@defra/interactive-map 0.0.55-alpha → 0.0.56-alpha

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 (394) hide show
  1. package/assets/templates/style-switcher.njk +2 -2
  2. package/dist/esm/im-core.js +1 -1
  3. package/dist/esm/im-shell.js +1 -1
  4. package/dist/umd/im-core.js +1 -1
  5. package/dist/umd/index.js +1 -1
  6. package/docs/api/context.md +2 -0
  7. package/docs/api.md +17 -1
  8. package/docs/architecture/interactive-map.likec4 +4 -4
  9. package/docs/plugins/datasets.md +11 -0
  10. package/docs/plugins/draw.md +8 -2
  11. package/docs/plugins/interact.md +24 -1
  12. package/docs/plugins/search.md +2 -2
  13. package/docusaurus.config.cjs +25 -3
  14. package/govuk-prototype-kit.config.json +6 -7
  15. package/package.json +20 -23
  16. package/plugins/datasets/dist/esm/im-datasets-esri-adapter.js +1 -1
  17. package/plugins/datasets/dist/esm/im-datasets-ml-adapter.js +1 -1
  18. package/plugins/datasets/dist/esm/im-datasets-ol-adapter.js +1 -1
  19. package/plugins/datasets/dist/esm/im-datasets-plugin.js +1 -1
  20. package/plugins/datasets/dist/esm/index.js +1 -1
  21. package/plugins/datasets/dist/esm/mapboxStyleLayerAdapter.js +1 -1
  22. package/plugins/datasets/dist/umd/im-datasets-ml-adapter.js +1 -1
  23. package/plugins/datasets/dist/umd/im-datasets-ol-adapter.js +1 -1
  24. package/plugins/datasets/dist/umd/im-datasets-plugin.js +1 -1
  25. package/plugins/datasets/dist/umd/index.js +1 -1
  26. package/plugins/datasets/src/adapters/esri/esriLayerAdapter.js +18 -16
  27. package/plugins/datasets/src/adapters/esri/esriLayerAdapter.test.js +2 -2
  28. package/plugins/datasets/src/adapters/esri/registry/esriDataset.js +2 -3
  29. package/plugins/datasets/src/adapters/esri/registry/esriDataset.test.js +1 -1
  30. package/plugins/datasets/src/adapters/loadLayerAdapter.js +2 -20
  31. package/plugins/datasets/src/adapters/loadLayerAdapter.test.js +9 -9
  32. package/plugins/datasets/src/adapters/mapboxStyleLayerAdapter.js +7 -7
  33. package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.js +19 -19
  34. package/plugins/datasets/src/adapters/maplibre/maplibreLayerAdapter.test.js +1 -1
  35. package/plugins/datasets/src/adapters/maplibre/registry/mapLibreDataset.test.js +1 -1
  36. package/plugins/datasets/src/adapters/openlayers/canvasPatternStyle.test.js +2 -2
  37. package/plugins/datasets/src/adapters/openlayers/layerBuilders.test.js +1 -1
  38. package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.js +21 -21
  39. package/plugins/datasets/src/adapters/openlayers/openlayersLayerAdapter.test.js +5 -5
  40. package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.js +2 -3
  41. package/plugins/datasets/src/adapters/openlayers/registry/openLayersDataset.test.js +2 -2
  42. package/plugins/datasets/src/api/getOpacity.js +1 -2
  43. package/plugins/datasets/src/api/getOpacity.test.js +9 -12
  44. package/plugins/datasets/src/api/getStyle.js +1 -2
  45. package/plugins/datasets/src/api/getStyle.test.js +5 -8
  46. package/plugins/datasets/src/api/removeDataset.js +2 -4
  47. package/plugins/datasets/src/api/removeDataset.test.js +5 -10
  48. package/plugins/datasets/src/api/setData.js +2 -4
  49. package/plugins/datasets/src/api/setData.test.js +6 -14
  50. package/plugins/datasets/src/api/setFeatureVisibility.js +1 -2
  51. package/plugins/datasets/src/api/setFeatureVisibility.test.js +8 -11
  52. package/plugins/datasets/src/components/LayersMenu/LayersMenu.jsx +1 -0
  53. package/plugins/datasets/src/components/LayersMenu/LayersMenuCheckbox.jsx +1 -3
  54. package/plugins/datasets/src/components/LayersMenu/LayersMenuCheckbox.test.jsx +13 -18
  55. package/plugins/datasets/src/index.js +2 -2
  56. package/plugins/datasets/src/index.test.js +8 -1
  57. package/plugins/datasets/src/initialise/DatasetsInit.jsx +48 -26
  58. package/plugins/datasets/src/initialise/DatasetsInit.test.jsx +160 -89
  59. package/plugins/datasets/src/initialise/initialiseDatasets.js +2 -3
  60. package/plugins/datasets/src/initialise/initialiseDatasets.test.js +23 -10
  61. package/plugins/datasets/src/manifest.js +53 -44
  62. package/plugins/datasets/src/manifest.test.js +36 -4
  63. package/plugins/datasets/src/reducers/pluginState.js +5 -5
  64. package/plugins/datasets/src/reducers/pluginState.test.js +21 -20
  65. package/plugins/datasets/src/registry/__mocks__/datasetRegistry.js +7 -6
  66. package/plugins/datasets/src/registry/createDataset.js +2 -2
  67. package/plugins/datasets/src/registry/dataset.js +9 -10
  68. package/plugins/datasets/src/registry/dataset.test.js +63 -64
  69. package/plugins/datasets/src/registry/datasetRegistry.js +39 -10
  70. package/plugins/datasets/src/registry/datasetRegistry.test.js +83 -1
  71. package/plugins/datasets/src/registry/globalDataset.js +9 -17
  72. package/plugins/datasets/src/registry/isVisibleWhen.js +9 -17
  73. package/plugins/datasets/src/registry/isVisibleWhen.test.js +27 -20
  74. package/plugins/datasets/src/registry/mapboxStyleDataset.test.js +26 -27
  75. package/plugins/datasets/src/utils/hasLayersMenu.js +13 -0
  76. package/plugins/datasets/src/utils/hasLayersMenu.test.js +25 -0
  77. package/plugins/draw/dist/esm/im-draw-plugin.js +1 -1
  78. package/plugins/draw/dist/esm/index.js +1 -1
  79. package/plugins/draw/dist/umd/im-draw-plugin.js +1 -1
  80. package/plugins/draw/dist/umd/index.js +1 -1
  81. package/plugins/draw/src/DrawInit.jsx +47 -26
  82. package/plugins/draw/src/DrawInit.test.jsx +90 -2
  83. package/plugins/draw/src/adapters/openlayers/core/styles.test.js +1 -1
  84. package/plugins/draw/src/adapters/openlayers/point/pointSymbolImages.test.js +1 -1
  85. package/plugins/draw/src/manifest.js +3 -2
  86. package/plugins/draw/src/manifest.test.js +13 -1
  87. package/plugins/draw/src/utils/needsDrawTarget.js +22 -0
  88. package/plugins/draw/src/utils/needsDrawTarget.test.js +42 -0
  89. package/plugins/draw-es/dist/esm/index.js +1 -0
  90. package/plugins/{beta/draw-es → draw-es}/src/DrawInit.jsx +1 -1
  91. package/plugins/{beta/draw-es → draw-es}/src/events.test.js +1 -1
  92. package/plugins/{beta/draw-es → draw-es}/src/graphic.js +1 -1
  93. package/plugins/frame/dist/esm/index.js +1 -0
  94. package/plugins/{beta/frame → frame}/dist/umd/im-frame-plugin.js +1 -1
  95. package/plugins/{beta/frame → frame}/dist/umd/index.js +1 -1
  96. package/plugins/{beta/frame → frame}/package.json +2 -2
  97. package/plugins/interact/dist/esm/im-interact-plugin.js +1 -1
  98. package/plugins/interact/dist/esm/index.js +1 -1
  99. package/plugins/interact/dist/umd/im-interact-plugin.js +1 -1
  100. package/plugins/interact/dist/umd/index.js +1 -1
  101. package/plugins/interact/src/InteractInit.jsx +3 -3
  102. package/plugins/interact/src/api/enable.test.js +13 -0
  103. package/plugins/interact/src/defaults.js +1 -0
  104. package/plugins/interact/src/hooks/useCrossHairVisibility.js +27 -17
  105. package/plugins/interact/src/hooks/useCrossHairVisibility.test.js +72 -7
  106. package/plugins/interact/src/manifest.js +4 -4
  107. package/plugins/interact/src/manifest.test.js +29 -0
  108. package/plugins/interact/src/reducer.js +7 -2
  109. package/plugins/interact/src/reducer.test.js +12 -2
  110. package/plugins/interact/src/utils/needsTarget.js +20 -0
  111. package/plugins/interact/src/utils/needsTarget.test.js +36 -0
  112. package/plugins/map-key/dist/esm/im-map-key-plugin.js +1 -1
  113. package/plugins/map-key/dist/esm/index.js +1 -1
  114. package/plugins/map-key/dist/umd/im-map-key-plugin.js +1 -1
  115. package/plugins/map-key/dist/umd/index.js +1 -1
  116. package/plugins/map-key/src/components/Key/KeySvgSymbol.jsx +4 -0
  117. package/plugins/map-key/src/components/Key/MapKey.jsx +15 -15
  118. package/plugins/map-key/src/components/Key/MapKey.test.jsx +29 -15
  119. package/plugins/map-key/src/initialise/MapKeyInit.jsx +5 -8
  120. package/plugins/map-key/src/initialise/MapKeyInit.test.jsx +9 -7
  121. package/plugins/map-key/src/manifest.test.js +0 -1
  122. package/plugins/map-key/src/reducers/mergeKeyGroupItems.js +14 -33
  123. package/plugins/map-key/src/reducers/mergeKeyGroupItems.test.js +34 -50
  124. package/plugins/map-key/src/reducers/pluginState.js +6 -1
  125. package/plugins/map-key/src/reducers/pluginState.test.js +13 -4
  126. package/plugins/map-styles/dist/esm/index.js +1 -0
  127. package/plugins/{beta/map-styles → map-styles}/dist/umd/im-map-styles-plugin.js +1 -1
  128. package/plugins/{beta/map-styles → map-styles}/dist/umd/index.js +1 -1
  129. package/plugins/{beta/map-styles → map-styles}/src/MapStyles.jsx +2 -2
  130. package/plugins/{beta/map-styles → map-styles}/src/MapStylesInit.jsx +1 -1
  131. package/plugins/menu/dist/esm/index.js +1 -1
  132. package/plugins/scale-bar/dist/esm/index.js +1 -0
  133. package/plugins/{beta/scale-bar → scale-bar}/dist/umd/im-scale-bar-plugin.js +1 -1
  134. package/plugins/{beta/scale-bar → scale-bar}/dist/umd/index.js +1 -1
  135. package/plugins/{beta/scale-bar → scale-bar}/package.json +2 -2
  136. package/plugins/search/dist/esm/im-search-plugin.js +1 -1
  137. package/plugins/search/dist/esm/index.js +1 -1
  138. package/plugins/search/dist/umd/im-search-plugin.js +1 -1
  139. package/plugins/search/dist/umd/index.js +1 -1
  140. package/plugins/search/src/components/Suggestions/Suggestions.jsx +3 -1
  141. package/plugins/search/src/components/Suggestions/Suggestions.test.jsx +11 -0
  142. package/plugins/search/src/utils/markedToElements.jsx +25 -0
  143. package/plugins/search/src/utils/markedToElements.test.jsx +49 -0
  144. package/plugins/search/src/utils/parseOsNamesResults.js +6 -4
  145. package/plugins/search/src/utils/parseOsNamesResults.test.js +18 -0
  146. package/plugins/use-location/dist/esm/index.js +1 -0
  147. package/plugins/{beta/use-location → use-location}/dist/umd/im-use-location-plugin.js +1 -1
  148. package/plugins/{beta/use-location → use-location}/dist/umd/index.js +1 -1
  149. package/providers/esri/dist/esm/index.js +1 -0
  150. package/providers/{beta/esri → esri}/src/esriProvider.js +1 -1
  151. package/providers/{beta/esri → esri}/src/mapEvents.js +2 -2
  152. package/providers/maplibre/dist/esm/index.js +1 -1
  153. package/providers/open-names/dist/esm/index.js +1 -0
  154. package/providers/{beta/open-names → open-names}/dist/umd/im-reverse-geocode.js +1 -1
  155. package/providers/{beta/open-names → open-names}/dist/umd/index.js +1 -1
  156. package/providers/openlayers/dist/esm/index.js +1 -0
  157. package/providers/openlayers/dist/umd/im-openlayers-provider.js +2 -0
  158. package/providers/{beta/openlayers → openlayers}/dist/umd/index.js +1 -1
  159. package/providers/{beta/openlayers → openlayers}/src/index.js +4 -4
  160. package/providers/{beta/openlayers → openlayers}/src/mapEvents.js +2 -2
  161. package/providers/{beta/openlayers → openlayers}/src/mapEvents.test.js +2 -2
  162. package/providers/{beta/openlayers → openlayers}/src/openlayersProvider.js +3 -3
  163. package/providers/{beta/openlayers → openlayers}/src/utils/highlightFeatures.js +1 -1
  164. package/providers/{beta/openlayers → openlayers}/src/utils/patternImages.js +1 -1
  165. package/providers/{beta/openlayers → openlayers}/src/utils/symbolImages.js +1 -1
  166. package/rollup.esm.mjs +43 -47
  167. package/sonar-project.properties +1 -1
  168. package/src/App/App.jsx +4 -1
  169. package/src/App/App.test.jsx +6 -0
  170. package/src/App/renderer/PluginInits.jsx +8 -7
  171. package/src/App/renderer/PluginInits.test.jsx +20 -5
  172. package/src/App/renderer/SlotItemsProvider.jsx +33 -0
  173. package/src/App/renderer/SlotItemsProvider.test.jsx +59 -0
  174. package/src/App/renderer/SlotRenderer.jsx +3 -14
  175. package/src/App/renderer/SlotRenderer.test.jsx +11 -44
  176. package/src/App/renderer/mapButtons.js +22 -11
  177. package/src/App/renderer/mapButtons.test.js +23 -1
  178. package/src/App/renderer/mapControls.js +6 -8
  179. package/src/App/renderer/mapControls.test.js +10 -0
  180. package/src/App/renderer/mapPanels.js +16 -19
  181. package/src/App/renderer/mapPanels.test.js +37 -9
  182. package/src/App/renderer/pluginWrapper.js +10 -8
  183. package/src/App/renderer/pluginWrapper.test.js +23 -9
  184. package/src/App/renderer/slotAggregator.js +18 -5
  185. package/src/App/renderer/slotAggregator.test.js +68 -25
  186. package/src/App/renderer/slotHelpers.js +13 -0
  187. package/src/App/renderer/slotHelpers.test.js +16 -1
  188. package/src/App/store/AppProvider.jsx +19 -1
  189. package/src/App/store/AppProvider.test.jsx +41 -0
  190. package/src/App/store/appActionsMap.js +10 -1
  191. package/src/App/store/appActionsMap.test.js +21 -0
  192. package/src/App/store/appDispatchMiddleware.js +29 -17
  193. package/src/App/store/appDispatchMiddleware.test.js +31 -0
  194. package/src/InteractiveMap/parseDataProperties.js +4 -4
  195. package/src/InteractiveMap/parseDataProperties.test.js +62 -6
  196. package/src/config/events.js +4 -2
  197. package/src/scss/tools/_govuk-content.scss +4 -3
  198. package/webpack.dev.mjs +9 -3
  199. package/webpack.prod.mjs +11 -4
  200. package/webpack.umd.mjs +6 -7
  201. package/plugins/beta/draw-es/dist/esm/index.js +0 -1
  202. package/plugins/beta/draw-ml/dist/esm/im-draw-ml-plugin.js +0 -1
  203. package/plugins/beta/draw-ml/dist/esm/index.js +0 -1
  204. package/plugins/beta/draw-ml/dist/umd/im-draw-ml-plugin.js +0 -1
  205. package/plugins/beta/draw-ml/dist/umd/index.js +0 -2
  206. package/plugins/beta/draw-ml/src/DrawInit.jsx +0 -85
  207. package/plugins/beta/draw-ml/src/api/addFeature.js +0 -27
  208. package/plugins/beta/draw-ml/src/api/deleteFeature.js +0 -13
  209. package/plugins/beta/draw-ml/src/api/editFeature.js +0 -75
  210. package/plugins/beta/draw-ml/src/api/merge.js +0 -9
  211. package/plugins/beta/draw-ml/src/api/newLine.js +0 -68
  212. package/plugins/beta/draw-ml/src/api/newPolygon.js +0 -68
  213. package/plugins/beta/draw-ml/src/api/split.js +0 -81
  214. package/plugins/beta/draw-ml/src/defaults.js +0 -17
  215. package/plugins/beta/draw-ml/src/draw.scss +0 -26
  216. package/plugins/beta/draw-ml/src/events.js +0 -185
  217. package/plugins/beta/draw-ml/src/index.js +0 -13
  218. package/plugins/beta/draw-ml/src/manifest.js +0 -110
  219. package/plugins/beta/draw-ml/src/mapboxDraw.js +0 -143
  220. package/plugins/beta/draw-ml/src/mapboxSnap.js +0 -321
  221. package/plugins/beta/draw-ml/src/modes/createDrawMode.js +0 -552
  222. package/plugins/beta/draw-ml/src/modes/disabledMode.js +0 -23
  223. package/plugins/beta/draw-ml/src/modes/drawLineMode.js +0 -18
  224. package/plugins/beta/draw-ml/src/modes/drawPolygonMode.js +0 -16
  225. package/plugins/beta/draw-ml/src/modes/editVertex/geometryHelpers.js +0 -135
  226. package/plugins/beta/draw-ml/src/modes/editVertex/helpers.js +0 -2
  227. package/plugins/beta/draw-ml/src/modes/editVertex/touchHandlers.js +0 -142
  228. package/plugins/beta/draw-ml/src/modes/editVertex/undoHandlers.js +0 -133
  229. package/plugins/beta/draw-ml/src/modes/editVertex/vertexOperations.js +0 -142
  230. package/plugins/beta/draw-ml/src/modes/editVertex/vertexQueries.js +0 -121
  231. package/plugins/beta/draw-ml/src/modes/editVertexMode.js +0 -495
  232. package/plugins/beta/draw-ml/src/reducer.js +0 -90
  233. package/plugins/beta/draw-ml/src/styles.js +0 -190
  234. package/plugins/beta/draw-ml/src/undoStack.js +0 -50
  235. package/plugins/beta/draw-ml/src/utils/debounce.js +0 -16
  236. package/plugins/beta/draw-ml/src/utils/flattenStyleProperties.js +0 -49
  237. package/plugins/beta/draw-ml/src/utils/snapHelpers.js +0 -200
  238. package/plugins/beta/draw-ml/src/utils/spatial.js +0 -258
  239. package/plugins/beta/draw-ol/dist/css/index.css +0 -1
  240. package/plugins/beta/draw-ol/dist/esm/DrawMode.js +0 -1
  241. package/plugins/beta/draw-ol/dist/esm/EditMode.js +0 -1
  242. package/plugins/beta/draw-ol/dist/esm/geometryHelpers.js +0 -1
  243. package/plugins/beta/draw-ol/dist/esm/im-draw-ol-plugin.js +0 -1
  244. package/plugins/beta/draw-ol/dist/esm/index.js +0 -1
  245. package/plugins/beta/draw-ol/src/DrawInit.jsx +0 -65
  246. package/plugins/beta/draw-ol/src/api/addFeature.js +0 -29
  247. package/plugins/beta/draw-ol/src/api/deleteFeature.js +0 -11
  248. package/plugins/beta/draw-ol/src/api/editFeature.js +0 -50
  249. package/plugins/beta/draw-ol/src/api/newLine.js +0 -44
  250. package/plugins/beta/draw-ol/src/api/newPolygon.js +0 -44
  251. package/plugins/beta/draw-ol/src/core/OLDrawManager.js +0 -153
  252. package/plugins/beta/draw-ol/src/core/featureStore.js +0 -65
  253. package/plugins/beta/draw-ol/src/core/styles.js +0 -98
  254. package/plugins/beta/draw-ol/src/core/undoStack.js +0 -31
  255. package/plugins/beta/draw-ol/src/defaults.js +0 -16
  256. package/plugins/beta/draw-ol/src/draw/DrawMode.js +0 -121
  257. package/plugins/beta/draw-ol/src/draw/drawInput.js +0 -243
  258. package/plugins/beta/draw-ol/src/draw.scss +0 -17
  259. package/plugins/beta/draw-ol/src/edit/EditMode.js +0 -424
  260. package/plugins/beta/draw-ol/src/edit/keyboardHandler.js +0 -229
  261. package/plugins/beta/draw-ol/src/edit/midpointLayer.js +0 -57
  262. package/plugins/beta/draw-ol/src/edit/touchHandler.js +0 -171
  263. package/plugins/beta/draw-ol/src/edit/undoOps.js +0 -95
  264. package/plugins/beta/draw-ol/src/edit/vertexHitTest.js +0 -72
  265. package/plugins/beta/draw-ol/src/edit/vertexLayer.js +0 -49
  266. package/plugins/beta/draw-ol/src/edit/vertexOps.js +0 -99
  267. package/plugins/beta/draw-ol/src/events.js +0 -114
  268. package/plugins/beta/draw-ol/src/index.js +0 -12
  269. package/plugins/beta/draw-ol/src/manifest.js +0 -125
  270. package/plugins/beta/draw-ol/src/olDraw.js +0 -38
  271. package/plugins/beta/draw-ol/src/reducer.js +0 -41
  272. package/plugins/beta/draw-ol/src/snap/snapEngine.js +0 -153
  273. package/plugins/beta/draw-ol/src/snap/snapGeometry.js +0 -177
  274. package/plugins/beta/draw-ol/src/snap/snapIndicator.js +0 -81
  275. package/plugins/beta/draw-ol/src/snap/snapInteraction.js +0 -57
  276. package/plugins/beta/draw-ol/src/snap/snapManager.js +0 -99
  277. package/plugins/beta/draw-ol/src/utils/flattenStyleProperties.js +0 -47
  278. package/plugins/beta/draw-ol/src/utils/geometryHelpers.js +0 -103
  279. package/plugins/beta/draw-ol/src/utils/olCoords.js +0 -35
  280. package/plugins/beta/draw-ol/src/utils/resolveColors.js +0 -39
  281. package/plugins/beta/draw-ol/src/utils/spatial.js +0 -24
  282. package/plugins/beta/draw-ol/src/utils/touchTarget.js +0 -61
  283. package/plugins/beta/frame/dist/esm/index.js +0 -1
  284. package/plugins/beta/map-styles/dist/esm/index.js +0 -1
  285. package/plugins/beta/scale-bar/dist/esm/index.js +0 -1
  286. package/plugins/beta/use-location/dist/esm/index.js +0 -1
  287. package/plugins/map-key/src/registry/getDatasetRegistry.js +0 -6
  288. package/plugins/map-key/src/registry/getDatasetRegistry.test.js +0 -23
  289. package/plugins/map-key/src/registry/index.js +0 -1
  290. package/plugins/map-key/src/registry/index.test.js +0 -7
  291. package/providers/beta/esri/dist/esm/index.js +0 -1
  292. package/providers/beta/open-names/dist/esm/index.js +0 -1
  293. package/providers/beta/openlayers/dist/esm/index.js +0 -1
  294. package/providers/beta/openlayers/dist/umd/im-openlayers-provider.js +0 -2
  295. package/providers/beta/openlayers/dist/umd/index.js.LICENSE.txt +0 -1
  296. /package/plugins/{beta/draw-es → draw-es}/dist/esm/im-draw-es-plugin.js +0 -0
  297. /package/plugins/{beta/draw-es → draw-es}/src/api/addFeature.js +0 -0
  298. /package/plugins/{beta/draw-es → draw-es}/src/api/deleteFeature.js +0 -0
  299. /package/plugins/{beta/draw-es → draw-es}/src/api/editFeature.js +0 -0
  300. /package/plugins/{beta/draw-es → draw-es}/src/api/newPolygon.js +0 -0
  301. /package/plugins/{beta/draw-es → draw-es}/src/api/removeSafeZone.js +0 -0
  302. /package/plugins/{beta/draw-es → draw-es}/src/events.js +0 -0
  303. /package/plugins/{beta/draw-es → draw-es}/src/index.js +0 -0
  304. /package/plugins/{beta/draw-es → draw-es}/src/manifest.js +0 -0
  305. /package/plugins/{beta/draw-es → draw-es}/src/reducer.js +0 -0
  306. /package/plugins/{beta/draw-es → draw-es}/src/sketchViewModel.js +0 -0
  307. /package/plugins/{beta/frame → frame}/dist/css/index.css +0 -0
  308. /package/plugins/{beta/frame → frame}/dist/esm/im-frame-plugin.js +0 -0
  309. /package/plugins/{beta/draw-ml → frame}/dist/umd/index.js.LICENSE.txt +0 -0
  310. /package/plugins/{beta/frame → frame}/src/Frame.jsx +0 -0
  311. /package/plugins/{beta/frame → frame}/src/FrameInit.jsx +0 -0
  312. /package/plugins/{beta/frame → frame}/src/api/addFrame.js +0 -0
  313. /package/plugins/{beta/frame → frame}/src/api/editFeature.js +0 -0
  314. /package/plugins/{beta/frame → frame}/src/config.js +0 -0
  315. /package/plugins/{beta/frame → frame}/src/frame.scss +0 -0
  316. /package/plugins/{beta/frame → frame}/src/index.js +0 -0
  317. /package/plugins/{beta/frame → frame}/src/manifest.js +0 -0
  318. /package/plugins/{beta/frame → frame}/src/reducer.js +0 -0
  319. /package/plugins/{beta/frame → frame}/src/utils.js +0 -0
  320. /package/plugins/{beta/map-styles → map-styles}/dist/css/index.css +0 -0
  321. /package/plugins/{beta/map-styles → map-styles}/dist/esm/im-map-styles-plugin.js +0 -0
  322. /package/plugins/{beta/frame → map-styles}/dist/umd/index.js.LICENSE.txt +0 -0
  323. /package/plugins/{beta/map-styles → map-styles}/src/config.js +0 -0
  324. /package/plugins/{beta/map-styles → map-styles}/src/index.js +0 -0
  325. /package/plugins/{beta/map-styles → map-styles}/src/manifest.js +0 -0
  326. /package/plugins/{beta/map-styles → map-styles}/src/mapStyles.scss +0 -0
  327. /package/plugins/{beta/scale-bar → scale-bar}/dist/css/index.css +0 -0
  328. /package/plugins/{beta/scale-bar → scale-bar}/dist/esm/im-scale-bar-plugin.js +0 -0
  329. /package/plugins/{beta/map-styles → scale-bar}/dist/umd/index.js.LICENSE.txt +0 -0
  330. /package/plugins/{beta/scale-bar → scale-bar}/src/ScaleBar.jsx +0 -0
  331. /package/plugins/{beta/scale-bar → scale-bar}/src/ScaleBar.test.jsx +0 -0
  332. /package/plugins/{beta/scale-bar → scale-bar}/src/index.js +0 -0
  333. /package/plugins/{beta/scale-bar → scale-bar}/src/index.test.js +0 -0
  334. /package/plugins/{beta/scale-bar → scale-bar}/src/manifest.js +0 -0
  335. /package/plugins/{beta/scale-bar → scale-bar}/src/scaleBar.scss +0 -0
  336. /package/plugins/{beta/scale-bar → scale-bar}/src/utils.js +0 -0
  337. /package/plugins/{beta/scale-bar → scale-bar}/src/utils.test.js +0 -0
  338. /package/plugins/{beta/use-location → use-location}/dist/esm/im-use-location-plugin.js +0 -0
  339. /package/plugins/{beta/scale-bar → use-location}/dist/umd/index.js.LICENSE.txt +0 -0
  340. /package/plugins/{beta/use-location → use-location}/src/UseLocation.jsx +0 -0
  341. /package/plugins/{beta/use-location → use-location}/src/UseLocationInit.jsx +0 -0
  342. /package/plugins/{beta/use-location → use-location}/src/defaults.js +0 -0
  343. /package/plugins/{beta/use-location → use-location}/src/events.js +0 -0
  344. /package/plugins/{beta/use-location → use-location}/src/index.js +0 -0
  345. /package/plugins/{beta/use-location → use-location}/src/manifest.js +0 -0
  346. /package/plugins/{beta/use-location → use-location}/src/reducer.js +0 -0
  347. /package/providers/{beta/esri → esri}/dist/css/index.css +0 -0
  348. /package/providers/{beta/esri → esri}/dist/esm/im-esri-provider.js +0 -0
  349. /package/providers/{beta/esri → esri}/src/appEvents.js +0 -0
  350. /package/providers/{beta/esri → esri}/src/defaults.js +0 -0
  351. /package/providers/{beta/esri → esri}/src/esriProvider.scss +0 -0
  352. /package/providers/{beta/esri → esri}/src/index.js +0 -0
  353. /package/providers/{beta/esri → esri}/src/utils/coords.js +0 -0
  354. /package/providers/{beta/esri → esri}/src/utils/coords.test.js +0 -0
  355. /package/providers/{beta/esri → esri}/src/utils/detectWebGL.js +0 -0
  356. /package/providers/{beta/esri → esri}/src/utils/esriFixes.js +0 -0
  357. /package/providers/{beta/esri → esri}/src/utils/query.js +0 -0
  358. /package/providers/{beta/esri → esri}/src/utils/spatial.js +0 -0
  359. /package/providers/{beta/esri → esri}/src/utils/spatial.test.js +0 -0
  360. /package/providers/{beta/open-names → open-names}/dist/esm/im-reverse-geocode.js +0 -0
  361. /package/providers/{beta/open-names → open-names}/dist/umd/im-reverse-geocode.js.LICENSE.txt +0 -0
  362. /package/{plugins/beta/use-location → providers/open-names}/dist/umd/index.js.LICENSE.txt +0 -0
  363. /package/providers/{beta/open-names → open-names}/src/index.js +0 -0
  364. /package/providers/{beta/open-names → open-names}/src/reverseGeocode.js +0 -0
  365. /package/providers/{beta/open-names → open-names}/src/utils/mapToLocationModel.js +0 -0
  366. /package/providers/{beta/open-names → open-names}/src/utils/mapToLocationModel.test.js +0 -0
  367. /package/providers/{beta/openlayers → openlayers}/dist/esm/im-openlayers-provider.js +0 -0
  368. /package/providers/{beta/openlayers → openlayers}/dist/umd/im-openlayers-provider.js.LICENSE.txt +0 -0
  369. /package/providers/{beta/open-names → openlayers}/dist/umd/index.js.LICENSE.txt +0 -0
  370. /package/providers/{beta/openlayers → openlayers}/src/appEvents.js +0 -0
  371. /package/providers/{beta/openlayers → openlayers}/src/appEvents.test.js +0 -0
  372. /package/providers/{beta/openlayers → openlayers}/src/defaults.js +0 -0
  373. /package/providers/{beta/openlayers → openlayers}/src/index.test.js +0 -0
  374. /package/providers/{beta/openlayers → openlayers}/src/openlayersProvider.test.js +0 -0
  375. /package/providers/{beta/openlayers → openlayers}/src/utils/bngProjection.js +0 -0
  376. /package/providers/{beta/openlayers → openlayers}/src/utils/filterEvaluator.js +0 -0
  377. /package/providers/{beta/openlayers → openlayers}/src/utils/filterEvaluator.test.js +0 -0
  378. /package/providers/{beta/openlayers → openlayers}/src/utils/highlightFeatures.test.js +0 -0
  379. /package/providers/{beta/openlayers → openlayers}/src/utils/hoverCursor.js +0 -0
  380. /package/providers/{beta/openlayers → openlayers}/src/utils/hoverCursor.test.js +0 -0
  381. /package/providers/{beta/openlayers → openlayers}/src/utils/openLayersFixes.js +0 -0
  382. /package/providers/{beta/openlayers → openlayers}/src/utils/openLayersFixes.test.js +0 -0
  383. /package/providers/{beta/openlayers → openlayers}/src/utils/patternImages.test.js +0 -0
  384. /package/providers/{beta/openlayers → openlayers}/src/utils/queryFeatures.js +0 -0
  385. /package/providers/{beta/openlayers → openlayers}/src/utils/queryFeatures.test.js +0 -0
  386. /package/providers/{beta/openlayers → openlayers}/src/utils/spatial.js +0 -0
  387. /package/providers/{beta/openlayers → openlayers}/src/utils/spatial.test.js +0 -0
  388. /package/providers/{beta/openlayers → openlayers}/src/utils/symbolImages.test.js +0 -0
  389. /package/providers/{beta/openlayers → openlayers}/src/utils/tileLayers.js +0 -0
  390. /package/providers/{beta/openlayers → openlayers}/src/utils/tileLayers.test.js +0 -0
  391. /package/providers/{beta/openlayers → openlayers}/src/utils/vtTileFragments.js +0 -0
  392. /package/providers/{beta/openlayers → openlayers}/src/utils/vtTileFragments.test.js +0 -0
  393. /package/providers/{beta/openlayers → openlayers}/src/utils/zoom.js +0 -0
  394. /package/providers/{beta/openlayers → openlayers}/src/utils/zoom.test.js +0 -0
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.mapKeyPlugin=t())}(Object("undefined"!=typeof self?self:this),function(){return function(){"use strict";var e,t,r={738:function(e){e.exports=preactCompat},287:function(e){e.exports=preactJsxRuntime}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce(function(t,r){return o.f[r](e,t),t},[]))},o.u=function(e){return"im-map-key-plugin.js"},o.miniCssF=function(e){},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="defra.mapKeyPlugin:",o.l=function(r,n,i,u){if(e[r])e[r].push(n);else{var c,a;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){c=l;break}}c||(a=!0,(c=document.createElement("script")).charset="utf-8",o.nc&&c.setAttribute("nonce",o.nc),c.setAttribute("data-webpack",t+i),c.src=r),e[r]=[n];var s=function(t,n){c.onerror=c.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach(function(e){return e(n)}),t)return t(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=s.bind(null,c.onerror),c.onload=s.bind(null,c.onload),a&&document.head.appendChild(c)}},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e}(),function(){var e={57:0};o.f.j=function(t,r){var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(function(r,o){n=e[t]=[r,o]});r.push(n[2]=i);var u=o.p+o.u(t),c=new Error;o.l(u,function(r){if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+i+": "+u+")",c.name="ChunkLoadError",c.type=i,c.request=u,n[1](c)}},"chunk-"+t,t)}};var t=function(t,r){var n,i,u=r[0],c=r[1],a=r[2],f=0;if(u.some(function(t){return 0!==e[t]})){for(n in c)o.o(c,n)&&(o.m[n]=c[n]);a&&a(o)}for(t&&t(r);f<u.length;f++)i=u[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var i={};function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof f?n:f,p=Object.create(c.prototype);return a(p,"_invoke",function(r,n,o){var i,c,a,f=0,p=o||[],l=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,a=e,s.n=r,u}};function d(r,n){for(c=r,a=n,t=0;!l&&f&&!o&&t<p.length;t++){var o,i=p[t],d=s.p,b=i[2];r>3?(o=b===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,s.v=n,s.n=i[1]):d<b&&(o=r<3||i[0]>n||n>b)&&(i[4]=r,i[5]=n,s.n=b,c=0))}if(o||r>1)return u;throw l=!0,n}return function(o,p,b){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,b),c=p,a=b;(t=c<2?e:a)||!l;){i||(c?c<3?(c>1&&(s.n=-1),d(c,a)):s.n=a:s.v=a);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(l=s.n<0)?a:r.call(n,s))!==u)break}catch(t){i=e,c=1,a=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),p}var u={};function f(){}function p(){}function l(){}t=Object.getPrototypeOf;var s=[][n]?t(t([][n]())):(a(t={},n,function(){return this}),t),d=l.prototype=f.prototype=Object.create(s);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,a(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return p.prototype=l,a(d,"constructor",l),a(l,"constructor",p),p.displayName="GeneratorFunction",a(l,o,"GeneratorFunction"),a(d),a(d,o,"Generator"),a(d,n,function(){return this}),a(d,"toString",function(){return"[object Generator]"}),(c=function(){return{w:i,m:b}})()}function a(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}a=function(e,t,r,n){function i(t,r){a(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},a(e,t,r,n)}function f(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void r(e)}c.done?t(a):Promise.resolve(a).then(n,o)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=function(e){var t=function(e){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(){var e,t;return l(l({noKeyItemText:"No features displayed"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"mapKey",load:(e=c().m(function e(){var t;return c().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(414).then(o.bind(o,718));case 1:return t=e.v.manifest,e.a(2,t)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){f(i,n,o,u,c,"next",e)}function c(e){f(i,n,o,u,c,"throw",e)}u(void 0)})},function(){return t.apply(this,arguments)})})}return o.d(i,{default:function(){return d}}),i.default}()});
2
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("defra",[],t):"object"==typeof exports?exports.defra=t():(e.defra=e.defra||{},e.defra.mapKeyPlugin=t())}(Object("undefined"!=typeof self?self:this),function(){return function(){"use strict";var e,t,r={738:function(e){e.exports=preactCompat},287:function(e){e.exports=preactJsxRuntime}},n={};function o(e){var t=n[e];if(void 0!==t)return t.exports;var i=n[e]={exports:{}};return r[e](i,i.exports,o),i.exports}o.m=r,o.d=function(e,t){for(var r in t)o.o(t,r)&&!o.o(e,r)&&Object.defineProperty(e,r,{enumerable:!0,get:t[r]})},o.f={},o.e=function(e){return Promise.all(Object.keys(o.f).reduce(function(t,r){return o.f[r](e,t),t},[]))},o.u=function(e){return"im-map-key-plugin.js"},o.miniCssF=function(e){},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(e){if("object"==typeof window)return window}}(),o.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},e={},t="defra.mapKeyPlugin:",o.l=function(r,n,i,u){if(e[r])e[r].push(n);else{var c,a;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==t+i){c=l;break}}c||(a=!0,(c=document.createElement("script")).charset="utf-8",o.nc&&c.setAttribute("nonce",o.nc),c.setAttribute("data-webpack",t+i),c.src=r),e[r]=[n];var s=function(t,n){c.onerror=c.onload=null,clearTimeout(d);var o=e[r];if(delete e[r],c.parentNode&&c.parentNode.removeChild(c),o&&o.forEach(function(e){return e(n)}),t)return t(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:c}),12e4);c.onerror=s.bind(null,c.onerror),c.onload=s.bind(null,c.onload),a&&document.head.appendChild(c)}},o.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},function(){var e;o.g.importScripts&&(e=o.g.location+"");var t=o.g.document;if(!e&&t&&(t.currentScript&&"SCRIPT"===t.currentScript.tagName.toUpperCase()&&(e=t.currentScript.src),!e)){var r=t.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!e||!/^http(s?):/.test(e));)e=r[n--].src}if(!e)throw new Error("Automatic publicPath is not supported in this browser");e=e.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=e}(),function(){var e={57:0};o.f.j=function(t,r){var n=o.o(e,t)?e[t]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(function(r,o){n=e[t]=[r,o]});r.push(n[2]=i);var u=o.p+o.u(t),c=new Error;o.l(u,function(r){if(o.o(e,t)&&(0!==(n=e[t])&&(e[t]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),u=r&&r.target&&r.target.src;c.message="Loading chunk "+t+" failed.\n("+i+": "+u+")",c.name="ChunkLoadError",c.type=i,c.request=u,n[1](c)}},"chunk-"+t,t)}};var t=function(t,r){var n,i,u=r[0],c=r[1],a=r[2],f=0;if(u.some(function(t){return 0!==e[t]})){for(n in c)o.o(c,n)&&(o.m[n]=c[n]);a&&a(o)}for(t&&t(r);f<u.length;f++)i=u[f],o.o(e,i)&&e[i]&&e[i][0](),e[i]=0},r=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[];r.forEach(t.bind(null,0)),r.push=t.bind(null,r.push.bind(r))}();var i={};function u(e){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},u(e)}function c(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var c=n&&n.prototype instanceof f?n:f,p=Object.create(c.prototype);return a(p,"_invoke",function(r,n,o){var i,c,a,f=0,p=o||[],l=!1,s={p:0,n:0,v:e,a:d,f:d.bind(e,4),d:function(t,r){return i=t,c=0,a=e,s.n=r,u}};function d(r,n){for(c=r,a=n,t=0;!l&&f&&!o&&t<p.length;t++){var o,i=p[t],d=s.p,b=i[2];r>3?(o=b===n)&&(a=i[(c=i[4])?5:(c=3,3)],i[4]=i[5]=e):i[0]<=d&&((o=r<2&&d<i[1])?(c=0,s.v=n,s.n=i[1]):d<b&&(o=r<3||i[0]>n||n>b)&&(i[4]=r,i[5]=n,s.n=b,c=0))}if(o||r>1)return u;throw l=!0,n}return function(o,p,b){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,b),c=p,a=b;(t=c<2?e:a)||!l;){i||(c?c<3?(c>1&&(s.n=-1),d(c,a)):s.n=a:s.v=a);try{if(f=2,i){if(c||(o="next"),t=i[o]){if(!(t=t.call(i,a)))throw TypeError("iterator result is not an object");if(!t.done)return t;a=t.value,c<2&&(c=0)}else 1===c&&(t=i.return)&&t.call(i),c<2&&(a=TypeError("The iterator does not provide a '"+o+"' method"),c=1);i=e}else if((t=(l=s.n<0)?a:r.call(n,s))!==u)break}catch(t){i=e,c=1,a=t}finally{f=1}}return{value:t,done:l}}}(r,o,i),!0),p}var u={};function f(){}function p(){}function l(){}t=Object.getPrototypeOf;var s=[][n]?t(t([][n]())):(a(t={},n,function(){return this}),t),d=l.prototype=f.prototype=Object.create(s);function b(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,l):(e.__proto__=l,a(e,o,"GeneratorFunction")),e.prototype=Object.create(d),e}return p.prototype=l,a(d,"constructor",l),a(l,"constructor",p),p.displayName="GeneratorFunction",a(l,o,"GeneratorFunction"),a(d),a(d,o,"Generator"),a(d,n,function(){return this}),a(d,"toString",function(){return"[object Generator]"}),(c=function(){return{w:i,m:b}})()}function a(e,t,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(e){o=0}a=function(e,t,r,n){function i(t,r){a(e,t,function(e){return this._invoke(t,r,e)})}t?o?o(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(i("next",0),i("throw",1),i("return",2))},a(e,t,r,n)}function f(e,t,r,n,o,i,u){try{var c=e[i](u),a=c.value}catch(e){return void r(e)}c.done?t(a):Promise.resolve(a).then(n,o)}function p(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function l(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?p(Object(r),!0).forEach(function(t){s(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):p(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function s(e,t,r){return(t=function(e){var t=function(e){if("object"!=u(e)||!e)return e;var t=e[Symbol.toPrimitive];if(void 0!==t){var r=t.call(e,"string");if("object"!=u(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(e)}(e);return"symbol"==u(t)?t:t+""}(t))in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function d(){var e,t;return l(l({noKeyItemText:"No features displayed"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"mapKey",load:(e=c().m(function e(){var t;return c().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,o.e(414).then(o.bind(o,883));case 1:return t=e.v.manifest,e.a(2,t)}},e)}),t=function(){var t=this,r=arguments;return new Promise(function(n,o){var i=e.apply(t,r);function u(e){f(i,n,o,u,c,"next",e)}function c(e){f(i,n,o,u,c,"throw",e)}u(void 0)})},function(){return t.apply(this,arguments)})})}return o.d(i,{default:function(){return d}}),i.default}()});
@@ -18,9 +18,13 @@ export const KeySvgSymbol = ({ keySymbol }) => {
18
18
  const drawnWidth = width * scale
19
19
  const drawnHeight = height * scale
20
20
 
21
+ // The symbol is decorative: the key item's text labels it. The outer svg is aria-hidden via
22
+ // svgSymbolProps, which already hides the inner one; the inner one repeats aria-hidden so it
23
+ // can't be exposed as a second, unnamed graphic.
21
24
  return (
22
25
  <svg {...svgSymbolProps} overflow='visible'>
23
26
  <svg
27
+ aria-hidden='true'
24
28
  x={(SVG_SYMBOL_SIZE - drawnWidth) * HALF}
25
29
  y={(SVG_SYMBOL_SIZE - drawnHeight) * HALF}
26
30
  width={drawnWidth}
@@ -1,5 +1,4 @@
1
- import React, { useState, useEffect } from 'react'
2
- import { getDatasetRegistry } from '../../registry/index.js'
1
+ import React, { useState, useEffect, useRef } from 'react'
3
2
  import { mergeKeyGroupItems } from '../../reducers/mergeKeyGroupItems.js'
4
3
  import { Key } from './Key.jsx'
5
4
 
@@ -9,7 +8,10 @@ export function MapKey ({
9
8
  pluginState,
10
9
  services: { eventBus, symbolRegistry, patternRegistry }
11
10
  }) {
12
- const [datasetRegistry, setDatasetRegistry] = useState(getDatasetRegistry())
11
+ const { datasetRegistry } = pluginState
12
+ // The event handlers below outlive the render that registers them, so they read the latest state
13
+ const pluginStateRef = useRef(pluginState)
14
+ pluginStateRef.current = pluginState
13
15
  // Lazily seed from the registry (already populated whenever the key is opened after
14
16
  // datasets:ready) so the first paint shows real content instead of flashing the empty
15
17
  // state while the effect below catches up on the next tick.
@@ -19,7 +21,7 @@ export function MapKey ({
19
21
  const getKeyItems = () => {
20
22
  const { items, hasGroups: _hasGroups } = datasetRegistry.keyItems()
21
23
  // Post Process the items - based on the map-key pluginConfig adding any groupConfigs
22
- const groupItems = mergeKeyGroupItems(items)
24
+ const groupItems = mergeKeyGroupItems(items, pluginStateRef.current)
23
25
  setKeyGroups(groupItems)
24
26
  setHasGroups(_hasGroups)
25
27
  }
@@ -30,19 +32,17 @@ export function MapKey ({
30
32
  }
31
33
 
32
34
  useEffect(() => {
35
+ // MapKeyInit puts the registry in plugin state once the datasets plugin is ready
33
36
  if (!datasetRegistry) {
34
- // 'datasets:registry' is only required when the key is opened before datasets:ready
35
- eventBus.requestOnce('datasets:registry', setDatasetRegistry)
36
- return () => {}
37
- } else {
38
- getKeyItems() // populate the initial KeyItems from the datasetRegistry (which caches them)
39
- eventBus
40
- .on('menu:changed', onMenuChanged) // Ensure keyItems refresh when menu updates
41
- .on('datasets:changed', getKeyItems) // Ensure keyItems refresh when datasets change
42
- return () => eventBus
43
- .off('menu:changed', onMenuChanged)
44
- .off('datasets:changed', getKeyItems)
37
+ return undefined
45
38
  }
39
+ getKeyItems() // populate the initial KeyItems from the datasetRegistry (which caches them)
40
+ eventBus
41
+ .on('menu:changed', onMenuChanged) // Ensure keyItems refresh when menu updates
42
+ .on('datasets:changed', getKeyItems) // Ensure keyItems refresh when datasets change
43
+ return () => eventBus
44
+ .off('menu:changed', onMenuChanged)
45
+ .off('datasets:changed', getKeyItems)
46
46
  }, [datasetRegistry])
47
47
 
48
48
  useEffect(() => {
@@ -1,10 +1,5 @@
1
1
  import { render, act } from '@testing-library/react'
2
2
  import { MapKey } from './MapKey'
3
- import { getDatasetRegistry } from '../../registry/index.js'
4
-
5
- jest.mock('../../registry/index.js', () => ({
6
- getDatasetRegistry: jest.fn()
7
- }))
8
3
 
9
4
  // eslint-disable-next-line no-var -- jest.mock factories may only reference vars prefixed "mock"
10
5
  var mockKeyRenderCount = 0
@@ -40,9 +35,12 @@ const makeRegistry = (items = [], hasGroups = false) => ({
40
35
  })
41
36
 
42
37
  let eventBus
43
- const baseProps = () => ({
38
+ // This map's datasets registry, which MapKeyInit puts in plugin state
39
+ let datasetRegistry
40
+ const baseProps = (pluginState = {}) => ({
44
41
  mapState: { mapStyle: { id: 'default' } },
45
42
  pluginConfig: { noKeyItemText: 'No items' },
43
+ pluginState: { datasetRegistry, ...pluginState },
46
44
  services: { eventBus }
47
45
  })
48
46
 
@@ -54,7 +52,7 @@ beforeEach(() => {
54
52
 
55
53
  describe('MapKey', () => {
56
54
  describe('when datasetRegistry is null', () => {
57
- beforeEach(() => { getDatasetRegistry.mockReturnValue(null) })
55
+ beforeEach(() => { datasetRegistry = null })
58
56
 
59
57
  it('passes empty items and hasGroups false to Key', () => {
60
58
  const { getByTestId } = render(<MapKey {...baseProps()} />)
@@ -62,17 +60,17 @@ describe('MapKey', () => {
62
60
  expect(getByTestId('key').dataset.hasGroups).toBe('false')
63
61
  })
64
62
 
65
- it('calls requestOnce for datasets:registry', () => {
63
+ it('does not request the registry itself', () => {
66
64
  render(<MapKey {...baseProps()} />)
67
- expect(eventBus.requestOnce).toHaveBeenCalledWith('datasets:registry', expect.any(Function))
65
+ expect(eventBus.requestOnce).not.toHaveBeenCalled()
68
66
  })
69
67
 
70
- it('populates key items when the registry arrives via requestOnce', () => {
71
- render(<MapKey {...baseProps()} />)
72
- const setReg = eventBus.requestOnce.mock.calls[0][1]
68
+ it('populates key items when the registry arrives in plugin state', () => {
69
+ const { rerender, getByTestId } = render(<MapKey {...baseProps()} />)
73
70
  const registry = makeRegistry([{ id: '1' }, { id: '2' }], true)
74
- act(() => { setReg(registry) })
71
+ rerender(<MapKey {...baseProps({ datasetRegistry: registry })} />)
75
72
  expect(registry.keyItems).toHaveBeenCalled()
73
+ expect(getByTestId('key').dataset.keyGroupsLength).toBe('2')
76
74
  })
77
75
  })
78
76
 
@@ -81,7 +79,7 @@ describe('MapKey', () => {
81
79
 
82
80
  beforeEach(() => {
83
81
  registry = makeRegistry([{ id: '1' }, { id: '2' }], true)
84
- getDatasetRegistry.mockReturnValue(registry)
82
+ datasetRegistry = registry
85
83
  })
86
84
 
87
85
  it('passes keyGroups and hasGroups from the registry to Key', () => {
@@ -129,10 +127,26 @@ describe('MapKey', () => {
129
127
  expect(registry.invalidateKeyItemsOnMenuStateChange).toHaveBeenCalledWith(menuState)
130
128
  expect(registry.keyItems).toHaveBeenCalledTimes(callsAtMount + 1)
131
129
  })
130
+
131
+ it('merges the latest key groups from plugin state when an event fires after they change', () => {
132
+ datasetRegistry = makeRegistry([
133
+ { id: '1', type: 'flat', keyDefinition: { id: '1' } },
134
+ { id: '2', type: 'flat', keyDefinition: { id: '2' } }
135
+ ])
136
+ const { rerender, getByTestId } = render(<MapKey {...baseProps()} />)
137
+ const groupState = {
138
+ groups: [{ id: 'manual', type: 'group', groupLabel: 'Manual' }],
139
+ keyDefinitions: [{ id: 'm1', groupId: 'manual' }]
140
+ }
141
+ rerender(<MapKey {...baseProps(groupState)} />)
142
+ const onDatasetsChanged = eventBus.on.mock.calls.find(([e]) => e === 'datasets:changed')[1]
143
+ act(() => { onDatasetsChanged() })
144
+ expect(getByTestId('key').dataset.keyGroupsLength).toBe('3')
145
+ })
132
146
  })
133
147
 
134
148
  describe('props forwarded to Key', () => {
135
- beforeEach(() => { getDatasetRegistry.mockReturnValue(null) })
149
+ beforeEach(() => { datasetRegistry = null })
136
150
 
137
151
  it('passes noKeyItemText from pluginConfig', () => {
138
152
  const { getByTestId } = render(<MapKey {...baseProps()} />)
@@ -1,21 +1,18 @@
1
- import { useEffect, useRef } from 'react'
2
- import { setDatasetRegistry } from '../registry/getDatasetRegistry.js'
3
- import { attachPluginStateRef } from '../reducers/mergeKeyGroupItems.js'
1
+ import { useEffect } from 'react'
4
2
 
5
3
  // additional possible params here are: pluginConfig, appState, mapProvider,
6
4
  export function MapKeyInit ({ pluginConfig, pluginState, mapState, services }) {
7
5
  const { dispatch } = pluginState
8
6
  const { eventBus } = services
9
- const pluginStateRef = useRef(pluginState)
10
- pluginStateRef.current = pluginState
11
7
 
12
8
  useEffect(() => {
13
9
  if (!mapState.isMapReady) {
14
10
  return
15
11
  }
16
- attachPluginStateRef(pluginStateRef)
17
- // Request a handle on the datasetsRegistry singleton
18
- eventBus.requestOnce('datasets:registry', setDatasetRegistry)
12
+ // Request this map's datasets registry, which arrives straight away if the datasets plugin is ready
13
+ eventBus.requestOnce('datasets:registry', (datasetRegistry) => {
14
+ dispatch({ type: 'SET_DATASET_REGISTRY', payload: datasetRegistry })
15
+ })
19
16
  eventBus.emit('map-key:ready')
20
17
  }, [mapState.isMapReady])
21
18
 
@@ -1,11 +1,5 @@
1
1
  import { render } from '@testing-library/react'
2
2
  import { MapKeyInit } from './MapKeyInit.jsx'
3
- import { setDatasetRegistry } from '../registry/getDatasetRegistry.js'
4
-
5
- jest.mock('../registry/getDatasetRegistry.js', () => ({
6
- setDatasetRegistry: jest.fn()
7
- }))
8
-
9
3
  const eventBus = { requestOnce: jest.fn(), emit: jest.fn() }
10
4
  const pluginState = { dispatch: jest.fn() }
11
5
  const pluginConfig = {
@@ -35,7 +29,15 @@ describe('MapKeyInit', () => {
35
29
 
36
30
  it('calls requestOnce for datasets:registry when map is ready', () => {
37
31
  renderInit({ isMapReady: true })
38
- expect(eventBus.requestOnce).toHaveBeenCalledWith('datasets:registry', setDatasetRegistry)
32
+ expect(eventBus.requestOnce).toHaveBeenCalledWith('datasets:registry', expect.any(Function))
33
+ })
34
+
35
+ it('puts the datasets registry it receives in this map\'s plugin state', () => {
36
+ renderInit({ isMapReady: true })
37
+ const datasetRegistry = { keyItems: jest.fn() }
38
+ const [, onRegistry] = eventBus.requestOnce.mock.calls[0]
39
+ onRegistry(datasetRegistry)
40
+ expect(pluginState.dispatch).toHaveBeenCalledWith({ type: 'SET_DATASET_REGISTRY', payload: datasetRegistry })
39
41
  })
40
42
 
41
43
  it('dispatches configured groups when pluginConfig.groups is provided', () => {
@@ -4,7 +4,6 @@ import { MapKeyInit } from './initialise/MapKeyInit.jsx'
4
4
 
5
5
  jest.mock('./components/Key/MapKey.jsx', () => ({ MapKey: jest.fn() }))
6
6
  jest.mock('./initialise/MapKeyInit.jsx', () => ({ MapKeyInit: jest.fn() }))
7
- jest.mock('./registry/getDatasetRegistry.js', () => ({}))
8
7
 
9
8
  describe('manifest', () => {
10
9
  it('sets InitComponent to MapKeyInit', () => {
@@ -1,41 +1,22 @@
1
- let _pluginStateRef = {}
2
- export const attachPluginStateRef = (pluginStateRef) => { _pluginStateRef = pluginStateRef }
3
-
4
- let previousRef = null
5
- let addedKeyGroups = []
6
-
7
- const getStateKeyGroups = () => {
8
- if (!_pluginStateRef?.current) {
9
- return []
10
- }
11
- if (previousRef === _pluginStateRef.current) {
12
- return addedKeyGroups
13
- }
14
- previousRef = _pluginStateRef.current
15
- const { groups = [], keyDefinitions = [] } = _pluginStateRef.current
16
-
17
- addedKeyGroups = groups.map(group => {
18
- if (group.type === 'flat') {
19
- return {
20
- ...group,
21
- keyDefinition: keyDefinitions.find(item => item.id === group.id)
22
- }
23
- }
24
-
1
+ // Turns the key groups and symbols added through the map-key API into key group items
2
+ const getStateKeyGroups = ({ groups = [], keyDefinitions = [] }) => groups.map(group => {
3
+ if (group.type === 'flat') {
25
4
  return {
26
5
  ...group,
27
- keyDefinitions: keyDefinitions.filter(item => item.groupId === group.id)
6
+ keyDefinition: keyDefinitions.find(item => item.id === group.id)
28
7
  }
29
- })
30
- return addedKeyGroups
31
- }
8
+ }
9
+
10
+ return {
11
+ ...group,
12
+ keyDefinitions: keyDefinitions.filter(item => item.groupId === group.id)
13
+ }
14
+ })
32
15
 
33
- // Merges the state key group items with items provided by another plugin,
16
+ // Merges this map's key groups from the map-key plugin state with items provided by another plugin,
34
17
  // specifically the datasets plugin
35
- export const mergeKeyGroupItems = (keyGroupItemsToMerge = []) => {
36
- // Clone the current state key groups from the plugin state reference
37
- // to avoid mutating the original array
38
- const stateKeyGroups = [...getStateKeyGroups()]
18
+ export const mergeKeyGroupItems = (keyGroupItemsToMerge = [], pluginState = {}) => {
19
+ const stateKeyGroups = getStateKeyGroups(pluginState)
39
20
  if (stateKeyGroups.length === 0) {
40
21
  // if there is nothing in the state key groups, just return the items that were passed in
41
22
  return keyGroupItemsToMerge
@@ -1,82 +1,68 @@
1
- import { attachPluginStateRef, mergeKeyGroupItems } from './mergeKeyGroupItems.js'
1
+ import { mergeKeyGroupItems } from './mergeKeyGroupItems.js'
2
2
 
3
3
  describe('mergeKeyGroupItems', () => {
4
- afterEach(() => {
5
- attachPluginStateRef({ current: null })
6
- })
7
-
8
- it('returns the incoming items unchanged when no plugin state is attached', () => {
9
- attachPluginStateRef({ current: null })
4
+ it('returns the incoming items unchanged when no plugin state is passed', () => {
10
5
  const items = [{ id: 'dataset-1', keyDefinitions: [{ id: 'k1' }] }]
11
6
 
12
7
  expect(mergeKeyGroupItems(items)).toBe(items)
13
8
  })
14
9
 
15
10
  it('returns dataset items unchanged when plugin state groups are empty', () => {
16
- attachPluginStateRef({ current: { groups: [], keyDefinitions: [] } })
11
+ const pluginState = { groups: [], keyDefinitions: [] }
17
12
  const items = [{ id: 'dataset-1', keyDefinitions: [{ id: 'k1' }] }]
18
13
 
19
- expect(mergeKeyGroupItems(items)).toEqual(items)
14
+ expect(mergeKeyGroupItems(items, pluginState)).toEqual(items)
20
15
  })
21
16
 
22
17
  it('uses default empty state values and empty arguments when no groups or items are supplied', () => {
23
- attachPluginStateRef({ current: {} })
18
+ const pluginState = {}
24
19
 
25
- expect(mergeKeyGroupItems()).toEqual([])
20
+ expect(mergeKeyGroupItems(undefined, pluginState)).toEqual([])
26
21
  })
27
22
 
28
23
  it('merges a matched group even when the state group has no keyDefinitions array', () => {
29
- attachPluginStateRef({
30
- current: {
31
- groups: [{ id: 'dataset-1', type: 'group', groupLabel: 'Dataset 1' }],
32
- keyDefinitions: []
33
- }
34
- })
24
+ const pluginState = {
25
+ groups: [{ id: 'dataset-1', type: 'group', groupLabel: 'Dataset 1' }],
26
+ keyDefinitions: []
27
+ }
35
28
 
36
29
  const items = [{ id: 'dataset-1', keyDefinitions: [{ id: 'd1' }] }]
37
30
 
38
- expect(mergeKeyGroupItems(items)).toEqual([
31
+ expect(mergeKeyGroupItems(items, pluginState)).toEqual([
39
32
  { id: 'dataset-1', type: 'group', groupLabel: 'Dataset 1', keyDefinitions: [{ id: 'd1' }] }
40
33
  ])
41
34
  })
42
35
 
43
36
  it('merges a matched group even when the incoming item has no keyDefinitions array', () => {
44
- attachPluginStateRef({
45
- current: {
46
- groups: [{ id: 'group-1', type: 'group', groupLabel: 'Group 1' }],
47
- keyDefinitions: [{ id: 'k1', groupId: 'group-1' }]
48
- }
49
- })
37
+ const pluginState = {
38
+ groups: [{ id: 'group-1', type: 'group', groupLabel: 'Group 1' }],
39
+ keyDefinitions: [{ id: 'k1', groupId: 'group-1' }]
40
+ }
50
41
 
51
42
  const items = [{ id: 'group-1' }]
52
43
 
53
- expect(mergeKeyGroupItems(items)).toEqual([
44
+ expect(mergeKeyGroupItems(items, pluginState)).toEqual([
54
45
  { id: 'group-1', type: 'group', groupLabel: 'Group 1', keyDefinitions: [{ id: 'k1', groupId: 'group-1' }] }
55
46
  ])
56
47
  })
57
48
 
58
- it('reuses the cached plugin-state groups when the ref object is unchanged', () => {
59
- const ref = { current: { groups: [{ id: 'group-1', type: 'group', groupLabel: 'Group 1' }], keyDefinitions: [{ id: 'k1', groupId: 'group-1' }] } }
60
- attachPluginStateRef(ref)
49
+ it('uses only the plugin state it is given, so each map keeps its own groups', () => {
50
+ const mapAState = { groups: [{ id: 'group-a', type: 'group', groupLabel: 'Group A' }], keyDefinitions: [{ id: 'a1', groupId: 'group-a' }] }
51
+ const mapBState = { groups: [{ id: 'group-b', type: 'group', groupLabel: 'Group B' }], keyDefinitions: [{ id: 'b1', groupId: 'group-b' }] }
61
52
 
62
- const first = mergeKeyGroupItems([{ id: 'dataset-1', keyDefinitions: [{ id: 'd1' }] }])
63
- const second = mergeKeyGroupItems([{ id: 'dataset-1', keyDefinitions: [{ id: 'd2' }] }])
64
-
65
- expect(first).toEqual([{ id: 'group-1', type: 'group', groupLabel: 'Group 1', keyDefinitions: [{ id: 'k1', groupId: 'group-1' }] }])
66
- expect(second).toEqual(first)
53
+ expect(mergeKeyGroupItems([], mapAState)).toEqual([{ id: 'group-a', type: 'group', groupLabel: 'Group A', keyDefinitions: [{ id: 'a1', groupId: 'group-a' }] }])
54
+ expect(mergeKeyGroupItems([], mapBState)).toEqual([{ id: 'group-b', type: 'group', groupLabel: 'Group B', keyDefinitions: [{ id: 'b1', groupId: 'group-b' }] }])
67
55
  })
68
56
 
69
57
  it('merges a matching flat group into the dataset item when the key definition matches the same id', () => {
70
- attachPluginStateRef({
71
- current: {
72
- groups: [{ id: 'dataset-1', type: 'flat' }],
73
- keyDefinitions: [{ id: 'dataset-1' }]
74
- }
75
- })
58
+ const pluginState = {
59
+ groups: [{ id: 'dataset-1', type: 'flat' }],
60
+ keyDefinitions: [{ id: 'dataset-1' }]
61
+ }
76
62
 
77
63
  const items = [{ id: 'dataset-1', keyDefinitions: [{ id: 'dataset-1' }] }]
78
64
 
79
- expect(mergeKeyGroupItems(items)).toEqual([
65
+ expect(mergeKeyGroupItems(items, pluginState)).toEqual([
80
66
  {
81
67
  id: 'dataset-1',
82
68
  type: 'flat',
@@ -87,19 +73,17 @@ describe('mergeKeyGroupItems', () => {
87
73
  })
88
74
 
89
75
  it('keeps only unmatched state groups that still have key definitions', () => {
90
- attachPluginStateRef({
91
- current: {
92
- groups: [
93
- { id: 'group-1', type: 'group', groupLabel: 'Group 1' },
94
- { id: 'group-2', type: 'group', groupLabel: 'Group 2' }
95
- ],
96
- keyDefinitions: [{ id: 'k1', groupId: 'group-1' }]
97
- }
98
- })
76
+ const pluginState = {
77
+ groups: [
78
+ { id: 'group-1', type: 'group', groupLabel: 'Group 1' },
79
+ { id: 'group-2', type: 'group', groupLabel: 'Group 2' }
80
+ ],
81
+ keyDefinitions: [{ id: 'k1', groupId: 'group-1' }]
82
+ }
99
83
 
100
84
  const items = [{ id: 'dataset-1', keyDefinitions: [{ id: 'd1' }] }]
101
85
 
102
- expect(mergeKeyGroupItems(items)).toEqual([
86
+ expect(mergeKeyGroupItems(items, pluginState)).toEqual([
103
87
  { id: 'group-1', type: 'group', groupLabel: 'Group 1', keyDefinitions: [{ id: 'k1', groupId: 'group-1' }] }
104
88
  ])
105
89
  })
@@ -1,6 +1,8 @@
1
1
  const initialState = {
2
2
  keyDefinitions: [],
3
- groups: []
3
+ groups: [],
4
+ // This map's datasets registry, if the datasets plugin is in use
5
+ datasetRegistry: null
4
6
  }
5
7
 
6
8
  const labelToId = (label) => label ? label.toLowerCase().replace(/\s+/g, '-') : null
@@ -56,7 +58,10 @@ const addKeyGroups = (state, groups) => {
56
58
  }
57
59
  }
58
60
 
61
+ const setDatasetRegistry = (state, datasetRegistry) => ({ ...state, datasetRegistry })
62
+
59
63
  const actions = {
64
+ SET_DATASET_REGISTRY: setDatasetRegistry,
60
65
  ADD_KEY_SYMBOL: addSymbol,
61
66
  REMOVE_KEY_SYMBOL: removeSymbol,
62
67
  ADD_KEY_GROUPS: addKeyGroups
@@ -2,7 +2,13 @@ import { actions, initialState } from './pluginState.js'
2
2
 
3
3
  describe('pluginState reducer helpers', () => {
4
4
  it('returns the initial state', () => {
5
- expect(initialState).toEqual({ keyDefinitions: [], groups: [] })
5
+ expect(initialState).toEqual({ keyDefinitions: [], groups: [], datasetRegistry: null })
6
+ })
7
+
8
+ it('stores this map\'s datasets registry', () => {
9
+ const datasetRegistry = { keyItems: jest.fn() }
10
+
11
+ expect(actions.SET_DATASET_REGISTRY(initialState, datasetRegistry)).toEqual({ ...initialState, datasetRegistry })
6
12
  })
7
13
 
8
14
  it('adds a flat key item and creates a flat group when needed', () => {
@@ -10,7 +16,8 @@ describe('pluginState reducer helpers', () => {
10
16
 
11
17
  expect(nextState).toEqual({
12
18
  keyDefinitions: [{ id: 'flat-key', label: 'Flat key', type: 'manual' }],
13
- groups: [{ id: 'flat-key', type: 'flat' }]
19
+ groups: [{ id: 'flat-key', type: 'flat' }],
20
+ datasetRegistry: null
14
21
  })
15
22
  })
16
23
 
@@ -25,7 +32,8 @@ describe('pluginState reducer helpers', () => {
25
32
  label: 'Group key',
26
33
  type: 'manual'
27
34
  }],
28
- groups: [{ id: 'group-label', type: 'group', groupLabel: 'Group Label' }]
35
+ groups: [{ id: 'group-label', type: 'group', groupLabel: 'Group Label' }],
36
+ datasetRegistry: null
29
37
  })
30
38
  })
31
39
 
@@ -76,7 +84,8 @@ describe('pluginState reducer helpers', () => {
76
84
 
77
85
  expect(actions.ADD_KEY_GROUPS(initialState, groups)).toEqual({
78
86
  keyDefinitions: [],
79
- groups: [{ id: 'g1', type: 'group', groupLabel: 'G1' }]
87
+ groups: [{ id: 'g1', type: 'group', groupLabel: 'G1' }],
88
+ datasetRegistry: null
80
89
  })
81
90
  })
82
91
  })
@@ -0,0 +1 @@
1
+ import e from"@babel/runtime/helpers/regenerator";import t from"@babel/runtime/helpers/asyncToGenerator";function r(){var r,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"mapStyles",manifest:n.manifest,mapStyles:n.mapStyles,load:(r=t(e().m(function t(){var r;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,import(/* webpackChunkName: "im-map-styles-plugin" */ "./im-map-styles-plugin.js");case 1:return r=e.v.manifest,e.a(2,r)}},t)})),function(){return r.apply(this,arguments)}),handlesMapStyle:!0,api:{}}}export{r as default};
@@ -1 +1 @@
1
- "use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[657],{790:function(e,s,i){i.r(s),i.d(s,{manifest:function(){return m}});var t=i(738),a="app:ready",l=i(287),n={small:1,medium:1.5,large:2},m={InitComponent:function(e){var s=e.pluginConfig,i=e.services.eventBus,n=function(){i.emit("map:initmapstyles",s.mapStyles)};return(0,t.useEffect)(function(){return i.on(a,n),function(){return i.off(a,n)}},[]),(0,l.jsx)(l.Fragment,{})},panels:[{id:"mapStyles",label:"Map styles",mobile:{slot:"drawer",modal:!0,dismissible:!0},tablet:{slot:"left-top",modal:!0,width:"400px",dismissible:!0},desktop:{slot:"left-top",modal:!0,width:"400px",dismissible:!0},render:function(e){var s=e.mapState,i=e.pluginConfig,t=e.services,a=e.mapProvider,m=s.mapStyle,c=s.mapSize,r=i.mapStyles,p=t.eventBus,d=a.capabilities.supportsMapSizes;return(0,l.jsxs)("div",{className:"im-c-map-styles",children:[(0,l.jsx)("div",{className:"im-c-map-styles__group",children:(0,l.jsx)("div",{className:"im-c-map-styles__inner",children:r.filter(function(e){return e.url}).map(function(e){return(0,l.jsx)("div",{className:"im-c-map-styles__item",children:(0,l.jsxs)("button",{className:"im-c-map-styles__button","aria-pressed":e.id===m.id,onClick:function(){return s=e,void p.emit("map:setstyle",s);var s},children:[(0,l.jsx)("div",{className:"im-c-map-styles__image",children:(0,l.jsx)("img",{src:e.thumbnail||void 0,alt:"",height:"60",width:"60"})}),e.label]})},e.id)})})}),d&&(0,l.jsxs)("div",{className:"im-c-map-styles__group",children:[(0,l.jsx)("h3",{className:"im-c-map-styles__heading",id:"map-text-sizes",children:"Map size"}),(0,l.jsx)("div",{className:"im-c-map-styles__inner",children:["small","medium","large"].map(function(e){return(0,l.jsx)("div",{className:"im-c-map-styles__item",children:(0,l.jsxs)("button",{className:"im-c-map-styles__button",onClick:function(){return s=e,p.emit("map:setsize",s),void p.emit("map:setpixelratio",window.devicePixelRatio*n[s]);var s},"aria-pressed":e===c,children:[(0,l.jsx)("div",{className:"im-c-map-styles__image",children:(0,l.jsxs)("svg",{width:"60",height:"60",viewBox:"0 0 60 60",fillRule:"evenodd",children:[(0,l.jsx)("rect",{className:"im-c-map-styles__image-bg",width:"100%",height:"100%"}),(0,l.jsx)("g",{style:{transform:"scale(".concat(n[e],")"),transformOrigin:"8px 52px"},children:(0,l.jsx)("path",{d:"M8 51.785L12.948 38.9h1.837l5.274 12.885h-1.943l-1.503-3.903h-5.387l-1.415 3.903H8zm3.718-5.291h4.368l-1.345-3.569-.914-2.671c-.164.826-.395 1.646-.694 2.46l-1.415 3.78zm15.592 4.139c-3.698 3.143-7.836.271-6.315-2.562.963-1.794 5.529-1.982 6.183-2.21.022-.825.052-2.27-2.241-2.312-1.751-.031-2.242 1.025-2.435 1.776l-1.547-.211c.234-1.102.963-2.856 4.21-2.874 4.037-.022 3.612 2.962 3.612 3.524v2.11c0 .315 0 3.012.501 3.911h-1.652c-.164-.328-.27-.712-.316-1.152zm-.132-3.533c-.907.37-3.444.694-3.964.914-1.293.548-.911 2.399.225 2.637.639.134 3.739.476 3.739-2.971v-.58z"})})]})}),e[0].toUpperCase()+e.slice(1)]})},e)})})]})]})}}],buttons:[{id:"mapStyles",label:"Styles",panelId:"mapStyles",iconId:"map",mobile:{slot:"top-left",showLabel:!1},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}}],icons:[{id:"map",svgContent:'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>'}]}}}]);
1
+ "use strict";(Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[]).push([[657],{868:function(e,s,i){i.r(s),i.d(s,{manifest:function(){return m}});var t=i(738),a="app:ready",l=i(287),n={small:1,medium:1.5,large:2},m={InitComponent:function(e){var s=e.pluginConfig,i=e.services.eventBus,n=function(){i.emit("map:initmapstyles",s.mapStyles)};return(0,t.useEffect)(function(){return i.on(a,n),function(){return i.off(a,n)}},[]),(0,l.jsx)(l.Fragment,{})},panels:[{id:"mapStyles",label:"Map styles",mobile:{slot:"drawer",modal:!0,dismissible:!0},tablet:{slot:"left-top",modal:!0,width:"400px",dismissible:!0},desktop:{slot:"left-top",modal:!0,width:"400px",dismissible:!0},render:function(e){var s=e.mapState,i=e.pluginConfig,t=e.services,a=e.mapProvider,m=s.mapStyle,c=s.mapSize,r=i.mapStyles,p=t.eventBus,d=a.capabilities.supportsMapSizes;return(0,l.jsxs)("div",{className:"im-c-map-styles",children:[(0,l.jsx)("div",{className:"im-c-map-styles__group",children:(0,l.jsx)("div",{className:"im-c-map-styles__inner",children:r.filter(function(e){return e.url}).map(function(e){return(0,l.jsx)("div",{className:"im-c-map-styles__item",children:(0,l.jsxs)("button",{className:"im-c-map-styles__button","aria-pressed":e.id===m.id,onClick:function(){return s=e,void p.emit("map:setstyle",s);var s},children:[(0,l.jsx)("div",{className:"im-c-map-styles__image",children:(0,l.jsx)("img",{src:e.thumbnail||void 0,alt:"",height:"60",width:"60"})}),e.label]})},e.id)})})}),d&&(0,l.jsxs)("div",{className:"im-c-map-styles__group",children:[(0,l.jsx)("h3",{className:"im-c-map-styles__heading",id:"map-text-sizes",children:"Map size"}),(0,l.jsx)("div",{className:"im-c-map-styles__inner",children:["small","medium","large"].map(function(e){return(0,l.jsx)("div",{className:"im-c-map-styles__item",children:(0,l.jsxs)("button",{className:"im-c-map-styles__button",onClick:function(){return s=e,p.emit("map:setsize",s),void p.emit("map:setpixelratio",window.devicePixelRatio*n[s]);var s},"aria-pressed":e===c,children:[(0,l.jsx)("div",{className:"im-c-map-styles__image",children:(0,l.jsxs)("svg",{width:"60",height:"60",viewBox:"0 0 60 60",fillRule:"evenodd",children:[(0,l.jsx)("rect",{className:"im-c-map-styles__image-bg",width:"100%",height:"100%"}),(0,l.jsx)("g",{style:{transform:"scale(".concat(n[e],")"),transformOrigin:"8px 52px"},children:(0,l.jsx)("path",{d:"M8 51.785L12.948 38.9h1.837l5.274 12.885h-1.943l-1.503-3.903h-5.387l-1.415 3.903H8zm3.718-5.291h4.368l-1.345-3.569-.914-2.671c-.164.826-.395 1.646-.694 2.46l-1.415 3.78zm15.592 4.139c-3.698 3.143-7.836.271-6.315-2.562.963-1.794 5.529-1.982 6.183-2.21.022-.825.052-2.27-2.241-2.312-1.751-.031-2.242 1.025-2.435 1.776l-1.547-.211c.234-1.102.963-2.856 4.21-2.874 4.037-.022 3.612 2.962 3.612 3.524v2.11c0 .315 0 3.012.501 3.911h-1.652c-.164-.328-.27-.712-.316-1.152zm-.132-3.533c-.907.37-3.444.694-3.964.914-1.293.548-.911 2.399.225 2.637.639.134 3.739.476 3.739-2.971v-.58z"})})]})}),e[0].toUpperCase()+e.slice(1)]})},e)})})]})]})}}],buttons:[{id:"mapStyles",label:"Styles",panelId:"mapStyles",iconId:"map",mobile:{slot:"top-left",showLabel:!1},tablet:{slot:"top-left",showLabel:!0},desktop:{slot:"top-left",showLabel:!0}}],icons:[{id:"map",svgContent:'<path d="M14.106 5.553a2 2 0 0 0 1.788 0l3.659-1.83A1 1 0 0 1 21 4.619v12.764a1 1 0 0 1-.553.894l-4.553 2.277a2 2 0 0 1-1.788 0l-4.212-2.106a2 2 0 0 0-1.788 0l-3.659 1.83A1 1 0 0 1 3 19.381V6.618a1 1 0 0 1 .553-.894l4.553-2.277a2 2 0 0 1 1.788 0z"/><path d="M15 5.764v15"/><path d="M9 3.236v15"/>'}]}}}]);
@@ -1,2 +1,2 @@
1
1
  /*! For license information please see index.js.LICENSE.txt */
2
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("defra",[],e):"object"==typeof exports?exports.defra=e():(t.defra=t.defra||{},t.defra.mapStylesPlugin=e())}(Object("undefined"!=typeof self?self:this),function(){return function(){"use strict";var t,e,r={738:function(t){t.exports=preactCompat},287:function(t){t.exports=preactJsxRuntime}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,o),i.exports}o.m=r,o.d=function(t,e){for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.f={},o.e=function(t){return Promise.all(Object.keys(o.f).reduce(function(e,r){return o.f[r](t,e),e},[]))},o.u=function(t){return"im-map-styles-plugin.js"},o.miniCssF=function(t){},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t={},e="defra.mapStylesPlugin:",o.l=function(r,n,i,a){if(t[r])t[r].push(n);else{var u,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==e+i){u=l;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",o.nc&&u.setAttribute("nonce",o.nc),u.setAttribute("data-webpack",e+i),u.src=r),t[r]=[n];var s=function(e,n){u.onerror=u.onload=null,clearTimeout(d);var o=t[r];if(delete t[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(function(t){return t(n)}),e)return e(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t}(),function(){var t={57:0};o.f.j=function(e,r){var n=o.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(function(r,o){n=t[e]=[r,o]});r.push(n[2]=i);var a=o.p+o.u(e),u=new Error;o.l(a,function(r){if(o.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;u.message="Loading chunk "+e+" failed.\n("+i+": "+a+")",u.name="ChunkLoadError",u.type=i,u.request=a,n[1](u)}},"chunk-"+e,e)}};var e=function(e,r){var n,i,a=r[0],u=r[1],c=r[2],f=0;if(a.some(function(e){return 0!==t[e]})){for(n in u)o.o(u,n)&&(o.m[n]=u[n]);c&&c(o)}for(e&&e(r);f<a.length;f++)i=a[f],o.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}();var i={};function a(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=n&&n.prototype instanceof f?n:f,p=Object.create(a.prototype);return u(p,"_invoke",function(r,n,o){var i,a,u,f=0,p=o||[],l=!1,s={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,a=0,u=t,s.n=r,c}};function d(r,n){for(a=r,u=n,e=0;!l&&f&&!o&&e<p.length;e++){var o,i=p[e],d=s.p,y=i[2];r>3?(o=y===n)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,s.v=n,s.n=i[1]):d<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,s.n=y,a=0))}if(o||r>1)return c;throw l=!0,n}return function(o,p,y){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,y),a=p,u=y;(e=a<2?t:u)||!l;){i||(a?a<3?(a>1&&(s.n=-1),d(a,u)):s.n=u:s.v=u);try{if(f=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(l=s.n<0)?u:r.call(n,s))!==c)break}catch(e){i=t,a=1,u=e}finally{f=1}}return{value:e,done:l}}}(r,o,i),!0),p}var c={};function f(){}function p(){}function l(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(u(e={},n,function(){return this}),e),d=l.prototype=f.prototype=Object.create(s);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,u(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return p.prototype=l,u(d,"constructor",l),u(l,"constructor",p),p.displayName="GeneratorFunction",u(l,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,n,function(){return this}),u(d,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:y}})()}function u(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}u=function(t,e,r,n){function i(e,r){u(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},u(t,e,r,n)}function c(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function f(){var t,e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"mapStyles",manifest:r.manifest,mapStyles:r.mapStyles,load:(t=a().m(function t(){var e;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,o.e(657).then(o.bind(o,790));case 1:return e=t.v.manifest,t.a(2,e)}},t)}),e=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,u,"next",t)}function u(t){c(i,n,o,a,u,"throw",t)}a(void 0)})},function(){return e.apply(this,arguments)}),handlesMapStyle:!0,api:{}}}return o.d(i,{default:function(){return f}}),i.default}()});
2
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("defra",[],e):"object"==typeof exports?exports.defra=e():(t.defra=t.defra||{},t.defra.mapStylesPlugin=e())}(Object("undefined"!=typeof self?self:this),function(){return function(){"use strict";var t,e,r={738:function(t){t.exports=preactCompat},287:function(t){t.exports=preactJsxRuntime}},n={};function o(t){var e=n[t];if(void 0!==e)return e.exports;var i=n[t]={exports:{}};return r[t](i,i.exports,o),i.exports}o.m=r,o.d=function(t,e){for(var r in e)o.o(e,r)&&!o.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},o.f={},o.e=function(t){return Promise.all(Object.keys(o.f).reduce(function(e,r){return o.f[r](t,e),e},[]))},o.u=function(t){return"im-map-styles-plugin.js"},o.miniCssF=function(t){},o.g=function(){if("object"==typeof globalThis)return globalThis;try{return this||new Function("return this")()}catch(t){if("object"==typeof window)return window}}(),o.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},t={},e="defra.mapStylesPlugin:",o.l=function(r,n,i,a){if(t[r])t[r].push(n);else{var u,c;if(void 0!==i)for(var f=document.getElementsByTagName("script"),p=0;p<f.length;p++){var l=f[p];if(l.getAttribute("src")==r||l.getAttribute("data-webpack")==e+i){u=l;break}}u||(c=!0,(u=document.createElement("script")).charset="utf-8",o.nc&&u.setAttribute("nonce",o.nc),u.setAttribute("data-webpack",e+i),u.src=r),t[r]=[n];var s=function(e,n){u.onerror=u.onload=null,clearTimeout(d);var o=t[r];if(delete t[r],u.parentNode&&u.parentNode.removeChild(u),o&&o.forEach(function(t){return t(n)}),e)return e(n)},d=setTimeout(s.bind(null,void 0,{type:"timeout",target:u}),12e4);u.onerror=s.bind(null,u.onerror),u.onload=s.bind(null,u.onload),c&&document.head.appendChild(u)}},o.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},function(){var t;o.g.importScripts&&(t=o.g.location+"");var e=o.g.document;if(!t&&e&&(e.currentScript&&"SCRIPT"===e.currentScript.tagName.toUpperCase()&&(t=e.currentScript.src),!t)){var r=e.getElementsByTagName("script");if(r.length)for(var n=r.length-1;n>-1&&(!t||!/^http(s?):/.test(t));)t=r[n--].src}if(!t)throw new Error("Automatic publicPath is not supported in this browser");t=t.replace(/^blob:/,"").replace(/#.*$/,"").replace(/\?.*$/,"").replace(/\/[^\/]+$/,"/"),o.p=t}(),function(){var t={57:0};o.f.j=function(e,r){var n=o.o(t,e)?t[e]:void 0;if(0!==n)if(n)r.push(n[2]);else{var i=new Promise(function(r,o){n=t[e]=[r,o]});r.push(n[2]=i);var a=o.p+o.u(e),u=new Error;o.l(a,function(r){if(o.o(t,e)&&(0!==(n=t[e])&&(t[e]=void 0),n)){var i=r&&("load"===r.type?"missing":r.type),a=r&&r.target&&r.target.src;u.message="Loading chunk "+e+" failed.\n("+i+": "+a+")",u.name="ChunkLoadError",u.type=i,u.request=a,n[1](u)}},"chunk-"+e,e)}};var e=function(e,r){var n,i,a=r[0],u=r[1],c=r[2],f=0;if(a.some(function(e){return 0!==t[e]})){for(n in u)o.o(u,n)&&(o.m[n]=u[n]);c&&c(o)}for(e&&e(r);f<a.length;f++)i=a[f],o.o(t,i)&&t[i]&&t[i][0](),t[i]=0},r=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap=Object("undefined"!=typeof self?self:this).webpackChunkdefra_DefraMap||[];r.forEach(e.bind(null,0)),r.push=e.bind(null,r.push.bind(r))}();var i={};function a(){var t,e,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",o=r.toStringTag||"@@toStringTag";function i(r,n,o,i){var a=n&&n.prototype instanceof f?n:f,p=Object.create(a.prototype);return u(p,"_invoke",function(r,n,o){var i,a,u,f=0,p=o||[],l=!1,s={p:0,n:0,v:t,a:d,f:d.bind(t,4),d:function(e,r){return i=e,a=0,u=t,s.n=r,c}};function d(r,n){for(a=r,u=n,e=0;!l&&f&&!o&&e<p.length;e++){var o,i=p[e],d=s.p,y=i[2];r>3?(o=y===n)&&(u=i[(a=i[4])?5:(a=3,3)],i[4]=i[5]=t):i[0]<=d&&((o=r<2&&d<i[1])?(a=0,s.v=n,s.n=i[1]):d<y&&(o=r<3||i[0]>n||n>y)&&(i[4]=r,i[5]=n,s.n=y,a=0))}if(o||r>1)return c;throw l=!0,n}return function(o,p,y){if(f>1)throw TypeError("Generator is already running");for(l&&1===p&&d(p,y),a=p,u=y;(e=a<2?t:u)||!l;){i||(a?a<3?(a>1&&(s.n=-1),d(a,u)):s.n=u:s.v=u);try{if(f=2,i){if(a||(o="next"),e=i[o]){if(!(e=e.call(i,u)))throw TypeError("iterator result is not an object");if(!e.done)return e;u=e.value,a<2&&(a=0)}else 1===a&&(e=i.return)&&e.call(i),a<2&&(u=TypeError("The iterator does not provide a '"+o+"' method"),a=1);i=t}else if((e=(l=s.n<0)?u:r.call(n,s))!==c)break}catch(e){i=t,a=1,u=e}finally{f=1}}return{value:e,done:l}}}(r,o,i),!0),p}var c={};function f(){}function p(){}function l(){}e=Object.getPrototypeOf;var s=[][n]?e(e([][n]())):(u(e={},n,function(){return this}),e),d=l.prototype=f.prototype=Object.create(s);function y(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,l):(t.__proto__=l,u(t,o,"GeneratorFunction")),t.prototype=Object.create(d),t}return p.prototype=l,u(d,"constructor",l),u(l,"constructor",p),p.displayName="GeneratorFunction",u(l,o,"GeneratorFunction"),u(d),u(d,o,"Generator"),u(d,n,function(){return this}),u(d,"toString",function(){return"[object Generator]"}),(a=function(){return{w:i,m:y}})()}function u(t,e,r,n){var o=Object.defineProperty;try{o({},"",{})}catch(t){o=0}u=function(t,e,r,n){function i(e,r){u(t,e,function(t){return this._invoke(e,r,t)})}e?o?o(t,e,{value:r,enumerable:!n,configurable:!n,writable:!n}):t[e]=r:(i("next",0),i("throw",1),i("return",2))},u(t,e,r,n)}function c(t,e,r,n,o,i,a){try{var u=t[i](a),c=u.value}catch(t){return void r(t)}u.done?e(c):Promise.resolve(c).then(n,o)}function f(){var t,e,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return{id:"mapStyles",manifest:r.manifest,mapStyles:r.mapStyles,load:(t=a().m(function t(){var e;return a().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,o.e(657).then(o.bind(o,868));case 1:return e=t.v.manifest,t.a(2,e)}},t)}),e=function(){var e=this,r=arguments;return new Promise(function(n,o){var i=t.apply(e,r);function a(t){c(i,n,o,a,u,"next",t)}function u(t){c(i,n,o,a,u,"throw",t)}a(void 0)})},function(){return e.apply(this,arguments)}),handlesMapStyle:!0,api:{}}}return o.d(i,{default:function(){return f}}),i.default}()});
@@ -1,7 +1,7 @@
1
1
  import React from 'react'
2
- import { EVENTS } from '../../../../src/config/events.js'
2
+ import { EVENTS } from '../../../src/config/events.js'
3
3
  import { textSizeSvgPath } from './config.js'
4
- import { scaleFactor } from '../../../../src/config/appConfig.js'
4
+ import { scaleFactor } from '../../../src/config/appConfig.js'
5
5
 
6
6
  export const MapStyles = ({ mapState, pluginConfig, services, mapProvider }) => {
7
7
  const { mapStyle: currentMapStyle, mapSize: currentMapSize } = mapState
@@ -1,6 +1,6 @@
1
1
  // src/plugins/mapStyles/MapStylesInit.jsx
2
2
  import { useEffect } from 'react'
3
- import { EVENTS } from '../../../../src/config/events.js'
3
+ import { EVENTS } from '../../../src/config/events.js'
4
4
 
5
5
  export function MapStylesInit ({ pluginConfig, services }) {
6
6
  const { eventBus } = services
@@ -1 +1 @@
1
- import e from"@babel/runtime/helpers/asyncToGenerator";import r from"@babel/runtime/helpers/defineProperty";import t from"@babel/runtime/regenerator";function n(e,r){var t=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);r&&(n=n.filter(function(r){return Object.getOwnPropertyDescriptor(e,r).enumerable})),t.push.apply(t,n)}return t}function o(e){for(var t=1;t<arguments.length;t++){var o=null!=arguments[t]?arguments[t]:{};t%2?n(Object(o),!0).forEach(function(t){r(e,t,o[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(o)):n(Object(o)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(o,r))})}return e}function i(){var r;return o(o({noKeyItemText:"No features displayed"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"menu",load:(r=e(t.mark(function e(){var r;return t.wrap(function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=1,import(/* webpackChunkName: "im-menu-plugin" */ "./im-menu-plugin.js");case 1:return r=e.sent.manifest,e.abrupt("return",r);case 2:case"end":return e.stop()}},e)})),function(){return r.apply(this,arguments)})})}export{i as default};
1
+ import e from"@babel/runtime/helpers/regenerator";import r from"@babel/runtime/helpers/asyncToGenerator";import t from"@babel/runtime/helpers/objectSpread2";function n(){var n;return t(t({noKeyItemText:"No features displayed"},arguments.length>0&&void 0!==arguments[0]?arguments[0]:{}),{},{id:"menu",load:(n=r(e().m(function r(){var t;return e().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,import(/* webpackChunkName: "im-menu-plugin" */ "./im-menu-plugin.js");case 1:return t=e.v.manifest,e.a(2,t)}},r)})),function(){return n.apply(this,arguments)})})}export{n as default};
@@ -0,0 +1 @@
1
+ import r from"@babel/runtime/helpers/regenerator";import e from"@babel/runtime/helpers/asyncToGenerator";function n(){var n,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},i=t.manifest,a=t.units;return{id:"scaleBar",manifest:i,units:void 0===a?"metric":a,load:(n=e(r().m(function e(){var n;return r().w(function(r){for(;;)switch(r.n){case 0:return r.n=1,import(/* webpackChunkName: "im-scale-bar-plugin" */ "./im-scale-bar-plugin.js");case 1:return n=r.v.manifest,r.a(2,n)}},e)})),function(){return n.apply(this,arguments)})}}export{n as default};