react-instantsearch 7.48.0 → 7.49.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.
|
@@ -47,9 +47,16 @@ function PromptSuggestions(_0) {
|
|
|
47
47
|
}), {
|
|
48
48
|
$$widgetType: 'ais.promptSuggestions'
|
|
49
49
|
}), suggestions = _usePromptSuggestions.suggestions, isLoading = _usePromptSuggestions.isLoading, error = _usePromptSuggestions.error, onSuggestionClick = _usePromptSuggestions.onSuggestionClick, isChatBusy = _usePromptSuggestions.isChatBusy, sendToChat = _usePromptSuggestions.sendToChat;
|
|
50
|
+
if (!sendToChat && !onSuggestionClickOverride) {
|
|
51
|
+
throw new Error('No <Chat> widget is mounted on this index, so there is nothing to send a clicked suggestion to. Mount a <Chat> on the same index, or pass `onSuggestionClick` to handle the click yourself.');
|
|
52
|
+
}
|
|
50
53
|
var handleClick = onSuggestionClickOverride ? function(prompt) {
|
|
51
54
|
return onSuggestionClickOverride(prompt, {
|
|
52
|
-
sendToChat
|
|
55
|
+
// `sendToChat` is only absent when the override above owns the click,
|
|
56
|
+
// in which case falling through to the chat is a no-op.
|
|
57
|
+
sendToChat: sendToChat !== null && sendToChat !== void 0 ? sendToChat : function() {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
53
60
|
});
|
|
54
61
|
} : onSuggestionClick;
|
|
55
62
|
if (LayoutComponent) {
|
|
@@ -36,9 +36,16 @@ function PromptSuggestions(_0) {
|
|
|
36
36
|
}), {
|
|
37
37
|
$$widgetType: 'ais.promptSuggestions'
|
|
38
38
|
}), suggestions = _usePromptSuggestions.suggestions, isLoading = _usePromptSuggestions.isLoading, error = _usePromptSuggestions.error, onSuggestionClick = _usePromptSuggestions.onSuggestionClick, isChatBusy = _usePromptSuggestions.isChatBusy, sendToChat = _usePromptSuggestions.sendToChat;
|
|
39
|
+
if (!sendToChat && !onSuggestionClickOverride) {
|
|
40
|
+
throw new Error('No <Chat> widget is mounted on this index, so there is nothing to send a clicked suggestion to. Mount a <Chat> on the same index, or pass `onSuggestionClick` to handle the click yourself.');
|
|
41
|
+
}
|
|
39
42
|
var handleClick = onSuggestionClickOverride ? function(prompt) {
|
|
40
43
|
return onSuggestionClickOverride(prompt, {
|
|
41
|
-
sendToChat
|
|
44
|
+
// `sendToChat` is only absent when the override above owns the click,
|
|
45
|
+
// in which case falling through to the chat is a no-op.
|
|
46
|
+
sendToChat: sendToChat !== null && sendToChat !== void 0 ? sendToChat : function() {
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
42
49
|
});
|
|
43
50
|
} : onSuggestionClick;
|
|
44
51
|
if (LayoutComponent) {
|