@atlaskit/editor-plugin-type-ahead 6.1.1 → 6.3.0

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,25 @@
1
1
  # @atlaskit/editor-plugin-type-ahead
2
2
 
3
+ ## 6.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`2cfe444a49320`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2cfe444a49320) -
8
+ [https://product-fabric.atlassian.net/browse/ED-29474](ED-29474) - bump react-virtualized version
9
+ to 9.22.6
10
+
11
+ ## 6.2.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`97586ad447624`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/97586ad447624) -
16
+ [ux] Add a feature gate to remove the onClick handler from type-ahead InpuQuery to fix the a11y
17
+ violation
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 6.1.1
4
24
 
5
25
  ### Patch Changes
@@ -245,6 +245,8 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
245
245
  return false;
246
246
  }
247
247
  }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state, isEditorControlsEnabled]);
248
+
249
+ // Remove when cleaning up platform_editor_a11y_remove_input_query_on_click
248
250
  var onClick = (0, _react.useCallback)(function (event) {
249
251
  var _inputRef$current;
250
252
  event.stopPropagation();
@@ -476,18 +478,13 @@ var InputQuery = exports.InputQuery = /*#__PURE__*/_react.default.memo(function
476
478
  }, [showPlaceholder, selection]);
477
479
  var assistiveHintID = _constants.TYPE_AHEAD_DECORATION_ELEMENT_ID + '__assistiveHint';
478
480
  var intl = (0, _reactIntlNext.useIntl)();
479
-
480
- /**
481
- When we migrated to emotion from styled component, we started getting this error.
482
- jsx-a11y/interactive-supports-focus
483
- Task added in https://product-fabric.atlassian.net/wiki/spaces/E/pages/3182068181/Potential+improvements#Moderate-changes.
484
- */
485
481
  return (0, _react2.jsx)(_react.Fragment, null, triggerQueryPrefix, (0, _react2.jsx)("span", {
486
482
  css: [querySpanStyles, isSearchPlaceholderEnabled && queryWithoutPlaceholderStyles, showPlaceholder && placeholderStyles],
487
483
  contentEditable: true,
488
484
  ref: ref,
489
485
  onKeyUp: onKeyUp,
490
- onClick: onClick,
486
+ onClick: (0, _platformFeatureFlags.fg)('platform_editor_a11y_remove_input_query_on_click') ? undefined : onClick,
487
+ tabIndex: (0, _platformFeatureFlags.fg)('platform_editor_a11y_remove_input_query_on_click') ? -1 : undefined,
491
488
  onInput: isSearchPlaceholderEnabled ? onInput : undefined,
492
489
  role: "combobox",
493
490
  "aria-controls": _constants.TYPE_AHEAD_DECORATION_ELEMENT_ID,
@@ -4,7 +4,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.ListRow = ListRow;
7
+ exports.ListRow = void 0;
8
8
  var _react = _interopRequireWildcard(require("react"));
9
9
  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); }
10
10
  /**
@@ -20,9 +20,9 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
20
20
  * @param root0.onMouseMove
21
21
  * @example
22
22
  */
23
- function ListRow(_ref) {
23
+ // The `CellMeasurer` component from react-virtualized expects that his children is a `forwardRef` component.
24
+ var ListRow = exports.ListRow = /*#__PURE__*/(0, _react.forwardRef)(function (_ref, ref) {
24
25
  var children = _ref.children,
25
- registerChild = _ref.registerChild,
26
26
  measure = _ref.measure,
27
27
  index = _ref.index,
28
28
  style = _ref.style,
@@ -30,9 +30,6 @@ function ListRow(_ref) {
30
30
  isScrolling = _ref.isScrolling,
31
31
  onMouseMove = _ref.onMouseMove;
32
32
  var childElementRef = (0, _react.useRef)(null);
33
- var setListElementRef = function setListElementRef(element) {
34
- registerChild === null || registerChild === void 0 || registerChild(element !== null && element !== void 0 ? element : undefined);
35
- };
36
33
  (0, _react.useEffect)(function () {
37
34
  // Do not measure if the row is not visible or is scrolling for performance reasons.
38
35
  if (!childElementRef.current || !isVisible || isScrolling) {
@@ -50,7 +47,7 @@ function ListRow(_ref) {
50
47
  /*#__PURE__*/
51
48
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
52
49
  _react.default.createElement("div", {
53
- ref: setListElementRef,
50
+ ref: ref,
54
51
  style: style,
55
52
  "data-index": index
56
53
  }, /*#__PURE__*/_react.default.createElement("div", {
@@ -59,4 +56,4 @@ function ListRow(_ref) {
59
56
  onMouseMove: onMouseMove
60
57
  }, children))
61
58
  );
62
- }
59
+ });
@@ -297,10 +297,8 @@ var TypeAheadListComponent = /*#__PURE__*/_react.default.memo(function (_ref2) {
297
297
  columnIndex: 0,
298
298
  rowIndex: index
299
299
  }, function (_ref6) {
300
- var measure = _ref6.measure,
301
- registerChild = _ref6.registerChild;
300
+ var measure = _ref6.measure;
302
301
  return (0, _react2.jsx)(_ListRow.ListRow, {
303
- registerChild: registerChild,
304
302
  measure: measure,
305
303
  index: index
306
304
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
@@ -229,6 +229,8 @@ export const InputQuery = /*#__PURE__*/React.memo(({
229
229
  return false;
230
230
  }
231
231
  }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state, isEditorControlsEnabled]);
232
+
233
+ // Remove when cleaning up platform_editor_a11y_remove_input_query_on_click
232
234
  const onClick = useCallback(event => {
233
235
  var _inputRef$current;
234
236
  event.stopPropagation();
@@ -469,18 +471,13 @@ export const InputQuery = /*#__PURE__*/React.memo(({
469
471
  }, [showPlaceholder, selection]);
470
472
  const assistiveHintID = TYPE_AHEAD_DECORATION_ELEMENT_ID + '__assistiveHint';
471
473
  const intl = useIntl();
472
-
473
- /**
474
- When we migrated to emotion from styled component, we started getting this error.
475
- jsx-a11y/interactive-supports-focus
476
- Task added in https://product-fabric.atlassian.net/wiki/spaces/E/pages/3182068181/Potential+improvements#Moderate-changes.
477
- */
478
474
  return jsx(Fragment, null, triggerQueryPrefix, jsx("span", {
479
475
  css: [querySpanStyles, isSearchPlaceholderEnabled && queryWithoutPlaceholderStyles, showPlaceholder && placeholderStyles],
480
476
  contentEditable: true,
481
477
  ref: ref,
482
478
  onKeyUp: onKeyUp,
483
- onClick: onClick,
479
+ onClick: fg('platform_editor_a11y_remove_input_query_on_click') ? undefined : onClick,
480
+ tabIndex: fg('platform_editor_a11y_remove_input_query_on_click') ? -1 : undefined,
484
481
  onInput: isSearchPlaceholderEnabled ? onInput : undefined,
485
482
  role: "combobox",
486
483
  "aria-controls": TYPE_AHEAD_DECORATION_ELEMENT_ID,
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef } from 'react';
1
+ import React, { useEffect, useRef, forwardRef } from 'react';
2
2
  /**
3
3
  *
4
4
  * @param root0
@@ -12,20 +12,17 @@ import React, { useEffect, useRef } from 'react';
12
12
  * @param root0.onMouseMove
13
13
  * @example
14
14
  */
15
- export function ListRow({
15
+ // The `CellMeasurer` component from react-virtualized expects that his children is a `forwardRef` component.
16
+ export const ListRow = /*#__PURE__*/forwardRef(({
16
17
  children,
17
- registerChild,
18
18
  measure,
19
19
  index,
20
20
  style,
21
21
  isVisible,
22
22
  isScrolling,
23
23
  onMouseMove
24
- }) {
24
+ }, ref) => {
25
25
  const childElementRef = useRef(null);
26
- const setListElementRef = element => {
27
- registerChild === null || registerChild === void 0 ? void 0 : registerChild(element !== null && element !== void 0 ? element : undefined);
28
- };
29
26
  useEffect(() => {
30
27
  // Do not measure if the row is not visible or is scrolling for performance reasons.
31
28
  if (!childElementRef.current || !isVisible || isScrolling) {
@@ -39,7 +36,7 @@ export function ListRow({
39
36
  /*#__PURE__*/
40
37
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
41
38
  React.createElement("div", {
42
- ref: setListElementRef,
39
+ ref: ref,
43
40
  style: style,
44
41
  "data-index": index
45
42
  }, /*#__PURE__*/React.createElement("div", {
@@ -48,4 +45,4 @@ export function ListRow({
48
45
  onMouseMove: onMouseMove
49
46
  }, children))
50
47
  );
51
- }
48
+ });
@@ -280,10 +280,8 @@ const TypeAheadListComponent = /*#__PURE__*/React.memo(({
280
280
  columnIndex: 0,
281
281
  rowIndex: index
282
282
  }, ({
283
- measure,
284
- registerChild
283
+ measure
285
284
  }) => jsx(ListRow, {
286
- registerChild: registerChild,
287
285
  measure: measure,
288
286
  index: index
289
287
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
@@ -235,6 +235,8 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
235
235
  return false;
236
236
  }
237
237
  }, [onUndoRedo, onItemSelect, selectNextItem, selectPreviousItem, cancel, cleanedInputContent, editorView.state, isEditorControlsEnabled]);
238
+
239
+ // Remove when cleaning up platform_editor_a11y_remove_input_query_on_click
238
240
  var onClick = useCallback(function (event) {
239
241
  var _inputRef$current;
240
242
  event.stopPropagation();
@@ -466,18 +468,13 @@ export var InputQuery = /*#__PURE__*/React.memo(function (_ref) {
466
468
  }, [showPlaceholder, selection]);
467
469
  var assistiveHintID = TYPE_AHEAD_DECORATION_ELEMENT_ID + '__assistiveHint';
468
470
  var intl = useIntl();
469
-
470
- /**
471
- When we migrated to emotion from styled component, we started getting this error.
472
- jsx-a11y/interactive-supports-focus
473
- Task added in https://product-fabric.atlassian.net/wiki/spaces/E/pages/3182068181/Potential+improvements#Moderate-changes.
474
- */
475
471
  return jsx(Fragment, null, triggerQueryPrefix, jsx("span", {
476
472
  css: [querySpanStyles, isSearchPlaceholderEnabled && queryWithoutPlaceholderStyles, showPlaceholder && placeholderStyles],
477
473
  contentEditable: true,
478
474
  ref: ref,
479
475
  onKeyUp: onKeyUp,
480
- onClick: onClick,
476
+ onClick: fg('platform_editor_a11y_remove_input_query_on_click') ? undefined : onClick,
477
+ tabIndex: fg('platform_editor_a11y_remove_input_query_on_click') ? -1 : undefined,
481
478
  onInput: isSearchPlaceholderEnabled ? onInput : undefined,
482
479
  role: "combobox",
483
480
  "aria-controls": TYPE_AHEAD_DECORATION_ELEMENT_ID,
@@ -1,4 +1,4 @@
1
- import React, { useEffect, useRef } from 'react';
1
+ import React, { useEffect, useRef, forwardRef } from 'react';
2
2
  /**
3
3
  *
4
4
  * @param root0
@@ -12,9 +12,9 @@ import React, { useEffect, useRef } from 'react';
12
12
  * @param root0.onMouseMove
13
13
  * @example
14
14
  */
15
- export function ListRow(_ref) {
15
+ // The `CellMeasurer` component from react-virtualized expects that his children is a `forwardRef` component.
16
+ export var ListRow = /*#__PURE__*/forwardRef(function (_ref, ref) {
16
17
  var children = _ref.children,
17
- registerChild = _ref.registerChild,
18
18
  measure = _ref.measure,
19
19
  index = _ref.index,
20
20
  style = _ref.style,
@@ -22,9 +22,6 @@ export function ListRow(_ref) {
22
22
  isScrolling = _ref.isScrolling,
23
23
  onMouseMove = _ref.onMouseMove;
24
24
  var childElementRef = useRef(null);
25
- var setListElementRef = function setListElementRef(element) {
26
- registerChild === null || registerChild === void 0 || registerChild(element !== null && element !== void 0 ? element : undefined);
27
- };
28
25
  useEffect(function () {
29
26
  // Do not measure if the row is not visible or is scrolling for performance reasons.
30
27
  if (!childElementRef.current || !isVisible || isScrolling) {
@@ -42,7 +39,7 @@ export function ListRow(_ref) {
42
39
  /*#__PURE__*/
43
40
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
44
41
  React.createElement("div", {
45
- ref: setListElementRef,
42
+ ref: ref,
46
43
  style: style,
47
44
  "data-index": index
48
45
  }, /*#__PURE__*/React.createElement("div", {
@@ -51,4 +48,4 @@ export function ListRow(_ref) {
51
48
  onMouseMove: onMouseMove
52
49
  }, children))
53
50
  );
54
- }
51
+ });
@@ -288,10 +288,8 @@ var TypeAheadListComponent = /*#__PURE__*/React.memo(function (_ref2) {
288
288
  columnIndex: 0,
289
289
  rowIndex: index
290
290
  }, function (_ref6) {
291
- var measure = _ref6.measure,
292
- registerChild = _ref6.registerChild;
291
+ var measure = _ref6.measure;
293
292
  return jsx(ListRow, {
294
- registerChild: registerChild,
295
293
  measure: measure,
296
294
  index: index
297
295
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
@@ -1,11 +1,5 @@
1
1
  import React, { type ReactNode, type MouseEventHandler } from 'react';
2
2
  import { type ListRowProps } from 'react-virtualized';
3
- type Props = {
4
- children: ReactNode;
5
- measure: () => void;
6
- onMouseMove: MouseEventHandler<HTMLDivElement>;
7
- registerChild?: (element?: Element) => void;
8
- } & Pick<ListRowProps, 'index' | 'style' | 'isScrolling' | 'isVisible'>;
9
3
  /**
10
4
  *
11
5
  * @param root0
@@ -19,5 +13,8 @@ type Props = {
19
13
  * @param root0.onMouseMove
20
14
  * @example
21
15
  */
22
- export declare function ListRow({ children, registerChild, measure, index, style, isVisible, isScrolling, onMouseMove, }: Props): React.JSX.Element;
23
- export {};
16
+ export declare const ListRow: React.ForwardRefExoticComponent<{
17
+ children: ReactNode;
18
+ measure: () => void;
19
+ onMouseMove: MouseEventHandler<HTMLDivElement>;
20
+ } & Pick<ListRowProps, "index" | "style" | "isScrolling" | "isVisible"> & React.RefAttributes<HTMLDivElement>>;
@@ -1,11 +1,5 @@
1
1
  import React, { type ReactNode, type MouseEventHandler } from 'react';
2
2
  import { type ListRowProps } from 'react-virtualized';
3
- type Props = {
4
- children: ReactNode;
5
- measure: () => void;
6
- onMouseMove: MouseEventHandler<HTMLDivElement>;
7
- registerChild?: (element?: Element) => void;
8
- } & Pick<ListRowProps, 'index' | 'style' | 'isScrolling' | 'isVisible'>;
9
3
  /**
10
4
  *
11
5
  * @param root0
@@ -19,5 +13,8 @@ type Props = {
19
13
  * @param root0.onMouseMove
20
14
  * @example
21
15
  */
22
- export declare function ListRow({ children, registerChild, measure, index, style, isVisible, isScrolling, onMouseMove, }: Props): React.JSX.Element;
23
- export {};
16
+ export declare const ListRow: React.ForwardRefExoticComponent<{
17
+ children: ReactNode;
18
+ measure: () => void;
19
+ onMouseMove: MouseEventHandler<HTMLDivElement>;
20
+ } & Pick<ListRowProps, "index" | "style" | "isScrolling" | "isVisible"> & React.RefAttributes<HTMLDivElement>>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-type-ahead",
3
- "version": "6.1.1",
3
+ "version": "6.3.0",
4
4
  "description": "Type-ahead plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -38,25 +38,25 @@
38
38
  "@atlaskit/editor-prosemirror": "7.0.0",
39
39
  "@atlaskit/editor-shared-styles": "^3.6.0",
40
40
  "@atlaskit/heading": "^5.2.0",
41
- "@atlaskit/icon": "^28.3.0",
41
+ "@atlaskit/icon": "^28.4.0",
42
42
  "@atlaskit/insm": "^0.1.0",
43
43
  "@atlaskit/menu": "^8.4.0",
44
44
  "@atlaskit/platform-feature-flags": "^1.1.0",
45
45
  "@atlaskit/primitives": "^14.15.0",
46
46
  "@atlaskit/prosemirror-input-rules": "^3.4.0",
47
47
  "@atlaskit/theme": "^21.0.0",
48
- "@atlaskit/tmp-editor-statsig": "^13.0.0",
48
+ "@atlaskit/tmp-editor-statsig": "^13.4.0",
49
49
  "@atlaskit/tokens": "^6.4.0",
50
50
  "@babel/runtime": "^7.0.0",
51
51
  "@emotion/react": "^11.7.1",
52
52
  "lodash": "^4.17.21",
53
53
  "raf-schd": "^4.0.3",
54
- "react-virtualized": "^9.8.0",
54
+ "react-virtualized": "^9.22.6",
55
55
  "uuid": "^3.1.0",
56
56
  "w3c-keyname": "^2.1.8"
57
57
  },
58
58
  "peerDependencies": {
59
- "@atlaskit/editor-common": "^110.4.0",
59
+ "@atlaskit/editor-common": "^110.7.0",
60
60
  "react": "^18.2.0",
61
61
  "react-dom": "^18.2.0",
62
62
  "react-intl-next": "npm:react-intl@^5.18.1"
@@ -108,6 +108,9 @@
108
108
  },
109
109
  "platform_editor_ai_rovo_rebrand": {
110
110
  "type": "boolean"
111
+ },
112
+ "platform_editor_a11y_remove_input_query_on_click": {
113
+ "type": "boolean"
111
114
  }
112
115
  }
113
116
  }