@blaze-cms/plugin-google-maps-fe 0.125.0-alpha.7 → 0.125.0-auth-updates.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.
Files changed (86) hide show
  1. package/CHANGELOG.md +1 -17
  2. package/lib/GoogleMaps/GoogleMaps.js +24 -71
  3. package/lib/GoogleMaps/GoogleMaps.js.map +1 -1
  4. package/lib/GoogleMaps/GoogleMapsFactory.js +8 -24
  5. package/lib/GoogleMaps/GoogleMapsFactory.js.map +1 -1
  6. package/lib/GoogleMaps/GoogleMapsHtml.js +0 -6
  7. package/lib/GoogleMaps/GoogleMapsHtml.js.map +1 -1
  8. package/lib/GoogleMaps/GoogleMapsRender.js +12 -33
  9. package/lib/GoogleMaps/GoogleMapsRender.js.map +1 -1
  10. package/lib/GoogleMaps/helpers/add-zoom-listener.js +0 -6
  11. package/lib/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
  12. package/lib/GoogleMaps/helpers/build-map-shapes.js +7 -33
  13. package/lib/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
  14. package/lib/GoogleMaps/helpers/build-map-type-ids.js +0 -4
  15. package/lib/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
  16. package/lib/GoogleMaps/helpers/build-query.js +5 -17
  17. package/lib/GoogleMaps/helpers/build-query.js.map +1 -1
  18. package/lib/GoogleMaps/helpers/build-shapes-configs.js +25 -70
  19. package/lib/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
  20. package/lib/GoogleMaps/helpers/get-center-coordinates.js +2 -11
  21. package/lib/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
  22. package/lib/GoogleMaps/helpers/get-image-ids.js +1 -13
  23. package/lib/GoogleMaps/helpers/get-image-ids.js.map +1 -1
  24. package/lib/GoogleMaps/helpers/get-path.js +1 -6
  25. package/lib/GoogleMaps/helpers/get-path.js.map +1 -1
  26. package/lib/GoogleMaps/helpers/index.js +0 -9
  27. package/lib/GoogleMaps/helpers/index.js.map +1 -1
  28. package/lib/GoogleMaps/helpers/set-map-options.js +21 -33
  29. package/lib/GoogleMaps/helpers/set-map-options.js.map +1 -1
  30. package/lib/GoogleMaps/helpers/set-shapes.js +30 -112
  31. package/lib/GoogleMaps/helpers/set-shapes.js.map +1 -1
  32. package/lib/GoogleMaps/hooks/index.js +0 -4
  33. package/lib/GoogleMaps/hooks/index.js.map +1 -1
  34. package/lib/GoogleMaps/hooks/use-get-entity-schemas.js +8 -19
  35. package/lib/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
  36. package/lib/GoogleMaps/hooks/use-get-images.js +12 -19
  37. package/lib/GoogleMaps/hooks/use-get-images.js.map +1 -1
  38. package/lib/GoogleMaps/index.js +0 -4
  39. package/lib/GoogleMaps/index.js.map +1 -1
  40. package/lib/GoogleMaps/queries.js +0 -17
  41. package/lib/GoogleMaps/queries.js.map +1 -1
  42. package/lib/constants.js +0 -1
  43. package/lib/constants.js.map +1 -1
  44. package/lib/index.js +1 -22
  45. package/lib/index.js.map +1 -1
  46. package/lib-es/GoogleMaps/GoogleMaps.js +14 -25
  47. package/lib-es/GoogleMaps/GoogleMaps.js.map +1 -1
  48. package/lib-es/GoogleMaps/GoogleMapsFactory.js +4 -7
  49. package/lib-es/GoogleMaps/GoogleMapsFactory.js.map +1 -1
  50. package/lib-es/GoogleMaps/GoogleMapsHtml.js +0 -2
  51. package/lib-es/GoogleMaps/GoogleMapsHtml.js.map +1 -1
  52. package/lib-es/GoogleMaps/GoogleMapsRender.js +5 -8
  53. package/lib-es/GoogleMaps/GoogleMapsRender.js.map +1 -1
  54. package/lib-es/GoogleMaps/helpers/add-zoom-listener.js +0 -2
  55. package/lib-es/GoogleMaps/helpers/add-zoom-listener.js.map +1 -1
  56. package/lib-es/GoogleMaps/helpers/build-map-shapes.js +0 -8
  57. package/lib-es/GoogleMaps/helpers/build-map-shapes.js.map +1 -1
  58. package/lib-es/GoogleMaps/helpers/build-map-type-ids.js +0 -2
  59. package/lib-es/GoogleMaps/helpers/build-map-type-ids.js.map +1 -1
  60. package/lib-es/GoogleMaps/helpers/build-query.js +0 -2
  61. package/lib-es/GoogleMaps/helpers/build-query.js.map +1 -1
  62. package/lib-es/GoogleMaps/helpers/build-shapes-configs.js +0 -14
  63. package/lib-es/GoogleMaps/helpers/build-shapes-configs.js.map +1 -1
  64. package/lib-es/GoogleMaps/helpers/get-center-coordinates.js +0 -2
  65. package/lib-es/GoogleMaps/helpers/get-center-coordinates.js.map +1 -1
  66. package/lib-es/GoogleMaps/helpers/get-image-ids.js +0 -1
  67. package/lib-es/GoogleMaps/helpers/get-image-ids.js.map +1 -1
  68. package/lib-es/GoogleMaps/helpers/get-path.js +0 -1
  69. package/lib-es/GoogleMaps/helpers/get-path.js.map +1 -1
  70. package/lib-es/GoogleMaps/helpers/index.js.map +1 -1
  71. package/lib-es/GoogleMaps/helpers/set-map-options.js +2 -8
  72. package/lib-es/GoogleMaps/helpers/set-map-options.js.map +1 -1
  73. package/lib-es/GoogleMaps/helpers/set-shapes.js +5 -41
  74. package/lib-es/GoogleMaps/helpers/set-shapes.js.map +1 -1
  75. package/lib-es/GoogleMaps/hooks/index.js.map +1 -1
  76. package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js +0 -2
  77. package/lib-es/GoogleMaps/hooks/use-get-entity-schemas.js.map +1 -1
  78. package/lib-es/GoogleMaps/hooks/use-get-images.js +0 -2
  79. package/lib-es/GoogleMaps/hooks/use-get-images.js.map +1 -1
  80. package/lib-es/GoogleMaps/index.js.map +1 -1
  81. package/lib-es/GoogleMaps/queries.js +0 -6
  82. package/lib-es/GoogleMaps/queries.js.map +1 -1
  83. package/lib-es/constants.js.map +1 -1
  84. package/lib-es/index.js +1 -3
  85. package/lib-es/index.js.map +1 -1
  86. package/package.json +4 -4
@@ -1,53 +1,32 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.keys.js");
4
-
5
4
  require("core-js/modules/es.symbol.js");
6
-
7
5
  require("core-js/modules/es.array.filter.js");
8
-
9
6
  require("core-js/modules/es.object.get-own-property-descriptor.js");
10
-
11
7
  require("core-js/modules/es.object.get-own-property-descriptors.js");
12
-
13
8
  require("core-js/modules/es.object.define-properties.js");
14
-
15
9
  require("core-js/modules/es.object.define-property.js");
16
-
17
10
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
18
-
19
11
  Object.defineProperty(exports, "__esModule", {
20
12
  value: true
21
13
  });
22
14
  exports["default"] = void 0;
23
-
24
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
25
-
26
- require("core-js/modules/es.regexp.exec.js");
27
-
28
- require("core-js/modules/es.string.split.js");
29
-
30
16
  require("core-js/modules/es.array.for-each.js");
31
-
32
17
  require("core-js/modules/es.object.to-string.js");
33
-
34
18
  require("core-js/modules/web.dom-collections.for-each.js");
35
-
36
19
  require("core-js/modules/es.array.is-array.js");
37
-
38
20
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
39
-
40
21
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
41
-
42
22
  var getLatLonValues = function getLatLonValues(keys, data) {
43
23
  if (keys.length === 1) return data[keys];
44
24
  var key = keys.shift();
45
25
  return getLatLonValues(keys, data[key]);
46
26
  };
47
-
48
27
  var getLatLong = function getLatLong(latProp, lonProp, shape, data) {
49
28
  var latitude = shape.latitude,
50
- longitude = shape.longitude;
29
+ longitude = shape.longitude;
51
30
  if (!latProp || !lonProp) return {
52
31
  latitude: latitude,
53
32
  longitude: longitude
@@ -61,27 +40,24 @@ var getLatLong = function getLatLong(latProp, lonProp, shape, data) {
61
40
  longitude: lon
62
41
  };
63
42
  };
64
-
65
43
  var buildMapShapes = function buildMapShapes(shapesOptions, shapesData) {
66
44
  if (!shapesData) return [];
67
45
  var mapShapes = [];
68
46
  shapesOptions.forEach(function (shape) {
69
47
  var shapeKey = shape.shapeKey,
70
- entityOptions = shape.entityOptions,
71
- shapeOptions = shape.shapeOptions;
48
+ entityOptions = shape.entityOptions,
49
+ shapeOptions = shape.shapeOptions;
72
50
  var dataSummaries = entityOptions.dataSummaries,
73
- enableInfoPane = entityOptions.enableInfoPane;
51
+ enableInfoPane = entityOptions.enableInfoPane;
74
52
  var shapeData = Array.isArray(shapesData[shapeKey]) ? shapesData[shapeKey] : shapesData[shapeKey].results;
75
53
  if (!shapeData) return;
76
54
  var latProp = entityOptions.latProp,
77
- lonProp = entityOptions.lonProp;
55
+ lonProp = entityOptions.lonProp;
78
56
  shapeData.forEach(function (data) {
79
57
  var url = data.url;
80
-
81
58
  var _getLatLong = getLatLong(latProp, lonProp, shapeOptions, data),
82
- latitude = _getLatLong.latitude,
83
- longitude = _getLatLong.longitude;
84
-
59
+ latitude = _getLatLong.latitude,
60
+ longitude = _getLatLong.longitude;
85
61
  var formatedShape = _objectSpread(_objectSpread({}, shapeOptions), {}, {
86
62
  latitude: latitude,
87
63
  longitude: longitude,
@@ -90,13 +66,11 @@ var buildMapShapes = function buildMapShapes(shapesOptions, shapesData) {
90
66
  url: url,
91
67
  shapeData: data
92
68
  });
93
-
94
69
  mapShapes.push(formatedShape);
95
70
  });
96
71
  });
97
72
  return mapShapes;
98
73
  };
99
-
100
74
  var _default = buildMapShapes;
101
75
  exports["default"] = _default;
102
76
  //# sourceMappingURL=build-map-shapes.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-map-shapes.js","names":["getLatLonValues","keys","data","length","key","shift","getLatLong","latProp","lonProp","shape","latitude","longitude","latKeys","split","lonKeys","lat","lon","buildMapShapes","shapesOptions","shapesData","mapShapes","forEach","shapeKey","entityOptions","shapeOptions","dataSummaries","enableInfoPane","shapeData","Array","isArray","results","url","formatedShape","push"],"sources":["../../../src/GoogleMaps/helpers/build-map-shapes.js"],"sourcesContent":["const getLatLonValues = (keys, data) => {\n if (keys.length === 1) return data[keys];\n const key = keys.shift();\n return getLatLonValues(keys, data[key]);\n};\n\nconst getLatLong = (latProp, lonProp, shape, data) => {\n const { latitude, longitude } = shape;\n\n if (!latProp || !lonProp) return { latitude, longitude };\n const latKeys = latProp.split('.');\n const lonKeys = lonProp.split('.');\n const lat = getLatLonValues(latKeys, data);\n const lon = getLatLonValues(lonKeys, data);\n\n return { latitude: lat, longitude: lon };\n};\n\nconst buildMapShapes = (shapesOptions, shapesData) => {\n if (!shapesData) return [];\n const mapShapes = [];\n shapesOptions.forEach(shape => {\n const { shapeKey, entityOptions, shapeOptions } = shape;\n const { dataSummaries, enableInfoPane } = entityOptions;\n\n const shapeData = Array.isArray(shapesData[shapeKey])\n ? shapesData[shapeKey]\n : shapesData[shapeKey].results;\n if (!shapeData) return;\n const { latProp, lonProp } = entityOptions;\n\n shapeData.forEach(data => {\n const { url } = data;\n const { latitude, longitude } = getLatLong(latProp, lonProp, shapeOptions, data);\n\n const formatedShape = {\n ...shapeOptions,\n latitude,\n longitude,\n dataSummaries,\n enableInfoPane,\n url,\n shapeData: data\n };\n\n mapShapes.push(formatedShape);\n });\n });\n\n return mapShapes;\n};\n\nexport default buildMapShapes;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,IAAD,EAAOC,IAAP,EAAgB;EACtC,IAAID,IAAI,CAACE,MAAL,KAAgB,CAApB,EAAuB,OAAOD,IAAI,CAACD,IAAD,CA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A0CH,aAA1C,CAAuBG,cAAvB;IAEA,IAAMC,SAAS,GAAGC,KAAK,CAACC,OAAN,CAAcV,UAAU,CAACG,QAAD,CAAxB,IACdH,UAAU,CAACG,QAAD,CADI,GAEdH,UAAU,CAACG,QAAD,CAAV,CAAqBQ,OAFzB;IAGA,IAAI,CAACH,SAAL,EAAgB;IAChB,IAAQpB,OAAR,GAA6BgB,aAA7B,CAAQhB,OAAR;IAAA,IAAiBC,OAAjB,GAA6Be,aAA7B,CAAiBf,OAAjB;IAEAmB,SAAS,CAACN,OAAV,CAAkB,UAAAnB,IAAI,EAAI;MACxB,IAAQ6B,GAAR,GAAgB7B,IAAhB,CAAQ6B,GAAR;;MACA,kBAAgCzB,UAAU,CAACC,OAAD,EAAUC,OAAV,EAAmBgB,YAAnB,EAAiCtB,IAAjC,CAA1C;MAAA,IAAQQ,QAAR,eAAQA,QAAR;MAAA,IAAkBC,SAAlB,eAAkBA,SAAlB;;MAEA,IAAMqB,aAAa,mCACdR,YADc;QAEjBd,QAAQ,EAARA,QAFiB;QAGjBC,SAAS,EAATA,SAHiB;QAIjBc,aAAa,EAAbA,aAJiB;QAKjBC,cAAc,EAAdA,cALiB;QAMjBK,GAAG,EAAHA,GANiB;QAOjBJ,SAAS,EAAEzB;MAPM,EAAnB;;MAUAkB,SAAS,CAACa,IAAV,CAAeD,aAAf;IACD,CAfD;EAgBD,CA1BD;EA4BA,OAAOZ,SAAP;AACD,CAhCD;;eAkCeH,c"}
1
+ {"version":3,"file":"build-map-shapes.js","names":["getLatLonValues","keys","data","length","key","shift","getLatLong","latProp","lonProp","shape","latitude","longitude","latKeys","split","lonKeys","lat","lon","buildMapShapes","shapesOptions","shapesData","mapShapes","forEach","shapeKey","entityOptions","shapeOptions","dataSummaries","enableInfoPane","shapeData","Array","isArray","results","url","formatedShape","push"],"sources":["../../../src/GoogleMaps/helpers/build-map-shapes.js"],"sourcesContent":["const getLatLonValues = (keys, data) => {\n if (keys.length === 1) return data[keys];\n const key = keys.shift();\n return getLatLonValues(keys, data[key]);\n};\n\nconst getLatLong = (latProp, lonProp, shape, data) => {\n const { latitude, longitude } = shape;\n\n if (!latProp || !lonProp) return { latitude, longitude };\n const latKeys = latProp.split('.');\n const lonKeys = lonProp.split('.');\n const lat = getLatLonValues(latKeys, data);\n const lon = getLatLonValues(lonKeys, data);\n\n return { latitude: lat, longitude: lon };\n};\n\nconst buildMapShapes = (shapesOptions, shapesData) => {\n if (!shapesData) return [];\n const mapShapes = [];\n shapesOptions.forEach(shape => {\n const { shapeKey, entityOptions, shapeOptions } = shape;\n const { dataSummaries, enableInfoPane } = entityOptions;\n\n const shapeData = Array.isArray(shapesData[shapeKey])\n ? shapesData[shapeKey]\n : shapesData[shapeKey].results;\n if (!shapeData) return;\n const { latProp, lonProp } = entityOptions;\n\n shapeData.forEach(data => {\n const { url } = data;\n const { latitude, longitude } = getLatLong(latProp, lonProp, shapeOptions, data);\n\n const formatedShape = {\n ...shapeOptions,\n latitude,\n longitude,\n dataSummaries,\n enableInfoPane,\n url,\n shapeData: data\n };\n\n mapShapes.push(formatedShape);\n });\n });\n\n return mapShapes;\n};\n\nexport default buildMapShapes;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,IAAI,EAAEC,IAAI,EAAK;EACtC,IAAID,IAAI,CAACE,MAAM,KAAK,CAAC,EAAE,OAAOD,IAAI,CAACD,IAAI,CAAC;EACxC,IAAMG,GAAG,GAAGH,IAAI,CAACI,KAAK,EAAE;EACxB,OAAOL,eAAe,CAACC,IAAI,EAAEC,IAAI,CAACE,GAAG,CAAC,CAAC;AACzC,CAAC;AAED,IAAME,UAAU,GAAG,SAAbA,UAAU,CAAIC,OAAO,EAAEC,OAAO,EAAEC,KAAK,EAAEP,IAAI,EAAK;EACpD,IAAQQ,QAAQ,GAAgBD,KAAK,CAA7BC,QAAQ;IAAEC,SAAS,GAAKF,KAAK,CAAnBE,SAAS;EAE3B,I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K7B,IAAI,CAAZ6B,GAAG;MACX,kBAAgCzB,UAAU,CAACC,OAAO,EAAEC,OAAO,EAAEgB,YAAY,EAAEtB,IAAI,CAAC;QAAxEQ,QAAQ,eAARA,QAAQ;QAAEC,SAAS,eAATA,SAAS;MAE3B,IAAMqB,aAAa,mCACdR,YAAY;QACfd,QAAQ,EAARA,QAAQ;QACRC,SAAS,EAATA,SAAS;QACTc,aAAa,EAAbA,aAAa;QACbC,cAAc,EAAdA,cAAc;QACdK,GAAG,EAAHA,GAAG;QACHJ,SAAS,EAAEzB;MAAI,EAChB;MAEDkB,SAAS,CAACa,IAAI,CAACD,aAAa,CAAC;IAC/B,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOZ,SAAS;AAClB,CAAC;AAAC,eAEaH,cAAc;AAAA"}
@@ -1,21 +1,17 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.define-property.js");
4
-
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
7
  exports["default"] = void 0;
9
-
10
8
  var _constants = require("../../constants");
11
-
12
9
  var buildMapTypeIds = function buildMapTypeIds(enableSatelliteView, enableTerrainScreen) {
13
10
  var mapTypeIds = [_constants.ROADMAP];
14
11
  if (enableSatelliteView) mapTypeIds.push(_constants.SATELLITE);
15
12
  if (enableTerrainScreen) mapTypeIds.push(_constants.TERRAIN);
16
13
  return mapTypeIds;
17
14
  };
18
-
19
15
  var _default = buildMapTypeIds;
20
16
  exports["default"] = _default;
21
17
  //# sourceMappingURL=build-map-type-ids.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-map-type-ids.js","names":["buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","ROADMAP","push","SATELLITE","TERRAIN"],"sources":["../../../src/GoogleMaps/helpers/build-map-type-ids.js"],"sourcesContent":["import { ROADMAP, SATELLITE, TERRAIN } from '../../constants';\n\nconst buildMapTypeIds = (enableSatelliteView, enableTerrainScreen) => {\n const mapTypeIds = [ROADMAP];\n if (enableSatelliteView) mapTypeIds.push(SATELLITE);\n if (enableTerrainScreen) mapTypeIds.push(TERRAIN);\n return mapTypeIds;\n};\n\nexport default buildMapTypeIds;\n"],"mappings":";;;;;;;;;AAAA;;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAkB,CAACC,mBAAD,EAAsBC,mBAAtB,EAA8C;EACpE,IAAMC,UAAU,GAAG,CAACC,kBAAD,CAAnB;EACA,IAAIH,mBAAJ,EAAyBE,UAAU,CAACE,IAAX,CAAgBC,oBAAhB;EACzB,IAAIJ,mBAAJ,EAAyBC,UAAU,CAACE,IAAX,CAAgBE,kBAAhB;EACzB,OAAOJ,UAAP;AACD,CALD;;eAOeH,e"}
1
+ {"version":3,"file":"build-map-type-ids.js","names":["buildMapTypeIds","enableSatelliteView","enableTerrainScreen","mapTypeIds","ROADMAP","push","SATELLITE","TERRAIN"],"sources":["../../../src/GoogleMaps/helpers/build-map-type-ids.js"],"sourcesContent":["import { ROADMAP, SATELLITE, TERRAIN } from '../../constants';\n\nconst buildMapTypeIds = (enableSatelliteView, enableTerrainScreen) => {\n const mapTypeIds = [ROADMAP];\n if (enableSatelliteView) mapTypeIds.push(SATELLITE);\n if (enableTerrainScreen) mapTypeIds.push(TERRAIN);\n return mapTypeIds;\n};\n\nexport default buildMapTypeIds;\n"],"mappings":";;;;;;;AAAA;AAEA,IAAMA,eAAe,GAAG,SAAlBA,eAAe,CAAIC,mBAAmB,EAAEC,mBAAmB,EAAK;EACpE,IAAMC,UAAU,GAAG,CAACC,kBAAO,CAAC;EAC5B,IAAIH,mBAAmB,EAAEE,UAAU,CAACE,IAAI,CAACC,oBAAS,CAAC;EACnD,IAAIJ,mBAAmB,EAAEC,UAAU,CAACE,IAAI,CAACE,kBAAO,CAAC;EACjD,OAAOJ,UAAU;AACnB,CAAC;AAAC,eAEaH,eAAe;AAAA"}
@@ -1,40 +1,29 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.define-property.js");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports["default"] = void 0;
11
-
12
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
10
  require("core-js/modules/es.array.join.js");
15
-
16
11
  require("core-js/modules/es.array.map.js");
17
-
18
12
  require("core-js/modules/es.array.concat.js");
19
-
20
13
  require("core-js/modules/es.array.slice.js");
21
-
22
14
  require("core-js/modules/es.array.index-of.js");
23
-
24
15
  require("core-js/modules/es.string.trim.js");
25
-
26
16
  var _queries = require("../queries");
27
-
28
17
  var buildQuery = function buildQuery(entityConfigs) {
29
18
  var entityIds = [];
30
19
  var rawQueryStringified = '';
31
20
  var queryString = entityConfigs.map(function (entityConfig) {
32
21
  var action = entityConfig.action,
33
- ids = entityConfig.ids,
34
- entity = entityConfig.entity,
35
- propsQuery = entityConfig.propsQuery,
36
- shapeKey = entityConfig.shapeKey,
37
- filtersObject = entityConfig.filtersObject;
22
+ ids = entityConfig.ids,
23
+ entity = entityConfig.entity,
24
+ propsQuery = entityConfig.propsQuery,
25
+ shapeKey = entityConfig.shapeKey,
26
+ filtersObject = entityConfig.filtersObject;
38
27
  if (!action) return '';
39
28
  var formatedEntity = "".concat(entity[0].toUpperCase()).concat(entity.slice(1));
40
29
  var filterQueryKey = action.indexOf('Published') !== -1 ? "Published".concat(formatedEntity) : formatedEntity;
@@ -49,7 +38,6 @@ var buildQuery = function buildQuery(entityConfigs) {
49
38
  rawQueryStringified: rawQueryStringified
50
39
  };
51
40
  };
52
-
53
41
  var _default = buildQuery;
54
42
  exports["default"] = _default;
55
43
  //# sourceMappingURL=build-query.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-query.js","names":["buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","toUpperCase","slice","filterQueryKey","indexOf","push","props","trim","singleItemQuery","generateFiltersQuery","JSON","stringify","generateIdsQuery","join","query","generateQuery"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';\n\nconst buildQuery = entityConfigs => {\n const entityIds = [];\n const rawQueryStringified = '';\n const queryString = entityConfigs\n .map(entityConfig => {\n const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;\n if (!action) return '';\n const formatedEntity = `${entity[0].toUpperCase()}${entity.slice(1)}`;\n const filterQueryKey =\n action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;\n\n entityIds.push(...ids);\n const props = propsQuery.trim() || 'id';\n const singleItemQuery = filtersObject\n ? generateFiltersQuery(shapeKey, props, JSON.stringify(filtersObject), filterQueryKey)\n : generateIdsQuery(shapeKey, props, action, ids);\n\n return singleItemQuery;\n })\n .join(' ');\n\n return {\n query: queryString ? generateQuery(queryString) : '',\n ids: entityIds,\n rawQueryStringified\n };\n};\n\nexport default buildQuery;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAa,CAAAC,aAAa,EAAI;EAClC,IAAMC,SAAS,GAAG,EAAlB;EACA,IAAMC,mBAAmB,GAAG,EAA5B;EACA,IAAMC,WAAW,GAAGH,aAAa,CAC9BI,GADiB,CACb,UAAAC,YAAY,EAAI;IACnB,IAAQC,MAAR,GAAqED,YAArE,CAAQC,MAAR;IAAA,IAAgBC,GAAhB,GAAqEF,YAArE,CAAgBE,GAAhB;IAAA,IAAqBC,MAArB,GAAqEH,YAArE,CAAqBG,MAArB;IAAA,IAA6BC,UAA7B,GAAqEJ,YAArE,CAA6BI,UAA7B;IAAA,IAAyCC,QAAzC,GAAqEL,YAArE,CAAyCK,QAAzC;IAAA,IAAmDC,aAAnD,GAAqEN,YAArE,CAAmDM,aAAnD;IACA,IAAI,CAACL,MAAL,EAAa,OAAO,EAAP;IACb,IAAMM,cAAc,aAAMJ,MAAM,CAAC,CAAD,CAAN,CAAUK,WAAV,EAAN,SAAgCL,MAAM,CAACM,KAAP,CAAa,CAAb,CAAhC,CAApB;IACA,IAAMC,cAAc,GAClBT,MAAM,CAACU,OAAP,CAAe,WAAf,MAAgC,CAAC,CAAjC,sBAAiDJ,cAAjD,IAAoEA,cADtE;IAGAX,SAAS,CAACgB,IAAV,OAAAhB,SAAS,sCAASM,GAAT,EAAT;IACA,IAAMW,KAAK,GAAGT,UAAU,CAACU,IAAX,MAAqB,IAAnC;IACA,IAAMC,eAAe,GAAGT,aAAa,GACjC,IAAAU,6BAAA,EAAqBX,QAArB,EAA+BQ,KAA/B,EAAsCI,IAAI,CAACC,SAAL,CAAeZ,aAAf,CAAtC,EAAqEI,cAArE,CADiC,GAEjC,IAAAS,yBAAA,EAAiBd,QAAjB,EAA2BQ,KAA3B,EAAkCZ,MAAlC,EAA0CC,GAA1C,CAFJ;IAIA,OAAOa,eAAP;EACD,CAfiB,EAgBjBK,IAhBiB,CAgBZ,GAhBY,CAApB;EAkBA,OAAO;IACLC,KAAK,EAAEvB,WAAW,GAAG,IAAAwB,sBAAA,EAAcxB,WAAd,CAAH,GAAgC,EAD7C;IAELI,GAAG,EAAEN,SAFA;IAGLC,mBAAmB,EAAnBA;EAHK,CAAP;AAKD,CA1BD;;eA4BeH,U"}
1
+ {"version":3,"file":"build-query.js","names":["buildQuery","entityConfigs","entityIds","rawQueryStringified","queryString","map","entityConfig","action","ids","entity","propsQuery","shapeKey","filtersObject","formatedEntity","toUpperCase","slice","filterQueryKey","indexOf","push","props","trim","singleItemQuery","generateFiltersQuery","JSON","stringify","generateIdsQuery","join","query","generateQuery"],"sources":["../../../src/GoogleMaps/helpers/build-query.js"],"sourcesContent":["import { generateQuery, generateIdsQuery, generateFiltersQuery } from '../queries';\n\nconst buildQuery = entityConfigs => {\n const entityIds = [];\n const rawQueryStringified = '';\n const queryString = entityConfigs\n .map(entityConfig => {\n const { action, ids, entity, propsQuery, shapeKey, filtersObject } = entityConfig;\n if (!action) return '';\n const formatedEntity = `${entity[0].toUpperCase()}${entity.slice(1)}`;\n const filterQueryKey =\n action.indexOf('Published') !== -1 ? `Published${formatedEntity}` : formatedEntity;\n\n entityIds.push(...ids);\n const props = propsQuery.trim() || 'id';\n const singleItemQuery = filtersObject\n ? generateFiltersQuery(shapeKey, props, JSON.stringify(filtersObject), filterQueryKey)\n : generateIdsQuery(shapeKey, props, action, ids);\n\n return singleItemQuery;\n })\n .join(' ');\n\n return {\n query: queryString ? generateQuery(queryString) : '',\n ids: entityIds,\n rawQueryStringified\n };\n};\n\nexport default buildQuery;\n"],"mappings":";;;;;;;;;;;;;;;AAAA;AAEA,IAAMA,UAAU,GAAG,SAAbA,UAAU,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,aAAMJ,MAAM,CAAC,CAAC,CAAC,CAACK,WAAW,EAAE,SAAGL,MAAM,CAACM,KAAK,CAAC,CAAC,CAAC,CAAE;IACrE,IAAMC,cAAc,GAClBT,MAAM,CAACU,OAAO,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,sBAAeJ,cAAc,IAAKA,cAAc;IAEpFX,SAAS,CAACgB,IAAI,OAAdhB,SAAS,sCAASM,GAAG,EAAC;IACtB,IAAMW,KAAK,GAAGT,UAAU,CAACU,IAAI,EAAE,IAAI,IAAI;IACvC,IAAMC,eAAe,GAAGT,aAAa,GACjC,IAAAU,6BAAoB,EAACX,QAAQ,EAAEQ,KAAK,EAAEI,IAAI,CAACC,SAAS,CAACZ,aAAa,CAAC,EAAEI,cAAc,CAAC,GACpF,IAAAS,yBAAgB,EAACd,QAAQ,EAAEQ,KAAK,EAAEZ,MAAM,EAAEC,GAAG,CAAC;IAElD,OAAOa,eAAe;EACxB,CAAC,CAAC,CACDK,IAAI,CAAC,GAAG,CAAC;EAEZ,OAAO;IACLC,KAAK,EAAEvB,WAAW,GAAG,IAAAwB,sBAAa,EAACxB,WAAW,CAAC,GAAG,EAAE;IACpDI,GAAG,EAAEN,SAAS;IACdC,mBAAmB,EAAnBA;EACF,CAAC;AACH,CAAC;AAAC,eAEaH,UAAU;AAAA"}
@@ -1,89 +1,55 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.symbol.js");
4
-
5
4
  require("core-js/modules/es.object.get-own-property-descriptor.js");
6
-
7
5
  require("core-js/modules/es.object.get-own-property-descriptors.js");
8
-
9
6
  require("core-js/modules/es.object.define-properties.js");
10
-
11
7
  require("core-js/modules/es.object.define-property.js");
12
-
13
8
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
14
-
15
9
  Object.defineProperty(exports, "__esModule", {
16
10
  value: true
17
11
  });
18
12
  exports["default"] = void 0;
19
-
20
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
21
-
22
14
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
23
-
24
15
  require("core-js/modules/es.string.trim.js");
25
-
26
16
  require("core-js/modules/es.array.reduce.js");
27
-
28
17
  require("core-js/modules/es.object.to-string.js");
29
-
30
18
  require("core-js/modules/es.array.includes.js");
31
-
32
19
  require("core-js/modules/es.string.includes.js");
33
-
34
- require("core-js/modules/es.regexp.exec.js");
35
-
36
- require("core-js/modules/es.string.split.js");
37
-
38
20
  require("core-js/modules/es.array.concat.js");
39
-
40
21
  require("core-js/modules/es.array.filter.js");
41
-
42
22
  require("core-js/modules/es.object.keys.js");
43
-
44
23
  require("core-js/modules/es.array.map.js");
45
-
46
24
  require("core-js/modules/es.array.find.js");
47
-
48
25
  require("core-js/modules/es.array.for-each.js");
49
-
50
26
  require("core-js/modules/web.dom-collections.for-each.js");
51
-
52
27
  var _lodash = _interopRequireDefault(require("lodash.flatten"));
53
-
54
28
  var _constants = require("../../constants");
55
-
56
29
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
57
-
58
30
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2["default"])(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
59
-
60
31
  var getPropValues = function getPropValues(properties) {
61
32
  return properties.reduce(function (acc, property) {
62
33
  if (property.includes('.')) {
63
34
  var _property$split = property.split('.'),
64
- _property$split2 = (0, _slicedToArray2["default"])(_property$split, 2),
65
- relationName = _property$split2[0],
66
- relationProp = _property$split2[1];
67
-
35
+ _property$split2 = (0, _slicedToArray2["default"])(_property$split, 2),
36
+ relationName = _property$split2[0],
37
+ relationProp = _property$split2[1];
68
38
  return "".concat(acc, " ").concat(relationName, " { ").concat(relationProp, " }");
69
39
  }
70
-
71
40
  return "".concat(acc, " ").concat(property);
72
41
  }, '').trim();
73
42
  };
74
-
75
43
  var getUpdatedPropsQuery = function getUpdatedPropsQuery(propsQuery, entityData) {
76
44
  var _entityData$propertie = entityData.properties,
77
- properties = _entityData$propertie === void 0 ? {} : _entityData$propertie,
78
- _entityData$dynamicPr = entityData.dynamicProperties,
79
- dynamicProperties = _entityData$dynamicPr === void 0 ? {} : _entityData$dynamicPr;
80
-
45
+ properties = _entityData$propertie === void 0 ? {} : _entityData$propertie,
46
+ _entityData$dynamicPr = entityData.dynamicProperties,
47
+ dynamicProperties = _entityData$dynamicPr === void 0 ? {} : _entityData$dynamicPr;
81
48
  var _Object$keys$filter = Object.keys(dynamicProperties).filter(function (prop) {
82
- return prop === _constants.URL;
83
- }),
84
- _Object$keys$filter2 = (0, _slicedToArray2["default"])(_Object$keys$filter, 1),
85
- url = _Object$keys$filter2[0];
86
-
49
+ return prop === _constants.URL;
50
+ }),
51
+ _Object$keys$filter2 = (0, _slicedToArray2["default"])(_Object$keys$filter, 1),
52
+ url = _Object$keys$filter2[0];
87
53
  var hasImage = !!Object.keys(properties).filter(function (prop) {
88
54
  return prop === _constants.IMAGE_ID;
89
55
  }).length;
@@ -91,13 +57,11 @@ var getUpdatedPropsQuery = function getUpdatedPropsQuery(propsQuery, entityData)
91
57
  updatedPropsQuery = url ? "".concat(updatedPropsQuery, " ").concat(_constants.URL) : updatedPropsQuery;
92
58
  return updatedPropsQuery;
93
59
  };
94
-
95
60
  var buildFilterQueryString = function buildFilterQueryString(filter) {
96
61
  var _filter$split = filter.split('/'),
97
- _filter$split2 = (0, _slicedToArray2["default"])(_filter$split, 2),
98
- filterKey = _filter$split2[0],
99
- filterValue = _filter$split2[1];
100
-
62
+ _filter$split2 = (0, _slicedToArray2["default"])(_filter$split, 2),
63
+ filterKey = _filter$split2[0],
64
+ filterValue = _filter$split2[1];
101
65
  var filterKeyword = "".concat(filterKey, ".keyword");
102
66
  return {
103
67
  bool: {
@@ -107,7 +71,6 @@ var buildFilterQueryString = function buildFilterQueryString(filter) {
107
71
  }
108
72
  };
109
73
  };
110
-
111
74
  var buildFilters = function buildFilters(filters) {
112
75
  if (!filters || !filters.length) return null;
113
76
  var filterQueryProps = filters.map(buildFilterQueryString);
@@ -117,16 +80,15 @@ var buildFilters = function buildFilters(filters) {
117
80
  }
118
81
  };
119
82
  };
120
-
121
83
  var buiildShapeProps = function buiildShapeProps(shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) {
122
84
  var _shape$displayItems = shape.displayItems,
123
- displayItems = _shape$displayItems === void 0 ? [] : _shape$displayItems,
124
- filterBy = shape.filterBy;
85
+ displayItems = _shape$displayItems === void 0 ? [] : _shape$displayItems,
86
+ filterBy = shape.filterBy;
125
87
  var latProp = entityGroup.latProp,
126
- lonProp = entityGroup.lonProp,
127
- entity = entityGroup.entity;
88
+ lonProp = entityGroup.lonProp,
89
+ entity = entityGroup.entity;
128
90
  var actions = entityData.actions,
129
- relations = entityData.relations;
91
+ relations = entityData.relations;
130
92
  var action = actions ? actions.getAllPublished || actions.getAll : '';
131
93
  var dataSummaryProps = dataSummaries.reduce(function (acc, _ref) {
132
94
  var propsToDisplay = _ref.propsToDisplay;
@@ -142,11 +104,9 @@ var buiildShapeProps = function buiildShapeProps(shape, shapeKey, dataSummaries,
142
104
  var filtersObject = buildFilters(filterBy);
143
105
  var propsQuery = dataSummaryProps ? "".concat(dataSummaryProps) : '';
144
106
  propsQuery = getUpdatedPropsQuery(propsQuery, entityData);
145
-
146
107
  if (latProp && lonProp) {
147
108
  propsQuery = "".concat(propsQuery, " ").concat(formatProp(latProp, relations), " ").concat(formatProp(lonProp, relations));
148
109
  }
149
-
150
110
  if (ids.length && !propsQuery.includes(_constants.ID)) propsQuery = "".concat(propsQuery.trim(), " ").concat(_constants.ID);
151
111
  return {
152
112
  shapeKey: shapeKey,
@@ -157,33 +117,29 @@ var buiildShapeProps = function buiildShapeProps(shape, shapeKey, dataSummaries,
157
117
  filtersObject: filtersObject
158
118
  };
159
119
  };
160
-
161
120
  var formatProp = function formatProp(prop) {
162
121
  var relations = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
163
122
  if (!prop.includes('.')) return prop;
164
-
165
123
  var _prop$split = prop.split('.'),
166
- _prop$split2 = (0, _slicedToArray2["default"])(_prop$split, 2),
167
- mainProp = _prop$split2[0],
168
- nestedProp = _prop$split2[1];
169
-
124
+ _prop$split2 = (0, _slicedToArray2["default"])(_prop$split, 2),
125
+ mainProp = _prop$split2[0],
126
+ nestedProp = _prop$split2[1];
170
127
  var idProp = relations.find(function (_ref3) {
171
128
  var localField = _ref3.localField;
172
129
  return localField === mainProp;
173
130
  }) ? 'id ' : '';
174
131
  return "".concat(mainProp, "{").concat(idProp).concat(nestedProp, "}");
175
132
  };
176
-
177
133
  var buildShapesConfig = function buildShapesConfig(schemas, entityGroups, parent) {
178
134
  if (!schemas || !entityGroups) return [];
179
135
  var itemId = parent.itemId,
180
- itemEntity = parent.itemEntity;
136
+ itemEntity = parent.itemEntity;
181
137
  var shapeGroups = [];
182
138
  entityGroups.forEach(function (entityGroup, i) {
183
139
  var entity = entityGroup.entity,
184
- shapes = entityGroup.shapes,
185
- _entityGroup$dataSumm = entityGroup.dataSummaries,
186
- dataSummaries = _entityGroup$dataSumm === void 0 ? [] : _entityGroup$dataSumm;
140
+ shapes = entityGroup.shapes,
141
+ _entityGroup$dataSumm = entityGroup.dataSummaries,
142
+ dataSummaries = _entityGroup$dataSumm === void 0 ? [] : _entityGroup$dataSumm;
187
143
  var parentId = entity === itemEntity && itemId;
188
144
  if (!entity) return null;
189
145
  var entityData = schemas[entity] || {};
@@ -198,7 +154,6 @@ var buildShapesConfig = function buildShapesConfig(schemas, entityGroups, parent
198
154
  });
199
155
  return shapeGroups;
200
156
  };
201
-
202
157
  var _default = buildShapesConfig;
203
158
  exports["default"] = _default;
204
159
  //# sourceMappingURL=build-shapes-configs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"build-shapes-configs.js","names":["getPropValues","properties","reduce","acc","property","includes","split","relationName","relationProp","trim","getUpdatedPropsQuery","propsQuery","entityData","dynamicProperties","Object","keys","filter","prop","URL","url","hasImage","IMAGE_ID","length","updatedPropsQuery","buildFilterQueryString","filterKey","filterValue","filterKeyword","bool","should","match","buildFilters","filters","filterQueryProps","map","buiildShapeProps","shape","shapeKey","dataSummaries","parentId","entityGroup","displayItems","filterBy","latProp","lonProp","entity","actions","relations","action","getAllPublished","getAll","dataSummaryProps","propsToDisplay","propsToDisplayValues","flatten","propertiesToDisplay","propsToDisplayString","ids","push","filtersObject","formatProp","ID","mainProp","nestedProp","idProp","find","localField","buildShapesConfig","schemas","entityGroups","parent","itemId","itemEntity","shapeGroups","forEach","i","shapes","Boolean","shapeIndex","shapeValues","shapeOptions","entityOptions"],"sources":["../../../src/GoogleMaps/helpers/build-shapes-configs.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { IMAGE_ID, URL, ID } from '../../constants';\n\nconst getPropValues = properties =>\n properties\n .reduce((acc, property) => {\n if (property.includes('.')) {\n const [relationName, relationProp] = property.split('.');\n return `${acc} ${relationName} { ${relationProp} }`;\n }\n return `${acc} ${property}`;\n }, '')\n .trim();\n\nconst getUpdatedPropsQuery = (propsQuery, entityData) => {\n const { properties = {}, dynamicProperties = {} } = entityData;\n\n const [url] = Object.keys(dynamicProperties).filter(prop => prop === URL);\n const hasImage = !!Object.keys(properties).filter(prop => prop === IMAGE_ID).length;\n\n let updatedPropsQuery = hasImage ? `${propsQuery} ${IMAGE_ID}` : propsQuery;\n updatedPropsQuery = url ? `${updatedPropsQuery} ${URL}` : updatedPropsQuery;\n\n return updatedPropsQuery;\n};\n\nconst buildFilterQueryString = filter => {\n const [filterKey, filterValue] = filter.split('/');\n const filterKeyword = `${filterKey}.keyword`;\n return { bool: { should: [{ match: { [filterKeyword]: filterValue } }] } };\n};\n\nconst buildFilters = filters => {\n if (!filters || !filters.length) return null;\n const filterQueryProps = filters.map(buildFilterQueryString);\n return { bool: { should: filterQueryProps } };\n};\n\nconst buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {\n const { displayItems = [], filterBy } = shape;\n const { latProp, lonProp, entity } = entityGroup;\n const { actions, relations } = entityData;\n const action = actions ? actions.getAllPublished || actions.getAll : '';\n\n const dataSummaryProps = dataSummaries\n .reduce((acc, { propsToDisplay }) => {\n const propsToDisplayValues = flatten(\n propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay)\n );\n const propsToDisplayString = getPropValues(propsToDisplayValues);\n\n return `${acc} ${propsToDisplayString}`;\n }, '')\n .trim();\n const ids = [];\n displayItems.length ? ids.push(displayItems[0]) : ids.push(parentId);\n\n const filtersObject = buildFilters(filterBy);\n let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';\n propsQuery = getUpdatedPropsQuery(propsQuery, entityData);\n if (latProp && lonProp) {\n propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(\n lonProp,\n relations\n )}`;\n }\n if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;\n\n return {\n shapeKey,\n entity,\n propsQuery,\n ids,\n action,\n filtersObject\n };\n};\n\nconst formatProp = (prop, relations = []) => {\n if (!prop.includes('.')) return prop;\n\n const [mainProp, nestedProp] = prop.split('.');\n const idProp = relations.find(({ localField }) => localField === mainProp) ? 'id ' : '';\n return `${mainProp}{${idProp}${nestedProp}}`;\n};\n\nconst buildShapesConfig = (schemas, entityGroups, parent) => {\n if (!schemas || !entityGroups) return [];\n const { itemId, itemEntity } = parent;\n const shapeGroups = [];\n entityGroups.forEach((entityGroup, i) => {\n const { entity, shapes, dataSummaries = [] } = entityGroup;\n const parentId = entity === itemEntity && itemId;\n if (!entity) return null;\n const entityData = schemas[entity] || {};\n\n shapes.filter(Boolean).forEach((shape, shapeIndex) => {\n const shapeKey = `shape${i}${shapeIndex}`;\n const shapeValues = buiildShapeProps(\n shape,\n shapeKey,\n dataSummaries,\n parentId,\n entityData,\n entityGroup\n );\n shapeGroups.push({ ...shapeValues, shapeOptions: shape, entityOptions: entityGroup });\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AM,KAAK2B,UAAX,IAAyBD,MAA1C;IACA,IAAI,CAAC1B,MAAL,EAAa,OAAO,IAAP;IACb,IAAMjC,UAAU,GAAGwD,OAAO,CAACvB,MAAD,CAAP,IAAmB,EAAtC;IAEA+B,MAAM,CAAC5D,MAAP,CAAc6D,OAAd,EAAuBH,OAAvB,CAA+B,UAACtC,KAAD,EAAQ0C,UAAR,EAAuB;MACpD,IAAMzC,QAAQ,kBAAWsC,CAAX,SAAeG,UAAf,CAAd;MACA,IAAMC,WAAW,GAAG5C,gBAAgB,CAClCC,KADkC,EAElCC,QAFkC,EAGlCC,aAHkC,EAIlCC,QAJkC,EAKlC3B,UALkC,EAMlC4B,WANkC,CAApC;MAQAiC,WAAW,CAACf,IAAZ,iCAAsBqB,WAAtB;QAAmCC,YAAY,EAAE5C,KAAjD;QAAwD6C,aAAa,EAAEzC;MAAvE;IACD,CAXD;EAYD,CAlBD;EAoBA,OAAOiC,WAAP;AACD,CAzBD;;eA2BeN,iB"}
1
+ {"version":3,"file":"build-shapes-configs.js","names":["getPropValues","properties","reduce","acc","property","includes","split","relationName","relationProp","trim","getUpdatedPropsQuery","propsQuery","entityData","dynamicProperties","Object","keys","filter","prop","URL","url","hasImage","IMAGE_ID","length","updatedPropsQuery","buildFilterQueryString","filterKey","filterValue","filterKeyword","bool","should","match","buildFilters","filters","filterQueryProps","map","buiildShapeProps","shape","shapeKey","dataSummaries","parentId","entityGroup","displayItems","filterBy","latProp","lonProp","entity","actions","relations","action","getAllPublished","getAll","dataSummaryProps","propsToDisplay","propsToDisplayValues","flatten","propertiesToDisplay","propsToDisplayString","ids","push","filtersObject","formatProp","ID","mainProp","nestedProp","idProp","find","localField","buildShapesConfig","schemas","entityGroups","parent","itemId","itemEntity","shapeGroups","forEach","i","shapes","Boolean","shapeIndex","shapeValues","shapeOptions","entityOptions"],"sources":["../../../src/GoogleMaps/helpers/build-shapes-configs.js"],"sourcesContent":["import flatten from 'lodash.flatten';\nimport { IMAGE_ID, URL, ID } from '../../constants';\n\nconst getPropValues = properties =>\n properties\n .reduce((acc, property) => {\n if (property.includes('.')) {\n const [relationName, relationProp] = property.split('.');\n return `${acc} ${relationName} { ${relationProp} }`;\n }\n return `${acc} ${property}`;\n }, '')\n .trim();\n\nconst getUpdatedPropsQuery = (propsQuery, entityData) => {\n const { properties = {}, dynamicProperties = {} } = entityData;\n\n const [url] = Object.keys(dynamicProperties).filter(prop => prop === URL);\n const hasImage = !!Object.keys(properties).filter(prop => prop === IMAGE_ID).length;\n\n let updatedPropsQuery = hasImage ? `${propsQuery} ${IMAGE_ID}` : propsQuery;\n updatedPropsQuery = url ? `${updatedPropsQuery} ${URL}` : updatedPropsQuery;\n\n return updatedPropsQuery;\n};\n\nconst buildFilterQueryString = filter => {\n const [filterKey, filterValue] = filter.split('/');\n const filterKeyword = `${filterKey}.keyword`;\n return { bool: { should: [{ match: { [filterKeyword]: filterValue } }] } };\n};\n\nconst buildFilters = filters => {\n if (!filters || !filters.length) return null;\n const filterQueryProps = filters.map(buildFilterQueryString);\n return { bool: { should: filterQueryProps } };\n};\n\nconst buiildShapeProps = (shape, shapeKey, dataSummaries, parentId, entityData, entityGroup) => {\n const { displayItems = [], filterBy } = shape;\n const { latProp, lonProp, entity } = entityGroup;\n const { actions, relations } = entityData;\n const action = actions ? actions.getAllPublished || actions.getAll : '';\n\n const dataSummaryProps = dataSummaries\n .reduce((acc, { propsToDisplay }) => {\n const propsToDisplayValues = flatten(\n propsToDisplay.map(({ propertiesToDisplay }) => propertiesToDisplay)\n );\n const propsToDisplayString = getPropValues(propsToDisplayValues);\n\n return `${acc} ${propsToDisplayString}`;\n }, '')\n .trim();\n const ids = [];\n displayItems.length ? ids.push(displayItems[0]) : ids.push(parentId);\n\n const filtersObject = buildFilters(filterBy);\n let propsQuery = dataSummaryProps ? `${dataSummaryProps}` : '';\n propsQuery = getUpdatedPropsQuery(propsQuery, entityData);\n if (latProp && lonProp) {\n propsQuery = `${propsQuery} ${formatProp(latProp, relations)} ${formatProp(\n lonProp,\n relations\n )}`;\n }\n if (ids.length && !propsQuery.includes(ID)) propsQuery = `${propsQuery.trim()} ${ID}`;\n\n return {\n shapeKey,\n entity,\n propsQuery,\n ids,\n action,\n filtersObject\n };\n};\n\nconst formatProp = (prop, relations = []) => {\n if (!prop.includes('.')) return prop;\n\n const [mainProp, nestedProp] = prop.split('.');\n const idProp = relations.find(({ localField }) => localField === mainProp) ? 'id ' : '';\n return `${mainProp}{${idProp}${nestedProp}}`;\n};\n\nconst buildShapesConfig = (schemas, entityGroups, parent) => {\n if (!schemas || !entityGroups) return [];\n const { itemId, itemEntity } = parent;\n const shapeGroups = [];\n entityGroups.forEach((entityGroup, i) => {\n const { entity, shapes, dataSummaries = [] } = entityGroup;\n const parentId = entity === itemEntity && itemId;\n if (!entity) return null;\n const entityData = schemas[entity] || {};\n\n shapes.filter(Boolean).forEach((shape, shapeIndex) => {\n const shapeKey = `shape${i}${shapeIndex}`;\n const shapeValues = buiildShapeProps(\n shape,\n shapeKey,\n dataSummaries,\n parentId,\n entityData,\n entityGroup\n );\n shapeGroups.push({ ...shapeValues, shapeOptions: shape, entityOptions: entityGroup });\n });\n });\n\n return shapeGroups;\n};\n\nexport default buildShapesConfig;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AACA;AAAoD;AAAA;AAEpD,IAAMA,aAAa,GAAG,SAAhBA,aAAa,CAAGC,UAAU;EAAA,OAC9BA,UAAU,CACPC,MAAM,CAAC,UAACC,GAAG,EAAEC,QAAQ,EAAK;IACzB,IAAIA,QAAQ,CAACC,QAAQ,CAAC,GAAG,CAAC,EAAE;MAC1B,sBAAqCD,QAAQ,CAACE,KAAK,CAAC,GAAG,CAAC;QAAA;QAAjDC,YAAY;QAAEC,YAAY;MACjC,iBAAUL,GAAG,cAAII,YAAY,gBAAMC,YAAY;IACjD;IACA,iBAAUL,GAAG,cAAIC,QAAQ;EAC3B,CAAC,EAAE,EAAE,CAAC,CACLK,IAAI,EAAE;AA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AAO,EAAEC,YAAY,EAAEC,MAAM,EAAK;EAC3D,IAAI,CAACF,OAAO,IAAI,CAACC,YAAY,EAAE,OAAO,EAAE;EACxC,IAAQE,MAAM,GAAiBD,MAAM,CAA7BC,MAAM;IAAEC,UAAU,GAAKF,MAAM,CAArBE,UAAU;EAC1B,IAAMC,WAAW,GAAG,EAAE;EACtBJ,YAAY,CAACK,OAAO,CAAC,UAAClC,WAAW,EAAEmC,CAAC,EAAK;IACvC,IAAQ9B,MAAM,GAAiCL,WAAW,CAAlDK,MAAM;MAAE+B,MAAM,GAAyBpC,WAAW,CAA1CoC,MAAM;MAAA,wBAAyBpC,WAAW,CAAlCF,aAAa;MAAbA,aAAa,sCAAG,EAAE;IAC1C,IAAMC,QAAQ,GAAGM,MAAM,KAAK2B,UAAU,IAAID,MAAM;IAChD,IAAI,CAAC1B,MAAM,EAAE,OAAO,IAAI;IACxB,IAAMjC,UAAU,GAAGwD,OAAO,CAACvB,MAAM,CAAC,IAAI,CAAC,CAAC;IAExC+B,MAAM,CAAC5D,MAAM,CAAC6D,OAAO,CAAC,CAACH,OAAO,CAAC,UAACtC,KAAK,EAAE0C,UAAU,EAAK;MACpD,IAAMzC,QAAQ,kBAAWsC,CAAC,SAAGG,UAAU,CAAE;MACzC,IAAMC,WAAW,GAAG5C,gBAAgB,CAClCC,KAAK,EACLC,QAAQ,EACRC,aAAa,EACbC,QAAQ,EACR3B,UAAU,EACV4B,WAAW,CACZ;MACDiC,WAAW,CAACf,IAAI,iCAAMqB,WAAW;QAAEC,YAAY,EAAE5C,KAAK;QAAE6C,aAAa,EAAEzC;MAAW,GAAG;IACvF,CAAC,CAAC;EACJ,CAAC,CAAC;EAEF,OAAOiC,WAAW;AACpB,CAAC;AAAC,eAEaN,iBAAiB;AAAA"}
@@ -1,28 +1,20 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.define-property.js");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports["default"] = void 0;
11
-
12
9
  require("core-js/modules/es.array.filter.js");
13
-
14
10
  require("core-js/modules/es.object.to-string.js");
15
-
16
11
  require("core-js/modules/es.array.for-each.js");
17
-
18
12
  require("core-js/modules/web.dom-collections.for-each.js");
19
-
20
13
  var _lodash = _interopRequireDefault(require("lodash.isnumber"));
21
-
22
14
  var getCenterCoordinates = function getCenterCoordinates(mapShapes, otherProps) {
23
15
  var centerCoordinates = [];
24
16
  var centerLatitude = otherProps.centerLatitude,
25
- centerLongitude = otherProps.centerLongitude;
17
+ centerLongitude = otherProps.centerLongitude;
26
18
  var useDefaultCenter = centerLatitude !== 0 && centerLongitude !== 0 && (0, _lodash["default"])(centerLatitude) && (0, _lodash["default"])(centerLongitude);
27
19
  if (useDefaultCenter) return [{
28
20
  latitude: centerLatitude,
@@ -35,7 +27,7 @@ var getCenterCoordinates = function getCenterCoordinates(mapShapes, otherProps)
35
27
  var shapesForCenter = useAsCenterShapes.length ? useAsCenterShapes : mapShapes;
36
28
  shapesForCenter.forEach(function (_ref2) {
37
29
  var latitude = _ref2.latitude,
38
- longitude = _ref2.longitude;
30
+ longitude = _ref2.longitude;
39
31
  if ((0, _lodash["default"])(latitude) && (0, _lodash["default"])(longitude)) centerCoordinates.push({
40
32
  latitude: latitude,
41
33
  longitude: longitude
@@ -43,7 +35,6 @@ var getCenterCoordinates = function getCenterCoordinates(mapShapes, otherProps)
43
35
  });
44
36
  return centerCoordinates;
45
37
  };
46
-
47
38
  var _default = getCenterCoordinates;
48
39
  exports["default"] = _default;
49
40
  //# sourceMappingURL=get-center-coordinates.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"get-center-coordinates.js","names":["getCenterCoordinates","mapShapes","otherProps","centerCoordinates","centerLatitude","centerLongitude","useDefaultCenter","isNumber","latitude","longitude","useAsCenterShapes","filter","useAsCenter","shapesForCenter","length","forEach","push"],"sources":["../../../src/GoogleMaps/helpers/get-center-coordinates.js"],"sourcesContent":["import isNumber from 'lodash.isnumber';\n\nconst getCenterCoordinates = (mapShapes, otherProps) => {\n const centerCoordinates = [];\n\n const { centerLatitude, centerLongitude } = otherProps;\n const useDefaultCenter =\n centerLatitude !== 0 &&\n centerLongitude !== 0 &&\n isNumber(centerLatitude) &&\n isNumber(centerLongitude);\n\n if (useDefaultCenter) return [{ latitude: centerLatitude, longitude: centerLongitude }];\n\n const useAsCenterShapes = mapShapes.filter(({ useAsCenter }) => useAsCenter);\n const shapesForCenter = useAsCenterShapes.length ? useAsCenterShapes : mapShapes;\n shapesForCenter.forEach(({ latitude, longitude }) => {\n if (isNumber(latitude) && isNumber(longitude)) centerCoordinates.push({ latitude, longitude });\n });\n\n return centerCoordinates;\n};\n\nexport default getCenterCoordinates;\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAAA;;AAEA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAuB,CAACC,SAAD,EAAYC,UAAZ,EAA2B;EACtD,IAAMC,iBAAiB,GAAG,EAA1B;EAEA,IAAQC,cAAR,GAA4CF,UAA5C,CAAQE,cAAR;EAAA,IAAwBC,eAAxB,GAA4CH,UAA5C,CAAwBG,eAAxB;EACA,IAAMC,gBAAgB,GACpBF,cAAc,KAAK,CAAnB,IACAC,eAAe,KAAK,CADpB,IAEA,IAAAE,kBAAA,EAASH,cAAT,CAFA,IAGA,IAAAG,kBAAA,EAASF,eAAT,CAJF;EAMA,IAAIC,gBAAJ,EAAsB,OAAO,CAAC;IAAEE,QAAQ,EAAEJ,cAAZ;IAA4BK,SAAS,EAAEJ;EAAvC,CAAD,CAAP;EAEtB,IAAMK,iBAAiB,GAAGT,SAAS,CAACU,MAAV,CAAiB;IAAA,IAAGC,WAAH,QAAGA,WAAH;IAAA,OAAqBA,WAArB;EAAA,CAAjB,CAA1B;EACA,IAAMC,eAAe,GAAGH,iBAAiB,CAACI,MAAlB,GAA2BJ,iBAA3B,GAA+CT,SAAvE;EACAY,eAAe,CAACE,OAAhB,CAAwB,iBAA6B;IAAA,IAA1BP,QAA0B,SAA1BA,QAA0B;IAAA,IAAhBC,SAAgB,SAAhBA,SAAgB;IACnD,IAAI,IAAAF,kBAAA,EAASC,QAAT,KAAsB,IAAAD,kBAAA,EAASE,SAAT,CAA1B,EAA+CN,iBAAiB,CAACa,IAAlB,CAAuB;MAAER,QAAQ,EAARA,QAAF;MAAYC,SAAS,EAATA;IAAZ,CAAvB;EAChD,CAFD;EAIA,OAAON,iBAAP;AACD,CAnBD;;eAqBeH,oB"}
1
+ {"version":3,"file":"get-center-coordinates.js","names":["getCenterCoordinates","mapShapes","otherProps","centerCoordinates","centerLatitude","centerLongitude","useDefaultCenter","isNumber","latitude","longitude","useAsCenterShapes","filter","useAsCenter","shapesForCenter","length","forEach","push"],"sources":["../../../src/GoogleMaps/helpers/get-center-coordinates.js"],"sourcesContent":["import isNumber from 'lodash.isnumber';\n\nconst getCenterCoordinates = (mapShapes, otherProps) => {\n const centerCoordinates = [];\n\n const { centerLatitude, centerLongitude } = otherProps;\n const useDefaultCenter =\n centerLatitude !== 0 &&\n centerLongitude !== 0 &&\n isNumber(centerLatitude) &&\n isNumber(centerLongitude);\n\n if (useDefaultCenter) return [{ latitude: centerLatitude, longitude: centerLongitude }];\n\n const useAsCenterShapes = mapShapes.filter(({ useAsCenter }) => useAsCenter);\n const shapesForCenter = useAsCenterShapes.length ? useAsCenterShapes : mapShapes;\n shapesForCenter.forEach(({ latitude, longitude }) => {\n if (isNumber(latitude) && isNumber(longitude)) centerCoordinates.push({ latitude, longitude });\n });\n\n return centerCoordinates;\n};\n\nexport default getCenterCoordinates;\n"],"mappings":";;;;;;;;;;;;AAAA;AAEA,IAAMA,oBAAoB,GAAG,SAAvBA,oBAAoB,CAAIC,SAAS,EAAEC,UAAU,EAAK;EACtD,IAAMC,iBAAiB,GAAG,EAAE;EAE5B,IAAQC,cAAc,GAAsBF,UAAU,CAA9CE,cAAc;IAAEC,eAAe,GAAKH,UAAU,CAA9BG,eAAe;EACvC,IAAMC,gBAAgB,GACpBF,cAAc,KAAK,CAAC,IACpBC,eAAe,KAAK,CAAC,IACrB,IAAAE,kBAAQ,EAACH,cAAc,CAAC,IACxB,IAAAG,kBAAQ,EAACF,eAAe,CAAC;EAE3B,IAAIC,gBAAgB,EAAE,OAAO,CAAC;IAAEE,QAAQ,EAAEJ,cAAc;IAAEK,SAAS,EAAEJ;EAAgB,CAAC,CAAC;EAEvF,IAAMK,iBAAiB,GAAGT,SAAS,CAACU,MAAM,CAAC;IAAA,IAAGC,WAAW,QAAXA,WAAW;IAAA,OAAOA,WAAW;EAAA,EAAC;EAC5E,IAAMC,eAAe,GAAGH,iBAAiB,CAACI,MAAM,GAAGJ,iBAAiB,GAAGT,SAAS;EAChFY,eAAe,CAACE,OAAO,CAAC,iBAA6B;IAAA,IAA1BP,QAAQ,SAARA,QAAQ;MAAEC,SAAS,SAATA,SAAS;IAC5C,IAAI,IAAAF,kBAAQ,EAACC,QAAQ,CAAC,IAAI,IAAAD,kBAAQ,EAACE,SAAS,CAAC,EAAEN,iBAAiB,CAACa,IAAI,CAAC;MAAER,QAAQ,EAARA,QAAQ;MAAEC,SAAS,EAATA;IAAU,CAAC,CAAC;EAChG,CAAC,CAAC;EAEF,OAAON,iBAAiB;AAC1B,CAAC;AAAC,eAEaH,oBAAoB;AAAA"}
@@ -1,41 +1,29 @@
1
1
  "use strict";
2
2
 
3
3
  require("core-js/modules/es.object.define-property.js");
4
-
5
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
6
-
7
5
  Object.defineProperty(exports, "__esModule", {
8
6
  value: true
9
7
  });
10
8
  exports["default"] = void 0;
11
-
12
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
13
-
14
10
  require("core-js/modules/es.array.for-each.js");
15
-
16
11
  require("core-js/modules/es.object.to-string.js");
17
-
18
12
  require("core-js/modules/web.dom-collections.for-each.js");
19
-
20
13
  require("core-js/modules/es.array.iterator.js");
21
-
22
14
  require("core-js/modules/es.set.js");
23
-
24
15
  require("core-js/modules/es.string.iterator.js");
25
-
26
16
  require("core-js/modules/web.dom-collections.iterator.js");
27
-
28
17
  var getImageIds = function getImageIds(mapShapes) {
29
18
  var ids = [];
30
19
  mapShapes.forEach(function (_ref) {
31
20
  var shapeData = _ref.shapeData,
32
- imageId = _ref.imageId;
21
+ imageId = _ref.imageId;
33
22
  if (imageId) ids.push(imageId);
34
23
  if (shapeData.imageId) ids.push(shapeData.imageId);
35
24
  });
36
25
  return (0, _toConsumableArray2["default"])(new Set(ids));
37
26
  };
38
-
39
27
  var _default = getImageIds;
40
28
  exports["default"] = _default;
41
29
  //# sourceMappingURL=get-image-ids.js.map