instantsearch.js 4.36.0 → 4.37.3
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.
- package/CHANGELOG.md +38 -0
- package/cjs/components/Answers/Answers.js +1 -1
- package/cjs/components/Breadcrumb/Breadcrumb.js +1 -1
- package/cjs/components/ClearRefinements/ClearRefinements.js +1 -1
- package/cjs/components/CurrentRefinements/CurrentRefinements.js +3 -3
- package/cjs/components/GeoSearchControls/GeoSearchControls.js +3 -3
- package/cjs/components/Hits/Hits.js +1 -7
- package/cjs/components/InfiniteHits/InfiniteHits.js +1 -1
- package/cjs/components/MenuSelect/MenuSelect.js +3 -3
- package/cjs/components/Pagination/Pagination.js +89 -160
- package/cjs/components/Panel/Panel.js +1 -1
- package/cjs/components/QueryRuleCustomData/QueryRuleCustomData.js +1 -1
- package/cjs/components/RangeInput/RangeInput.js +1 -1
- package/cjs/components/RefinementList/RefinementList.js +6 -6
- package/cjs/components/RefinementList/RefinementListItem.js +1 -1
- package/cjs/components/RelevantSort/RelevantSort.js +1 -1
- package/cjs/components/SearchBox/SearchBox.js +9 -10
- package/cjs/components/Slider/Slider.js +5 -5
- package/cjs/components/Stats/Stats.js +1 -1
- package/cjs/components/Template/Template.js +3 -3
- package/cjs/components/ToggleRefinement/ToggleRefinement.js +1 -1
- package/cjs/components/VoiceSearch/VoiceSearch.js +1 -1
- package/cjs/connectors/answers/connectAnswers.js +10 -10
- package/cjs/connectors/autocomplete/connectAutocomplete.js +9 -9
- package/cjs/connectors/breadcrumb/connectBreadcrumb.js +12 -7
- package/cjs/connectors/clear-refinements/connectClearRefinements.js +9 -9
- package/cjs/connectors/configure/connectConfigure.js +8 -8
- package/cjs/connectors/configure-related-items/connectConfigureRelatedItems.js +5 -5
- package/cjs/connectors/current-refinements/connectCurrentRefinements.js +6 -6
- package/cjs/connectors/dynamic-widgets/connectDynamicWidgets.js +7 -7
- package/cjs/connectors/geo-search/connectGeoSearch.js +11 -11
- package/cjs/connectors/hierarchical-menu/connectHierarchicalMenu.js +6 -6
- package/cjs/connectors/hits/connectHits.js +11 -11
- package/cjs/connectors/hits/connectHitsWithInsights.js +3 -3
- package/cjs/connectors/hits-per-page/connectHitsPerPage.js +6 -6
- package/cjs/connectors/index.js +31 -31
- package/cjs/connectors/infinite-hits/connectInfiniteHits.js +12 -12
- package/cjs/connectors/infinite-hits/connectInfiniteHitsWithInsights.js +3 -3
- package/cjs/connectors/menu/connectMenu.js +5 -5
- package/cjs/connectors/numeric-menu/connectNumericMenu.js +7 -7
- package/cjs/connectors/pagination/Paginator.js +3 -3
- package/cjs/connectors/pagination/connectPagination.js +5 -5
- package/cjs/connectors/powered-by/connectPoweredBy.js +5 -5
- package/cjs/connectors/query-rules/connectQueryRules.js +7 -7
- package/cjs/connectors/range/connectRange.js +27 -27
- package/cjs/connectors/rating-menu/connectRatingMenu.js +6 -6
- package/cjs/connectors/refinement-list/connectRefinementList.js +8 -8
- package/cjs/connectors/relevant-sort/connectRelevantSort.js +3 -3
- package/cjs/connectors/search-box/connectSearchBox.js +19 -29
- package/cjs/connectors/sort-by/connectSortBy.js +6 -6
- package/cjs/connectors/stats/connectStats.js +4 -4
- package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +11 -11
- package/cjs/connectors/voice-search/connectVoiceSearch.js +6 -6
- package/cjs/helpers/get-insights-anonymous-user-token.js +2 -2
- package/cjs/helpers/highlight.js +7 -4
- package/cjs/helpers/index.js +6 -6
- package/cjs/helpers/insights.js +4 -4
- package/cjs/helpers/reverseHighlight.js +8 -5
- package/cjs/helpers/reverseSnippet.js +8 -5
- package/cjs/helpers/snippet.js +7 -4
- package/cjs/index.js +9 -9
- package/cjs/lib/InstantSearch.js +32 -27
- package/cjs/lib/createHelpers.js +6 -6
- package/cjs/lib/infiniteHitsCache/index.js +1 -1
- package/cjs/lib/infiniteHitsCache/sessionStorage.js +4 -4
- package/cjs/lib/insights/client.js +5 -5
- package/cjs/lib/insights/index.js +2 -2
- package/cjs/lib/insights/listener.js +3 -3
- package/cjs/lib/routers/history.js +6 -6
- package/cjs/lib/routers/index.js +1 -1
- package/cjs/lib/stateMappings/index.js +2 -2
- package/cjs/lib/utils/checkIndexUiState.js +3 -3
- package/cjs/lib/utils/checkRendering.js +1 -1
- package/cjs/lib/utils/concatHighlightedParts.js +1 -1
- package/cjs/lib/utils/createSendEventForFacet.js +1 -1
- package/cjs/lib/utils/createSendEventForHits.js +1 -1
- package/cjs/lib/utils/detect-insights-client.js +1 -1
- package/cjs/lib/utils/escape-highlight.js +2 -2
- package/cjs/lib/utils/getContainerNode.js +1 -1
- package/cjs/lib/utils/getHighlightFromSiblings.js +1 -1
- package/cjs/lib/utils/getHighlightedParts.js +1 -1
- package/cjs/lib/utils/getRefinements.js +2 -2
- package/cjs/lib/utils/index.js +48 -48
- package/cjs/lib/utils/logger.js +1 -1
- package/cjs/lib/utils/mergeSearchParameters.js +2 -2
- package/cjs/lib/utils/prepareTemplateProps.js +1 -1
- package/cjs/lib/utils/reverseHighlightedParts.js +1 -1
- package/cjs/lib/version.js +1 -1
- package/cjs/middlewares/createInsightsMiddleware.js +11 -11
- package/cjs/middlewares/createMetadataMiddleware.js +2 -2
- package/cjs/middlewares/createRouterMiddleware.js +4 -4
- package/cjs/middlewares/index.js +3 -3
- package/cjs/types/index.js +14 -14
- package/cjs/widgets/analytics/analytics.js +3 -3
- package/cjs/widgets/answers/answers.js +8 -8
- package/cjs/widgets/breadcrumb/breadcrumb.js +8 -8
- package/cjs/widgets/clear-refinements/clear-refinements.js +8 -8
- package/cjs/widgets/configure/configure.js +3 -3
- package/cjs/widgets/configure-related-items/configure-related-items.js +3 -3
- package/cjs/widgets/current-refinements/current-refinements.js +6 -6
- package/cjs/widgets/dynamic-widgets/dynamic-widgets.js +6 -6
- package/cjs/widgets/geo-search/GeoSearchRenderer.js +3 -3
- package/cjs/widgets/geo-search/geo-search.js +9 -9
- package/cjs/widgets/hierarchical-menu/hierarchical-menu.js +8 -8
- package/cjs/widgets/hits/hits.js +11 -11
- package/cjs/widgets/hits-per-page/hits-per-page.js +7 -7
- package/cjs/widgets/index/index.js +6 -6
- package/cjs/widgets/index.js +36 -36
- package/cjs/widgets/infinite-hits/infinite-hits.js +11 -11
- package/cjs/widgets/menu/menu.js +8 -8
- package/cjs/widgets/menu-select/menu-select.js +8 -8
- package/cjs/widgets/numeric-menu/numeric-menu.js +8 -8
- package/cjs/widgets/pagination/pagination.js +7 -7
- package/cjs/widgets/panel/panel.js +7 -7
- package/cjs/widgets/powered-by/powered-by.js +6 -6
- package/cjs/widgets/query-rule-context/query-rule-context.js +4 -4
- package/cjs/widgets/query-rule-custom-data/query-rule-custom-data.js +6 -6
- package/cjs/widgets/range-input/range-input.js +7 -7
- package/cjs/widgets/range-slider/range-slider.js +6 -6
- package/cjs/widgets/rating-menu/rating-menu.js +8 -8
- package/cjs/widgets/refinement-list/refinement-list.js +10 -10
- package/cjs/widgets/relevant-sort/relevant-sort.js +7 -7
- package/cjs/widgets/search-box/search-box.js +7 -7
- package/cjs/widgets/sort-by/sort-by.js +6 -6
- package/cjs/widgets/stats/defaultTemplates.js +1 -1
- package/cjs/widgets/stats/stats.js +7 -7
- package/cjs/widgets/toggle-refinement/toggle-refinement.js +8 -8
- package/cjs/widgets/voice-search/voice-search.js +7 -7
- package/dist/instantsearch.development.d.ts +36 -7
- package/dist/instantsearch.development.js +326 -406
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.development.min.d.ts +36 -7
- package/dist/instantsearch.production.d.ts +36 -7
- package/dist/instantsearch.production.min.d.ts +36 -7
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Answers/Answers.js +1 -1
- package/es/components/Breadcrumb/Breadcrumb.js +1 -1
- package/es/components/ClearRefinements/ClearRefinements.js +1 -1
- package/es/components/CurrentRefinements/CurrentRefinements.js +1 -1
- package/es/components/GeoSearchControls/GeoSearchControls.js +3 -3
- package/es/components/Hits/Hits.d.ts +1 -9
- package/es/components/Hits/Hits.js +1 -7
- package/es/components/InfiniteHits/InfiniteHits.js +1 -1
- package/es/components/MenuSelect/MenuSelect.js +2 -2
- package/es/components/Pagination/Pagination.d.ts +5 -19
- package/es/components/Pagination/Pagination.js +89 -158
- package/es/components/Panel/Panel.js +1 -1
- package/es/components/QueryRuleCustomData/QueryRuleCustomData.js +1 -1
- package/es/components/RangeInput/RangeInput.js +1 -1
- package/es/components/RefinementList/RefinementList.js +4 -4
- package/es/components/RefinementList/RefinementListItem.js +1 -1
- package/es/components/RelevantSort/RelevantSort.js +1 -1
- package/es/components/SearchBox/SearchBox.js +5 -6
- package/es/components/Slider/Slider.js +3 -3
- package/es/components/Stats/Stats.js +1 -1
- package/es/components/Template/Template.js +1 -1
- package/es/components/ToggleRefinement/ToggleRefinement.js +1 -1
- package/es/components/VoiceSearch/VoiceSearch.js +1 -1
- package/es/connectors/answers/connectAnswers.js +1 -1
- package/es/connectors/autocomplete/connectAutocomplete.js +1 -1
- package/es/connectors/breadcrumb/connectBreadcrumb.js +8 -3
- package/es/connectors/clear-refinements/connectClearRefinements.js +1 -1
- package/es/connectors/configure/connectConfigure.js +1 -1
- package/es/connectors/configure-related-items/connectConfigureRelatedItems.js +2 -2
- package/es/connectors/current-refinements/connectCurrentRefinements.js +1 -1
- package/es/connectors/dynamic-widgets/connectDynamicWidgets.js +1 -1
- package/es/connectors/geo-search/connectGeoSearch.js +1 -1
- package/es/connectors/hierarchical-menu/connectHierarchicalMenu.js +1 -1
- package/es/connectors/hits/connectHits.js +1 -1
- package/es/connectors/hits/connectHitsWithInsights.js +2 -2
- package/es/connectors/hits-per-page/connectHitsPerPage.js +1 -1
- package/es/connectors/index.js +30 -30
- package/es/connectors/infinite-hits/connectInfiniteHits.js +1 -1
- package/es/connectors/infinite-hits/connectInfiniteHitsWithInsights.js +2 -2
- package/es/connectors/menu/connectMenu.js +1 -1
- package/es/connectors/numeric-menu/connectNumericMenu.js +1 -1
- package/es/connectors/pagination/Paginator.js +1 -1
- package/es/connectors/pagination/connectPagination.js +2 -2
- package/es/connectors/powered-by/connectPoweredBy.js +1 -1
- package/es/connectors/query-rules/connectQueryRules.js +1 -1
- package/es/connectors/range/connectRange.js +1 -1
- package/es/connectors/rating-menu/connectRatingMenu.js +1 -1
- package/es/connectors/refinement-list/connectRefinementList.js +1 -1
- package/es/connectors/relevant-sort/connectRelevantSort.js +1 -1
- package/es/connectors/search-box/connectSearchBox.js +16 -26
- package/es/connectors/sort-by/connectSortBy.js +1 -1
- package/es/connectors/stats/connectStats.js +1 -1
- package/es/connectors/toggle-refinement/connectToggleRefinement.d.ts +36 -7
- package/es/connectors/toggle-refinement/connectToggleRefinement.js +1 -1
- package/es/connectors/voice-search/connectVoiceSearch.js +2 -2
- package/es/helpers/get-insights-anonymous-user-token.js +1 -1
- package/es/helpers/highlight.js +6 -3
- package/es/helpers/index.js +10 -10
- package/es/helpers/insights.js +1 -1
- package/es/helpers/reverseHighlight.js +6 -3
- package/es/helpers/reverseSnippet.js +6 -3
- package/es/helpers/snippet.js +6 -3
- package/es/index.js +6 -6
- package/es/lib/InstantSearch.js +15 -10
- package/es/lib/createHelpers.js +1 -1
- package/es/lib/infiniteHitsCache/index.js +1 -1
- package/es/lib/infiniteHitsCache/sessionStorage.js +1 -1
- package/es/lib/insights/client.js +1 -1
- package/es/lib/insights/index.js +2 -2
- package/es/lib/insights/listener.js +2 -2
- package/es/lib/routers/history.js +1 -1
- package/es/lib/routers/index.js +1 -1
- package/es/lib/stateMappings/index.js +2 -2
- package/es/lib/utils/checkIndexUiState.js +3 -3
- package/es/lib/utils/checkRendering.js +1 -1
- package/es/lib/utils/concatHighlightedParts.js +1 -1
- package/es/lib/utils/createSendEventForFacet.js +1 -1
- package/es/lib/utils/createSendEventForHits.js +1 -1
- package/es/lib/utils/detect-insights-client.js +1 -1
- package/es/lib/utils/escape-highlight.js +2 -2
- package/es/lib/utils/getContainerNode.js +1 -1
- package/es/lib/utils/getHighlightFromSiblings.js +1 -1
- package/es/lib/utils/getHighlightedParts.js +1 -1
- package/es/lib/utils/getRefinements.js +2 -2
- package/es/lib/utils/index.js +48 -48
- package/es/lib/utils/logger.js +1 -1
- package/es/lib/utils/mergeSearchParameters.js +2 -2
- package/es/lib/utils/prepareTemplateProps.js +1 -1
- package/es/lib/utils/reverseHighlightedParts.js +1 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/middlewares/createInsightsMiddleware.js +3 -3
- package/es/middlewares/createMetadataMiddleware.js +1 -1
- package/es/middlewares/createRouterMiddleware.js +3 -3
- package/es/middlewares/index.js +3 -3
- package/es/package.json +1 -0
- package/es/types/index.js +14 -14
- package/es/widgets/analytics/analytics.js +1 -1
- package/es/widgets/answers/answers.js +5 -5
- package/es/widgets/breadcrumb/breadcrumb.js +5 -5
- package/es/widgets/clear-refinements/clear-refinements.js +5 -5
- package/es/widgets/configure/configure.js +2 -2
- package/es/widgets/configure-related-items/configure-related-items.js +2 -2
- package/es/widgets/current-refinements/current-refinements.js +4 -4
- package/es/widgets/dynamic-widgets/dynamic-widgets.js +3 -3
- package/es/widgets/geo-search/GeoSearchRenderer.js +2 -2
- package/es/widgets/geo-search/geo-search.js +6 -6
- package/es/widgets/hierarchical-menu/hierarchical-menu.js +5 -5
- package/es/widgets/hits/hits.js +6 -6
- package/es/widgets/hits-per-page/hits-per-page.js +4 -4
- package/es/widgets/index/index.js +1 -1
- package/es/widgets/index.js +34 -34
- package/es/widgets/infinite-hits/infinite-hits.js +6 -6
- package/es/widgets/menu/menu.js +5 -5
- package/es/widgets/menu-select/menu-select.js +5 -5
- package/es/widgets/numeric-menu/numeric-menu.js +5 -5
- package/es/widgets/pagination/pagination.js +4 -4
- package/es/widgets/panel/panel.js +3 -3
- package/es/widgets/powered-by/powered-by.js +4 -4
- package/es/widgets/query-rule-context/query-rule-context.js +2 -2
- package/es/widgets/query-rule-custom-data/query-rule-custom-data.js +4 -4
- package/es/widgets/range-input/range-input.js +4 -4
- package/es/widgets/range-slider/range-slider.js +4 -4
- package/es/widgets/rating-menu/rating-menu.js +5 -5
- package/es/widgets/refinement-list/refinement-list.js +6 -6
- package/es/widgets/relevant-sort/relevant-sort.js +5 -5
- package/es/widgets/search-box/search-box.js +5 -5
- package/es/widgets/sort-by/sort-by.js +4 -4
- package/es/widgets/stats/defaultTemplates.js +1 -1
- package/es/widgets/stats/stats.js +4 -4
- package/es/widgets/toggle-refinement/toggle-refinement.js +5 -5
- package/es/widgets/voice-search/voice-search.js +5 -5
- package/package.json +6 -5
- package/cjs/components/Pagination/PaginationLink.js +0 -47
- package/es/components/Pagination/PaginationLink.d.ts +0 -17
- package/es/components/Pagination/PaginationLink.js +0 -39
|
@@ -5,7 +5,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
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
7
|
import algoliasearchHelper from 'algoliasearch-helper';
|
|
8
|
-
import { createDocumentationMessageGenerator, isPlainObject, mergeSearchParameters, noop } from
|
|
8
|
+
import { createDocumentationMessageGenerator, isPlainObject, mergeSearchParameters, noop } from "../../lib/utils/index.js";
|
|
9
9
|
/**
|
|
10
10
|
* Refine the given search parameters.
|
|
11
11
|
*/
|
|
@@ -17,8 +17,8 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
17
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
18
|
|
|
19
19
|
import algoliasearchHelper from 'algoliasearch-helper';
|
|
20
|
-
import { createDocumentationMessageGenerator, getObjectType, warning, getPropertyByPath } from
|
|
21
|
-
import connectConfigure from
|
|
20
|
+
import { createDocumentationMessageGenerator, getObjectType, warning, getPropertyByPath } from "../../lib/utils/index.js";
|
|
21
|
+
import connectConfigure from "../configure/connectConfigure.js";
|
|
22
22
|
var withUsage = createDocumentationMessageGenerator({
|
|
23
23
|
name: 'configure-related-items',
|
|
24
24
|
connector: true
|
|
@@ -16,7 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
|
|
19
|
-
import { getRefinements, checkRendering, createDocumentationMessageGenerator, noop, warning } from
|
|
19
|
+
import { getRefinements, checkRendering, createDocumentationMessageGenerator, noop, warning } from "../../lib/utils/index.js";
|
|
20
20
|
var withUsage = createDocumentationMessageGenerator({
|
|
21
21
|
name: 'current-refinements',
|
|
22
22
|
connector: true
|
|
@@ -6,7 +6,7 @@ function _defineProperty(obj, key, value) { if (key in obj) { Object.definePrope
|
|
|
6
6
|
|
|
7
7
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
8
8
|
|
|
9
|
-
import { checkRendering, createDocumentationMessageGenerator, getWidgetAttribute, noop, warning } from
|
|
9
|
+
import { checkRendering, createDocumentationMessageGenerator, getWidgetAttribute, noop, warning } from "../../lib/utils/index.js";
|
|
10
10
|
var withUsage = createDocumentationMessageGenerator({
|
|
11
11
|
name: 'dynamic-widgets',
|
|
12
12
|
connector: true
|
|
@@ -4,7 +4,7 @@ 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
|
-
import { checkRendering, aroundLatLngToPosition, insideBoundingBoxToBoundingBox, createDocumentationMessageGenerator, createSendEventForHits, noop } from
|
|
7
|
+
import { checkRendering, aroundLatLngToPosition, insideBoundingBoxToBoundingBox, createDocumentationMessageGenerator, createSendEventForHits, noop } from "../../lib/utils/index.js";
|
|
8
8
|
var withUsage = createDocumentationMessageGenerator({
|
|
9
9
|
name: 'geo-search',
|
|
10
10
|
connector: true
|
|
@@ -20,7 +20,7 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
20
20
|
|
|
21
21
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
22
22
|
|
|
23
|
-
import { checkRendering, warning, createDocumentationMessageGenerator, createSendEventForFacet, isEqual, noop } from
|
|
23
|
+
import { checkRendering, warning, createDocumentationMessageGenerator, createSendEventForFacet, isEqual, noop } from "../../lib/utils/index.js";
|
|
24
24
|
var withUsage = createDocumentationMessageGenerator({
|
|
25
25
|
name: 'hierarchical-menu',
|
|
26
26
|
connector: true
|
|
@@ -4,7 +4,7 @@ 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
|
-
import { escapeHits, TAG_PLACEHOLDER, checkRendering, createDocumentationMessageGenerator, addAbsolutePosition, addQueryID, createSendEventForHits, createBindEventForHits, noop } from
|
|
7
|
+
import { escapeHits, TAG_PLACEHOLDER, checkRendering, createDocumentationMessageGenerator, addAbsolutePosition, addQueryID, createSendEventForHits, createBindEventForHits, noop } from "../../lib/utils/index.js";
|
|
8
8
|
var withUsage = createDocumentationMessageGenerator({
|
|
9
9
|
name: 'hits',
|
|
10
10
|
connector: true
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { withInsights } from
|
|
2
|
-
import connectHits from
|
|
1
|
+
import { withInsights } from "../../lib/insights/index.js";
|
|
2
|
+
import connectHits from "./connectHits.js";
|
|
3
3
|
var connectHitsWithInsights = withInsights(connectHits);
|
|
4
4
|
export default connectHitsWithInsights;
|
|
@@ -16,7 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
|
|
19
|
-
import { checkRendering, warning, createDocumentationMessageGenerator, noop } from
|
|
19
|
+
import { checkRendering, warning, createDocumentationMessageGenerator, noop } from "../../lib/utils/index.js";
|
|
20
20
|
var withUsage = createDocumentationMessageGenerator({
|
|
21
21
|
name: 'hits-per-page',
|
|
22
22
|
connector: true
|
package/es/connectors/index.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
|
-
export { default as connectClearRefinements } from
|
|
2
|
-
export { default as connectCurrentRefinements } from
|
|
3
|
-
export { default as connectHierarchicalMenu } from
|
|
4
|
-
export { default as connectHits } from
|
|
5
|
-
export { default as connectHitsWithInsights } from
|
|
6
|
-
export { default as connectHitsPerPage } from
|
|
7
|
-
export { default as connectInfiniteHits } from
|
|
8
|
-
export { default as connectInfiniteHitsWithInsights } from
|
|
9
|
-
export { default as connectMenu } from
|
|
10
|
-
export { default as connectNumericMenu } from
|
|
11
|
-
export { default as connectPagination } from
|
|
12
|
-
export { default as connectRange } from
|
|
13
|
-
export { default as connectRefinementList } from
|
|
14
|
-
export { default as connectSearchBox } from
|
|
15
|
-
export { default as connectSortBy } from
|
|
16
|
-
export { default as connectRatingMenu } from
|
|
17
|
-
export { default as connectStats } from
|
|
18
|
-
export { default as connectToggleRefinement } from
|
|
19
|
-
export { default as connectBreadcrumb } from
|
|
20
|
-
export { default as connectGeoSearch } from
|
|
21
|
-
export { default as connectPoweredBy } from
|
|
22
|
-
export { default as connectConfigure } from
|
|
23
|
-
export { default as EXPERIMENTAL_connectConfigureRelatedItems } from
|
|
24
|
-
export { default as connectAutocomplete } from
|
|
25
|
-
export { default as connectQueryRules } from
|
|
26
|
-
export { default as connectVoiceSearch } from
|
|
27
|
-
export { default as EXPERIMENTAL_connectAnswers } from
|
|
28
|
-
export { default as connectRelevantSort } from
|
|
29
|
-
import connectDynamicWidgets from
|
|
1
|
+
export { default as connectClearRefinements } from "./clear-refinements/connectClearRefinements.js";
|
|
2
|
+
export { default as connectCurrentRefinements } from "./current-refinements/connectCurrentRefinements.js";
|
|
3
|
+
export { default as connectHierarchicalMenu } from "./hierarchical-menu/connectHierarchicalMenu.js";
|
|
4
|
+
export { default as connectHits } from "./hits/connectHits.js";
|
|
5
|
+
export { default as connectHitsWithInsights } from "./hits/connectHitsWithInsights.js";
|
|
6
|
+
export { default as connectHitsPerPage } from "./hits-per-page/connectHitsPerPage.js";
|
|
7
|
+
export { default as connectInfiniteHits } from "./infinite-hits/connectInfiniteHits.js";
|
|
8
|
+
export { default as connectInfiniteHitsWithInsights } from "./infinite-hits/connectInfiniteHitsWithInsights.js";
|
|
9
|
+
export { default as connectMenu } from "./menu/connectMenu.js";
|
|
10
|
+
export { default as connectNumericMenu } from "./numeric-menu/connectNumericMenu.js";
|
|
11
|
+
export { default as connectPagination } from "./pagination/connectPagination.js";
|
|
12
|
+
export { default as connectRange } from "./range/connectRange.js";
|
|
13
|
+
export { default as connectRefinementList } from "./refinement-list/connectRefinementList.js";
|
|
14
|
+
export { default as connectSearchBox } from "./search-box/connectSearchBox.js";
|
|
15
|
+
export { default as connectSortBy } from "./sort-by/connectSortBy.js";
|
|
16
|
+
export { default as connectRatingMenu } from "./rating-menu/connectRatingMenu.js";
|
|
17
|
+
export { default as connectStats } from "./stats/connectStats.js";
|
|
18
|
+
export { default as connectToggleRefinement } from "./toggle-refinement/connectToggleRefinement.js";
|
|
19
|
+
export { default as connectBreadcrumb } from "./breadcrumb/connectBreadcrumb.js";
|
|
20
|
+
export { default as connectGeoSearch } from "./geo-search/connectGeoSearch.js";
|
|
21
|
+
export { default as connectPoweredBy } from "./powered-by/connectPoweredBy.js";
|
|
22
|
+
export { default as connectConfigure } from "./configure/connectConfigure.js";
|
|
23
|
+
export { default as EXPERIMENTAL_connectConfigureRelatedItems } from "./configure-related-items/connectConfigureRelatedItems.js";
|
|
24
|
+
export { default as connectAutocomplete } from "./autocomplete/connectAutocomplete.js";
|
|
25
|
+
export { default as connectQueryRules } from "./query-rules/connectQueryRules.js";
|
|
26
|
+
export { default as connectVoiceSearch } from "./voice-search/connectVoiceSearch.js";
|
|
27
|
+
export { default as EXPERIMENTAL_connectAnswers } from "./answers/connectAnswers.js";
|
|
28
|
+
export { default as connectRelevantSort } from "./relevant-sort/connectRelevantSort.js";
|
|
29
|
+
import connectDynamicWidgets from "./dynamic-widgets/connectDynamicWidgets.js";
|
|
30
30
|
export { connectDynamicWidgets };
|
|
31
|
-
import { deprecate } from
|
|
31
|
+
import { deprecate } from "../lib/utils/index.js";
|
|
32
32
|
/** @deprecated use connectDynamicWidgets */
|
|
33
33
|
|
|
34
34
|
export var EXPERIMENTAL_connectDynamicWidgets = deprecate(connectDynamicWidgets, 'use connectDynamicWidgets');
|
|
@@ -20,7 +20,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
20
20
|
|
|
21
21
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
22
22
|
|
|
23
|
-
import { escapeHits, TAG_PLACEHOLDER, checkRendering, createDocumentationMessageGenerator, isEqual, addAbsolutePosition, addQueryID, noop, createSendEventForHits, createBindEventForHits } from
|
|
23
|
+
import { escapeHits, TAG_PLACEHOLDER, checkRendering, createDocumentationMessageGenerator, isEqual, addAbsolutePosition, addQueryID, noop, createSendEventForHits, createBindEventForHits } from "../../lib/utils/index.js";
|
|
24
24
|
var withUsage = createDocumentationMessageGenerator({
|
|
25
25
|
name: 'infinite-hits',
|
|
26
26
|
connector: true
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { withInsights } from
|
|
2
|
-
import connectInfiniteHits from
|
|
1
|
+
import { withInsights } from "../../lib/insights/index.js";
|
|
2
|
+
import connectInfiniteHits from "./connectInfiniteHits.js";
|
|
3
3
|
var connectInfiniteHitsWithInsights = withInsights(connectInfiniteHits);
|
|
4
4
|
export default connectInfiniteHitsWithInsights;
|
|
@@ -20,7 +20,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
20
20
|
|
|
21
21
|
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; }
|
|
22
22
|
|
|
23
|
-
import { checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop } from
|
|
23
|
+
import { checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop } from "../../lib/utils/index.js";
|
|
24
24
|
var withUsage = createDocumentationMessageGenerator({
|
|
25
25
|
name: 'menu',
|
|
26
26
|
connector: true
|
|
@@ -16,7 +16,7 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
16
16
|
|
|
17
17
|
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; }
|
|
18
18
|
|
|
19
|
-
import { checkRendering, createDocumentationMessageGenerator, isFiniteNumber, convertNumericRefinementsToFilters, noop } from
|
|
19
|
+
import { checkRendering, createDocumentationMessageGenerator, isFiniteNumber, convertNumericRefinementsToFilters, noop } from "../../lib/utils/index.js";
|
|
20
20
|
var withUsage = createDocumentationMessageGenerator({
|
|
21
21
|
name: 'numeric-menu',
|
|
22
22
|
connector: true
|
|
@@ -6,7 +6,7 @@ function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _d
|
|
|
6
6
|
|
|
7
7
|
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; }
|
|
8
8
|
|
|
9
|
-
import { range } from
|
|
9
|
+
import { range } from "../../lib/utils/index.js";
|
|
10
10
|
|
|
11
11
|
var Paginator = /*#__PURE__*/function () {
|
|
12
12
|
function Paginator(params) {
|
|
@@ -4,8 +4,8 @@ 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
|
-
import { checkRendering, createDocumentationMessageGenerator, noop } from
|
|
8
|
-
import Paginator from
|
|
7
|
+
import { checkRendering, createDocumentationMessageGenerator, noop } from "../../lib/utils/index.js";
|
|
8
|
+
import Paginator from "./Paginator.js";
|
|
9
9
|
var withUsage = createDocumentationMessageGenerator({
|
|
10
10
|
name: 'pagination',
|
|
11
11
|
connector: true
|
|
@@ -4,7 +4,7 @@ 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
|
-
import { safelyRunOnBrowser, checkRendering, createDocumentationMessageGenerator, noop } from
|
|
7
|
+
import { safelyRunOnBrowser, checkRendering, createDocumentationMessageGenerator, noop } from "../../lib/utils/index.js";
|
|
8
8
|
var withUsage = createDocumentationMessageGenerator({
|
|
9
9
|
name: 'powered-by',
|
|
10
10
|
connector: true
|
|
@@ -16,7 +16,7 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
16
16
|
|
|
17
17
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
|
|
18
18
|
|
|
19
|
-
import { checkRendering, createDocumentationMessageGenerator, warning, getRefinements, isEqual, noop } from
|
|
19
|
+
import { checkRendering, createDocumentationMessageGenerator, warning, getRefinements, isEqual, noop } from "../../lib/utils/index.js";
|
|
20
20
|
var withUsage = createDocumentationMessageGenerator({
|
|
21
21
|
name: 'query-rules',
|
|
22
22
|
connector: true
|
|
@@ -16,7 +16,7 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
16
16
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
|
|
19
|
-
import { checkRendering, createDocumentationMessageGenerator, convertNumericRefinementsToFilters, isFiniteNumber, find, noop } from
|
|
19
|
+
import { checkRendering, createDocumentationMessageGenerator, convertNumericRefinementsToFilters, isFiniteNumber, find, noop } from "../../lib/utils/index.js";
|
|
20
20
|
var withUsage = createDocumentationMessageGenerator({
|
|
21
21
|
name: 'range-input',
|
|
22
22
|
connector: true
|
|
@@ -24,7 +24,7 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
24
24
|
|
|
25
25
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
26
26
|
|
|
27
|
-
import { checkRendering, createDocumentationLink, createDocumentationMessageGenerator, noop, warning } from
|
|
27
|
+
import { checkRendering, createDocumentationLink, createDocumentationMessageGenerator, noop, warning } from "../../lib/utils/index.js";
|
|
28
28
|
var withUsage = createDocumentationMessageGenerator({
|
|
29
29
|
name: 'rating-menu',
|
|
30
30
|
connector: true
|
|
@@ -8,7 +8,7 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
8
8
|
|
|
9
9
|
function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
|
|
10
10
|
|
|
11
|
-
import { escapeFacets, TAG_PLACEHOLDER, TAG_REPLACEMENT, checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop } from
|
|
11
|
+
import { escapeFacets, TAG_PLACEHOLDER, TAG_REPLACEMENT, checkRendering, createDocumentationMessageGenerator, createSendEventForFacet, noop } from "../../lib/utils/index.js";
|
|
12
12
|
var withUsage = createDocumentationMessageGenerator({
|
|
13
13
|
name: 'refinement-list',
|
|
14
14
|
connector: true
|
|
@@ -4,7 +4,7 @@ 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
|
-
import { noop } from
|
|
7
|
+
import { noop } from "../../lib/utils/index.js";
|
|
8
8
|
|
|
9
9
|
var connectRelevantSort = function connectRelevantSort() {
|
|
10
10
|
var renderFn = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : noop;
|
|
@@ -4,38 +4,34 @@ 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
|
-
import { checkRendering, createDocumentationMessageGenerator, noop } from
|
|
7
|
+
import { checkRendering, createDocumentationMessageGenerator, noop } from "../../lib/utils/index.js";
|
|
8
8
|
var withUsage = createDocumentationMessageGenerator({
|
|
9
9
|
name: 'search-box',
|
|
10
10
|
connector: true
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
+
var defaultQueryHook = function defaultQueryHook(query, hook) {
|
|
14
|
+
return hook(query);
|
|
15
|
+
};
|
|
13
16
|
/**
|
|
14
17
|
* **SearchBox** connector provides the logic to build a widget that will let the user search for a query.
|
|
15
18
|
*
|
|
16
19
|
* The connector provides to the rendering: `refine()` to set the query. The behaviour of this function
|
|
17
20
|
* may be impacted by the `queryHook` widget parameter.
|
|
18
21
|
*/
|
|
22
|
+
|
|
23
|
+
|
|
19
24
|
var connectSearchBox = function connectSearchBox(renderFn) {
|
|
20
25
|
var unmountFn = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : noop;
|
|
21
26
|
checkRendering(renderFn, withUsage());
|
|
22
27
|
return function (widgetParams) {
|
|
23
28
|
var _ref = widgetParams || {},
|
|
24
|
-
queryHook = _ref.queryHook
|
|
25
|
-
|
|
26
|
-
function clear(helper) {
|
|
27
|
-
return function () {
|
|
28
|
-
helper.setQuery('').search();
|
|
29
|
-
};
|
|
30
|
-
}
|
|
29
|
+
_ref$queryHook = _ref.queryHook,
|
|
30
|
+
queryHook = _ref$queryHook === void 0 ? defaultQueryHook : _ref$queryHook;
|
|
31
31
|
|
|
32
32
|
var _refine;
|
|
33
33
|
|
|
34
|
-
var _clear
|
|
35
|
-
|
|
36
|
-
function _cachedClear() {
|
|
37
|
-
_clear();
|
|
38
|
-
}
|
|
34
|
+
var _clear;
|
|
39
35
|
|
|
40
36
|
return {
|
|
41
37
|
$$type: 'ais.searchBox',
|
|
@@ -67,27 +63,21 @@ var connectSearchBox = function connectSearchBox(renderFn) {
|
|
|
67
63
|
state = _ref3.state;
|
|
68
64
|
|
|
69
65
|
if (!_refine) {
|
|
70
|
-
var setQueryAndSearch = function setQueryAndSearch(query) {
|
|
71
|
-
if (query !== state.query) {
|
|
72
|
-
helper.setQuery(query).search();
|
|
73
|
-
}
|
|
74
|
-
};
|
|
75
|
-
|
|
76
66
|
_refine = function _refine(query) {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
67
|
+
queryHook(query, function (q) {
|
|
68
|
+
return helper.setQuery(q).search();
|
|
69
|
+
});
|
|
70
|
+
};
|
|
81
71
|
|
|
82
|
-
|
|
72
|
+
_clear = function _clear() {
|
|
73
|
+
helper.setQuery('').search();
|
|
83
74
|
};
|
|
84
75
|
}
|
|
85
76
|
|
|
86
|
-
_clear = clear(helper);
|
|
87
77
|
return {
|
|
88
78
|
query: state.query || '',
|
|
89
79
|
refine: _refine,
|
|
90
|
-
clear:
|
|
80
|
+
clear: _clear,
|
|
91
81
|
widgetParams: widgetParams,
|
|
92
82
|
isSearchStalled: searchMetadata.isSearchStalled
|
|
93
83
|
};
|
|
@@ -4,7 +4,7 @@ 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
|
-
import { checkRendering, createDocumentationMessageGenerator, find, warning, noop } from
|
|
7
|
+
import { checkRendering, createDocumentationMessageGenerator, find, warning, noop } from "../../lib/utils/index.js";
|
|
8
8
|
var withUsage = createDocumentationMessageGenerator({
|
|
9
9
|
name: 'sort-by',
|
|
10
10
|
connector: true
|
|
@@ -4,7 +4,7 @@ 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
|
-
import { checkRendering, createDocumentationMessageGenerator, noop } from
|
|
7
|
+
import { checkRendering, createDocumentationMessageGenerator, noop } from "../../lib/utils/index.js";
|
|
8
8
|
var withUsage = createDocumentationMessageGenerator({
|
|
9
9
|
name: 'stats',
|
|
10
10
|
connector: true
|
|
@@ -3,13 +3,19 @@ declare type BuiltInSendEventForToggle = (eventType: string, isRefined: boolean,
|
|
|
3
3
|
declare type CustomSendEventForToggle = (customPayload: any) => void;
|
|
4
4
|
export declare type SendEventForToggle = BuiltInSendEventForToggle & CustomSendEventForToggle;
|
|
5
5
|
export declare type ToggleRefinementValue = {
|
|
6
|
-
/**
|
|
6
|
+
/**
|
|
7
|
+
* Whether this option is enabled.
|
|
8
|
+
*/
|
|
7
9
|
isRefined: boolean;
|
|
8
|
-
/**
|
|
10
|
+
/**
|
|
11
|
+
* Number of result if this option is toggled.
|
|
12
|
+
*/
|
|
9
13
|
count: number | null;
|
|
10
14
|
};
|
|
11
15
|
export declare type ToggleRefinementConnectorParams = {
|
|
12
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* Name of the attribute for faceting (e.g., "free_shipping").
|
|
18
|
+
*/
|
|
13
19
|
attribute: string;
|
|
14
20
|
/**
|
|
15
21
|
* Value to filter on when toggled.
|
|
@@ -24,19 +30,42 @@ export declare type ToggleRefinementConnectorParams = {
|
|
|
24
30
|
export declare type ToggleRefinementRenderState = {
|
|
25
31
|
/** The current toggle value */
|
|
26
32
|
value: {
|
|
33
|
+
/**
|
|
34
|
+
* The attribute name of this toggle.
|
|
35
|
+
*/
|
|
27
36
|
name: string;
|
|
37
|
+
/**
|
|
38
|
+
* Whether the current option is "on" (true) or "off" (false)
|
|
39
|
+
*/
|
|
28
40
|
isRefined: boolean;
|
|
41
|
+
/**
|
|
42
|
+
* Number of results if this option is toggled.
|
|
43
|
+
*/
|
|
29
44
|
count: number | null;
|
|
45
|
+
/**
|
|
46
|
+
* Information about the "on" toggle.
|
|
47
|
+
*/
|
|
30
48
|
onFacetValue: ToggleRefinementValue;
|
|
49
|
+
/**
|
|
50
|
+
* Information about the "off" toggle.
|
|
51
|
+
*/
|
|
31
52
|
offFacetValue: ToggleRefinementValue;
|
|
32
53
|
};
|
|
33
|
-
/**
|
|
54
|
+
/**
|
|
55
|
+
* Creates an URL for the next state.
|
|
56
|
+
*/
|
|
34
57
|
createURL: CreateURL<string>;
|
|
35
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Send a "Facet Clicked" Insights event.
|
|
60
|
+
*/
|
|
36
61
|
sendEvent: SendEventForToggle;
|
|
37
|
-
/**
|
|
62
|
+
/**
|
|
63
|
+
* Indicates if search state can be refined.
|
|
64
|
+
*/
|
|
38
65
|
canRefine: boolean;
|
|
39
|
-
/**
|
|
66
|
+
/**
|
|
67
|
+
* Updates to the next state by applying the toggle refinement.
|
|
68
|
+
*/
|
|
40
69
|
refine: (value?: {
|
|
41
70
|
isRefined: boolean;
|
|
42
71
|
}) => void;
|
|
@@ -4,7 +4,7 @@ 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
|
-
import { checkRendering, escapeRefinement, unescapeRefinement, createDocumentationMessageGenerator, find, noop, toArray } from
|
|
7
|
+
import { checkRendering, escapeRefinement, unescapeRefinement, createDocumentationMessageGenerator, find, noop, toArray } from "../../lib/utils/index.js";
|
|
8
8
|
var withUsage = createDocumentationMessageGenerator({
|
|
9
9
|
name: 'toggle-refinement',
|
|
10
10
|
connector: true
|
|
@@ -4,8 +4,8 @@ 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
|
-
import { checkRendering, createDocumentationMessageGenerator, noop } from
|
|
8
|
-
import builtInCreateVoiceSearchHelper from
|
|
7
|
+
import { checkRendering, createDocumentationMessageGenerator, noop } from "../../lib/utils/index.js";
|
|
8
|
+
import builtInCreateVoiceSearchHelper from "../../lib/voiceSearchHelper/index.js";
|
|
9
9
|
var withUsage = createDocumentationMessageGenerator({
|
|
10
10
|
name: 'voice-search',
|
|
11
11
|
connector: true
|
package/es/helpers/highlight.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { component } from
|
|
2
|
-
import { getPropertyByPath, TAG_REPLACEMENT } from
|
|
1
|
+
import { component } from "../lib/suit.js";
|
|
2
|
+
import { getPropertyByPath, TAG_REPLACEMENT, warning } from "../lib/utils/index.js";
|
|
3
3
|
var suit = component('Highlight');
|
|
4
4
|
export default function highlight(_ref) {
|
|
5
5
|
var attribute = _ref.attribute,
|
|
@@ -8,8 +8,11 @@ export default function highlight(_ref) {
|
|
|
8
8
|
hit = _ref.hit,
|
|
9
9
|
_ref$cssClasses = _ref.cssClasses,
|
|
10
10
|
cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;
|
|
11
|
+
var highlightAttributeResult = getPropertyByPath(hit._highlightResult, attribute); // @MAJOR fallback to attribute value if highlight is not found
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
process.env.NODE_ENV === 'development' ? warning(highlightAttributeResult, "Could not enable highlight for \"".concat(attribute, "\", will display an empty string.\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\n\nSee: https://alg.li/highlighting\n")) : void 0;
|
|
14
|
+
|
|
15
|
+
var _ref2 = highlightAttributeResult || {},
|
|
13
16
|
_ref2$value = _ref2.value,
|
|
14
17
|
attributeValue = _ref2$value === void 0 ? '' : _ref2$value; // cx is not used, since it would be bundled as a dependency for Vue & Angular
|
|
15
18
|
|
package/es/helpers/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * from
|
|
4
|
-
export * from
|
|
5
|
-
export { default as reverseHighlight } from
|
|
6
|
-
export { default as reverseSnippet } from
|
|
7
|
-
export { default as highlight } from
|
|
8
|
-
export { default as snippet } from
|
|
9
|
-
export { default as insights } from
|
|
10
|
-
export { default as getInsightsAnonymousUserToken, getInsightsAnonymousUserTokenInternal } from
|
|
1
|
+
export * from "./highlight.js";
|
|
2
|
+
export * from "./reverseHighlight.js";
|
|
3
|
+
export * from "./snippet.js";
|
|
4
|
+
export * from "./reverseSnippet.js";
|
|
5
|
+
export { default as reverseHighlight } from "./reverseHighlight.js";
|
|
6
|
+
export { default as reverseSnippet } from "./reverseSnippet.js";
|
|
7
|
+
export { default as highlight } from "./highlight.js";
|
|
8
|
+
export { default as snippet } from "./snippet.js";
|
|
9
|
+
export { default as insights } from "./insights.js";
|
|
10
|
+
export { default as getInsightsAnonymousUserToken, getInsightsAnonymousUserTokenInternal } from "./get-insights-anonymous-user-token.js";
|
package/es/helpers/insights.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
2
2
|
|
|
3
|
-
import { warning, serializePayload, deserializePayload } from
|
|
3
|
+
import { warning, serializePayload, deserializePayload } from "../lib/utils/index.js";
|
|
4
4
|
export function readDataAttributes(domElement) {
|
|
5
5
|
var method = domElement.getAttribute('data-insights-method');
|
|
6
6
|
var serializedPayload = domElement.getAttribute('data-insights-payload');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts } from
|
|
2
|
-
import { component } from
|
|
1
|
+
import { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts, warning } from "../lib/utils/index.js";
|
|
2
|
+
import { component } from "../lib/suit.js";
|
|
3
3
|
var suit = component('ReverseHighlight');
|
|
4
4
|
export default function reverseHighlight(_ref) {
|
|
5
5
|
var attribute = _ref.attribute,
|
|
@@ -8,8 +8,11 @@ export default function reverseHighlight(_ref) {
|
|
|
8
8
|
hit = _ref.hit,
|
|
9
9
|
_ref$cssClasses = _ref.cssClasses,
|
|
10
10
|
cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;
|
|
11
|
+
var highlightAttributeResult = getPropertyByPath(hit._highlightResult, attribute); // @MAJOR fallback to attribute value if highlight is not found
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
process.env.NODE_ENV === 'development' ? warning(highlightAttributeResult, "Could not enable reverse highlight for \"".concat(attribute, "\", will display an empty string.\nPlease check whether this attribute exists and is either searchable or specified in `attributesToHighlight`.\n\nSee: https://alg.li/highlighting\n")) : void 0;
|
|
14
|
+
|
|
15
|
+
var _ref2 = highlightAttributeResult || {},
|
|
13
16
|
_ref2$value = _ref2.value,
|
|
14
17
|
attributeValue = _ref2$value === void 0 ? '' : _ref2$value; // cx is not used, since it would be bundled as a dependency for Vue & Angular
|
|
15
18
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts } from
|
|
2
|
-
import { component } from
|
|
1
|
+
import { TAG_REPLACEMENT, getPropertyByPath, getHighlightedParts, reverseHighlightedParts, concatHighlightedParts, warning } from "../lib/utils/index.js";
|
|
2
|
+
import { component } from "../lib/suit.js";
|
|
3
3
|
var suit = component('ReverseSnippet');
|
|
4
4
|
export default function reverseSnippet(_ref) {
|
|
5
5
|
var attribute = _ref.attribute,
|
|
@@ -8,8 +8,11 @@ export default function reverseSnippet(_ref) {
|
|
|
8
8
|
hit = _ref.hit,
|
|
9
9
|
_ref$cssClasses = _ref.cssClasses,
|
|
10
10
|
cssClasses = _ref$cssClasses === void 0 ? {} : _ref$cssClasses;
|
|
11
|
+
var snippetAttributeResult = getPropertyByPath(hit._snippetResult, attribute); // @MAJOR fallback to attribute value if snippet is not found
|
|
11
12
|
|
|
12
|
-
|
|
13
|
+
process.env.NODE_ENV === 'development' ? warning(snippetAttributeResult, "Could not enable reverse snippet for \"".concat(attribute, "\", will display an empty string.\nPlease check whether this attribute exists and is specified in `attributesToSnippet`.\n\nSee: https://alg.li/highlighting\n")) : void 0;
|
|
14
|
+
|
|
15
|
+
var _ref2 = snippetAttributeResult || {},
|
|
13
16
|
_ref2$value = _ref2.value,
|
|
14
17
|
attributeValue = _ref2$value === void 0 ? '' : _ref2$value; // cx is not used, since it would be bundled as a dependency for Vue & Angular
|
|
15
18
|
|