@atlaskit/jql-editor 5.2.2 → 5.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlaskit/jql-editor
2
2
 
3
+ ## 5.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#159778](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/159778)
8
+ [`24eb0515f7011`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/24eb0515f7011) -
9
+ Clean up old code path for accessibility fix in error messages section
10
+
11
+ ## 5.3.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#157088](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/157088)
16
+ [`0d5045c49d85a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0d5045c49d85a) -
17
+ We are testing the migration to the ADS Link component behind a feature flag. If this fix is
18
+ successful it will be available in a later release.
19
+
3
20
  ## 5.2.2
4
21
 
5
22
  ### 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.2.2", _jqlEditorCommon.ANALYTICS_CHANNEL);
9
+ return (0, _jqlEditorCommon.useJqlPackageAnalytics)(analyticsSource, "@atlaskit/jql-editor", "5.3.1", _jqlEditorCommon.ANALYTICS_CHANNEL);
10
10
  };
@@ -13,7 +13,6 @@ var _react = _interopRequireWildcard(require("react"));
13
13
  var _reactMagneticDi = require("react-magnetic-di");
14
14
  var _form = require("@atlaskit/form");
15
15
  var _jqlAst = require("@atlaskit/jql-ast");
16
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
16
  var _constants = require("../../../../common/constants");
18
17
  var _messages = require("../../../../common/messages");
19
18
  var _useEditorTheme = require("../../../../hooks/use-editor-theme");
@@ -108,16 +107,11 @@ var ErrorMessages = exports.ErrorMessages = function ErrorMessages() {
108
107
  CustomErrorComponent = _useCustomErrorCompon2[0];
109
108
  var childrenToRender = errorMessages != null ? /*#__PURE__*/_react.default.createElement(_format.MessageContainer, null, /*#__PURE__*/_react.default.createElement(_form.ErrorMessage, {
110
109
  testId: _constants.JQL_EDITOR_VALIDATION_ID
111
- }, (0, _platformFeatureFlags.fg)('jql_editor_a11y') ? /*#__PURE__*/_react.default.createElement("span", {
110
+ }, /*#__PURE__*/_react.default.createElement("span", {
112
111
  role: "alert",
113
112
  id: validationId
114
113
  }, /*#__PURE__*/_react.default.createElement(_format.FormatMessages, {
115
114
  messages: errorMessages
116
- })) : /*#__PURE__*/_react.default.createElement("span", {
117
- role: "alert",
118
- "aria-describedby": editorId
119
- }, /*#__PURE__*/_react.default.createElement(_format.FormatMessages, {
120
- messages: errorMessages
121
115
  })))) : null;
122
116
 
123
117
  // Only render CustomErrorComponent if there is an errorMessage
@@ -13,6 +13,8 @@ var _reactMagneticDi = require("react-magnetic-di");
13
13
  var _form = require("@atlaskit/form");
14
14
  var _warning = _interopRequireDefault(require("@atlaskit/icon/glyph/warning"));
15
15
  var _warning2 = _interopRequireDefault(require("@atlaskit/icon/utility/warning"));
16
+ var _link = _interopRequireDefault(require("@atlaskit/link"));
17
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
18
  var _compiled = require("@atlaskit/primitives/compiled");
17
19
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
18
20
  var _useEditorViewHasWarnings = require("../../../../hooks/use-editor-view-has-warnings");
@@ -70,7 +72,17 @@ var useFormattedWarningMessage = exports.useFormattedWarningMessage = function u
70
72
  } else if (epicLinkDeprecationTerm && parentLinkDeprecationTerm) {
71
73
  return formatWarnings(formatMessage(_messages.messages.deprecatedBothParentReplacementMessage, {
72
74
  link: function link(chunks) {
73
- return /*#__PURE__*/_react.default.createElement("a", {
75
+ return (0, _platformFeatureFlags.fg)('dst-a11y__replace-anchor-with-link__jira-platform-') ? /*#__PURE__*/_react.default.createElement(_link.default, {
76
+ href: softDeprecateEpicParentDocsLink,
77
+ target: "_blank",
78
+ rel: "noopener noreferrer",
79
+ onClick: function onClick(e) {
80
+ return e.stopPropagation();
81
+ }
82
+ }, chunks) :
83
+ /*#__PURE__*/
84
+ // eslint-disable-next-line @atlaskit/design-system/no-html-anchor
85
+ _react.default.createElement("a", {
74
86
  href: softDeprecateEpicParentDocsLink,
75
87
  target: "_blank",
76
88
  rel: "noopener noreferrer",
@@ -86,7 +98,17 @@ var useFormattedWarningMessage = exports.useFormattedWarningMessage = function u
86
98
  } else if (epicLinkDeprecationTerm || parentLinkDeprecationTerm) {
87
99
  return formatWarnings(formatMessage(_messages.messages.deprecatedParentReplacementMessage, {
88
100
  link: function link(chunks) {
89
- return /*#__PURE__*/_react.default.createElement("a", {
101
+ return (0, _platformFeatureFlags.fg)('dst-a11y__replace-anchor-with-link__jira-platform-') ? /*#__PURE__*/_react.default.createElement(_link.default, {
102
+ href: softDeprecateEpicParentDocsLink,
103
+ target: "_blank",
104
+ rel: "noopener noreferrer",
105
+ onClick: function onClick(e) {
106
+ return e.stopPropagation();
107
+ }
108
+ }, chunks) :
109
+ /*#__PURE__*/
110
+ // eslint-disable-next-line @atlaskit/design-system/no-html-anchor
111
+ _react.default.createElement("a", {
90
112
  href: softDeprecateEpicParentDocsLink,
91
113
  target: "_blank",
92
114
  rel: "noopener noreferrer",
@@ -10,7 +10,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var _throttle = _interopRequireDefault(require("lodash/throttle"));
13
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
13
  var _constants = require("../../common/constants");
15
14
  var _useEditorTheme = require("../../hooks/use-editor-theme");
16
15
  var _useEditorViewIsInvalid = require("../../hooks/use-editor-view-is-invalid");
@@ -124,7 +123,7 @@ var JQLEditorView = function JQLEditorView(_ref) {
124
123
  'aria-label': intl.formatMessage(_messages.messages.inputLabel),
125
124
  'aria-controls': autocompleteId,
126
125
  'aria-owns': autocompleteId,
127
- 'aria-describedby': (0, _platformFeatureFlags.fg)('jql_editor_a11y') ? editorViewIsInvalid ? validationId : helpContentId : helpContentId
126
+ 'aria-describedby': editorViewIsInvalid ? validationId : helpContentId
128
127
  }, selectedOptionId && {
129
128
  'aria-activedescendant': selectedOptionId
130
129
  }), editorViewIsInvalid && {
@@ -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.2.2", ANALYTICS_CHANNEL);
3
+ return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.3.1", ANALYTICS_CHANNEL);
4
4
  };
@@ -3,7 +3,6 @@ import React, { useEffect } from 'react';
3
3
  import { di } from 'react-magnetic-di';
4
4
  import { ErrorMessage } from '@atlaskit/form';
5
5
  import { JQLSyntaxError } from '@atlaskit/jql-ast';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
6
  import { JQL_EDITOR_INPUT_ID, JQL_EDITOR_VALIDATION_ID } from '../../../../common/constants';
8
7
  import { commonMessages } from '../../../../common/messages';
9
8
  import { useEditorThemeContext } from '../../../../hooks/use-editor-theme';
@@ -88,16 +87,11 @@ export const ErrorMessages = () => {
88
87
  const [CustomErrorComponent] = useCustomErrorComponent();
89
88
  const childrenToRender = errorMessages != null ? /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(ErrorMessage, {
90
89
  testId: JQL_EDITOR_VALIDATION_ID
91
- }, fg('jql_editor_a11y') ? /*#__PURE__*/React.createElement("span", {
90
+ }, /*#__PURE__*/React.createElement("span", {
92
91
  role: "alert",
93
92
  id: validationId
94
93
  }, /*#__PURE__*/React.createElement(FormatMessages, {
95
94
  messages: errorMessages
96
- })) : /*#__PURE__*/React.createElement("span", {
97
- role: "alert",
98
- "aria-describedby": editorId
99
- }, /*#__PURE__*/React.createElement(FormatMessages, {
100
- messages: errorMessages
101
95
  })))) : null;
102
96
 
103
97
  // Only render CustomErrorComponent if there is an errorMessage
@@ -3,6 +3,8 @@ import { di } from 'react-magnetic-di';
3
3
  import { HelperMessage } from '@atlaskit/form';
4
4
  import LegacyWarningIcon from '@atlaskit/icon/glyph/warning';
5
5
  import WarningIcon from '@atlaskit/icon/utility/warning';
6
+ import Link from '@atlaskit/link';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
6
8
  import { Box } from '@atlaskit/primitives/compiled';
7
9
  import * as colors from '@atlaskit/theme/colors';
8
10
  import { useEditorViewHasWarnings } from '../../../../hooks/use-editor-view-has-warnings';
@@ -51,7 +53,15 @@ export const useFormattedWarningMessage = () => {
51
53
  }));
52
54
  } else if (epicLinkDeprecationTerm && parentLinkDeprecationTerm) {
53
55
  return formatWarnings(formatMessage(messages.deprecatedBothParentReplacementMessage, {
54
- link: chunks => /*#__PURE__*/React.createElement("a", {
56
+ link: chunks => fg('dst-a11y__replace-anchor-with-link__jira-platform-') ? /*#__PURE__*/React.createElement(Link, {
57
+ href: softDeprecateEpicParentDocsLink,
58
+ target: "_blank",
59
+ rel: "noopener noreferrer",
60
+ onClick: e => e.stopPropagation()
61
+ }, chunks) :
62
+ /*#__PURE__*/
63
+ // eslint-disable-next-line @atlaskit/design-system/no-html-anchor
64
+ React.createElement("a", {
55
65
  href: softDeprecateEpicParentDocsLink,
56
66
  target: "_blank",
57
67
  rel: "noopener noreferrer",
@@ -63,7 +73,15 @@ export const useFormattedWarningMessage = () => {
63
73
  }));
64
74
  } else if (epicLinkDeprecationTerm || parentLinkDeprecationTerm) {
65
75
  return formatWarnings(formatMessage(messages.deprecatedParentReplacementMessage, {
66
- link: chunks => /*#__PURE__*/React.createElement("a", {
76
+ link: chunks => fg('dst-a11y__replace-anchor-with-link__jira-platform-') ? /*#__PURE__*/React.createElement(Link, {
77
+ href: softDeprecateEpicParentDocsLink,
78
+ target: "_blank",
79
+ rel: "noopener noreferrer",
80
+ onClick: e => e.stopPropagation()
81
+ }, chunks) :
82
+ /*#__PURE__*/
83
+ // eslint-disable-next-line @atlaskit/design-system/no-html-anchor
84
+ React.createElement("a", {
67
85
  href: softDeprecateEpicParentDocsLink,
68
86
  target: "_blank",
69
87
  rel: "noopener noreferrer",
@@ -1,6 +1,5 @@
1
1
  import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
2
2
  import throttle from 'lodash/throttle';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { JQL_EDITOR_AUTOCOMPLETE_ID, JQL_EDITOR_HELP_CONTENT_ID, JQL_EDITOR_INPUT_ID, JQL_EDITOR_MAIN_ID, JQL_EDITOR_VALIDATION_ID } from '../../common/constants';
5
4
  import { useEditorThemeContext } from '../../hooks/use-editor-theme';
6
5
  import { useEditorViewIsInvalid } from '../../hooks/use-editor-view-is-invalid';
@@ -91,7 +90,7 @@ const JQLEditorView = ({
91
90
  'aria-label': intl.formatMessage(messages.inputLabel),
92
91
  'aria-controls': autocompleteId,
93
92
  'aria-owns': autocompleteId,
94
- 'aria-describedby': fg('jql_editor_a11y') ? editorViewIsInvalid ? validationId : helpContentId : helpContentId,
93
+ 'aria-describedby': editorViewIsInvalid ? validationId : helpContentId,
95
94
  ...(selectedOptionId && {
96
95
  'aria-activedescendant': selectedOptionId
97
96
  }),
@@ -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.2.2", ANALYTICS_CHANNEL);
3
+ return useJqlPackageAnalytics(analyticsSource, "@atlaskit/jql-editor", "5.3.1", ANALYTICS_CHANNEL);
4
4
  };
@@ -6,7 +6,6 @@ import React, { useEffect } from 'react';
6
6
  import { di } from 'react-magnetic-di';
7
7
  import { ErrorMessage } from '@atlaskit/form';
8
8
  import { JQLSyntaxError } from '@atlaskit/jql-ast';
9
- import { fg } from '@atlaskit/platform-feature-flags';
10
9
  import { JQL_EDITOR_INPUT_ID, JQL_EDITOR_VALIDATION_ID } from '../../../../common/constants';
11
10
  import { commonMessages } from '../../../../common/messages';
12
11
  import { useEditorThemeContext } from '../../../../hooks/use-editor-theme';
@@ -99,16 +98,11 @@ export var ErrorMessages = function ErrorMessages() {
99
98
  CustomErrorComponent = _useCustomErrorCompon2[0];
100
99
  var childrenToRender = errorMessages != null ? /*#__PURE__*/React.createElement(MessageContainer, null, /*#__PURE__*/React.createElement(ErrorMessage, {
101
100
  testId: JQL_EDITOR_VALIDATION_ID
102
- }, fg('jql_editor_a11y') ? /*#__PURE__*/React.createElement("span", {
101
+ }, /*#__PURE__*/React.createElement("span", {
103
102
  role: "alert",
104
103
  id: validationId
105
104
  }, /*#__PURE__*/React.createElement(FormatMessages, {
106
105
  messages: errorMessages
107
- })) : /*#__PURE__*/React.createElement("span", {
108
- role: "alert",
109
- "aria-describedby": editorId
110
- }, /*#__PURE__*/React.createElement(FormatMessages, {
111
- messages: errorMessages
112
106
  })))) : null;
113
107
 
114
108
  // Only render CustomErrorComponent if there is an errorMessage
@@ -5,6 +5,8 @@ import { di } from 'react-magnetic-di';
5
5
  import { HelperMessage } from '@atlaskit/form';
6
6
  import LegacyWarningIcon from '@atlaskit/icon/glyph/warning';
7
7
  import WarningIcon from '@atlaskit/icon/utility/warning';
8
+ import Link from '@atlaskit/link';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
8
10
  import { Box } from '@atlaskit/primitives/compiled';
9
11
  import * as colors from '@atlaskit/theme/colors';
10
12
  import { useEditorViewHasWarnings } from '../../../../hooks/use-editor-view-has-warnings';
@@ -60,7 +62,17 @@ export var useFormattedWarningMessage = function useFormattedWarningMessage() {
60
62
  } else if (epicLinkDeprecationTerm && parentLinkDeprecationTerm) {
61
63
  return formatWarnings(formatMessage(messages.deprecatedBothParentReplacementMessage, {
62
64
  link: function link(chunks) {
63
- return /*#__PURE__*/React.createElement("a", {
65
+ return fg('dst-a11y__replace-anchor-with-link__jira-platform-') ? /*#__PURE__*/React.createElement(Link, {
66
+ href: softDeprecateEpicParentDocsLink,
67
+ target: "_blank",
68
+ rel: "noopener noreferrer",
69
+ onClick: function onClick(e) {
70
+ return e.stopPropagation();
71
+ }
72
+ }, chunks) :
73
+ /*#__PURE__*/
74
+ // eslint-disable-next-line @atlaskit/design-system/no-html-anchor
75
+ React.createElement("a", {
64
76
  href: softDeprecateEpicParentDocsLink,
65
77
  target: "_blank",
66
78
  rel: "noopener noreferrer",
@@ -76,7 +88,17 @@ export var useFormattedWarningMessage = function useFormattedWarningMessage() {
76
88
  } else if (epicLinkDeprecationTerm || parentLinkDeprecationTerm) {
77
89
  return formatWarnings(formatMessage(messages.deprecatedParentReplacementMessage, {
78
90
  link: function link(chunks) {
79
- return /*#__PURE__*/React.createElement("a", {
91
+ return fg('dst-a11y__replace-anchor-with-link__jira-platform-') ? /*#__PURE__*/React.createElement(Link, {
92
+ href: softDeprecateEpicParentDocsLink,
93
+ target: "_blank",
94
+ rel: "noopener noreferrer",
95
+ onClick: function onClick(e) {
96
+ return e.stopPropagation();
97
+ }
98
+ }, chunks) :
99
+ /*#__PURE__*/
100
+ // eslint-disable-next-line @atlaskit/design-system/no-html-anchor
101
+ React.createElement("a", {
80
102
  href: softDeprecateEpicParentDocsLink,
81
103
  target: "_blank",
82
104
  rel: "noopener noreferrer",
@@ -4,7 +4,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
4
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; }
5
5
  import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef } from 'react';
6
6
  import throttle from 'lodash/throttle';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { JQL_EDITOR_AUTOCOMPLETE_ID, JQL_EDITOR_HELP_CONTENT_ID, JQL_EDITOR_INPUT_ID, JQL_EDITOR_MAIN_ID, JQL_EDITOR_VALIDATION_ID } from '../../common/constants';
9
8
  import { useEditorThemeContext } from '../../hooks/use-editor-theme';
10
9
  import { useEditorViewIsInvalid } from '../../hooks/use-editor-view-is-invalid';
@@ -116,7 +115,7 @@ var JQLEditorView = function JQLEditorView(_ref) {
116
115
  'aria-label': intl.formatMessage(messages.inputLabel),
117
116
  'aria-controls': autocompleteId,
118
117
  'aria-owns': autocompleteId,
119
- 'aria-describedby': fg('jql_editor_a11y') ? editorViewIsInvalid ? validationId : helpContentId : helpContentId
118
+ 'aria-describedby': editorViewIsInvalid ? validationId : helpContentId
120
119
  }, selectedOptionId && {
121
120
  'aria-activedescendant': selectedOptionId
122
121
  }), editorViewIsInvalid && {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/jql-editor",
3
- "version": "5.2.2",
3
+ "version": "5.3.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",
@@ -39,21 +39,22 @@
39
39
  "dependencies": {
40
40
  "@atlaskit/analytics-gas-types": "^5.1.0",
41
41
  "@atlaskit/analytics-next": "^11.0.0",
42
- "@atlaskit/avatar": "^25.0.0",
43
- "@atlaskit/button": "^23.0.0",
42
+ "@atlaskit/avatar": "^25.1.0",
43
+ "@atlaskit/button": "^23.2.0",
44
44
  "@atlaskit/editor-prosemirror": "7.0.0",
45
45
  "@atlaskit/form": "^12.0.0",
46
- "@atlaskit/icon": "^26.0.0",
46
+ "@atlaskit/icon": "^26.1.0",
47
47
  "@atlaskit/jql-ast": "^3.3.0",
48
48
  "@atlaskit/jql-autocomplete": "^2.0.0",
49
49
  "@atlaskit/jql-editor-common": "^3.0.0",
50
50
  "@atlaskit/jql-parser": "^2.0.0",
51
51
  "@atlaskit/legacy-custom-icons": "^0.22.0",
52
+ "@atlaskit/link": "^3.2.0",
52
53
  "@atlaskit/platform-feature-flags": "^1.1.0",
53
- "@atlaskit/primitives": "^14.7.0",
54
+ "@atlaskit/primitives": "^14.8.0",
54
55
  "@atlaskit/spinner": "^18.0.0",
55
56
  "@atlaskit/theme": "^18.0.0",
56
- "@atlaskit/tokens": "^4.8.0",
57
+ "@atlaskit/tokens": "^4.9.0",
57
58
  "@atlaskit/tooltip": "^20.0.0",
58
59
  "@babel/runtime": "^7.0.0",
59
60
  "@emotion/react": "^11.7.1",
@@ -134,7 +135,7 @@
134
135
  "add_nin_press_interactions": {
135
136
  "type": "boolean"
136
137
  },
137
- "jql_editor_a11y": {
138
+ "dst-a11y__replace-anchor-with-link__jira-platform-": {
138
139
  "type": "boolean"
139
140
  }
140
141
  }