Skip to content

Commit 1d754d1

Browse files
francoischalifourHaroenv
authored andcommitted
feat(places): add Places widget (#4167)
* feat(places): add Places widget * fix(places): rename `placesClient` to `placesReference`
1 parent 80d32fc commit 1d754d1

File tree

9 files changed

+703
-45
lines changed

9 files changed

+703
-45
lines changed

.storybook/static/storybook.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ body {
115115

116116
.algolia-places {
117117
display: block !important;
118-
width: 850px;
118+
width: 100%;
119119
margin: 0 auto;
120120
}
121121

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
"jscodeshift": "0.6.4",
122122
"jsdom-global": "3.0.2",
123123
"mversion": "1.13.0",
124-
"places.js": "1.16.4",
124+
"places.js": "1.16.6",
125125
"prettier": "1.18.2",
126126
"rollup": "1.21.4",
127127
"rollup-plugin-babel": "4.3.3",
@@ -139,7 +139,7 @@
139139
"bundlesize": [
140140
{
141141
"path": "./dist/instantsearch.production.min.js",
142-
"maxSize": "62 kB"
142+
"maxSize": "63 kB"
143143
},
144144
{
145145
"path": "./dist/instantsearch.development.js",

src/types/widget.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,15 @@ export type IndexUiState = {
104104
page?: number;
105105
hitsPerPage?: number;
106106
configure?: PlainSearchParameters;
107+
places?: {
108+
query: string;
109+
/**
110+
* The central geolocation.
111+
*
112+
* @example '48.8546,2.3477'
113+
*/
114+
position: string;
115+
};
107116
};
108117

109118
export type UiState = {
@@ -130,6 +139,7 @@ export interface Widget {
130139
| 'ais.menu'
131140
| 'ais.numericMenu'
132141
| 'ais.pagination'
142+
| 'ais.places'
133143
| 'ais.poweredBy'
134144
| 'ais.queryRules'
135145
| 'ais.range'

src/widgets/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,3 +38,4 @@ export {
3838
default as queryRuleContext,
3939
} from './query-rule-context/query-rule-context';
4040
export { default as index } from './index/index';
41+
export { default as places } from './places/places';

src/widgets/index/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -380,6 +380,7 @@ const index = (props: IndexProps): Index => {
380380
page: ['ais.pagination', 'ais.infiniteHits'],
381381
hitsPerPage: ['ais.hitsPerPage'],
382382
configure: ['ais.configure'],
383+
places: ['ais.places'],
383384
};
384385

385386
const mountedWidgets = this.getWidgets()

0 commit comments

Comments
 (0)