@blaze-cms/plugin-google-maps-fe 0.146.0-core-styles.45 → 0.146.0-core-styles.52
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 +16 -0
- package/lib/GoogleMaps/GoogleMaps.js +1 -2
- package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
- package/lib/GoogleMaps/GoogleMapsFactory.js +1 -0
- package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
- package/lib/GoogleMaps/helpers/build-query.js +1 -0
- package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
- package/lib/index.js +1 -2
- package/lib/index.js.map +1 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,22 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [0.146.0-core-styles.52](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.51...v0.146.0-core-styles.52) (2025-05-13)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [0.146.0-core-styles.50](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.49...v0.146.0-core-styles.50) (2025-04-30)
|
|
15
|
+
|
|
16
|
+
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
6
22
|
# [0.146.0-core-styles.45](https://github.com/thebyte9/blaze/compare/v0.146.0-core-styles.44...v0.146.0-core-styles.45) (2025-03-27)
|
|
7
23
|
|
|
8
24
|
**Note:** Version bump only for package @blaze-cms/plugin-google-maps-fe
|
|
@@ -34,8 +34,7 @@ var _helpers = require("./helpers");
|
|
|
34
34
|
var _constants = require("../constants");
|
|
35
35
|
var _GoogleMapsHtml = _interopRequireDefault(require("./GoogleMapsHtml"));
|
|
36
36
|
var _excluded = ["type", "name", "modifier", "elementTitle", "imageData", "onMount", "onMountProps", "parent", "mapShapes", "centerCoordinates"];
|
|
37
|
-
function
|
|
38
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof3(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; }
|
|
37
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != _typeof3(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
39
38
|
var shouldNotUpdate = function shouldNotUpdate(props, nextProps) {
|
|
40
39
|
var _ref = [(0, _lodash.functions)(props), (0, _lodash.functions)(nextProps)],
|
|
41
40
|
funcs = _ref[0],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMaps.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_client","_router","_reactPageBuilder","_customHooks","_lodash","_helpers","_constants","_GoogleMapsHtml","_excluded","_getRequireWildcardCache","e","WeakMap","r","t","__esModule","_typeof3","has","get","n","__proto__","a","Object","defineProperty","getOwnPropertyDescriptor","u","hasOwnProperty","call","i","set","shouldNotUpdate","props","nextProps","_ref","functions","funcs","nextFuncs","noPropChange","isEqual","omit","noFuncChange","length","every","fn","toString","GoogleMaps","_ref2","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","_objectWithoutProperties2","router","useRouter","_useInView","useInView","IN_VIEW_CONFIG","_useInView2","_slicedToArray2","isIntersecting","mapRef","client","useApolloClient","_useState","useState","_useState2","map","setMap","useEffect","options","setMapOptions","onLoad","initialMap","window","google","maps","Map","current","_centerCoordinates","_centerCoordinates$","lat","latitude","lng","longitude","setCenter","bounds","LatLngBounds","forEach","_ref3","extend","LatLng","fitBounds","script","document","createElement","SCRIPT","src","concat","GOOGLE_MAPS_SCRIPT","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","LOAD","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","_typeof2","addZoomListener","propTypes","PropTypes","array","string","func","object","defaultProps","_default","exports","React","memo","withTitle"],"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 if (map && typeof onMount === `function`) onMount(map, onMountProps);\n if (isIntersecting) addZoomListener(map, router, mapShapes, imageData, client);\n\n return <GoogleMapsHtml mapRef={mapRef} />;\n};\n\nGoogleMaps.propTypes = {\n mapShapes: PropTypes.array,\n imageData: PropTypes.array,\n type: PropTypes.string,\n name: PropTypes.string,\n modifier: PropTypes.string,\n elementTitle: PropTypes.string,\n onMount: PropTypes.func,\n onMountProps: PropTypes.object,\n parent: PropTypes.object,\n centerCoordinates: PropTypes.array\n};\n\nGoogleMaps.defaultProps = {\n mapShapes: [],\n imageData: [],\n centerCoordinates: [],\n type: '',\n name: '',\n modifier: '',\n elementTitle: '',\n onMount: null,\n onMountProps: null,\n parent: {}\n};\n\nexport default React.memo(withTitle(GoogleMaps), shouldNotUpdate);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AACA,IAAAS,UAAA,GAAAT,OAAA;AACA,IAAAU,eAAA,GAAAR,sBAAA,CAAAF,OAAA;AAA8C,IAAAW,SAAA;AAAA,SAAAC,yBAAAC,CAAA,6BAAAC,OAAA,mBAAAC,CAAA,OAAAD,OAAA,IAAAE,CAAA,OAAAF,OAAA,YAAAF,wBAAA,YAAAA,yBAAAC,CAAA,WAAAA,CAAA,GAAAG,CAAA,GAAAD,CAAA,KAAAF,CAAA;AAAA,SAAAd,wBAAAc,CAAA,EAAAE,CAAA,SAAAA,CAAA,IAAAF,CAAA,IAAAA,CAAA,CAAAI,UAAA,SAAAJ,CAAA,eAAAA,CAAA,gBAAAK,QAAA,CAAAL,CAAA,0BAAAA,CAAA,sBAAAA,CAAA,QAAAG,CAAA,GAAAJ,wBAAA,CAAAG,CAAA,OAAAC,CAAA,IAAAA,CAAA,CAAAG,GAAA,CAAAN,CAAA,UAAAG,CAAA,CAAAI,GAAA,CAAAP,CAAA,OAAAQ,CAAA,KAAAC,SAAA,UAAAC,CAAA,GAAAC,MAAA,CAA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M,EAAEwE,qBAAS,CAACI,MAAM;EACxB1E,iBAAiB,EAAEsE,qBAAS,CAACC;AAC/B,CAAC;AAEDlF,UAAU,CAACsF,YAAY,GAAG;EACxB5E,SAAS,EAAE,EAAE;EACbJ,SAAS,EAAE,EAAE;EACbK,iBAAiB,EAAE,EAAE;EACrBT,IAAI,EAAE,EAAE;EACRC,IAAI,EAAE,EAAE;EACRC,QAAQ,EAAE,EAAE;EACZC,YAAY,EAAE,EAAE;EAChBE,OAAO,EAAE,IAAI;EACbC,YAAY,EAAE,IAAI;EAClBC,MAAM,EAAE,CAAC;AACX,CAAC;AAAC,IAAA8E,QAAA,GAAAC,OAAA,2BAEaC,iBAAK,CAACC,IAAI,CAAC,IAAAC,2BAAS,EAAC3F,UAAU,CAAC,EAAEf,eAAe,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"file":"GoogleMaps.js","names":["_react","_interopRequireWildcard","require","_propTypes","_interopRequireDefault","_client","_router","_reactPageBuilder","_customHooks","_lodash","_helpers","_constants","_GoogleMapsHtml","_excluded","e","t","WeakMap","r","n","__esModule","o","i","f","__proto__","_typeof3","has","get","set","_t2","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","shouldNotUpdate","props","nextProps","_ref","functions","funcs","nextFuncs","noPropChange","isEqual","omit","noFuncChange","length","every","fn","toString","GoogleMaps","_ref2","type","name","modifier","elementTitle","imageData","onMount","onMountProps","parent","mapShapes","centerCoordinates","otherProps","_objectWithoutProperties2","router","useRouter","_useInView","useInView","IN_VIEW_CONFIG","_useInView2","_slicedToArray2","isIntersecting","mapRef","client","useApolloClient","_useState","useState","_useState2","map","setMap","useEffect","options","setMapOptions","onLoad","initialMap","window","google","maps","Map","current","_centerCoordinates","_centerCoordinates$","lat","latitude","lng","longitude","setCenter","bounds","LatLngBounds","forEach","_ref3","extend","LatLng","fitBounds","script","document","createElement","SCRIPT","src","concat","GOOGLE_MAPS_SCRIPT","process","env","GOOGLE_MAPS_API_KEY","head","append","addEventListener","LOAD","removeEventListener","setOptions","enableGeolocation","shouldActivateGeolocation","navigator","geolocation","getCurrentPosition","position","center","coords","_typeof2","addZoomListener","propTypes","PropTypes","array","string","func","object","defaultProps","_default","exports","React","memo","withTitle"],"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 if (map && typeof onMount === `function`) onMount(map, onMountProps);\n if (isIntersecting) addZoomListener(map, router, mapShapes, imageData, client);\n\n return <GoogleMapsHtml mapRef={mapRef} />;\n};\n\nGoogleMaps.propTypes = {\n mapShapes: PropTypes.array,\n imageData: PropTypes.array,\n type: PropTypes.string,\n name: PropTypes.string,\n modifier: PropTypes.string,\n elementTitle: PropTypes.string,\n onMount: PropTypes.func,\n onMountProps: PropTypes.object,\n parent: PropTypes.object,\n centerCoordinates: PropTypes.array\n};\n\nGoogleMaps.defaultProps = {\n mapShapes: [],\n imageData: [],\n centerCoordinates: [],\n type: '',\n name: '',\n modifier: '',\n elementTitle: '',\n onMount: null,\n onMountProps: null,\n parent: {}\n};\n\nexport default React.memo(withTitle(GoogleMaps), shouldNotUpdate);\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,uBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AACA,IAAAK,iBAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAA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M,EAAEJ,SAAS,EAAEJ,SAAS,EAAEiB,MAAM,CAAC;EAE9E,oBAAOxE,MAAA,YAAAyG,aAAA,CAAC7F,eAAA,WAAc;IAAC2D,MAAM,EAAEA;EAAO,CAAE,CAAC;AAC3C,CAAC;AAEDtB,UAAU,CAACgF,SAAS,GAAG;EACrBtE,SAAS,EAAEuE,qBAAS,CAACC,KAAK;EAC1B5E,SAAS,EAAE2E,qBAAS,CAACC,KAAK;EAC1BhF,IAAI,EAAE+E,qBAAS,CAACE,MAAM;EACtBhF,IAAI,EAAE8E,qBAAS,CAACE,MAAM;EACtB/E,QAAQ,EAAE6E,qBAAS,CAACE,MAAM;EAC1B9E,YAAY,EAAE4E,qBAAS,CAACE,MAAM;EAC9B5E,OAAO,EAAE0E,qBAAS,CAACG,IAAI;EACvB5E,YAAY,EAAEyE,qBAAS,CAACI,MAAM;EAC9B5E,MAAM,EAAEwE,qBAAS,CAACI,MAAM;EACxB1E,iBAAiB,EAAEsE,qBAAS,CAACC;AAC/B,CAAC;AAEDlF,UAAU,CAACsF,YAAY,GAAG;EACxB5E,SAAS,EAAE,EAAE;EACbJ,SAAS,EAAE,EAAE;EACbK,iBAAiB,EAAE,EAAE;EACrBT,IAAI,EAAE,EAAE;EACRC,IAAI,EAAE,EAAE;EACRC,QAAQ,EAAE,EAAE;EACZC,YAAY,EAAE,EAAE;EAChBE,OAAO,EAAE,IAAI;EACbC,YAAY,EAAE,IAAI;EAClBC,MAAM,EAAE,CAAC;AACX,CAAC;AAAC,IAAA8E,QAAA,GAAAC,OAAA,2BAEaC,iBAAK,CAACC,IAAI,CAAC,IAAAC,2BAAS,EAAC3F,UAAU,CAAC,EAAEf,eAAe,CAAC","ignoreList":[]}
|
|
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
7
7
|
});
|
|
8
8
|
exports["default"] = void 0;
|
|
9
9
|
require("core-js/modules/es.array.map.js");
|
|
10
|
+
require("core-js/modules/es.object.to-string.js");
|
|
10
11
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
12
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
12
13
|
var _react = _interopRequireDefault(require("react"));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GoogleMapsFactory.js","names":["_react","_interopRequireDefault","require","_propTypes","_reactPageBuilder","_helpers","_GoogleMapsRender","_GoogleMapsHtml","_excluded","GoogleMapsFactory","_ref","entityGroups","parent","otherProps","_objectWithoutProperties2","_useGetEntitySchemasA","useGetEntitySchemasAsObj","map","_ref2","entity","data","loading","error","createElement","message","shapeConfigs","buildShapesConfig","_extends2","propTypes","PropTypes","object","array","defaultProps","_default","exports"],"sources":["../../src/GoogleMaps/GoogleMapsFactory.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGetEntitySchemasAsObj } from '@blaze-cms/react-page-builder';\nimport { buildShapesConfig } from './helpers';\nimport GoogleMapsRender from './GoogleMapsRender';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst GoogleMapsFactory = ({ entityGroups, parent, ...otherProps }) => {\n const { data, loading, error } = useGetEntitySchemasAsObj(\n entityGroups.map(({ entity }) => entity)\n );\n\n if (loading) return <GoogleMapsHtml />;\n if (error) return error.message;\n\n const shapeConfigs = buildShapesConfig(data, entityGroups, parent);\n\n return (\n <GoogleMapsRender\n shapeConfigs={shapeConfigs}\n entityGroups={entityGroups}\n parent={parent}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsFactory.propTypes = {\n parent: PropTypes.object,\n entityGroups: PropTypes.array\n};\n\nGoogleMapsFactory.defaultProps = {\n parent: {},\n entityGroups: []\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"GoogleMapsFactory.js","names":["_react","_interopRequireDefault","require","_propTypes","_reactPageBuilder","_helpers","_GoogleMapsRender","_GoogleMapsHtml","_excluded","GoogleMapsFactory","_ref","entityGroups","parent","otherProps","_objectWithoutProperties2","_useGetEntitySchemasA","useGetEntitySchemasAsObj","map","_ref2","entity","data","loading","error","createElement","message","shapeConfigs","buildShapesConfig","_extends2","propTypes","PropTypes","object","array","defaultProps","_default","exports"],"sources":["../../src/GoogleMaps/GoogleMapsFactory.js"],"sourcesContent":["import React from 'react';\nimport PropTypes from 'prop-types';\nimport { useGetEntitySchemasAsObj } from '@blaze-cms/react-page-builder';\nimport { buildShapesConfig } from './helpers';\nimport GoogleMapsRender from './GoogleMapsRender';\nimport GoogleMapsHtml from './GoogleMapsHtml';\n\nconst GoogleMapsFactory = ({ entityGroups, parent, ...otherProps }) => {\n const { data, loading, error } = useGetEntitySchemasAsObj(\n entityGroups.map(({ entity }) => entity)\n );\n\n if (loading) return <GoogleMapsHtml />;\n if (error) return error.message;\n\n const shapeConfigs = buildShapesConfig(data, entityGroups, parent);\n\n return (\n <GoogleMapsRender\n shapeConfigs={shapeConfigs}\n entityGroups={entityGroups}\n parent={parent}\n {...otherProps}\n />\n );\n};\n\nGoogleMapsFactory.propTypes = {\n parent: PropTypes.object,\n entityGroups: PropTypes.array\n};\n\nGoogleMapsFactory.defaultProps = {\n parent: {},\n entityGroups: []\n};\n\nexport default GoogleMapsFactory;\n"],"mappings":";;;;;;;;;;;;AAAA,IAAAA,MAAA,GAAAC,sBAAA,CAAAC,OAAA;AACA,IAAAC,UAAA,GAAAF,sBAAA,CAAAC,OAAA;AACA,IAAAE,iBAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AACA,IAAAI,iBAAA,GAAAL,sBAAA,CAAAC,OAAA;AACA,IAAAK,eAAA,GAAAN,sBAAA,CAAAC,OAAA;AAA8C,IAAAM,SAAA;AAE9C,IAAMC,iBAAiB,GAAG,SAApBA,iBAAiBA,CAAAC,IAAA,EAAgD;EAAA,IAA1CC,YAAY,GAAAD,IAAA,CAAZC,YAAY;IAAEC,MAAM,GAAAF,IAAA,CAANE,MAAM;IAAKC,UAAU,OAAAC,yBAAA,aAAAJ,IAAA,EAAAF,SAAA;EAC9D,IAAAO,qBAAA,GAAiC,IAAAC,0CAAwB,EACvDL,YAAY,CAACM,GAAG,CAAC,UAAAC,KAAA;MAAA,IAAGC,MAAM,GAAAD,KAAA,CAANC,MAAM;MAAA,OAAOA,MAAM;IAAA,EACzC,CAAC;IAFOC,IAAI,GAAAL,qBAAA,CAAJK,IAAI;IAAEC,OAAO,GAAAN,qBAAA,CAAPM,OAAO;IAAEC,KAAK,GAAAP,qBAAA,CAALO,KAAK;EAI5B,IAAID,OAAO,EAAE,oBAAOrB,MAAA,YAAAuB,aAAA,CAAChB,eAAA,WAAc,MAAE,CAAC;EACtC,IAAIe,KAAK,EAAE,OAAOA,KAAK,CAACE,OAAO;EAE/B,IAAMC,YAAY,GAAG,IAAAC,0BAAiB,EAACN,IAAI,EAAET,YAAY,EAAEC,MAAM,CAAC;EAElE,oBACEZ,MAAA,YAAAuB,aAAA,CAACjB,iBAAA,WAAgB,MAAAqB,SAAA;IACfF,YAAY,EAAEA,YAAa;IAC3Bd,YAAY,EAAEA,YAAa;IAC3BC,MAAM,EAAEA;EAAO,GACXC,UAAU,CACf,CAAC;AAEN,CAAC;AAEDJ,iBAAiB,CAACmB,SAAS,GAAG;EAC5BhB,MAAM,EAAEiB,qBAAS,CAACC,MAAM;EACxBnB,YAAY,EAAEkB,qBAAS,CAACE;AAC1B,CAAC;AAEDtB,iBAAiB,CAACuB,YAAY,GAAG;EAC/BpB,MAAM,EAAE,CAAC,CAAC;EACVD,YAAY,EAAE;AAChB,CAAC;AAAC,IAAAsB,QAAA,GAAAC,OAAA,cAEazB,iBAAiB","ignoreList":[]}
|
|
@@ -13,6 +13,7 @@ require("core-js/modules/es.array.join.js");
|
|
|
13
13
|
require("core-js/modules/es.array.map.js");
|
|
14
14
|
require("core-js/modules/es.array.slice.js");
|
|
15
15
|
require("core-js/modules/es.date.to-json.js");
|
|
16
|
+
require("core-js/modules/es.object.to-string.js");
|
|
16
17
|
require("core-js/modules/es.string.trim.js");
|
|
17
18
|
var _queries = require("../queries");
|
|
18
19
|
var buildQuery = function buildQuery(entityConfigs) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-query.js","names":["_queries","require","buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","concat","toUpperCase","slice","filterQueryKey","indexOf","push","apply","_toConsumableArray2","props","trim","singleItemQuery","generateFiltersQuery","JSON","stringify","generateIdsQuery","join","query","generateQuery","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';\n\nconst buildQuery = entityConfigs => {\n const entityIds = [];\n const rawQueryStringified = '';\n const queryString = entityConfigs\n .map(entityConfig => {\n const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;\n if (!action) return '';\n const formatedEntity = `${entity[0].toUpperCase()}${entity.slice(1)}`;\n const filterQueryKey =\n action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;\n\n entityIds.push(...ids);\n const props = propsQuery.trim() || 'id';\n const singleItemQuery = filtersObject\n ? generateFiltersQuery(shapeKey, props, JSON.stringify(filtersObject), filterQueryKey)\n : generateIdsQuery(shapeKey, props, action, ids);\n\n return singleItemQuery;\n })\n .join(' ');\n\n return {\n query: queryString ? generateQuery(queryString) : '',\n ids: entityIds,\n rawQueryStringified\n };\n};\n\nexport default buildQuery;\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"build-query.js","names":["_queries","require","buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","concat","toUpperCase","slice","filterQueryKey","indexOf","push","apply","_toConsumableArray2","props","trim","singleItemQuery","generateFiltersQuery","JSON","stringify","generateIdsQuery","join","query","generateQuery","_default","exports"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';\n\nconst buildQuery = entityConfigs => {\n const entityIds = [];\n const rawQueryStringified = '';\n const queryString = entityConfigs\n .map(entityConfig => {\n const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;\n if (!action) return '';\n const formatedEntity = `${entity[0].toUpperCase()}${entity.slice(1)}`;\n const filterQueryKey =\n action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;\n\n entityIds.push(...ids);\n const props = propsQuery.trim() || 'id';\n const singleItemQuery = filtersObject\n ? generateFiltersQuery(shapeKey, props, JSON.stringify(filtersObject), filterQueryKey)\n : generateIdsQuery(shapeKey, props, action, ids);\n\n return singleItemQuery;\n })\n .join(' ');\n\n return {\n query: queryString ? generateQuery(queryString) : '',\n ids: entityIds,\n rawQueryStringified\n };\n};\n\nexport default buildQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAEA,IAAMC,UAAU,GAAG,SAAbA,UAAUA,CAAGC,aAAa,EAAI;EAClC,IAAMC,SAAS,GAAG,EAAE;EACpB,IAAMC,mBAAmB,GAAG,EAAE;EAC9B,IAAMC,WAAW,GAAGH,aAAa,CAC9BI,GAAG,CAAC,UAAAC,YAAY,EAAI;IACnB,IAAQC,MAAM,GAAuDD,YAAY,CAAzEC,MAAM;MAAEC,GAAG,GAAkDF,YAAY,CAAjEE,GAAG;MAAEC,MAAM,GAA0CH,YAAY,CAA5DG,MAAM;MAAEC,UAAU,GAA8BJ,YAAY,CAApDI,UAAU;MAAEC,QAAQ,GAAoBL,YAAY,CAAxCK,QAAQ;MAAEC,aAAa,GAAKN,YAAY,CAA9BM,aAAa;IAChE,IAAI,CAACL,MAAM,EAAE,OAAO,EAAE;IACtB,IAAMM,cAAc,MAAAC,MAAA,CAAML,MAAM,CAAC,CAAC,CAAC,CAACM,WAAW,CAAC,CAAC,EAAAD,MAAA,CAAGL,MAAM,CAACO,KAAK,CAAC,CAAC,CAAC,CAAE;IACrE,IAAMC,cAAc,GAClBV,MAAM,CAACW,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,eAAAJ,MAAA,CAAeD,cAAc,IAAKA,cAAc;IAEpFX,SAAS,CAACiB,IAAI,CAAAC,KAAA,CAAdlB,SAAS,MAAAmB,mBAAA,aAASb,GAAG,EAAC;IACtB,IAAMc,KAAK,GAAGZ,UAAU,CAACa,IAAI,CAAC,CAAC,IAAI,IAAI;IACvC,IAAMC,eAAe,GAAGZ,aAAa,GACjC,IAAAa,6BAAoB,EAACd,QAAQ,EAAEW,KAAK,EAAEI,IAAI,CAACC,SAAS,CAACf,aAAa,CAAC,EAAEK,cAAc,CAAC,GACpF,IAAAW,yBAAgB,EAACjB,QAAQ,EAAEW,KAAK,EAAEf,MAAM,EAAEC,GAAG,CAAC;IAElD,OAAOgB,eAAe;EACxB,CAAC,CAAC,CACDK,IAAI,CAAC,GAAG,CAAC;EAEZ,OAAO;IACLC,KAAK,EAAE1B,WAAW,GAAG,IAAA2B,sBAAa,EAAC3B,WAAW,CAAC,GAAG,EAAE;IACpDI,GAAG,EAAEN,SAAS;IACdC,mBAAmB,EAAnBA;EACF,CAAC;AACH,CAAC;AAAC,IAAA6B,QAAA,GAAAC,OAAA,cAEajC,UAAU","ignoreList":[]}
|
package/lib/index.js
CHANGED
|
@@ -19,8 +19,7 @@ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/
|
|
|
19
19
|
var _dynamic = _interopRequireDefault(require("next/dynamic"));
|
|
20
20
|
var _package = _interopRequireDefault(require("../package.json"));
|
|
21
21
|
var _constants = require("./constants");
|
|
22
|
-
function
|
|
23
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2["default"])(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; }
|
|
22
|
+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, "default": e }; if (null === e || "object" != (0, _typeof2["default"])(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t2 in e) "default" !== _t2 && {}.hasOwnProperty.call(e, _t2) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t2)) && (i.get || i.set) ? o(f, _t2, i) : f[_t2] = e[_t2]); return f; })(e, t); }
|
|
24
23
|
function load(_x) {
|
|
25
24
|
return _load.apply(this, arguments);
|
|
26
25
|
}
|
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__","_typeof2","has","get","set","_t2","hasOwnProperty","call","Object","defineProperty","getOwnPropertyDescriptor","load","_x","_load","apply","arguments","_asyncToGenerator2","_regenerator","mark","_callee","app","wrap","_callee$","_context","prev","next","events","once","addComponent","key","component","dynamic","Promise","resolve","then","abrupt","name","PLUGIN_NAME","version","pkg","stop","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: d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C,CAAA;AAAA,SAEZmB,IAAIA,CAAAC,EAAA;EAAA,OAAAC,KAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAAA,SAAAF,MAAA;EAAAA,KAAA,OAAAG,kBAAA,0BAAAC,YAAA,YAAAC,IAAA,CAAnB,SAAAC,QAAoBC,GAAG;IAAA,OAAAH,YAAA,YAAAI,IAAA,UAAAC,SAAAC,QAAA;MAAA,kBAAAA,QAAA,CAAAC,IAAA,GAAAD,QAAA,CAAAE,IAAA;QAAA;UACpCL,GAAG,CAACM,MAAM,CAACC,IAAI,CAAC,oCAAoC,EAAE,UAAAC,YAAY,EAAI;YACpEA,YAAY,CAAC;cACXC,GAAG,EAAE,YAAY;cACjBC,SAAS,EAAE,IAAAC,mBAAO,EAAC;gBAAA,OAAAC,OAAA,CAAAC,OAAA,GAAAC,IAAA;kBAAA,OAAA5C,uBAAA,CAAAH,OAAA,CAAa,2CAA4C,cAAc;gBAAA;cAAA,CAAC;YAC7F,CAAC,CAAC;UACJ,CAAC,CAAC;UAAC,OAAAoC,QAAA,CAAAY,MAAA,WAEI;YACLC,IAAI,EAAEC,sBAAW;YACjBC,OAAO,EAAEC,mBAAG,CAACD;UACf,CAAC;QAAA;QAAA;UAAA,OAAAf,QAAA,CAAAiB,IAAA;MAAA;IAAA,GAAArB,OAAA;EAAA,CACF;EAAA,OAAAN,KAAA,CAAAC,KAAA,OAAAC,SAAA;AAAA;AAEDJ,IAAI,CAAC8B,UAAU,GAAGJ,sBAAW","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blaze-cms/plugin-google-maps-fe",
|
|
3
|
-
"version": "0.146.0-core-styles.
|
|
3
|
+
"version": "0.146.0-core-styles.52",
|
|
4
4
|
"description": "Blaze Google maps plugin fe",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"module": "lib-es/index.js",
|
|
@@ -28,14 +28,14 @@
|
|
|
28
28
|
"license": "GPL-3.0",
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@blaze-cms/nextjs-components": "0.146.0-core-styles.42",
|
|
31
|
-
"@blaze-cms/react-page-builder": "0.146.0-core-styles.
|
|
31
|
+
"@blaze-cms/react-page-builder": "0.146.0-core-styles.52",
|
|
32
32
|
"@blaze-cms/setup-ui": "0.145.1-core-styles.0",
|
|
33
33
|
"core-js": "^3.2.1",
|
|
34
34
|
"lodash.isnumber": "^3.0.3",
|
|
35
35
|
"regenerator-runtime": "^0.13.3"
|
|
36
36
|
},
|
|
37
37
|
"devDependencies": {
|
|
38
|
-
"@blaze-cms/core-ui": "0.146.0-core-styles.
|
|
38
|
+
"@blaze-cms/core-ui": "0.146.0-core-styles.52"
|
|
39
39
|
},
|
|
40
40
|
"peerDependencies": {
|
|
41
41
|
"next": "12.x"
|
|
@@ -44,5 +44,5 @@
|
|
|
44
44
|
"lib/*",
|
|
45
45
|
"lib-es/*"
|
|
46
46
|
],
|
|
47
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "b3ac6c631d3363ef099165ca1a055d2a09b3705b"
|
|
48
48
|
}
|