instantsearch.js 4.64.2 → 4.65.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/components/Answers/Answers.js +2 -2
- package/cjs/components/Breadcrumb/Breadcrumb.js +4 -4
- package/cjs/components/ClearRefinements/ClearRefinements.js +2 -2
- package/cjs/components/CurrentRefinements/CurrentRefinements.js +2 -2
- package/cjs/components/GeoSearchControls/GeoSearchControls.js +3 -3
- package/cjs/components/Highlight/Highlight.js +5 -5
- package/cjs/components/Hits/Hits.js +2 -2
- package/cjs/components/InfiniteHits/InfiniteHits.js +4 -4
- package/cjs/components/InternalHighlight/InternalHighlight.js +2 -2
- package/cjs/components/MenuSelect/MenuSelect.js +2 -2
- package/cjs/components/Pagination/Pagination.js +3 -3
- package/cjs/components/Panel/Panel.js +2 -2
- package/cjs/components/RangeInput/RangeInput.js +4 -4
- package/cjs/components/RefinementList/RefinementList.js +4 -4
- package/cjs/components/ReverseHighlight/ReverseHighlight.js +5 -5
- package/cjs/components/ReverseSnippet/ReverseSnippet.js +5 -5
- package/cjs/components/Selector/Selector.js +3 -3
- package/cjs/components/Slider/Pit.js +2 -2
- package/cjs/components/Slider/Slider.js +3 -3
- package/cjs/components/Snippet/Snippet.js +5 -5
- package/cjs/components/Stats/Stats.js +2 -2
- package/cjs/components/Template/Template.js +64 -7
- package/cjs/connectors/autocomplete/connectAutocomplete.js +3 -1
- package/cjs/connectors/geo-search/connectGeoSearch.js +3 -1
- package/cjs/connectors/hits/connectHits.js +6 -2
- package/cjs/connectors/infinite-hits/connectInfiniteHits.js +6 -2
- package/cjs/lib/utils/createSendEventForHits.js +8 -8
- package/cjs/lib/version.js +1 -1
- package/cjs/widgets/answers/answers.js +7 -7
- package/cjs/widgets/breadcrumb/breadcrumb.js +8 -8
- package/cjs/widgets/clear-refinements/clear-refinements.js +4 -4
- package/cjs/widgets/current-refinements/current-refinements.js +9 -9
- package/cjs/widgets/geo-search/geo-search.js +11 -11
- package/cjs/widgets/hierarchical-menu/defaultTemplates.js +4 -4
- package/cjs/widgets/hierarchical-menu/hierarchical-menu.js +14 -14
- package/cjs/widgets/hits/hits.js +5 -5
- package/cjs/widgets/hits-per-page/hits-per-page.js +4 -4
- package/cjs/widgets/infinite-hits/infinite-hits.js +9 -9
- package/cjs/widgets/menu/defaultTemplates.js +4 -4
- package/cjs/widgets/menu/menu.js +11 -11
- package/cjs/widgets/menu-select/menu-select.js +5 -5
- package/cjs/widgets/numeric-menu/numeric-menu.js +9 -9
- package/cjs/widgets/pagination/pagination.js +13 -13
- package/cjs/widgets/panel/panel.js +10 -10
- package/cjs/widgets/powered-by/powered-by.js +4 -4
- package/cjs/widgets/query-rule-custom-data/query-rule-custom-data.js +2 -2
- package/cjs/widgets/range-input/range-input.js +10 -10
- package/cjs/widgets/range-slider/range-slider.js +3 -3
- package/cjs/widgets/rating-menu/defaultTemplates.js +6 -6
- package/cjs/widgets/rating-menu/rating-menu.js +13 -13
- package/cjs/widgets/refinement-list/defaultTemplates.js +5 -5
- package/cjs/widgets/refinement-list/refinement-list.js +23 -23
- package/cjs/widgets/relevant-sort/relevant-sort.js +4 -4
- package/cjs/widgets/search-box/search-box.js +10 -10
- package/cjs/widgets/sort-by/sort-by.js +4 -4
- package/cjs/widgets/stats/stats.js +3 -3
- package/cjs/widgets/toggle-refinement/toggle-refinement.js +5 -5
- package/cjs/widgets/voice-search/voice-search.js +4 -4
- package/dist/instantsearch.development.d.ts +6 -2
- package/dist/instantsearch.development.js +213 -155
- package/dist/instantsearch.development.js.map +1 -1
- package/dist/instantsearch.production.d.ts +6 -2
- package/dist/instantsearch.production.min.d.ts +6 -2
- package/dist/instantsearch.production.min.js +2 -2
- package/dist/instantsearch.production.min.js.map +1 -1
- package/es/components/Answers/Answers.js +1 -1
- package/es/components/Breadcrumb/Breadcrumb.js +1 -1
- package/es/components/ClearRefinements/ClearRefinements.js +1 -1
- package/es/components/CurrentRefinements/CurrentRefinements.js +1 -1
- package/es/components/GeoSearchControls/GeoSearchControls.js +1 -1
- package/es/components/Highlight/Highlight.d.ts +1 -1
- package/es/components/Highlight/Highlight.js +1 -1
- package/es/components/Hits/Hits.js +1 -1
- package/es/components/InfiniteHits/InfiniteHits.js +1 -1
- package/es/components/InternalHighlight/InternalHighlight.d.ts +1 -1
- package/es/components/InternalHighlight/InternalHighlight.js +1 -1
- package/es/components/MenuSelect/MenuSelect.js +1 -1
- package/es/components/Pagination/Pagination.js +1 -1
- package/es/components/Panel/Panel.js +1 -1
- package/es/components/RangeInput/RangeInput.js +1 -1
- package/es/components/RefinementList/RefinementList.js +1 -1
- package/es/components/ReverseHighlight/ReverseHighlight.d.ts +1 -1
- package/es/components/ReverseHighlight/ReverseHighlight.js +1 -1
- package/es/components/ReverseSnippet/ReverseSnippet.d.ts +1 -1
- package/es/components/ReverseSnippet/ReverseSnippet.js +1 -1
- package/es/components/Selector/Selector.js +1 -1
- package/es/components/Slider/Pit.js +1 -1
- package/es/components/Slider/Slider.js +1 -1
- package/es/components/Snippet/Snippet.d.ts +1 -1
- package/es/components/Snippet/Snippet.js +1 -1
- package/es/components/Stats/Stats.js +1 -1
- package/es/components/Template/Template.d.ts +1 -1
- package/es/components/Template/Template.js +65 -8
- package/es/connectors/autocomplete/connectAutocomplete.d.ts +4 -0
- package/es/connectors/autocomplete/connectAutocomplete.js +3 -1
- package/es/connectors/geo-search/connectGeoSearch.js +3 -1
- package/es/connectors/hits/connectHits.js +6 -2
- package/es/connectors/infinite-hits/connectInfiniteHits.js +6 -2
- package/es/lib/utils/createSendEventForHits.d.ts +6 -6
- package/es/lib/utils/createSendEventForHits.js +8 -8
- package/es/lib/version.d.ts +1 -1
- package/es/lib/version.js +1 -1
- package/es/widgets/answers/answers.js +1 -1
- package/es/widgets/breadcrumb/breadcrumb.js +1 -1
- package/es/widgets/clear-refinements/clear-refinements.js +1 -1
- package/es/widgets/current-refinements/current-refinements.js +1 -1
- package/es/widgets/geo-search/geo-search.js +1 -1
- package/es/widgets/hierarchical-menu/defaultTemplates.js +1 -1
- package/es/widgets/hierarchical-menu/hierarchical-menu.js +1 -1
- package/es/widgets/hits/hits.js +1 -1
- package/es/widgets/hits-per-page/hits-per-page.js +1 -1
- package/es/widgets/infinite-hits/infinite-hits.js +1 -1
- package/es/widgets/menu/defaultTemplates.js +1 -1
- package/es/widgets/menu/menu.js +1 -1
- package/es/widgets/menu-select/menu-select.js +1 -1
- package/es/widgets/numeric-menu/numeric-menu.js +1 -1
- package/es/widgets/pagination/pagination.js +1 -1
- package/es/widgets/panel/panel.js +1 -1
- package/es/widgets/powered-by/powered-by.js +1 -1
- package/es/widgets/query-rule-custom-data/query-rule-custom-data.js +1 -1
- package/es/widgets/range-input/range-input.js +1 -1
- package/es/widgets/range-slider/range-slider.js +1 -1
- package/es/widgets/rating-menu/defaultTemplates.js +1 -1
- package/es/widgets/rating-menu/rating-menu.js +1 -1
- package/es/widgets/refinement-list/defaultTemplates.js +1 -1
- package/es/widgets/refinement-list/refinement-list.js +1 -1
- package/es/widgets/relevant-sort/relevant-sort.js +1 -1
- package/es/widgets/search-box/search-box.js +1 -1
- package/es/widgets/sort-by/sort-by.js +1 -1
- package/es/widgets/stats/stats.js +1 -1
- package/es/widgets/toggle-refinement/toggle-refinement.js +1 -1
- package/es/widgets/voice-search/voice-search.js +1 -1
- package/package.json +6 -7
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
8
8
|
var _preact = require("preact");
|
|
9
9
|
var _Selector = _interopRequireDefault(require("../../components/Selector/Selector"));
|
|
10
10
|
var _connectSortBy = _interopRequireDefault(require("../../connectors/sort-by/connectSortBy"));
|
|
@@ -59,11 +59,11 @@ var sortBy = function sortBy(widgetParams) {
|
|
|
59
59
|
}
|
|
60
60
|
var containerNode = (0, _utils.getContainerNode)(container);
|
|
61
61
|
var cssClasses = {
|
|
62
|
-
root: (0,
|
|
63
|
-
select: (0,
|
|
62
|
+
root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),
|
|
63
|
+
select: (0, _instantsearchUiComponents.cx)(suit({
|
|
64
64
|
descendantName: 'select'
|
|
65
65
|
}), userCssClasses.select),
|
|
66
|
-
option: (0,
|
|
66
|
+
option: (0, _instantsearchUiComponents.cx)(suit({
|
|
67
67
|
descendantName: 'option'
|
|
68
68
|
}), userCssClasses.option)
|
|
69
69
|
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.defaultTemplates = exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
8
8
|
var _preact = require("preact");
|
|
9
9
|
var _Stats = _interopRequireDefault(require("../../components/Stats/Stats"));
|
|
10
10
|
var _connectStats = _interopRequireDefault(require("../../connectors/stats/connectStats"));
|
|
@@ -119,8 +119,8 @@ var stats = function stats(widgetParams) {
|
|
|
119
119
|
}
|
|
120
120
|
var containerNode = (0, _utils.getContainerNode)(container);
|
|
121
121
|
var cssClasses = {
|
|
122
|
-
root: (0,
|
|
123
|
-
text: (0,
|
|
122
|
+
root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),
|
|
123
|
+
text: (0, _instantsearchUiComponents.cx)(suit({
|
|
124
124
|
descendantName: 'text'
|
|
125
125
|
}), userCssClasses.text)
|
|
126
126
|
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
8
8
|
var _preact = require("preact");
|
|
9
9
|
var _ToggleRefinement = _interopRequireDefault(require("../../components/ToggleRefinement/ToggleRefinement"));
|
|
10
10
|
var _connectToggleRefinement = _interopRequireDefault(require("../../connectors/toggle-refinement/connectToggleRefinement"));
|
|
@@ -76,14 +76,14 @@ var toggleRefinement = function toggleRefinement(widgetParams) {
|
|
|
76
76
|
}
|
|
77
77
|
var containerNode = (0, _utils.getContainerNode)(container);
|
|
78
78
|
var cssClasses = {
|
|
79
|
-
root: (0,
|
|
80
|
-
label: (0,
|
|
79
|
+
root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),
|
|
80
|
+
label: (0, _instantsearchUiComponents.cx)(suit({
|
|
81
81
|
descendantName: 'label'
|
|
82
82
|
}), userCssClasses.label),
|
|
83
|
-
checkbox: (0,
|
|
83
|
+
checkbox: (0, _instantsearchUiComponents.cx)(suit({
|
|
84
84
|
descendantName: 'checkbox'
|
|
85
85
|
}), userCssClasses.checkbox),
|
|
86
|
-
labelText: (0,
|
|
86
|
+
labelText: (0, _instantsearchUiComponents.cx)(suit({
|
|
87
87
|
descendantName: 'labelText'
|
|
88
88
|
}), userCssClasses.labelText)
|
|
89
89
|
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.default = void 0;
|
|
7
|
-
var
|
|
7
|
+
var _instantsearchUiComponents = require("instantsearch-ui-components");
|
|
8
8
|
var _preact = require("preact");
|
|
9
9
|
var _VoiceSearch = _interopRequireDefault(require("../../components/VoiceSearch/VoiceSearch"));
|
|
10
10
|
var _connectVoiceSearch = _interopRequireDefault(require("../../connectors/voice-search/connectVoiceSearch"));
|
|
@@ -58,11 +58,11 @@ var voiceSearch = function voiceSearch(widgetParams) {
|
|
|
58
58
|
}
|
|
59
59
|
var containerNode = (0, _utils.getContainerNode)(container);
|
|
60
60
|
var cssClasses = {
|
|
61
|
-
root: (0,
|
|
62
|
-
button: (0,
|
|
61
|
+
root: (0, _instantsearchUiComponents.cx)(suit(), userCssClasses.root),
|
|
62
|
+
button: (0, _instantsearchUiComponents.cx)(suit({
|
|
63
63
|
descendantName: 'button'
|
|
64
64
|
}), userCssClasses.button),
|
|
65
|
-
status: (0,
|
|
65
|
+
status: (0, _instantsearchUiComponents.cx)(suit({
|
|
66
66
|
descendantName: 'status'
|
|
67
67
|
}), userCssClasses.status)
|
|
68
68
|
};
|
|
@@ -5,8 +5,8 @@ import type { AlgoliaSearchHelper } from 'algoliasearch-helper';
|
|
|
5
5
|
import EventEmitter from '@algolia/events';
|
|
6
6
|
import { FindAnswersOptions } from 'algoliasearch-helper/types/algoliasearch.js';
|
|
7
7
|
import { h } from 'preact';
|
|
8
|
-
import type { HighlightClassNames as HighlightClassNames_2 } from '
|
|
9
|
-
import type { HighlightProps as HighlightProps_3 } from '
|
|
8
|
+
import type { HighlightClassNames as HighlightClassNames_2 } from 'instantsearch-ui-components';
|
|
9
|
+
import type { HighlightProps as HighlightProps_3 } from 'instantsearch-ui-components';
|
|
10
10
|
import type { HoganOptions } from 'hogan.js';
|
|
11
11
|
import type { html } from 'htm/preact';
|
|
12
12
|
import type { InsightsClient as InsightsClient_2 } from 'search-insights';
|
|
@@ -267,6 +267,10 @@ declare type AutocompleteRenderState = {
|
|
|
267
267
|
* The name of the index
|
|
268
268
|
*/
|
|
269
269
|
indexName: string;
|
|
270
|
+
/**
|
|
271
|
+
* The id of the index
|
|
272
|
+
*/
|
|
273
|
+
indexId: string;
|
|
270
274
|
/**
|
|
271
275
|
* The resolved hits from the index matching the query.
|
|
272
276
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! InstantSearch.js 4.
|
|
1
|
+
/*! InstantSearch.js 4.65.0 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(factory) :
|
|
@@ -801,7 +801,7 @@
|
|
|
801
801
|
return chunks;
|
|
802
802
|
}
|
|
803
803
|
function _buildEventPayloadsForHits(_ref) {
|
|
804
|
-
var
|
|
804
|
+
var getIndex = _ref.getIndex,
|
|
805
805
|
widgetType = _ref.widgetType,
|
|
806
806
|
methodName = _ref.methodName,
|
|
807
807
|
args = _ref.args,
|
|
@@ -854,7 +854,7 @@
|
|
|
854
854
|
eventType: eventType,
|
|
855
855
|
payload: _objectSpread2({
|
|
856
856
|
eventName: eventName || 'Hits Viewed',
|
|
857
|
-
index:
|
|
857
|
+
index: getIndex(),
|
|
858
858
|
objectIDs: objectIDsByChunk[i]
|
|
859
859
|
}, additionalData),
|
|
860
860
|
hits: batch,
|
|
@@ -869,7 +869,7 @@
|
|
|
869
869
|
eventType: eventType,
|
|
870
870
|
payload: _objectSpread2({
|
|
871
871
|
eventName: eventName || 'Hit Clicked',
|
|
872
|
-
index:
|
|
872
|
+
index: getIndex(),
|
|
873
873
|
queryID: queryID,
|
|
874
874
|
objectIDs: objectIDsByChunk[i],
|
|
875
875
|
positions: positionsByChunk[i]
|
|
@@ -886,7 +886,7 @@
|
|
|
886
886
|
eventType: eventType,
|
|
887
887
|
payload: _objectSpread2({
|
|
888
888
|
eventName: eventName || 'Hit Converted',
|
|
889
|
-
index:
|
|
889
|
+
index: getIndex(),
|
|
890
890
|
queryID: queryID,
|
|
891
891
|
objectIDs: objectIDsByChunk[i]
|
|
892
892
|
}, additionalData),
|
|
@@ -900,7 +900,7 @@
|
|
|
900
900
|
}
|
|
901
901
|
function createSendEventForHits(_ref2) {
|
|
902
902
|
var instantSearchInstance = _ref2.instantSearchInstance,
|
|
903
|
-
|
|
903
|
+
getIndex = _ref2.getIndex,
|
|
904
904
|
widgetType = _ref2.widgetType;
|
|
905
905
|
var sentEvents = {};
|
|
906
906
|
var timer = undefined;
|
|
@@ -910,7 +910,7 @@
|
|
|
910
910
|
}
|
|
911
911
|
var payloads = _buildEventPayloadsForHits({
|
|
912
912
|
widgetType: widgetType,
|
|
913
|
-
|
|
913
|
+
getIndex: getIndex,
|
|
914
914
|
methodName: 'sendEvent',
|
|
915
915
|
args: args,
|
|
916
916
|
instantSearchInstance: instantSearchInstance
|
|
@@ -930,7 +930,7 @@
|
|
|
930
930
|
return sendEventForHits;
|
|
931
931
|
}
|
|
932
932
|
function createBindEventForHits(_ref3) {
|
|
933
|
-
var
|
|
933
|
+
var getIndex = _ref3.getIndex,
|
|
934
934
|
widgetType = _ref3.widgetType,
|
|
935
935
|
instantSearchInstance = _ref3.instantSearchInstance;
|
|
936
936
|
var bindEventForHits = function bindEventForHits() {
|
|
@@ -939,7 +939,7 @@
|
|
|
939
939
|
}
|
|
940
940
|
var payloads = _buildEventPayloadsForHits({
|
|
941
941
|
widgetType: widgetType,
|
|
942
|
-
|
|
942
|
+
getIndex: getIndex,
|
|
943
943
|
methodName: 'bindEvent',
|
|
944
944
|
args: args,
|
|
945
945
|
instantSearchInstance: instantSearchInstance
|
|
@@ -2669,13 +2669,17 @@
|
|
|
2669
2669
|
if (!sendEvent) {
|
|
2670
2670
|
sendEvent = createSendEventForHits({
|
|
2671
2671
|
instantSearchInstance: instantSearchInstance,
|
|
2672
|
-
|
|
2672
|
+
getIndex: function getIndex() {
|
|
2673
|
+
return helper.getIndex();
|
|
2674
|
+
},
|
|
2673
2675
|
widgetType: this.$$type
|
|
2674
2676
|
});
|
|
2675
2677
|
}
|
|
2676
2678
|
if (!bindEvent) {
|
|
2677
2679
|
bindEvent = createBindEventForHits({
|
|
2678
|
-
|
|
2680
|
+
getIndex: function getIndex() {
|
|
2681
|
+
return helper.getIndex();
|
|
2682
|
+
},
|
|
2679
2683
|
widgetType: this.$$type,
|
|
2680
2684
|
instantSearchInstance: instantSearchInstance
|
|
2681
2685
|
});
|
|
@@ -3212,11 +3216,15 @@
|
|
|
3212
3216
|
showMore = getShowMore(helper);
|
|
3213
3217
|
sendEvent = createSendEventForHits({
|
|
3214
3218
|
instantSearchInstance: instantSearchInstance,
|
|
3215
|
-
|
|
3219
|
+
getIndex: function getIndex() {
|
|
3220
|
+
return helper.getIndex();
|
|
3221
|
+
},
|
|
3216
3222
|
widgetType: this.$$type
|
|
3217
3223
|
});
|
|
3218
3224
|
bindEvent = createBindEventForHits({
|
|
3219
|
-
|
|
3225
|
+
getIndex: function getIndex() {
|
|
3226
|
+
return helper.getIndex();
|
|
3227
|
+
},
|
|
3220
3228
|
widgetType: this.$$type,
|
|
3221
3229
|
instantSearchInstance: instantSearchInstance
|
|
3222
3230
|
});
|
|
@@ -5651,7 +5659,9 @@
|
|
|
5651
5659
|
if (!sendEvent) {
|
|
5652
5660
|
sendEvent = createSendEventForHits({
|
|
5653
5661
|
instantSearchInstance: instantSearchInstance,
|
|
5654
|
-
|
|
5662
|
+
getIndex: function getIndex() {
|
|
5663
|
+
return helper.getIndex();
|
|
5664
|
+
},
|
|
5655
5665
|
widgetType: $$type$4
|
|
5656
5666
|
});
|
|
5657
5667
|
}
|
|
@@ -11976,7 +11986,9 @@
|
|
|
11976
11986
|
scopedResult.results.hits = escapeHTML ? escapeHits(scopedResult.results.hits) : scopedResult.results.hits;
|
|
11977
11987
|
var sendEvent = createSendEventForHits({
|
|
11978
11988
|
instantSearchInstance: instantSearchInstance,
|
|
11979
|
-
|
|
11989
|
+
getIndex: function getIndex() {
|
|
11990
|
+
return scopedResult.results.index;
|
|
11991
|
+
},
|
|
11980
11992
|
widgetType: _this.$$type
|
|
11981
11993
|
});
|
|
11982
11994
|
return {
|
|
@@ -14890,7 +14902,7 @@
|
|
|
14890
14902
|
};
|
|
14891
14903
|
}
|
|
14892
14904
|
|
|
14893
|
-
var version$1 = '4.
|
|
14905
|
+
var version$1 = '4.65.0';
|
|
14894
14906
|
|
|
14895
14907
|
var withUsage$r = createDocumentationMessageGenerator({
|
|
14896
14908
|
name: 'instantsearch'
|
|
@@ -15526,20 +15538,142 @@
|
|
|
15526
15538
|
createMetadataMiddleware: createMetadataMiddleware
|
|
15527
15539
|
});
|
|
15528
15540
|
|
|
15529
|
-
function
|
|
15530
|
-
|
|
15531
|
-
|
|
15541
|
+
function unwrapExports (x) {
|
|
15542
|
+
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
15543
|
+
}
|
|
15544
|
+
|
|
15545
|
+
function createCommonjsModule(fn, module) {
|
|
15546
|
+
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
15547
|
+
}
|
|
15548
|
+
|
|
15549
|
+
var _extends_1 = createCommonjsModule(function (module) {
|
|
15550
|
+
function _extends() {
|
|
15551
|
+
module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
15552
|
+
for (var i = 1; i < arguments.length; i++) {
|
|
15553
|
+
var source = arguments[i];
|
|
15554
|
+
for (var key in source) {
|
|
15555
|
+
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
15556
|
+
target[key] = source[key];
|
|
15557
|
+
}
|
|
15558
|
+
}
|
|
15559
|
+
}
|
|
15560
|
+
return target;
|
|
15561
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
15562
|
+
return _extends.apply(this, arguments);
|
|
15563
|
+
}
|
|
15564
|
+
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
15565
|
+
});
|
|
15566
|
+
|
|
15567
|
+
var _extends$1 = unwrapExports(_extends_1);
|
|
15568
|
+
|
|
15569
|
+
var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {
|
|
15570
|
+
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
15571
|
+
if (source == null) return {};
|
|
15572
|
+
var target = {};
|
|
15573
|
+
var sourceKeys = Object.keys(source);
|
|
15574
|
+
var key, i;
|
|
15575
|
+
for (i = 0; i < sourceKeys.length; i++) {
|
|
15576
|
+
key = sourceKeys[i];
|
|
15577
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
15578
|
+
target[key] = source[key];
|
|
15532
15579
|
}
|
|
15580
|
+
return target;
|
|
15581
|
+
}
|
|
15582
|
+
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
15583
|
+
});
|
|
15584
|
+
|
|
15585
|
+
unwrapExports(objectWithoutPropertiesLoose);
|
|
15533
15586
|
|
|
15534
|
-
|
|
15587
|
+
var objectWithoutProperties = createCommonjsModule(function (module) {
|
|
15588
|
+
function _objectWithoutProperties(source, excluded) {
|
|
15589
|
+
if (source == null) return {};
|
|
15590
|
+
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
15591
|
+
var key, i;
|
|
15592
|
+
if (Object.getOwnPropertySymbols) {
|
|
15593
|
+
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
15594
|
+
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
15595
|
+
key = sourceSymbolKeys[i];
|
|
15596
|
+
if (excluded.indexOf(key) >= 0) continue;
|
|
15597
|
+
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
15598
|
+
target[key] = source[key];
|
|
15599
|
+
}
|
|
15600
|
+
}
|
|
15601
|
+
return target;
|
|
15602
|
+
}
|
|
15603
|
+
module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
15604
|
+
});
|
|
15605
|
+
|
|
15606
|
+
var _objectWithoutProperties$1 = unwrapExports(objectWithoutProperties);
|
|
15607
|
+
|
|
15608
|
+
function cx() {
|
|
15609
|
+
for (var _len = arguments.length, classNames = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
15610
|
+
classNames[_key] = arguments[_key];
|
|
15611
|
+
}
|
|
15612
|
+
return classNames.reduce(function (acc, className) {
|
|
15535
15613
|
if (Array.isArray(className)) {
|
|
15536
15614
|
return acc.concat(className);
|
|
15537
15615
|
}
|
|
15538
|
-
|
|
15539
15616
|
return acc.concat([className]);
|
|
15540
15617
|
}, []).filter(Boolean).join(' ');
|
|
15541
15618
|
}
|
|
15542
15619
|
|
|
15620
|
+
var _excluded$9 = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
|
|
15621
|
+
function createHighlightPartComponent(_ref) {
|
|
15622
|
+
var createElement = _ref.createElement;
|
|
15623
|
+
return function HighlightPart(_ref2) {
|
|
15624
|
+
var classNames = _ref2.classNames,
|
|
15625
|
+
children = _ref2.children,
|
|
15626
|
+
highlightedTagName = _ref2.highlightedTagName,
|
|
15627
|
+
isHighlighted = _ref2.isHighlighted,
|
|
15628
|
+
nonHighlightedTagName = _ref2.nonHighlightedTagName;
|
|
15629
|
+
var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;
|
|
15630
|
+
return createElement(TagName, {
|
|
15631
|
+
className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted
|
|
15632
|
+
}, children);
|
|
15633
|
+
};
|
|
15634
|
+
}
|
|
15635
|
+
function createHighlightComponent(_ref3) {
|
|
15636
|
+
var createElement = _ref3.createElement,
|
|
15637
|
+
Fragment = _ref3.Fragment;
|
|
15638
|
+
var HighlightPart = createHighlightPartComponent({
|
|
15639
|
+
createElement: createElement,
|
|
15640
|
+
Fragment: Fragment
|
|
15641
|
+
});
|
|
15642
|
+
return function Highlight(userProps) {
|
|
15643
|
+
// Not destructured in function signature, to make sure it's not exposed in
|
|
15644
|
+
// the type definition.
|
|
15645
|
+
var parts = userProps.parts,
|
|
15646
|
+
_userProps$highlighte = userProps.highlightedTagName,
|
|
15647
|
+
highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
|
|
15648
|
+
_userProps$nonHighlig = userProps.nonHighlightedTagName,
|
|
15649
|
+
nonHighlightedTagName = _userProps$nonHighlig === void 0 ? 'span' : _userProps$nonHighlig,
|
|
15650
|
+
_userProps$separator = userProps.separator,
|
|
15651
|
+
separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,
|
|
15652
|
+
className = userProps.className,
|
|
15653
|
+
_userProps$classNames = userProps.classNames,
|
|
15654
|
+
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
15655
|
+
props = _objectWithoutProperties$1(userProps, _excluded$9);
|
|
15656
|
+
return createElement("span", _extends$1({}, props, {
|
|
15657
|
+
className: cx(classNames.root, className)
|
|
15658
|
+
}), parts.map(function (part, partIndex) {
|
|
15659
|
+
var isLastPart = partIndex === parts.length - 1;
|
|
15660
|
+
return createElement(Fragment, {
|
|
15661
|
+
key: partIndex
|
|
15662
|
+
}, part.map(function (subPart, subPartIndex) {
|
|
15663
|
+
return createElement(HighlightPart, {
|
|
15664
|
+
key: subPartIndex,
|
|
15665
|
+
classNames: classNames,
|
|
15666
|
+
highlightedTagName: highlightedTagName,
|
|
15667
|
+
nonHighlightedTagName: nonHighlightedTagName,
|
|
15668
|
+
isHighlighted: subPart.isHighlighted
|
|
15669
|
+
}, subPart.value);
|
|
15670
|
+
}), !isLastPart && createElement("span", {
|
|
15671
|
+
className: classNames.separator
|
|
15672
|
+
}, separator));
|
|
15673
|
+
}));
|
|
15674
|
+
};
|
|
15675
|
+
}
|
|
15676
|
+
|
|
15543
15677
|
function prepareTemplates(
|
|
15544
15678
|
// can not use = {} here, since the template could have different constraints
|
|
15545
15679
|
defaultTemplates) {
|
|
@@ -15573,14 +15707,6 @@
|
|
|
15573
15707
|
}, preparedTemplates);
|
|
15574
15708
|
}
|
|
15575
15709
|
|
|
15576
|
-
function unwrapExports (x) {
|
|
15577
|
-
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
15578
|
-
}
|
|
15579
|
-
|
|
15580
|
-
function createCommonjsModule(fn, module) {
|
|
15581
|
-
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
15582
|
-
}
|
|
15583
|
-
|
|
15584
15710
|
var compiler = createCommonjsModule(function (module, exports) {
|
|
15585
15711
|
/*
|
|
15586
15712
|
* Copyright 2011 Twitter, Inc.
|
|
@@ -16359,125 +16485,6 @@
|
|
|
16359
16485
|
|
|
16360
16486
|
var m$1=e$1.bind(h);
|
|
16361
16487
|
|
|
16362
|
-
var _extends_1 = createCommonjsModule(function (module) {
|
|
16363
|
-
function _extends() {
|
|
16364
|
-
module.exports = _extends = Object.assign ? Object.assign.bind() : function (target) {
|
|
16365
|
-
for (var i = 1; i < arguments.length; i++) {
|
|
16366
|
-
var source = arguments[i];
|
|
16367
|
-
for (var key in source) {
|
|
16368
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
16369
|
-
target[key] = source[key];
|
|
16370
|
-
}
|
|
16371
|
-
}
|
|
16372
|
-
}
|
|
16373
|
-
return target;
|
|
16374
|
-
}, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
16375
|
-
return _extends.apply(this, arguments);
|
|
16376
|
-
}
|
|
16377
|
-
module.exports = _extends, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
16378
|
-
});
|
|
16379
|
-
|
|
16380
|
-
var _extends$1 = unwrapExports(_extends_1);
|
|
16381
|
-
|
|
16382
|
-
var objectWithoutPropertiesLoose = createCommonjsModule(function (module) {
|
|
16383
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
16384
|
-
if (source == null) return {};
|
|
16385
|
-
var target = {};
|
|
16386
|
-
var sourceKeys = Object.keys(source);
|
|
16387
|
-
var key, i;
|
|
16388
|
-
for (i = 0; i < sourceKeys.length; i++) {
|
|
16389
|
-
key = sourceKeys[i];
|
|
16390
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
16391
|
-
target[key] = source[key];
|
|
16392
|
-
}
|
|
16393
|
-
return target;
|
|
16394
|
-
}
|
|
16395
|
-
module.exports = _objectWithoutPropertiesLoose, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
16396
|
-
});
|
|
16397
|
-
|
|
16398
|
-
unwrapExports(objectWithoutPropertiesLoose);
|
|
16399
|
-
|
|
16400
|
-
var objectWithoutProperties = createCommonjsModule(function (module) {
|
|
16401
|
-
function _objectWithoutProperties(source, excluded) {
|
|
16402
|
-
if (source == null) return {};
|
|
16403
|
-
var target = objectWithoutPropertiesLoose(source, excluded);
|
|
16404
|
-
var key, i;
|
|
16405
|
-
if (Object.getOwnPropertySymbols) {
|
|
16406
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
16407
|
-
for (i = 0; i < sourceSymbolKeys.length; i++) {
|
|
16408
|
-
key = sourceSymbolKeys[i];
|
|
16409
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
16410
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
16411
|
-
target[key] = source[key];
|
|
16412
|
-
}
|
|
16413
|
-
}
|
|
16414
|
-
return target;
|
|
16415
|
-
}
|
|
16416
|
-
module.exports = _objectWithoutProperties, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
16417
|
-
});
|
|
16418
|
-
|
|
16419
|
-
var _objectWithoutProperties$1 = unwrapExports(objectWithoutProperties);
|
|
16420
|
-
|
|
16421
|
-
var _excluded$9 = ["parts", "highlightedTagName", "nonHighlightedTagName", "separator", "className", "classNames"];
|
|
16422
|
-
|
|
16423
|
-
function createHighlightPartComponent(_ref) {
|
|
16424
|
-
var createElement = _ref.createElement;
|
|
16425
|
-
return function HighlightPart(_ref2) {
|
|
16426
|
-
var classNames = _ref2.classNames,
|
|
16427
|
-
children = _ref2.children,
|
|
16428
|
-
highlightedTagName = _ref2.highlightedTagName,
|
|
16429
|
-
isHighlighted = _ref2.isHighlighted,
|
|
16430
|
-
nonHighlightedTagName = _ref2.nonHighlightedTagName;
|
|
16431
|
-
var TagName = isHighlighted ? highlightedTagName : nonHighlightedTagName;
|
|
16432
|
-
return createElement(TagName, {
|
|
16433
|
-
className: isHighlighted ? classNames.highlighted : classNames.nonHighlighted
|
|
16434
|
-
}, children);
|
|
16435
|
-
};
|
|
16436
|
-
}
|
|
16437
|
-
|
|
16438
|
-
function createHighlightComponent(_ref3) {
|
|
16439
|
-
var createElement = _ref3.createElement,
|
|
16440
|
-
Fragment = _ref3.Fragment;
|
|
16441
|
-
var HighlightPart = createHighlightPartComponent({
|
|
16442
|
-
createElement: createElement,
|
|
16443
|
-
Fragment: Fragment
|
|
16444
|
-
});
|
|
16445
|
-
return function Highlight(userProps) {
|
|
16446
|
-
// Not destructured in function signature, to make sure it's not exposed in
|
|
16447
|
-
// the type definition.
|
|
16448
|
-
var parts = userProps.parts,
|
|
16449
|
-
_userProps$highlighte = userProps.highlightedTagName,
|
|
16450
|
-
highlightedTagName = _userProps$highlighte === void 0 ? 'mark' : _userProps$highlighte,
|
|
16451
|
-
_userProps$nonHighlig = userProps.nonHighlightedTagName,
|
|
16452
|
-
nonHighlightedTagName = _userProps$nonHighlig === void 0 ? 'span' : _userProps$nonHighlig,
|
|
16453
|
-
_userProps$separator = userProps.separator,
|
|
16454
|
-
separator = _userProps$separator === void 0 ? ', ' : _userProps$separator,
|
|
16455
|
-
className = userProps.className,
|
|
16456
|
-
_userProps$classNames = userProps.classNames,
|
|
16457
|
-
classNames = _userProps$classNames === void 0 ? {} : _userProps$classNames,
|
|
16458
|
-
props = _objectWithoutProperties$1(userProps, _excluded$9);
|
|
16459
|
-
|
|
16460
|
-
return createElement("span", _extends$1({}, props, {
|
|
16461
|
-
className: cx(classNames.root, className)
|
|
16462
|
-
}), parts.map(function (part, partIndex) {
|
|
16463
|
-
var isLastPart = partIndex === parts.length - 1;
|
|
16464
|
-
return createElement(Fragment, {
|
|
16465
|
-
key: partIndex
|
|
16466
|
-
}, part.map(function (subPart, subPartIndex) {
|
|
16467
|
-
return createElement(HighlightPart, {
|
|
16468
|
-
key: subPartIndex,
|
|
16469
|
-
classNames: classNames,
|
|
16470
|
-
highlightedTagName: highlightedTagName,
|
|
16471
|
-
nonHighlightedTagName: nonHighlightedTagName,
|
|
16472
|
-
isHighlighted: subPart.isHighlighted
|
|
16473
|
-
}, subPart.value);
|
|
16474
|
-
}), !isLastPart && createElement("span", {
|
|
16475
|
-
className: classNames.separator
|
|
16476
|
-
}, separator));
|
|
16477
|
-
}));
|
|
16478
|
-
};
|
|
16479
|
-
}
|
|
16480
|
-
|
|
16481
16488
|
var InternalHighlight = createHighlightComponent({
|
|
16482
16489
|
createElement: h,
|
|
16483
16490
|
Fragment: p
|
|
@@ -16689,6 +16696,49 @@
|
|
|
16689
16696
|
}).trim();
|
|
16690
16697
|
}
|
|
16691
16698
|
|
|
16699
|
+
var RawHtml = /*#__PURE__*/function (_Component) {
|
|
16700
|
+
_inherits(RawHtml, _Component);
|
|
16701
|
+
var _super = _createSuper(RawHtml);
|
|
16702
|
+
function RawHtml() {
|
|
16703
|
+
var _this;
|
|
16704
|
+
_classCallCheck(this, RawHtml);
|
|
16705
|
+
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
16706
|
+
args[_key] = arguments[_key];
|
|
16707
|
+
}
|
|
16708
|
+
_this = _super.call.apply(_super, [this].concat(args));
|
|
16709
|
+
_defineProperty(_assertThisInitialized(_this), "ref", y());
|
|
16710
|
+
_defineProperty(_assertThisInitialized(_this), "nodes", []);
|
|
16711
|
+
return _this;
|
|
16712
|
+
}
|
|
16713
|
+
_createClass(RawHtml, [{
|
|
16714
|
+
key: "componentDidMount",
|
|
16715
|
+
value: function componentDidMount() {
|
|
16716
|
+
var fragment = new DocumentFragment();
|
|
16717
|
+
var root = document.createElement('div');
|
|
16718
|
+
root.innerHTML = this.props.content;
|
|
16719
|
+
this.nodes = _toConsumableArray(root.children);
|
|
16720
|
+
this.nodes.forEach(function (node) {
|
|
16721
|
+
return fragment.appendChild(node);
|
|
16722
|
+
});
|
|
16723
|
+
this.ref.current.replaceWith(fragment);
|
|
16724
|
+
}
|
|
16725
|
+
}, {
|
|
16726
|
+
key: "componentWillUnmount",
|
|
16727
|
+
value: function componentWillUnmount() {
|
|
16728
|
+
this.nodes.forEach(function (node) {
|
|
16729
|
+
return node.outerHTML = '';
|
|
16730
|
+
});
|
|
16731
|
+
}
|
|
16732
|
+
}, {
|
|
16733
|
+
key: "render",
|
|
16734
|
+
value: function render() {
|
|
16735
|
+
return h("div", {
|
|
16736
|
+
ref: this.ref
|
|
16737
|
+
});
|
|
16738
|
+
}
|
|
16739
|
+
}]);
|
|
16740
|
+
return RawHtml;
|
|
16741
|
+
}(d);
|
|
16692
16742
|
var defaultProps = {
|
|
16693
16743
|
data: {},
|
|
16694
16744
|
rootTagName: 'div',
|
|
@@ -16697,12 +16747,12 @@
|
|
|
16697
16747
|
templatesConfig: {}
|
|
16698
16748
|
};
|
|
16699
16749
|
// @TODO: Template should be a generic and receive TData to pass to Templates (to avoid TTemplateData to be set as `any`)
|
|
16700
|
-
var Template = /*#__PURE__*/function (
|
|
16701
|
-
_inherits(Template,
|
|
16702
|
-
var
|
|
16750
|
+
var Template = /*#__PURE__*/function (_Component2) {
|
|
16751
|
+
_inherits(Template, _Component2);
|
|
16752
|
+
var _super2 = _createSuper(Template);
|
|
16703
16753
|
function Template() {
|
|
16704
16754
|
_classCallCheck(this, Template);
|
|
16705
|
-
return
|
|
16755
|
+
return _super2.apply(this, arguments);
|
|
16706
16756
|
}
|
|
16707
16757
|
_createClass(Template, [{
|
|
16708
16758
|
key: "shouldComponentUpdate",
|
|
@@ -16712,14 +16762,14 @@
|
|
|
16712
16762
|
}, {
|
|
16713
16763
|
key: "render",
|
|
16714
16764
|
value: function render() {
|
|
16715
|
-
var
|
|
16765
|
+
var _this2 = this;
|
|
16716
16766
|
{
|
|
16717
16767
|
var nonFunctionTemplates = Object.keys(this.props.templates).filter(function (key) {
|
|
16718
|
-
return typeof
|
|
16768
|
+
return typeof _this2.props.templates[key] !== 'function';
|
|
16719
16769
|
});
|
|
16720
16770
|
_warning(nonFunctionTemplates.length === 0, "Hogan.js and string-based templates are deprecated and will not be supported in InstantSearch.js 5.x.\n\nYou can replace them with function-form templates and use either the provided `html` function or JSX templates.\n\nString-based templates: ".concat(nonFunctionTemplates.join(', '), ".\n\nSee: https://www.algolia.com/doc/guides/building-search-ui/upgrade-guides/js/#upgrade-templates")) ;
|
|
16721
16771
|
}
|
|
16722
|
-
var RootTagName = this.props.rootTagName;
|
|
16772
|
+
var RootTagName = this.props.rootTagName === 'fragment' ? p : this.props.rootTagName;
|
|
16723
16773
|
var useCustomCompileOptions = this.props.useCustomCompileOptions[this.props.templateKey];
|
|
16724
16774
|
var compileOptions = useCustomCompileOptions ? this.props.templatesConfig.compileOptions : {};
|
|
16725
16775
|
var content = renderTemplate({
|
|
@@ -16739,6 +16789,14 @@
|
|
|
16739
16789
|
if (_typeof(content) === 'object') {
|
|
16740
16790
|
return h(RootTagName, this.props.rootProps, content);
|
|
16741
16791
|
}
|
|
16792
|
+
|
|
16793
|
+
// This is to handle Hogan templates with Fragment as rootTagName
|
|
16794
|
+
if (RootTagName === p) {
|
|
16795
|
+
return h(RawHtml, {
|
|
16796
|
+
content: content,
|
|
16797
|
+
key: content
|
|
16798
|
+
});
|
|
16799
|
+
}
|
|
16742
16800
|
return h(RootTagName, _extends({}, this.props.rootProps, {
|
|
16743
16801
|
dangerouslySetInnerHTML: {
|
|
16744
16802
|
__html: content
|