@blaze-cms/plugin-google-maps-fe 0.127.0 → 0.127.3
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.map +1 -1
- package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsHtml.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsRender.js +3 -3
- 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.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.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.map +1 -1
- package/lib/GoogleMaps/helpers/set-shapes.js +85 -91
- 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.map +1 -1
- package/lib/constants.js.map +1 -1
- package/lib/index.js +18 -20
- package/lib/index.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsHtml.js.map +1 -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.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
- 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/set-map-options.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/set-shapes.js.map +1 -1
- package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
- package/lib-es/GoogleMaps/queries.js.map +1 -1
- package/lib-es/index.js.map +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,14 @@
|
|
|
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.127.3](https://github.com/thebyte9/blaze/compare/v0.127.2...v0.127.3) (2023-03-31)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
6
14
|
# [0.127.0](https://github.com/thebyte9/blaze/compare/v0.126.1...v0.127.0) (2023-02-10)
|
|
7
15
|
|
|
8
16
|
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMaps.js","names":["shouldNotUpdate","props","nextProps","functions","funcs","nextFuncs","noPropChange","isEqual","omit","noFuncChange","length","every","fn","toString","GoogleMaps","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","router","useRouter","useInView","IN_VIEW_CONFIG","isIntersecting","mapRef","useState","map","setMap","useEffect","options","setMapOptions","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","addZoomListener","propTypes","PropTypes","array","string","func","object","defaultProps","React","memo","withTitle"],"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;AAA8C;AAAA;AAAA;AAE9C,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,KAAK,EAAEC,SAAS,EAAK;EAC5C,WAA2B,CAAC,IAAAC,iBAAS,EAACF,KAAK,CAAC,EAAE,IAAAE,iBAAS,EAACD,SAAS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ACxB/D,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;AAAC,4BAEaiE,iBAAK,CAACC,IAAI,CAAC,IAAAC,2BAAS,EAAC3E,UAAU,CAAC,EAAEd,eAAe,CAAC;AAAA"}
|
|
1
|
+
{"version":3,"file":"GoogleMaps.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_router","_reactPageBuilder","_customHooks","_lodash","_helpers","_constants","_GoogleMapsHtml","_excluded","_getRequireWildcardCache","nodeInterop","WeakMap","cacheBabelInterop","cacheNodeInterop","obj","__esModule","_typeof3","cache","has","get","newObj","hasPropertyDescriptor","Object","defineProperty","getOwnPropertyDescriptor","key","prototype","hasOwnProperty","call","desc","set","shouldNotUpdate","props","nextProps","_ref","functions","funcs","nextFuncs","noPropChange","isEqual","omit","noFuncChange","length","every","fn","toString","GoogleMaps","_ref2","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","_objectWithoutProperties2","router","useRouter","_useInView","useInView","IN_VIEW_CONFIG","_useInView2","_slicedToArray2","isIntersecting","mapRef","_useState","useState","_useState2","map","setMap","useEffect","options","setMapOptions","onLoad","initialMap","window","google","maps","Map","current","_centerCoordinates","_centerCoordinates$","lat","latitude","lng","longitude","setCenter","bounds","LatLngBounds","forEach","_ref3","extend","LatLng","fitBounds","script","document","createElement","SCRIPT","src","concat","GOOGLE_MAPS_SCRIPT","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","LOAD","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","_typeof2","addZoomListener","propTypes","PropTypes","array","string","func","object","defaultProps","_default","React","memo","withTitle","exports"],"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,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,eAAA,GAAAP,sBAAA,CAAAF,OAAA;AAA8C,IAAAU,SAAA;AAAA,SAAAC,yBAAAC,WAAA,eAAAC,OAAA,kCAAAC,iBAAA,OAAAD,OAAA,QA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AAEDtB,UAAU,CAAC8E,SAAS,GAAG;EACrBpE,SAAS,EAAEqE,qBAAS,CAACC,KAAK;EAC1B1E,SAAS,EAAEyE,qBAAS,CAACC,KAAK;EAC1B9E,IAAI,EAAE6E,qBAAS,CAACE,MAAM;EACtB9E,IAAI,EAAE4E,qBAAS,CAACE,MAAM;EACtB7E,QAAQ,EAAE2E,qBAAS,CAACE,MAAM;EAC1B5E,YAAY,EAAE0E,qBAAS,CAACE,MAAM;EAC9B1E,OAAO,EAAEwE,qBAAS,CAACG,IAAI;EACvB1E,YAAY,EAAEuE,qBAAS,CAACI,MAAM;EAC9B1E,MAAM,EAAEsE,qBAAS,CAACI,MAAM;EACxBxE,iBAAiB,EAAEoE,qBAAS,CAACC;AAC/B,CAAC;AAEDhF,UAAU,CAACoF,YAAY,GAAG;EACxB1E,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;AAAC,IAAA4E,QAAA,gBAEaC,iBAAK,CAACC,IAAI,CAAC,IAAAC,2BAAS,EAACxF,UAAU,CAAC,EAAEf,eAAe,CAAC;AAAAwG,OAAA,cAAAJ,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsFactory.js","names":["GoogleMapsFactory","entityGroups","parent","otherProps","useGetEntitySchemasAsObj","map","entity","data","loading","error","message","shapeConfigs","buildShapesConfig","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;AAA8C;AAE9C,
|
|
1
|
+
{"version":3,"file":"GoogleMapsFactory.js","names":["_react","_interopRequireDefault","require","_propTypes","_reactPageBuilder","_helpers","_GoogleMapsRender","_GoogleMapsHtml","_excluded","GoogleMapsFactory","_ref","entityGroups","parent","otherProps","_objectWithoutProperties2","_useGetEntitySchemasA","useGetEntitySchemasAsObj","map","_ref2","entity","data","loading","error","createElement","message","shapeConfigs","buildShapesConfig","_extends2","propTypes","PropTypes","object","array","defaultProps","_default","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA8C,IAAAM,SAAA;AAE9C,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAAgD;EAAA,IAA1CC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAKC,UAAU,OAAAC,yBAAA,aAAAJ,IAAA,EAAAF,SAAA;EAC9D,IAAAO,qBAAA,GAAiC,IAAAC,0CAAwB,EACvDL,YAAY,CAACM,GAAG,CAAC,UAAAC,KAAA;MAAA,IAAGC,MAAM,GAAAD,KAAA,CAANC,MAAM;MAAA,OAAOA,MAAM;IAAA,EAAC,CACzC;IAFOC,IAAI,GAAAL,qBAAA,CAAJK,IAAI;IAAEC,OAAO,GAAAN,qBAAA,CAAPM,OAAO;IAAEC,KAAK,GAAAP,qBAAA,CAALO,KAAK;EAI5B,IAAID,OAAO,EAAE,oBAAOrB,MAAA,YAAAuB,aAAA,CAAChB,eAAA,WAAc,OAAG;EACtC,IAAIe,KAAK,EAAE,OAAOA,KAAK,CAACE,OAAO;EAE/B,IAAMC,YAAY,GAAG,IAAAC,0BAAiB,EAACN,IAAI,EAAET,YAAY,EAAEC,MAAM,CAAC;EAElE,oBACEZ,MAAA,YAAAuB,aAAA,CAACjB,iBAAA,WAAgB,MAAAqB,SAAA;IACfF,YAAY,EAAEA,YAAa;IAC3Bd,YAAY,EAAEA,YAAa;IAC3BC,MAAM,EAAEA;EAAO,GACXC,UAAU,EACd;AAEN,CAAC;AAEDJ,iBAAiB,CAACmB,SAAS,GAAG;EAC5BhB,MAAM,EAAEiB,qBAAS,CAACC,MAAM;EACxBnB,YAAY,EAAEkB,qBAAS,CAACE;AAC1B,CAAC;AAEDtB,iBAAiB,CAACuB,YAAY,GAAG;EAC/BpB,MAAM,EAAE,CAAC,CAAC;EACVD,YAAY,EAAE;AAChB,CAAC;AAAC,IAAAsB,QAAA,GAEaxB,iBAAiB;AAAAyB,OAAA,cAAAD,QAAA"}
|
|
@@ -1 +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,
|
|
1
|
+
{"version":3,"file":"GoogleMapsHtml.js","names":["_react","_interopRequireDefault","require","_propTypes","GoogleMapsFactory","_ref","mapRef","createElement","className","concat","ref","propTypes","PropTypes","object","defaultProps","_default","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AAEA,IAAME,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA;EAAA,IAAMC,MAAM,GAAAD,IAAA,CAANC,MAAM;EAAA,oBACjCN,MAAA,YAAAO,aAAA;IAAKC,SAAS,iBAAAC,MAAA,CAAiB,CAACH,MAAM,GAAG,SAAS,GAAG,EAAE,CAAG;IAACI,GAAG,EAAEJ;EAAO,EAAG;AAAA,CAC3E;AAEDF,iBAAiB,CAACO,SAAS,GAAG;EAC5BL,MAAM,EAAEM,qBAAS,CAACC;AACpB,CAAC;AAEDT,iBAAiB,CAACU,YAAY,GAAG;EAC/BR,MAAM,EAAE;AACV,CAAC;AAAC,IAAAS,QAAA,GAEaX,iBAAiB;AAAAY,OAAA,cAAAD,QAAA"}
|
|
@@ -36,9 +36,9 @@ var GoogleMapsRender = function GoogleMapsRender(_ref) {
|
|
|
36
36
|
var mapShapes = (0, _helpers.buildMapShapes)(shapeConfigs, data);
|
|
37
37
|
var imageIds = (0, _helpers.getImageIds)(mapShapes);
|
|
38
38
|
var _useGetImages = (0, _hooks.useGetImages)(imageIds),
|
|
39
|
-
_useGetImages$data = _useGetImages.data
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
_useGetImages$data = _useGetImages.data,
|
|
40
|
+
_useGetImages$data2 = _useGetImages$data === void 0 ? {} : _useGetImages$data,
|
|
41
|
+
imageData = _useGetImages$data2.getFiles,
|
|
42
42
|
imagesLoading = _useGetImages.loading,
|
|
43
43
|
imagesError = _useGetImages.error;
|
|
44
44
|
if (loading || imagesLoading) return /*#__PURE__*/_react["default"].createElement(_GoogleMapsHtml["default"], null);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsRender.js","names":["defaultQuery","getAction","GoogleMapsRender","shapeConfigs","entityGroups","id","otherProps","defaultZoom","buildQuery","query","useQuery","skip","data","loading","error","mapShapes","buildMapShapes","imageIds","getImageIds","useGetImages","imageData","getFiles","imagesLoading","imagesError","centerCoordinates","getCenterCoordinates","shouldDisplayMap","isNumber","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;AAA8C;AAE9C,
|
|
1
|
+
{"version":3,"file":"GoogleMapsRender.js","names":["_react","_interopRequireDefault","require","_propTypes","_lodash","_client","_reactPageBuilder","_hooks","_helpers","_GoogleMaps","_GoogleMapsHtml","_excluded","defaultQuery","getAction","GoogleMapsRender","_ref","shapeConfigs","entityGroups","id","otherProps","_objectWithoutProperties2","defaultZoom","_buildQuery","buildQuery","query","_useQuery","useQuery","skip","data","loading","error","mapShapes","buildMapShapes","imageIds","getImageIds","_useGetImages","useGetImages","_useGetImages$data","_useGetImages$data2","imageData","getFiles","imagesLoading","imagesError","createElement","centerCoordinates","getCenterCoordinates","shouldDisplayMap","isNumber","length","_extends2","key","slug","propTypes","PropTypes","array","string","centerLatitude","number","centerLongitude","defaultProps","_default","exports"],"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,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,OAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,WAAA,GAAAR,sBAAA,CAAAC,OAAA;AACA,IAAAQ,eAAA,GAAAT,sBAAA,CAAAC,OAAA;AAA8C,IAAAS,SAAA;AAE9C,IAAMC,YAAY,GAAG,IAAAC,2BAAS,EAAC,mBAAmB,EAAE,IAAI,CAAC;AAEzD,IAAMC,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAA0D;EAAA,IAApDC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAEC,YAAY,GAAAF,IAAA,CAAZE,YAAY;IAAEC,EAAE,GAAAH,IAAA,CAAFG,EAAE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oBACE9C,MAAA,YAAA2C,aAAA,CAAClC,WAAA,WAAU,MAAAwC,SAAA;IACTC,GAAG,EAAE/B,UAAU,CAACgC,IAAK;IACrBP,iBAAiB,EAAEA,iBAAkB;IACrCb,SAAS,EAAEA,SAAU;IACrBQ,SAAS,EAAEA;EAAU,GACjBpB,UAAU,EACd;AAEN,CAAC;AAEDL,gBAAgB,CAACsC,SAAS,GAAG;EAC3BnC,YAAY,EAAEoC,qBAAS,CAACC,KAAK;EAC7BpC,EAAE,EAAEmC,qBAAS,CAACE,MAAM;EACpBvC,YAAY,EAAEqC,qBAAS,CAACC,KAAK;EAC7BE,cAAc,EAAEH,qBAAS,CAACI,MAAM;EAChCC,eAAe,EAAEL,qBAAS,CAACI,MAAM;EACjCpC,WAAW,EAAEgC,qBAAS,CAACI;AACzB,CAAC;AAED3C,gBAAgB,CAAC6C,YAAY,GAAG;EAC9B1C,YAAY,EAAE,EAAE;EAChBD,YAAY,EAAE,EAAE;EAChBE,EAAE,EAAE,EAAE;EACNsC,cAAc,EAAE,IAAI;EACpBE,eAAe,EAAE,IAAI;EACrBrC,WAAW,EAAE;AACf,CAAC;AAAC,IAAAuC,QAAA,GAEa9C,gBAAgB;AAAA+C,OAAA,cAAAD,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-zoom-listener.js","names":["addZoomListener","map","router","shapes","imageData","setShapes","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,
|
|
1
|
+
{"version":3,"file":"add-zoom-listener.js","names":["_constants","require","_setShapes","_interopRequireDefault","addZoomListener","map","router","shapes","imageData","setShapes","addListener","ZOOM_CHANGED","_default","exports"],"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,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AAEA,IAAMG,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAK;EAC1D,IAAI,CAACH,GAAG,EAAE;EACV,IAAAI,qBAAS,EAACJ,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,CAAC;EACzCH,GAAG,CAACK,WAAW,CAACC,uBAAY,EAAE;IAAA,OAAM,IAAAF,qBAAS,EAACJ,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,CAAC;EAAA,EAAC;AAChF,CAAC;AAAC,IAAAI,QAAA,GAEaR,eAAe;AAAAS,OAAA,cAAAD,QAAA"}
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,eAAe,GAAG,SAAlBA,
|
|
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","_getLatLong","formatedShape","_objectSpread","push","_default","exports"],"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,IAAMA,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,IAAI,EAAEC,IAAI,EAAK;EACtC,IAAID,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE,OAAOD,IAAI,CAACD,IAAI,CAAC;EACxC,IAAMG,GAAG,GAAGH,IAAI,CAACI,KAAK,EAAE;EACxB,OAAOL,eAAe,CAACC,IAAI,EAAEC,IAAI,CAACE,GAAG,CAAC,CAAC;AACzC,CAAC;AAED,IAAME,UAAU,GAAG,SAAbA,UAAUA,CAAIC,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAEP,IAAI,EAAK;EACpD,IAAQQ,QAAQ,GAAgBD,KAAK,CAA7BC,QAAQ;IAAEC,SAAS,GAAKF,KAAK,CAAnBE,SAAS;EAE3B,IAAI,CAACJ,OAAO,IAAI,CAACC,OAAO,EAAE,OAAO;IAAEE,QAAQ,EAARA,QAAQ;IAAEC,SAAS,EAATA;EAAU,CAAC;EACxD,IAAMC,OAAO,GAAGL,OAAO,CAACM,KAAK,CAAC,GAAG,CAAC;EACl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,SAAS,GAAAqB,WAAA,CAATrB,SAAS;MAE3B,IAAMsB,aAAa,GAAAC,aAAA,CAAAA,aAAA,KACdV,YAAY;QACfd,QAAQ,EAARA,QAAQ;QACRC,SAAS,EAATA,SAAS;QACTc,aAAa,EAAbA,aAAa;QACbC,cAAc,EAAdA,cAAc;QACdK,GAAG,EAAHA,GAAG;QACHJ,SAAS,EAAEzB;MAAI,EAChB;MAEDkB,SAAS,CAACe,IAAI,CAACF,aAAa,CAAC;IAC/B,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOb,SAAS;AAClB,CAAC;AAAC,IAAAgB,QAAA,GAEanB,cAAc;AAAAoB,OAAA,cAAAD,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-map-type-ids.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,
|
|
1
|
+
{"version":3,"file":"build-map-type-ids.js","names":["_constants","require","buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","ROADMAP","push","SATELLITE","TERRAIN","_default","exports"],"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,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAMC,eAAe,GAAG,SAAlBA,eAAeA,CAAIC,mBAAmB,EAAEC,mBAAmB,EAAK;EACpE,IAAMC,UAAU,GAAG,CAACC,kBAAO,CAAC;EAC5B,IAAIH,mBAAmB,EAAEE,UAAU,CAACE,IAAI,CAACC,oBAAS,CAAC;EACnD,IAAIJ,mBAAmB,EAAEC,UAAU,CAACE,IAAI,CAACE,kBAAO,CAAC;EACjD,OAAOJ,UAAU;AACnB,CAAC;AAAC,IAAAK,QAAA,GAEaR,eAAe;AAAAS,OAAA,cAAAD,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
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","generateFiltersQuery","JSON","stringify","generateIdsQuery","join","query","generateQuery"],"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,
|
|
1
|
+
{"version":3,"file":"build-query.js","names":["_queries","require","buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","concat","toUpperCase","slice","filterQueryKey","indexOf","push","apply","_toConsumableArray2","props","trim","singleItemQuery","generateFiltersQuery","JSON","stringify","generateIdsQuery","join","query","generateQuery","_default","exports"],"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,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAGC,aAAa,EAAI;EAClC,IAAMC,SAAS,GAAG,EAAE;EACpB,IAAMC,mBAAmB,GAAG,EAAE;EAC9B,IAAMC,WAAW,GAAGH,aAAa,CAC9BI,GAAG,CAAC,UAAAC,YAAY,EAAI;IACnB,IAAQC,MAAM,GAAuDD,YAAY,CAAzEC,MAAM;MAAEC,GAAG,GAAkDF,YAAY,CAAjEE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","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","flatten","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;AAAoD;AAAA;AAEpD,IAAMA,aAAa,GAAG,SAAhBA,aAAa,CAAGC,UAAU;EAAA,OAC9BA,UAAU,CACPC,MAAM,CAAC,UAACC,GAAG,EAAEC,QAAQ,EAAK;IACzB,IAAIA,QAAQ,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;MAC1B,sBAAqCD,QAAQ,CAACE,KAAK,CAAC,GAAG,CAAC;QAAA;QAAjDC,YAAY;QAAEC,YAAY;MACjC,iBAAUL,GAAG,cAAII,YAAY,gBAAMC,YAAY;IACjD;IACA,iBAAUL,GAAG,cAAIC,QAAQ;EAC3B,CAAC,EAAE,EAAE,CAAC,CACLK,IAAI,EAAE;AAAA;AAEX,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoB,CAAIC,UAAU,EAAEC,UAAU,EAAK;EACvD,4BAAoDA,UAAU,CAAtDX,UAAU;IAAVA,UAAU,sCAAG,CAAC,CAAC;IAAA,wBAA6BW,UAAU,CAArCC,iBAAiB;IAAjBA,iBAAiB,sCAAG,CAAC,CAAC;EAE/C,0BAAcC,MAAM,CAACC,IAAI,CAACF,iBAAiB,CAAC,CAACG,MAAM,CAAC,UAAAC,IAAI;MAAA,OAAIA,IAAI,KAAKC,cAAG;IAAA,EAAC;IAAA;IAAlEC,GAAG;EACV,IAAMC,QAAQ,GAAG,CAAC,CAACN,MAAM,CAACC,IAAI,CAACd,UAAU,CAAC,CAACe,MAAM,CAAC,UAAAC,IAAI;IAAA,OAAIA,IAAI,KAAKI,mBAAQ;EAAA,EAAC,CAACC,MAAM;EAEnF,IAAIC,iBAAiB,GAAGH,QAAQ,aAAMT,UAAU,cAAIU,mBAAQ,IAAKV,UAAU;EAC3EY,iBAAiB,GAAGJ,GAAG,aAAMI,iBA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D,OAAO,CAAC,CAACH,OAAO,CAAC,UAACtC,KAAK,EAAE0C,UAAU,EAAK;MACpD,IAAMzC,QAAQ,kBAAWsC,CAAC,SAAGG,UAAU,CAAE;MACzC,IAAMC,WAAW,GAAG5C,gBAAgB,CAClCC,KAAK,EACLC,QAAQ,EACRC,aAAa,EACbC,QAAQ,EACR3B,UAAU,EACV4B,WAAW,CACZ;MACDiC,WAAW,CAACf,IAAI,iCAAMqB,WAAW;QAAEC,YAAY,EAAE5C,KAAK;QAAE6C,aAAa,EAAEzC;MAAW,GAAG;IACvF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOiC,WAAW;AACpB,CAAC;AAAC,eAEaN,iBAAiB;AAAA"}
|
|
1
|
+
{"version":3,"file":"build-shapes-configs.js","names":["_lodash","_interopRequireDefault","require","_constants","ownKeys","object","enumerableOnly","keys","Object","getOwnPropertySymbols","symbols","filter","sym","getOwnPropertyDescriptor","enumerable","push","apply","_objectSpread","target","i","arguments","length","source","forEach","key","_defineProperty2","getOwnPropertyDescriptors","defineProperties","defineProperty","getPropValues","properties","reduce","acc","property","includes","_property$split","split","_property$split2","_slicedToArray2","relationName","relationProp","concat","trim","getUpdatedPropsQuery","propsQuery","entityData","_entityData$propertie","_entityData$dynamicPr","dynamicProperties","_Object$keys$filter","prop","URL","_Object$keys$filter2","url","hasImage","IMAGE_ID","updatedPropsQuery","buildFilterQueryString","_filter$split","_filter$split2","filterKey","filterValue","filterKeyword","bool","should","match","buildFilters","filters","filterQueryProps","map","buiildShapeProps","shape","shapeKey","dataSummaries","parentId","entityGroup","_shape$displayItems","displayItems","filterBy","latProp","lonProp","entity","actions","relations","action","getAllPublished","getAll","dataSummaryProps","_ref","propsToDisplay","propsToDisplayValues","flatten","_ref2","propertiesToDisplay","propsToDisplayString","ids","filtersObject","formatProp","ID","undefined","_prop$split","_prop$split2","mainProp","nestedProp","idProp","find","_ref3","localField","buildShapesConfig","schemas","entityGroups","parent","itemId","itemEntity","shapeGroups","shapes","_entityGroup$dataSumm","Boolean","shapeIndex","shapeValues","shapeOptions","entityOptions","_default","exports"],"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,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAAoD,SAAAE,QAAAC,MAAA,EAAAC,cAAA,QAAAC,IAAA,GAAAC,MAAA,CAAAD,IAAA,CAAAF,MAAA,OAAAG,MAAA,CAAAC,qBAAA,QAAAC,OAAA,GAAAF,MAAA,CAAAC,qBAAA,CAAAJ,MAAA,GAAAC,cAAA,KAAAI,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AAyBxC,WAAW,CAA1CwC,MAAM;MAAAC,qBAAA,GAAyBzC,WAAW,CAAlCF,aAAa;MAAbA,aAAa,GAAA2C,qBAAA,cAAG,EAAE,GAAAA,qBAAA;IAC1C,IAAM1C,QAAQ,GAAGO,MAAM,KAAKgC,UAAU,IAAID,MAAM;IAChD,IAAI,CAAC/B,MAAM,EAAE,OAAO,IAAI;IACxB,IAAMpC,UAAU,GAAGgE,OAAO,CAAC5B,MAAM,CAAC,IAAI,CAAC,CAAC;IAExCkC,MAAM,CAACxG,MAAM,CAAC0G,OAAO,CAAC,CAAC9F,OAAO,CAAC,UAACgD,KAAK,EAAE+C,UAAU,EAAK;MACpD,IAAM9C,QAAQ,WAAA/B,MAAA,CAAWtB,CAAC,EAAAsB,MAAA,CAAG6E,UAAU,CAAE;MACzC,IAAMC,WAAW,GAAGjD,gBAAgB,CAClCC,KAAK,EACLC,QAAQ,EACRC,aAAa,EACbC,QAAQ,EACR7B,UAAU,EACV8B,WAAW,CACZ;MACDuC,WAAW,CAACnG,IAAI,CAAAE,aAAA,CAAAA,aAAA,KAAMsG,WAAW;QAAEC,YAAY,EAAEjD,KAAK;QAAEkD,aAAa,EAAE9C;MAAW,GAAG;IACvF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOuC,WAAW;AACpB,CAAC;AAAC,IAAAQ,QAAA,GAEad,iBAAiB;AAAAe,OAAA,cAAAD,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-center-coordinates.js","names":["getCenterCoordinates","mapShapes","otherProps","centerCoordinates","centerLatitude","centerLongitude","useDefaultCenter","isNumber","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,
|
|
1
|
+
{"version":3,"file":"get-center-coordinates.js","names":["_lodash","_interopRequireDefault","require","getCenterCoordinates","mapShapes","otherProps","centerCoordinates","centerLatitude","centerLongitude","useDefaultCenter","isNumber","latitude","longitude","useAsCenterShapes","filter","_ref","useAsCenter","shapesForCenter","length","forEach","_ref2","push","_default","exports"],"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,IAAAA,OAAA,GAAAC,sBAAA,CAAAC,OAAA;AAEA,IAAMC,oBAAoB,GAAG,SAAvBA,oBAAoBA,CAAIC,SAAS,EAAEC,UAAU,EAAK;EACtD,IAAMC,iBAAiB,GAAG,EAAE;EAE5B,IAAQC,cAAc,GAAsBF,UAAU,CAA9CE,cAAc;IAAEC,eAAe,GAAKH,UAAU,CAA9BG,eAAe;EACvC,IAAMC,gBAAgB,GACpBF,cAAc,KAAK,CAAC,IACpBC,eAAe,KAAK,CAAC,IACrB,IAAAE,kBAAQ,EAACH,cAAc,CAAC,IACxB,IAAAG,kBAAQ,EAACF,eAAe,CAAC;EAE3B,IAAIC,gBAAgB,EAAE,OAAO,CAAC;IAAEE,QAAQ,EAAEJ,cAAc;IAAEK,SAAS,EAAEJ;EAAgB,CAAC,CAAC;EAEvF,IAAMK,iBAAiB,GAAGT,SAAS,CAACU,MAAM,CAAC,UAAAC,IAAA;IAAA,IAAGC,WAAW,GAAAD,IAAA,CAAXC,WAAW;IAAA,OAAOA,WAAW;EAAA,EAAC;EAC5E,IAAMC,eAAe,GAAGJ,iBAAiB,CAACK,MAAM,GAAGL,iBAAiB,GAAGT,SAAS;EAChFa,eAAe,CAACE,OAAO,CAAC,UAAAC,KAAA,EAA6B;IAAA,IAA1BT,QAAQ,GAAAS,KAAA,CAART,QAAQ;MAAEC,SAAS,GAAAQ,KAAA,CAATR,SAAS;IAC5C,IAAI,IAAAF,kBAAQ,EAACC,QAAQ,CAAC,IAAI,IAAAD,kBAAQ,EAACE,SAAS,CAAC,EAAEN,iBAAiB,CAACe,IAAI,CAAC;MAAEV,QAAQ,EAARA,QAAQ;MAAEC,SAAS,EAATA;IAAU,CAAC,CAAC;EAChG,CAAC,CAAC;EAEF,OAAON,iBAAiB;AAC1B,CAAC;AAAC,IAAAgB,QAAA,GAEanB,oBAAoB;AAAAoB,OAAA,cAAAD,QAAA"}
|
|
@@ -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,IAAMA,WAAW,GAAG,SAAdA,
|
|
1
|
+
{"version":3,"file":"get-image-ids.js","names":["getImageIds","mapShapes","ids","forEach","_ref","shapeData","imageId","push","_toConsumableArray2","Set","_default","exports"],"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,IAAMA,WAAW,GAAG,SAAdA,WAAWA,CAAGC,SAAS,EAAI;EAC/B,IAAMC,GAAG,GAAG,EAAE;EACdD,SAAS,CAACE,OAAO,CAAC,UAAAC,IAAA,EAA4B;IAAA,IAAzBC,SAAS,GAAAD,IAAA,CAATC,SAAS;MAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;IACrC,IAAIA,OAAO,EAAEJ,GAAG,CAACK,IAAI,CAACD,OAAO,CAAC;IAC9B,IAAID,SAAS,CAACC,OAAO,EAAEJ,GAAG,CAACK,IAAI,CAACF,SAAS,CAACC,OAAO,CAAC;EACpD,CAAC,CAAC;EACF,WAAAE,mBAAA,aAAW,IAAIC,GAAG,CAACP,GAAG,CAAC;AACzB,CAAC;AAAC,IAAAQ,QAAA,GAEaV,WAAW;AAAAW,OAAA,cAAAD,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","lat","latitude","lng","longitude","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,IAAMA,OAAO,GAAG,SAAVA,
|
|
1
|
+
{"version":3,"file":"get-path.js","names":["getPath","paths","reduce","acc","path","lat","latitude","lng","longitude","push","_default","exports"],"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,IAAMA,OAAO,GAAG,SAAVA,OAAOA,CAAGC,KAAK;EAAA,OACnBA,KAAK,CAACC,MAAM,CAAC,UAACC,GAAG,EAAEC,IAAI,EAAK;IAC1B,IAAkBC,GAAG,GAAqBD,IAAI,CAAtCE,QAAQ;MAAkBC,GAAG,GAAKH,IAAI,CAAvBI,SAAS;IAChCL,GAAG,CAACM,IAAI,CAAC;MAAEJ,GAAG,EAAHA,GAAG;MAAEE,GAAG,EAAHA;IAAI,CAAC,CAAC;IACtB,OAAOJ,GAAG;EACZ,CAAC,EAAE,EAAE,CAAC;AAAA;AAAC,IAAAO,QAAA,GAEMV,OAAO;AAAAW,OAAA,cAAAD,QAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":[],"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;AACA;AACA;AACA;AACA;AACA;AACA"}
|
|
1
|
+
{"version":3,"file":"index.js","names":["_addZoomListener","_interopRequireDefault","require","_buildQuery","_getImageIds","_buildShapesConfigs","_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,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,WAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,YAAA,GAAAH,sBAAA,CAAAC,OAAA;AACA,IAAAG,mBAAA,GAAAJ,sBAAA,CAAAC,OAAA;AACA,IAAAI,cAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,qBAAA,GAAAN,sBAAA,CAAAC,OAAA;AACA,IAAAM,eAAA,GAAAP,sBAAA,CAAAC,OAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-map-options.js","names":["setCustomColor","featureType","color","elementType","ELEMENT_GEOMETRY","stylers","getFeatureStyles","enableRoads","enableFeatureTransportation","enableFeatureLabels","enableFeaturePoi","enableFeatureBoundaries","customColors","push","DISABLE_LABELS_STYLES","DISABLE_BOUNDARIES_STYLES","DISABLE_POI_STYLES","DISABLE_TRANSPORTATION_STYLES","setMapOptions","otherProps","centerLatitude","centerLongitude","defaultZoom","enableZoom","maxZoom","minZoom","enablePan","enableStreetView","enableFullScreen","enableSatelliteView","enableTerrainScreen","waterColor","landscapeColor","landscapeColorAll","mapType","FEATURE_TYPE_MAP","ALL","center","lat","lng","zoom","gestureHandling","COOPERATIVE","NONE","panControl","zoomControl","disableDoubleClickZoom","streetViewControl","fullscreenControl","mapTypeControl","mapTypeControlOptions","mapTypeIds","buildMapTypeIds","mapTypeId","DEFAULT_SELECT_VALUE","undefined","styles"],"sources":["../../../src/GoogleMaps/helpers/set-map-options.js"],"sourcesContent":["import buildMapTypeIds from './build-map-type-ids';\nimport {\n COOPERATIVE,\n NONE,\n ELEMENT_GEOMETRY,\n FEATURE_TYPE_MAP,\n ALL,\n DISABLE_TRANSPORTATION_STYLES,\n DISABLE_POI_STYLES,\n DISABLE_BOUNDARIES_STYLES,\n DISABLE_LABELS_STYLES,\n DEFAULT_SELECT_VALUE\n} from '../../constants';\n\nconst setCustomColor = (featureType, color, elementType) =>\n color\n ? [\n {\n featureType,\n elementType: elementType || ELEMENT_GEOMETRY,\n stylers: [\n {\n color\n }\n ]\n }\n ]\n : [];\n\nconst getFeatureStyles = ({\n enableRoads = true,\n enableFeatureTransportation,\n enableFeatureLabels,\n enableFeaturePoi,\n enableFeatureBoundaries\n}) => {\n const customColors = [];\n // todo: enableRoads is a legacy option can be removed in later updates\n if (!enableFeatureLabels || !enableRoads) customColors.push(...DISABLE_LABELS_STYLES);\n if (!enableFeatureBoundaries || !enableRoads) customColors.push(...DISABLE_BOUNDARIES_STYLES);\n if (!enableFeaturePoi || !enableRoads) customColors.push(...DISABLE_POI_STYLES);\n if (!enableFeatureTransportation || !enableRoads) {\n customColors.push(...DISABLE_TRANSPORTATION_STYLES);\n }\n\n return customColors;\n};\n\nconst setMapOptions = otherProps => {\n const {\n centerLatitude,\n centerLongitude,\n defaultZoom,\n enableZoom,\n maxZoom,\n minZoom,\n enablePan,\n enableStreetView,\n enableFullScreen,\n enableSatelliteView,\n enableTerrainScreen,\n waterColor,\n landscapeColor,\n landscapeColorAll,\n mapType\n } = otherProps;\n\n const customColors = [\n ...getFeatureStyles(otherProps),\n ...setCustomColor(FEATURE_TYPE_MAP.waterColor, waterColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColorAll, ALL)\n ];\n\n return {\n center: { lat: centerLatitude, lng: centerLongitude },\n zoom: defaultZoom,\n maxZoom: enableZoom ? maxZoom : defaultZoom,\n minZoom: enableZoom ? minZoom : defaultZoom,\n gestureHandling: enablePan || enableZoom ? COOPERATIVE : NONE,\n panControl: enablePan,\n zoomControl: enableZoom && minZoom !== maxZoom,\n disableDoubleClickZoom: !enableZoom,\n streetViewControl: enableStreetView,\n fullscreenControl: enableFullScreen,\n mapTypeControl: enableSatelliteView || enableTerrainScreen,\n mapTypeControlOptions: {\n mapTypeIds: buildMapTypeIds(enableSatelliteView, enableTerrainScreen)\n },\n mapTypeId: !mapType || mapType === DEFAULT_SELECT_VALUE ? undefined : mapType,\n styles: customColors\n };\n};\n\nexport default setMapOptions;\n"],"mappings":";;;;;;;;;;AAAA;AACA;AAaA,
|
|
1
|
+
{"version":3,"file":"set-map-options.js","names":["_buildMapTypeIds","_interopRequireDefault","require","_constants","setCustomColor","featureType","color","elementType","ELEMENT_GEOMETRY","stylers","getFeatureStyles","_ref","_ref$enableRoads","enableRoads","enableFeatureTransportation","enableFeatureLabels","enableFeaturePoi","enableFeatureBoundaries","customColors","push","apply","_toConsumableArray2","DISABLE_LABELS_STYLES","DISABLE_BOUNDARIES_STYLES","DISABLE_POI_STYLES","DISABLE_TRANSPORTATION_STYLES","setMapOptions","otherProps","centerLatitude","centerLongitude","defaultZoom","enableZoom","maxZoom","minZoom","enablePan","enableStreetView","enableFullScreen","enableSatelliteView","enableTerrainScreen","waterColor","landscapeColor","landscapeColorAll","mapType","concat","FEATURE_TYPE_MAP","ALL","center","lat","lng","zoom","gestureHandling","COOPERATIVE","NONE","panControl","zoomControl","disableDoubleClickZoom","streetViewControl","fullscreenControl","mapTypeControl","mapTypeControlOptions","mapTypeIds","buildMapTypeIds","mapTypeId","DEFAULT_SELECT_VALUE","undefined","styles","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/set-map-options.js"],"sourcesContent":["import buildMapTypeIds from './build-map-type-ids';\nimport {\n COOPERATIVE,\n NONE,\n ELEMENT_GEOMETRY,\n FEATURE_TYPE_MAP,\n ALL,\n DISABLE_TRANSPORTATION_STYLES,\n DISABLE_POI_STYLES,\n DISABLE_BOUNDARIES_STYLES,\n DISABLE_LABELS_STYLES,\n DEFAULT_SELECT_VALUE\n} from '../../constants';\n\nconst setCustomColor = (featureType, color, elementType) =>\n color\n ? [\n {\n featureType,\n elementType: elementType || ELEMENT_GEOMETRY,\n stylers: [\n {\n color\n }\n ]\n }\n ]\n : [];\n\nconst getFeatureStyles = ({\n enableRoads = true,\n enableFeatureTransportation,\n enableFeatureLabels,\n enableFeaturePoi,\n enableFeatureBoundaries\n}) => {\n const customColors = [];\n // todo: enableRoads is a legacy option can be removed in later updates\n if (!enableFeatureLabels || !enableRoads) customColors.push(...DISABLE_LABELS_STYLES);\n if (!enableFeatureBoundaries || !enableRoads) customColors.push(...DISABLE_BOUNDARIES_STYLES);\n if (!enableFeaturePoi || !enableRoads) customColors.push(...DISABLE_POI_STYLES);\n if (!enableFeatureTransportation || !enableRoads) {\n customColors.push(...DISABLE_TRANSPORTATION_STYLES);\n }\n\n return customColors;\n};\n\nconst setMapOptions = otherProps => {\n const {\n centerLatitude,\n centerLongitude,\n defaultZoom,\n enableZoom,\n maxZoom,\n minZoom,\n enablePan,\n enableStreetView,\n enableFullScreen,\n enableSatelliteView,\n enableTerrainScreen,\n waterColor,\n landscapeColor,\n landscapeColorAll,\n mapType\n } = otherProps;\n\n const customColors = [\n ...getFeatureStyles(otherProps),\n ...setCustomColor(FEATURE_TYPE_MAP.waterColor, waterColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColor),\n ...setCustomColor(FEATURE_TYPE_MAP.landscapeColor, landscapeColorAll, ALL)\n ];\n\n return {\n center: { lat: centerLatitude, lng: centerLongitude },\n zoom: defaultZoom,\n maxZoom: enableZoom ? maxZoom : defaultZoom,\n minZoom: enableZoom ? minZoom : defaultZoom,\n gestureHandling: enablePan || enableZoom ? COOPERATIVE : NONE,\n panControl: enablePan,\n zoomControl: enableZoom && minZoom !== maxZoom,\n disableDoubleClickZoom: !enableZoom,\n streetViewControl: enableStreetView,\n fullscreenControl: enableFullScreen,\n mapTypeControl: enableSatelliteView || enableTerrainScreen,\n mapTypeControlOptions: {\n mapTypeIds: buildMapTypeIds(enableSatelliteView, enableTerrainScreen)\n },\n mapTypeId: !mapType || mapType === DEFAULT_SELECT_VALUE ? undefined : mapType,\n styles: customColors\n };\n};\n\nexport default setMapOptions;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,gBAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAD,OAAA;AAaA,IAAME,cAAc,GAAG,SAAjBA,cAAcA,CAAIC,WAAW,EAAEC,KAAK,EAAEC,WAAW;EAAA,OACrDD,KAAK,GACD,CACE;IACED,WAAW,EAAXA,WAAW;IACXE,WAAW,EAAEA,WAAW,IAAIC,2BAAgB;IAC5CC,OAAO,EAAE,CACP;MACEH,KAAK,EAALA;IACF,CAAC;EAEL,CAAC,CACF,GACD,EAAE;AAAA;AAER,IAAMI,gBAAgB,GAAG,SAAnBA,gBAAgBA,CAAAC,IAAA,EAMhB;EAAA,IAAAC,gBAAA,GAAAD,IAAA,CALJE,WAAW;IAAXA,WAAW,GAAAD,gBAAA,cAAG,IAAI,GAAAA,gBAAA;IAClBE,2BAA2B,GAAAH,IAAA,CAA3BG,2BAA2B;IAC3BC,mBAAmB,GAAAJ,IAAA,CAAnBI,mBAAmB;IACnBC,gBAAgB,GAAAL,IAAA,CAAhBK,gBAAgB;IAChBC,uBAAuB,GAAAN,IAAA,CAAvBM,uBAAuB;EAEvB,IAAMC,YAAY,GAAG,EAAE;EACvB;EACA,IAA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ape, imageData
|
|
|
72
72
|
var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(event) {
|
|
73
73
|
var content;
|
|
74
74
|
return _regenerator["default"].wrap(function _callee$(_context) {
|
|
75
|
-
while (1) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
return _context.stop();
|
|
92
|
-
}
|
|
75
|
+
while (1) switch (_context.prev = _context.next) {
|
|
76
|
+
case 0:
|
|
77
|
+
closeInfoWindows();
|
|
78
|
+
_context.t0 = _server["default"];
|
|
79
|
+
_context.next = 4;
|
|
80
|
+
return infoWindowContent(imageData, dataSummaries, url, shapeData);
|
|
81
|
+
case 4:
|
|
82
|
+
_context.t1 = _context.sent;
|
|
83
|
+
content = _context.t0.renderToString.call(_context.t0, _context.t1);
|
|
84
|
+
infoWindow.setContent(content);
|
|
85
|
+
infoWindow.setPosition(event.latLng);
|
|
86
|
+
infoWindow.open(map, shapeInstance);
|
|
87
|
+
infoWindowArray.push(infoWindow);
|
|
88
|
+
case 10:
|
|
89
|
+
case "end":
|
|
90
|
+
return _context.stop();
|
|
93
91
|
}
|
|
94
92
|
}, _callee);
|
|
95
93
|
}));
|
|
@@ -145,81 +143,77 @@ var infoWindowContent = /*#__PURE__*/function () {
|
|
|
145
143
|
var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(imageData, dataSummaries, url, shapeData) {
|
|
146
144
|
var summariesWithContent, _ref5, imageId, image, shouldShowImage, getImageElement;
|
|
147
145
|
return _regenerator["default"].wrap(function _callee3$(_context3) {
|
|
148
|
-
while (1) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
var
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
_context2.next = 9;
|
|
169
|
-
break;
|
|
170
|
-
}
|
|
171
|
-
return _context2.abrupt("return", null);
|
|
172
|
-
case 9:
|
|
173
|
-
getDataSummaryComponent = function getDataSummaryComponent() {
|
|
174
|
-
var component = /*#__PURE__*/_react["default"].createElement(SummaryComponent, {
|
|
175
|
-
key: type,
|
|
176
|
-
modifier: modifier,
|
|
177
|
-
elementTitle: elementTitle,
|
|
178
|
-
summaryPropsWithContent: summaryPropsWithContent
|
|
179
|
-
});
|
|
180
|
-
if (isTypeHeading && url) return /*#__PURE__*/_react["default"].createElement(_nextjsComponents.Link, {
|
|
181
|
-
href: url
|
|
182
|
-
}, component);
|
|
183
|
-
return component;
|
|
184
|
-
};
|
|
185
|
-
return _context2.abrupt("return", getDataSummaryComponent());
|
|
186
|
-
case 11:
|
|
187
|
-
case "end":
|
|
188
|
-
return _context2.stop();
|
|
146
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
147
|
+
case 0:
|
|
148
|
+
_context3.next = 2;
|
|
149
|
+
return Promise.all(dataSummaries.map( /*#__PURE__*/function () {
|
|
150
|
+
var _ref4 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(dataSummary) {
|
|
151
|
+
var elementTitle, type, propsToDisplay, otherProps, isTypeHeading, summaryPropsWithContent, modifier, SummaryComponent, getDataSummaryComponent;
|
|
152
|
+
return _regenerator["default"].wrap(function _callee2$(_context2) {
|
|
153
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
154
|
+
case 0:
|
|
155
|
+
elementTitle = dataSummary.elementTitle, type = dataSummary.type, propsToDisplay = dataSummary.propsToDisplay, otherProps = (0, _objectWithoutProperties2["default"])(dataSummary, _excluded);
|
|
156
|
+
isTypeHeading = type === _constants.HEADING_LARGE;
|
|
157
|
+
summaryPropsWithContent = (0, _reactPageBuilder.buildPropsToDisplayWithContent)(shapeData, propsToDisplay);
|
|
158
|
+
modifier = (0, _reactPageBuilder.getClassModifiers)(_constants.LIST, otherProps);
|
|
159
|
+
SummaryComponent = _reactPageBuilder.summaryComponents[type];
|
|
160
|
+
_context2.next = 7;
|
|
161
|
+
return SummaryComponent.render.preload();
|
|
162
|
+
case 7:
|
|
163
|
+
if (summaryPropsWithContent.length) {
|
|
164
|
+
_context2.next = 9;
|
|
165
|
+
break;
|
|
189
166
|
}
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
if (url) return /*#__PURE__*/_react["default"].createElement(_nextjsComponents.Link, {
|
|
214
|
-
href: url
|
|
215
|
-
}, imageElement);
|
|
216
|
-
return imageElement;
|
|
167
|
+
return _context2.abrupt("return", null);
|
|
168
|
+
case 9:
|
|
169
|
+
getDataSummaryComponent = function getDataSummaryComponent() {
|
|
170
|
+
var component = /*#__PURE__*/_react["default"].createElement(SummaryComponent, {
|
|
171
|
+
key: type,
|
|
172
|
+
modifier: modifier,
|
|
173
|
+
elementTitle: elementTitle,
|
|
174
|
+
summaryPropsWithContent: summaryPropsWithContent
|
|
175
|
+
});
|
|
176
|
+
if (isTypeHeading && url) return /*#__PURE__*/_react["default"].createElement(_nextjsComponents.Link, {
|
|
177
|
+
href: url
|
|
178
|
+
}, component);
|
|
179
|
+
return component;
|
|
180
|
+
};
|
|
181
|
+
return _context2.abrupt("return", getDataSummaryComponent());
|
|
182
|
+
case 11:
|
|
183
|
+
case "end":
|
|
184
|
+
return _context2.stop();
|
|
185
|
+
}
|
|
186
|
+
}, _callee2);
|
|
187
|
+
}));
|
|
188
|
+
return function (_x6) {
|
|
189
|
+
return _ref4.apply(this, arguments);
|
|
217
190
|
};
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
191
|
+
}()));
|
|
192
|
+
case 2:
|
|
193
|
+
summariesWithContent = _context3.sent;
|
|
194
|
+
_ref5 = shapeData || {}, imageId = _ref5.imageId;
|
|
195
|
+
image = imageData.find(function (_ref6) {
|
|
196
|
+
var id = _ref6.id;
|
|
197
|
+
return id === imageId;
|
|
198
|
+
});
|
|
199
|
+
shouldShowImage = image && image.url;
|
|
200
|
+
getImageElement = function getImageElement() {
|
|
201
|
+
var imageUrl = image.url,
|
|
202
|
+
data = image.data;
|
|
203
|
+
var imageElement = /*#__PURE__*/_react["default"].createElement("img", {
|
|
204
|
+
className: "info__window",
|
|
205
|
+
src: imageUrl,
|
|
206
|
+
alt: data && data.altText ? data.altText : ''
|
|
207
|
+
});
|
|
208
|
+
if (url) return /*#__PURE__*/_react["default"].createElement(_nextjsComponents.Link, {
|
|
209
|
+
href: url
|
|
210
|
+
}, imageElement);
|
|
211
|
+
return imageElement;
|
|
212
|
+
};
|
|
213
|
+
return _context3.abrupt("return", /*#__PURE__*/_react["default"].createElement(_react["default"].Fragment, null, shouldShowImage && getImageElement(), summariesWithContent));
|
|
214
|
+
case 8:
|
|
215
|
+
case "end":
|
|
216
|
+
return _context3.stop();
|
|
223
217
|
}
|
|
224
218
|
}, _callee3);
|
|
225
219
|
}));
|