@atlaskit/emoji 70.10.4 → 70.10.6
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 +17 -0
- package/dist/cjs/components/common/EmojiDeletePreview.js +1 -1
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +28 -3
- package/dist/cjs/components/picker/EmojiPickerComponent.compiled.css +3 -0
- package/dist/cjs/components/picker/EmojiPickerComponent.js +8 -2
- package/dist/cjs/util/analytics/analytics.js +1 -1
- package/dist/es2019/components/common/EmojiDeletePreview.js +1 -1
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +29 -3
- package/dist/es2019/components/picker/EmojiPickerComponent.compiled.css +3 -0
- package/dist/es2019/components/picker/EmojiPickerComponent.js +8 -2
- package/dist/es2019/util/analytics/analytics.js +1 -1
- package/dist/esm/components/common/EmojiDeletePreview.js +1 -1
- package/dist/esm/components/common/ResourcedEmojiComponent.js +28 -3
- package/dist/esm/components/picker/EmojiPickerComponent.compiled.css +3 -0
- package/dist/esm/components/picker/EmojiPickerComponent.js +8 -2
- package/dist/esm/util/analytics/analytics.js +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/emoji
|
|
2
2
|
|
|
3
|
+
## 70.10.6
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`95ba1db6aa5f7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/95ba1db6aa5f7) -
|
|
8
|
+
Use findByEmojiId with retry for shortName-only lookups and render native unicode characters for
|
|
9
|
+
STANDARD emojis behind platform_twemoji_removal_unicode_emojis feature gate
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 70.10.5
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`1bfdb5118d1c7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1bfdb5118d1c7) -
|
|
17
|
+
Delete emoji screen fix scroll component at bottom
|
|
18
|
+
- Updated dependencies
|
|
19
|
+
|
|
3
20
|
## 70.10.4
|
|
4
21
|
|
|
5
22
|
### Patch Changes
|
|
@@ -121,7 +121,7 @@ var EmojiDeletePreview = /*#__PURE__*/function (_Component) {
|
|
|
121
121
|
}, /*#__PURE__*/React.createElement(_CachingEmoji.default, {
|
|
122
122
|
emoji: emoji
|
|
123
123
|
})), /*#__PURE__*/React.createElement("div", {
|
|
124
|
-
className: (0, _runtime.ax)(["_zulpu2gc _1e0c1txw _4cvr1h6o _1bahesu3 _19pkutpp"])
|
|
124
|
+
className: (0, _runtime.ax)(["_zulpu2gc _1e0c1txw _4cvr1h6o _1bahesu3 _19pkutpp _n3tdutpp"])
|
|
125
125
|
}, error && !loading ? /*#__PURE__*/React.createElement(_EmojiErrorMessage.default, {
|
|
126
126
|
message: formatMessage(_i18n.messages.deleteEmojiFailed),
|
|
127
127
|
errorStyle: "delete",
|
|
@@ -20,6 +20,7 @@ var _analytics = require("../../util/analytics");
|
|
|
20
20
|
var _EmojiCommonProvider = require("../../context/EmojiCommonProvider");
|
|
21
21
|
var _ufoExperiences = require("../../util/analytics/ufoExperiences");
|
|
22
22
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
|
+
var _emojiIdToEmoji = require("../../util/emojiIdToEmoji");
|
|
23
24
|
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
|
|
24
25
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
25
26
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
@@ -88,7 +89,10 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
|
|
|
88
89
|
}
|
|
89
90
|
});
|
|
90
91
|
}
|
|
91
|
-
|
|
92
|
+
|
|
93
|
+
// When id is absent/empty, fetchByEmojiId won't retry if the catalogue isn't loaded yet.
|
|
94
|
+
// findByEmojiId has retryIfLoading built in — use it for shortName-only lookups.
|
|
95
|
+
foundEmoji = !emojiId.id && (0, _platformFeatureFlags.fg)('platform_twemoji_removal_unicode_emojis') ? _emojiProvider.findByEmojiId(emojiId) : _emojiProvider.fetchByEmojiId(emojiId, optimisticFetch);
|
|
92
96
|
(0, _analytics.sampledUfoRenderedEmoji)(emojiId).mark(_types.UfoEmojiTimings.METADATA_START);
|
|
93
97
|
if ((0, _typeHelpers.isPromise)(foundEmoji)) {
|
|
94
98
|
setLoaded(false);
|
|
@@ -170,14 +174,35 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
|
|
|
170
174
|
});
|
|
171
175
|
}, [emojiProvider]);
|
|
172
176
|
var emojiRenderState = (0, _react.useMemo)(function () {
|
|
173
|
-
if (!emoji && !loaded && !optimisticImageURL) {
|
|
177
|
+
if (!emoji && !loaded && !optimisticImageURL || optimisticImageURL && !emoji && !id && (0, _platformFeatureFlags.fg)('platform_twemoji_removal_unicode_emojis')) {
|
|
174
178
|
return ResourcedEmojiComponentRenderStatesEnum.INITIAL;
|
|
175
179
|
} else if (!emoji && loaded || imageLoadError) {
|
|
176
180
|
return ResourcedEmojiComponentRenderStatesEnum.FALLBACK;
|
|
177
181
|
}
|
|
178
182
|
return ResourcedEmojiComponentRenderStatesEnum.EMOJI;
|
|
179
|
-
}, [emoji, loaded, optimisticImageURL, imageLoadError]);
|
|
183
|
+
}, [emoji, loaded, optimisticImageURL, imageLoadError, id]);
|
|
180
184
|
var optimisticEmojiDescription = (0, _react.useMemo)(function () {
|
|
185
|
+
// For STANDARD emojis, use native unicode character instead of optimistic image.
|
|
186
|
+
if ((0, _platformFeatureFlags.fg)('platform_twemoji_removal_unicode_emojis')) {
|
|
187
|
+
var resolvedId = id || (emoji === null || emoji === void 0 ? void 0 : emoji.id);
|
|
188
|
+
if (!resolvedId) return undefined;
|
|
189
|
+
var unicodeEmoji = (0, _emojiIdToEmoji.emojiIdToEmoji)(resolvedId);
|
|
190
|
+
if (unicodeEmoji) {
|
|
191
|
+
return _objectSpread(_objectSpread({}, emoji !== null && emoji !== void 0 ? emoji : {
|
|
192
|
+
id: id,
|
|
193
|
+
shortName: shortName,
|
|
194
|
+
fallback: fallback,
|
|
195
|
+
type: 'STANDARD',
|
|
196
|
+
category: '',
|
|
197
|
+
searchable: true
|
|
198
|
+
}), {}, {
|
|
199
|
+
representation: {
|
|
200
|
+
unicodeEmoji: unicodeEmoji
|
|
201
|
+
}
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
|
|
181
206
|
// reduce blast radius by targeting page title
|
|
182
207
|
if (pageTitleEmoji && optimisticImageURL && (0, _platformFeatureFlags.fg)('platform_emoji_prevent_img_src_changing')) {
|
|
183
208
|
return {
|
|
@@ -22,11 +22,14 @@
|
|
|
22
22
|
._2lx21bp4{flex-direction:column}
|
|
23
23
|
._4t3i1784{height:470px}
|
|
24
24
|
._4t3i1ckg{height:455px}
|
|
25
|
+
._4t3i1dsu{height:419px}
|
|
25
26
|
._4t3i1sa4{height:390px}
|
|
26
27
|
._4t3i2300{height:429px}
|
|
28
|
+
._4t3i50k7{height:499px}
|
|
27
29
|
._4t3iaq3k{height:295px}
|
|
28
30
|
._4t3ibqjm{height:310px}
|
|
29
31
|
._4t3iixjv{height:375px}
|
|
32
|
+
._4t3iqbeb{height:339px}
|
|
30
33
|
._4t3iuxo9{height:var(--_19dn98e)}
|
|
31
34
|
._4t3ivixp{height:349px}
|
|
32
35
|
._4t3ixt2k{height:509px}
|
|
@@ -48,6 +48,7 @@ var emojiPickerBoxShadow = "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px
|
|
|
48
48
|
var emojiPickerHeight = 295;
|
|
49
49
|
var emojiPickerHeightWithPreview = 349; // emojiPickerHeight + emojiPickerPreviewHeight;
|
|
50
50
|
var emojiPickerHeightWithPreviewNew = 310;
|
|
51
|
+
var emojiPickerHeightDeleteRefresh = 339;
|
|
51
52
|
var emojiPickerWidth = 350;
|
|
52
53
|
var emojiPickerMinHeight = 260;
|
|
53
54
|
var heightOffset = 80;
|
|
@@ -65,6 +66,11 @@ var withUploadRefreshHeight = {
|
|
|
65
66
|
medium: "_4t3i1sa4 _1tke5x59",
|
|
66
67
|
large: "_4t3i1784 _1tke1pna"
|
|
67
68
|
};
|
|
69
|
+
var withDeleteRefreshHeight = {
|
|
70
|
+
small: "_4t3iqbeb _1tkegx0z",
|
|
71
|
+
medium: "_4t3i1dsu _1tke5x59",
|
|
72
|
+
large: "_4t3i50k7 _1tke1pna"
|
|
73
|
+
};
|
|
68
74
|
var withoutPreviewHeight = {
|
|
69
75
|
small: "_4t3iaq3k _1tkegx0z",
|
|
70
76
|
medium: "_4t3iixjv _1tke5x59",
|
|
@@ -631,7 +637,7 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
631
637
|
role: "dialog",
|
|
632
638
|
"aria-label": formatMessage(_i18n.messages.emojiPickerTitle),
|
|
633
639
|
"aria-modal": true,
|
|
634
|
-
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm", (
|
|
640
|
+
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm", !!emojiToDelete && (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? withDeleteRefreshHeight[size] : uploading && (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? withUploadRefreshHeight[size] : showPreview ? withPreviewHeight[size] : withoutPreviewHeight[size]]),
|
|
635
641
|
style: {
|
|
636
642
|
"--_19dn98e": (0, _runtime.ix)("".concat(emojiPickerHeight, "px")),
|
|
637
643
|
"--_gsvyy7": (0, _runtime.ix)("".concat(emojiPickerWidth, "px"))
|
|
@@ -691,7 +697,7 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
691
697
|
onKeyPress: suppressKeyPress,
|
|
692
698
|
onKeyUp: suppressKeyPress,
|
|
693
699
|
onKeyDown: suppressKeyPress,
|
|
694
|
-
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm", (
|
|
700
|
+
className: (0, _runtime.ax)([(0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm", !!emojiToDelete && (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? withDeleteRefreshHeight[size] : uploading && (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? withUploadRefreshHeight[size] : showPreview ? withPreviewHeight[size] : withoutPreviewHeight[size]]),
|
|
695
701
|
style: {
|
|
696
702
|
"--_19dn98e": (0, _runtime.ix)("".concat(emojiPickerHeight, "px")),
|
|
697
703
|
"--_gsvyy7": (0, _runtime.ix)("".concat(emojiPickerWidth, "px"))
|
|
@@ -20,7 +20,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
20
20
|
actionSubjectId: actionSubjectId,
|
|
21
21
|
attributes: _objectSpread({
|
|
22
22
|
packageName: "@atlaskit/emoji",
|
|
23
|
-
packageVersion: "70.10.
|
|
23
|
+
packageVersion: "70.10.5"
|
|
24
24
|
}, attributes)
|
|
25
25
|
};
|
|
26
26
|
};
|
|
@@ -102,7 +102,7 @@ class EmojiDeletePreview extends Component {
|
|
|
102
102
|
}, /*#__PURE__*/React.createElement(CachingEmoji, {
|
|
103
103
|
emoji: emoji
|
|
104
104
|
})), /*#__PURE__*/React.createElement("div", {
|
|
105
|
-
className: ax(["_zulpu2gc _1e0c1txw _4cvr1h6o _1bahesu3 _19pkutpp"])
|
|
105
|
+
className: ax(["_zulpu2gc _1e0c1txw _4cvr1h6o _1bahesu3 _19pkutpp _n3tdutpp"])
|
|
106
106
|
}, error && !loading ? /*#__PURE__*/React.createElement(EmojiErrorMessage, {
|
|
107
107
|
message: formatMessage(messages.deleteEmojiFailed),
|
|
108
108
|
errorStyle: "delete",
|
|
@@ -8,6 +8,7 @@ import { sampledUfoRenderedEmoji } from '../../util/analytics';
|
|
|
8
8
|
import { EmojiCommonProvider } from '../../context/EmojiCommonProvider';
|
|
9
9
|
import { hasUfoMarked } from '../../util/analytics/ufoExperiences';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
|
+
import { emojiIdToEmoji } from '../../util/emojiIdToEmoji';
|
|
11
12
|
var ResourcedEmojiComponentRenderStatesEnum = /*#__PURE__*/function (ResourcedEmojiComponentRenderStatesEnum) {
|
|
12
13
|
ResourcedEmojiComponentRenderStatesEnum["INITIAL"] = "INITIAL";
|
|
13
14
|
ResourcedEmojiComponentRenderStatesEnum["FALLBACK"] = "FALLBACK";
|
|
@@ -49,7 +50,10 @@ export const ResourcedEmojiComponent = ({
|
|
|
49
50
|
}
|
|
50
51
|
});
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
|
|
54
|
+
// When id is absent/empty, fetchByEmojiId won't retry if the catalogue isn't loaded yet.
|
|
55
|
+
// findByEmojiId has retryIfLoading built in — use it for shortName-only lookups.
|
|
56
|
+
const foundEmoji = !emojiId.id && fg('platform_twemoji_removal_unicode_emojis') ? _emojiProvider.findByEmojiId(emojiId) : _emojiProvider.fetchByEmojiId(emojiId, optimisticFetch);
|
|
53
57
|
sampledUfoRenderedEmoji(emojiId).mark(UfoEmojiTimings.METADATA_START);
|
|
54
58
|
if (isPromise(foundEmoji)) {
|
|
55
59
|
setLoaded(false);
|
|
@@ -122,14 +126,36 @@ export const ResourcedEmojiComponent = ({
|
|
|
122
126
|
});
|
|
123
127
|
}, [emojiProvider]);
|
|
124
128
|
const emojiRenderState = useMemo(() => {
|
|
125
|
-
if (!emoji && !loaded && !optimisticImageURL) {
|
|
129
|
+
if (!emoji && !loaded && !optimisticImageURL || optimisticImageURL && !emoji && !id && fg('platform_twemoji_removal_unicode_emojis')) {
|
|
126
130
|
return ResourcedEmojiComponentRenderStatesEnum.INITIAL;
|
|
127
131
|
} else if (!emoji && loaded || imageLoadError) {
|
|
128
132
|
return ResourcedEmojiComponentRenderStatesEnum.FALLBACK;
|
|
129
133
|
}
|
|
130
134
|
return ResourcedEmojiComponentRenderStatesEnum.EMOJI;
|
|
131
|
-
}, [emoji, loaded, optimisticImageURL, imageLoadError]);
|
|
135
|
+
}, [emoji, loaded, optimisticImageURL, imageLoadError, id]);
|
|
132
136
|
const optimisticEmojiDescription = useMemo(() => {
|
|
137
|
+
// For STANDARD emojis, use native unicode character instead of optimistic image.
|
|
138
|
+
if (fg('platform_twemoji_removal_unicode_emojis')) {
|
|
139
|
+
const resolvedId = id || (emoji === null || emoji === void 0 ? void 0 : emoji.id);
|
|
140
|
+
if (!resolvedId) return undefined;
|
|
141
|
+
const unicodeEmoji = emojiIdToEmoji(resolvedId);
|
|
142
|
+
if (unicodeEmoji) {
|
|
143
|
+
return {
|
|
144
|
+
...(emoji !== null && emoji !== void 0 ? emoji : {
|
|
145
|
+
id,
|
|
146
|
+
shortName,
|
|
147
|
+
fallback,
|
|
148
|
+
type: 'STANDARD',
|
|
149
|
+
category: '',
|
|
150
|
+
searchable: true
|
|
151
|
+
}),
|
|
152
|
+
representation: {
|
|
153
|
+
unicodeEmoji
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
|
|
133
159
|
// reduce blast radius by targeting page title
|
|
134
160
|
if (pageTitleEmoji && optimisticImageURL && fg('platform_emoji_prevent_img_src_changing')) {
|
|
135
161
|
return {
|
|
@@ -22,11 +22,14 @@
|
|
|
22
22
|
._2lx21bp4{flex-direction:column}
|
|
23
23
|
._4t3i1784{height:470px}
|
|
24
24
|
._4t3i1ckg{height:455px}
|
|
25
|
+
._4t3i1dsu{height:419px}
|
|
25
26
|
._4t3i1sa4{height:390px}
|
|
26
27
|
._4t3i2300{height:429px}
|
|
28
|
+
._4t3i50k7{height:499px}
|
|
27
29
|
._4t3iaq3k{height:295px}
|
|
28
30
|
._4t3ibqjm{height:310px}
|
|
29
31
|
._4t3iixjv{height:375px}
|
|
32
|
+
._4t3iqbeb{height:339px}
|
|
30
33
|
._4t3ivixp{height:349px}
|
|
31
34
|
._4t3ixt2k{height:509px}
|
|
32
35
|
._94n5idpf{bottom:0}
|
|
@@ -32,6 +32,7 @@ const emojiPickerBoxShadow = "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0
|
|
|
32
32
|
const emojiPickerHeight = 295;
|
|
33
33
|
const emojiPickerHeightWithPreview = 349; // emojiPickerHeight + emojiPickerPreviewHeight;
|
|
34
34
|
const emojiPickerHeightWithPreviewNew = 310;
|
|
35
|
+
const emojiPickerHeightDeleteRefresh = 339;
|
|
35
36
|
const emojiPickerWidth = 350;
|
|
36
37
|
const emojiPickerMinHeight = 260;
|
|
37
38
|
const heightOffset = 80;
|
|
@@ -49,6 +50,11 @@ const withUploadRefreshHeight = {
|
|
|
49
50
|
medium: "_4t3i1sa4 _1tke5x59",
|
|
50
51
|
large: "_4t3i1784 _1tke1pna"
|
|
51
52
|
};
|
|
53
|
+
const withDeleteRefreshHeight = {
|
|
54
|
+
small: "_4t3iqbeb _1tkegx0z",
|
|
55
|
+
medium: "_4t3i1dsu _1tke5x59",
|
|
56
|
+
large: "_4t3i50k7 _1tke1pna"
|
|
57
|
+
};
|
|
52
58
|
const withoutPreviewHeight = {
|
|
53
59
|
small: "_4t3iaq3k _1tkegx0z",
|
|
54
60
|
medium: "_4t3iixjv _1tke5x59",
|
|
@@ -541,7 +547,7 @@ const EmojiPickerComponent = ({
|
|
|
541
547
|
role: "dialog",
|
|
542
548
|
"aria-label": formatMessage(messages.emojiPickerTitle),
|
|
543
549
|
"aria-modal": true,
|
|
544
|
-
className: ax([fg('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iaq3k _1bsb1edt _1ul91edt _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iaq3k _1bsb1edt _1ul91edt _c71l1y6z _kqswh2mm",
|
|
550
|
+
className: ax([fg('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iaq3k _1bsb1edt _1ul91edt _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iaq3k _1bsb1edt _1ul91edt _c71l1y6z _kqswh2mm", !!emojiToDelete && fg('platform_emoji_picker_refresh') ? withDeleteRefreshHeight[size] : uploading && fg('platform_emoji_picker_refresh') ? withUploadRefreshHeight[size] : showPreview ? withPreviewHeight[size] : withoutPreviewHeight[size]])
|
|
545
551
|
}, /*#__PURE__*/React.createElement("div", {
|
|
546
552
|
role: "presentation",
|
|
547
553
|
onKeyPress: suppressKeyPress,
|
|
@@ -597,7 +603,7 @@ const EmojiPickerComponent = ({
|
|
|
597
603
|
onKeyPress: suppressKeyPress,
|
|
598
604
|
onKeyUp: suppressKeyPress,
|
|
599
605
|
onKeyDown: suppressKeyPress,
|
|
600
|
-
className: ax([fg('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iaq3k _1bsb1edt _1ul91edt _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iaq3k _1bsb1edt _1ul91edt _c71l1y6z _kqswh2mm",
|
|
606
|
+
className: ax([fg('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iaq3k _1bsb1edt _1ul91edt _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iaq3k _1bsb1edt _1ul91edt _c71l1y6z _kqswh2mm", !!emojiToDelete && fg('platform_emoji_picker_refresh') ? withDeleteRefreshHeight[size] : uploading && fg('platform_emoji_picker_refresh') ? withUploadRefreshHeight[size] : showPreview ? withPreviewHeight[size] : withoutPreviewHeight[size]])
|
|
601
607
|
}, /*#__PURE__*/React.createElement(CategorySelector, {
|
|
602
608
|
activeCategoryId: (uploading || emojiToDelete) && fg('platform_emoji_picker_refresh') ? null : activeCategory,
|
|
603
609
|
dynamicCategories: dynamicCategories,
|
|
@@ -112,7 +112,7 @@ var EmojiDeletePreview = /*#__PURE__*/function (_Component) {
|
|
|
112
112
|
}, /*#__PURE__*/React.createElement(CachingEmoji, {
|
|
113
113
|
emoji: emoji
|
|
114
114
|
})), /*#__PURE__*/React.createElement("div", {
|
|
115
|
-
className: ax(["_zulpu2gc _1e0c1txw _4cvr1h6o _1bahesu3 _19pkutpp"])
|
|
115
|
+
className: ax(["_zulpu2gc _1e0c1txw _4cvr1h6o _1bahesu3 _19pkutpp _n3tdutpp"])
|
|
116
116
|
}, error && !loading ? /*#__PURE__*/React.createElement(EmojiErrorMessage, {
|
|
117
117
|
message: formatMessage(messages.deleteEmojiFailed),
|
|
118
118
|
errorStyle: "delete",
|
|
@@ -14,6 +14,7 @@ import { sampledUfoRenderedEmoji } from '../../util/analytics';
|
|
|
14
14
|
import { EmojiCommonProvider } from '../../context/EmojiCommonProvider';
|
|
15
15
|
import { hasUfoMarked } from '../../util/analytics/ufoExperiences';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
|
+
import { emojiIdToEmoji } from '../../util/emojiIdToEmoji';
|
|
17
18
|
var ResourcedEmojiComponentRenderStatesEnum = /*#__PURE__*/function (ResourcedEmojiComponentRenderStatesEnum) {
|
|
18
19
|
ResourcedEmojiComponentRenderStatesEnum["INITIAL"] = "INITIAL";
|
|
19
20
|
ResourcedEmojiComponentRenderStatesEnum["FALLBACK"] = "FALLBACK";
|
|
@@ -79,7 +80,10 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
|
|
|
79
80
|
}
|
|
80
81
|
});
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
+
|
|
84
|
+
// When id is absent/empty, fetchByEmojiId won't retry if the catalogue isn't loaded yet.
|
|
85
|
+
// findByEmojiId has retryIfLoading built in — use it for shortName-only lookups.
|
|
86
|
+
foundEmoji = !emojiId.id && fg('platform_twemoji_removal_unicode_emojis') ? _emojiProvider.findByEmojiId(emojiId) : _emojiProvider.fetchByEmojiId(emojiId, optimisticFetch);
|
|
83
87
|
sampledUfoRenderedEmoji(emojiId).mark(UfoEmojiTimings.METADATA_START);
|
|
84
88
|
if (isPromise(foundEmoji)) {
|
|
85
89
|
setLoaded(false);
|
|
@@ -161,14 +165,35 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
|
|
|
161
165
|
});
|
|
162
166
|
}, [emojiProvider]);
|
|
163
167
|
var emojiRenderState = useMemo(function () {
|
|
164
|
-
if (!emoji && !loaded && !optimisticImageURL) {
|
|
168
|
+
if (!emoji && !loaded && !optimisticImageURL || optimisticImageURL && !emoji && !id && fg('platform_twemoji_removal_unicode_emojis')) {
|
|
165
169
|
return ResourcedEmojiComponentRenderStatesEnum.INITIAL;
|
|
166
170
|
} else if (!emoji && loaded || imageLoadError) {
|
|
167
171
|
return ResourcedEmojiComponentRenderStatesEnum.FALLBACK;
|
|
168
172
|
}
|
|
169
173
|
return ResourcedEmojiComponentRenderStatesEnum.EMOJI;
|
|
170
|
-
}, [emoji, loaded, optimisticImageURL, imageLoadError]);
|
|
174
|
+
}, [emoji, loaded, optimisticImageURL, imageLoadError, id]);
|
|
171
175
|
var optimisticEmojiDescription = useMemo(function () {
|
|
176
|
+
// For STANDARD emojis, use native unicode character instead of optimistic image.
|
|
177
|
+
if (fg('platform_twemoji_removal_unicode_emojis')) {
|
|
178
|
+
var resolvedId = id || (emoji === null || emoji === void 0 ? void 0 : emoji.id);
|
|
179
|
+
if (!resolvedId) return undefined;
|
|
180
|
+
var unicodeEmoji = emojiIdToEmoji(resolvedId);
|
|
181
|
+
if (unicodeEmoji) {
|
|
182
|
+
return _objectSpread(_objectSpread({}, emoji !== null && emoji !== void 0 ? emoji : {
|
|
183
|
+
id: id,
|
|
184
|
+
shortName: shortName,
|
|
185
|
+
fallback: fallback,
|
|
186
|
+
type: 'STANDARD',
|
|
187
|
+
category: '',
|
|
188
|
+
searchable: true
|
|
189
|
+
}), {}, {
|
|
190
|
+
representation: {
|
|
191
|
+
unicodeEmoji: unicodeEmoji
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
|
|
172
197
|
// reduce blast radius by targeting page title
|
|
173
198
|
if (pageTitleEmoji && optimisticImageURL && fg('platform_emoji_prevent_img_src_changing')) {
|
|
174
199
|
return {
|
|
@@ -22,11 +22,14 @@
|
|
|
22
22
|
._2lx21bp4{flex-direction:column}
|
|
23
23
|
._4t3i1784{height:470px}
|
|
24
24
|
._4t3i1ckg{height:455px}
|
|
25
|
+
._4t3i1dsu{height:419px}
|
|
25
26
|
._4t3i1sa4{height:390px}
|
|
26
27
|
._4t3i2300{height:429px}
|
|
28
|
+
._4t3i50k7{height:499px}
|
|
27
29
|
._4t3iaq3k{height:295px}
|
|
28
30
|
._4t3ibqjm{height:310px}
|
|
29
31
|
._4t3iixjv{height:375px}
|
|
32
|
+
._4t3iqbeb{height:339px}
|
|
30
33
|
._4t3iuxo9{height:var(--_19dn98e)}
|
|
31
34
|
._4t3ivixp{height:349px}
|
|
32
35
|
._4t3ixt2k{height:509px}
|
|
@@ -39,6 +39,7 @@ var emojiPickerBoxShadow = "var(--ds-shadow-overlay, 0px 8px 12px #1E1F2126, 0px
|
|
|
39
39
|
var emojiPickerHeight = 295;
|
|
40
40
|
var emojiPickerHeightWithPreview = 349; // emojiPickerHeight + emojiPickerPreviewHeight;
|
|
41
41
|
var emojiPickerHeightWithPreviewNew = 310;
|
|
42
|
+
var emojiPickerHeightDeleteRefresh = 339;
|
|
42
43
|
var emojiPickerWidth = 350;
|
|
43
44
|
var emojiPickerMinHeight = 260;
|
|
44
45
|
var heightOffset = 80;
|
|
@@ -56,6 +57,11 @@ var withUploadRefreshHeight = {
|
|
|
56
57
|
medium: "_4t3i1sa4 _1tke5x59",
|
|
57
58
|
large: "_4t3i1784 _1tke1pna"
|
|
58
59
|
};
|
|
60
|
+
var withDeleteRefreshHeight = {
|
|
61
|
+
small: "_4t3iqbeb _1tkegx0z",
|
|
62
|
+
medium: "_4t3i1dsu _1tke5x59",
|
|
63
|
+
large: "_4t3i50k7 _1tke1pna"
|
|
64
|
+
};
|
|
59
65
|
var withoutPreviewHeight = {
|
|
60
66
|
small: "_4t3iaq3k _1tkegx0z",
|
|
61
67
|
medium: "_4t3iixjv _1tke5x59",
|
|
@@ -622,7 +628,7 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
622
628
|
role: "dialog",
|
|
623
629
|
"aria-label": formatMessage(messages.emojiPickerTitle),
|
|
624
630
|
"aria-modal": true,
|
|
625
|
-
className: ax([fg('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm",
|
|
631
|
+
className: ax([fg('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm", !!emojiToDelete && fg('platform_emoji_picker_refresh') ? withDeleteRefreshHeight[size] : uploading && fg('platform_emoji_picker_refresh') ? withUploadRefreshHeight[size] : showPreview ? withPreviewHeight[size] : withoutPreviewHeight[size]]),
|
|
626
632
|
style: {
|
|
627
633
|
"--_19dn98e": ix("".concat(emojiPickerHeight, "px")),
|
|
628
634
|
"--_gsvyy7": ix("".concat(emojiPickerWidth, "px"))
|
|
@@ -682,7 +688,7 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
682
688
|
onKeyPress: suppressKeyPress,
|
|
683
689
|
onKeyUp: suppressKeyPress,
|
|
684
690
|
onKeyDown: suppressKeyPress,
|
|
685
|
-
className: ax([fg('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm",
|
|
691
|
+
className: ax([fg('platform_emoji_picker_refresh') ? "_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm" : "_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iuxo9 _1bsb10mj _1ul910mj _c71l1y6z _kqswh2mm", !!emojiToDelete && fg('platform_emoji_picker_refresh') ? withDeleteRefreshHeight[size] : uploading && fg('platform_emoji_picker_refresh') ? withUploadRefreshHeight[size] : showPreview ? withPreviewHeight[size] : withoutPreviewHeight[size]]),
|
|
686
692
|
style: {
|
|
687
693
|
"--_19dn98e": ix("".concat(emojiPickerHeight, "px")),
|
|
688
694
|
"--_gsvyy7": ix("".concat(emojiPickerWidth, "px"))
|
|
@@ -14,7 +14,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
14
14
|
actionSubjectId: actionSubjectId,
|
|
15
15
|
attributes: _objectSpread({
|
|
16
16
|
packageName: "@atlaskit/emoji",
|
|
17
|
-
packageVersion: "70.10.
|
|
17
|
+
packageVersion: "70.10.5"
|
|
18
18
|
}, attributes)
|
|
19
19
|
};
|
|
20
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/emoji",
|
|
3
|
-
"version": "70.10.
|
|
3
|
+
"version": "70.10.6",
|
|
4
4
|
"description": "Fabric emoji React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -52,9 +52,9 @@
|
|
|
52
52
|
"@atlaskit/primitives": "^19.0.0",
|
|
53
53
|
"@atlaskit/spinner": "^19.1.0",
|
|
54
54
|
"@atlaskit/textfield": "^8.3.0",
|
|
55
|
-
"@atlaskit/tmp-editor-statsig": "^82.
|
|
55
|
+
"@atlaskit/tmp-editor-statsig": "^82.5.0",
|
|
56
56
|
"@atlaskit/tokens": "^13.0.0",
|
|
57
|
-
"@atlaskit/tooltip": "^22.
|
|
57
|
+
"@atlaskit/tooltip": "^22.3.0",
|
|
58
58
|
"@atlaskit/ufo": "^0.5.0",
|
|
59
59
|
"@atlaskit/util-service-support": "^6.4.0",
|
|
60
60
|
"@atlaskit/visually-hidden": "^3.1.0",
|