react-instantsearch-core 7.32.3 → 7.33.1
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/dist/cjs/version.js +1 -1
- package/dist/es/connectors/useFilterSuggestions.d.ts +3 -0
- package/dist/es/connectors/useFilterSuggestions.js +3 -1
- package/dist/es/version.d.ts +1 -1
- package/dist/es/version.js +1 -1
- package/dist/umd/ReactInstantSearchCore.js +44 -59
- package/dist/umd/ReactInstantSearchCore.min.js +3 -3
- package/package.json +4 -6
package/dist/cjs/version.js
CHANGED
|
@@ -1,4 +1,7 @@
|
|
|
1
1
|
import type { AdditionalWidgetProperties } from '../hooks/useConnector';
|
|
2
2
|
import type { FilterSuggestionsConnectorParams } from 'instantsearch.js/es/connectors/filter-suggestions/connectFilterSuggestions';
|
|
3
3
|
export type UseFilterSuggestionsProps = FilterSuggestionsConnectorParams;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Filter suggestions are deprecated and will be removed in a future major version.
|
|
6
|
+
*/
|
|
4
7
|
export declare function useFilterSuggestions(props: UseFilterSuggestionsProps, additionalWidgetProperties?: AdditionalWidgetProperties): import("instantsearch.js/es/connectors/filter-suggestions/connectFilterSuggestions").FilterSuggestionsRenderState;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import connectFilterSuggestions from 'instantsearch.js/es/connectors/filter-suggestions/connectFilterSuggestions.js';
|
|
2
2
|
import { useConnector } from '../hooks/useConnector.js';
|
|
3
3
|
|
|
4
|
-
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Filter suggestions are deprecated and will be removed in a future major version.
|
|
6
|
+
*/ function useFilterSuggestions(props, additionalWidgetProperties) {
|
|
5
7
|
return useConnector(connectFilterSuggestions, props, additionalWidgetProperties);
|
|
6
8
|
}
|
|
7
9
|
|
package/dist/es/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
declare const _default: "7.
|
|
1
|
+
declare const _default: "7.33.1";
|
|
2
2
|
export default _default;
|
package/dist/es/version.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! React InstantSearch Core 7.
|
|
1
|
+
/*! React InstantSearch Core 7.33.1 | © Algolia, Inc. and contributors; MIT License | https://github.com/algolia/instantsearch */
|
|
2
2
|
(function (global, factory) {
|
|
3
3
|
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('react')) :
|
|
4
4
|
typeof define === 'function' && define.amd ? define(['exports', 'react'], factory) :
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
|
|
25
25
|
var React__namespace = /*#__PURE__*/_interopNamespaceDefault(React);
|
|
26
26
|
|
|
27
|
-
var version$2 = '7.
|
|
27
|
+
var version$2 = '7.33.1';
|
|
28
28
|
|
|
29
29
|
function _define_property(obj, key, value) {
|
|
30
30
|
if (key in obj) {
|
|
@@ -10853,7 +10853,7 @@
|
|
|
10853
10853
|
};
|
|
10854
10854
|
}
|
|
10855
10855
|
|
|
10856
|
-
var version = '4.
|
|
10856
|
+
var version = '4.99.0';
|
|
10857
10857
|
|
|
10858
10858
|
var withUsage$q = createDocumentationMessageGenerator({
|
|
10859
10859
|
name: 'instantsearch'
|
|
@@ -12587,6 +12587,12 @@
|
|
|
12587
12587
|
}
|
|
12588
12588
|
});
|
|
12589
12589
|
/**
|
|
12590
|
+
* Regenerate the chat id. Use this to start a fresh conversation on the
|
|
12591
|
+
* server while keeping the same Chat instance and its registered listeners.
|
|
12592
|
+
*/ _define_property(this, "regenerateId", function() {
|
|
12593
|
+
_this.id = _this.generateId();
|
|
12594
|
+
});
|
|
12595
|
+
/**
|
|
12590
12596
|
* Add a tool result for a tool call.
|
|
12591
12597
|
*/ _define_property(this, "addToolResult", function(param) {
|
|
12592
12598
|
var tool = param.tool, toolCallId = param.toolCallId, output = param.output;
|
|
@@ -13753,12 +13759,14 @@
|
|
|
13753
13759
|
var onClearTransitionEnd = function onClearTransitionEnd() {
|
|
13754
13760
|
setMessages([]);
|
|
13755
13761
|
_chatInstance.clearError();
|
|
13762
|
+
_chatInstance.regenerateId();
|
|
13756
13763
|
feedbackState = {};
|
|
13757
13764
|
setIsClearing(false);
|
|
13758
13765
|
};
|
|
13759
13766
|
var makeChatInstance = function makeChatInstance(instantSearchInstance) {
|
|
13760
13767
|
var transport;
|
|
13761
|
-
var
|
|
13768
|
+
var client = instantSearchInstance.client;
|
|
13769
|
+
var _getAppIdAndApiKey = _sliced_to_array(getAppIdAndApiKey(client), 2), appId = _getAppIdAndApiKey[0], apiKey = _getAppIdAndApiKey[1];
|
|
13762
13770
|
// Filter out custom data parts (like data-suggestions) that the backend doesn't accept
|
|
13763
13771
|
var filterDataParts = function filterDataParts(messages) {
|
|
13764
13772
|
return messages.map(function(message) {
|
|
@@ -13775,9 +13783,16 @@
|
|
|
13775
13783
|
transport = new DefaultChatTransport(_object_spread_props(_object_spread({}, options.transport), {
|
|
13776
13784
|
prepareSendMessagesRequest: function prepareSendMessagesRequest(params) {
|
|
13777
13785
|
// Call the original prepareSendMessagesRequest if it exists,
|
|
13778
|
-
// otherwise construct
|
|
13786
|
+
// otherwise construct a minimal default body containing only the
|
|
13787
|
+
// request payload — without leaking transport metadata such as
|
|
13788
|
+
// resolved headers, api URL, credentials, or `requestMetadata`.
|
|
13779
13789
|
var preparedOrPromise = originalPrepare ? originalPrepare(params) : {
|
|
13780
|
-
body: _object_spread({
|
|
13790
|
+
body: _object_spread({
|
|
13791
|
+
id: params.id,
|
|
13792
|
+
messageId: params.messageId,
|
|
13793
|
+
trigger: params.trigger,
|
|
13794
|
+
messages: params.messages
|
|
13795
|
+
}, params.body)
|
|
13781
13796
|
};
|
|
13782
13797
|
// Then filter out data-* parts
|
|
13783
13798
|
var applyFilter = function applyFilter(prepared) {
|
|
@@ -13804,20 +13819,19 @@
|
|
|
13804
13819
|
api: baseApi,
|
|
13805
13820
|
headers: {
|
|
13806
13821
|
'x-algolia-application-id': appId,
|
|
13807
|
-
'x-algolia-api-
|
|
13808
|
-
'x-algolia-agent': getAlgoliaAgent(
|
|
13822
|
+
'x-algolia-api-key': apiKey,
|
|
13823
|
+
'x-algolia-agent': "".concat(getAlgoliaAgent(client), "; chat")
|
|
13809
13824
|
},
|
|
13810
|
-
prepareSendMessagesRequest: function prepareSendMessagesRequest(
|
|
13811
|
-
var messages =
|
|
13812
|
-
"messages",
|
|
13813
|
-
"trigger"
|
|
13814
|
-
]);
|
|
13825
|
+
prepareSendMessagesRequest: function prepareSendMessagesRequest(param) {
|
|
13826
|
+
var id = param.id, messages = param.messages, trigger = param.trigger, messageId = param.messageId;
|
|
13815
13827
|
return {
|
|
13816
13828
|
// Bypass cache when regenerating to ensure fresh responses
|
|
13817
13829
|
api: trigger === 'regenerate-message' ? "".concat(baseApi, "&cache=false") : baseApi,
|
|
13818
|
-
body:
|
|
13830
|
+
body: {
|
|
13831
|
+
id: id,
|
|
13832
|
+
messageId: messageId,
|
|
13819
13833
|
messages: filterDataParts(messages)
|
|
13820
|
-
}
|
|
13834
|
+
}
|
|
13821
13835
|
};
|
|
13822
13836
|
}
|
|
13823
13837
|
});
|
|
@@ -13991,47 +14005,15 @@
|
|
|
13991
14005
|
message
|
|
13992
14006
|
].concat(_to_consumable_array(rest)));
|
|
13993
14007
|
}
|
|
13994
|
-
|
|
13995
|
-
|
|
13996
|
-
|
|
13997
|
-
serializedContext = JSON.stringify(resolvedContext);
|
|
13998
|
-
} catch (unused) {
|
|
13999
|
-
var _chatInstance3;
|
|
14000
|
-
return (_chatInstance3 = _chatInstance).sendMessage.apply(_chatInstance3, [
|
|
14001
|
-
message
|
|
14002
|
-
].concat(_to_consumable_array(rest)));
|
|
14003
|
-
}
|
|
14004
|
-
var contextTextPart = {
|
|
14005
|
-
type: 'text',
|
|
14006
|
-
text: '<context>'.concat(serializedContext).concat('</context>')
|
|
14007
|
-
};
|
|
14008
|
-
if ('parts' in message && message.parts) {
|
|
14009
|
-
var _chatInstance4;
|
|
14010
|
-
return (_chatInstance4 = _chatInstance).sendMessage.apply(_chatInstance4, [
|
|
14011
|
-
_object_spread_props(_object_spread({}, message), {
|
|
14012
|
-
parts: [
|
|
14013
|
-
contextTextPart
|
|
14014
|
-
].concat(_to_consumable_array(message.parts)),
|
|
14015
|
-
text: undefined,
|
|
14016
|
-
files: undefined
|
|
14017
|
-
})
|
|
14018
|
-
].concat(_to_consumable_array(rest)));
|
|
14019
|
-
}
|
|
14020
|
-
var textContent = 'text' in message && message.text ? message.text : '';
|
|
14008
|
+
// Resolve once per send; let the server validate the payload and
|
|
14009
|
+
// surface any contract violations.
|
|
14010
|
+
var turnContext = typeof context === 'function' ? context() : context;
|
|
14021
14011
|
return (_chatInstance1 = _chatInstance).sendMessage.apply(_chatInstance1, [
|
|
14022
|
-
{
|
|
14023
|
-
|
|
14024
|
-
|
|
14025
|
-
|
|
14026
|
-
|
|
14027
|
-
text: textContent
|
|
14028
|
-
}
|
|
14029
|
-
],
|
|
14030
|
-
metadata: message.metadata,
|
|
14031
|
-
messageId: message.messageId,
|
|
14032
|
-
files: undefined,
|
|
14033
|
-
text: undefined
|
|
14034
|
-
}
|
|
14012
|
+
_object_spread_props(_object_spread({}, message), {
|
|
14013
|
+
metadata: _object_spread_props(_object_spread({}, message.metadata), {
|
|
14014
|
+
turnContext: turnContext
|
|
14015
|
+
})
|
|
14016
|
+
})
|
|
14035
14017
|
].concat(_to_consumable_array(rest)));
|
|
14036
14018
|
};
|
|
14037
14019
|
return {
|
|
@@ -17439,7 +17421,7 @@
|
|
|
17439
17421
|
var unmountFn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop;
|
|
17440
17422
|
checkRendering(renderFn, withUsage$2());
|
|
17441
17423
|
return function(widgetParams) {
|
|
17442
|
-
var _ref = widgetParams || {}, facetName = _ref.facetName, limit = _ref.limit, threshold = _ref.threshold, fallbackParameters = _ref.fallbackParameters,
|
|
17424
|
+
var _ref = widgetParams || {}, facetName = _ref.facetName, limit = _ref.limit, threshold = _ref.threshold, fallbackParameters = _ref.fallbackParameters, _ref_escapeHTML = _ref.escapeHTML, escapeHTML = _ref_escapeHTML === void 0 ? true : _ref_escapeHTML, _ref_transformItems = _ref.transformItems, transformItems = _ref_transformItems === void 0 ? function(items) {
|
|
17443
17425
|
return items;
|
|
17444
17426
|
} : _ref_transformItems;
|
|
17445
17427
|
if (!facetName) {
|
|
@@ -17507,7 +17489,6 @@
|
|
|
17507
17489
|
maxRecommendations: limit,
|
|
17508
17490
|
threshold: threshold,
|
|
17509
17491
|
fallbackParameters: fallbackParameters ? _object_spread({}, fallbackParameters, escapeHTML ? TAG_PLACEHOLDER : {}) : undefined,
|
|
17510
|
-
queryParameters: _object_spread({}, queryParameters, escapeHTML ? TAG_PLACEHOLDER : {}),
|
|
17511
17492
|
$$id: this.$$id
|
|
17512
17493
|
});
|
|
17513
17494
|
}
|
|
@@ -17611,7 +17592,9 @@
|
|
|
17611
17592
|
name: 'filter-suggestions',
|
|
17612
17593
|
connector: true
|
|
17613
17594
|
});
|
|
17614
|
-
|
|
17595
|
+
/**
|
|
17596
|
+
* @deprecated Filter suggestions are deprecated and will be removed in a future major version.
|
|
17597
|
+
*/ var connectFilterSuggestions = function connectFilterSuggestions(renderFn) {
|
|
17615
17598
|
var unmountFn = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : noop;
|
|
17616
17599
|
checkRendering(renderFn, withUsage());
|
|
17617
17600
|
return function(widgetParams) {
|
|
@@ -17823,7 +17806,9 @@
|
|
|
17823
17806
|
};
|
|
17824
17807
|
};
|
|
17825
17808
|
|
|
17826
|
-
|
|
17809
|
+
/**
|
|
17810
|
+
* @deprecated Filter suggestions are deprecated and will be removed in a future major version.
|
|
17811
|
+
*/ function useFilterSuggestions(props, additionalWidgetProperties) {
|
|
17827
17812
|
return useConnector(connectFilterSuggestions, props, additionalWidgetProperties);
|
|
17828
17813
|
}
|
|
17829
17814
|
|