@atlaskit/jql-editor 5.7.1 → 5.8.1

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 (46) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/dist/cjs/analytics/util.js +1 -1
  3. package/dist/cjs/async.js +6 -2
  4. package/dist/cjs/hooks/use-editor-theme/index.js +12 -5
  5. package/dist/cjs/plugins/autocomplete/view.js +15 -0
  6. package/dist/cjs/plugins/rich-inline-nodes/nodes/team/index.js +7 -4
  7. package/dist/cjs/plugins/rich-inline-nodes/nodes/team/styled.js +1 -12
  8. package/dist/cjs/plugins/rich-inline-nodes/util/react-node-view.js +2 -1
  9. package/dist/cjs/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +9 -2
  10. package/dist/cjs/state/index.js +2 -1
  11. package/dist/cjs/ui/jql-editor/index.js +4 -2
  12. package/dist/cjs/ui/jql-editor-layout/index.js +15 -7
  13. package/dist/cjs/ui/jql-editor-layout/styled.js +7 -2
  14. package/dist/es2019/analytics/util.js +1 -1
  15. package/dist/es2019/async.js +6 -2
  16. package/dist/es2019/hooks/use-editor-theme/index.js +9 -4
  17. package/dist/es2019/plugins/autocomplete/view.js +15 -0
  18. package/dist/es2019/plugins/rich-inline-nodes/nodes/team/index.js +7 -4
  19. package/dist/es2019/plugins/rich-inline-nodes/nodes/team/styled.js +1 -12
  20. package/dist/es2019/plugins/rich-inline-nodes/util/react-node-view.js +2 -0
  21. package/dist/es2019/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +7 -2
  22. package/dist/es2019/state/index.js +2 -0
  23. package/dist/es2019/ui/jql-editor/index.js +4 -2
  24. package/dist/es2019/ui/jql-editor-layout/index.js +14 -6
  25. package/dist/es2019/ui/jql-editor-layout/styled.js +3 -1
  26. package/dist/esm/analytics/util.js +1 -1
  27. package/dist/esm/async.js +6 -2
  28. package/dist/esm/hooks/use-editor-theme/index.js +12 -5
  29. package/dist/esm/plugins/autocomplete/view.js +15 -0
  30. package/dist/esm/plugins/rich-inline-nodes/nodes/team/index.js +7 -4
  31. package/dist/esm/plugins/rich-inline-nodes/nodes/team/styled.js +1 -12
  32. package/dist/esm/plugins/rich-inline-nodes/util/react-node-view.js +2 -0
  33. package/dist/esm/plugins/rich-inline-nodes/util/replace-nodes-transaction.js +9 -2
  34. package/dist/esm/state/index.js +2 -0
  35. package/dist/esm/ui/jql-editor/index.js +4 -2
  36. package/dist/esm/ui/jql-editor-layout/index.js +15 -7
  37. package/dist/esm/ui/jql-editor-layout/styled.js +7 -2
  38. package/dist/types/hooks/use-editor-theme/index.d.ts +6 -1
  39. package/dist/types/ui/jql-editor/types.d.ts +4 -0
  40. package/dist/types/ui/jql-editor-layout/index.d.ts +2 -1
  41. package/dist/types/ui/jql-editor-layout/styled.d.ts +2 -0
  42. package/dist/types-ts4.5/hooks/use-editor-theme/index.d.ts +6 -1
  43. package/dist/types-ts4.5/ui/jql-editor/types.d.ts +4 -0
  44. package/dist/types-ts4.5/ui/jql-editor-layout/index.d.ts +2 -1
  45. package/dist/types-ts4.5/ui/jql-editor-layout/styled.d.ts +2 -0
  46. package/package.json +9 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @atlaskit/jql-editor
2
2
 
3
+ ## 5.8.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`9b64a2eecf044`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9b64a2eecf044) -
8
+ Fix for team rich node on autocomplete
9
+ - Updated dependencies
10
+
11
+ ## 5.8.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`c25862e7683e2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c25862e7683e2) -
16
+ Introduced `defaultRows` props to set the initial number of rows in the JQL Editor
17
+
18
+ ### Patch Changes
19
+
20
+ - [`ac3b979978554`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ac3b979978554) -
21
+ Update the JQL editor to be case insensitve for replace node check
22
+
3
23
  ## 5.7.1
4
24
 
5
25
  ### Patch Changes
@@ -6,5 +6,5 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.useJqlEditorAnalytics = void 0;
7
7
  var _jqlEditorCommon = require("@atlaskit/jql-editor-common");
8
8
  var useJqlEditorAnalytics = exports.useJqlEditorAnalytics = function useJqlEditorAnalytics(analyticsSource) {
9
- return (0, _jqlEditorCommon.useJqlPackageAnalytics)(analyticsSource, "@atlaskit/jql-editor", "5.7.1", _jqlEditorCommon.ANALYTICS_CHANNEL);
9
+ return (0, _jqlEditorCommon.useJqlPackageAnalytics)(analyticsSource, "@atlaskit/jql-editor", "5.8.0", _jqlEditorCommon.ANALYTICS_CHANNEL);
10
10
  };
package/dist/cjs/async.js CHANGED
@@ -6,8 +6,10 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.preloadJQLEditor = exports.JQLEditorAsync = void 0;
8
8
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _react = _interopRequireDefault(require("react"));
10
11
  var _reactLooselyLazy = require("react-loosely-lazy");
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
13
  var _errorBoundary = require("./ui/error-boundary");
12
14
  var _intlProvider = require("./ui/intl-provider");
13
15
  var _jqlEditorLayout = require("./ui/jql-editor-layout");
@@ -27,10 +29,12 @@ var preloadJQLEditor = exports.preloadJQLEditor = function preloadJQLEditor() {
27
29
  };
28
30
  var JQLEditorAsync = exports.JQLEditorAsync = (0, _intlProvider.withIntlProvider)((0, _errorBoundary.withErrorBoundary)(function (props) {
29
31
  return /*#__PURE__*/_react.default.createElement(_reactLooselyLazy.LazySuspense, {
30
- fallback: /*#__PURE__*/_react.default.createElement(_jqlEditorLayout.JQLEditorReadOnly, {
32
+ fallback: /*#__PURE__*/_react.default.createElement(_jqlEditorLayout.JQLEditorReadOnly, (0, _extends2.default)({
31
33
  query: props.query,
32
34
  isSearch: !!props.onSearch,
33
35
  isCompact: props.isCompact
34
- })
36
+ }, (0, _platformFeatureFlags.fg)('list_lovability_improving_filters') ? {
37
+ defaultRows: props.defaultRows
38
+ } : {}))
35
39
  }, /*#__PURE__*/_react.default.createElement(JQLEditor, props));
36
40
  }));
@@ -5,9 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.useEditorThemeContext = exports.useEditorTheme = exports.EditorThemeContext = void 0;
8
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
8
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
10
  var _react = require("react");
10
11
  var _noop = _interopRequireDefault(require("lodash/noop"));
12
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
+ 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; }
14
+ 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) { (0, _defineProperty2.default)(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; }
11
15
  var defaultMaxRows = 3;
12
16
  var expandedRows = 15;
13
17
  var defaultEditorTheme = {
@@ -27,7 +31,8 @@ var useEditorTheme = exports.useEditorTheme = function useEditorTheme(_ref) {
27
31
  var _ref$isSearch = _ref.isSearch,
28
32
  isSearch = _ref$isSearch === void 0 ? false : _ref$isSearch,
29
33
  _ref$isCompact = _ref.isCompact,
30
- isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact;
34
+ isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact,
35
+ defaultRows = _ref.defaultRows;
31
36
  var _useState = (0, _react.useState)(false),
32
37
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
33
38
  expanded = _useState2[0],
@@ -38,15 +43,17 @@ var useEditorTheme = exports.useEditorTheme = function useEditorTheme(_ref) {
38
43
  });
39
44
  }, []);
40
45
  return (0, _react.useMemo)(function () {
41
- return {
42
- defaultMaxRows: defaultMaxRows,
46
+ return _objectSpread({
47
+ defaultMaxRows: defaultRows !== undefined && defaultRows > defaultMaxRows && (0, _platformFeatureFlags.fg)('list_lovability_improving_filters') ? defaultRows : defaultMaxRows,
43
48
  expanded: expanded,
44
49
  expandedRows: expandedRows,
45
50
  toggleExpanded: toggleExpanded,
46
51
  isSearch: isSearch,
47
52
  isCompact: isCompact
48
- };
49
- }, [expanded, toggleExpanded, isSearch, isCompact]);
53
+ }, (0, _platformFeatureFlags.fg)('list_lovability_improving_filters') ? {
54
+ defaultRows: defaultRows
55
+ } : {});
56
+ }, [expanded, toggleExpanded, isSearch, isCompact, defaultRows]);
50
57
  };
51
58
  var useEditorThemeContext = exports.useEditorThemeContext = function useEditorThemeContext() {
52
59
  return (0, _react.useContext)(EditorThemeContext);
@@ -102,6 +102,21 @@ var AutocompletePluginView = exports.default = /*#__PURE__*/function (_ReactPlug
102
102
  nodes.push(_this.view.state.schema.nodes.user.create(attributes, textContent));
103
103
  break;
104
104
  }
105
+ case 'team':
106
+ {
107
+ if ((0, _platformFeatureFlags.fg)('jira_update_jql_teams')) {
108
+ var _attributes = {
109
+ type: 'team',
110
+ id: value,
111
+ name: nameOnRichInlineNode !== null && nameOnRichInlineNode !== void 0 ? nameOnRichInlineNode : name,
112
+ fieldName: context === null || context === void 0 ? void 0 : context.field
113
+ };
114
+ nodes.push(_this.view.state.schema.nodes.team.create(_attributes, textContent));
115
+ } else {
116
+ nodes.push(textContent);
117
+ }
118
+ break;
119
+ }
105
120
  default:
106
121
  {
107
122
  nodes.push(textContent);
@@ -7,7 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.team = void 0;
8
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
9
9
  var _react = _interopRequireDefault(require("react"));
10
- var _avatar = _interopRequireDefault(require("@atlaskit/avatar"));
10
+ var _teamsAvatar = _interopRequireDefault(require("@atlaskit/teams-avatar"));
11
11
  var _state = require("../../../../state");
12
12
  var _styled = require("./styled");
13
13
  var Team = function Team(_ref) {
@@ -25,11 +25,14 @@ var Team = function Team(_ref) {
25
25
  return /*#__PURE__*/_react.default.createElement(_styled.TeamContainer, {
26
26
  selected: selected,
27
27
  error: error
28
- }, /*#__PURE__*/_react.default.createElement(_styled.AvatarWrapper, null, /*#__PURE__*/_react.default.createElement(_avatar.default, {
28
+ }, /*#__PURE__*/_react.default.createElement(_styled.AvatarWrapper, {
29
+ "data-testid": "team-avatar-wrapper"
30
+ }, /*#__PURE__*/_react.default.createElement(_teamsAvatar.default, {
31
+ teamId: id,
29
32
  src: team === null || team === void 0 ? void 0 : team.avatarUrl,
30
- appearance: "square",
31
33
  borderColor: "transparent",
32
- size: "xsmall"
34
+ size: "xsmall",
35
+ compact: true
33
36
  })), /*#__PURE__*/_react.default.createElement(_styled.NameContainer, null, name));
34
37
  };
35
38
  var team = exports.team = {
@@ -84,16 +84,5 @@ var NameContainer = exports.NameContainer = _styled.default.span({
84
84
  var AvatarWrapper = exports.AvatarWrapper = _styled.default.div({
85
85
  height: "var(--ds-space-200, 16px)",
86
86
  width: "var(--ds-space-200, 16px)",
87
- alignSelf: 'center',
88
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
89
- '> div span': {
90
- margin: "var(--ds-space-0, 0px)"
91
- },
92
- // Fix fallback icon alignment by targeting the outer AvatarContent span
93
- // This contains the icon background and needs to move as a unit
94
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
95
- '> div > span:has(> span)': {
96
- position: 'relative',
97
- top: '-2px'
98
- }
87
+ alignSelf: 'center'
99
88
  });
@@ -18,7 +18,7 @@ var _state = require("../../../state");
18
18
  var _constants = require("../constants");
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
20
  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; }
21
- 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) { (0, _defineProperty2.default)(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; }
21
+ 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) { (0, _defineProperty2.default)(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; } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
22
22
  var ReactNodeView = exports.ReactNodeView = /*#__PURE__*/function () {
23
23
  function ReactNodeView(component, portalActions, _node) {
24
24
  var _this = this;
@@ -113,6 +113,7 @@ var ReactNodeView = exports.ReactNodeView = /*#__PURE__*/function () {
113
113
  // Generate unique portal identifier
114
114
  // If you read this comment in the future and TypeScript has added support for Symbols as object keys, please do
115
115
  // JQL Editor a favor and replace this library with the native JS functionality that TS was supposed to support.
116
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
116
117
  this.portalKey = (0, _uuid.v4)();
117
118
  // Creating span under the assumption that all node views will be inline elements in JQL Editor
118
119
  this.dom = document.createElement('span');
@@ -102,7 +102,7 @@ var FindValuesVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
102
102
  }, []);
103
103
  });
104
104
  (0, _defineProperty2.default)(_this, "visitTerminalClause", function (terminalClause) {
105
- if (terminalClause.field.value !== _this.field) {
105
+ if (!_this.equalsIgnoreCase(terminalClause.field.value, _this.field)) {
106
106
  return [];
107
107
  }
108
108
  if (terminalClause.operand === undefined) {
@@ -114,7 +114,7 @@ var FindValuesVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
114
114
  return notClause.clause.accept(_this);
115
115
  });
116
116
  (0, _defineProperty2.default)(_this, "visitValueOperand", function (valueOperand) {
117
- if (valueOperand.value !== _this.value) {
117
+ if (!_this.equalsIgnoreCase(valueOperand.value, _this.value)) {
118
118
  return [];
119
119
  }
120
120
  return [valueOperand];
@@ -139,5 +139,12 @@ var FindValuesVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
139
139
  value: function defaultResult() {
140
140
  return [];
141
141
  }
142
+ }, {
143
+ key: "equalsIgnoreCase",
144
+ value: function equalsIgnoreCase(a, b) {
145
+ return a.localeCompare(b, undefined, {
146
+ sensitivity: 'base'
147
+ }) === 0;
148
+ }
142
149
  }]);
143
150
  }(_jqlAst.AbstractJastVisitor);
@@ -30,7 +30,7 @@ var _autocomplete = require("./autocomplete");
30
30
  var _hydration = require("./hydration");
31
31
  var _util = require("./util");
32
32
  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; }
33
- 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) { (0, _defineProperty2.default)(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; }
33
+ 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) { (0, _defineProperty2.default)(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; } // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
34
34
  var initialIntl = (0, _reactIntlNext.createIntl)({
35
35
  locale: 'en'
36
36
  });
@@ -972,6 +972,7 @@ var EditorStateContainer = exports.EditorStateContainer = (0, _reactSweetState.c
972
972
  autocompleteProvider: autocompleteProvider,
973
973
  enableRichInlineNodes: enableRichInlineNodes,
974
974
  // Generate unique identifiers for each JQL editor instance
975
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
975
976
  idPrefix: (0, _uuid.v4)(),
976
977
  resizeObserver: window.ResizeObserver !== undefined ? new window.ResizeObserver(function () {
977
978
  var _getState$editorViewC;
@@ -38,10 +38,12 @@ var JQLEditorInner = function JQLEditorInner(_ref) {
38
38
  isCompact = _ref.isCompact,
39
39
  onSyntaxHelp = _ref.onSyntaxHelp,
40
40
  onFocus = _ref.onFocus,
41
- customComponents = _ref.customComponents;
41
+ customComponents = _ref.customComponents,
42
+ defaultRows = _ref.defaultRows;
42
43
  var editorTheme = (0, _useEditorTheme.useEditorTheme)({
43
44
  isSearch: !!onSearch,
44
- isCompact: isCompact
45
+ isCompact: isCompact,
46
+ defaultRows: defaultRows
45
47
  });
46
48
  var _useJqlEditorAnalytic = (0, _analytics.useJqlEditorAnalytics)(analyticsSource),
47
49
  createAndFireAnalyticsEvent = _useJqlEditorAnalytic.createAndFireAnalyticsEvent;
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", {
6
6
  });
7
7
  exports.default = exports.JQLEditorReadOnly = void 0;
8
8
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
9
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
10
  var _react = _interopRequireDefault(require("react"));
10
11
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _compiled = require("@atlaskit/primitives/compiled");
@@ -13,13 +14,14 @@ var _useEditorTheme = require("../../hooks/use-editor-theme");
13
14
  var _splitTextByNewLine = require("../../utils/split-text-by-new-line");
14
15
  var _readOnlyControlsContent = require("../jql-editor-controls-content/read-only-controls-content");
15
16
  var _styled = require("./styled");
16
- var _excluded = ["isSearch", "isCompact"]; // eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
17
+ var _excluded = ["isSearch", "isCompact", "defaultRows"]; // eslint-disable-next-line @atlassian/tangerine/import/no-parent-imports
17
18
  var JQLEditorLayout = function JQLEditorLayout(props) {
18
19
  var _useEditorThemeContex = (0, _useEditorTheme.useEditorThemeContext)(),
19
20
  defaultMaxRows = _useEditorThemeContex.defaultMaxRows,
20
21
  expandedRows = _useEditorThemeContex.expandedRows,
21
22
  isSearch = _useEditorThemeContex.isSearch,
22
- isCompact = _useEditorThemeContex.isCompact;
23
+ isCompact = _useEditorThemeContex.isCompact,
24
+ defaultRows = _useEditorThemeContex.defaultRows;
23
25
  var editorViewHasFocus = props.editorViewHasFocus,
24
26
  EditorControlsContent = props.EditorControlsContent,
25
27
  EditorFooterContent = props.EditorFooterContent,
@@ -43,7 +45,7 @@ var JQLEditorLayout = function JQLEditorLayout(props) {
43
45
  onScroll: onEditorViewContainerScroll
44
46
  }, /*#__PURE__*/_react.default.createElement(_styled.LineNumberToolbar, {
45
47
  lineNumbersVisible: lineNumbersVisible
46
- }), /*#__PURE__*/_react.default.createElement(_styled.EditorView, {
48
+ }), /*#__PURE__*/_react.default.createElement(_styled.EditorView, (0, _extends2.default)({
47
49
  defaultMaxRows: defaultMaxRows,
48
50
  expandedRows: expandedRows,
49
51
  isCompact: isCompact,
@@ -52,7 +54,9 @@ var JQLEditorLayout = function JQLEditorLayout(props) {
52
54
  onBlur: onEditorViewBlur,
53
55
  onFocus: onEditorViewFocus,
54
56
  onTransitionEnd: onEditorViewTransitionEnd
55
- }), /*#__PURE__*/_react.default.createElement(_styled.EditorControls, {
57
+ }, (0, _platformFeatureFlags.fg)('list_lovability_improving_filters') ? {
58
+ defaultRows: defaultRows
59
+ } : {})), /*#__PURE__*/_react.default.createElement(_styled.EditorControls, {
56
60
  isSearch: isSearch,
57
61
  isCompact: isCompact,
58
62
  isVisualRefresh: (0, _platformFeatureFlags.fg)('platform-component-visual-refresh')
@@ -70,7 +74,8 @@ var JQLEditorReadOnlyWithoutTheme = function JQLEditorReadOnlyWithoutTheme(_ref)
70
74
  defaultMaxRows = _useEditorThemeContex2.defaultMaxRows,
71
75
  expandedRows = _useEditorThemeContex2.expandedRows,
72
76
  isSearch = _useEditorThemeContex2.isSearch,
73
- isCompact = _useEditorThemeContex2.isCompact;
77
+ isCompact = _useEditorThemeContex2.isCompact,
78
+ defaultRows = _useEditorThemeContex2.defaultRows;
74
79
  var blocks = (0, _splitTextByNewLine.splitTextByNewLine)(query);
75
80
  var lineNumbersVisible = blocks.length > 1;
76
81
  return /*#__PURE__*/_react.default.createElement(_styled.EditorMain, null, /*#__PURE__*/_react.default.createElement(_styled.ReadOnlyEditorViewContainer, null, /*#__PURE__*/_react.default.createElement(_styled.LineNumberToolbar, {
@@ -89,7 +94,8 @@ var JQLEditorReadOnlyWithoutTheme = function JQLEditorReadOnlyWithoutTheme(_ref)
89
94
  ,
90
95
  "aria-expanded": false,
91
96
  "aria-controls": "dummy-jql-editor-auto-complete-id",
92
- "aria-label": "JQL query"
97
+ "aria-label": "JQL query",
98
+ defaultRows: defaultRows
93
99
  }, blocks.map(function (block, index) {
94
100
  return /*#__PURE__*/_react.default.createElement(_compiled.Box, {
95
101
  as: "p",
@@ -103,10 +109,12 @@ var JQLEditorReadOnlyWithoutTheme = function JQLEditorReadOnlyWithoutTheme(_ref)
103
109
  var JQLEditorReadOnly = exports.JQLEditorReadOnly = function JQLEditorReadOnly(_ref2) {
104
110
  var isSearch = _ref2.isSearch,
105
111
  isCompact = _ref2.isCompact,
112
+ defaultRows = _ref2.defaultRows,
106
113
  props = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
107
114
  var editorTheme = (0, _useEditorTheme.useEditorTheme)({
108
115
  isSearch: isSearch,
109
- isCompact: isCompact
116
+ isCompact: isCompact,
117
+ defaultRows: defaultRows
110
118
  });
111
119
  return /*#__PURE__*/_react.default.createElement(_useEditorTheme.EditorThemeContext.Provider, {
112
120
  value: editorTheme
@@ -8,6 +8,7 @@ exports.ReadOnlyEditorViewContainer = exports.ReadOnlyEditorView = exports.LineN
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _react = require("@emotion/react");
10
10
  var _styled = _interopRequireDefault(require("@emotion/styled"));
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _colors = require("@atlaskit/theme/colors");
12
13
  var _constants = require("@atlaskit/theme/constants");
13
14
  var _constants2 = require("../../plugins/validation-tooltip/constants");
@@ -116,9 +117,13 @@ function (props) {
116
117
  * The main div which the Prosemirror editor will be rendered into.
117
118
  */
118
119
  // eslint-disable-next-line @atlaskit/design-system/no-styled-tagged-template-expression, @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
119
- var EditorView = exports.EditorView = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\tcounter-reset: lineNumber;\n\tflex-grow: 1;\n\n\ttransition:\n\t\theight 250ms cubic-bezier(0.15, 1, 0.3, 1),\n\t\tmax-height 250ms cubic-bezier(0.15, 1, 0.3, 1);\n\tmax-height: ", "px;\n\n\tline-height: ", ";\n\tfont-family: ", ";\n\tword-break: break-word;\n\toverflow-wrap: anywhere;\n\twhite-space: pre-wrap;\n\n\t&[data-expanded] {\n\t\theight: ", "px;\n\t\tmax-height: ", "px;\n\t}\n\n\t.ProseMirror {\n\t\tcolor: ", ";\n\t\tpadding: ", "px\n\t\t\t", "px;\n\n\t\t&:focus {\n\t\t\toutline: none;\n\t\t}\n\n\t\t.mark-token-keyword {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-field {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-operator {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-error {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: wavy underline;\n\t\t\ttext-decoration-thickness: 1px;\n\t\t\ttext-decoration-skip-ink: none;\n\t\t}\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t\tcounter-increment: lineNumber;\n\t\tposition: relative;\n\n\t\t/* Show the current line number before each paragraph block. */\n\n\t\t&::before {\n\t\t\tcontent: counter(lineNumber);\n\t\t\tcolor: ", ";\n\t\t\tfont-size: 10px;\n\t\t\tline-height: ", ";\n\t\t\tpadding: 0 ", " 0 ", ";\n\t\t\tposition: absolute;\n\t\t\tbox-sizing: border-box;\n\t\t\t/* Shift the line number tag 100% (plus 8px padding) to the left to position it inside the LineNumberToolbar */\n\t\t\ttransform: translateX(calc(-100% - ", "));\n\n\t\t\t/* We can fit 3 digits before ellipses. This is not very responsive but saves us having to add expensive width\n recalculation logic to the LineNumberToolbar for a scenario that *should* never happen. */\n\t\t\tmax-width: 30px;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\twhite-space: nowrap;\n\n\t\t\t", "\n\t\t}\n\t}\n"])), function (props) {
120
+ var EditorView = exports.EditorView = _styled.default.div(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n\tcounter-reset: lineNumber;\n\tflex-grow: 1;\n\n\ttransition:\n\t\theight 250ms cubic-bezier(0.15, 1, 0.3, 1),\n\t\tmax-height 250ms cubic-bezier(0.15, 1, 0.3, 1);\n\tmax-height: ", "px;\n\tline-height: ", ";\n\t", "\n\t", "\n\tfont-family: ", ";\n\tword-break: break-word;\n\toverflow-wrap: anywhere;\n\twhite-space: pre-wrap;\n\n\t&[data-expanded] {\n\t\theight: ", "px;\n\t\tmax-height: ", "px;\n\t}\n\n\t.ProseMirror {\n\t\tcolor: ", ";\n\t\tpadding: ", "px\n\t\t\t", "px;\n\n\t\t&:focus {\n\t\t\toutline: none;\n\t\t}\n\n\t\t.mark-token-keyword {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-field {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-operator {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-error {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: wavy underline;\n\t\t\ttext-decoration-thickness: 1px;\n\t\t\ttext-decoration-skip-ink: none;\n\t\t}\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t\tcounter-increment: lineNumber;\n\t\tposition: relative;\n\n\t\t/* Show the current line number before each paragraph block. */\n\n\t\t&::before {\n\t\t\tcontent: counter(lineNumber);\n\t\t\tcolor: ", ";\n\t\t\tfont-size: 10px;\n\t\t\tline-height: ", ";\n\t\t\tpadding: 0 ", " 0 ", ";\n\t\t\tposition: absolute;\n\t\t\tbox-sizing: border-box;\n\t\t\t/* Shift the line number tag 100% (plus 8px padding) to the left to position it inside the LineNumberToolbar */\n\t\t\ttransform: translateX(calc(-100% - ", "));\n\n\t\t\t/* We can fit 3 digits before ellipses. This is not very responsive but saves us having to add expensive width\n recalculation logic to the LineNumberToolbar for a scenario that *should* never happen. */\n\t\t\tmax-width: 30px;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\twhite-space: nowrap;\n\n\t\t\t", "\n\t\t}\n\t}\n"])), function (props) {
120
121
  return rowHeight * props.defaultMaxRows + getEditorInputVerticalPadding(props.isCompact) * 2;
121
- }, rowHeight / 14, "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)", function (props) {
122
+ }, rowHeight / 14, function (props) {
123
+ return props.defaultRows && (0, _platformFeatureFlags.fg)('list_lovability_improving_filters') ? 'height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : '';
124
+ }, function (props) {
125
+ return props.defaultRows && (0, _platformFeatureFlags.fg)('list_lovability_improving_filters') ? 'min-height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : '';
126
+ }, "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)", function (props) {
122
127
  return rowHeight * props.expandedRows + getEditorInputVerticalPadding(props.isCompact) * 2;
123
128
  }, function (props) {
124
129
  return rowHeight * props.expandedRows + getEditorInputVerticalPadding(props.isCompact) * 2;
@@ -1,4 +1,4 @@
1
1
  import { ANALYTICS_CHANNEL, useJqlPackageAnalytics } from '@atlaskit/jql-editor-common';
2
2
  export const useJqlEditorAnalytics = analyticsSource => {
3
- return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.7.1", ANALYTICS_CHANNEL);
3
+ return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.8.0", ANALYTICS_CHANNEL);
4
4
  };
@@ -1,5 +1,7 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React from 'react';
2
3
  import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
3
5
  import { withErrorBoundary } from './ui/error-boundary';
4
6
  import { withIntlProvider } from './ui/intl-provider';
5
7
  import { JQLEditorReadOnly } from './ui/jql-editor-layout';
@@ -11,10 +13,12 @@ const JQLEditor = lazyForPaint(() => import( /* webpackChunkName: "async-jql-edi
11
13
  export const preloadJQLEditor = () => JQLEditor.preload();
12
14
  export const JQLEditorAsync = withIntlProvider(withErrorBoundary(props => {
13
15
  return /*#__PURE__*/React.createElement(LazySuspense, {
14
- fallback: /*#__PURE__*/React.createElement(JQLEditorReadOnly, {
16
+ fallback: /*#__PURE__*/React.createElement(JQLEditorReadOnly, _extends({
15
17
  query: props.query,
16
18
  isSearch: !!props.onSearch,
17
19
  isCompact: props.isCompact
18
- })
20
+ }, fg('list_lovability_improving_filters') ? {
21
+ defaultRows: props.defaultRows
22
+ } : {}))
19
23
  }, /*#__PURE__*/React.createElement(JQLEditor, props));
20
24
  }));
@@ -1,5 +1,6 @@
1
1
  import { createContext, useCallback, useContext, useMemo, useState } from 'react';
2
2
  import noop from 'lodash/noop';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  const defaultMaxRows = 3;
4
5
  const expandedRows = 15;
5
6
  const defaultEditorTheme = {
@@ -17,17 +18,21 @@ export const EditorThemeContext = /*#__PURE__*/createContext(defaultEditorTheme)
17
18
  */
18
19
  export const useEditorTheme = ({
19
20
  isSearch = false,
20
- isCompact = false
21
+ isCompact = false,
22
+ defaultRows
21
23
  }) => {
22
24
  const [expanded, setExpanded] = useState(false);
23
25
  const toggleExpanded = useCallback(() => setExpanded(prevState => !prevState), []);
24
26
  return useMemo(() => ({
25
- defaultMaxRows,
27
+ defaultMaxRows: defaultRows !== undefined && defaultRows > defaultMaxRows && fg('list_lovability_improving_filters') ? defaultRows : defaultMaxRows,
26
28
  expanded,
27
29
  expandedRows,
28
30
  toggleExpanded,
29
31
  isSearch,
30
- isCompact
31
- }), [expanded, toggleExpanded, isSearch, isCompact]);
32
+ isCompact,
33
+ ...(fg('list_lovability_improving_filters') ? {
34
+ defaultRows
35
+ } : {})
36
+ }), [expanded, toggleExpanded, isSearch, isCompact, defaultRows]);
32
37
  };
33
38
  export const useEditorThemeContext = () => useContext(EditorThemeContext);
@@ -87,6 +87,21 @@ export default class AutocompletePluginView extends ReactPluginView {
87
87
  nodes.push(this.view.state.schema.nodes.user.create(attributes, textContent));
88
88
  break;
89
89
  }
90
+ case 'team':
91
+ {
92
+ if (fg('jira_update_jql_teams')) {
93
+ const attributes = {
94
+ type: 'team',
95
+ id: value,
96
+ name: nameOnRichInlineNode !== null && nameOnRichInlineNode !== void 0 ? nameOnRichInlineNode : name,
97
+ fieldName: context === null || context === void 0 ? void 0 : context.field
98
+ };
99
+ nodes.push(this.view.state.schema.nodes.team.create(attributes, textContent));
100
+ } else {
101
+ nodes.push(textContent);
102
+ }
103
+ break;
104
+ }
90
105
  default:
91
106
  {
92
107
  nodes.push(textContent);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import Avatar from '@atlaskit/avatar';
2
+ import TeamsAvatar from '@atlaskit/teams-avatar';
3
3
  import { useHydratedTeam } from '../../../../state';
4
4
  import { AvatarWrapper, NameContainer, TeamContainer } from './styled';
5
5
  const Team = ({
@@ -16,11 +16,14 @@ const Team = ({
16
16
  return /*#__PURE__*/React.createElement(TeamContainer, {
17
17
  selected: selected,
18
18
  error: error
19
- }, /*#__PURE__*/React.createElement(AvatarWrapper, null, /*#__PURE__*/React.createElement(Avatar, {
19
+ }, /*#__PURE__*/React.createElement(AvatarWrapper, {
20
+ "data-testid": "team-avatar-wrapper"
21
+ }, /*#__PURE__*/React.createElement(TeamsAvatar, {
22
+ teamId: id,
20
23
  src: team === null || team === void 0 ? void 0 : team.avatarUrl,
21
- appearance: "square",
22
24
  borderColor: "transparent",
23
- size: "xsmall"
25
+ size: "xsmall",
26
+ compact: true
24
27
  })), /*#__PURE__*/React.createElement(NameContainer, null, name));
25
28
  };
26
29
  export const team = {
@@ -76,16 +76,5 @@ export const NameContainer = styled.span({
76
76
  export const AvatarWrapper = styled.div({
77
77
  height: "var(--ds-space-200, 16px)",
78
78
  width: "var(--ds-space-200, 16px)",
79
- alignSelf: 'center',
80
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
81
- '> div span': {
82
- margin: "var(--ds-space-0, 0px)"
83
- },
84
- // Fix fallback icon alignment by targeting the outer AvatarContent span
85
- // This contains the icon background and needs to move as a unit
86
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
87
- '> div > span:has(> span)': {
88
- position: 'relative',
89
- top: '-2px'
90
- }
79
+ alignSelf: 'center'
91
80
  });
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import React, { useEffect, useLayoutEffect, useState } from 'react';
4
4
  import { Subject } from 'rxjs/Subject';
5
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
5
6
  import { v4 as uuid } from 'uuid';
6
7
  import { useEditorViewHasFocus } from '../../../state';
7
8
  import { ERROR_NODE, SELECTED_NODE } from '../constants';
@@ -90,6 +91,7 @@ export class ReactNodeView {
90
91
  // Generate unique portal identifier
91
92
  // If you read this comment in the future and TypeScript has added support for Symbols as object keys, please do
92
93
  // JQL Editor a favor and replace this library with the native JS functionality that TS was supposed to support.
94
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
93
95
  this.portalKey = uuid();
94
96
  // Creating span under the assumption that all node views will be inline elements in JQL Editor
95
97
  this.dom = document.createElement('span');
@@ -79,7 +79,7 @@ class FindValuesVisitor extends AbstractJastVisitor {
79
79
  }, []);
80
80
  });
81
81
  _defineProperty(this, "visitTerminalClause", terminalClause => {
82
- if (terminalClause.field.value !== this.field) {
82
+ if (!this.equalsIgnoreCase(terminalClause.field.value, this.field)) {
83
83
  return [];
84
84
  }
85
85
  if (terminalClause.operand === undefined) {
@@ -91,7 +91,7 @@ class FindValuesVisitor extends AbstractJastVisitor {
91
91
  return notClause.clause.accept(this);
92
92
  });
93
93
  _defineProperty(this, "visitValueOperand", valueOperand => {
94
- if (valueOperand.value !== this.value) {
94
+ if (!this.equalsIgnoreCase(valueOperand.value, this.value)) {
95
95
  return [];
96
96
  }
97
97
  return [valueOperand];
@@ -110,4 +110,9 @@ class FindValuesVisitor extends AbstractJastVisitor {
110
110
  defaultResult() {
111
111
  return [];
112
112
  }
113
+ equalsIgnoreCase(a, b) {
114
+ return a.localeCompare(b, undefined, {
115
+ sensitivity: 'base'
116
+ }) === 0;
117
+ }
113
118
  }
@@ -4,6 +4,7 @@ import { createIntl } from 'react-intl-next';
4
4
  import { createContainer, createHook, createSelector, createStore } from 'react-sweet-state';
5
5
  import { merge } from 'rxjs/observable/merge';
6
6
  import { tap } from 'rxjs/operators/tap';
7
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
7
8
  import { v4 as uuidv4 } from 'uuid';
8
9
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
9
10
  import { computeJqlInsights, isListOperator } from '@atlaskit/jql-ast';
@@ -941,6 +942,7 @@ export const EditorStateContainer = createContainer(Store, {
941
942
  autocompleteProvider,
942
943
  enableRichInlineNodes,
943
944
  // Generate unique identifiers for each JQL editor instance
945
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
944
946
  idPrefix: uuidv4(),
945
947
  resizeObserver: window.ResizeObserver !== undefined ? new window.ResizeObserver(() => {
946
948
  var _getState$editorViewC;
@@ -25,11 +25,13 @@ const JQLEditorInner = ({
25
25
  isCompact,
26
26
  onSyntaxHelp,
27
27
  onFocus,
28
- customComponents
28
+ customComponents,
29
+ defaultRows
29
30
  }) => {
30
31
  const editorTheme = useEditorTheme({
31
32
  isSearch: !!onSearch,
32
- isCompact
33
+ isCompact,
34
+ defaultRows
33
35
  });
34
36
  const {
35
37
  createAndFireAnalyticsEvent
@@ -1,3 +1,4 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React from 'react';
2
3
  import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { Box } from '@atlaskit/primitives/compiled';
@@ -11,7 +12,8 @@ const JQLEditorLayout = props => {
11
12
  defaultMaxRows,
12
13
  expandedRows,
13
14
  isSearch,
14
- isCompact
15
+ isCompact,
16
+ defaultRows
15
17
  } = useEditorThemeContext();
16
18
  const {
17
19
  editorViewHasFocus,
@@ -38,7 +40,7 @@ const JQLEditorLayout = props => {
38
40
  onScroll: onEditorViewContainerScroll
39
41
  }, /*#__PURE__*/React.createElement(LineNumberToolbar, {
40
42
  lineNumbersVisible: lineNumbersVisible
41
- }), /*#__PURE__*/React.createElement(EditorView, {
43
+ }), /*#__PURE__*/React.createElement(EditorView, _extends({
42
44
  defaultMaxRows: defaultMaxRows,
43
45
  expandedRows: expandedRows,
44
46
  isCompact: isCompact,
@@ -47,7 +49,9 @@ const JQLEditorLayout = props => {
47
49
  onBlur: onEditorViewBlur,
48
50
  onFocus: onEditorViewFocus,
49
51
  onTransitionEnd: onEditorViewTransitionEnd
50
- }), /*#__PURE__*/React.createElement(EditorControls, {
52
+ }, fg('list_lovability_improving_filters') ? {
53
+ defaultRows
54
+ } : {})), /*#__PURE__*/React.createElement(EditorControls, {
51
55
  isSearch: isSearch,
52
56
  isCompact: isCompact,
53
57
  isVisualRefresh: fg('platform-component-visual-refresh')
@@ -66,7 +70,8 @@ const JQLEditorReadOnlyWithoutTheme = ({
66
70
  defaultMaxRows,
67
71
  expandedRows,
68
72
  isSearch,
69
- isCompact
73
+ isCompact,
74
+ defaultRows
70
75
  } = useEditorThemeContext();
71
76
  const blocks = splitTextByNewLine(query);
72
77
  const lineNumbersVisible = blocks.length > 1;
@@ -86,7 +91,8 @@ const JQLEditorReadOnlyWithoutTheme = ({
86
91
  ,
87
92
  "aria-expanded": false,
88
93
  "aria-controls": "dummy-jql-editor-auto-complete-id",
89
- "aria-label": "JQL query"
94
+ "aria-label": "JQL query",
95
+ defaultRows: defaultRows
90
96
  }, blocks.map((block, index) => /*#__PURE__*/React.createElement(Box, {
91
97
  as: "p",
92
98
  key: index
@@ -98,11 +104,13 @@ const JQLEditorReadOnlyWithoutTheme = ({
98
104
  export const JQLEditorReadOnly = ({
99
105
  isSearch,
100
106
  isCompact,
107
+ defaultRows,
101
108
  ...props
102
109
  }) => {
103
110
  const editorTheme = useEditorTheme({
104
111
  isSearch,
105
- isCompact
112
+ isCompact,
113
+ defaultRows
106
114
  });
107
115
  return /*#__PURE__*/React.createElement(EditorThemeContext.Provider, {
108
116
  value: editorTheme
@@ -2,6 +2,7 @@
2
2
  import { css, keyframes } from '@emotion/react';
3
3
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
4
  import styled from '@emotion/styled';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { B200, B300, G500, N0, N10, N100, N30, N700, N800, N900, P400, R400 } from '@atlaskit/theme/colors';
6
7
  import { layers } from '@atlaskit/theme/constants';
7
8
  import { TOOLTIP_CLASSNAME, TOOLTIP_ENTER_CLASSNAME, TOOLTIP_EXIT_CLASSNAME } from '../../plugins/validation-tooltip/constants';
@@ -144,8 +145,9 @@ export const EditorView = styled.div`
144
145
  height 250ms cubic-bezier(0.15, 1, 0.3, 1),
145
146
  max-height 250ms cubic-bezier(0.15, 1, 0.3, 1);
146
147
  max-height: ${props => rowHeight * props.defaultMaxRows + getEditorInputVerticalPadding(props.isCompact) * 2}px;
147
-
148
148
  line-height: ${rowHeight / 14};
149
+ ${props => props.defaultRows && fg('list_lovability_improving_filters') ? 'height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : ''}
150
+ ${props => props.defaultRows && fg('list_lovability_improving_filters') ? 'min-height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : ''}
149
151
  font-family: ${"var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)"};
150
152
  word-break: break-word;
151
153
  overflow-wrap: anywhere;
@@ -1,4 +1,4 @@
1
1
  import { ANALYTICS_CHANNEL, useJqlPackageAnalytics } from '@atlaskit/jql-editor-common';
2
2
  export var useJqlEditorAnalytics = function useJqlEditorAnalytics(analyticsSource) {
3
- return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.7.1", ANALYTICS_CHANNEL);
3
+ return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.8.0", ANALYTICS_CHANNEL);
4
4
  };
package/dist/esm/async.js CHANGED
@@ -1,5 +1,7 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React from 'react';
2
3
  import { lazyForPaint, LazySuspense } from 'react-loosely-lazy';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
3
5
  import { withErrorBoundary } from './ui/error-boundary';
4
6
  import { withIntlProvider } from './ui/intl-provider';
5
7
  import { JQLEditorReadOnly } from './ui/jql-editor-layout';
@@ -16,10 +18,12 @@ export var preloadJQLEditor = function preloadJQLEditor() {
16
18
  };
17
19
  export var JQLEditorAsync = withIntlProvider(withErrorBoundary(function (props) {
18
20
  return /*#__PURE__*/React.createElement(LazySuspense, {
19
- fallback: /*#__PURE__*/React.createElement(JQLEditorReadOnly, {
21
+ fallback: /*#__PURE__*/React.createElement(JQLEditorReadOnly, _extends({
20
22
  query: props.query,
21
23
  isSearch: !!props.onSearch,
22
24
  isCompact: props.isCompact
23
- })
25
+ }, fg('list_lovability_improving_filters') ? {
26
+ defaultRows: props.defaultRows
27
+ } : {}))
24
28
  }, /*#__PURE__*/React.createElement(JQLEditor, props));
25
29
  }));
@@ -1,6 +1,10 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
3
+ 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; }
4
+ 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; }
2
5
  import { createContext, useCallback, useContext, useMemo, useState } from 'react';
3
6
  import noop from 'lodash/noop';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
4
8
  var defaultMaxRows = 3;
5
9
  var expandedRows = 15;
6
10
  var defaultEditorTheme = {
@@ -20,7 +24,8 @@ export var useEditorTheme = function useEditorTheme(_ref) {
20
24
  var _ref$isSearch = _ref.isSearch,
21
25
  isSearch = _ref$isSearch === void 0 ? false : _ref$isSearch,
22
26
  _ref$isCompact = _ref.isCompact,
23
- isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact;
27
+ isCompact = _ref$isCompact === void 0 ? false : _ref$isCompact,
28
+ defaultRows = _ref.defaultRows;
24
29
  var _useState = useState(false),
25
30
  _useState2 = _slicedToArray(_useState, 2),
26
31
  expanded = _useState2[0],
@@ -31,15 +36,17 @@ export var useEditorTheme = function useEditorTheme(_ref) {
31
36
  });
32
37
  }, []);
33
38
  return useMemo(function () {
34
- return {
35
- defaultMaxRows: defaultMaxRows,
39
+ return _objectSpread({
40
+ defaultMaxRows: defaultRows !== undefined && defaultRows > defaultMaxRows && fg('list_lovability_improving_filters') ? defaultRows : defaultMaxRows,
36
41
  expanded: expanded,
37
42
  expandedRows: expandedRows,
38
43
  toggleExpanded: toggleExpanded,
39
44
  isSearch: isSearch,
40
45
  isCompact: isCompact
41
- };
42
- }, [expanded, toggleExpanded, isSearch, isCompact]);
46
+ }, fg('list_lovability_improving_filters') ? {
47
+ defaultRows: defaultRows
48
+ } : {});
49
+ }, [expanded, toggleExpanded, isSearch, isCompact, defaultRows]);
43
50
  };
44
51
  export var useEditorThemeContext = function useEditorThemeContext() {
45
52
  return useContext(EditorThemeContext);
@@ -96,6 +96,21 @@ var AutocompletePluginView = /*#__PURE__*/function (_ReactPluginView) {
96
96
  nodes.push(_this.view.state.schema.nodes.user.create(attributes, textContent));
97
97
  break;
98
98
  }
99
+ case 'team':
100
+ {
101
+ if (fg('jira_update_jql_teams')) {
102
+ var _attributes = {
103
+ type: 'team',
104
+ id: value,
105
+ name: nameOnRichInlineNode !== null && nameOnRichInlineNode !== void 0 ? nameOnRichInlineNode : name,
106
+ fieldName: context === null || context === void 0 ? void 0 : context.field
107
+ };
108
+ nodes.push(_this.view.state.schema.nodes.team.create(_attributes, textContent));
109
+ } else {
110
+ nodes.push(textContent);
111
+ }
112
+ break;
113
+ }
99
114
  default:
100
115
  {
101
116
  nodes.push(textContent);
@@ -1,6 +1,6 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
2
  import React from 'react';
3
- import Avatar from '@atlaskit/avatar';
3
+ import TeamsAvatar from '@atlaskit/teams-avatar';
4
4
  import { useHydratedTeam } from '../../../../state';
5
5
  import { AvatarWrapper, NameContainer, TeamContainer } from './styled';
6
6
  var Team = function Team(_ref) {
@@ -18,11 +18,14 @@ var Team = function Team(_ref) {
18
18
  return /*#__PURE__*/React.createElement(TeamContainer, {
19
19
  selected: selected,
20
20
  error: error
21
- }, /*#__PURE__*/React.createElement(AvatarWrapper, null, /*#__PURE__*/React.createElement(Avatar, {
21
+ }, /*#__PURE__*/React.createElement(AvatarWrapper, {
22
+ "data-testid": "team-avatar-wrapper"
23
+ }, /*#__PURE__*/React.createElement(TeamsAvatar, {
24
+ teamId: id,
22
25
  src: team === null || team === void 0 ? void 0 : team.avatarUrl,
23
- appearance: "square",
24
26
  borderColor: "transparent",
25
- size: "xsmall"
27
+ size: "xsmall",
28
+ compact: true
26
29
  })), /*#__PURE__*/React.createElement(NameContainer, null, name));
27
30
  };
28
31
  export var team = {
@@ -75,16 +75,5 @@ export var NameContainer = styled.span({
75
75
  export var AvatarWrapper = styled.div({
76
76
  height: "var(--ds-space-200, 16px)",
77
77
  width: "var(--ds-space-200, 16px)",
78
- alignSelf: 'center',
79
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
80
- '> div span': {
81
- margin: "var(--ds-space-0, 0px)"
82
- },
83
- // Fix fallback icon alignment by targeting the outer AvatarContent span
84
- // This contains the icon background and needs to move as a unit
85
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
86
- '> div > span:has(> span)': {
87
- position: 'relative',
88
- top: '-2px'
89
- }
78
+ alignSelf: 'center'
90
79
  });
@@ -7,6 +7,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
7
7
  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; }
8
8
  import React, { useEffect, useLayoutEffect, useState } from 'react';
9
9
  import { Subject } from 'rxjs/Subject';
10
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
10
11
  import { v4 as uuid } from 'uuid';
11
12
  import { useEditorViewHasFocus } from '../../../state';
12
13
  import { ERROR_NODE, SELECTED_NODE } from '../constants';
@@ -104,6 +105,7 @@ export var ReactNodeView = /*#__PURE__*/function () {
104
105
  // Generate unique portal identifier
105
106
  // If you read this comment in the future and TypeScript has added support for Symbols as object keys, please do
106
107
  // JQL Editor a favor and replace this library with the native JS functionality that TS was supposed to support.
108
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
107
109
  this.portalKey = uuid();
108
110
  // Creating span under the assumption that all node views will be inline elements in JQL Editor
109
111
  this.dom = document.createElement('span');
@@ -95,7 +95,7 @@ var FindValuesVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
95
95
  }, []);
96
96
  });
97
97
  _defineProperty(_this, "visitTerminalClause", function (terminalClause) {
98
- if (terminalClause.field.value !== _this.field) {
98
+ if (!_this.equalsIgnoreCase(terminalClause.field.value, _this.field)) {
99
99
  return [];
100
100
  }
101
101
  if (terminalClause.operand === undefined) {
@@ -107,7 +107,7 @@ var FindValuesVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
107
107
  return notClause.clause.accept(_this);
108
108
  });
109
109
  _defineProperty(_this, "visitValueOperand", function (valueOperand) {
110
- if (valueOperand.value !== _this.value) {
110
+ if (!_this.equalsIgnoreCase(valueOperand.value, _this.value)) {
111
111
  return [];
112
112
  }
113
113
  return [valueOperand];
@@ -132,5 +132,12 @@ var FindValuesVisitor = /*#__PURE__*/function (_AbstractJastVisitor) {
132
132
  value: function defaultResult() {
133
133
  return [];
134
134
  }
135
+ }, {
136
+ key: "equalsIgnoreCase",
137
+ value: function equalsIgnoreCase(a, b) {
138
+ return a.localeCompare(b, undefined, {
139
+ sensitivity: 'base'
140
+ }) === 0;
141
+ }
135
142
  }]);
136
143
  }(AbstractJastVisitor);
@@ -9,6 +9,7 @@ import { createIntl } from 'react-intl-next';
9
9
  import { createContainer, createHook, createSelector, createStore } from 'react-sweet-state';
10
10
  import { merge } from 'rxjs/observable/merge';
11
11
  import { tap } from 'rxjs/operators/tap';
12
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
12
13
  import { v4 as uuidv4 } from 'uuid';
13
14
  import { EditorView } from '@atlaskit/editor-prosemirror/view';
14
15
  import { computeJqlInsights, isListOperator } from '@atlaskit/jql-ast';
@@ -965,6 +966,7 @@ export var EditorStateContainer = createContainer(Store, {
965
966
  autocompleteProvider: autocompleteProvider,
966
967
  enableRichInlineNodes: enableRichInlineNodes,
967
968
  // Generate unique identifiers for each JQL editor instance
969
+ // eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
968
970
  idPrefix: uuidv4(),
969
971
  resizeObserver: window.ResizeObserver !== undefined ? new window.ResizeObserver(function () {
970
972
  var _getState$editorViewC;
@@ -27,10 +27,12 @@ var JQLEditorInner = function JQLEditorInner(_ref) {
27
27
  isCompact = _ref.isCompact,
28
28
  onSyntaxHelp = _ref.onSyntaxHelp,
29
29
  onFocus = _ref.onFocus,
30
- customComponents = _ref.customComponents;
30
+ customComponents = _ref.customComponents,
31
+ defaultRows = _ref.defaultRows;
31
32
  var editorTheme = useEditorTheme({
32
33
  isSearch: !!onSearch,
33
- isCompact: isCompact
34
+ isCompact: isCompact,
35
+ defaultRows: defaultRows
34
36
  });
35
37
  var _useJqlEditorAnalytic = useJqlEditorAnalytics(analyticsSource),
36
38
  createAndFireAnalyticsEvent = _useJqlEditorAnalytic.createAndFireAnalyticsEvent;
@@ -1,5 +1,6 @@
1
1
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
- var _excluded = ["isSearch", "isCompact"];
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ var _excluded = ["isSearch", "isCompact", "defaultRows"];
3
4
  import React from 'react';
4
5
  import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { Box } from '@atlaskit/primitives/compiled';
@@ -13,7 +14,8 @@ var JQLEditorLayout = function JQLEditorLayout(props) {
13
14
  defaultMaxRows = _useEditorThemeContex.defaultMaxRows,
14
15
  expandedRows = _useEditorThemeContex.expandedRows,
15
16
  isSearch = _useEditorThemeContex.isSearch,
16
- isCompact = _useEditorThemeContex.isCompact;
17
+ isCompact = _useEditorThemeContex.isCompact,
18
+ defaultRows = _useEditorThemeContex.defaultRows;
17
19
  var editorViewHasFocus = props.editorViewHasFocus,
18
20
  EditorControlsContent = props.EditorControlsContent,
19
21
  EditorFooterContent = props.EditorFooterContent,
@@ -37,7 +39,7 @@ var JQLEditorLayout = function JQLEditorLayout(props) {
37
39
  onScroll: onEditorViewContainerScroll
38
40
  }, /*#__PURE__*/React.createElement(LineNumberToolbar, {
39
41
  lineNumbersVisible: lineNumbersVisible
40
- }), /*#__PURE__*/React.createElement(EditorView, {
42
+ }), /*#__PURE__*/React.createElement(EditorView, _extends({
41
43
  defaultMaxRows: defaultMaxRows,
42
44
  expandedRows: expandedRows,
43
45
  isCompact: isCompact,
@@ -46,7 +48,9 @@ var JQLEditorLayout = function JQLEditorLayout(props) {
46
48
  onBlur: onEditorViewBlur,
47
49
  onFocus: onEditorViewFocus,
48
50
  onTransitionEnd: onEditorViewTransitionEnd
49
- }), /*#__PURE__*/React.createElement(EditorControls, {
51
+ }, fg('list_lovability_improving_filters') ? {
52
+ defaultRows: defaultRows
53
+ } : {})), /*#__PURE__*/React.createElement(EditorControls, {
50
54
  isSearch: isSearch,
51
55
  isCompact: isCompact,
52
56
  isVisualRefresh: fg('platform-component-visual-refresh')
@@ -64,7 +68,8 @@ var JQLEditorReadOnlyWithoutTheme = function JQLEditorReadOnlyWithoutTheme(_ref)
64
68
  defaultMaxRows = _useEditorThemeContex2.defaultMaxRows,
65
69
  expandedRows = _useEditorThemeContex2.expandedRows,
66
70
  isSearch = _useEditorThemeContex2.isSearch,
67
- isCompact = _useEditorThemeContex2.isCompact;
71
+ isCompact = _useEditorThemeContex2.isCompact,
72
+ defaultRows = _useEditorThemeContex2.defaultRows;
68
73
  var blocks = splitTextByNewLine(query);
69
74
  var lineNumbersVisible = blocks.length > 1;
70
75
  return /*#__PURE__*/React.createElement(EditorMain, null, /*#__PURE__*/React.createElement(ReadOnlyEditorViewContainer, null, /*#__PURE__*/React.createElement(LineNumberToolbar, {
@@ -83,7 +88,8 @@ var JQLEditorReadOnlyWithoutTheme = function JQLEditorReadOnlyWithoutTheme(_ref)
83
88
  ,
84
89
  "aria-expanded": false,
85
90
  "aria-controls": "dummy-jql-editor-auto-complete-id",
86
- "aria-label": "JQL query"
91
+ "aria-label": "JQL query",
92
+ defaultRows: defaultRows
87
93
  }, blocks.map(function (block, index) {
88
94
  return /*#__PURE__*/React.createElement(Box, {
89
95
  as: "p",
@@ -97,10 +103,12 @@ var JQLEditorReadOnlyWithoutTheme = function JQLEditorReadOnlyWithoutTheme(_ref)
97
103
  export var JQLEditorReadOnly = function JQLEditorReadOnly(_ref2) {
98
104
  var isSearch = _ref2.isSearch,
99
105
  isCompact = _ref2.isCompact,
106
+ defaultRows = _ref2.defaultRows,
100
107
  props = _objectWithoutProperties(_ref2, _excluded);
101
108
  var editorTheme = useEditorTheme({
102
109
  isSearch: isSearch,
103
- isCompact: isCompact
110
+ isCompact: isCompact,
111
+ defaultRows: defaultRows
104
112
  });
105
113
  return /*#__PURE__*/React.createElement(EditorThemeContext.Provider, {
106
114
  value: editorTheme
@@ -4,6 +4,7 @@ var _templateObject, _templateObject2, _templateObject3, _templateObject4;
4
4
  import { css, keyframes } from '@emotion/react';
5
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
6
6
  import styled from '@emotion/styled';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { B200, B300, G500, N0, N10, N100, N30, N700, N800, N900, P400, R400 } from '@atlaskit/theme/colors';
8
9
  import { layers } from '@atlaskit/theme/constants';
9
10
  import { TOOLTIP_CLASSNAME, TOOLTIP_ENTER_CLASSNAME, TOOLTIP_EXIT_CLASSNAME } from '../../plugins/validation-tooltip/constants';
@@ -110,9 +111,13 @@ function (props) {
110
111
  * The main div which the Prosemirror editor will be rendered into.
111
112
  */
112
113
  // eslint-disable-next-line @atlaskit/design-system/no-styled-tagged-template-expression, @atlaskit/ui-styling-standard/no-styled, @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
113
- export var EditorView = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tcounter-reset: lineNumber;\n\tflex-grow: 1;\n\n\ttransition:\n\t\theight 250ms cubic-bezier(0.15, 1, 0.3, 1),\n\t\tmax-height 250ms cubic-bezier(0.15, 1, 0.3, 1);\n\tmax-height: ", "px;\n\n\tline-height: ", ";\n\tfont-family: ", ";\n\tword-break: break-word;\n\toverflow-wrap: anywhere;\n\twhite-space: pre-wrap;\n\n\t&[data-expanded] {\n\t\theight: ", "px;\n\t\tmax-height: ", "px;\n\t}\n\n\t.ProseMirror {\n\t\tcolor: ", ";\n\t\tpadding: ", "px\n\t\t\t", "px;\n\n\t\t&:focus {\n\t\t\toutline: none;\n\t\t}\n\n\t\t.mark-token-keyword {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-field {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-operator {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-error {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: wavy underline;\n\t\t\ttext-decoration-thickness: 1px;\n\t\t\ttext-decoration-skip-ink: none;\n\t\t}\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t\tcounter-increment: lineNumber;\n\t\tposition: relative;\n\n\t\t/* Show the current line number before each paragraph block. */\n\n\t\t&::before {\n\t\t\tcontent: counter(lineNumber);\n\t\t\tcolor: ", ";\n\t\t\tfont-size: 10px;\n\t\t\tline-height: ", ";\n\t\t\tpadding: 0 ", " 0 ", ";\n\t\t\tposition: absolute;\n\t\t\tbox-sizing: border-box;\n\t\t\t/* Shift the line number tag 100% (plus 8px padding) to the left to position it inside the LineNumberToolbar */\n\t\t\ttransform: translateX(calc(-100% - ", "));\n\n\t\t\t/* We can fit 3 digits before ellipses. This is not very responsive but saves us having to add expensive width\n recalculation logic to the LineNumberToolbar for a scenario that *should* never happen. */\n\t\t\tmax-width: 30px;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\twhite-space: nowrap;\n\n\t\t\t", "\n\t\t}\n\t}\n"])), function (props) {
114
+ export var EditorView = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n\tcounter-reset: lineNumber;\n\tflex-grow: 1;\n\n\ttransition:\n\t\theight 250ms cubic-bezier(0.15, 1, 0.3, 1),\n\t\tmax-height 250ms cubic-bezier(0.15, 1, 0.3, 1);\n\tmax-height: ", "px;\n\tline-height: ", ";\n\t", "\n\t", "\n\tfont-family: ", ";\n\tword-break: break-word;\n\toverflow-wrap: anywhere;\n\twhite-space: pre-wrap;\n\n\t&[data-expanded] {\n\t\theight: ", "px;\n\t\tmax-height: ", "px;\n\t}\n\n\t.ProseMirror {\n\t\tcolor: ", ";\n\t\tpadding: ", "px\n\t\t\t", "px;\n\n\t\t&:focus {\n\t\t\toutline: none;\n\t\t}\n\n\t\t.mark-token-keyword {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-field {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-operator {\n\t\t\tcolor: ", ";\n\t\t}\n\n\t\t.mark-token-error {\n\t\t\tcolor: ", ";\n\t\t\ttext-decoration: wavy underline;\n\t\t\ttext-decoration-thickness: 1px;\n\t\t\ttext-decoration-skip-ink: none;\n\t\t}\n\t}\n\n\tp {\n\t\tmargin: 0;\n\t\tcounter-increment: lineNumber;\n\t\tposition: relative;\n\n\t\t/* Show the current line number before each paragraph block. */\n\n\t\t&::before {\n\t\t\tcontent: counter(lineNumber);\n\t\t\tcolor: ", ";\n\t\t\tfont-size: 10px;\n\t\t\tline-height: ", ";\n\t\t\tpadding: 0 ", " 0 ", ";\n\t\t\tposition: absolute;\n\t\t\tbox-sizing: border-box;\n\t\t\t/* Shift the line number tag 100% (plus 8px padding) to the left to position it inside the LineNumberToolbar */\n\t\t\ttransform: translateX(calc(-100% - ", "));\n\n\t\t\t/* We can fit 3 digits before ellipses. This is not very responsive but saves us having to add expensive width\n recalculation logic to the LineNumberToolbar for a scenario that *should* never happen. */\n\t\t\tmax-width: 30px;\n\t\t\ttext-overflow: ellipsis;\n\t\t\toverflow: hidden;\n\t\t\twhite-space: nowrap;\n\n\t\t\t", "\n\t\t}\n\t}\n"])), function (props) {
114
115
  return rowHeight * props.defaultMaxRows + getEditorInputVerticalPadding(props.isCompact) * 2;
115
- }, rowHeight / 14, "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)", function (props) {
116
+ }, rowHeight / 14, function (props) {
117
+ return props.defaultRows && fg('list_lovability_improving_filters') ? 'height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : '';
118
+ }, function (props) {
119
+ return props.defaultRows && fg('list_lovability_improving_filters') ? 'min-height: ' + (rowHeight * props.defaultRows + getEditorInputVerticalPadding(props.isCompact) * 2) + 'px;' : '';
120
+ }, "var(--ds-font-family-code, ui-monospace, Menlo, \"Segoe UI Mono\", \"Ubuntu Mono\", monospace)", function (props) {
116
121
  return rowHeight * props.expandedRows + getEditorInputVerticalPadding(props.isCompact) * 2;
117
122
  }, function (props) {
118
123
  return rowHeight * props.expandedRows + getEditorInputVerticalPadding(props.isCompact) * 2;
@@ -3,6 +3,10 @@ export type EditorTheme = {
3
3
  * The maximum number of rows that are visible in the default editor view.
4
4
  */
5
5
  defaultMaxRows: number;
6
+ /**
7
+ * The number of initial rows that are visible.
8
+ */
9
+ defaultRows?: number;
6
10
  /**
7
11
  * `true` if the editor view is in the expanded state.
8
12
  */
@@ -30,7 +34,8 @@ export declare const EditorThemeContext: import("react").Context<EditorTheme>;
30
34
  /**
31
35
  * Hook to manage the theming state of the editor.
32
36
  */
33
- export declare const useEditorTheme: ({ isSearch, isCompact, }: {
37
+ export declare const useEditorTheme: ({ isSearch, isCompact, defaultRows, }: {
38
+ defaultRows?: number;
34
39
  isCompact?: boolean;
35
40
  isSearch?: boolean;
36
41
  }) => EditorTheme;
@@ -39,6 +39,10 @@ export type JQLEditorUIProps = {
39
39
  * Custom components to take over the rendering of certain parts of JQL editor
40
40
  */
41
41
  customComponents?: CustomComponents;
42
+ /**
43
+ * The number of default rows that are visible.
44
+ */
45
+ defaultRows?: number;
42
46
  /**
43
47
  * Enables rich inline nodes feature, which will replace user identifiers with a lozenge containing name and avatar.
44
48
  * Note that you must specify an `onHydrate` prop which will return user data for a given query in order to see the
@@ -57,7 +57,8 @@ declare const JQLEditorLayout: (props: Props) => React.JSX.Element;
57
57
  type ReadOnlyProps = {
58
58
  query: string;
59
59
  };
60
- export declare const JQLEditorReadOnly: ({ isSearch, isCompact, ...props }: ReadOnlyProps & {
60
+ export declare const JQLEditorReadOnly: ({ isSearch, isCompact, defaultRows, ...props }: ReadOnlyProps & {
61
+ defaultRows?: number;
61
62
  isCompact?: boolean;
62
63
  isSearch?: boolean;
63
64
  }) => React.JSX.Element;
@@ -34,6 +34,7 @@ export declare const EditorView: import("@emotion/styled").StyledComponent<{
34
34
  as?: React.ElementType;
35
35
  } & {
36
36
  defaultMaxRows: number;
37
+ defaultRows?: number;
37
38
  expandedRows: number;
38
39
  isCompact: boolean;
39
40
  lineNumbersVisible: boolean;
@@ -43,6 +44,7 @@ export declare const ReadOnlyEditorView: import("@emotion/styled").StyledCompone
43
44
  as?: React.ElementType;
44
45
  } & {
45
46
  defaultMaxRows: number;
47
+ defaultRows?: number;
46
48
  expandedRows: number;
47
49
  isCompact: boolean;
48
50
  lineNumbersVisible: boolean;
@@ -3,6 +3,10 @@ export type EditorTheme = {
3
3
  * The maximum number of rows that are visible in the default editor view.
4
4
  */
5
5
  defaultMaxRows: number;
6
+ /**
7
+ * The number of initial rows that are visible.
8
+ */
9
+ defaultRows?: number;
6
10
  /**
7
11
  * `true` if the editor view is in the expanded state.
8
12
  */
@@ -30,7 +34,8 @@ export declare const EditorThemeContext: import("react").Context<EditorTheme>;
30
34
  /**
31
35
  * Hook to manage the theming state of the editor.
32
36
  */
33
- export declare const useEditorTheme: ({ isSearch, isCompact, }: {
37
+ export declare const useEditorTheme: ({ isSearch, isCompact, defaultRows, }: {
38
+ defaultRows?: number;
34
39
  isCompact?: boolean;
35
40
  isSearch?: boolean;
36
41
  }) => EditorTheme;
@@ -39,6 +39,10 @@ export type JQLEditorUIProps = {
39
39
  * Custom components to take over the rendering of certain parts of JQL editor
40
40
  */
41
41
  customComponents?: CustomComponents;
42
+ /**
43
+ * The number of default rows that are visible.
44
+ */
45
+ defaultRows?: number;
42
46
  /**
43
47
  * Enables rich inline nodes feature, which will replace user identifiers with a lozenge containing name and avatar.
44
48
  * Note that you must specify an `onHydrate` prop which will return user data for a given query in order to see the
@@ -57,7 +57,8 @@ declare const JQLEditorLayout: (props: Props) => React.JSX.Element;
57
57
  type ReadOnlyProps = {
58
58
  query: string;
59
59
  };
60
- export declare const JQLEditorReadOnly: ({ isSearch, isCompact, ...props }: ReadOnlyProps & {
60
+ export declare const JQLEditorReadOnly: ({ isSearch, isCompact, defaultRows, ...props }: ReadOnlyProps & {
61
+ defaultRows?: number;
61
62
  isCompact?: boolean;
62
63
  isSearch?: boolean;
63
64
  }) => React.JSX.Element;
@@ -34,6 +34,7 @@ export declare const EditorView: import("@emotion/styled").StyledComponent<{
34
34
  as?: React.ElementType;
35
35
  } & {
36
36
  defaultMaxRows: number;
37
+ defaultRows?: number;
37
38
  expandedRows: number;
38
39
  isCompact: boolean;
39
40
  lineNumbersVisible: boolean;
@@ -43,6 +44,7 @@ export declare const ReadOnlyEditorView: import("@emotion/styled").StyledCompone
43
44
  as?: React.ElementType;
44
45
  } & {
45
46
  defaultMaxRows: number;
47
+ defaultRows?: number;
46
48
  expandedRows: number;
47
49
  isCompact: boolean;
48
50
  lineNumbersVisible: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/jql-editor",
3
- "version": "5.7.1",
3
+ "version": "5.8.1",
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",
@@ -48,12 +48,13 @@
48
48
  "@atlaskit/link": "^3.2.0",
49
49
  "@atlaskit/platform-feature-flags": "^1.1.0",
50
50
  "@atlaskit/popper": "^7.1.0",
51
- "@atlaskit/primitives": "^16.0.0",
51
+ "@atlaskit/primitives": "^16.1.0",
52
52
  "@atlaskit/prosemirror-history": "^0.2.0",
53
53
  "@atlaskit/spinner": "^19.0.0",
54
+ "@atlaskit/teams-avatar": "^2.4.0",
54
55
  "@atlaskit/theme": "^21.0.0",
55
- "@atlaskit/tokens": "^7.0.0",
56
- "@atlaskit/tooltip": "^20.6.0",
56
+ "@atlaskit/tokens": "^7.1.0",
57
+ "@atlaskit/tooltip": "^20.8.0",
57
58
  "@babel/runtime": "^7.0.0",
58
59
  "@emotion/react": "^11.7.1",
59
60
  "@emotion/styled": "^11.0.0",
@@ -77,6 +78,7 @@
77
78
  "@af/integration-testing": "workspace:^",
78
79
  "@atlaskit/docs": "^11.2.0",
79
80
  "@atlaskit/jql-editor-autocomplete-rest": "^3.0.0",
81
+ "@atlassian/feature-flags-storybook-utils": "^0.3.0",
80
82
  "@atlassian/feature-flags-test-utils": "^1.0.0",
81
83
  "@storybook/addon-actions": "^8.6.14",
82
84
  "@storybook/addon-knobs": "^6.4.0",
@@ -142,6 +144,9 @@
142
144
  },
143
145
  "jira_update_jql_teams": {
144
146
  "type": "boolean"
147
+ },
148
+ "list_lovability_improving_filters": {
149
+ "type": "boolean"
145
150
  }
146
151
  }
147
152
  }