instantsearch.js 4.51.0 → 4.52.0

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 (221) hide show
  1. package/cjs/components/Answers/Answers.js +7 -3
  2. package/cjs/components/Breadcrumb/Breadcrumb.js +1 -1
  3. package/cjs/components/ClearRefinements/ClearRefinements.js +1 -1
  4. package/cjs/components/CurrentRefinements/CurrentRefinements.js +1 -1
  5. package/cjs/components/GeoSearchControls/GeoSearchControls.js +1 -1
  6. package/cjs/components/Hits/Hits.js +6 -2
  7. package/cjs/components/InfiniteHits/InfiniteHits.js +7 -3
  8. package/cjs/components/MenuSelect/MenuSelect.js +1 -1
  9. package/cjs/components/Pagination/Pagination.js +1 -1
  10. package/cjs/components/Panel/Panel.js +1 -1
  11. package/cjs/components/RangeInput/RangeInput.js +1 -1
  12. package/cjs/components/RefinementList/RefinementList.js +2 -2
  13. package/cjs/components/Selector/Selector.js +1 -1
  14. package/cjs/components/Slider/Pit.js +1 -1
  15. package/cjs/components/Slider/Slider.js +2 -2
  16. package/cjs/components/Stats/Stats.js +1 -1
  17. package/cjs/components/Template/Template.js +1 -1
  18. package/cjs/connectors/breadcrumb/connectBreadcrumb.js +2 -2
  19. package/cjs/connectors/index.js +4 -3
  20. package/cjs/helpers/reverseHighlight.js +1 -1
  21. package/cjs/helpers/reverseSnippet.js +1 -1
  22. package/cjs/index.js +7 -7
  23. package/cjs/lib/InstantSearch.js +7 -5
  24. package/cjs/lib/insights/listener.js +1 -1
  25. package/cjs/lib/routers/history.js +5 -0
  26. package/cjs/lib/utils/createSendEventForHits.js +1 -5
  27. package/cjs/lib/utils/getRefinements.js +1 -1
  28. package/cjs/lib/utils/index.js +11 -0
  29. package/cjs/lib/utils/omit.js +25 -0
  30. package/cjs/lib/utils/setIndexHelperState.js +1 -1
  31. package/cjs/lib/version.js +1 -1
  32. package/cjs/middlewares/createRouterMiddleware.js +5 -2
  33. package/cjs/widgets/answers/answers.js +5 -5
  34. package/cjs/widgets/breadcrumb/breadcrumb.js +4 -4
  35. package/cjs/widgets/clear-refinements/clear-refinements.js +4 -4
  36. package/cjs/widgets/configure-related-items/configure-related-items.js +1 -1
  37. package/cjs/widgets/current-refinements/current-refinements.js +2 -2
  38. package/cjs/widgets/geo-search/GeoSearchRenderer.js +1 -1
  39. package/cjs/widgets/geo-search/geo-search.js +5 -5
  40. package/cjs/widgets/hierarchical-menu/defaultTemplates.js +1 -1
  41. package/cjs/widgets/hierarchical-menu/hierarchical-menu.js +4 -4
  42. package/cjs/widgets/hits/defaultTemplates.js +2 -1
  43. package/cjs/widgets/hits/hits.js +6 -6
  44. package/cjs/widgets/hits-per-page/hits-per-page.js +2 -2
  45. package/cjs/widgets/index/index.js +11 -3
  46. package/cjs/widgets/index.js +4 -3
  47. package/cjs/widgets/infinite-hits/defaultTemplates.js +2 -1
  48. package/cjs/widgets/infinite-hits/infinite-hits.js +4 -4
  49. package/cjs/widgets/menu/defaultTemplates.js +1 -1
  50. package/cjs/widgets/menu/menu.js +4 -4
  51. package/cjs/widgets/menu-select/menu-select.js +5 -5
  52. package/cjs/widgets/numeric-menu/numeric-menu.js +3 -3
  53. package/cjs/widgets/pagination/pagination.js +2 -2
  54. package/cjs/widgets/panel/panel.js +3 -3
  55. package/cjs/widgets/powered-by/powered-by.js +2 -2
  56. package/cjs/widgets/query-rule-context/query-rule-context.js +1 -1
  57. package/cjs/widgets/query-rule-custom-data/query-rule-custom-data.js +4 -4
  58. package/cjs/widgets/range-input/range-input.js +3 -3
  59. package/cjs/widgets/range-slider/range-slider.js +2 -2
  60. package/cjs/widgets/rating-menu/defaultTemplates.js +1 -1
  61. package/cjs/widgets/rating-menu/rating-menu.js +4 -4
  62. package/cjs/widgets/refinement-list/defaultTemplates.js +1 -1
  63. package/cjs/widgets/refinement-list/refinement-list.js +3 -3
  64. package/cjs/widgets/relevant-sort/relevant-sort.js +4 -4
  65. package/cjs/widgets/search-box/search-box.js +4 -4
  66. package/cjs/widgets/sort-by/sort-by.js +2 -2
  67. package/cjs/widgets/stats/stats.js +4 -4
  68. package/cjs/widgets/toggle-refinement/toggle-refinement.js +4 -4
  69. package/cjs/widgets/voice-search/voice-search.js +4 -4
  70. package/dist/instantsearch.development.d.ts +27 -9
  71. package/dist/instantsearch.development.js +13646 -13611
  72. package/dist/instantsearch.development.js.map +1 -1
  73. package/dist/instantsearch.production.d.ts +27 -9
  74. package/dist/instantsearch.production.min.d.ts +27 -9
  75. package/dist/instantsearch.production.min.js +2 -2
  76. package/dist/instantsearch.production.min.js.map +1 -1
  77. package/es/components/Answers/Answers.d.ts +1 -1
  78. package/es/components/Answers/Answers.js +7 -3
  79. package/es/components/Breadcrumb/Breadcrumb.d.ts +3 -3
  80. package/es/components/Breadcrumb/Breadcrumb.js +1 -1
  81. package/es/components/ClearRefinements/ClearRefinements.d.ts +2 -2
  82. package/es/components/ClearRefinements/ClearRefinements.js +1 -1
  83. package/es/components/CurrentRefinements/CurrentRefinements.d.ts +1 -1
  84. package/es/components/CurrentRefinements/CurrentRefinements.js +1 -1
  85. package/es/components/GeoSearchControls/GeoSearchButton.d.ts +1 -1
  86. package/es/components/GeoSearchControls/GeoSearchControls.d.ts +2 -2
  87. package/es/components/GeoSearchControls/GeoSearchControls.js +1 -1
  88. package/es/components/GeoSearchControls/GeoSearchToggle.d.ts +1 -1
  89. package/es/components/Hits/Hits.d.ts +2 -2
  90. package/es/components/Hits/Hits.js +6 -2
  91. package/es/components/InfiniteHits/InfiniteHits.d.ts +2 -2
  92. package/es/components/InfiniteHits/InfiniteHits.js +7 -3
  93. package/es/components/MenuSelect/MenuSelect.d.ts +1 -1
  94. package/es/components/MenuSelect/MenuSelect.js +1 -1
  95. package/es/components/Pagination/Pagination.d.ts +1 -1
  96. package/es/components/Pagination/Pagination.js +1 -1
  97. package/es/components/Panel/Panel.d.ts +1 -1
  98. package/es/components/Panel/Panel.js +1 -1
  99. package/es/components/RangeInput/RangeInput.d.ts +1 -1
  100. package/es/components/RangeInput/RangeInput.js +1 -1
  101. package/es/components/RefinementList/RefinementList.d.ts +7 -7
  102. package/es/components/RefinementList/RefinementList.js +2 -2
  103. package/es/components/RefinementList/RefinementListItem.d.ts +2 -1
  104. package/es/components/RelevantSort/RelevantSort.d.ts +1 -1
  105. package/es/components/SearchBox/SearchBox.d.ts +1 -1
  106. package/es/components/Selector/Selector.js +1 -1
  107. package/es/components/Slider/Pit.js +1 -1
  108. package/es/components/Slider/Rheostat.d.ts +3 -3
  109. package/es/components/Slider/Slider.d.ts +1 -1
  110. package/es/components/Slider/Slider.js +2 -2
  111. package/es/components/Stats/Stats.d.ts +1 -1
  112. package/es/components/Stats/Stats.js +1 -1
  113. package/es/components/Template/Template.d.ts +4 -4
  114. package/es/components/Template/Template.js +1 -1
  115. package/es/components/VoiceSearch/VoiceSearch.d.ts +1 -1
  116. package/es/connectors/autocomplete/connectAutocomplete.d.ts +1 -1
  117. package/es/connectors/breadcrumb/connectBreadcrumb.js +2 -2
  118. package/es/connectors/configure/connectConfigure.d.ts +1 -1
  119. package/es/connectors/configure/connectConfigure.js +0 -5
  120. package/es/connectors/configure-related-items/connectConfigureRelatedItems.d.ts +1 -1
  121. package/es/connectors/hierarchical-menu/connectHierarchicalMenu.d.ts +1 -1
  122. package/es/connectors/index.d.ts +6 -6
  123. package/es/connectors/index.js +10 -10
  124. package/es/connectors/infinite-hits/connectInfiniteHits.d.ts +2 -2
  125. package/es/connectors/menu/connectMenu.d.ts +1 -1
  126. package/es/connectors/rating-menu/connectRatingMenu.d.ts +1 -1
  127. package/es/connectors/refinement-list/connectRefinementList.d.ts +1 -1
  128. package/es/connectors/voice-search/connectVoiceSearch.d.ts +2 -2
  129. package/es/helpers/components/Highlight.d.ts +1 -1
  130. package/es/helpers/components/ReverseHighlight.d.ts +1 -1
  131. package/es/helpers/components/ReverseSnippet.d.ts +1 -1
  132. package/es/helpers/components/Snippet.d.ts +1 -1
  133. package/es/helpers/reverseHighlight.js +1 -1
  134. package/es/helpers/reverseSnippet.js +1 -1
  135. package/es/index.d.ts +3 -3
  136. package/es/index.js +2 -2
  137. package/es/lib/InstantSearch.d.ts +5 -4
  138. package/es/lib/InstantSearch.js +7 -5
  139. package/es/lib/insights/client.d.ts +1 -1
  140. package/es/lib/insights/listener.d.ts +1 -1
  141. package/es/lib/insights/listener.js +1 -1
  142. package/es/lib/routers/history.d.ts +1 -0
  143. package/es/lib/routers/history.js +5 -0
  144. package/es/lib/templating/renderTemplate.d.ts +1 -1
  145. package/es/lib/utils/checkIndexUiState.d.ts +1 -1
  146. package/es/lib/utils/checkIndexUiState.js +0 -1
  147. package/es/lib/utils/createSendEventForFacet.d.ts +1 -1
  148. package/es/lib/utils/createSendEventForHits.js +1 -5
  149. package/es/lib/utils/getRefinements.js +1 -1
  150. package/es/lib/utils/index.d.ts +1 -0
  151. package/es/lib/utils/index.js +1 -0
  152. package/es/lib/utils/omit.d.ts +7 -0
  153. package/es/lib/utils/omit.js +19 -0
  154. package/es/lib/utils/render-args.d.ts +2 -2
  155. package/es/lib/utils/resolveSearchParameters.d.ts +1 -1
  156. package/es/lib/utils/setIndexHelperState.js +1 -1
  157. package/es/lib/version.d.ts +1 -1
  158. package/es/lib/version.js +1 -1
  159. package/es/middlewares/createRouterMiddleware.js +5 -2
  160. package/es/types/connector.d.ts +2 -2
  161. package/es/types/index.d.ts +1 -0
  162. package/es/types/index.js +4 -1
  163. package/es/types/router.d.ts +4 -0
  164. package/es/types/templates.d.ts +2 -2
  165. package/es/types/widget.d.ts +2 -2
  166. package/es/widgets/analytics/analytics.d.ts +1 -1
  167. package/es/widgets/answers/answers.d.ts +1 -1
  168. package/es/widgets/answers/answers.js +5 -5
  169. package/es/widgets/breadcrumb/breadcrumb.js +4 -4
  170. package/es/widgets/clear-refinements/clear-refinements.js +4 -4
  171. package/es/widgets/configure/configure.js +0 -6
  172. package/es/widgets/configure-related-items/configure-related-items.d.ts +1 -1
  173. package/es/widgets/configure-related-items/configure-related-items.js +1 -1
  174. package/es/widgets/current-refinements/current-refinements.js +2 -2
  175. package/es/widgets/geo-search/GeoSearchRenderer.js +1 -1
  176. package/es/widgets/geo-search/geo-search.d.ts +1 -1
  177. package/es/widgets/geo-search/geo-search.js +5 -5
  178. package/es/widgets/hierarchical-menu/defaultTemplates.js +1 -1
  179. package/es/widgets/hierarchical-menu/hierarchical-menu.js +4 -4
  180. package/es/widgets/hits/defaultTemplates.js +2 -1
  181. package/es/widgets/hits/hits.d.ts +1 -0
  182. package/es/widgets/hits/hits.js +6 -6
  183. package/es/widgets/hits-per-page/hits-per-page.js +2 -2
  184. package/es/widgets/index/index.d.ts +13 -3
  185. package/es/widgets/index/index.js +11 -3
  186. package/es/widgets/index.d.ts +6 -6
  187. package/es/widgets/index.js +9 -7
  188. package/es/widgets/infinite-hits/defaultTemplates.js +2 -1
  189. package/es/widgets/infinite-hits/infinite-hits.d.ts +2 -1
  190. package/es/widgets/infinite-hits/infinite-hits.js +4 -4
  191. package/es/widgets/menu/defaultTemplates.js +1 -1
  192. package/es/widgets/menu/menu.js +4 -4
  193. package/es/widgets/menu-select/menu-select.js +5 -5
  194. package/es/widgets/numeric-menu/numeric-menu.js +3 -3
  195. package/es/widgets/pagination/pagination.js +2 -2
  196. package/es/widgets/panel/panel.js +3 -3
  197. package/es/widgets/places/places.d.ts +1 -1
  198. package/es/widgets/powered-by/powered-by.js +2 -2
  199. package/es/widgets/query-rule-context/query-rule-context.d.ts +1 -1
  200. package/es/widgets/query-rule-context/query-rule-context.js +1 -1
  201. package/es/widgets/query-rule-custom-data/query-rule-custom-data.d.ts +2 -2
  202. package/es/widgets/query-rule-custom-data/query-rule-custom-data.js +4 -4
  203. package/es/widgets/range-input/range-input.js +3 -3
  204. package/es/widgets/range-slider/range-slider.js +2 -2
  205. package/es/widgets/rating-menu/defaultTemplates.js +1 -1
  206. package/es/widgets/rating-menu/rating-menu.js +4 -4
  207. package/es/widgets/refinement-list/defaultTemplates.js +1 -1
  208. package/es/widgets/refinement-list/refinement-list.js +3 -3
  209. package/es/widgets/relevant-sort/relevant-sort.d.ts +1 -1
  210. package/es/widgets/relevant-sort/relevant-sort.js +4 -4
  211. package/es/widgets/search-box/search-box.d.ts +2 -2
  212. package/es/widgets/search-box/search-box.js +4 -4
  213. package/es/widgets/sort-by/sort-by.js +2 -2
  214. package/es/widgets/stats/stats.js +4 -4
  215. package/es/widgets/toggle-refinement/toggle-refinement.js +4 -4
  216. package/es/widgets/voice-search/voice-search.d.ts +2 -2
  217. package/es/widgets/voice-search/voice-search.js +4 -4
  218. package/package.json +5 -5
  219. package/cjs/lib/utils/detect-insights-client.js +0 -17
  220. package/es/lib/utils/detect-insights-client.d.ts +0 -1
  221. package/es/lib/utils/detect-insights-client.js +0 -11
@@ -1,3 +1,9 @@
1
+ import connectDynamicWidgets from './dynamic-widgets/connectDynamicWidgets';
2
+ /** @deprecated answers is no longer supported */
3
+ export declare const EXPERIMENTAL_connectAnswers: import("./answers/connectAnswers").AnswersConnector;
4
+ /** @deprecated use connectDynamicWidgets */
5
+ export declare const EXPERIMENTAL_connectDynamicWidgets: import("./dynamic-widgets/connectDynamicWidgets").DynamicWidgetsConnector;
6
+ export { connectDynamicWidgets };
1
7
  export { default as connectClearRefinements } from './clear-refinements/connectClearRefinements';
2
8
  export { default as connectCurrentRefinements } from './current-refinements/connectCurrentRefinements';
3
9
  export { default as connectHierarchicalMenu } from './hierarchical-menu/connectHierarchicalMenu';
@@ -24,10 +30,4 @@ export { default as EXPERIMENTAL_connectConfigureRelatedItems } from './configur
24
30
  export { default as connectAutocomplete } from './autocomplete/connectAutocomplete';
25
31
  export { default as connectQueryRules } from './query-rules/connectQueryRules';
26
32
  export { default as connectVoiceSearch } from './voice-search/connectVoiceSearch';
27
- /** @deprecated answers is no longer supported */
28
- export declare const EXPERIMENTAL_connectAnswers: import("./answers/connectAnswers").AnswersConnector;
29
33
  export { default as connectRelevantSort } from './relevant-sort/connectRelevantSort';
30
- import connectDynamicWidgets from './dynamic-widgets/connectDynamicWidgets';
31
- export { connectDynamicWidgets };
32
- /** @deprecated use connectDynamicWidgets */
33
- export declare const EXPERIMENTAL_connectDynamicWidgets: import("./dynamic-widgets/connectDynamicWidgets").DynamicWidgetsConnector;
@@ -1,4 +1,13 @@
1
1
  import { deprecate } from "../lib/utils/index.js";
2
+ import connectAnswers from "./answers/connectAnswers.js";
3
+ import connectDynamicWidgets from "./dynamic-widgets/connectDynamicWidgets.js";
4
+
5
+ /** @deprecated answers is no longer supported */
6
+ export var EXPERIMENTAL_connectAnswers = deprecate(connectAnswers, 'answers is no longer supported');
7
+
8
+ /** @deprecated use connectDynamicWidgets */
9
+ export var EXPERIMENTAL_connectDynamicWidgets = deprecate(connectDynamicWidgets, 'use connectDynamicWidgets');
10
+ export { connectDynamicWidgets };
2
11
  export { default as connectClearRefinements } from "./clear-refinements/connectClearRefinements.js";
3
12
  export { default as connectCurrentRefinements } from "./current-refinements/connectCurrentRefinements.js";
4
13
  export { default as connectHierarchicalMenu } from "./hierarchical-menu/connectHierarchicalMenu.js";
@@ -25,13 +34,4 @@ export { default as EXPERIMENTAL_connectConfigureRelatedItems } from "./configur
25
34
  export { default as connectAutocomplete } from "./autocomplete/connectAutocomplete.js";
26
35
  export { default as connectQueryRules } from "./query-rules/connectQueryRules.js";
27
36
  export { default as connectVoiceSearch } from "./voice-search/connectVoiceSearch.js";
28
- import connectAnswers from "./answers/connectAnswers.js";
29
-
30
- /** @deprecated answers is no longer supported */
31
- export var EXPERIMENTAL_connectAnswers = deprecate(connectAnswers, 'answers is no longer supported');
32
- export { default as connectRelevantSort } from "./relevant-sort/connectRelevantSort.js";
33
- import connectDynamicWidgets from "./dynamic-widgets/connectDynamicWidgets.js";
34
- export { connectDynamicWidgets };
35
-
36
- /** @deprecated use connectDynamicWidgets */
37
- export var EXPERIMENTAL_connectDynamicWidgets = deprecate(connectDynamicWidgets, 'use connectDynamicWidgets');
37
+ export { default as connectRelevantSort } from "./relevant-sort/connectRelevantSort.js";
@@ -1,6 +1,6 @@
1
- import type { PlainSearchParameters, SearchResults } from 'algoliasearch-helper';
2
- import type { Connector, TransformItems, Hit, WidgetRenderState, BaseHit } from '../../types';
3
1
  import type { SendEventForHits, BindEventForHits } from '../../lib/utils';
2
+ import type { Connector, TransformItems, Hit, WidgetRenderState, BaseHit } from '../../types';
3
+ import type { PlainSearchParameters, SearchResults } from 'algoliasearch-helper';
4
4
  export type InfiniteHitsCachedHits<THit extends BaseHit> = {
5
5
  [page: number]: Array<Hit<THit>>;
6
6
  };
@@ -1,6 +1,6 @@
1
- import type { SearchResults } from 'algoliasearch-helper';
2
1
  import type { SendEventForFacet } from '../../lib/utils';
3
2
  import type { Connector, CreateURL, SortBy, TransformItems, WidgetRenderState } from '../../types';
3
+ import type { SearchResults } from 'algoliasearch-helper';
4
4
  export type MenuItem = {
5
5
  /**
6
6
  * The value of the menu item.
@@ -1,5 +1,5 @@
1
- import type { Connector, CreateURL, WidgetRenderState } from '../../types';
2
1
  import type { InsightsEvent } from '../../middlewares';
2
+ import type { Connector, CreateURL, WidgetRenderState } from '../../types';
3
3
  type SendEvent = (...args: [InsightsEvent] | [string, string, string?]) => void;
4
4
  type StarRatingItems = {
5
5
  /**
@@ -1,6 +1,6 @@
1
- import type { SearchResults } from 'algoliasearch-helper';
2
1
  import type { SendEventForFacet } from '../../lib/utils';
3
2
  import type { Connector, TransformItems, SortBy, CreateURL, WidgetRenderState } from '../../types';
3
+ import type { SearchResults } from 'algoliasearch-helper';
4
4
  export type RefinementListItem = {
5
5
  /**
6
6
  * The value of the refinement list item.
@@ -1,6 +1,6 @@
1
- import type { PlainSearchParameters } from 'algoliasearch-helper';
2
- import type { Connector, WidgetRenderState } from '../../types';
3
1
  import type { CreateVoiceSearchHelper, VoiceListeningState } from '../../lib/voiceSearchHelper/types';
2
+ import type { Connector, WidgetRenderState } from '../../types';
3
+ import type { PlainSearchParameters } from 'algoliasearch-helper';
4
4
  export type VoiceSearchConnectorParams = {
5
5
  searchAsYouSpeak?: boolean;
6
6
  language?: string;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { h } from 'preact';
3
- import type { BaseHit, Hit, PartialKeys } from '../../types';
4
3
  import type { HighlightProps as HighlightUiComponentProps } from '../../components/Highlight/Highlight';
4
+ import type { BaseHit, Hit, PartialKeys } from '../../types';
5
5
  export type HighlightProps<THit extends Hit<BaseHit>> = {
6
6
  hit: THit;
7
7
  attribute: keyof THit | string[];
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { h } from 'preact';
3
- import type { BaseHit, Hit, PartialKeys } from '../../types';
4
3
  import type { ReverseHighlightProps as ReverseHighlightUiComponentProps } from '../../components/ReverseHighlight/ReverseHighlight';
4
+ import type { BaseHit, Hit, PartialKeys } from '../../types';
5
5
  export type ReverseHighlightProps<THit extends Hit<BaseHit>> = {
6
6
  hit: THit;
7
7
  attribute: keyof THit | string[];
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { h } from 'preact';
3
- import type { BaseHit, Hit, PartialKeys } from '../../types';
4
3
  import type { ReverseSnippetProps as ReverseSnippetUiComponentProps } from '../../components/ReverseSnippet/ReverseSnippet';
4
+ import type { BaseHit, Hit, PartialKeys } from '../../types';
5
5
  export type ReverseSnippetProps<THit extends Hit<BaseHit>> = {
6
6
  hit: THit;
7
7
  attribute: keyof THit | string[];
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { h } from 'preact';
3
- import type { BaseHit, Hit, PartialKeys } from '../../types';
4
3
  import type { SnippetProps as SnippetUiComponentProps } from '../../components/Snippet/Snippet';
4
+ import type { BaseHit, Hit, PartialKeys } from '../../types';
5
5
  export type SnippetProps<THit extends Hit<BaseHit>> = {
6
6
  hit: THit;
7
7
  attribute: keyof THit | string[];
@@ -1,5 +1,5 @@
1
- import { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts, warning } from "../lib/utils/index.js";
2
1
  import { component } from "../lib/suit.js";
2
+ import { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts, warning } from "../lib/utils/index.js";
3
3
  var suit = component('ReverseHighlight');
4
4
  export default function reverseHighlight(_ref) {
5
5
  var attribute = _ref.attribute,
@@ -1,5 +1,5 @@
1
- import { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts, warning } from "../lib/utils/index.js";
2
1
  import { component } from "../lib/suit.js";
2
+ import { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts, warning } from "../lib/utils/index.js";
3
3
  var suit = component('ReverseSnippet');
4
4
  export default function reverseSnippet(_ref) {
5
5
  var attribute = _ref.attribute,
package/es/index.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import type { Expand, UiState } from './types';
2
- import type { InstantSearchOptions } from './lib/InstantSearch';
3
- import InstantSearch from './lib/InstantSearch';
4
1
  import { snippet, reverseSnippet, highlight, reverseHighlight, insights, getInsightsAnonymousUserToken } from './helpers';
5
2
  import { createInfiniteHitsSessionStorageCache } from './lib/infiniteHitsCache';
3
+ import InstantSearch from './lib/InstantSearch';
4
+ import type { InstantSearchOptions } from './lib/InstantSearch';
5
+ import type { Expand, UiState } from './types';
6
6
  type InstantSearchModule = {
7
7
  <TUiState = Record<string, unknown>, TRouteState = TUiState>(options: InstantSearchOptions<Expand<UiState & TUiState>, TRouteState>): InstantSearch<Expand<UiState & TUiState>, TRouteState>;
8
8
  version: string;
package/es/index.js CHANGED
@@ -1,8 +1,8 @@
1
- import InstantSearch from "./lib/InstantSearch.js";
2
- import version from "./lib/version.js";
3
1
  import { snippet, reverseSnippet, highlight, reverseHighlight, insights, getInsightsAnonymousUserToken } from "./helpers/index.js";
4
2
  import { createInfiniteHitsSessionStorageCache } from "./lib/infiniteHitsCache/index.js";
3
+ import InstantSearch from "./lib/InstantSearch.js";
5
4
  import { deprecate } from "./lib/utils/index.js";
5
+ import version from "./lib/version.js";
6
6
  /**
7
7
  * InstantSearch is the main component of InstantSearch.js. This object
8
8
  * manages the widget and lets you add new ones.
@@ -1,9 +1,9 @@
1
- import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
2
1
  import EventEmitter from '@algolia/events';
3
- import type { IndexWidget } from '../widgets/index/index';
4
- import type { InsightsClient as AlgoliaInsightsClient, SearchClient, Widget, UiState, CreateURL, Middleware, MiddlewareDefinition, RenderState, InitialResults } from '../types';
5
- import type { RouterProps } from '../middlewares/createRouterMiddleware';
6
2
  import type { InsightsEvent } from '../middlewares/createInsightsMiddleware';
3
+ import type { RouterProps } from '../middlewares/createRouterMiddleware';
4
+ import type { InsightsClient as AlgoliaInsightsClient, SearchClient, Widget, UiState, CreateURL, Middleware, MiddlewareDefinition, RenderState, InitialResults } from '../types';
5
+ import type { IndexWidget } from '../widgets/index/index';
6
+ import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
7
7
  type NoInfer<T> = T extends infer S ? S : never;
8
8
  /**
9
9
  * Global options for an InstantSearch instance.
@@ -50,6 +50,7 @@ export type InstantSearchOptions<TUiState extends UiState = UiState, TRouteState
50
50
  * A hook that will be called each time a search needs to be done, with the
51
51
  * helper as a parameter. It's your responsibility to call `helper.search()`.
52
52
  * This option allows you to avoid doing searches at page load for example.
53
+ * @deprecated use onStateChange instead
53
54
  */
54
55
  searchFunction?: (helper: AlgoliaSearchHelper) => void;
55
56
  /**
@@ -14,14 +14,14 @@ function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.g
14
14
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
15
15
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
16
16
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
17
- import algoliasearchHelper from 'algoliasearch-helper';
18
17
  import EventEmitter from '@algolia/events';
18
+ import algoliasearchHelper from 'algoliasearch-helper';
19
+ import { createMetadataMiddleware, isMetadataEnabled } from "../middlewares/createMetadataMiddleware.js";
20
+ import { createRouterMiddleware } from "../middlewares/createRouterMiddleware.js";
19
21
  import index from "../widgets/index/index.js";
20
- import version from "./version.js";
21
22
  import createHelpers from "./createHelpers.js";
22
23
  import { createDocumentationMessageGenerator, createDocumentationLink, defer, noop, warning, setIndexHelperState } from "./utils/index.js";
23
- import { createRouterMiddleware } from "../middlewares/createRouterMiddleware.js";
24
- import { createMetadataMiddleware, isMetadataEnabled } from "../middlewares/createMetadataMiddleware.js";
24
+ import version from "./version.js";
25
25
  var withUsage = createDocumentationMessageGenerator({
26
26
  name: 'instantsearch'
27
27
  });
@@ -155,6 +155,7 @@ var InstantSearch = /*#__PURE__*/function (_EventEmitter) {
155
155
  _this._initialUiState = initialUiState;
156
156
  _this._initialResults = null;
157
157
  if (searchFunction) {
158
+ process.env.NODE_ENV === 'development' ? warning(false, "The `searchFunction` option is deprecated. Use `onStateChange` instead.") : void 0;
158
159
  _this._searchFunction = searchFunction;
159
160
  }
160
161
  _this.sendEventToInsights = noop;
@@ -463,6 +464,7 @@ var InstantSearch = /*#__PURE__*/function (_EventEmitter) {
463
464
  }, {
464
465
  key: "dispose",
465
466
  value: function dispose() {
467
+ var _this$mainHelper2;
466
468
  this.scheduleSearch.cancel();
467
469
  this.scheduleRender.cancel();
468
470
  clearTimeout(this._searchStalledTimer);
@@ -477,7 +479,7 @@ var InstantSearch = /*#__PURE__*/function (_EventEmitter) {
477
479
  // The helper needs to be reset to perform the next search from a fresh state.
478
480
  // If not reset, it would use the state stored before calling `dispose()`.
479
481
  this.removeAllListeners();
480
- this.mainHelper.removeAllListeners();
482
+ (_this$mainHelper2 = this.mainHelper) === null || _this$mainHelper2 === void 0 ? void 0 : _this$mainHelper2.removeAllListeners();
481
483
  this.mainHelper = null;
482
484
  this.helper = null;
483
485
  this.middleware.forEach(function (_ref7) {
@@ -1,5 +1,5 @@
1
- import type { SearchResults } from 'algoliasearch-helper';
2
1
  import type { Hit, InsightsClientMethod, InsightsClientPayload, Connector } from '../../types';
2
+ import type { SearchResults } from 'algoliasearch-helper';
3
3
  export declare const inferPayload: ({ method, results, hits, objectIDs, }: {
4
4
  method: InsightsClientMethod;
5
5
  results: SearchResults;
@@ -1,7 +1,7 @@
1
1
 
2
2
  import { h } from 'preact';
3
- import type { InsightsClient } from '../../types';
4
3
  import type { InsightsEvent } from '../../middlewares/createInsightsMiddleware';
4
+ import type { InsightsClient } from '../../types';
5
5
  type WithInsightsListenerProps = {
6
6
  [key: string]: unknown;
7
7
  insights: InsightsClient;
@@ -1,6 +1,6 @@
1
1
  import { h } from 'preact';
2
- import { deserializePayload } from "../utils/index.js";
3
2
  import { readDataAttributes, hasDataAttributes } from "../../helpers/insights.js";
3
+ import { deserializePayload } from "../utils/index.js";
4
4
  var findInsightsTarget = function findInsightsTarget(startElement, endElement, validator) {
5
5
  var element = startElement;
6
6
  while (element && !validator(element)) {
@@ -97,6 +97,7 @@ declare class BrowserHistory<TRouteState> implements Router<TRouteState> {
97
97
  * Removes the event listener and cleans up the URL.
98
98
  */
99
99
  dispose(): void;
100
+ start(): void;
100
101
  private shouldWrite;
101
102
  }
102
103
  export default function historyRouter<TRouteState = UiState>({ createURL, parseURL, writeDelay, windowTitle, getLocation, start, dispose, push, }?: Partial<BrowserHistoryArgs<TRouteState>>): BrowserHistory<TRouteState>;
@@ -171,6 +171,11 @@ var BrowserHistory = /*#__PURE__*/function () {
171
171
  }
172
172
  this.write({});
173
173
  }
174
+ }, {
175
+ key: "start",
176
+ value: function start() {
177
+ this.isDisposed = false;
178
+ }
174
179
  }, {
175
180
  key: "shouldWrite",
176
181
  value: function shouldWrite(url) {
@@ -1,6 +1,6 @@
1
- import type { HoganOptions } from 'hogan.js';
2
1
  import type { Templates, HoganHelpers } from '../../types';
3
2
  import type { BindEventForHits, SendEventForHits } from '../utils/createSendEventForHits';
3
+ import type { HoganOptions } from 'hogan.js';
4
4
  export declare function renderTemplate({ templates, templateKey, compileOptions, helpers, data, bindEvent, sendEvent, }: {
5
5
  templates: Templates;
6
6
  templateKey: string;
@@ -1,5 +1,5 @@
1
- import type { IndexWidget } from '../../widgets/index/index';
2
1
  import type { IndexUiState } from '../../types';
2
+ import type { IndexWidget } from '../../widgets/index/index';
3
3
  type CheckIndexUiStateParams = {
4
4
  index: IndexWidget;
5
5
  indexUiState: IndexUiState;
@@ -11,7 +11,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
11
11
  import { capitalize } from "./capitalize.js";
12
12
  import { warning } from "./logger.js";
13
13
  import { keys } from "./typedObject.js";
14
-
15
14
  // Some connectors are responsible for multiple widgets so we need
16
15
  // to map them.
17
16
  function getWidgetNames(connectorName) {
@@ -1,5 +1,5 @@
1
- import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
2
1
  import type { InstantSearch } from '../../types';
2
+ import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
3
3
  type BuiltInSendEventForFacet = (eventType: string, facetValue: string, eventName?: string) => void;
4
4
  type CustomSendEventForFacet = (customPayload: any) => void;
5
5
  export type SendEventForFacet = BuiltInSendEventForFacet & CustomSendEventForFacet;
@@ -35,7 +35,7 @@ var buildPayloads = function buildPayloads(_ref) {
35
35
  return [];
36
36
  }
37
37
  }
38
- var hitsArray = Array.isArray(hits) ? removeEscapedFromHits(hits) : [hits];
38
+ var hitsArray = Array.isArray(hits) ? hits : [hits];
39
39
  if (hitsArray.length === 0) {
40
40
  return [];
41
41
  }
@@ -105,10 +105,6 @@ var buildPayloads = function buildPayloads(_ref) {
105
105
  return [];
106
106
  }
107
107
  };
108
- function removeEscapedFromHits(hits) {
109
- // remove `hits.__escaped` without mutating
110
- return hits.slice();
111
- }
112
108
  export function createSendEventForHits(_ref2) {
113
109
  var instantSearchInstance = _ref2.instantSearchInstance,
114
110
  index = _ref2.index,
@@ -1,5 +1,5 @@
1
- import { find } from "./find.js";
2
1
  import { unescapeFacetValue, escapeFacetValue } from "./escapeFacetValue.js";
2
+ import { find } from "./find.js";
3
3
  function getRefinement(state, type, attribute, name) {
4
4
  var resultsFacets = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : [];
5
5
  var res = {
@@ -35,6 +35,7 @@ export * from './isPlainObject';
35
35
  export * from './isSpecialClick';
36
36
  export * from './logger';
37
37
  export * from './mergeSearchParameters';
38
+ export * from './omit';
38
39
  export * from './noop';
39
40
  export * from './range';
40
41
  export * from './render-args';
@@ -35,6 +35,7 @@ export * from "./isPlainObject.js";
35
35
  export * from "./isSpecialClick.js";
36
36
  export * from "./logger.js";
37
37
  export * from "./mergeSearchParameters.js";
38
+ export * from "./omit.js";
38
39
  export * from "./noop.js";
39
40
  export * from "./range.js";
40
41
  export * from "./render-args.js";
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Creates a new object with the same keys as the original object, but without the excluded keys.
3
+ * @param source original object
4
+ * @param excluded keys to remove from the original object
5
+ * @returns the new object
6
+ */
7
+ export declare function omit<TSource extends Record<string, unknown>, TExcluded extends keyof TSource>(source: TSource, excluded: TExcluded[]): Omit<TSource, TExcluded>;
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Creates a new object with the same keys as the original object, but without the excluded keys.
3
+ * @param source original object
4
+ * @param excluded keys to remove from the original object
5
+ * @returns the new object
6
+ */
7
+ export function omit(source, excluded) {
8
+ if (source === null || source === undefined) {
9
+ return source;
10
+ }
11
+ return Object.keys(source).reduce(function (target, key) {
12
+ if (excluded.indexOf(key) >= 0) {
13
+ return target;
14
+ }
15
+ var validKey = key;
16
+ target[validKey] = source[validKey];
17
+ return target;
18
+ }, {});
19
+ }
@@ -3,7 +3,7 @@ import type { IndexWidget } from '../../widgets/index/index';
3
3
  export declare function createInitArgs(instantSearchInstance: InstantSearch, parent: IndexWidget, uiState: UiState): {
4
4
  uiState: UiState;
5
5
  helper: import("algoliasearch-helper").AlgoliaSearchHelper;
6
- parent: IndexWidget;
6
+ parent: IndexWidget<UiState>;
7
7
  instantSearchInstance: InstantSearch<UiState, UiState>;
8
8
  state: import("algoliasearch-helper").SearchParameters;
9
9
  renderState: import("../../types").RenderState;
@@ -18,7 +18,7 @@ export declare function createInitArgs(instantSearchInstance: InstantSearch, par
18
18
  };
19
19
  export declare function createRenderArgs(instantSearchInstance: InstantSearch, parent: IndexWidget): {
20
20
  helper: import("algoliasearch-helper").AlgoliaSearchHelper;
21
- parent: IndexWidget;
21
+ parent: IndexWidget<UiState>;
22
22
  instantSearchInstance: InstantSearch<UiState, UiState>;
23
23
  results: import("algoliasearch-helper").SearchResults<any>;
24
24
  scopedResults: import("../../types").ScopedResult[];
@@ -1,3 +1,3 @@
1
- import type { SearchParameters } from 'algoliasearch-helper';
2
1
  import type { IndexWidget } from '../../widgets/index/index';
2
+ import type { SearchParameters } from 'algoliasearch-helper';
3
3
  export declare function resolveSearchParameters(current: IndexWidget): SearchParameters[];
@@ -1,5 +1,5 @@
1
- import { isIndexWidget } from "./isIndexWidget.js";
2
1
  import { checkIndexUiState } from "./checkIndexUiState.js";
2
+ import { isIndexWidget } from "./isIndexWidget.js";
3
3
  export function setIndexHelperState(finalUiState, indexWidget) {
4
4
  var nextIndexUiState = finalUiState[indexWidget.getIndexId()] || {};
5
5
  if (process.env.NODE_ENV === 'development') {
@@ -1,2 +1,2 @@
1
- declare const _default: "4.51.0";
1
+ declare const _default: "4.52.0";
2
2
  export default _default;
package/es/lib/version.js CHANGED
@@ -1 +1 @@
1
- export default '4.51.0';
1
+ export default '4.52.0';
@@ -4,8 +4,8 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import simpleStateMapping from "../lib/stateMappings/simple.js";
8
7
  import historyRouter from "../lib/routers/history.js";
8
+ import simpleStateMapping from "../lib/stateMappings/simple.js";
9
9
  import { isEqual } from "../lib/utils/index.js";
10
10
  export var createRouterMiddleware = function createRouterMiddleware() {
11
11
  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
@@ -43,7 +43,10 @@ export var createRouterMiddleware = function createRouterMiddleware() {
43
43
  instantSearchInstance.setUiState(stateMapping.routeToState(route));
44
44
  });
45
45
  },
46
- started: function started() {},
46
+ started: function started() {
47
+ var _router$start;
48
+ (_router$start = router.start) === null || _router$start === void 0 ? void 0 : _router$start.call(router);
49
+ },
47
50
  unsubscribe: function unsubscribe() {
48
51
  router.dispose();
49
52
  }
@@ -1,8 +1,8 @@
1
- import type { SearchResults } from 'algoliasearch-helper';
2
- import type { InstantSearch } from './instantsearch';
3
1
  import type { InsightsClient } from './insights';
2
+ import type { InstantSearch } from './instantsearch';
4
3
  import type { Hit } from './results';
5
4
  import type { UnknownWidgetParams, Widget, WidgetDescription } from './widget';
5
+ import type { SearchResults } from 'algoliasearch-helper';
6
6
  /**
7
7
  * The base renderer options. All render functions receive
8
8
  * the options below plus the specific options per connector.
@@ -12,3 +12,4 @@ export * from './widget';
12
12
  export * from './ui-state';
13
13
  export * from './render-state';
14
14
  export * from './templates';
15
+ export type { IndexWidget } from '../widgets/index/index';
package/es/types/index.js CHANGED
@@ -21,4 +21,7 @@ export * from "./widget-factory.js";
21
21
  export * from "./widget.js";
22
22
  export * from "./ui-state.js";
23
23
  export * from "./render-state.js";
24
- export * from "./templates.js";
24
+ export * from "./templates.js";
25
+
26
+ // from specific widgets
27
+ export {};
@@ -30,6 +30,10 @@ export type Router<TRouteState = UiState> = {
30
30
  * Called when InstantSearch is disposed. Used to remove subscriptions.
31
31
  */
32
32
  dispose(): void;
33
+ /**
34
+ * Called when InstantSearch is started.
35
+ */
36
+ start?: () => void;
33
37
  };
34
38
  /**
35
39
  * The state mapping is a way to customize the structure before sending it to the router.
@@ -1,7 +1,7 @@
1
- import type { VNode } from 'preact';
2
1
  import type { Highlight, ReverseHighlight, ReverseSnippet, Snippet } from '../helpers/components';
3
- import type { html } from 'htm/preact';
4
2
  import type { BuiltInBindEventForHits, CustomBindEventForHits, SendEventForHits } from '../lib/utils';
3
+ import type { html } from 'htm/preact';
4
+ import type { VNode } from 'preact';
5
5
  export type Template<TTemplateData = void> = string | ((data: TTemplateData, params: TemplateParams) => VNode | VNode[] | string);
6
6
  export type TemplateParams = {
7
7
  html: typeof html;
@@ -1,9 +1,9 @@
1
1
  import type { IndexWidget } from '../widgets/index/index';
2
- import type { AlgoliaSearchHelper as Helper, SearchParameters, SearchResults } from 'algoliasearch-helper';
3
2
  import type { InstantSearch } from './instantsearch';
4
- import type { IndexUiState, UiState } from './ui-state';
5
3
  import type { IndexRenderState, WidgetRenderState } from './render-state';
4
+ import type { IndexUiState, UiState } from './ui-state';
6
5
  import type { Expand, RequiredKeys } from './utils';
6
+ import type { AlgoliaSearchHelper as Helper, SearchParameters, SearchResults } from 'algoliasearch-helper';
7
7
  export type ScopedResult = {
8
8
  indexId: string;
9
9
  results: SearchResults;
@@ -1,5 +1,5 @@
1
- import type { SearchParameters, SearchResults } from 'algoliasearch-helper';
2
1
  import type { WidgetFactory, WidgetRenderState } from '../../types';
2
+ import type { SearchParameters, SearchResults } from 'algoliasearch-helper';
3
3
  export type AnalyticsWidgetParamsPushFunction = (
4
4
  /**
5
5
  * Contains the search parameters, serialized as a query string.
@@ -1,6 +1,6 @@
1
1
 
2
- import type { WidgetFactory, Template, Hit } from '../../types';
3
2
  import type { AnswersConnectorParams, AnswersWidgetDescription } from '../../connectors/answers/connectAnswers';
3
+ import type { WidgetFactory, Template, Hit } from '../../types';
4
4
  export type AnswersTemplates = Partial<{
5
5
  /**
6
6
  * Template to use for the header. This template will receive an object containing `hits` and `isLoading`.
@@ -4,14 +4,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import { h, render } from 'preact';
8
7
  import { cx } from '@algolia/ui-components-shared';
9
- import defaultTemplates from "./defaultTemplates.js";
10
- import { createDocumentationMessageGenerator, getContainerNode } from "../../lib/utils/index.js";
11
- import { prepareTemplateProps } from "../../lib/templating/index.js";
12
- import { component } from "../../lib/suit.js";
8
+ import { h, render } from 'preact';
13
9
  import Answers from "../../components/Answers/Answers.js";
14
10
  import connectAnswers from "../../connectors/answers/connectAnswers.js";
11
+ import { component } from "../../lib/suit.js";
12
+ import { prepareTemplateProps } from "../../lib/templating/index.js";
13
+ import { createDocumentationMessageGenerator, getContainerNode } from "../../lib/utils/index.js";
14
+ import defaultTemplates from "./defaultTemplates.js";
15
15
  var withUsage = createDocumentationMessageGenerator({
16
16
  name: 'answers'
17
17
  });
@@ -4,14 +4,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
5
  function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
6
  function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- import { h, render } from 'preact';
8
7
  import { cx } from '@algolia/ui-components-shared';
8
+ import { h, render } from 'preact';
9
9
  import Breadcrumb from "../../components/Breadcrumb/Breadcrumb.js";
10
10
  import connectBreadcrumb from "../../connectors/breadcrumb/connectBreadcrumb.js";
11
- import defaultTemplates from "./defaultTemplates.js";
12
- import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
13
- import { prepareTemplateProps } from "../../lib/templating/index.js";
14
11
  import { component } from "../../lib/suit.js";
12
+ import { prepareTemplateProps } from "../../lib/templating/index.js";
13
+ import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
14
+ import defaultTemplates from "./defaultTemplates.js";
15
15
  var withUsage = createDocumentationMessageGenerator({
16
16
  name: 'breadcrumb'
17
17
  });