instantsearch.js 4.46.0 → 4.46.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -1
- package/cjs/components/CurrentRefinements/CurrentRefinements.js +0 -1
- package/cjs/components/GeoSearchControls/GeoSearchButton.js +0 -1
- package/cjs/components/GeoSearchControls/GeoSearchToggle.js +0 -1
- package/cjs/components/PoweredBy/PoweredBy.js +0 -1
- package/cjs/components/QueryRuleCustomData/QueryRuleCustomData.js +0 -1
- package/cjs/components/RelevantSort/RelevantSort.js +0 -1
- package/cjs/components/Selector/Selector.js +0 -1
- package/cjs/components/Template/Template.js +3 -1
- package/cjs/components/VoiceSearch/VoiceSearch.js +0 -1
- package/cjs/connectors/toggle-refinement/connectToggleRefinement.js +3 -1
- package/cjs/helpers/components/Highlight.js +5 -13
- package/cjs/helpers/components/ReverseHighlight.js +5 -13
- package/cjs/helpers/components/ReverseSnippet.js +5 -13
- package/cjs/helpers/components/Snippet.js +5 -13
- package/cjs/lib/InstantSearch.js +33 -24
- package/cjs/lib/insights/listener.js +0 -1
- package/cjs/lib/templating/index.js +31 -0
- package/cjs/lib/{utils → templating}/prepareTemplateProps.js +4 -9
- package/cjs/lib/{utils → templating}/renderTemplate.js +4 -7
- package/cjs/lib/utils/capitalize.js +2 -5
- package/cjs/lib/utils/checkIndexUiState.js +3 -5
- package/cjs/lib/utils/checkRendering.js +4 -9
- package/cjs/lib/utils/clearRefinements.js +3 -9
- package/cjs/lib/utils/concatHighlightedParts.js +1 -1
- package/cjs/lib/utils/createSendEventForFacet.js +2 -4
- package/cjs/lib/utils/defer.js +3 -6
- package/cjs/lib/utils/detect-insights-client.js +1 -1
- package/cjs/lib/utils/documentation.js +6 -9
- package/cjs/lib/utils/escape-highlight.js +4 -6
- package/cjs/lib/utils/escape-html.js +60 -0
- package/cjs/lib/utils/find.js +2 -5
- package/cjs/lib/utils/findIndex.js +2 -5
- package/cjs/lib/utils/getContainerNode.js +4 -9
- package/cjs/lib/utils/getHighlightFromSiblings.js +3 -5
- package/cjs/lib/utils/getHighlightedParts.js +1 -1
- package/cjs/lib/utils/getObjectType.js +2 -5
- package/cjs/lib/utils/getPropertyByPath.js +2 -5
- package/cjs/lib/utils/getRefinements.js +4 -6
- package/cjs/lib/utils/index.js +536 -440
- package/cjs/lib/utils/isDomElement.js +2 -5
- package/cjs/lib/utils/isEqual.js +2 -5
- package/cjs/lib/utils/isFacetRefined.js +1 -1
- package/cjs/lib/utils/isFiniteNumber.js +3 -5
- package/cjs/lib/utils/isIndexWidget.js +10 -0
- package/cjs/lib/utils/isPlainObject.js +2 -5
- package/cjs/lib/utils/isSpecialClick.js +2 -5
- package/cjs/lib/utils/logger.js +3 -5
- package/cjs/lib/utils/mergeSearchParameters.js +7 -10
- package/cjs/lib/utils/noop.js +2 -5
- package/cjs/lib/utils/range.js +2 -5
- package/cjs/lib/utils/resolveSearchParameters.js +3 -6
- package/cjs/lib/utils/reverseHighlightedParts.js +3 -5
- package/cjs/lib/utils/setIndexHelperState.js +28 -0
- package/cjs/lib/utils/toArray.js +2 -5
- package/cjs/lib/utils/uniq.js +2 -5
- package/cjs/lib/version.js +1 -1
- package/cjs/middlewares/createInsightsMiddleware.js +23 -30
- package/cjs/middlewares/createMetadataMiddleware.js +1 -0
- package/cjs/middlewares/createRouterMiddleware.js +1 -0
- package/cjs/widgets/answers/answers.js +3 -1
- package/cjs/widgets/breadcrumb/breadcrumb.js +3 -1
- package/cjs/widgets/clear-refinements/clear-refinements.js +3 -1
- package/cjs/widgets/geo-search/GeoSearchRenderer.js +1 -1
- package/cjs/widgets/geo-search/defaultTemplates.js +0 -1
- package/cjs/widgets/geo-search/geo-search.js +3 -1
- package/cjs/widgets/hierarchical-menu/defaultTemplates.js +0 -1
- package/cjs/widgets/hierarchical-menu/hierarchical-menu.js +3 -1
- package/cjs/widgets/hits/hits.js +6 -4
- package/cjs/widgets/index/index.js +8 -12
- package/cjs/widgets/infinite-hits/infinite-hits.js +6 -4
- package/cjs/widgets/menu/defaultTemplates.js +0 -1
- package/cjs/widgets/menu/menu.js +3 -1
- package/cjs/widgets/menu-select/menu-select.js +3 -1
- package/cjs/widgets/numeric-menu/defaultTemplates.js +0 -1
- package/cjs/widgets/numeric-menu/numeric-menu.js +3 -1
- package/cjs/widgets/range-input/range-input.js +3 -1
- package/cjs/widgets/rating-menu/defaultTemplates.js +0 -1
- package/cjs/widgets/rating-menu/rating-menu.js +3 -1
- package/cjs/widgets/refinement-list/defaultTemplates.js +0 -1
- package/cjs/widgets/refinement-list/refinement-list.js +4 -2
- package/cjs/widgets/search-box/defaultTemplates.js +0 -1
- package/cjs/widgets/stats/stats.js +3 -1
- package/cjs/widgets/toggle-refinement/toggle-refinement.js +3 -1
- package/cjs/widgets/voice-search/defaultTemplates.js +0 -1
- package/dist/instantsearch.development.d.ts +11 -3
- package/dist/instantsearch.development.js +8513 -8482
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +11 -3
- package/dist/instantsearch.production.min.d.ts +11 -3
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Answers/Answers.d.ts +1 -1
- package/es/components/Answers/Answers.js +0 -1
- package/es/components/Breadcrumb/Breadcrumb.d.ts +2 -2
- package/es/components/Breadcrumb/Breadcrumb.js +0 -1
- package/es/components/ClearRefinements/ClearRefinements.d.ts +2 -2
- package/es/components/ClearRefinements/ClearRefinements.js +0 -1
- package/es/components/CurrentRefinements/CurrentRefinements.d.ts +1 -1
- package/es/components/CurrentRefinements/CurrentRefinements.js +0 -1
- package/es/components/GeoSearchControls/GeoSearchButton.d.ts +1 -1
- package/es/components/GeoSearchControls/GeoSearchButton.js +0 -1
- package/es/components/GeoSearchControls/GeoSearchControls.d.ts +2 -2
- package/es/components/GeoSearchControls/GeoSearchControls.js +0 -1
- package/es/components/GeoSearchControls/GeoSearchToggle.d.ts +1 -1
- package/es/components/GeoSearchControls/GeoSearchToggle.js +0 -1
- package/es/components/Highlight/Highlight.js +0 -1
- package/es/components/Hits/Hits.d.ts +2 -2
- package/es/components/Hits/Hits.js +0 -1
- package/es/components/InfiniteHits/InfiniteHits.d.ts +1 -1
- package/es/components/InfiniteHits/InfiniteHits.js +0 -1
- package/es/components/MenuSelect/MenuSelect.d.ts +1 -1
- package/es/components/MenuSelect/MenuSelect.js +0 -1
- package/es/components/Pagination/Pagination.d.ts +1 -1
- package/es/components/Pagination/Pagination.js +0 -1
- package/es/components/Panel/Panel.d.ts +1 -1
- package/es/components/Panel/Panel.js +0 -1
- package/es/components/PoweredBy/PoweredBy.d.ts +1 -1
- package/es/components/PoweredBy/PoweredBy.js +0 -1
- package/es/components/QueryRuleCustomData/QueryRuleCustomData.d.ts +1 -1
- package/es/components/QueryRuleCustomData/QueryRuleCustomData.js +0 -1
- package/es/components/RangeInput/RangeInput.d.ts +1 -1
- package/es/components/RangeInput/RangeInput.js +0 -1
- package/es/components/RefinementList/RefinementList.d.ts +2 -2
- package/es/components/RefinementList/RefinementList.js +0 -1
- package/es/components/RefinementList/RefinementListItem.d.ts +1 -1
- package/es/components/RefinementList/RefinementListItem.js +0 -1
- package/es/components/RelevantSort/RelevantSort.d.ts +1 -1
- package/es/components/RelevantSort/RelevantSort.js +0 -1
- package/es/components/ReverseHighlight/ReverseHighlight.js +0 -1
- package/es/components/ReverseSnippet/ReverseSnippet.js +0 -1
- package/es/components/SearchBox/SearchBox.d.ts +1 -1
- package/es/components/SearchBox/SearchBox.js +0 -1
- package/es/components/Selector/Selector.d.ts +1 -1
- package/es/components/Selector/Selector.js +0 -1
- package/es/components/Slider/Pit.d.ts +1 -1
- package/es/components/Slider/Pit.js +0 -1
- package/es/components/Slider/Rheostat.d.ts +1 -1
- package/es/components/Slider/Rheostat.js +0 -2
- package/es/components/Slider/Slider.d.ts +1 -1
- package/es/components/Slider/Slider.js +0 -1
- package/es/components/Snippet/Snippet.js +0 -1
- package/es/components/Stats/Stats.d.ts +1 -1
- package/es/components/Stats/Stats.js +0 -1
- package/es/components/Template/Template.d.ts +2 -2
- package/es/components/Template/Template.js +2 -2
- package/es/components/ToggleRefinement/ToggleRefinement.d.ts +2 -5
- package/es/components/ToggleRefinement/ToggleRefinement.js +0 -5
- package/es/components/VoiceSearch/VoiceSearch.d.ts +1 -1
- package/es/components/VoiceSearch/VoiceSearch.js +0 -1
- package/es/connectors/toggle-refinement/connectToggleRefinement.d.ts +3 -2
- package/es/connectors/toggle-refinement/connectToggleRefinement.js +3 -1
- package/es/helpers/components/Highlight.d.ts +1 -1
- package/es/helpers/components/Highlight.js +2 -6
- package/es/helpers/components/ReverseHighlight.d.ts +1 -1
- package/es/helpers/components/ReverseHighlight.js +2 -6
- package/es/helpers/components/ReverseSnippet.d.ts +1 -1
- package/es/helpers/components/ReverseSnippet.js +2 -6
- package/es/helpers/components/Snippet.d.ts +1 -1
- package/es/helpers/components/Snippet.js +2 -6
- package/es/lib/InstantSearch.d.ts +6 -1
- package/es/lib/InstantSearch.js +34 -21
- package/es/lib/insights/listener.d.ts +1 -1
- package/es/lib/insights/listener.js +0 -1
- package/es/lib/templating/index.d.ts +2 -0
- package/es/lib/templating/index.js +2 -0
- package/es/lib/{utils → templating}/prepareTemplateProps.d.ts +2 -2
- package/es/lib/{utils → templating}/prepareTemplateProps.js +3 -5
- package/es/lib/{utils → templating}/renderTemplate.d.ts +2 -3
- package/es/lib/{utils → templating}/renderTemplate.js +3 -5
- package/es/lib/utils/capitalize.d.ts +1 -2
- package/es/lib/utils/capitalize.js +2 -4
- package/es/lib/utils/checkIndexUiState.js +1 -1
- package/es/lib/utils/checkRendering.d.ts +1 -2
- package/es/lib/utils/checkRendering.js +3 -6
- package/es/lib/utils/clearRefinements.d.ts +4 -8
- package/es/lib/utils/clearRefinements.js +3 -8
- package/es/lib/utils/concatHighlightedParts.d.ts +1 -1
- package/es/lib/utils/concatHighlightedParts.js +1 -1
- package/es/lib/utils/createSendEventForFacet.js +1 -1
- package/es/lib/utils/createSendEventForHits.d.ts +0 -3
- package/es/lib/utils/createSendEventForHits.js +0 -3
- package/es/lib/utils/defer.d.ts +2 -2
- package/es/lib/utils/defer.js +2 -5
- package/es/lib/utils/detect-insights-client.d.ts +1 -1
- package/es/lib/utils/detect-insights-client.js +1 -1
- package/es/lib/utils/documentation.d.ts +2 -2
- package/es/lib/utils/documentation.js +4 -4
- package/es/lib/utils/escape-highlight.js +2 -2
- package/es/lib/utils/{escape.d.ts → escape-html.d.ts} +6 -2
- package/es/lib/utils/escape-html.js +51 -0
- package/es/lib/utils/escapeFacetValue.d.ts +1 -1
- package/es/lib/utils/find.d.ts +1 -2
- package/es/lib/utils/find.js +2 -4
- package/es/lib/utils/findIndex.d.ts +1 -2
- package/es/lib/utils/findIndex.js +2 -4
- package/es/lib/utils/getContainerNode.d.ts +1 -2
- package/es/lib/utils/getContainerNode.js +3 -5
- package/es/lib/utils/getHighlightFromSiblings.d.ts +1 -1
- package/es/lib/utils/getHighlightFromSiblings.js +2 -2
- package/es/lib/utils/getHighlightedParts.d.ts +1 -1
- package/es/lib/utils/getHighlightedParts.js +1 -1
- package/es/lib/utils/getObjectType.d.ts +1 -2
- package/es/lib/utils/getObjectType.js +2 -4
- package/es/lib/utils/getPropertyByPath.d.ts +1 -2
- package/es/lib/utils/getPropertyByPath.js +2 -4
- package/es/lib/utils/getRefinements.d.ts +1 -1
- package/es/lib/utils/getRefinements.js +2 -2
- package/es/lib/utils/index.d.ts +44 -46
- package/es/lib/utils/index.js +44 -46
- package/es/lib/utils/isDomElement.d.ts +1 -2
- package/es/lib/utils/isDomElement.js +2 -4
- package/es/lib/utils/isEqual.d.ts +1 -2
- package/es/lib/utils/isEqual.js +2 -4
- package/es/lib/utils/isFacetRefined.d.ts +1 -1
- package/es/lib/utils/isFacetRefined.js +1 -1
- package/es/lib/utils/isFiniteNumber.d.ts +1 -2
- package/es/lib/utils/isFiniteNumber.js +3 -4
- package/es/lib/utils/isIndexWidget.d.ts +3 -0
- package/es/lib/utils/isIndexWidget.js +3 -0
- package/es/lib/utils/isPlainObject.d.ts +1 -2
- package/es/lib/utils/isPlainObject.js +2 -4
- package/es/lib/utils/isSpecialClick.d.ts +1 -2
- package/es/lib/utils/isSpecialClick.js +2 -4
- package/es/lib/utils/logger.js +1 -1
- package/es/lib/utils/mergeSearchParameters.d.ts +1 -2
- package/es/lib/utils/mergeSearchParameters.js +4 -6
- package/es/lib/utils/noop.d.ts +1 -2
- package/es/lib/utils/noop.js +1 -3
- package/es/lib/utils/range.d.ts +2 -2
- package/es/lib/utils/range.js +2 -4
- package/es/lib/utils/resolveSearchParameters.d.ts +1 -2
- package/es/lib/utils/resolveSearchParameters.js +2 -4
- package/es/lib/utils/reverseHighlightedParts.d.ts +1 -1
- package/es/lib/utils/reverseHighlightedParts.js +2 -2
- package/es/lib/utils/setIndexHelperState.d.ts +3 -0
- package/es/lib/utils/setIndexHelperState.js +19 -0
- package/es/lib/utils/toArray.d.ts +3 -2
- package/es/lib/utils/toArray.js +2 -4
- package/es/lib/utils/uniq.d.ts +1 -2
- package/es/lib/utils/uniq.js +2 -4
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/middlewares/createInsightsMiddleware.js +23 -27
- package/es/middlewares/createMetadataMiddleware.js +1 -0
- package/es/middlewares/createRouterMiddleware.js +1 -0
- package/es/types/middleware.d.ts +1 -0
- package/es/widgets/answers/answers.d.ts +1 -1
- package/es/widgets/answers/answers.js +2 -2
- package/es/widgets/breadcrumb/breadcrumb.d.ts +1 -1
- package/es/widgets/breadcrumb/breadcrumb.js +2 -2
- package/es/widgets/clear-refinements/clear-refinements.d.ts +1 -1
- package/es/widgets/clear-refinements/clear-refinements.js +2 -2
- package/es/widgets/current-refinements/current-refinements.d.ts +1 -1
- package/es/widgets/current-refinements/current-refinements.js +0 -1
- package/es/widgets/geo-search/GeoSearchRenderer.js +1 -2
- package/es/widgets/geo-search/createHTMLMarker.d.ts +1 -1
- package/es/widgets/geo-search/defaultTemplates.d.ts +1 -1
- package/es/widgets/geo-search/defaultTemplates.js +0 -1
- package/es/widgets/geo-search/geo-search.js +2 -1
- package/es/widgets/hierarchical-menu/defaultTemplates.js +0 -1
- package/es/widgets/hierarchical-menu/hierarchical-menu.d.ts +1 -1
- package/es/widgets/hierarchical-menu/hierarchical-menu.js +2 -2
- package/es/widgets/hits/hits.d.ts +1 -1
- package/es/widgets/hits/hits.js +2 -2
- package/es/widgets/hits-per-page/hits-per-page.d.ts +1 -1
- package/es/widgets/hits-per-page/hits-per-page.js +0 -1
- package/es/widgets/index/index.d.ts +0 -1
- package/es/widgets/index/index.js +5 -6
- package/es/widgets/infinite-hits/infinite-hits.d.ts +1 -1
- package/es/widgets/infinite-hits/infinite-hits.js +2 -2
- package/es/widgets/menu/defaultTemplates.js +0 -1
- package/es/widgets/menu/menu.d.ts +1 -1
- package/es/widgets/menu/menu.js +2 -2
- package/es/widgets/menu-select/menu-select.d.ts +1 -1
- package/es/widgets/menu-select/menu-select.js +2 -2
- package/es/widgets/numeric-menu/defaultTemplates.js +0 -1
- package/es/widgets/numeric-menu/numeric-menu.d.ts +1 -1
- package/es/widgets/numeric-menu/numeric-menu.js +2 -2
- package/es/widgets/pagination/pagination.d.ts +1 -1
- package/es/widgets/pagination/pagination.js +0 -1
- package/es/widgets/panel/panel.d.ts +1 -1
- package/es/widgets/panel/panel.js +0 -1
- package/es/widgets/powered-by/powered-by.d.ts +1 -1
- package/es/widgets/powered-by/powered-by.js +0 -1
- package/es/widgets/query-rule-custom-data/query-rule-custom-data.d.ts +1 -1
- package/es/widgets/query-rule-custom-data/query-rule-custom-data.js +0 -1
- package/es/widgets/range-input/range-input.d.ts +1 -1
- package/es/widgets/range-input/range-input.js +2 -2
- package/es/widgets/range-slider/range-slider.d.ts +1 -1
- package/es/widgets/range-slider/range-slider.js +0 -1
- package/es/widgets/rating-menu/defaultTemplates.js +0 -1
- package/es/widgets/rating-menu/rating-menu.d.ts +1 -1
- package/es/widgets/rating-menu/rating-menu.js +2 -2
- package/es/widgets/refinement-list/defaultTemplates.js +0 -1
- package/es/widgets/refinement-list/refinement-list.d.ts +1 -1
- package/es/widgets/refinement-list/refinement-list.js +2 -2
- package/es/widgets/relevant-sort/relevant-sort.d.ts +1 -1
- package/es/widgets/relevant-sort/relevant-sort.js +0 -1
- package/es/widgets/search-box/defaultTemplates.js +0 -1
- package/es/widgets/search-box/search-box.d.ts +1 -1
- package/es/widgets/search-box/search-box.js +0 -1
- package/es/widgets/sort-by/sort-by.d.ts +1 -1
- package/es/widgets/sort-by/sort-by.js +0 -1
- package/es/widgets/stats/stats.d.ts +1 -1
- package/es/widgets/stats/stats.js +2 -2
- package/es/widgets/toggle-refinement/toggle-refinement.d.ts +1 -1
- package/es/widgets/toggle-refinement/toggle-refinement.js +2 -2
- package/es/widgets/voice-search/defaultTemplates.js +0 -1
- package/es/widgets/voice-search/voice-search.d.ts +1 -1
- package/es/widgets/voice-search/voice-search.js +0 -1
- package/package.json +6 -6
- package/cjs/lib/utils/convertNumericRefinementsToFilters.js +0 -31
- package/cjs/lib/utils/escape.js +0 -35
- package/cjs/lib/utils/unescape.js +0 -32
- package/es/lib/utils/convertNumericRefinementsToFilters.d.ts +0 -2
- package/es/lib/utils/convertNumericRefinementsToFilters.js +0 -24
- package/es/lib/utils/escape.js +0 -27
- package/es/lib/utils/unescape.d.ts +0 -9
- package/es/lib/utils/unescape.js +0 -25
|
@@ -18,7 +18,6 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
|
18
18
|
|
|
19
19
|
import { getInsightsAnonymousUserTokenInternal } from "../helpers/index.js";
|
|
20
20
|
import { warning, noop, getAppIdAndApiKey, find } from "../lib/utils/index.js";
|
|
21
|
-
import connectConfigure from "../connectors/configure/connectConfigure.js";
|
|
22
21
|
export var createInsightsMiddleware = function createInsightsMiddleware(props) {
|
|
23
22
|
var _ref = props || {},
|
|
24
23
|
_insightsClient = _ref.insightsClient,
|
|
@@ -86,31 +85,28 @@ export var createInsightsMiddleware = function createInsightsMiddleware(props) {
|
|
|
86
85
|
appId: appId,
|
|
87
86
|
apiKey: apiKey
|
|
88
87
|
}, insightsInitParams));
|
|
89
|
-
var
|
|
90
|
-
var
|
|
91
|
-
var configureUserToken;
|
|
88
|
+
var initialParameters;
|
|
89
|
+
var helper;
|
|
92
90
|
return {
|
|
93
91
|
onStateChange: function onStateChange() {},
|
|
94
|
-
subscribe: function subscribe() {
|
|
92
|
+
subscribe: function subscribe() {},
|
|
93
|
+
started: function started() {
|
|
95
94
|
insightsClient('addAlgoliaAgent', 'insights-middleware');
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
}
|
|
101
|
-
|
|
95
|
+
helper = instantSearchInstance.helper;
|
|
96
|
+
initialParameters = {
|
|
97
|
+
userToken: helper.state.userToken,
|
|
98
|
+
clickAnalytics: helper.state.clickAnalytics
|
|
99
|
+
};
|
|
100
|
+
helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {
|
|
101
|
+
clickAnalytics: true
|
|
102
|
+
}));
|
|
103
|
+
instantSearchInstance.scheduleSearch();
|
|
102
104
|
|
|
103
105
|
var setUserTokenToSearch = function setUserTokenToSearch(userToken) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
configureUserToken = createWidget({
|
|
109
|
-
searchParameters: {
|
|
110
|
-
userToken: userToken
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
instantSearchInstance.addWidgets([configureUserToken]);
|
|
106
|
+
helper.overrideStateWithoutTriggeringChangeEvent(_objectSpread(_objectSpread({}, helper.state), {}, {
|
|
107
|
+
userToken: userToken
|
|
108
|
+
}));
|
|
109
|
+
instantSearchInstance.scheduleSearch();
|
|
114
110
|
};
|
|
115
111
|
|
|
116
112
|
var anonymousUserToken = getInsightsAnonymousUserTokenInternal();
|
|
@@ -138,9 +134,7 @@ export var createInsightsMiddleware = function createInsightsMiddleware(props) {
|
|
|
138
134
|
if (onEvent) {
|
|
139
135
|
onEvent(event, _insightsClient);
|
|
140
136
|
} else if (event.insightsMethod) {
|
|
141
|
-
|
|
142
|
-
// it means there is a configure widget (added above).
|
|
143
|
-
var hasUserToken = Boolean(instantSearchInstance.renderState[instantSearchInstance.indexName].configure.widgetParams.searchParameters.userToken);
|
|
137
|
+
var hasUserToken = Boolean(helper.state.userToken);
|
|
144
138
|
|
|
145
139
|
if (hasUserToken) {
|
|
146
140
|
insightsClient(event.insightsMethod, event.payload);
|
|
@@ -154,10 +148,12 @@ export var createInsightsMiddleware = function createInsightsMiddleware(props) {
|
|
|
154
148
|
},
|
|
155
149
|
unsubscribe: function unsubscribe() {
|
|
156
150
|
insightsClient('onUserTokenChange', undefined);
|
|
157
|
-
instantSearchInstance.removeWidgets([configureClickAnalytics, configureUserToken]);
|
|
158
|
-
configureClickAnalytics = undefined;
|
|
159
|
-
configureUserToken = undefined;
|
|
160
151
|
instantSearchInstance.sendEventToInsights = noop;
|
|
152
|
+
|
|
153
|
+
if (helper && initialParameters) {
|
|
154
|
+
helper.setState(_objectSpread(_objectSpread({}, helper.state), initialParameters));
|
|
155
|
+
instantSearchInstance.scheduleSearch();
|
|
156
|
+
}
|
|
161
157
|
}
|
|
162
158
|
};
|
|
163
159
|
};
|
package/es/types/middleware.d.ts
CHANGED
|
@@ -4,11 +4,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import defaultTemplates from "./defaultTemplates.js";
|
|
11
|
-
import { createDocumentationMessageGenerator, getContainerNode
|
|
10
|
+
import { createDocumentationMessageGenerator, getContainerNode } from "../../lib/utils/index.js";
|
|
11
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
12
12
|
import { component } from "../../lib/suit.js";
|
|
13
13
|
import Answers from "../../components/Answers/Answers.js";
|
|
14
14
|
import connectAnswers from "../../connectors/answers/connectAnswers.js";
|
|
@@ -4,13 +4,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import Breadcrumb from "../../components/Breadcrumb/Breadcrumb.js";
|
|
11
10
|
import connectBreadcrumb from "../../connectors/breadcrumb/connectBreadcrumb.js";
|
|
12
11
|
import defaultTemplates from "./defaultTemplates.js";
|
|
13
|
-
import { getContainerNode,
|
|
12
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
13
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
14
14
|
import { component } from "../../lib/suit.js";
|
|
15
15
|
var withUsage = createDocumentationMessageGenerator({
|
|
16
16
|
name: 'breadcrumb'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import type { ClearRefinementsConnectorParams, ClearRefinementsWidgetDescription } from '../../connectors/clear-refinements/connectClearRefinements';
|
|
3
3
|
import type { WidgetFactory, Template } from '../../types';
|
|
4
4
|
export declare type ClearRefinementsCSSClasses = Partial<{
|
|
@@ -4,13 +4,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import ClearRefinements from "../../components/ClearRefinements/ClearRefinements.js";
|
|
10
9
|
import cx from 'classnames';
|
|
11
10
|
import connectClearRefinements from "../../connectors/clear-refinements/connectClearRefinements.js";
|
|
12
11
|
import defaultTemplates from "./defaultTemplates.js";
|
|
13
|
-
import { getContainerNode,
|
|
12
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
13
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
14
14
|
import { component } from "../../lib/suit.js";
|
|
15
15
|
var withUsage = createDocumentationMessageGenerator({
|
|
16
16
|
name: 'clear-refinements'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import type { CurrentRefinementsConnectorParams, CurrentRefinementsWidgetDescription } from '../../connectors/current-refinements/connectCurrentRefinements';
|
|
3
3
|
import type { WidgetFactory } from '../../types';
|
|
4
4
|
export declare type CurrentRefinementsCSSClasses = Partial<{
|
|
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import CurrentRefinements from "../../components/CurrentRefinements/CurrentRefinements.js";
|
|
@@ -16,9 +16,8 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
16
16
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
|
|
19
|
-
/** @jsx h */
|
|
20
19
|
import { h, render } from 'preact';
|
|
21
|
-
import { prepareTemplateProps } from "../../lib/
|
|
20
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
22
21
|
import GeoSearchControls from "../../components/GeoSearchControls/GeoSearchControls.js";
|
|
23
22
|
|
|
24
23
|
var refineWithMap = function refineWithMap(_ref) {
|
|
@@ -13,7 +13,8 @@ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) r
|
|
|
13
13
|
/* global google */
|
|
14
14
|
import cx from 'classnames';
|
|
15
15
|
import { render } from 'preact';
|
|
16
|
-
import { getContainerNode,
|
|
16
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
17
|
+
import { renderTemplate } from "../../lib/templating/index.js";
|
|
17
18
|
import { component } from "../../lib/suit.js";
|
|
18
19
|
import connectGeoSearch from "../../connectors/geo-search/connectGeoSearch.js";
|
|
19
20
|
import renderer from "./GeoSearchRenderer.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import type { HierarchicalMenuItem, HierarchicalMenuConnectorParams, HierarchicalMenuWidgetDescription } from '../../connectors/hierarchical-menu/connectHierarchicalMenu';
|
|
3
3
|
import type { TransformItems, Template, WidgetFactory, SortBy, ComponentCSSClasses } from '../../types';
|
|
4
4
|
declare type HierarchicalMenuTemplates = Partial<{
|
|
@@ -4,13 +4,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import RefinementList from "../../components/RefinementList/RefinementList.js";
|
|
11
10
|
import connectHierarchicalMenu from "../../connectors/hierarchical-menu/connectHierarchicalMenu.js";
|
|
12
11
|
import defaultTemplates from "./defaultTemplates.js";
|
|
13
|
-
import {
|
|
12
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
13
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
14
14
|
import { component } from "../../lib/suit.js";
|
|
15
15
|
var withUsage = createDocumentationMessageGenerator({
|
|
16
16
|
name: 'hierarchical-menu'
|
package/es/widgets/hits/hits.js
CHANGED
|
@@ -4,13 +4,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import connectHits from "../../connectors/hits/connectHits.js";
|
|
11
10
|
import Hits from "../../components/Hits/Hits.js";
|
|
12
11
|
import defaultTemplates from "./defaultTemplates.js";
|
|
13
|
-
import {
|
|
12
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
13
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
14
14
|
import { component } from "../../lib/suit.js";
|
|
15
15
|
import { withInsights, withInsightsListener } from "../../lib/insights/index.js";
|
|
16
16
|
var withUsage = createDocumentationMessageGenerator({
|
|
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import Selector from "../../components/Selector/Selector.js";
|
|
@@ -42,6 +42,5 @@ export declare type IndexWidget = Omit<Widget<IndexWidgetDescription & {
|
|
|
42
42
|
}): SearchParameters;
|
|
43
43
|
refreshUiState(): void;
|
|
44
44
|
};
|
|
45
|
-
export declare function isIndexWidget(widget: Widget | IndexWidget): widget is IndexWidget;
|
|
46
45
|
declare const index: (widgetParams: IndexWidgetParams) => IndexWidget;
|
|
47
46
|
export default index;
|
|
@@ -21,19 +21,16 @@ function _objectWithoutProperties(source, excluded) { if (source == null) return
|
|
|
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
23
|
import algoliasearchHelper from 'algoliasearch-helper';
|
|
24
|
-
import { checkIndexUiState, createDocumentationMessageGenerator, resolveSearchParameters, mergeSearchParameters, warning } from "../../lib/utils/index.js";
|
|
24
|
+
import { checkIndexUiState, createDocumentationMessageGenerator, resolveSearchParameters, mergeSearchParameters, warning, isIndexWidget } from "../../lib/utils/index.js";
|
|
25
25
|
var withUsage = createDocumentationMessageGenerator({
|
|
26
26
|
name: 'index-widget'
|
|
27
27
|
});
|
|
28
|
-
|
|
29
|
-
return widget.$$type === 'ais.index';
|
|
30
|
-
}
|
|
28
|
+
|
|
31
29
|
/**
|
|
32
30
|
* This is the same content as helper._change / setState, but allowing for extra
|
|
33
31
|
* UiState to be synchronized.
|
|
34
32
|
* see: https://github.com/algolia/algoliasearch-helper-js/blob/6b835ffd07742f2d6b314022cce6848f5cfecd4a/src/algoliasearch.helper.js#L1311-L1324
|
|
35
33
|
*/
|
|
36
|
-
|
|
37
34
|
function privateHelperSetState(helper, _ref) {
|
|
38
35
|
var state = _ref.state,
|
|
39
36
|
isPageReset = _ref.isPageReset,
|
|
@@ -312,7 +309,9 @@ var index = function index(widgetParams) {
|
|
|
312
309
|
if (instantSearchInstance.onStateChange) {
|
|
313
310
|
instantSearchInstance.onStateChange({
|
|
314
311
|
uiState: instantSearchInstance.mainIndex.getWidgetUiState({}),
|
|
315
|
-
setUiState:
|
|
312
|
+
setUiState: function setUiState(nextState) {
|
|
313
|
+
return instantSearchInstance.setUiState(nextState, false);
|
|
314
|
+
}
|
|
316
315
|
}); // We don't trigger a search when controlled because it becomes the
|
|
317
316
|
// responsibility of `setUiState`.
|
|
318
317
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import type { SearchResults } from 'algoliasearch-helper';
|
|
3
3
|
import type { InfiniteHitsConnectorParams, InfiniteHitsCache, InfiniteHitsWidgetDescription } from '../../connectors/infinite-hits/connectInfiniteHits';
|
|
4
4
|
import type { WidgetFactory, Template, TemplateWithBindEvent, Hit } from '../../types';
|
|
@@ -4,12 +4,12 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import InfiniteHits from "../../components/InfiniteHits/InfiniteHits.js";
|
|
11
10
|
import connectInfiniteHits from "../../connectors/infinite-hits/connectInfiniteHits.js";
|
|
12
|
-
import {
|
|
11
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
12
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
13
13
|
import { component } from "../../lib/suit.js";
|
|
14
14
|
import { withInsights, withInsightsListener } from "../../lib/insights/index.js";
|
|
15
15
|
import defaultTemplates from "./defaultTemplates.js";
|
package/es/widgets/menu/menu.js
CHANGED
|
@@ -4,13 +4,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import RefinementList from "../../components/RefinementList/RefinementList.js";
|
|
11
10
|
import connectMenu from "../../connectors/menu/connectMenu.js";
|
|
12
11
|
import defaultTemplates from "./defaultTemplates.js";
|
|
13
|
-
import {
|
|
12
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
13
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
14
14
|
import { component } from "../../lib/suit.js";
|
|
15
15
|
var withUsage = createDocumentationMessageGenerator({
|
|
16
16
|
name: 'menu'
|
|
@@ -4,13 +4,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import connectMenu from "../../connectors/menu/connectMenu.js";
|
|
11
10
|
import MenuSelect from "../../components/MenuSelect/MenuSelect.js";
|
|
12
11
|
import defaultTemplates from "./defaultTemplates.js";
|
|
13
|
-
import {
|
|
12
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
13
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
14
14
|
import { component } from "../../lib/suit.js";
|
|
15
15
|
var withUsage = createDocumentationMessageGenerator({
|
|
16
16
|
name: 'menu-select'
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import type { NumericMenuConnectorParams, NumericMenuWidgetDescription } from '../../connectors/numeric-menu/connectNumericMenu';
|
|
3
3
|
import type { ComponentCSSClasses, Template, WidgetFactory } from '../../types';
|
|
4
4
|
export declare type NumericMenuCSSClasses = Partial<{
|
|
@@ -4,14 +4,14 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import RefinementList from "../../components/RefinementList/RefinementList.js";
|
|
11
10
|
import connectNumericMenu from "../../connectors/numeric-menu/connectNumericMenu.js";
|
|
12
11
|
import defaultTemplates from "./defaultTemplates.js";
|
|
13
|
-
import {
|
|
12
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
14
13
|
import { component } from "../../lib/suit.js";
|
|
14
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
15
15
|
var withUsage = createDocumentationMessageGenerator({
|
|
16
16
|
name: 'numeric-menu'
|
|
17
17
|
});
|
|
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import Pagination from "../../components/Pagination/Pagination.js";
|
|
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import { createDocumentationMessageGenerator, getContainerNode, getObjectType, warning } from "../../lib/utils/index.js";
|
|
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import PoweredBy from "../../components/PoweredBy/PoweredBy.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import type { WidgetFactory, Template } from '../../types';
|
|
3
3
|
import type { QueryRulesConnectorParams, QueryRulesWidgetDescription } from '../../connectors/query-rules/connectQueryRules';
|
|
4
4
|
import type { QueryRuleCustomDataComponentTemplates } from '../../components/QueryRuleCustomData/QueryRuleCustomData';
|
|
@@ -4,7 +4,6 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
@@ -16,12 +16,12 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
16
16
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
|
|
19
|
-
/** @jsx h */
|
|
20
19
|
import { h, render } from 'preact';
|
|
21
20
|
import cx from 'classnames';
|
|
22
21
|
import RangeInput from "../../components/RangeInput/RangeInput.js";
|
|
23
22
|
import connectRange from "../../connectors/range/connectRange.js";
|
|
24
|
-
import {
|
|
23
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
24
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
25
25
|
import { component } from "../../lib/suit.js";
|
|
26
26
|
var withUsage = createDocumentationMessageGenerator({
|
|
27
27
|
name: 'range-input'
|
|
@@ -16,7 +16,6 @@ function _iterableToArrayLimit(arr, i) { if (typeof Symbol === "undefined" || !(
|
|
|
16
16
|
|
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
18
18
|
|
|
19
|
-
/** @jsx h */
|
|
20
19
|
import { h, render } from 'preact';
|
|
21
20
|
import cx from 'classnames';
|
|
22
21
|
import Slider from "../../components/Slider/Slider.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
2
|
import type { RatingMenuWidgetDescription, RatingMenuConnectorParams } from '../../connectors/rating-menu/connectRatingMenu';
|
|
3
3
|
import type { ComponentCSSClasses, Template, WidgetFactory } from '../../types';
|
|
4
4
|
export declare type RatingMenuTemplates = Partial<{
|
|
@@ -4,13 +4,13 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
4
4
|
|
|
5
5
|
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
6
|
|
|
7
|
-
/** @jsx h */
|
|
8
7
|
import { h, render } from 'preact';
|
|
9
8
|
import cx from 'classnames';
|
|
10
9
|
import RefinementList from "../../components/RefinementList/RefinementList.js";
|
|
11
10
|
import connectRatingMenu from "../../connectors/rating-menu/connectRatingMenu.js";
|
|
12
11
|
import defaultTemplates from "./defaultTemplates.js";
|
|
13
|
-
import {
|
|
12
|
+
import { getContainerNode, createDocumentationMessageGenerator } from "../../lib/utils/index.js";
|
|
13
|
+
import { prepareTemplateProps } from "../../lib/templating/index.js";
|
|
14
14
|
import { component } from "../../lib/suit.js";
|
|
15
15
|
var withUsage = createDocumentationMessageGenerator({
|
|
16
16
|
name: 'rating-menu'
|