react-instantsearch 7.24.0 → 7.25.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.
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
|
|
8
8
|
var React__default = 'default' in React ? React['default'] : React;
|
|
9
9
|
|
|
10
|
-
var version = '7.
|
|
10
|
+
var version = '7.25.0';
|
|
11
11
|
|
|
12
12
|
// Copyright Joyent, Inc. and other Node contributors.
|
|
13
13
|
//
|
|
@@ -13361,7 +13361,7 @@
|
|
|
13361
13361
|
};
|
|
13362
13362
|
}
|
|
13363
13363
|
|
|
13364
|
-
var version$3 = '4.
|
|
13364
|
+
var version$3 = '4.89.0';
|
|
13365
13365
|
|
|
13366
13366
|
function _typeof$q(o) {
|
|
13367
13367
|
"@babel/helpers - typeof";
|
|
@@ -17082,6 +17082,11 @@
|
|
|
17082
17082
|
onToolCall: function onToolCall(_ref5) {
|
|
17083
17083
|
var toolCall = _ref5.toolCall;
|
|
17084
17084
|
var tool = tools[toolCall.toolName];
|
|
17085
|
+
|
|
17086
|
+
// Compatibility shim with Algolia MCP Server search tool
|
|
17087
|
+
if (!tool && toolCall.toolName.startsWith("".concat(SearchIndexToolType, "_"))) {
|
|
17088
|
+
tool = tools[SearchIndexToolType];
|
|
17089
|
+
}
|
|
17085
17090
|
if (!tool) {
|
|
17086
17091
|
return _chatInstance.addToolResult({
|
|
17087
17092
|
output: "No tool implemented for \"".concat(toolCall.toolName, "\"."),
|
|
@@ -24772,13 +24777,11 @@
|
|
|
24772
24777
|
}, [rootRef, isDetached]);
|
|
24773
24778
|
var getNextActiveDescendant = function getNextActiveDescendant(key) {
|
|
24774
24779
|
switch (key) {
|
|
24775
|
-
case 'ArrowLeft':
|
|
24776
24780
|
case 'ArrowUp':
|
|
24777
24781
|
{
|
|
24778
24782
|
var prevIndex = itemsIds.indexOf(activeDescendant || '') - 1;
|
|
24779
24783
|
return itemsIds[prevIndex] || itemsIds[itemsIds.length - 1];
|
|
24780
24784
|
}
|
|
24781
|
-
case 'ArrowRight':
|
|
24782
24785
|
case 'ArrowDown':
|
|
24783
24786
|
{
|
|
24784
24787
|
var nextIndex = itemsIds.indexOf(activeDescendant || '') + 1;
|
|
@@ -24849,9 +24852,7 @@
|
|
|
24849
24852
|
}
|
|
24850
24853
|
break;
|
|
24851
24854
|
}
|
|
24852
|
-
case 'ArrowLeft':
|
|
24853
24855
|
case 'ArrowUp':
|
|
24854
|
-
case 'ArrowRight':
|
|
24855
24856
|
case 'ArrowDown':
|
|
24856
24857
|
{
|
|
24857
24858
|
var _document$getElementB;
|
|
@@ -25848,6 +25849,8 @@
|
|
|
25848
25849
|
}
|
|
25849
25850
|
return e;
|
|
25850
25851
|
}
|
|
25852
|
+
// Keep in sync with packages/instantsearch.js/src/lib/chat/index.ts
|
|
25853
|
+
var SearchIndexToolType$1 = 'algolia_search_index';
|
|
25851
25854
|
function createChatMessageComponent(_ref) {
|
|
25852
25855
|
var createElement = _ref.createElement;
|
|
25853
25856
|
var Button = createButtonComponent({
|
|
@@ -25907,12 +25910,17 @@
|
|
|
25907
25910
|
if (startsWith(part.type, 'tool-')) {
|
|
25908
25911
|
var toolName = part.type.replace('tool-', '');
|
|
25909
25912
|
var tool = tools[toolName];
|
|
25913
|
+
|
|
25914
|
+
// Compatibility shim with Algolia MCP Server search tool
|
|
25915
|
+
if (!tool && startsWith(toolName, "".concat(SearchIndexToolType$1, "_"))) {
|
|
25916
|
+
tool = tools[SearchIndexToolType$1];
|
|
25917
|
+
}
|
|
25910
25918
|
if (tool) {
|
|
25911
25919
|
var ToolLayoutComponent = tool.layoutComponent;
|
|
25912
25920
|
var toolMessage = part;
|
|
25913
25921
|
var boundAddToolResult = function boundAddToolResult(params) {
|
|
25914
|
-
var _tool$addToolResult;
|
|
25915
|
-
return (_tool$addToolResult = tool.addToolResult) === null || _tool$addToolResult === void 0 ? void 0 : _tool$addToolResult.call(
|
|
25922
|
+
var _tool$addToolResult, _tool;
|
|
25923
|
+
return (_tool$addToolResult = (_tool = tool).addToolResult) === null || _tool$addToolResult === void 0 ? void 0 : _tool$addToolResult.call(_tool, {
|
|
25916
25924
|
output: params.output,
|
|
25917
25925
|
tool: part.type,
|
|
25918
25926
|
toolCallId: toolMessage.toolCallId
|