@blaze-cms/plugin-google-maps-fe 0.146.0-node18.1 → 0.146.0-rc-eagle-3.0
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 +3 -9
- package/lib/GoogleMaps/GoogleMaps.js +68 -90
- package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsFactory.js +21 -22
- 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 +48 -48
- 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 -28
- 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 -245
- 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 -22
- 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 +14 -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/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/package.json +15 -10
- 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/babel.config.js +0 -3
- package/jest.config.js +0 -3
package/lib/index.js
CHANGED
|
@@ -4,52 +4,23 @@ 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 _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function
|
|
23
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" !=
|
|
24
|
-
function load(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
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 _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function (e) { return e ? t : r; })(e); }
|
|
12
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != typeof e && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
13
|
+
async function load(app) {
|
|
14
|
+
app.events.once('load:custom:page-builder:component', addComponent => {
|
|
15
|
+
addComponent({
|
|
16
|
+
key: 'googlemaps',
|
|
17
|
+
component: (0, _dynamic.default)(() => Promise.resolve().then(() => _interopRequireWildcard(require('./GoogleMaps'))))
|
|
18
|
+
});
|
|
19
|
+
});
|
|
20
|
+
return {
|
|
21
|
+
name: _constants.PLUGIN_NAME,
|
|
22
|
+
version: _package.default.version
|
|
23
|
+
};
|
|
53
24
|
}
|
|
54
25
|
load.pluginName = _constants.PLUGIN_NAME;
|
|
55
26
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","names":["_dynamic","_interopRequireDefault","require","_package","_constants","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","
|
|
1
|
+
{"version":3,"file":"index.js","names":["_dynamic","_interopRequireDefault","require","_package","_constants","_getRequireWildcardCache","e","WeakMap","r","t","_interopRequireWildcard","__esModule","default","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","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,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,CAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAI,wBAAAJ,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAK,UAAA,SAAAL,CAAA,eAAAA,CAAA,uBAAAA,CAAA,yBAAAA,CAAA,WAAAM,OAAA,EAAAN,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAI,GAAA,CAAAP,CAAA,UAAAG,CAAA,CAAAK,GAAA,CAAAR,CAAA,OAAAS,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAAAC,cAAA,IAAAD,MAAA,CAAAE,wBAAA,WAAAC,CAAA,IAAAf,CAAA,oBAAAe,CAAA,OAAAC,cAAA,CAAAC,IAAA,CAAAjB,CAAA,EAAAe,CAAA,SAAAG,CAAA,GAAAP,CAAA,GAAAC,MAAA,CAAAE,wBAAA,CAAAd,CAAA,EAAAe,CAAA,UAAAG,CAAA,KAAAA,CAAA,CAAAV,GAAA,IAAAU,CAAA,CAAAC,GAAA,IAAAP,MAAA,CAAAC,cAAA,CAAAJ,CAAA,EAAAM,CAAA,EAAAG,CAAA,IAAAT,CAAA,CAAAM,CAAA,IAAAf,CAAA,CAAAe,CAAA,YAAAN,CAAA,CAAAH,OAAA,GAAAN,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAgB,GAAA,CAAAnB,CAAA,EAAAS,CAAA,GAAAA,CAAA;AAE3B,eAAeW,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,OAAA1B,uBAAA,CAAAR,OAAA,CAAyD,cAAc,GAAC;IAC7F,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAO;IACLmC,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;AACvC,SAASC,SAAS,QAAQ,+BAA+B;AACzD,S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F,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":[]}
|
|
@@ -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":[]}
|
package/package.json
CHANGED
|
@@ -1,10 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-google-maps-fe",
|
|
3
|
-
"version": "0.146.0-
|
|
3
|
+
"version": "0.146.0-rc-eagle-3.0",
|
|
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
|
},
|
|
@@ -27,24 +32,24 @@
|
|
|
27
32
|
},
|
|
28
33
|
"license": "GPL-3.0",
|
|
29
34
|
"dependencies": {
|
|
30
|
-
"@blaze-cms/nextjs-components": "0.146.0-
|
|
31
|
-
"@blaze-cms/react-page-builder": "0.146.0-
|
|
32
|
-
"@blaze-cms/setup-ui": "0.146.0-
|
|
35
|
+
"@blaze-cms/nextjs-components": "0.146.0-rc-eagle-3.0",
|
|
36
|
+
"@blaze-cms/react-page-builder": "0.146.0-rc-eagle-3.0",
|
|
37
|
+
"@blaze-cms/setup-ui": "0.146.0-rc-eagle-3.0",
|
|
33
38
|
"@blaze-react/more": "^0.7.0",
|
|
34
39
|
"@blaze-react/utils": "^0.7.0",
|
|
35
|
-
"
|
|
40
|
+
"lodash.camelcase": "^4.3.0",
|
|
36
41
|
"lodash.isnumber": "^3.0.3",
|
|
37
|
-
"
|
|
42
|
+
"lodash.upperfirst": "^4.3.1"
|
|
38
43
|
},
|
|
39
44
|
"devDependencies": {
|
|
40
|
-
"@blaze-cms/core-ui": "0.146.0-
|
|
45
|
+
"@blaze-cms/core-ui": "0.146.0-rc-eagle-3.0"
|
|
41
46
|
},
|
|
42
47
|
"peerDependencies": {
|
|
43
|
-
"next": "14
|
|
48
|
+
"next": ">= 14"
|
|
44
49
|
},
|
|
45
50
|
"eslintIgnore": [
|
|
46
51
|
"lib/*",
|
|
47
52
|
"lib-es/*"
|
|
48
53
|
],
|
|
49
|
-
"gitHead": "
|
|
54
|
+
"gitHead": "eeb5c91d33bae79f7605ffa99d8cbf430840e27a"
|
|
50
55
|
}
|
|
@@ -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
|
|
package/babel.config.js
DELETED
package/jest.config.js
DELETED