1- /* eslint-disable no-undef */
21import { instantMeiliSearch } from '@meilisearch/instant-meilisearch'
2+ import { default as instantsearch } from 'instantsearch.js'
3+ import {
4+ clearRefinements ,
5+ configure ,
6+ hits ,
7+ pagination ,
8+ refinementList ,
9+ searchBox ,
10+ sortBy ,
11+ } from 'instantsearch.js/es/widgets'
312
413const search = instantsearch ( {
514 indexName : 'steam-video-games' ,
@@ -13,7 +22,7 @@ const search = instantsearch({
1322} )
1423
1524search . addWidgets ( [
16- instantsearch . widgets . sortBy ( {
25+ sortBy ( {
1726 container : '#sort-by' ,
1827 items : [
1928 { value : 'steam-video-games' , label : 'Relevant' } ,
@@ -27,33 +36,33 @@ search.addWidgets([
2736 } ,
2837 ] ,
2938 } ) ,
30- instantsearch . widgets . searchBox ( {
39+ searchBox ( {
3140 container : '#searchbox' ,
3241 } ) ,
33- instantsearch . widgets . clearRefinements ( {
42+ clearRefinements ( {
3443 container : '#clear-refinements' ,
3544 } ) ,
36- instantsearch . widgets . refinementList ( {
45+ refinementList ( {
3746 container : '#genres-list' ,
3847 attribute : 'genres' ,
3948 } ) ,
40- instantsearch . widgets . refinementList ( {
49+ refinementList ( {
4150 container : '#players-list' ,
4251 attribute : 'players' ,
4352 } ) ,
44- instantsearch . widgets . refinementList ( {
53+ refinementList ( {
4554 container : '#platforms-list' ,
4655 attribute : 'platforms' ,
4756 } ) ,
48- instantsearch . widgets . configure ( {
57+ configure ( {
4958 hitsPerPage : 6 ,
5059 attributesToSnippet : [ 'description:150' ] ,
5160 } ) ,
52- instantsearch . widgets . refinementList ( {
61+ refinementList ( {
5362 container : '#misc-list' ,
5463 attribute : 'misc' ,
5564 } ) ,
56- instantsearch . widgets . hits ( {
65+ hits ( {
5766 container : '#hits' ,
5867 templates : {
5968 item : `
@@ -72,7 +81,7 @@ search.addWidgets([
7281 ` ,
7382 } ,
7483 } ) ,
75- instantsearch . widgets . pagination ( {
84+ pagination ( {
7685 container : '#pagination' ,
7786 } ) ,
7887] )
0 commit comments