@appbaseio/reactivesearch-vue 3.0.0-rc.6.3 → 3.0.0-rc.6.5
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/@appbaseio/reactivesearch-vue.umd.js +138 -60
- package/dist/@appbaseio/reactivesearch-vue.umd.js.map +1 -1
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js +4 -4
- package/dist/@appbaseio/reactivesearch-vue.umd.min.js.map +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/{install-547d13b9.js → install-e8141489.js} +92 -57
- package/dist/cjs/install.js +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/es/index.js +2 -2
- package/dist/es/{install-b0a1fd33.js → install-b785dd55.js} +93 -58
- package/dist/es/install.js +1 -1
- package/dist/es/version.js +1 -1
- package/package.json +2 -2
|
@@ -7681,6 +7681,7 @@
|
|
|
7681
7681
|
exports.loadMore = loadMore;
|
|
7682
7682
|
exports.loadDataToExport = loadDataToExport;
|
|
7683
7683
|
exports.fetchAIResponse = fetchAIResponse;
|
|
7684
|
+
exports.createAISession = createAISession;
|
|
7684
7685
|
function _objectWithoutProperties(obj, keys) {
|
|
7685
7686
|
var target = {};
|
|
7686
7687
|
for (var i in obj) {
|
|
@@ -8246,13 +8247,14 @@
|
|
|
8246
8247
|
var chunk = decoder.decode(value, {
|
|
8247
8248
|
stream: true
|
|
8248
8249
|
});
|
|
8249
|
-
var
|
|
8250
|
+
var regex = /\n\n(?=data:)/;
|
|
8251
|
+
var lines = chunk.split(regex);
|
|
8250
8252
|
var shouldStop = false;
|
|
8251
8253
|
for (var i = 0; i < lines.length; i++) {
|
|
8252
8254
|
var line = lines[i];
|
|
8253
8255
|
if (line.startsWith('data: ')) {
|
|
8254
8256
|
var content = line.slice(6);
|
|
8255
|
-
if (content === '[DONE]') {
|
|
8257
|
+
if (content === '[DONE]\n\n') {
|
|
8256
8258
|
shouldStop = true;
|
|
8257
8259
|
if (Promise.resolve(metaInfoPromise) === metaInfoPromise) {
|
|
8258
8260
|
metaInfoPromise.then(function (resMeta) {
|
|
@@ -8371,6 +8373,46 @@
|
|
|
8371
8373
|
doFetch();
|
|
8372
8374
|
};
|
|
8373
8375
|
}
|
|
8376
|
+
function createAISession() {
|
|
8377
|
+
var question = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'Reactivesearch';
|
|
8378
|
+
return function (dispatch, getState) {
|
|
8379
|
+
var _getState7 = getState(),
|
|
8380
|
+
_getState7$config = _getState7.config,
|
|
8381
|
+
url = _getState7$config.url,
|
|
8382
|
+
configCredentials = _getState7$config.credentials,
|
|
8383
|
+
endpoint = _getState7$config.endpoint;
|
|
8384
|
+
var regex = /https:\/\/[^/]+/;
|
|
8385
|
+
var urlObj = new URL(url.match(regex)[0]);
|
|
8386
|
+
var credentials = configCredentials;
|
|
8387
|
+
if (urlObj.username && urlObj.password) {
|
|
8388
|
+
credentials = urlObj.username + ':' + urlObj.password;
|
|
8389
|
+
urlObj.username = '';
|
|
8390
|
+
urlObj.password = '';
|
|
8391
|
+
}
|
|
8392
|
+
var fetchUrl = urlObj.toString() + '_ai';
|
|
8393
|
+
var headers = new Headers();
|
|
8394
|
+
if (credentials) {
|
|
8395
|
+
var encodedCredentials = btoa(credentials);
|
|
8396
|
+
headers.append('Authorization', 'Basic ' + encodedCredentials);
|
|
8397
|
+
} else if (endpoint && endpoint.headers && endpoint.headers.Authorization) {
|
|
8398
|
+
headers.append('Authorization', endpoint.headers.Authorization);
|
|
8399
|
+
}
|
|
8400
|
+
var requestOptions = {
|
|
8401
|
+
headers: headers,
|
|
8402
|
+
method: 'POST',
|
|
8403
|
+
body: JSON.stringify({
|
|
8404
|
+
question: question
|
|
8405
|
+
})
|
|
8406
|
+
};
|
|
8407
|
+
return fetch(fetchUrl, _extends({}, requestOptions)).then(function (res) {
|
|
8408
|
+
return res.json();
|
|
8409
|
+
}).then(function (parsedRes) {
|
|
8410
|
+
return parsedRes;
|
|
8411
|
+
})["catch"](function (e) {
|
|
8412
|
+
console.error('Error creating an AI session: ', e);
|
|
8413
|
+
});
|
|
8414
|
+
};
|
|
8415
|
+
}
|
|
8374
8416
|
});
|
|
8375
8417
|
unwrapExports(query);
|
|
8376
8418
|
var query_1 = query.loadPopularSuggestions;
|
|
@@ -8380,6 +8422,7 @@
|
|
|
8380
8422
|
var query_5 = query.loadMore;
|
|
8381
8423
|
var query_6 = query.loadDataToExport;
|
|
8382
8424
|
var query_7 = query.fetchAIResponse;
|
|
8425
|
+
var query_8 = query.createAISession;
|
|
8383
8426
|
|
|
8384
8427
|
var component = createCommonjsModule(function (module, exports) {
|
|
8385
8428
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -24780,7 +24823,7 @@
|
|
|
24780
24823
|
// eslint-disable-next-line no-nested-ternary
|
|
24781
24824
|
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryColor : props.theme.colors.borderColor : props.theme.colors.borderColor) + ";\n\t}\n\n\tcode {\n\t\tline-height: normal;\n\n\t\tcolor: " + (
|
|
24782
24825
|
// eslint-disable-next-line no-nested-ternary
|
|
24783
|
-
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor : props.theme.colors.primaryTextColor) + ";\n\t\tborder-radius: 3px;\n\t\tfont-size: 85%;\n\t\tpadding: 0.2em 0.4em;\n\t\tmargin-top: 5px;\n\t\tdisplay: inline-block;\n\t\toverflow: auto;\n\t\twidth: fit-content;\n\t\tmax-width: 100%;\n\t}\n\tul,\n\tol {\n\t\tlist-style-position: inside;\n\n\t}\n\n\tli{\n\t\tdisplay:
|
|
24826
|
+
props.isSender ? props.themePreset !== 'dark' ? props.theme.colors.primaryTextColor : props.theme.colors.textColor : props.theme.colors.primaryTextColor) + ";\n\t\tborder-radius: 3px;\n\t\tfont-size: 85%;\n\t\tpadding: 0.2em 0.4em;\n\t\tmargin-top: 5px;\n\t\tdisplay: inline-block;\n\t\toverflow: auto;\n\t\twidth: fit-content;\n\t\tmax-width: 100%;\n\t}\n\tul,\n\tol {\n\t\tlist-style-position: inside;\n\t\tpadding-left: 10px;\n\n\t}\n\n\tli{\n\t\tdisplay: list-item;\n\t\tcursor: default;\n\t\tpadding: initial;\n\n\t\t&:hover{\n\t\t\tbackground-color: initial;\n\t\t}\n\t}\n\tp {\n\t\tmargin: inherit;\n\t}\n";
|
|
24784
24827
|
};
|
|
24785
24828
|
var messageBGColor = function messageBGColor(props) {
|
|
24786
24829
|
var finalBGColor;
|
|
@@ -26499,6 +26542,7 @@
|
|
|
26499
26542
|
isLoading: types.boolRequired,
|
|
26500
26543
|
sessionIdFromStore: Q.string,
|
|
26501
26544
|
showComponent: types.boolRequired,
|
|
26545
|
+
componentError: types.componentObject,
|
|
26502
26546
|
style: types.style
|
|
26503
26547
|
},
|
|
26504
26548
|
mounted: function mounted() {},
|
|
@@ -26525,7 +26569,7 @@
|
|
|
26525
26569
|
role: constants_7$1.ASSISTANT,
|
|
26526
26570
|
content: response.answer.text
|
|
26527
26571
|
});
|
|
26528
|
-
this.error = {
|
|
26572
|
+
if (!this.AISessionId) this.error = {
|
|
26529
26573
|
message: this.errorMessageForMissingSessionId
|
|
26530
26574
|
};
|
|
26531
26575
|
}
|
|
@@ -26543,7 +26587,6 @@
|
|
|
26543
26587
|
});
|
|
26544
26588
|
},
|
|
26545
26589
|
isAIResponseLoading: function isAIResponseLoading(newVal) {
|
|
26546
|
-
this.isLoadingState = newVal;
|
|
26547
26590
|
this.$emit('on-data', {
|
|
26548
26591
|
data: this.messages,
|
|
26549
26592
|
rawData: this.$props.rawData,
|
|
@@ -26552,7 +26595,6 @@
|
|
|
26552
26595
|
});
|
|
26553
26596
|
},
|
|
26554
26597
|
isLoading: function isLoading(newVal) {
|
|
26555
|
-
this.isLoadingState = newVal;
|
|
26556
26598
|
this.$emit('on-data', {
|
|
26557
26599
|
data: this.messages,
|
|
26558
26600
|
rawData: this.$props.rawData,
|
|
@@ -26584,14 +26626,50 @@
|
|
|
26584
26626
|
},
|
|
26585
26627
|
messages: function messages() {
|
|
26586
26628
|
this.scrollToBottom();
|
|
26629
|
+
},
|
|
26630
|
+
componentError: function componentError(newVal) {
|
|
26631
|
+
var _this = this;
|
|
26632
|
+
if (newVal && newVal._bodyBlob) {
|
|
26633
|
+
this.AISessionId = ((helper_2(constants_8$1) || {})[this.$props.componentId] || {}).sessionId || null;
|
|
26634
|
+
if (!this.AISessionId) {
|
|
26635
|
+
this.generateNewSessionId();
|
|
26636
|
+
}
|
|
26637
|
+
newVal._bodyBlob.text().then(function (textData) {
|
|
26638
|
+
try {
|
|
26639
|
+
var parsedErrorRes = JSON.parse(textData);
|
|
26640
|
+
if (parsedErrorRes.error) {
|
|
26641
|
+
_this.error = parsedErrorRes.error;
|
|
26642
|
+
_this.$emit('on-data', {
|
|
26643
|
+
data: _this.messages,
|
|
26644
|
+
rawData: _this.$props.rawData,
|
|
26645
|
+
loading: _this.$props.isAIResponseLoading || _this.$props.isLoading,
|
|
26646
|
+
error: parsedErrorRes.error
|
|
26647
|
+
});
|
|
26648
|
+
}
|
|
26649
|
+
} catch (error) {
|
|
26650
|
+
console.error('Error parsing component error JSON:', error);
|
|
26651
|
+
}
|
|
26652
|
+
})["catch"](function (error) {
|
|
26653
|
+
console.error('Error reading component error text data:', error);
|
|
26654
|
+
});
|
|
26655
|
+
}
|
|
26587
26656
|
}
|
|
26588
26657
|
},
|
|
26589
26658
|
methods: {
|
|
26659
|
+
generateNewSessionId: function generateNewSessionId() {
|
|
26660
|
+
var _this2 = this;
|
|
26661
|
+
var newSessionPromise = this.createAISession();
|
|
26662
|
+
newSessionPromise.then(function (res) {
|
|
26663
|
+
_this2.AISessionId = res.AIsessionId;
|
|
26664
|
+
})["catch"](function (e) {
|
|
26665
|
+
console.error(e);
|
|
26666
|
+
});
|
|
26667
|
+
},
|
|
26590
26668
|
scrollToBottom: function scrollToBottom() {
|
|
26591
|
-
var
|
|
26669
|
+
var _this3 = this;
|
|
26592
26670
|
this.$nextTick(function () {
|
|
26593
|
-
var
|
|
26594
|
-
var messageContainer = (
|
|
26671
|
+
var _this3$$refs;
|
|
26672
|
+
var messageContainer = (_this3$$refs = _this3.$refs) == null ? void 0 : _this3$$refs[_this3.$props.innerRef];
|
|
26595
26673
|
if (messageContainer && messageContainer.$el) {
|
|
26596
26674
|
messageContainer.$el.scrollTo({
|
|
26597
26675
|
top: messageContainer.$el.scrollHeight,
|
|
@@ -26658,7 +26736,7 @@
|
|
|
26658
26736
|
"class": "--ai-answer-error-container " + (helper_31(this.$props.innerClass, 'ai-error') || '')
|
|
26659
26737
|
}, [vue.createVNode("div", {
|
|
26660
26738
|
"class": "--default-error-element"
|
|
26661
|
-
}, [vue.createVNode("span", null, [(_this$error = this.error) != null && _this$error.message ? this.error.message : 'There was an error in generating the response.', ' ', (_this$error2 = this.error) != null && _this$error2.code ? "Code:\n\t\t\t\t\t\t\t" + this.error.code : '']), this.AISessionId && vue.createVNode(Button, {
|
|
26739
|
+
}, [vue.createVNode("span", null, [(_this$error = this.error) != null && _this$error.message ? this.error.message : 'There was an error in generating the response.', ' ', (_this$error2 = this.error) != null && _this$error2.code ? ", Code:\n\t\t\t\t\t\t\t" + this.error.code : '']), this.AISessionId && vue.createVNode(Button, {
|
|
26662
26740
|
"primary": true,
|
|
26663
26741
|
"onClick": this.handleRetryRequest
|
|
26664
26742
|
}, {
|
|
@@ -26670,6 +26748,7 @@
|
|
|
26670
26748
|
return null;
|
|
26671
26749
|
},
|
|
26672
26750
|
handleKeyPress: function handleKeyPress(e) {
|
|
26751
|
+
window.console.log('e', e);
|
|
26673
26752
|
if (e.key === 'Enter') {
|
|
26674
26753
|
this.handleSendMessage(e);
|
|
26675
26754
|
this.inputMessage = '';
|
|
@@ -26708,7 +26787,7 @@
|
|
|
26708
26787
|
}
|
|
26709
26788
|
},
|
|
26710
26789
|
renderIcons: function renderIcons() {
|
|
26711
|
-
var
|
|
26790
|
+
var _this4 = this;
|
|
26712
26791
|
var _slot, _slot2;
|
|
26713
26792
|
var _this$$props = this.$props,
|
|
26714
26793
|
getMicInstance = _this$$props.getMicInstance,
|
|
@@ -26722,12 +26801,12 @@
|
|
|
26722
26801
|
"positionType": "absolute"
|
|
26723
26802
|
}, {
|
|
26724
26803
|
"default": function _default() {
|
|
26725
|
-
return [!
|
|
26804
|
+
return [!_this4.isLoadingState && _this4.AISessionId && _this4.shouldMicRender(showVoiceInput) && vue.createVNode(Mic, {
|
|
26726
26805
|
"getInstance": getMicInstance,
|
|
26727
26806
|
"render": renderMic,
|
|
26728
|
-
"handleResult":
|
|
26807
|
+
"handleResult": _this4.handleVoiceResults,
|
|
26729
26808
|
"class": helper_31(innerClass, 'ai-search-mic') || null
|
|
26730
|
-
}, null), iconPosition === 'right' && vue.createVNode(IconWrapper, null, _isSlot$6(_slot =
|
|
26809
|
+
}, null), iconPosition === 'right' && vue.createVNode(IconWrapper, null, _isSlot$6(_slot = _this4.renderIcon()) ? _slot : {
|
|
26731
26810
|
"default": function _default() {
|
|
26732
26811
|
return [_slot];
|
|
26733
26812
|
}
|
|
@@ -26739,7 +26818,7 @@
|
|
|
26739
26818
|
"positionType": "absolute"
|
|
26740
26819
|
}, {
|
|
26741
26820
|
"default": function _default() {
|
|
26742
|
-
return [iconPosition === 'left' && vue.createVNode(IconWrapper, null, _isSlot$6(_slot2 =
|
|
26821
|
+
return [iconPosition === 'left' && vue.createVNode(IconWrapper, null, _isSlot$6(_slot2 = _this4.renderIcon()) ? _slot2 : {
|
|
26743
26822
|
"default": function _default() {
|
|
26744
26823
|
return [_slot2];
|
|
26745
26824
|
}
|
|
@@ -26751,7 +26830,7 @@
|
|
|
26751
26830
|
this.handleSendMessage(e);
|
|
26752
26831
|
},
|
|
26753
26832
|
renderEnterButtonElement: function renderEnterButtonElement() {
|
|
26754
|
-
var
|
|
26833
|
+
var _this5 = this;
|
|
26755
26834
|
var _this$$props2 = this.$props,
|
|
26756
26835
|
enterButton = _this$$props2.enterButton,
|
|
26757
26836
|
innerClass = _this$$props2.innerClass;
|
|
@@ -26759,16 +26838,16 @@
|
|
|
26759
26838
|
if (enterButton) {
|
|
26760
26839
|
var getEnterButtonMarkup = function getEnterButtonMarkup() {
|
|
26761
26840
|
if (renderEnterButton) {
|
|
26762
|
-
return renderEnterButton(
|
|
26841
|
+
return renderEnterButton(_this5.enterButtonOnClick);
|
|
26763
26842
|
}
|
|
26764
26843
|
return vue.createVNode(SendButton, {
|
|
26765
26844
|
"primary": true,
|
|
26766
26845
|
"type": "submit",
|
|
26767
26846
|
"tabIndex": 0,
|
|
26768
|
-
"onClick":
|
|
26769
|
-
"onKeyPress":
|
|
26847
|
+
"onClick": _this5.handleSendMessage,
|
|
26848
|
+
"onKeyPress": _this5.handleKeyPress,
|
|
26770
26849
|
"class": "ask-btn " + helper_31(innerClass, 'ai-enter-button'),
|
|
26771
|
-
"disabled":
|
|
26850
|
+
"disabled": _this5.isLoadingState || !_this5.AISessionId
|
|
26772
26851
|
}, {
|
|
26773
26852
|
"default": function _default() {
|
|
26774
26853
|
return [vue.createTextVNode("Send")];
|
|
@@ -26791,10 +26870,10 @@
|
|
|
26791
26870
|
return getComponent(data, this);
|
|
26792
26871
|
},
|
|
26793
26872
|
handleTextAreaHeightChange: function handleTextAreaHeightChange() {
|
|
26794
|
-
var _this$$
|
|
26795
|
-
var textArea = (_this$$
|
|
26796
|
-
var inputWrapper = (_this$$
|
|
26797
|
-
var errorContainer = (_this$$
|
|
26873
|
+
var _this$$refs, _this$$refs$_inputRef, _this$$refs2, _this$$refs2$_inputWr, _this$$refs3;
|
|
26874
|
+
var textArea = (_this$$refs = this.$refs) == null ? void 0 : (_this$$refs$_inputRef = _this$$refs[_inputRef]) == null ? void 0 : _this$$refs$_inputRef.$el;
|
|
26875
|
+
var inputWrapper = (_this$$refs2 = this.$refs) == null ? void 0 : (_this$$refs2$_inputWr = _this$$refs2[_inputWrapperRef]) == null ? void 0 : _this$$refs2$_inputWr.$el;
|
|
26876
|
+
var errorContainer = (_this$$refs3 = this.$refs) == null ? void 0 : _this$$refs3[_errorContainerRef];
|
|
26798
26877
|
if (textArea) {
|
|
26799
26878
|
textArea.style.height = '42px';
|
|
26800
26879
|
var lineHeight = parseInt(getComputedStyle(textArea).lineHeight, 10);
|
|
@@ -26826,21 +26905,20 @@
|
|
|
26826
26905
|
},
|
|
26827
26906
|
render: function render() {
|
|
26828
26907
|
var _slot3;
|
|
26829
|
-
var
|
|
26908
|
+
var _this6 = this;
|
|
26830
26909
|
var props = this.$props;
|
|
26831
26910
|
if (!this.shouldShowComponent) {
|
|
26832
26911
|
return null;
|
|
26833
26912
|
}
|
|
26834
26913
|
return vue.createVNode(Chatbox, {
|
|
26835
|
-
"style": props.style
|
|
26836
|
-
"class": "--ai-chat-box-wrapper"
|
|
26914
|
+
"style": props.style || {}
|
|
26837
26915
|
}, {
|
|
26838
26916
|
"default": function _default() {
|
|
26839
|
-
return [
|
|
26840
|
-
"class": helper_31(
|
|
26917
|
+
return [_this6.$props.title && vue.createVNode(Title, {
|
|
26918
|
+
"class": helper_31(_this6.$props.innerClass, 'title') || ''
|
|
26841
26919
|
}, {
|
|
26842
26920
|
"default": function _default() {
|
|
26843
|
-
return [
|
|
26921
|
+
return [_this6.$props.title];
|
|
26844
26922
|
}
|
|
26845
26923
|
}), vue.createVNode(ChatContainer, {
|
|
26846
26924
|
"class": "--ai-chat-container",
|
|
@@ -26848,33 +26926,33 @@
|
|
|
26848
26926
|
"showInput": props.showInput
|
|
26849
26927
|
}, {
|
|
26850
26928
|
"default": function _default() {
|
|
26851
|
-
return [
|
|
26852
|
-
"themePreset":
|
|
26929
|
+
return [_this6.hasCustomRenderer && vue.createVNode(MessagesContainer, {
|
|
26930
|
+
"themePreset": _this6.themePreset,
|
|
26853
26931
|
"theme": props.theme,
|
|
26854
|
-
"ref":
|
|
26932
|
+
"ref": _this6.$props.innerRef,
|
|
26855
26933
|
"class": "--ai-message-container " + (helper_31(props.innerClass, 'ai-message-container') || '')
|
|
26856
|
-
}, _isSlot$6(_slot3 =
|
|
26934
|
+
}, _isSlot$6(_slot3 = _this6.getComponent()) ? _slot3 : {
|
|
26857
26935
|
"default": function _default() {
|
|
26858
26936
|
return [_slot3];
|
|
26859
26937
|
}
|
|
26860
|
-
}), !
|
|
26861
|
-
"themePreset":
|
|
26938
|
+
}), !_this6.hasCustomRenderer && vue.createVNode(MessagesContainer, {
|
|
26939
|
+
"themePreset": _this6.themePreset,
|
|
26862
26940
|
"theme": props.theme,
|
|
26863
|
-
"ref":
|
|
26941
|
+
"ref": _this6.$props.innerRef,
|
|
26864
26942
|
"class": "--ai-message-container " + (helper_31(props.innerClass, 'ai-message-container') || '')
|
|
26865
26943
|
}, {
|
|
26866
26944
|
"default": function _default() {
|
|
26867
|
-
return [
|
|
26945
|
+
return [_this6.messages.map(function (message, index) {
|
|
26868
26946
|
return vue.createVNode(Message, {
|
|
26869
26947
|
"key": index,
|
|
26870
26948
|
"isSender": message.role === constants_7$1.USER,
|
|
26871
26949
|
"innerHTML": md$1.render(message.content),
|
|
26872
|
-
"themePreset":
|
|
26950
|
+
"themePreset": _this6.themePreset,
|
|
26873
26951
|
"theme": props.theme,
|
|
26874
26952
|
"class": "--ai-answer-message " + (helper_31(props.innerClass, 'ai-message') || '')
|
|
26875
26953
|
}, null);
|
|
26876
|
-
}),
|
|
26877
|
-
"themePreset":
|
|
26954
|
+
}), _this6.isLoadingState && vue.createVNode(Message, {
|
|
26955
|
+
"themePreset": _this6.themePreset,
|
|
26878
26956
|
"theme": props.theme,
|
|
26879
26957
|
"isSender": false,
|
|
26880
26958
|
"class": "--ai-answer-message " + (helper_31(props.innerClass, 'ai-message') || null)
|
|
@@ -26883,31 +26961,31 @@
|
|
|
26883
26961
|
return [vue.createVNode(TypingIndicator, null, {
|
|
26884
26962
|
"default": function _default() {
|
|
26885
26963
|
return [vue.createVNode(TypingDot, {
|
|
26886
|
-
"themePreset":
|
|
26964
|
+
"themePreset": _this6.themePreset
|
|
26887
26965
|
}, null), vue.createVNode(TypingDot, {
|
|
26888
|
-
"themePreset":
|
|
26966
|
+
"themePreset": _this6.themePreset
|
|
26889
26967
|
}, null), vue.createVNode(TypingDot, {
|
|
26890
|
-
"themePreset":
|
|
26968
|
+
"themePreset": _this6.themePreset
|
|
26891
26969
|
}, null)];
|
|
26892
26970
|
}
|
|
26893
26971
|
})];
|
|
26894
26972
|
}
|
|
26895
26973
|
})];
|
|
26896
26974
|
}
|
|
26897
|
-
}),
|
|
26975
|
+
}), _this6.renderErrorComponent(), ' ', props.showFeedback && vue.createVNode("div", {
|
|
26898
26976
|
"class": "--ai-answer-feedback-container " + (helper_31(props.innerClass, 'ai-feedback') || '')
|
|
26899
26977
|
}, [vue.createVNode(AIFeedback, {
|
|
26900
|
-
"hideUI":
|
|
26901
|
-
"key":
|
|
26978
|
+
"hideUI": _this6.isLoadingState || !_this6.sessionId,
|
|
26979
|
+
"key": _this6.sessionId,
|
|
26902
26980
|
"onFeedbackSubmit": function onFeedbackSubmit(useful, reason) {
|
|
26903
|
-
|
|
26981
|
+
_this6.trackUsefullness(_this6.sessionId, {
|
|
26904
26982
|
useful: useful,
|
|
26905
26983
|
reason: reason
|
|
26906
26984
|
});
|
|
26907
26985
|
}
|
|
26908
26986
|
}, null)]), props.showInput && vue.createVNode(MessageInputContainer, {
|
|
26909
26987
|
"class": "--ai-input-container",
|
|
26910
|
-
"onSubmit":
|
|
26988
|
+
"onSubmit": _this6.handleSendMessage
|
|
26911
26989
|
}, {
|
|
26912
26990
|
"default": function _default() {
|
|
26913
26991
|
return [vue.createVNode(InputGroup, {
|
|
@@ -26921,23 +26999,21 @@
|
|
|
26921
26999
|
"default": function _default() {
|
|
26922
27000
|
return [vue.createVNode(MessageInput, {
|
|
26923
27001
|
"ref": _inputRef,
|
|
26924
|
-
"type": "text",
|
|
26925
27002
|
"placeholder": props.placeholder,
|
|
26926
27003
|
"enterButton": props.enterButton,
|
|
26927
|
-
"value":
|
|
26928
|
-
"onInput":
|
|
26929
|
-
"onKeyPress": _this4.handleKeyPress,
|
|
27004
|
+
"value": _this6.inputMessage,
|
|
27005
|
+
"onInput": _this6.handleMessageInputChange,
|
|
26930
27006
|
"id": props.componentId + "-ai-input",
|
|
26931
27007
|
"showIcon": props.showIcon,
|
|
26932
27008
|
"iconPosition": props.iconPosition,
|
|
26933
|
-
"themePreset":
|
|
26934
|
-
"disabled":
|
|
27009
|
+
"themePreset": _this6.themePreset,
|
|
27010
|
+
"disabled": _this6.isLoadingState || !_this6.AISessionId,
|
|
26935
27011
|
"class": helper_31(props.innerClass, 'ai-input') || null
|
|
26936
|
-
}, null), ' ',
|
|
27012
|
+
}, null), ' ', _this6.renderIcons()];
|
|
26937
27013
|
}
|
|
26938
27014
|
})];
|
|
26939
27015
|
}
|
|
26940
|
-
}),
|
|
27016
|
+
}), _this6.renderEnterButtonElement()];
|
|
26941
27017
|
}
|
|
26942
27018
|
}), ' '];
|
|
26943
27019
|
}
|
|
@@ -26964,12 +27040,14 @@
|
|
|
26964
27040
|
rawData: state.rawData[props.componentId],
|
|
26965
27041
|
themePreset: state.config.themePreset,
|
|
26966
27042
|
isLoading: state.isLoading[props.componentId] || false,
|
|
26967
|
-
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || ''
|
|
27043
|
+
sessionIdFromStore: state.AIResponses[props.componentId] && state.AIResponses[props.componentId].response && state.AIResponses[props.componentId].response.sessionId || '',
|
|
27044
|
+
componentError: state.error[props.componentId]
|
|
26968
27045
|
};
|
|
26969
27046
|
};
|
|
26970
27047
|
var mapDispatchToProps$3 = {
|
|
26971
27048
|
getAIResponse: query_7,
|
|
26972
|
-
trackUsefullness: analytics_8
|
|
27049
|
+
trackUsefullness: analytics_8,
|
|
27050
|
+
createAISession: query_8
|
|
26973
27051
|
};
|
|
26974
27052
|
var AIConnected = PreferencesConsumer(ComponentWrapper$1(connect(mapStateToProps$4, mapDispatchToProps$3)(AIAnswer), {
|
|
26975
27053
|
componentType: constants_1$1.AIAnswer,
|
|
@@ -39950,7 +40028,7 @@
|
|
|
39950
40028
|
}, queryString, renderFunction);
|
|
39951
40029
|
}
|
|
39952
40030
|
|
|
39953
|
-
var version = "3.0.0-rc.6.
|
|
40031
|
+
var version = "3.0.0-rc.6.5";
|
|
39954
40032
|
|
|
39955
40033
|
var components = [RLConnected, ResultCard, ResultList, ReactiveBase, SBConnected, ListConnected, ListConnected$1, RangeConnected$1, RangeConnected$2, RangeConnected$3, RangeConnected, RcConnected, RcConnected$1, RcConnected$2, TBConnected, ListConnected$2, ListConnected$3, StateProviderConnected, RangeConnected$4, TreeListConnected, AIConnected];
|
|
39956
40034
|
function install$1 (Vue) {
|