instantsearch.js 4.49.2 → 4.49.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/README.md +12 -6
- package/cjs/components/Answers/Answers.js +5 -2
- package/cjs/components/Breadcrumb/Breadcrumb.js +1 -1
- package/cjs/components/ClearRefinements/ClearRefinements.js +1 -1
- package/cjs/components/CurrentRefinements/CurrentRefinements.js +3 -4
- package/cjs/components/GeoSearchControls/GeoSearchButton.js +0 -1
- package/cjs/components/GeoSearchControls/GeoSearchControls.js +3 -3
- package/cjs/components/GeoSearchControls/GeoSearchToggle.js +0 -1
- package/cjs/components/Highlight/Highlight.js +3 -2
- package/cjs/components/Hits/Hits.js +5 -2
- package/cjs/components/InfiniteHits/InfiniteHits.js +5 -2
- package/cjs/components/MenuSelect/MenuSelect.js +3 -3
- package/cjs/components/Pagination/Pagination.js +2 -3
- package/cjs/components/Panel/Panel.js +3 -3
- package/cjs/components/PoweredBy/PoweredBy.js +0 -1
- package/cjs/components/QueryRuleCustomData/QueryRuleCustomData.js +1 -2
- package/cjs/components/RangeInput/RangeInput.js +6 -4
- package/cjs/components/RefinementList/RefinementList.js +13 -10
- package/cjs/components/RefinementList/RefinementListItem.js +1 -1
- package/cjs/components/RelevantSort/RelevantSort.js +1 -2
- package/cjs/components/ReverseHighlight/ReverseHighlight.js +3 -2
- package/cjs/components/ReverseSnippet/ReverseSnippet.js +3 -2
- package/cjs/components/SearchBox/SearchBox.js +11 -9
- package/cjs/components/Selector/Selector.js +0 -1
- package/cjs/components/Slider/Pit.js +4 -1
- package/cjs/components/Slider/Rheostat.js +7 -3
- package/cjs/components/Slider/Slider.js +13 -9
- package/cjs/components/Snippet/Snippet.js +3 -2
- package/cjs/components/Stats/Stats.js +7 -3
- package/cjs/components/Template/Template.js +9 -7
- package/cjs/components/ToggleRefinement/ToggleRefinement.js +1 -1
- package/cjs/components/VoiceSearch/VoiceSearch.js +1 -2
- package/cjs/connectors/answers/connectAnswers.js +17 -12
- package/cjs/connectors/autocomplete/connectAutocomplete.js +13 -10
- package/cjs/connectors/breadcrumb/connectBreadcrumb.js +11 -8
- package/cjs/connectors/clear-refinements/connectClearRefinements.js +14 -11
- package/cjs/connectors/configure/connectConfigure.js +12 -9
- package/cjs/connectors/configure-related-items/connectConfigureRelatedItems.js +10 -7
- package/cjs/connectors/current-refinements/connectCurrentRefinements.js +11 -8
- package/cjs/connectors/dynamic-widgets/connectDynamicWidgets.js +10 -8
- package/cjs/connectors/geo-search/connectGeoSearch.js +15 -12
- package/cjs/connectors/hierarchical-menu/connectHierarchicalMenu.js +14 -10
- package/cjs/connectors/hits/connectHits.js +15 -12
- package/cjs/connectors/hits/connectHitsWithInsights.js +3 -3
- package/cjs/connectors/hits-per-page/connectHitsPerPage.js +11 -8
- package/cjs/connectors/index.js +32 -32
- package/cjs/connectors/infinite-hits/connectInfiniteHits.js +19 -15
- package/cjs/connectors/infinite-hits/connectInfiniteHitsWithInsights.js +3 -3
- package/cjs/connectors/menu/connectMenu.js +13 -9
- package/cjs/connectors/numeric-menu/connectNumericMenu.js +14 -9
- package/cjs/connectors/pagination/Paginator.js +8 -5
- package/cjs/connectors/pagination/connectPagination.js +9 -6
- package/cjs/connectors/powered-by/connectPoweredBy.js +9 -6
- package/cjs/connectors/query-rules/connectQueryRules.js +12 -9
- package/cjs/connectors/range/connectRange.js +32 -29
- package/cjs/connectors/rating-menu/connectRatingMenu.js +12 -9
- package/cjs/connectors/refinement-list/connectRefinementList.js +16 -11
- package/cjs/connectors/relevant-sort/connectRelevantSort.js +7 -4
- package/cjs/connectors/search-box/connectSearchBox.js +8 -5
- package/cjs/connectors/sort-by/connectSortBy.js +10 -7
- package/cjs/connectors/stats/connectStats.js +8 -5
- package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +15 -12
- package/cjs/connectors/voice-search/connectVoiceSearch.js +10 -7
- package/cjs/helpers/components/Highlight.js +8 -7
- package/cjs/helpers/components/ReverseHighlight.js +14 -9
- package/cjs/helpers/components/ReverseSnippet.js +14 -9
- package/cjs/helpers/components/Snippet.js +8 -7
- package/cjs/helpers/components/index.js +4 -4
- package/cjs/helpers/get-insights-anonymous-user-token.js +2 -2
- package/cjs/helpers/highlight.js +8 -6
- package/cjs/helpers/index.js +6 -6
- package/cjs/helpers/insights.js +4 -4
- package/cjs/helpers/reverseHighlight.js +9 -7
- package/cjs/helpers/reverseSnippet.js +9 -7
- package/cjs/helpers/snippet.js +8 -6
- package/cjs/index.js +9 -9
- package/cjs/lib/InstantSearch.js +31 -29
- package/cjs/lib/createHelpers.js +11 -8
- package/cjs/lib/infiniteHitsCache/index.js +1 -1
- package/cjs/lib/infiniteHitsCache/sessionStorage.js +6 -5
- package/cjs/lib/insights/client.js +9 -6
- package/cjs/lib/insights/index.js +2 -2
- package/cjs/lib/insights/listener.js +3 -4
- package/cjs/lib/routers/history.js +16 -19
- package/cjs/lib/routers/index.js +1 -1
- package/cjs/lib/stateMappings/index.js +2 -2
- package/cjs/lib/stateMappings/simple.js +6 -2
- package/cjs/lib/stateMappings/singleIndex.js +6 -2
- package/cjs/lib/templating/index.js +2 -2
- package/cjs/lib/templating/prepareTemplateProps.js +6 -3
- package/cjs/lib/templating/renderTemplate.js +8 -6
- package/cjs/lib/utils/checkIndexUiState.js +5 -5
- 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 +8 -4
- package/cjs/lib/utils/geo-search.js +14 -10
- 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 +17 -19
- package/cjs/lib/utils/hits-absolute-position.js +4 -1
- package/cjs/lib/utils/hits-query-id.js +4 -1
- package/cjs/lib/utils/index.js +46 -46
- package/cjs/lib/utils/isEqual.js +3 -0
- package/cjs/lib/utils/logger.js +3 -3
- package/cjs/lib/utils/mergeSearchParameters.js +8 -4
- package/cjs/lib/utils/range.js +1 -1
- package/cjs/lib/utils/reverseHighlightedParts.js +5 -2
- package/cjs/lib/utils/setIndexHelperState.js +2 -2
- package/cjs/lib/version.js +1 -1
- package/cjs/lib/voiceSearchHelper/index.js +4 -1
- package/cjs/middlewares/createInsightsMiddleware.js +18 -13
- package/cjs/middlewares/createMetadataMiddleware.js +3 -3
- package/cjs/middlewares/createRouterMiddleware.js +8 -5
- package/cjs/middlewares/index.js +3 -3
- package/cjs/types/index.js +14 -14
- package/cjs/widgets/analytics/analytics.js +13 -4
- package/cjs/widgets/answers/answers.js +13 -10
- package/cjs/widgets/breadcrumb/breadcrumb.js +13 -10
- package/cjs/widgets/clear-refinements/clear-refinements.js +13 -10
- package/cjs/widgets/configure/configure.js +7 -4
- package/cjs/widgets/configure-related-items/configure-related-items.js +7 -4
- package/cjs/widgets/current-refinements/current-refinements.js +10 -7
- package/cjs/widgets/dynamic-widgets/dynamic-widgets.js +12 -8
- package/cjs/widgets/geo-search/GeoSearchRenderer.js +12 -7
- package/cjs/widgets/geo-search/createHTMLMarker.js +4 -2
- package/cjs/widgets/geo-search/geo-search.js +20 -14
- package/cjs/widgets/hierarchical-menu/defaultTemplates.js +1 -2
- package/cjs/widgets/hierarchical-menu/hierarchical-menu.js +13 -10
- package/cjs/widgets/hits/hits.js +16 -13
- package/cjs/widgets/hits-per-page/hits-per-page.js +11 -8
- package/cjs/widgets/index/index.js +24 -20
- package/cjs/widgets/index.js +37 -37
- package/cjs/widgets/infinite-hits/infinite-hits.js +16 -13
- package/cjs/widgets/menu/defaultTemplates.js +1 -2
- package/cjs/widgets/menu/menu.js +13 -10
- package/cjs/widgets/menu-select/defaultTemplates.js +1 -1
- package/cjs/widgets/menu-select/menu-select.js +13 -10
- package/cjs/widgets/numeric-menu/defaultTemplates.js +0 -1
- package/cjs/widgets/numeric-menu/numeric-menu.js +13 -10
- package/cjs/widgets/pagination/pagination.js +11 -8
- package/cjs/widgets/panel/panel.js +11 -8
- package/cjs/widgets/places/places.js +8 -3
- package/cjs/widgets/powered-by/powered-by.js +10 -7
- package/cjs/widgets/query-rule-context/query-rule-context.js +8 -5
- package/cjs/widgets/query-rule-custom-data/query-rule-custom-data.js +10 -7
- package/cjs/widgets/range-input/range-input.js +14 -11
- package/cjs/widgets/range-slider/range-slider.js +12 -9
- package/cjs/widgets/rating-menu/defaultTemplates.js +1 -2
- package/cjs/widgets/rating-menu/rating-menu.js +13 -10
- package/cjs/widgets/refinement-list/defaultTemplates.js +1 -2
- package/cjs/widgets/refinement-list/refinement-list.js +15 -12
- package/cjs/widgets/relevant-sort/relevant-sort.js +11 -8
- package/cjs/widgets/search-box/search-box.js +11 -8
- package/cjs/widgets/sort-by/sort-by.js +10 -7
- package/cjs/widgets/stats/defaultTemplates.js +1 -1
- package/cjs/widgets/stats/stats.js +13 -10
- package/cjs/widgets/toggle-refinement/toggle-refinement.js +13 -10
- package/cjs/widgets/voice-search/voice-search.js +11 -8
- package/dist/instantsearch.development.d.ts +1 -0
- package/dist/instantsearch.development.js +184 -120
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +1 -0
- package/dist/instantsearch.production.min.d.ts +1 -0
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Answers/Answers.js +4 -2
- package/es/components/Breadcrumb/Breadcrumb.js +0 -1
- package/es/components/ClearRefinements/ClearRefinements.js +0 -1
- package/es/components/CurrentRefinements/CurrentRefinements.js +0 -2
- package/es/components/GeoSearchControls/GeoSearchButton.js +0 -2
- package/es/components/GeoSearchControls/GeoSearchControls.js +0 -1
- package/es/components/GeoSearchControls/GeoSearchToggle.js +0 -2
- package/es/components/Highlight/Highlight.js +2 -1
- package/es/components/Hits/Hits.js +4 -2
- package/es/components/InfiniteHits/InfiniteHits.js +4 -2
- package/es/components/MenuSelect/MenuSelect.js +0 -1
- package/es/components/Pagination/Pagination.js +0 -2
- package/es/components/Panel/Panel.js +2 -3
- package/es/components/PoweredBy/PoweredBy.js +0 -2
- package/es/components/QueryRuleCustomData/QueryRuleCustomData.js +0 -2
- package/es/components/RangeInput/RangeInput.js +4 -3
- package/es/components/RefinementList/RefinementList.js +6 -4
- package/es/components/RefinementList/RefinementListItem.js +0 -1
- package/es/components/RelevantSort/RelevantSort.js +0 -2
- package/es/components/ReverseHighlight/ReverseHighlight.js +2 -1
- package/es/components/ReverseSnippet/ReverseSnippet.js +2 -1
- package/es/components/SearchBox/SearchBox.js +4 -3
- package/es/components/Selector/Selector.js +0 -2
- package/es/components/Slider/Pit.js +4 -2
- package/es/components/Slider/Rheostat.js +8 -6
- package/es/components/Slider/Slider.js +8 -5
- package/es/components/Snippet/Snippet.js +2 -1
- package/es/components/Stats/Stats.js +6 -3
- package/es/components/Template/Template.js +4 -3
- package/es/components/ToggleRefinement/ToggleRefinement.js +0 -1
- package/es/components/VoiceSearch/VoiceSearch.js +0 -2
- package/es/connectors/answers/connectAnswers.js +7 -2
- package/es/connectors/autocomplete/connectAutocomplete.js +4 -1
- package/es/connectors/breadcrumb/connectBreadcrumb.js +6 -3
- package/es/connectors/clear-refinements/connectClearRefinements.js +5 -2
- package/es/connectors/configure/connectConfigure.js +4 -1
- package/es/connectors/configure-related-items/connectConfigureRelatedItems.js +5 -2
- package/es/connectors/current-refinements/connectCurrentRefinements.js +5 -2
- package/es/connectors/dynamic-widgets/connectDynamicWidgets.js +3 -1
- package/es/connectors/geo-search/connectGeoSearch.js +4 -1
- package/es/connectors/hierarchical-menu/connectHierarchicalMenu.js +8 -4
- package/es/connectors/hits/connectHits.js +4 -1
- package/es/connectors/hits-per-page/connectHitsPerPage.js +5 -2
- package/es/connectors/infinite-hits/connectInfiniteHits.js +7 -3
- package/es/connectors/menu/connectMenu.js +8 -4
- package/es/connectors/numeric-menu/connectNumericMenu.js +8 -3
- package/es/connectors/pagination/Paginator.js +5 -2
- package/es/connectors/pagination/connectPagination.js +4 -1
- package/es/connectors/powered-by/connectPoweredBy.js +4 -1
- package/es/connectors/query-rules/connectQueryRules.js +5 -2
- package/es/connectors/range/connectRange.js +6 -3
- package/es/connectors/rating-menu/connectRatingMenu.js +6 -3
- package/es/connectors/refinement-list/connectRefinementList.js +8 -3
- package/es/connectors/relevant-sort/connectRelevantSort.js +4 -1
- package/es/connectors/search-box/connectSearchBox.js +4 -1
- package/es/connectors/sort-by/connectSortBy.js +4 -1
- package/es/connectors/stats/connectStats.js +4 -1
- package/es/connectors/toggle-refinement/connectToggleRefinement.js +4 -1
- package/es/connectors/toggle-refinement/types.js +1 -0
- package/es/connectors/voice-search/connectVoiceSearch.js +4 -1
- package/es/helpers/components/Highlight.js +2 -1
- package/es/helpers/components/ReverseHighlight.js +8 -3
- package/es/helpers/components/ReverseSnippet.js +8 -3
- package/es/helpers/components/Snippet.js +2 -1
- package/es/helpers/highlight.js +3 -1
- package/es/helpers/reverseHighlight.js +3 -1
- package/es/helpers/reverseSnippet.js +3 -1
- package/es/helpers/snippet.js +3 -1
- package/es/lib/InstantSearch.js +4 -2
- package/es/lib/createHelpers.js +4 -1
- package/es/lib/infiniteHitsCache/sessionStorage.js +2 -1
- package/es/lib/insights/client.js +4 -1
- package/es/lib/insights/listener.js +0 -2
- package/es/lib/routers/history.js +9 -12
- package/es/lib/stateMappings/simple.js +6 -2
- package/es/lib/stateMappings/singleIndex.js +6 -2
- package/es/lib/templating/prepareTemplateProps.js +5 -2
- package/es/lib/templating/renderTemplate.js +3 -1
- package/es/lib/utils/checkIndexUiState.js +2 -2
- package/es/lib/utils/escape-highlight.js +6 -2
- package/es/lib/utils/geo-search.js +14 -10
- package/es/lib/utils/getRefinements.js +15 -17
- package/es/lib/utils/hits-absolute-position.js +4 -1
- package/es/lib/utils/hits-query-id.js +4 -1
- package/es/lib/utils/isEqual.js +3 -0
- package/es/lib/utils/logger.js +2 -2
- package/es/lib/utils/mergeSearchParameters.js +6 -2
- package/es/lib/utils/range.js +1 -1
- package/es/lib/utils/reverseHighlightedParts.js +4 -1
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/lib/voiceSearchHelper/index.js +4 -1
- package/es/lib/voiceSearchHelper/types.js +1 -0
- package/es/middlewares/createInsightsMiddleware.js +9 -4
- package/es/middlewares/createRouterMiddleware.js +4 -1
- package/es/types/algoliasearch.js +1 -0
- package/es/types/component.js +1 -0
- package/es/types/connector.js +1 -0
- package/es/types/insights.js +1 -0
- package/es/types/instantsearch.js +1 -0
- package/es/types/middleware.js +1 -0
- package/es/types/render-state.js +1 -0
- package/es/types/results.js +1 -0
- package/es/types/router.js +1 -0
- package/es/types/templates.js +1 -0
- package/es/types/ui-state.js +1 -0
- package/es/types/utils.js +1 -0
- package/es/types/widget-factory.js +1 -0
- package/es/types/widget.js +1 -0
- package/es/widgets/analytics/analytics.js +10 -1
- package/es/widgets/answers/answers.js +4 -2
- package/es/widgets/breadcrumb/breadcrumb.js +4 -2
- package/es/widgets/clear-refinements/clear-refinements.js +4 -2
- package/es/widgets/configure/configure.js +4 -1
- package/es/widgets/configure-related-items/configure-related-items.js +4 -1
- package/es/widgets/current-refinements/current-refinements.js +4 -2
- package/es/widgets/dynamic-widgets/dynamic-widgets.js +6 -2
- package/es/widgets/geo-search/GeoSearchRenderer.d.js +1 -0
- package/es/widgets/geo-search/GeoSearchRenderer.js +9 -5
- package/es/widgets/geo-search/createHTMLMarker.d.ts +1 -0
- package/es/widgets/geo-search/createHTMLMarker.js +4 -2
- package/es/widgets/geo-search/defaultTemplates.js +0 -2
- package/es/widgets/geo-search/geo-search.d.ts +1 -0
- package/es/widgets/geo-search/geo-search.js +10 -4
- package/es/widgets/hierarchical-menu/defaultTemplates.js +0 -1
- package/es/widgets/hierarchical-menu/hierarchical-menu.js +4 -2
- package/es/widgets/hits/hits.js +4 -2
- package/es/widgets/hits-per-page/hits-per-page.js +4 -2
- package/es/widgets/index/index.js +7 -3
- package/es/widgets/infinite-hits/infinite-hits.js +4 -2
- package/es/widgets/menu/defaultTemplates.js +0 -1
- package/es/widgets/menu/menu.js +4 -2
- package/es/widgets/menu-select/menu-select.js +4 -2
- package/es/widgets/numeric-menu/defaultTemplates.js +0 -1
- package/es/widgets/numeric-menu/numeric-menu.js +4 -2
- package/es/widgets/pagination/pagination.js +4 -2
- package/es/widgets/panel/panel.js +4 -2
- package/es/widgets/places/places.js +8 -3
- package/es/widgets/powered-by/powered-by.js +4 -2
- package/es/widgets/query-rule-context/query-rule-context.js +4 -1
- package/es/widgets/query-rule-custom-data/query-rule-custom-data.js +4 -2
- package/es/widgets/range-input/range-input.js +6 -4
- package/es/widgets/range-slider/range-slider.js +6 -4
- package/es/widgets/rating-menu/defaultTemplates.js +0 -1
- package/es/widgets/rating-menu/rating-menu.js +4 -2
- package/es/widgets/refinement-list/defaultTemplates.js +0 -1
- package/es/widgets/refinement-list/refinement-list.js +4 -2
- package/es/widgets/relevant-sort/relevant-sort.js +4 -2
- package/es/widgets/search-box/defaultTemplates.js +0 -1
- package/es/widgets/search-box/search-box.js +4 -2
- package/es/widgets/sort-by/sort-by.js +4 -2
- package/es/widgets/stats/stats.js +4 -2
- package/es/widgets/toggle-refinement/toggle-refinement.js +4 -2
- package/es/widgets/voice-search/defaultTemplates.js +0 -1
- package/es/widgets/voice-search/voice-search.js +4 -2
- package/package.json +6 -6
- package/scripts/transforms/__tests__/addWidget-to-addWidgets.test.js +1 -0
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var _excluded = ["hit", "attribute", "cssClasses"];
|
|
1
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
4
|
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; }
|
|
@@ -8,7 +9,7 @@ export function Highlight(_ref) {
|
|
|
8
9
|
var hit = _ref.hit,
|
|
9
10
|
attribute = _ref.attribute,
|
|
10
11
|
cssClasses = _ref.cssClasses,
|
|
11
|
-
props = _objectWithoutProperties(_ref,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
13
|
var property = getPropertyByPath(hit._highlightResult, attribute) || [];
|
|
13
14
|
var properties = toArray(property);
|
|
14
15
|
process.env.NODE_ENV === 'development' ? warning(Boolean(properties.length), "Could not enable highlight for \"".concat(attribute.toString(), "\", 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;
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["hit", "attribute", "cssClasses"],
|
|
3
|
+
_excluded2 = ["isHighlighted"];
|
|
1
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
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; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
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); }
|
|
5
10
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
11
|
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; }
|
|
7
12
|
import { h } from 'preact';
|
|
@@ -11,7 +16,7 @@ export function ReverseHighlight(_ref) {
|
|
|
11
16
|
var hit = _ref.hit,
|
|
12
17
|
attribute = _ref.attribute,
|
|
13
18
|
cssClasses = _ref.cssClasses,
|
|
14
|
-
props = _objectWithoutProperties(_ref,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
20
|
var property = getPropertyByPath(hit._highlightResult, attribute) || [];
|
|
16
21
|
var properties = toArray(property);
|
|
17
22
|
process.env.NODE_ENV === 'development' ? warning(Boolean(properties.length), "Could not enable highlight for \"".concat(attribute.toString(), "\", 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;
|
|
@@ -19,7 +24,7 @@ export function ReverseHighlight(_ref) {
|
|
|
19
24
|
var value = _ref2.value;
|
|
20
25
|
return getHighlightedParts(unescape(value || '')).map(function (_ref3) {
|
|
21
26
|
var isHighlighted = _ref3.isHighlighted,
|
|
22
|
-
rest = _objectWithoutProperties(_ref3,
|
|
27
|
+
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
23
28
|
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
24
29
|
isHighlighted: !isHighlighted
|
|
25
30
|
});
|
|
@@ -1,7 +1,12 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["hit", "attribute", "cssClasses"],
|
|
3
|
+
_excluded2 = ["isHighlighted"];
|
|
1
4
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
5
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
6
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
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; }
|
|
7
|
+
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; }
|
|
8
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
9
|
+
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); }
|
|
5
10
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
6
11
|
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; }
|
|
7
12
|
import { h } from 'preact';
|
|
@@ -11,7 +16,7 @@ export function ReverseSnippet(_ref) {
|
|
|
11
16
|
var hit = _ref.hit,
|
|
12
17
|
attribute = _ref.attribute,
|
|
13
18
|
cssClasses = _ref.cssClasses,
|
|
14
|
-
props = _objectWithoutProperties(_ref,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
15
20
|
var property = getPropertyByPath(hit._snippetResult, attribute) || [];
|
|
16
21
|
var properties = toArray(property);
|
|
17
22
|
process.env.NODE_ENV === 'development' ? warning(Boolean(properties.length), "Could not enable snippet for \"".concat(attribute.toString(), "\", 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;
|
|
@@ -19,7 +24,7 @@ export function ReverseSnippet(_ref) {
|
|
|
19
24
|
var value = _ref2.value;
|
|
20
25
|
return getHighlightedParts(unescape(value || '')).map(function (_ref3) {
|
|
21
26
|
var isHighlighted = _ref3.isHighlighted,
|
|
22
|
-
rest = _objectWithoutProperties(_ref3,
|
|
27
|
+
rest = _objectWithoutProperties(_ref3, _excluded2);
|
|
23
28
|
return _objectSpread(_objectSpread({}, rest), {}, {
|
|
24
29
|
isHighlighted: !isHighlighted
|
|
25
30
|
});
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
var _excluded = ["hit", "attribute", "cssClasses"];
|
|
1
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
3
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
4
|
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; }
|
|
@@ -8,7 +9,7 @@ export function Snippet(_ref) {
|
|
|
8
9
|
var hit = _ref.hit,
|
|
9
10
|
attribute = _ref.attribute,
|
|
10
11
|
cssClasses = _ref.cssClasses,
|
|
11
|
-
props = _objectWithoutProperties(_ref,
|
|
12
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
12
13
|
var property = getPropertyByPath(hit._snippetResult, attribute) || [];
|
|
13
14
|
var properties = toArray(property);
|
|
14
15
|
process.env.NODE_ENV === 'development' ? warning(Boolean(properties.length), "Could not enable snippet for \"".concat(attribute.toString(), "\", 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;
|
package/es/helpers/highlight.js
CHANGED
|
@@ -14,7 +14,9 @@ export default function highlight(_ref) {
|
|
|
14
14
|
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;
|
|
15
15
|
var _ref2 = highlightAttributeResult || {},
|
|
16
16
|
_ref2$value = _ref2.value,
|
|
17
|
-
attributeValue = _ref2$value === void 0 ? '' : _ref2$value;
|
|
17
|
+
attributeValue = _ref2$value === void 0 ? '' : _ref2$value;
|
|
18
|
+
|
|
19
|
+
// cx is not used, since it would be bundled as a dependency for Vue & Angular
|
|
18
20
|
var className = suit({
|
|
19
21
|
descendantName: 'highlighted'
|
|
20
22
|
}) + (cssClasses.highlighted ? " ".concat(cssClasses.highlighted) : '');
|
|
@@ -14,7 +14,9 @@ export default function reverseHighlight(_ref) {
|
|
|
14
14
|
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;
|
|
15
15
|
var _ref2 = highlightAttributeResult || {},
|
|
16
16
|
_ref2$value = _ref2.value,
|
|
17
|
-
attributeValue = _ref2$value === void 0 ? '' : _ref2$value;
|
|
17
|
+
attributeValue = _ref2$value === void 0 ? '' : _ref2$value;
|
|
18
|
+
|
|
19
|
+
// cx is not used, since it would be bundled as a dependency for Vue & Angular
|
|
18
20
|
var className = suit({
|
|
19
21
|
descendantName: 'highlighted'
|
|
20
22
|
}) + (cssClasses.highlighted ? " ".concat(cssClasses.highlighted) : '');
|
|
@@ -14,7 +14,9 @@ export default function reverseSnippet(_ref) {
|
|
|
14
14
|
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;
|
|
15
15
|
var _ref2 = snippetAttributeResult || {},
|
|
16
16
|
_ref2$value = _ref2.value,
|
|
17
|
-
attributeValue = _ref2$value === void 0 ? '' : _ref2$value;
|
|
17
|
+
attributeValue = _ref2$value === void 0 ? '' : _ref2$value;
|
|
18
|
+
|
|
19
|
+
// cx is not used, since it would be bundled as a dependency for Vue & Angular
|
|
18
20
|
var className = suit({
|
|
19
21
|
descendantName: 'highlighted'
|
|
20
22
|
}) + (cssClasses.highlighted ? " ".concat(cssClasses.highlighted) : '');
|
package/es/helpers/snippet.js
CHANGED
|
@@ -14,7 +14,9 @@ export default function snippet(_ref) {
|
|
|
14
14
|
process.env.NODE_ENV === 'development' ? warning(snippetAttributeResult, "Could not enable 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;
|
|
15
15
|
var _ref2 = snippetAttributeResult || {},
|
|
16
16
|
_ref2$value = _ref2.value,
|
|
17
|
-
attributeValue = _ref2$value === void 0 ? '' : _ref2$value;
|
|
17
|
+
attributeValue = _ref2$value === void 0 ? '' : _ref2$value;
|
|
18
|
+
|
|
19
|
+
// cx is not used, since it would be bundled as a dependency for Vue & Angular
|
|
18
20
|
var className = suit({
|
|
19
21
|
descendantName: 'highlighted'
|
|
20
22
|
}) + (cssClasses.highlighted ? " ".concat(cssClasses.highlighted) : '');
|
package/es/lib/InstantSearch.js
CHANGED
|
@@ -2,7 +2,7 @@ function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" =
|
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
4
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
5
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
5
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
6
6
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
7
7
|
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, "prototype", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
8
8
|
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
@@ -11,7 +11,9 @@ function _possibleConstructorReturn(self, call) { if (call && (_typeof(call) ===
|
|
|
11
11
|
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
12
12
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
13
13
|
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
14
|
-
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; }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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); }
|
|
15
17
|
import algoliasearchHelper from 'algoliasearch-helper';
|
|
16
18
|
import EventEmitter from '@algolia/events';
|
|
17
19
|
import index from "../widgets/index/index.js";
|
package/es/lib/createHelpers.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
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; }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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); }
|
|
4
7
|
import { highlight as _highlight, reverseHighlight as _reverseHighlight, snippet as _snippet, reverseSnippet as _reverseSnippet, insights as _insights } from "../helpers/index.js";
|
|
5
8
|
import { formatNumber as _formatNumber } from "./formatNumber.js";
|
|
6
9
|
export default function hoganHelpers(_ref) {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
var _excluded = ["page"];
|
|
1
2
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
2
3
|
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; }
|
|
3
4
|
import { isEqual, safelyRunOnBrowser } from "../utils/index.js";
|
|
4
5
|
function getStateWithoutPage(state) {
|
|
5
6
|
var _ref = state || {},
|
|
6
7
|
page = _ref.page,
|
|
7
|
-
rest = _objectWithoutProperties(_ref,
|
|
8
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
8
9
|
return rest;
|
|
9
10
|
}
|
|
10
11
|
var KEY = 'ais.infiniteHits';
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
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; }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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); }
|
|
4
7
|
import { uniq, find, createDocumentationMessageGenerator, warning } from "../utils/index.js";
|
|
5
8
|
var getSelectedHits = function getSelectedHits(hits, selectedObjectIDs) {
|
|
6
9
|
return selectedObjectIDs.map(function (objectID) {
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
2
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
3
|
+
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, _toPropertyKey(descriptor.key), descriptor); } }
|
|
3
4
|
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, "prototype", { writable: false }); return Constructor; }
|
|
4
|
-
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
5
8
|
import qs from 'qs';
|
|
6
9
|
import { safelyRunOnBrowser } from "../utils/index.js";
|
|
7
10
|
var setWindowTitle = function setWindowTitle(title) {
|
|
@@ -94,22 +97,16 @@ var BrowserHistory = /*#__PURE__*/function () {
|
|
|
94
97
|
key: "onUpdate",
|
|
95
98
|
value: function onUpdate(callback) {
|
|
96
99
|
var _this3 = this;
|
|
97
|
-
this._onPopState = function (
|
|
100
|
+
this._onPopState = function () {
|
|
98
101
|
if (_this3.writeTimer) {
|
|
99
102
|
clearTimeout(_this3.writeTimer);
|
|
100
103
|
_this3.writeTimer = undefined;
|
|
101
104
|
}
|
|
102
105
|
_this3.inPopState = true;
|
|
103
|
-
var routeState = event.state;
|
|
104
106
|
|
|
105
|
-
//
|
|
106
|
-
//
|
|
107
|
-
|
|
108
|
-
if (!routeState) {
|
|
109
|
-
callback(_this3.read());
|
|
110
|
-
} else {
|
|
111
|
-
callback(routeState);
|
|
112
|
-
}
|
|
107
|
+
// We always read the state from the URL because the state of the history
|
|
108
|
+
// can be incorect in some cases (e.g. using React Router).
|
|
109
|
+
callback(_this3.read());
|
|
113
110
|
};
|
|
114
111
|
safelyRunOnBrowser(function (_ref4) {
|
|
115
112
|
var window = _ref4.window;
|
|
@@ -1,11 +1,15 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["configure"];
|
|
1
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
4
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
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; }
|
|
6
10
|
function getIndexStateWithoutConfigure(uiState) {
|
|
7
11
|
var configure = uiState.configure,
|
|
8
|
-
trackedUiState = _objectWithoutProperties(uiState,
|
|
12
|
+
trackedUiState = _objectWithoutProperties(uiState, _excluded);
|
|
9
13
|
return trackedUiState;
|
|
10
14
|
}
|
|
11
15
|
|
|
@@ -1,9 +1,13 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["configure"];
|
|
3
|
+
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; }
|
|
4
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
5
|
+
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); }
|
|
2
6
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
3
7
|
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; }
|
|
4
8
|
function getIndexStateWithoutConfigure(uiState) {
|
|
5
9
|
var configure = uiState.configure,
|
|
6
|
-
trackedUiState = _objectWithoutProperties(uiState,
|
|
10
|
+
trackedUiState = _objectWithoutProperties(uiState, _excluded);
|
|
7
11
|
return trackedUiState;
|
|
8
12
|
}
|
|
9
13
|
export default function singleIndexStateMapping(indexName) {
|
|
@@ -1,12 +1,15 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
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; }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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); }
|
|
4
7
|
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
|
|
5
8
|
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
6
9
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
7
10
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
8
11
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
9
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
12
|
+
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; }
|
|
10
13
|
import { uniq } from "../utils/uniq.js";
|
|
11
14
|
function prepareTemplates(
|
|
12
15
|
// can not use = {} here, since the template could have different constraints
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
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; }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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); }
|
|
5
7
|
import hogan from 'hogan.js';
|
|
6
8
|
import { html } from 'htm/preact';
|
|
7
9
|
import { Highlight, ReverseHighlight, ReverseSnippet, Snippet } from "../../helpers/components/index.js";
|
|
@@ -5,8 +5,8 @@ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToAr
|
|
|
5
5
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
6
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
7
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
9
|
-
function _iterableToArrayLimit(arr, i) { var _i =
|
|
8
|
+
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; }
|
|
9
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
10
10
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
11
|
import { capitalize } from "./capitalize.js";
|
|
12
12
|
import { warning } from "./logger.js";
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _objectDestructuringEmpty(obj) { if (obj == null) throw new TypeError("Cannot destructure " + obj); }
|
|
1
3
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
4
|
-
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
|
+
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; }
|
|
7
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
8
|
+
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); }
|
|
5
9
|
import { escape } from "./escape-html.js";
|
|
6
10
|
import { isPlainObject } from "./isPlainObject.js";
|
|
7
11
|
export var TAG_PLACEHOLDER = {
|
|
@@ -33,7 +37,7 @@ export function escapeHits(hits) {
|
|
|
33
37
|
// We don't override the value on hit because it will mutate the raw results
|
|
34
38
|
// instead we make a shallow copy and we assign the escaped values on it.
|
|
35
39
|
hits = hits.map(function (_ref) {
|
|
36
|
-
var hit = _extends({}, _ref);
|
|
40
|
+
var hit = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
|
|
37
41
|
if (hit._highlightResult) {
|
|
38
42
|
hit._highlightResult = recursiveEscape(hit._highlightResult);
|
|
39
43
|
}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
2
2
|
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
5
|
-
function _iterableToArrayLimit(arr, i) { var _i =
|
|
4
|
+
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; }
|
|
5
|
+
function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
|
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
7
7
|
var latLngRegExp = /^(-?\d+(?:\.\d+)?),\s*(-?\d+(?:\.\d+)?)$/;
|
|
8
8
|
export function aroundLatLngToPosition(value) {
|
|
@@ -20,13 +20,15 @@ export function aroundLatLngToPosition(value) {
|
|
|
20
20
|
}
|
|
21
21
|
function insideBoundingBoxArrayToBoundingBox(value) {
|
|
22
22
|
var _value = _slicedToArray(value, 1),
|
|
23
|
-
_value$ = _value[0]
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
neLat = _value$
|
|
27
|
-
neLng = _value$
|
|
28
|
-
swLat = _value$
|
|
29
|
-
swLng = _value$
|
|
23
|
+
_value$ = _value[0],
|
|
24
|
+
_value$2 = _value$ === void 0 ? [undefined, undefined, undefined, undefined] : _value$,
|
|
25
|
+
_value$3 = _slicedToArray(_value$2, 4),
|
|
26
|
+
neLat = _value$3[0],
|
|
27
|
+
neLng = _value$3[1],
|
|
28
|
+
swLat = _value$3[2],
|
|
29
|
+
swLng = _value$3[3];
|
|
30
|
+
|
|
31
|
+
// Since the value provided is the one send with the request, the API should
|
|
30
32
|
// throw an error due to the wrong format. So throw an error should be safe.
|
|
31
33
|
if (!neLat || !neLng || !swLat || !swLng) {
|
|
32
34
|
throw new Error("Invalid value for \"insideBoundingBox\" parameter: [".concat(value, "]"));
|
|
@@ -48,7 +50,9 @@ function insideBoundingBoxStringToBoundingBox(value) {
|
|
|
48
50
|
neLat = _value$split$map2[0],
|
|
49
51
|
neLng = _value$split$map2[1],
|
|
50
52
|
swLat = _value$split$map2[2],
|
|
51
|
-
swLng = _value$split$map2[3];
|
|
53
|
+
swLng = _value$split$map2[3];
|
|
54
|
+
|
|
55
|
+
// Since the value provided is the one send with the request, the API should
|
|
52
56
|
// throw an error due to the wrong format. So throw an error should be safe.
|
|
53
57
|
if (!neLat || !neLng || !swLat || !swLng) {
|
|
54
58
|
throw new Error("Invalid value for \"insideBoundingBox\" parameter: \"".concat(value, "\""));
|
|
@@ -13,24 +13,22 @@ function getRefinement(state, type, attribute, name) {
|
|
|
13
13
|
});
|
|
14
14
|
var count;
|
|
15
15
|
if (type === 'hierarchical') {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
return
|
|
21
|
-
return facetData[refinementKey];
|
|
22
|
-
};
|
|
16
|
+
var facetDeclaration = state.getHierarchicalFacetByName(attribute);
|
|
17
|
+
var nameParts = name.split(facetDeclaration.separator);
|
|
18
|
+
var getFacetRefinement = function getFacetRefinement(facetData) {
|
|
19
|
+
return function (refinementKey) {
|
|
20
|
+
return facetData[refinementKey];
|
|
23
21
|
};
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
22
|
+
};
|
|
23
|
+
var _loop = function _loop(i) {
|
|
24
|
+
facet = facet && facet.data && find(Object.keys(facet.data).map(getFacetRefinement(facet.data)), function (refinement) {
|
|
25
|
+
return refinement.name === nameParts[i];
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
for (var i = 0; facet !== undefined && i < nameParts.length; ++i) {
|
|
29
|
+
_loop(i);
|
|
30
|
+
}
|
|
31
|
+
count = facet && facet.count;
|
|
34
32
|
} else {
|
|
35
33
|
count = facet && facet.data && facet.data[res.name];
|
|
36
34
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
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; }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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); }
|
|
4
7
|
export function addAbsolutePosition(hits, page, hitsPerPage) {
|
|
5
8
|
return hits.map(function (hit, idx) {
|
|
6
9
|
return _objectSpread(_objectSpread({}, hit), {}, {
|
|
@@ -1,6 +1,9 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
1
2
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
3
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
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; }
|
|
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
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
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); }
|
|
4
7
|
export function addQueryID(hits, queryID) {
|
|
5
8
|
if (!queryID) {
|
|
6
9
|
return hits;
|
package/es/lib/utils/isEqual.js
CHANGED
|
@@ -11,6 +11,9 @@ export function isEqual(first, second) {
|
|
|
11
11
|
if (Object.keys(first).length !== Object.keys(second).length) {
|
|
12
12
|
return false;
|
|
13
13
|
}
|
|
14
|
+
|
|
15
|
+
// @TODO avoid for..of because of the large polyfill
|
|
16
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
14
17
|
for (var _i = 0, _Object$keys = Object.keys(first); _i < _Object$keys.length; _i++) {
|
|
15
18
|
var key = _Object$keys[_i];
|
|
16
19
|
if (!(key in second)) {
|
package/es/lib/utils/logger.js
CHANGED
|
@@ -27,7 +27,7 @@ if (process.env.NODE_ENV === 'development') {
|
|
|
27
27
|
return function () {
|
|
28
28
|
if (!hasAlreadyPrinted) {
|
|
29
29
|
hasAlreadyPrinted = true;
|
|
30
|
-
warn(message);
|
|
30
|
+
process.env.NODE_ENV === 'development' ? warn(message) : void 0;
|
|
31
31
|
}
|
|
32
32
|
return fn.apply(void 0, arguments);
|
|
33
33
|
};
|
|
@@ -39,7 +39,7 @@ if (process.env.NODE_ENV === 'development') {
|
|
|
39
39
|
var hasAlreadyPrinted = _warning.cache[message];
|
|
40
40
|
if (!hasAlreadyPrinted) {
|
|
41
41
|
_warning.cache[message] = true;
|
|
42
|
-
warn(message);
|
|
42
|
+
process.env.NODE_ENV === 'development' ? warn(message) : void 0;
|
|
43
43
|
}
|
|
44
44
|
};
|
|
45
45
|
_warning.cache = {};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
var _excluded = ["facets", "disjunctiveFacets", "facetsRefinements", "facetsExcludes", "disjunctiveFacetsRefinements", "numericRefinements", "tagRefinements", "hierarchicalFacets", "hierarchicalFacetsRefinements", "ruleContexts"];
|
|
1
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
2
4
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
3
|
-
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; }
|
|
5
|
+
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; }
|
|
6
|
+
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
7
|
+
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); }
|
|
4
8
|
function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
|
|
5
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; }
|
|
6
10
|
import { findIndex } from "./findIndex.js";
|
|
@@ -16,7 +20,7 @@ var mergeWithRest = function mergeWithRest(left, right) {
|
|
|
16
20
|
hierarchicalFacets = right.hierarchicalFacets,
|
|
17
21
|
hierarchicalFacetsRefinements = right.hierarchicalFacetsRefinements,
|
|
18
22
|
ruleContexts = right.ruleContexts,
|
|
19
|
-
rest = _objectWithoutProperties(right,
|
|
23
|
+
rest = _objectWithoutProperties(right, _excluded);
|
|
20
24
|
return left.setQueryParameters(rest);
|
|
21
25
|
};
|
|
22
26
|
|
package/es/lib/utils/range.js
CHANGED
|
@@ -3,7 +3,7 @@ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread n
|
|
|
3
3
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
4
4
|
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
|
|
5
5
|
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
|
|
6
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++)
|
|
6
|
+
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; }
|
|
7
7
|
export function range(_ref) {
|
|
8
8
|
var _ref$start = _ref.start,
|
|
9
9
|
start = _ref$start === void 0 ? 0 : _ref$start,
|