@blaze-cms/plugin-google-maps-fe 0.146.0-translations.8 → 0.147.0-rc-eagle.4
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/lib/GoogleMaps/GoogleMaps.js +67 -90
- package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsFactory.js +21 -21
- package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsHtml.js +9 -11
- package/lib/GoogleMaps/GoogleMapsHtml.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsRender.js +43 -37
- package/lib/GoogleMaps/GoogleMapsRender.js.map +1 -1
- package/lib/GoogleMaps/helpers/add-zoom-listener.js +5 -8
- package/lib/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-shapes.js +47 -47
- package/lib/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-map-type-ids.js +4 -5
- package/lib/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-query.js +22 -26
- package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-shapes-configs.js +84 -111
- package/lib/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-center-coordinates.js +20 -23
- package/lib/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-image-ids.js +9 -18
- package/lib/GoogleMaps/helpers/get-image-ids.js.map +1 -1
- package/lib/GoogleMaps/helpers/get-path.js +13 -16
- package/lib/GoogleMaps/helpers/get-path.js.map +1 -1
- package/lib/GoogleMaps/helpers/index.js +14 -15
- package/lib/GoogleMaps/helpers/index.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-map-options.js +41 -44
- package/lib/GoogleMaps/helpers/set-map-options.js.map +1 -1
- package/lib/GoogleMaps/helpers/set-shapes.js +175 -242
- package/lib/GoogleMaps/helpers/set-shapes.js.map +1 -1
- package/lib/GoogleMaps/hooks/index.js +4 -5
- package/lib/GoogleMaps/hooks/index.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-entity-schemas.js +14 -20
- package/lib/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
- package/lib/GoogleMaps/hooks/use-get-images.js +21 -22
- package/lib/GoogleMaps/hooks/use-get-images.js.map +1 -1
- package/lib/GoogleMaps/index.js +2 -3
- package/lib/GoogleMaps/index.js.map +1 -1
- package/lib/GoogleMaps/queries.js +49 -21
- package/lib/GoogleMaps/queries.js.map +1 -1
- package/lib/constants.js +35 -36
- package/lib/constants.js.map +1 -1
- package/lib/index.js +13 -43
- package/lib/index.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMaps.js +3 -1
- package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib-es/GoogleMaps/GoogleMapsHtml.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/add-zoom-listener.js +1 -1
- package/lib-es/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-query.js +3 -1
- package/lib-es/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
- package/lib-es/GoogleMaps/helpers/set-shapes.js +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/hooks/use-get-images.js.map +1 -1
- package/lib-es/GoogleMaps/queries.js.map +1 -1
- package/lib-es/index.js +1 -1
- package/lib-es/index.js.map +1 -1
- package/package.json +22 -14
- package/src/GoogleMaps/GoogleMaps.js +4 -1
- package/src/GoogleMaps/helpers/add-zoom-listener.js +1 -1
- package/src/GoogleMaps/helpers/build-query.js +3 -1
- package/src/GoogleMaps/helpers/set-shapes.js +1 -1
- package/src/GoogleMaps/hooks/use-get-entity-schemas.js +5 -1
- package/src/GoogleMaps/hooks/use-get-images.js +5 -1
- package/CHANGELOG.md +0 -1829
- package/babel.config.js +0 -3
- package/jest.config.js +0 -3
package/lib/index.js
CHANGED
|
@@ -4,52 +4,22 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports
|
|
8
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
9
|
-
require("core-js/modules/es.array.iterator.js");
|
|
10
|
-
require("core-js/modules/es.object.define-property.js");
|
|
11
|
-
require("core-js/modules/es.object.get-own-property-descriptor.js");
|
|
12
|
-
require("core-js/modules/es.object.to-string.js");
|
|
13
|
-
require("core-js/modules/es.promise.js");
|
|
14
|
-
require("core-js/modules/es.string.iterator.js");
|
|
15
|
-
require("core-js/modules/es.weak-map.js");
|
|
16
|
-
require("core-js/modules/web.dom-collections.iterator.js");
|
|
17
|
-
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
18
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
7
|
+
exports.default = load;
|
|
19
8
|
var _dynamic = _interopRequireDefault(require("next/dynamic"));
|
|
20
9
|
var _package = _interopRequireDefault(require("../package.json"));
|
|
21
10
|
var _constants = require("./constants");
|
|
22
|
-
function
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
key: 'googlemaps',
|
|
35
|
-
component: (0, _dynamic["default"])(function () {
|
|
36
|
-
return Promise.resolve().then(function () {
|
|
37
|
-
return _interopRequireWildcard(require( /* webpackChunkName: "blazePbGoogleMaps" */'./GoogleMaps'));
|
|
38
|
-
});
|
|
39
|
-
})
|
|
40
|
-
});
|
|
41
|
-
});
|
|
42
|
-
return _context.abrupt("return", {
|
|
43
|
-
name: _constants.PLUGIN_NAME,
|
|
44
|
-
version: _package["default"].version
|
|
45
|
-
});
|
|
46
|
-
case 2:
|
|
47
|
-
case "end":
|
|
48
|
-
return _context.stop();
|
|
49
|
-
}
|
|
50
|
-
}, _callee);
|
|
51
|
-
}));
|
|
52
|
-
return _load.apply(this, arguments);
|
|
11
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function (e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != typeof e && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (const t in e) "default" !== t && {}.hasOwnProperty.call(e, t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, t)) && (i.get || i.set) ? o(f, t, i) : f[t] = e[t]); return f; })(e, t); }
|
|
12
|
+
async function load(app) {
|
|
13
|
+
app.events.once('load:custom:page-builder:component', addComponent => {
|
|
14
|
+
addComponent({
|
|
15
|
+
key: 'googlemaps',
|
|
16
|
+
component: (0, _dynamic.default)(() => Promise.resolve().then(() => _interopRequireWildcard(require('./GoogleMaps'))))
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
return {
|
|
20
|
+
name: _constants.PLUGIN_NAME,
|
|
21
|
+
version: _package.default.version
|
|
22
|
+
};
|
|
53
23
|
}
|
|
54
24
|
load.pluginName = _constants.PLUGIN_NAME;
|
|
55
25
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_dynamic","_interopRequireDefault","require","_package","_constants","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_dynamic","_interopRequireDefault","require","_package","_constants","_interopRequireWildcard","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","default","has","get","set","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","load","app","events","once","addComponent","key","component","dynamic","Promise","resolve","then","name","PLUGIN_NAME","version","pkg","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\nimport pkg from '../package.json';\nimport { PLUGIN_NAME } from './constants';\n\nexport default async function load(app) {\n app.events.once('load:custom:page-builder:component', addComponent => {\n addComponent({\n key: 'googlemaps',\n component: dynamic(() => import(/* webpackChunkName: \"blazePbGoogleMaps\" */ './GoogleMaps'))\n });\n });\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings":";;;;;;;AAAA,IAAAA,QAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,QAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,UAAA,GAAAF,OAAA;AAA0C,SAAAG,wBAAAC,CAAA,EAAAC,CAAA,6BAAAC,OAAA,MAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAH,uBAAA,YAAAA,CAAAC,CAAA,EAAAC,CAAA,SAAAA,CAAA,IAAAD,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,MAAAM,CAAA,EAAAC,CAAA,EAAAC,CAAA,KAAAC,SAAA,QAAAC,OAAA,EAAAV,CAAA,iBAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,SAAAQ,CAAA,MAAAF,CAAA,GAAAL,CAAA,GAAAG,CAAA,GAAAD,CAAA,QAAAG,CAAA,CAAAK,GAAA,CAAAX,CAAA,UAAAM,CAAA,CAAAM,GAAA,CAAAZ,CAAA,GAAAM,CAAA,CAAAO,GAAA,CAAAb,CAAA,EAAAQ,CAAA,gBAAAP,CAAA,IAAAD,CAAA,gBAAAC,CAAA,OAAAa,cAAA,CAAAC,IAAA,CAAAf,CAAA,EAAAC,CAAA,OAAAM,CAAA,IAAAD,CAAA,GAAAU,MAAA,CAAAC,cAAA,KAAAD,MAAA,CAAAE,wBAAA,CAAAlB,CAAA,EAAAC,CAAA,OAAAM,CAAA,CAAAK,GAAA,IAAAL,CAAA,CAAAM,GAAA,IAAAP,CAAA,CAAAE,CAAA,EAAAP,CAAA,EAAAM,CAAA,IAAAC,CAAA,CAAAP,CAAA,IAAAD,CAAA,CAAAC,CAAA,WAAAO,CAAA,KAAAR,CAAA,EAAAC,CAAA;AAE3B,eAAekB,IAAIA,CAACC,GAAG,EAAE;EACtCA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,oCAAoC,EAAEC,YAAY,IAAI;IACpEA,YAAY,CAAC;MACXC,GAAG,EAAE,YAAY;MACjBC,SAAS,EAAE,IAAAC,gBAAO,EAAC,MAAAC,OAAA,CAAAC,OAAA,GAAAC,IAAA,OAAA9B,uBAAA,CAAAH,OAAA,CAAyD,cAAc,GAAC;IAC7F,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAO;IACLkC,IAAI,EAAEC,sBAAW;IACjBC,OAAO,EAAEC,gBAAG,CAACD;EACf,CAAC;AACH;AAEAb,IAAI,CAACe,UAAU,GAAGH,sBAAW","ignoreList":[]}
|
|
@@ -86,8 +86,10 @@ const GoogleMaps = _ref => {
|
|
|
86
86
|
return () => {};
|
|
87
87
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
88
88
|
}, []);
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (isIntersecting) addZoomListener(map, router, mapShapes, imageData, client);
|
|
91
|
+
}, [isIntersecting, map, mapShapes, imageData, router, client]);
|
|
89
92
|
if (map && typeof onMount === `function`) onMount(map, onMountProps);
|
|
90
|
-
if (isIntersecting) addZoomListener(map, router, mapShapes, imageData, client);
|
|
91
93
|
return /*#__PURE__*/React.createElement(GoogleMapsHtml, {
|
|
92
94
|
mapRef: mapRef
|
|
93
95
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMaps.js","names":["React","useEffect","useState","PropTypes","useApolloClient","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","_ref","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","_objectWithoutProperties","_excluded","router","isIntersecting","mapRef","client","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 { useApolloClient } from '@apollo/client';\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 client = useApolloClient();\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
|
|
1
|
+
{"version":3,"file":"GoogleMaps.js","names":["React","useEffect","useState","PropTypes","useApolloClient","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","_ref","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","_objectWithoutProperties","_excluded","router","isIntersecting","mapRef","client","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 { useApolloClient } from '@apollo/client';\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 client = useApolloClient();\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 useEffect(() => {\n if (isIntersecting) addZoomListener(map, router, mapShapes, imageData, client);\n }, [isIntersecting, map, mapShapes, imageData, router, client]);\n\n if (map && typeof onMount === `function`) onMount(map, onMountProps);\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,eAAe,QAAQ,gBAAgB;AAChD,SAASC,SAAS,QAAQ,aAAa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S,GAAG;EACrBlD,SAAS,EAAEpC,SAAS,CAACuF,KAAK;EAC1BvD,SAAS,EAAEhC,SAAS,CAACuF,KAAK;EAC1B3D,IAAI,EAAE5B,SAAS,CAACwF,MAAM;EACtB3D,IAAI,EAAE7B,SAAS,CAACwF,MAAM;EACtB1D,QAAQ,EAAE9B,SAAS,CAACwF,MAAM;EAC1BzD,YAAY,EAAE/B,SAAS,CAACwF,MAAM;EAC9BvD,OAAO,EAAEjC,SAAS,CAACyF,IAAI;EACvBvD,YAAY,EAAElC,SAAS,CAAC0F,MAAM;EAC9BvD,MAAM,EAAEnC,SAAS,CAAC0F,MAAM;EACxBrD,iBAAiB,EAAErC,SAAS,CAACuF;AAC/B,CAAC;AAED7D,UAAU,CAACiE,YAAY,GAAG;EACxBvD,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,eAAetC,KAAK,CAAC+F,IAAI,CAACzF,SAAS,CAACuB,UAAU,CAAC,EAAEX,eAAe,CAAC","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsHtml.js","names":["React","PropTypes","GoogleMapsFactory","mapRef","createElement","className","ref","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,GAAGA,CAAC;EAAEC;AAAO,CAAC,kBACnCH,KAAA,CAAAI,aAAA;EAAKC,SAAS,
|
|
1
|
+
{"version":3,"file":"GoogleMapsHtml.js","names":["React","PropTypes","GoogleMapsFactory","mapRef","createElement","className","ref","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,GAAGA,CAAC;EAAEC;AAAO,CAAC,kBACnCH,KAAA,CAAAI,aAAA;EAAKC,SAAS,EAAE,eAAe,CAACF,MAAM,GAAG,SAAS,GAAG,EAAE,EAAG;EAACG,GAAG,EAAEH;AAAO,CAAE,CAC1E;AAEDD,iBAAiB,CAACK,SAAS,GAAG;EAC5BJ,MAAM,EAAEF,SAAS,CAACO;AACpB,CAAC;AAEDN,iBAAiB,CAACO,YAAY,GAAG;EAC/BN,MAAM,EAAE;AACV,CAAC;AAED,eAAeD,iBAAiB","ignoreList":[]}
|
|
@@ -2,7 +2,7 @@ import { ZOOM_CHANGED } from '../../constants';
|
|
|
2
2
|
import setShapes from './set-shapes';
|
|
3
3
|
const addZoomListener = (map, router, shapes, imageData, client) => {
|
|
4
4
|
if (!map) return;
|
|
5
|
-
setShapes(map, router, shapes, imageData);
|
|
5
|
+
setShapes(map, router, shapes, imageData, client);
|
|
6
6
|
map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData, client));
|
|
7
7
|
};
|
|
8
8
|
export default addZoomListener;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"add-zoom-listener.js","names":["ZOOM_CHANGED","setShapes","addZoomListener","map","router","shapes","imageData","client","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, client) => {\n if (!map) return;\n setShapes(map, router, shapes, imageData);\n map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData, client));\n};\n\nexport default addZoomListener;\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,OAAOC,SAAS,MAAM,cAAc;AAEpC,MAAMC,eAAe,GAAGA,CAACC,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,MAAM,KAAK;EAClE,IAAI,CAACJ,GAAG,EAAE;EACVF,SAAS,CAACE,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"add-zoom-listener.js","names":["ZOOM_CHANGED","setShapes","addZoomListener","map","router","shapes","imageData","client","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, client) => {\n if (!map) return;\n setShapes(map, router, shapes, imageData, client);\n map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData, client));\n};\n\nexport default addZoomListener;\n"],"mappings":"AAAA,SAASA,YAAY,QAAQ,iBAAiB;AAC9C,OAAOC,SAAS,MAAM,cAAc;AAEpC,MAAMC,eAAe,GAAGA,CAACC,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,MAAM,KAAK;EAClE,IAAI,CAACJ,GAAG,EAAE;EACVF,SAAS,CAACE,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,MAAM,CAAC;EACjDJ,GAAG,CAACK,WAAW,CAACR,YAAY,EAAE,MAAMC,SAAS,CAACE,GAAG,EAAEC,MAAM,EAAEC,MAAM,EAAEC,SAAS,EAAEC,MAAM,CAAC,CAAC;AACxF,CAAC;AAED,eAAeL,eAAe","ignoreList":[]}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import upperFirst from 'lodash.upperfirst';
|
|
2
|
+
import camelcase from 'lodash.camelcase';
|
|
1
3
|
import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';
|
|
2
4
|
const buildQuery = entityConfigs => {
|
|
3
5
|
const entityIds = [];
|
|
@@ -12,7 +14,7 @@ const buildQuery = entityConfigs => {
|
|
|
12
14
|
filtersObject
|
|
13
15
|
} = entityConfig;
|
|
14
16
|
if (!action) return '';
|
|
15
|
-
const formatedEntity =
|
|
17
|
+
const formatedEntity = upperFirst(camelcase(entity));
|
|
16
18
|
const filterQueryKey = action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;
|
|
17
19
|
entityIds.push(...ids);
|
|
18
20
|
const props = propsQuery.trim() || 'id';
|
|
@@ -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","
|
|
1
|
+
{"version":3,"file":"build-query.js","names":["upperFirst","camelcase","generateQuery","generateIdsQuery","generateFiltersQuery","buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","filterQueryKey","indexOf","push","props","trim","singleItemQuery","JSON","stringify","join","query"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import upperFirst from 'lodash.upperfirst';\nimport camelcase from 'lodash.camelcase';\nimport { 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 = upperFirst(camelcase(entity));\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,OAAOA,UAAU,MAAM,mBAAmB;AAC1C,OAAOC,SAAS,MAAM,kBAAkB;AACxC,SAASC,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,GAAGlB,UAAU,CAACC,SAAS,CAACa,MAAM,CAAC,CAAC;IACpD,MAAMK,cAAc,GAClBP,MAAM,CAACQ,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,GAAG,YAAYF,cAAc,EAAE,GAAGA,cAAc;IAEpFX,SAAS,CAACc,IAAI,CAAC,GAAGR,GAAG,CAAC;IACtB,MAAMS,KAAK,GAAGP,UAAU,CAACQ,IAAI,CAAC,CAAC,IAAI,IAAI;IACvC,MAAMC,eAAe,GAAGP,aAAa,GACjCb,oBAAoB,CAACY,QAAQ,EAAEM,KAAK,EAAEG,IAAI,CAACC,SAAS,CAACT,aAAa,CAAC,EAAEE,cAAc,CAAC,GACpFhB,gBAAgB,CAACa,QAAQ,EAAEM,KAAK,EAAEV,MAAM,EAAEC,GAAG,CAAC;IAElD,OAAOW,eAAe;EACxB,CAAC,CAAC,CACDG,IAAI,CAAC,GAAG,CAAC;EAEZ,OAAO;IACLC,KAAK,EAAEnB,WAAW,GAAGP,aAAa,CAACO,WAAW,CAAC,GAAG,EAAE;IACpDI,GAAG,EAAEN,SAAS;IACdC;EACF,CAAC;AACH,CAAC;AAED,eAAeH,UAAU","ignoreList":[]}
|
|
@@ -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","_objectSpread","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,OAAOA,OAAO,MAAM,gBAAgB;AACpC,SAASC,QAAQ,EAAEC,GAAG,EAAEC,EAAE,QAAQ,iBAAiB;AAEnD,MAAMC,aAAa,GAAGC,UAAU,IAC9BA,UAAU,CACPC,MAAM,CAAC,CAACC,GAAG,EAAEC,QAAQ,KAAK;EACzB,IAAIA,QAAQ,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;IAC1B,MAAM,CAACC,YAAY,EAAEC,YAAY,CAAC,GAAGH,QAAQ,CAACI,KAAK,CAAC,GAAG,CAAC;IACxD,
|
|
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","_objectSpread","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"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); if (Object.getOwnPropertySymbol
|
|
|
5
5
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import isNumber from 'lodash.isnumber';
|
|
8
|
-
import ReactDOMServer from 'react-dom/server';
|
|
8
|
+
import * as ReactDOMServer from 'react-dom/server';
|
|
9
9
|
import { Link } from '@blaze-cms/nextjs-components';
|
|
10
10
|
import { ApolloProvider } from '@apollo/client';
|
|
11
11
|
import { buildPropsToDisplayWithContent, summaryComponents, getClassModifiers } from '@blaze-cms/react-page-builder';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"set-shapes.js","names":["React","isNumber","ReactDOMServer","Link","ApolloProvider","buildPropsToDisplayWithContent","summaryComponents","getClassModifiers","getPath","MARKER","POLYLINE","POLYGON","RECTANGLE","CIRCLE","COLOR","CLICK","HEADING_LARGE","LIST","DEFAULT_CUSTOM_MARKER_PATH","shapesArray","infoWindowArray","clearShapes","length","forEach","shape","setMap","closeInfoWindows","infoWindow","close","addShapeListeners","map","router","imageData","shapeInstance","client","enableInfoPane","dataSummaries","url","shapeData","window","google","maps","InfoWindow","content","addListener","event","renderToString","infoWindowContent","setContent","setPosition","latLng","open","push","setStyleOptions","strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity","styleSettings","_objectSpread","Object","keys","reduce","acc","key","settingValue","shouldValueBeNumber","includes","hasValuePassedCondition","areRectangleBoundsNumbers","bounds","every","bound","isPositionCorrect","lat","lng","getIconUrl","imageId","image","find","id","summariesWithContent","Promise","all","dataSummary","elementTitle","type","propsToDisplay","otherProps","_objectWithoutProperties","_excluded","isTypeHeading","summaryPropsWithContent","modifier","SummaryComponent","render","preload","getDataSummaryComponent","component","createElement","href","shouldShowImage","getImageElement","imageUrl","data","imageElement","className","src","alt","altText","Fragment","getIcon","markerWidth","markerHeight","svgPath","iconUrl","icon","scaledSize","Size","svgMarker","path","rotation","scale","setMarker","label","latitude","longitude","marker","Marker","position","title","setPolyline","paths","polyline","Polyline","geodesic","setPolygon","unParsedPaths","polygon","Polygon","setRectangle","northBound","southBound","eastBound","westBound","rectangle","Rectangle","north","south","east","west","setCircle","radius","circle","Circle","center","setShapes","shapes","mapZoom","getZoom","minZoom","maxZoom"],"sources":["../../../src/GoogleMaps/helpers/set-shapes.js"],"sourcesContent":["import React from 'react';\nimport isNumber from 'lodash.isnumber';\nimport ReactDOMServer from 'react-dom/server';\nimport { Link } from '@blaze-cms/nextjs-components';\nimport { ApolloProvider } from '@apollo/client';\nimport {\n buildPropsToDisplayWithContent,\n summaryComponents,\n getClassModifiers\n} from '@blaze-cms/react-page-builder';\nimport getPath from './get-path';\nimport {\n MARKER,\n POLYLINE,\n POLYGON,\n RECTANGLE,\n CIRCLE,\n COLOR,\n CLICK,\n HEADING_LARGE,\n LIST,\n DEFAULT_CUSTOM_MARKER_PATH\n} from '../../constants';\n\nconst shapesArray = [];\nconst infoWindowArray = [];\n\nconst clearShapes = () => {\n if (shapesArray.length) {\n shapesArray.forEach(shape => shape.setMap(null));\n shapesArray.length = 0;\n }\n};\n\nconst closeInfoWindows = () => {\n if (infoWindowArray.length) {\n infoWindowArray.forEach(infoWindow => infoWindow.close());\n infoWindowArray.length = 0;\n }\n};\n\nconst addShapeListeners = (map, router, shape, imageData, shapeInstance, client) => {\n const { enableInfoPane = false, dataSummaries = [], url, shapeData } = shape;\n\n if (enableInfoPane) {\n const infoWindow = new window.google.maps.InfoWindow({\n content: ''\n });\n\n shapeInstance.addListener(CLICK, async event => {\n closeInfoWindows();\n const content = ReactDOMServer.renderToString(\n await infoWindowContent(imageData, dataSummaries, url, shapeData, client)\n );\n infoWindow.setContent(content);\n infoWindow.setPosition(event.latLng);\n infoWindow.open(map, shapeInstance);\n infoWindowArray.push(infoWindow);\n });\n } else if (url) {\n shapeInstance.addListener(CLICK, () => {\n router.push(url);\n });\n }\n};\n\nconst setStyleOptions = shape => {\n const { strokeColor, strokeOpacity, strokeWeight, fillColor, fillOpacity } = shape;\n const styleSettings = { strokeColor, fillColor, strokeOpacity, strokeWeight, fillOpacity };\n\n return {\n ...Object.keys(styleSettings).reduce((acc, key) => {\n const settingValue = styleSettings[key];\n const shouldValueBeNumber = !key.includes(COLOR);\n const hasValuePassedCondition = shouldValueBeNumber ? isNumber(settingValue) : settingValue;\n if (hasValuePassedCondition) acc[key] = settingValue;\n return acc;\n }, {})\n };\n};\n\nconst areRectangleBoundsNumbers = bounds => bounds.every(bound => isNumber(bound));\n\nconst isPositionCorrect = (lat, lng) => isNumber(lat) && isNumber(lng);\n\nconst getIconUrl = (imageId, imageData) => {\n if (!imageId) return '';\n const image = imageData.find(({ id }) => id === imageId);\n if (!image || !image.url) return '';\n\n return image.url;\n};\n\nconst infoWindowContent = async (imageData, dataSummaries, url, shapeData, client) => {\n const summariesWithContent = await Promise.all(\n dataSummaries.map(async dataSummary => {\n const { elementTitle, type, propsToDisplay, ...otherProps } = dataSummary;\n const isTypeHeading = type === HEADING_LARGE;\n const summaryPropsWithContent = buildPropsToDisplayWithContent(shapeData, propsToDisplay);\n const modifier = getClassModifiers(LIST, otherProps);\n const SummaryComponent = summaryComponents[type];\n await SummaryComponent.render.preload(); // preload dynamic nextjs component\n\n if (!summaryPropsWithContent.length) return null;\n\n const getDataSummaryComponent = () => {\n const component = (\n <ApolloProvider client={client}>\n <SummaryComponent\n key={type}\n modifier={modifier}\n elementTitle={elementTitle}\n summaryPropsWithContent={summaryPropsWithContent}\n />\n </ApolloProvider>\n );\n\n if (isTypeHeading && url) return <Link href={url}>{component}</Link>;\n\n return component;\n };\n\n return getDataSummaryComponent();\n })\n );\n const { imageId } = shapeData || {};\n const image = imageData.find(({ id }) => id === imageId);\n const shouldShowImage = image && image.url;\n\n const getImageElement = () => {\n const { url: imageUrl, data } = image;\n const imageElement = (\n <img className=\"info__window\" src={imageUrl} alt={data && data.altText ? data.altText : ''} />\n );\n\n if (url) return <Link href={url}>{imageElement}</Link>;\n\n return imageElement;\n };\n\n return (\n <>\n {shouldShowImage && getImageElement()}\n {summariesWithContent}\n </>\n );\n};\n\nfunction getIcon(imageData, shape) {\n const {\n imageId,\n markerWidth = 50,\n markerHeight = 50,\n strokeColor,\n strokeOpacity,\n strokeWeight,\n fillColor,\n fillOpacity,\n svgPath\n } = shape;\n const iconUrl = getIconUrl(imageId, imageData);\n\n const icon = iconUrl\n ? {\n url: iconUrl,\n scaledSize: new window.google.maps.Size(markerWidth || 50, markerHeight || 50)\n }\n : null;\n\n if (icon) return icon;\n\n if (!svgPath && !fillColor && !strokeColor) return {}; // any can be true for custom marker\n\n const svgMarker = {\n path: svgPath || DEFAULT_CUSTOM_MARKER_PATH,\n strokeColor,\n strokeOpacity,\n strokeWeight,\n fillColor,\n fillOpacity,\n rotation: 0,\n scale: 2\n };\n return svgMarker;\n}\n\nconst setMarker = (map, router, shape, imageData, client) => {\n const { label = '', latitude, longitude } = shape;\n\n if (isPositionCorrect(latitude, longitude)) {\n const svgMarker = getIcon(imageData, shape);\n\n const marker = new window.google.maps.Marker({\n position: { lat: latitude, lng: longitude },\n map,\n icon: svgMarker,\n title: label || ''\n });\n\n addShapeListeners(map, router, shape, imageData, marker, client);\n\n shapesArray.push(marker);\n\n marker.setMap(map);\n }\n};\n\nconst setPolyline = (map, router, shape, imageData) => {\n const { paths } = shape;\n const path = getPath(paths);\n\n if (path.length) {\n const polyline = new window.google.maps.Polyline({\n path,\n geodesic: true,\n ...setStyleOptions(shape)\n });\n\n addShapeListeners(map, router, shape, imageData, polyline);\n\n shapesArray.push(polyline);\n\n polyline.setMap(map);\n }\n};\n\nconst setPolygon = (map, router, shape, imageData) => {\n const { paths: unParsedPaths } = shape;\n const paths = getPath(unParsedPaths);\n\n if (paths.length) {\n const polygon = new window.google.maps.Polygon({\n paths,\n ...setStyleOptions(shape)\n });\n\n addShapeListeners(map, router, shape, imageData, polygon);\n\n shapesArray.push(polygon);\n\n polygon.setMap(map);\n }\n};\n\nconst setRectangle = (map, router, shape, imageData) => {\n const { northBound, southBound, eastBound, westBound } = shape;\n if (areRectangleBoundsNumbers([northBound, southBound, eastBound, westBound])) {\n const rectangle = new window.google.maps.Rectangle({\n ...setStyleOptions(shape),\n map,\n bounds: {\n north: northBound,\n south: southBound,\n east: eastBound,\n west: westBound\n }\n });\n\n addShapeListeners(map, router, shape, imageData, rectangle);\n\n shapesArray.push(rectangle);\n\n rectangle.setMap(map);\n }\n};\n\nconst setCircle = (map, router, shape, imageData) => {\n const { latitude, longitude, radius } = shape;\n if (isPositionCorrect(latitude, longitude) && isNumber(radius)) {\n const circle = new window.google.maps.Circle({\n ...setStyleOptions(shape),\n map,\n center: { lat: latitude, lng: longitude },\n radius\n });\n\n addShapeListeners(map, router, shape, imageData, circle);\n\n shapesArray.push(circle);\n\n circle.setMap(map);\n }\n};\n\nconst setShapes = (map, router, shapes, imageData, client) => {\n const mapZoom = map.getZoom();\n clearShapes();\n\n shapes.forEach(shape => {\n const { type, minZoom, maxZoom } = shape;\n\n if (mapZoom >= minZoom && mapZoom <= maxZoom) {\n switch (type) {\n case MARKER: {\n setMarker(map, router, shape, imageData, client);\n break;\n }\n case POLYLINE: {\n setPolyline(map, router, shape, imageData);\n break;\n }\n case POLYGON: {\n setPolygon(map, router, shape, imageData);\n break;\n }\n case RECTANGLE: {\n setRectangle(map, router, shape, imageData);\n break;\n }\n case CIRCLE: {\n setCircle(map, router, shape, imageData);\n break;\n }\n default:\n break;\n }\n }\n });\n};\n\nexport default setShapes;\n"],"mappings":";;;;;AAAA,OAAOA,KAAK,MAAM,OAAO;AACzB,OAAOC,QAAQ,MAAM,iBAAiB;AACtC,OAAOC,cAAc,MAAM,kBAAkB;A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AIuI,OAAO,IAAIE,OAAO,IAAIF,OAAO,IAAIG,OAAO,EAAE;MAC5C,QAAQ3E,IAAI;QACV,KAAK9E,MAAM;UAAE;YACXmH,SAAS,CAAC9F,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,EAAEE,MAAM,CAAC;YAChD;UACF;QACA,KAAKxB,QAAQ;UAAE;YACb0H,WAAW,CAACtG,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,CAAC;YAC1C;UACF;QACA,KAAKrB,OAAO;UAAE;YACZ8H,UAAU,CAAC3G,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,CAAC;YACzC;UACF;QACA,KAAKpB,SAAS;UAAE;YACdiI,YAAY,CAAC/G,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,CAAC;YAC3C;UACF;QACA,KAAKnB,MAAM;UAAE;YACX2I,SAAS,CAAC1H,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,CAAC;YACxC;UACF;QACA;UACE;MACJ;IACF;EACF,CAAC,CAAC;AACJ,CAAC;AAED,eAAe6H,SAAS","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"set-shapes.js","names":["React","isNumber","ReactDOMServer","Link","ApolloProvider","buildPropsToDisplayWithContent","summaryComponents","getClassModifiers","getPath","MARKER","POLYLINE","POLYGON","RECTANGLE","CIRCLE","COLOR","CLICK","HEADING_LARGE","LIST","DEFAULT_CUSTOM_MARKER_PATH","shapesArray","infoWindowArray","clearShapes","length","forEach","shape","setMap","closeInfoWindows","infoWindow","close","addShapeListeners","map","router","imageData","shapeInstance","client","enableInfoPane","dataSummaries","url","shapeData","window","google","maps","InfoWindow","content","addListener","event","renderToString","infoWindowContent","setContent","setPosition","latLng","open","push","setStyleOptions","strokeColor","strokeOpacity","strokeWeight","fillColor","fillOpacity","styleSettings","_objectSpread","Object","keys","reduce","acc","key","settingValue","shouldValueBeNumber","includes","hasValuePassedCondition","areRectangleBoundsNumbers","bounds","every","bound","isPositionCorrect","lat","lng","getIconUrl","imageId","image","find","id","summariesWithContent","Promise","all","dataSummary","elementTitle","type","propsToDisplay","otherProps","_objectWithoutProperties","_excluded","isTypeHeading","summaryPropsWithContent","modifier","SummaryComponent","render","preload","getDataSummaryComponent","component","createElement","href","shouldShowImage","getImageElement","imageUrl","data","imageElement","className","src","alt","altText","Fragment","getIcon","markerWidth","markerHeight","svgPath","iconUrl","icon","scaledSize","Size","svgMarker","path","rotation","scale","setMarker","label","latitude","longitude","marker","Marker","position","title","setPolyline","paths","polyline","Polyline","geodesic","setPolygon","unParsedPaths","polygon","Polygon","setRectangle","northBound","southBound","eastBound","westBound","rectangle","Rectangle","north","south","east","west","setCircle","radius","circle","Circle","center","setShapes","shapes","mapZoom","getZoom","minZoom","maxZoom"],"sources":["../../../src/GoogleMaps/helpers/set-shapes.js"],"sourcesContent":["import React from 'react';\nimport isNumber from 'lodash.isnumber';\nimport * as ReactDOMServer from 'react-dom/server';\nimport { Link } from '@blaze-cms/nextjs-components';\nimport { ApolloProvider } from '@apollo/client';\nimport {\n buildPropsToDisplayWithContent,\n summaryComponents,\n getClassModifiers\n} from '@blaze-cms/react-page-builder';\nimport getPath from './get-path';\nimport {\n MARKER,\n POLYLINE,\n POLYGON,\n RECTANGLE,\n CIRCLE,\n COLOR,\n CLICK,\n HEADING_LARGE,\n LIST,\n DEFAULT_CUSTOM_MARKER_PATH\n} from '../../constants';\n\nconst shapesArray = [];\nconst infoWindowArray = [];\n\nconst clearShapes = () => {\n if (shapesArray.length) {\n shapesArray.forEach(shape => shape.setMap(null));\n shapesArray.length = 0;\n }\n};\n\nconst closeInfoWindows = () => {\n if (infoWindowArray.length) {\n infoWindowArray.forEach(infoWindow => infoWindow.close());\n infoWindowArray.length = 0;\n }\n};\n\nconst addShapeListeners = (map, router, shape, imageData, shapeInstance, client) => {\n const { enableInfoPane = false, dataSummaries = [], url, shapeData } = shape;\n\n if (enableInfoPane) {\n const infoWindow = new window.google.maps.InfoWindow({\n content: ''\n });\n\n shapeInstance.addListener(CLICK, async event => {\n closeInfoWindows();\n const content = ReactDOMServer.renderToString(\n await infoWindowContent(imageData, dataSummaries, url, shapeData, client)\n );\n infoWindow.setContent(content);\n infoWindow.setPosition(event.latLng);\n infoWindow.open(map, shapeInstance);\n infoWindowArray.push(infoWindow);\n });\n } else if (url) {\n shapeInstance.addListener(CLICK, () => {\n router.push(url);\n });\n }\n};\n\nconst setStyleOptions = shape => {\n const { strokeColor, strokeOpacity, strokeWeight, fillColor, fillOpacity } = shape;\n const styleSettings = { strokeColor, fillColor, strokeOpacity, strokeWeight, fillOpacity };\n\n return {\n ...Object.keys(styleSettings).reduce((acc, key) => {\n const settingValue = styleSettings[key];\n const shouldValueBeNumber = !key.includes(COLOR);\n const hasValuePassedCondition = shouldValueBeNumber ? isNumber(settingValue) : settingValue;\n if (hasValuePassedCondition) acc[key] = settingValue;\n return acc;\n }, {})\n };\n};\n\nconst areRectangleBoundsNumbers = bounds => bounds.every(bound => isNumber(bound));\n\nconst isPositionCorrect = (lat, lng) => isNumber(lat) && isNumber(lng);\n\nconst getIconUrl = (imageId, imageData) => {\n if (!imageId) return '';\n const image = imageData.find(({ id }) => id === imageId);\n if (!image || !image.url) return '';\n\n return image.url;\n};\n\nconst infoWindowContent = async (imageData, dataSummaries, url, shapeData, client) => {\n const summariesWithContent = await Promise.all(\n dataSummaries.map(async dataSummary => {\n const { elementTitle, type, propsToDisplay, ...otherProps } = dataSummary;\n const isTypeHeading = type === HEADING_LARGE;\n const summaryPropsWithContent = buildPropsToDisplayWithContent(shapeData, propsToDisplay);\n const modifier = getClassModifiers(LIST, otherProps);\n const SummaryComponent = summaryComponents[type];\n await SummaryComponent.render.preload(); // preload dynamic nextjs component\n\n if (!summaryPropsWithContent.length) return null;\n\n const getDataSummaryComponent = () => {\n const component = (\n <ApolloProvider client={client}>\n <SummaryComponent\n key={type}\n modifier={modifier}\n elementTitle={elementTitle}\n summaryPropsWithContent={summaryPropsWithContent}\n />\n </ApolloProvider>\n );\n\n if (isTypeHeading && url) return <Link href={url}>{component}</Link>;\n\n return component;\n };\n\n return getDataSummaryComponent();\n })\n );\n const { imageId } = shapeData || {};\n const image = imageData.find(({ id }) => id === imageId);\n const shouldShowImage = image && image.url;\n\n const getImageElement = () => {\n const { url: imageUrl, data } = image;\n const imageElement = (\n <img className=\"info__window\" src={imageUrl} alt={data && data.altText ? data.altText : ''} />\n );\n\n if (url) return <Link href={url}>{imageElement}</Link>;\n\n return imageElement;\n };\n\n return (\n <>\n {shouldShowImage && getImageElement()}\n {summariesWithContent}\n </>\n );\n};\n\nfunction getIcon(imageData, shape) {\n const {\n imageId,\n markerWidth = 50,\n markerHeight = 50,\n strokeColor,\n strokeOpacity,\n strokeWeight,\n fillColor,\n fillOpacity,\n svgPath\n } = shape;\n const iconUrl = getIconUrl(imageId, imageData);\n\n const icon = iconUrl\n ? {\n url: iconUrl,\n scaledSize: new window.google.maps.Size(markerWidth || 50, markerHeight || 50)\n }\n : null;\n\n if (icon) return icon;\n\n if (!svgPath && !fillColor && !strokeColor) return {}; // any can be true for custom marker\n\n const svgMarker = {\n path: svgPath || DEFAULT_CUSTOM_MARKER_PATH,\n strokeColor,\n strokeOpacity,\n strokeWeight,\n fillColor,\n fillOpacity,\n rotation: 0,\n scale: 2\n };\n return svgMarker;\n}\n\nconst setMarker = (map, router, shape, imageData, client) => {\n const { label = '', latitude, longitude } = shape;\n\n if (isPositionCorrect(latitude, longitude)) {\n const svgMarker = getIcon(imageData, shape);\n\n const marker = new window.google.maps.Marker({\n position: { lat: latitude, lng: longitude },\n map,\n icon: svgMarker,\n title: label || ''\n });\n\n addShapeListeners(map, router, shape, imageData, marker, client);\n\n shapesArray.push(marker);\n\n marker.setMap(map);\n }\n};\n\nconst setPolyline = (map, router, shape, imageData) => {\n const { paths } = shape;\n const path = getPath(paths);\n\n if (path.length) {\n const polyline = new window.google.maps.Polyline({\n path,\n geodesic: true,\n ...setStyleOptions(shape)\n });\n\n addShapeListeners(map, router, shape, imageData, polyline);\n\n shapesArray.push(polyline);\n\n polyline.setMap(map);\n }\n};\n\nconst setPolygon = (map, router, shape, imageData) => {\n const { paths: unParsedPaths } = shape;\n const paths = getPath(unParsedPaths);\n\n if (paths.length) {\n const polygon = new window.google.maps.Polygon({\n paths,\n ...setStyleOptions(shape)\n });\n\n addShapeListeners(map, router, shape, imageData, polygon);\n\n shapesArray.push(polygon);\n\n polygon.setMap(map);\n }\n};\n\nconst setRectangle = (map, router, shape, imageData) => {\n const { northBound, southBound, eastBound, westBound } = shape;\n if (areRectangleBoundsNumbers([northBound, southBound, eastBound, westBound])) {\n const rectangle = new window.google.maps.Rectangle({\n ...setStyleOptions(shape),\n map,\n bounds: {\n north: northBound,\n south: southBound,\n east: eastBound,\n west: westBound\n }\n });\n\n addShapeListeners(map, router, shape, imageData, rectangle);\n\n shapesArray.push(rectangle);\n\n rectangle.setMap(map);\n }\n};\n\nconst setCircle = (map, router, shape, imageData) => {\n const { latitude, longitude, radius } = shape;\n if (isPositionCorrect(latitude, longitude) && isNumber(radius)) {\n const circle = new window.google.maps.Circle({\n ...setStyleOptions(shape),\n map,\n center: { lat: latitude, lng: longitude },\n radius\n });\n\n addShapeListeners(map, router, shape, imageData, circle);\n\n shapesArray.push(circle);\n\n circle.setMap(map);\n }\n};\n\nconst setShapes = (map, router, shapes, imageData, client) => {\n const mapZoom = map.getZoom();\n clearShapes();\n\n shapes.forEach(shape => {\n const { type, minZoom, maxZoom } = shape;\n\n if (mapZoom >= minZoom && mapZoom <= maxZoom) {\n switch (type) {\n case MARKER: {\n setMarker(map, router, shape, imageData, client);\n break;\n }\n case POLYLINE: {\n setPolyline(map, router, shape, imageData);\n break;\n }\n case POLYGON: {\n setPolygon(map, router, shape, imageData);\n break;\n }\n case RECTANGLE: {\n setRectangle(map, router, shape, imageData);\n break;\n }\n case CIRCLE: {\n setCircle(map, router, shape, imageData);\n break;\n }\n default:\n break;\n }\n }\n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CAAC,CAAC;EAEbyI,MAAM,CAACvI,OAAO,CAACC,KAAK,IAAI;IACtB,MAAM;MAAE+D,IAAI;MAAE0E,OAAO;MAAEC;IAAQ,CAAC,GAAG1I,KAAK;IAExC,IAAIuI,OAAO,IAAIE,OAAO,IAAIF,OAAO,IAAIG,OAAO,EAAE;MAC5C,QAAQ3E,IAAI;QACV,KAAK9E,MAAM;UAAE;YACXmH,SAAS,CAAC9F,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,EAAEE,MAAM,CAAC;YAChD;UACF;QACA,KAAKxB,QAAQ;UAAE;YACb0H,WAAW,CAACtG,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,CAAC;YAC1C;UACF;QACA,KAAKrB,OAAO;UAAE;YACZ8H,UAAU,CAAC3G,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,CAAC;YACzC;UACF;QACA,KAAKpB,SAAS;UAAE;YACdiI,YAAY,CAAC/G,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,CAAC;YAC3C;UACF;QACA,KAAKnB,MAAM;UAAE;YACX2I,SAAS,CAAC1H,GAAG,EAAEC,MAAM,EAAEP,KAAK,EAAEQ,SAAS,CAAC;YACxC;UACF;QACA;UACE;MACJ;IACF;EACF,CAAC,CAAC;AACJ,CAAC;AAED,eAAe6H,SAAS","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-get-entity-schemas.js","names":["useQuery","useState","GET_ENTITY_SCHEMAS","useGetEntitySchemas","skipCondition","skip","data","loading","error"],"sources":["../../../src/GoogleMaps/hooks/use-get-entity-schemas.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { useState } from 'react';\nimport { GET_ENTITY_SCHEMAS } from '../queries';\n\nconst useGetEntitySchemas = (skipCondition = false) => {\n const [skip] = useState(!skipCondition);\n const {
|
|
1
|
+
{"version":3,"file":"use-get-entity-schemas.js","names":["useQuery","useState","GET_ENTITY_SCHEMAS","useGetEntitySchemas","skipCondition","skip","data","loading","error"],"sources":["../../../src/GoogleMaps/hooks/use-get-entity-schemas.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { useState } from 'react';\nimport { GET_ENTITY_SCHEMAS } from '../queries';\n\nconst useGetEntitySchemas = (skipCondition = false) => {\n const [skip] = useState(!skipCondition);\n const {\n data = {},\n loading,\n error\n } = useQuery(GET_ENTITY_SCHEMAS, {\n skip\n });\n return { data, loading, error };\n};\n\nexport default useGetEntitySchemas;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,QAAQ,QAAQ,OAAO;AAChC,SAASC,kBAAkB,QAAQ,YAAY;AAE/C,MAAMC,mBAAmB,GAAGA,CAACC,aAAa,GAAG,KAAK,KAAK;EACrD,MAAM,CAACC,IAAI,CAAC,GAAGJ,QAAQ,CAAC,CAACG,aAAa,CAAC;EACvC,MAAM;IACJE,IAAI,GAAG,CAAC,CAAC;IACTC,OAAO;IACPC;EACF,CAAC,GAAGR,QAAQ,CAACE,kBAAkB,EAAE;IAC/BG;EACF,CAAC,CAAC;EACF,OAAO;IAAEC,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC;AACjC,CAAC;AAED,eAAeL,mBAAmB","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"use-get-images.js","names":["useQuery","generateWhereQuery","generateQueryString","useGetImages","imageIds","queryName","action","data","loading","error","variables","where","id","_in","skip","length"],"sources":["../../../src/GoogleMaps/hooks/use-get-images.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { generateWhereQuery, generateQueryString } from '../queries';\n\nconst useGetImages = imageIds => {\n const queryName = 'getFiles';\n const action = generateWhereQuery(generateQueryString(queryName, queryName, 'id url data'));\n const {
|
|
1
|
+
{"version":3,"file":"use-get-images.js","names":["useQuery","generateWhereQuery","generateQueryString","useGetImages","imageIds","queryName","action","data","loading","error","variables","where","id","_in","skip","length"],"sources":["../../../src/GoogleMaps/hooks/use-get-images.js"],"sourcesContent":["import { useQuery } from '@apollo/client';\nimport { generateWhereQuery, generateQueryString } from '../queries';\n\nconst useGetImages = imageIds => {\n const queryName = 'getFiles';\n const action = generateWhereQuery(generateQueryString(queryName, queryName, 'id url data'));\n const {\n data = {},\n loading,\n error\n } = useQuery(action, {\n variables: { where: { id: { _in: imageIds } } },\n skip: !imageIds || !imageIds.length\n });\n return { data, loading, error };\n};\n\nexport default useGetImages;\n"],"mappings":"AAAA,SAASA,QAAQ,QAAQ,gBAAgB;AACzC,SAASC,kBAAkB,EAAEC,mBAAmB,QAAQ,YAAY;AAEpE,MAAMC,YAAY,GAAGC,QAAQ,IAAI;EAC/B,MAAMC,SAAS,GAAG,UAAU;EAC5B,MAAMC,MAAM,GAAGL,kBAAkB,CAACC,mBAAmB,CAACG,SAAS,EAAEA,SAAS,EAAE,aAAa,CAAC,CAAC;EAC3F,MAAM;IACJE,IAAI,GAAG,CAAC,CAAC;IACTC,OAAO;IACPC;EACF,CAAC,GAAGT,QAAQ,CAACM,MAAM,EAAE;IACnBI,SAAS,EAAE;MAAEC,KAAK,EAAE;QAAEC,EAAE,EAAE;UAAEC,GAAG,EAAET;QAAS;MAAE;IAAE,CAAC;IAC/CU,IAAI,EAAE,CAACV,QAAQ,IAAI,CAACA,QAAQ,CAACW;EAC/B,CAAC,CAAC;EACF,OAAO;IAAER,IAAI;IAAEC,OAAO;IAAEC;EAAM,CAAC;AACjC,CAAC;AAED,eAAeN,YAAY","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"queries.js","names":["gql","GET_ENTITY_SCHEMAS","generateQuery","queryString","generateWhereQuery","generateQueryString","action","query","props","generateIdsQuery","ids","JSON","stringify","generateFiltersQuery","rawQUery","filterQueryKey"],"sources":["../../src/GoogleMaps/queries.js"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst GET_ENTITY_SCHEMAS = gql`\n query getEntitySchemas($identifier: String) {\n getEntitySchemas(identifier: $identifier) {\n id\n identifier\n actions\n dynamicProperties\n properties\n relations\n }\n }\n`;\n\nconst generateQuery = queryString => gql`\n query getEntityData {\n ${queryString}\n }\n`;\n\nconst generateWhereQuery = queryString => gql`\n query getEntityData($where: JSON){\n ${queryString}\n }\n`;\nconst generateQueryString = (action, query, props) => `\n ${query}: ${action}(where: $where){\n id\n ${props}\n }\n`;\n\nconst generateIdsQuery = (query, props, action, ids) => `\n ${query}: ${action}(where: { id: { _in: ${JSON.stringify(ids)} } }){\n id\n ${props}\n }\n`;\n\nconst generateFiltersQuery = (query, props, rawQUery, filterQueryKey) => `\n ${query}: searchPublishedContent(rawQueryStringified: ${JSON.stringify(rawQUery)}){\n results {\n ...on ${filterQueryKey} {\n id\n ${props}\n }\n }\n }\n`;\n\nexport {\n GET_ENTITY_SCHEMAS,\n generateQuery,\n generateQueryString,\n generateIdsQuery,\n generateFiltersQuery,\n generateWhereQuery\n};\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AAEpC,MAAMC,kBAAkB,GAAGD,
|
|
1
|
+
{"version":3,"file":"queries.js","names":["gql","GET_ENTITY_SCHEMAS","generateQuery","queryString","generateWhereQuery","generateQueryString","action","query","props","generateIdsQuery","ids","JSON","stringify","generateFiltersQuery","rawQUery","filterQueryKey"],"sources":["../../src/GoogleMaps/queries.js"],"sourcesContent":["import { gql } from '@apollo/client';\n\nconst GET_ENTITY_SCHEMAS = gql`\n query getEntitySchemas($identifier: String) {\n getEntitySchemas(identifier: $identifier) {\n id\n identifier\n actions\n dynamicProperties\n properties\n relations\n }\n }\n`;\n\nconst generateQuery = queryString => gql`\n query getEntityData {\n ${queryString}\n }\n`;\n\nconst generateWhereQuery = queryString => gql`\n query getEntityData($where: JSON){\n ${queryString}\n }\n`;\nconst generateQueryString = (action, query, props) => `\n ${query}: ${action}(where: $where){\n id\n ${props}\n }\n`;\n\nconst generateIdsQuery = (query, props, action, ids) => `\n ${query}: ${action}(where: { id: { _in: ${JSON.stringify(ids)} } }){\n id\n ${props}\n }\n`;\n\nconst generateFiltersQuery = (query, props, rawQUery, filterQueryKey) => `\n ${query}: searchPublishedContent(rawQueryStringified: ${JSON.stringify(rawQUery)}){\n results {\n ...on ${filterQueryKey} {\n id\n ${props}\n }\n }\n }\n`;\n\nexport {\n GET_ENTITY_SCHEMAS,\n generateQuery,\n generateQueryString,\n generateIdsQuery,\n generateFiltersQuery,\n generateWhereQuery\n};\n"],"mappings":"AAAA,SAASA,GAAG,QAAQ,gBAAgB;AAEpC,MAAMC,kBAAkB,GAAGD,GAAG;AAC9B;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,CAAC;AAED,MAAME,aAAa,GAAGC,WAAW,IAAIH,GAAG;AACxC;AACA,MAAMG,WAAW;AACjB;AACA,CAAC;AAED,MAAMC,kBAAkB,GAAGD,WAAW,IAAIH,GAAG;AAC7C;AACA,MAAMG,WAAW;AACjB;AACA,CAAC;AACD,MAAME,mBAAmB,GAAGA,CAACC,MAAM,EAAEC,KAAK,EAAEC,KAAK,KAAK;AACtD,IAAID,KAAK,KAAKD,MAAM;AACpB;AACA,MAAME,KAAK;AACX;AACA,CAAC;AAED,MAAMC,gBAAgB,GAAGA,CAACF,KAAK,EAAEC,KAAK,EAAEF,MAAM,EAAEI,GAAG,KAAK;AACxD,IAAIH,KAAK,KAAKD,MAAM,wBAAwBK,IAAI,CAACC,SAAS,CAACF,GAAG,CAAC;AAC/D;AACA,MAAMF,KAAK;AACX;AACA,CAAC;AAED,MAAMK,oBAAoB,GAAGA,CAACN,KAAK,EAAEC,KAAK,EAAEM,QAAQ,EAAEC,cAAc,KAAK;AACzE,IAAIR,KAAK,kDAAkDI,IAAI,CAACC,SAAS,CAACE,QAAQ,CAAC;AACnF;AACA,cAAcC,cAAc;AAC5B;AACA,UAAUP,KAAK;AACf;AACA;AACA;AACA,CAAC;AAED,SACEP,kBAAkB,EAClBC,aAAa,EACbG,mBAAmB,EACnBI,gBAAgB,EAChBI,oBAAoB,EACpBT,kBAAkB","ignoreList":[]}
|
package/lib-es/index.js
CHANGED
|
@@ -5,7 +5,7 @@ export default async function load(app) {
|
|
|
5
5
|
app.events.once('load:custom:page-builder:component', addComponent => {
|
|
6
6
|
addComponent({
|
|
7
7
|
key: 'googlemaps',
|
|
8
|
-
component: dynamic(() => import(
|
|
8
|
+
component: dynamic(() => import(/* webpackChunkName: "blazePbGoogleMaps" */'./GoogleMaps'))
|
|
9
9
|
});
|
|
10
10
|
});
|
|
11
11
|
return {
|
package/lib-es/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["dynamic","pkg","PLUGIN_NAME","load","app","events","once","addComponent","key","component","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\nimport pkg from '../package.json';\nimport { PLUGIN_NAME } from './constants';\n\nexport default async function load(app) {\n app.events.once('load:custom:page-builder:component', addComponent => {\n addComponent({\n key: 'googlemaps',\n component: dynamic(() => import(/* webpackChunkName: \"blazePbGoogleMaps\" */ './GoogleMaps'))\n });\n });\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,cAAc;AAClC,OAAOC,GAAG,MAAM,iBAAiB;AACjC,SAASC,WAAW,QAAQ,aAAa;AAEzC,eAAe,eAAeC,IAAIA,CAACC,GAAG,EAAE;EACtCA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,oCAAoC,EAAEC,YAAY,IAAI;IACpEA,YAAY,CAAC;MACXC,GAAG,EAAE,YAAY;MACjBC,SAAS,EAAET,OAAO,CAAC,MAAM,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","names":["dynamic","pkg","PLUGIN_NAME","load","app","events","once","addComponent","key","component","name","version","pluginName"],"sources":["../src/index.js"],"sourcesContent":["import dynamic from 'next/dynamic';\nimport pkg from '../package.json';\nimport { PLUGIN_NAME } from './constants';\n\nexport default async function load(app) {\n app.events.once('load:custom:page-builder:component', addComponent => {\n addComponent({\n key: 'googlemaps',\n component: dynamic(() => import(/* webpackChunkName: \"blazePbGoogleMaps\" */ './GoogleMaps'))\n });\n });\n\n return {\n name: PLUGIN_NAME,\n version: pkg.version\n };\n}\n\nload.pluginName = PLUGIN_NAME;\n"],"mappings":"AAAA,OAAOA,OAAO,MAAM,cAAc;AAClC,OAAOC,GAAG,MAAM,iBAAiB;AACjC,SAASC,WAAW,QAAQ,aAAa;AAEzC,eAAe,eAAeC,IAAIA,CAACC,GAAG,EAAE;EACtCA,GAAG,CAACC,MAAM,CAACC,IAAI,CAAC,oCAAoC,EAAEC,YAAY,IAAI;IACpEA,YAAY,CAAC;MACXC,GAAG,EAAE,YAAY;MACjBC,SAAS,EAAET,OAAO,CAAC,MAAM,MAAM,CAAC,2CAA4C,cAAc,CAAC;IAC7F,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAO;IACLU,IAAI,EAAER,WAAW;IACjBS,OAAO,EAAEV,GAAG,CAACU;EACf,CAAC;AACH;AAEAR,IAAI,CAACS,UAAU,GAAGV,WAAW","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,24 +1,29 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-google-maps-fe",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.147.0-rc-eagle.4",
|
|
4
4
|
"description": "Blaze Google maps plugin fe",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
7
|
-
"
|
|
7
|
+
"files": [
|
|
8
|
+
"lib",
|
|
9
|
+
"lib-es",
|
|
10
|
+
"src"
|
|
11
|
+
],
|
|
12
|
+
"source": "src/index.js",
|
|
8
13
|
"directories": {
|
|
9
14
|
"src": "src/"
|
|
10
15
|
},
|
|
11
16
|
"scripts": {
|
|
12
17
|
"test": "jest",
|
|
13
|
-
"lint": "
|
|
18
|
+
"lint": "npm run lint:js",
|
|
14
19
|
"lint:js": "eslint .",
|
|
15
20
|
"clean": "rm -Rf ./lib/ && rm -Rf ./lib-es/",
|
|
16
21
|
"build:cjs": "BABEL_ENV=cjs ../../node_modules/.bin/babel ./src --out-dir ./lib --source-maps --root-mode upward",
|
|
17
22
|
"build:esm": "BABEL_ENV=esm ../../node_modules/.bin/babel ./src --out-dir ./lib-es --source-maps --root-mode upward",
|
|
18
|
-
"build": "
|
|
19
|
-
"build:clean": "
|
|
20
|
-
"prepublishOnly": "
|
|
21
|
-
"postpublish": "
|
|
23
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
24
|
+
"build:clean": "npm run clean && npm run build",
|
|
25
|
+
"prepublishOnly": "npm run build:clean",
|
|
26
|
+
"postpublish": "npm run clean"
|
|
22
27
|
},
|
|
23
28
|
"author": {
|
|
24
29
|
"email": "hello@thebyte9.com",
|
|
@@ -27,22 +32,25 @@
|
|
|
27
32
|
},
|
|
28
33
|
"license": "GPL-3.0",
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/nextjs-components": "0.
|
|
31
|
-
"@blaze-cms/react-page-builder": "0.
|
|
32
|
-
"@blaze-cms/setup-ui": "
|
|
33
|
-
"
|
|
35
|
+
"@blaze-cms/nextjs-components": "0.147.0-rc-eagle.4",
|
|
36
|
+
"@blaze-cms/react-page-builder": "0.147.0-rc-eagle.4",
|
|
37
|
+
"@blaze-cms/setup-ui": "0.147.0-rc-eagle.4",
|
|
38
|
+
"@blaze-react/more": "^0.7.0",
|
|
39
|
+
"@blaze-react/utils": "^0.7.0",
|
|
40
|
+
"lodash.camelcase": "^4.3.0",
|
|
34
41
|
"lodash.isnumber": "^3.0.3",
|
|
42
|
+
"lodash.upperfirst": "^4.3.1",
|
|
35
43
|
"regenerator-runtime": "^0.13.3"
|
|
36
44
|
},
|
|
37
45
|
"devDependencies": {
|
|
38
|
-
"@blaze-cms/core-ui": "0.
|
|
46
|
+
"@blaze-cms/core-ui": "0.147.0-rc-eagle.4"
|
|
39
47
|
},
|
|
40
48
|
"peerDependencies": {
|
|
41
|
-
"next": "
|
|
49
|
+
"next": ">= 14"
|
|
42
50
|
},
|
|
43
51
|
"eslintIgnore": [
|
|
44
52
|
"lib/*",
|
|
45
53
|
"lib-es/*"
|
|
46
54
|
],
|
|
47
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "ddfab9ac3d59438939268c106917b092e4071071"
|
|
48
56
|
}
|
|
@@ -86,8 +86,11 @@ const GoogleMaps = ({
|
|
|
86
86
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
87
87
|
}, []);
|
|
88
88
|
|
|
89
|
+
useEffect(() => {
|
|
90
|
+
if (isIntersecting) addZoomListener(map, router, mapShapes, imageData, client);
|
|
91
|
+
}, [isIntersecting, map, mapShapes, imageData, router, client]);
|
|
92
|
+
|
|
89
93
|
if (map && typeof onMount === `function`) onMount(map, onMountProps);
|
|
90
|
-
if (isIntersecting) addZoomListener(map, router, mapShapes, imageData, client);
|
|
91
94
|
|
|
92
95
|
return <GoogleMapsHtml mapRef={mapRef} />;
|
|
93
96
|
};
|
|
@@ -3,7 +3,7 @@ import setShapes from './set-shapes';
|
|
|
3
3
|
|
|
4
4
|
const addZoomListener = (map, router, shapes, imageData, client) => {
|
|
5
5
|
if (!map) return;
|
|
6
|
-
setShapes(map, router, shapes, imageData);
|
|
6
|
+
setShapes(map, router, shapes, imageData, client);
|
|
7
7
|
map.addListener(ZOOM_CHANGED, () => setShapes(map, router, shapes, imageData, client));
|
|
8
8
|
};
|
|
9
9
|
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import upperFirst from 'lodash.upperfirst';
|
|
2
|
+
import camelcase from 'lodash.camelcase';
|
|
1
3
|
import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';
|
|
2
4
|
|
|
3
5
|
const buildQuery = entityConfigs => {
|
|
@@ -7,7 +9,7 @@ const buildQuery = entityConfigs => {
|
|
|
7
9
|
.map(entityConfig => {
|
|
8
10
|
const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;
|
|
9
11
|
if (!action) return '';
|
|
10
|
-
const formatedEntity =
|
|
12
|
+
const formatedEntity = upperFirst(camelcase(entity));
|
|
11
13
|
const filterQueryKey =
|
|
12
14
|
action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;
|
|
13
15
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import isNumber from 'lodash.isnumber';
|
|
3
|
-
import ReactDOMServer from 'react-dom/server';
|
|
3
|
+
import * as ReactDOMServer from 'react-dom/server';
|
|
4
4
|
import { Link } from '@blaze-cms/nextjs-components';
|
|
5
5
|
import { ApolloProvider } from '@apollo/client';
|
|
6
6
|
import {
|
|
@@ -4,7 +4,11 @@ import { GET_ENTITY_SCHEMAS } from '../queries';
|
|
|
4
4
|
|
|
5
5
|
const useGetEntitySchemas = (skipCondition = false) => {
|
|
6
6
|
const [skip] = useState(!skipCondition);
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
data = {},
|
|
9
|
+
loading,
|
|
10
|
+
error
|
|
11
|
+
} = useQuery(GET_ENTITY_SCHEMAS, {
|
|
8
12
|
skip
|
|
9
13
|
});
|
|
10
14
|
return { data, loading, error };
|
|
@@ -4,7 +4,11 @@ import { generateWhereQuery, generateQueryString } from '../queries';
|
|
|
4
4
|
const useGetImages = imageIds => {
|
|
5
5
|
const queryName = 'getFiles';
|
|
6
6
|
const action = generateWhereQuery(generateQueryString(queryName, queryName, 'id url data'));
|
|
7
|
-
const {
|
|
7
|
+
const {
|
|
8
|
+
data = {},
|
|
9
|
+
loading,
|
|
10
|
+
error
|
|
11
|
+
} = useQuery(action, {
|
|
8
12
|
variables: { where: { id: { _in: imageIds } } },
|
|
9
13
|
skip: !imageIds || !imageIds.length
|
|
10
14
|
});
|