instantsearch.js 4.65.0 → 4.66.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 (32) hide show
  1. package/cjs/connectors/answers/connectAnswers.js +3 -0
  2. package/cjs/connectors/hits/connectHits.js +2 -0
  3. package/cjs/connectors/infinite-hits/connectInfiniteHits.js +1 -0
  4. package/cjs/lib/version.js +1 -1
  5. package/cjs/widgets/answers/answers.js +4 -1
  6. package/cjs/widgets/hits/hits.js +66 -30
  7. package/cjs/widgets/places/places.js +3 -1
  8. package/dist/instantsearch.development.d.ts +7 -25
  9. package/dist/instantsearch.development.js +334 -253
  10. package/dist/instantsearch.development.js.map +1 -1
  11. package/dist/instantsearch.production.d.ts +7 -25
  12. package/dist/instantsearch.production.min.d.ts +7 -25
  13. package/dist/instantsearch.production.min.js +2 -2
  14. package/dist/instantsearch.production.min.js.map +1 -1
  15. package/es/connectors/answers/connectAnswers.d.ts +3 -0
  16. package/es/connectors/answers/connectAnswers.js +3 -0
  17. package/es/connectors/hits/connectHits.js +2 -0
  18. package/es/connectors/infinite-hits/connectInfiniteHits.js +1 -0
  19. package/es/connectors/refinement-list/connectRefinementList.d.ts +2 -0
  20. package/es/lib/version.d.ts +1 -1
  21. package/es/lib/version.js +1 -1
  22. package/es/widgets/answers/answers.d.ts +2 -2
  23. package/es/widgets/answers/answers.js +5 -2
  24. package/es/widgets/hits/defaultTemplates.d.ts +2 -2
  25. package/es/widgets/hits/hits.d.ts +2 -18
  26. package/es/widgets/hits/hits.js +67 -31
  27. package/es/widgets/places/places.d.ts +2 -6
  28. package/es/widgets/places/places.js +4 -1
  29. package/package.json +12 -10
  30. package/cjs/components/Hits/Hits.js +0 -72
  31. package/es/components/Hits/Hits.d.ts +0 -19
  32. package/es/components/Hits/Hits.js +0 -65
@@ -7,6 +7,7 @@ import { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js'
7
7
  import { h } from 'preact';
8
8
  import type { HighlightClassNames as HighlightClassNames_2 } from 'instantsearch-ui-components';
9
9
  import type { HighlightProps as HighlightProps_3 } from 'instantsearch-ui-components';
10
+ import type { HitsClassNames } from 'instantsearch-ui-components';
10
11
  import type { HoganOptions } from 'hogan.js';
11
12
  import type { html } from 'htm/preact';
12
13
  import type { InsightsClient as InsightsClient_2 } from 'search-insights';
@@ -1111,6 +1112,8 @@ declare type CustomSendEventForHits = (customPayload: any) => void;
1111
1112
 
1112
1113
  declare type CustomSendEventForToggle = (customPayload: any) => void;
1113
1114
 
1115
+ declare const _default: PlacesWidget;
1116
+
1114
1117
  declare type DisposeOptions = {
1115
1118
  helper: AlgoliaSearchHelper;
1116
1119
  state: SearchParameters;
@@ -1863,24 +1866,7 @@ declare type HitsConnectorParams<THit extends BaseHit = BaseHit> = {
1863
1866
  transformItems?: TransformItems<Hit<THit>>;
1864
1867
  };
1865
1868
 
1866
- declare type HitsCSSClasses = Partial<{
1867
- /**
1868
- * CSS class to add to the wrapping element.
1869
- */
1870
- root: string | string[];
1871
- /**
1872
- * CSS class to add to the wrapping element when no results.
1873
- */
1874
- emptyRoot: string | string[];
1875
- /**
1876
- * CSS class to add to the list of results.
1877
- */
1878
- list: string | string[];
1879
- /**
1880
- * CSS class to add to each result.
1881
- */
1882
- item: string | string[];
1883
- }>;
1869
+ declare type HitsCSSClasses = Partial<HitsClassNames>;
1884
1870
 
1885
1871
  declare type HitSnippetResult = {
1886
1872
  [attribute: string]: HitAttributeSnippetResult[] | HitSnippetResult[] | HitAttributeSnippetResult | HitSnippetResult;
@@ -3431,12 +3417,6 @@ declare type PlacesInstance = Places.PlacesInstance;
3431
3417
 
3432
3418
  declare type PlacesWidget = WidgetFactory<PlacesWidgetDescription, PlacesWidgetParams, PlacesWidgetParams>;
3433
3419
 
3434
- /**
3435
- * This widget sets the geolocation value for the search based on the selected
3436
- * result in the Algolia Places autocomplete.
3437
- */
3438
- declare const placesWidget: PlacesWidget;
3439
-
3440
3420
  declare type PlacesWidgetDescription = {
3441
3421
  $$type: 'ais.places';
3442
3422
  $$widgetType: 'ais.places';
@@ -4263,6 +4243,8 @@ declare type RefinementListRenderState = {
4263
4243
  isFromSearch: boolean;
4264
4244
  /**
4265
4245
  * `true` if a refinement can be applied.
4246
+ * @MAJOR: reconsider how `canRefine` is computed so it both accounts for the
4247
+ * items returned in the main search and in SFFV.
4266
4248
  */
4267
4249
  canRefine: boolean;
4268
4250
  /**
@@ -5563,7 +5545,7 @@ declare namespace widgets {
5563
5545
  numericMenu,
5564
5546
  pagination,
5565
5547
  panel,
5566
- placesWidget as places,
5548
+ _default as places,
5567
5549
  poweredBy,
5568
5550
  queryRuleContext,
5569
5551
  queryRuleCustomData,
@@ -7,6 +7,7 @@ import { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js'
7
7
  import { h } from 'preact';
8
8
  import type { HighlightClassNames as HighlightClassNames_2 } from 'instantsearch-ui-components';
9
9
  import type { HighlightProps as HighlightProps_3 } from 'instantsearch-ui-components';
10
+ import type { HitsClassNames } from 'instantsearch-ui-components';
10
11
  import type { HoganOptions } from 'hogan.js';
11
12
  import type { html } from 'htm/preact';
12
13
  import type { InsightsClient as InsightsClient_2 } from 'search-insights';
@@ -1111,6 +1112,8 @@ declare type CustomSendEventForHits = (customPayload: any) => void;
1111
1112
 
1112
1113
  declare type CustomSendEventForToggle = (customPayload: any) => void;
1113
1114
 
1115
+ declare const _default: PlacesWidget;
1116
+
1114
1117
  declare type DisposeOptions = {
1115
1118
  helper: AlgoliaSearchHelper;
1116
1119
  state: SearchParameters;
@@ -1863,24 +1866,7 @@ declare type HitsConnectorParams<THit extends BaseHit = BaseHit> = {
1863
1866
  transformItems?: TransformItems<Hit<THit>>;
1864
1867
  };
1865
1868
 
1866
- declare type HitsCSSClasses = Partial<{
1867
- /**
1868
- * CSS class to add to the wrapping element.
1869
- */
1870
- root: string | string[];
1871
- /**
1872
- * CSS class to add to the wrapping element when no results.
1873
- */
1874
- emptyRoot: string | string[];
1875
- /**
1876
- * CSS class to add to the list of results.
1877
- */
1878
- list: string | string[];
1879
- /**
1880
- * CSS class to add to each result.
1881
- */
1882
- item: string | string[];
1883
- }>;
1869
+ declare type HitsCSSClasses = Partial<HitsClassNames>;
1884
1870
 
1885
1871
  declare type HitSnippetResult = {
1886
1872
  [attribute: string]: HitAttributeSnippetResult[] | HitSnippetResult[] | HitAttributeSnippetResult | HitSnippetResult;
@@ -3431,12 +3417,6 @@ declare type PlacesInstance = Places.PlacesInstance;
3431
3417
 
3432
3418
  declare type PlacesWidget = WidgetFactory<PlacesWidgetDescription, PlacesWidgetParams, PlacesWidgetParams>;
3433
3419
 
3434
- /**
3435
- * This widget sets the geolocation value for the search based on the selected
3436
- * result in the Algolia Places autocomplete.
3437
- */
3438
- declare const placesWidget: PlacesWidget;
3439
-
3440
3420
  declare type PlacesWidgetDescription = {
3441
3421
  $$type: 'ais.places';
3442
3422
  $$widgetType: 'ais.places';
@@ -4263,6 +4243,8 @@ declare type RefinementListRenderState = {
4263
4243
  isFromSearch: boolean;
4264
4244
  /**
4265
4245
  * `true` if a refinement can be applied.
4246
+ * @MAJOR: reconsider how `canRefine` is computed so it both accounts for the
4247
+ * items returned in the main search and in SFFV.
4266
4248
  */
4267
4249
  canRefine: boolean;
4268
4250
  /**
@@ -5563,7 +5545,7 @@ declare namespace widgets {
5563
5545
  numericMenu,
5564
5546
  pagination,
5565
5547
  panel,
5566
- placesWidget as places,
5548
+ _default as places,
5567
5549
  poweredBy,
5568
5550
  queryRuleContext,
5569
5551
  queryRuleCustomData,