@blaze-cms/plugin-google-maps-fe 0.125.0-core-styles.0 → 0.125.0-core-styles.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.
- package/CHANGELOG.md +8 -0
- package/lib/GoogleMaps/GoogleMaps.js +24 -71
- package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsFactory.js +8 -24
- package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsHtml.js +0 -6
- package/lib/GoogleMaps/GoogleMapsHtml.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsRender.js +12 -33
- package/lib/GoogleMaps/GoogleMapsRender.js.map +1 -1
- package/lib/GoogleMaps/helpers/add-zoom-listener.js +0 -6
- package/lib/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-shapes.js +7 -33
- package/lib/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-type-ids.js +0 -4
- package/lib/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-query.js +5 -17
- package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-shapes-configs.js +25 -70
- package/lib/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-center-coordinates.js +2 -11
- package/lib/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-image-ids.js +1 -13
- package/lib/GoogleMaps/helpers/get-image-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-path.js +1 -6
- package/lib/GoogleMaps/helpers/get-path.js.map +1 -1
- package/lib/GoogleMaps/helpers/index.js +0 -9
- package/lib/GoogleMaps/helpers/index.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-map-options.js +21 -33
- package/lib/GoogleMaps/helpers/set-map-options.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-shapes.js +30 -112
- package/lib/GoogleMaps/helpers/set-shapes.js.map +1 -1
- package/lib/GoogleMaps/hooks/index.js +0 -4
- package/lib/GoogleMaps/hooks/index.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-entity-schemas.js +8 -19
- package/lib/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-images.js +12 -19
- package/lib/GoogleMaps/hooks/use-get-images.js.map +1 -1
- package/lib/GoogleMaps/index.js +0 -4
- package/lib/GoogleMaps/index.js.map +1 -1
- package/lib/GoogleMaps/queries.js +0 -17
- package/lib/GoogleMaps/queries.js.map +1 -1
- package/lib/constants.js +0 -1
- package/lib/constants.js.map +1 -1
- package/lib/index.js +1 -22
- package/lib/index.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMaps.js +14 -25
- package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsFactory.js +4 -7
- package/lib-es/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsHtml.js +0 -2
- package/lib-es/GoogleMaps/GoogleMapsHtml.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsRender.js +5 -8
- package/lib-es/GoogleMaps/GoogleMapsRender.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/add-zoom-listener.js +0 -2
- package/lib-es/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-map-shapes.js +0 -8
- package/lib-es/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-map-type-ids.js +0 -2
- package/lib-es/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-query.js +0 -2
- package/lib-es/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-shapes-configs.js +0 -14
- package/lib-es/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/get-center-coordinates.js +0 -2
- package/lib-es/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/get-image-ids.js +0 -1
- package/lib-es/GoogleMaps/helpers/get-image-ids.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/get-path.js +0 -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 +2 -8
- package/lib-es/GoogleMaps/helpers/set-map-options.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/set-shapes.js +5 -41
- 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 +0 -2
- package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
- package/lib-es/GoogleMaps/hooks/use-get-images.js +0 -2
- 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 +0 -6
- package/lib-es/GoogleMaps/queries.js.map +1 -1
- package/lib-es/constants.js.map +1 -1
- package/lib-es/index.js +1 -3
- package/lib-es/index.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMaps.js","names":["React","useEffect","useState","PropTypes","useRouter","withTitle","useInView","functions","isEqual","omit","setMapOptions","addZoomListener","GOOGLE_MAPS_SCRIPT","LOAD","SCRIPT","IN_VIEW_CONFIG","GoogleMapsHtml","shouldNotUpdate","props","nextProps","funcs","nextFuncs","noPropChange","noFuncChange","length","every","fn","toString","GoogleMaps","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","router","isIntersecting","mapRef","map","setMap","options","onLoad","initialMap","window","google","maps","Map","current","latitude","lat","longitude","lng","setCenter","bounds","LatLngBounds","forEach","extend","LatLng","fitBounds","script","document","createElement","src","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","propTypes","array","string","func","object","defaultProps","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,OAAOA,
|
|
1
|
+
{"version":3,"file":"GoogleMaps.js","names":["React","useEffect","useState","PropTypes","useRouter","withTitle","useInView","functions","isEqual","omit","setMapOptions","addZoomListener","GOOGLE_MAPS_SCRIPT","LOAD","SCRIPT","IN_VIEW_CONFIG","GoogleMapsHtml","shouldNotUpdate","props","nextProps","funcs","nextFuncs","noPropChange","noFuncChange","length","every","fn","toString","GoogleMaps","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","router","isIntersecting","mapRef","map","setMap","options","onLoad","initialMap","window","google","maps","Map","current","latitude","lat","longitude","lng","setCenter","bounds","LatLngBounds","forEach","extend","LatLng","fitBounds","script","document","createElement","src","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","propTypes","array","string","func","object","defaultProps","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,OAAOA,KAAK,IAAIC,SAAS,EAAEC,QAAQ,QAAQ,OAAO;AAClD,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,SAAS,QAAQ,aAAa;AACvC,SAASC,SAAS,QAAQ,+BA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EAAEjC,SAAS,CAACqF,MAAM;EACxBlD,iBAAiB,EAAEnC,SAAS,CAACkF;AAC/B,CAAC;AAEDzD,UAAU,CAAC6D,YAAY,GAAG;EACxBpD,SAAS,EAAE,EAAE;EACbJ,SAAS,EAAE,EAAE;EACbK,iBAAiB,EAAE,EAAE;EACrBT,IAAI,EAAE,EAAE;EACRC,IAAI,EAAE,EAAE;EACRC,QAAQ,EAAE,EAAE;EACZC,YAAY,EAAE,EAAE;EAChBE,OAAO,EAAE,IAAI;EACbC,YAAY,EAAE,IAAI;EAClBC,MAAM,EAAE,CAAC;AACX,CAAC;AAED,eAAepC,KAAK,CAAC0F,IAAI,CAACrF,SAAS,CAACuB,UAAU,CAAC,EAAEX,eAAe,CAAC"}
|
|
@@ -7,14 +7,12 @@ import { useGetEntitySchemasAsObj } from '@blaze-cms/react-page-builder';
|
|
|
7
7
|
import { buildShapesConfig } from './helpers';
|
|
8
8
|
import GoogleMapsRender from './GoogleMapsRender';
|
|
9
9
|
import GoogleMapsHtml from './GoogleMapsHtml';
|
|
10
|
-
|
|
11
10
|
const GoogleMapsFactory = _ref => {
|
|
12
11
|
let {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
entityGroups,
|
|
13
|
+
parent
|
|
14
|
+
} = _ref,
|
|
15
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
18
16
|
const {
|
|
19
17
|
data,
|
|
20
18
|
loading,
|
|
@@ -31,7 +29,6 @@ const GoogleMapsFactory = _ref => {
|
|
|
31
29
|
parent: parent
|
|
32
30
|
}, otherProps));
|
|
33
31
|
};
|
|
34
|
-
|
|
35
32
|
GoogleMapsFactory.propTypes = {
|
|
36
33
|
parent: PropTypes.object,
|
|
37
34
|
entityGroups: PropTypes.array
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsFactory.js","names":["React","PropTypes","useGetEntitySchemasAsObj","buildShapesConfig","GoogleMapsRender","GoogleMapsHtml","GoogleMapsFactory","entityGroups","parent","otherProps","data","loading","error","map","entity","message","shapeConfigs","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,OAAOA,
|
|
1
|
+
{"version":3,"file":"GoogleMapsFactory.js","names":["React","PropTypes","useGetEntitySchemasAsObj","buildShapesConfig","GoogleMapsRender","GoogleMapsHtml","GoogleMapsFactory","entityGroups","parent","otherProps","data","loading","error","map","entity","message","shapeConfigs","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,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,SAASC,wBAAwB,QAAQ,+BAA+B;AACxE,SAASC,iBAAiB,QAAQ,WAAW;AAC7C,OAAOC,gBAAgB,MAAM,oBAAoB;AACjD,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,iBAAiB,GAAG,QAA6C;EAAA,IAA5C;MAAEC,YAAY;MAAEC;IAAsB,CAAC;IAAZC,UAAU;EAC9D,MAAM;IAAEC,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGV,wBAAwB,CACvDK,YAAY,CAACM,GAAG,CAAC,CAAC;IAAEC;EAAO,CAAC,KAAKA,MAAM,CAAC,CACzC;EAED,IAAIH,OAAO,EAAE,oBAAO,oBAAC,cAAc,OAAG;EACtC,IAAIC,KAAK,EAAE,OAAOA,KAAK,CAACG,OAAO;EAE/B,MAAMC,YAAY,GAAGb,iBAAiB,CAACO,IAAI,EAAEH,YAAY,EAAEC,MAAM,CAAC;EAElE,oBACE,oBAAC,gBAAgB;IACf,YAAY,EAAEQ,YAAa;IAC3B,YAAY,EAAET,YAAa;IAC3B,MAAM,EAAEC;EAAO,GACXC,UAAU,EACd;AAEN,CAAC;AAEDH,iBAAiB,CAACW,SAAS,GAAG;EAC5BT,MAAM,EAAEP,SAAS,CAACiB,MAAM;EACxBX,YAAY,EAAEN,SAAS,CAACkB;AAC1B,CAAC;AAEDb,iBAAiB,CAACc,YAAY,GAAG;EAC/BZ,MAAM,EAAE,CAAC,CAAC;EACVD,YAAY,EAAE;AAChB,CAAC;AAED,eAAeD,iBAAiB"}
|
|
@@ -1,13 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
|
|
4
3
|
const GoogleMapsFactory = ({
|
|
5
4
|
mapRef
|
|
6
5
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
7
6
|
className: `google-maps ${!mapRef ? 'loading' : ''}`,
|
|
8
7
|
ref: mapRef
|
|
9
8
|
});
|
|
10
|
-
|
|
11
9
|
GoogleMapsFactory.propTypes = {
|
|
12
10
|
mapRef: PropTypes.object
|
|
13
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsHtml.js","names":["React","PropTypes","GoogleMapsFactory","mapRef","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,OAAOA,
|
|
1
|
+
{"version":3,"file":"GoogleMapsHtml.js","names":["React","PropTypes","GoogleMapsFactory","mapRef","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,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAElC,MAAMC,iBAAiB,GAAG,CAAC;EAAEC;AAAO,CAAC,kBACnC;EAAK,SAAS,EAAG,eAAc,CAACA,MAAM,GAAG,SAAS,GAAG,EAAG,EAAE;EAAC,GAAG,EAAEA;AAAO,EACxE;AAEDD,iBAAiB,CAACE,SAAS,GAAG;EAC5BD,MAAM,EAAEF,SAAS,CAACI;AACpB,CAAC;AAEDH,iBAAiB,CAACI,YAAY,GAAG;EAC/BH,MAAM,EAAE;AACV,CAAC;AAED,eAAeD,iBAAiB"}
|
|
@@ -11,15 +11,13 @@ import { buildQuery, getImageIds, getCenterCoordinates, buildMapShapes } from '.
|
|
|
11
11
|
import GoogleMaps from './GoogleMaps';
|
|
12
12
|
import GoogleMapsHtml from './GoogleMapsHtml';
|
|
13
13
|
const defaultQuery = getAction('getPublishedPages', 'id');
|
|
14
|
-
|
|
15
14
|
const GoogleMapsRender = _ref => {
|
|
16
15
|
let {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
shapeConfigs,
|
|
17
|
+
entityGroups,
|
|
18
|
+
id
|
|
19
|
+
} = _ref,
|
|
20
|
+
otherProps = _objectWithoutProperties(_ref, _excluded);
|
|
23
21
|
const {
|
|
24
22
|
defaultZoom
|
|
25
23
|
} = otherProps;
|
|
@@ -54,7 +52,6 @@ const GoogleMapsRender = _ref => {
|
|
|
54
52
|
imageData: imageData
|
|
55
53
|
}, otherProps));
|
|
56
54
|
};
|
|
57
|
-
|
|
58
55
|
GoogleMapsRender.propTypes = {
|
|
59
56
|
entityGroups: PropTypes.array,
|
|
60
57
|
id: PropTypes.string,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsRender.js","names":["React","PropTypes","isNumber","useQuery","getAction","useGetImages","buildQuery","getImageIds","getCenterCoordinates","buildMapShapes","GoogleMaps","GoogleMapsHtml","defaultQuery","GoogleMapsRender","shapeConfigs","entityGroups","id","otherProps","defaultZoom","query","data","loading","error","skip","mapShapes","imageIds","getFiles","imageData","imagesLoading","imagesError","centerCoordinates","shouldDisplayMap","length","slug","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,OAAOA,
|
|
1
|
+
{"version":3,"file":"GoogleMapsRender.js","names":["React","PropTypes","isNumber","useQuery","getAction","useGetImages","buildQuery","getImageIds","getCenterCoordinates","buildMapShapes","GoogleMaps","GoogleMapsHtml","defaultQuery","GoogleMapsRender","shapeConfigs","entityGroups","id","otherProps","defaultZoom","query","data","loading","error","skip","mapShapes","imageIds","getFiles","imageData","imagesLoading","imagesError","centerCoordinates","shouldDisplayMap","length","slug","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,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,SAAS,MAAM,YAAY;AAClC,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,SAAS,QAAQ,+BAA+B;AACzD,SAASC,YAAY,QAAQ,SAAS;AACtC,SAASC,UAAU,EAAEC,WAAW,EAAEC,oBAAoB,EAAEC,cAAc,QAAQ,WAAW;AACzF,OAAOC,UAAU,MAAM,cAAc;AACrC,OAAOC,cAAc,MAAM,kBAAkB;AAE7C,MAAMC,YAAY,GAAGR,SAAS,CAAC,mBAAmB,EAAE,IAAI,CAAC;AAEzD,MAAMS,gBAAgB,GAAG,QAAuD;EAAA,IAAtD;MAAEC,YAAY;MAAEC,YAAY;MAAEC;IAAkB,CAAC;IAAZC,UAAU;EACvE,MAAM;IAAEC;EAAY,CAAC,GAAGD,UAAU;EAClC,MAAM;IAAEE;EAAM,CAAC,GAAGb,UAAU,CAACQ,YAAY,CAAC;EAC1C,MAAM;IAAEM,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC,GAAGnB,QAAQ,CAACgB,KAAK,IAAIP,YAAY,EAAE;IAC/DW,IAAI,EAAE,CAACJ;EACT,CAAC,CAAC;EACF,MAAMK,SAAS,GAAGf,cAAc,CAACK,YAAY,EAAEM,IAAI,CAAC;EACpD,MAAMK,QAAQ,GAAGlB,WAAW,CAACiB,SAAS,CAAC;EACvC,MAAM;IACJJ,IAAI,EAAE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
2
|
import setShapes from './set-shapes';
|
|
3
|
-
|
|
4
3
|
const addZoomListener = (map, router, shapes, imageData) => {
|
|
5
4
|
if (!map) return;
|
|
6
5
|
setShapes(map, router, shapes, imageData);
|
|
7
6
|
map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData));
|
|
8
7
|
};
|
|
9
|
-
|
|
10
8
|
export default addZoomListener;
|
|
11
9
|
//# sourceMappingURL=add-zoom-listener.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-zoom-listener.js","names":["ZOOM_CHANGED","setShapes","addZoomListener","map","router","shapes","imageData","addListener"],"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,SAASA,
|
|
1
|
+
{"version":3,"file":"add-zoom-listener.js","names":["ZOOM_CHANGED","setShapes","addZoomListener","map","router","shapes","imageData","addListener"],"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,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,OAAOC,SAAS,MAAM,cAAc;AAEpC,MAAMC,eAAe,GAAG,CAACC,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,KAAK;EAC1D,IAAI,CAACH,GAAG,EAAE;EACVF,SAAS,CAACE,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,CAAC;EACzCH,GAAG,CAACI,WAAW,CAACP,YAAY,EAAE,MAAMC,SAAS,CAACE,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,CAAC,CAAC;AAChF,CAAC;AAED,eAAeJ,eAAe"}
|
|
@@ -1,15 +1,11 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
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; }
|
|
4
|
-
|
|
5
3
|
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) { _defineProperty(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; }
|
|
6
|
-
|
|
7
4
|
const getLatLonValues = (keys, data) => {
|
|
8
5
|
if (keys.length === 1) return data[keys];
|
|
9
6
|
const key = keys.shift();
|
|
10
7
|
return getLatLonValues(keys, data[key]);
|
|
11
8
|
};
|
|
12
|
-
|
|
13
9
|
const getLatLong = (latProp, lonProp, shape, data) => {
|
|
14
10
|
const {
|
|
15
11
|
latitude,
|
|
@@ -28,7 +24,6 @@ const getLatLong = (latProp, lonProp, shape, data) => {
|
|
|
28
24
|
longitude: lon
|
|
29
25
|
};
|
|
30
26
|
};
|
|
31
|
-
|
|
32
27
|
const buildMapShapes = (shapesOptions, shapesData) => {
|
|
33
28
|
if (!shapesData) return [];
|
|
34
29
|
const mapShapes = [];
|
|
@@ -56,7 +51,6 @@ const buildMapShapes = (shapesOptions, shapesData) => {
|
|
|
56
51
|
latitude,
|
|
57
52
|
longitude
|
|
58
53
|
} = getLatLong(latProp, lonProp, shapeOptions, data);
|
|
59
|
-
|
|
60
54
|
const formatedShape = _objectSpread(_objectSpread({}, shapeOptions), {}, {
|
|
61
55
|
latitude,
|
|
62
56
|
longitude,
|
|
@@ -65,12 +59,10 @@ const buildMapShapes = (shapesOptions, shapesData) => {
|
|
|
65
59
|
url,
|
|
66
60
|
shapeData: data
|
|
67
61
|
});
|
|
68
|
-
|
|
69
62
|
mapShapes.push(formatedShape);
|
|
70
63
|
});
|
|
71
64
|
});
|
|
72
65
|
return mapShapes;
|
|
73
66
|
};
|
|
74
|
-
|
|
75
67
|
export default buildMapShapes;
|
|
76
68
|
//# sourceMappingURL=build-map-shapes.js.map
|
|
@@ -1 +1 @@
|
|
|
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 return mapShapes;\n};\n\nexport default buildMapShapes;\n"],"mappings":"
|
|
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 return mapShapes;\n};\n\nexport default buildMapShapes;\n"],"mappings":";;;AAAA,MAAMA,eAAe,GAAG,CAACC,IAAI,EAAEC,IAAI,KAAK;EACtC,IAAID,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE,OAAOD,IAAI,CAACD,IAAI,CAAC;EACxC,MAAMG,GAAG,GAAGH,IAAI,CAACI,KAAK,EAAE;EACxB,OAAOL,eAAe,CAACC,IAAI,EAAEC,IAAI,CAACE,GAAG,CAAC,CAAC;AACzC,CAAC;AAED,MAAME,UAAU,GAAG,CAACC,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAEP,IAAI,KAAK;EACpD,MAAM;IAAEQ,QAAQ;IAAEC;EAAU,CAAC,GAAGF,KAAK;EAErC,IAAI,CAACF,OAAO,IAAI,CAACC,OAAO,EAAE,OAAO;IAAEE,QAAQ;IAAEC;EAAU,CAAC;EACxD,MAAMC,OAAO,GAAGL,OAAO,CAACM,KAAK,CAAC,GAAG,CAAC;EAClC,MAAMC,OAAO,GAAGN,OAAO,CAACK,KAAK,CAAC,GAAG,CAAC;EAClC,MAAME,GAAG,GAAGf,eAAe,CAACY,OAAO,EAAEV,IAAI,CAAC;EAC1C,MAAMc,GAAG,GAAGhB,eAAe,CAACc,OAAO,EAAEZ,IAAI,CAAC;EAE1C,OAAO;IAAEQ,QAAQ,EAAEK,GAAG;IAAEJ,SAAS,EAAEK;EAAI,CAAC;AAC1C,CAAC;AAED,MAAMC,cAAc,GAAG,CAACC,aAAa,EAAEC,UAAU,KAAK;EACpD,IAAI,CAACA,UAAU,EAAE,OAAO,EAAE;EAC1B,MAAMC,SAAS,GAAG,EAAE;EACpBF,aAAa,CAACG,OAAO,CAACZ,KAAK,IAAI;IAC7B,MAAM;MAAEa,QAAQ;MAAEC,aAAa;MAAEC;IAAa,CAAC,GAAGf,KAAK;IACvD,MAAM;MAAEgB,aAAa;MAAEC;IAAe,CAAC,GAAGH,aAAa;IAEvD,MAAMI,SAAS,GAAGC,KAAK,CAACC,OAAO,CAACV,UAAU,CAACG,QAAQ,CAAC,CAAC,GACjDH,UAAU,CAACG,QAAQ,CAAC,GACpBH,UAAU,CAACG,QAAQ,CAAC,CAACQ,OAAO;IAChC,IAAI,CAACH,SAAS,EAAE;IAChB,MAAM;MAAEpB,OAAO;MAAEC;IAAQ,CAAC,GAAGe,aAAa;IAE1CI,SAAS,CAACN,OAAO,CAACnB,IAAI,IAAI;MACxB,MAAM;QAAE6B;MAAI,CAAC,GAAG7B,IAAI;MACpB,MAAM;QAAEQ,QAAQ;QAAEC;MAAU,CAAC,GAAGL,UAAU,CAACC,OAAO,EAAEC,OAAO,EAAEgB,YAAY,EAAEtB,IAAI,CAAC;MAEhF,MAAM8B,aAAa,mCACdR,YAAY;QACfd,QAAQ;QACRC,SAAS;QACTc,aAAa;QACbC,cAAc;QACdK,GAAG;QACHJ,SAAS,EAAEzB;MAAI,EAChB;MAEDkB,SAAS,CAACa,IAAI,CAACD,aAAa,CAAC;IAC/B,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOZ,SAAS;AAClB,CAAC;AAED,eAAeH,cAAc"}
|
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
import { ROADMAP, SATELLITE, TERRAIN } from '../../constants';
|
|
2
|
-
|
|
3
2
|
const buildMapTypeIds = (enableSatelliteView, enableTerrainScreen) => {
|
|
4
3
|
const mapTypeIds = [ROADMAP];
|
|
5
4
|
if (enableSatelliteView) mapTypeIds.push(SATELLITE);
|
|
6
5
|
if (enableTerrainScreen) mapTypeIds.push(TERRAIN);
|
|
7
6
|
return mapTypeIds;
|
|
8
7
|
};
|
|
9
|
-
|
|
10
8
|
export default buildMapTypeIds;
|
|
11
9
|
//# sourceMappingURL=build-map-type-ids.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-map-type-ids.js","names":["ROADMAP","SATELLITE","TERRAIN","buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","push"],"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,SAASA,
|
|
1
|
+
{"version":3,"file":"build-map-type-ids.js","names":["ROADMAP","SATELLITE","TERRAIN","buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","push"],"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,SAASA,OAAO,EAAEC,SAAS,EAAEC,OAAO,QAAQ,iBAAiB;AAE7D,MAAMC,eAAe,GAAG,CAACC,mBAAmB,EAAEC,mBAAmB,KAAK;EACpE,MAAMC,UAAU,GAAG,CAACN,OAAO,CAAC;EAC5B,IAAII,mBAAmB,EAAEE,UAAU,CAACC,IAAI,CAACN,SAAS,CAAC;EACnD,IAAII,mBAAmB,EAAEC,UAAU,CAACC,IAAI,CAACL,OAAO,CAAC;EACjD,OAAOI,UAAU;AACnB,CAAC;AAED,eAAeH,eAAe"}
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';
|
|
2
|
-
|
|
3
2
|
const buildQuery = entityConfigs => {
|
|
4
3
|
const entityIds = [];
|
|
5
4
|
const rawQueryStringified = '';
|
|
@@ -26,6 +25,5 @@ const buildQuery = entityConfigs => {
|
|
|
26
25
|
rawQueryStringified
|
|
27
26
|
};
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
export default buildQuery;
|
|
31
29
|
//# sourceMappingURL=build-query.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-query.js","names":["generateQuery","generateIdsQuery","generateFiltersQuery","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,SAASA,
|
|
1
|
+
{"version":3,"file":"build-query.js","names":["generateQuery","generateIdsQuery","generateFiltersQuery","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,SAASA,aAAa,EAAEC,gBAAgB,EAAEC,oBAAoB,QAAQ,YAAY;AAElF,MAAMC,UAAU,GAAGC,aAAa,IAAI;EAClC,MAAMC,SAAS,GAAG,EAAE;EACpB,MAAMC,mBAAmB,GAAG,EAAE;EAC9B,MAAMC,WAAW,GAAGH,aAAa,CAC9BI,GAAG,CAACC,YAAY,IAAI;IACnB,MAAM;MAAEC,MAAM;MAAEC,GAAG;MAAEC,MAAM;MAAEC,UAAU;MAAEC,QAAQ;MAAEC;IAAc,CAAC,GAAGN,YAAY;IACjF,IAAI,CAACC,MAAM,EAAE,OAAO,EAAE;IACtB,MAAMM,cAAc,GAAI,GAAEJ,MAAM,CAAC,CAAC,CAAC,CAACK,WAAW,EAAG,GAAEL,MAAM,CAACM,KAAK,CAAC,CAAC,CAAE,EAAC;IACrE,MAAMC,cAAc,GAClBT,MAAM,CAACU,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,GAAI,YAAWJ,cAAe,EAAC,GAAGA,cAAc;IAEpFX,SAAS,CAACgB,IAAI,CAAC,GAAGV,GAAG,CAAC;IACtB,MAAMW,KAAK,GAAGT,UAAU,CAACU,IAAI,EAAE,IAAI,IAAI;IACvC,MAAMC,eAAe,GAAGT,aAAa,GACjCb,oBAAoB,CAACY,QAAQ,EAAEQ,KAAK,EAAEG,IAAI,CAACC,SAAS,CAACX,aAAa,CAAC,EAAEI,cAAc,CAAC,GACpFlB,gBAAgB,CAACa,QAAQ,EAAEQ,KAAK,EAAEZ,MAAM,EAAEC,GAAG,CAAC;IAElD,OAAOa,eAAe;EACxB,CAAC,CAAC,CACDG,IAAI,CAAC,GAAG,CAAC;EAEZ,OAAO;IACLC,KAAK,EAAErB,WAAW,GAAGP,aAAa,CAACO,WAAW,CAAC,GAAG,EAAE;IACpDI,GAAG,EAAEN,SAAS;IACdC;EACF,CAAC;AACH,CAAC;AAED,eAAeH,UAAU"}
|
|
@@ -1,21 +1,15 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
2
|
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; }
|
|
4
|
-
|
|
5
3
|
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) { _defineProperty(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; }
|
|
6
|
-
|
|
7
4
|
import flatten from 'lodash.flatten';
|
|
8
5
|
import { IMAGE_ID, URL, ID } from '../../constants';
|
|
9
|
-
|
|
10
6
|
const getPropValues = properties => properties.reduce((acc, property) => {
|
|
11
7
|
if (property.includes('.')) {
|
|
12
8
|
const [relationName, relationProp] = property.split('.');
|
|
13
9
|
return `${acc} ${relationName} { ${relationProp} }`;
|
|
14
10
|
}
|
|
15
|
-
|
|
16
11
|
return `${acc} ${property}`;
|
|
17
12
|
}, '').trim();
|
|
18
|
-
|
|
19
13
|
const getUpdatedPropsQuery = (propsQuery, entityData) => {
|
|
20
14
|
const {
|
|
21
15
|
properties = {},
|
|
@@ -27,7 +21,6 @@ const getUpdatedPropsQuery = (propsQuery, entityData) => {
|
|
|
27
21
|
updatedPropsQuery = url ? `${updatedPropsQuery} ${URL}` : updatedPropsQuery;
|
|
28
22
|
return updatedPropsQuery;
|
|
29
23
|
};
|
|
30
|
-
|
|
31
24
|
const buildFilterQueryString = filter => {
|
|
32
25
|
const [filterKey, filterValue] = filter.split('/');
|
|
33
26
|
const filterKeyword = `${filterKey}.keyword`;
|
|
@@ -41,7 +34,6 @@ const buildFilterQueryString = filter => {
|
|
|
41
34
|
}
|
|
42
35
|
};
|
|
43
36
|
};
|
|
44
|
-
|
|
45
37
|
const buildFilters = filters => {
|
|
46
38
|
if (!filters || !filters.length) return null;
|
|
47
39
|
const filterQueryProps = filters.map(buildFilterQueryString);
|
|
@@ -51,7 +43,6 @@ const buildFilters = filters => {
|
|
|
51
43
|
}
|
|
52
44
|
};
|
|
53
45
|
};
|
|
54
|
-
|
|
55
46
|
const buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {
|
|
56
47
|
const {
|
|
57
48
|
displayItems = [],
|
|
@@ -81,11 +72,9 @@ const buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData,
|
|
|
81
72
|
const filtersObject = buildFilters(filterBy);
|
|
82
73
|
let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';
|
|
83
74
|
propsQuery = getUpdatedPropsQuery(propsQuery, entityData);
|
|
84
|
-
|
|
85
75
|
if (latProp && lonProp) {
|
|
86
76
|
propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(lonProp, relations)}`;
|
|
87
77
|
}
|
|
88
|
-
|
|
89
78
|
if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;
|
|
90
79
|
return {
|
|
91
80
|
shapeKey,
|
|
@@ -96,7 +85,6 @@ const buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData,
|
|
|
96
85
|
filtersObject
|
|
97
86
|
};
|
|
98
87
|
};
|
|
99
|
-
|
|
100
88
|
const formatProp = (prop, relations = []) => {
|
|
101
89
|
if (!prop.includes('.')) return prop;
|
|
102
90
|
const [mainProp, nestedProp] = prop.split('.');
|
|
@@ -105,7 +93,6 @@ const formatProp = (prop, relations = []) => {
|
|
|
105
93
|
}) => localField === mainProp) ? 'id ' : '';
|
|
106
94
|
return `${mainProp}{${idProp}${nestedProp}}`;
|
|
107
95
|
};
|
|
108
|
-
|
|
109
96
|
const buildShapesConfig = (schemas, entityGroups, parent) => {
|
|
110
97
|
if (!schemas || !entityGroups) return [];
|
|
111
98
|
const {
|
|
@@ -133,6 +120,5 @@ const buildShapesConfig = (schemas, entityGroups, parent) => {
|
|
|
133
120
|
});
|
|
134
121
|
return shapeGroups;
|
|
135
122
|
};
|
|
136
|
-
|
|
137
123
|
export default buildShapesConfig;
|
|
138
124
|
//# sourceMappingURL=build-shapes-configs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-shapes-configs.js","names":["flatten","IMAGE_ID","URL","ID","getPropValues","properties","reduce","acc","property","includes","relationName","relationProp","split","trim","getUpdatedPropsQuery","propsQuery","entityData","dynamicProperties","url","Object","keys","filter","prop","hasImage","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","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":"
|
|
1
|
+
{"version":3,"file":"build-shapes-configs.js","names":["flatten","IMAGE_ID","URL","ID","getPropValues","properties","reduce","acc","property","includes","relationName","relationProp","split","trim","getUpdatedPropsQuery","propsQuery","entityData","dynamicProperties","url","Object","keys","filter","prop","hasImage","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","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"],"mapp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
|
4
3
|
const centerCoordinates = [];
|
|
5
4
|
const {
|
|
@@ -26,6 +25,5 @@ const getCenterCoordinates = (mapShapes, otherProps) => {
|
|
|
26
25
|
});
|
|
27
26
|
return centerCoordinates;
|
|
28
27
|
};
|
|
29
|
-
|
|
30
28
|
export default getCenterCoordinates;
|
|
31
29
|
//# sourceMappingURL=get-center-coordinates.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-center-coordinates.js","names":["isNumber","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,OAAOA,
|
|
1
|
+
{"version":3,"file":"get-center-coordinates.js","names":["isNumber","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,OAAOA,QAAQ,MAAM,iBAAiB;AAEtC,MAAMC,oBAAoB,GAAG,CAACC,SAAS,EAAEC,UAAU,KAAK;EACtD,MAAMC,iBAAiB,GAAG,EAAE;EAE5B,MAAM;IAAEC,cAAc;IAAEC;EAAgB,CAAC,GAAGH,UAAU;EACtD,MAAMI,gBAAgB,GACpBF,cAAc,KAAK,CAAC,IACpBC,eAAe,KAAK,CAAC,IACrBN,QAAQ,CAACK,cAAc,CAAC,IACxBL,QAAQ,CAACM,eAAe,CAAC;EAE3B,IAAIC,gBAAgB,EAAE,OAAO,CAAC;IAAEC,QAAQ,EAAEH,cAAc;IAAEI,SAAS,EAAEH;EAAgB,CAAC,CAAC;EAEvF,MAAMI,iBAAiB,GAAGR,SAAS,CAACS,MAAM,CAAC,CAAC;IAAEC;EAAY,CAAC,KAAKA,WAAW,CAAC;EAC5E,MAAMC,eAAe,GAAGH,iBAAiB,CAACI,MAAM,GAAGJ,iBAAiB,GAAGR,SAAS;EAChFW,eAAe,CAACE,OAAO,CAAC,CAAC;IAAEP,QAAQ;IAAEC;EAAU,CAAC,KAAK;IACnD,IAAIT,QAAQ,CAACQ,QAAQ,CAAC,IAAIR,QAAQ,CAACS,SAAS,CAAC,EAAEL,iBAAiB,CAACY,IAAI,CAAC;MAAER,QAAQ;MAAEC;IAAU,CAAC,CAAC;EAChG,CAAC,CAAC;EAEF,OAAOL,iBAAiB;AAC1B,CAAC;AAED,eAAeH,oBAAoB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-image-ids.js","names":["getImageIds","mapShapes","ids","forEach","shapeData","imageId","push","Set"],"sources":["../../../src/GoogleMaps/helpers/get-image-ids.js"],"sourcesContent":["const getImageIds = mapShapes => {\n const ids = [];\n mapShapes.forEach(({ shapeData, imageId }) => {\n if (imageId) ids.push(imageId);\n if (shapeData.imageId) ids.push(shapeData.imageId);\n });\n return [...new Set(ids)];\n};\n\nexport default getImageIds;\n"],"mappings":"AAAA,MAAMA,WAAW,GAAGC,SAAS,IAAI;EAC/B,MAAMC,GAAG,GAAG,
|
|
1
|
+
{"version":3,"file":"get-image-ids.js","names":["getImageIds","mapShapes","ids","forEach","shapeData","imageId","push","Set"],"sources":["../../../src/GoogleMaps/helpers/get-image-ids.js"],"sourcesContent":["const getImageIds = mapShapes => {\n const ids = [];\n mapShapes.forEach(({ shapeData, imageId }) => {\n if (imageId) ids.push(imageId);\n if (shapeData.imageId) ids.push(shapeData.imageId);\n });\n return [...new Set(ids)];\n};\n\nexport default getImageIds;\n"],"mappings":"AAAA,MAAMA,WAAW,GAAGC,SAAS,IAAI;EAC/B,MAAMC,GAAG,GAAG,EAAE;EACdD,SAAS,CAACE,OAAO,CAAC,CAAC;IAAEC,SAAS;IAAEC;EAAQ,CAAC,KAAK;IAC5C,IAAIA,OAAO,EAAEH,GAAG,CAACI,IAAI,CAACD,OAAO,CAAC;IAC9B,IAAID,SAAS,CAACC,OAAO,EAAEH,GAAG,CAACI,IAAI,CAACF,SAAS,CAACC,OAAO,CAAC;EACpD,CAAC,CAAC;EACF,OAAO,CAAC,GAAG,IAAIE,GAAG,CAACL,GAAG,CAAC,CAAC;AAC1B,CAAC;AAED,eAAeF,WAAW"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","latitude","lat","longitude","lng","push"],"sources":["../../../src/GoogleMaps/helpers/get-path.js"],"sourcesContent":["const getPath = paths =>\n paths.reduce((acc, path) => {\n const { latitude: lat, longitude: lng } = path;\n acc.push({ lat, lng });\n return acc;\n }, []);\n\nexport default getPath;\n"],"mappings":"AAAA,MAAMA,OAAO,GAAGC,KAAK,IACnBA,KAAK,CAACC,
|
|
1
|
+
{"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","latitude","lat","longitude","lng","push"],"sources":["../../../src/GoogleMaps/helpers/get-path.js"],"sourcesContent":["const getPath = paths =>\n paths.reduce((acc, path) => {\n const { latitude: lat, longitude: lng } = path;\n acc.push({ lat, lng });\n return acc;\n }, []);\n\nexport default getPath;\n"],"mappings":"AAAA,MAAMA,OAAO,GAAGC,KAAK,IACnBA,KAAK,CAACC,MAAM,CAAC,CAACC,GAAG,EAAEC,IAAI,KAAK;EAC1B,MAAM;IAAEC,QAAQ,EAAEC,GAAG;IAAEC,SAAS,EAAEC;EAAI,CAAC,GAAGJ,IAAI;EAC9CD,GAAG,CAACM,IAAI,CAAC;IAAEH,GAAG;IAAEE;EAAI,CAAC,CAAC;EACtB,OAAOL,GAAG;AACZ,CAAC,EAAE,EAAE,CAAC;AAER,eAAeH,OAAO"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["addZoomListener","buildQuery","getImageIds","buildShapesConfig","setMapOptions","getCenterCoordinates","buildMapShapes"],"sources":["../../../src/GoogleMaps/helpers/index.js"],"sourcesContent":["import addZoomListener from './add-zoom-listener';\nimport buildQuery from './build-query';\nimport getImageIds from './get-image-ids';\nimport buildShapesConfig from './build-shapes-configs';\nimport setMapOptions from './set-map-options';\nimport getCenterCoordinates from './get-center-coordinates';\nimport buildMapShapes from './build-map-shapes';\n\nexport {\n addZoomListener,\n buildQuery,\n getImageIds,\n buildShapesConfig,\n setMapOptions,\n getCenterCoordinates,\n buildMapShapes\n};\n"],"mappings":"AAAA,OAAOA,
|
|
1
|
+
{"version":3,"file":"index.js","names":["addZoomListener","buildQuery","getImageIds","buildShapesConfig","setMapOptions","getCenterCoordinates","buildMapShapes"],"sources":["../../../src/GoogleMaps/helpers/index.js"],"sourcesContent":["import addZoomListener from './add-zoom-listener';\nimport buildQuery from './build-query';\nimport getImageIds from './get-image-ids';\nimport buildShapesConfig from './build-shapes-configs';\nimport setMapOptions from './set-map-options';\nimport getCenterCoordinates from './get-center-coordinates';\nimport buildMapShapes from './build-map-shapes';\n\nexport {\n addZoomListener,\n buildQuery,\n getImageIds,\n buildShapesConfig,\n setMapOptions,\n getCenterCoordinates,\n buildMapShapes\n};\n"],"mappings":"AAAA,OAAOA,eAAe,MAAM,qBAAqB;AACjD,OAAOC,UAAU,MAAM,eAAe;AACtC,OAAOC,WAAW,MAAM,iBAAiB;AACzC,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,aAAa,MAAM,mBAAmB;AAC7C,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,OAAOC,cAAc,MAAM,oBAAoB;AAE/C,SACEN,eAAe,EACfC,UAAU,EACVC,WAAW,EACXC,iBAAiB,EACjBC,aAAa,EACbC,oBAAoB,EACpBC,cAAc"}
|