@appbaseio/reactivesearch-vue 3.0.1 → 3.0.3

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/index.js CHANGED
@@ -34,7 +34,7 @@ var ReactiveBase = require('./ReactiveBase.js');
34
34
  require('hotkeys-js');
35
35
  require('xss');
36
36
  require('remarkable');
37
- var install = require('./install-5d1a97a5.js');
37
+ var install = require('./install-aa24bd30.js');
38
38
  require('./DropDown-26666911.js');
39
39
  require('./Input-3ecdb905.js');
40
40
  require('compute-scroll-into-view');
@@ -809,7 +809,7 @@ var HorizontalSkeletonLoader = vue.defineComponent({
809
809
 
810
810
  var _templateObject$7, _templateObject2$2, _templateObject3$1, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
811
811
  var Chatbox = vueEmotion.styled('div')(_templateObject$7 || (_templateObject$7 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tposition: relative;\n\tmargin: 0 auto;\n\tpadding: 10px;\n\tbackground-color: #fafafa;\n\twidth: 100%;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 0px 6px;\n\tborder-radius: 6px;\n\tmargin-bottom: 20px;\n\tbackground-color: ", ";\n\n\t.--trigger-message-wrapper {\n\t\tcursor: pointer;\n\t}\n"])), function (props) {
812
- return props.theme && props.theme.colors ? polished.lighten(0.1, props.theme.colors.backgroundColor) : '#fff';
812
+ return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? polished.lighten(0.1, props.theme.colors.backgroundColor) : '#fff';
813
813
  });
814
814
  var ChatContainer = vueEmotion.styled('div')(_templateObject2$2 || (_templateObject2$2 = _rollupPluginBabelHelpers._taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tposition: relative;\n\t.--ai-answer-error-container {\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tbottom: 0px;\n\t\t", ";\n\t\tz-index: 1;\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\twidth: 100%;\n\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tpadding: 10px;\n\t\t\tbackground-color: ", ";\n\t\t\tbox-shadow: 0 -5px 5px -2px\n\t\t\t\t", ";\n\n\t\t\tspan {\n\t\t\t\tmargin-bottom: 5px;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t}\n\t\t}\n\t}\n\n\t", ";\n"])), function (props) {
815
815
  return props.showInput ? 'bottom: 48px;' : '';
@@ -1313,14 +1313,22 @@ var SearchBox = vue.defineComponent({
1313
1313
  mounted: function mounted() {
1314
1314
  this.listenForFocusShortcuts();
1315
1315
  },
1316
+ updated: function updated() {
1317
+ if (this.$props.mode === constants.SEARCH_COMPONENTS_MODES.SELECT && this.$options.isTagsMode === true) {
1318
+ this.$options.isTagsMode = false;
1319
+ this.selectedTags = [];
1320
+ } else if (this.$props.mode === constants.SEARCH_COMPONENTS_MODES.TAG && this.$options.isTagsMode === false) {
1321
+ this.$options.isTagsMode = true;
1322
+ }
1323
+ },
1316
1324
  watch: {
1317
1325
  AIResponse: function AIResponse(newVal) {
1318
1326
  if (newVal) {
1319
1327
  if (this.$props.AIUIConfig && this.$props.AIUIConfig.showSourceDocuments && newVal.response && newVal.response.answer && Array.isArray(newVal.response.answer.documentIds)) {
1320
1328
  this.sourceDocIds = newVal.response.answer.documentIds;
1321
1329
  var localCache = helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY) && helper.getObjectFromLocalStorage(constants.AI_LOCAL_CACHE_KEY)[this.$props.componentId];
1322
- if (localCache && localCache.meta && localCache.meta.hits) {
1323
- this.initialHits = localCache.meta.hits;
1330
+ if (localCache && localCache.meta && localCache.meta.hits && localCache.meta.hits.hits) {
1331
+ this.initialHits = localCache.meta.hits.hits;
1324
1332
  }
1325
1333
  }
1326
1334
  }
@@ -2937,12 +2945,11 @@ var AIAnswer = vue.defineComponent({
2937
2945
  message: response.error
2938
2946
  };
2939
2947
  }
2940
-
2941
2948
  // pushing message history so far
2942
2949
  if (messagesHistory && Array.isArray(messagesHistory)) {
2943
2950
  finalMessages.push.apply(finalMessages, messagesHistory.filter(function (msg) {
2944
2951
  return msg.role !== constants.AI_ROLES.SYSTEM;
2945
- }));
2952
+ }).slice(1));
2946
2953
  } else if (response && response.answer && response.answer.text) {
2947
2954
  finalMessages.push({
2948
2955
  role: constants.AI_ROLES.ASSISTANT,
@@ -34,7 +34,7 @@ require('./ReactiveBase.js');
34
34
  require('hotkeys-js');
35
35
  require('xss');
36
36
  require('remarkable');
37
- var install = require('./install-5d1a97a5.js');
37
+ var install = require('./install-aa24bd30.js');
38
38
  require('./DropDown-26666911.js');
39
39
  require('./Input-3ecdb905.js');
40
40
  require('compute-scroll-into-view');
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var version = "3.0.1";
5
+ var version = "3.0.3";
6
6
 
7
7
  exports.default = version;
package/dist/es/index.js CHANGED
@@ -30,8 +30,8 @@ export { default as ReactiveBase } from './ReactiveBase.js';
30
30
  import 'hotkeys-js';
31
31
  import 'xss';
32
32
  import 'remarkable';
33
- import { i as install } from './install-01aaa4e0.js';
34
- export { A as AIAnswer, R as ReactiveComponentPrivate, S as SearchBox, T as TreeList, i as install } from './install-01aaa4e0.js';
33
+ import { i as install } from './install-37ef0fb5.js';
34
+ export { A as AIAnswer, R as ReactiveComponentPrivate, S as SearchBox, T as TreeList, i as install } from './install-37ef0fb5.js';
35
35
  import './DropDown-48045fde.js';
36
36
  import './Input-83dee8c5.js';
37
37
  import 'compute-scroll-into-view';
@@ -805,7 +805,7 @@ var HorizontalSkeletonLoader = defineComponent({
805
805
 
806
806
  var _templateObject$7, _templateObject2$2, _templateObject3$1, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11;
807
807
  var Chatbox = styled('div')(_templateObject$7 || (_templateObject$7 = _taggedTemplateLiteralLoose(["\n\tposition: relative;\n\tmargin: 0 auto;\n\tpadding: 10px;\n\tbackground-color: #fafafa;\n\twidth: 100%;\n\tbox-shadow: rgb(0 0 0 / 20%) 0px 0px 6px;\n\tborder-radius: 6px;\n\tmargin-bottom: 20px;\n\tbackground-color: ", ";\n\n\t.--trigger-message-wrapper {\n\t\tcursor: pointer;\n\t}\n"])), function (props) {
808
- return props.theme && props.theme.colors ? lighten(0.1, props.theme.colors.backgroundColor) : '#fff';
808
+ return props.theme && props.theme.colors && props.theme.colors.backgroundColor ? lighten(0.1, props.theme.colors.backgroundColor) : '#fff';
809
809
  });
810
810
  var ChatContainer = styled('div')(_templateObject2$2 || (_templateObject2$2 = _taggedTemplateLiteralLoose(["\n\tdisplay: flex;\n\tflex-direction: column;\n\theight: 100%;\n\tposition: relative;\n\t.--ai-answer-error-container {\n\t\ttext-align: center;\n\t\tposition: absolute;\n\t\tbottom: 0px;\n\t\t", ";\n\t\tz-index: 1;\n\t\tleft: 50%;\n\t\ttransform: translateX(-50%);\n\t\twidth: 100%;\n\n\t\t.--default-error-element {\n\t\t\tdisplay: flex;\n\t\t\tflex-direction: column;\n\t\t\talign-items: center;\n\t\t\tpadding: 10px;\n\t\t\tbackground-color: ", ";\n\t\t\tbox-shadow: 0 -5px 5px -2px\n\t\t\t\t", ";\n\n\t\t\tspan {\n\t\t\t\tmargin-bottom: 5px;\n\t\t\t}\n\n\t\t\tbutton {\n\t\t\t}\n\t\t}\n\t}\n\n\t", ";\n"])), function (props) {
811
811
  return props.showInput ? 'bottom: 48px;' : '';
@@ -1309,14 +1309,22 @@ var SearchBox = defineComponent({
1309
1309
  mounted: function mounted() {
1310
1310
  this.listenForFocusShortcuts();
1311
1311
  },
1312
+ updated: function updated() {
1313
+ if (this.$props.mode === SEARCH_COMPONENTS_MODES.SELECT && this.$options.isTagsMode === true) {
1314
+ this.$options.isTagsMode = false;
1315
+ this.selectedTags = [];
1316
+ } else if (this.$props.mode === SEARCH_COMPONENTS_MODES.TAG && this.$options.isTagsMode === false) {
1317
+ this.$options.isTagsMode = true;
1318
+ }
1319
+ },
1312
1320
  watch: {
1313
1321
  AIResponse: function AIResponse(newVal) {
1314
1322
  if (newVal) {
1315
1323
  if (this.$props.AIUIConfig && this.$props.AIUIConfig.showSourceDocuments && newVal.response && newVal.response.answer && Array.isArray(newVal.response.answer.documentIds)) {
1316
1324
  this.sourceDocIds = newVal.response.answer.documentIds;
1317
1325
  var localCache = getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY) && getObjectFromLocalStorage(AI_LOCAL_CACHE_KEY)[this.$props.componentId];
1318
- if (localCache && localCache.meta && localCache.meta.hits) {
1319
- this.initialHits = localCache.meta.hits;
1326
+ if (localCache && localCache.meta && localCache.meta.hits && localCache.meta.hits.hits) {
1327
+ this.initialHits = localCache.meta.hits.hits;
1320
1328
  }
1321
1329
  }
1322
1330
  }
@@ -2933,12 +2941,11 @@ var AIAnswer = defineComponent({
2933
2941
  message: response.error
2934
2942
  };
2935
2943
  }
2936
-
2937
2944
  // pushing message history so far
2938
2945
  if (messagesHistory && Array.isArray(messagesHistory)) {
2939
2946
  finalMessages.push.apply(finalMessages, messagesHistory.filter(function (msg) {
2940
2947
  return msg.role !== AI_ROLES.SYSTEM;
2941
- }));
2948
+ }).slice(1));
2942
2949
  } else if (response && response.answer && response.answer.text) {
2943
2950
  finalMessages.push({
2944
2951
  role: AI_ROLES.ASSISTANT,
@@ -30,7 +30,7 @@ import './ReactiveBase.js';
30
30
  import 'hotkeys-js';
31
31
  import 'xss';
32
32
  import 'remarkable';
33
- export { i as default } from './install-01aaa4e0.js';
33
+ export { i as default } from './install-37ef0fb5.js';
34
34
  import './DropDown-48045fde.js';
35
35
  import './Input-83dee8c5.js';
36
36
  import 'compute-scroll-into-view';
@@ -1,3 +1,3 @@
1
- var version = "3.0.1";
1
+ var version = "3.0.3";
2
2
 
3
3
  export default version;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appbaseio/reactivesearch-vue",
3
- "version": "3.0.1",
3
+ "version": "3.0.3",
4
4
  "private": false,
5
5
  "main": "dist/cjs/index.js",
6
6
  "jsnext:main": "dist/es/index.js",