@atlaskit/emoji 70.4.2 → 70.5.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 +7 -0
- package/dist/cjs/components/common/AddEmoji.compiled.css +5 -0
- package/dist/cjs/components/common/AddEmoji.js +37 -0
- package/dist/cjs/components/common/EmojiActions.js +40 -13
- package/dist/cjs/components/common/EmojiUploadPicker.js +2 -1
- package/dist/cjs/components/common/TonePreviewButton.compiled.css +1 -0
- package/dist/cjs/components/common/TonePreviewButton.js +22 -1
- package/dist/cjs/components/picker/CategorySelector.compiled.css +2 -2
- package/dist/cjs/components/picker/CategorySelector.js +6 -3
- package/dist/cjs/components/picker/EmojiPickerComponent.js +14 -3
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +4 -0
- package/dist/cjs/components/picker/EmojiPickerFooter.compiled.css +7 -2
- package/dist/cjs/components/picker/EmojiPickerFooter.js +24 -2
- package/dist/cjs/components/picker/EmojiPickerList.js +5 -3
- package/dist/cjs/components/picker/EmojiPickerListSearch.compiled.css +4 -0
- package/dist/cjs/components/picker/EmojiPickerListSearch.js +26 -1
- package/dist/cjs/components/picker/EmojiPickerSizes.js +1 -0
- package/dist/cjs/components/picker/categories.js +13 -13
- package/dist/cjs/util/analytics/analytics.js +1 -1
- package/dist/cjs/util/constants.js +2 -1
- package/dist/es2019/components/common/AddEmoji.compiled.css +5 -0
- package/dist/es2019/components/common/AddEmoji.js +28 -0
- package/dist/es2019/components/common/EmojiActions.js +40 -14
- package/dist/es2019/components/common/EmojiUploadPicker.js +2 -1
- package/dist/es2019/components/common/TonePreviewButton.compiled.css +1 -0
- package/dist/es2019/components/common/TonePreviewButton.js +22 -1
- package/dist/es2019/components/picker/CategorySelector.compiled.css +2 -2
- package/dist/es2019/components/picker/CategorySelector.js +3 -2
- package/dist/es2019/components/picker/EmojiPickerComponent.js +14 -3
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +4 -0
- package/dist/es2019/components/picker/EmojiPickerFooter.compiled.css +7 -2
- package/dist/es2019/components/picker/EmojiPickerFooter.js +31 -7
- package/dist/es2019/components/picker/EmojiPickerList.js +7 -3
- package/dist/es2019/components/picker/EmojiPickerListSearch.compiled.css +4 -0
- package/dist/es2019/components/picker/EmojiPickerListSearch.js +26 -1
- package/dist/es2019/components/picker/EmojiPickerSizes.js +2 -1
- package/dist/es2019/components/picker/categories.js +13 -13
- package/dist/es2019/util/analytics/analytics.js +1 -1
- package/dist/es2019/util/constants.js +1 -0
- package/dist/esm/components/common/AddEmoji.compiled.css +5 -0
- package/dist/esm/components/common/AddEmoji.js +28 -0
- package/dist/esm/components/common/EmojiActions.js +40 -13
- package/dist/esm/components/common/EmojiUploadPicker.js +2 -1
- package/dist/esm/components/common/TonePreviewButton.compiled.css +1 -0
- package/dist/esm/components/common/TonePreviewButton.js +22 -1
- package/dist/esm/components/picker/CategorySelector.compiled.css +2 -2
- package/dist/esm/components/picker/CategorySelector.js +5 -2
- package/dist/esm/components/picker/EmojiPickerComponent.js +14 -3
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +4 -0
- package/dist/esm/components/picker/EmojiPickerFooter.compiled.css +7 -2
- package/dist/esm/components/picker/EmojiPickerFooter.js +24 -2
- package/dist/esm/components/picker/EmojiPickerList.js +5 -3
- package/dist/esm/components/picker/EmojiPickerListSearch.compiled.css +4 -0
- package/dist/esm/components/picker/EmojiPickerListSearch.js +26 -1
- package/dist/esm/components/picker/EmojiPickerSizes.js +2 -1
- package/dist/esm/components/picker/categories.js +13 -13
- package/dist/esm/util/analytics/analytics.js +1 -1
- package/dist/esm/util/constants.js +1 -0
- package/dist/types/components/common/AddEmoji.d.ts +11 -0
- package/dist/types/components/common/EmojiActions.d.ts +2 -0
- package/dist/types/components/picker/CategorySelector.d.ts +1 -0
- package/dist/types/components/picker/EmojiPickerEmojiRow.d.ts +2 -1
- package/dist/types/components/picker/EmojiPickerFooter.d.ts +3 -1
- package/dist/types/components/picker/EmojiPickerList.d.ts +1 -0
- package/dist/types/components/picker/EmojiPickerSizes.d.ts +1 -0
- package/dist/types/util/constants.d.ts +1 -0
- package/dist/types-ts4.5/components/common/AddEmoji.d.ts +11 -0
- package/dist/types-ts4.5/components/common/EmojiActions.d.ts +2 -0
- package/dist/types-ts4.5/components/picker/CategorySelector.d.ts +1 -0
- package/dist/types-ts4.5/components/picker/EmojiPickerEmojiRow.d.ts +2 -1
- package/dist/types-ts4.5/components/picker/EmojiPickerFooter.d.ts +3 -1
- package/dist/types-ts4.5/components/picker/EmojiPickerList.d.ts +1 -0
- package/dist/types-ts4.5/components/picker/EmojiPickerSizes.d.ts +1 -0
- package/dist/types-ts4.5/util/constants.d.ts +1 -0
- package/package.json +1 -1
- package/dist/cjs/components/common/messages.js +0 -14
- package/dist/es2019/components/common/messages.js +0 -8
- package/dist/esm/components/common/messages.js +0 -8
- package/dist/types/components/common/messages.d.ts +0 -7
- package/dist/types-ts4.5/components/common/messages.d.ts +0 -7
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* AddEmoji.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import "./AddEmoji.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { Fragment } from 'react';
|
|
6
|
+
import { FormattedMessage } from 'react-intl';
|
|
7
|
+
import { messages } from '../i18n';
|
|
8
|
+
import Button from '@atlaskit/button/new';
|
|
9
|
+
export const emojiActionsTestId = 'emoji-actions';
|
|
10
|
+
export const uploadEmojiTestId = 'upload-emoji';
|
|
11
|
+
const addCustomEmoji = null;
|
|
12
|
+
|
|
13
|
+
// Generic Type for the wrapped functional component
|
|
14
|
+
|
|
15
|
+
export const AddOwnEmoji = props => {
|
|
16
|
+
const {
|
|
17
|
+
onOpenUpload,
|
|
18
|
+
uploadEnabled
|
|
19
|
+
} = props;
|
|
20
|
+
return /*#__PURE__*/React.createElement(Fragment, null, uploadEnabled && /*#__PURE__*/React.createElement("div", {
|
|
21
|
+
"data-testid": uploadEmojiTestId,
|
|
22
|
+
className: ax(["_1wpz1h6o _19pkutpp _2hwxutpp _otyrutpp _18u0utpp"])
|
|
23
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.addCustomEmojiLabel, label => /*#__PURE__*/React.createElement(Button, {
|
|
24
|
+
onClick: onOpenUpload,
|
|
25
|
+
tabIndex: 0,
|
|
26
|
+
id: "add-custom-emoji"
|
|
27
|
+
}, label))));
|
|
28
|
+
};
|
|
@@ -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
|
|
8
|
+
import { FormattedMessage, injectIntl } from 'react-intl';
|
|
9
9
|
import EmojiDeletePreview from './EmojiDeletePreview';
|
|
10
10
|
import EmojiUploadPicker from './EmojiUploadPicker';
|
|
11
11
|
import TonePreviewButton from './TonePreviewButton';
|
|
@@ -14,7 +14,6 @@ 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';
|
|
18
17
|
import { setSkinToneAriaLabelText } from './setSkinToneAriaLabelText';
|
|
19
18
|
import { emojiPickerAddEmoji } from './styles';
|
|
20
19
|
import { DEFAULT_TONE } from '../../util/constants';
|
|
@@ -27,30 +26,25 @@ const addCustomEmojiButton = null;
|
|
|
27
26
|
const emojiActionsWrapper = null;
|
|
28
27
|
const emojiToneSelectorContainer = null;
|
|
29
28
|
const previewFooter = null;
|
|
29
|
+
const previewFooterNew = null;
|
|
30
30
|
export const emojiActionsTestId = 'emoji-actions';
|
|
31
31
|
export const uploadEmojiTestId = 'upload-emoji';
|
|
32
32
|
|
|
33
33
|
// Generic Type for the wrapped functional component
|
|
34
34
|
|
|
35
|
-
const AddOwnEmoji = props => {
|
|
35
|
+
export const AddOwnEmoji = props => {
|
|
36
36
|
const {
|
|
37
37
|
onOpenUpload,
|
|
38
38
|
uploadEnabled
|
|
39
39
|
} = props;
|
|
40
|
-
const {
|
|
41
|
-
formatMessage
|
|
42
|
-
} = useIntl();
|
|
43
40
|
return /*#__PURE__*/React.createElement(Fragment, null, uploadEnabled && /*#__PURE__*/React.createElement("div", {
|
|
44
41
|
"data-testid": uploadEmojiTestId,
|
|
45
42
|
className: ax(["_1wpz1h6o _18u019bv _otyr19bv"])
|
|
46
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage,
|
|
43
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.addCustomEmojiLabel, label => /*#__PURE__*/React.createElement(AkButton, {
|
|
47
44
|
onClick: onOpenUpload,
|
|
48
45
|
iconBefore: /*#__PURE__*/React.createElement(Box, {
|
|
49
46
|
xcss: styles.icon
|
|
50
|
-
},
|
|
51
|
-
color: "currentColor",
|
|
52
|
-
label: formatMessage(messages.addCustomEmojiLabel)
|
|
53
|
-
}) : /*#__PURE__*/React.createElement(AddIcon, {
|
|
47
|
+
}, /*#__PURE__*/React.createElement(AddIcon, {
|
|
54
48
|
color: "currentColor",
|
|
55
49
|
label: ""
|
|
56
50
|
})),
|
|
@@ -127,6 +121,7 @@ const TonesWrapper = props => {
|
|
|
127
121
|
isVisible: !showToneSelector
|
|
128
122
|
}));
|
|
129
123
|
};
|
|
124
|
+
// TODO: remove this on cleanup of platform_emoji_picker_refresh
|
|
130
125
|
export const EmojiActions = props => {
|
|
131
126
|
const {
|
|
132
127
|
onToneSelected,
|
|
@@ -160,7 +155,15 @@ export const EmojiActions = props => {
|
|
|
160
155
|
setShowToneSelector(false);
|
|
161
156
|
}, [showToneSelector, onToneSelectorCancelled]);
|
|
162
157
|
if (uploading) {
|
|
163
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
158
|
+
return fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
159
|
+
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug"])
|
|
160
|
+
}, /*#__PURE__*/React.createElement(EmojiUploadPicker, {
|
|
161
|
+
onUploadCancelled: onUploadCancelled,
|
|
162
|
+
onUploadEmoji: onUploadEmoji,
|
|
163
|
+
onFileChooserClicked: onFileChooserClicked,
|
|
164
|
+
errorMessage: uploadErrorMessage,
|
|
165
|
+
initialUploadName: initialUploadName
|
|
166
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
164
167
|
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _n7zl1uh4 _16qsjgpa"])
|
|
165
168
|
}, /*#__PURE__*/React.createElement(EmojiUploadPicker, {
|
|
166
169
|
onUploadCancelled: onUploadCancelled,
|
|
@@ -171,7 +174,13 @@ export const EmojiActions = props => {
|
|
|
171
174
|
}));
|
|
172
175
|
}
|
|
173
176
|
if (emojiToDelete) {
|
|
174
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
177
|
+
return fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
178
|
+
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug"])
|
|
179
|
+
}, /*#__PURE__*/React.createElement(EmojiDeletePreview, {
|
|
180
|
+
emoji: emojiToDelete,
|
|
181
|
+
onDeleteEmoji: onDeleteEmoji,
|
|
182
|
+
onCloseDelete: onCloseDelete
|
|
183
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
175
184
|
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _n7zl1uh4 _16qsjgpa"])
|
|
176
185
|
}, /*#__PURE__*/React.createElement(EmojiDeletePreview, {
|
|
177
186
|
emoji: emojiToDelete,
|
|
@@ -179,7 +188,24 @@ export const EmojiActions = props => {
|
|
|
179
188
|
onCloseDelete: onCloseDelete
|
|
180
189
|
}));
|
|
181
190
|
}
|
|
182
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
191
|
+
return fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
192
|
+
"data-testid": emojiActionsTestId,
|
|
193
|
+
onMouseLeave: onMouseLeaveHandler,
|
|
194
|
+
onBlur: fg('platform_suppression_removal_fix_reactions') ? onMouseLeaveHandler : undefined,
|
|
195
|
+
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug"])
|
|
196
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
197
|
+
className: ax(["_1e0c1txw _1bahesu3 _4cvr1h6o"])
|
|
198
|
+
}, /*#__PURE__*/React.createElement(EmojiPickerListSearch, {
|
|
199
|
+
onChange: onChange,
|
|
200
|
+
query: query,
|
|
201
|
+
resultsCount: resultsCount,
|
|
202
|
+
isVisible: !showToneSelector
|
|
203
|
+
}), /*#__PURE__*/React.createElement(TonesWrapper, _extends({}, props, {
|
|
204
|
+
onToneOpen: onToneOpenHandler,
|
|
205
|
+
onToneClose: onToneCloseHandler,
|
|
206
|
+
onToneSelected: onToneSelectedHandler,
|
|
207
|
+
showToneSelector: showToneSelector
|
|
208
|
+
})))) : /*#__PURE__*/React.createElement("div", {
|
|
183
209
|
"data-testid": emojiActionsTestId,
|
|
184
210
|
onMouseLeave: onMouseLeaveHandler,
|
|
185
211
|
onBlur: fg('platform_suppression_removal_fix_reactions') ? onMouseLeaveHandler : undefined,
|
|
@@ -87,7 +87,8 @@ const ChooseEmojiFile = /*#__PURE__*/memo(props => {
|
|
|
87
87
|
appearance: "subtle",
|
|
88
88
|
spacing: "none",
|
|
89
89
|
shouldFitContainer: true,
|
|
90
|
-
testId: cancelEmojiUploadPickerTestId
|
|
90
|
+
testId: cancelEmojiUploadPickerTestId,
|
|
91
|
+
name: messages.addCustomEmojiLabel.defaultMessage
|
|
91
92
|
}, /*#__PURE__*/React.createElement(CrossIcon, {
|
|
92
93
|
color: "currentColor",
|
|
93
94
|
label: cancelLabel
|
|
@@ -3,10 +3,12 @@ import "./TonePreviewButton.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { forwardRef, memo } from 'react';
|
|
6
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
6
7
|
import Emoji from './Emoji';
|
|
7
8
|
export const tonePreviewTestId = 'tone-preview';
|
|
8
9
|
const emojiButton = null;
|
|
9
10
|
const hidden = null;
|
|
11
|
+
const emojiButtonOutline = null;
|
|
10
12
|
export const TonePreviewButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
11
13
|
const {
|
|
12
14
|
emoji,
|
|
@@ -16,7 +18,26 @@ export const TonePreviewButton = /*#__PURE__*/forwardRef((props, ref) => {
|
|
|
16
18
|
onSelected,
|
|
17
19
|
isVisible = true
|
|
18
20
|
} = props;
|
|
19
|
-
return /*#__PURE__*/React.createElement("button", {
|
|
21
|
+
return fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("button", {
|
|
22
|
+
ref: ref,
|
|
23
|
+
onClick: onSelected,
|
|
24
|
+
"aria-label": ariaLabelText,
|
|
25
|
+
"aria-expanded": ariaExpanded,
|
|
26
|
+
"aria-controls": "emoji-picker-tone-selector"
|
|
27
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop -- Ignored via go/DSP-18766
|
|
28
|
+
,
|
|
29
|
+
style: {
|
|
30
|
+
overflow: 'hidden'
|
|
31
|
+
},
|
|
32
|
+
"data-testid": tonePreviewTestId,
|
|
33
|
+
type: "button",
|
|
34
|
+
className: ax(["_19itidpf _2rkofajl _ca0qidpf _u5f3idpf _n3tdidpf _19bvidpf _bfhk1j28 _80omtlke _kqswh2mm _1e0c1o8l _lev4idpf _1cx6idpf _tyukidpf _2ewlidpf _11bcidpf _dqozglyw _1at812x7 _1cjo12x7 _1yg612x7 _hjaq12x7 _hlt21tcg _1s3c1tcg _1i911tcg _1ye71tcg _nt751r31 _49pcglyw _1hvw1o36 _7ehi1y54 _491113zc", !isVisible && "_tzy4idpf _3um015vq _1e0cglyw", "_19itia51"])
|
|
35
|
+
}, /*#__PURE__*/React.createElement(Emoji, {
|
|
36
|
+
emoji: emoji,
|
|
37
|
+
selectOnHover: selectOnHover,
|
|
38
|
+
shouldBeInteractive: false,
|
|
39
|
+
"aria-hidden": true
|
|
40
|
+
})) : /*#__PURE__*/React.createElement("button", {
|
|
20
41
|
ref: ref,
|
|
21
42
|
onClick: onSelected,
|
|
22
43
|
"aria-label": ariaLabelText,
|
|
@@ -22,12 +22,12 @@
|
|
|
22
22
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
23
23
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
24
24
|
._ca0q12x7{padding-top:var(--ds-space-075,6px)}
|
|
25
|
-
.
|
|
25
|
+
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
26
26
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
27
27
|
._dpd31txw button{display:flex}
|
|
28
28
|
._i0dl1wug{flex-basis:auto}
|
|
29
29
|
._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
|
|
30
|
-
.
|
|
30
|
+
._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
|
|
31
31
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
32
32
|
._syaz1rpy{color:var(--ds-text-subtlest,#6b6e76)}
|
|
33
33
|
._syaz6x5g{color:var(--ds-text-selected,#1868db)}
|
|
@@ -15,7 +15,7 @@ import { usePrevious } from '../../hooks/usePrevious';
|
|
|
15
15
|
import { RENDER_EMOJI_PICKER_LIST_TESTID } from './EmojiPickerList';
|
|
16
16
|
const styles = {
|
|
17
17
|
commonCategory: "_2rko12b0 _v564h5h4 _189eidpf _bfhksm61 _ca0qze3t _n3tdze3t _19bvze3t _u5f3ze3t",
|
|
18
|
-
commonCategoryNew: "_v564h5h4 _189eidpf _bfhksm61
|
|
18
|
+
commonCategoryNew: "_v564h5h4 _189eidpf _bfhksm61 _ca0qu2gc _n3tdu2gc _19bv12x7 _u5f312x7 _1e0c1txw _4cvr1h6o _1bah1h6o",
|
|
19
19
|
defaultCategory: "_syaz1rpy _30l36x5g",
|
|
20
20
|
defaultCategoryNew: "_syaz1rpy _1doc1dm9 _1il9nqa1 _1o3i1j28 _30l31rpy _1jc41ihb",
|
|
21
21
|
activeCategory: "_syaz6x5g _30l36x5g",
|
|
@@ -27,11 +27,12 @@ const categorySelectorNew = null;
|
|
|
27
27
|
const categorySelectorTablist = null;
|
|
28
28
|
const categorySelectorTablistNew = null;
|
|
29
29
|
export const sortCategories = (c1, c2) => CategoryDescriptionMap[c1].order - CategoryDescriptionMap[c2].order;
|
|
30
|
+
export const sortCategoriesNew = (c1, c2) => CategoryDescriptionMapNew[c1].order - CategoryDescriptionMapNew[c2].order;
|
|
30
31
|
const addNewCategories = (oldCategories, newCategories) => {
|
|
31
32
|
if (!newCategories) {
|
|
32
33
|
return oldCategories;
|
|
33
34
|
}
|
|
34
|
-
return oldCategories.concat(newCategories.filter(category => !!(fg('platform_emoji_picker_refresh') ? CategoryDescriptionMapNew : CategoryDescriptionMap)[category])).sort(sortCategories);
|
|
35
|
+
return oldCategories.concat(newCategories.filter(category => !!(fg('platform_emoji_picker_refresh') ? CategoryDescriptionMapNew : CategoryDescriptionMap)[category])).sort(fg('platform_emoji_picker_refresh') ? sortCategoriesNew : sortCategories);
|
|
35
36
|
};
|
|
36
37
|
export const categorySelectorComponentTestId = 'category-selector-component';
|
|
37
38
|
export const categorySelectorCategoryTestId = categoryId => `category-selector-${categoryId}`;
|
|
@@ -87,6 +87,11 @@ const EmojiPickerComponent = ({
|
|
|
87
87
|
setSelectedEmoji(emoji);
|
|
88
88
|
}
|
|
89
89
|
}, [selectedEmoji]);
|
|
90
|
+
const onEmojiLeave = useCallback(() => {
|
|
91
|
+
if (fg('platform_emoji_picker_refresh')) {
|
|
92
|
+
setSelectedEmoji(undefined);
|
|
93
|
+
}
|
|
94
|
+
}, []);
|
|
90
95
|
const onCategoryActivated = useCallback(category => {
|
|
91
96
|
// Ignore scroll-driven category changes while a programmatic reveal()
|
|
92
97
|
// scroll is in progress — they would flicker the indicator through
|
|
@@ -447,7 +452,7 @@ const EmojiPickerComponent = ({
|
|
|
447
452
|
emojiProvider.unsubscribe(onProviderChange);
|
|
448
453
|
};
|
|
449
454
|
}, [emojiProvider, onProviderChange]);
|
|
450
|
-
const showPreview = selectedEmoji && !uploading;
|
|
455
|
+
const showPreview = fg('platform_emoji_picker_refresh') ? !uploading : selectedEmoji && !uploading;
|
|
451
456
|
if (fg('platform_no_noninteractive_emojis_reactions')) {
|
|
452
457
|
return /*#__PURE__*/React.createElement("div", {
|
|
453
458
|
ref: onPickerRef,
|
|
@@ -472,6 +477,7 @@ const EmojiPickerComponent = ({
|
|
|
472
477
|
currentUser: currentUser,
|
|
473
478
|
onEmojiSelected: recordUsageOnSelection,
|
|
474
479
|
onEmojiActive: onEmojiActive,
|
|
480
|
+
onEmojiLeave: onEmojiLeave,
|
|
475
481
|
onEmojiDelete: onTriggerDelete,
|
|
476
482
|
onCategoryActivated: onCategoryActivated,
|
|
477
483
|
onSearch: onSearch,
|
|
@@ -496,7 +502,9 @@ const EmojiPickerComponent = ({
|
|
|
496
502
|
size: size,
|
|
497
503
|
activeCategoryId: activeCategory
|
|
498
504
|
}), showPreview && /*#__PURE__*/React.createElement(EmojiPickerFooter, {
|
|
499
|
-
selectedEmoji: selectedEmoji
|
|
505
|
+
selectedEmoji: selectedEmoji,
|
|
506
|
+
uploadEnabled: isUploadSupported && !uploading,
|
|
507
|
+
onOpenUpload: onOpenUpload
|
|
500
508
|
})));
|
|
501
509
|
}
|
|
502
510
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -519,6 +527,7 @@ const EmojiPickerComponent = ({
|
|
|
519
527
|
currentUser: currentUser,
|
|
520
528
|
onEmojiSelected: recordUsageOnSelection,
|
|
521
529
|
onEmojiActive: onEmojiActive,
|
|
530
|
+
onEmojiLeave: onEmojiLeave,
|
|
522
531
|
onEmojiDelete: onTriggerDelete,
|
|
523
532
|
onCategoryActivated: onCategoryActivated,
|
|
524
533
|
onSearch: onSearch,
|
|
@@ -543,7 +552,9 @@ const EmojiPickerComponent = ({
|
|
|
543
552
|
size: size,
|
|
544
553
|
activeCategoryId: activeCategory
|
|
545
554
|
}), showPreview && /*#__PURE__*/React.createElement(EmojiPickerFooter, {
|
|
546
|
-
selectedEmoji: selectedEmoji
|
|
555
|
+
selectedEmoji: selectedEmoji,
|
|
556
|
+
uploadEnabled: isUploadSupported && !uploading,
|
|
557
|
+
onOpenUpload: onOpenUpload
|
|
547
558
|
}));
|
|
548
559
|
};
|
|
549
560
|
const _default_1 = /*#__PURE__*/memo(EmojiPickerComponent);
|
|
@@ -13,6 +13,7 @@ const EmojiPickerEmojiRow = ({
|
|
|
13
13
|
emojis,
|
|
14
14
|
onSelected,
|
|
15
15
|
onMouseMove,
|
|
16
|
+
onMouseLeave,
|
|
16
17
|
onFocus,
|
|
17
18
|
title,
|
|
18
19
|
showDelete,
|
|
@@ -49,6 +50,9 @@ const EmojiPickerEmojiRow = ({
|
|
|
49
50
|
role: "gridcell",
|
|
50
51
|
"aria-colindex": index + 1 // aria-colindex is 1 based
|
|
51
52
|
,
|
|
53
|
+
onMouseLeave: onMouseLeave,
|
|
54
|
+
onBlur: onMouseLeave,
|
|
55
|
+
tabIndex: 0,
|
|
52
56
|
className: ax(["_1e0c1o8l _y3gn1h6o _1bsb1ylp _1wcg1qi0 _1678tlke _7b50u2gc _1rf4u2gc _b4kiu2gc _bm9mu2gc _1lvc1tcg _1cf71tcg _8vlfze3t _1909ze3t _1tcfze3t _n7xcze3t _4ubfu2gc _18x3u2gc _fw9su2gc _29jju2gc _qpkw1tcg _elsp1tcg _vtzrze3t _w2q0ze3t _o5kcze3t _1mc3ze3t _115ch2mm _yrst1ssb _85ft1ssb _5mfndbra _1k8z1tcg _17dz1tcg _zdyf1ule _1mn81tcg _u5ah1tcg"])
|
|
53
57
|
}, /*#__PURE__*/React.createElement(CachingEmoji, {
|
|
54
58
|
emoji: emoji,
|
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
|
|
2
|
-
._x3do1uh4{border-top:var(--ds-border-width-selected,2px) solid var(--ds-border,#0b120e24)}
|
|
2
|
+
._x3do1uh4{border-top:var(--ds-border-width-selected,2px) solid var(--ds-border,#0b120e24)}
|
|
3
|
+
._x3doia51{border-top:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._16jlidpf{flex-grow:0}
|
|
3
4
|
._16qsvjqj{box-shadow:0 -1px 1px 0 var(--ds-border,#0b120e24)}
|
|
5
|
+
._19bvv77o{padding-left:var(--ds-space-025,2px)}
|
|
4
6
|
._1o9zidpf{flex-shrink:0}
|
|
5
|
-
.
|
|
7
|
+
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
8
|
+
._i0dl1wug{flex-basis:auto}
|
|
9
|
+
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
10
|
+
._u5f3v77o{padding-right:var(--ds-space-025,2px)}
|
|
@@ -3,17 +3,41 @@ import "./EmojiPickerFooter.compiled.css";
|
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import { ax, ix } from "@compiled/react/runtime";
|
|
5
5
|
import { memo } from 'react';
|
|
6
|
+
import { useIntl } from 'react-intl';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
|
+
import { Box } from '@atlaskit/primitives/compiled';
|
|
6
9
|
import { EmojiPreviewComponent } from '../common/EmojiPreviewComponent';
|
|
10
|
+
import { AddOwnEmoji } from '../common/AddEmoji';
|
|
7
11
|
const emojiPickerFooter = null;
|
|
8
12
|
const emojiPickerFooterWithTopShadow = null;
|
|
13
|
+
const emojiPickerFooterWithTopShadowNew = null;
|
|
14
|
+
const emojiPreviewContainerStyles = {
|
|
15
|
+
emojiPreviewContainer: "_ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o"
|
|
16
|
+
};
|
|
9
17
|
export const emojiPickerFooterTestId = 'emoji-picker-footer';
|
|
10
18
|
const EmojiPickerFooter = ({
|
|
11
|
-
selectedEmoji
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
selectedEmoji,
|
|
20
|
+
onOpenUpload,
|
|
21
|
+
uploadEnabled
|
|
22
|
+
}) => {
|
|
23
|
+
const intl = useIntl();
|
|
24
|
+
return fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
25
|
+
"data-testid": emojiPickerFooterTestId,
|
|
26
|
+
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug", "_x3doia51"])
|
|
27
|
+
}, selectedEmoji ? /*#__PURE__*/React.createElement(Box, {
|
|
28
|
+
xcss: emojiPreviewContainerStyles.emojiPreviewContainer
|
|
29
|
+
}, /*#__PURE__*/React.createElement(EmojiPreviewComponent, {
|
|
30
|
+
emoji: selectedEmoji
|
|
31
|
+
})) : /*#__PURE__*/React.createElement(AddOwnEmoji, {
|
|
32
|
+
onOpenUpload: onOpenUpload,
|
|
33
|
+
uploadEnabled: uploadEnabled,
|
|
34
|
+
intl: intl
|
|
35
|
+
})) : /*#__PURE__*/React.createElement("div", {
|
|
36
|
+
"data-testid": emojiPickerFooterTestId,
|
|
37
|
+
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug", "_x3do1uh4 _16qsvjqj"])
|
|
38
|
+
}, selectedEmoji && /*#__PURE__*/React.createElement(EmojiPreviewComponent, {
|
|
39
|
+
emoji: selectedEmoji
|
|
40
|
+
}));
|
|
41
|
+
};
|
|
18
42
|
const _default_1 = /*#__PURE__*/memo(EmojiPickerFooter);
|
|
19
43
|
export default _default_1;
|
|
@@ -28,6 +28,7 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
28
28
|
currentUser,
|
|
29
29
|
onEmojiSelected = () => {},
|
|
30
30
|
onEmojiActive = () => {},
|
|
31
|
+
onEmojiLeave,
|
|
31
32
|
onEmojiDelete = () => {},
|
|
32
33
|
onCategoryActivated = () => {},
|
|
33
34
|
onSearch = () => {},
|
|
@@ -138,11 +139,12 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
138
139
|
onSelected: onEmojiSelected,
|
|
139
140
|
onDelete: onEmojiDelete,
|
|
140
141
|
onMouseMove: onEmojiActive,
|
|
141
|
-
onFocus: onEmojiActive
|
|
142
|
+
onFocus: onEmojiActive,
|
|
143
|
+
onMouseLeave: fg('platform_emoji_picker_refresh') ? onEmojiLeave : undefined
|
|
142
144
|
}));
|
|
143
145
|
}
|
|
144
146
|
return items;
|
|
145
|
-
}, [onEmojiSelected, onEmojiDelete, onEmojiActive]);
|
|
147
|
+
}, [onEmojiSelected, onEmojiDelete, onEmojiActive, onEmojiLeave]);
|
|
146
148
|
const buildVirtualItems = useCallback(() => {
|
|
147
149
|
let items = [];
|
|
148
150
|
const prevFirstCategory = categoryTracker.getFirstCategory();
|
|
@@ -291,7 +293,9 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
291
293
|
}
|
|
292
294
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
293
295
|
}, [virtualItems, categoriesChanged]);
|
|
294
|
-
const virtualListHeight = useMemo(() =>
|
|
296
|
+
const virtualListHeight = useMemo(() => {
|
|
297
|
+
return fg('platform_emoji_picker_refresh') ? sizes.listHeightNew + emojiPickerHeightOffset(size) : sizes.listHeight + emojiPickerHeightOffset(size);
|
|
298
|
+
}, [size]);
|
|
295
299
|
return /*#__PURE__*/React.createElement(EmojiPickerTabPanel, {
|
|
296
300
|
showSearchResults: !!query
|
|
297
301
|
}, /*#__PURE__*/React.createElement(EmojiActions, {
|
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
._11c8fhey{font:var(--ds-font-body,normal 400 14px/20px "Atlassian Sans",ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._n6341l7x [data-ds--text-field--container]{border-color:var(--ds-border,#0b120e24)}
|
|
2
3
|
._12ji1r31{outline-color:currentColor}
|
|
3
4
|
._12y31o36{outline-width:medium}
|
|
4
5
|
._13xeglyw:invalid{box-shadow:none}
|
|
5
6
|
._18u01i6y{margin-left:var(--ds-space-negative-025,-2px)}
|
|
7
|
+
._18z11b66 [data-ds--text-field--container]{padding-top:var(--ds-space-050,4px)}
|
|
6
8
|
._19bvutpp{padding-left:var(--ds-space-150,9pt)}
|
|
7
9
|
._1bsb1osq{width:100%}
|
|
8
10
|
._1e0cglyw{display:none}
|
|
9
11
|
._1goxglyw::-ms-clear{display:none}
|
|
10
12
|
._1q51t94y{padding-block-start:1px}
|
|
13
|
+
._1q51yh40{padding-block-start:2px}
|
|
11
14
|
._1qu2glyw{outline-style:none}
|
|
12
15
|
._3um015vq{visibility:hidden}
|
|
13
16
|
._80om1kw7{cursor:inherit}
|
|
@@ -15,6 +18,7 @@
|
|
|
15
18
|
._bozg12x7{padding-inline-start:var(--ds-space-075,6px)}
|
|
16
19
|
._ca0qutpp{padding-top:var(--ds-space-150,9pt)}
|
|
17
20
|
._n3tdutpp{padding-bottom:var(--ds-space-150,9pt)}
|
|
21
|
+
._otyr1i6y{margin-bottom:var(--ds-space-negative-025,-2px)}
|
|
18
22
|
._syaz1kw7{color:inherit}
|
|
19
23
|
._tzy4105o{opacity:.5}
|
|
20
24
|
._tzy4idpf{opacity:0}
|
|
@@ -4,14 +4,18 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
4
4
|
import SearchIcon from '@atlaskit/icon/core/search';
|
|
5
5
|
import TextField from '@atlaskit/textfield';
|
|
6
6
|
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
7
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
7
8
|
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
8
9
|
import { useIntl } from 'react-intl';
|
|
9
10
|
import { useDebouncedCallback } from 'use-debounce';
|
|
10
11
|
import { EMOJI_SEARCH_DEBOUNCE } from '../../util/constants';
|
|
11
12
|
import { messages } from '../i18n';
|
|
12
13
|
const input = null;
|
|
14
|
+
const inputNew = null;
|
|
15
|
+
const textFieldWrapperNew = null;
|
|
13
16
|
const pickerSearch = null;
|
|
14
17
|
const searchIcon = null;
|
|
18
|
+
const searchIconNew = null;
|
|
15
19
|
const hidden = null;
|
|
16
20
|
export const emojiPickerSearchTestId = 'emoji-picker-search';
|
|
17
21
|
export const EmojiPickerListSearch = props => {
|
|
@@ -54,7 +58,28 @@ export const EmojiPickerListSearch = props => {
|
|
|
54
58
|
role: "status"
|
|
55
59
|
}, dirty ? query === '' ? formatMessage(messages.searchResultsStatusSeeAll) : formatMessage(messages.searchResultsStatus, {
|
|
56
60
|
count: resultsCount
|
|
57
|
-
}) : null), /*#__PURE__*/React.createElement(
|
|
61
|
+
}) : null), fg('platform_emoji_picker_refresh') ? /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
className: ax(["_n6341l7x _18z11b66"])
|
|
63
|
+
}, /*#__PURE__*/React.createElement(TextField, {
|
|
64
|
+
role: "searchbox",
|
|
65
|
+
"aria-label": formatMessage(messages.searchLabel),
|
|
66
|
+
autoComplete: "off",
|
|
67
|
+
name: "search",
|
|
68
|
+
placeholder: `${formatMessage(messages.searchPlaceholder)}...`,
|
|
69
|
+
defaultValue: query || '',
|
|
70
|
+
onChange: handleOnChange,
|
|
71
|
+
elemBeforeInput: /*#__PURE__*/React.createElement("span", {
|
|
72
|
+
className: ax(["_tzy4105o _18u01i6y _otyr1i6y"])
|
|
73
|
+
}, /*#__PURE__*/React.createElement(SearchIcon, {
|
|
74
|
+
color: "currentColor",
|
|
75
|
+
spacing: "spacious",
|
|
76
|
+
label: ""
|
|
77
|
+
})),
|
|
78
|
+
testId: emojiPickerSearchTestId,
|
|
79
|
+
ref: textRef,
|
|
80
|
+
isCompact: true,
|
|
81
|
+
className: ax(["_11c8fhey _12ji1r31 _1qu2glyw _12y31o36 _vchhusvi _syaz1kw7 _80om1kw7 _1q51yh40 _y4tize3t _85i5v77o _bozg12x7 _1bsb1osq _13xeglyw _1goxglyw"])
|
|
82
|
+
})) : /*#__PURE__*/React.createElement(TextField, {
|
|
58
83
|
role: "searchbox",
|
|
59
84
|
"aria-label": formatMessage(messages.searchLabel),
|
|
60
85
|
autoComplete: "off",
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { emojiPickerListHeight, emojiPickerWidth } from '../../util/constants';
|
|
1
|
+
import { emojiPickerListHeight, emojiPickerListHeightNew, emojiPickerWidth } from '../../util/constants';
|
|
2
2
|
export const sizes = {
|
|
3
3
|
listHeight: emojiPickerListHeight,
|
|
4
|
+
listHeightNew: emojiPickerListHeightNew,
|
|
4
5
|
listWidth: emojiPickerWidth,
|
|
5
6
|
searchHeight: 52,
|
|
6
7
|
// 32px height + 10px padding top/bottom
|
|
@@ -106,58 +106,58 @@ export const CategoryDescriptionMapNew = {
|
|
|
106
106
|
icon: ClockIcon,
|
|
107
107
|
order: 1
|
|
108
108
|
},
|
|
109
|
+
ATLASSIAN: {
|
|
110
|
+
id: 'ATLASSIAN',
|
|
111
|
+
name: 'productivityCategory',
|
|
112
|
+
icon: CheckCircleIcon,
|
|
113
|
+
order: 2
|
|
114
|
+
},
|
|
109
115
|
PEOPLE: {
|
|
110
116
|
id: 'PEOPLE',
|
|
111
117
|
name: 'peopleCategory',
|
|
112
118
|
icon: EmojiIcon,
|
|
113
|
-
order:
|
|
119
|
+
order: 3
|
|
114
120
|
},
|
|
115
121
|
NATURE: {
|
|
116
122
|
id: 'NATURE',
|
|
117
123
|
name: 'natureCategory',
|
|
118
124
|
icon: TreeIcon,
|
|
119
|
-
order:
|
|
125
|
+
order: 4
|
|
120
126
|
},
|
|
121
127
|
FOODS: {
|
|
122
128
|
id: 'FOODS',
|
|
123
129
|
name: 'foodsCategory',
|
|
124
130
|
icon: TakeoutFoodIcon,
|
|
125
|
-
order:
|
|
131
|
+
order: 5
|
|
126
132
|
},
|
|
127
133
|
ACTIVITY: {
|
|
128
134
|
id: 'ACTIVITY',
|
|
129
135
|
name: 'activityCategory',
|
|
130
136
|
icon: BasketballIcon,
|
|
131
|
-
order:
|
|
137
|
+
order: 6
|
|
132
138
|
},
|
|
133
139
|
PLACES: {
|
|
134
140
|
id: 'PLACES',
|
|
135
141
|
name: 'placesCategory',
|
|
136
142
|
icon: VehicleCarIcon,
|
|
137
|
-
order:
|
|
143
|
+
order: 7
|
|
138
144
|
},
|
|
139
145
|
OBJECTS: {
|
|
140
146
|
id: 'OBJECTS',
|
|
141
147
|
name: 'objectsCategory',
|
|
142
148
|
icon: LightbulbIcon,
|
|
143
|
-
order:
|
|
149
|
+
order: 8
|
|
144
150
|
},
|
|
145
151
|
SYMBOLS: {
|
|
146
152
|
id: 'SYMBOLS',
|
|
147
153
|
name: 'symbolsCategory',
|
|
148
154
|
icon: HeartIcon,
|
|
149
|
-
order:
|
|
155
|
+
order: 9
|
|
150
156
|
},
|
|
151
157
|
FLAGS: {
|
|
152
158
|
id: 'FLAGS',
|
|
153
159
|
name: 'flagsCategory',
|
|
154
160
|
icon: FlagIcon,
|
|
155
|
-
order: 9
|
|
156
|
-
},
|
|
157
|
-
ATLASSIAN: {
|
|
158
|
-
id: 'ATLASSIAN',
|
|
159
|
-
name: 'productivityCategory',
|
|
160
|
-
icon: CheckCircleIcon,
|
|
161
161
|
order: 10
|
|
162
162
|
},
|
|
163
163
|
USER_CUSTOM: {
|
|
@@ -30,6 +30,7 @@ export const defaultEmojiPickerSize = 'medium';
|
|
|
30
30
|
export const emojiPickerMinHeight = 260;
|
|
31
31
|
export const emojiPickerHeight = 295;
|
|
32
32
|
export const emojiPickerListHeight = emojiPickerHeight - 58; // picker height - actions height
|
|
33
|
+
export const emojiPickerListHeightNew = emojiPickerHeight - 102; // picker height - actions height - preview height
|
|
33
34
|
|
|
34
35
|
export const emojiPickerPreviewHeight = 54;
|
|
35
36
|
export const emojiPickerHeightWithPreview = emojiPickerHeight + emojiPickerPreviewHeight;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/* AddEmoji.tsx generated by @compiled/babel-plugin v0.39.1 */
|
|
2
|
+
import "./AddEmoji.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { Fragment } from 'react';
|
|
6
|
+
import { FormattedMessage } from 'react-intl';
|
|
7
|
+
import { messages } from '../i18n';
|
|
8
|
+
import Button from '@atlaskit/button/new';
|
|
9
|
+
export var emojiActionsTestId = 'emoji-actions';
|
|
10
|
+
export var uploadEmojiTestId = 'upload-emoji';
|
|
11
|
+
var addCustomEmoji = null;
|
|
12
|
+
|
|
13
|
+
// Generic Type for the wrapped functional component
|
|
14
|
+
|
|
15
|
+
export var AddOwnEmoji = function AddOwnEmoji(props) {
|
|
16
|
+
var onOpenUpload = props.onOpenUpload,
|
|
17
|
+
uploadEnabled = props.uploadEnabled;
|
|
18
|
+
return /*#__PURE__*/React.createElement(Fragment, null, uploadEnabled && /*#__PURE__*/React.createElement("div", {
|
|
19
|
+
"data-testid": uploadEmojiTestId,
|
|
20
|
+
className: ax(["_1wpz1h6o _19pkutpp _2hwxutpp _otyrutpp _18u0utpp"])
|
|
21
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.addCustomEmojiLabel, function (label) {
|
|
22
|
+
return /*#__PURE__*/React.createElement(Button, {
|
|
23
|
+
onClick: onOpenUpload,
|
|
24
|
+
tabIndex: 0,
|
|
25
|
+
id: "add-custom-emoji"
|
|
26
|
+
}, label);
|
|
27
|
+
})));
|
|
28
|
+
};
|