@atlaskit/emoji 71.4.2 → 71.4.4

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.
Files changed (64) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/components/common/DeleteButton.js +2 -2
  3. package/dist/cjs/components/common/Emoji.js +15 -7
  4. package/dist/cjs/components/common/EmojiActions.js +6 -14
  5. package/dist/cjs/components/common/EmojiDeletePreview.js +2 -2
  6. package/dist/cjs/components/common/EmojiErrorMessage.js +2 -2
  7. package/dist/cjs/components/common/EmojiRadioButton.js +2 -3
  8. package/dist/cjs/components/common/EmojiUploadPicker.js +9 -9
  9. package/dist/cjs/components/common/FileChooser.js +3 -3
  10. package/dist/cjs/components/common/TonePreviewButton.js +1 -2
  11. package/dist/cjs/components/common/ToneSelector.js +2 -2
  12. package/dist/cjs/components/picker/CategorySelector.js +7 -7
  13. package/dist/cjs/components/picker/EmojiPicker.js +2 -2
  14. package/dist/cjs/components/picker/EmojiPickerComponent.js +15 -15
  15. package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +1 -3
  16. package/dist/cjs/components/picker/EmojiPickerFooter.js +2 -3
  17. package/dist/cjs/components/picker/EmojiPickerList.js +2 -2
  18. package/dist/cjs/components/picker/EmojiPickerListSearch.js +2 -2
  19. package/dist/cjs/components/picker/VirtualList.js +3 -3
  20. package/dist/cjs/util/analytics/analytics.js +1 -1
  21. package/dist/cjs/util/emojiIdToEmoji.js +61 -49
  22. package/dist/es2019/components/common/DeleteButton.js +2 -2
  23. package/dist/es2019/components/common/Emoji.js +14 -6
  24. package/dist/es2019/components/common/EmojiActions.js +6 -14
  25. package/dist/es2019/components/common/EmojiDeletePreview.js +2 -2
  26. package/dist/es2019/components/common/EmojiErrorMessage.js +2 -2
  27. package/dist/es2019/components/common/EmojiRadioButton.js +2 -3
  28. package/dist/es2019/components/common/EmojiUploadPicker.js +9 -9
  29. package/dist/es2019/components/common/FileChooser.js +3 -3
  30. package/dist/es2019/components/common/TonePreviewButton.js +1 -2
  31. package/dist/es2019/components/common/ToneSelector.js +2 -2
  32. package/dist/es2019/components/picker/CategorySelector.js +6 -6
  33. package/dist/es2019/components/picker/EmojiPicker.js +2 -2
  34. package/dist/es2019/components/picker/EmojiPickerComponent.js +15 -15
  35. package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +1 -3
  36. package/dist/es2019/components/picker/EmojiPickerFooter.js +2 -2
  37. package/dist/es2019/components/picker/EmojiPickerList.js +2 -2
  38. package/dist/es2019/components/picker/EmojiPickerListSearch.js +2 -2
  39. package/dist/es2019/components/picker/VirtualList.js +3 -3
  40. package/dist/es2019/util/analytics/analytics.js +1 -1
  41. package/dist/es2019/util/emojiIdToEmoji.js +46 -40
  42. package/dist/esm/components/common/DeleteButton.js +2 -2
  43. package/dist/esm/components/common/Emoji.js +15 -7
  44. package/dist/esm/components/common/EmojiActions.js +6 -14
  45. package/dist/esm/components/common/EmojiDeletePreview.js +2 -2
  46. package/dist/esm/components/common/EmojiErrorMessage.js +2 -2
  47. package/dist/esm/components/common/EmojiRadioButton.js +2 -3
  48. package/dist/esm/components/common/EmojiUploadPicker.js +9 -9
  49. package/dist/esm/components/common/FileChooser.js +3 -3
  50. package/dist/esm/components/common/TonePreviewButton.js +1 -2
  51. package/dist/esm/components/common/ToneSelector.js +2 -2
  52. package/dist/esm/components/picker/CategorySelector.js +7 -7
  53. package/dist/esm/components/picker/EmojiPicker.js +2 -2
  54. package/dist/esm/components/picker/EmojiPickerComponent.js +15 -15
  55. package/dist/esm/components/picker/EmojiPickerEmojiRow.js +1 -3
  56. package/dist/esm/components/picker/EmojiPickerFooter.js +2 -2
  57. package/dist/esm/components/picker/EmojiPickerList.js +2 -2
  58. package/dist/esm/components/picker/EmojiPickerListSearch.js +2 -2
  59. package/dist/esm/components/picker/VirtualList.js +3 -3
  60. package/dist/esm/util/analytics/analytics.js +1 -1
  61. package/dist/esm/util/emojiIdToEmoji.js +61 -49
  62. package/dist/types/components/picker/EmojiPickerComponent.d.ts +0 -4
  63. package/dist/types/util/emojiIdToEmoji.d.ts +2 -2
  64. package/package.json +6 -6
@@ -13,7 +13,6 @@ var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
15
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
- var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
17
16
  var _reactIntl = require("react-intl");
18
17
  var _CachingEmoji = _interopRequireDefault(require("../common/CachingEmoji"));
19
18
  var _useEmojiPickerListContext = require("../../hooks/useEmojiPickerListContext");
@@ -23,7 +22,6 @@ function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r
23
22
  var emojiItem = null;
24
23
  var emojiPickerRow = null;
25
24
  var emojiPickerRowList = null;
26
- var teamojiRefreshExperimentName = 'platform_teamoji_26_refresh_emoji_picker';
27
25
  var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
28
26
  var emojis = _ref.emojis,
29
27
  onSelected = _ref.onSelected,
@@ -41,7 +39,7 @@ var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
41
39
  var _useIntl = (0, _reactIntl.useIntl)(),
42
40
  formatMessage = _useIntl.formatMessage;
43
41
  var fitToHeight = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
44
- var preventFocusOnMouseDown = _featureGateJsClient.default.getExperimentValue(teamojiRefreshExperimentName, 'isEnabled', false);
42
+ var preventFocusOnMouseDown = (0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', true);
45
43
  var handleFocus = function handleFocus(index) {
46
44
  return function (emojiId, emoji, event) {
47
45
  setEmojisFocus({
@@ -1,7 +1,6 @@
1
1
  /* EmojiPickerFooter.tsx generated by @compiled/babel-plugin v0.39.1 */
2
2
  "use strict";
3
3
 
4
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
4
  var _typeof = require("@babel/runtime/helpers/typeof");
6
5
  Object.defineProperty(exports, "__esModule", {
7
6
  value: true
@@ -13,9 +12,9 @@ var React = _react;
13
12
  var _runtime = require("@compiled/react/runtime");
14
13
  var _reactIntl = require("react-intl");
15
14
  var _compiled = require("@atlaskit/primitives/compiled");
16
- var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
17
15
  var _EmojiPreviewComponent = require("../common/EmojiPreviewComponent");
18
16
  var _AddEmoji = require("../common/AddEmoji");
17
+ var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
19
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); }
20
19
  var emojiPickerFooter = null;
21
20
  var emojiPickerFooterWithTopShadow = null;
@@ -29,7 +28,7 @@ var EmojiPickerFooter = function EmojiPickerFooter(_ref) {
29
28
  onOpenUpload = _ref.onOpenUpload,
30
29
  uploadEnabled = _ref.uploadEnabled;
31
30
  var intl = (0, _reactIntl.useIntl)();
32
- return _featureGateJsClient.default.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
31
+ return (0, _expVal.expVal)('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
33
32
  "data-testid": emojiPickerFooterTestId,
34
33
  className: (0, _runtime.ax)(["_16jlidpf _1o9zidpf _i0dl1wug", "_x3doia51"])
35
34
  }, selectedEmoji ? /*#__PURE__*/React.createElement(_compiled.Box, {
@@ -9,8 +9,8 @@ exports.RENDER_EMOJI_PICKER_LIST_TESTID = exports.EmojiPickerVirtualListInternal
9
9
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
10
10
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
11
11
  var _reactIntl = require("react-intl");
12
+ var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
12
13
  var _react = _interopRequireWildcard(require("react"));
13
- var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
14
14
  var _constants = require("../../util/constants");
15
15
  var _productivityColors = require("../../util/productivity-colors");
16
16
  var _hiddenEmojis = require("../../util/hidden-emojis");
@@ -106,7 +106,7 @@ var EmojiPickerVirtualListInternal = exports.EmojiPickerVirtualListInternal = /*
106
106
  _useState8 = (0, _slicedToArray2.default)(_useState7, 2),
107
107
  categoriesChanged = _useState8[0],
108
108
  setCategoriesChanged = _useState8[1];
109
- var isTeamojiExperimentEnabled = _featureGateJsClient.default.getExperimentValue(teamojiRefreshExperimentName, 'isEnabled', false);
109
+ var isTeamojiExperimentEnabled = (0, _expVal.expVal)(teamojiRefreshExperimentName, 'isEnabled', false);
110
110
  var visibleEmojis = (0, _react.useMemo)(function () {
111
111
  return isTeamojiExperimentEnabled ? (0, _hiddenEmojis.filterHiddenEmojis)(emojis) : emojis;
112
112
  }, [emojis, isTeamojiExperimentEnabled]);
@@ -17,8 +17,8 @@ var _react = _interopRequireWildcard(require("react"));
17
17
  var _reactIntl = require("react-intl");
18
18
  var _useDebounce = require("use-debounce");
19
19
  var _constants = require("../../util/constants");
20
- var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
21
20
  var _i18n = require("../i18n");
21
+ var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
22
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); }
23
23
  var input = null;
24
24
  var inputNew = null;
@@ -71,7 +71,7 @@ var EmojiPickerListSearch = exports.EmojiPickerListSearch = function EmojiPicker
71
71
  role: "status"
72
72
  }, dirty ? query === '' ? formatMessage(_i18n.messages.searchResultsStatusSeeAll) : formatMessage(_i18n.messages.searchResultsStatus, {
73
73
  count: resultsCount
74
- }) : null), _featureGateJsClient.default.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/_react.default.createElement("div", {
74
+ }) : null), (0, _expVal.expVal)('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/_react.default.createElement("div", {
75
75
  className: (0, _runtime.ax)(["_n6341l7x _18z11b66"])
76
76
  }, /*#__PURE__*/_react.default.createElement(_textfield.default, {
77
77
  role: "searchbox",
@@ -14,7 +14,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
14
14
  var _react = _interopRequireWildcard(require("react"));
15
15
  var _reactVirtual = require("@tanstack/react-virtual");
16
16
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
17
- var _featureGateJsClient = _interopRequireDefault(require("@atlaskit/feature-gate-js-client"));
17
+ var _expVal = require("@atlaskit/tmp-editor-statsig/expVal");
18
18
  var _useEmojiPickerListContext = require("../../hooks/useEmojiPickerListContext");
19
19
  var _constants = require("../../util/constants");
20
20
  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); }
@@ -65,7 +65,7 @@ var VirtualList = exports.VirtualList = /*#__PURE__*/_react.default.forwardRef(f
65
65
  var elemBottom = elementRect.bottom;
66
66
  var parentTop = parentRect.top;
67
67
  var parentBottom = parentRect.bottom;
68
- var isVisible = _featureGateJsClient.default.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? elemTop >= parentTop && elemBottom <= parentBottom : elemBottom > parentTop && elemTop < parentBottom;
68
+ var isVisible = (0, _expVal.expVal)('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? elemTop >= parentTop && elemBottom <= parentBottom : elemBottom > parentTop && elemTop < parentBottom;
69
69
  return isVisible;
70
70
  };
71
71
  var getFirstVisibleListElementIndex = (0, _react.useCallback)(function () {
@@ -84,7 +84,7 @@ var VirtualList = exports.VirtualList = /*#__PURE__*/_react.default.forwardRef(f
84
84
  var _virtualList$firstVis;
85
85
  return ((_virtualList$firstVis = virtualList[firstVisibleIndex]) === null || _virtualList$firstVis === void 0 ? void 0 : _virtualList$firstVis.index) || 0;
86
86
  }
87
- return _featureGateJsClient.default.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? ((_virtualList$ = virtualList[0]) === null || _virtualList$ === void 0 ? void 0 : _virtualList$.index) || 0 : 0;
87
+ return (0, _expVal.expVal)('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? ((_virtualList$ = virtualList[0]) === null || _virtualList$ === void 0 ? void 0 : _virtualList$.index) || 0 : 0;
88
88
  }, [rowVirtualizer]);
89
89
 
90
90
  /**
@@ -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.4.1"
23
+ packageVersion: "71.4.3"
24
24
  }, attributes)
25
25
  };
26
26
  };
@@ -11,36 +11,25 @@ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length)
11
11
  var KEYCAP_COMBINING = 0x20e3;
12
12
  var VARIATION_SELECTOR_16 = 0xfe0f;
13
13
  var VARIATION_SELECTOR_15 = 0xfe0e;
14
+ var EMOJI_MODIFIER_START = 0x1f3fb;
15
+ var EMOJI_MODIFIER_END = 0x1f3ff;
16
+ var REGIONAL_INDICATOR_START = 0x1f1e6;
17
+ var REGIONAL_INDICATOR_END = 0x1f1ff;
18
+ var FLAG_BASES = new Set([0x1f38c, 0x1f3c1, 0x1f3f3, 0x1f3f4, 0x1f6a9]);
14
19
 
15
- // Text-presentation-default emoji: BMP characters (U+0000–U+FFFF) that are
16
- // valid emoji but lack the Emoji_Presentation property render as text without
17
- // U+FE0F. Supplementary-plane characters (U+10000+) always render as emoji
18
- // regardless of the Emoji_Presentation property, so we skip those.
19
- //
20
- // This set is derived from Unicode 14.0 emoji-data.txt: all BMP code points
21
- // that have the Emoji property but NOT the Emoji_Presentation property.
22
- // Using an explicit lookup table avoids the \p{} Unicode property escape
23
- // syntax (TS1501) which requires a specific TypeScript build target.
24
- var TEXT_DEFAULT_EMOJI = new Set([0x0023, 0x002a, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x00a9, 0x00ae, 0x203c, 0x2049, 0x2122, 0x2139, 0x2194, 0x2195, 0x2196, 0x2197, 0x2198, 0x2199, 0x21a9, 0x21aa, 0x2328, 0x23cf, 0x23ed, 0x23ee, 0x23ef, 0x23f1, 0x23f2, 0x23f8, 0x23f9, 0x23fa, 0x24c2, 0x25aa, 0x25ab, 0x25b6, 0x25c0, 0x25fb, 0x25fc, 0x2600, 0x2601, 0x2602, 0x2603, 0x2604, 0x260e, 0x2611, 0x2618, 0x261d, 0x2620, 0x2622, 0x2623, 0x2626, 0x262a, 0x262e, 0x262f, 0x2638, 0x2639, 0x263a, 0x2640, 0x2642, 0x265f, 0x2660, 0x2663, 0x2665, 0x2666, 0x2668, 0x267b, 0x267e, 0x2692, 0x2694, 0x2695, 0x2696, 0x2697, 0x2699, 0x269b, 0x269c, 0x26a0, 0x26a7, 0x26b0, 0x26b1, 0x26c8, 0x26cf, 0x26d1, 0x26d3, 0x26e9, 0x26f0, 0x26f1, 0x26f4, 0x26f7, 0x26f8, 0x26f9, 0x2702, 0x2708, 0x2709, 0x270c, 0x270d, 0x270f, 0x2712, 0x2714, 0x2716, 0x271d, 0x2721, 0x2733, 0x2734, 0x2744, 0x2747, 0x2763, 0x2764, 0x27a1, 0x2934, 0x2935, 0x2b05, 0x2b06, 0x2b07, 0x3030, 0x303d, 0x3297, 0x3299]);
25
-
26
- /**
27
- * Converts an emoji ID (a hyphen-separated string of hex Unicode code points,
28
- * e.g. `"1f44d"`, `"1f44d-1f3fb"`, `"1f468-200d-1f469-200d-1f467"`) into its
29
- * corresponding Unicode string.
30
- *
31
- * Special handling:
32
- * - Keycap sequences: U+20E3 (COMBINING ENCLOSING KEYCAP) must be preceded by
33
- * U+FE0F (VARIATION SELECTOR-16) to form a well-defined keycap emoji.
34
- * - Text-default emoji (characters whose default presentation is text) must be
35
- * followed by U+FE0F to force emoji presentation.
36
- *
37
- * @returns The Unicode string for the emoji, or `undefined` if the input is
38
- * invalid (empty string, non-hex segments, or out-of-range code points).
39
- */
40
- function emojiIdToEmoji(id) {
41
- if (!id) {
42
- return undefined;
43
- }
20
+ // Emoji variation bases from Unicode 14.0 emoji-variation-sequences.txt.
21
+ // These are the code points with a defined U+FE0F emoji-style variant.
22
+ var EMOJI_VARIATION_BASES = new Set([0x0023, 0x002a, 0x0030, 0x0031, 0x0032, 0x0033, 0x0034, 0x0035, 0x0036, 0x0037, 0x0038, 0x0039, 0x00a9, 0x00ae, 0x203c, 0x2049, 0x2122, 0x2139, 0x2194, 0x2195, 0x2196, 0x2197, 0x2198, 0x2199, 0x21a9, 0x21aa, 0x2328, 0x23cf, 0x23ed, 0x23ee, 0x23ef, 0x23f1, 0x23f2, 0x23f8, 0x23f9, 0x23fa, 0x24c2, 0x25aa, 0x25ab, 0x25b6, 0x25c0, 0x25fb, 0x25fc, 0x2600, 0x2601, 0x2602, 0x2603, 0x2604, 0x260e, 0x2611, 0x2618, 0x261d, 0x2620, 0x2622, 0x2623, 0x2626, 0x262a, 0x262e, 0x262f, 0x2638, 0x2639, 0x263a, 0x2640, 0x2642, 0x265f, 0x2660, 0x2663, 0x2665, 0x2666, 0x2668, 0x267b, 0x267e, 0x2692, 0x2694, 0x2695, 0x2696, 0x2697, 0x2699, 0x269b, 0x269c, 0x26a0, 0x26a7, 0x26b0, 0x26b1, 0x26c8, 0x26cf, 0x26d1, 0x26d3, 0x26e9, 0x26f0, 0x26f1, 0x26f4, 0x26f7, 0x26f8, 0x26f9, 0x2702, 0x2708, 0x2709, 0x270c, 0x270d, 0x270f, 0x2712, 0x2714, 0x2716, 0x271d, 0x2721, 0x2733, 0x2734, 0x2744, 0x2747, 0x2763, 0x2764, 0x27a1, 0x2934, 0x2935, 0x2b05, 0x2b06, 0x2b07, 0x3030, 0x303d, 0x3297, 0x3299, 0x1f170, 0x1f171, 0x1f17e, 0x1f17f, 0x1f202, 0x1f237, 0x1f321, 0x1f324, 0x1f325, 0x1f326, 0x1f327, 0x1f328, 0x1f329, 0x1f32a, 0x1f32b, 0x1f32c, 0x1f336, 0x1f37d, 0x1f396, 0x1f397, 0x1f399, 0x1f39a, 0x1f39b, 0x1f39e, 0x1f39f, 0x1f3cb, 0x1f3cc, 0x1f3cd, 0x1f3ce, 0x1f3d4, 0x1f3d5, 0x1f3d6, 0x1f3d7, 0x1f3d8, 0x1f3d9, 0x1f3da, 0x1f3db, 0x1f3dc, 0x1f3dd, 0x1f3de, 0x1f3df, 0x1f3f3, 0x1f3f5, 0x1f3f7, 0x1f43f, 0x1f441, 0x1f4fd, 0x1f549, 0x1f54a, 0x1f56f, 0x1f570, 0x1f573, 0x1f574, 0x1f575, 0x1f576, 0x1f577, 0x1f578, 0x1f579, 0x1f587, 0x1f58a, 0x1f58b, 0x1f58c, 0x1f58d, 0x1f590, 0x1f5a5, 0x1f5a8, 0x1f5b1, 0x1f5b2, 0x1f5bc, 0x1f5c2, 0x1f5c3, 0x1f5c4, 0x1f5d1, 0x1f5d2, 0x1f5d3, 0x1f5dc, 0x1f5dd, 0x1f5de, 0x1f5e1, 0x1f5e3, 0x1f5e8, 0x1f5ef, 0x1f5f3, 0x1f5fa, 0x1f6cb, 0x1f6cd, 0x1f6ce, 0x1f6cf, 0x1f6e0, 0x1f6e1, 0x1f6e2, 0x1f6e3, 0x1f6e4, 0x1f6e5, 0x1f6e9, 0x1f6f0, 0x1f6f3, 0x231a, 0x231b, 0x23e9, 0x23ea, 0x23f3, 0x25fd, 0x25fe, 0x2614, 0x2615, 0x2648, 0x2649, 0x264a, 0x264b, 0x264c, 0x264d, 0x264e, 0x264f, 0x2650, 0x2651, 0x2652, 0x2653, 0x267f, 0x2693, 0x26a1, 0x26aa, 0x26ab, 0x26bd, 0x26be, 0x26c4, 0x26c5, 0x26d4, 0x26ea, 0x26f2, 0x26f3, 0x26f5, 0x26fa, 0x26fd, 0x2753, 0x2757, 0x2b1b, 0x2b1c, 0x2b50, 0x2b55, 0x1f004, 0x1f21a, 0x1f22f, 0x1f30d, 0x1f30e, 0x1f30f, 0x1f315, 0x1f31c, 0x1f378, 0x1f393, 0x1f3a7, 0x1f3ac, 0x1f3ad, 0x1f3ae, 0x1f3c2, 0x1f3c4, 0x1f3c6, 0x1f3ca, 0x1f3e0, 0x1f3ed, 0x1f408, 0x1f415, 0x1f41f, 0x1f426, 0x1f442, 0x1f446, 0x1f447, 0x1f448, 0x1f449, 0x1f44d, 0x1f44e, 0x1f453, 0x1f46a, 0x1f47d, 0x1f4a3, 0x1f4b0, 0x1f4b3, 0x1f4bb, 0x1f4bf, 0x1f4cb, 0x1f4da, 0x1f4df, 0x1f4e4, 0x1f4e5, 0x1f4e6, 0x1f4ea, 0x1f4eb, 0x1f4ec, 0x1f4ed, 0x1f4f7, 0x1f4f9, 0x1f4fa, 0x1f4fb, 0x1f508, 0x1f50d, 0x1f512, 0x1f513, 0x1f550, 0x1f551, 0x1f552, 0x1f553, 0x1f554, 0x1f555, 0x1f556, 0x1f557, 0x1f558, 0x1f559, 0x1f55a, 0x1f55b, 0x1f55c, 0x1f55d, 0x1f55e, 0x1f55f, 0x1f560, 0x1f561, 0x1f562, 0x1f563, 0x1f564, 0x1f565, 0x1f566, 0x1f567, 0x1f610, 0x1f687, 0x1f68d, 0x1f691, 0x1f694, 0x1f698, 0x1f6ad, 0x1f6b2, 0x1f6b9, 0x1f6ba, 0x1f6bc]);
23
+ var isEmojiModifier = function isEmojiModifier(codePoint) {
24
+ return typeof codePoint === 'number' && codePoint >= EMOJI_MODIFIER_START && codePoint <= EMOJI_MODIFIER_END;
25
+ };
26
+ var shouldAddEmojiPresentationSelector = function shouldAddEmojiPresentationSelector(codePoint, nextCodePoint) {
27
+ return EMOJI_VARIATION_BASES.has(codePoint) && nextCodePoint !== VARIATION_SELECTOR_16 && nextCodePoint !== VARIATION_SELECTOR_15 && nextCodePoint !== KEYCAP_COMBINING && !isEmojiModifier(nextCodePoint);
28
+ };
29
+ var isRegionalIndicator = function isRegionalIndicator(codePoint) {
30
+ return codePoint >= REGIONAL_INDICATOR_START && codePoint <= REGIONAL_INDICATOR_END;
31
+ };
32
+ var parseEmojiIdCodePoints = function parseEmojiIdCodePoints(id) {
44
33
  var segments = id.split('-');
45
34
  var codePoints = [];
46
35
  var _iterator = _createForOfIteratorHelper(segments),
@@ -51,19 +40,53 @@ function emojiIdToEmoji(id) {
51
40
  if (!/^[0-9a-fA-F]+$/.test(segment)) {
52
41
  return undefined;
53
42
  }
54
- var _cp = parseInt(segment, 16);
55
- // Valid Unicode scalar values: 0x00000x10FFFF, excluding surrogates 0xD800–0xDFFF
56
- if (isNaN(_cp) || _cp < 0 || _cp > 0x10ffff || _cp >= 0xd800 && _cp <= 0xdfff) {
43
+ var cp = parseInt(segment, 16);
44
+ // Valid Unicode scalar values: U+0000U+10FFFF, excluding surrogates.
45
+ if (isNaN(cp) || cp < 0 || cp > 0x10ffff || cp >= 0xd800 && cp <= 0xdfff) {
57
46
  return undefined;
58
47
  }
59
- codePoints.push(_cp);
48
+ codePoints.push(cp);
60
49
  }
61
50
  } catch (err) {
62
51
  _iterator.e(err);
63
52
  } finally {
64
53
  _iterator.f();
65
54
  }
66
- if (codePoints.length === 0) {
55
+ return codePoints.length ? codePoints : undefined;
56
+ };
57
+ var isFlagEmoji = function isFlagEmoji(codePoints) {
58
+ if (codePoints.length === 2 && codePoints.every(isRegionalIndicator)) {
59
+ return true;
60
+ }
61
+ return FLAG_BASES.has(codePoints[0]);
62
+ };
63
+
64
+ /**
65
+ * Converts an emoji ID (a hyphen-separated string of hex Unicode code points,
66
+ * e.g. `"1f44d"`, `"1f44d-1f3fb"`, `"1f468-200d-1f469-200d-1f467"`) into its
67
+ * corresponding Unicode string.
68
+ *
69
+ * Special handling:
70
+ * - Keycap sequences: U+20E3 (COMBINING ENCLOSING KEYCAP) must be preceded by
71
+ * U+FE0F (VARIATION SELECTOR-16) to form a well-defined keycap emoji.
72
+ * - Emoji variation bases are followed by U+FE0F to force emoji presentation.
73
+ * - Flags return `undefined` so callers use Twemoji instead of native emoji.
74
+ *
75
+ * @returns The Unicode string for the emoji, or `undefined` if the input is
76
+ * invalid (empty string, non-hex segments, or out-of-range code points).
77
+ */
78
+ function emojiIdToEmoji(id) {
79
+ if (!(0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true)) {
80
+ return undefined;
81
+ }
82
+ if (!id) {
83
+ return undefined;
84
+ }
85
+ var codePoints = parseEmojiIdCodePoints(id);
86
+ if (!codePoints) {
87
+ return undefined;
88
+ }
89
+ if (isFlagEmoji(codePoints)) {
67
90
  return undefined;
68
91
  }
69
92
  var processedCodePoints = [];
@@ -77,22 +100,11 @@ function emojiIdToEmoji(id) {
77
100
  if (next === KEYCAP_COMBINING && cp !== VARIATION_SELECTOR_16) {
78
101
  processedCodePoints.push(VARIATION_SELECTOR_16);
79
102
  }
80
- }
81
103
 
82
- // Text-presentation-default emoji: characters that are valid emoji but whose
83
- // default rendering is text (e.g. etc.) must be followed by
84
- // U+FE0F (VARIATION SELECTOR-16) to force emoji presentation.
85
- if ((0, _expValEqualsNoExposure.expValEqualsNoExposure)('platform_use_unicode_emojis', 'isEnabled', true)) {
86
- var lastCodePoint = processedCodePoints[processedCodePoints.length - 1];
87
- var alreadyHasVariationSelector = lastCodePoint === VARIATION_SELECTOR_16 || lastCodePoint === VARIATION_SELECTOR_15 ||
88
- // Keycap sequences end with U+20E3 — they already have U+FE0F inserted inline
89
- // and must not have another variation selector appended at the end.
90
- lastCodePoint === KEYCAP_COMBINING;
91
- if (!alreadyHasVariationSelector) {
92
- var baseCodePoint = codePoints[0];
93
- if (codePoints.length === 1 && baseCodePoint <= 0xffff && TEXT_DEFAULT_EMOJI.has(baseCodePoint)) {
94
- processedCodePoints.push(VARIATION_SELECTOR_16);
95
- }
104
+ // Emoji variation bases need U+FE0F immediately after the base code point,
105
+ // including when the base appears inside a ZWJ sequence.
106
+ if (shouldAddEmojiPresentationSelector(cp, next)) {
107
+ processedCodePoints.push(VARIATION_SELECTOR_16);
96
108
  }
97
109
  }
98
110
  try {
@@ -5,9 +5,9 @@ import { ax, ix } from "@compiled/react/runtime";
5
5
  import Button from '@atlaskit/button/standard-button';
6
6
  import CrossCircleIcon from '@atlaskit/icon/core/cross-circle';
7
7
  import { deleteEmojiLabel } from '../../util/constants';
8
- import FeatureGates from '@atlaskit/feature-gate-js-client';
9
8
  import { emojiDeleteButton } from './styles';
10
9
  import { Box } from '@atlaskit/primitives/compiled';
10
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
11
11
  const styles = {
12
12
  boxWrapperStyle: "_1bsbf6fq _4t3if6fq"
13
13
  };
@@ -19,7 +19,7 @@ const refreshedDeleteButton = null;
19
19
  */
20
20
  export const RENDER_EMOJI_DELETE_BUTTON_TESTID = 'render-emoji-delete-button';
21
21
  const DeleteButton = props => {
22
- const isRefreshEnabled = FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false);
22
+ const isRefreshEnabled = expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false);
23
23
  return /*#__PURE__*/React.createElement("span", {
24
24
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
25
25
  className: ax(["_3um015vq _1e0c1txw _kqswstnw _154ix0bf _1xi2x0bf _1pbykb7n _13t3idpf", isRefreshEnabled && "_154ir5cr _1xi2r5cr", emojiDeleteButton]),
@@ -469,27 +469,35 @@ export const EmojiNodeWrapper = /*#__PURE__*/forwardRef((props, ref) => {
469
469
  const ariaLabel = intl && fg('platform_change_emoji_button_label') ? intl.formatMessage(messages.changeEmojiShortnameButtonLabel, {
470
470
  shortName: (_emoji$name = emoji.name) !== null && _emoji$name !== void 0 ? _emoji$name : emoji.shortName
471
471
  }) : editorEmoji ? undefined : emoji.shortName;
472
- return /*#__PURE__*/React.createElement("span", _extends({
472
+ const tooltipContent = showTooltip && expValEquals('platform_editor_emoji_hover_show_tooltip', 'isEnabled', true) ? emoji.shortName || emoji.name || undefined : undefined;
473
+ const emojiSpan = /*#__PURE__*/React.createElement("span", _extends({
473
474
  role: editorEmoji ? undefined : shouldBeInteractive ? 'button' : ariaLabel ? 'img' : 'presentation',
474
475
  "aria-label": ariaLabel,
475
476
  ref: ref,
476
477
  "data-testid": `${type}-emoji-${emoji.shortName}`,
477
478
  "data-emoji-type": type,
478
- tabIndex: shouldBeInteractive ? tabIndex || 0 : undefined,
479
+ tabIndex: shouldBeInteractive ? tabIndex || 0 : tooltipContent ? 0 : undefined,
479
480
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
480
481
  className: ax([type === 'sprite' ? "_19pk1n1a _2hwxidpf _otyr1n1a _18u0idpf _1e0c1o8l _jr50g2xd _ylp71o8l _pkaxgktf _1hdcgktf _109tnkob _tn8j1dpa _3naf1dpa _nt751r31 _49pcglyw _1hvw1o36 _7ehi1y54 _491113zc" : type === 'unicode' ? "_19pk1n1a _2hwxidpf _otyr1n1a _18u0idpf _bfhk1j28 _1e0c1o8l _s7n4nkob _tn8j1dpa _3naf1dpa _160jewfl _1theewfl _1kogh2mm _qyp0ewfl _nt751r31 _49pcglyw _1hvw1o36 _7ehi1y54 _491113zc" : "_2rkofajl _19pk1n1a _2hwxidpf _otyr1n1a _18u0idpf _bfhk1j28 _1e0c1o8l _s7n4nkob _v4pn1ule _tn8j1dpa _3naf1dpa _160jewfl _1theewfl _1kogh2mm _qyp0ewfl _nt751r31 _49pcglyw _1hvw1o36 _7ehi1y54 _491113zc", className]),
481
- onKeyDown: event => handleKeyDown(props, event),
482
- onMouseDown: event => {
482
+ onKeyDown: shouldBeInteractive || !expValEquals('platform_editor_emoji_hover_show_tooltip', 'isEnabled', true) ? event => handleKeyDown(props, event) : undefined,
483
+ onMouseDown: shouldBeInteractive || !expValEquals('platform_editor_emoji_hover_show_tooltip', 'isEnabled', true) ? event => {
483
484
  handleMouseDown(props, event);
484
- },
485
+ } : undefined,
485
486
  onMouseEnter: event => {
486
487
  handleMouseMove(props, event);
487
488
  },
488
489
  onFocus: event => {
489
490
  handleFocus(props, event);
490
491
  },
491
- title: showTooltip ? emoji.shortName : undefined // TODO: COLLAB-2351 - use @atlaskit/Tooltip in future for non-deletable emoji if enabled showTooltip
492
+ title: showTooltip && !expValEquals('platform_editor_emoji_hover_show_tooltip', 'isEnabled', true) ? emoji.shortName : undefined
492
493
  }, other), children);
494
+ if (tooltipContent) {
495
+ return /*#__PURE__*/React.createElement(Tooltip, {
496
+ content: tooltipContent,
497
+ tag: "span"
498
+ }, emojiSpan);
499
+ }
500
+ return emojiSpan;
493
501
  });
494
502
  export const Emoji = props => {
495
503
  const {
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { Fragment, useState, useRef, memo, useLayoutEffect, useCallback, useEffect } from 'react';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
8
9
  import { FormattedMessage, injectIntl } from 'react-intl';
9
10
  import EmojiDeletePreview from './EmojiDeletePreview';
10
11
  import EmojiUploadPicker from './EmojiUploadPicker';
@@ -19,7 +20,6 @@ import AddIcon from '@atlaskit/icon/core/add';
19
20
  import { setSkinToneAriaLabelText } from './setSkinToneAriaLabelText';
20
21
  import { emojiPickerAddEmoji } from './styles';
21
22
  import { DEFAULT_TONE } from '../../util/constants';
22
- import FeatureGates from '@atlaskit/feature-gate-js-client';
23
23
  import { Box } from '@atlaskit/primitives/compiled';
24
24
  import { layers } from '@atlaskit/theme/constants';
25
25
  const styles = {
@@ -131,9 +131,7 @@ const TonesWrapper = props => {
131
131
  openProductivityColorSelectorWithKeyboard.current = true;
132
132
  }
133
133
  }, []);
134
- const shouldShowProductivityColorSelector = !!(activeCategoryId === 'ATLASSIAN' && productivityColorPreviewEmojis && selectedProductivityColor && onProductivityColorSelected &&
135
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
136
- FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false));
134
+ const shouldShowProductivityColorSelector = !!(activeCategoryId === 'ATLASSIAN' && productivityColorPreviewEmojis && selectedProductivityColor && onProductivityColorSelected && expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false));
137
135
  if (shouldShowProductivityColorSelector) {
138
136
  const previewEmoji = (productivityColorPreviewEmojis === null || productivityColorPreviewEmojis === void 0 ? void 0 : productivityColorPreviewEmojis[selectedProductivityColor]) || Object.values(productivityColorPreviewEmojis || {})[0];
139
137
  if (!previewEmoji) {
@@ -212,9 +210,7 @@ export const EmojiActions = props => {
212
210
  } = props;
213
211
  const [showToneSelector, setShowToneSelector] = useState(false);
214
212
  const wasProductivityColorSelectorOpen = useRef(false);
215
- const shouldUseProductivityColorControl = !!(props.activeCategoryId === 'ATLASSIAN' && props.productivityColorPreviewEmojis && props.selectedProductivityColor && props.onProductivityColorSelected &&
216
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
217
- FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false));
213
+ const shouldUseProductivityColorControl = !!(props.activeCategoryId === 'ATLASSIAN' && props.productivityColorPreviewEmojis && props.selectedProductivityColor && props.onProductivityColorSelected && expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false));
218
214
  const onToneOpenHandler = useCallback(() => setShowToneSelector(true), []);
219
215
  const onToneCloseHandler = useCallback(() => setShowToneSelector(false), []);
220
216
  const onToneToggleHandler = useCallback(() => {
@@ -246,8 +242,7 @@ export const EmojiActions = props => {
246
242
  }
247
243
  }, [shouldUseProductivityColorControl, showToneSelector]);
248
244
  if (uploading) {
249
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
250
- return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
245
+ return expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
251
246
  className: ax(["_16jlidpf _1o9zidpf _i0dl1wug"])
252
247
  }, /*#__PURE__*/React.createElement(EmojiUploadPicker, {
253
248
  onUploadCancelled: onUploadCancelled,
@@ -266,8 +261,7 @@ export const EmojiActions = props => {
266
261
  }));
267
262
  }
268
263
  if (emojiToDelete) {
269
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
270
- return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
264
+ return expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
271
265
  className: ax(["_16jlidpf _1o9zidpf _i0dl1wug"])
272
266
  }, /*#__PURE__*/React.createElement(EmojiDeletePreview, {
273
267
  emoji: emojiToDelete,
@@ -281,9 +275,7 @@ export const EmojiActions = props => {
281
275
  onCloseDelete: onCloseDelete
282
276
  }));
283
277
  }
284
-
285
- // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
286
- return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
278
+ return expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
287
279
  "data-testid": emojiActionsTestId,
288
280
  onMouseLeave: onMouseLeaveHandler,
289
281
  onBlur: fg('platform_suppression_removal_fix_reactions') ? onMouseLeaveHandler : undefined,
@@ -5,12 +5,12 @@ import "./EmojiDeletePreview.compiled.css";
5
5
  import * as React from 'react';
6
6
  import { ax, ix } from "@compiled/react/runtime";
7
7
  import { Component } from 'react';
8
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
8
9
  import { FormattedMessage, injectIntl } from 'react-intl';
9
10
  import AkButton from '@atlaskit/button/new';
10
11
  import Heading from '@atlaskit/heading';
11
12
  import { Box, Text } from '@atlaskit/primitives/compiled';
12
13
  import FocusLock from 'react-focus-lock';
13
- import FeatureGates from '@atlaskit/feature-gate-js-client';
14
14
  import { messages } from '../i18n';
15
15
  import CachingEmoji from './CachingEmoji';
16
16
  import EmojiErrorMessage, { emojiErrorScreenreaderTestId } from './EmojiErrorMessage';
@@ -78,7 +78,7 @@ class EmojiDeletePreview extends Component {
78
78
  const {
79
79
  formatMessage
80
80
  } = intl;
81
- if (FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
81
+ if (expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
82
82
  return /*#__PURE__*/React.createElement(FocusLock, {
83
83
  noFocusGuards: true
84
84
  }, /*#__PURE__*/React.createElement("div", {
@@ -5,8 +5,8 @@ import { ax, ix } from "@compiled/react/runtime";
5
5
  import Tooltip from '@atlaskit/tooltip';
6
6
  import ErrorIcon from '@atlaskit/icon/core/status-error';
7
7
  import { ErrorMessage } from '@atlaskit/form';
8
- import FeatureGates from '@atlaskit/feature-gate-js-client';
9
8
  import { useIntl } from 'react-intl';
9
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
10
10
  import { messages } from '../i18n';
11
11
  const errorMessageStyles = {
12
12
  chooseFile: "_1e0c1txw _syaz1tmw _u5f319bv _1bah1y6m",
@@ -38,7 +38,7 @@ const EmojiErrorMessage = props => {
38
38
  label: formatMessage(messages.error),
39
39
  spacing: "spacious",
40
40
  testId: emojiErrorIconTestId
41
- }))) : FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
41
+ }))) : expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
42
42
  "data-testid": emojiErrorMessageTestId
43
43
  }, /*#__PURE__*/React.createElement(ErrorMessage, null, message)) : /*#__PURE__*/React.createElement("div", {
44
44
  "data-testid": emojiErrorMessageTestId,
@@ -2,7 +2,6 @@
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 FeatureGates from '@atlaskit/feature-gate-js-client';
6
5
  import Emoji from './Emoji';
7
6
  import { TONESELECTOR_KEYBOARD_KEYS_SUPPORTED } from '../../util/constants';
8
7
  import VisuallyHidden from '@atlaskit/visually-hidden';
@@ -12,7 +11,7 @@ const emojiRadio = {
12
11
  default: "_tzy4idpf _kqswstnw _154i14id _1ltv14id _3y8mfajl _157z1r31 _1dzmglyw _1sqm1o36 _fh6w1y54 _1i1213zc"
13
12
  };
14
13
  const handleKeyDown = (props, event) => {
15
- if ((event.key === 'ArrowLeft' || event.key === 'ArrowRight') && FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
14
+ if ((event.key === 'ArrowLeft' || event.key === 'ArrowRight') && expValEqualsNoExposure('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', true)) {
16
15
  var _props$onArrowKey;
17
16
  event.preventDefault();
18
17
  event.stopPropagation();
@@ -51,7 +50,7 @@ export const EmojiRadioButton = /*#__PURE__*/forwardRef((props, ref) => {
51
50
  return (_props$onSelected = props.onSelected) === null || _props$onSelected === void 0 ? void 0 : _props$onSelected.call(props);
52
51
  },
53
52
  onKeyDown: event => handleKeyDown(props, event),
54
- onChange: FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? e => e.preventDefault() : undefined,
53
+ onChange: expValEqualsNoExposure('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', true) ? e => e.preventDefault() : undefined,
55
54
  className: ax([emojiRadio.default])
56
55
  }), /*#__PURE__*/React.createElement(Emoji, {
57
56
  emoji: emoji,
@@ -9,7 +9,6 @@ import CrossIcon from '@atlaskit/icon/core/cross';
9
9
  import AkButton from '@atlaskit/button/standard-button';
10
10
  import { Text } from '@atlaskit/primitives/compiled';
11
11
  import FocusLock from 'react-focus-lock';
12
- import FeatureGates from '@atlaskit/feature-gate-js-client';
13
12
  import * as ImageUtil from '../../util/image';
14
13
  import debug from '../../util/logger';
15
14
  import { messages } from '../i18n';
@@ -18,6 +17,7 @@ import EmojiUploadPreview from './EmojiUploadPreview';
18
17
  import FileChooser from './FileChooser';
19
18
  import { UploadStatus } from './internal-types';
20
19
  import { fg } from '@atlaskit/platform-feature-flags';
20
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
21
21
  import Button from '@atlaskit/button/new';
22
22
  import { Box } from '@atlaskit/primitives/compiled';
23
23
  import { getDocument } from '@atlaskit/browser-apis';
@@ -56,7 +56,7 @@ const toDefaultUploadName = fileName => {
56
56
  return sanitizeName(nameWithoutExtension).slice(0, maxNameLength);
57
57
  };
58
58
  const isSupportedEmojiUploadFileType = file => {
59
- if (!FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
59
+ if (!expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
60
60
  return true;
61
61
  }
62
62
  if (supportedEmojiUploadMimeTypes.has(file.type)) {
@@ -103,7 +103,7 @@ const ChooseEmojiFile = /*#__PURE__*/memo(props => {
103
103
  const emojiChooseFileTitleNew = formatMessage(messages.emojiChooseFileDndTitle);
104
104
  const isUploading = uploadStatus === UploadStatus.Uploading;
105
105
  const addEmojiDisabled = !previewImage || !name || isUploading;
106
- return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
106
+ return expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
107
107
  "data-testid": uploadEmojiComponentTestId,
108
108
  className: ax(["_ca0qu2gc _u5f3pxbi _n3tdu2gc _19bvpxbi _1e0c1txw _2lx21bp4 _1bah1b1v"])
109
109
  }, /*#__PURE__*/React.createElement("div", {
@@ -114,7 +114,7 @@ const ChooseEmojiFile = /*#__PURE__*/memo(props => {
114
114
  }, previewImage ? /*#__PURE__*/React.createElement(FormattedMessage, messages.emojiPreviewTitle) : /*#__PURE__*/React.createElement(FormattedMessage, messages.addCustomEmojiLabel))), /*#__PURE__*/React.createElement("div", {
115
115
  className: ax(["_zulp12x7 _1e0c1txw _2lx21bp4 _1tker0r7"])
116
116
  }, /*#__PURE__*/React.createElement(Box, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.emojiChooseFileScreenReaderDescription, () => /*#__PURE__*/React.createElement(FileChooser, {
117
- label: FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? emojiChooseFileTitleNew : emojiChooseFileTitle,
117
+ label: expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? emojiChooseFileTitleNew : emojiChooseFileTitle,
118
118
  onChange: onChooseFile,
119
119
  onClick: onClick,
120
120
  accept: "image/png,image/jpeg,image/gif",
@@ -197,7 +197,7 @@ const ChooseEmojiFile = /*#__PURE__*/memo(props => {
197
197
  id: "new-emoji-name-input",
198
198
  "aria-required": true
199
199
  })), /*#__PURE__*/React.createElement(Text, null, /*#__PURE__*/React.createElement(FormattedMessage, messages.emojiChooseFileScreenReaderDescription, () => /*#__PURE__*/React.createElement(FileChooser, {
200
- label: FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? emojiChooseFileTitleNew : emojiChooseFileTitle,
200
+ label: expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? emojiChooseFileTitleNew : emojiChooseFileTitle,
201
201
  onChange: onChooseFile,
202
202
  onClick: onClick,
203
203
  accept: "image/png,image/jpeg,image/gif",
@@ -301,7 +301,7 @@ const EmojiUploadPicker = props => {
301
301
  const onFileLoad = useCallback(file => async f => {
302
302
  try {
303
303
  setFilename(file.name);
304
- if (!name && FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
304
+ if (!name && expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
305
305
  setName(toDefaultUploadName(file.name));
306
306
  }
307
307
  await ImageUtil.parseImage(f.target.result);
@@ -354,8 +354,8 @@ const EmojiUploadPicker = props => {
354
354
  const onChooseFileClicked = () => {
355
355
  onFileChooserClicked && onFileChooserClicked();
356
356
  };
357
- const isDuplicateNameError = errorMessage !== null && errorMessage !== undefined && FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false);
358
- const content = name && previewImage && !FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement(EmojiUploadPreview, {
357
+ const isDuplicateNameError = errorMessage !== null && errorMessage !== undefined && expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false);
358
+ const content = name && previewImage && !expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement(EmojiUploadPreview, {
359
359
  errorMessage: errorMessage,
360
360
  name: name,
361
361
  onAddEmoji: onAddEmoji,
@@ -375,7 +375,7 @@ const EmojiUploadPicker = props => {
375
375
  nameErrorMessage: isDuplicateNameError ? errorMessage : undefined,
376
376
  intl: intl
377
377
  });
378
- return disableFocusLock || FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? content : /*#__PURE__*/React.createElement(FocusLock, {
378
+ return disableFocusLock || expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? content : /*#__PURE__*/React.createElement(FocusLock, {
379
379
  noFocusGuards: true
380
380
  }, content);
381
381
  };
@@ -4,9 +4,9 @@ import { ax, ix } from "@compiled/react/runtime";
4
4
  import React, { useCallback, useEffect, useRef, useState } from 'react';
5
5
  import Button from '@atlaskit/button/new';
6
6
  import UploadIcon from '@atlaskit/icon/core/upload';
7
- import FeatureGates from '@atlaskit/feature-gate-js-client';
8
7
  import { dropTargetForExternal } from '@atlaskit/pragmatic-drag-and-drop/external/adapter';
9
8
  import { containsFiles, getFiles } from '@atlaskit/pragmatic-drag-and-drop/external/file';
9
+ import { expVal } from '@atlaskit/tmp-editor-statsig/expVal';
10
10
  export const chooseFileButtonTestId = 'choose-file-button';
11
11
  export const fileUploadInputTestId = 'file-upload';
12
12
  export const dropzoneTestId = 'file-dropzone';
@@ -60,7 +60,7 @@ const FileChooser = props => {
60
60
  }, [onChange]);
61
61
  useEffect(() => {
62
62
  const element = dropzoneRef.current;
63
- if (!element || !FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
63
+ if (!element || !expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
64
64
  return;
65
65
  }
66
66
  const suppressNativeFileDrop = event => {
@@ -161,7 +161,7 @@ const FileChooser = props => {
161
161
  },
162
162
  "data-testid": fileUploadInputTestId
163
163
  });
164
- if (FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
164
+ if (expVal('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false)) {
165
165
  return /*#__PURE__*/React.createElement("div", {
166
166
  ref: dropzoneRef,
167
167
  "data-testid": dropzoneTestId,
@@ -3,7 +3,6 @@ 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 FeatureGates from '@atlaskit/feature-gate-js-client';
7
6
  import Emoji from './Emoji';
8
7
  import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
9
8
  export const tonePreviewTestId = 'tone-preview';
@@ -23,7 +22,7 @@ export const TonePreviewButton = /*#__PURE__*/forwardRef((props, ref) => {
23
22
  isVisible = true
24
23
  } = props;
25
24
  const fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
26
- return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("button", {
25
+ return expValEqualsNoExposure('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', true) ? /*#__PURE__*/React.createElement("button", {
27
26
  ref: ref,
28
27
  onClick: onSelected,
29
28
  onKeyDown: onKeyDown,