@spothero/ui 13.9.0 → 13.10.0-beta.1

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 (31) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/CHANGELOG.tmp +3 -3
  3. package/backlog/GooglePlacesSearchInput/GooglePlacesSearchInput.js +9 -2
  4. package/package.json +1 -1
  5. package/styles/GooglePlacesSearchInput/GooglePlacesSearchInput.jsx +33 -1
  6. package/v1/index-bundled-cjs/index.js +1 -1
  7. package/v1/index-bundled-cjs/index.js.map +1 -1
  8. package/v1/index-bundled-esm/index.js +1 -1
  9. package/v1/index-bundled-esm/index.js.map +1 -1
  10. package/v1/index-unbundled-cjs/index.js +35 -35
  11. package/v1/index-unbundled-esm/index.js +35 -35
  12. package/v2/index-bundled-cjs/{ImageCarousel-c8dddbb1.js → ImageCarousel-e8e079e8.js} +2 -2
  13. package/v2/index-bundled-cjs/{ImageCarousel-c8dddbb1.js.map → ImageCarousel-e8e079e8.js.map} +1 -1
  14. package/v2/index-bundled-cjs/{index-7c73c07d.js → index-e7e488ba.js} +4 -4
  15. package/v2/index-bundled-cjs/{index-7c73c07d.js.map → index-e7e488ba.js.map} +1 -1
  16. package/v2/index-bundled-cjs/index.js +1 -1
  17. package/v2/index-bundled-esm/{ImageCarousel-dc224d64.js → ImageCarousel-64780662.js} +2 -2
  18. package/v2/index-bundled-esm/{ImageCarousel-dc224d64.js.map → ImageCarousel-64780662.js.map} +1 -1
  19. package/v2/index-bundled-esm/{index-7ef77e69.js → index-0fa0fa5c.js} +4 -4
  20. package/v2/index-bundled-esm/{index-7ef77e69.js.map → index-0fa0fa5c.js.map} +1 -1
  21. package/v2/index-bundled-esm/index.js +1 -1
  22. package/v2/index-unbundled-cjs/{ImageCarousel-325df0c4.js → ImageCarousel-bc41393b.js} +4 -4
  23. package/v2/index-unbundled-cjs/{ImageCarousel-325df0c4.js.map → ImageCarousel-bc41393b.js.map} +1 -1
  24. package/v2/index-unbundled-cjs/{index-093f8806.js → index-beb87ca2.js} +148 -148
  25. package/v2/index-unbundled-cjs/{index-093f8806.js.map → index-beb87ca2.js.map} +1 -1
  26. package/v2/index-unbundled-cjs/index.js +1 -1
  27. package/v2/index-unbundled-esm/{ImageCarousel-653f3259.js → ImageCarousel-d3597a8c.js} +4 -4
  28. package/v2/index-unbundled-esm/{ImageCarousel-653f3259.js.map → ImageCarousel-d3597a8c.js.map} +1 -1
  29. package/v2/index-unbundled-esm/{index-1c95808d.js → index-0ea45e07.js} +148 -148
  30. package/v2/index-unbundled-esm/{index-1c95808d.js.map → index-0ea45e07.js.map} +1 -1
  31. package/v2/index-unbundled-esm/index.js +1 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,19 @@
1
+ # 13.10.0-beta.1 - 02/22/2022
2
+
3
+ ## Miscellaneous Updates
4
+ * [[1f46e18](https://github.com/spothero/fe-ui/commit/1f46e18)] - `chore:` Added logging for suggestions, and added origin to biasing options (Nathan)
5
+
6
+ # 13.10.0-beta.0 - 02/22/2022
7
+ ## Miscellaneous Updates
8
+
9
+ ## New Features
10
+ * [[4193a26](https://github.com/spothero/fe-ui/commit/4193a26)] - Updated Autocomplete to accept biasing options (Nathan)
11
+
12
+ ## Miscellaneous Updates
13
+ * [[3a93a18](https://github.com/spothero/fe-ui/commit/3a93a18)] - 13.9.0-beta.0 (sh-devtools-bot)
14
+ * [[e6ab74b](https://github.com/spothero/fe-ui/commit/e6ab74b)] - `chore:` Updated location options (Nathan)
15
+ * [[19f8451](https://github.com/spothero/fe-ui/commit/19f8451)] - `chore:` Updated PropTypes for geolocation biasing (Nathan)
16
+
1
17
  # 13.9.0 - 02/17/2022
2
18
 
3
19
  ## New Features
package/CHANGELOG.tmp CHANGED
@@ -1,5 +1,5 @@
1
- # 13.9.0 - 02/17/2022
1
+ # 13.10.0-beta.1 - 02/22/2022
2
2
 
3
- ## New Features
4
- * [[5229309](https://github.com/spothero/fe-ui/commit/5229309)] - Adds Popover component ([#270](https://github.com/spothero/fe-ui/pull/270)) (Tyler Williams)
3
+ ## Miscellaneous Updates
4
+ * [[1f46e18](https://github.com/spothero/fe-ui/commit/1f46e18)] - `chore:` Added logging for suggestions, and added origin to biasing options (Nathan)
5
5
 
@@ -148,10 +148,11 @@ var GooglePlacesSearchInput = /*#__PURE__*/function (_Component) {
148
148
  var _this$props = _this.props,
149
149
  country = _this$props.country,
150
150
  types = _this$props.types,
151
- bounds = _this$props.bounds;
151
+ bounds = _this$props.bounds,
152
+ biasOptions = _this$props.biasOptions;
152
153
  var autocompleteSessionToken = _this.state.autocompleteSessionToken;
153
154
 
154
- var options = _objectSpread(_objectSpread(_objectSpread(_objectSpread({
155
+ var options = _objectSpread(_objectSpread(_objectSpread(_objectSpread(_objectSpread({
155
156
  input: value
156
157
  }, bounds && {
157
158
  bounds: bounds
@@ -161,6 +162,10 @@ var GooglePlacesSearchInput = /*#__PURE__*/function (_Component) {
161
162
  }
162
163
  }), types && {
163
164
  types: types
165
+ }), (biasOptions === null || biasOptions === void 0 ? void 0 : biasOptions.location) && {
166
+ location: new _this._gmaps.LatLng(location.latitude, location.longitude),
167
+ radius: biasOptions === null || biasOptions === void 0 ? void 0 : biasOptions.radius,
168
+ origin: new _this._gmaps.LatLng(location.latitude, location.longitude)
164
169
  }), {}, {
165
170
  sessionToken: autocompleteSessionToken
166
171
  });
@@ -178,6 +183,8 @@ var GooglePlacesSearchInput = /*#__PURE__*/function (_Component) {
178
183
  });
179
184
  }
180
185
 
186
+ console.log('>>>>>>suggestions', suggestions);
187
+
181
188
  _this.setState({
182
189
  suggestions: suggestions
183
190
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spothero/ui",
3
- "version": "13.9.0",
3
+ "version": "13.10.0-beta.1",
4
4
  "description": "SpotHero's React component UI library.",
5
5
  "main": "v2/index-bundled-cjs/index.js",
6
6
  "module": "v2/index.js",
@@ -27,6 +27,25 @@ export default class GooglePlacesSearchInput extends Component {
27
27
  googleMaps: PropTypes.object,
28
28
  /** A custom element (typically a PoweredByGoogle component) to display at the bottom of the suggestion list. */
29
29
  poweredByGoogleFooter: PropTypes.element.isRequired,
30
+ /** An object containing the bias options */
31
+ biasOptions: PropTypes.shape({
32
+ /** The location (lat and long), to bias the search results around.
33
+ * * @see https://developers.google.com/maps/documentation/javascript/reference/places-autocomplete-service#AutocompletionRequest.location
34
+ */
35
+ location: PropTypes.shape({
36
+ latitude: PropTypes.number,
37
+ longitude: PropTypes.number,
38
+ }),
39
+ /** The radius, in meters, to bias the search results within - required when providing a location for biasing */
40
+ radius: (props, propName) =>
41
+ props.biasOptions.location.latitude &&
42
+ props.biasOptions.location.longitude &&
43
+ (Boolean(props[propName]) === false ||
44
+ typeof props[propName] !== 'number') &&
45
+ new Error(
46
+ 'A radius value is required when biasing autocomplete suggestions'
47
+ ),
48
+ }),
30
49
  };
31
50
  static defaultProps = {
32
51
  placeholder: 'Search Address or Venue',
@@ -114,7 +133,7 @@ export default class GooglePlacesSearchInput extends Component {
114
133
  };
115
134
 
116
135
  _searchSuggestions = value => {
117
- const {country, types, bounds} = this.props;
136
+ const {country, types, bounds, biasOptions} = this.props;
118
137
  const {autocompleteSessionToken} = this.state;
119
138
 
120
139
  const options = {
@@ -126,6 +145,17 @@ export default class GooglePlacesSearchInput extends Component {
126
145
  },
127
146
  }),
128
147
  ...(types && {types}),
148
+ ...(biasOptions?.location && {
149
+ location: new this._gmaps.LatLng(
150
+ location.latitude,
151
+ location.longitude
152
+ ),
153
+ radius: biasOptions?.radius,
154
+ origin: new this._gmaps.LatLng(
155
+ location.latitude,
156
+ location.longitude
157
+ ),
158
+ }),
129
159
  sessionToken: autocompleteSessionToken,
130
160
  };
131
161
 
@@ -142,6 +172,8 @@ export default class GooglePlacesSearchInput extends Component {
142
172
  });
143
173
  }
144
174
 
175
+ console.log('>>>>>>suggestions', suggestions);
176
+
145
177
  this.setState({
146
178
  suggestions,
147
179
  });