react-spatial 1.4.0-beta.2 → 1.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (296) hide show
  1. package/.github/workflows/conventional-pr-title.yml +21 -0
  2. package/.github/workflows/main.yml +28 -0
  3. package/.husky/commit-msg +4 -0
  4. package/.husky/post-checkout +4 -0
  5. package/.husky/post-merge +4 -0
  6. package/.husky/post-rebase +4 -0
  7. package/.husky/pre-commit +4 -0
  8. package/.nvmrc +1 -0
  9. package/.whitesource +8 -0
  10. package/CHANGELOG.md +54 -0
  11. package/DEVELOP.md +113 -0
  12. package/README.md +1 -1
  13. package/__mocks__/mapbox-gl.js +11 -0
  14. package/__mocks__/resize-observer-polyfill.js +9 -0
  15. package/babel.config.js +3 -0
  16. package/commitlint.config.js +1 -0
  17. package/data/topic1.js +119 -0
  18. package/data/topic2.js +28 -0
  19. package/doc/README.md +21 -0
  20. package/doc/doc-config.json +4 -0
  21. package/netlify.toml +3 -0
  22. package/package.json +31 -41
  23. package/pull_request_template.md +16 -0
  24. package/renovate.json +4 -0
  25. package/scripts/read-pkg-json.js +17 -0
  26. package/src/components/BaseLayerSwitcher/BaseLayerSwitcher.js +322 -0
  27. package/src/components/BaseLayerSwitcher/BaseLayerSwitcher.test.js +69 -0
  28. package/src/components/BaseLayerSwitcher/README.md +61 -0
  29. package/src/components/BaseLayerSwitcher/__snapshots__/BaseLayerSwitcher.test.js.snap +88 -0
  30. package/src/components/BaseLayerSwitcher/index.js +1 -0
  31. package/src/components/BasicMap/BasicMap.js +413 -0
  32. package/src/components/BasicMap/BasicMap.test.js +281 -0
  33. package/src/components/BasicMap/README.md +18 -0
  34. package/src/components/BasicMap/index.js +1 -0
  35. package/{components → src/components}/CanvasSaveButton/CanvasSaveButton.js +320 -93
  36. package/src/components/CanvasSaveButton/CanvasSaveButton.test.js +148 -0
  37. package/src/components/CanvasSaveButton/README.md +76 -0
  38. package/src/components/CanvasSaveButton/__snapshots__/CanvasSaveButton.test.js.snap +76 -0
  39. package/src/components/CanvasSaveButton/index.js +1 -0
  40. package/src/components/Copyright/Copyright.js +89 -0
  41. package/src/components/Copyright/Copyright.test.js +134 -0
  42. package/src/components/Copyright/README.md +36 -0
  43. package/src/components/Copyright/index.js +1 -0
  44. package/src/components/FeatureExportButton/FeatureExportButton.js +118 -0
  45. package/src/components/FeatureExportButton/FeatureExportButton.test.js +417 -0
  46. package/src/components/FeatureExportButton/README.md +76 -0
  47. package/src/components/FeatureExportButton/__snapshots__/FeatureExportButton.test.js.snap +67 -0
  48. package/src/components/FeatureExportButton/index.js +1 -0
  49. package/src/components/FitExtent/FitExtent.js +62 -0
  50. package/src/components/FitExtent/FitExtent.test.js +48 -0
  51. package/src/components/FitExtent/README.md +34 -0
  52. package/src/components/FitExtent/__snapshots__/FitExtent.test.js.snap +13 -0
  53. package/src/components/FitExtent/index.js +1 -0
  54. package/{components → src/components}/Geolocation/Geolocation.js +144 -61
  55. package/src/components/Geolocation/Geolocation.test.js +267 -0
  56. package/src/components/Geolocation/README.md +25 -0
  57. package/src/components/Geolocation/__snapshots__/Geolocation.test.js.snap +92 -0
  58. package/src/components/Geolocation/index.js +1 -0
  59. package/src/components/LayerTree/LayerTree.js +487 -0
  60. package/src/components/LayerTree/LayerTree.test.js +337 -0
  61. package/src/components/LayerTree/README.md +92 -0
  62. package/src/components/LayerTree/__snapshots__/LayerTree.test.js.snap +1746 -0
  63. package/src/components/LayerTree/index.js +1 -0
  64. package/src/components/MousePosition/MousePosition.js +175 -0
  65. package/src/components/MousePosition/MousePosition.test.js +132 -0
  66. package/src/components/MousePosition/README.md +50 -0
  67. package/src/components/MousePosition/__snapshots__/MousePosition.test.js.snap +76 -0
  68. package/src/components/MousePosition/index.js +1 -0
  69. package/src/components/NorthArrow/NorthArrow.js +75 -0
  70. package/src/components/NorthArrow/NorthArrow.test.js +104 -0
  71. package/src/components/NorthArrow/README.md +59 -0
  72. package/src/components/NorthArrow/__snapshots__/NorthArrow.test.js.snap +117 -0
  73. package/src/components/NorthArrow/index.js +1 -0
  74. package/src/components/Overlay/Overlay.js +176 -0
  75. package/src/components/Overlay/Overlay.test.js +149 -0
  76. package/src/components/Overlay/README.md +59 -0
  77. package/src/components/Overlay/__snapshots__/Overlay.test.js.snap +9 -0
  78. package/src/components/Overlay/index.js +1 -0
  79. package/src/components/Permalink/Permalink.js +326 -0
  80. package/src/components/Permalink/Permalink.test.js +285 -0
  81. package/src/components/Permalink/README.md +105 -0
  82. package/src/components/Permalink/index.js +1 -0
  83. package/{components → src/components}/Popup/Popup.js +165 -55
  84. package/src/components/Popup/Popup.test.js +307 -0
  85. package/src/components/Popup/README.md +93 -0
  86. package/src/components/Popup/__snapshots__/Popup.test.js.snap +180 -0
  87. package/src/components/Popup/index.js +1 -0
  88. package/src/components/README.md +41 -0
  89. package/{components → src/components}/ResizeHandler/ResizeHandler.js +50 -15
  90. package/src/components/ResizeHandler/ResizeHandler.test.js +344 -0
  91. package/src/components/ResizeHandler/index.js +1 -0
  92. package/src/components/RouteSchedule/README.md +118 -0
  93. package/src/components/RouteSchedule/RouteSchedule.js +364 -0
  94. package/src/components/RouteSchedule/RouteSchedule.test.js +113 -0
  95. package/src/components/RouteSchedule/__snapshots__/RouteSchedule.test.js.snap +248 -0
  96. package/src/components/RouteSchedule/index.js +1 -0
  97. package/src/components/ScaleLine/README.md +29 -0
  98. package/src/components/ScaleLine/ScaleLine.js +50 -0
  99. package/src/components/ScaleLine/ScaleLine.test.js +30 -0
  100. package/src/components/ScaleLine/__snapshots__/ScaleLine.test.js.snap +7 -0
  101. package/src/components/ScaleLine/index.js +1 -0
  102. package/src/components/StopsFinder/README.md +50 -0
  103. package/src/components/StopsFinder/StopsFinder.js +284 -0
  104. package/src/components/StopsFinder/StopsFinder.test.js +17 -0
  105. package/src/components/StopsFinder/StopsFinderOption.js +61 -0
  106. package/src/components/StopsFinder/__snapshots__/StopsFinder.test.js.snap +133 -0
  107. package/src/components/StopsFinder/index.js +1 -0
  108. package/src/components/Zoom/README.md +25 -0
  109. package/src/components/Zoom/Zoom.js +180 -0
  110. package/src/components/Zoom/Zoom.test.js +141 -0
  111. package/src/components/Zoom/__snapshots__/Zoom.test.js.snap +201 -0
  112. package/src/components/Zoom/index.js +1 -0
  113. package/{propTypes.js → src/propTypes.js} +16 -12
  114. package/{setupTests.js → src/setupTests.js} +1 -1
  115. package/src/styleguidist/ComponentsList.js +52 -0
  116. package/src/styleguidist/StyleGuide.js +277 -0
  117. package/src/styleguidist/styleguidist.css +38 -0
  118. package/src/utils/GlobalsForOle.js +99 -0
  119. package/src/utils/KML.js +594 -0
  120. package/src/utils/KML.test.js +337 -0
  121. package/src/utils/KMLFormat.js +100 -0
  122. package/src/utils/KMLFormat.test.js +50 -0
  123. package/{utils → src/utils}/Styles.js +20 -14
  124. package/src/utils/__snapshots__/KML.test.js.snap.KML-readFeatures()-and-writeFeatures()-should-read-and-write-lineDash-and-fillPattern-style-for-polygon.canvas-image.png +0 -0
  125. package/src/utils/__snapshots__/getPolygonPattern.test.js.snap.getPolygonPattern()-render-pattern-2-(cross)-color-and-(light-blue)-opacity.canvas-image.png +0 -0
  126. package/src/utils/__snapshots__/getPolygonPattern.test.js.snap.getPolygonPattern()-render-pattern-3-(diagonal-line-from-bottom-left-tot-top-right)-with-color-(light-blue)-and-opacity.canvas-image.png +0 -0
  127. package/src/utils/__snapshots__/getPolygonPattern.test.js.snap.getPolygonPattern()-render-pattern-4-(diagonal-line-from-top-left-to-bottom-right)-with-color-(light-blue)-and-opacity.canvas-image.png +0 -0
  128. package/{utils → src/utils}/getPolygonPattern.js +34 -6
  129. package/src/utils/getPolygonPattern.test.js +61 -0
  130. package/{utils → src/utils}/timeUtils.js +22 -5
  131. package/src/utils/timeUtils.test.js +30 -0
  132. package/styleguide.config.js +251 -0
  133. package/components/BaseLayerSwitcher/BaseLayerSwitcher.js +0 -231
  134. package/components/BaseLayerSwitcher/BaseLayerSwitcher.js.map +0 -7
  135. package/components/BaseLayerSwitcher/index.js +0 -1
  136. package/components/BaseLayerSwitcher/index.js.map +0 -7
  137. package/components/BasicMap/BasicMap.js +0 -278
  138. package/components/BasicMap/BasicMap.js.map +0 -7
  139. package/components/BasicMap/index.js +0 -1
  140. package/components/BasicMap/index.js.map +0 -7
  141. package/components/CanvasSaveButton/CanvasSaveButton.js.map +0 -7
  142. package/components/CanvasSaveButton/index.js +0 -1
  143. package/components/CanvasSaveButton/index.js.map +0 -7
  144. package/components/Copyright/Copyright.js +0 -55
  145. package/components/Copyright/Copyright.js.map +0 -7
  146. package/components/Copyright/index.js +0 -1
  147. package/components/Copyright/index.js.map +0 -7
  148. package/components/FeatureExportButton/FeatureExportButton.js +0 -62
  149. package/components/FeatureExportButton/FeatureExportButton.js.map +0 -7
  150. package/components/FeatureExportButton/index.js +0 -1
  151. package/components/FeatureExportButton/index.js.map +0 -7
  152. package/components/FitExtent/FitExtent.js +0 -32
  153. package/components/FitExtent/FitExtent.js.map +0 -7
  154. package/components/FitExtent/index.js +0 -1
  155. package/components/FitExtent/index.js.map +0 -7
  156. package/components/Geolocation/Geolocation.js.map +0 -7
  157. package/components/Geolocation/index.js +0 -1
  158. package/components/Geolocation/index.js.map +0 -7
  159. package/components/LayerTree/LayerTree.js +0 -278
  160. package/components/LayerTree/LayerTree.js.map +0 -7
  161. package/components/LayerTree/index.js +0 -1
  162. package/components/LayerTree/index.js.map +0 -7
  163. package/components/MousePosition/MousePosition.js +0 -110
  164. package/components/MousePosition/MousePosition.js.map +0 -7
  165. package/components/MousePosition/index.js +0 -1
  166. package/components/MousePosition/index.js.map +0 -7
  167. package/components/NorthArrow/NorthArrow.js +0 -43
  168. package/components/NorthArrow/NorthArrow.js.map +0 -7
  169. package/components/NorthArrow/index.js +0 -1
  170. package/components/NorthArrow/index.js.map +0 -7
  171. package/components/Overlay/Overlay.js +0 -122
  172. package/components/Overlay/Overlay.js.map +0 -7
  173. package/components/Overlay/index.js +0 -1
  174. package/components/Overlay/index.js.map +0 -7
  175. package/components/Permalink/Permalink.js +0 -206
  176. package/components/Permalink/Permalink.js.map +0 -7
  177. package/components/Permalink/index.js +0 -1
  178. package/components/Permalink/index.js.map +0 -7
  179. package/components/Popup/Popup.js.map +0 -7
  180. package/components/Popup/index.js +0 -1
  181. package/components/Popup/index.js.map +0 -7
  182. package/components/ResizeHandler/ResizeHandler.js.map +0 -7
  183. package/components/ResizeHandler/index.js +0 -1
  184. package/components/ResizeHandler/index.js.map +0 -7
  185. package/components/RouteSchedule/RouteSchedule.js +0 -220
  186. package/components/RouteSchedule/RouteSchedule.js.map +0 -7
  187. package/components/RouteSchedule/index.js +0 -1
  188. package/components/RouteSchedule/index.js.map +0 -7
  189. package/components/ScaleLine/ScaleLine.js +0 -32
  190. package/components/ScaleLine/ScaleLine.js.map +0 -7
  191. package/components/ScaleLine/index.js +0 -1
  192. package/components/ScaleLine/index.js.map +0 -7
  193. package/components/StopsFinder/StopsFinder.js +0 -210
  194. package/components/StopsFinder/StopsFinder.js.map +0 -7
  195. package/components/StopsFinder/StopsFinderOption.js +0 -50
  196. package/components/StopsFinder/StopsFinderOption.js.map +0 -7
  197. package/components/StopsFinder/index.js +0 -1
  198. package/components/StopsFinder/index.js.map +0 -7
  199. package/components/Zoom/Zoom.js +0 -120
  200. package/components/Zoom/Zoom.js.map +0 -7
  201. package/components/Zoom/index.js +0 -1
  202. package/components/Zoom/index.js.map +0 -7
  203. package/propTypes.js.map +0 -7
  204. package/setupTests.js.map +0 -7
  205. package/utils/GlobalsForOle.js +0 -94
  206. package/utils/GlobalsForOle.js.map +0 -7
  207. package/utils/KML.js +0 -412
  208. package/utils/KML.js.map +0 -7
  209. package/utils/KMLFormat.js +0 -69
  210. package/utils/KMLFormat.js.map +0 -7
  211. package/utils/Styles.js.map +0 -7
  212. package/utils/getPolygonPattern.js.map +0 -7
  213. package/utils/timeUtils.js.map +0 -7
  214. /package/{components → src/components}/BaseLayerSwitcher/BaseLayerSwitcher.md.scss +0 -0
  215. /package/{components → src/components}/BaseLayerSwitcher/BaseLayerSwitcher.scss +0 -0
  216. /package/{components → src/components}/BasicMap/BasicMap.md.scss +0 -0
  217. /package/{components → src/components}/CanvasSaveButton/CanvasSaveButton.md.scss +0 -0
  218. /package/{components → src/components}/Copyright/Copyright.md.scss +0 -0
  219. /package/{components → src/components}/FeatureExportButton/FeatureExportButton.md.scss +0 -0
  220. /package/{components → src/components}/FitExtent/FitExtent.md.scss +0 -0
  221. /package/{components → src/components}/Geolocation/Geolocation.md.scss +0 -0
  222. /package/{components → src/components}/Geolocation/Geolocation.scss +0 -0
  223. /package/{components → src/components}/LayerTree/LayerTree.md.scss +0 -0
  224. /package/{components → src/components}/LayerTree/LayerTree.scss +0 -0
  225. /package/{components → src/components}/MousePosition/MousePosition.md.scss +0 -0
  226. /package/{components → src/components}/NorthArrow/NorthArrow.scss +0 -0
  227. /package/{components → src/components}/Overlay/Overlay.md.scss +0 -0
  228. /package/{components → src/components}/Overlay/Overlay.scss +0 -0
  229. /package/{components → src/components}/Permalink/Permalink.md.scss +0 -0
  230. /package/{components → src/components}/Popup/Popup.md.scss +0 -0
  231. /package/{components → src/components}/Popup/Popup.scss +0 -0
  232. /package/{components → src/components}/RouteSchedule/RouteSchedule.md.scss +0 -0
  233. /package/{components → src/components}/RouteSchedule/RouteSchedule.scss +0 -0
  234. /package/{components → src/components}/ScaleLine/ScaleLine.scss +0 -0
  235. /package/{components → src/components}/Zoom/Zoom.md.scss +0 -0
  236. /package/{components → src/components}/Zoom/Zoom.scss +0 -0
  237. /package/{images → src/images}/RouteSchedule/firstStation.png +0 -0
  238. /package/{images → src/images}/RouteSchedule/lastStation.png +0 -0
  239. /package/{images → src/images}/RouteSchedule/line.png +0 -0
  240. /package/{images → src/images}/RouteSchedule/station.png +0 -0
  241. /package/{images → src/images}/baselayer/baselayer.basebright.png +0 -0
  242. /package/{images → src/images}/baselayer/baselayer.osm.png +0 -0
  243. /package/{images → src/images}/baselayer/baselayer.travic.png +0 -0
  244. /package/{images → src/images}/baselayer/open.topo.map.png +0 -0
  245. /package/{images → src/images}/baselayer/osm.baselayer.hot.png +0 -0
  246. /package/{images → src/images}/baselayer/osm.baselayer.png +0 -0
  247. /package/{images → src/images}/favicon.png +0 -0
  248. /package/{images → src/images}/geops_logo.png +0 -0
  249. /package/{images → src/images}/geops_logo.svg +0 -0
  250. /package/{images → src/images}/geops_qr.png +0 -0
  251. /package/{images → src/images}/mots/bus_poi-blue-01.svg +0 -0
  252. /package/{images → src/images}/mots/bus_poi-grey-01.svg +0 -0
  253. /package/{images → src/images}/mots/bus_round-blue-01.svg +0 -0
  254. /package/{images → src/images}/mots/bus_round-grey-01.svg +0 -0
  255. /package/{images → src/images}/mots/bus_square-blue-01.svg +0 -0
  256. /package/{images → src/images}/mots/bus_square-grey-01.svg +0 -0
  257. /package/{images → src/images}/mots/cable_car_poi-blue-01.svg +0 -0
  258. /package/{images → src/images}/mots/cable_car_poi-grey-01.svg +0 -0
  259. /package/{images → src/images}/mots/cable_car_round-blue-01.svg +0 -0
  260. /package/{images → src/images}/mots/cable_car_round-grey-01.svg +0 -0
  261. /package/{images → src/images}/mots/cable_car_square-blue-01.svg +0 -0
  262. /package/{images → src/images}/mots/cable_car_square-grey-01.svg +0 -0
  263. /package/{images → src/images}/mots/ferry_poi-blue-01.svg +0 -0
  264. /package/{images → src/images}/mots/ferry_poi-grey-01.svg +0 -0
  265. /package/{images → src/images}/mots/ferry_round-blue-01.svg +0 -0
  266. /package/{images → src/images}/mots/ferry_round-grey-01.svg +0 -0
  267. /package/{images → src/images}/mots/ferry_square-blue-01.svg +0 -0
  268. /package/{images → src/images}/mots/ferry_square-grey-01.svg +0 -0
  269. /package/{images → src/images}/mots/funicular_round-blue-01.svg +0 -0
  270. /package/{images → src/images}/mots/funicular_round-grey-01.svg +0 -0
  271. /package/{images → src/images}/mots/funicular_square-blue-01.svg +0 -0
  272. /package/{images → src/images}/mots/gondola_round-blue-01.svg +0 -0
  273. /package/{images → src/images}/mots/rail_poi-blue-01.svg +0 -0
  274. /package/{images → src/images}/mots/rail_poi-grey-01.svg +0 -0
  275. /package/{images → src/images}/mots/rail_round-blue-01.svg +0 -0
  276. /package/{images → src/images}/mots/rail_round-grey-01.svg +0 -0
  277. /package/{images → src/images}/mots/rail_square-blue-01.svg +0 -0
  278. /package/{images → src/images}/mots/rail_square-grey-01.svg +0 -0
  279. /package/{images → src/images}/mots/subway_round blue-01.svg +0 -0
  280. /package/{images → src/images}/mots/subway_round-blue-01.svg +0 -0
  281. /package/{images → src/images}/mots/tram_poi-blue-01.svg +0 -0
  282. /package/{images → src/images}/mots/tram_poi-grey-01.svg +0 -0
  283. /package/{images → src/images}/mots/tram_round-blue-01.svg +0 -0
  284. /package/{images → src/images}/mots/tram_round-grey-01.svg +0 -0
  285. /package/{images → src/images}/mots/tram_square-blue-01.svg +0 -0
  286. /package/{images → src/images}/mots/tram_square-grey-01.svg +0 -0
  287. /package/{images → src/images}/northArrow.svg +0 -0
  288. /package/{images → src/images}/northArrow.url.svg +0 -0
  289. /package/{images → src/images}/northArrowCircle.svg +0 -0
  290. /package/{images → src/images}/northArrowCircle.url.svg +0 -0
  291. /package/{themes → src/themes}/README.md +0 -0
  292. /package/{themes → src/themes}/default/components.scss +0 -0
  293. /package/{themes → src/themes}/default/examples.scss +0 -0
  294. /package/{themes → src/themes}/default/index.scss +0 -0
  295. /package/{themes → src/themes}/default/mixins.scss +0 -0
  296. /package/{themes → src/themes}/default/variables.scss +0 -0
@@ -0,0 +1,21 @@
1
+ name: Check PR title
2
+ on:
3
+ pull_request:
4
+ types:
5
+ - opened
6
+ - reopened
7
+ - edited
8
+ - synchronize
9
+
10
+ jobs:
11
+ lint:
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - uses: aslafy-z/conventional-pr-title-action@v2.2.0
15
+ with:
16
+ success-state: Title follows the specification.
17
+ failure-state: Title does not follow the specification.
18
+ context-name: conventional-pr-title
19
+ preset: conventional-changelog-angular@latest
20
+ env:
21
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
@@ -0,0 +1,28 @@
1
+ name: main
2
+
3
+ on:
4
+ pull_request:
5
+ push:
6
+ branches:
7
+ - master
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+
13
+ steps:
14
+ - name: Checkout
15
+ uses: actions/checkout@v3
16
+
17
+ - name: Setup node
18
+ uses: actions/setup-node@v3
19
+ with:
20
+ node-version-file: '.nvmrc'
21
+
22
+ - name: Run linting and tests
23
+ run: |
24
+ yarn install --frozen-lockfile
25
+ yarn lint
26
+ yarn test
27
+ env:
28
+ CI: true
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env sh
2
+ . "$(dirname -- "$0")/_/husky.sh"
3
+
4
+ yarn commitlint --edit $1
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ yarn install --frozen-lockfile
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ yarn install --frozen-lockfile
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ yarn install --frozen-lockfile
@@ -0,0 +1,4 @@
1
+ #!/bin/sh
2
+ . "$(dirname "$0")/_/husky.sh"
3
+
4
+ sort && CI=true npx lint-staged
package/.nvmrc ADDED
@@ -0,0 +1 @@
1
+ 16
package/.whitesource ADDED
@@ -0,0 +1,8 @@
1
+ ##########################################################
2
+ #### WhiteSource Integration configuration file ####
3
+ ##########################################################
4
+
5
+ # Configuration #
6
+ #---------------#
7
+ ws.repo.scan=true
8
+ vulnerable.check.run.conclusion.level=failure
package/CHANGELOG.md ADDED
@@ -0,0 +1,54 @@
1
+ # Changelog
2
+
3
+ All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
+
5
+ ### [1.4.1](https://github.com/geops/react-spatial/compare/v1.4.0...v1.4.1) (2023-04-28)
6
+
7
+
8
+ ### Bug Fixes
9
+
10
+ * use a more intuitive zooming behavior ([2d43f31](https://github.com/geops/react-spatial/commit/2d43f3189096b2195e0b550e8fb2d9d994746a8a))
11
+
12
+ ## [1.4.0](https://github.com/geops/react-spatial/compare/v1.3.2...v1.4.0) (2023-01-09)
13
+
14
+
15
+ ### Features
16
+
17
+ * **CanvasSaveButton:** add extraData.qrCode option to insert QR code in canvas export ([#700](https://github.com/geops/react-spatial/issues/700)) ([16be889](https://github.com/geops/react-spatial/commit/16be889d97682c2a2d21c2fa17d55cae205e09da))
18
+
19
+ ### [1.3.2](https://github.com/geops/react-spatial/compare/v1.3.1...v1.3.2) (2022-12-15)
20
+
21
+
22
+ ### Bug Fixes
23
+
24
+ * fix use of baselayers permalink and baselayerswitcher ([#699](https://github.com/geops/react-spatial/issues/699)) ([23af45f](https://github.com/geops/react-spatial/commit/23af45f5681cc50cfc4c60502b71c161a478fe71))
25
+
26
+ ### [1.3.1](https://github.com/geops/react-spatial/compare/v1.3.1-beta.0...v1.3.1) (2022-12-15)
27
+
28
+
29
+ ### Bug Fixes
30
+
31
+ * fix detection of base layer in permalink ([9099ba7](https://github.com/geops/react-spatial/commit/9099ba704d15c670e87f8cb9245f06f159078f3e))
32
+
33
+ ## [1.3.0](https://github.com/geops/react-spatial/compare/v1.3.0-beta.1...v1.3.0) (2022-11-14)
34
+
35
+
36
+ ### Bug Fixes
37
+
38
+ * **LayerTree:** add input and toggle props for layer tree renderItemContent ([#697](https://github.com/geops/react-spatial/issues/697)) ([8df5237](https://github.com/geops/react-spatial/commit/8df5237482373dc9c9de1ab9cfecefaf3472dcba))
39
+
40
+ ### [1.2.2](https://github.com/geops/react-spatial/compare/v1.2.1...v1.2.2) (2022-07-22)
41
+
42
+ ### [1.2.1](https://github.com/geops/react-spatial/compare/v1.2.0...v1.2.1) (2022-07-22)
43
+
44
+
45
+ ### Bug Fixes
46
+
47
+ * make component better work with nextjs image sand routing ([#694](https://github.com/geops/react-spatial/issues/694)) ([85871fe](https://github.com/geops/react-spatial/commit/85871fe2201ecad0de76442bc9d77815bfe6db27))
48
+
49
+ ## [1.2.0](https://github.com/geops/react-spatial/compare/v1.0.35...v1.2.0) (2022-06-20)
50
+
51
+
52
+ ### Features
53
+
54
+ * use standard-version and commitlint for automatic versioning and changelog ([#690](https://github.com/geops/react-spatial/issues/690)) ([2c83f00](https://github.com/geops/react-spatial/commit/2c83f00c05f5b76b3f7e38978fb022d7cebfbcfc))
package/DEVELOP.md ADDED
@@ -0,0 +1,113 @@
1
+ # Develop
2
+
3
+ ## Create new component
4
+
5
+ Follow the [guidelines](https://github.com/geops/react-spatial/tree/master/src/components).
6
+
7
+ ## Create new theme
8
+
9
+ Follow the [guidelines](https://github.com/geops/react-spatial/tree/master/src/themes).
10
+
11
+ ## Documentation
12
+
13
+ We are using [react-styleguidist](https://react-styleguidist.js.org/).
14
+ Documentation and examples are available [here](https://react-spatial.geops.de/).
15
+
16
+ Build the doc:
17
+
18
+ ```bash
19
+ yarn doc
20
+ ```
21
+
22
+ Run the doc on [`locahost:6060`](http://locahost:6060/):
23
+
24
+ ```bash
25
+ yarn start
26
+ ```
27
+
28
+ ## Tests
29
+
30
+ We are using [jest]([https://react-styleguidist.js.org/](https://jestjs.io/docs/en/getting-started.html)) and [enzyme]([https://github.com/airbnb/enzyme](https://airbnb.io/enzyme/)).
31
+
32
+ Run the tests in watch mode:
33
+
34
+ ```bash
35
+ yarn test --watch
36
+ ```
37
+
38
+ ## Coverage
39
+
40
+ Run coverage:
41
+
42
+ ```bash
43
+ yarn coverage
44
+ ```
45
+
46
+ Then open the file `coverage/lcov-report/index.html` in your browser.
47
+
48
+ ## Publish on [npmjs.com](https://www.npmjs.com/package/react-spatial)
49
+
50
+ Run publish:
51
+
52
+ ```bash
53
+ publish:public
54
+ ```
55
+ You need to enter the new version number in the command line.
56
+ Then the new version must be published on [npmjs.com](https://www.npmjs.com/package/react-spatial).
57
+
58
+ ## Publish a development version on [npmjs.com](https://www.npmjs.com/package/react-spatial)
59
+
60
+ This version WILL NOT be displayed to other in [npmjs.com](https://www.npmjs.com/package/react-spatial).
61
+
62
+ Run publish:
63
+
64
+ ```bash
65
+ publish:beta
66
+ ```
67
+
68
+ You need to enter the new version number in the command line.
69
+ Append `-beta.0` to the current version or increase the beta number.
70
+ Then the new version must be published on [npmjs.com](https://www.npmjs.com/package/react-spatial) with the tag beta.
71
+
72
+ ## How to use SVG
73
+
74
+ Before adding an SVG file in this folder please clean it using [svgo](https://www.npmjs.com/package/svgo) or [svgomg](https://jakearchibald.github.io/svgomg/).
75
+
76
+ After optimization, verify you can use it Openlayers using this [code sandbox](https://codesandbox.io/s/5w5o4mqwlk).
77
+
78
+ By default the svg loader will load the svg file as a react component if you want to load svg file as a base64 data URI use the extension .url.svg :
79
+
80
+ ```javascript
81
+ // Import as a React component:
82
+ import NorthArrow from 'northArrow.svg';
83
+ // Use: <NorthArrow />
84
+
85
+ // Import as a base64 data URI (or with an url the file is too big):
86
+ import northArrow from 'northArrow.url.svg';
87
+ // northArrow = "data:image/svg+xml;base64,PHN2ZyB4...."
88
+ ```
89
+
90
+ You could also use others loaders (ex: svg-inline-loader , svg-url-loader ...) .
91
+ To use these loaders just adapt the extension of the svg file and add the loader config in styleguide.config.js, then you will be able to use it like this :
92
+
93
+ ```javascript
94
+ // Import as an inline svg:
95
+ import northArrow from 'northArrow.svginline.svg';
96
+ // northArrow = "<svg xmlns='http://www.w3.org/2000/svg' height='192' ...> ... </svg>"
97
+
98
+ // Import as an encoded inline svg data URI (or with an url the file is too big):
99
+ import northArrow from 'northArrow.svgurl.svg';
100
+ // northArrow = "data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='192' ...%3E ... %3C/svg%3E"
101
+ ```
102
+
103
+ ## How to use SVG with a dynamic size
104
+
105
+ In case you want your SVG fits perfectly his parent div you need to remove `width` and `height` attributes of `<svg>` and replace it by a `viewBox` property, like this:
106
+
107
+ Replace
108
+
109
+ `<svg width="192" height="192">`
110
+
111
+ by
112
+
113
+ `<svg viewBox="0 0 192 192">`
package/README.md CHANGED
@@ -10,7 +10,7 @@ This library provides React components to build web applications and to visualiz
10
10
 
11
11
  This library uses the [mobility-toolbox-js](https://mobility-toolbox-js.geops.io/) library.
12
12
 
13
- Documentation and examples at https://react-spatial.geops.de.
13
+ Documentation and examples at https://react-spatial.geops.io.
14
14
 
15
15
  ## Getting Started
16
16
 
@@ -0,0 +1,11 @@
1
+ /* eslint-disable class-methods-use-this */
2
+ class Map {
3
+ isStyleLoaded() {}
4
+
5
+ getCanvas() {}
6
+
7
+ once() {}
8
+ }
9
+ module.exports = {
10
+ Map,
11
+ };
@@ -0,0 +1,9 @@
1
+ /* eslint-disable */
2
+ export default class ResizeObserver {
3
+ constructor(onResize) {
4
+ ResizeObserver.onResize = onResize;
5
+ }
6
+ observe() {}
7
+ unobserve() {}
8
+ disconnect() {}
9
+ }
@@ -0,0 +1,3 @@
1
+ module.exports = {
2
+ presets: ['@babel/preset-env', '@babel/preset-react'],
3
+ };
@@ -0,0 +1 @@
1
+ module.exports = { extends: ['@commitlint/config-conventional'] };
package/data/topic1.js ADDED
@@ -0,0 +1,119 @@
1
+ import Style from 'ol/style/Style';
2
+ import Circle from 'ol/style/Circle';
3
+ import Stroke from 'ol/style/Stroke';
4
+ import Fill from 'ol/style/Fill';
5
+
6
+ const topic1 = {
7
+ id: 'topic1',
8
+ name: 'Topic 1',
9
+ visible: true,
10
+ children: [
11
+ {
12
+ name: 'OSM Baselayer',
13
+ visible: true,
14
+ isBaseLayer: true,
15
+ data: {
16
+ type: 'xyz',
17
+ url: 'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png',
18
+ },
19
+ },
20
+ {
21
+ name: 'Other layers',
22
+ visible: true,
23
+ type: 'parent',
24
+ children: [
25
+ {
26
+ name: 'Countries Borders',
27
+ visible: false,
28
+ data: {
29
+ type: 'vectorLayer',
30
+ url:
31
+ 'https://openlayers.org/en/latest/examples/data/geojson/' +
32
+ 'countries.geojson',
33
+ },
34
+ },
35
+ {
36
+ name: 'USA Population Density',
37
+ visible: true,
38
+ data: {
39
+ type: 'wmts',
40
+ url:
41
+ 'https://services.arcgisonline.com/arcgis/rest/services/' +
42
+ 'Demographics/USA_Population_Density/MapServer/WMTS/?layer=0' +
43
+ '&style=default&tilematrixset=EPSG%3A3857&Service=WMTS&' +
44
+ 'Request=GetTile&Version=1.0.0&Format=image%2Fpng&',
45
+ projection: 'EPSG:3857',
46
+ },
47
+ },
48
+ ],
49
+ },
50
+ {
51
+ name: 'Vector sample layers',
52
+ visible: true,
53
+ radioGroup: 'radio',
54
+ children: [
55
+ {
56
+ name: 'Points Samples',
57
+ radioGroup: 'vectorLayers',
58
+ visible: false,
59
+ data: {
60
+ style: new Style({
61
+ image: new Circle({
62
+ radius: 5,
63
+ fill: new Fill({
64
+ color: '#ff0000',
65
+ }),
66
+ }),
67
+ }),
68
+ type: 'vectorLayer',
69
+ url:
70
+ 'https://raw.githubusercontent.com/openlayers/openlayers/' +
71
+ '3c64018b3754cf605ea19cbbe4c8813304da2539/examples/data/geojson/' +
72
+ 'point-samples.geojson',
73
+ },
74
+ },
75
+ {
76
+ name: 'Lines Samples',
77
+ radioGroup: 'vectorLayers',
78
+ visible: true,
79
+ data: {
80
+ style: new Style({
81
+ stroke: new Stroke({
82
+ color: '#ffcc33',
83
+ width: 2,
84
+ }),
85
+ }),
86
+ type: 'vectorLayer',
87
+ url:
88
+ 'https://raw.githubusercontent.com/openlayers/openlayers/' +
89
+ '3c64018b3754cf605ea19cbbe4c8813304da2539/examples/data/geojson/' +
90
+ 'line-samples.geojson',
91
+ },
92
+ },
93
+ {
94
+ name: 'Polygons Samples',
95
+ radioGroup: 'vectorLayers',
96
+ visible: false,
97
+ data: {
98
+ style: new Style({
99
+ stroke: new Stroke({
100
+ color: '#7dff8f',
101
+ width: 3,
102
+ }),
103
+ fill: new Fill({
104
+ color: 'rgba(125, 255, 143, 0.2)',
105
+ }),
106
+ }),
107
+ type: 'vectorLayer',
108
+ url:
109
+ 'https://raw.githubusercontent.com/openlayers/openlayers/' +
110
+ '3c64018b3754cf605ea19cbbe4c8813304da2539/examples/data/geojson/' +
111
+ 'polygon-samples.geojson',
112
+ },
113
+ },
114
+ ],
115
+ },
116
+ ],
117
+ };
118
+
119
+ export default topic1;
package/data/topic2.js ADDED
@@ -0,0 +1,28 @@
1
+ const topic2 = {
2
+ id: 'topic2',
3
+ name: 'Topic 2',
4
+ visible: false,
5
+ children: [
6
+ {
7
+ name: 'OSM Baselayer',
8
+ visible: true,
9
+ isBaseLayer: true,
10
+ data: {
11
+ type: 'xyz',
12
+ url: 'https://c.tile.openstreetmap.org/{z}/{x}/{y}.png',
13
+ },
14
+ },
15
+ {
16
+ name: 'Countries Borders',
17
+ visible: true,
18
+ data: {
19
+ type: 'vectorLayer',
20
+ url:
21
+ 'https://openlayers.org/en/latest/examples/data/geojson/' +
22
+ 'countries.geojson',
23
+ },
24
+ },
25
+ ],
26
+ };
27
+
28
+ export default topic2;
package/doc/README.md ADDED
@@ -0,0 +1,21 @@
1
+ # Documentation in react-spatial
2
+
3
+ Two documentation tools are combined:
4
+ - react-styleguidist (https://github.com/styleguidist/react-styleguidist)
5
+ - documentation.js (https://github.com/documentationjs/documentation)
6
+
7
+ the folder published by netlify is doc/build (netlify.toml).
8
+
9
+ ## Commands
10
+
11
+ Styleguidist documentation is visible (with hot reload) with the cmd:
12
+ 'yarn start'
13
+
14
+ ## Configuration
15
+
16
+ Variables shared among both documentation are written in /doc/doc-config.json
17
+
18
+ - Styleguidist: 'styleguide.config.js
19
+ one component need to be overwritten:
20
+ - 'StyleGuideRenderer': to customize the style of the page, with our own
21
+ header, ribbon footer, etc.
@@ -0,0 +1,4 @@
1
+ {
2
+ "appName": "react-spatial",
3
+ "githubRepo": "https://github.com/geops/react-spatial"
4
+ }
package/netlify.toml ADDED
@@ -0,0 +1,3 @@
1
+ [build]
2
+ publish = "styleguide-build"
3
+ command = "yarn doc"
package/package.json CHANGED
@@ -1,19 +1,15 @@
1
1
  {
2
2
  "name": "react-spatial",
3
3
  "description": "Components to build React map apps.",
4
- "version": "1.4.0-beta.2",
4
+ "version": "1.4.1",
5
5
  "license": "MIT",
6
6
  "dependencies": {
7
7
  "@geops/geops-ui": "0.1.13",
8
8
  "@material-ui/core": "4.12.3",
9
9
  "@material-ui/icons": "4.11.2",
10
10
  "@material-ui/lab": "4.0.0-alpha.60",
11
- "abortcontroller-polyfill": "1.7.3",
12
11
  "query-string": "7.0.1",
13
- "radians-degrees": "1.0.0",
14
12
  "re-resizable": "6.9.1",
15
- "react-autosuggest": "10.1.0",
16
- "react-draggable": "4.4.4",
17
13
  "react-icons": "4.4.0",
18
14
  "resize-observer-polyfill": "1.5.1"
19
15
  },
@@ -25,26 +21,22 @@
25
21
  "react-dom": "^16"
26
22
  },
27
23
  "devDependencies": {
28
- "@babel/core": "7.15.0",
29
- "@babel/eslint-parser": "7.15.0",
30
- "@babel/plugin-transform-runtime": "7.15.0",
31
24
  "@babel/preset-env": "7.15.0",
32
25
  "@babel/preset-react": "7.14.5",
26
+ "@cfaester/enzyme-adapter-react-18": "0.7.0",
33
27
  "@commitlint/cli": "17.0.2",
34
28
  "@commitlint/config-conventional": "17.0.2",
35
29
  "@svgr/webpack": "5.5.0",
36
- "@testing-library/jest-dom": "5.16.3",
37
- "@testing-library/react": "12.1.4",
38
- "@testing-library/user-event": "13.5.0",
39
- "@wojtekmaj/enzyme-adapter-react-17": "0.6.7",
40
- "babel-core": "7.0.0-bridge.0",
41
- "babel-jest": "27.2.4",
42
- "babel-loader": "8.2.2",
43
- "buble": "0.20.0",
44
- "canvas": "2.8.0",
30
+ "@testing-library/jest-dom": "5.16.5",
31
+ "@testing-library/react": "14.0.0",
32
+ "@testing-library/user-event": "14.4.3",
33
+ "babel-jest": "29.5.0",
34
+ "babel-loader": "9.1.2",
35
+ "canvas": "2.11.2",
45
36
  "css-loader": "5.2.6",
46
37
  "enzyme": "3.11.0",
47
38
  "esbuild": "^0.15.6",
39
+ "esbuild-loader": "^3.0.1",
48
40
  "eslint": "7.32.0",
49
41
  "eslint-config-airbnb": "18.2.1",
50
42
  "eslint-config-prettier": "8.3.0",
@@ -57,30 +49,30 @@
57
49
  "fixpack": "3.0.6",
58
50
  "generact": "0.4.0",
59
51
  "husky": "8.0.1",
60
- "identity-obj-proxy": "3.0.0",
61
- "jest": "26.6.3",
62
- "jest-canvas-mock": "2.3.1",
63
- "jest-canvas-snapshot-serializer": "1.0.1",
52
+ "identity-obj-proxy": "^3.0.0",
53
+ "is-ci": "3.0.1",
54
+ "jest": "29.5.0",
55
+ "jest-canvas-mock": "2.5.0",
64
56
  "jest-date-mock": "1.0.8",
57
+ "jest-environment-jsdom": "^29.5.0",
65
58
  "jest-fetch-mock": "3.0.3",
66
59
  "jest-serializer-html": "7.1.0",
67
- "jest-svg-transformer": "1.0.0",
68
60
  "jest-transform-file": "1.1.1",
61
+ "jest-transformer-svg": "^2.0.1",
69
62
  "jsts": "2.7.3",
70
63
  "lint-staged": "11.2.0",
71
64
  "mapbox-gl": "1.13.1",
72
65
  "maplibre-gl": "2.4.0",
73
- "mobility-toolbox-js": "2.0.0-beta.54",
66
+ "mobility-toolbox-js": "2.0.0-beta.79",
74
67
  "ol": "6.14.1",
75
68
  "prettier": "2.4.1",
76
69
  "proj4": "2.7.5",
77
70
  "prop-types": "15.7.2",
78
- "react": "17.0.2",
79
- "react-app-polyfill": "2.0.0",
80
- "react-dom": "17.0.2",
81
- "react-styleguidist": "11.0.8",
71
+ "react": "18",
72
+ "react-dom": "18",
73
+ "react-styleguidist": "13.1.1",
82
74
  "react-svg-loader": "3.0.3",
83
- "react-test-renderer": "17.0.2",
75
+ "react-test-renderer": "18.2.0",
84
76
  "sass": "1.49.9",
85
77
  "sass-loader": "10.2.0",
86
78
  "standard-version": "9.5.0",
@@ -90,13 +82,13 @@
90
82
  "stylelint-config-recommended-scss": "4.3.0",
91
83
  "stylelint-config-standard": "22.0.0",
92
84
  "stylelint-scss": "3.21.0",
85
+ "terser-webpack-plugin": "^5.3.7",
93
86
  "url-loader": "4.1.1",
94
87
  "vinyl-fs": "3.0.3",
95
- "webpack": "4.46.0",
88
+ "webpack": "^5.81.0",
96
89
  "xml-beautifier": "0.5.0"
97
90
  },
98
91
  "scripts": {
99
- "buble": "buble --no modules,asyncAwait -i src -o build --objectAssign Object.assign --sourcemap",
100
92
  "build": "yarn esbuild && find build -type f -name '*.test.*' -delete && rm -rf build/styleguidist && cp package.json README.md LICENSE build && cp -rf src/images build && cp -rf src/themes build",
101
93
  "coverage": "yarn test --coverage --coverageDirectory=coverage",
102
94
  "cp": "generact --root src/components",
@@ -107,6 +99,7 @@
107
99
  "lint": "eslint 'src/**/*.js' && stylelint 'src/**/*.css' 'src/**/*.scss'",
108
100
  "postbuild": "cp package.json build/ && cd src && find . -name '*.scss' | cpio -pdm ../build",
109
101
  "prebuild": "rm -rf build/",
102
+ "prepare": "is-ci || husky install",
110
103
  "publish:beta": "yarn release -- --prerelease beta --skip.changelog && git push origin HEAD && yarn run build && git push --tags && yarn publish build/ --tag beta",
111
104
  "publish:beta:dryrun": "yarn release -- --prerelease beta --dry-run --skip.changelog",
112
105
  "publish:public": "yarn release && git push origin HEAD && yarn build && git push --tags && yarn publish build/",
@@ -129,20 +122,19 @@
129
122
  "es6": true,
130
123
  "jest": true
131
124
  },
132
- "parser": "@babel/eslint-parser",
133
125
  "extends": [
134
126
  "airbnb",
135
127
  "airbnb/hooks",
136
128
  "prettier"
137
129
  ],
130
+ "parserOptions": {
131
+ "ecmaVersion": "latest"
132
+ },
138
133
  "plugins": [
139
134
  "prettier"
140
135
  ],
141
136
  "rules": {
142
- "arrow-body-style": [
143
- "error",
144
- "always"
145
- ],
137
+ "arrow-body-style": "off",
146
138
  "import/no-extraneous-dependencies": [
147
139
  "error",
148
140
  {
@@ -164,11 +156,10 @@
164
156
  }
165
157
  },
166
158
  "jest": {
167
- "maxConcurrency": 10,
159
+ "testEnvironment": "jsdom",
168
160
  "transform": {
169
161
  ".+\\.js$": "babel-jest",
170
- ".+\\.svg$": "jest-svg-transformer",
171
- "\\.(jpg|jpeg|png|gif|webp)$": "jest-transform-file"
162
+ ".+\\.svg$": "jest-transformer-svg"
172
163
  },
173
164
  "transformIgnorePatterns": [
174
165
  "node_modules/(?!(jsts|ol|mobility-toolbox-js)|@geops|geotiff|quick-lru)"
@@ -177,11 +168,10 @@
177
168
  "<rootDir>/src/**/?(*.)+(spec|test).[jt]s?(x)"
178
169
  ],
179
170
  "moduleNameMapper": {
180
- ".+\\.scss$": "identity-obj-proxy"
171
+ "\\.(jpg|jpeg|png|gif|webp|scss)$": "identity-obj-proxy"
181
172
  },
182
173
  "snapshotSerializers": [
183
- "jest-serializer-html",
184
- "jest-canvas-snapshot-serializer"
174
+ "jest-serializer-html"
185
175
  ],
186
176
  "testPathIgnorePatterns": [
187
177
  "<rootDir>/(build|coverage|public|doc|packages)"