instantsearch.js 4.46.0 → 4.46.2

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 (320) hide show
  1. package/CHANGELOG.md +22 -1
  2. package/cjs/components/CurrentRefinements/CurrentRefinements.js +0 -1
  3. package/cjs/components/GeoSearchControls/GeoSearchButton.js +0 -1
  4. package/cjs/components/GeoSearchControls/GeoSearchToggle.js +0 -1
  5. package/cjs/components/PoweredBy/PoweredBy.js +0 -1
  6. package/cjs/components/QueryRuleCustomData/QueryRuleCustomData.js +0 -1
  7. package/cjs/components/RelevantSort/RelevantSort.js +0 -1
  8. package/cjs/components/Selector/Selector.js +0 -1
  9. package/cjs/components/Template/Template.js +3 -1
  10. package/cjs/components/VoiceSearch/VoiceSearch.js +0 -1
  11. package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +3 -1
  12. package/cjs/helpers/components/Highlight.js +5 -13
  13. package/cjs/helpers/components/ReverseHighlight.js +5 -13
  14. package/cjs/helpers/components/ReverseSnippet.js +5 -13
  15. package/cjs/helpers/components/Snippet.js +5 -13
  16. package/cjs/lib/InstantSearch.js +33 -24
  17. package/cjs/lib/insights/listener.js +0 -1
  18. package/cjs/lib/templating/index.js +31 -0
  19. package/cjs/lib/{utils → templating}/prepareTemplateProps.js +4 -9
  20. package/cjs/lib/{utils → templating}/renderTemplate.js +4 -7
  21. package/cjs/lib/utils/capitalize.js +2 -5
  22. package/cjs/lib/utils/checkIndexUiState.js +3 -5
  23. package/cjs/lib/utils/checkRendering.js +4 -9
  24. package/cjs/lib/utils/clearRefinements.js +3 -9
  25. package/cjs/lib/utils/concatHighlightedParts.js +1 -1
  26. package/cjs/lib/utils/createSendEventForFacet.js +2 -4
  27. package/cjs/lib/utils/defer.js +3 -6
  28. package/cjs/lib/utils/detect-insights-client.js +1 -1
  29. package/cjs/lib/utils/documentation.js +6 -9
  30. package/cjs/lib/utils/escape-highlight.js +4 -6
  31. package/cjs/lib/utils/escape-html.js +60 -0
  32. package/cjs/lib/utils/find.js +2 -5
  33. package/cjs/lib/utils/findIndex.js +2 -5
  34. package/cjs/lib/utils/getContainerNode.js +4 -9
  35. package/cjs/lib/utils/getHighlightFromSiblings.js +3 -5
  36. package/cjs/lib/utils/getHighlightedParts.js +1 -1
  37. package/cjs/lib/utils/getObjectType.js +2 -5
  38. package/cjs/lib/utils/getPropertyByPath.js +2 -5
  39. package/cjs/lib/utils/getRefinements.js +4 -6
  40. package/cjs/lib/utils/index.js +536 -440
  41. package/cjs/lib/utils/isDomElement.js +2 -5
  42. package/cjs/lib/utils/isEqual.js +2 -5
  43. package/cjs/lib/utils/isFacetRefined.js +1 -1
  44. package/cjs/lib/utils/isFiniteNumber.js +3 -5
  45. package/cjs/lib/utils/isIndexWidget.js +10 -0
  46. package/cjs/lib/utils/isPlainObject.js +2 -5
  47. package/cjs/lib/utils/isSpecialClick.js +2 -5
  48. package/cjs/lib/utils/logger.js +3 -5
  49. package/cjs/lib/utils/mergeSearchParameters.js +7 -10
  50. package/cjs/lib/utils/noop.js +2 -5
  51. package/cjs/lib/utils/range.js +2 -5
  52. package/cjs/lib/utils/resolveSearchParameters.js +3 -6
  53. package/cjs/lib/utils/reverseHighlightedParts.js +3 -5
  54. package/cjs/lib/utils/setIndexHelperState.js +28 -0
  55. package/cjs/lib/utils/toArray.js +2 -5
  56. package/cjs/lib/utils/uniq.js +2 -5
  57. package/cjs/lib/version.js +1 -1
  58. package/cjs/middlewares/createInsightsMiddleware.js +23 -30
  59. package/cjs/middlewares/createMetadataMiddleware.js +1 -0
  60. package/cjs/middlewares/createRouterMiddleware.js +1 -0
  61. package/cjs/widgets/answers/answers.js +3 -1
  62. package/cjs/widgets/breadcrumb/breadcrumb.js +3 -1
  63. package/cjs/widgets/clear-refinements/clear-refinements.js +3 -1
  64. package/cjs/widgets/geo-search/GeoSearchRenderer.js +1 -1
  65. package/cjs/widgets/geo-search/defaultTemplates.js +0 -1
  66. package/cjs/widgets/geo-search/geo-search.js +3 -1
  67. package/cjs/widgets/hierarchical-menu/defaultTemplates.js +0 -1
  68. package/cjs/widgets/hierarchical-menu/hierarchical-menu.js +3 -1
  69. package/cjs/widgets/hits/hits.js +6 -4
  70. package/cjs/widgets/index/index.js +8 -12
  71. package/cjs/widgets/infinite-hits/infinite-hits.js +6 -4
  72. package/cjs/widgets/menu/defaultTemplates.js +0 -1
  73. package/cjs/widgets/menu/menu.js +3 -1
  74. package/cjs/widgets/menu-select/menu-select.js +3 -1
  75. package/cjs/widgets/numeric-menu/defaultTemplates.js +0 -1
  76. package/cjs/widgets/numeric-menu/numeric-menu.js +3 -1
  77. package/cjs/widgets/range-input/range-input.js +3 -1
  78. package/cjs/widgets/rating-menu/defaultTemplates.js +0 -1
  79. package/cjs/widgets/rating-menu/rating-menu.js +3 -1
  80. package/cjs/widgets/refinement-list/defaultTemplates.js +0 -1
  81. package/cjs/widgets/refinement-list/refinement-list.js +4 -2
  82. package/cjs/widgets/search-box/defaultTemplates.js +0 -1
  83. package/cjs/widgets/stats/stats.js +3 -1
  84. package/cjs/widgets/toggle-refinement/toggle-refinement.js +3 -1
  85. package/cjs/widgets/voice-search/defaultTemplates.js +0 -1
  86. package/dist/instantsearch.development.d.ts +11 -3
  87. package/dist/instantsearch.development.js +8513 -8482
  88. package/dist/instantsearch.development.js.map +1 -1
  89. package/dist/instantsearch.production.d.ts +11 -3
  90. package/dist/instantsearch.production.min.d.ts +11 -3
  91. package/dist/instantsearch.production.min.js +2 -2
  92. package/dist/instantsearch.production.min.js.map +1 -1
  93. package/es/components/Answers/Answers.d.ts +1 -1
  94. package/es/components/Answers/Answers.js +0 -1
  95. package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -2
  96. package/es/components/Breadcrumb/Breadcrumb.js +0 -1
  97. package/es/components/ClearRefinements/ClearRefinements.d.ts +2 -2
  98. package/es/components/ClearRefinements/ClearRefinements.js +0 -1
  99. package/es/components/CurrentRefinements/CurrentRefinements.d.ts +1 -1
  100. package/es/components/CurrentRefinements/CurrentRefinements.js +0 -1
  101. package/es/components/GeoSearchControls/GeoSearchButton.d.ts +1 -1
  102. package/es/components/GeoSearchControls/GeoSearchButton.js +0 -1
  103. package/es/components/GeoSearchControls/GeoSearchControls.d.ts +2 -2
  104. package/es/components/GeoSearchControls/GeoSearchControls.js +0 -1
  105. package/es/components/GeoSearchControls/GeoSearchToggle.d.ts +1 -1
  106. package/es/components/GeoSearchControls/GeoSearchToggle.js +0 -1
  107. package/es/components/Highlight/Highlight.js +0 -1
  108. package/es/components/Hits/Hits.d.ts +2 -2
  109. package/es/components/Hits/Hits.js +0 -1
  110. package/es/components/InfiniteHits/InfiniteHits.d.ts +1 -1
  111. package/es/components/InfiniteHits/InfiniteHits.js +0 -1
  112. package/es/components/MenuSelect/MenuSelect.d.ts +1 -1
  113. package/es/components/MenuSelect/MenuSelect.js +0 -1
  114. package/es/components/Pagination/Pagination.d.ts +1 -1
  115. package/es/components/Pagination/Pagination.js +0 -1
  116. package/es/components/Panel/Panel.d.ts +1 -1
  117. package/es/components/Panel/Panel.js +0 -1
  118. package/es/components/PoweredBy/PoweredBy.d.ts +1 -1
  119. package/es/components/PoweredBy/PoweredBy.js +0 -1
  120. package/es/components/QueryRuleCustomData/QueryRuleCustomData.d.ts +1 -1
  121. package/es/components/QueryRuleCustomData/QueryRuleCustomData.js +0 -1
  122. package/es/components/RangeInput/RangeInput.d.ts +1 -1
  123. package/es/components/RangeInput/RangeInput.js +0 -1
  124. package/es/components/RefinementList/RefinementList.d.ts +2 -2
  125. package/es/components/RefinementList/RefinementList.js +0 -1
  126. package/es/components/RefinementList/RefinementListItem.d.ts +1 -1
  127. package/es/components/RefinementList/RefinementListItem.js +0 -1
  128. package/es/components/RelevantSort/RelevantSort.d.ts +1 -1
  129. package/es/components/RelevantSort/RelevantSort.js +0 -1
  130. package/es/components/ReverseHighlight/ReverseHighlight.js +0 -1
  131. package/es/components/ReverseSnippet/ReverseSnippet.js +0 -1
  132. package/es/components/SearchBox/SearchBox.d.ts +1 -1
  133. package/es/components/SearchBox/SearchBox.js +0 -1
  134. package/es/components/Selector/Selector.d.ts +1 -1
  135. package/es/components/Selector/Selector.js +0 -1
  136. package/es/components/Slider/Pit.d.ts +1 -1
  137. package/es/components/Slider/Pit.js +0 -1
  138. package/es/components/Slider/Rheostat.d.ts +1 -1
  139. package/es/components/Slider/Rheostat.js +0 -2
  140. package/es/components/Slider/Slider.d.ts +1 -1
  141. package/es/components/Slider/Slider.js +0 -1
  142. package/es/components/Snippet/Snippet.js +0 -1
  143. package/es/components/Stats/Stats.d.ts +1 -1
  144. package/es/components/Stats/Stats.js +0 -1
  145. package/es/components/Template/Template.d.ts +2 -2
  146. package/es/components/Template/Template.js +2 -2
  147. package/es/components/ToggleRefinement/ToggleRefinement.d.ts +2 -5
  148. package/es/components/ToggleRefinement/ToggleRefinement.js +0 -5
  149. package/es/components/VoiceSearch/VoiceSearch.d.ts +1 -1
  150. package/es/components/VoiceSearch/VoiceSearch.js +0 -1
  151. package/es/connectors/toggle-refinement/connectToggleRefinement.d.ts +3 -2
  152. package/es/connectors/toggle-refinement/connectToggleRefinement.js +3 -1
  153. package/es/helpers/components/Highlight.d.ts +1 -1
  154. package/es/helpers/components/Highlight.js +2 -6
  155. package/es/helpers/components/ReverseHighlight.d.ts +1 -1
  156. package/es/helpers/components/ReverseHighlight.js +2 -6
  157. package/es/helpers/components/ReverseSnippet.d.ts +1 -1
  158. package/es/helpers/components/ReverseSnippet.js +2 -6
  159. package/es/helpers/components/Snippet.d.ts +1 -1
  160. package/es/helpers/components/Snippet.js +2 -6
  161. package/es/lib/InstantSearch.d.ts +6 -1
  162. package/es/lib/InstantSearch.js +34 -21
  163. package/es/lib/insights/listener.d.ts +1 -1
  164. package/es/lib/insights/listener.js +0 -1
  165. package/es/lib/templating/index.d.ts +2 -0
  166. package/es/lib/templating/index.js +2 -0
  167. package/es/lib/{utils → templating}/prepareTemplateProps.d.ts +2 -2
  168. package/es/lib/{utils → templating}/prepareTemplateProps.js +3 -5
  169. package/es/lib/{utils → templating}/renderTemplate.d.ts +2 -3
  170. package/es/lib/{utils → templating}/renderTemplate.js +3 -5
  171. package/es/lib/utils/capitalize.d.ts +1 -2
  172. package/es/lib/utils/capitalize.js +2 -4
  173. package/es/lib/utils/checkIndexUiState.js +1 -1
  174. package/es/lib/utils/checkRendering.d.ts +1 -2
  175. package/es/lib/utils/checkRendering.js +3 -6
  176. package/es/lib/utils/clearRefinements.d.ts +4 -8
  177. package/es/lib/utils/clearRefinements.js +3 -8
  178. package/es/lib/utils/concatHighlightedParts.d.ts +1 -1
  179. package/es/lib/utils/concatHighlightedParts.js +1 -1
  180. package/es/lib/utils/createSendEventForFacet.js +1 -1
  181. package/es/lib/utils/createSendEventForHits.d.ts +0 -3
  182. package/es/lib/utils/createSendEventForHits.js +0 -3
  183. package/es/lib/utils/defer.d.ts +2 -2
  184. package/es/lib/utils/defer.js +2 -5
  185. package/es/lib/utils/detect-insights-client.d.ts +1 -1
  186. package/es/lib/utils/detect-insights-client.js +1 -1
  187. package/es/lib/utils/documentation.d.ts +2 -2
  188. package/es/lib/utils/documentation.js +4 -4
  189. package/es/lib/utils/escape-highlight.js +2 -2
  190. package/es/lib/utils/{escape.d.ts → escape-html.d.ts} +6 -2
  191. package/es/lib/utils/escape-html.js +51 -0
  192. package/es/lib/utils/escapeFacetValue.d.ts +1 -1
  193. package/es/lib/utils/find.d.ts +1 -2
  194. package/es/lib/utils/find.js +2 -4
  195. package/es/lib/utils/findIndex.d.ts +1 -2
  196. package/es/lib/utils/findIndex.js +2 -4
  197. package/es/lib/utils/getContainerNode.d.ts +1 -2
  198. package/es/lib/utils/getContainerNode.js +3 -5
  199. package/es/lib/utils/getHighlightFromSiblings.d.ts +1 -1
  200. package/es/lib/utils/getHighlightFromSiblings.js +2 -2
  201. package/es/lib/utils/getHighlightedParts.d.ts +1 -1
  202. package/es/lib/utils/getHighlightedParts.js +1 -1
  203. package/es/lib/utils/getObjectType.d.ts +1 -2
  204. package/es/lib/utils/getObjectType.js +2 -4
  205. package/es/lib/utils/getPropertyByPath.d.ts +1 -2
  206. package/es/lib/utils/getPropertyByPath.js +2 -4
  207. package/es/lib/utils/getRefinements.d.ts +1 -1
  208. package/es/lib/utils/getRefinements.js +2 -2
  209. package/es/lib/utils/index.d.ts +44 -46
  210. package/es/lib/utils/index.js +44 -46
  211. package/es/lib/utils/isDomElement.d.ts +1 -2
  212. package/es/lib/utils/isDomElement.js +2 -4
  213. package/es/lib/utils/isEqual.d.ts +1 -2
  214. package/es/lib/utils/isEqual.js +2 -4
  215. package/es/lib/utils/isFacetRefined.d.ts +1 -1
  216. package/es/lib/utils/isFacetRefined.js +1 -1
  217. package/es/lib/utils/isFiniteNumber.d.ts +1 -2
  218. package/es/lib/utils/isFiniteNumber.js +3 -4
  219. package/es/lib/utils/isIndexWidget.d.ts +3 -0
  220. package/es/lib/utils/isIndexWidget.js +3 -0
  221. package/es/lib/utils/isPlainObject.d.ts +1 -2
  222. package/es/lib/utils/isPlainObject.js +2 -4
  223. package/es/lib/utils/isSpecialClick.d.ts +1 -2
  224. package/es/lib/utils/isSpecialClick.js +2 -4
  225. package/es/lib/utils/logger.js +1 -1
  226. package/es/lib/utils/mergeSearchParameters.d.ts +1 -2
  227. package/es/lib/utils/mergeSearchParameters.js +4 -6
  228. package/es/lib/utils/noop.d.ts +1 -2
  229. package/es/lib/utils/noop.js +1 -3
  230. package/es/lib/utils/range.d.ts +2 -2
  231. package/es/lib/utils/range.js +2 -4
  232. package/es/lib/utils/resolveSearchParameters.d.ts +1 -2
  233. package/es/lib/utils/resolveSearchParameters.js +2 -4
  234. package/es/lib/utils/reverseHighlightedParts.d.ts +1 -1
  235. package/es/lib/utils/reverseHighlightedParts.js +2 -2
  236. package/es/lib/utils/setIndexHelperState.d.ts +3 -0
  237. package/es/lib/utils/setIndexHelperState.js +19 -0
  238. package/es/lib/utils/toArray.d.ts +3 -2
  239. package/es/lib/utils/toArray.js +2 -4
  240. package/es/lib/utils/uniq.d.ts +1 -2
  241. package/es/lib/utils/uniq.js +2 -4
  242. package/es/lib/version.d.ts +1 -1
  243. package/es/lib/version.js +1 -1
  244. package/es/middlewares/createInsightsMiddleware.js +23 -27
  245. package/es/middlewares/createMetadataMiddleware.js +1 -0
  246. package/es/middlewares/createRouterMiddleware.js +1 -0
  247. package/es/types/middleware.d.ts +1 -0
  248. package/es/widgets/answers/answers.d.ts +1 -1
  249. package/es/widgets/answers/answers.js +2 -2
  250. package/es/widgets/breadcrumb/breadcrumb.d.ts +1 -1
  251. package/es/widgets/breadcrumb/breadcrumb.js +2 -2
  252. package/es/widgets/clear-refinements/clear-refinements.d.ts +1 -1
  253. package/es/widgets/clear-refinements/clear-refinements.js +2 -2
  254. package/es/widgets/current-refinements/current-refinements.d.ts +1 -1
  255. package/es/widgets/current-refinements/current-refinements.js +0 -1
  256. package/es/widgets/geo-search/GeoSearchRenderer.js +1 -2
  257. package/es/widgets/geo-search/createHTMLMarker.d.ts +1 -1
  258. package/es/widgets/geo-search/defaultTemplates.d.ts +1 -1
  259. package/es/widgets/geo-search/defaultTemplates.js +0 -1
  260. package/es/widgets/geo-search/geo-search.js +2 -1
  261. package/es/widgets/hierarchical-menu/defaultTemplates.js +0 -1
  262. package/es/widgets/hierarchical-menu/hierarchical-menu.d.ts +1 -1
  263. package/es/widgets/hierarchical-menu/hierarchical-menu.js +2 -2
  264. package/es/widgets/hits/hits.d.ts +1 -1
  265. package/es/widgets/hits/hits.js +2 -2
  266. package/es/widgets/hits-per-page/hits-per-page.d.ts +1 -1
  267. package/es/widgets/hits-per-page/hits-per-page.js +0 -1
  268. package/es/widgets/index/index.d.ts +0 -1
  269. package/es/widgets/index/index.js +5 -6
  270. package/es/widgets/infinite-hits/infinite-hits.d.ts +1 -1
  271. package/es/widgets/infinite-hits/infinite-hits.js +2 -2
  272. package/es/widgets/menu/defaultTemplates.js +0 -1
  273. package/es/widgets/menu/menu.d.ts +1 -1
  274. package/es/widgets/menu/menu.js +2 -2
  275. package/es/widgets/menu-select/menu-select.d.ts +1 -1
  276. package/es/widgets/menu-select/menu-select.js +2 -2
  277. package/es/widgets/numeric-menu/defaultTemplates.js +0 -1
  278. package/es/widgets/numeric-menu/numeric-menu.d.ts +1 -1
  279. package/es/widgets/numeric-menu/numeric-menu.js +2 -2
  280. package/es/widgets/pagination/pagination.d.ts +1 -1
  281. package/es/widgets/pagination/pagination.js +0 -1
  282. package/es/widgets/panel/panel.d.ts +1 -1
  283. package/es/widgets/panel/panel.js +0 -1
  284. package/es/widgets/powered-by/powered-by.d.ts +1 -1
  285. package/es/widgets/powered-by/powered-by.js +0 -1
  286. package/es/widgets/query-rule-custom-data/query-rule-custom-data.d.ts +1 -1
  287. package/es/widgets/query-rule-custom-data/query-rule-custom-data.js +0 -1
  288. package/es/widgets/range-input/range-input.d.ts +1 -1
  289. package/es/widgets/range-input/range-input.js +2 -2
  290. package/es/widgets/range-slider/range-slider.d.ts +1 -1
  291. package/es/widgets/range-slider/range-slider.js +0 -1
  292. package/es/widgets/rating-menu/defaultTemplates.js +0 -1
  293. package/es/widgets/rating-menu/rating-menu.d.ts +1 -1
  294. package/es/widgets/rating-menu/rating-menu.js +2 -2
  295. package/es/widgets/refinement-list/defaultTemplates.js +0 -1
  296. package/es/widgets/refinement-list/refinement-list.d.ts +1 -1
  297. package/es/widgets/refinement-list/refinement-list.js +2 -2
  298. package/es/widgets/relevant-sort/relevant-sort.d.ts +1 -1
  299. package/es/widgets/relevant-sort/relevant-sort.js +0 -1
  300. package/es/widgets/search-box/defaultTemplates.js +0 -1
  301. package/es/widgets/search-box/search-box.d.ts +1 -1
  302. package/es/widgets/search-box/search-box.js +0 -1
  303. package/es/widgets/sort-by/sort-by.d.ts +1 -1
  304. package/es/widgets/sort-by/sort-by.js +0 -1
  305. package/es/widgets/stats/stats.d.ts +1 -1
  306. package/es/widgets/stats/stats.js +2 -2
  307. package/es/widgets/toggle-refinement/toggle-refinement.d.ts +1 -1
  308. package/es/widgets/toggle-refinement/toggle-refinement.js +2 -2
  309. package/es/widgets/voice-search/defaultTemplates.js +0 -1
  310. package/es/widgets/voice-search/voice-search.d.ts +1 -1
  311. package/es/widgets/voice-search/voice-search.js +0 -1
  312. package/package.json +6 -6
  313. package/cjs/lib/utils/convertNumericRefinementsToFilters.js +0 -31
  314. package/cjs/lib/utils/escape.js +0 -35
  315. package/cjs/lib/utils/unescape.js +0 -32
  316. package/es/lib/utils/convertNumericRefinementsToFilters.d.ts +0 -2
  317. package/es/lib/utils/convertNumericRefinementsToFilters.js +0 -24
  318. package/es/lib/utils/escape.js +0 -27
  319. package/es/lib/utils/unescape.d.ts +0 -9
  320. package/es/lib/utils/unescape.js +0 -25
@@ -1,4 +1,4 @@
1
- /** @jsx h */
1
+
2
2
  import type { RefinementListConnectorParams, RefinementListWidgetDescription } from '../../connectors/refinement-list/connectRefinementList';
3
3
  import type { Template, WidgetFactory } from '../../types';
4
4
  import type { SearchBoxTemplates } from '../search-box/search-box';
@@ -4,12 +4,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- /** @jsx h */
8
7
  import { h, render } from 'preact';
9
8
  import cx from 'classnames';
10
9
  import RefinementList from "../../components/RefinementList/RefinementList.js";
11
10
  import connectRefinementList from "../../connectors/refinement-list/connectRefinementList.js";
12
- import { prepareTemplateProps, getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
11
+ import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
12
+ import { prepareTemplateProps } from "../../lib/templating/index.js";
13
13
  import { component } from "../../lib/suit.js";
14
14
  import searchBoxDefaultTemplates from "../search-box/defaultTemplates.js";
15
15
  import defaultTemplates from "./defaultTemplates.js";
@@ -1,4 +1,4 @@
1
- /** @jsx h */
1
+
2
2
  import type { WidgetFactory, Template } from '../../types';
3
3
  import type { RelevantSortConnectorParams, RelevantSortWidgetDescription } from '../../connectors/relevant-sort/connectRelevantSort';
4
4
  export declare type RelevantSortCSSClasses = Partial<{
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- /** @jsx h */
8
7
  import { h, render } from 'preact';
9
8
  import cx from 'classnames';
10
9
  import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
@@ -1,4 +1,3 @@
1
- /** @jsx h */
2
1
  import { h } from 'preact';
3
2
 
4
3
  var _ref2 = h("path", {
@@ -1,4 +1,4 @@
1
- /** @jsx h */
1
+
2
2
  import type { WidgetFactory, Template } from '../../types';
3
3
  import type { SearchBoxConnectorParams, SearchBoxWidgetDescription } from '../../connectors/search-box/connectSearchBox';
4
4
  import type { SearchBoxComponentCSSClasses } from '../../components/SearchBox/SearchBox';
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- /** @jsx h */
8
7
  import { h, render } from 'preact';
9
8
  import cx from 'classnames';
10
9
  import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
@@ -1,4 +1,4 @@
1
- /** @jsx h */
1
+
2
2
  import type { SortByConnectorParams, SortByItem, SortByWidgetDescription } from '../../connectors/sort-by/connectSortBy';
3
3
  import type { TransformItems, WidgetFactory } from '../../types';
4
4
  export declare type SortByWidgetCssClasses = Partial<{
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- /** @jsx h */
8
7
  import { h, render } from 'preact';
9
8
  import cx from 'classnames';
10
9
  import Selector from "../../components/Selector/Selector.js";
@@ -1,4 +1,4 @@
1
- /** @jsx h */
1
+
2
2
  import type { StatsComponentTemplates } from '../../components/Stats/Stats';
3
3
  import type { StatsConnectorParams, StatsRenderState, StatsWidgetDescription } from '../../connectors/stats/connectStats';
4
4
  import type { Template, WidgetFactory } from '../../types';
@@ -4,12 +4,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- /** @jsx h */
8
7
  import { h, render } from 'preact';
9
8
  import cx from 'classnames';
10
9
  import Stats from "../../components/Stats/Stats.js";
11
10
  import connectStats from "../../connectors/stats/connectStats.js";
12
- import { prepareTemplateProps, getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
11
+ import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
12
+ import { prepareTemplateProps } from "../../lib/templating/index.js";
13
13
  import { component } from "../../lib/suit.js";
14
14
  import { formatNumber } from "../../lib/formatNumber.js";
15
15
  var withUsage = createDocumentationMessageGenerator({
@@ -1,4 +1,4 @@
1
- /** @jsx h */
1
+
2
2
  import type { ToggleRefinementConnectorParams, ToggleRefinementWidgetDescription, ToggleRefinementValue } from '../../connectors/toggle-refinement/connectToggleRefinement';
3
3
  import type { Template, WidgetFactory } from '../../types';
4
4
  export declare type ToggleRefinementCSSClasses = Partial<{
@@ -4,13 +4,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- /** @jsx h */
8
7
  import { h, render } from 'preact';
9
8
  import cx from 'classnames';
10
9
  import ToggleRefinement from "../../components/ToggleRefinement/ToggleRefinement.js";
11
10
  import connectToggleRefinement from "../../connectors/toggle-refinement/connectToggleRefinement.js";
12
11
  import defaultTemplates from "./defaultTemplates.js";
13
- import { getContainerNode, prepareTemplateProps, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
12
+ import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
13
+ import { prepareTemplateProps } from "../../lib/templating/index.js";
14
14
  import { component } from "../../lib/suit.js";
15
15
  var withUsage = createDocumentationMessageGenerator({
16
16
  name: 'toggle-refinement'
@@ -1,4 +1,3 @@
1
- /** @jsx h */
2
1
  import { Fragment, h } from 'preact';
3
2
 
4
3
  var _ref2 = h(Fragment, null, h("line", {
@@ -1,4 +1,4 @@
1
- /** @jsx h */
1
+
2
2
  import type { PlainSearchParameters } from 'algoliasearch-helper';
3
3
  import type { VoiceSearchConnectorParams, VoiceSearchWidgetDescription } from '../../connectors/voice-search/connectVoiceSearch';
4
4
  import type { WidgetFactory, Template } from '../../types';
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
4
4
 
5
5
  function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
6
 
7
- /** @jsx h */
8
7
  import { h, render } from 'preact';
9
8
  import cx from 'classnames';
10
9
  import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "instantsearch.js",
3
- "version": "4.46.0",
3
+ "version": "4.46.2",
4
4
  "description": "InstantSearch.js is a JavaScript library for building performant and instant search experiences with Algolia.",
5
5
  "homepage": "https://www.algolia.com/doc/guides/building-search-ui/what-is-instantsearch/js/",
6
6
  "types": "es/index.d.ts",
@@ -23,7 +23,7 @@
23
23
  "start": "yarn run dev",
24
24
  "dev": "yarn run storybook",
25
25
  "build": "yarn run build:cjs && yarn run build:es && yarn run build:umd && yarn run build:types",
26
- "build:umd": "rm -rf dist && BABEL_ENV=umd rollup --config scripts/rollup/config.js",
26
+ "build:umd": "rm -rf dist && BABEL_ENV=umd rollup --config scripts/rollup/rollup.config.js",
27
27
  "build:cjs": "rm -rf cjs && BABEL_ENV=cjs babel src --extensions '.js,.ts,.tsx' --out-dir cjs/ --ignore 'src/index.es.ts','**/__tests__','**/__mocks__' --quiet",
28
28
  "build:es": "rm -rf es && BABEL_ENV=es babel src --extensions '.js,.ts,.tsx' --out-dir es/ --ignore 'src/index.es.ts','**/__tests__','**/__mocks__' --quiet && BABEL_ENV=es babel src/index.es.ts --out-file es/index.js --quiet && echo '{\"type\":\"module\",\"sideEffects\":false}' > es/package.json",
29
29
  "build:types": "./scripts/typescript/extract.js",
@@ -59,7 +59,7 @@
59
59
  "@types/google.maps": "^3.45.3",
60
60
  "@types/hogan.js": "^3.0.0",
61
61
  "@types/qs": "^6.5.3",
62
- "algoliasearch-helper": "^3.10.0",
62
+ "algoliasearch-helper": "^3.11.1",
63
63
  "classnames": "^2.2.5",
64
64
  "hogan.js": "^3.0.2",
65
65
  "htm": "^3.0.0",
@@ -117,6 +117,7 @@
117
117
  "eslint": "6.8.0",
118
118
  "eslint-config-algolia": "16.0.0",
119
119
  "eslint-config-prettier": "6.9.0",
120
+ "eslint-plugin-deprecation": "1.3.2",
120
121
  "eslint-plugin-eslint-comments": "3.2.0",
121
122
  "eslint-plugin-import": "2.18.2",
122
123
  "eslint-plugin-jasmine": "4.1.0",
@@ -124,7 +125,6 @@
124
125
  "eslint-plugin-prettier": "3.4.0",
125
126
  "eslint-plugin-react": "7.18.0",
126
127
  "eslint-plugin-react-hooks": "2.3.0",
127
- "eslint-plugin-deprecation": "1.3.2",
128
128
  "instantsearch-e2e-tests": "algolia/instantsearch-e2e-tests#2.0.2",
129
129
  "jest": "27.1.0",
130
130
  "jest-diff": "27.1.0",
@@ -159,11 +159,11 @@
159
159
  "bundlesize": [
160
160
  {
161
161
  "path": "./dist/instantsearch.production.min.js",
162
- "maxSize": "72.25 kB"
162
+ "maxSize": "72.75 kB"
163
163
  },
164
164
  {
165
165
  "path": "./dist/instantsearch.development.js",
166
- "maxSize": "155.25 kB"
166
+ "maxSize": "155.75 kB"
167
167
  }
168
168
  ]
169
169
  }
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.convertNumericRefinementsToFilters = convertNumericRefinementsToFilters;
7
-
8
- function convertNumericRefinementsToFilters(state, attribute) {
9
- if (!state) {
10
- return null;
11
- }
12
-
13
- var filtersObj = state.numericRefinements[attribute];
14
- /*
15
- filtersObj === {
16
- "<=": [10],
17
- "=": [],
18
- ">=": [5]
19
- }
20
- */
21
-
22
- var filters = [];
23
- Object.keys(filtersObj).filter(function (operator) {
24
- return Array.isArray(filtersObj[operator]) && filtersObj[operator].length > 0;
25
- }).forEach(function (operator) {
26
- filtersObj[operator].forEach(function (value) {
27
- filters.push("".concat(attribute).concat(operator).concat(value));
28
- });
29
- });
30
- return filters;
31
- }
@@ -1,35 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = void 0;
7
-
8
- /**
9
- * This implementation is taken from Lodash implementation.
10
- * See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js
11
- */
12
- // Used to map characters to HTML entities.
13
- var htmlEscapes = {
14
- '&': '&amp;',
15
- '<': '&lt;',
16
- '>': '&gt;',
17
- '"': '&quot;',
18
- "'": '&#39;'
19
- }; // Used to match HTML entities and HTML characters.
20
-
21
- var regexUnescapedHtml = /[&<>"']/g;
22
- var regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);
23
- /**
24
- * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
25
- * corresponding HTML entities.
26
- */
27
-
28
- function escape(value) {
29
- return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {
30
- return htmlEscapes[character];
31
- }) : value;
32
- }
33
-
34
- var _default = escape;
35
- exports.default = _default;
@@ -1,32 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.default = unescape;
7
-
8
- /**
9
- * This implementation is taken from Lodash implementation.
10
- * See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js
11
- */
12
- // Used to map HTML entities to characters.
13
- var htmlEscapes = {
14
- '&amp;': '&',
15
- '&lt;': '<',
16
- '&gt;': '>',
17
- '&quot;': '"',
18
- '&#39;': "'"
19
- }; // Used to match HTML entities and HTML characters.
20
-
21
- var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;
22
- var regexHasEscapedHtml = RegExp(regexEscapedHtml.source);
23
- /**
24
- * Converts the HTML entities "&", "<", ">", '"', and "'" in `string` to their
25
- * characters.
26
- */
27
-
28
- function unescape(value) {
29
- return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {
30
- return htmlEscapes[character];
31
- }) : value;
32
- }
@@ -1,2 +0,0 @@
1
- import type { SearchParameters } from 'algoliasearch-helper';
2
- export declare function convertNumericRefinementsToFilters(state: SearchParameters | null, attribute: string): string[] | null;
@@ -1,24 +0,0 @@
1
- export function convertNumericRefinementsToFilters(state, attribute) {
2
- if (!state) {
3
- return null;
4
- }
5
-
6
- var filtersObj = state.numericRefinements[attribute];
7
- /*
8
- filtersObj === {
9
- "<=": [10],
10
- "=": [],
11
- ">=": [5]
12
- }
13
- */
14
-
15
- var filters = [];
16
- Object.keys(filtersObj).filter(function (operator) {
17
- return Array.isArray(filtersObj[operator]) && filtersObj[operator].length > 0;
18
- }).forEach(function (operator) {
19
- filtersObj[operator].forEach(function (value) {
20
- filters.push("".concat(attribute).concat(operator).concat(value));
21
- });
22
- });
23
- return filters;
24
- }
@@ -1,27 +0,0 @@
1
- /**
2
- * This implementation is taken from Lodash implementation.
3
- * See: https://github.com/lodash/lodash/blob/4.17.11-npm/escape.js
4
- */
5
- // Used to map characters to HTML entities.
6
- var htmlEscapes = {
7
- '&': '&amp;',
8
- '<': '&lt;',
9
- '>': '&gt;',
10
- '"': '&quot;',
11
- "'": '&#39;'
12
- }; // Used to match HTML entities and HTML characters.
13
-
14
- var regexUnescapedHtml = /[&<>"']/g;
15
- var regexHasUnescapedHtml = RegExp(regexUnescapedHtml.source);
16
- /**
17
- * Converts the characters "&", "<", ">", '"', and "'" in `string` to their
18
- * corresponding HTML entities.
19
- */
20
-
21
- function escape(value) {
22
- return value && regexHasUnescapedHtml.test(value) ? value.replace(regexUnescapedHtml, function (character) {
23
- return htmlEscapes[character];
24
- }) : value;
25
- }
26
-
27
- export default escape;
@@ -1,9 +0,0 @@
1
- /**
2
- * This implementation is taken from Lodash implementation.
3
- * See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js
4
- */
5
- /**
6
- * Converts the HTML entities "&", "<", ">", '"', and "'" in `string` to their
7
- * characters.
8
- */
9
- export default function unescape(value: string): string;
@@ -1,25 +0,0 @@
1
- /**
2
- * This implementation is taken from Lodash implementation.
3
- * See: https://github.com/lodash/lodash/blob/4.17.11-npm/unescape.js
4
- */
5
- // Used to map HTML entities to characters.
6
- var htmlEscapes = {
7
- '&amp;': '&',
8
- '&lt;': '<',
9
- '&gt;': '>',
10
- '&quot;': '"',
11
- '&#39;': "'"
12
- }; // Used to match HTML entities and HTML characters.
13
-
14
- var regexEscapedHtml = /&(amp|quot|lt|gt|#39);/g;
15
- var regexHasEscapedHtml = RegExp(regexEscapedHtml.source);
16
- /**
17
- * Converts the HTML entities "&", "<", ">", '"', and "'" in `string` to their
18
- * characters.
19
- */
20
-
21
- export default function unescape(value) {
22
- return value && regexHasEscapedHtml.test(value) ? value.replace(regexEscapedHtml, function (character) {
23
- return htmlEscapes[character];
24
- }) : value;
25
- }