homeflowjs 0.13.20 → 0.13.22

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.
@@ -652,9 +652,70 @@
652
652
  }
653
653
  }
654
654
 
655
+ // Loading
655
656
  .hfjs-instant-val__loader {
656
657
  margin-top: 180px;
658
+ position: absolute;
659
+ left: 0;
660
+ right: 0;
661
+ margin-left: auto;
662
+ margin-right: auto;
663
+ display: inline-block;
664
+ width: 80px;
665
+ height: 80px;
666
+ padding: 4rem;
667
+ }
668
+ // Loading
669
+ .hfjs-instant-val__loader div {
670
+ position: absolute;
671
+ top: 33px;
672
+ width: 13px;
673
+ height: 13px;
674
+ border-radius: 50%;
675
+ background: #888;
676
+ animation-timing-function: cubic-bezier(0, 1, 1, 0);
657
677
  }
678
+ .hfjs-instant-val__loader div:nth-child(1) {
679
+ left: 8px;
680
+ animation: valuation-loader1 0.6s infinite;
681
+ }
682
+ .hfjs-instant-val__loader div:nth-child(2) {
683
+ left: 8px;
684
+ animation: valuation-loader2 0.6s infinite;
685
+ }
686
+ .hfjs-instant-val__loader div:nth-child(3) {
687
+ left: 32px;
688
+ animation: valuation-loader2 0.6s infinite;
689
+ }
690
+ .hfjs-instant-val__loader div:nth-child(4) {
691
+ left: 56px;
692
+ animation: valuation-loader3 0.6s infinite;
693
+ }
694
+ @keyframes valuation-loader1 {
695
+ 0% {
696
+ transform: scale(0);
697
+ }
698
+ 100% {
699
+ transform: scale(1);
700
+ }
701
+ }
702
+ @keyframes valuation-loader2 {
703
+ 0% {
704
+ transform: translate(0, 0);
705
+ }
706
+ 100% {
707
+ transform: translate(24px, 0);
708
+ }
709
+ }
710
+ @keyframes valuation-loader3 {
711
+ 0% {
712
+ transform: scale(1);
713
+ }
714
+ 100% {
715
+ transform: scale(0);
716
+ }
717
+ }
718
+
658
719
 
659
720
  .instant-valuation__price-label {
660
721
  margin-bottom: 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "homeflowjs",
3
- "version": "0.13.20",
3
+ "version": "0.13.22",
4
4
  "sideEffects": [
5
5
  "modal/**/*",
6
6
  "user/default-profile/**/*",
@@ -1,7 +1,7 @@
1
1
  /* eslint-disable */
2
2
  import DraggableMap from './draggable-map';
3
3
  import store from '../../store';
4
- import { currentGeonameId } from '../../utils/index';
4
+ import { currentGeonameId, filterGeonames } from '../../utils/index';
5
5
  import { setProperties, setGeonames, setSelectedMarker } from '../../actions/properties.actions';
6
6
  import { setInitialSearch, setPlace, setSearchField } from '../../actions/search.actions';
7
7
  import { buildQueryString } from '../../search/property-search/property-search';
@@ -16,6 +16,7 @@ export default class GeonamesMap extends DraggableMap {
16
16
 
17
17
  this.geonameMarkerLayers = [];
18
18
  this.geonameMarkerHoverLayers = [];
19
+ this.currentGeonameIdFromLocationPath = currentGeonameId();
19
20
  }
20
21
 
21
22
  initOnMarkerClick() {
@@ -258,11 +259,15 @@ export default class GeonamesMap extends DraggableMap {
258
259
 
259
260
  setSearchResponse(json) {
260
261
  if (!json) return;
261
-
262
+
262
263
  if (json.geonames) {
263
264
  this.geonames = this.concatenateDistinctObjects('geoname_id', this.geonames, json.geonames);
264
265
  window.markerType = 'geonames';
265
- store.dispatch(setGeonames(json.geonames));
266
+ const currentAreaId = store.getState().search.currentSearch?.place?.area;
267
+ const geonamesFiltered = filterGeonames(
268
+ this.currentGeonameIdFromLocationPath, Number(currentAreaId), this.geonames
269
+ );
270
+ store.dispatch(setGeonames(geonamesFiltered));
266
271
  } else if (json.properties) {
267
272
  this.properties = this.concatenateDistinctObjects('property_id', this.properties, json.properties);
268
273
  window.markerType = 'properties';
@@ -285,7 +290,11 @@ export default class GeonamesMap extends DraggableMap {
285
290
  this.hideSuggestedDestinations();
286
291
  this.markersInitialized = true;
287
292
  } else if (window.markerType === 'geonames' && this.geonames?.length) {
288
- this.geonames.forEach(geoname => this.setGeonameMarker(geoname));
293
+ const currentAreaId = store.getState().search.currentSearch?.place?.area;
294
+ const geonamesFiltered = filterGeonames(
295
+ this.currentGeonameIdFromLocationPath, Number(currentAreaId), this.geonames
296
+ );
297
+ geonamesFiltered.forEach(geoname => this.setGeonameMarker(geoname));
289
298
  this.showSuggestedDestinations();
290
299
  this.markersInitialized = true;
291
300
  }
@@ -9,6 +9,7 @@ const Loader = ({ containerClass, className, message }) => (
9
9
  <div />
10
10
  <div />
11
11
  <div />
12
+ <div />
12
13
  </div>
13
14
 
14
15
  {message && <p style={{ marginTop: '10px' }}>{message}</p>}
package/utils/index.js CHANGED
@@ -1,3 +1,8 @@
1
+ /* eslint-disable arrow-body-style */
2
+ /* eslint-disable max-len */
3
+ /* eslint-disable semi */
4
+ /* eslint-disable no-undef */
5
+ /* eslint-disable no-restricted-syntax */
1
6
  export { default as stampDutyCalculator } from './stamp-duty-calculator/stamp-duty-calculator';
2
7
 
3
8
  export const capitalizeFirstLetter = (str) => (
@@ -82,8 +87,16 @@ export const sanitizeText = (string) => new Option(string).innerHTML;
82
87
 
83
88
  export const currentGeonameId = (path) => {
84
89
  const pathname = path || window.location.pathname;
85
- const segment = pathname.split('/').reverse().find(item => item.startsWith('gid-'))?.replace(/^gid-/, '')
90
+ const segment = pathname.split('/').reverse().find((item) => item.startsWith('gid-'))?.replace(/^gid-/, '');
86
91
  return parseInt(segment, 10) || null;
87
92
  };
88
93
 
89
94
  export const DEBOUNCE_DELAY = 200;
95
+
96
+ export const filterGeonames = (geonameId = null, areaId = null, geonames) => {
97
+ if (!geonameId) return geonames;
98
+
99
+ if (areaId) return geonames.filter((geoname) => geoname?.geoname_id !== geonameId && geoname?.area < areaId);
100
+
101
+ return geonames.filter((geoname) => geoname?.geoname_id !== geonameId);
102
+ };