@atlaskit/emoji 73.4.0 → 73.4.1

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,16 @@
1
1
  # @atlaskit/emoji
2
2
 
3
+ ## 73.4.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`52041aceb2dbb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/52041aceb2dbb) -
8
+ Restore focus to the Add custom emoji button after cancelling behind
9
+ platform_ally_emoji_fixes_various
10
+ - [`17e8d92cb49c7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/17e8d92cb49c7) -
11
+ [ux] Mark emoji picker images as decorative while preserving the interactive emoji's accessible
12
+ name, behind the `platform_ally_emoji_fixes_various` feature gate.
13
+
3
14
  ## 73.4.0
4
15
 
5
16
  ### Minor Changes
@@ -12,6 +12,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
12
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
13
  var _react = _interopRequireWildcard(require("react"));
14
14
  var _browserApis = require("@atlaskit/browser-apis");
15
+ var _fg = require("@atlaskit/platform-feature-flags/fg");
15
16
  var _Tooltip = _interopRequireDefault(require("@atlaskit/tooltip/Tooltip"));
16
17
  var _shouldUseAltRepresentation = require("../../api/shouldUseAltRepresentation");
17
18
  var _useInView3 = require("../../hooks/useInView");
@@ -54,7 +55,8 @@ var ImageEmoji = exports.ImageEmoji = function ImageEmoji(props) {
54
55
  onLoadSuccess = props.onLoadSuccess,
55
56
  disableLazyLoad = props.disableLazyLoad,
56
57
  autoWidth = props.autoWidth,
57
- isDecorative = props.isDecorative;
58
+ isDecorative = props.isDecorative,
59
+ shouldBeInteractive = props.shouldBeInteractive;
58
60
  var _useInView = (0, _useInView3.useInView)({
59
61
  triggerOnce: true
60
62
  }),
@@ -141,7 +143,7 @@ var ImageEmoji = exports.ImageEmoji = function ImageEmoji(props) {
141
143
  onBeforeLoad();
142
144
  }
143
145
  }, [inView, onBeforeLoad]);
144
- var imgAlt = isDecorative ? '' : emoji.name || emoji.shortName || '';
146
+ var imgAlt = isDecorative || shouldBeInteractive && (0, _fg.fg)('platform_ally_emoji_fixes_various') ? '' : emoji.name || emoji.shortName || '';
145
147
  var emojiNode = /*#__PURE__*/_react.default.createElement("img", (0, _extends2.default)({
146
148
  loading: disableLazyLoad ? 'eager' : 'lazy',
147
149
  src: src,
@@ -258,10 +258,12 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
258
258
  setUploadErrorMessage(undefined);
259
259
  });
260
260
  fireAnalytics((0, _uploadCancelButton.uploadCancelButton)());
261
- setTimeout(function () {
262
- var _getDocument;
263
- (_getDocument = (0, _browserApis.getDocument)()) === null || _getDocument === void 0 || (_getDocument = _getDocument.getElementById('add-custom-emoji')) === null || _getDocument === void 0 || _getDocument.focus();
264
- }, 0);
261
+ if ((0, _fg.fg)('platform_ally_emoji_fixes_various')) {
262
+ setTimeout(function () {
263
+ var _getDocument;
264
+ (_getDocument = (0, _browserApis.getDocument)()) === null || _getDocument === void 0 || (_getDocument = _getDocument.getElementById('add-custom-emoji')) === null || _getDocument === void 0 || _getDocument.focus();
265
+ }, 0);
266
+ }
265
267
  }, [fireAnalytics]);
266
268
  var getDynamicCategories = (0, _react.useCallback)(function () {
267
269
  if (!emojiProvider.calculateDynamicCategories) {
@@ -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.3.9"
20
+ packageVersion: "73.4.0"
21
21
  }, attributes)
22
22
  };
23
23
  };
@@ -3,6 +3,7 @@ import _extends from "@babel/runtime/helpers/extends";
3
3
  import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useEffect, useCallback, useMemo } from 'react';
5
5
  import { getDocument } from '@atlaskit/browser-apis';
6
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
6
7
  import Tooltip from '@atlaskit/tooltip/Tooltip';
7
8
  import { shouldUseAltRepresentation } from '../../api/shouldUseAltRepresentation';
8
9
  import { useInView } from '../../hooks/useInView';
@@ -47,7 +48,8 @@ export const ImageEmoji = props => {
47
48
  onLoadSuccess,
48
49
  disableLazyLoad,
49
50
  autoWidth,
50
- isDecorative
51
+ isDecorative,
52
+ shouldBeInteractive
51
53
  } = props;
52
54
  const [ref, inView] = useInView({
53
55
  triggerOnce: true
@@ -126,7 +128,7 @@ export const ImageEmoji = props => {
126
128
  onBeforeLoad();
127
129
  }
128
130
  }, [inView, onBeforeLoad]);
129
- const imgAlt = isDecorative ? '' : emoji.name || emoji.shortName || '';
131
+ const imgAlt = isDecorative || shouldBeInteractive && fg('platform_ally_emoji_fixes_various') ? '' : emoji.name || emoji.shortName || '';
130
132
  const emojiNode = /*#__PURE__*/React.createElement("img", _extends({
131
133
  loading: disableLazyLoad ? 'eager' : 'lazy',
132
134
  src: src,
@@ -192,10 +192,12 @@ const EmojiPickerComponent = ({
192
192
  setUploadErrorMessage(undefined);
193
193
  });
194
194
  fireAnalytics(uploadCancelButton());
195
- setTimeout(() => {
196
- var _getDocument, _getDocument$getEleme;
197
- (_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : (_getDocument$getEleme = _getDocument.getElementById('add-custom-emoji')) === null || _getDocument$getEleme === void 0 ? void 0 : _getDocument$getEleme.focus();
198
- }, 0);
195
+ if (fg('platform_ally_emoji_fixes_various')) {
196
+ setTimeout(() => {
197
+ var _getDocument, _getDocument$getEleme;
198
+ (_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : (_getDocument$getEleme = _getDocument.getElementById('add-custom-emoji')) === null || _getDocument$getEleme === void 0 ? void 0 : _getDocument$getEleme.focus();
199
+ }, 0);
200
+ }
199
201
  }, [fireAnalytics]);
200
202
  const getDynamicCategories = useCallback(() => {
201
203
  if (!emojiProvider.calculateDynamicCategories) {
@@ -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.3.9",
8
+ packageVersion: "73.4.0",
9
9
  ...attributes
10
10
  }
11
11
  });
@@ -4,6 +4,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
4
  import { ax, ix } from "@compiled/react/runtime";
5
5
  import React, { useEffect, useCallback, useMemo } from 'react';
6
6
  import { getDocument } from '@atlaskit/browser-apis';
7
+ import { fg } from '@atlaskit/platform-feature-flags/fg';
7
8
  import Tooltip from '@atlaskit/tooltip/Tooltip';
8
9
  import { shouldUseAltRepresentation } from '../../api/shouldUseAltRepresentation';
9
10
  import { useInView } from '../../hooks/useInView';
@@ -45,7 +46,8 @@ export var ImageEmoji = function ImageEmoji(props) {
45
46
  onLoadSuccess = props.onLoadSuccess,
46
47
  disableLazyLoad = props.disableLazyLoad,
47
48
  autoWidth = props.autoWidth,
48
- isDecorative = props.isDecorative;
49
+ isDecorative = props.isDecorative,
50
+ shouldBeInteractive = props.shouldBeInteractive;
49
51
  var _useInView = useInView({
50
52
  triggerOnce: true
51
53
  }),
@@ -132,7 +134,7 @@ export var ImageEmoji = function ImageEmoji(props) {
132
134
  onBeforeLoad();
133
135
  }
134
136
  }, [inView, onBeforeLoad]);
135
- var imgAlt = isDecorative ? '' : emoji.name || emoji.shortName || '';
137
+ var imgAlt = isDecorative || shouldBeInteractive && fg('platform_ally_emoji_fixes_various') ? '' : emoji.name || emoji.shortName || '';
136
138
  var emojiNode = /*#__PURE__*/React.createElement("img", _extends({
137
139
  loading: disableLazyLoad ? 'eager' : 'lazy',
138
140
  src: src,
@@ -249,10 +249,12 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
249
249
  setUploadErrorMessage(undefined);
250
250
  });
251
251
  fireAnalytics(uploadCancelButton());
252
- setTimeout(function () {
253
- var _getDocument;
254
- (_getDocument = getDocument()) === null || _getDocument === void 0 || (_getDocument = _getDocument.getElementById('add-custom-emoji')) === null || _getDocument === void 0 || _getDocument.focus();
255
- }, 0);
252
+ if (fg('platform_ally_emoji_fixes_various')) {
253
+ setTimeout(function () {
254
+ var _getDocument;
255
+ (_getDocument = getDocument()) === null || _getDocument === void 0 || (_getDocument = _getDocument.getElementById('add-custom-emoji')) === null || _getDocument === void 0 || _getDocument.focus();
256
+ }, 0);
257
+ }
256
258
  }, [fireAnalytics]);
257
259
  var getDynamicCategories = useCallback(function () {
258
260
  if (!emojiProvider.calculateDynamicCategories) {
@@ -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.3.9"
13
+ packageVersion: "73.4.0"
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.0",
3
+ "version": "73.4.1",
4
4
  "description": "Fabric emoji React components",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"