@atlaskit/emoji 70.3.3 → 70.4.0
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 +13 -0
- package/afm-cc/tsconfig.json +0 -1
- package/afm-products/tsconfig.json +0 -1
- package/dist/cjs/components/picker/CategorySelector.compiled.css +16 -0
- package/dist/cjs/components/picker/CategorySelector.js +40 -2
- package/dist/cjs/components/picker/EmojiPickerComponent.js +16 -0
- package/dist/cjs/util/analytics/analytics.js +1 -1
- package/dist/es2019/components/picker/CategorySelector.compiled.css +16 -0
- package/dist/es2019/components/picker/CategorySelector.js +40 -2
- package/dist/es2019/components/picker/EmojiPickerComponent.js +16 -0
- package/dist/es2019/util/analytics/analytics.js +1 -1
- package/dist/esm/components/picker/CategorySelector.compiled.css +16 -0
- package/dist/esm/components/picker/CategorySelector.js +40 -2
- package/dist/esm/components/picker/EmojiPickerComponent.js +16 -0
- package/dist/esm/util/analytics/analytics.js +1 -1
- package/package.json +6 -3
- package/afm-jira/tsconfig.json +0 -78
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/emoji
|
|
2
2
|
|
|
3
|
+
## 70.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`f715c95dbc725`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/f715c95dbc725) -
|
|
8
|
+
Update the emoji category picker for new styling
|
|
9
|
+
|
|
10
|
+
## 70.3.4
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 70.3.3
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
|
@@ -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
|
};
|
|
@@ -117,7 +123,37 @@ 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", {
|
|
127
|
+
role: "tablist",
|
|
128
|
+
"aria-label": formatMessage(_i18n.messages.categoriesSelectorLabel),
|
|
129
|
+
"data-testid": categorySelectorComponentTestId,
|
|
130
|
+
ref: categoryRef,
|
|
131
|
+
className: (0, _runtime.ax)(["_ca0qze3t _n3tdze3t _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1fhb"])
|
|
132
|
+
}, categories.map(function (categoryId, index) {
|
|
133
|
+
var category = _categories.CategoryDescriptionMap[categoryId];
|
|
134
|
+
var Icon = category.icon;
|
|
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", {
|
|
121
157
|
role: "tablist",
|
|
122
158
|
"aria-label": formatMessage(_i18n.messages.categoriesSelectorLabel),
|
|
123
159
|
"data-testid": categorySelectorComponentTestId,
|
|
@@ -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);
|
|
@@ -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: "70.3.4"
|
|
24
24
|
}, attributes)
|
|
25
25
|
};
|
|
26
26
|
};
|
|
@@ -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,6 +4,7 @@ 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';
|
|
@@ -14,12 +15,17 @@ 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) {
|
|
@@ -96,7 +102,37 @@ 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", {
|
|
106
|
+
role: "tablist",
|
|
107
|
+
"aria-label": formatMessage(messages.categoriesSelectorLabel),
|
|
108
|
+
"data-testid": categorySelectorComponentTestId,
|
|
109
|
+
ref: categoryRef,
|
|
110
|
+
className: ax(["_ca0qze3t _n3tdze3t _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1fhb"])
|
|
111
|
+
}, categories.map((categoryId, index) => {
|
|
112
|
+
const category = CategoryDescriptionMap[categoryId];
|
|
113
|
+
const Icon = category.icon;
|
|
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", {
|
|
100
136
|
role: "tablist",
|
|
101
137
|
"aria-label": formatMessage(messages.categoriesSelectorLabel),
|
|
102
138
|
"data-testid": categorySelectorComponentTestId,
|
|
@@ -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);
|
|
@@ -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)}
|
|
@@ -5,6 +5,7 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
7
7
|
import { cx } from '@atlaskit/css';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { useIntl } from 'react-intl';
|
|
9
10
|
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
10
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -15,12 +16,17 @@ import { usePrevious } from '../../hooks/usePrevious';
|
|
|
15
16
|
import { RENDER_EMOJI_PICKER_LIST_TESTID } from './EmojiPickerList';
|
|
16
17
|
var styles = {
|
|
17
18
|
commonCategory: "_2rko12b0 _v564h5h4 _189eidpf _bfhksm61 _ca0qze3t _n3tdze3t _19bvze3t _u5f3ze3t",
|
|
19
|
+
commonCategoryNew: "_v564h5h4 _189eidpf _bfhksm61 _ca0qpxbi _n3tdpxbi _19bv12x7 _u5f312x7 _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
18
20
|
defaultCategory: "_syaz1rpy _30l36x5g",
|
|
21
|
+
defaultCategoryNew: "_syaz1rpy _1doc1dm9 _1il9nqa1 _1o3i1j28 _30l31rpy _1jc41ihb",
|
|
19
22
|
activeCategory: "_syaz6x5g _30l36x5g",
|
|
23
|
+
activeCategoryNew: "_syaz6x5g _1doc1dm9 _1il9nqa1 _1o3ia755 _30l36x5g _1jc4a755",
|
|
20
24
|
disabledCategory: "_syaz1rpy"
|
|
21
25
|
};
|
|
22
26
|
var categorySelector = null;
|
|
27
|
+
var categorySelectorNew = null;
|
|
23
28
|
var categorySelectorTablist = null;
|
|
29
|
+
var categorySelectorTablistNew = null;
|
|
24
30
|
export var sortCategories = function sortCategories(c1, c2) {
|
|
25
31
|
return CategoryDescriptionMap[c1].order - CategoryDescriptionMap[c2].order;
|
|
26
32
|
};
|
|
@@ -108,7 +114,37 @@ var CategorySelector = function CategorySelector(props) {
|
|
|
108
114
|
};
|
|
109
115
|
var categoriesSection;
|
|
110
116
|
if (categories) {
|
|
111
|
-
categoriesSection = /*#__PURE__*/React.createElement("div", {
|
|
117
|
+
categoriesSection = fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
118
|
+
role: "tablist",
|
|
119
|
+
"aria-label": formatMessage(messages.categoriesSelectorLabel),
|
|
120
|
+
"data-testid": categorySelectorComponentTestId,
|
|
121
|
+
ref: categoryRef,
|
|
122
|
+
className: ax(["_ca0qze3t _n3tdze3t _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1fhb"])
|
|
123
|
+
}, categories.map(function (categoryId, index) {
|
|
124
|
+
var category = CategoryDescriptionMap[categoryId];
|
|
125
|
+
var Icon = category.icon;
|
|
126
|
+
var categoryName = formatMessage(messages[category.name]);
|
|
127
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
128
|
+
content: categoryName,
|
|
129
|
+
position: "bottom",
|
|
130
|
+
key: category.id
|
|
131
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
132
|
+
id: "category-selector-".concat(category.id),
|
|
133
|
+
"data-focus-index": index,
|
|
134
|
+
"aria-label": categoryName,
|
|
135
|
+
"aria-controls": currentFocus === index ? RENDER_EMOJI_PICKER_LIST_TESTID : undefined,
|
|
136
|
+
"aria-selected": categoryId === activeCategoryId,
|
|
137
|
+
xcss: cx(styles.commonCategoryNew, styles.defaultCategoryNew, categoryId === activeCategoryId && styles.activeCategoryNew, disableCategories && styles.disabledCategory),
|
|
138
|
+
isDisabled: disableCategories,
|
|
139
|
+
onClick: handleClick(categoryId, index),
|
|
140
|
+
testId: categorySelectorCategoryTestId(categoryId),
|
|
141
|
+
tabIndex: currentFocus === index ? 0 : -1,
|
|
142
|
+
onKeyDown: handleKeyDown,
|
|
143
|
+
role: "tab"
|
|
144
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
145
|
+
label: categoryName
|
|
146
|
+
})));
|
|
147
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
112
148
|
role: "tablist",
|
|
113
149
|
"aria-label": formatMessage(messages.categoriesSelectorLabel),
|
|
114
150
|
"data-testid": categorySelectorComponentTestId,
|
|
@@ -140,7 +176,9 @@ var CategorySelector = function CategorySelector(props) {
|
|
|
140
176
|
})));
|
|
141
177
|
}));
|
|
142
178
|
}
|
|
143
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
179
|
+
return fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
180
|
+
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _bfhkvuon _ca0qze3t _n3tdze3t _1doce4h9 _1il9nqa1 _1o3i1l7x _dpd31txw"])
|
|
181
|
+
}, categoriesSection) : /*#__PURE__*/React.createElement("div", {
|
|
144
182
|
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _bfhkhfxm _dpd31txw"])
|
|
145
183
|
}, categoriesSection);
|
|
146
184
|
};
|
|
@@ -119,6 +119,7 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
119
119
|
var openTime = useRef(0);
|
|
120
120
|
var isMounting = useRef(true);
|
|
121
121
|
var previousEmojiProvider = useRef(emojiProvider);
|
|
122
|
+
var isProgrammaticScroll = useRef(false);
|
|
122
123
|
var currentUser = useMemo(function () {
|
|
123
124
|
return emojiProvider.getCurrentUser();
|
|
124
125
|
}, [emojiProvider]);
|
|
@@ -134,6 +135,12 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
134
135
|
}
|
|
135
136
|
}, [selectedEmoji]);
|
|
136
137
|
var onCategoryActivated = useCallback(function (category) {
|
|
138
|
+
// Ignore scroll-driven category changes while a programmatic reveal()
|
|
139
|
+
// scroll is in progress — they would flicker the indicator through
|
|
140
|
+
// intermediate categories before landing on the correct one.
|
|
141
|
+
if (isProgrammaticScroll.current && fg('platform_emoji_picker_refresh')) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
137
144
|
if (activeCategory !== category) {
|
|
138
145
|
setActiveCategory(category);
|
|
139
146
|
}
|
|
@@ -295,7 +302,16 @@ var EmojiPickerComponent = function EmojiPickerComponent(_ref) {
|
|
|
295
302
|
});
|
|
296
303
|
}
|
|
297
304
|
if (emojiPickerList.current) {
|
|
305
|
+
if (fg('platform_emoji_picker_refresh')) {
|
|
306
|
+
isProgrammaticScroll.current = true;
|
|
307
|
+
}
|
|
298
308
|
emojiPickerList.current.reveal(categoryId);
|
|
309
|
+
if (fg('platform_emoji_picker_refresh')) {
|
|
310
|
+
// Clear the flag after the scroll animation has settled.
|
|
311
|
+
setTimeout(function () {
|
|
312
|
+
isProgrammaticScroll.current = false;
|
|
313
|
+
}, 300);
|
|
314
|
+
}
|
|
299
315
|
}
|
|
300
316
|
batchedUpdates(function () {
|
|
301
317
|
setActiveCategory(categoryId);
|
|
@@ -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: "
|
|
17
|
+
packageVersion: "70.3.4"
|
|
18
18
|
}, attributes)
|
|
19
19
|
};
|
|
20
20
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/emoji",
|
|
3
|
-
"version": "70.
|
|
3
|
+
"version": "70.4.0",
|
|
4
4
|
"description": "Fabric emoji React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,14 +42,14 @@
|
|
|
42
42
|
"@atlaskit/button": "^23.11.0",
|
|
43
43
|
"@atlaskit/css": "^0.19.0",
|
|
44
44
|
"@atlaskit/heading": "^5.4.0",
|
|
45
|
-
"@atlaskit/icon": "^34.
|
|
45
|
+
"@atlaskit/icon": "^34.4.0",
|
|
46
46
|
"@atlaskit/media-client": "^36.1.0",
|
|
47
47
|
"@atlaskit/media-client-react": "^5.1.0",
|
|
48
48
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|
|
49
49
|
"@atlaskit/primitives": "^19.0.0",
|
|
50
50
|
"@atlaskit/spinner": "^19.1.0",
|
|
51
51
|
"@atlaskit/textfield": "^8.3.0",
|
|
52
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^77.1.0",
|
|
53
53
|
"@atlaskit/tokens": "^13.0.0",
|
|
54
54
|
"@atlaskit/tooltip": "^22.0.0",
|
|
55
55
|
"@atlaskit/ufo": "^0.4.0",
|
|
@@ -139,6 +139,9 @@
|
|
|
139
139
|
},
|
|
140
140
|
"increase-emoji-client-upload-timeout": {
|
|
141
141
|
"type": "boolean"
|
|
142
|
+
},
|
|
143
|
+
"platform_emoji_picker_refresh": {
|
|
144
|
+
"type": "boolean"
|
|
142
145
|
}
|
|
143
146
|
},
|
|
144
147
|
"scripts": {
|
package/afm-jira/tsconfig.json
DELETED
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"extends": "../../../../tsconfig.local-consumption.json",
|
|
3
|
-
"compilerOptions": {
|
|
4
|
-
"target": "es5",
|
|
5
|
-
"outDir": "../../../../../jira/tsDist/@atlaskit__emoji/app",
|
|
6
|
-
"rootDir": "../",
|
|
7
|
-
"composite": true,
|
|
8
|
-
"noCheck": true
|
|
9
|
-
},
|
|
10
|
-
"include": [
|
|
11
|
-
"../src/**/*.ts",
|
|
12
|
-
"../src/**/*.tsx"
|
|
13
|
-
],
|
|
14
|
-
"exclude": [
|
|
15
|
-
"../src/**/__tests__/*",
|
|
16
|
-
"../src/**/*.test.*",
|
|
17
|
-
"../src/**/test.*",
|
|
18
|
-
"../src/**/examples.*",
|
|
19
|
-
"../src/**/examples/*",
|
|
20
|
-
"../src/**/examples/**/*",
|
|
21
|
-
"../src/**/*.stories.*",
|
|
22
|
-
"../src/**/stories/*",
|
|
23
|
-
"../src/**/stories/**/*"
|
|
24
|
-
],
|
|
25
|
-
"references": [
|
|
26
|
-
{
|
|
27
|
-
"path": "../../../analytics/analytics-next/afm-jira/tsconfig.json"
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
"path": "../../../design-system/button/afm-jira/tsconfig.json"
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
"path": "../../../design-system/css/afm-jira/tsconfig.json"
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"path": "../../../design-system/heading/afm-jira/tsconfig.json"
|
|
37
|
-
},
|
|
38
|
-
{
|
|
39
|
-
"path": "../../../design-system/icon/afm-jira/tsconfig.json"
|
|
40
|
-
},
|
|
41
|
-
{
|
|
42
|
-
"path": "../../../media/media-client/afm-jira/tsconfig.json"
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
"path": "../../../media/media-client-react/afm-jira/tsconfig.json"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"path": "../../../platform/feature-flags/afm-jira/tsconfig.json"
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"path": "../../../design-system/primitives/afm-jira/tsconfig.json"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
54
|
-
"path": "../../../design-system/spinner/afm-jira/tsconfig.json"
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
"path": "../../../design-system/textfield/afm-jira/tsconfig.json"
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
"path": "../../../editor/tmp-editor-statsig/afm-jira/tsconfig.json"
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
"path": "../../../design-system/tokens/afm-jira/tsconfig.json"
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"path": "../../../design-system/tooltip/afm-jira/tsconfig.json"
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
"path": "../../../data/ufo-external/afm-jira/tsconfig.json"
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
"path": "../../util-service-support/afm-jira/tsconfig.json"
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
"path": "../../../design-system/visually-hidden/afm-jira/tsconfig.json"
|
|
76
|
-
}
|
|
77
|
-
]
|
|
78
|
-
}
|