@atlaskit/emoji 73.4.0 → 73.4.2
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 +19 -0
- package/dist/cjs/components/common/ImageEmoji.js +4 -2
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +1 -19
- package/dist/cjs/components/picker/EmojiPickerComponent.js +6 -4
- package/dist/cjs/util/analytics/createEvent.js +1 -1
- package/dist/es2019/components/common/ImageEmoji.js +4 -2
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +1 -18
- package/dist/es2019/components/picker/EmojiPickerComponent.js +6 -4
- package/dist/es2019/util/analytics/createEvent.js +1 -1
- package/dist/esm/components/common/ImageEmoji.js +4 -2
- package/dist/esm/components/common/ResourcedEmojiComponent.js +1 -19
- package/dist/esm/components/picker/EmojiPickerComponent.js +6 -4
- package/dist/esm/util/analytics/createEvent.js +1 -1
- package/dist/types/components/common/ResourcedEmojiComponent.d.ts +1 -1
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/emoji
|
|
2
2
|
|
|
3
|
+
## 73.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`5764694cfc17a`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/5764694cfc17a) -
|
|
8
|
+
Cleanup `feature_gate` `platform_emoji_prevent_img_src_changing`. Page-title emoji keep their
|
|
9
|
+
optimistic image src through the unconditional optimistic-image path.
|
|
10
|
+
|
|
11
|
+
## 73.4.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`52041aceb2dbb`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/52041aceb2dbb) -
|
|
16
|
+
Restore focus to the Add custom emoji button after cancelling behind
|
|
17
|
+
platform_ally_emoji_fixes_various
|
|
18
|
+
- [`17e8d92cb49c7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/17e8d92cb49c7) -
|
|
19
|
+
[ux] Mark emoji picker images as decorative while preserving the interactive emoji's accessible
|
|
20
|
+
name, behind the `platform_ally_emoji_fixes_various` feature gate.
|
|
21
|
+
|
|
3
22
|
## 73.4.0
|
|
4
23
|
|
|
5
24
|
### 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,
|
|
@@ -58,8 +58,6 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
|
|
|
58
58
|
_ref$optimisticImageU = _ref.optimisticImageURL,
|
|
59
59
|
optimisticImageURL = _ref$optimisticImageU === void 0 ? undefined : _ref$optimisticImageU,
|
|
60
60
|
editorEmoji = _ref.editorEmoji,
|
|
61
|
-
_ref$pageTitleEmoji = _ref.pageTitleEmoji,
|
|
62
|
-
pageTitleEmoji = _ref$pageTitleEmoji === void 0 ? false : _ref$pageTitleEmoji,
|
|
63
61
|
placeholderXcss = _ref.placeholderXcss,
|
|
64
62
|
onEmojiLoadSuccess = _ref.onEmojiLoadSuccess,
|
|
65
63
|
onEmojiLoadFail = _ref.onEmojiLoadFail;
|
|
@@ -206,22 +204,6 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
|
|
|
206
204
|
return emoji;
|
|
207
205
|
}
|
|
208
206
|
|
|
209
|
-
// reduce blast radius by targeting page title
|
|
210
|
-
if (pageTitleEmoji && optimisticImageURL && (0, _fg.fg)('platform_emoji_prevent_img_src_changing')) {
|
|
211
|
-
return {
|
|
212
|
-
id: id,
|
|
213
|
-
shortName: shortName,
|
|
214
|
-
fallback: fallback,
|
|
215
|
-
type: '',
|
|
216
|
-
category: '',
|
|
217
|
-
searchable: true,
|
|
218
|
-
representation: {
|
|
219
|
-
height: fitToHeight || _constants.defaultEmojiHeight,
|
|
220
|
-
width: fitToHeight || _constants.defaultEmojiHeight,
|
|
221
|
-
imagePath: optimisticImageURL
|
|
222
|
-
}
|
|
223
|
-
};
|
|
224
|
-
}
|
|
225
207
|
// Keep the optimistic representation stable when catalogue data arrives.
|
|
226
208
|
if (optimisticImageURL) {
|
|
227
209
|
return {
|
|
@@ -259,7 +241,7 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
|
|
|
259
241
|
}
|
|
260
242
|
}
|
|
261
243
|
return emoji;
|
|
262
|
-
}, [emoji, optimisticImageURL, fallback, fitToHeight, id, shortName,
|
|
244
|
+
}, [emoji, optimisticImageURL, fallback, fitToHeight, id, shortName, resolvedEmojiProvider, failedAdaptiveImageURL]);
|
|
263
245
|
var handleOnLoadError = (0, _react.useCallback)(function (emojiId) {
|
|
264
246
|
if ((0, _fg.fg)('platform_emoji_adaptive_image_size') && !optimisticImageURL && optimisticEmojiDescription !== emoji && optimisticEmojiDescription !== null && optimisticEmojiDescription !== void 0 && optimisticEmojiDescription.representation && 'imagePath' in optimisticEmojiDescription.representation) {
|
|
265
247
|
setFailedAdaptiveImageURL(optimisticEmojiDescription.representation.imagePath);
|
|
@@ -258,10 +258,12 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
258
258
|
setUploadErrorMessage(undefined);
|
|
259
259
|
});
|
|
260
260
|
fireAnalytics((0, _uploadCancelButton.uploadCancelButton)());
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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.
|
|
20
|
+
packageVersion: "73.4.1"
|
|
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,
|
|
@@ -37,7 +37,6 @@ export const ResourcedEmojiComponent = ({
|
|
|
37
37
|
optimistic = false,
|
|
38
38
|
optimisticImageURL = undefined,
|
|
39
39
|
editorEmoji,
|
|
40
|
-
pageTitleEmoji = false,
|
|
41
40
|
placeholderXcss,
|
|
42
41
|
onEmojiLoadSuccess,
|
|
43
42
|
onEmojiLoadFail
|
|
@@ -154,22 +153,6 @@ export const ResourcedEmojiComponent = ({
|
|
|
154
153
|
return emoji;
|
|
155
154
|
}
|
|
156
155
|
|
|
157
|
-
// reduce blast radius by targeting page title
|
|
158
|
-
if (pageTitleEmoji && optimisticImageURL && fg('platform_emoji_prevent_img_src_changing')) {
|
|
159
|
-
return {
|
|
160
|
-
id,
|
|
161
|
-
shortName,
|
|
162
|
-
fallback,
|
|
163
|
-
type: '',
|
|
164
|
-
category: '',
|
|
165
|
-
searchable: true,
|
|
166
|
-
representation: {
|
|
167
|
-
height: fitToHeight || defaultEmojiHeight,
|
|
168
|
-
width: fitToHeight || defaultEmojiHeight,
|
|
169
|
-
imagePath: optimisticImageURL
|
|
170
|
-
}
|
|
171
|
-
};
|
|
172
|
-
}
|
|
173
156
|
// Keep the optimistic representation stable when catalogue data arrives.
|
|
174
157
|
if (optimisticImageURL) {
|
|
175
158
|
return {
|
|
@@ -208,7 +191,7 @@ export const ResourcedEmojiComponent = ({
|
|
|
208
191
|
}
|
|
209
192
|
}
|
|
210
193
|
return emoji;
|
|
211
|
-
}, [emoji, optimisticImageURL, fallback, fitToHeight, id, shortName,
|
|
194
|
+
}, [emoji, optimisticImageURL, fallback, fitToHeight, id, shortName, resolvedEmojiProvider, failedAdaptiveImageURL]);
|
|
212
195
|
const handleOnLoadError = useCallback(emojiId => {
|
|
213
196
|
if (fg('platform_emoji_adaptive_image_size') && !optimisticImageURL && optimisticEmojiDescription !== emoji && optimisticEmojiDescription !== null && optimisticEmojiDescription !== void 0 && optimisticEmojiDescription.representation && 'imagePath' in optimisticEmojiDescription.representation) {
|
|
214
197
|
setFailedAdaptiveImageURL(optimisticEmojiDescription.representation.imagePath);
|
|
@@ -192,10 +192,12 @@ const EmojiPickerComponent = ({
|
|
|
192
192
|
setUploadErrorMessage(undefined);
|
|
193
193
|
});
|
|
194
194
|
fireAnalytics(uploadCancelButton());
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
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) {
|
|
@@ -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,
|
|
@@ -49,8 +49,6 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
|
|
|
49
49
|
_ref$optimisticImageU = _ref.optimisticImageURL,
|
|
50
50
|
optimisticImageURL = _ref$optimisticImageU === void 0 ? undefined : _ref$optimisticImageU,
|
|
51
51
|
editorEmoji = _ref.editorEmoji,
|
|
52
|
-
_ref$pageTitleEmoji = _ref.pageTitleEmoji,
|
|
53
|
-
pageTitleEmoji = _ref$pageTitleEmoji === void 0 ? false : _ref$pageTitleEmoji,
|
|
54
52
|
placeholderXcss = _ref.placeholderXcss,
|
|
55
53
|
onEmojiLoadSuccess = _ref.onEmojiLoadSuccess,
|
|
56
54
|
onEmojiLoadFail = _ref.onEmojiLoadFail;
|
|
@@ -197,22 +195,6 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
|
|
|
197
195
|
return emoji;
|
|
198
196
|
}
|
|
199
197
|
|
|
200
|
-
// reduce blast radius by targeting page title
|
|
201
|
-
if (pageTitleEmoji && optimisticImageURL && fg('platform_emoji_prevent_img_src_changing')) {
|
|
202
|
-
return {
|
|
203
|
-
id: id,
|
|
204
|
-
shortName: shortName,
|
|
205
|
-
fallback: fallback,
|
|
206
|
-
type: '',
|
|
207
|
-
category: '',
|
|
208
|
-
searchable: true,
|
|
209
|
-
representation: {
|
|
210
|
-
height: fitToHeight || defaultEmojiHeight,
|
|
211
|
-
width: fitToHeight || defaultEmojiHeight,
|
|
212
|
-
imagePath: optimisticImageURL
|
|
213
|
-
}
|
|
214
|
-
};
|
|
215
|
-
}
|
|
216
198
|
// Keep the optimistic representation stable when catalogue data arrives.
|
|
217
199
|
if (optimisticImageURL) {
|
|
218
200
|
return {
|
|
@@ -250,7 +232,7 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
|
|
|
250
232
|
}
|
|
251
233
|
}
|
|
252
234
|
return emoji;
|
|
253
|
-
}, [emoji, optimisticImageURL, fallback, fitToHeight, id, shortName,
|
|
235
|
+
}, [emoji, optimisticImageURL, fallback, fitToHeight, id, shortName, resolvedEmojiProvider, failedAdaptiveImageURL]);
|
|
254
236
|
var handleOnLoadError = useCallback(function (emojiId) {
|
|
255
237
|
if (fg('platform_emoji_adaptive_image_size') && !optimisticImageURL && optimisticEmojiDescription !== emoji && optimisticEmojiDescription !== null && optimisticEmojiDescription !== void 0 && optimisticEmojiDescription.representation && 'imagePath' in optimisticEmojiDescription.representation) {
|
|
256
238
|
setFailedAdaptiveImageURL(optimisticEmojiDescription.representation.imagePath);
|
|
@@ -249,10 +249,12 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
249
249
|
setUploadErrorMessage(undefined);
|
|
250
250
|
});
|
|
251
251
|
fireAnalytics(uploadCancelButton());
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
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.
|
|
13
|
+
packageVersion: "73.4.1"
|
|
14
14
|
}, attributes)
|
|
15
15
|
};
|
|
16
16
|
};
|
|
@@ -85,5 +85,5 @@ export interface Props extends BaseResourcedEmojiProps {
|
|
|
85
85
|
*/
|
|
86
86
|
onEmojiLoadSuccess?: EmojiLoadSuccessCallback;
|
|
87
87
|
}
|
|
88
|
-
export declare const ResourcedEmojiComponent: ({ emojiProvider, emojiId, emojiProviderLookupOrder, showTooltip, customFallback, fitToHeight, ignoreWrapper, optimistic, optimisticImageURL, editorEmoji,
|
|
88
|
+
export declare const ResourcedEmojiComponent: ({ emojiProvider, emojiId, emojiProviderLookupOrder, showTooltip, customFallback, fitToHeight, ignoreWrapper, optimistic, optimisticImageURL, editorEmoji, placeholderXcss, onEmojiLoadSuccess, onEmojiLoadFail, }: Props) => React.JSX.Element;
|
|
89
89
|
export default ResourcedEmojiComponent;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/emoji",
|
|
3
|
-
"version": "73.4.
|
|
3
|
+
"version": "73.4.2",
|
|
4
4
|
"description": "Fabric emoji React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -122,9 +122,6 @@
|
|
|
122
122
|
"nike_r19_render_unmount": {
|
|
123
123
|
"type": "boolean"
|
|
124
124
|
},
|
|
125
|
-
"platform_emoji_prevent_img_src_changing": {
|
|
126
|
-
"type": "boolean"
|
|
127
|
-
},
|
|
128
125
|
"platform_suppression_removal_fix_reactions": {
|
|
129
126
|
"type": "boolean"
|
|
130
127
|
},
|