@atlaskit/emoji 70.4.0 → 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 +8 -0
- 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.js +2 -2
- 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.js +3 -3
- 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.js +3 -3
- 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 +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
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
|
+
|
|
3
11
|
## 70.4.0
|
|
4
12
|
|
|
5
13
|
### Minor Changes
|
|
@@ -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
|
+
});
|
|
@@ -44,7 +44,7 @@ var addNewCategories = function addNewCategories(oldCategories, newCategories) {
|
|
|
44
44
|
return oldCategories;
|
|
45
45
|
}
|
|
46
46
|
return oldCategories.concat(newCategories.filter(function (category) {
|
|
47
|
-
return !!_categories.CategoryDescriptionMap[category];
|
|
47
|
+
return !!((0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? _categories.CategoryDescriptionMapNew : _categories.CategoryDescriptionMap)[category];
|
|
48
48
|
})).sort(sortCategories);
|
|
49
49
|
};
|
|
50
50
|
var categorySelectorComponentTestId = exports.categorySelectorComponentTestId = 'category-selector-component';
|
|
@@ -160,7 +160,7 @@ var CategorySelector = function CategorySelector(props) {
|
|
|
160
160
|
ref: categoryRef,
|
|
161
161
|
className: (0, _runtime.ax)(["_ca0q12x7 _n3td12x7 _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1h6o"])
|
|
162
162
|
}, categories.map(function (categoryId, index) {
|
|
163
|
-
var category = _categories.CategoryDescriptionMap[categoryId];
|
|
163
|
+
var category = (0, _platformFeatureFlags.fg)('platform_emoji_picker_refresh') ? _categories.CategoryDescriptionMapNew[categoryId] : _categories.CategoryDescriptionMap[categoryId];
|
|
164
164
|
var Icon = category.icon;
|
|
165
165
|
var categoryName = formatMessage(_i18n.messages[category.name]);
|
|
166
166
|
return /*#__PURE__*/React.createElement(_tooltip.default, {
|
|
@@ -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,
|
|
@@ -10,7 +10,7 @@ import { Pressable } from '@atlaskit/primitives/compiled';
|
|
|
10
10
|
import Tooltip from '@atlaskit/tooltip';
|
|
11
11
|
import { CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED, defaultCategories, KeyboardKeys } from '../../util/constants';
|
|
12
12
|
import { messages } from '../i18n';
|
|
13
|
-
import { CategoryDescriptionMap } from './categories';
|
|
13
|
+
import { CategoryDescriptionMap, CategoryDescriptionMapNew } from './categories';
|
|
14
14
|
import { usePrevious } from '../../hooks/usePrevious';
|
|
15
15
|
import { RENDER_EMOJI_PICKER_LIST_TESTID } from './EmojiPickerList';
|
|
16
16
|
const styles = {
|
|
@@ -31,7 +31,7 @@ const addNewCategories = (oldCategories, newCategories) => {
|
|
|
31
31
|
if (!newCategories) {
|
|
32
32
|
return oldCategories;
|
|
33
33
|
}
|
|
34
|
-
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);
|
|
35
35
|
};
|
|
36
36
|
export const categorySelectorComponentTestId = 'category-selector-component';
|
|
37
37
|
export const categorySelectorCategoryTestId = categoryId => `category-selector-${categoryId}`;
|
|
@@ -139,7 +139,7 @@ const CategorySelector = props => {
|
|
|
139
139
|
ref: categoryRef,
|
|
140
140
|
className: ax(["_ca0q12x7 _n3td12x7 _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1h6o"])
|
|
141
141
|
}, categories.map((categoryId, index) => {
|
|
142
|
-
const category = CategoryDescriptionMap[categoryId];
|
|
142
|
+
const category = fg('platform_emoji_picker_refresh') ? CategoryDescriptionMapNew[categoryId] : CategoryDescriptionMap[categoryId];
|
|
143
143
|
const Icon = category.icon;
|
|
144
144
|
const categoryName = formatMessage(messages[category.name]);
|
|
145
145
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
2
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
2
3
|
import { customCategory, defaultEmojiPickerSize, frequentCategory, searchCategory, userCustomTitle, yourUploadsCategory } from '../../util/constants';
|
|
3
|
-
import { CategoryDescriptionMap } from './categories';
|
|
4
|
+
import { CategoryDescriptionMap, CategoryDescriptionMapNew } from './categories';
|
|
4
5
|
import CategoryTracker from './CategoryTracker';
|
|
5
6
|
import { sizes } from './EmojiPickerSizes';
|
|
6
7
|
import { CategoryHeadingItem, EmojisRowItem, LoadingItem, virtualItemRenderer } from './EmojiPickerVirtualItems';
|
|
@@ -107,7 +108,7 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
107
108
|
}, [groupByCategory]);
|
|
108
109
|
const addToCategoryMap = (categoryToGroupMap, emoji, category) => {
|
|
109
110
|
if (!categoryToGroupMap[category]) {
|
|
110
|
-
const categoryDefinition = CategoryDescriptionMap[category];
|
|
111
|
+
const categoryDefinition = fg('platform_emoji_picker_refresh') ? CategoryDescriptionMapNew[category] : CategoryDescriptionMap[category];
|
|
111
112
|
categoryToGroupMap[category] = {
|
|
112
113
|
emojis: [],
|
|
113
114
|
title: categoryDefinition.name,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import BasketballIcon from '@atlaskit/icon/core/basketball';
|
|
2
2
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
3
|
+
import EmojiAddIcon from '@atlaskit/icon/core/emoji-add';
|
|
3
4
|
import FlagIcon from '@atlaskit/icon/core/flag';
|
|
4
5
|
import TakeoutFoodIcon from '@atlaskit/icon/core/takeout-food';
|
|
5
6
|
import ClockIcon from '@atlaskit/icon/core/clock';
|
|
@@ -90,4 +91,85 @@ export const CategoryDescriptionMap = {
|
|
|
90
91
|
icon: AddIcon,
|
|
91
92
|
order: 12
|
|
92
93
|
}
|
|
94
|
+
};
|
|
95
|
+
export const CategoryDescriptionMapNew = {
|
|
96
|
+
SEARCH: {
|
|
97
|
+
id: 'SEARCH',
|
|
98
|
+
name: 'categoriesSearchResults',
|
|
99
|
+
// refers to i18n categoriesSearchResults key
|
|
100
|
+
icon: undefined,
|
|
101
|
+
order: 0
|
|
102
|
+
},
|
|
103
|
+
FREQUENT: {
|
|
104
|
+
id: 'FREQUENT',
|
|
105
|
+
name: 'frequentCategory',
|
|
106
|
+
icon: ClockIcon,
|
|
107
|
+
order: 1
|
|
108
|
+
},
|
|
109
|
+
PEOPLE: {
|
|
110
|
+
id: 'PEOPLE',
|
|
111
|
+
name: 'peopleCategory',
|
|
112
|
+
icon: EmojiIcon,
|
|
113
|
+
order: 2
|
|
114
|
+
},
|
|
115
|
+
NATURE: {
|
|
116
|
+
id: 'NATURE',
|
|
117
|
+
name: 'natureCategory',
|
|
118
|
+
icon: TreeIcon,
|
|
119
|
+
order: 3
|
|
120
|
+
},
|
|
121
|
+
FOODS: {
|
|
122
|
+
id: 'FOODS',
|
|
123
|
+
name: 'foodsCategory',
|
|
124
|
+
icon: TakeoutFoodIcon,
|
|
125
|
+
order: 4
|
|
126
|
+
},
|
|
127
|
+
ACTIVITY: {
|
|
128
|
+
id: 'ACTIVITY',
|
|
129
|
+
name: 'activityCategory',
|
|
130
|
+
icon: BasketballIcon,
|
|
131
|
+
order: 5
|
|
132
|
+
},
|
|
133
|
+
PLACES: {
|
|
134
|
+
id: 'PLACES',
|
|
135
|
+
name: 'placesCategory',
|
|
136
|
+
icon: VehicleCarIcon,
|
|
137
|
+
order: 6
|
|
138
|
+
},
|
|
139
|
+
OBJECTS: {
|
|
140
|
+
id: 'OBJECTS',
|
|
141
|
+
name: 'objectsCategory',
|
|
142
|
+
icon: LightbulbIcon,
|
|
143
|
+
order: 7
|
|
144
|
+
},
|
|
145
|
+
SYMBOLS: {
|
|
146
|
+
id: 'SYMBOLS',
|
|
147
|
+
name: 'symbolsCategory',
|
|
148
|
+
icon: HeartIcon,
|
|
149
|
+
order: 8
|
|
150
|
+
},
|
|
151
|
+
FLAGS: {
|
|
152
|
+
id: 'FLAGS',
|
|
153
|
+
name: 'flagsCategory',
|
|
154
|
+
icon: FlagIcon,
|
|
155
|
+
order: 9
|
|
156
|
+
},
|
|
157
|
+
ATLASSIAN: {
|
|
158
|
+
id: 'ATLASSIAN',
|
|
159
|
+
name: 'productivityCategory',
|
|
160
|
+
icon: CheckCircleIcon,
|
|
161
|
+
order: 10
|
|
162
|
+
},
|
|
163
|
+
USER_CUSTOM: {
|
|
164
|
+
id: customCategory,
|
|
165
|
+
name: userCustomTitle,
|
|
166
|
+
icon: AddIcon,
|
|
167
|
+
order: 11
|
|
168
|
+
},
|
|
169
|
+
CUSTOM: {
|
|
170
|
+
id: customCategory,
|
|
171
|
+
name: customTitle,
|
|
172
|
+
icon: EmojiAddIcon,
|
|
173
|
+
order: 12
|
|
174
|
+
}
|
|
93
175
|
};
|
|
@@ -6,7 +6,7 @@ import * as React from 'react';
|
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
7
|
import { Fragment, useState, useRef, memo, useLayoutEffect, useCallback } from 'react';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
-
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
9
|
+
import { FormattedMessage, injectIntl, useIntl } from 'react-intl';
|
|
10
10
|
import EmojiDeletePreview from './EmojiDeletePreview';
|
|
11
11
|
import EmojiUploadPicker from './EmojiUploadPicker';
|
|
12
12
|
import TonePreviewButton from './TonePreviewButton';
|
|
@@ -15,6 +15,7 @@ import { EmojiPickerListSearch } from '../picker/EmojiPickerListSearch';
|
|
|
15
15
|
import { messages } from '../i18n';
|
|
16
16
|
import AkButton from '@atlaskit/button/standard-button';
|
|
17
17
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
18
|
+
import EmojiAddIcon from '@atlaskit/icon/core/emoji-add';
|
|
18
19
|
import { setSkinToneAriaLabelText } from './setSkinToneAriaLabelText';
|
|
19
20
|
import { emojiPickerAddEmoji } from './styles';
|
|
20
21
|
import { DEFAULT_TONE } from '../../util/constants';
|
|
@@ -35,15 +36,20 @@ export var uploadEmojiTestId = 'upload-emoji';
|
|
|
35
36
|
var AddOwnEmoji = function AddOwnEmoji(props) {
|
|
36
37
|
var onOpenUpload = props.onOpenUpload,
|
|
37
38
|
uploadEnabled = props.uploadEnabled;
|
|
39
|
+
var _useIntl = useIntl(),
|
|
40
|
+
formatMessage = _useIntl.formatMessage;
|
|
38
41
|
return /*#__PURE__*/React.createElement(Fragment, null, uploadEnabled && /*#__PURE__*/React.createElement("div", {
|
|
39
42
|
"data-testid": uploadEmojiTestId,
|
|
40
43
|
className: ax(["_1wpz1h6o _18u019bv _otyr19bv"])
|
|
41
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.addCustomEmojiLabel, function (label) {
|
|
44
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, fg('platform_emoji_picker_refresh') ? messages.addEmojiLabel : messages.addCustomEmojiLabel, function (label) {
|
|
42
45
|
return /*#__PURE__*/React.createElement(AkButton, {
|
|
43
46
|
onClick: onOpenUpload,
|
|
44
47
|
iconBefore: /*#__PURE__*/React.createElement(Box, {
|
|
45
48
|
xcss: styles.icon
|
|
46
|
-
}, /*#__PURE__*/React.createElement(
|
|
49
|
+
}, fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement(EmojiAddIcon, {
|
|
50
|
+
color: "currentColor",
|
|
51
|
+
label: formatMessage(messages.addCustomEmojiLabel)
|
|
52
|
+
}) : /*#__PURE__*/React.createElement(AddIcon, {
|
|
47
53
|
color: "currentColor",
|
|
48
54
|
label: ""
|
|
49
55
|
})),
|
|
@@ -19,6 +19,7 @@ import EmojiErrorMessage from './EmojiErrorMessage';
|
|
|
19
19
|
import EmojiUploadPreview from './EmojiUploadPreview';
|
|
20
20
|
import FileChooser from './FileChooser';
|
|
21
21
|
import { UploadStatus } from './internal-types';
|
|
22
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
22
23
|
var closeEmojiUploadButton = null;
|
|
23
24
|
var emojiUpload = null;
|
|
24
25
|
var emojiUploadTop = null;
|
|
@@ -78,7 +79,7 @@ var ChooseEmojiFile = /*#__PURE__*/memo(function (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,
|
|
@@ -11,7 +11,7 @@ import { Pressable } from '@atlaskit/primitives/compiled';
|
|
|
11
11
|
import Tooltip from '@atlaskit/tooltip';
|
|
12
12
|
import { CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED, defaultCategories, KeyboardKeys } from '../../util/constants';
|
|
13
13
|
import { messages } from '../i18n';
|
|
14
|
-
import { CategoryDescriptionMap } from './categories';
|
|
14
|
+
import { CategoryDescriptionMap, CategoryDescriptionMapNew } from './categories';
|
|
15
15
|
import { usePrevious } from '../../hooks/usePrevious';
|
|
16
16
|
import { RENDER_EMOJI_PICKER_LIST_TESTID } from './EmojiPickerList';
|
|
17
17
|
var styles = {
|
|
@@ -35,7 +35,7 @@ var addNewCategories = function addNewCategories(oldCategories, newCategories) {
|
|
|
35
35
|
return oldCategories;
|
|
36
36
|
}
|
|
37
37
|
return oldCategories.concat(newCategories.filter(function (category) {
|
|
38
|
-
return !!CategoryDescriptionMap[category];
|
|
38
|
+
return !!(fg('platform_emoji_picker_refresh') ? CategoryDescriptionMapNew : CategoryDescriptionMap)[category];
|
|
39
39
|
})).sort(sortCategories);
|
|
40
40
|
};
|
|
41
41
|
export var categorySelectorComponentTestId = 'category-selector-component';
|
|
@@ -151,7 +151,7 @@ var CategorySelector = function CategorySelector(props) {
|
|
|
151
151
|
ref: categoryRef,
|
|
152
152
|
className: ax(["_ca0q12x7 _n3td12x7 _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1h6o"])
|
|
153
153
|
}, categories.map(function (categoryId, index) {
|
|
154
|
-
var category = CategoryDescriptionMap[categoryId];
|
|
154
|
+
var category = fg('platform_emoji_picker_refresh') ? CategoryDescriptionMapNew[categoryId] : CategoryDescriptionMap[categoryId];
|
|
155
155
|
var Icon = category.icon;
|
|
156
156
|
var categoryName = formatMessage(messages[category.name]);
|
|
157
157
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import React, { useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from 'react';
|
|
4
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
4
5
|
import { customCategory, defaultEmojiPickerSize, frequentCategory, searchCategory, userCustomTitle, yourUploadsCategory } from '../../util/constants';
|
|
5
|
-
import { CategoryDescriptionMap } from './categories';
|
|
6
|
+
import { CategoryDescriptionMap, CategoryDescriptionMapNew } from './categories';
|
|
6
7
|
import CategoryTracker from './CategoryTracker';
|
|
7
8
|
import { sizes } from './EmojiPickerSizes';
|
|
8
9
|
import { CategoryHeadingItem, EmojisRowItem, LoadingItem, virtualItemRenderer } from './EmojiPickerVirtualItems';
|
|
@@ -131,7 +132,7 @@ export var EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef(functi
|
|
|
131
132
|
}, [groupByCategory]);
|
|
132
133
|
var addToCategoryMap = function addToCategoryMap(categoryToGroupMap, emoji, category) {
|
|
133
134
|
if (!categoryToGroupMap[category]) {
|
|
134
|
-
var categoryDefinition = CategoryDescriptionMap[category];
|
|
135
|
+
var categoryDefinition = fg('platform_emoji_picker_refresh') ? CategoryDescriptionMapNew[category] : CategoryDescriptionMap[category];
|
|
135
136
|
categoryToGroupMap[category] = {
|
|
136
137
|
emojis: [],
|
|
137
138
|
title: categoryDefinition.name,
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import BasketballIcon from '@atlaskit/icon/core/basketball';
|
|
2
2
|
import AddIcon from '@atlaskit/icon/core/add';
|
|
3
|
+
import EmojiAddIcon from '@atlaskit/icon/core/emoji-add';
|
|
3
4
|
import FlagIcon from '@atlaskit/icon/core/flag';
|
|
4
5
|
import TakeoutFoodIcon from '@atlaskit/icon/core/takeout-food';
|
|
5
6
|
import ClockIcon from '@atlaskit/icon/core/clock';
|
|
@@ -90,4 +91,85 @@ export var CategoryDescriptionMap = {
|
|
|
90
91
|
icon: AddIcon,
|
|
91
92
|
order: 12
|
|
92
93
|
}
|
|
94
|
+
};
|
|
95
|
+
export var CategoryDescriptionMapNew = {
|
|
96
|
+
SEARCH: {
|
|
97
|
+
id: 'SEARCH',
|
|
98
|
+
name: 'categoriesSearchResults',
|
|
99
|
+
// refers to i18n categoriesSearchResults key
|
|
100
|
+
icon: undefined,
|
|
101
|
+
order: 0
|
|
102
|
+
},
|
|
103
|
+
FREQUENT: {
|
|
104
|
+
id: 'FREQUENT',
|
|
105
|
+
name: 'frequentCategory',
|
|
106
|
+
icon: ClockIcon,
|
|
107
|
+
order: 1
|
|
108
|
+
},
|
|
109
|
+
PEOPLE: {
|
|
110
|
+
id: 'PEOPLE',
|
|
111
|
+
name: 'peopleCategory',
|
|
112
|
+
icon: EmojiIcon,
|
|
113
|
+
order: 2
|
|
114
|
+
},
|
|
115
|
+
NATURE: {
|
|
116
|
+
id: 'NATURE',
|
|
117
|
+
name: 'natureCategory',
|
|
118
|
+
icon: TreeIcon,
|
|
119
|
+
order: 3
|
|
120
|
+
},
|
|
121
|
+
FOODS: {
|
|
122
|
+
id: 'FOODS',
|
|
123
|
+
name: 'foodsCategory',
|
|
124
|
+
icon: TakeoutFoodIcon,
|
|
125
|
+
order: 4
|
|
126
|
+
},
|
|
127
|
+
ACTIVITY: {
|
|
128
|
+
id: 'ACTIVITY',
|
|
129
|
+
name: 'activityCategory',
|
|
130
|
+
icon: BasketballIcon,
|
|
131
|
+
order: 5
|
|
132
|
+
},
|
|
133
|
+
PLACES: {
|
|
134
|
+
id: 'PLACES',
|
|
135
|
+
name: 'placesCategory',
|
|
136
|
+
icon: VehicleCarIcon,
|
|
137
|
+
order: 6
|
|
138
|
+
},
|
|
139
|
+
OBJECTS: {
|
|
140
|
+
id: 'OBJECTS',
|
|
141
|
+
name: 'objectsCategory',
|
|
142
|
+
icon: LightbulbIcon,
|
|
143
|
+
order: 7
|
|
144
|
+
},
|
|
145
|
+
SYMBOLS: {
|
|
146
|
+
id: 'SYMBOLS',
|
|
147
|
+
name: 'symbolsCategory',
|
|
148
|
+
icon: HeartIcon,
|
|
149
|
+
order: 8
|
|
150
|
+
},
|
|
151
|
+
FLAGS: {
|
|
152
|
+
id: 'FLAGS',
|
|
153
|
+
name: 'flagsCategory',
|
|
154
|
+
icon: FlagIcon,
|
|
155
|
+
order: 9
|
|
156
|
+
},
|
|
157
|
+
ATLASSIAN: {
|
|
158
|
+
id: 'ATLASSIAN',
|
|
159
|
+
name: 'productivityCategory',
|
|
160
|
+
icon: CheckCircleIcon,
|
|
161
|
+
order: 10
|
|
162
|
+
},
|
|
163
|
+
USER_CUSTOM: {
|
|
164
|
+
id: customCategory,
|
|
165
|
+
name: userCustomTitle,
|
|
166
|
+
icon: AddIcon,
|
|
167
|
+
order: 11
|
|
168
|
+
},
|
|
169
|
+
CUSTOM: {
|
|
170
|
+
id: customCategory,
|
|
171
|
+
name: customTitle,
|
|
172
|
+
icon: EmojiAddIcon,
|
|
173
|
+
order: 12
|
|
174
|
+
}
|
|
93
175
|
};
|
|
@@ -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: "0.0.0-development"
|
|
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.4.
|
|
3
|
+
"version": "70.4.1",
|
|
4
4
|
"description": "Fabric emoji React components",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -43,13 +43,13 @@
|
|
|
43
43
|
"@atlaskit/css": "^0.19.0",
|
|
44
44
|
"@atlaskit/heading": "^5.4.0",
|
|
45
45
|
"@atlaskit/icon": "^34.4.0",
|
|
46
|
-
"@atlaskit/media-client": "^36.
|
|
46
|
+
"@atlaskit/media-client": "^36.2.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": "^77.
|
|
52
|
+
"@atlaskit/tmp-editor-statsig": "^77.3.0",
|
|
53
53
|
"@atlaskit/tokens": "^13.0.0",
|
|
54
54
|
"@atlaskit/tooltip": "^22.0.0",
|
|
55
55
|
"@atlaskit/ufo": "^0.4.0",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"@atlaskit/ssr": "workspace:^",
|
|
80
80
|
"@atlaskit/theme": "^23.2.0",
|
|
81
81
|
"@atlassian/a11y-jest-testing": "^0.11.0",
|
|
82
|
-
"@atlassian/feature-flags-test-utils": "^1.
|
|
82
|
+
"@atlassian/feature-flags-test-utils": "^1.1.0",
|
|
83
83
|
"@emotion/jest": "^11.8.0",
|
|
84
84
|
"@testing-library/dom": "^10.1.0",
|
|
85
85
|
"@testing-library/jest-dom": "^6.4.5",
|