react-autoql 3.4.3 → 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,7 +2721,7 @@ var runQueryOnly = function runQueryOnly() {
2715
2721
  source = _ref4.source,
2716
2722
  AutoAEId = _ref4.AutoAEId;
2717
2723
 
2718
- var url = "".concat(domain, "/autoql/api/v2/query?key=").concat(apiKey);
2724
+ var url = "".concat(domain, "/autoql/api/v1/query?key=").concat(apiKey);
2719
2725
  var finalUserSelection = transformUserSelection(userSelection);
2720
2726
  var data = {
2721
2727
  text: query,
@@ -3856,19 +3862,12 @@ var QueryInput = /*#__PURE__*/function (_React$Component) {
3856
3862
  type: "react-autoql-bubbles-outlined"
3857
3863
  })), _this.props.showLoadingDots && _this.state.isQueryRunning && /*#__PURE__*/React.createElement("div", {
3858
3864
  className: "input-response-loading-container"
3859
- }, /*#__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, {
3860
3866
  onTranscriptChange: _this.onTranscriptChange,
3861
3867
  onFinalTranscript: _this.onFinalTranscript,
3862
3868
  themeConfig: _this.props.themeConfig,
3863
3869
  authentication: getAuthentication(_this.props.authentication)
3864
- }) // KEEP THIS FOR NOW
3865
- // <SpeechToTextButtonBrowser
3866
- // onTranscriptChange={this.onTranscriptChange}
3867
- // onFinalTranscript={this.onFinalTranscript}
3868
- // themeConfig={this.props.themeConfig}
3869
- // authentication={getAuthentication(this.props.authentication)}
3870
- // />
3871
- ));
3870
+ }))));
3872
3871
  });
3873
3872
 
3874
3873
  return _this;
@@ -11994,7 +11993,7 @@ var validateExpression = function validateExpression(_ref20) {
11994
11993
  });
11995
11994
  }; // DELETE
11996
11995
 
11997
- var deleteDataAlert = function deleteDataAlert(dataAlertId, projectId, authObject) {
11996
+ var deleteDataAlert = function deleteDataAlert(dataAlertId, authObject) {
11998
11997
  // If there is missing data, dont bother making the call
11999
11998
  var domain = authObject.domain,
12000
11999
  apiKey = authObject.apiKey,
@@ -12069,9 +12068,11 @@ var NotificationIcon = /*#__PURE__*/function (_React$Component) {
12069
12068
  while (1) {
12070
12069
  switch (_context.prev = _context.next) {
12071
12070
  case 0:
12072
- _this._isMounted = true; // this.subscribeToNotificationCount()
12071
+ _this._isMounted = true;
12073
12072
 
12074
- case 1:
12073
+ _this.subscribeToNotificationCount();
12074
+
12075
+ case 2:
12075
12076
  case "end":
12076
12077
  return _context.stop();
12077
12078
  }
@@ -14356,13 +14357,13 @@ var DataAlertModal = /*#__PURE__*/function (_React$Component) {
14356
14357
  isDeletingDataAlert: true
14357
14358
  });
14358
14359
 
14359
- deleteDataAlert(dataAlertId, _this.props.activeAlertType, _this.props.authObject).then(function () {
14360
+ deleteDataAlert(dataAlertId, getAuthentication(_this.props.authentication)).then(function () {
14360
14361
  _this.setState({
14361
14362
  isDeletingDataAlert: false,
14362
14363
  isConfirmDeleteModalVisible: false
14363
14364
  });
14364
14365
 
14365
- _this.props.handleAlertDeletedByWidget();
14366
+ _this.props.onDelete(dataAlertId);
14366
14367
 
14367
14368
  _this.props.onClose(false);
14368
14369
  }).catch(function (error) {
@@ -14939,7 +14940,7 @@ var DataAlerts = /*#__PURE__*/function (_React$Component) {
14939
14940
  _this.getDataAlerts();
14940
14941
  }
14941
14942
 
14942
- if (!_isEqual(_this.state.projectAlertsList, prevState.projectAlertsList)) {
14943
+ if (!_isEqual(_this.state.projectAlertsList, prevState.projectAlertsList) || !_isEqual(_this.state.customAlertsList, prevState.customAlertsList)) {
14943
14944
  _this.getDataAlerts();
14944
14945
  }
14945
14946
  });
@@ -15117,7 +15118,6 @@ var DataAlerts = /*#__PURE__*/function (_React$Component) {
15117
15118
  });
15118
15119
 
15119
15120
  _defineProperty(_assertThisInitialized(_this), "hasError", function (dataAlert) {
15120
- console.log(dataAlert);
15121
15121
  return dataAlert.status === 'GENERAL_ERROR' || dataAlert.status === 'EVALUATION_ERROR' || dataAlert.status === 'DATA_RETURN_ERROR';
15122
15122
  });
15123
15123
 
@@ -19129,13 +19129,13 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19129
19129
  hasError: true
19130
19130
  });
19131
19131
  } // WIP
19132
- // fetchConditions({ ...getAuthentication(this.props.authentication) }).then(
19133
- // (response) => {
19134
- // console.log(_get(response, 'data.data.data'))
19135
- // this.setState({ conditions: _get(response, 'data.data.data') })
19136
- // }
19137
- // )
19138
19132
 
19133
+
19134
+ fetchConditions(_objectSpread2({}, getAuthentication(_this.props.authentication))).then(function (response) {
19135
+ _this.setState({
19136
+ conditions: _get(response, 'data.data.data')
19137
+ });
19138
+ });
19139
19139
  });
19140
19140
 
19141
19141
  _defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function (prevProps, prevState) {
@@ -19732,10 +19732,31 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19732
19732
 
19733
19733
  _defineProperty(_assertThisInitialized(_this), "renderOptionsDropdown", function () {
19734
19734
  if (_this.state.activePage === 'data-messenger') {
19735
- 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, {
19736
19755
  isOpen: _this.state.isOptionsDropdownOpen,
19737
19756
  onClickOutside: function onClickOutside() {
19738
- return _this.setState({
19757
+ console.log(_this.state.isOptionsDropdownOpen);
19758
+
19759
+ _this.setState({
19739
19760
  isOptionsDropdownOpen: false
19740
19761
  });
19741
19762
  },
@@ -19782,8 +19803,8 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19782
19803
  "data-tip": lang.dataMessengerOptions,
19783
19804
  "data-for": "react-autoql-header-tooltip"
19784
19805
  }, /*#__PURE__*/React.createElement(Icon, {
19785
- type: "menu"
19786
- })));
19806
+ type: "trash"
19807
+ }))));
19787
19808
  }
19788
19809
  });
19789
19810
 
@@ -19820,11 +19841,11 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19820
19841
  className: "react-autoql-header-left-container"
19821
19842
  }, /*#__PURE__*/React.createElement("button", {
19822
19843
  onClick: function onClick() {
19823
- _this.props.onHandleClick();
19824
-
19825
19844
  _this.setState({
19826
19845
  isConditionLockingMenuOpen: false
19827
19846
  });
19847
+
19848
+ _this.props.onHandleClick();
19828
19849
  },
19829
19850
  className: "react-autoql-drawer-header-btn close",
19830
19851
  "data-tip": lang.closeDataMessenger,
@@ -19834,17 +19855,15 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19834
19855
  }))), /*#__PURE__*/React.createElement(Popover, {
19835
19856
  containerStyle: _this.getConditionMenuPosition(),
19836
19857
  isOpen: _this.state.isConditionLockingMenuOpen,
19837
- onClickOutside: function onClickOutside(e) {
19838
- if (_get(e, 'target.innerText') !== lang.openConditionLocking && !_includes(_get(e, 'target.className'), 'react-autosuggest__suggestion') && !_includes(_get(e, 'target.className'), 'condition-list-container')) {
19839
- _this.setState({
19840
- isConditionLockingMenuOpen: false
19841
- });
19842
- }
19843
- },
19844
19858
  position: "bottom",
19845
19859
  padding: 2,
19846
19860
  align: "center",
19847
- 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, {
19848
19867
  authentication: getAuthentication(getAuthentication(_this.props.authentication)),
19849
19868
  containerWidth: _this.getDrawerWidth(),
19850
19869
  isOpen: _this.state.isConditionLockingMenuOpen,
@@ -19861,7 +19880,7 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19861
19880
  isConditionLockingMenuOpen: false
19862
19881
  });
19863
19882
  }
19864
- })
19883
+ }))
19865
19884
  }, /*#__PURE__*/React.createElement("div", {
19866
19885
  className: "react-autoql-header-center-container"
19867
19886
  }, _this.renderHeaderTitle(), _this.renderShowSuccessMessage())), /*#__PURE__*/React.createElement("div", {
@@ -19955,26 +19974,7 @@ var DataMessenger = /*#__PURE__*/function (_React$Component) {
19955
19974
  className: "response-loading"
19956
19975
  }, /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null), /*#__PURE__*/React.createElement("div", null))), /*#__PURE__*/React.createElement("div", {
19957
19976
  className: "chat-bar-container"
19958
- }, _this.state.conditions && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
19959
- id: "conditionListContent",
19960
- className: "condition-list-display"
19961
- }, /*#__PURE__*/React.createElement("h5", null, "Content:"), /*#__PURE__*/React.createElement("ul", null, /*#__PURE__*/React.createElement("li", null, "thing 1"), /*#__PURE__*/React.createElement("li", null, "thing 2"))), /*#__PURE__*/React.createElement("span", {
19962
- className: "condition-list-container",
19963
- onMouseEnter: function onMouseEnter() {
19964
- return document.getElementById('conditionListContent').style.display = 'block';
19965
- },
19966
- onMouseLeave: function onMouseLeave() {
19967
- return document.getElementById('conditionListContent').style.display = 'none';
19968
- },
19969
- onClick: function onClick() {
19970
- _this.setState({
19971
- isConditionLockingMenuOpen: true,
19972
- isOptionsDropdownOpen: false
19973
- });
19974
- }
19975
- }, /*#__PURE__*/React.createElement(Icon, {
19976
- type: "lock"
19977
- }), " Conditions")), /*#__PURE__*/React.createElement("div", {
19977
+ }, /*#__PURE__*/React.createElement("div", {
19978
19978
  className: "watermark"
19979
19979
  }, /*#__PURE__*/React.createElement(Icon, {
19980
19980
  type: "react-autoql-bubbles-outlined"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-autoql",
3
- "version": "3.4.3",
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",