@atlaskit/editor-plugin-type-ahead 2.1.4 → 2.1.5

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,14 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 2.1.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [#122662](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/122662)
8
+ [`4b5cbb4f25f54`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4b5cbb4f25f54) -
9
+ FD-80149: cleans up platform_editor_react18_phase2_v2 in typeahead
10
+ - Updated dependencies
11
+
3
12
  ## 2.1.4
4
13
 
5
14
  ### Patch Changes
@@ -1,30 +1,21 @@
1
1
  "use strict";
2
2
 
3
3
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- var _typeof = require("@babel/runtime/helpers/typeof");
5
4
  Object.defineProperty(exports, "__esModule", {
6
5
  value: true
7
6
  });
8
- exports.AssistiveTextNew = exports.AssistiveText = void 0;
7
+ exports.AssistiveText = void 0;
9
8
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
11
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
12
- var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
13
- var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
14
- var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
15
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
- var _react = _interopRequireWildcard(require("react"));
9
+ var _react = require("react");
17
10
  var _react2 = require("@emotion/react");
18
11
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
19
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
- function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
21
- function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
22
- function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
23
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); } /**
12
+ /**
24
13
  * @jsxRuntime classic
25
14
  * @jsx jsx
26
- */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
27
- var statusDebounceMillis = 1400;
15
+ */
16
+
17
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
+
28
19
  var assitiveTextStyles = (0, _react2.css)({
29
20
  border: 0,
30
21
  clip: 'rect(0 0 0 0)',
@@ -37,105 +28,15 @@ var assitiveTextStyles = (0, _react2.css)({
37
28
  whitespace: 'nowrap',
38
29
  width: '1px'
39
30
  });
40
-
41
- // Ignored via go/ees005
42
- // eslint-disable-next-line @repo/internal/react/no-class-components
43
- var AssistveTextOld = /*#__PURE__*/function (_React$Component) {
44
- function AssistveTextOld() {
45
- var _this;
46
- (0, _classCallCheck2.default)(this, AssistveTextOld);
47
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
48
- args[_key] = arguments[_key];
49
- }
50
- _this = _callSuper(this, AssistveTextOld, [].concat(args));
51
- (0, _defineProperty2.default)(_this, "state", {
52
- bump: false,
53
- //when the same text needs to be read again, Hence it needs to be toggled between __status--A and __status--B
54
- debounced: false,
55
- silenced: false
56
- });
57
- return _this;
58
- }
59
- (0, _inherits2.default)(AssistveTextOld, _React$Component);
60
- return (0, _createClass2.default)(AssistveTextOld, [{
61
- key: "UNSAFE_componentWillMount",
62
- value: function UNSAFE_componentWillMount() {
63
- var _this2 = this;
64
- this.debounceStatusUpdate = (0, _debounce.default)(function () {
65
- if (!_this2.state.debounced) {
66
- var shouldSilence = !_this2.props.isInFocus;
67
- _this2.setState(function (_ref) {
68
- var bump = _ref.bump;
69
- return {
70
- bump: !bump,
71
- debounced: true,
72
- silenced: shouldSilence
73
- };
74
- });
75
- }
76
- }, statusDebounceMillis);
77
- }
78
- }, {
79
- key: "UNSAFE_componentWillUnmount",
80
- value: function UNSAFE_componentWillUnmount() {
81
- this.debounceStatusUpdate.cancel();
82
- }
83
- }, {
84
- key: "UNSAFE_componentWillReceiveProps",
85
- value: function UNSAFE_componentWillReceiveProps() {
86
- this.setState(function (_ref2) {
87
- var bump = _ref2.bump;
88
- return {
89
- bump: !bump,
90
- debounced: false
91
- };
92
- });
93
- }
94
- }, {
95
- key: "render",
96
- value: function render() {
97
- var _this$props = this.props,
98
- assistiveText = _this$props.assistiveText,
99
- id = _this$props.id;
100
- var _this$state = this.state,
101
- bump = _this$state.bump,
102
- debounced = _this$state.debounced,
103
- silenced = _this$state.silenced;
104
- this.debounceStatusUpdate();
105
- return (0, _react2.jsx)("div", {
106
- css: assitiveTextStyles
107
- }, (0, _react2.jsx)("div", {
108
- "data-testId": id + '__status--A',
109
- id: id + '__status--A',
110
- role: "status",
111
- "aria-atomic": "true",
112
- "aria-live": "polite"
113
- }, "".concat(!silenced && debounced && bump ? assistiveText : '')), (0, _react2.jsx)("div", {
114
- "data-testId": id + '__status--B',
115
- id: id + '__status--B',
116
- role: "status",
117
- "aria-atomic": "true",
118
- "aria-live": "polite"
119
- }, "".concat(!silenced && debounced && !bump ? assistiveText : '')));
120
- }
121
- }]);
122
- }(_react.default.Component);
123
- (0, _defineProperty2.default)(AssistveTextOld, "defaultProps", {
124
- statusDebounceMillis: 1400,
125
- debounce: true,
126
- assistiveText: '',
127
- isInFocus: false,
128
- id: ''
129
- });
130
- var AssistiveTextNew = exports.AssistiveTextNew = function AssistiveTextNew(_ref3) {
131
- var _ref3$assistiveText = _ref3.assistiveText,
132
- assistiveText = _ref3$assistiveText === void 0 ? '' : _ref3$assistiveText,
133
- _ref3$isInFocus = _ref3.isInFocus,
134
- isInFocus = _ref3$isInFocus === void 0 ? false : _ref3$isInFocus,
135
- _ref3$id = _ref3.id,
136
- id = _ref3$id === void 0 ? '' : _ref3$id,
137
- _ref3$statusDebounceM = _ref3.statusDebounceMillis,
138
- statusDebounceMillis = _ref3$statusDebounceM === void 0 ? 1400 : _ref3$statusDebounceM;
31
+ var AssistiveText = exports.AssistiveText = function AssistiveText(_ref) {
32
+ var _ref$assistiveText = _ref.assistiveText,
33
+ assistiveText = _ref$assistiveText === void 0 ? '' : _ref$assistiveText,
34
+ _ref$isInFocus = _ref.isInFocus,
35
+ isInFocus = _ref$isInFocus === void 0 ? false : _ref$isInFocus,
36
+ _ref$id = _ref.id,
37
+ id = _ref$id === void 0 ? '' : _ref$id,
38
+ _ref$statusDebounceMi = _ref.statusDebounceMillis,
39
+ statusDebounceMillis = _ref$statusDebounceMi === void 0 ? 1400 : _ref$statusDebounceMi;
139
40
  var _useState = (0, _react.useState)(false),
140
41
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
141
42
  bump = _useState2[0],
@@ -190,15 +91,4 @@ var AssistiveTextNew = exports.AssistiveTextNew = function AssistiveTextNew(_ref
190
91
  "aria-atomic": "true",
191
92
  "aria-live": "polite"
192
93
  }, !silenced && debounced && !bump ? assistiveText : ''));
193
- };
194
- var AssistiveText = exports.AssistiveText = function AssistiveText(props) {
195
- if ((0, _platformFeatureFlags.fg)('platform_editor_react18_phase2_v2')) {
196
- // Ignored via go/ees005
197
- // eslint-disable-next-line react/jsx-props-no-spreading
198
- return (0, _react2.jsx)(AssistiveTextNew, props);
199
- } else {
200
- // Ignored via go/ees005
201
- // eslint-disable-next-line react/jsx-props-no-spreading
202
- return (0, _react2.jsx)(AssistveTextOld, props);
203
- }
204
94
  };
@@ -22,7 +22,7 @@ function ContentComponent(_ref) {
22
22
  return null;
23
23
  }
24
24
  if (
25
- // TODO: Also requires a check for editor appearance (needs to be enabled for full-page/full-width editor only ?)
25
+ // TODO: ED-26959 - Also requires a check for editor appearance (needs to be enabled for full-page/full-width editor only ?)
26
26
  !(0, _experiments.editorExperiment)('platform_editor_insertion', 'control') && ((_typeAheadState$trigg = typeAheadState.triggerHandler) === null || _typeAheadState$trigg === void 0 ? void 0 : _typeAheadState$trigg.id) === _typeAhead.TypeAheadAvailableNodes.QUICK_INSERT) {
27
27
  return /*#__PURE__*/_react.default.createElement(_TypeAheadMenu.TypeAheadMenu, {
28
28
  editorView: editorView,
@@ -52,7 +52,7 @@ var querySpanStyles = (0, _react2.css)({
52
52
  background: 'transparent',
53
53
  padding: 0,
54
54
  margin: 0,
55
- // ED-17022 Fixes firefox caret position
55
+ // TODO: ED-17022 - Fixes firefox caret position
56
56
  // Do not migrate font when em is used as unit
57
57
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
58
58
  fontSize: '1em',
@@ -179,7 +179,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
179
179
  }
180
180
  break;
181
181
  case 'Enter':
182
- // ED-14758 - Under the W3C specification, any keycode sent under IME would return a keycode 229
182
+ // TODO: ED-14758 - Under the W3C specification, any keycode sent under IME would return a keycode 229
183
183
  // event.isComposing can't be used alone as this also included a virtual keyboard under a keyboardless device, therefore, it seems the best practice would be intercepting the event as below.
184
184
  // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
185
185
  if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
@@ -214,7 +214,7 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
214
214
  selectPreviousItem();
215
215
  selectNextItem();
216
216
  }
217
- // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
217
+ // TODO: DTR-1401 - why is this calling select item when hitting tab? fix this in DTR-1401
218
218
  onItemSelect(_typeAhead.SelectItemMode.TAB);
219
219
  break;
220
220
  case 'ArrowDown':
@@ -230,7 +230,7 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
230
230
  event.stopPropagation();
231
231
  break;
232
232
 
233
- // TODO DTR-1401: why is this calling item click when hitting tab? fix this in DTR-1401
233
+ // TODO: DTR-1401 - why is this calling item click when hitting tab? fix this in DTR-1401
234
234
  case 'Tab':
235
235
  //Tab key quick inserts the selected item.
236
236
  onItemClick(_typeAhead.SelectItemMode.TAB, selectedIndex);
@@ -249,7 +249,7 @@ var TypeAheadListItem = exports.TypeAheadListItem = /*#__PURE__*/_react.default.
249
249
  isSelected: isSelected,
250
250
  "aria-selected": isSelected,
251
251
  "aria-label": title
252
- // TODO: aria-description is in draft for ARIA 1.3.
252
+ // TODO: ED-26959 - aria-description is in draft for ARIA 1.3.
253
253
  // For now replace it with aria-describedby.
254
254
  // eslint-disable-next-line jsx-a11y/aria-props
255
255
  ,
@@ -268,7 +268,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
268
268
  };
269
269
  }, [ref, cancel]);
270
270
 
271
- // ED-17443 When you press escape on typeahead panel, it should remove focus and close the panel
271
+ // TODO: ED-17443 - When you press escape on typeahead panel, it should remove focus and close the panel
272
272
  // This is the expected keyboard behaviour advised by the Accessibility team
273
273
  (0, _react.useLayoutEffect)(function () {
274
274
  var escape = function escape(event) {
@@ -294,7 +294,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
294
294
  // @ts-ignore
295
295
  var openElementBrowserModal = triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.openElementBrowserModal;
296
296
  var onViewMoreClick = (0, _react.useCallback)(function () {
297
- // TODO: when clean up, remove config in quick insert plugin
297
+ // TODO: ED-26959 - when clean up, remove config in quick insert plugin
298
298
  // platform/packages/editor/editor-plugin-quick-insert/src/quickInsertPlugin.tsx (typeAhead.openElementBrowserModal)
299
299
  openElementBrowserModal === null || openElementBrowserModal === void 0 || openElementBrowserModal();
300
300
  cancel({
@@ -257,7 +257,7 @@ var TypeAheadPopup = exports.TypeAheadPopup = /*#__PURE__*/_react.default.memo(f
257
257
  };
258
258
  }, [ref, cancel]);
259
259
 
260
- // ED-17443 When you press escape on typeahead panel, it should remove focus and close the panel
260
+ // TODO: ED-17443 - When you press escape on typeahead panel, it should remove focus and close the panel
261
261
  // This is the expected keyboard behaviour advised by the Accessibility team
262
262
  (0, _react.useLayoutEffect)(function () {
263
263
  var escape = function escape(event) {
@@ -1,16 +1,13 @@
1
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
1
  /**
3
2
  * @jsxRuntime classic
4
3
  * @jsx jsx
5
4
  */
6
5
 
7
- import React, { useEffect, useMemo, useState } from 'react';
6
+ import { useEffect, useMemo, useState } from 'react';
8
7
 
9
8
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
9
  import { css, jsx } from '@emotion/react';
11
10
  import debounce from 'lodash/debounce';
12
- import { fg } from '@atlaskit/platform-feature-flags';
13
- const statusDebounceMillis = 1400;
14
11
  const assitiveTextStyles = css({
15
12
  border: 0,
16
13
  clip: 'rect(0 0 0 0)',
@@ -23,80 +20,7 @@ const assitiveTextStyles = css({
23
20
  whitespace: 'nowrap',
24
21
  width: '1px'
25
22
  });
26
-
27
- // Ignored via go/ees005
28
- // eslint-disable-next-line @repo/internal/react/no-class-components
29
- class AssistveTextOld extends React.Component {
30
- constructor(...args) {
31
- super(...args);
32
- _defineProperty(this, "state", {
33
- bump: false,
34
- //when the same text needs to be read again, Hence it needs to be toggled between __status--A and __status--B
35
- debounced: false,
36
- silenced: false
37
- });
38
- }
39
- UNSAFE_componentWillMount() {
40
- this.debounceStatusUpdate = debounce(() => {
41
- if (!this.state.debounced) {
42
- const shouldSilence = !this.props.isInFocus;
43
- this.setState(({
44
- bump
45
- }) => ({
46
- bump: !bump,
47
- debounced: true,
48
- silenced: shouldSilence
49
- }));
50
- }
51
- }, statusDebounceMillis);
52
- }
53
- UNSAFE_componentWillUnmount() {
54
- this.debounceStatusUpdate.cancel();
55
- }
56
- UNSAFE_componentWillReceiveProps() {
57
- this.setState(({
58
- bump
59
- }) => ({
60
- bump: !bump,
61
- debounced: false
62
- }));
63
- }
64
- render() {
65
- const {
66
- assistiveText,
67
- id
68
- } = this.props;
69
- const {
70
- bump,
71
- debounced,
72
- silenced
73
- } = this.state;
74
- this.debounceStatusUpdate();
75
- return jsx("div", {
76
- css: assitiveTextStyles
77
- }, jsx("div", {
78
- "data-testId": id + '__status--A',
79
- id: id + '__status--A',
80
- role: "status",
81
- "aria-atomic": "true",
82
- "aria-live": "polite"
83
- }, `${!silenced && debounced && bump ? assistiveText : ''}`), jsx("div", {
84
- "data-testId": id + '__status--B',
85
- id: id + '__status--B',
86
- role: "status",
87
- "aria-atomic": "true",
88
- "aria-live": "polite"
89
- }, `${!silenced && debounced && !bump ? assistiveText : ''}`));
90
- }
91
- }
92
- _defineProperty(AssistveTextOld, "defaultProps", {
93
- statusDebounceMillis: 1400,
94
- debounce: true,
95
- assistiveText: '',
96
- isInFocus: false,
97
- id: ''
98
- });
99
- export const AssistiveTextNew = ({
23
+ export const AssistiveText = ({
100
24
  assistiveText = '',
101
25
  isInFocus = false,
102
26
  id = '',
@@ -141,15 +65,4 @@ export const AssistiveTextNew = ({
141
65
  "aria-atomic": "true",
142
66
  "aria-live": "polite"
143
67
  }, !silenced && debounced && !bump ? assistiveText : ''));
144
- };
145
- export const AssistiveText = props => {
146
- if (fg('platform_editor_react18_phase2_v2')) {
147
- // Ignored via go/ees005
148
- // eslint-disable-next-line react/jsx-props-no-spreading
149
- return jsx(AssistiveTextNew, props);
150
- } else {
151
- // Ignored via go/ees005
152
- // eslint-disable-next-line react/jsx-props-no-spreading
153
- return jsx(AssistveTextOld, props);
154
- }
155
68
  };
@@ -17,7 +17,7 @@ export function ContentComponent({
17
17
  return null;
18
18
  }
19
19
  if (
20
- // TODO: Also requires a check for editor appearance (needs to be enabled for full-page/full-width editor only ?)
20
+ // TODO: ED-26959 - Also requires a check for editor appearance (needs to be enabled for full-page/full-width editor only ?)
21
21
  !editorExperiment('platform_editor_insertion', 'control') && ((_typeAheadState$trigg = typeAheadState.triggerHandler) === null || _typeAheadState$trigg === void 0 ? void 0 : _typeAheadState$trigg.id) === TypeAheadAvailableNodes.QUICK_INSERT) {
22
22
  return /*#__PURE__*/React.createElement(TypeAheadMenuModern, {
23
23
  editorView: editorView,
@@ -40,7 +40,7 @@ const querySpanStyles = css({
40
40
  background: 'transparent',
41
41
  padding: 0,
42
42
  margin: 0,
43
- // ED-17022 Fixes firefox caret position
43
+ // TODO: ED-17022 - Fixes firefox caret position
44
44
  // Do not migrate font when em is used as unit
45
45
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
46
46
  fontSize: '1em',
@@ -160,7 +160,7 @@ export const InputQuery = /*#__PURE__*/React.memo(({
160
160
  }
161
161
  break;
162
162
  case 'Enter':
163
- // ED-14758 - Under the W3C specification, any keycode sent under IME would return a keycode 229
163
+ // TODO: ED-14758 - Under the W3C specification, any keycode sent under IME would return a keycode 229
164
164
  // event.isComposing can't be used alone as this also included a virtual keyboard under a keyboardless device, therefore, it seems the best practice would be intercepting the event as below.
165
165
  // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
166
166
  if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
@@ -195,7 +195,7 @@ export const InputQuery = /*#__PURE__*/React.memo(({
195
195
  selectPreviousItem();
196
196
  selectNextItem();
197
197
  }
198
- // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
198
+ // TODO: DTR-1401 - why is this calling select item when hitting tab? fix this in DTR-1401
199
199
  onItemSelect(SelectItemMode.TAB);
200
200
  break;
201
201
  case 'ArrowDown':
@@ -212,7 +212,7 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
212
212
  event.stopPropagation();
213
213
  break;
214
214
 
215
- // TODO DTR-1401: why is this calling item click when hitting tab? fix this in DTR-1401
215
+ // TODO: DTR-1401 - why is this calling item click when hitting tab? fix this in DTR-1401
216
216
  case 'Tab':
217
217
  //Tab key quick inserts the selected item.
218
218
  onItemClick(SelectItemMode.TAB, selectedIndex);
@@ -262,7 +262,7 @@ export const TypeAheadListItem = /*#__PURE__*/React.memo(({
262
262
  isSelected: isSelected,
263
263
  "aria-selected": isSelected,
264
264
  "aria-label": title
265
- // TODO: aria-description is in draft for ARIA 1.3.
265
+ // TODO: ED-26959 - aria-description is in draft for ARIA 1.3.
266
266
  // For now replace it with aria-describedby.
267
267
  // eslint-disable-next-line jsx-a11y/aria-props
268
268
  ,
@@ -259,7 +259,7 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
259
259
  };
260
260
  }, [ref, cancel]);
261
261
 
262
- // ED-17443 When you press escape on typeahead panel, it should remove focus and close the panel
262
+ // TODO: ED-17443 - When you press escape on typeahead panel, it should remove focus and close the panel
263
263
  // This is the expected keyboard behaviour advised by the Accessibility team
264
264
  useLayoutEffect(() => {
265
265
  const escape = event => {
@@ -287,7 +287,7 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
287
287
  // @ts-ignore
288
288
  const openElementBrowserModal = triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.openElementBrowserModal;
289
289
  const onViewMoreClick = useCallback(() => {
290
- // TODO: when clean up, remove config in quick insert plugin
290
+ // TODO: ED-26959 - when clean up, remove config in quick insert plugin
291
291
  // platform/packages/editor/editor-plugin-quick-insert/src/quickInsertPlugin.tsx (typeAhead.openElementBrowserModal)
292
292
  openElementBrowserModal === null || openElementBrowserModal === void 0 ? void 0 : openElementBrowserModal();
293
293
  cancel({
@@ -250,7 +250,7 @@ export const TypeAheadPopup = /*#__PURE__*/React.memo(props => {
250
250
  };
251
251
  }, [ref, cancel]);
252
252
 
253
- // ED-17443 When you press escape on typeahead panel, it should remove focus and close the panel
253
+ // TODO: ED-17443 - When you press escape on typeahead panel, it should remove focus and close the panel
254
254
  // This is the expected keyboard behaviour advised by the Accessibility team
255
255
  useLayoutEffect(() => {
256
256
  const escape = event => {
@@ -1,24 +1,14 @@
1
1
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
- import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
3
- import _createClass from "@babel/runtime/helpers/createClass";
4
- import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
5
- import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
6
- import _inherits from "@babel/runtime/helpers/inherits";
7
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
8
- function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
9
- function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
10
2
  /**
11
3
  * @jsxRuntime classic
12
4
  * @jsx jsx
13
5
  */
14
6
 
15
- import React, { useEffect, useMemo, useState } from 'react';
7
+ import { useEffect, useMemo, useState } from 'react';
16
8
 
17
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
18
10
  import { css, jsx } from '@emotion/react';
19
11
  import debounce from 'lodash/debounce';
20
- import { fg } from '@atlaskit/platform-feature-flags';
21
- var statusDebounceMillis = 1400;
22
12
  var assitiveTextStyles = css({
23
13
  border: 0,
24
14
  clip: 'rect(0 0 0 0)',
@@ -31,105 +21,15 @@ var assitiveTextStyles = css({
31
21
  whitespace: 'nowrap',
32
22
  width: '1px'
33
23
  });
34
-
35
- // Ignored via go/ees005
36
- // eslint-disable-next-line @repo/internal/react/no-class-components
37
- var AssistveTextOld = /*#__PURE__*/function (_React$Component) {
38
- function AssistveTextOld() {
39
- var _this;
40
- _classCallCheck(this, AssistveTextOld);
41
- for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
42
- args[_key] = arguments[_key];
43
- }
44
- _this = _callSuper(this, AssistveTextOld, [].concat(args));
45
- _defineProperty(_this, "state", {
46
- bump: false,
47
- //when the same text needs to be read again, Hence it needs to be toggled between __status--A and __status--B
48
- debounced: false,
49
- silenced: false
50
- });
51
- return _this;
52
- }
53
- _inherits(AssistveTextOld, _React$Component);
54
- return _createClass(AssistveTextOld, [{
55
- key: "UNSAFE_componentWillMount",
56
- value: function UNSAFE_componentWillMount() {
57
- var _this2 = this;
58
- this.debounceStatusUpdate = debounce(function () {
59
- if (!_this2.state.debounced) {
60
- var shouldSilence = !_this2.props.isInFocus;
61
- _this2.setState(function (_ref) {
62
- var bump = _ref.bump;
63
- return {
64
- bump: !bump,
65
- debounced: true,
66
- silenced: shouldSilence
67
- };
68
- });
69
- }
70
- }, statusDebounceMillis);
71
- }
72
- }, {
73
- key: "UNSAFE_componentWillUnmount",
74
- value: function UNSAFE_componentWillUnmount() {
75
- this.debounceStatusUpdate.cancel();
76
- }
77
- }, {
78
- key: "UNSAFE_componentWillReceiveProps",
79
- value: function UNSAFE_componentWillReceiveProps() {
80
- this.setState(function (_ref2) {
81
- var bump = _ref2.bump;
82
- return {
83
- bump: !bump,
84
- debounced: false
85
- };
86
- });
87
- }
88
- }, {
89
- key: "render",
90
- value: function render() {
91
- var _this$props = this.props,
92
- assistiveText = _this$props.assistiveText,
93
- id = _this$props.id;
94
- var _this$state = this.state,
95
- bump = _this$state.bump,
96
- debounced = _this$state.debounced,
97
- silenced = _this$state.silenced;
98
- this.debounceStatusUpdate();
99
- return jsx("div", {
100
- css: assitiveTextStyles
101
- }, jsx("div", {
102
- "data-testId": id + '__status--A',
103
- id: id + '__status--A',
104
- role: "status",
105
- "aria-atomic": "true",
106
- "aria-live": "polite"
107
- }, "".concat(!silenced && debounced && bump ? assistiveText : '')), jsx("div", {
108
- "data-testId": id + '__status--B',
109
- id: id + '__status--B',
110
- role: "status",
111
- "aria-atomic": "true",
112
- "aria-live": "polite"
113
- }, "".concat(!silenced && debounced && !bump ? assistiveText : '')));
114
- }
115
- }]);
116
- }(React.Component);
117
- _defineProperty(AssistveTextOld, "defaultProps", {
118
- statusDebounceMillis: 1400,
119
- debounce: true,
120
- assistiveText: '',
121
- isInFocus: false,
122
- id: ''
123
- });
124
- export var AssistiveTextNew = function AssistiveTextNew(_ref3) {
125
- var _ref3$assistiveText = _ref3.assistiveText,
126
- assistiveText = _ref3$assistiveText === void 0 ? '' : _ref3$assistiveText,
127
- _ref3$isInFocus = _ref3.isInFocus,
128
- isInFocus = _ref3$isInFocus === void 0 ? false : _ref3$isInFocus,
129
- _ref3$id = _ref3.id,
130
- id = _ref3$id === void 0 ? '' : _ref3$id,
131
- _ref3$statusDebounceM = _ref3.statusDebounceMillis,
132
- statusDebounceMillis = _ref3$statusDebounceM === void 0 ? 1400 : _ref3$statusDebounceM;
24
+ export var AssistiveText = function AssistiveText(_ref) {
25
+ var _ref$assistiveText = _ref.assistiveText,
26
+ assistiveText = _ref$assistiveText === void 0 ? '' : _ref$assistiveText,
27
+ _ref$isInFocus = _ref.isInFocus,
28
+ isInFocus = _ref$isInFocus === void 0 ? false : _ref$isInFocus,
29
+ _ref$id = _ref.id,
30
+ id = _ref$id === void 0 ? '' : _ref$id,
31
+ _ref$statusDebounceMi = _ref.statusDebounceMillis,
32
+ statusDebounceMillis = _ref$statusDebounceMi === void 0 ? 1400 : _ref$statusDebounceMi;
133
33
  var _useState = useState(false),
134
34
  _useState2 = _slicedToArray(_useState, 2),
135
35
  bump = _useState2[0],
@@ -184,15 +84,4 @@ export var AssistiveTextNew = function AssistiveTextNew(_ref3) {
184
84
  "aria-atomic": "true",
185
85
  "aria-live": "polite"
186
86
  }, !silenced && debounced && !bump ? assistiveText : ''));
187
- };
188
- export var AssistiveText = function AssistiveText(props) {
189
- if (fg('platform_editor_react18_phase2_v2')) {
190
- // Ignored via go/ees005
191
- // eslint-disable-next-line react/jsx-props-no-spreading
192
- return jsx(AssistiveTextNew, props);
193
- } else {
194
- // Ignored via go/ees005
195
- // eslint-disable-next-line react/jsx-props-no-spreading
196
- return jsx(AssistveTextOld, props);
197
- }
198
87
  };
@@ -15,7 +15,7 @@ export function ContentComponent(_ref) {
15
15
  return null;
16
16
  }
17
17
  if (
18
- // TODO: Also requires a check for editor appearance (needs to be enabled for full-page/full-width editor only ?)
18
+ // TODO: ED-26959 - Also requires a check for editor appearance (needs to be enabled for full-page/full-width editor only ?)
19
19
  !editorExperiment('platform_editor_insertion', 'control') && ((_typeAheadState$trigg = typeAheadState.triggerHandler) === null || _typeAheadState$trigg === void 0 ? void 0 : _typeAheadState$trigg.id) === TypeAheadAvailableNodes.QUICK_INSERT) {
20
20
  return /*#__PURE__*/React.createElement(TypeAheadMenuModern, {
21
21
  editorView: editorView,
@@ -41,7 +41,7 @@ var querySpanStyles = css({
41
41
  background: 'transparent',
42
42
  padding: 0,
43
43
  margin: 0,
44
- // ED-17022 Fixes firefox caret position
44
+ // TODO: ED-17022 - Fixes firefox caret position
45
45
  // Do not migrate font when em is used as unit
46
46
  // eslint-disable-next-line @atlaskit/design-system/use-tokens-typography
47
47
  fontSize: '1em',
@@ -168,7 +168,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
168
168
  }
169
169
  break;
170
170
  case 'Enter':
171
- // ED-14758 - Under the W3C specification, any keycode sent under IME would return a keycode 229
171
+ // TODO: ED-14758 - Under the W3C specification, any keycode sent under IME would return a keycode 229
172
172
  // event.isComposing can't be used alone as this also included a virtual keyboard under a keyboardless device, therefore, it seems the best practice would be intercepting the event as below.
173
173
  // Some suggested the other workaround maybe listen on`keypress` instead of `keydown`
174
174
  if (!event.isComposing && event.which !== 229 && event.keyCode !== 229) {
@@ -203,7 +203,7 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
203
203
  selectPreviousItem();
204
204
  selectNextItem();
205
205
  }
206
- // TODO DTR-1401: why is this calling select item when hitting tab? fix this in DTR-1401
206
+ // TODO: DTR-1401 - why is this calling select item when hitting tab? fix this in DTR-1401
207
207
  onItemSelect(SelectItemMode.TAB);
208
208
  break;
209
209
  case 'ArrowDown':
@@ -220,7 +220,7 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
220
220
  event.stopPropagation();
221
221
  break;
222
222
 
223
- // TODO DTR-1401: why is this calling item click when hitting tab? fix this in DTR-1401
223
+ // TODO: DTR-1401 - why is this calling item click when hitting tab? fix this in DTR-1401
224
224
  case 'Tab':
225
225
  //Tab key quick inserts the selected item.
226
226
  onItemClick(SelectItemMode.TAB, selectedIndex);
@@ -240,7 +240,7 @@ export var TypeAheadListItem = /*#__PURE__*/React.memo(function (_ref2) {
240
240
  isSelected: isSelected,
241
241
  "aria-selected": isSelected,
242
242
  "aria-label": title
243
- // TODO: aria-description is in draft for ARIA 1.3.
243
+ // TODO: ED-26959 - aria-description is in draft for ARIA 1.3.
244
244
  // For now replace it with aria-describedby.
245
245
  // eslint-disable-next-line jsx-a11y/aria-props
246
246
  ,
@@ -257,7 +257,7 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
257
257
  };
258
258
  }, [ref, cancel]);
259
259
 
260
- // ED-17443 When you press escape on typeahead panel, it should remove focus and close the panel
260
+ // TODO: ED-17443 - When you press escape on typeahead panel, it should remove focus and close the panel
261
261
  // This is the expected keyboard behaviour advised by the Accessibility team
262
262
  useLayoutEffect(function () {
263
263
  var escape = function escape(event) {
@@ -283,7 +283,7 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
283
283
  // @ts-ignore
284
284
  var openElementBrowserModal = triggerHandler === null || triggerHandler === void 0 ? void 0 : triggerHandler.openElementBrowserModal;
285
285
  var onViewMoreClick = useCallback(function () {
286
- // TODO: when clean up, remove config in quick insert plugin
286
+ // TODO: ED-26959 - when clean up, remove config in quick insert plugin
287
287
  // platform/packages/editor/editor-plugin-quick-insert/src/quickInsertPlugin.tsx (typeAhead.openElementBrowserModal)
288
288
  openElementBrowserModal === null || openElementBrowserModal === void 0 || openElementBrowserModal();
289
289
  cancel({
@@ -247,7 +247,7 @@ export var TypeAheadPopup = /*#__PURE__*/React.memo(function (props) {
247
247
  };
248
248
  }, [ref, cancel]);
249
249
 
250
- // ED-17443 When you press escape on typeahead panel, it should remove focus and close the panel
250
+ // TODO: ED-17443 - When you press escape on typeahead panel, it should remove focus and close the panel
251
251
  // This is the expected keyboard behaviour advised by the Accessibility team
252
252
  useLayoutEffect(function () {
253
253
  var escape = function escape(event) {
@@ -10,6 +10,5 @@ type AssistiveTextProps = {
10
10
  statusDebounceMillis?: number;
11
11
  debounce?: boolean;
12
12
  };
13
- export declare const AssistiveTextNew: ({ assistiveText, isInFocus, id, statusDebounceMillis, }: AssistiveTextProps) => jsx.JSX.Element;
14
- export declare const AssistiveText: (props: AssistiveTextProps) => jsx.JSX.Element;
13
+ export declare const AssistiveText: ({ assistiveText, isInFocus, id, statusDebounceMillis, }: AssistiveTextProps) => jsx.JSX.Element;
15
14
  export {};
@@ -10,6 +10,5 @@ type AssistiveTextProps = {
10
10
  statusDebounceMillis?: number;
11
11
  debounce?: boolean;
12
12
  };
13
- export declare const AssistiveTextNew: ({ assistiveText, isInFocus, id, statusDebounceMillis, }: AssistiveTextProps) => jsx.JSX.Element;
14
- export declare const AssistiveText: (props: AssistiveTextProps) => jsx.JSX.Element;
13
+ export declare const AssistiveText: ({ assistiveText, isInFocus, id, statusDebounceMillis, }: AssistiveTextProps) => jsx.JSX.Element;
15
14
  export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "2.1.4",
3
+ "version": "2.1.5",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^47.6.0",
37
- "@atlaskit/editor-common": "^102.0.0",
37
+ "@atlaskit/editor-common": "^102.3.0",
38
38
  "@atlaskit/editor-element-browser": "^0.1.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^2.1.0",
40
40
  "@atlaskit/editor-plugin-connectivity": "^2.0.0",
@@ -48,7 +48,7 @@
48
48
  "@atlaskit/primitives": "^14.1.0",
49
49
  "@atlaskit/prosemirror-input-rules": "^3.3.0",
50
50
  "@atlaskit/theme": "^18.0.0",
51
- "@atlaskit/tmp-editor-statsig": "^3.4.0",
51
+ "@atlaskit/tmp-editor-statsig": "^3.5.0",
52
52
  "@atlaskit/tokens": "^4.3.0",
53
53
  "@babel/runtime": "^7.0.0",
54
54
  "@emotion/react": "^11.7.1",
@@ -95,9 +95,6 @@
95
95
  }
96
96
  },
97
97
  "platform-feature-flags": {
98
- "platform_editor_react18_phase2_v2": {
99
- "type": "boolean"
100
- },
101
98
  "platform_editor_offline_editing_ga": {
102
99
  "type": "boolean"
103
100
  },