@atlaskit/emoji 71.3.3 → 71.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-products/tsconfig.json +3 -0
  4. package/dist/cjs/api/EmojiUtils.js +2 -2
  5. package/dist/cjs/components/common/Emoji.js +7 -0
  6. package/dist/cjs/components/common/EmojiActions.js +14 -4
  7. package/dist/cjs/components/common/EmojiPreviewComponent.js +2 -2
  8. package/dist/cjs/components/common/EmojiRadioButton.js +2 -2
  9. package/dist/cjs/components/common/ResourcedEmojiComponent.js +4 -3
  10. package/dist/cjs/components/common/TonePreviewButton.js +2 -2
  11. package/dist/cjs/components/picker/EmojiPickerComponent.js +1 -1
  12. package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +10 -3
  13. package/dist/cjs/components/picker/EmojiPickerList.js +15 -4
  14. package/dist/cjs/util/analytics/analytics.js +1 -1
  15. package/dist/cjs/util/emojiIdToEmoji.js +2 -2
  16. package/dist/es2019/api/EmojiUtils.js +2 -2
  17. package/dist/es2019/components/common/Emoji.js +8 -1
  18. package/dist/es2019/components/common/EmojiActions.js +14 -4
  19. package/dist/es2019/components/common/EmojiPreviewComponent.js +2 -2
  20. package/dist/es2019/components/common/EmojiRadioButton.js +2 -2
  21. package/dist/es2019/components/common/ResourcedEmojiComponent.js +4 -3
  22. package/dist/es2019/components/common/TonePreviewButton.js +2 -2
  23. package/dist/es2019/components/picker/EmojiPickerComponent.js +1 -1
  24. package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +10 -3
  25. package/dist/es2019/components/picker/EmojiPickerList.js +15 -5
  26. package/dist/es2019/util/analytics/analytics.js +1 -1
  27. package/dist/es2019/util/emojiIdToEmoji.js +2 -2
  28. package/dist/esm/api/EmojiUtils.js +2 -2
  29. package/dist/esm/components/common/Emoji.js +8 -1
  30. package/dist/esm/components/common/EmojiActions.js +14 -4
  31. package/dist/esm/components/common/EmojiPreviewComponent.js +2 -2
  32. package/dist/esm/components/common/EmojiRadioButton.js +2 -2
  33. package/dist/esm/components/common/ResourcedEmojiComponent.js +4 -3
  34. package/dist/esm/components/common/TonePreviewButton.js +2 -2
  35. package/dist/esm/components/picker/EmojiPickerComponent.js +1 -1
  36. package/dist/esm/components/picker/EmojiPickerEmojiRow.js +10 -3
  37. package/dist/esm/components/picker/EmojiPickerList.js +15 -4
  38. package/dist/esm/util/analytics/analytics.js +1 -1
  39. package/dist/esm/util/emojiIdToEmoji.js +2 -2
  40. package/dist/types/components/common/Emoji.d.ts +5 -0
  41. package/dist/types/components/common/EmojiActions.d.ts +3 -3
  42. package/dist/types/components/picker/EmojiPickerList.d.ts +1 -1
  43. package/package.json +4 -7
@@ -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 && fg('platform_twemoji_removal_unicode_emojis') ? _emojiProvider.findByEmojiId(emojiId) : _emojiProvider.fetchByEmojiId(emojiId, optimisticFetch);
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 && fg('platform_twemoji_removal_unicode_emojis')) {
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 (fg('platform_twemoji_removal_unicode_emojis')) {
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 = fg('platform_twemoji_removal_unicode_emojis') ? 24 : undefined;
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,
@@ -423,7 +423,7 @@ const EmojiPickerComponent = ({
423
423
  // Wait a tick to ensure repaint and updated height for picker list
424
424
  window.setTimeout(() => {
425
425
  var _emojiPickerList$curr2;
426
- (_emojiPickerList$curr2 = emojiPickerList.current) === null || _emojiPickerList$curr2 === void 0 ? void 0 : _emojiPickerList$curr2.scrollToRecentlyUploaded(emojiDescription);
426
+ (_emojiPickerList$curr2 = emojiPickerList.current) === null || _emojiPickerList$curr2 === void 0 ? void 0 : _emojiPickerList$curr2.scrollToRecentlyUploaded(emojiDescription, false);
427
427
  }, 0);
428
428
  }
429
429
  }, [emojiPickerList]);
@@ -5,13 +5,16 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { memo } from 'react';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
8
9
  import { useIntl } from 'react-intl';
9
10
  import CachingEmoji from '../common/CachingEmoji';
10
11
  import { useEmojiPickerListContext } from '../../hooks/useEmojiPickerListContext';
12
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
11
13
  import { messages } from '../i18n';
12
14
  const emojiItem = null;
13
15
  const emojiPickerRow = null;
14
16
  const emojiPickerRowList = null;
17
+ const teamojiRefreshExperimentName = 'platform_teamoji_26_refresh_emoji_picker';
15
18
  const EmojiPickerEmojiRow = ({
16
19
  emojis,
17
20
  onSelected,
@@ -31,7 +34,8 @@ const EmojiPickerEmojiRow = ({
31
34
  const {
32
35
  formatMessage
33
36
  } = useIntl();
34
- const fitToHeight = fg('platform_twemoji_removal_unicode_emojis') ? 24 : undefined;
37
+ const fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
38
+ const preventFocusOnMouseDown = FeatureGates.getExperimentValue(teamojiRefreshExperimentName, 'isEnabled', false);
35
39
  const handleFocus = index => (emojiId, emoji, event) => {
36
40
  setEmojisFocus({
37
41
  rowIndex,
@@ -65,7 +69,9 @@ const EmojiPickerEmojiRow = ({
65
69
  "data-focus-index": `${rowIndex}-${index}`,
66
70
  tabIndex: focus ? 0 : -1,
67
71
  "aria-roledescription": formatMessage(messages.emojiButtonRoleDescription),
68
- shouldBeInteractive: true
72
+ shouldBeInteractive: true,
73
+ fitToHeight: fitToHeight,
74
+ preventFocusOnMouseDown: preventFocusOnMouseDown
69
75
  }));
70
76
  }));
71
77
  }
@@ -101,7 +107,8 @@ const EmojiPickerEmojiRow = ({
101
107
  tabIndex: focus ? 0 : -1,
102
108
  "aria-roledescription": formatMessage(messages.emojiButtonRoleDescription),
103
109
  shouldBeInteractive: true,
104
- fitToHeight: fitToHeight
110
+ fitToHeight: fitToHeight,
111
+ preventFocusOnMouseDown: preventFocusOnMouseDown
105
112
  }));
106
113
  }));
107
114
  };
@@ -354,7 +354,7 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
354
354
  scrollToRow(index) {
355
355
  scrollToRow(listRef, index);
356
356
  },
357
- scrollToRecentlyUploaded(uploadedEmoji) {
357
+ scrollToRecentlyUploaded(uploadedEmoji, shouldFocus = true) {
358
358
  // when search results is shown
359
359
  if (query) {
360
360
  const {
@@ -362,15 +362,25 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
362
362
  columnIndex
363
363
  } = findEmojiRowAndColumnById(uploadedEmoji.id);
364
364
  if (rowIndex !== -1) {
365
- var _listRef$current;
366
- (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollToEmojiAndFocus(rowIndex, columnIndex);
365
+ if (shouldFocus) {
366
+ var _listRef$current;
367
+ (_listRef$current = listRef.current) === null || _listRef$current === void 0 ? void 0 : _listRef$current.scrollToEmojiAndFocus(rowIndex, columnIndex);
368
+ } else {
369
+ var _listRef$current2;
370
+ (_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 ? void 0 : _listRef$current2.scrollToRow(rowIndex);
371
+ }
367
372
  }
368
373
  } else {
369
374
  // when seeing all emojis
370
375
  const row = lastYourUploadsRow;
371
376
  if (row > 0) {
372
- var _listRef$current2;
373
- (_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 ? void 0 : _listRef$current2.scrollToRowAndFocusLastEmoji(lastYourUploadsRow);
377
+ if (shouldFocus) {
378
+ var _listRef$current3;
379
+ (_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 ? void 0 : _listRef$current3.scrollToRowAndFocusLastEmoji(lastYourUploadsRow);
380
+ } else {
381
+ var _listRef$current4;
382
+ (_listRef$current4 = listRef.current) === null || _listRef$current4 === void 0 ? void 0 : _listRef$current4.scrollToRow(lastYourUploadsRow);
383
+ }
374
384
  }
375
385
  }
376
386
  }
@@ -9,7 +9,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
9
9
  actionSubjectId,
10
10
  attributes: {
11
11
  packageName: "@atlaskit/emoji",
12
- packageVersion: "71.3.2",
12
+ packageVersion: "71.4.0",
13
13
  ...attributes
14
14
  }
15
15
  });
@@ -1,4 +1,4 @@
1
- import { fg } from '@atlaskit/platform-feature-flags';
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 (fg('platform_twemoji_removal_unicode_emojis')) {
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 && fg('platform_twemoji_removal_unicode_emojis'));
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';
@@ -45,6 +45,9 @@ var handleMouseDown = function handleMouseDown(props, event) {
45
45
  var emoji = props.emoji,
46
46
  onSelected = props.onSelected;
47
47
  if (onSelected && leftClick(event)) {
48
+ if (props.preventFocusOnMouseDown) {
49
+ event.preventDefault();
50
+ }
48
51
  onSelected(toEmojiId(emoji), emoji, event);
49
52
  }
50
53
  };
@@ -257,6 +260,7 @@ var UnicodeEmojiImage = function UnicodeEmojiImage(props) {
257
260
  if (unicodeEmojiImage.status === 'ready') {
258
261
  return /*#__PURE__*/React.createElement(ImageEmoji, _extends({}, props, {
259
262
  emoji: _objectSpread(_objectSpread({}, emoji), {}, {
263
+ altRepresentation: undefined,
260
264
  representation: {
261
265
  imagePath: unicodeEmojiImage.imagePath,
262
266
  width: unicodeEmojiCanvasSize,
@@ -527,6 +531,9 @@ export var Emoji = function Emoji(props) {
527
531
  if (!hasUfoMarked(ufoExp, UfoEmojiTimings.MOUNTED_END)) {
528
532
  ufoExp.mark(UfoEmojiTimings.MOUNTED_END);
529
533
  }
534
+ if (emoji.type === ProviderTypes.STANDARD || isUnicodeRepresentation(emoji.representation)) {
535
+ expValEquals('platform_use_unicode_emojis', 'isEnabled', true);
536
+ }
530
537
  // eslint-disable-next-line react-hooks/exhaustive-deps
531
538
  }, []);
532
539
  if (isUnicodeRepresentation(emoji.representation)) {
@@ -22,6 +22,7 @@ import { emojiPickerAddEmoji } from './styles';
22
22
  import { DEFAULT_TONE } from '../../util/constants';
23
23
  import FeatureGates from '@atlaskit/feature-gate-js-client';
24
24
  import { Box } from '@atlaskit/primitives/compiled';
25
+ import { layers } from '@atlaskit/theme/constants';
25
26
  var styles = {
26
27
  icon: "_18u0r5cr _2hwx1i6y"
27
28
  };
@@ -61,9 +62,10 @@ export var AddOwnEmoji = function AddOwnEmoji(props) {
61
62
  })),
62
63
  appearance: "subtle"
63
64
  // TODO: (from codemod) Buttons with "component", "css" or "style" prop can't be automatically migrated with codemods. Please migrate it manually.
65
+ // eslint-disable-next-line @atlaskit/design-system/no-unsafe-style-overrides
64
66
  ,
65
67
 
66
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
68
+ // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop, @atlaskit/design-system/no-unsafe-style-overrides -- Ignored via go/DSP-18766
67
69
  className: ax(["_p12f3sup", emojiPickerAddEmoji]),
68
70
  tabIndex: 0,
69
71
  id: "add-custom-emoji"
@@ -129,7 +131,9 @@ var TonesWrapper = function TonesWrapper(props) {
129
131
  openProductivityColorSelectorWithKeyboard.current = true;
130
132
  }
131
133
  }, []);
132
- var shouldShowProductivityColorSelector = !!(activeCategoryId === 'ATLASSIAN' && productivityColorPreviewEmojis && selectedProductivityColor && onProductivityColorSelected && FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false));
134
+ var 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));
133
137
  if (shouldShowProductivityColorSelector) {
134
138
  var previewEmoji = (productivityColorPreviewEmojis === null || productivityColorPreviewEmojis === void 0 ? void 0 : productivityColorPreviewEmojis[selectedProductivityColor]) || Object.values(productivityColorPreviewEmojis || {})[0];
135
139
  if (!previewEmoji) {
@@ -142,7 +146,7 @@ var TonesWrapper = function TonesWrapper(props) {
142
146
  relativePosition: "below",
143
147
  horizontalAlign: "end-to-start",
144
148
  offsetY: 4,
145
- zIndex: 510
149
+ zIndex: layers.tooltip()
146
150
  }, /*#__PURE__*/React.createElement("div", {
147
151
  className: ax(["_19itia51 _2rkofajl _bfhk1bhr _16qs130s _ca0q12x7 _u5f312x7 _n3td12x7 _19bv12x7"])
148
152
  }, /*#__PURE__*/React.createElement(ProductivityColorSelector, {
@@ -210,7 +214,9 @@ export var EmojiActions = function EmojiActions(props) {
210
214
  showToneSelector = _useState6[0],
211
215
  setShowToneSelector = _useState6[1];
212
216
  var wasProductivityColorSelectorOpen = useRef(false);
213
- var shouldUseProductivityColorControl = !!(props.activeCategoryId === 'ATLASSIAN' && props.productivityColorPreviewEmojis && props.selectedProductivityColor && props.onProductivityColorSelected && FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false));
217
+ var shouldUseProductivityColorControl = !!(props.activeCategoryId === 'ATLASSIAN' && props.productivityColorPreviewEmojis && props.selectedProductivityColor && props.onProductivityColorSelected &&
218
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
219
+ FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false));
214
220
  var onToneOpenHandler = useCallback(function () {
215
221
  return setShowToneSelector(true);
216
222
  }, []);
@@ -248,6 +254,7 @@ export var EmojiActions = function EmojiActions(props) {
248
254
  }
249
255
  }, [shouldUseProductivityColorControl, showToneSelector]);
250
256
  if (uploading) {
257
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
251
258
  return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
252
259
  className: ax(["_16jlidpf _1o9zidpf _i0dl1wug"])
253
260
  }, /*#__PURE__*/React.createElement(EmojiUploadPicker, {
@@ -267,6 +274,7 @@ export var EmojiActions = function EmojiActions(props) {
267
274
  }));
268
275
  }
269
276
  if (emojiToDelete) {
277
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
270
278
  return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
271
279
  className: ax(["_16jlidpf _1o9zidpf _i0dl1wug"])
272
280
  }, /*#__PURE__*/React.createElement(EmojiDeletePreview, {
@@ -281,6 +289,8 @@ export var EmojiActions = function EmojiActions(props) {
281
289
  onCloseDelete: onCloseDelete
282
290
  }));
283
291
  }
292
+
293
+ // eslint-disable-next-line @atlaskit/platform/use-recommended-utils
284
294
  return FeatureGates.getExperimentValue('platform_teamoji_26_refresh_emoji_picker', 'isEnabled', false) ? /*#__PURE__*/React.createElement("div", {
285
295
  "data-testid": emojiActionsTestId,
286
296
  onMouseLeave: onMouseLeaveHandler,
@@ -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 = fg('platform_twemoji_removal_unicode_emojis') ? 32 : undefined;
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 = fg('platform_twemoji_removal_unicode_emojis') ? 24 : undefined;
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 && fg('platform_twemoji_removal_unicode_emojis') ? _emojiProvider.findByEmojiId(emojiId) : _emojiProvider.fetchByEmojiId(emojiId, optimisticFetch);
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 && fg('platform_twemoji_removal_unicode_emojis')) {
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 (fg('platform_twemoji_removal_unicode_emojis')) {
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 = fg('platform_twemoji_removal_unicode_emojis') ? 24 : undefined;
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,
@@ -485,7 +485,7 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
485
485
  // Wait a tick to ensure repaint and updated height for picker list
486
486
  window.setTimeout(function () {
487
487
  var _emojiPickerList$curr2;
488
- (_emojiPickerList$curr2 = emojiPickerList.current) === null || _emojiPickerList$curr2 === void 0 || _emojiPickerList$curr2.scrollToRecentlyUploaded(emojiDescription);
488
+ (_emojiPickerList$curr2 = emojiPickerList.current) === null || _emojiPickerList$curr2 === void 0 || _emojiPickerList$curr2.scrollToRecentlyUploaded(emojiDescription, false);
489
489
  }, 0);
490
490
  }
491
491
  }, [emojiPickerList]);
@@ -5,13 +5,16 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { memo } from 'react';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
+ import FeatureGates from '@atlaskit/feature-gate-js-client';
8
9
  import { useIntl } from 'react-intl';
9
10
  import CachingEmoji from '../common/CachingEmoji';
10
11
  import { useEmojiPickerListContext } from '../../hooks/useEmojiPickerListContext';
12
+ import { expValEqualsNoExposure } from '@atlaskit/tmp-editor-statsig/exp-val-equals-no-exposure';
11
13
  import { messages } from '../i18n';
12
14
  var emojiItem = null;
13
15
  var emojiPickerRow = null;
14
16
  var emojiPickerRowList = null;
17
+ var teamojiRefreshExperimentName = 'platform_teamoji_26_refresh_emoji_picker';
15
18
  var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
16
19
  var emojis = _ref.emojis,
17
20
  onSelected = _ref.onSelected,
@@ -28,7 +31,8 @@ var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
28
31
  var rowIndex = (virtualItemContext === null || virtualItemContext === void 0 ? void 0 : virtualItemContext.index) || 0;
29
32
  var _useIntl = useIntl(),
30
33
  formatMessage = _useIntl.formatMessage;
31
- var fitToHeight = fg('platform_twemoji_removal_unicode_emojis') ? 24 : undefined;
34
+ var fitToHeight = expValEqualsNoExposure('platform_use_unicode_emojis', 'isEnabled', true) ? 24 : undefined;
35
+ var preventFocusOnMouseDown = FeatureGates.getExperimentValue(teamojiRefreshExperimentName, 'isEnabled', false);
32
36
  var handleFocus = function handleFocus(index) {
33
37
  return function (emojiId, emoji, event) {
34
38
  setEmojisFocus({
@@ -62,7 +66,9 @@ var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
62
66
  "data-focus-index": "".concat(rowIndex, "-").concat(index),
63
67
  tabIndex: focus ? 0 : -1,
64
68
  "aria-roledescription": formatMessage(messages.emojiButtonRoleDescription),
65
- shouldBeInteractive: true
69
+ shouldBeInteractive: true,
70
+ fitToHeight: fitToHeight,
71
+ preventFocusOnMouseDown: preventFocusOnMouseDown
66
72
  }));
67
73
  }));
68
74
  }
@@ -96,7 +102,8 @@ var EmojiPickerEmojiRow = function EmojiPickerEmojiRow(_ref) {
96
102
  tabIndex: focus ? 0 : -1,
97
103
  "aria-roledescription": formatMessage(messages.emojiButtonRoleDescription),
98
104
  shouldBeInteractive: true,
99
- fitToHeight: fitToHeight
105
+ fitToHeight: fitToHeight,
106
+ preventFocusOnMouseDown: preventFocusOnMouseDown
100
107
  }));
101
108
  }));
102
109
  };
@@ -387,21 +387,32 @@ export var EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef(functi
387
387
  _scrollToRow(listRef, index);
388
388
  },
389
389
  scrollToRecentlyUploaded: function scrollToRecentlyUploaded(uploadedEmoji) {
390
+ var shouldFocus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
390
391
  // when search results is shown
391
392
  if (query) {
392
393
  var _findEmojiRowAndColum = findEmojiRowAndColumnById(uploadedEmoji.id),
393
394
  rowIndex = _findEmojiRowAndColum.rowIndex,
394
395
  columnIndex = _findEmojiRowAndColum.columnIndex;
395
396
  if (rowIndex !== -1) {
396
- var _listRef$current;
397
- (_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.scrollToEmojiAndFocus(rowIndex, columnIndex);
397
+ if (shouldFocus) {
398
+ var _listRef$current;
399
+ (_listRef$current = listRef.current) === null || _listRef$current === void 0 || _listRef$current.scrollToEmojiAndFocus(rowIndex, columnIndex);
400
+ } else {
401
+ var _listRef$current2;
402
+ (_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || _listRef$current2.scrollToRow(rowIndex);
403
+ }
398
404
  }
399
405
  } else {
400
406
  // when seeing all emojis
401
407
  var row = lastYourUploadsRow;
402
408
  if (row > 0) {
403
- var _listRef$current2;
404
- (_listRef$current2 = listRef.current) === null || _listRef$current2 === void 0 || _listRef$current2.scrollToRowAndFocusLastEmoji(lastYourUploadsRow);
409
+ if (shouldFocus) {
410
+ var _listRef$current3;
411
+ (_listRef$current3 = listRef.current) === null || _listRef$current3 === void 0 || _listRef$current3.scrollToRowAndFocusLastEmoji(lastYourUploadsRow);
412
+ } else {
413
+ var _listRef$current4;
414
+ (_listRef$current4 = listRef.current) === null || _listRef$current4 === void 0 || _listRef$current4.scrollToRow(lastYourUploadsRow);
415
+ }
405
416
  }
406
417
  }
407
418
  }
@@ -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.3.2"
17
+ packageVersion: "71.4.0"
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 { fg } from '@atlaskit/platform-feature-flags';
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 (fg('platform_twemoji_removal_unicode_emojis')) {
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
@@ -59,6 +59,11 @@ export interface Props extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'onMo
59
59
  * Called when an emoji is selected
60
60
  */
61
61
  onSelected?: OnEmojiEvent;
62
+ /**
63
+ * Prevent mouse selection from moving browser focus to the emoji.
64
+ * Keyboard selection still keeps focus on the emoji for grid navigation.
65
+ */
66
+ preventFocusOnMouseDown?: boolean;
62
67
  /**
63
68
  * Renders unicode emoji through an image representation when a fixed height is supplied.
64
69
  * Defaults to `true`.
@@ -10,22 +10,22 @@ import { type OnDeleteEmoji } from './EmojiDeletePreview';
10
10
  import { type OnUploadEmoji } from './EmojiUploadPicker';
11
11
  import type { ProductivityColor } from '../../util/productivity-colors';
12
12
  export interface Props {
13
+ activeCategoryId?: CategoryId | null;
13
14
  emojiToDelete?: EmojiDescription;
14
15
  initialUploadName?: string;
15
16
  onChange: (value: string) => void;
16
17
  onCloseDelete: () => void;
17
- onProductivityColorSelected?: (color: ProductivityColor) => void;
18
18
  onDeleteEmoji: OnDeleteEmoji;
19
19
  onFileChooserClicked?: () => void;
20
20
  onOpenUpload: () => void;
21
+ onProductivityColorSelected?: (color: ProductivityColor) => void;
21
22
  onToneSelected?: OnToneSelected;
22
23
  onToneSelectorCancelled?: OnToneSelectorCancelled;
23
24
  onUploadCancelled: () => void;
24
25
  onUploadEmoji: OnUploadEmoji;
26
+ productivityColorPreviewEmojis?: Partial<Record<ProductivityColor, EmojiDescription>>;
25
27
  query?: string;
26
28
  resultsCount?: number;
27
- activeCategoryId?: CategoryId | null;
28
- productivityColorPreviewEmojis?: Partial<Record<ProductivityColor, EmojiDescription>>;
29
29
  selectedProductivityColor?: ProductivityColor;
30
30
  selectedTone?: ToneSelection;
31
31
  toneEmoji?: EmojiDescriptionWithVariations;
@@ -47,7 +47,7 @@ export interface State {
47
47
  export type PickerListRef = {
48
48
  reveal: (category: CategoryId, preferYourUploads?: boolean) => void;
49
49
  scrollToBottom: () => void;
50
- scrollToRecentlyUploaded: (uploadedEmoji: EmojiDescription) => void;
50
+ scrollToRecentlyUploaded: (uploadedEmoji: EmojiDescription, shouldFocus?: boolean) => void;
51
51
  scrollToRow: (index?: number) => void;
52
52
  scrollToTop: () => void;
53
53
  };