instantsearch.js 4.53.0 → 4.54.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 (53) hide show
  1. package/cjs/components/Pagination/Pagination.js +35 -17
  2. package/cjs/components/Template/Template.js +6 -3
  3. package/cjs/connectors/hierarchical-menu/connectHierarchicalMenu.js +4 -0
  4. package/cjs/connectors/menu/connectMenu.js +4 -0
  5. package/cjs/connectors/refinement-list/connectRefinementList.js +8 -0
  6. package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +4 -0
  7. package/cjs/helpers/highlight.js +5 -0
  8. package/cjs/helpers/reverseHighlight.js +5 -0
  9. package/cjs/helpers/reverseSnippet.js +5 -0
  10. package/cjs/helpers/snippet.js +5 -0
  11. package/cjs/lib/server.js +60 -0
  12. package/cjs/lib/utils/index.js +11 -0
  13. package/cjs/lib/utils/walkIndex.js +18 -0
  14. package/cjs/lib/version.js +1 -1
  15. package/cjs/widgets/pagination/pagination.js +51 -39
  16. package/cjs/widgets/panel/panel.js +0 -2
  17. package/cjs/widgets/places/places.js +1 -0
  18. package/dist/instantsearch.development.d.ts +27 -4
  19. package/dist/instantsearch.development.js +133 -63
  20. package/dist/instantsearch.development.js.map +1 -1
  21. package/dist/instantsearch.production.d.ts +27 -4
  22. package/dist/instantsearch.production.min.d.ts +27 -4
  23. package/dist/instantsearch.production.min.js +2 -2
  24. package/dist/instantsearch.production.min.js.map +1 -1
  25. package/es/components/Pagination/Pagination.js +34 -17
  26. package/es/components/Panel/Panel.d.ts +1 -1
  27. package/es/components/Template/Template.js +6 -3
  28. package/es/connectors/hierarchical-menu/connectHierarchicalMenu.js +4 -0
  29. package/es/connectors/menu/connectMenu.js +5 -1
  30. package/es/connectors/refinement-list/connectRefinementList.js +9 -1
  31. package/es/connectors/toggle-refinement/connectToggleRefinement.js +5 -1
  32. package/es/helpers/highlight.d.ts +3 -0
  33. package/es/helpers/highlight.js +5 -0
  34. package/es/helpers/reverseHighlight.d.ts +3 -0
  35. package/es/helpers/reverseHighlight.js +5 -0
  36. package/es/helpers/reverseSnippet.d.ts +3 -0
  37. package/es/helpers/reverseSnippet.js +5 -0
  38. package/es/helpers/snippet.d.ts +3 -0
  39. package/es/helpers/snippet.js +5 -0
  40. package/es/lib/server.d.ts +10 -0
  41. package/es/lib/server.js +53 -0
  42. package/es/lib/utils/index.d.ts +1 -0
  43. package/es/lib/utils/index.js +1 -0
  44. package/es/lib/utils/walkIndex.d.ts +5 -0
  45. package/es/lib/utils/walkIndex.js +12 -0
  46. package/es/lib/version.d.ts +1 -1
  47. package/es/lib/version.js +1 -1
  48. package/es/widgets/pagination/pagination.d.ts +12 -5
  49. package/es/widgets/pagination/pagination.js +51 -39
  50. package/es/widgets/panel/panel.js +0 -2
  51. package/es/widgets/places/places.d.ts +1 -1
  52. package/es/widgets/places/places.js +1 -0
  53. package/package.json +5 -5
@@ -1774,6 +1774,9 @@ declare type HierarchicalMenuWidgetParams = {
1774
1774
 
1775
1775
  declare function Highlight<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: HighlightProps<THit>): h.JSX.Element;
1776
1776
 
1777
+ /**
1778
+ * @deprecated use html tagged templates and the Highlight component instead
1779
+ */
1777
1780
  declare function highlight({ attribute, highlightedTagName, hit, cssClasses, }: HighlightOptions): string;
1778
1781
 
1779
1782
  declare type HighlightClassNames = HighlightClassNames_2;
@@ -2475,9 +2478,13 @@ declare type InstantSearchModule = {
2475
2478
  routers: typeof routers;
2476
2479
  stateMappings: typeof stateMappings;
2477
2480
  createInfiniteHitsSessionStorageCache: typeof createInfiniteHitsSessionStorageCache;
2481
+ /** @deprecated use html tagged templates and the Highlight component instead */
2478
2482
  highlight: typeof helpers.highlight;
2483
+ /** @deprecated use html tagged templates and the ReverseHighlight component instead */
2479
2484
  reverseHighlight: typeof helpers.reverseHighlight;
2485
+ /** @deprecated use html tagged templates and the Snippet component instead */
2480
2486
  snippet: typeof helpers.snippet;
2487
+ /** @deprecated use html tagged templates and the ReverseSnippet component instead */
2481
2488
  reverseSnippet: typeof helpers.reverseSnippet;
2482
2489
  /**
2483
2490
  * @deprecated use createInsightsMiddleware
@@ -3140,19 +3147,26 @@ declare type PaginationTemplates = Partial<{
3140
3147
  /**
3141
3148
  * Label for the Previous link.
3142
3149
  */
3143
- previous: string;
3150
+ previous: Template;
3144
3151
  /**
3145
3152
  * Label for the Next link.
3146
3153
  */
3147
- next: string;
3154
+ next: Template;
3155
+ /**
3156
+ * Label for the link of a certain page
3157
+ * Page is one-based, so `page` will be `1` for the first page.
3158
+ */
3159
+ page: Template<{
3160
+ page: number;
3161
+ }>;
3148
3162
  /**
3149
3163
  * Label for the First link.
3150
3164
  */
3151
- first: string;
3165
+ first: Template;
3152
3166
  /**
3153
3167
  * Label for the Last link.
3154
3168
  */
3155
- last: string;
3169
+ last: Template;
3156
3170
  }>;
3157
3171
 
3158
3172
  declare type PaginationWidget = WidgetFactory<PaginationWidgetDescription & {
@@ -4459,6 +4473,9 @@ declare type RequiredWidgetType<TWidgetDescription extends WidgetDescription> =
4459
4473
 
4460
4474
  declare function ReverseHighlight<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseHighlightProps<THit>): h.JSX.Element;
4461
4475
 
4476
+ /**
4477
+ * @deprecated use html tagged templates and the ReverseHighlight component instead
4478
+ */
4462
4479
  declare function reverseHighlight({ attribute, highlightedTagName, hit, cssClasses, }: ReverseHighlightOptions): string;
4463
4480
 
4464
4481
  declare type ReverseHighlightClassNames = HighlightClassNames_2;
@@ -4484,6 +4501,9 @@ declare type ReverseHighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {
4484
4501
 
4485
4502
  declare function ReverseSnippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseSnippetProps<THit>): h.JSX.Element;
4486
4503
 
4504
+ /**
4505
+ * @deprecated use html tagged templates and the ReverseSnippet component instead
4506
+ */
4487
4507
  declare function reverseSnippet({ attribute, highlightedTagName, hit, cssClasses, }: ReverseSnippetOptions): string;
4488
4508
 
4489
4509
  declare type ReverseSnippetClassNames = HighlightClassNames_2;
@@ -4770,6 +4790,9 @@ declare function singleIndexStateMapping<TUiState extends UiState = UiState>(ind
4770
4790
 
4771
4791
  declare function Snippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: SnippetProps<THit>): h.JSX.Element;
4772
4792
 
4793
+ /**
4794
+ * @deprecated use html tagged templates and the Snippet component instead
4795
+ */
4773
4796
  declare function snippet({ attribute, highlightedTagName, hit, cssClasses, }: SnippetOptions): string;
4774
4797
 
4775
4798
  declare type SnippetClassNames = HighlightClassNames_2;
@@ -1774,6 +1774,9 @@ declare type HierarchicalMenuWidgetParams = {
1774
1774
 
1775
1775
  declare function Highlight<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: HighlightProps<THit>): h.JSX.Element;
1776
1776
 
1777
+ /**
1778
+ * @deprecated use html tagged templates and the Highlight component instead
1779
+ */
1777
1780
  declare function highlight({ attribute, highlightedTagName, hit, cssClasses, }: HighlightOptions): string;
1778
1781
 
1779
1782
  declare type HighlightClassNames = HighlightClassNames_2;
@@ -2475,9 +2478,13 @@ declare type InstantSearchModule = {
2475
2478
  routers: typeof routers;
2476
2479
  stateMappings: typeof stateMappings;
2477
2480
  createInfiniteHitsSessionStorageCache: typeof createInfiniteHitsSessionStorageCache;
2481
+ /** @deprecated use html tagged templates and the Highlight component instead */
2478
2482
  highlight: typeof helpers.highlight;
2483
+ /** @deprecated use html tagged templates and the ReverseHighlight component instead */
2479
2484
  reverseHighlight: typeof helpers.reverseHighlight;
2485
+ /** @deprecated use html tagged templates and the Snippet component instead */
2480
2486
  snippet: typeof helpers.snippet;
2487
+ /** @deprecated use html tagged templates and the ReverseSnippet component instead */
2481
2488
  reverseSnippet: typeof helpers.reverseSnippet;
2482
2489
  /**
2483
2490
  * @deprecated use createInsightsMiddleware
@@ -3140,19 +3147,26 @@ declare type PaginationTemplates = Partial<{
3140
3147
  /**
3141
3148
  * Label for the Previous link.
3142
3149
  */
3143
- previous: string;
3150
+ previous: Template;
3144
3151
  /**
3145
3152
  * Label for the Next link.
3146
3153
  */
3147
- next: string;
3154
+ next: Template;
3155
+ /**
3156
+ * Label for the link of a certain page
3157
+ * Page is one-based, so `page` will be `1` for the first page.
3158
+ */
3159
+ page: Template<{
3160
+ page: number;
3161
+ }>;
3148
3162
  /**
3149
3163
  * Label for the First link.
3150
3164
  */
3151
- first: string;
3165
+ first: Template;
3152
3166
  /**
3153
3167
  * Label for the Last link.
3154
3168
  */
3155
- last: string;
3169
+ last: Template;
3156
3170
  }>;
3157
3171
 
3158
3172
  declare type PaginationWidget = WidgetFactory<PaginationWidgetDescription & {
@@ -4459,6 +4473,9 @@ declare type RequiredWidgetType<TWidgetDescription extends WidgetDescription> =
4459
4473
 
4460
4474
  declare function ReverseHighlight<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseHighlightProps<THit>): h.JSX.Element;
4461
4475
 
4476
+ /**
4477
+ * @deprecated use html tagged templates and the ReverseHighlight component instead
4478
+ */
4462
4479
  declare function reverseHighlight({ attribute, highlightedTagName, hit, cssClasses, }: ReverseHighlightOptions): string;
4463
4480
 
4464
4481
  declare type ReverseHighlightClassNames = HighlightClassNames_2;
@@ -4484,6 +4501,9 @@ declare type ReverseHighlightProps_2 = Omit<HighlightProps_3, 'classNames'> & {
4484
4501
 
4485
4502
  declare function ReverseSnippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: ReverseSnippetProps<THit>): h.JSX.Element;
4486
4503
 
4504
+ /**
4505
+ * @deprecated use html tagged templates and the ReverseSnippet component instead
4506
+ */
4487
4507
  declare function reverseSnippet({ attribute, highlightedTagName, hit, cssClasses, }: ReverseSnippetOptions): string;
4488
4508
 
4489
4509
  declare type ReverseSnippetClassNames = HighlightClassNames_2;
@@ -4770,6 +4790,9 @@ declare function singleIndexStateMapping<TUiState extends UiState = UiState>(ind
4770
4790
 
4771
4791
  declare function Snippet<THit extends Hit<BaseHit>>({ hit, attribute, cssClasses, ...props }: SnippetProps<THit>): h.JSX.Element;
4772
4792
 
4793
+ /**
4794
+ * @deprecated use html tagged templates and the Snippet component instead
4795
+ */
4773
4796
  declare function snippet({ attribute, highlightedTagName, hit, cssClasses, }: SnippetOptions): string;
4774
4797
 
4775
4798
  declare type SnippetClassNames = HighlightClassNames_2;