react-autoql 3.4.6 → 3.4.7

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.
@@ -11,7 +11,7 @@ import _regeneratorRuntime from '@babel/runtime/regenerator';
11
11
  import PropTypes, { shape, string, number, bool, oneOf, arrayOf, func, instanceOf, oneOfType, array } from 'prop-types';
12
12
  import { BsArrowBarDown, BsArrowBarUp } from 'react-icons/bs';
13
13
  import { BiLineChart } from 'react-icons/bi';
14
- import { MdError, MdPlayCircleOutline, MdLock, MdInfoOutline, MdContentCopy, MdClose } from 'react-icons/md';
14
+ import { MdError, MdLockOpen, MdPlayCircleOutline, MdLock, MdInfoOutline, MdContentCopy, MdClose } from 'react-icons/md';
15
15
  import { FiAlertTriangle, FiTrash2, FiSettings, FiSend, FiPlus, FiPauseCircle, FiBellOff, FiBell, FiMoreHorizontal, FiMoreVertical, FiFilter, FiEye, FiDownload, FiDatabase, FiCheck, FiCalendar, FiArrowLeft } from 'react-icons/fi';
16
16
  import { IoIosSearch, IoIosHourglass, IoIosGlobe, IoIosCloseCircleOutline } from 'react-icons/io';
17
17
  import { TiSortNumerically } from 'react-icons/ti';
@@ -34,7 +34,7 @@ import disableScroll from 'disable-scroll';
34
34
  import HTMLRenderer from 'react-html-renderer';
35
35
  import { scaleOrdinal, scaleBand, scaleLinear } from 'd3-scale';
36
36
  import Autosuggest from 'react-autosuggest';
37
- import RecordRTC, { StereoAudioRecorder } from 'recordrtc';
37
+ import SpeechRecognition from 'react-speech-recognition';
38
38
  import { ReactTabulator } from 'react-tabulator';
39
39
  import 'react-tabulator/lib/styles.css';
40
40
  import 'react-tabulator/css/bootstrap/tabulator_bootstrap.min.css';
@@ -57,7 +57,7 @@ import RGL, { WidthProvider } from 'react-grid-layout';
57
57
  import SplitterLayout from 'react-splitter-layout';
58
58
  import 'react-grid-layout/css/styles.css';
59
59
  import 'react-splitter-layout/lib/index.css';
60
- import SpeechRecognition from 'react-speech-recognition';
60
+ import RecordRTC, { StereoAudioRecorder } from 'recordrtc';
61
61
 
62
62
  function ownKeys(object, enumerableOnly) {
63
63
  var keys = Object.keys(object);
@@ -2514,6 +2514,12 @@ var Icon = /*#__PURE__*/function (_React$Component) {
2514
2514
  break;
2515
2515
  }
2516
2516
 
2517
+ case 'unlock':
2518
+ {
2519
+ icon = /*#__PURE__*/React.createElement(MdLockOpen, null);
2520
+ break;
2521
+ }
2522
+
2517
2523
  case 'warning':
2518
2524
  {
2519
2525
  icon = /*#__PURE__*/React.createElement(MdError, null);
@@ -2715,12 +2721,7 @@ var runQueryOnly = function runQueryOnly() {
2715
2721
  source = _ref4.source,
2716
2722
  AutoAEId = _ref4.AutoAEId;
2717
2723
 
2718
- var url; // if(window.location.href.includes('localhost') || window.location.href.includes('chata-ai-test-page')) {
2719
- // url = `${domain}/autoql/api/v2/query?key=${apiKey}`
2720
- // } else {
2721
-
2722
- url = "".concat(domain, "/autoql/api/v1/query?key=").concat(apiKey); // }
2723
-
2724
+ var url = "".concat(domain, "/autoql/api/v1/query?key=").concat(apiKey);
2724
2725
  var finalUserSelection = transformUserSelection(userSelection);
2725
2726
  var data = {
2726
2727
  text: query,
@@ -3861,19 +3862,12 @@ var QueryInput = /*#__PURE__*/function (_React$Component) {
3861
3862
  type: "react-autoql-bubbles-outlined"
3862
3863
  })), _this.props.showLoadingDots && _this.state.isQueryRunning && /*#__PURE__*/React.createElement("div", {
3863
3864
  className: "input-response-loading-container"
3864
- }, /*#__PURE__*/React.createElement(LoadingDots, null)), _this.props.enableVoiceRecord && /*#__PURE__*/React.createElement(SpeechToTextBtn, {
3865
+ }, /*#__PURE__*/React.createElement(LoadingDots, null)), _this.props.enableVoiceRecord && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(SpeechToTextButtonBrowser, {
3865
3866
  onTranscriptChange: _this.onTranscriptChange,
3866
3867
  onFinalTranscript: _this.onFinalTranscript,
3867
3868
  themeConfig: _this.props.themeConfig,
3868
3869
  authentication: getAuthentication(_this.props.authentication)
3869
- }) // KEEP THIS FOR NOW
3870
- // <SpeechToTextButtonBrowser
3871
- // onTranscriptChange={this.onTranscriptChange}
3872
- // onFinalTranscript={this.onFinalTranscript}
3873
- // themeConfig={this.props.themeConfig}
3874
- // authentication={getAuthentication(this.props.authentication)}
3875
- // />
3876
- ));
3870
+ }))));
3877
3871
  });
3878
3872
 
3879
3873
  return _this;
@@ -19135,12 +19129,13 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19135
19129
  hasError: true
19136
19130
  });
19137
19131
  } // WIP
19138
- // fetchConditions({ ...getAuthentication(this.props.authentication) }).then(
19139
- // (response) => {
19140
- // this.setState({ conditions: _get(response, 'data.data.data') })
19141
- // }
19142
- // )
19143
19132
 
19133
+
19134
+ fetchConditions(_objectSpread2({}, getAuthentication(_this.props.authentication))).then(function (response) {
19135
+ _this.setState({
19136
+ conditions: _get(response, 'data.data.data')
19137
+ });
19138
+ });
19144
19139
  });
19145
19140
 
19146
19141
  _defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps, prevState) {
@@ -19737,32 +19732,37 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19737
19732
 
19738
19733
  _defineProperty(_assertThisInitialized(_this), "renderOptionsDropdown", function () {
19739
19734
  if (_this.state.activePage === 'data-messenger') {
19740
- return /*#__PURE__*/React.createElement(Popover, {
19735
+ return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
19736
+ id: "condition-dropdown",
19737
+ style: {
19738
+ justifyContent: 'left',
19739
+ position: 'absolute',
19740
+ right: 30
19741
+ }
19742
+ }, window.location.href.includes('localhost') || window.location.href.includes('chata-ai-test-page') ? /*#__PURE__*/React.createElement("button", {
19743
+ id: "condition-dropdown",
19744
+ onClick: function onClick() {
19745
+ _this.setState({
19746
+ isConditionLockingMenuOpen: !_this.state.isConditionLockingMenuOpen
19747
+ });
19748
+ },
19749
+ className: "react-autoql-drawer-header-btn clear-all",
19750
+ "data-tip": lang.dataMessengerOptions,
19751
+ "data-for": "react-autoql-header-tooltip"
19752
+ }, /*#__PURE__*/React.createElement(Icon, {
19753
+ type: _get(_this.state.conditions, 'length') > 0 ? "lock" : "unlock"
19754
+ })) : /*#__PURE__*/React.createElement("span", null)), /*#__PURE__*/React.createElement(Popover, {
19741
19755
  isOpen: _this.state.isOptionsDropdownOpen,
19742
19756
  onClickOutside: function onClickOutside() {
19743
- return _this.setState({
19757
+ console.log(_this.state.isOptionsDropdownOpen);
19758
+
19759
+ _this.setState({
19744
19760
  isOptionsDropdownOpen: false
19745
19761
  });
19746
19762
  },
19747
19763
  position: "bottom" // preferred position
19748
19764
  ,
19749
- content: /*#__PURE__*/React.createElement("div", null, window.location.href.includes('chata-ai-test-page') && /*#__PURE__*/React.createElement("div", {
19750
- className: "clear-messages-confirm-popover"
19751
- }, /*#__PURE__*/React.createElement("div", {
19752
- className: "react-autoql-menu-text",
19753
- onClick: function onClick() {
19754
- _this.setState({
19755
- isConditionLockingMenuOpen: true,
19756
- isOptionsDropdownOpen: false
19757
- });
19758
- }
19759
- }, /*#__PURE__*/React.createElement(Icon, {
19760
- type: "lock"
19761
- }), /*#__PURE__*/React.createElement("span", {
19762
- style: {
19763
- marginLeft: 5
19764
- }
19765
- }, lang.openConditionLocking))), /*#__PURE__*/React.createElement("div", {
19765
+ content: /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("div", {
19766
19766
  className: "clear-messages-confirm-popover"
19767
19767
  }, /*#__PURE__*/React.createElement("div", {
19768
19768
  className: "react-autoql-menu-text",
@@ -19804,7 +19804,7 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19804
19804
  "data-for": "react-autoql-header-tooltip"
19805
19805
  }, /*#__PURE__*/React.createElement(Icon, {
19806
19806
  type: "trash"
19807
- })));
19807
+ }))));
19808
19808
  }
19809
19809
  });
19810
19810
 
@@ -19841,11 +19841,11 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19841
19841
  className: "react-autoql-header-left-container"
19842
19842
  }, /*#__PURE__*/React.createElement("button", {
19843
19843
  onClick: function onClick() {
19844
- _this.props.onHandleClick();
19845
-
19846
19844
  _this.setState({
19847
19845
  isConditionLockingMenuOpen: false
19848
19846
  });
19847
+
19848
+ _this.props.onHandleClick();
19849
19849
  },
19850
19850
  className: "react-autoql-drawer-header-btn close",
19851
19851
  "data-tip": lang.closeDataMessenger,
@@ -19855,17 +19855,15 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19855
19855
  }))), /*#__PURE__*/React.createElement(Popover, {
19856
19856
  containerStyle: _this.getConditionMenuPosition(),
19857
19857
  isOpen: _this.state.isConditionLockingMenuOpen,
19858
- onClickOutside: function onClickOutside(e) {
19859
- if (_get(e, 'target.innerText') !== lang.openConditionLocking && !_includes(_get(e, 'target.className'), 'react-autosuggest__suggestion') && !_includes(_get(e, 'target.className'), 'condition-list-container')) {
19860
- _this.setState({
19861
- isConditionLockingMenuOpen: false
19862
- });
19863
- }
19864
- },
19865
19858
  position: "bottom",
19866
19859
  padding: 2,
19867
19860
  align: "center",
19868
- content: /*#__PURE__*/React.createElement(ConditionLockMenu, {
19861
+ content: /*#__PURE__*/React.createElement("div", {
19862
+ id: "condition-menu-dropdown",
19863
+ style: {
19864
+ display: 'block'
19865
+ }
19866
+ }, /*#__PURE__*/React.createElement(ConditionLockMenu, {
19869
19867
  authentication: getAuthentication(getAuthentication(_this.props.authentication)),
19870
19868
  containerWidth: _this.getDrawerWidth(),
19871
19869
  isOpen: _this.state.isConditionLockingMenuOpen,
@@ -19882,7 +19880,7 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19882
19880
  isConditionLockingMenuOpen: false
19883
19881
  });
19884
19882
  }
19885
- })
19883
+ }))
19886
19884
  }, /*#__PURE__*/React.createElement("div", {
19887
19885
  className: "react-autoql-header-center-container"
19888
19886
  }, _this.renderHeaderTitle(), _this.renderShowSuccessMessage())), /*#__PURE__*/React.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-autoql",
3
- "version": "3.4.6",
3
+ "version": "3.4.7",
4
4
  "description": "React Widget Library",
5
5
  "main": "dist/autoql.cjs.js",
6
6
  "module": "dist/autoql.esm.js",