@atlaskit/emoji 70.3.4 → 70.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.
- package/CHANGELOG.md +15 -0
- package/afm-cc/tsconfig.json +0 -1
- package/afm-products/tsconfig.json +0 -1
- package/dist/cjs/components/common/EmojiActions.js +8 -2
- package/dist/cjs/components/common/EmojiUploadPicker.js +2 -1
- package/dist/cjs/components/common/messages.js +14 -0
- package/dist/cjs/components/picker/CategorySelector.compiled.css +16 -0
- package/dist/cjs/components/picker/CategorySelector.js +42 -4
- package/dist/cjs/components/picker/EmojiPickerComponent.js +16 -0
- package/dist/cjs/components/picker/EmojiPickerList.js +2 -1
- package/dist/cjs/components/picker/categories.js +83 -1
- package/dist/cjs/util/analytics/analytics.js +1 -1
- package/dist/es2019/components/common/EmojiActions.js +10 -3
- package/dist/es2019/components/common/EmojiUploadPicker.js +2 -1
- package/dist/es2019/components/common/messages.js +8 -0
- package/dist/es2019/components/picker/CategorySelector.compiled.css +16 -0
- package/dist/es2019/components/picker/CategorySelector.js +43 -5
- package/dist/es2019/components/picker/EmojiPickerComponent.js +16 -0
- package/dist/es2019/components/picker/EmojiPickerList.js +3 -2
- package/dist/es2019/components/picker/categories.js +82 -0
- package/dist/es2019/util/analytics/analytics.js +1 -1
- package/dist/esm/components/common/EmojiActions.js +9 -3
- package/dist/esm/components/common/EmojiUploadPicker.js +2 -1
- package/dist/esm/components/common/messages.js +8 -0
- package/dist/esm/components/picker/CategorySelector.compiled.css +16 -0
- package/dist/esm/components/picker/CategorySelector.js +43 -5
- package/dist/esm/components/picker/EmojiPickerComponent.js +16 -0
- package/dist/esm/components/picker/EmojiPickerList.js +3 -2
- package/dist/esm/components/picker/categories.js +82 -0
- package/dist/esm/util/analytics/analytics.js +1 -1
- package/dist/types/components/common/messages.d.ts +7 -0
- package/dist/types/components/picker/categories.d.ts +1 -0
- package/dist/types-ts4.5/components/common/messages.d.ts +7 -0
- package/dist/types-ts4.5/components/picker/categories.d.ts +1 -0
- package/package.json +7 -4
- package/afm-jira/tsconfig.json +0 -78
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,20 @@
|
|
|
1
1
|
# @atlaskit/emoji
|
|
2
2
|
|
|
3
|
+
## 70.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c4804f9e7bdaf`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c4804f9e7bdaf) -
|
|
8
|
+
Update add emoji icon to use add emoji icon
|
|
9
|
+
- Updated dependencies
|
|
10
|
+
|
|
11
|
+
## 70.4.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [`f715c95dbc725`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f715c95dbc725) -
|
|
16
|
+
Update the emoji category picker for new styling
|
|
17
|
+
|
|
3
18
|
## 70.3.4
|
|
4
19
|
|
|
5
20
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -23,6 +23,7 @@ var _EmojiPickerListSearch = require("../picker/EmojiPickerListSearch");
|
|
|
23
23
|
var _i18n = require("../i18n");
|
|
24
24
|
var _standardButton = _interopRequireDefault(require("@atlaskit/button/standard-button"));
|
|
25
25
|
var _add = _interopRequireDefault(require("@atlaskit/icon/core/add"));
|
|
26
|
+
var _emojiAdd = _interopRequireDefault(require("@atlaskit/icon/core/emoji-add"));
|
|
26
27
|
var _setSkinToneAriaLabelText = require("./setSkinToneAriaLabelText");
|
|
27
28
|
var _styles = require("./styles");
|
|
28
29
|
var _constants = require("../../util/constants");
|
|
@@ -44,15 +45,20 @@ var uploadEmojiTestId = exports.uploadEmojiTestId = 'upload-emoji';
|
|
|
44
45
|
var AddOwnEmoji = function AddOwnEmoji(props) {
|
|
45
46
|
var onOpenUpload = props.onOpenUpload,
|
|
46
47
|
uploadEnabled = props.uploadEnabled;
|
|
48
|
+
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
49
|
+
formatMessage = _useIntl.formatMessage;
|
|
47
50
|
return /*#__PURE__*/React.createElement(_react.Fragment, null, uploadEnabled && /*#__PURE__*/React.createElement("div", {
|
|
48
51
|
"data-testid": uploadEmojiTestId,
|
|
49
52
|
className: (0, _runtime.ax)(["_1wpz1h6o _18u019bv _otyr19bv"])
|
|
50
|
-
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _i18n.messages.addCustomEmojiLabel, function (label) {
|
|
53
|
+
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? _i18n.messages.addEmojiLabel : _i18n.messages.addCustomEmojiLabel, function (label) {
|
|
51
54
|
return /*#__PURE__*/React.createElement(_standardButton.default, {
|
|
52
55
|
onClick: onOpenUpload,
|
|
53
56
|
iconBefore: /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
54
57
|
xcss: styles.icon
|
|
55
|
-
}, /*#__PURE__*/React.createElement(
|
|
58
|
+
}, (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement(_emojiAdd.default, {
|
|
59
|
+
color: "currentColor",
|
|
60
|
+
label: formatMessage(_i18n.messages.addCustomEmojiLabel)
|
|
61
|
+
}) : /*#__PURE__*/React.createElement(_add.default, {
|
|
56
62
|
color: "currentColor",
|
|
57
63
|
label: ""
|
|
58
64
|
})),
|
|
@@ -27,6 +27,7 @@ var _EmojiErrorMessage = _interopRequireDefault(require("./EmojiErrorMessage"));
|
|
|
27
27
|
var _EmojiUploadPreview = _interopRequireDefault(require("./EmojiUploadPreview"));
|
|
28
28
|
var _FileChooser = _interopRequireDefault(require("./FileChooser"));
|
|
29
29
|
var _internalTypes = require("./internal-types");
|
|
30
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
30
31
|
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); }
|
|
31
32
|
var closeEmojiUploadButton = null;
|
|
32
33
|
var emojiUpload = null;
|
|
@@ -87,7 +88,7 @@ var ChooseEmojiFile = /*#__PURE__*/(0, _react.memo)(function (props) {
|
|
|
87
88
|
}, /*#__PURE__*/React.createElement("label", {
|
|
88
89
|
htmlFor: "new-emoji-name-input",
|
|
89
90
|
className: (0, _runtime.ax)(["_1w90azsu", "_11c8wadc _k48p1pd9"])
|
|
90
|
-
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, _i18n.messages.addCustomEmojiLabel)), /*#__PURE__*/React.createElement("div", {
|
|
91
|
+
}, /*#__PURE__*/React.createElement(_reactIntl.FormattedMessage, (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? _i18n.messages.addEmojiLabel : _i18n.messages.addCustomEmojiLabel)), /*#__PURE__*/React.createElement("div", {
|
|
91
92
|
className: (0, _runtime.ax)(["_1e0c1txw"])
|
|
92
93
|
}, /*#__PURE__*/React.createElement(_standardButton.default, {
|
|
93
94
|
onClick: onUploadCancelled,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.messages = void 0;
|
|
7
|
+
var _reactIntl = require("react-intl");
|
|
8
|
+
var messages = exports.messages = (0, _reactIntl.defineMessages)({
|
|
9
|
+
addCustomEmojiLabel: {
|
|
10
|
+
id: 'addCustomEmojiLabel',
|
|
11
|
+
defaultMessage: 'Add custom emoji',
|
|
12
|
+
description: 'Accessible label for add custom emoji button'
|
|
13
|
+
}
|
|
14
|
+
});
|
|
@@ -2,23 +2,39 @@
|
|
|
2
2
|
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
3
|
._v564h5h4{transition:color .2s ease}
|
|
4
4
|
._189eidpf{border-width:0}._16jlidpf{flex-grow:0}
|
|
5
|
+
._19bv12x7{padding-left:var(--ds-space-075,6px)}
|
|
5
6
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
6
7
|
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
7
8
|
._1bah1b1v{justify-content:space-around}
|
|
9
|
+
._1bah1h6o{justify-content:center}
|
|
10
|
+
._1doc1dm9{border-bottom-width:var(--ds-border-width-selected,2px)}
|
|
11
|
+
._1doce4h9{border-bottom-width:var(--ds-border-width,1px)}
|
|
8
12
|
._1e0c1txw{display:flex}
|
|
13
|
+
._1il9nqa1{border-bottom-style:solid}
|
|
14
|
+
._1o3i1j28{border-bottom-color:transparent}
|
|
15
|
+
._1o3i1l7x{border-bottom-color:var(--ds-border,#0b120e24)}
|
|
16
|
+
._1o3ia755{border-bottom-color:var(--ds-border-brand,#1868db)}
|
|
9
17
|
._1o9zidpf{flex-shrink:0}
|
|
10
18
|
._2lx2vrvc{flex-direction:row}
|
|
19
|
+
._4cvr1fhb{align-items:stretch}
|
|
11
20
|
._4cvr1h6o{align-items:center}
|
|
12
21
|
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
13
22
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
23
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
14
24
|
._ca0q12x7{padding-top:var(--ds-space-075,6px)}
|
|
25
|
+
._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
|
|
15
26
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
16
27
|
._dpd31txw button{display:flex}
|
|
17
28
|
._i0dl1wug{flex-basis:auto}
|
|
18
29
|
._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
|
|
30
|
+
._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
|
|
19
31
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
20
32
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
21
33
|
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
34
|
+
._u5f312x7{padding-right:var(--ds-space-075,6px)}
|
|
22
35
|
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
23
36
|
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
37
|
+
._1jc41ihb:hover{border-bottom-color:var(--ds-border-bold,#7d818a)}
|
|
38
|
+
._1jc4a755:hover{border-bottom-color:var(--ds-border-brand,#1868db)}
|
|
39
|
+
._30l31rpy:hover{color:var(--ds-text-subtlest,#6b6e76)}
|
|
24
40
|
._30l36x5g:hover{color:var(--ds-text-selected,#1868db)}
|
|
@@ -13,6 +13,7 @@ var React = _react;
|
|
|
13
13
|
var _runtime = require("@compiled/react/runtime");
|
|
14
14
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
15
15
|
var _css = require("@atlaskit/css");
|
|
16
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
16
17
|
var _reactIntl = require("react-intl");
|
|
17
18
|
var _compiled = require("@atlaskit/primitives/compiled");
|
|
18
19
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
@@ -24,12 +25,17 @@ var _EmojiPickerList = require("./EmojiPickerList");
|
|
|
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
|
var styles = {
|
|
26
27
|
commonCategory: "_2rko12b0 _v564h5h4 _189eidpf _bfhksm61 _ca0qze3t _n3tdze3t _19bvze3t _u5f3ze3t",
|
|
28
|
+
commonCategoryNew: "_v564h5h4 _189eidpf _bfhksm61 _ca0qpxbi _n3tdpxbi _19bv12x7 _u5f312x7 _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
27
29
|
defaultCategory: "_syaz1rpy _30l36x5g",
|
|
30
|
+
defaultCategoryNew: "_syaz1rpy _1doc1dm9 _1il9nqa1 _1o3i1j28 _30l31rpy _1jc41ihb",
|
|
28
31
|
activeCategory: "_syaz6x5g _30l36x5g",
|
|
32
|
+
activeCategoryNew: "_syaz6x5g _1doc1dm9 _1il9nqa1 _1o3ia755 _30l36x5g _1jc4a755",
|
|
29
33
|
disabledCategory: "_syaz1rpy"
|
|
30
34
|
};
|
|
31
35
|
var categorySelector = null;
|
|
36
|
+
var categorySelectorNew = null;
|
|
32
37
|
var categorySelectorTablist = null;
|
|
38
|
+
var categorySelectorTablistNew = null;
|
|
33
39
|
var sortCategories = exports.sortCategories = function sortCategories(c1, c2) {
|
|
34
40
|
return _categories.CategoryDescriptionMap[c1].order - _categories.CategoryDescriptionMap[c2].order;
|
|
35
41
|
};
|
|
@@ -38,7 +44,7 @@ var addNewCategories = function addNewCategories(oldCategories, newCategories) {
|
|
|
38
44
|
return oldCategories;
|
|
39
45
|
}
|
|
40
46
|
return oldCategories.concat(newCategories.filter(function (category) {
|
|
41
|
-
return !!_categories.CategoryDescriptionMap[category];
|
|
47
|
+
return !!((0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? _categories.CategoryDescriptionMapNew : _categories.CategoryDescriptionMap)[category];
|
|
42
48
|
})).sort(sortCategories);
|
|
43
49
|
};
|
|
44
50
|
var categorySelectorComponentTestId = exports.categorySelectorComponentTestId = 'category-selector-component';
|
|
@@ -117,16 +123,46 @@ var CategorySelector = function CategorySelector(props) {
|
|
|
117
123
|
};
|
|
118
124
|
var categoriesSection;
|
|
119
125
|
if (categories) {
|
|
120
|
-
categoriesSection = /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
categoriesSection = (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
121
127
|
role: "tablist",
|
|
122
128
|
"aria-label": formatMessage(_i18n.messages.categoriesSelectorLabel),
|
|
123
129
|
"data-testid": categorySelectorComponentTestId,
|
|
124
130
|
ref: categoryRef,
|
|
125
|
-
className: (0, _runtime.ax)(["
|
|
131
|
+
className: (0, _runtime.ax)(["_ca0qze3t _n3tdze3t _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1fhb"])
|
|
126
132
|
}, categories.map(function (categoryId, index) {
|
|
127
133
|
var category = _categories.CategoryDescriptionMap[categoryId];
|
|
128
134
|
var Icon = category.icon;
|
|
129
135
|
var categoryName = formatMessage(_i18n.messages[category.name]);
|
|
136
|
+
return /*#__PURE__*/React.createElement(_tooltip.default, {
|
|
137
|
+
content: categoryName,
|
|
138
|
+
position: "bottom",
|
|
139
|
+
key: category.id
|
|
140
|
+
}, /*#__PURE__*/React.createElement(_compiled.Pressable, {
|
|
141
|
+
id: "category-selector-".concat(category.id),
|
|
142
|
+
"data-focus-index": index,
|
|
143
|
+
"aria-label": categoryName,
|
|
144
|
+
"aria-controls": currentFocus === index ? _EmojiPickerList.RENDER_EMOJI_PICKER_LIST_TESTID : undefined,
|
|
145
|
+
"aria-selected": categoryId === activeCategoryId,
|
|
146
|
+
xcss: (0, _css.cx)(styles.commonCategoryNew, styles.defaultCategoryNew, categoryId === activeCategoryId && styles.activeCategoryNew, disableCategories && styles.disabledCategory),
|
|
147
|
+
isDisabled: disableCategories,
|
|
148
|
+
onClick: handleClick(categoryId, index),
|
|
149
|
+
testId: categorySelectorCategoryTestId(categoryId),
|
|
150
|
+
tabIndex: currentFocus === index ? 0 : -1,
|
|
151
|
+
onKeyDown: handleKeyDown,
|
|
152
|
+
role: "tab"
|
|
153
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
154
|
+
label: categoryName
|
|
155
|
+
})));
|
|
156
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
157
|
+
role: "tablist",
|
|
158
|
+
"aria-label": formatMessage(_i18n.messages.categoriesSelectorLabel),
|
|
159
|
+
"data-testid": categorySelectorComponentTestId,
|
|
160
|
+
ref: categoryRef,
|
|
161
|
+
className: (0, _runtime.ax)(["_ca0q12x7 _n3td12x7 _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1h6o"])
|
|
162
|
+
}, categories.map(function (categoryId, index) {
|
|
163
|
+
var category = (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? _categories.CategoryDescriptionMapNew[categoryId] : _categories.CategoryDescriptionMap[categoryId];
|
|
164
|
+
var Icon = category.icon;
|
|
165
|
+
var categoryName = formatMessage(_i18n.messages[category.name]);
|
|
130
166
|
return /*#__PURE__*/React.createElement(_tooltip.default, {
|
|
131
167
|
content: categoryName,
|
|
132
168
|
position: "bottom",
|
|
@@ -149,7 +185,9 @@ var CategorySelector = function CategorySelector(props) {
|
|
|
149
185
|
})));
|
|
150
186
|
}));
|
|
151
187
|
}
|
|
152
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
188
|
+
return (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
189
|
+
className: (0, _runtime.ax)(["_16jlidpf _1o9zidpf _i0dl1wug _bfhkvuon _ca0qze3t _n3tdze3t _1doce4h9 _1il9nqa1 _1o3i1l7x _dpd31txw"])
|
|
190
|
+
}, categoriesSection) : /*#__PURE__*/React.createElement("div", {
|
|
153
191
|
className: (0, _runtime.ax)(["_16jlidpf _1o9zidpf _i0dl1wug _bfhkhfxm _dpd31txw"])
|
|
154
192
|
}, categoriesSection);
|
|
155
193
|
};
|
|
@@ -128,6 +128,7 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
128
128
|
var openTime = (0, _react.useRef)(0);
|
|
129
129
|
var isMounting = (0, _react.useRef)(true);
|
|
130
130
|
var previousEmojiProvider = (0, _react.useRef)(emojiProvider);
|
|
131
|
+
var isProgrammaticScroll = (0, _react.useRef)(false);
|
|
131
132
|
var currentUser = (0, _react.useMemo)(function () {
|
|
132
133
|
return emojiProvider.getCurrentUser();
|
|
133
134
|
}, [emojiProvider]);
|
|
@@ -143,6 +144,12 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
143
144
|
}
|
|
144
145
|
}, [selectedEmoji]);
|
|
145
146
|
var onCategoryActivated = (0, _react.useCallback)(function (category) {
|
|
147
|
+
// Ignore scroll-driven category changes while a programmatic reveal()
|
|
148
|
+
// scroll is in progress — they would flicker the indicator through
|
|
149
|
+
// intermediate categories before landing on the correct one.
|
|
150
|
+
if (isProgrammaticScroll.current && (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh')) {
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
146
153
|
if (activeCategory !== category) {
|
|
147
154
|
setActiveCategory(category);
|
|
148
155
|
}
|
|
@@ -304,7 +311,16 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
304
311
|
});
|
|
305
312
|
}
|
|
306
313
|
if (emojiPickerList.current) {
|
|
314
|
+
if ((0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh')) {
|
|
315
|
+
isProgrammaticScroll.current = true;
|
|
316
|
+
}
|
|
307
317
|
emojiPickerList.current.reveal(categoryId);
|
|
318
|
+
if ((0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh')) {
|
|
319
|
+
// Clear the flag after the scroll animation has settled.
|
|
320
|
+
setTimeout(function () {
|
|
321
|
+
isProgrammaticScroll.current = false;
|
|
322
|
+
}, 300);
|
|
323
|
+
}
|
|
308
324
|
}
|
|
309
325
|
(0, _reactDom.unstable_batchedUpdates)(function () {
|
|
310
326
|
setActiveCategory(categoryId);
|
|
@@ -9,6 +9,7 @@ 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 _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
12
13
|
var _constants = require("../../util/constants");
|
|
13
14
|
var _categories = require("./categories");
|
|
14
15
|
var _CategoryTracker = _interopRequireDefault(require("./CategoryTracker"));
|
|
@@ -139,7 +140,7 @@ var EmojiPickerVirtualListInternal = exports.EmojiPickerVirtualListInternal = /*
|
|
|
139
140
|
}, [groupByCategory]);
|
|
140
141
|
var addToCategoryMap = function addToCategoryMap(categoryToGroupMap, emoji, category) {
|
|
141
142
|
if (!categoryToGroupMap[category]) {
|
|
142
|
-
var categoryDefinition = _categories.CategoryDescriptionMap[category];
|
|
143
|
+
var categoryDefinition = (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? _categories.CategoryDescriptionMapNew[category] : _categories.CategoryDescriptionMap[category];
|
|
143
144
|
categoryToGroupMap[category] = {
|
|
144
145
|
emojis: [],
|
|
145
146
|
title: categoryDefinition.name,
|
|
@@ -4,9 +4,10 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.CategoryDescriptionMap = void 0;
|
|
7
|
+
exports.CategoryDescriptionMapNew = exports.CategoryDescriptionMap = void 0;
|
|
8
8
|
var _basketball = _interopRequireDefault(require("@atlaskit/icon/core/basketball"));
|
|
9
9
|
var _add = _interopRequireDefault(require("@atlaskit/icon/core/add"));
|
|
10
|
+
var _emojiAdd = _interopRequireDefault(require("@atlaskit/icon/core/emoji-add"));
|
|
10
11
|
var _flag = _interopRequireDefault(require("@atlaskit/icon/core/flag"));
|
|
11
12
|
var _takeoutFood = _interopRequireDefault(require("@atlaskit/icon/core/takeout-food"));
|
|
12
13
|
var _clock = _interopRequireDefault(require("@atlaskit/icon/core/clock"));
|
|
@@ -97,4 +98,85 @@ var CategoryDescriptionMap = exports.CategoryDescriptionMap = {
|
|
|
97
98
|
icon: _add.default,
|
|
98
99
|
order: 12
|
|
99
100
|
}
|
|
101
|
+
};
|
|
102
|
+
var CategoryDescriptionMapNew = exports.CategoryDescriptionMapNew = {
|
|
103
|
+
SEARCH: {
|
|
104
|
+
id: 'SEARCH',
|
|
105
|
+
name: 'categoriesSearchResults',
|
|
106
|
+
// refers to i18n categoriesSearchResults key
|
|
107
|
+
icon: undefined,
|
|
108
|
+
order: 0
|
|
109
|
+
},
|
|
110
|
+
FREQUENT: {
|
|
111
|
+
id: 'FREQUENT',
|
|
112
|
+
name: 'frequentCategory',
|
|
113
|
+
icon: _clock.default,
|
|
114
|
+
order: 1
|
|
115
|
+
},
|
|
116
|
+
PEOPLE: {
|
|
117
|
+
id: 'PEOPLE',
|
|
118
|
+
name: 'peopleCategory',
|
|
119
|
+
icon: _emoji.default,
|
|
120
|
+
order: 2
|
|
121
|
+
},
|
|
122
|
+
NATURE: {
|
|
123
|
+
id: 'NATURE',
|
|
124
|
+
name: 'natureCategory',
|
|
125
|
+
icon: _tree.default,
|
|
126
|
+
order: 3
|
|
127
|
+
},
|
|
128
|
+
FOODS: {
|
|
129
|
+
id: 'FOODS',
|
|
130
|
+
name: 'foodsCategory',
|
|
131
|
+
icon: _takeoutFood.default,
|
|
132
|
+
order: 4
|
|
133
|
+
},
|
|
134
|
+
ACTIVITY: {
|
|
135
|
+
id: 'ACTIVITY',
|
|
136
|
+
name: 'activityCategory',
|
|
137
|
+
icon: _basketball.default,
|
|
138
|
+
order: 5
|
|
139
|
+
},
|
|
140
|
+
PLACES: {
|
|
141
|
+
id: 'PLACES',
|
|
142
|
+
name: 'placesCategory',
|
|
143
|
+
icon: _vehicleCar.default,
|
|
144
|
+
order: 6
|
|
145
|
+
},
|
|
146
|
+
OBJECTS: {
|
|
147
|
+
id: 'OBJECTS',
|
|
148
|
+
name: 'objectsCategory',
|
|
149
|
+
icon: _lightbulb.default,
|
|
150
|
+
order: 7
|
|
151
|
+
},
|
|
152
|
+
SYMBOLS: {
|
|
153
|
+
id: 'SYMBOLS',
|
|
154
|
+
name: 'symbolsCategory',
|
|
155
|
+
icon: _heart.default,
|
|
156
|
+
order: 8
|
|
157
|
+
},
|
|
158
|
+
FLAGS: {
|
|
159
|
+
id: 'FLAGS',
|
|
160
|
+
name: 'flagsCategory',
|
|
161
|
+
icon: _flag.default,
|
|
162
|
+
order: 9
|
|
163
|
+
},
|
|
164
|
+
ATLASSIAN: {
|
|
165
|
+
id: 'ATLASSIAN',
|
|
166
|
+
name: 'productivityCategory',
|
|
167
|
+
icon: _checkCircle.default,
|
|
168
|
+
order: 10
|
|
169
|
+
},
|
|
170
|
+
USER_CUSTOM: {
|
|
171
|
+
id: _constants.customCategory,
|
|
172
|
+
name: _constants.userCustomTitle,
|
|
173
|
+
icon: _add.default,
|
|
174
|
+
order: 11
|
|
175
|
+
},
|
|
176
|
+
CUSTOM: {
|
|
177
|
+
id: _constants.customCategory,
|
|
178
|
+
name: _constants.customTitle,
|
|
179
|
+
icon: _emojiAdd.default,
|
|
180
|
+
order: 12
|
|
181
|
+
}
|
|
100
182
|
};
|
|
@@ -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: "
|
|
23
|
+
packageVersion: "0.0.0-development"
|
|
24
24
|
}, attributes)
|
|
25
25
|
};
|
|
26
26
|
};
|
|
@@ -5,7 +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 } from 'react';
|
|
7
7
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
-
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
8
|
+
import { FormattedMessage, injectIntl, useIntl } from 'react-intl';
|
|
9
9
|
import EmojiDeletePreview from './EmojiDeletePreview';
|
|
10
10
|
import EmojiUploadPicker from './EmojiUploadPicker';
|
|
11
11
|
import TonePreviewButton from './TonePreviewButton';
|
|
@@ -14,6 +14,7 @@ import { EmojiPickerListSearch } from '../picker/EmojiPickerListSearch';
|
|
|
14
14
|
import { messages } from '../i18n';
|
|
15
15
|
import AkButton from '@atlaskit/button/standard-button';
|
|
16
16
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
17
|
+
import EmojiAddIcon from '@atlaskit/icon/core/emoji-add';
|
|
17
18
|
import { setSkinToneAriaLabelText } from './setSkinToneAriaLabelText';
|
|
18
19
|
import { emojiPickerAddEmoji } from './styles';
|
|
19
20
|
import { DEFAULT_TONE } from '../../util/constants';
|
|
@@ -36,14 +37,20 @@ const AddOwnEmoji = props => {
|
|
|
36
37
|
onOpenUpload,
|
|
37
38
|
uploadEnabled
|
|
38
39
|
} = props;
|
|
40
|
+
const {
|
|
41
|
+
formatMessage
|
|
42
|
+
} = useIntl();
|
|
39
43
|
return /*#__PURE__*/React.createElement(Fragment, null, uploadEnabled && /*#__PURE__*/React.createElement("div", {
|
|
40
44
|
"data-testid": uploadEmojiTestId,
|
|
41
45
|
className: ax(["_1wpz1h6o _18u019bv _otyr19bv"])
|
|
42
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.addCustomEmojiLabel, label => /*#__PURE__*/React.createElement(AkButton, {
|
|
46
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, fg('platform_emoji_picker_refresh') ? messages.addEmojiLabel : messages.addCustomEmojiLabel, label => /*#__PURE__*/React.createElement(AkButton, {
|
|
43
47
|
onClick: onOpenUpload,
|
|
44
48
|
iconBefore: /*#__PURE__*/React.createElement(Box, {
|
|
45
49
|
xcss: styles.icon
|
|
46
|
-
}, /*#__PURE__*/React.createElement(
|
|
50
|
+
}, fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement(EmojiAddIcon, {
|
|
51
|
+
color: "currentColor",
|
|
52
|
+
label: formatMessage(messages.addCustomEmojiLabel)
|
|
53
|
+
}) : /*#__PURE__*/React.createElement(AddIcon, {
|
|
47
54
|
color: "currentColor",
|
|
48
55
|
label: ""
|
|
49
56
|
})),
|
|
@@ -16,6 +16,7 @@ import EmojiErrorMessage from './EmojiErrorMessage';
|
|
|
16
16
|
import EmojiUploadPreview from './EmojiUploadPreview';
|
|
17
17
|
import FileChooser from './FileChooser';
|
|
18
18
|
import { UploadStatus } from './internal-types';
|
|
19
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
19
20
|
const closeEmojiUploadButton = null;
|
|
20
21
|
const emojiUpload = null;
|
|
21
22
|
const emojiUploadTop = null;
|
|
@@ -78,7 +79,7 @@ const ChooseEmojiFile = /*#__PURE__*/memo(props => {
|
|
|
78
79
|
}, /*#__PURE__*/React.createElement("label", {
|
|
79
80
|
htmlFor: "new-emoji-name-input",
|
|
80
81
|
className: ax(["_1w90azsu", "_11c8wadc _k48p1pd9"])
|
|
81
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.addCustomEmojiLabel)), /*#__PURE__*/React.createElement("div", {
|
|
82
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, fg('platform_emoji_picker_refresh') ? messages.addEmojiLabel : messages.addCustomEmojiLabel)), /*#__PURE__*/React.createElement("div", {
|
|
82
83
|
className: ax(["_1e0c1txw"])
|
|
83
84
|
}, /*#__PURE__*/React.createElement(AkButton, {
|
|
84
85
|
onClick: onUploadCancelled,
|
|
@@ -2,23 +2,39 @@
|
|
|
2
2
|
._2rko12b0{border-radius:var(--ds-radius-small,4px)}
|
|
3
3
|
._v564h5h4{transition:color .2s ease}
|
|
4
4
|
._189eidpf{border-width:0}._16jlidpf{flex-grow:0}
|
|
5
|
+
._19bv12x7{padding-left:var(--ds-space-075,6px)}
|
|
5
6
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
6
7
|
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
7
8
|
._1bah1b1v{justify-content:space-around}
|
|
9
|
+
._1bah1h6o{justify-content:center}
|
|
10
|
+
._1doc1dm9{border-bottom-width:var(--ds-border-width-selected,2px)}
|
|
11
|
+
._1doce4h9{border-bottom-width:var(--ds-border-width,1px)}
|
|
8
12
|
._1e0c1txw{display:flex}
|
|
13
|
+
._1il9nqa1{border-bottom-style:solid}
|
|
14
|
+
._1o3i1j28{border-bottom-color:transparent}
|
|
15
|
+
._1o3i1l7x{border-bottom-color:var(--ds-border,#0b120e24)}
|
|
16
|
+
._1o3ia755{border-bottom-color:var(--ds-border-brand,#1868db)}
|
|
9
17
|
._1o9zidpf{flex-shrink:0}
|
|
10
18
|
._2lx2vrvc{flex-direction:row}
|
|
19
|
+
._4cvr1fhb{align-items:stretch}
|
|
11
20
|
._4cvr1h6o{align-items:center}
|
|
12
21
|
._bfhkhfxm{background-color:var(--ds-surface-sunken,#f8f8f8)}
|
|
13
22
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
23
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
14
24
|
._ca0q12x7{padding-top:var(--ds-space-075,6px)}
|
|
25
|
+
._ca0qpxbi{padding-top:var(--ds-space-200,1pc)}
|
|
15
26
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
16
27
|
._dpd31txw button{display:flex}
|
|
17
28
|
._i0dl1wug{flex-basis:auto}
|
|
18
29
|
._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
|
|
30
|
+
._n3tdpxbi{padding-bottom:var(--ds-space-200,1pc)}
|
|
19
31
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
20
32
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
21
33
|
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
34
|
+
._u5f312x7{padding-right:var(--ds-space-075,6px)}
|
|
22
35
|
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
23
36
|
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
37
|
+
._1jc41ihb:hover{border-bottom-color:var(--ds-border-bold,#7d818a)}
|
|
38
|
+
._1jc4a755:hover{border-bottom-color:var(--ds-border-brand,#1868db)}
|
|
39
|
+
._30l31rpy:hover{color:var(--ds-text-subtlest,#6b6e76)}
|
|
24
40
|
._30l36x5g:hover{color:var(--ds-text-selected,#1868db)}
|
|
@@ -4,28 +4,34 @@ import * as React from 'react';
|
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
6
|
import { cx } from '@atlaskit/css';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import { useIntl } from 'react-intl';
|
|
8
9
|
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
9
10
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
11
|
import { CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED, defaultCategories, KeyboardKeys } from '../../util/constants';
|
|
11
12
|
import { messages } from '../i18n';
|
|
12
|
-
import { CategoryDescriptionMap } from './categories';
|
|
13
|
+
import { CategoryDescriptionMap, CategoryDescriptionMapNew } from './categories';
|
|
13
14
|
import { usePrevious } from '../../hooks/usePrevious';
|
|
14
15
|
import { RENDER_EMOJI_PICKER_LIST_TESTID } from './EmojiPickerList';
|
|
15
16
|
const styles = {
|
|
16
17
|
commonCategory: "_2rko12b0 _v564h5h4 _189eidpf _bfhksm61 _ca0qze3t _n3tdze3t _19bvze3t _u5f3ze3t",
|
|
18
|
+
commonCategoryNew: "_v564h5h4 _189eidpf _bfhksm61 _ca0qpxbi _n3tdpxbi _19bv12x7 _u5f312x7 _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
17
19
|
defaultCategory: "_syaz1rpy _30l36x5g",
|
|
20
|
+
defaultCategoryNew: "_syaz1rpy _1doc1dm9 _1il9nqa1 _1o3i1j28 _30l31rpy _1jc41ihb",
|
|
18
21
|
activeCategory: "_syaz6x5g _30l36x5g",
|
|
22
|
+
activeCategoryNew: "_syaz6x5g _1doc1dm9 _1il9nqa1 _1o3ia755 _30l36x5g _1jc4a755",
|
|
19
23
|
disabledCategory: "_syaz1rpy"
|
|
20
24
|
};
|
|
21
25
|
const categorySelector = null;
|
|
26
|
+
const categorySelectorNew = null;
|
|
22
27
|
const categorySelectorTablist = null;
|
|
28
|
+
const categorySelectorTablistNew = null;
|
|
23
29
|
export const sortCategories = (c1, c2) => CategoryDescriptionMap[c1].order - CategoryDescriptionMap[c2].order;
|
|
24
30
|
const addNewCategories = (oldCategories, newCategories) => {
|
|
25
31
|
if (!newCategories) {
|
|
26
32
|
return oldCategories;
|
|
27
33
|
}
|
|
28
|
-
return oldCategories.concat(newCategories.filter(category => !!CategoryDescriptionMap[category])).sort(sortCategories);
|
|
34
|
+
return oldCategories.concat(newCategories.filter(category => !!(fg('platform_emoji_picker_refresh') ? CategoryDescriptionMapNew : CategoryDescriptionMap)[category])).sort(sortCategories);
|
|
29
35
|
};
|
|
30
36
|
export const categorySelectorComponentTestId = 'category-selector-component';
|
|
31
37
|
export const categorySelectorCategoryTestId = categoryId => `category-selector-${categoryId}`;
|
|
@@ -96,16 +102,46 @@ const CategorySelector = props => {
|
|
|
96
102
|
};
|
|
97
103
|
let categoriesSection;
|
|
98
104
|
if (categories) {
|
|
99
|
-
categoriesSection = /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
categoriesSection = fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
100
106
|
role: "tablist",
|
|
101
107
|
"aria-label": formatMessage(messages.categoriesSelectorLabel),
|
|
102
108
|
"data-testid": categorySelectorComponentTestId,
|
|
103
109
|
ref: categoryRef,
|
|
104
|
-
className: ax(["
|
|
110
|
+
className: ax(["_ca0qze3t _n3tdze3t _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1fhb"])
|
|
105
111
|
}, categories.map((categoryId, index) => {
|
|
106
112
|
const category = CategoryDescriptionMap[categoryId];
|
|
107
113
|
const Icon = category.icon;
|
|
108
114
|
const categoryName = formatMessage(messages[category.name]);
|
|
115
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
116
|
+
content: categoryName,
|
|
117
|
+
position: "bottom",
|
|
118
|
+
key: category.id
|
|
119
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
120
|
+
id: `category-selector-${category.id}`,
|
|
121
|
+
"data-focus-index": index,
|
|
122
|
+
"aria-label": categoryName,
|
|
123
|
+
"aria-controls": currentFocus === index ? RENDER_EMOJI_PICKER_LIST_TESTID : undefined,
|
|
124
|
+
"aria-selected": categoryId === activeCategoryId,
|
|
125
|
+
xcss: cx(styles.commonCategoryNew, styles.defaultCategoryNew, categoryId === activeCategoryId && styles.activeCategoryNew, disableCategories && styles.disabledCategory),
|
|
126
|
+
isDisabled: disableCategories,
|
|
127
|
+
onClick: handleClick(categoryId, index),
|
|
128
|
+
testId: categorySelectorCategoryTestId(categoryId),
|
|
129
|
+
tabIndex: currentFocus === index ? 0 : -1,
|
|
130
|
+
onKeyDown: handleKeyDown,
|
|
131
|
+
role: "tab"
|
|
132
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
133
|
+
label: categoryName
|
|
134
|
+
})));
|
|
135
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
136
|
+
role: "tablist",
|
|
137
|
+
"aria-label": formatMessage(messages.categoriesSelectorLabel),
|
|
138
|
+
"data-testid": categorySelectorComponentTestId,
|
|
139
|
+
ref: categoryRef,
|
|
140
|
+
className: ax(["_ca0q12x7 _n3td12x7 _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1h6o"])
|
|
141
|
+
}, categories.map((categoryId, index) => {
|
|
142
|
+
const category = fg('platform_emoji_picker_refresh') ? CategoryDescriptionMapNew[categoryId] : CategoryDescriptionMap[categoryId];
|
|
143
|
+
const Icon = category.icon;
|
|
144
|
+
const categoryName = formatMessage(messages[category.name]);
|
|
109
145
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
110
146
|
content: categoryName,
|
|
111
147
|
position: "bottom",
|
|
@@ -128,7 +164,9 @@ const CategorySelector = props => {
|
|
|
128
164
|
})));
|
|
129
165
|
}));
|
|
130
166
|
}
|
|
131
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
167
|
+
return fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
168
|
+
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _bfhkvuon _ca0qze3t _n3tdze3t _1doce4h9 _1il9nqa1 _1o3i1l7x _dpd31txw"])
|
|
169
|
+
}, categoriesSection) : /*#__PURE__*/React.createElement("div", {
|
|
132
170
|
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _bfhkhfxm _dpd31txw"])
|
|
133
171
|
}, categoriesSection);
|
|
134
172
|
};
|
|
@@ -72,6 +72,7 @@ const EmojiPickerComponent = ({
|
|
|
72
72
|
const openTime = useRef(0);
|
|
73
73
|
const isMounting = useRef(true);
|
|
74
74
|
const previousEmojiProvider = useRef(emojiProvider);
|
|
75
|
+
const isProgrammaticScroll = useRef(false);
|
|
75
76
|
const currentUser = useMemo(() => {
|
|
76
77
|
return emojiProvider.getCurrentUser();
|
|
77
78
|
}, [emojiProvider]);
|
|
@@ -87,6 +88,12 @@ const EmojiPickerComponent = ({
|
|
|
87
88
|
}
|
|
88
89
|
}, [selectedEmoji]);
|
|
89
90
|
const onCategoryActivated = useCallback(category => {
|
|
91
|
+
// Ignore scroll-driven category changes while a programmatic reveal()
|
|
92
|
+
// scroll is in progress — they would flicker the indicator through
|
|
93
|
+
// intermediate categories before landing on the correct one.
|
|
94
|
+
if (isProgrammaticScroll.current && fg('platform_emoji_picker_refresh')) {
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
90
97
|
if (activeCategory !== category) {
|
|
91
98
|
setActiveCategory(category);
|
|
92
99
|
}
|
|
@@ -250,7 +257,16 @@ const EmojiPickerComponent = ({
|
|
|
250
257
|
});
|
|
251
258
|
}
|
|
252
259
|
if (emojiPickerList.current) {
|
|
260
|
+
if (fg('platform_emoji_picker_refresh')) {
|
|
261
|
+
isProgrammaticScroll.current = true;
|
|
262
|
+
}
|
|
253
263
|
emojiPickerList.current.reveal(categoryId);
|
|
264
|
+
if (fg('platform_emoji_picker_refresh')) {
|
|
265
|
+
// Clear the flag after the scroll animation has settled.
|
|
266
|
+
setTimeout(() => {
|
|
267
|
+
isProgrammaticScroll.current = false;
|
|
268
|
+
}, 300);
|
|
269
|
+
}
|
|
254
270
|
}
|
|
255
271
|
batchedUpdates(() => {
|
|
256
272
|
setActiveCategory(categoryId);
|