@atlaskit/emoji 71.4.0 → 71.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/api/EmojiUtils.js +2 -2
- package/dist/cjs/components/common/Emoji.js +4 -0
- package/dist/cjs/components/common/EmojiPreviewComponent.js +2 -2
- package/dist/cjs/components/common/EmojiRadioButton.js +2 -2
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +4 -3
- package/dist/cjs/components/common/TonePreviewButton.js +2 -2
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +3 -1
- package/dist/cjs/util/analytics/analytics.js +1 -1
- package/dist/cjs/util/emojiIdToEmoji.js +2 -2
- package/dist/es2019/api/EmojiUtils.js +2 -2
- package/dist/es2019/components/common/Emoji.js +5 -1
- package/dist/es2019/components/common/EmojiPreviewComponent.js +2 -2
- package/dist/es2019/components/common/EmojiRadioButton.js +2 -2
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +4 -3
- package/dist/es2019/components/common/TonePreviewButton.js +2 -2
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +3 -1
- package/dist/es2019/util/analytics/analytics.js +1 -1
- package/dist/es2019/util/emojiIdToEmoji.js +2 -2
- package/dist/esm/api/EmojiUtils.js +2 -2
- package/dist/esm/components/common/Emoji.js +5 -1
- package/dist/esm/components/common/EmojiPreviewComponent.js +2 -2
- package/dist/esm/components/common/EmojiRadioButton.js +2 -2
- package/dist/esm/components/common/ResourcedEmojiComponent.js +4 -3
- package/dist/esm/components/common/TonePreviewButton.js +2 -2
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +3 -1
- package/dist/esm/util/analytics/analytics.js +1 -1
- package/dist/esm/util/emojiIdToEmoji.js +2 -2
- package/package.json +3 -6
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/emoji
|
|
2
2
|
|
|
3
|
+
## 71.4.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`05b9f7b19ddba`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/05b9f7b19ddba) -
|
|
8
|
+
Use the platform_use_unicode_emojis experiment for native Unicode emoji rendering.
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 71.4.1
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [`9a7ca4cefe634`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9a7ca4cefe634) -
|
|
16
|
+
Use the platform_use_unicode_emojis experiment for native Unicode emoji rendering.
|
|
17
|
+
- [`2a3076a890d07`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2a3076a890d07) -
|
|
18
|
+
Fix unicode emoji image rendering so generated unicode images do not fall back to alt image
|
|
19
|
+
representations at large sizes.
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 71.4.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -9,10 +9,10 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
10
|
var _utilServiceSupport = require("@atlaskit/util-service-support");
|
|
11
11
|
var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
|
|
12
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
12
13
|
var _types = require("../types");
|
|
13
14
|
var _typeHelpers = require("../util/type-helpers");
|
|
14
15
|
var _logger = _interopRequireDefault(require("../util/logger"));
|
|
15
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
16
|
var _emojiIdToEmoji = require("../util/emojiIdToEmoji");
|
|
17
17
|
var _excluded = ["getRatio"],
|
|
18
18
|
_excluded2 = ["queryParams"],
|
|
@@ -119,7 +119,7 @@ var denormaliseServiceAltRepresentation = exports.denormaliseServiceAltRepresent
|
|
|
119
119
|
};
|
|
120
120
|
var denormaliseStandardRepresentation = function denormaliseStandardRepresentation(emoji, meta) {
|
|
121
121
|
var unicodeEmoji = (0, _emojiIdToEmoji.emojiIdToEmoji)(emoji.id);
|
|
122
|
-
var useUnicodeRepresentation = !!(emoji.id && emoji.type === _types.ProviderTypes.STANDARD && unicodeEmoji && (0,
|
|
122
|
+
var useUnicodeRepresentation = !!(emoji.id && emoji.type === _types.ProviderTypes.STANDARD && unicodeEmoji && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true));
|
|
123
123
|
return useUnicodeRepresentation ? {
|
|
124
124
|
unicodeEmoji: unicodeEmoji
|
|
125
125
|
} : denormaliseServiceRepresentation(emoji.representation, meta);
|
|
@@ -269,6 +269,7 @@ var UnicodeEmojiImage = function UnicodeEmojiImage(props) {
|
|
|
269
269
|
if (unicodeEmojiImage.status === 'ready') {
|
|
270
270
|
return /*#__PURE__*/_react.default.createElement(ImageEmoji, (0, _extends2.default)({}, props, {
|
|
271
271
|
emoji: _objectSpread(_objectSpread({}, emoji), {}, {
|
|
272
|
+
altRepresentation: undefined,
|
|
272
273
|
representation: {
|
|
273
274
|
imagePath: unicodeEmojiImage.imagePath,
|
|
274
275
|
width: unicodeEmojiCanvasSize,
|
|
@@ -539,6 +540,9 @@ var Emoji = exports.Emoji = function Emoji(props) {
|
|
|
539
540
|
if (!(0, _ufoExperiences.hasUfoMarked)(ufoExp, _types.UfoEmojiTimings.MOUNTED_END)) {
|
|
540
541
|
ufoExp.mark(_types.UfoEmojiTimings.MOUNTED_END);
|
|
541
542
|
}
|
|
543
|
+
if (emoji.type === _types.ProviderTypes.STANDARD || (0, _typeHelpers.isUnicodeRepresentation)(emoji.representation)) {
|
|
544
|
+
(0, _expValEquals.expValEquals)('platform_use_unicode_emojis', 'isEnabled', true);
|
|
545
|
+
}
|
|
542
546
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
543
547
|
}, []);
|
|
544
548
|
if ((0, _typeHelpers.isUnicodeRepresentation)(emoji.representation)) {
|
|
@@ -10,8 +10,8 @@ exports.EmojiPreviewComponent = void 0;
|
|
|
10
10
|
require("./EmojiPreviewComponent.compiled.css");
|
|
11
11
|
var React = _interopRequireWildcard(require("react"));
|
|
12
12
|
var _runtime = require("@compiled/react/runtime");
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _CachingEmoji = _interopRequireDefault(require("./CachingEmoji"));
|
|
14
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
15
15
|
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); }
|
|
16
16
|
var emojiName = null;
|
|
17
17
|
var emojiShortName = null;
|
|
@@ -20,7 +20,7 @@ var previewImg = null;
|
|
|
20
20
|
var previewText = null;
|
|
21
21
|
var EmojiPreviewComponent = exports.EmojiPreviewComponent = function EmojiPreviewComponent(_ref) {
|
|
22
22
|
var emoji = _ref.emoji;
|
|
23
|
-
var fitToHeight = (0,
|
|
23
|
+
var fitToHeight = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true) ? 32 : undefined;
|
|
24
24
|
return /*#__PURE__*/React.createElement("div", {
|
|
25
25
|
className: (0, _runtime.ax)(["_ca0q19bv _u5f319bv _n3td19bv _19bv19bv _1e0c1txw _2lx2vrvc _1n261q9c _4t3izwfg _4cvr1h6o"])
|
|
26
26
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -10,11 +10,11 @@ exports.default = exports.EmojiRadioButton = void 0;
|
|
|
10
10
|
require("./EmojiRadioButton.compiled.css");
|
|
11
11
|
var _runtime = require("@compiled/react/runtime");
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
14
13
|
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
15
14
|
var _Emoji = _interopRequireDefault(require("./Emoji"));
|
|
16
15
|
var _constants = require("../../util/constants");
|
|
17
16
|
var _visuallyHidden = _interopRequireDefault(require("@atlaskit/visually-hidden"));
|
|
17
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
18
18
|
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); }
|
|
19
19
|
var emojiButton = null;
|
|
20
20
|
var emojiRadio = {
|
|
@@ -42,7 +42,7 @@ var EmojiRadioButton = exports.EmojiRadioButton = /*#__PURE__*/(0, _react.forwar
|
|
|
42
42
|
selectOnHover = props.selectOnHover,
|
|
43
43
|
ariaLabelText = props.ariaLabelText,
|
|
44
44
|
defaultChecked = props.defaultChecked;
|
|
45
|
-
var fitToHeight = (0,
|
|
45
|
+
var fitToHeight = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
|
|
46
46
|
return /*#__PURE__*/_react.default.createElement("label", {
|
|
47
47
|
className: (0, _runtime.ax)(["_19itidpf _2rkofajl _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _bfhk1j28 _80omtlke _kqswh2mm _1e0c1o8l _lev4idpf _1cx6idpf _tyukidpf _2ewlidpf _11bcidpf _dqozglyw _1at812x7 _1cjo12x7 _1yg612x7 _hjaq12x7 _hlt21tcg _1s3c1tcg _1i911tcg _1ye71tcg"])
|
|
48
48
|
}, /*#__PURE__*/_react.default.createElement(_visuallyHidden.default, null, ariaLabelText), /*#__PURE__*/_react.default.createElement("input", {
|
|
@@ -21,6 +21,7 @@ var _EmojiCommonProvider = require("../../context/EmojiCommonProvider");
|
|
|
21
21
|
var _ufoExperiences = require("../../util/analytics/ufoExperiences");
|
|
22
22
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
23
23
|
var _emojiIdToEmoji = require("../../util/emojiIdToEmoji");
|
|
24
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
24
25
|
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); }
|
|
25
26
|
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; }
|
|
26
27
|
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; }
|
|
@@ -94,7 +95,7 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
|
|
|
94
95
|
|
|
95
96
|
// When id is absent/empty, fetchByEmojiId won't retry if the catalogue isn't loaded yet.
|
|
96
97
|
// findByEmojiId has retryIfLoading built in — use it for shortName-only lookups.
|
|
97
|
-
foundEmoji = !emojiId.id && (0,
|
|
98
|
+
foundEmoji = !emojiId.id && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true) ? _emojiProvider.findByEmojiId(emojiId) : _emojiProvider.fetchByEmojiId(emojiId, optimisticFetch);
|
|
98
99
|
(0, _analytics.sampledUfoRenderedEmoji)(emojiId).mark(_types.UfoEmojiTimings.METADATA_START);
|
|
99
100
|
if ((0, _typeHelpers.isPromise)(foundEmoji)) {
|
|
100
101
|
setLoaded(false);
|
|
@@ -176,7 +177,7 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
|
|
|
176
177
|
});
|
|
177
178
|
}, [emojiProvider]);
|
|
178
179
|
var emojiRenderState = (0, _react.useMemo)(function () {
|
|
179
|
-
if (!emoji && !loaded && !optimisticImageURL || optimisticImageURL && !emoji && !id && (0,
|
|
180
|
+
if (!emoji && !loaded && !optimisticImageURL || optimisticImageURL && !emoji && !id && (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
180
181
|
return ResourcedEmojiComponentRenderStatesEnum.INITIAL;
|
|
181
182
|
} else if (!emoji && loaded || imageLoadError) {
|
|
182
183
|
return ResourcedEmojiComponentRenderStatesEnum.FALLBACK;
|
|
@@ -185,7 +186,7 @@ var ResourcedEmojiComponent = exports.ResourcedEmojiComponent = function Resourc
|
|
|
185
186
|
}, [emoji, loaded, optimisticImageURL, imageLoadError, id]);
|
|
186
187
|
var optimisticEmojiDescription = (0, _react.useMemo)(function () {
|
|
187
188
|
// For STANDARD emojis, use native unicode character instead of optimistic image.
|
|
188
|
-
if ((0,
|
|
189
|
+
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
189
190
|
var resolvedId = id || (emoji === null || emoji === void 0 ? void 0 : emoji.id);
|
|
190
191
|
if (!resolvedId) return undefined;
|
|
191
192
|
var unicodeEmoji = (0, _emojiIdToEmoji.emojiIdToEmoji)(resolvedId);
|
|
@@ -11,9 +11,9 @@ require("./TonePreviewButton.compiled.css");
|
|
|
11
11
|
var _react = _interopRequireWildcard(require("react"));
|
|
12
12
|
var React = _react;
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
15
14
|
var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
|
|
16
15
|
var _Emoji = _interopRequireDefault(require("./Emoji"));
|
|
16
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
17
17
|
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); }
|
|
18
18
|
var tonePreviewTestId = exports.tonePreviewTestId = 'tone-preview';
|
|
19
19
|
var emojiButton = null;
|
|
@@ -31,7 +31,7 @@ var TonePreviewButton = exports.TonePreviewButton = /*#__PURE__*/(0, _react.forw
|
|
|
31
31
|
onSelected = props.onSelected,
|
|
32
32
|
_props$isVisible = props.isVisible,
|
|
33
33
|
isVisible = _props$isVisible === void 0 ? true : _props$isVisible;
|
|
34
|
-
var fitToHeight = (0,
|
|
34
|
+
var fitToHeight = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
|
|
35
35
|
return _featureGateJsClient.default.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("button", {
|
|
36
36
|
ref: ref,
|
|
37
37
|
onClick: onSelected,
|
|
@@ -17,6 +17,7 @@ var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gat
|
|
|
17
17
|
var _reactIntl = require("react-intl");
|
|
18
18
|
var _CachingEmoji = _interopRequireDefault(require("../common/CachingEmoji"));
|
|
19
19
|
var _useEmojiPickerListContext = require("../../hooks/useEmojiPickerListContext");
|
|
20
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
20
21
|
var _i18n = require("../i18n");
|
|
21
22
|
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); }
|
|
22
23
|
var emojiItem = null;
|
|
@@ -39,7 +40,7 @@ var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
|
|
|
39
40
|
var rowIndex = (virtualItemContext === null || virtualItemContext === void 0 ? void 0 : virtualItemContext.index) || 0;
|
|
40
41
|
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
41
42
|
formatMessage = _useIntl.formatMessage;
|
|
42
|
-
var fitToHeight = (0,
|
|
43
|
+
var fitToHeight = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
|
|
43
44
|
var preventFocusOnMouseDown = _featureGateJsClient.default.getExperimentValue(teamojiRefreshExperimentName, 'isEnabled', false);
|
|
44
45
|
var handleFocus = function handleFocus(index) {
|
|
45
46
|
return function (emojiId, emoji, event) {
|
|
@@ -75,6 +76,7 @@ var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
|
|
|
75
76
|
tabIndex: focus ? 0 : -1,
|
|
76
77
|
"aria-roledescription": formatMessage(_i18n.messages.emojiButtonRoleDescription),
|
|
77
78
|
shouldBeInteractive: true,
|
|
79
|
+
fitToHeight: fitToHeight,
|
|
78
80
|
preventFocusOnMouseDown: preventFocusOnMouseDown
|
|
79
81
|
}));
|
|
80
82
|
}));
|
|
@@ -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: "71.
|
|
23
|
+
packageVersion: "71.4.1"
|
|
24
24
|
}, attributes)
|
|
25
25
|
};
|
|
26
26
|
};
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
6
|
exports.emojiIdToEmoji = emojiIdToEmoji;
|
|
7
|
-
var
|
|
7
|
+
var _expValEqualsNoExposure = require("@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure");
|
|
8
8
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
9
9
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
10
10
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
@@ -82,7 +82,7 @@ function emojiIdToEmoji(id) {
|
|
|
82
82
|
// Text-presentation-default emoji: characters that are valid emoji but whose
|
|
83
83
|
// default rendering is text (e.g. ☪ ☺ ☢ etc.) must be followed by
|
|
84
84
|
// U+FE0F (VARIATION SELECTOR-16) to force emoji presentation.
|
|
85
|
-
if ((0,
|
|
85
|
+
if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
86
86
|
var lastCodePoint = processedCodePoints[processedCodePoints.length - 1];
|
|
87
87
|
var alreadyHasVariationSelector = lastCodePoint === VARIATION_SELECTOR_16 || lastCodePoint === VARIATION_SELECTOR_15 ||
|
|
88
88
|
// Keycap sequences end with U+20E3 — they already have U+FE0F inserted inline
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
2
2
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
3
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
3
4
|
import { ProviderTypes } from '../types';
|
|
4
5
|
import { isImageRepresentation, isSpriteServiceRepresentation, convertImageToMediaRepresentation, buildEmojiDescriptionWithAltRepresentation } from '../util/type-helpers';
|
|
5
6
|
import debug from '../util/logger';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
import { emojiIdToEmoji } from '../util/emojiIdToEmoji';
|
|
8
8
|
export const emojiRequest = (provider, options) => {
|
|
9
9
|
const {
|
|
@@ -109,7 +109,7 @@ export const denormaliseServiceAltRepresentation = (altReps, meta) => {
|
|
|
109
109
|
};
|
|
110
110
|
const denormaliseStandardRepresentation = (emoji, meta) => {
|
|
111
111
|
const unicodeEmoji = emojiIdToEmoji(emoji.id);
|
|
112
|
-
const useUnicodeRepresentation = !!(emoji.id && emoji.type === ProviderTypes.STANDARD && unicodeEmoji &&
|
|
112
|
+
const useUnicodeRepresentation = !!(emoji.id && emoji.type === ProviderTypes.STANDARD && unicodeEmoji && expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true));
|
|
113
113
|
return useUnicodeRepresentation ? {
|
|
114
114
|
unicodeEmoji
|
|
115
115
|
} : denormaliseServiceRepresentation(emoji.representation, meta);
|
|
@@ -8,7 +8,7 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
8
8
|
import { shouldUseAltRepresentation } from '../../api/EmojiUtils';
|
|
9
9
|
import { defaultEmojiHeight, deleteEmojiLabel, EMOJI_KEYBOARD_KEYS_SUPPORTED, KeyboardKeys, SAMPLING_RATE_EMOJI_RENDERED_EXP } from '../../util/constants';
|
|
10
10
|
import { isImageRepresentation, isMediaRepresentation, isSpriteRepresentation, isUnicodeRepresentation, toEmojiId } from '../../util/type-helpers';
|
|
11
|
-
import { UfoEmojiTimings } from '../../types';
|
|
11
|
+
import { ProviderTypes, UfoEmojiTimings } from '../../types';
|
|
12
12
|
import { leftClick } from '../../util/mouse';
|
|
13
13
|
import DeleteButton from './DeleteButton';
|
|
14
14
|
import { emojiNodeStyles, commonSelectedStyles, selectOnHoverStyles, emojiSprite, emojiMainStyle, emojiImage, deletableEmoji } from './styles';
|
|
@@ -244,6 +244,7 @@ const UnicodeEmojiImage = props => {
|
|
|
244
244
|
return /*#__PURE__*/React.createElement(ImageEmoji, _extends({}, props, {
|
|
245
245
|
emoji: {
|
|
246
246
|
...emoji,
|
|
247
|
+
altRepresentation: undefined,
|
|
247
248
|
representation: {
|
|
248
249
|
imagePath: unicodeEmojiImage.imagePath,
|
|
249
250
|
width: unicodeEmojiCanvasSize,
|
|
@@ -507,6 +508,9 @@ export const Emoji = props => {
|
|
|
507
508
|
if (!hasUfoMarked(ufoExp, UfoEmojiTimings.MOUNTED_END)) {
|
|
508
509
|
ufoExp.mark(UfoEmojiTimings.MOUNTED_END);
|
|
509
510
|
}
|
|
511
|
+
if (emoji.type === ProviderTypes.STANDARD || isUnicodeRepresentation(emoji.representation)) {
|
|
512
|
+
expValEquals('platform_use_unicode_emojis', 'isEnabled', true);
|
|
513
|
+
}
|
|
510
514
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
511
515
|
}, []);
|
|
512
516
|
if (isUnicodeRepresentation(emoji.representation)) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import "./EmojiPreviewComponent.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import CachingEmoji from './CachingEmoji';
|
|
6
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
7
|
const emojiName = null;
|
|
8
8
|
const emojiShortName = null;
|
|
9
9
|
const preview = null;
|
|
@@ -12,7 +12,7 @@ const previewText = null;
|
|
|
12
12
|
export const EmojiPreviewComponent = ({
|
|
13
13
|
emoji
|
|
14
14
|
}) => {
|
|
15
|
-
const fitToHeight =
|
|
15
|
+
const fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 32 : undefined;
|
|
16
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
17
17
|
className: ax(["_ca0q19bv _u5f319bv _n3td19bv _19bv19bv _1e0c1txw _2lx2vrvc _1n261q9c _4t3izwfg _4cvr1h6o"])
|
|
18
18
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import "./EmojiRadioButton.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { memo, forwardRef } from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
7
6
|
import Emoji from './Emoji';
|
|
8
7
|
import { TONESELECTOR_KEYBOARD_KEYS_SUPPORTED } from '../../util/constants';
|
|
9
8
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
9
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
10
10
|
const emojiButton = null;
|
|
11
11
|
const emojiRadio = {
|
|
12
12
|
default: "_tzy4idpf _kqswstnw _154i14id _1ltv14id _3y8mfajl _157z1r31 _1dzmglyw _1sqm1o36 _fh6w1y54 _1i1213zc"
|
|
@@ -37,7 +37,7 @@ export const EmojiRadioButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
37
37
|
ariaLabelText,
|
|
38
38
|
defaultChecked
|
|
39
39
|
} = props;
|
|
40
|
-
const fitToHeight =
|
|
40
|
+
const fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
|
|
41
41
|
return /*#__PURE__*/React.createElement("label", {
|
|
42
42
|
className: ax(["_19itidpf _2rkofajl _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _bfhk1j28 _80omtlke _kqswh2mm _1e0c1o8l _lev4idpf _1cx6idpf _tyukidpf _2ewlidpf _11bcidpf _dqozglyw _1at812x7 _1cjo12x7 _1yg612x7 _hjaq12x7 _hlt21tcg _1s3c1tcg _1i911tcg _1ye71tcg"])
|
|
43
43
|
}, /*#__PURE__*/React.createElement(VisuallyHidden, null, ariaLabelText), /*#__PURE__*/React.createElement("input", {
|
|
@@ -9,6 +9,7 @@ import { EmojiCommonProvider } from '../../context/EmojiCommonProvider';
|
|
|
9
9
|
import { hasUfoMarked } from '../../util/analytics/ufoExperiences';
|
|
10
10
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
11
11
|
import { emojiIdToEmoji } from '../../util/emojiIdToEmoji';
|
|
12
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
13
|
var ResourcedEmojiComponentRenderStatesEnum = /*#__PURE__*/function (ResourcedEmojiComponentRenderStatesEnum) {
|
|
13
14
|
ResourcedEmojiComponentRenderStatesEnum["INITIAL"] = "INITIAL";
|
|
14
15
|
ResourcedEmojiComponentRenderStatesEnum["FALLBACK"] = "FALLBACK";
|
|
@@ -54,7 +55,7 @@ export const ResourcedEmojiComponent = ({
|
|
|
54
55
|
|
|
55
56
|
// When id is absent/empty, fetchByEmojiId won't retry if the catalogue isn't loaded yet.
|
|
56
57
|
// findByEmojiId has retryIfLoading built in — use it for shortName-only lookups.
|
|
57
|
-
const foundEmoji = !emojiId.id &&
|
|
58
|
+
const foundEmoji = !emojiId.id && expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? _emojiProvider.findByEmojiId(emojiId) : _emojiProvider.fetchByEmojiId(emojiId, optimisticFetch);
|
|
58
59
|
sampledUfoRenderedEmoji(emojiId).mark(UfoEmojiTimings.METADATA_START);
|
|
59
60
|
if (isPromise(foundEmoji)) {
|
|
60
61
|
setLoaded(false);
|
|
@@ -127,7 +128,7 @@ export const ResourcedEmojiComponent = ({
|
|
|
127
128
|
});
|
|
128
129
|
}, [emojiProvider]);
|
|
129
130
|
const emojiRenderState = useMemo(() => {
|
|
130
|
-
if (!emoji && !loaded && !optimisticImageURL || optimisticImageURL && !emoji && !id &&
|
|
131
|
+
if (!emoji && !loaded && !optimisticImageURL || optimisticImageURL && !emoji && !id && expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
131
132
|
return ResourcedEmojiComponentRenderStatesEnum.INITIAL;
|
|
132
133
|
} else if (!emoji && loaded || imageLoadError) {
|
|
133
134
|
return ResourcedEmojiComponentRenderStatesEnum.FALLBACK;
|
|
@@ -136,7 +137,7 @@ export const ResourcedEmojiComponent = ({
|
|
|
136
137
|
}, [emoji, loaded, optimisticImageURL, imageLoadError, id]);
|
|
137
138
|
const optimisticEmojiDescription = useMemo(() => {
|
|
138
139
|
// For STANDARD emojis, use native unicode character instead of optimistic image.
|
|
139
|
-
if (
|
|
140
|
+
if (expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
140
141
|
const resolvedId = id || (emoji === null || emoji === void 0 ? void 0 : emoji.id);
|
|
141
142
|
if (!resolvedId) return undefined;
|
|
142
143
|
const unicodeEmoji = emojiIdToEmoji(resolvedId);
|
|
@@ -3,9 +3,9 @@ import "./TonePreviewButton.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { forwardRef, memo } from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
8
7
|
import Emoji from './Emoji';
|
|
8
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
9
|
export const tonePreviewTestId = 'tone-preview';
|
|
10
10
|
const emojiButton = null;
|
|
11
11
|
const hidden = null;
|
|
@@ -22,7 +22,7 @@ export const TonePreviewButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
22
22
|
onSelected,
|
|
23
23
|
isVisible = true
|
|
24
24
|
} = props;
|
|
25
|
-
const fitToHeight =
|
|
25
|
+
const fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
|
|
26
26
|
return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("button", {
|
|
27
27
|
ref: ref,
|
|
28
28
|
onClick: onSelected,
|
|
@@ -9,6 +9,7 @@ import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
|
9
9
|
import { useIntl } from 'react-intl';
|
|
10
10
|
import CachingEmoji from '../common/CachingEmoji';
|
|
11
11
|
import { useEmojiPickerListContext } from '../../hooks/useEmojiPickerListContext';
|
|
12
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
13
|
import { messages } from '../i18n';
|
|
13
14
|
const emojiItem = null;
|
|
14
15
|
const emojiPickerRow = null;
|
|
@@ -33,7 +34,7 @@ const EmojiPickerEmojiRow = ({
|
|
|
33
34
|
const {
|
|
34
35
|
formatMessage
|
|
35
36
|
} = useIntl();
|
|
36
|
-
const fitToHeight =
|
|
37
|
+
const fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
|
|
37
38
|
const preventFocusOnMouseDown = FeatureGates.getExperimentValue(teamojiRefreshExperimentName, 'isEnabled', false);
|
|
38
39
|
const handleFocus = index => (emojiId, emoji, event) => {
|
|
39
40
|
setEmojisFocus({
|
|
@@ -69,6 +70,7 @@ const EmojiPickerEmojiRow = ({
|
|
|
69
70
|
tabIndex: focus ? 0 : -1,
|
|
70
71
|
"aria-roledescription": formatMessage(messages.emojiButtonRoleDescription),
|
|
71
72
|
shouldBeInteractive: true,
|
|
73
|
+
fitToHeight: fitToHeight,
|
|
72
74
|
preventFocusOnMouseDown: preventFocusOnMouseDown
|
|
73
75
|
}));
|
|
74
76
|
}));
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
2
2
|
const KEYCAP_COMBINING = 0x20e3;
|
|
3
3
|
const VARIATION_SELECTOR_16 = 0xfe0f;
|
|
4
4
|
const VARIATION_SELECTOR_15 = 0xfe0e;
|
|
@@ -64,7 +64,7 @@ export function emojiIdToEmoji(id) {
|
|
|
64
64
|
// Text-presentation-default emoji: characters that are valid emoji but whose
|
|
65
65
|
// default rendering is text (e.g. ☪ ☺ ☢ etc.) must be followed by
|
|
66
66
|
// U+FE0F (VARIATION SELECTOR-16) to force emoji presentation.
|
|
67
|
-
if (
|
|
67
|
+
if (expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
68
68
|
const lastCodePoint = processedCodePoints[processedCodePoints.length - 1];
|
|
69
69
|
const alreadyHasVariationSelector = lastCodePoint === VARIATION_SELECTOR_16 || lastCodePoint === VARIATION_SELECTOR_15 ||
|
|
70
70
|
// Keycap sequences end with U+20E3 — they already have U+FE0F inserted inline
|
|
@@ -8,10 +8,10 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
8
8
|
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) { _defineProperty(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; }
|
|
9
9
|
import { utils as serviceUtils } from '@atlaskit/util-service-support';
|
|
10
10
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
11
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
11
12
|
import { ProviderTypes } from '../types';
|
|
12
13
|
import { isImageRepresentation, isSpriteServiceRepresentation, convertImageToMediaRepresentation, buildEmojiDescriptionWithAltRepresentation } from '../util/type-helpers';
|
|
13
14
|
import debug from '../util/logger';
|
|
14
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
15
15
|
import { emojiIdToEmoji } from '../util/emojiIdToEmoji';
|
|
16
16
|
export var emojiRequest = function emojiRequest(provider, options) {
|
|
17
17
|
var _provider$getRatio = provider.getRatio,
|
|
@@ -112,7 +112,7 @@ export var denormaliseServiceAltRepresentation = function denormaliseServiceAltR
|
|
|
112
112
|
};
|
|
113
113
|
var denormaliseStandardRepresentation = function denormaliseStandardRepresentation(emoji, meta) {
|
|
114
114
|
var unicodeEmoji = emojiIdToEmoji(emoji.id);
|
|
115
|
-
var useUnicodeRepresentation = !!(emoji.id && emoji.type === ProviderTypes.STANDARD && unicodeEmoji &&
|
|
115
|
+
var useUnicodeRepresentation = !!(emoji.id && emoji.type === ProviderTypes.STANDARD && unicodeEmoji && expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true));
|
|
116
116
|
return useUnicodeRepresentation ? {
|
|
117
117
|
unicodeEmoji: unicodeEmoji
|
|
118
118
|
} : denormaliseServiceRepresentation(emoji.representation, meta);
|
|
@@ -16,7 +16,7 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
16
16
|
import { shouldUseAltRepresentation } from '../../api/EmojiUtils';
|
|
17
17
|
import { defaultEmojiHeight, deleteEmojiLabel, EMOJI_KEYBOARD_KEYS_SUPPORTED, KeyboardKeys, SAMPLING_RATE_EMOJI_RENDERED_EXP } from '../../util/constants';
|
|
18
18
|
import { isImageRepresentation, isMediaRepresentation, isSpriteRepresentation, isUnicodeRepresentation, toEmojiId } from '../../util/type-helpers';
|
|
19
|
-
import { UfoEmojiTimings } from '../../types';
|
|
19
|
+
import { ProviderTypes, UfoEmojiTimings } from '../../types';
|
|
20
20
|
import { leftClick } from '../../util/mouse';
|
|
21
21
|
import DeleteButton from './DeleteButton';
|
|
22
22
|
import { emojiNodeStyles, commonSelectedStyles, selectOnHoverStyles, emojiSprite, emojiMainStyle, emojiImage, deletableEmoji } from './styles';
|
|
@@ -260,6 +260,7 @@ var UnicodeEmojiImage = function UnicodeEmojiImage(props) {
|
|
|
260
260
|
if (unicodeEmojiImage.status === 'ready') {
|
|
261
261
|
return /*#__PURE__*/React.createElement(ImageEmoji, _extends({}, props, {
|
|
262
262
|
emoji: _objectSpread(_objectSpread({}, emoji), {}, {
|
|
263
|
+
altRepresentation: undefined,
|
|
263
264
|
representation: {
|
|
264
265
|
imagePath: unicodeEmojiImage.imagePath,
|
|
265
266
|
width: unicodeEmojiCanvasSize,
|
|
@@ -530,6 +531,9 @@ export var Emoji = function Emoji(props) {
|
|
|
530
531
|
if (!hasUfoMarked(ufoExp, UfoEmojiTimings.MOUNTED_END)) {
|
|
531
532
|
ufoExp.mark(UfoEmojiTimings.MOUNTED_END);
|
|
532
533
|
}
|
|
534
|
+
if (emoji.type === ProviderTypes.STANDARD || isUnicodeRepresentation(emoji.representation)) {
|
|
535
|
+
expValEquals('platform_use_unicode_emojis', 'isEnabled', true);
|
|
536
|
+
}
|
|
533
537
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
534
538
|
}, []);
|
|
535
539
|
if (isUnicodeRepresentation(emoji.representation)) {
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
import "./EmojiPreviewComponent.compiled.css";
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import CachingEmoji from './CachingEmoji';
|
|
6
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
7
7
|
var emojiName = null;
|
|
8
8
|
var emojiShortName = null;
|
|
9
9
|
var preview = null;
|
|
@@ -11,7 +11,7 @@ var previewImg = null;
|
|
|
11
11
|
var previewText = null;
|
|
12
12
|
export var EmojiPreviewComponent = function EmojiPreviewComponent(_ref) {
|
|
13
13
|
var emoji = _ref.emoji;
|
|
14
|
-
var fitToHeight =
|
|
14
|
+
var fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 32 : undefined;
|
|
15
15
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
16
|
className: ax(["_ca0q19bv _u5f319bv _n3td19bv _19bv19bv _1e0c1txw _2lx2vrvc _1n261q9c _4t3izwfg _4cvr1h6o"])
|
|
17
17
|
}, /*#__PURE__*/React.createElement("span", {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
import "./EmojiRadioButton.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { memo, forwardRef } from 'react';
|
|
5
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
5
|
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
7
6
|
import Emoji from './Emoji';
|
|
8
7
|
import { TONESELECTOR_KEYBOARD_KEYS_SUPPORTED } from '../../util/constants';
|
|
9
8
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
9
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
10
10
|
var emojiButton = null;
|
|
11
11
|
var emojiRadio = {
|
|
12
12
|
default: "_tzy4idpf _kqswstnw _154i14id _1ltv14id _3y8mfajl _157z1r31 _1dzmglyw _1sqm1o36 _fh6w1y54 _1i1213zc"
|
|
@@ -33,7 +33,7 @@ export var EmojiRadioButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
33
33
|
selectOnHover = props.selectOnHover,
|
|
34
34
|
ariaLabelText = props.ariaLabelText,
|
|
35
35
|
defaultChecked = props.defaultChecked;
|
|
36
|
-
var fitToHeight =
|
|
36
|
+
var fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
|
|
37
37
|
return /*#__PURE__*/React.createElement("label", {
|
|
38
38
|
className: ax(["_19itidpf _2rkofajl _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _bfhk1j28 _80omtlke _kqswh2mm _1e0c1o8l _lev4idpf _1cx6idpf _tyukidpf _2ewlidpf _11bcidpf _dqozglyw _1at812x7 _1cjo12x7 _1yg612x7 _hjaq12x7 _hlt21tcg _1s3c1tcg _1i911tcg _1ye71tcg"])
|
|
39
39
|
}, /*#__PURE__*/React.createElement(VisuallyHidden, null, ariaLabelText), /*#__PURE__*/React.createElement("input", {
|
|
@@ -15,6 +15,7 @@ import { EmojiCommonProvider } from '../../context/EmojiCommonProvider';
|
|
|
15
15
|
import { hasUfoMarked } from '../../util/analytics/ufoExperiences';
|
|
16
16
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
17
17
|
import { emojiIdToEmoji } from '../../util/emojiIdToEmoji';
|
|
18
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
18
19
|
var ResourcedEmojiComponentRenderStatesEnum = /*#__PURE__*/function (ResourcedEmojiComponentRenderStatesEnum) {
|
|
19
20
|
ResourcedEmojiComponentRenderStatesEnum["INITIAL"] = "INITIAL";
|
|
20
21
|
ResourcedEmojiComponentRenderStatesEnum["FALLBACK"] = "FALLBACK";
|
|
@@ -85,7 +86,7 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
|
|
|
85
86
|
|
|
86
87
|
// When id is absent/empty, fetchByEmojiId won't retry if the catalogue isn't loaded yet.
|
|
87
88
|
// findByEmojiId has retryIfLoading built in — use it for shortName-only lookups.
|
|
88
|
-
foundEmoji = !emojiId.id &&
|
|
89
|
+
foundEmoji = !emojiId.id && expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? _emojiProvider.findByEmojiId(emojiId) : _emojiProvider.fetchByEmojiId(emojiId, optimisticFetch);
|
|
89
90
|
sampledUfoRenderedEmoji(emojiId).mark(UfoEmojiTimings.METADATA_START);
|
|
90
91
|
if (isPromise(foundEmoji)) {
|
|
91
92
|
setLoaded(false);
|
|
@@ -167,7 +168,7 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
|
|
|
167
168
|
});
|
|
168
169
|
}, [emojiProvider]);
|
|
169
170
|
var emojiRenderState = useMemo(function () {
|
|
170
|
-
if (!emoji && !loaded && !optimisticImageURL || optimisticImageURL && !emoji && !id &&
|
|
171
|
+
if (!emoji && !loaded && !optimisticImageURL || optimisticImageURL && !emoji && !id && expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
171
172
|
return ResourcedEmojiComponentRenderStatesEnum.INITIAL;
|
|
172
173
|
} else if (!emoji && loaded || imageLoadError) {
|
|
173
174
|
return ResourcedEmojiComponentRenderStatesEnum.FALLBACK;
|
|
@@ -176,7 +177,7 @@ export var ResourcedEmojiComponent = function ResourcedEmojiComponent(_ref) {
|
|
|
176
177
|
}, [emoji, loaded, optimisticImageURL, imageLoadError, id]);
|
|
177
178
|
var optimisticEmojiDescription = useMemo(function () {
|
|
178
179
|
// For STANDARD emojis, use native unicode character instead of optimistic image.
|
|
179
|
-
if (
|
|
180
|
+
if (expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
180
181
|
var resolvedId = id || (emoji === null || emoji === void 0 ? void 0 : emoji.id);
|
|
181
182
|
if (!resolvedId) return undefined;
|
|
182
183
|
var unicodeEmoji = emojiIdToEmoji(resolvedId);
|
|
@@ -3,9 +3,9 @@ import "./TonePreviewButton.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { forwardRef, memo } from 'react';
|
|
6
|
-
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
6
|
import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
8
7
|
import Emoji from './Emoji';
|
|
8
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
9
9
|
export var tonePreviewTestId = 'tone-preview';
|
|
10
10
|
var emojiButton = null;
|
|
11
11
|
var hidden = null;
|
|
@@ -22,7 +22,7 @@ export var TonePreviewButton = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
|
22
22
|
onSelected = props.onSelected,
|
|
23
23
|
_props$isVisible = props.isVisible,
|
|
24
24
|
isVisible = _props$isVisible === void 0 ? true : _props$isVisible;
|
|
25
|
-
var fitToHeight =
|
|
25
|
+
var fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
|
|
26
26
|
return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("button", {
|
|
27
27
|
ref: ref,
|
|
28
28
|
onClick: onSelected,
|
|
@@ -9,6 +9,7 @@ import FeatureGates from '@atlaskit/feature-gate-js-client';
|
|
|
9
9
|
import { useIntl } from 'react-intl';
|
|
10
10
|
import CachingEmoji from '../common/CachingEmoji';
|
|
11
11
|
import { useEmojiPickerListContext } from '../../hooks/useEmojiPickerListContext';
|
|
12
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
12
13
|
import { messages } from '../i18n';
|
|
13
14
|
var emojiItem = null;
|
|
14
15
|
var emojiPickerRow = null;
|
|
@@ -30,7 +31,7 @@ var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
|
|
|
30
31
|
var rowIndex = (virtualItemContext === null || virtualItemContext === void 0 ? void 0 : virtualItemContext.index) || 0;
|
|
31
32
|
var _useIntl = useIntl(),
|
|
32
33
|
formatMessage = _useIntl.formatMessage;
|
|
33
|
-
var fitToHeight =
|
|
34
|
+
var fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
|
|
34
35
|
var preventFocusOnMouseDown = FeatureGates.getExperimentValue(teamojiRefreshExperimentName, 'isEnabled', false);
|
|
35
36
|
var handleFocus = function handleFocus(index) {
|
|
36
37
|
return function (emojiId, emoji, event) {
|
|
@@ -66,6 +67,7 @@ var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
|
|
|
66
67
|
tabIndex: focus ? 0 : -1,
|
|
67
68
|
"aria-roledescription": formatMessage(messages.emojiButtonRoleDescription),
|
|
68
69
|
shouldBeInteractive: true,
|
|
70
|
+
fitToHeight: fitToHeight,
|
|
69
71
|
preventFocusOnMouseDown: preventFocusOnMouseDown
|
|
70
72
|
}));
|
|
71
73
|
}));
|
|
@@ -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: "71.
|
|
17
|
+
packageVersion: "71.4.1"
|
|
18
18
|
}, attributes)
|
|
19
19
|
};
|
|
20
20
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (!t) { if (Array.isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
|
|
2
2
|
function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
|
|
3
3
|
function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
|
|
4
|
-
import {
|
|
4
|
+
import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
|
|
5
5
|
var KEYCAP_COMBINING = 0x20e3;
|
|
6
6
|
var VARIATION_SELECTOR_16 = 0xfe0f;
|
|
7
7
|
var VARIATION_SELECTOR_15 = 0xfe0e;
|
|
@@ -76,7 +76,7 @@ export function emojiIdToEmoji(id) {
|
|
|
76
76
|
// Text-presentation-default emoji: characters that are valid emoji but whose
|
|
77
77
|
// default rendering is text (e.g. ☪ ☺ ☢ etc.) must be followed by
|
|
78
78
|
// U+FE0F (VARIATION SELECTOR-16) to force emoji presentation.
|
|
79
|
-
if (
|
|
79
|
+
if (expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true)) {
|
|
80
80
|
var lastCodePoint = processedCodePoints[processedCodePoints.length - 1];
|
|
81
81
|
var alreadyHasVariationSelector = lastCodePoint === VARIATION_SELECTOR_16 || lastCodePoint === VARIATION_SELECTOR_15 ||
|
|
82
82
|
// Keycap sequences end with U+20E3 — they already have U+FE0F inserted inline
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/emoji",
|
|
3
|
-
"version": "71.4.
|
|
3
|
+
"version": "71.4.2",
|
|
4
4
|
"description": "Fabric emoji React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
"@atlaskit/spinner": "^20.0.0",
|
|
50
50
|
"@atlaskit/textfield": "^9.0.0",
|
|
51
51
|
"@atlaskit/theme": "^26.0.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^109.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^109.2.0",
|
|
53
53
|
"@atlaskit/tokens": "^14.0.0",
|
|
54
54
|
"@atlaskit/tooltip": "^23.0.0",
|
|
55
55
|
"@atlaskit/ufo": "^1.0.0",
|
|
@@ -93,7 +93,7 @@
|
|
|
93
93
|
"react": "^18.2.0",
|
|
94
94
|
"react-addons-perf": "^15.3.2",
|
|
95
95
|
"react-dom": "^18.2.0",
|
|
96
|
-
"react-intl": "^
|
|
96
|
+
"react-intl": "^7.0.0",
|
|
97
97
|
"react-test-renderer": "^18.2.0",
|
|
98
98
|
"rxjs": "^5.5.0",
|
|
99
99
|
"sinon": "^2.2.0",
|
|
@@ -115,9 +115,6 @@
|
|
|
115
115
|
}
|
|
116
116
|
},
|
|
117
117
|
"platform-feature-flags": {
|
|
118
|
-
"platform_twemoji_removal_unicode_emojis": {
|
|
119
|
-
"type": "boolean"
|
|
120
|
-
},
|
|
121
118
|
"platform_index_emoji_just_in_time": {
|
|
122
119
|
"type": "boolean"
|
|
123
120
|
},
|