@atlaskit/emoji 73.4.4 → 73.4.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/emoji
2
2
 
3
+ ## 73.4.5
4
+
5
+ ### Patch Changes
6
+
7
+ - [`ec809235e06d2`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ec809235e06d2) -
8
+ Announce duplicate emoji name errors and focus the name field behind
9
+ platform_ally_emoji_fixes_various.
10
+ - Updated dependencies
11
+
3
12
  ## 73.4.4
4
13
 
5
14
  ### Patch Changes
@@ -18,6 +18,7 @@ var _reactIntl = require("react-intl");
18
18
  var _browserApis = require("@atlaskit/browser-apis");
19
19
  var _button = _interopRequireDefault(require("@atlaskit/button/default/button"));
20
20
  var _isExperimentEnabled = require("@atlaskit/platform-feature-experiments/is-experiment-enabled");
21
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
21
22
  var _box = require("@atlaskit/primitives/compiled/box");
22
23
  var _textField = _interopRequireDefault(require("@atlaskit/textfield/text-field"));
23
24
  var ImageUtil = _interopRequireWildcard(require("../../util/image"));
@@ -82,7 +83,9 @@ var ChooseEmojiFile = /*#__PURE__*/(0, _react.memo)(function (props) {
82
83
  intl = props.intl;
83
84
  var formatMessage = intl.formatMessage;
84
85
  var fileChooserButtonDescriptionId = 'choose.emoji.file.button.screen.reader.description.id';
86
+ var emojiNameErrorId = 'new-emoji-name-error';
85
87
  var inputRef = (0, _react.useRef)(null);
88
+ var isA11yFixEnabled = !!nameErrorMessage && (0, _fg.fg)('platform_ally_emoji_fixes_various');
86
89
  var onKeyDownHandler = (0, _react.useCallback)(function (event) {
87
90
  if (event.key === 'Escape') {
88
91
  onUploadCancelled();
@@ -94,6 +97,12 @@ var ChooseEmojiFile = /*#__PURE__*/(0, _react.memo)(function (props) {
94
97
  (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
95
98
  });
96
99
  }, []);
100
+ (0, _react.useEffect)(function () {
101
+ if (isA11yFixEnabled) {
102
+ var _inputRef$current2;
103
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.focus();
104
+ }
105
+ }, [isA11yFixEnabled]);
97
106
  var emojiPlaceholder = formatMessage(_i18n.messages.emojiPlaceholder);
98
107
  var emojiNameAriaLabel = formatMessage(_i18n.messages.emojiNameAriaLabel);
99
108
  var emojiChooseFileTitleNew = formatMessage(_i18n.messages.emojiChooseFileDndTitle);
@@ -137,14 +146,22 @@ var ChooseEmojiFile = /*#__PURE__*/(0, _react.memo)(function (props) {
137
146
  isCompact: true,
138
147
  autoFocus: true,
139
148
  isInvalid: !!nameErrorMessage,
149
+ "aria-describedby": isA11yFixEnabled ? emojiNameErrorId : undefined,
140
150
  testId: uploadEmojiNameInputTestId,
141
151
  ref: inputRef,
142
152
  id: "new-emoji-name-input",
143
153
  "aria-required": true
144
- }), nameErrorMessage && /*#__PURE__*/React.createElement(_EmojiErrorMessage.default, {
154
+ }), nameErrorMessage && (isA11yFixEnabled ? /*#__PURE__*/React.createElement("div", {
155
+ id: emojiNameErrorId,
156
+ role: "alert",
157
+ "aria-atomic": "true"
158
+ }, /*#__PURE__*/React.createElement(_EmojiErrorMessage.default, {
159
+ errorStyle: "chooseFile",
160
+ message: nameErrorMessage
161
+ })) : /*#__PURE__*/React.createElement(_EmojiErrorMessage.default, {
145
162
  errorStyle: "chooseFile",
146
163
  message: nameErrorMessage
147
- }))), /*#__PURE__*/React.createElement("div", {
164
+ })))), /*#__PURE__*/React.createElement("div", {
148
165
  className: (0, _runtime.ax)(["_zulpu2gc _1e0c1txw _1bahesu3 _4cvr1h6o _ca0qu2gc _n3tdutpp"])
149
166
  }, /*#__PURE__*/React.createElement(_button.default, {
150
167
  onClick: onUploadCancelled,
@@ -17,7 +17,7 @@ var createEvent = exports.createEvent = function createEvent(eventType, action,
17
17
  actionSubjectId: actionSubjectId,
18
18
  attributes: _objectSpread({
19
19
  packageName: "@atlaskit/emoji",
20
- packageVersion: "73.4.3"
20
+ packageVersion: "73.4.4"
21
21
  }, attributes)
22
22
  };
23
23
  };
@@ -7,6 +7,7 @@ import { FormattedMessage, injectIntl } from 'react-intl';
7
7
  import { getDocument } from '@atlaskit/browser-apis';
8
8
  import Button from '@atlaskit/button/default/button';
9
9
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
10
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
10
11
  import { Box } from '@atlaskit/primitives/compiled/box';
11
12
  import TextField from '@atlaskit/textfield/text-field';
12
13
  import * as ImageUtil from '../../util/image';
@@ -71,7 +72,9 @@ const ChooseEmojiFile = /*#__PURE__*/memo(props => {
71
72
  formatMessage
72
73
  } = intl;
73
74
  const fileChooserButtonDescriptionId = 'choose.emoji.file.button.screen.reader.description.id';
75
+ const emojiNameErrorId = 'new-emoji-name-error';
74
76
  const inputRef = useRef(null);
77
+ const isA11yFixEnabled = !!nameErrorMessage && fg('platform_ally_emoji_fixes_various');
75
78
  const onKeyDownHandler = useCallback(event => {
76
79
  if (event.key === 'Escape') {
77
80
  onUploadCancelled();
@@ -83,6 +86,12 @@ const ChooseEmojiFile = /*#__PURE__*/memo(props => {
83
86
  (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 ? void 0 : _inputRef$current.focus();
84
87
  });
85
88
  }, []);
89
+ useEffect(() => {
90
+ if (isA11yFixEnabled) {
91
+ var _inputRef$current2;
92
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 ? void 0 : _inputRef$current2.focus();
93
+ }
94
+ }, [isA11yFixEnabled]);
86
95
  const emojiPlaceholder = formatMessage(messages.emojiPlaceholder);
87
96
  const emojiNameAriaLabel = formatMessage(messages.emojiNameAriaLabel);
88
97
  const emojiChooseFileTitleNew = formatMessage(messages.emojiChooseFileDndTitle);
@@ -124,14 +133,22 @@ const ChooseEmojiFile = /*#__PURE__*/memo(props => {
124
133
  isCompact: true,
125
134
  autoFocus: true,
126
135
  isInvalid: !!nameErrorMessage,
136
+ "aria-describedby": isA11yFixEnabled ? emojiNameErrorId : undefined,
127
137
  testId: uploadEmojiNameInputTestId,
128
138
  ref: inputRef,
129
139
  id: "new-emoji-name-input",
130
140
  "aria-required": true
131
- }), nameErrorMessage && /*#__PURE__*/React.createElement(EmojiErrorMessage, {
141
+ }), nameErrorMessage && (isA11yFixEnabled ? /*#__PURE__*/React.createElement("div", {
142
+ id: emojiNameErrorId,
143
+ role: "alert",
144
+ "aria-atomic": "true"
145
+ }, /*#__PURE__*/React.createElement(EmojiErrorMessage, {
146
+ errorStyle: "chooseFile",
147
+ message: nameErrorMessage
148
+ })) : /*#__PURE__*/React.createElement(EmojiErrorMessage, {
132
149
  errorStyle: "chooseFile",
133
150
  message: nameErrorMessage
134
- }))), /*#__PURE__*/React.createElement("div", {
151
+ })))), /*#__PURE__*/React.createElement("div", {
135
152
  className: ax(["_zulpu2gc _1e0c1txw _1bahesu3 _4cvr1h6o _ca0qu2gc _n3tdutpp"])
136
153
  }, /*#__PURE__*/React.createElement(Button, {
137
154
  onClick: onUploadCancelled,
@@ -5,7 +5,7 @@ export const createEvent = (eventType, action, actionSubject, actionSubjectId, a
5
5
  actionSubjectId,
6
6
  attributes: {
7
7
  packageName: "@atlaskit/emoji",
8
- packageVersion: "73.4.3",
8
+ packageVersion: "73.4.4",
9
9
  ...attributes
10
10
  }
11
11
  });
@@ -10,6 +10,7 @@ import { FormattedMessage, injectIntl } from 'react-intl';
10
10
  import { getDocument } from '@atlaskit/browser-apis';
11
11
  import Button from '@atlaskit/button/default/button';
12
12
  import { isExperimentEnabled } from '@atlaskit/platform-feature-experiments/is-experiment-enabled';
13
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
13
14
  import { Box } from '@atlaskit/primitives/compiled/box';
14
15
  import TextField from '@atlaskit/textfield/text-field';
15
16
  import * as ImageUtil from '../../util/image';
@@ -73,7 +74,9 @@ var ChooseEmojiFile = /*#__PURE__*/memo(function (props) {
73
74
  intl = props.intl;
74
75
  var formatMessage = intl.formatMessage;
75
76
  var fileChooserButtonDescriptionId = 'choose.emoji.file.button.screen.reader.description.id';
77
+ var emojiNameErrorId = 'new-emoji-name-error';
76
78
  var inputRef = useRef(null);
79
+ var isA11yFixEnabled = !!nameErrorMessage && fg('platform_ally_emoji_fixes_various');
77
80
  var onKeyDownHandler = useCallback(function (event) {
78
81
  if (event.key === 'Escape') {
79
82
  onUploadCancelled();
@@ -85,6 +88,12 @@ var ChooseEmojiFile = /*#__PURE__*/memo(function (props) {
85
88
  (_inputRef$current = inputRef.current) === null || _inputRef$current === void 0 || _inputRef$current.focus();
86
89
  });
87
90
  }, []);
91
+ useEffect(function () {
92
+ if (isA11yFixEnabled) {
93
+ var _inputRef$current2;
94
+ (_inputRef$current2 = inputRef.current) === null || _inputRef$current2 === void 0 || _inputRef$current2.focus();
95
+ }
96
+ }, [isA11yFixEnabled]);
88
97
  var emojiPlaceholder = formatMessage(messages.emojiPlaceholder);
89
98
  var emojiNameAriaLabel = formatMessage(messages.emojiNameAriaLabel);
90
99
  var emojiChooseFileTitleNew = formatMessage(messages.emojiChooseFileDndTitle);
@@ -128,14 +137,22 @@ var ChooseEmojiFile = /*#__PURE__*/memo(function (props) {
128
137
  isCompact: true,
129
138
  autoFocus: true,
130
139
  isInvalid: !!nameErrorMessage,
140
+ "aria-describedby": isA11yFixEnabled ? emojiNameErrorId : undefined,
131
141
  testId: uploadEmojiNameInputTestId,
132
142
  ref: inputRef,
133
143
  id: "new-emoji-name-input",
134
144
  "aria-required": true
135
- }), nameErrorMessage && /*#__PURE__*/React.createElement(EmojiErrorMessage, {
145
+ }), nameErrorMessage && (isA11yFixEnabled ? /*#__PURE__*/React.createElement("div", {
146
+ id: emojiNameErrorId,
147
+ role: "alert",
148
+ "aria-atomic": "true"
149
+ }, /*#__PURE__*/React.createElement(EmojiErrorMessage, {
150
+ errorStyle: "chooseFile",
151
+ message: nameErrorMessage
152
+ })) : /*#__PURE__*/React.createElement(EmojiErrorMessage, {
136
153
  errorStyle: "chooseFile",
137
154
  message: nameErrorMessage
138
- }))), /*#__PURE__*/React.createElement("div", {
155
+ })))), /*#__PURE__*/React.createElement("div", {
139
156
  className: ax(["_zulpu2gc _1e0c1txw _1bahesu3 _4cvr1h6o _ca0qu2gc _n3tdutpp"])
140
157
  }, /*#__PURE__*/React.createElement(Button, {
141
158
  onClick: onUploadCancelled,
@@ -10,7 +10,7 @@ export var createEvent = function createEvent(eventType, action, actionSubject,
10
10
  actionSubjectId: actionSubjectId,
11
11
  attributes: _objectSpread({
12
12
  packageName: "@atlaskit/emoji",
13
- packageVersion: "73.4.3"
13
+ packageVersion: "73.4.4"
14
14
  }, attributes)
15
15
  };
16
16
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/emoji",
3
- "version": "73.4.4",
3
+ "version": "73.4.5",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/spinner": "^20.4.0",
55
55
  "@atlaskit/textfield": "^10.3.0",
56
56
  "@atlaskit/theme": "^28.2.0",
57
- "@atlaskit/tmp-editor-statsig": "^256.0.0",
57
+ "@atlaskit/tmp-editor-statsig": "^257.0.0",
58
58
  "@atlaskit/tokens": "^20.9.0",
59
59
  "@atlaskit/tooltip": "^24.4.0",
60
60
  "@atlaskit/ufo": "^2.0.0",
@@ -119,6 +119,10 @@
119
119
  "ui"
120
120
  ],
121
121
  "platform-feature-flags": {
122
+ "platform_ally_emoji_fixes_various": {
123
+ "type": "boolean",
124
+ "referenceOnly": true
125
+ },
122
126
  "nike_r19_render_unmount": {
123
127
  "type": "boolean"
124
128
  },