@atlaskit/editor-plugin-status 3.1.9 → 3.1.11

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,23 @@
1
1
  # @atlaskit/editor-plugin-status
2
2
 
3
+ ## 3.1.11
4
+
5
+ ### Patch Changes
6
+
7
+ - [#146371](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/146371)
8
+ [`9540ed4b36027`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9540ed4b36027) -
9
+ [A11Y-9995] Add label to Status editor popup
10
+ - Updated dependencies
11
+
12
+ ## 3.1.10
13
+
14
+ ### Patch Changes
15
+
16
+ - [#139158](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/139158)
17
+ [`e535a2a6ac9ea`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e535a2a6ac9ea) -
18
+ [ux] [A11Y-10038] Announce status popup when it opens and let users know how to access the popup
19
+ - Updated dependencies
20
+
3
21
  ## 3.1.9
4
22
 
5
23
  ### 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,11 +324,13 @@ 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
  }
327
332
  return target && (0, _react2.jsx)(PopupWithListeners, {
333
+ ariaLabel: (0, _platformFeatureFlags.fg)('editor_a11y_aria_label_removal_popup') ? intl.formatMessage(_messages.statusMessages.statusEditorLabel) : undefined,
328
334
  target: target,
329
335
  offset: [0, 8],
330
336
  handleClickOutside: this.handleClickOutside,
@@ -335,8 +341,12 @@ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = /*#__PUR
335
341
  boundariesElement: boundariesElement,
336
342
  scrollableElement: scrollableElement,
337
343
  closeOnTab: false
338
- }, (0, _react2.jsx)(_uiReact.OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
344
+ }, (0, _platformFeatureFlags.fg)('editor_a11y_announce_status_editor_open') && (0, _react2.jsx)(_visuallyHidden.default, {
345
+ "aria-atomic": true,
346
+ role: "alert"
347
+ }, intl.formatMessage(_messages.statusMessages.statusPickerOpenedAlert)), (0, _react2.jsx)(_uiReact.OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
339
348
  }
340
349
  }]);
341
350
  }(_react.default.Component);
351
+ var StatusPickerWithoutAnalytcs = exports.StatusPickerWithoutAnalytcs = (0, _reactIntlNext.injectIntl)(StatusPickerWithIntl);
342
352
  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,12 +297,14 @@ 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;
300
305
  }
301
306
  return target && jsx(PopupWithListeners, {
307
+ ariaLabel: fg('editor_a11y_aria_label_removal_popup') ? intl.formatMessage(messages.statusEditorLabel) : undefined,
302
308
  target: target,
303
309
  offset: [0, 8],
304
310
  handleClickOutside: this.handleClickOutside,
@@ -309,7 +315,11 @@ export class StatusPickerWithoutAnalytcs extends React.Component {
309
315
  boundariesElement: boundariesElement,
310
316
  scrollableElement: scrollableElement,
311
317
  closeOnTab: false
312
- }, jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
318
+ }, fg('editor_a11y_announce_status_editor_open') && jsx(VisuallyHidden, {
319
+ "aria-atomic": true,
320
+ role: "alert"
321
+ }, intl.formatMessage(messages.statusPickerOpenedAlert)), jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
313
322
  }
314
323
  }
324
+ export const StatusPickerWithoutAnalytcs = injectIntl(StatusPickerWithIntl);
315
325
  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,11 +321,13 @@ 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
  }
324
329
  return target && jsx(PopupWithListeners, {
330
+ ariaLabel: fg('editor_a11y_aria_label_removal_popup') ? intl.formatMessage(messages.statusEditorLabel) : undefined,
325
331
  target: target,
326
332
  offset: [0, 8],
327
333
  handleClickOutside: this.handleClickOutside,
@@ -332,8 +338,12 @@ export var StatusPickerWithoutAnalytcs = /*#__PURE__*/function (_React$Component
332
338
  boundariesElement: boundariesElement,
333
339
  scrollableElement: scrollableElement,
334
340
  closeOnTab: false
335
- }, jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
341
+ }, fg('editor_a11y_announce_status_editor_open') && jsx(VisuallyHidden, {
342
+ "aria-atomic": true,
343
+ role: "alert"
344
+ }, intl.formatMessage(messages.statusPickerOpenedAlert)), jsx(OutsideClickTargetRefContext.Consumer, null, this.renderWithSetOutsideClickTargetRef.bind(this)));
336
345
  }
337
346
  }]);
338
347
  }(React.Component);
348
+ export var StatusPickerWithoutAnalytcs = injectIntl(StatusPickerWithIntl);
339
349
  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.11",
4
4
  "description": "Status plugin for @atlaskit/editor-core",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "license": "Apache-2.0",
@@ -35,16 +35,17 @@
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.18.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",
42
- "@atlaskit/icon": "^25.5.0",
42
+ "@atlaskit/icon": "^25.6.0",
43
43
  "@atlaskit/platform-feature-flags": "^1.1.0",
44
44
  "@atlaskit/status": "^3.0.0",
45
45
  "@atlaskit/theme": "^18.0.0",
46
- "@atlaskit/tmp-editor-statsig": "^4.6.0",
47
- "@atlaskit/tokens": "^4.7.0",
46
+ "@atlaskit/tmp-editor-statsig": "^4.14.0",
47
+ "@atlaskit/tokens": "^4.8.0",
48
+ "@atlaskit/visually-hidden": "^3.0.0",
48
49
  "@babel/runtime": "^7.0.0",
49
50
  "@emotion/react": "^11.7.1"
50
51
  },
@@ -54,9 +55,9 @@
54
55
  "react-intl-next": "npm:react-intl@^5.18.1"
55
56
  },
56
57
  "devDependencies": {
57
- "@af/visual-regression": "^1.3.0",
58
- "@atlaskit/ssr": "^0.4.0",
59
- "@atlaskit/visual-regression": "^0.10.0",
58
+ "@af/visual-regression": "workspace:^",
59
+ "@atlaskit/ssr": "workspace:^",
60
+ "@atlaskit/visual-regression": "workspace:^",
60
61
  "@testing-library/react": "^13.4.0",
61
62
  "raf-stub": "^2.0.1",
62
63
  "typescript": "~5.4.2"
@@ -104,9 +105,15 @@
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
  },
114
+ "editor_a11y_aria_label_removal_popup": {
115
+ "type": "boolean"
116
+ },
110
117
  "platform-lozenge-custom-letterspacing": {
111
118
  "type": "boolean"
112
119
  }