@blaze-cms/plugin-google-maps-fe 0.124.0-alpha.2 → 0.124.0-alpha.22
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.
- package/CHANGELOG.md +174 -0
- package/lib/GoogleMaps/GoogleMaps.js +4 -3
- package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsFactory.js +3 -1
- package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsHtml.js +32 -0
- package/lib/GoogleMaps/GoogleMapsHtml.js.map +1 -0
- package/lib/GoogleMaps/GoogleMapsRender.js +3 -1
- package/lib/GoogleMaps/GoogleMapsRender.js.map +1 -1
- package/lib/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-shapes.js +23 -18
- package/lib/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-shapes-configs.js +11 -3
- package/lib/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-image-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-path.js.map +1 -1
- package/lib/GoogleMaps/helpers/index.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-map-options.js +3 -1
- package/lib/GoogleMaps/helpers/set-map-options.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-shapes.js +35 -11
- package/lib/GoogleMaps/helpers/set-shapes.js.map +1 -1
- package/lib/GoogleMaps/hooks/index.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-images.js.map +1 -1
- package/lib/GoogleMaps/index.js.map +1 -1
- package/lib/GoogleMaps/queries.js +4 -4
- package/lib/GoogleMaps/queries.js.map +1 -1
- package/lib/constants.js +5 -1
- package/lib/constants.js.map +1 -1
- package/lib/index.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMaps.js +3 -3
- package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsFactory.js +2 -1
- package/lib-es/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsHtml.js +18 -0
- package/lib-es/GoogleMaps/GoogleMapsHtml.js.map +1 -0
- package/lib-es/GoogleMaps/GoogleMapsRender.js +2 -1
- package/lib-es/GoogleMaps/GoogleMapsRender.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-map-shapes.js +10 -20
- package/lib-es/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-shapes-configs.js +8 -4
- package/lib-es/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/get-image-ids.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/get-path.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/index.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/set-map-options.js +4 -2
- package/lib-es/GoogleMaps/helpers/set-map-options.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/set-shapes.js +37 -11
- package/lib-es/GoogleMaps/helpers/set-shapes.js.map +1 -1
- package/lib-es/GoogleMaps/hooks/index.js.map +1 -1
- package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
- package/lib-es/GoogleMaps/hooks/use-get-images.js.map +1 -1
- package/lib-es/GoogleMaps/index.js.map +1 -1
- package/lib-es/GoogleMaps/queries.js +5 -0
- package/lib-es/GoogleMaps/queries.js.map +1 -1
- package/lib-es/constants.js +3 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/index.js.map +1 -1
- package/package.json +3 -3
- package/src/GoogleMaps/GoogleMaps.js +2 -1
- package/src/GoogleMaps/GoogleMapsFactory.js +2 -1
- package/src/GoogleMaps/GoogleMapsHtml.js +16 -0
- package/src/GoogleMaps/GoogleMapsRender.js +2 -1
- package/src/GoogleMaps/helpers/build-map-shapes.js +1 -18
- package/src/GoogleMaps/helpers/build-shapes-configs.js +8 -4
- package/src/GoogleMaps/helpers/set-map-options.js +5 -2
- package/src/GoogleMaps/helpers/set-shapes.js +43 -11
- package/src/GoogleMaps/queries.js +5 -0
- package/src/constants.js +8 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,180 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.124.0-alpha.22](https://byte9/thebyte9/blaze/compare/v0.124.0-alpha.21...v0.124.0-alpha.22) (2022-05-24)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.124.0-alpha.21](https://byte9/thebyte9/blaze/compare/v0.124.0-alpha.20...v0.124.0-alpha.21) (2022-05-24)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
# [0.124.0-alpha.20](https://byte9/thebyte9/blaze/compare/v0.124.0-alpha.19...v0.124.0-alpha.20) (2022-05-24)
|
|
23
|
+
|
|
24
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
# [0.124.0-alpha.19](https://byte9/thebyte9/blaze/compare/v0.124.0-alpha.18...v0.124.0-alpha.19) (2022-05-18)
|
|
31
|
+
|
|
32
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
# [0.124.0-alpha.18](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.17...v0.124.0-alpha.18) (2022-05-17)
|
|
39
|
+
|
|
40
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
41
|
+
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
# [0.124.0-alpha.16](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.15...v0.124.0-alpha.16) (2022-05-12)
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
### Features
|
|
50
|
+
|
|
51
|
+
* allow setting custom map marker colours. Improve skelton loading of maps ([#3472](https://github.com/thebyte9/blaze/issues/3472)) ([b53df68](https://github.com/thebyte9/blaze/commit/b53df68ff89d88a15849a1b0f3c09c2241b22050))
|
|
52
|
+
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
|
|
56
|
+
|
|
57
|
+
# [0.124.0-alpha.15](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.14...v0.124.0-alpha.15) (2022-05-11)
|
|
58
|
+
|
|
59
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
|
|
65
|
+
# [0.124.0-alpha.14](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.13...v0.124.0-alpha.14) (2022-05-11)
|
|
66
|
+
|
|
67
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
68
|
+
|
|
69
|
+
|
|
70
|
+
|
|
71
|
+
|
|
72
|
+
|
|
73
|
+
# [0.124.0-alpha.13](https://byte9/thebyte9/blaze/compare/v0.124.0-alpha.12...v0.124.0-alpha.13) (2022-05-11)
|
|
74
|
+
|
|
75
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
76
|
+
|
|
77
|
+
|
|
78
|
+
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# [0.124.0-alpha.12](https://byte9/thebyte9/blaze/compare/v0.124.0-alpha.11...v0.124.0-alpha.12) (2022-05-11)
|
|
82
|
+
|
|
83
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
84
|
+
|
|
85
|
+
|
|
86
|
+
|
|
87
|
+
|
|
88
|
+
|
|
89
|
+
# [0.124.0-alpha.11](https://byte9/thebyte9/blaze/compare/v0.124.0-alpha.10...v0.124.0-alpha.11) (2022-05-11)
|
|
90
|
+
|
|
91
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
92
|
+
|
|
93
|
+
|
|
94
|
+
|
|
95
|
+
|
|
96
|
+
|
|
97
|
+
# [0.124.0-alpha.10](https://byte9/thebyte9/blaze/compare/v0.124.0-alpha.9...v0.124.0-alpha.10) (2022-05-11)
|
|
98
|
+
|
|
99
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
# [0.124.0-alpha.9](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.8...v0.124.0-alpha.9) (2022-05-10)
|
|
106
|
+
|
|
107
|
+
|
|
108
|
+
### Bug Fixes
|
|
109
|
+
|
|
110
|
+
* fix apollo client version to 3.5.x while investigating ssr issue ([#3466](https://github.com/thebyte9/blaze/issues/3466)) ([8f14f8e](https://github.com/thebyte9/blaze/commit/8f14f8e9946f0e1e2ed3d9eb747a6d01c34e9937))
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
|
|
114
|
+
|
|
115
|
+
|
|
116
|
+
# [0.124.0-alpha.8](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.7...v0.124.0-alpha.8) (2022-05-06)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
121
|
+
## [0.122.5](https://github.com/thebyte9/blaze/compare/v0.122.4...v0.122.5) (2022-05-06)
|
|
122
|
+
|
|
123
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
124
|
+
|
|
125
|
+
|
|
126
|
+
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
|
|
130
|
+
|
|
131
|
+
|
|
132
|
+
|
|
133
|
+
|
|
134
|
+
# [0.124.0-alpha.7](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.6...v0.124.0-alpha.7) (2022-05-06)
|
|
135
|
+
|
|
136
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
137
|
+
|
|
138
|
+
|
|
139
|
+
|
|
140
|
+
|
|
141
|
+
|
|
142
|
+
# [0.124.0-alpha.6](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.5...v0.124.0-alpha.6) (2022-05-06)
|
|
143
|
+
|
|
144
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
145
|
+
|
|
146
|
+
|
|
147
|
+
|
|
148
|
+
|
|
149
|
+
|
|
150
|
+
# [0.124.0-alpha.5](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.4...v0.124.0-alpha.5) (2022-05-05)
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
### Features
|
|
154
|
+
|
|
155
|
+
* add map type selection option ([#3455](https://github.com/thebyte9/blaze/issues/3455)) ([20c6ace](https://github.com/thebyte9/blaze/commit/20c6ace41177d7e2d08eae32dde95364ab93a7df))
|
|
156
|
+
|
|
157
|
+
|
|
158
|
+
|
|
159
|
+
|
|
160
|
+
|
|
161
|
+
# [0.124.0-alpha.4](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.3...v0.124.0-alpha.4) (2022-05-03)
|
|
162
|
+
|
|
163
|
+
|
|
164
|
+
### Bug Fixes
|
|
165
|
+
|
|
166
|
+
* add id prop to filter queries to help data merges in apollo ([#3451](https://github.com/thebyte9/blaze/issues/3451)) ([0e66222](https://github.com/thebyte9/blaze/commit/0e662220e80da84c1713e23b60f2ab4495a8e883))
|
|
167
|
+
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
|
|
171
|
+
|
|
172
|
+
# [0.124.0-alpha.3](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.2...v0.124.0-alpha.3) (2022-04-29)
|
|
173
|
+
|
|
174
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
175
|
+
|
|
176
|
+
|
|
177
|
+
|
|
178
|
+
|
|
179
|
+
|
|
6
180
|
# [0.124.0-alpha.2](https://github.com/thebyte9/blaze/compare/v0.124.0-alpha.1...v0.124.0-alpha.2) (2022-04-29)
|
|
7
181
|
|
|
8
182
|
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
@@ -57,6 +57,8 @@ var _helpers = require("./helpers");
|
|
|
57
57
|
|
|
58
58
|
var _constants = require("../constants");
|
|
59
59
|
|
|
60
|
+
var _GoogleMapsHtml = _interopRequireDefault(require("./GoogleMapsHtml"));
|
|
61
|
+
|
|
60
62
|
var _excluded = ["type", "name", "modifier", "elementTitle", "imageData", "onMount", "onMountProps", "parent", "mapShapes", "centerCoordinates"];
|
|
61
63
|
|
|
62
64
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
@@ -159,9 +161,8 @@ var GoogleMaps = function GoogleMaps(_ref2) {
|
|
|
159
161
|
}, []);
|
|
160
162
|
if (map && typeof onMount === "function") onMount(map, onMountProps);
|
|
161
163
|
if (isIntersecting) (0, _helpers.addZoomListener)(map, router, mapShapes, imageData);
|
|
162
|
-
return /*#__PURE__*/_react["default"].createElement("
|
|
163
|
-
|
|
164
|
-
ref: mapRef
|
|
164
|
+
return /*#__PURE__*/_react["default"].createElement(_GoogleMapsHtml["default"], {
|
|
165
|
+
mapRef: mapRef
|
|
165
166
|
});
|
|
166
167
|
};
|
|
167
168
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"GoogleMaps.js","names":["shouldNotUpdate","props","nextProps","funcs","nextFuncs","noPropChange","noFuncChange","length","every","fn","toString","GoogleMaps","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","router","IN_VIEW_CONFIG","isIntersecting","mapRef","map","setMap","options","onLoad","initialMap","window","google","maps","Map","current","lat","latitude","lng","longitude","setCenter","bounds","LatLngBounds","forEach","extend","LatLng","fitBounds","script","document","createElement","SCRIPT","src","GOOGLE_MAPS_SCRIPT","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","LOAD","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","propTypes","PropTypes","array","string","func","object","defaultProps","React","memo"],"sources":["../../src/GoogleMaps/GoogleMaps.js"],"sourcesContent":["import React, { useEffect, useState } from 'react';\nimport PropTypes from 'prop-types';\nimport { useRouter } from 'next/router';\nimport { withTitle } from '@blaze-cms/react-page-builder';\nimport { useInView } from '@blaze-react/utils/lib/customHooks';\nimport { functions, isEqual, omit } from 'lodash';\nimport { setMapOptions, addZoomListener } from './helpers';\nimport { GOOGLE_MAPS_SCRIPT, LOAD, SCRIPT, IN_VIEW_CONFIG } from '../constants';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst shouldNotUpdate = (props, nextProps) => {\n const [funcs, nextFuncs] = [functions(props), functions(nextProps)];\n const noPropChange = isEqual(omit(props, funcs), omit(nextProps, nextFuncs));\n const noFuncChange =\n funcs.length === nextFuncs.length &&\n funcs.every(fn => props[fn].toString() === nextProps[fn].toString());\n return noPropChange && noFuncChange;\n};\n\nconst GoogleMaps = ({\n type,\n name,\n modifier,\n elementTitle,\n imageData,\n onMount,\n onMountProps,\n parent,\n mapShapes,\n centerCoordinates,\n ...otherProps\n}) => {\n const router = useRouter();\n const [isIntersecting, mapRef] = useInView(IN_VIEW_CONFIG);\n const [map, setMap] = useState();\n\n useEffect(() => {\n const options = setMapOptions(otherProps);\n const onLoad = () => {\n const initialMap = new window.google.maps.Map(mapRef.current, options);\n if (centerCoordinates.length === 1) {\n const [{ latitude: lat, longitude: lng }] = centerCoordinates;\n initialMap.setCenter({ lat, lng });\n } else {\n const bounds = new window.google.maps.LatLngBounds();\n centerCoordinates.forEach(({ latitude, longitude }) => {\n bounds.extend(new window.google.maps.LatLng(latitude, longitude));\n });\n initialMap.fitBounds(bounds);\n }\n setMap(initialMap);\n };\n\n if (!window.google) {\n const script = document.createElement(SCRIPT);\n script.src = `${GOOGLE_MAPS_SCRIPT}${process.env.GOOGLE_MAPS_API_KEY}`;\n document.head.append(script);\n script.addEventListener(LOAD, onLoad);\n return () => script.removeEventListener(LOAD, onLoad);\n }\n\n onLoad();\n\n if (map) {\n map.setOptions(options);\n const { enableGeolocation } = otherProps;\n const shouldActivateGeolocation = enableGeolocation && navigator.geolocation;\n if (shouldActivateGeolocation) {\n navigator.geolocation.getCurrentPosition(\n position => {\n const center = {\n lat: position.coords.latitude,\n lng: position.coords.longitude\n };\n\n map.setCenter(center);\n },\n () => {}\n );\n }\n }\n\n return () => {};\n // eslint-disable-next-line react-hooks/exhaustive-deps\n }, []);\n\n if (map && typeof onMount === `function`) onMount(map, onMountProps);\n if (isIntersecting) addZoomListener(map, router, mapShapes, imageData);\n\n return <GoogleMapsHtml mapRef={mapRef} />;\n};\n\nGoogleMaps.propTypes = {\n mapShapes: PropTypes.array,\n imageData: PropTypes.array,\n type: PropTypes.string,\n name: PropTypes.string,\n modifier: PropTypes.string,\n elementTitle: PropTypes.string,\n onMount: PropTypes.func,\n onMountProps: PropTypes.object,\n parent: PropTypes.object,\n centerCoordinates: PropTypes.array\n};\n\nGoogleMaps.defaultProps = {\n mapShapes: [],\n imageData: [],\n centerCoordinates: [],\n type: '',\n name: '',\n modifier: '',\n elementTitle: '',\n onMount: null,\n onMountProps: null,\n parent: {}\n};\n\nexport default React.memo(withTitle(GoogleMaps), shouldNotUpdate);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;;;;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,KAAD,EAAQC,SAAR,EAAsB;EAC5C,WAA2B,CAAC,uBAAUD,KAAV,CAAD,EAAmB,uBAAUC,SAAV,CAAnB,CAA3B;EAAA,IAAOC,KAAP;EAAA,IAAcC,SAAd;EACA,IAAMC,YAAY,GAAG,qBAAQ,kBAAKJ,KAAL,EAAYE,KAAZ,CAAR,EAA4B,kBAAKD,SAAL,EAAgBE,SAAhB,CAA5B,CAArB;EACA,IAAME,YAAY,GAChBH,KAAK,CAACI,MAAN,KAAiBH,SAAS,CAACG,MAA3B,IACAJ,KAAK,CAACK,KAAN,CAAY,UAAAC,EAAE;IAAA,OAAIR,KAAK,CAACQ,EAAD,CAAL,CAAUC,QAAV,OAAyBR,SAAS,CAACO,EAAD,CAAT,CAAcC,QAAd,EAA7B;EAAA,CAAd,CAFF;EAGA,OAAOL,YAAY,IAAIC,YAAvB;AACD,CAPD;;AASA,IAAMK,UAAU,GAAG,SAAbA,UAAa,QAYb;EAAA,IAXJC,IAWI,SAXJA,IAWI;EAAA,IAVJC,IAUI,SAVJA,IAUI;EAAA,IATJC,QASI,SATJA,QASI;EAAA,IARJC,YAQI,SARJA,YAQI;EAAA,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,EAAqBJ,MAArB,EAA6BH,SAA7B,EAAwCJ,SAAxC;EAEpB,oBAAO,gCAAC,0BAAD;IAAgB,MAAM,EAAEU;EAAxB,EAAP;AACD,CAvED;;AAyEAf,UAAU,CAAC4D,SAAX,GAAuB;EACrBnD,SAAS,EAAEoD,sBAAUC,KADA;EAErBzD,SAAS,EAAEwD,sBAAUC,KAFA;EAGrB7D,IAAI,EAAE4D,sBAAUE,MAHK;EAIrB7D,IAAI,EAAE2D,sBAAUE,MAJK;EAKrB5D,QAAQ,EAAE0D,sBAAUE,MALC;EAMrB3D,YAAY,EAAEyD,sBAAUE,MANH;EAOrBzD,OAAO,EAAEuD,sBAAUG,IAPE;EAQrBzD,YAAY,EAAEsD,sBAAUI,MARH;EASrBzD,MAAM,EAAEqD,sBAAUI,MATG;EAUrBvD,iBAAiB,EAAEmD,sBAAUC;AAVR,CAAvB;AAaA9D,UAAU,CAACkE,YAAX,GAA0B;EACxBzD,SAAS,EAAE,EADa;EAExBJ,SAAS,EAAE,EAFa;EAGxBK,iBAAiB,EAAE,EAHK;EAIxBT,IAAI,EAAE,EAJkB;EAKxBC,IAAI,EAAE,EALkB;EAMxBC,QAAQ,EAAE,EANc;EAOxBC,YAAY,EAAE,EAPU;EAQxBE,OAAO,EAAE,IARe;EASxBC,YAAY,EAAE,IATU;EAUxBC,MAAM,EAAE;AAVgB,CAA1B;;4BAae2D,kBAAMC,IAAN,CAAW,iCAAUpE,UAAV,CAAX,EAAkCX,eAAlC,C"}
|
|
@@ -25,6 +25,8 @@ var _helpers = require("./helpers");
|
|
|
25
25
|
|
|
26
26
|
var _GoogleMapsRender = _interopRequireDefault(require("./GoogleMapsRender"));
|
|
27
27
|
|
|
28
|
+
var _GoogleMapsHtml = _interopRequireDefault(require("./GoogleMapsHtml"));
|
|
29
|
+
|
|
28
30
|
var _excluded = ["entityGroups", "parent"];
|
|
29
31
|
|
|
30
32
|
var GoogleMapsFactory = function GoogleMapsFactory(_ref) {
|
|
@@ -40,7 +42,7 @@ var GoogleMapsFactory = function GoogleMapsFactory(_ref) {
|
|
|
40
42
|
loading = _useGetEntitySchemasA.loading,
|
|
41
43
|
error = _useGetEntitySchemasA.error;
|
|
42
44
|
|
|
43
|
-
if (loading) return
|
|
45
|
+
if (loading) return /*#__PURE__*/_react["default"].createElement(_GoogleMapsHtml["default"], null);
|
|
44
46
|
if (error) return error.message;
|
|
45
47
|
var shapeConfigs = (0, _helpers.buildShapesConfig)(data, entityGroups, parent);
|
|
46
48
|
return /*#__PURE__*/_react["default"].createElement(_GoogleMapsRender["default"], (0, _extends2["default"])({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"GoogleMapsFactory.js","names":["GoogleMapsFactory","entityGroups","parent","otherProps","map","entity","data","loading","error","message","shapeConfigs","propTypes","PropTypes","object","array","defaultProps"],"sources":["../../src/GoogleMaps/GoogleMapsFactory.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGetEntitySchemasAsObj } from '@blaze-cms/react-page-builder';\nimport { buildShapesConfig } from './helpers';\nimport GoogleMapsRender from './GoogleMapsRender';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst GoogleMapsFactory = ({ entityGroups, parent, ...otherProps }) => {\n const { data, loading, error } = useGetEntitySchemasAsObj(\n entityGroups.map(({ entity }) => entity)\n );\n\n if (loading) return <GoogleMapsHtml />;\n if (error) return error.message;\n\n const shapeConfigs = buildShapesConfig(data, entityGroups, parent);\n\n return (\n <GoogleMapsRender\n shapeConfigs={shapeConfigs}\n entityGroups={entityGroups}\n parent={parent}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsFactory.propTypes = {\n parent: PropTypes.object,\n entityGroups: PropTypes.array\n};\n\nGoogleMapsFactory.defaultProps = {\n parent: {},\n entityGroups: []\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB,OAA6C;EAAA,IAA1CC,YAA0C,QAA1CA,YAA0C;EAAA,IAA5BC,MAA4B,QAA5BA,MAA4B;EAAA,IAAjBC,UAAiB;;EACrE,4BAAiC,gDAC/BF,YAAY,CAACG,GAAb,CAAiB;IAAA,IAAGC,MAAH,SAAGA,MAAH;IAAA,OAAgBA,MAAhB;EAAA,CAAjB,CAD+B,CAAjC;EAAA,IAAQC,IAAR,yBAAQA,IAAR;EAAA,IAAcC,OAAd,yBAAcA,OAAd;EAAA,IAAuBC,KAAvB,yBAAuBA,KAAvB;;EAIA,IAAID,OAAJ,EAAa,oBAAO,gCAAC,0BAAD,OAAP;EACb,IAAIC,KAAJ,EAAW,OAAOA,KAAK,CAACC,OAAb;EAEX,IAAMC,YAAY,GAAG,gCAAkBJ,IAAlB,EAAwBL,YAAxB,EAAsCC,MAAtC,CAArB;EAEA,oBACE,gCAAC,4BAAD;IACE,YAAY,EAAEQ,YADhB;IAEE,YAAY,EAAET,YAFhB;IAGE,MAAM,EAAEC;EAHV,GAIMC,UAJN,EADF;AAQD,CAlBD;;AAoBAH,iBAAiB,CAACW,SAAlB,GAA8B;EAC5BT,MAAM,EAAEU,sBAAUC,MADU;EAE5BZ,YAAY,EAAEW,sBAAUE;AAFI,CAA9B;AAKAd,iBAAiB,CAACe,YAAlB,GAAiC;EAC/Bb,MAAM,EAAE,EADuB;EAE/BD,YAAY,EAAE;AAFiB,CAAjC;eAKeD,iB"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
require("core-js/modules/es.object.define-property.js");
|
|
4
|
+
|
|
5
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
6
|
+
|
|
7
|
+
Object.defineProperty(exports, "__esModule", {
|
|
8
|
+
value: true
|
|
9
|
+
});
|
|
10
|
+
exports["default"] = void 0;
|
|
11
|
+
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
|
+
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
15
|
+
|
|
16
|
+
var GoogleMapsFactory = function GoogleMapsFactory(_ref) {
|
|
17
|
+
var mapRef = _ref.mapRef;
|
|
18
|
+
return /*#__PURE__*/_react["default"].createElement("div", {
|
|
19
|
+
className: "google-maps ".concat(!mapRef ? 'loading' : ''),
|
|
20
|
+
ref: mapRef
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
GoogleMapsFactory.propTypes = {
|
|
25
|
+
mapRef: _propTypes["default"].object
|
|
26
|
+
};
|
|
27
|
+
GoogleMapsFactory.defaultProps = {
|
|
28
|
+
mapRef: null
|
|
29
|
+
};
|
|
30
|
+
var _default = GoogleMapsFactory;
|
|
31
|
+
exports["default"] = _default;
|
|
32
|
+
//# sourceMappingURL=GoogleMapsHtml.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GoogleMapsHtml.js","names":["GoogleMapsFactory","mapRef","propTypes","PropTypes","object","defaultProps"],"sources":["../../src/GoogleMaps/GoogleMapsHtml.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\n\nconst GoogleMapsFactory = ({ mapRef }) => (\n <div className={`google-maps ${!mapRef ? 'loading' : ''}`} ref={mapRef} />\n);\n\nGoogleMapsFactory.propTypes = {\n mapRef: PropTypes.object\n};\n\nGoogleMapsFactory.defaultProps = {\n mapRef: null\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,iBAAiB,GAAG,SAApBA,iBAAoB;EAAA,IAAGC,MAAH,QAAGA,MAAH;EAAA,oBACxB;IAAK,SAAS,wBAAiB,CAACA,MAAD,GAAU,SAAV,GAAsB,EAAvC,CAAd;IAA2D,GAAG,EAAEA;EAAhE,EADwB;AAAA,CAA1B;;AAIAD,iBAAiB,CAACE,SAAlB,GAA8B;EAC5BD,MAAM,EAAEE,sBAAUC;AADU,CAA9B;AAIAJ,iBAAiB,CAACK,YAAlB,GAAiC;EAC/BJ,MAAM,EAAE;AADuB,CAAjC;eAIeD,iB"}
|
|
@@ -29,6 +29,8 @@ var _helpers = require("./helpers");
|
|
|
29
29
|
|
|
30
30
|
var _GoogleMaps = _interopRequireDefault(require("./GoogleMaps"));
|
|
31
31
|
|
|
32
|
+
var _GoogleMapsHtml = _interopRequireDefault(require("./GoogleMapsHtml"));
|
|
33
|
+
|
|
32
34
|
var _excluded = ["shapeConfigs", "entityGroups", "id"];
|
|
33
35
|
var defaultQuery = (0, _reactPageBuilder.getAction)('getPublishedPages', 'id');
|
|
34
36
|
|
|
@@ -59,7 +61,7 @@ var GoogleMapsRender = function GoogleMapsRender(_ref) {
|
|
|
59
61
|
var imageData = _useGetImages$data.getFiles,
|
|
60
62
|
imagesLoading = _useGetImages.loading,
|
|
61
63
|
imagesError = _useGetImages.error;
|
|
62
|
-
if (loading || imagesLoading) return
|
|
64
|
+
if (loading || imagesLoading) return /*#__PURE__*/_react["default"].createElement(_GoogleMapsHtml["default"], null);
|
|
63
65
|
if (error || imagesError) return null;
|
|
64
66
|
var centerCoordinates = (0, _helpers.getCenterCoordinates)(mapShapes, otherProps);
|
|
65
67
|
var shouldDisplayMap = (0, _lodash["default"])(defaultZoom) && !!centerCoordinates.length;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"GoogleMapsRender.js","names":["defaultQuery","GoogleMapsRender","shapeConfigs","entityGroups","id","otherProps","defaultZoom","query","skip","data","loading","error","mapShapes","imageIds","imageData","getFiles","imagesLoading","imagesError","centerCoordinates","shouldDisplayMap","length","slug","propTypes","PropTypes","array","string","centerLatitude","number","centerLongitude","defaultProps"],"sources":["../../src/GoogleMaps/GoogleMapsRender.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport isNumber from 'lodash.isnumber';\nimport { useQuery } from '@apollo/client';\nimport { getAction } from '@blaze-cms/react-page-builder';\nimport { useGetImages } from './hooks';\nimport { buildQuery, getImageIds, getCenterCoordinates, buildMapShapes } from './helpers';\nimport GoogleMaps from './GoogleMaps';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst defaultQuery = getAction('getPublishedPages', 'id');\n\nconst GoogleMapsRender = ({ shapeConfigs, entityGroups, id, ...otherProps }) => {\n const { defaultZoom } = otherProps;\n const { query } = buildQuery(shapeConfigs);\n const { data, loading, error } = useQuery(query || defaultQuery, {\n skip: !query\n });\n const mapShapes = buildMapShapes(shapeConfigs, data);\n const imageIds = getImageIds(mapShapes);\n const {\n data: { getFiles: imageData } = {},\n loading: imagesLoading,\n error: imagesError\n } = useGetImages(imageIds);\n if (loading || imagesLoading) return <GoogleMapsHtml />;\n if (error || imagesError) return null;\n\n const centerCoordinates = getCenterCoordinates(mapShapes, otherProps);\n const shouldDisplayMap = isNumber(defaultZoom) && !!centerCoordinates.length;\n\n if (!shouldDisplayMap) return null;\n\n return (\n <GoogleMaps\n key={otherProps.slug}\n centerCoordinates={centerCoordinates}\n mapShapes={mapShapes}\n imageData={imageData}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsRender.propTypes = {\n entityGroups: PropTypes.array,\n id: PropTypes.string,\n shapeConfigs: PropTypes.array,\n centerLatitude: PropTypes.number,\n centerLongitude: PropTypes.number,\n defaultZoom: PropTypes.number\n};\n\nGoogleMapsRender.defaultProps = {\n entityGroups: [],\n shapeConfigs: [],\n id: '',\n centerLatitude: null,\n centerLongitude: null,\n defaultZoom: null\n};\n\nexport default GoogleMapsRender;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;;AAEA,IAAMA,YAAY,GAAG,iCAAU,mBAAV,EAA+B,IAA/B,CAArB;;AAEA,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAmB,OAAuD;EAAA,IAApDC,YAAoD,QAApDA,YAAoD;EAAA,IAAtCC,Y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B,sBAAUC,KADG;EAE3BpB,EAAE,EAAEmB,sBAAUE,MAFa;EAG3BvB,YAAY,EAAEqB,sBAAUC,KAHG;EAI3BE,cAAc,EAAEH,sBAAUI,MAJC;EAK3BC,eAAe,EAAEL,sBAAUI,MALA;EAM3BrB,WAAW,EAAEiB,sBAAUI;AANI,CAA7B;AASA1B,gBAAgB,CAAC4B,YAAjB,GAAgC;EAC9B1B,YAAY,EAAE,EADgB;EAE9BD,YAAY,EAAE,EAFgB;EAG9BE,EAAE,EAAE,EAH0B;EAI9BsB,cAAc,EAAE,IAJc;EAK9BE,eAAe,EAAE,IALa;EAM9BtB,WAAW,EAAE;AANiB,CAAhC;eASeL,gB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"add-zoom-listener.js","names":["addZoomListener","map","router","shapes","imageData","addListener","ZOOM_CHANGED"],"sources":["../../../src/GoogleMaps/helpers/add-zoom-listener.js"],"sourcesContent":["import { ZOOM_CHANGED } from '../../constants';\nimport setShapes from './set-shapes';\n\nconst addZoomListener = (map, router, shapes, imageData) => {\n if (!map) return;\n setShapes(map, router, shapes, imageData);\n map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData));\n};\n\nexport default addZoomListener;\n"],"mappings":";;;;;;;;;;;AAAA;;AACA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,GAAD,EAAMC,MAAN,EAAcC,MAAd,EAAsBC,SAAtB,EAAoC;EAC1D,IAAI,CAACH,GAAL,EAAU;EACV,2BAAUA,GAAV,EAAeC,MAAf,EAAuBC,MAAvB,EAA+BC,SAA/B;EACAH,GAAG,CAACI,WAAJ,CAAgBC,uBAAhB,EAA8B;IAAA,OAAM,2BAAUL,GAAV,EAAeC,MAAf,EAAuBC,MAAvB,EAA+BC,SAA/B,CAAN;EAAA,CAA9B;AACD,CAJD;;eAMeJ,e"}
|
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
require("core-js/modules/es.object.keys.js");
|
|
4
|
+
|
|
5
|
+
require("core-js/modules/es.symbol.js");
|
|
6
|
+
|
|
7
|
+
require("core-js/modules/es.array.filter.js");
|
|
8
|
+
|
|
9
|
+
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
10
|
+
|
|
11
|
+
require("core-js/modules/es.object.get-own-property-descriptors.js");
|
|
12
|
+
|
|
13
|
+
require("core-js/modules/es.object.define-properties.js");
|
|
14
|
+
|
|
3
15
|
require("core-js/modules/es.object.define-property.js");
|
|
4
16
|
|
|
17
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
18
|
+
|
|
5
19
|
Object.defineProperty(exports, "__esModule", {
|
|
6
20
|
value: true
|
|
7
21
|
});
|
|
8
22
|
exports["default"] = void 0;
|
|
9
23
|
|
|
24
|
+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
+
|
|
10
26
|
require("core-js/modules/es.regexp.exec.js");
|
|
11
27
|
|
|
12
28
|
require("core-js/modules/es.string.split.js");
|
|
@@ -19,6 +35,10 @@ require("core-js/modules/web.dom-collections.for-each.js");
|
|
|
19
35
|
|
|
20
36
|
require("core-js/modules/es.array.is-array.js");
|
|
21
37
|
|
|
38
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
39
|
+
|
|
40
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
41
|
+
|
|
22
42
|
var getLatLonValues = function getLatLonValues(keys, data) {
|
|
23
43
|
if (keys.length === 1) return data[keys];
|
|
24
44
|
var key = keys.shift();
|
|
@@ -51,14 +71,6 @@ var buildMapShapes = function buildMapShapes(shapesOptions, shapesData) {
|
|
|
51
71
|
shapeOptions = shape.shapeOptions;
|
|
52
72
|
var dataSummaries = entityOptions.dataSummaries,
|
|
53
73
|
enableInfoPane = entityOptions.enableInfoPane;
|
|
54
|
-
var imageId = shapeOptions.imageId,
|
|
55
|
-
label = shapeOptions.label,
|
|
56
|
-
markerHeight = shapeOptions.markerHeight,
|
|
57
|
-
markerWidth = shapeOptions.markerWidth,
|
|
58
|
-
maxZoom = shapeOptions.maxZoom,
|
|
59
|
-
minZoom = shapeOptions.minZoom,
|
|
60
|
-
type = shapeOptions.type,
|
|
61
|
-
useAsCenter = shapeOptions.useAsCenter;
|
|
62
74
|
var shapeData = Array.isArray(shapesData[shapeKey]) ? shapesData[shapeKey] : shapesData[shapeKey].results;
|
|
63
75
|
if (!shapeData) return;
|
|
64
76
|
var latProp = entityOptions.latProp,
|
|
@@ -70,22 +82,15 @@ var buildMapShapes = function buildMapShapes(shapesOptions, shapesData) {
|
|
|
70
82
|
latitude = _getLatLong.latitude,
|
|
71
83
|
longitude = _getLatLong.longitude;
|
|
72
84
|
|
|
73
|
-
var formatedShape = {
|
|
85
|
+
var formatedShape = _objectSpread(_objectSpread({}, shapeOptions), {}, {
|
|
74
86
|
latitude: latitude,
|
|
75
87
|
longitude: longitude,
|
|
76
88
|
dataSummaries: dataSummaries,
|
|
77
89
|
enableInfoPane: enableInfoPane,
|
|
78
|
-
imageId: imageId,
|
|
79
|
-
label: label,
|
|
80
|
-
markerHeight: markerHeight,
|
|
81
|
-
markerWidth: markerWidth,
|
|
82
|
-
maxZoom: maxZoom,
|
|
83
|
-
minZoom: minZoom,
|
|
84
|
-
type: type,
|
|
85
90
|
url: url,
|
|
86
|
-
useAsCenter: useAsCenter,
|
|
87
91
|
shapeData: data
|
|
88
|
-
};
|
|
92
|
+
});
|
|
93
|
+
|
|
89
94
|
mapShapes.push(formatedShape);
|
|
90
95
|
});
|
|
91
96
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"build-map-shapes.js","names":["getLatLonValues","keys","data","length","key","shift","getLatLong","latProp","lonProp","shape","latitude","longitude","latKeys","split","lonKeys","lat","lon","buildMapShapes","shapesOptions","shapesData","mapShapes","forEach","shapeKey","entityOptions","shapeOptions","dataSummaries","enableInfoPane","shapeData","Array","isArray","results","url","formatedShape","push"],"sources":["../../../src/GoogleMaps/helpers/build-map-shapes.js"],"sourcesContent":["const getLatLonValues = (keys, data) => {\n if (keys.length === 1) return data[keys];\n const key = keys.shift();\n return getLatLonValues(keys, data[key]);\n};\n\nconst getLatLong = (latProp, lonProp, shape, data) => {\n const { latitude, longitude } = shape;\n\n if (!latProp || !lonProp) return { latitude, longitude };\n const latKeys = latProp.split('.');\n const lonKeys = lonProp.split('.');\n const lat = getLatLonValues(latKeys, data);\n const lon = getLatLonValues(lonKeys, data);\n\n return { latitude: lat, longitude: lon };\n};\n\nconst buildMapShapes = (shapesOptions, shapesData) => {\n if (!shapesData) return [];\n const mapShapes = [];\n shapesOptions.forEach(shape => {\n const { shapeKey, entityOptions, shapeOptions } = shape;\n const { dataSummaries, enableInfoPane } = entityOptions;\n\n const shapeData = Array.isArray(shapesData[shapeKey])\n ? shapesData[shapeKey]\n : shapesData[shapeKey].results;\n if (!shapeData) return;\n const { latProp, lonProp } = entityOptions;\n\n shapeData.forEach(data => {\n const { url } = data;\n const { latitude, longitude } = getLatLong(latProp, lonProp, shapeOptions, data);\n\n const formatedShape = {\n ...shapeOptions,\n latitude,\n longitude,\n dataSummaries,\n enableInfoPane,\n url,\n shapeData: data\n };\n\n mapShapes.push(formatedShape);\n });\n });\n\n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.js","names":["buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","ROADMAP","push","SATELLITE","TERRAIN"],"sources":["../../../src/GoogleMaps/helpers/build-map-type-ids.js"],"sourcesContent":["import { ROADMAP, SATELLITE, TERRAIN } from '../../constants';\n\nconst buildMapTypeIds = (enableSatelliteView, enableTerrainScreen) => {\n const mapTypeIds = [ROADMAP];\n if (enableSatelliteView) mapTypeIds.push(SATELLITE);\n if (enableTerrainScreen) mapTypeIds.push(TERRAIN);\n return mapTypeIds;\n};\n\nexport default buildMapTypeIds;\n"],"mappings":";;;;;;;;;AAAA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,mBAAD,EAAsBC,mBAAtB,EAA8C;EACpE,IAAMC,UAAU,GAAG,CAACC,kBAAD,CAAnB;EACA,IAAIH,mBAAJ,EAAyBE,UAAU,CAACE,IAAX,CAAgBC,oBAAhB;EACzB,IAAIJ,mBAAJ,EAAyBC,UAAU,CAACE,IAAX,CAAgBE,kBAAhB;EACzB,OAAOJ,UAAP;AACD,CALD;;eAOeH,e"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"build-query.js","names":["buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","toUpperCase","slice","filterQueryKey","indexOf","push","props","trim","singleItemQuery","JSON","stringify","join","query"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';\n\nconst buildQuery = entityConfigs => {\n const entityIds = [];\n const rawQueryStringified = '';\n const queryString = entityConfigs\n .map(entityConfig => {\n const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;\n if (!action) return '';\n const formatedEntity = `${entity[0].toUpperCase()}${entity.slice(1)}`;\n const filterQueryKey =\n action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;\n\n entityIds.push(...ids);\n const props = propsQuery.trim() || 'id';\n const singleItemQuery = filtersObject\n ? generateFiltersQuery(shapeKey, props, JSON.stringify(filtersObject), filterQueryKey)\n : generateIdsQuery(shapeKey, props, action, ids);\n\n return singleItemQuery;\n })\n .join(' ');\n\n return {\n query: queryString ? generateQuery(queryString) : '',\n ids: entityIds,\n rawQueryStringified\n };\n};\n\nexport default buildQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAAAC,aAAa,EAAI;EAClC,IAAMC,SAAS,GAAG,EAAlB;EACA,IAAMC,mBAAmB,GAAG,EAA5B;EACA,IAAMC,WAAW,GAAGH,aAAa,CAC9BI,GADiB,CACb,UAAAC,YAAY,EAAI;IACnB,IAAQC,MAAR,GAAqED,YAArE,CAAQC,MAAR;IAAA,IAAgBC,GAAhB,GAAqEF,YAArE,CAAgBE,GAAhB;IAAA,IAAqBC,MAArB,GAAqEH,YAArE,CAAqBG,MAArB;IAAA,IAA6BC,UAA7B,GAAqEJ,YAArE,CAA6BI,UAA7B;IAAA,IAAyCC,QAAzC,GAAqEL,YAArE,CAAyCK,QAAzC;IAAA,IAAmDC,aAAnD,GAAqEN,YAArE,CAAmDM,aAAnD;IACA,IAAI,CAACL,MAAL,EAAa,OAAO,EAAP;IACb,IAAMM,cAAc,aAAMJ,MAAM,CAAC,CAAD,CAAN,CAAUK,WAAV,EAAN,SAAgCL,MAAM,CAACM,KAAP,CAAa,CAAb,CAAhC,CAApB;IACA,IAAMC,cAAc,GAClBT,MAAM,CAACU,OAAP,CAAe,WAAf,MAAgC,CAAC,CAAjC,sBAAiDJ,cAAjD,IAAoEA,cADtE;IAGAX,SAAS,CAACgB,IAAV,OAAAhB,SAAS,sCAASM,GAAT,EAAT;IACA,IAAMW,KAAK,GAAGT,UAAU,CAACU,IAAX,MAAqB,IAAnC;IACA,IAAMC,eAAe,GAAGT,aAAa,GACjC,mCAAqBD,QAArB,EAA+BQ,KAA/B,EAAsCG,IAAI,CAACC,SAAL,CAAeX,aAAf,CAAtC,EAAqEI,cAArE,CADiC,GAEjC,+BAAiBL,QAAjB,EAA2BQ,KAA3B,EAAkCZ,MAAlC,EAA0CC,GAA1C,CAFJ;IAIA,OAAOa,eAAP;EACD,CAfiB,EAgBjBG,IAhBiB,CAgBZ,GAhBY,CAApB;EAkBA,OAAO;IACLC,KAAK,EAAErB,WAAW,GAAG,4BAAcA,WAAd,CAAH,GAAgC,EAD7C;IAELI,GAAG,EAAEN,SAFA;IAGLC,mBAAmB,EAAnBA;EAHK,CAAP;AAKD,CA1BD;;eA4BeH,U"}
|
|
@@ -43,6 +43,8 @@ require("core-js/modules/es.object.keys.js");
|
|
|
43
43
|
|
|
44
44
|
require("core-js/modules/es.array.map.js");
|
|
45
45
|
|
|
46
|
+
require("core-js/modules/es.array.find.js");
|
|
47
|
+
|
|
46
48
|
require("core-js/modules/es.array.for-each.js");
|
|
47
49
|
|
|
48
50
|
require("core-js/modules/web.dom-collections.for-each.js");
|
|
@@ -123,7 +125,8 @@ var buiildShapeProps = function buiildShapeProps(shape, shapeKey, dataSummaries,
|
|
|
123
125
|
var latProp = entityGroup.latProp,
|
|
124
126
|
lonProp = entityGroup.lonProp,
|
|
125
127
|
entity = entityGroup.entity;
|
|
126
|
-
var actions = entityData.actions
|
|
128
|
+
var actions = entityData.actions,
|
|
129
|
+
relations = entityData.relations;
|
|
127
130
|
var action = actions ? actions.getAllPublished || actions.getAll : '';
|
|
128
131
|
var dataSummaryProps = dataSummaries.reduce(function (acc, _ref) {
|
|
129
132
|
var propsToDisplay = _ref.propsToDisplay;
|
|
@@ -141,7 +144,7 @@ var buiildShapeProps = function buiildShapeProps(shape, shapeKey, dataSummaries,
|
|
|
141
144
|
propsQuery = getUpdatedPropsQuery(propsQuery, entityData);
|
|
142
145
|
|
|
143
146
|
if (latProp && lonProp) {
|
|
144
|
-
propsQuery = "".concat(propsQuery, " ").concat(formatProp(latProp), " ").concat(formatProp(lonProp));
|
|
147
|
+
propsQuery = "".concat(propsQuery, " ").concat(formatProp(latProp, relations), " ").concat(formatProp(lonProp, relations));
|
|
145
148
|
}
|
|
146
149
|
|
|
147
150
|
if (ids.length && !propsQuery.includes(_constants.ID)) propsQuery = "".concat(propsQuery.trim(), " ").concat(_constants.ID);
|
|
@@ -156,6 +159,7 @@ var buiildShapeProps = function buiildShapeProps(shape, shapeKey, dataSummaries,
|
|
|
156
159
|
};
|
|
157
160
|
|
|
158
161
|
var formatProp = function formatProp(prop) {
|
|
162
|
+
var relations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
159
163
|
if (!prop.includes('.')) return prop;
|
|
160
164
|
|
|
161
165
|
var _prop$split = prop.split('.'),
|
|
@@ -163,7 +167,11 @@ var formatProp = function formatProp(prop) {
|
|
|
163
167
|
mainProp = _prop$split2[0],
|
|
164
168
|
nestedProp = _prop$split2[1];
|
|
165
169
|
|
|
166
|
-
|
|
170
|
+
var idProp = relations.find(function (_ref3) {
|
|
171
|
+
var localField = _ref3.localField;
|
|
172
|
+
return localField === mainProp;
|
|
173
|
+
}) ? 'id ' : '';
|
|
174
|
+
return "".concat(mainProp, "{").concat(idProp).concat(nestedProp, "}");
|
|
167
175
|
};
|
|
168
176
|
|
|
169
177
|
var buildShapesConfig = function buildShapesConfig(schemas, entityGroups, parent) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"build-shapes-configs.js","names":["getPropValues","properties","reduce","acc","property","includes","split","relationName","relationProp","trim","getUpdatedPropsQuery","propsQuery","entityData","dynamicProperties","Object","keys","filter","prop","URL","url","hasImage","IMAGE_ID","length","updatedPropsQuery","buildFilterQueryString","filterKey","filterValue","filterKeyword","bool","should","match","buildFilters","filters","filterQueryProps","map","buiildShapeProps","shape","shapeKey","dataSummaries","parentId","entityGroup","displayItems","filterBy","latProp","lonProp","entity","actions","relations","action","getAllPublished","getAll","dataSummaryProps","propsToDisplay","propsToDisplayValues","propertiesToDisplay","propsToDisplayString","ids","push","filtersObject","formatProp","ID","mainProp","nestedProp","idProp","find","localField","buildShapesConfig","schemas","entityGroups","parent","itemId","itemEntity","shapeGroups","forEach","i","shapes","Boolean","shapeIndex","shapeValues","shapeOptions","entityOptions"],"sources":["../../../src/GoogleMaps/helpers/build-shapes-configs.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { IMAGE_ID, URL, ID } from '../../constants';\n\nconst getPropValues = properties =>\n properties\n .reduce((acc, property) => {\n if (property.includes('.')) {\n const [relationName, relationProp] = property.split('.');\n return `${acc} ${relationName} { ${relationProp} }`;\n }\n return `${acc} ${property}`;\n }, '')\n .trim();\n\nconst getUpdatedPropsQuery = (propsQuery, entityData) => {\n const { properties = {}, dynamicProperties = {} } = entityData;\n\n const [url] = Object.keys(dynamicProperties).filter(prop => prop === URL);\n const hasImage = !!Object.keys(properties).filter(prop => prop === IMAGE_ID).length;\n\n let updatedPropsQuery = hasImage ? `${propsQuery} ${IMAGE_ID}` : propsQuery;\n updatedPropsQuery = url ? `${updatedPropsQuery} ${URL}` : updatedPropsQuery;\n\n return updatedPropsQuery;\n};\n\nconst buildFilterQueryString = filter => {\n const [filterKey, filterValue] = filter.split('/');\n const filterKeyword = `${filterKey}.keyword`;\n return { bool: { should: [{ match: { [filterKeyword]: filterValue } }] } };\n};\n\nconst buildFilters = filters => {\n if (!filters || !filters.length) return null;\n const filterQueryProps = filters.map(buildFilterQueryString);\n return { bool: { should: filterQueryProps } };\n};\n\nconst buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {\n const { displayItems = [], filterBy } = shape;\n const { latProp, lonProp, entity } = entityGroup;\n const { actions, relations } = entityData;\n const action = actions ? actions.getAllPublished || actions.getAll : '';\n\n const dataSummaryProps = dataSummaries\n .reduce((acc, { propsToDisplay }) => {\n const propsToDisplayValues = flatten(\n propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay)\n );\n const propsToDisplayString = getPropValues(propsToDisplayValues);\n\n return `${acc} ${propsToDisplayString}`;\n }, '')\n .trim();\n const ids = [];\n displayItems.length ? ids.push(displayItems[0]) : ids.push(parentId);\n\n const filtersObject = buildFilters(filterBy);\n let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';\n propsQuery = getUpdatedPropsQuery(propsQuery, entityData);\n if (latProp && lonProp) {\n propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(\n lonProp,\n relations\n )}`;\n }\n if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;\n\n return {\n shapeKey,\n entity,\n propsQuery,\n ids,\n action,\n filtersObject\n };\n};\n\nconst formatProp = (prop, relations = []) => {\n if (!prop.includes('.')) return prop;\n\n const [mainProp, nestedProp] = prop.split('.');\n const idProp = relations.find(({ localField }) => localField === mainProp) ? 'id ' : '';\n return `${mainProp}{${idProp}${nestedProp}}`;\n};\n\nconst buildShapesConfig = (schemas, entityGroups, parent) => {\n if (!schemas || !entityGroups) return [];\n const { itemId, itemEntity } = parent;\n const shapeGroups = [];\n entityGroups.forEach((entityGroup, i) => {\n const { entity, shapes, dataSummaries = [] } = entityGroup;\n const parentId = entity === itemEntity && itemId;\n if (!entity) return null;\n const entityData = schemas[entity] || {};\n\n shapes.filter(Boolean).forEach((shape, shapeIndex) => {\n const shapeKey = `shape${i}${shapeIndex}`;\n const shapeValues = buiildShapeProps(\n shape,\n shapeKey,\n dataSummaries,\n parentId,\n entityData,\n entityGroup\n );\n shapeGroups.push({ ...shapeValues, shapeOptions: shape, entityOptions: entityGroup });\n });\n });\n\n return shapeGroups;\n};\n\nexport default buildShapesConfig;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AACA;;;;;;AAEA,IAAMA,aAAa,GAAG,SAAhBA,aAAgB,CAAAC,UAAU;EAAA,OAC9BA,UAAU,CACPC,MADH,CACU,UAACC,GAAD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AMxC,QAAQ,kBAAWqC,CAAX,SAAeG,UAAf,CAAd;MACA,IAAMC,WAAW,GAAG3C,gBAAgB,CAClCC,KADkC,EAElCC,QAFkC,EAGlCC,aAHkC,EAIlCC,QAJkC,EAKlC3B,UALkC,EAMlC4B,WANkC,CAApC;MAQAgC,WAAW,CAACf,IAAZ,iCAAsBqB,WAAtB;QAAmCC,YAAY,EAAE3C,KAAjD;QAAwD4C,aAAa,EAAExC;MAAvE;IACD,CAXD;EAYD,CAlBD;EAoBA,OAAOgC,WAAP;AACD,CAzBD;;eA2BeN,iB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"get-center-coordinates.js","names":["getCenterCoordinates","mapShapes","otherProps","centerCoordinates","centerLatitude","centerLongitude","useDefaultCenter","latitude","longitude","useAsCenterShapes","filter","useAsCenter","shapesForCenter","length","forEach","push"],"sources":["../../../src/GoogleMaps/helpers/get-center-coordinates.js"],"sourcesContent":["import isNumber from 'lodash.isnumber';\n\nconst getCenterCoordinates = (mapShapes, otherProps) => {\n const centerCoordinates = [];\n\n const { centerLatitude, centerLongitude } = otherProps;\n const useDefaultCenter =\n centerLatitude !== 0 &&\n centerLongitude !== 0 &&\n isNumber(centerLatitude) &&\n isNumber(centerLongitude);\n\n if (useDefaultCenter) return [{ latitude: centerLatitude, longitude: centerLongitude }];\n\n const useAsCenterShapes = mapShapes.filter(({ useAsCenter }) => useAsCenter);\n const shapesForCenter = useAsCenterShapes.length ? useAsCenterShapes : mapShapes;\n shapesForCenter.forEach(({ latitude, longitude }) => {\n if (isNumber(latitude) && isNumber(longitude)) centerCoordinates.push({ latitude, longitude });\n });\n\n return centerCoordinates;\n};\n\nexport default getCenterCoordinates;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,SAAD,EAAYC,UAAZ,EAA2B;EACtD,IAAMC,iBAAiB,GAAG,EAA1B;EAEA,IAAQC,cAAR,GAA4CF,UAA5C,CAAQE,cAAR;EAAA,IAAwBC,eAAxB,GAA4CH,UAA5C,CAAwBG,eAAxB;EACA,IAAMC,gBAAgB,GACpBF,cAAc,KAAK,CAAnB,IACAC,eAAe,KAAK,CADpB,IAEA,wBAASD,cAAT,CAFA,IAGA,wBAASC,eAAT,CAJF;EAMA,IAAIC,gBAAJ,EAAsB,OAAO,CAAC;IAAEC,QAAQ,EAAEH,cAAZ;IAA4BI,SAAS,EAAEH;EAAvC,CAAD,CAAP;EAEtB,IAAMI,iBAAiB,GAAGR,SAAS,CAACS,MAAV,CAAiB;IAAA,IAAGC,WAAH,QAAGA,WAAH;IAAA,OAAqBA,WAArB;EAAA,CAAjB,CAA1B;EACA,IAAMC,eAAe,GAAGH,iBAAiB,CAACI,MAAlB,GAA2BJ,iBAA3B,GAA+CR,SAAvE;EACAW,eAAe,CAACE,OAAhB,CAAwB,iBAA6B;IAAA,IAA1BP,QAA0B,SAA1BA,QAA0B;IAAA,IAAhBC,SAAgB,SAAhBA,SAAgB;IACnD,IAAI,wBAASD,QAAT,KAAsB,wBAASC,SAAT,CAA1B,EAA+CL,iBAAiB,CAACY,IAAlB,CAAuB;MAAER,QAAQ,EAARA,QAAF;MAAYC,SAAS,EAATA;IAAZ,CAAvB;EAChD,CAFD;EAIA,OAAOL,iBAAP;AACD,CAnBD;;eAqBeH,oB"}
|