@atlaskit/editor-plugin-status 3.1.9 → 3.1.10

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-status
2
2
 
3
+ ## 3.1.10
4
+
5
+ ### Patch Changes
6
+
7
+ - [#139158](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139158)
8
+ [`e535a2a6ac9ea`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e535a2a6ac9ea) -
9
+ [ux] [A11Y-10038] Announce status popup when it opens and let users know how to access the popup
10
+ - Updated dependencies
11
+
3
12
  ## 3.1.9
4
13
 
5
14
  ### Patch Changes
@@ -13,13 +13,17 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
14
14
  var _react = _interopRequireDefault(require("react"));
15
15
  var _react2 = require("@emotion/react");
16
+ var _reactIntlNext = require("react-intl-next");
16
17
  var _analyticsNext = require("@atlaskit/analytics-next");
18
+ var _messages = require("@atlaskit/editor-common/messages");
17
19
  var _ui = require("@atlaskit/editor-common/ui");
18
20
  var _uiReact = require("@atlaskit/editor-common/ui-react");
19
21
  var _editorSharedStyles = require("@atlaskit/editor-shared-styles");
22
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
23
  var _picker = require("@atlaskit/status/picker");
21
24
  var _colors = require("@atlaskit/theme/colors");
22
25
  var _constants = require("@atlaskit/theme/constants");
26
+ var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
23
27
  var _actions = require("../pm-plugins/actions");
24
28
  var _analytics = require("./analytics");
25
29
  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)); }
@@ -57,11 +61,11 @@ var pickerContainerStyles = (0, _react2.css)({
57
61
  });
58
62
 
59
63
  // eslint-disable-next-line @repo/internal/react/no-class-components
60
- var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
61
- function StatusPickerWithoutAnalytcs(props) {
64
+ var StatusPickerWithIntl = /*#__PURE__*/function (_React$Component) {
65
+ function StatusPickerWithIntl(props) {
62
66
  var _this;
63
- (0, _classCallCheck2.default)(this, StatusPickerWithoutAnalytcs);
64
- _this = _callSuper(this, StatusPickerWithoutAnalytcs, [props]);
67
+ (0, _classCallCheck2.default)(this, StatusPickerWithIntl);
68
+ _this = _callSuper(this, StatusPickerWithIntl, [props]);
65
69
  (0, _defineProperty2.default)(_this, "handleClickOutside", function (event) {
66
70
  event.preventDefault();
67
71
  _this.inputMethod = InputMethod.blur;
@@ -190,8 +194,8 @@ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PUR
190
194
  _this.popupBodyWrapper = /*#__PURE__*/_react.default.createRef();
191
195
  return _this;
192
196
  }
193
- (0, _inherits2.default)(StatusPickerWithoutAnalytcs, _React$Component);
194
- return (0, _createClass2.default)(StatusPickerWithoutAnalytcs, [{
197
+ (0, _inherits2.default)(StatusPickerWithIntl, _React$Component);
198
+ return (0, _createClass2.default)(StatusPickerWithIntl, [{
195
199
  key: "fireStatusPopupOpenedAnalytics",
196
200
  value: function fireStatusPopupOpenedAnalytics(state) {
197
201
  var color = state.color,
@@ -320,7 +324,8 @@ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PUR
320
324
  mountTo = _this$props2.mountTo,
321
325
  boundariesElement = _this$props2.boundariesElement,
322
326
  scrollableElement = _this$props2.scrollableElement,
323
- editorView = _this$props2.editorView;
327
+ editorView = _this$props2.editorView,
328
+ intl = _this$props2.intl;
324
329
  if (!(editorView !== null && editorView !== void 0 && editorView.editable)) {
325
330
  return null;
326
331
  }
@@ -335,8 +340,12 @@ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PUR
335
340
  boundariesElement: boundariesElement,
336
341
  scrollableElement: scrollableElement,
337
342
  closeOnTab: false
338
- }, (0, _react2.jsx)(_uiReact.OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
343
+ }, (0, _platformFeatureFlags.fg)('editor_a11y_announce_status_editor_open') && (0, _react2.jsx)(_visuallyHidden.default, {
344
+ "aria-atomic": true,
345
+ role: "alert"
346
+ }, intl.formatMessage(_messages.statusMessages.statusPickerOpenedAlert)), (0, _react2.jsx)(_uiReact.OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
339
347
  }
340
348
  }]);
341
349
  }(_react.default.Component);
350
+ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = (0, _reactIntlNext.injectIntl)(StatusPickerWithIntl);
342
351
  var _default = exports.default = (0, _analyticsNext.withAnalyticsEvents)()(StatusPickerWithoutAnalytcs);
@@ -8,13 +8,17 @@ import React from 'react';
8
8
 
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
  import { css, jsx } from '@emotion/react';
11
+ import { injectIntl } from 'react-intl-next';
11
12
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
13
+ import { statusMessages as messages } from '@atlaskit/editor-common/messages';
12
14
  import { Popup } from '@atlaskit/editor-common/ui';
13
15
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
14
16
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
17
+ import { fg } from '@atlaskit/platform-feature-flags';
15
18
  import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
16
19
  import { N0 } from '@atlaskit/theme/colors';
17
20
  import { borderRadius } from '@atlaskit/theme/constants';
21
+ import VisuallyHidden from '@atlaskit/visually-hidden';
18
22
  import { DEFAULT_STATUS } from '../pm-plugins/actions';
19
23
  import { analyticsState, createStatusAnalyticsAndFire } from './analytics';
20
24
  const PopupWithListeners = withOuterListeners(Popup);
@@ -47,7 +51,7 @@ const pickerContainerStyles = css({
47
51
  });
48
52
 
49
53
  // eslint-disable-next-line @repo/internal/react/no-class-components
50
- export class StatusPickerWithoutAnalytcs extends React.Component {
54
+ class StatusPickerWithIntl extends React.Component {
51
55
  constructor(props) {
52
56
  super(props);
53
57
  _defineProperty(this, "handleClickOutside", event => {
@@ -293,7 +297,8 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
293
297
  mountTo,
294
298
  boundariesElement,
295
299
  scrollableElement,
296
- editorView
300
+ editorView,
301
+ intl
297
302
  } = this.props;
298
303
  if (!(editorView !== null && editorView !== void 0 && editorView.editable)) {
299
304
  return null;
@@ -309,7 +314,11 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
309
314
  boundariesElement: boundariesElement,
310
315
  scrollableElement: scrollableElement,
311
316
  closeOnTab: false
312
- }, jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
317
+ }, fg('editor_a11y_announce_status_editor_open') && jsx(VisuallyHidden, {
318
+ "aria-atomic": true,
319
+ role: "alert"
320
+ }, intl.formatMessage(messages.statusPickerOpenedAlert)), jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
313
321
  }
314
322
  }
323
+ export const StatusPickerWithoutAnalytcs = injectIntl(StatusPickerWithIntl);
315
324
  export default withAnalyticsEvents()(StatusPickerWithoutAnalytcs);
@@ -15,13 +15,17 @@ import React from 'react';
15
15
 
16
16
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
17
17
  import { css, jsx } from '@emotion/react';
18
+ import { injectIntl } from 'react-intl-next';
18
19
  import { withAnalyticsEvents } from '@atlaskit/analytics-next';
20
+ import { statusMessages as messages } from '@atlaskit/editor-common/messages';
19
21
  import { Popup } from '@atlaskit/editor-common/ui';
20
22
  import { OutsideClickTargetRefContext, withReactEditorViewOuterListeners as withOuterListeners } from '@atlaskit/editor-common/ui-react';
21
23
  import { akEditorFloatingDialogZIndex } from '@atlaskit/editor-shared-styles';
24
+ import { fg } from '@atlaskit/platform-feature-flags';
22
25
  import { StatusPicker as AkStatusPicker } from '@atlaskit/status/picker';
23
26
  import { N0 } from '@atlaskit/theme/colors';
24
27
  import { borderRadius } from '@atlaskit/theme/constants';
28
+ import VisuallyHidden from '@atlaskit/visually-hidden';
25
29
  import { DEFAULT_STATUS } from '../pm-plugins/actions';
26
30
  import { analyticsState, createStatusAnalyticsAndFire } from './analytics';
27
31
  var PopupWithListeners = withOuterListeners(Popup);
@@ -54,11 +58,11 @@ var pickerContainerStyles = css({
54
58
  });
55
59
 
56
60
  // eslint-disable-next-line @repo/internal/react/no-class-components
57
- export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component) {
58
- function StatusPickerWithoutAnalytcs(props) {
61
+ var StatusPickerWithIntl = /*#__PURE__*/function (_React$Component) {
62
+ function StatusPickerWithIntl(props) {
59
63
  var _this;
60
- _classCallCheck(this, StatusPickerWithoutAnalytcs);
61
- _this = _callSuper(this, StatusPickerWithoutAnalytcs, [props]);
64
+ _classCallCheck(this, StatusPickerWithIntl);
65
+ _this = _callSuper(this, StatusPickerWithIntl, [props]);
62
66
  _defineProperty(_this, "handleClickOutside", function (event) {
63
67
  event.preventDefault();
64
68
  _this.inputMethod = InputMethod.blur;
@@ -187,8 +191,8 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
187
191
  _this.popupBodyWrapper = /*#__PURE__*/React.createRef();
188
192
  return _this;
189
193
  }
190
- _inherits(StatusPickerWithoutAnalytcs, _React$Component);
191
- return _createClass(StatusPickerWithoutAnalytcs, [{
194
+ _inherits(StatusPickerWithIntl, _React$Component);
195
+ return _createClass(StatusPickerWithIntl, [{
192
196
  key: "fireStatusPopupOpenedAnalytics",
193
197
  value: function fireStatusPopupOpenedAnalytics(state) {
194
198
  var color = state.color,
@@ -317,7 +321,8 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
317
321
  mountTo = _this$props2.mountTo,
318
322
  boundariesElement = _this$props2.boundariesElement,
319
323
  scrollableElement = _this$props2.scrollableElement,
320
- editorView = _this$props2.editorView;
324
+ editorView = _this$props2.editorView,
325
+ intl = _this$props2.intl;
321
326
  if (!(editorView !== null && editorView !== void 0 && editorView.editable)) {
322
327
  return null;
323
328
  }
@@ -332,8 +337,12 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
332
337
  boundariesElement: boundariesElement,
333
338
  scrollableElement: scrollableElement,
334
339
  closeOnTab: false
335
- }, jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
340
+ }, fg('editor_a11y_announce_status_editor_open') && jsx(VisuallyHidden, {
341
+ "aria-atomic": true,
342
+ role: "alert"
343
+ }, intl.formatMessage(messages.statusPickerOpenedAlert)), jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
336
344
  }
337
345
  }]);
338
346
  }(React.Component);
347
+ export var StatusPickerWithoutAnalytcs = injectIntl(StatusPickerWithIntl);
339
348
  export default withAnalyticsEvents()(StatusPickerWithoutAnalytcs);
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { jsx } from '@emotion/react';
2
+ import { type WrappedComponentProps } from 'react-intl-next';
3
3
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { ColorType as Color } from '@atlaskit/status/picker';
@@ -29,6 +29,7 @@ export interface Props {
29
29
  boundariesElement?: HTMLElement;
30
30
  scrollableElement?: HTMLElement;
31
31
  editorView: EditorView;
32
+ intl: WrappedComponentProps['intl'];
32
33
  }
33
34
  export interface State {
34
35
  color: Color;
@@ -36,33 +37,10 @@ export interface State {
36
37
  localId?: string;
37
38
  isNew?: boolean;
38
39
  }
39
- export declare class StatusPickerWithoutAnalytcs extends React.Component<Props, State> {
40
- private startTime;
41
- private inputMethod?;
42
- private createStatusAnalyticsAndFireFunc;
43
- private popupBodyWrapper;
44
- private focusTimeout;
45
- constructor(props: Props);
46
- private fireStatusPopupOpenedAnalytics;
47
- private fireStatusPopupClosedAnalytics;
48
- private reset;
49
- componentDidMount(): void;
50
- componentWillUnmount(): void;
51
- componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<State>): void;
52
- private extractStateFromProps;
53
- handleClickOutside: (event: Event) => void;
54
- private handleEscapeKeydown;
55
- private handleTabPress;
56
- private handleArrow;
57
- private onKeyDown;
58
- private setRef;
59
- private renderWithSetOutsideClickTargetRef;
60
- render(): jsx.JSX.Element | null;
61
- private onColorHover;
62
- private onColorClick;
63
- private onTextChanged;
64
- private onEnter;
65
- private handlePopupClick;
66
- }
67
- declare const _default: React.ForwardRefExoticComponent<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>;
40
+ export declare const StatusPickerWithoutAnalytcs: React.FC<import("react-intl-next").WithIntlProps<Props>> & {
41
+ WrappedComponent: React.ComponentType<Props>;
42
+ };
43
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<Props, "intl"> & {
44
+ forwardedRef?: React.Ref<any> | undefined;
45
+ }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>;
68
46
  export default _default;
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { jsx } from '@emotion/react';
2
+ import { type WrappedComponentProps } from 'react-intl-next';
3
3
  import type { CreateUIAnalyticsEvent } from '@atlaskit/analytics-next';
4
4
  import type { EditorView } from '@atlaskit/editor-prosemirror/view';
5
5
  import type { ColorType as Color } from '@atlaskit/status/picker';
@@ -29,6 +29,7 @@ export interface Props {
29
29
  boundariesElement?: HTMLElement;
30
30
  scrollableElement?: HTMLElement;
31
31
  editorView: EditorView;
32
+ intl: WrappedComponentProps['intl'];
32
33
  }
33
34
  export interface State {
34
35
  color: Color;
@@ -36,33 +37,10 @@ export interface State {
36
37
  localId?: string;
37
38
  isNew?: boolean;
38
39
  }
39
- export declare class StatusPickerWithoutAnalytcs extends React.Component<Props, State> {
40
- private startTime;
41
- private inputMethod?;
42
- private createStatusAnalyticsAndFireFunc;
43
- private popupBodyWrapper;
44
- private focusTimeout;
45
- constructor(props: Props);
46
- private fireStatusPopupOpenedAnalytics;
47
- private fireStatusPopupClosedAnalytics;
48
- private reset;
49
- componentDidMount(): void;
50
- componentWillUnmount(): void;
51
- componentDidUpdate(prevProps: Readonly<Props>, prevState: Readonly<State>): void;
52
- private extractStateFromProps;
53
- handleClickOutside: (event: Event) => void;
54
- private handleEscapeKeydown;
55
- private handleTabPress;
56
- private handleArrow;
57
- private onKeyDown;
58
- private setRef;
59
- private renderWithSetOutsideClickTargetRef;
60
- render(): jsx.JSX.Element | null;
61
- private onColorHover;
62
- private onColorClick;
63
- private onTextChanged;
64
- private onEnter;
65
- private handlePopupClick;
66
- }
67
- declare const _default: React.ForwardRefExoticComponent<Omit<Props, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>;
40
+ export declare const StatusPickerWithoutAnalytcs: React.FC<import("react-intl-next").WithIntlProps<Props>> & {
41
+ WrappedComponent: React.ComponentType<Props>;
42
+ };
43
+ declare const _default: React.ForwardRefExoticComponent<Omit<Omit<Props, "intl"> & {
44
+ forwardedRef?: React.Ref<any> | undefined;
45
+ }, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any>>;
68
46
  export default _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-plugin-status",
3
- "version": "3.1.9",
3
+ "version": "3.1.10",
4
4
  "description": "Status plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,7 +35,7 @@
35
35
  "dependencies": {
36
36
  "@atlaskit/adf-schema": "^47.6.0",
37
37
  "@atlaskit/analytics-next": "^11.0.0",
38
- "@atlaskit/editor-common": "^103.0.0",
38
+ "@atlaskit/editor-common": "^103.4.0",
39
39
  "@atlaskit/editor-plugin-analytics": "^2.2.0",
40
40
  "@atlaskit/editor-prosemirror": "7.0.0",
41
41
  "@atlaskit/editor-shared-styles": "^3.4.0",
@@ -45,6 +45,7 @@
45
45
  "@atlaskit/theme": "^18.0.0",
46
46
  "@atlaskit/tmp-editor-statsig": "^4.6.0",
47
47
  "@atlaskit/tokens": "^4.7.0",
48
+ "@atlaskit/visually-hidden": "^3.0.0",
48
49
  "@babel/runtime": "^7.0.0",
49
50
  "@emotion/react": "^11.7.1"
50
51
  },
@@ -104,6 +105,9 @@
104
105
  "platform-component-visual-refresh": {
105
106
  "type": "boolean"
106
107
  },
108
+ "editor_a11y_announce_status_editor_open": {
109
+ "type": "boolean"
110
+ },
107
111
  "visual-refresh_drop_5": {
108
112
  "type": "boolean"
109
113
  },