@atlaskit/jql-editor 4.12.1 → 4.12.2

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.
Files changed (36) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/analytics/listener/helpers/logger.js +1 -2
  3. package/dist/cjs/analytics/listener/jql-editor-analytics-listener.js +6 -9
  4. package/dist/cjs/analytics/util.js +1 -1
  5. package/dist/cjs/plugins/autocomplete/components/autocomplete-option/styled.js +1 -1
  6. package/dist/cjs/plugins/autocomplete/index.js +1 -2
  7. package/dist/cjs/plugins/autocomplete/view.js +9 -12
  8. package/dist/cjs/plugins/common/plugin-keymap.js +1 -2
  9. package/dist/cjs/plugins/common/react-plugin-view.js +1 -2
  10. package/dist/cjs/plugins/jql-ast/JQLEditorErrorStrategy.js +8 -9
  11. package/dist/cjs/plugins/jql-syntax-highlighting/visitor.js +14 -17
  12. package/dist/cjs/plugins/rich-inline-nodes/util/react-node-view.js +1 -2
  13. package/dist/cjs/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +16 -19
  14. package/dist/cjs/plugins/validation-tooltip/view.js +1 -2
  15. package/dist/cjs/state/hydration/util.js +16 -19
  16. package/dist/cjs/state/util.js +20 -23
  17. package/dist/cjs/ui/error-boundary/index.js +6 -9
  18. package/dist/es2019/analytics/util.js +1 -1
  19. package/dist/es2019/plugins/autocomplete/components/autocomplete-option/styled.js +1 -1
  20. package/dist/esm/analytics/listener/helpers/logger.js +1 -2
  21. package/dist/esm/analytics/listener/jql-editor-analytics-listener.js +6 -9
  22. package/dist/esm/analytics/util.js +1 -1
  23. package/dist/esm/plugins/autocomplete/components/autocomplete-option/styled.js +1 -1
  24. package/dist/esm/plugins/autocomplete/index.js +1 -2
  25. package/dist/esm/plugins/autocomplete/view.js +9 -12
  26. package/dist/esm/plugins/common/plugin-keymap.js +1 -2
  27. package/dist/esm/plugins/common/react-plugin-view.js +1 -2
  28. package/dist/esm/plugins/jql-ast/JQLEditorErrorStrategy.js +8 -9
  29. package/dist/esm/plugins/jql-syntax-highlighting/visitor.js +14 -17
  30. package/dist/esm/plugins/rich-inline-nodes/util/react-node-view.js +1 -2
  31. package/dist/esm/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +16 -19
  32. package/dist/esm/plugins/validation-tooltip/view.js +1 -2
  33. package/dist/esm/state/hydration/util.js +16 -19
  34. package/dist/esm/state/util.js +20 -23
  35. package/dist/esm/ui/error-boundary/index.js +6 -9
  36. package/package.json +1 -1
@@ -1,11 +1,10 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
7
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
9
  import { AbstractJastVisitor } from '@atlaskit/jql-ast';
11
10
 
@@ -23,61 +22,59 @@ import { AbstractJastVisitor } from '@atlaskit/jql-ast';
23
22
  * - Equivalent query: "project = EM and status in (Done)"
24
23
  */
25
24
  export var ValidQueryVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
26
- _inherits(ValidQueryVisitor, _AbstractJastVisitor);
27
- var _super = _createSuper(ValidQueryVisitor);
28
25
  function ValidQueryVisitor() {
29
26
  var _this;
30
27
  _classCallCheck(this, ValidQueryVisitor);
31
28
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
32
29
  args[_key] = arguments[_key];
33
30
  }
34
- _this = _super.call.apply(_super, [this].concat(args));
35
- _defineProperty(_assertThisInitialized(_this), "visitQuery", function (query) {
31
+ _this = _callSuper(this, ValidQueryVisitor, [].concat(args));
32
+ _defineProperty(_this, "visitQuery", function (query) {
36
33
  if (!query.where) {
37
34
  return '';
38
35
  }
39
- return query.where.accept(_assertThisInitialized(_this));
36
+ return query.where.accept(_this);
40
37
  });
41
- _defineProperty(_assertThisInitialized(_this), "visitCompoundClause", function (compoundClause) {
38
+ _defineProperty(_this, "visitCompoundClause", function (compoundClause) {
42
39
  return compoundClause.clauses.map(function (clause) {
43
- return clause.accept(_assertThisInitialized(_this));
40
+ return clause.accept(_this);
44
41
  }).filter(function (value) {
45
42
  return !!value;
46
43
  }).join(' and ');
47
44
  });
48
- _defineProperty(_assertThisInitialized(_this), "visitTerminalClause", function (terminalClause) {
45
+ _defineProperty(_this, "visitTerminalClause", function (terminalClause) {
49
46
  var field = terminalClause.field,
50
47
  operator = terminalClause.operator,
51
48
  operand = terminalClause.operand;
52
49
  if (!operator || !operand) {
53
50
  return '';
54
51
  }
55
- var operandValue = operand.accept(_assertThisInitialized(_this));
52
+ var operandValue = operand.accept(_this);
56
53
  if (!operandValue) {
57
54
  return '';
58
55
  }
59
56
  return "".concat(field.text, " ").concat(operator.value, " ").concat(operandValue);
60
57
  });
61
- _defineProperty(_assertThisInitialized(_this), "visitNotClause", function (notClause) {
62
- return notClause.clause.accept(_assertThisInitialized(_this));
58
+ _defineProperty(_this, "visitNotClause", function (notClause) {
59
+ return notClause.clause.accept(_this);
63
60
  });
64
- _defineProperty(_assertThisInitialized(_this), "visitValueOperand", function (valueOperand) {
61
+ _defineProperty(_this, "visitValueOperand", function (valueOperand) {
65
62
  return valueOperand.text;
66
63
  });
67
- _defineProperty(_assertThisInitialized(_this), "visitListOperand", function (listOperand) {
64
+ _defineProperty(_this, "visitListOperand", function (listOperand) {
68
65
  return "(".concat(listOperand.values.map(function (value) {
69
- return value.accept(_assertThisInitialized(_this));
66
+ return value.accept(_this);
70
67
  }).filter(function (value) {
71
68
  return !!value;
72
69
  }).join(', '), ")");
73
70
  });
74
71
  return _this;
75
72
  }
76
- _createClass(ValidQueryVisitor, [{
73
+ _inherits(ValidQueryVisitor, _AbstractJastVisitor);
74
+ return _createClass(ValidQueryVisitor, [{
77
75
  key: "defaultResult",
78
76
  value: function defaultResult() {
79
77
  return '';
80
78
  }
81
79
  }]);
82
- return ValidQueryVisitor;
83
80
  }(AbstractJastVisitor);
@@ -1,11 +1,10 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
7
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
9
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
10
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
@@ -117,53 +116,51 @@ export var getFieldNodes = function getFieldNodes(ast) {
117
116
  return visitor.fields;
118
117
  };
119
118
  var FindFieldsVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
120
- _inherits(FindFieldsVisitor, _AbstractJastVisitor);
121
- var _super = _createSuper(FindFieldsVisitor);
122
119
  function FindFieldsVisitor() {
123
120
  var _this;
124
121
  _classCallCheck(this, FindFieldsVisitor);
125
122
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
126
123
  args[_key] = arguments[_key];
127
124
  }
128
- _this = _super.call.apply(_super, [this].concat(args));
129
- _defineProperty(_assertThisInitialized(_this), "fields", new Set());
130
- _defineProperty(_assertThisInitialized(_this), "visitQuery", function (query) {
125
+ _this = _callSuper(this, FindFieldsVisitor, [].concat(args));
126
+ _defineProperty(_this, "fields", new Set());
127
+ _defineProperty(_this, "visitQuery", function (query) {
131
128
  if (query.where !== undefined) {
132
- query.where.accept(_assertThisInitialized(_this));
129
+ query.where.accept(_this);
133
130
  }
134
131
  if (query.orderBy !== undefined) {
135
- query.orderBy.accept(_assertThisInitialized(_this));
132
+ query.orderBy.accept(_this);
136
133
  }
137
134
  });
138
- _defineProperty(_assertThisInitialized(_this), "visitOrderBy", function (orderBy) {
135
+ _defineProperty(_this, "visitOrderBy", function (orderBy) {
139
136
  orderBy.fields.map(function (orderByField) {
140
- return orderByField.accept(_assertThisInitialized(_this));
137
+ return orderByField.accept(_this);
141
138
  });
142
139
  });
143
- _defineProperty(_assertThisInitialized(_this), "visitOrderByField", function (orderByField) {
144
- orderByField.field.accept(_assertThisInitialized(_this));
140
+ _defineProperty(_this, "visitOrderByField", function (orderByField) {
141
+ orderByField.field.accept(_this);
145
142
  });
146
- _defineProperty(_assertThisInitialized(_this), "visitCompoundClause", function (compoundClause) {
143
+ _defineProperty(_this, "visitCompoundClause", function (compoundClause) {
147
144
  compoundClause.clauses.map(function (clause) {
148
- return clause.accept(_assertThisInitialized(_this));
145
+ return clause.accept(_this);
149
146
  });
150
147
  });
151
- _defineProperty(_assertThisInitialized(_this), "visitTerminalClause", function (terminalClause) {
152
- terminalClause.field.accept(_assertThisInitialized(_this));
148
+ _defineProperty(_this, "visitTerminalClause", function (terminalClause) {
149
+ terminalClause.field.accept(_this);
153
150
  });
154
- _defineProperty(_assertThisInitialized(_this), "visitNotClause", function (notClause) {
155
- notClause.clause.accept(_assertThisInitialized(_this));
151
+ _defineProperty(_this, "visitNotClause", function (notClause) {
152
+ notClause.clause.accept(_this);
156
153
  });
157
- _defineProperty(_assertThisInitialized(_this), "visitField", function (field) {
154
+ _defineProperty(_this, "visitField", function (field) {
158
155
  _this.fields.add(field.value.toLowerCase());
159
156
  });
160
157
  return _this;
161
158
  }
162
- _createClass(FindFieldsVisitor, [{
159
+ _inherits(FindFieldsVisitor, _AbstractJastVisitor);
160
+ return _createClass(FindFieldsVisitor, [{
163
161
  key: "defaultResult",
164
162
  value: function defaultResult() {
165
163
  return;
166
164
  }
167
165
  }]);
168
- return FindFieldsVisitor;
169
166
  }(AbstractJastVisitor);
@@ -1,11 +1,10 @@
1
1
  import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
2
2
  import _createClass from "@babel/runtime/helpers/createClass";
3
- import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
4
- import _inherits from "@babel/runtime/helpers/inherits";
5
3
  import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
6
4
  import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
5
+ import _inherits from "@babel/runtime/helpers/inherits";
7
6
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function _createSuper(t) { var r = _isNativeReflectConstruct(); return function () { var e, o = _getPrototypeOf(t); if (r) { var s = _getPrototypeOf(this).constructor; e = Reflect.construct(o, arguments, s); } else e = o.apply(this, arguments); return _possibleConstructorReturn(this, e); }; }
7
+ function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
8
  function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
9
  import React, { Component } from 'react';
11
10
 
@@ -14,21 +13,20 @@ import { JQLEditorReadOnly } from '../jql-editor-layout';
14
13
  // eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
15
14
  // eslint-disable-next-line @repo/internal/react/no-class-components
16
15
  var ErrorBoundary = /*#__PURE__*/function (_Component) {
17
- _inherits(ErrorBoundary, _Component);
18
- var _super = _createSuper(ErrorBoundary);
19
16
  function ErrorBoundary() {
20
17
  var _this;
21
18
  _classCallCheck(this, ErrorBoundary);
22
19
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
23
20
  args[_key] = arguments[_key];
24
21
  }
25
- _this = _super.call.apply(_super, [this].concat(args));
26
- _defineProperty(_assertThisInitialized(_this), "state", {
22
+ _this = _callSuper(this, ErrorBoundary, [].concat(args));
23
+ _defineProperty(_this, "state", {
27
24
  error: null
28
25
  });
29
26
  return _this;
30
27
  }
31
- _createClass(ErrorBoundary, [{
28
+ _inherits(ErrorBoundary, _Component);
29
+ return _createClass(ErrorBoundary, [{
32
30
  key: "componentDidCatch",
33
31
  value: function componentDidCatch(error) {
34
32
  this.setState({
@@ -51,7 +49,6 @@ var ErrorBoundary = /*#__PURE__*/function (_Component) {
51
49
  });
52
50
  }
53
51
  }]);
54
- return ErrorBoundary;
55
52
  }(Component);
56
53
  export var withErrorBoundary = function withErrorBoundary(WrappedComponent) {
57
54
  return function (props) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/jql-editor",
3
- "version": "4.12.1",
3
+ "version": "4.12.2",
4
4
  "description": "This package allows consumers to render an advanced JQL editor component to enable autocomplete-assisted authoring and validation of JQL queries.",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",