@atlaskit/emoji 73.3.2 → 73.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/dist/cjs/api/EmojiRepository.js +1 -7
- package/dist/cjs/api/EmojiResource.js +1 -3
- package/dist/cjs/components/common/DeleteButton.js +2 -8
- package/dist/cjs/components/common/EmojiActions.compiled.css +1 -3
- package/dist/cjs/components/common/EmojiActions.js +6 -45
- package/dist/cjs/components/common/EmojiDeletePreview.compiled.css +1 -16
- package/dist/cjs/components/common/EmojiDeletePreview.js +17 -65
- package/dist/cjs/components/common/EmojiErrorMessage.js +2 -9
- package/dist/cjs/components/common/EmojiRadioButton.js +3 -4
- package/dist/cjs/components/common/EmojiUploadPicker.compiled.css +1 -14
- package/dist/cjs/components/common/EmojiUploadPicker.js +7 -90
- package/dist/cjs/components/common/FileChooser.js +15 -25
- package/dist/cjs/components/common/TonePreviewButton.compiled.css +1 -2
- package/dist/cjs/components/common/TonePreviewButton.js +2 -23
- package/dist/cjs/components/common/ToneSelectorInternal.js +1 -10
- package/dist/cjs/components/picker/CategorySelector.compiled.css +0 -6
- package/dist/cjs/components/picker/CategorySelector.js +5 -44
- package/dist/cjs/components/picker/EmojiPickerComponent.compiled.css +1 -2
- package/dist/cjs/components/picker/EmojiPickerComponent.js +38 -57
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +1 -2
- package/dist/cjs/components/picker/EmojiPickerFooter.compiled.css +0 -2
- package/dist/cjs/components/picker/EmojiPickerFooter.js +1 -8
- package/dist/cjs/components/picker/EmojiPickerInternal.compiled.css +1 -2
- package/dist/cjs/components/picker/EmojiPickerInternal.js +1 -9
- package/dist/cjs/components/picker/EmojiPickerList.js +30 -36
- package/dist/cjs/components/picker/EmojiPickerListSearch.compiled.css +0 -1
- package/dist/cjs/components/picker/EmojiPickerListSearch.js +2 -24
- package/dist/cjs/components/picker/EmojiPickerSizes.js +0 -1
- package/dist/cjs/components/picker/VirtualList.js +2 -3
- package/dist/cjs/components/picker/categories.js +1 -84
- package/dist/cjs/components/uploader/EmojiUploadComponent.js +0 -2
- package/dist/cjs/util/analytics/createEvent.js +1 -1
- package/dist/cjs/util/constants.js +1 -2
- package/dist/es2019/api/EmojiRepository.js +1 -7
- package/dist/es2019/api/EmojiResource.js +1 -3
- package/dist/es2019/components/common/DeleteButton.js +2 -8
- package/dist/es2019/components/common/EmojiActions.compiled.css +1 -3
- package/dist/es2019/components/common/EmojiActions.js +6 -45
- package/dist/es2019/components/common/EmojiDeletePreview.compiled.css +1 -16
- package/dist/es2019/components/common/EmojiDeletePreview.js +17 -65
- package/dist/es2019/components/common/EmojiErrorMessage.js +2 -9
- package/dist/es2019/components/common/EmojiRadioButton.js +2 -3
- package/dist/es2019/components/common/EmojiUploadPicker.compiled.css +1 -14
- package/dist/es2019/components/common/EmojiUploadPicker.js +7 -87
- package/dist/es2019/components/common/FileChooser.js +15 -25
- package/dist/es2019/components/common/TonePreviewButton.compiled.css +1 -2
- package/dist/es2019/components/common/TonePreviewButton.js +2 -23
- package/dist/es2019/components/common/ToneSelectorInternal.js +1 -10
- package/dist/es2019/components/picker/CategorySelector.compiled.css +0 -6
- package/dist/es2019/components/picker/CategorySelector.js +5 -44
- package/dist/es2019/components/picker/EmojiPickerComponent.compiled.css +1 -2
- package/dist/es2019/components/picker/EmojiPickerComponent.js +44 -61
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +1 -2
- package/dist/es2019/components/picker/EmojiPickerFooter.compiled.css +0 -2
- package/dist/es2019/components/picker/EmojiPickerFooter.js +1 -8
- package/dist/es2019/components/picker/EmojiPickerInternal.compiled.css +1 -2
- package/dist/es2019/components/picker/EmojiPickerInternal.js +1 -9
- package/dist/es2019/components/picker/EmojiPickerList.js +29 -35
- package/dist/es2019/components/picker/EmojiPickerListSearch.compiled.css +0 -1
- package/dist/es2019/components/picker/EmojiPickerListSearch.js +2 -24
- package/dist/es2019/components/picker/EmojiPickerSizes.js +1 -2
- package/dist/es2019/components/picker/VirtualList.js +2 -3
- package/dist/es2019/components/picker/categories.js +0 -83
- package/dist/es2019/components/uploader/EmojiUploadComponent.js +0 -2
- package/dist/es2019/util/analytics/createEvent.js +1 -1
- package/dist/es2019/util/constants.js +0 -1
- package/dist/esm/api/EmojiRepository.js +1 -7
- package/dist/esm/api/EmojiResource.js +1 -3
- package/dist/esm/components/common/DeleteButton.js +2 -8
- package/dist/esm/components/common/EmojiActions.compiled.css +1 -3
- package/dist/esm/components/common/EmojiActions.js +6 -45
- package/dist/esm/components/common/EmojiDeletePreview.compiled.css +1 -16
- package/dist/esm/components/common/EmojiDeletePreview.js +17 -65
- package/dist/esm/components/common/EmojiErrorMessage.js +2 -9
- package/dist/esm/components/common/EmojiRadioButton.js +3 -4
- package/dist/esm/components/common/EmojiUploadPicker.compiled.css +1 -14
- package/dist/esm/components/common/EmojiUploadPicker.js +7 -90
- package/dist/esm/components/common/FileChooser.js +15 -25
- package/dist/esm/components/common/TonePreviewButton.compiled.css +1 -2
- package/dist/esm/components/common/TonePreviewButton.js +2 -23
- package/dist/esm/components/common/ToneSelectorInternal.js +1 -10
- package/dist/esm/components/picker/CategorySelector.compiled.css +0 -6
- package/dist/esm/components/picker/CategorySelector.js +6 -45
- package/dist/esm/components/picker/EmojiPickerComponent.compiled.css +1 -2
- package/dist/esm/components/picker/EmojiPickerComponent.js +39 -58
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +1 -2
- package/dist/esm/components/picker/EmojiPickerFooter.compiled.css +0 -2
- package/dist/esm/components/picker/EmojiPickerFooter.js +1 -8
- package/dist/esm/components/picker/EmojiPickerInternal.compiled.css +1 -2
- package/dist/esm/components/picker/EmojiPickerInternal.js +1 -9
- package/dist/esm/components/picker/EmojiPickerList.js +31 -37
- package/dist/esm/components/picker/EmojiPickerListSearch.compiled.css +0 -1
- package/dist/esm/components/picker/EmojiPickerListSearch.js +2 -24
- package/dist/esm/components/picker/EmojiPickerSizes.js +1 -2
- package/dist/esm/components/picker/VirtualList.js +2 -3
- package/dist/esm/components/picker/categories.js +0 -83
- package/dist/esm/components/uploader/EmojiUploadComponent.js +0 -2
- package/dist/esm/util/analytics/createEvent.js +1 -1
- package/dist/esm/util/constants.js +0 -1
- package/dist/types/components/common/EmojiUploadPicker.d.ts +0 -1
- package/dist/types/components/picker/EmojiPickerSizes.d.ts +0 -1
- package/dist/types/components/picker/categories.d.ts +0 -1
- package/dist/types/components/uploader/EmojiUploadComponent.d.ts +0 -1
- package/dist/types/components/uploader/EmojiUploader.d.ts +0 -1
- package/dist/types/util/constants.d.ts +0 -1
- package/package.json +2 -15
- package/dist/cjs/components/common/AddOwnEmoji.compiled.css +0 -6
- package/dist/cjs/components/common/AddOwnEmoji.js +0 -58
- package/dist/cjs/components/common/EmojiUploadPreview.compiled.css +0 -19
- package/dist/cjs/components/common/EmojiUploadPreview.js +0 -119
- package/dist/cjs/components/common/isRefreshEmojiPickerEnabled.js +0 -10
- package/dist/cjs/components/picker/sortCategories.js +0 -15
- package/dist/cjs/util/teamoji26RefreshEmojiPicker.js +0 -19
- package/dist/es2019/components/common/AddOwnEmoji.compiled.css +0 -6
- package/dist/es2019/components/common/AddOwnEmoji.js +0 -49
- package/dist/es2019/components/common/EmojiUploadPreview.compiled.css +0 -19
- package/dist/es2019/components/common/EmojiUploadPreview.js +0 -100
- package/dist/es2019/components/common/isRefreshEmojiPickerEnabled.js +0 -4
- package/dist/es2019/components/picker/sortCategories.js +0 -7
- package/dist/es2019/util/teamoji26RefreshEmojiPicker.js +0 -13
- package/dist/esm/components/common/AddOwnEmoji.compiled.css +0 -6
- package/dist/esm/components/common/AddOwnEmoji.js +0 -49
- package/dist/esm/components/common/EmojiUploadPreview.compiled.css +0 -19
- package/dist/esm/components/common/EmojiUploadPreview.js +0 -110
- package/dist/esm/components/common/isRefreshEmojiPickerEnabled.js +0 -4
- package/dist/esm/components/picker/sortCategories.js +0 -9
- package/dist/esm/util/teamoji26RefreshEmojiPicker.js +0 -13
- package/dist/types/components/common/AddOwnEmoji.d.ts +0 -9
- package/dist/types/components/common/EmojiUploadPreview.d.ts +0 -22
- package/dist/types/components/common/isRefreshEmojiPickerEnabled.d.ts +0 -1
- package/dist/types/components/picker/sortCategories.d.ts +0 -6
- package/dist/types/util/teamoji26RefreshEmojiPicker.d.ts +0 -6
|
@@ -38,8 +38,7 @@ import { filterHiddenEmojis } from '../../util/filter-hidden-emojis';
|
|
|
38
38
|
import { getToneEmoji } from '../../util/get-tone-emoji';
|
|
39
39
|
import { isEmojiDescription } from '../../util/is-emoji-description';
|
|
40
40
|
import { isPromise } from '../../util/is-promise';
|
|
41
|
-
import {
|
|
42
|
-
import { isRefreshEmojiPickerEnabled } from '../common/isRefreshEmojiPickerEnabled';
|
|
41
|
+
import { getStoredProductivityColor, storeProductivityColor } from '../../util/productivity-colors';
|
|
43
42
|
import { createRecordSelectionDefault } from '../common/RecordSelectionDefault';
|
|
44
43
|
import { uploadEmoji } from '../common/UploadEmoji';
|
|
45
44
|
import { messages } from '../i18n';
|
|
@@ -55,7 +54,6 @@ const emojiPickerHeightDeleteRefresh = 339;
|
|
|
55
54
|
const emojiPickerWidth = 350;
|
|
56
55
|
const emojiPickerMinHeight = 260;
|
|
57
56
|
const heightOffset = 80;
|
|
58
|
-
const emojiPicker = null;
|
|
59
57
|
const emojiPickerNew = null;
|
|
60
58
|
const emojiPickerWrapper = null;
|
|
61
59
|
|
|
@@ -116,14 +114,13 @@ const EmojiPickerComponent = ({
|
|
|
116
114
|
emojiProvider,
|
|
117
115
|
isUploadSupported
|
|
118
116
|
} = useEmoji();
|
|
119
|
-
const isTeamojiExperimentEnabled = isRefreshEmojiPickerEnabled();
|
|
120
117
|
const [filteredEmojis, setFilteredEmojis] = useState([]);
|
|
121
118
|
const [searchEmojis, setSearchEmojis] = useState([]);
|
|
122
119
|
const [frequentlyUsedEmojis, setFrequentlyUsedEmojis] = useState([]);
|
|
123
120
|
const [query, setQuery] = useState('');
|
|
124
121
|
const [dynamicCategories, setDynamicCategories] = useState([]);
|
|
125
122
|
const [selectedTone, setSelectedTone] = useState(!hideToneSelector ? emojiProvider.getSelectedTone() : undefined);
|
|
126
|
-
const [selectedProductivityColor, setSelectedProductivityColor] = useState(() =>
|
|
123
|
+
const [selectedProductivityColor, setSelectedProductivityColor] = useState(() => getStoredProductivityColor());
|
|
127
124
|
const [loading, setLoading] = useState(true);
|
|
128
125
|
const [uploading, setUploading] = useState(false);
|
|
129
126
|
const [selectedEmoji, setSelectedEmoji] = useState();
|
|
@@ -141,11 +138,9 @@ const EmojiPickerComponent = ({
|
|
|
141
138
|
const isProgrammaticScroll = useRef(false);
|
|
142
139
|
const pickerRef = useRef(null);
|
|
143
140
|
const setPickerRef = useCallback(el => {
|
|
144
|
-
|
|
145
|
-
pickerRef.current = el;
|
|
146
|
-
}
|
|
141
|
+
pickerRef.current = el;
|
|
147
142
|
onPickerRef === null || onPickerRef === void 0 ? void 0 : onPickerRef(el);
|
|
148
|
-
}, [
|
|
143
|
+
}, [onPickerRef]);
|
|
149
144
|
const currentUser = useMemo(() => {
|
|
150
145
|
return emojiProvider.getCurrentUser();
|
|
151
146
|
}, [emojiProvider]);
|
|
@@ -162,7 +157,7 @@ const EmojiPickerComponent = ({
|
|
|
162
157
|
}, [selectedEmoji]);
|
|
163
158
|
const uploadEnabled = isUploadSupported && !uploading;
|
|
164
159
|
const onEmojiLeave = useCallback(() => {
|
|
165
|
-
if (
|
|
160
|
+
if (uploadEnabled) {
|
|
166
161
|
setSelectedEmoji(undefined);
|
|
167
162
|
}
|
|
168
163
|
}, [uploadEnabled]);
|
|
@@ -170,16 +165,16 @@ const EmojiPickerComponent = ({
|
|
|
170
165
|
// Ignore scroll-driven category changes while a programmatic reveal()
|
|
171
166
|
// scroll is in progress — they would flicker the indicator through
|
|
172
167
|
// intermediate categories before landing on the correct one.
|
|
173
|
-
if (isProgrammaticScroll.current
|
|
168
|
+
if (isProgrammaticScroll.current) {
|
|
174
169
|
return;
|
|
175
170
|
}
|
|
176
171
|
// Ignore scroll-driven category changes while the upload or delete screen is open
|
|
177
|
-
if (
|
|
172
|
+
if (uploading || emojiToDelete) {
|
|
178
173
|
return;
|
|
179
174
|
}
|
|
180
175
|
if (activeCategory !== category) {
|
|
181
176
|
setActiveCategory(category);
|
|
182
|
-
if (!query
|
|
177
|
+
if (!query) {
|
|
183
178
|
lastNonSearchCategory.current = category;
|
|
184
179
|
}
|
|
185
180
|
}
|
|
@@ -196,12 +191,10 @@ const EmojiPickerComponent = ({
|
|
|
196
191
|
setUploadErrorMessage(undefined);
|
|
197
192
|
});
|
|
198
193
|
fireAnalytics(uploadCancelButton());
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
}, 0);
|
|
204
|
-
}
|
|
194
|
+
setTimeout(() => {
|
|
195
|
+
var _getDocument, _getDocument$getEleme;
|
|
196
|
+
(_getDocument = getDocument()) === null || _getDocument === void 0 ? void 0 : (_getDocument$getEleme = _getDocument.getElementById('add-custom-emoji')) === null || _getDocument$getEleme === void 0 ? void 0 : _getDocument$getEleme.focus();
|
|
197
|
+
}, 0);
|
|
205
198
|
}, [fireAnalytics]);
|
|
206
199
|
const getDynamicCategories = useCallback(() => {
|
|
207
200
|
if (!emojiProvider.calculateDynamicCategories) {
|
|
@@ -248,7 +241,7 @@ const EmojiPickerComponent = ({
|
|
|
248
241
|
}, [filteredEmojis.length, getDynamicCategories, onDynamicCategoryChange, selectedEmoji]);
|
|
249
242
|
const onFrequentEmojiResult = useCallback(frequentEmoji => {
|
|
250
243
|
// change the category of each of the featured emoji
|
|
251
|
-
const visibleFrequentEmoji =
|
|
244
|
+
const visibleFrequentEmoji = filterHiddenEmojis(frequentEmoji);
|
|
252
245
|
const recategorised = visibleFrequentEmoji.map(emoji => {
|
|
253
246
|
const clone = JSON.parse(JSON.stringify(emoji));
|
|
254
247
|
clone.category = frequentCategory;
|
|
@@ -257,11 +250,11 @@ const EmojiPickerComponent = ({
|
|
|
257
250
|
setStateAfterEmojiChange({
|
|
258
251
|
frequentEmoji: recategorised
|
|
259
252
|
});
|
|
260
|
-
}, [
|
|
253
|
+
}, [setStateAfterEmojiChange]);
|
|
261
254
|
const onSearchResult = useCallback(searchResults => {
|
|
262
255
|
const frequentlyUsedEmoji = frequentlyUsedEmojis || [];
|
|
263
256
|
const searchQuery = searchResults.query || '';
|
|
264
|
-
const visibleSearchEmojis =
|
|
257
|
+
const visibleSearchEmojis = filterHiddenEmojis(searchResults.emojis);
|
|
265
258
|
|
|
266
259
|
/**
|
|
267
260
|
* If there is no user search in the EmojiPicker then it should display all emoji received from the EmojiRepository and should
|
|
@@ -283,7 +276,7 @@ const EmojiPickerComponent = ({
|
|
|
283
276
|
queryLength: searchQuery.length,
|
|
284
277
|
numMatches: visibleSearchEmojis.length
|
|
285
278
|
}));
|
|
286
|
-
}, [frequentlyUsedEmojis,
|
|
279
|
+
}, [frequentlyUsedEmojis, query, setStateAfterEmojiChange, fireAnalytics]);
|
|
287
280
|
const onProviderChange = useMemo(() => {
|
|
288
281
|
return {
|
|
289
282
|
result: onSearchResult
|
|
@@ -346,37 +339,29 @@ const EmojiPickerComponent = ({
|
|
|
346
339
|
if (!categoryId) {
|
|
347
340
|
return;
|
|
348
341
|
}
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
}
|
|
356
|
-
if (emojiToDelete) {
|
|
357
|
-
setEmojiToDelete(undefined);
|
|
358
|
-
}
|
|
342
|
+
if (uploading) {
|
|
343
|
+
setUploading(false);
|
|
344
|
+
setUploadErrorMessage(undefined);
|
|
345
|
+
}
|
|
346
|
+
if (emojiToDelete) {
|
|
347
|
+
setEmojiToDelete(undefined);
|
|
359
348
|
}
|
|
360
349
|
emojiProvider.findInCategory(categoryId).then(emojisInCategory => {
|
|
361
350
|
if (!disableCategories) {
|
|
362
351
|
let newSelectedEmoji;
|
|
363
|
-
const visibleEmojisInCategory =
|
|
352
|
+
const visibleEmojisInCategory = filterHiddenEmojis(emojisInCategory || []);
|
|
364
353
|
if (visibleEmojisInCategory.length > 0) {
|
|
365
354
|
newSelectedEmoji = getEmojiVariation(visibleEmojisInCategory[0], {
|
|
366
355
|
skinTone: selectedTone
|
|
367
356
|
});
|
|
368
357
|
}
|
|
369
358
|
if (emojiPickerList.current) {
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
setTimeout(() => {
|
|
377
|
-
isProgrammaticScroll.current = false;
|
|
378
|
-
}, 300);
|
|
379
|
-
}
|
|
359
|
+
isProgrammaticScroll.current = true;
|
|
360
|
+
emojiPickerList.current.reveal(categoryId, true);
|
|
361
|
+
// Clear the flag after the scroll animation has settled.
|
|
362
|
+
setTimeout(() => {
|
|
363
|
+
isProgrammaticScroll.current = false;
|
|
364
|
+
}, 300);
|
|
380
365
|
}
|
|
381
366
|
batchedUpdates(() => {
|
|
382
367
|
setActiveCategory(categoryId);
|
|
@@ -387,7 +372,7 @@ const EmojiPickerComponent = ({
|
|
|
387
372
|
}));
|
|
388
373
|
}
|
|
389
374
|
});
|
|
390
|
-
}, [disableCategories, emojiPickerList, emojiProvider, fireAnalytics,
|
|
375
|
+
}, [disableCategories, emojiPickerList, emojiProvider, fireAnalytics, selectedTone, uploading, emojiToDelete]);
|
|
391
376
|
const recordUsageOnSelection = useMemo(() => createRecordSelectionDefault(emojiProvider, onSelectWrapper, analytic => fireAnalytics(analytic(SearchSourceTypes.PICKER))), [emojiProvider, fireAnalytics, onSelectWrapper]);
|
|
392
377
|
const formattedErrorMessage = useMemo(() => uploadErrorMessage ? /*#__PURE__*/React.createElement(FormattedMessage, uploadErrorMessage) : null, [uploadErrorMessage]);
|
|
393
378
|
const onFileChooserClicked = useCallback(() => {
|
|
@@ -404,7 +389,7 @@ const EmojiPickerComponent = ({
|
|
|
404
389
|
};
|
|
405
390
|
if (searchQuery !== query) {
|
|
406
391
|
// Capture the active category before entering search so we can keep it highlighted
|
|
407
|
-
if (!query && searchQuery
|
|
392
|
+
if (!query && searchQuery) {
|
|
408
393
|
lastNonSearchCategory.current = activeCategory;
|
|
409
394
|
}
|
|
410
395
|
setQuery(searchQuery);
|
|
@@ -420,7 +405,7 @@ const EmojiPickerComponent = ({
|
|
|
420
405
|
// cannot reach underlying page drop handlers (e.g. the Confluence editor).
|
|
421
406
|
useEffect(() => {
|
|
422
407
|
var _getDocument2;
|
|
423
|
-
if (!uploading
|
|
408
|
+
if (!uploading) {
|
|
424
409
|
return;
|
|
425
410
|
}
|
|
426
411
|
const body = (_getDocument2 = getDocument()) === null || _getDocument2 === void 0 ? void 0 : _getDocument2.body;
|
|
@@ -481,13 +466,11 @@ const EmojiPickerComponent = ({
|
|
|
481
466
|
});
|
|
482
467
|
scrollToUploadedEmoji(emojiDescription);
|
|
483
468
|
};
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
return;
|
|
490
|
-
}
|
|
469
|
+
const uploadShortName = `:${upload.name.toLowerCase()}:`;
|
|
470
|
+
const existing = await emojiProvider.findByShortName(uploadShortName);
|
|
471
|
+
if (existing) {
|
|
472
|
+
errorSetter(messages.emojiDuplicateName);
|
|
473
|
+
return;
|
|
491
474
|
}
|
|
492
475
|
uploadEmoji(upload, emojiProvider, errorSetter, onSuccess, fireAnalytics, retry);
|
|
493
476
|
}, [emojiProvider, fireAnalytics, scrollToUploadedEmoji]);
|
|
@@ -600,9 +583,9 @@ const EmojiPickerComponent = ({
|
|
|
600
583
|
emojiProvider.unsubscribe(onProviderChange);
|
|
601
584
|
};
|
|
602
585
|
}, [emojiProvider, onProviderChange]);
|
|
603
|
-
const showPreview =
|
|
604
|
-
const shouldRenderFooter = showPreview && !
|
|
605
|
-
const useFooterSpaceForList = showPreview && !selectedEmoji && !uploadEnabled && !emojiToDelete && !(query && filteredEmojis.length === 0)
|
|
586
|
+
const showPreview = !uploading;
|
|
587
|
+
const shouldRenderFooter = showPreview && !emojiToDelete && !(query && filteredEmojis.length === 0) && (Boolean(selectedEmoji) || uploadEnabled);
|
|
588
|
+
const useFooterSpaceForList = showPreview && !selectedEmoji && !uploadEnabled && !emojiToDelete && !(query && filteredEmojis.length === 0);
|
|
606
589
|
|
|
607
590
|
// When the AI emoji section is shown in the upload panel, grow the picker so
|
|
608
591
|
// the section isn't clipped by the fixed upload height.
|
|
@@ -613,7 +596,7 @@ const EmojiPickerComponent = ({
|
|
|
613
596
|
role: "dialog",
|
|
614
597
|
"aria-label": formatMessage(messages.emojiPickerTitle),
|
|
615
598
|
"aria-modal": true,
|
|
616
|
-
className: ax([
|
|
599
|
+
className: ax(["_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iaq3k _1bsb1edt _1ul91edt _c71l1y6z _kqswh2mm", !!emojiToDelete ? withDeleteRefreshHeight[size] : uploading ? hasUploadPreviewError ? withUploadRefreshAndPreviewErrorHeight[size] : withUploadRefreshHeight[size] : query && filteredEmojis.length === 0 ? withNoResultsRefreshHeight[size] : showPreview ? withPreviewHeight[size] : withoutPreviewHeight[size], showAiUpload && "_4t3ikbql _c71l8k0t"])
|
|
617
600
|
}, /*#__PURE__*/React.createElement("div", {
|
|
618
601
|
role: "presentation",
|
|
619
602
|
onKeyPress: suppressKeyPress,
|
|
@@ -621,7 +604,7 @@ const EmojiPickerComponent = ({
|
|
|
621
604
|
onKeyDown: suppressKeyPress,
|
|
622
605
|
className: ax(["_16jlkb7n _1o9zkb7n _i0dlf1ug _1reo15vq _18m915vq _1e0c1txw _2lx21bp4 _1bah1yb4 _1tkeidpf", showAiUpload && "_1reo15vq _18m91wug"])
|
|
623
606
|
}, /*#__PURE__*/React.createElement(CategorySelector, {
|
|
624
|
-
activeCategoryId:
|
|
607
|
+
activeCategoryId: uploading || emojiToDelete ? null : activeCategory,
|
|
625
608
|
dynamicCategories: dynamicCategories,
|
|
626
609
|
disableCategories: disableCategories,
|
|
627
610
|
onCategorySelected: onCategorySelected
|
|
@@ -636,13 +619,13 @@ const EmojiPickerComponent = ({
|
|
|
636
619
|
onSearch: onSearch,
|
|
637
620
|
query: query,
|
|
638
621
|
selectedTone: selectedTone,
|
|
639
|
-
selectedProductivityColor:
|
|
622
|
+
selectedProductivityColor: selectedProductivityColor,
|
|
640
623
|
loading: loading,
|
|
641
624
|
ref: emojiPickerList,
|
|
642
625
|
initialUploadName: query,
|
|
643
626
|
onToneSelected: onToneSelected,
|
|
644
627
|
onToneSelectorCancelled: onToneSelectorCancelled,
|
|
645
|
-
onProductivityColorSelected:
|
|
628
|
+
onProductivityColorSelected: onProductivityColorSelected,
|
|
646
629
|
toneEmoji: toneEmoji,
|
|
647
630
|
uploading: uploading,
|
|
648
631
|
emojiToDelete: emojiToDelete,
|
|
@@ -5,7 +5,6 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
5
5
|
import { memo } from 'react';
|
|
6
6
|
import { useIntl } from 'react-intl';
|
|
7
7
|
import { useEmojiPickerListContext } from '../../hooks/useEmojiPickerListContext';
|
|
8
|
-
import { isTeamoji26RefreshEmojiPickerEnabledNoExposure } from '../../util/teamoji26RefreshEmojiPicker';
|
|
9
8
|
import CachingEmoji from '../common/CachingEmoji';
|
|
10
9
|
import { messages } from '../i18n';
|
|
11
10
|
const emojiItem = null;
|
|
@@ -29,7 +28,7 @@ const EmojiPickerEmojiRow = ({
|
|
|
29
28
|
const {
|
|
30
29
|
formatMessage
|
|
31
30
|
} = useIntl();
|
|
32
|
-
const preventFocusOnMouseDown =
|
|
31
|
+
const preventFocusOnMouseDown = true;
|
|
33
32
|
const handleFocus = index => (emojiId, emoji, event) => {
|
|
34
33
|
setEmojisFocus({
|
|
35
34
|
rowIndex,
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
._x3do1uh4{border-top:var(--ds-border-width-selected,2px) solid var(--ds-border,#0b120e24)}
|
|
2
1
|
._x3doia51{border-top:var(--ds-border-width,1px) solid var(--ds-border,#0b120e24)}._16jlidpf{flex-grow:0}
|
|
3
|
-
._16qsvjqj{box-shadow:0 -1px 1px 0 var(--ds-border,#0b120e24)}
|
|
4
2
|
._19bvv77o{padding-left:var(--ds-space-025,2px)}
|
|
5
3
|
._1o9zidpf{flex-shrink:0}
|
|
6
4
|
._ca0qv77o{padding-top:var(--ds-space-025,2px)}
|
|
@@ -7,9 +7,7 @@ import { useIntl } from 'react-intl';
|
|
|
7
7
|
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
8
8
|
import { AddOwnEmoji } from '../common/AddEmoji';
|
|
9
9
|
import { EmojiPreviewComponent } from '../common/EmojiPreviewComponent';
|
|
10
|
-
import { isRefreshEmojiPickerEnabled } from '../common/isRefreshEmojiPickerEnabled';
|
|
11
10
|
const emojiPickerFooter = null;
|
|
12
|
-
const emojiPickerFooterWithTopShadow = null;
|
|
13
11
|
const emojiPickerFooterWithTopShadowNew = null;
|
|
14
12
|
const emojiPreviewContainerStyles = {
|
|
15
13
|
emojiPreviewContainer: "_ca0qv77o _u5f3v77o _n3tdv77o _19bvv77o"
|
|
@@ -21,7 +19,7 @@ const EmojiPickerFooter = ({
|
|
|
21
19
|
uploadEnabled
|
|
22
20
|
}) => {
|
|
23
21
|
const intl = useIntl();
|
|
24
|
-
return
|
|
22
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
25
23
|
"data-testid": emojiPickerFooterTestId,
|
|
26
24
|
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug", "_x3doia51"])
|
|
27
25
|
}, selectedEmoji ? /*#__PURE__*/React.createElement(Box, {
|
|
@@ -32,11 +30,6 @@ const EmojiPickerFooter = ({
|
|
|
32
30
|
onOpenUpload: onOpenUpload,
|
|
33
31
|
uploadEnabled: uploadEnabled,
|
|
34
32
|
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
33
|
}));
|
|
41
34
|
};
|
|
42
35
|
const _default_1 = /*#__PURE__*/memo(EmojiPickerFooter);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
._19itahnd{border:var(--ds-border,#0b120e24) var(--ds-border-width,1px) solid}
|
|
2
|
-
._2rko1mok{border-radius:var(--ds-radius-large,8px)}
|
|
3
|
-
._2rkofajl{border-radius:var(--ds-radius-small,3px)}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
2
|
+
._2rko1mok{border-radius:var(--ds-radius-large,8px)}._16qs130s{box-shadow:var(--ds-shadow-overlay,0 8px 9pt #1e1f2126,0 0 1px #1e1f214f)}
|
|
4
3
|
._1bah1yb4{justify-content:space-between}
|
|
5
4
|
._1bsb1edt{width:350px}
|
|
6
5
|
._1e0c1txw{display:flex}
|
|
@@ -6,15 +6,10 @@ import React from 'react';
|
|
|
6
6
|
import { EmojiCommonProvider } from '../../context/EmojiCommonProvider';
|
|
7
7
|
import { ufoExperiences } from '../../util/analytics/ufoExperiences';
|
|
8
8
|
import { defaultEmojiPickerSize } from '../../util/constants';
|
|
9
|
-
import { isTeamoji26RefreshEmojiPickerEnabled } from '../../util/teamoji26RefreshEmojiPicker';
|
|
10
9
|
import LoadingEmojiComponent from '../common/LoadingEmojiComponent';
|
|
11
10
|
import { UfoErrorBoundary } from '../common/UfoErrorBoundary';
|
|
12
11
|
import { emojiPickerLoader } from './emojiPickerLoader';
|
|
13
12
|
import { LoadingItem } from './LoadingItem';
|
|
14
|
-
const isRefreshEmojiPickerEnabled = () => {
|
|
15
|
-
return isTeamoji26RefreshEmojiPickerEnabled();
|
|
16
|
-
};
|
|
17
|
-
const emojiPicker = null;
|
|
18
13
|
const emojiPickerNew = null;
|
|
19
14
|
export class EmojiPickerInternal extends LoadingEmojiComponent {
|
|
20
15
|
constructor(props) {
|
|
@@ -38,12 +33,9 @@ export class EmojiPickerInternal extends LoadingEmojiComponent {
|
|
|
38
33
|
}
|
|
39
34
|
};
|
|
40
35
|
ufoExperiences['emoji-picker-opened'].markFMP();
|
|
41
|
-
return
|
|
36
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
42
37
|
ref: handlePickerRef,
|
|
43
38
|
className: ax(["_19itahnd _2rko1mok _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iixjv _1bsb1edt _1ul91edt _1tke5x59 _c71l1y6z"])
|
|
44
|
-
}, item.renderItem()) : /*#__PURE__*/React.createElement("div", {
|
|
45
|
-
ref: handlePickerRef,
|
|
46
|
-
className: ax(["_19itahnd _2rkofajl _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qs130s _4t3iixjv _1bsb1edt _1ul91edt _1tke5x59 _c71l1y6z"])
|
|
47
39
|
}, item.renderItem());
|
|
48
40
|
}
|
|
49
41
|
renderLoaded(loadedEmojiProvider, EmojiPickerComponent) {
|
|
@@ -5,9 +5,8 @@ import { customCategory, defaultEmojiPickerSize, emojiPickerPreviewHeight, frequ
|
|
|
5
5
|
import { filterHiddenEmojis } from '../../util/filter-hidden-emojis';
|
|
6
6
|
import { filterProductivityEmojisByColor, getProductivityColorPreviewEmojis } from '../../util/productivity-colors';
|
|
7
7
|
import EmojiActions from '../common/EmojiActions';
|
|
8
|
-
import { isRefreshEmojiPickerEnabled } from '../common/isRefreshEmojiPickerEnabled';
|
|
9
8
|
import { messages } from '../i18n';
|
|
10
|
-
import {
|
|
9
|
+
import { CategoryDescriptionMapNew } from './categories';
|
|
11
10
|
import { CategoryHeadingItem } from './CategoryHeadingItem';
|
|
12
11
|
import CategoryTracker from './CategoryTracker';
|
|
13
12
|
import { emojiPickerHeightOffset } from './emojiPickerHeightOffset';
|
|
@@ -87,13 +86,12 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
87
86
|
const [activeAtlassianSubcategory, setActiveAtlassianSubcategory] = useState(null);
|
|
88
87
|
const categoryTracker = useMemo(() => new CategoryTracker(), []);
|
|
89
88
|
const [categoriesChanged, setCategoriesChanged] = useState(false);
|
|
90
|
-
const
|
|
91
|
-
const
|
|
92
|
-
const productivityColorPreviewEmojis = useMemo(() => isTeamojiExperimentEnabled ? getProductivityColorPreviewEmojis(visibleEmojis) : {}, [isTeamojiExperimentEnabled, visibleEmojis]);
|
|
89
|
+
const visibleEmojis = useMemo(() => filterHiddenEmojis(emojis), [emojis]);
|
|
90
|
+
const productivityColorPreviewEmojis = useMemo(() => getProductivityColorPreviewEmojis(visibleEmojis), [visibleEmojis]);
|
|
93
91
|
const addToCategoryMap = useCallback((categoryToGroupMap, emoji, category) => {
|
|
94
92
|
var _categoryToGroupMap$c;
|
|
95
93
|
if (!categoryToGroupMap[category]) {
|
|
96
|
-
const categoryDefinition =
|
|
94
|
+
const categoryDefinition = CategoryDescriptionMapNew[category];
|
|
97
95
|
if (!categoryDefinition) {
|
|
98
96
|
return categoryToGroupMap;
|
|
99
97
|
}
|
|
@@ -106,9 +104,9 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
106
104
|
}
|
|
107
105
|
(_categoryToGroupMap$c = categoryToGroupMap[category]) === null || _categoryToGroupMap$c === void 0 ? void 0 : _categoryToGroupMap$c.emojis.push(emoji);
|
|
108
106
|
return categoryToGroupMap;
|
|
109
|
-
}, [
|
|
107
|
+
}, []);
|
|
110
108
|
const groupByCategory = useCallback(currentUser => (categoryToGroupMap, emoji) => {
|
|
111
|
-
if (
|
|
109
|
+
if (emoji.type === 'ATLASSIAN' && emoji.category !== frequentCategory) {
|
|
112
110
|
addToCategoryMap(categoryToGroupMap, emoji, atlassianCategory);
|
|
113
111
|
const group = categoryToGroupMap[atlassianCategory];
|
|
114
112
|
if (group) {
|
|
@@ -126,8 +124,6 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
126
124
|
}
|
|
127
125
|
subcategory.emojis.push(emoji);
|
|
128
126
|
}
|
|
129
|
-
} else if (emoji.type === 'ATLASSIAN' && emoji.category !== frequentCategory) {
|
|
130
|
-
addToCategoryMap(categoryToGroupMap, emoji, atlassianCategory);
|
|
131
127
|
} else {
|
|
132
128
|
addToCategoryMap(categoryToGroupMap, emoji, emoji.category);
|
|
133
129
|
}
|
|
@@ -136,7 +132,7 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
136
132
|
addToCategoryMap(categoryToGroupMap, emoji, yourUploadsCategory);
|
|
137
133
|
}
|
|
138
134
|
return categoryToGroupMap;
|
|
139
|
-
}, [addToCategoryMap
|
|
135
|
+
}, [addToCategoryMap]);
|
|
140
136
|
const findAtlassianSubcategoryToActivate = useCallback(startIndex => {
|
|
141
137
|
const row = virtualItems[startIndex];
|
|
142
138
|
if (row instanceof CategoryHeadingItem && row.props.id === atlassianCategory) {
|
|
@@ -173,11 +169,9 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
173
169
|
if (!query) {
|
|
174
170
|
// Calculate category in view - only relevant if categories shown, i.e. no query
|
|
175
171
|
const currentCategory = findCategoryToActivate(rowItem);
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
setActiveAtlassianSubcategory(currentAtlassianSubcategory);
|
|
180
|
-
}
|
|
172
|
+
const currentAtlassianSubcategory = findAtlassianSubcategoryToActivate(startIndex);
|
|
173
|
+
if (activeAtlassianSubcategory !== currentAtlassianSubcategory) {
|
|
174
|
+
setActiveAtlassianSubcategory(currentAtlassianSubcategory);
|
|
181
175
|
}
|
|
182
176
|
if (currentCategory !== null && activeCategoryId !== currentCategory) {
|
|
183
177
|
if (onCategoryActivated) {
|
|
@@ -185,11 +179,11 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
185
179
|
}
|
|
186
180
|
}
|
|
187
181
|
}
|
|
188
|
-
}, [virtualItems, query, activeAtlassianSubcategory, activeCategoryId, findAtlassianSubcategoryToActivate,
|
|
182
|
+
}, [virtualItems, query, activeAtlassianSubcategory, activeCategoryId, findAtlassianSubcategoryToActivate, onCategoryActivated]);
|
|
189
183
|
const buildEmojiGroupedByCategory = useCallback((emojis, currentUser) => {
|
|
190
184
|
const categoryToGroupMap = emojis.reduce(groupByCategory(currentUser), {});
|
|
191
185
|
setAllEmojiGroups(Object.keys(categoryToGroupMap).map(key => categoryToGroupMap[key]).map(group => {
|
|
192
|
-
if (
|
|
186
|
+
if (selectedProductivityColor) {
|
|
193
187
|
var _group$subcategories;
|
|
194
188
|
group.emojis = filterProductivityEmojisByColor(group.emojis, selectedProductivityColor);
|
|
195
189
|
(_group$subcategories = group.subcategories) === null || _group$subcategories === void 0 ? void 0 : _group$subcategories.forEach(subcategory => {
|
|
@@ -205,7 +199,7 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
205
199
|
}
|
|
206
200
|
return group;
|
|
207
201
|
}).sort(byOrder));
|
|
208
|
-
}, [groupByCategory,
|
|
202
|
+
}, [groupByCategory, selectedProductivityColor]);
|
|
209
203
|
const buildEmojiRows = useCallback((items, category, title, emojis, showDelete) => {
|
|
210
204
|
let remainingEmojis = emojis;
|
|
211
205
|
while (remainingEmojis.length > 0) {
|
|
@@ -220,14 +214,14 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
220
214
|
onDelete: onEmojiDelete,
|
|
221
215
|
onMouseMove: onEmojiActive,
|
|
222
216
|
onFocus: onEmojiActive,
|
|
223
|
-
onMouseLeave:
|
|
217
|
+
onMouseLeave: onEmojiLeave
|
|
224
218
|
}));
|
|
225
219
|
}
|
|
226
|
-
}, [
|
|
220
|
+
}, [onEmojiActive, onEmojiDelete, onEmojiLeave, onEmojiSelected]);
|
|
227
221
|
const buildVirtualItemFromGroup = useCallback(group => {
|
|
228
222
|
var _group$subcategories3;
|
|
229
223
|
const items = [];
|
|
230
|
-
const hasAtlassianSubcategories =
|
|
224
|
+
const hasAtlassianSubcategories = group.category === atlassianCategory && !!((_group$subcategories3 = group.subcategories) !== null && _group$subcategories3 !== void 0 && _group$subcategories3.length);
|
|
231
225
|
if (!hasAtlassianSubcategories) {
|
|
232
226
|
items.push(new CategoryHeadingItem({
|
|
233
227
|
id: group.category,
|
|
@@ -262,7 +256,7 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
262
256
|
buildEmojiRows(items, group.category, group.title, group.emojis, group.title === userCustomTitle);
|
|
263
257
|
}
|
|
264
258
|
return items;
|
|
265
|
-
}, [buildEmojiRows
|
|
259
|
+
}, [buildEmojiRows]);
|
|
266
260
|
const buildVirtualItems = useCallback(() => {
|
|
267
261
|
let items = [];
|
|
268
262
|
const prevFirstCategory = categoryTracker.getFirstCategory();
|
|
@@ -271,8 +265,8 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
271
265
|
items.push(new LoadingItem());
|
|
272
266
|
} else {
|
|
273
267
|
if (query) {
|
|
274
|
-
const search =
|
|
275
|
-
if (visibleEmojis.length === 0
|
|
268
|
+
const search = CategoryDescriptionMapNew.SEARCH;
|
|
269
|
+
if (visibleEmojis.length === 0) {
|
|
276
270
|
// Show a "No results" category heading, then a no-results illustration below it
|
|
277
271
|
items.push(new CategoryHeadingItem({
|
|
278
272
|
id: searchCategory,
|
|
@@ -299,7 +293,7 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
299
293
|
allEmojiGroups.forEach(group => {
|
|
300
294
|
// Optimisation - avoid re-rendering unaffected groups for the current selectedShortcut
|
|
301
295
|
// by not passing it to irrelevant groups
|
|
302
|
-
categoryTracker.add(
|
|
296
|
+
categoryTracker.add(group.category, items.length);
|
|
303
297
|
items = [...items, ...buildVirtualItemFromGroup(group)];
|
|
304
298
|
if (group.category === yourUploadsCategory) {
|
|
305
299
|
setLastYourUploadsRow(items.length - 1);
|
|
@@ -316,7 +310,7 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
316
310
|
}
|
|
317
311
|
}
|
|
318
312
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
319
|
-
}, [allEmojiGroups, buildVirtualItemFromGroup, formatMessage,
|
|
313
|
+
}, [allEmojiGroups, buildVirtualItemFromGroup, formatMessage, loading, onOpenUpload, query, uploadEnabled, visibleEmojis]);
|
|
320
314
|
const findCategoryToActivate = row => {
|
|
321
315
|
let category = null;
|
|
322
316
|
if (row instanceof CategoryHeadingItem) {
|
|
@@ -437,12 +431,12 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
437
431
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
438
432
|
}, [virtualItems, categoriesChanged]);
|
|
439
433
|
const virtualListHeight = useMemo(() => {
|
|
440
|
-
if (query && visibleEmojis.length === 0
|
|
434
|
+
if (query && visibleEmojis.length === 0) {
|
|
441
435
|
// No-results state: expand the list height to fit heading + illustration without scrolling
|
|
442
436
|
return sizes.categoryHeadingHeight + sizes.noResultsHeight + emojiPickerHeightOffset(size);
|
|
443
437
|
}
|
|
444
|
-
return
|
|
445
|
-
}, [size, query, visibleEmojis.length,
|
|
438
|
+
return sizes.listHeightNew + emojiPickerHeightOffset(size) + (useFooterSpaceForList ? emojiPickerPreviewHeight : 0);
|
|
439
|
+
}, [size, query, visibleEmojis.length, useFooterSpaceForList]);
|
|
446
440
|
return /*#__PURE__*/React.createElement(EmojiPickerTabPanel, {
|
|
447
441
|
showSearchResults: !!query
|
|
448
442
|
}, /*#__PURE__*/React.createElement(EmojiActions, {
|
|
@@ -450,10 +444,10 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
450
444
|
onToneSelected: onToneSelected,
|
|
451
445
|
onToneSelectorCancelled: onToneSelectorCancelled,
|
|
452
446
|
toneEmoji: toneEmoji,
|
|
453
|
-
activeCategoryId:
|
|
454
|
-
activeAtlassianSubcategory:
|
|
455
|
-
productivityColorPreviewEmojis:
|
|
456
|
-
selectedProductivityColor:
|
|
447
|
+
activeCategoryId: activeCategoryId,
|
|
448
|
+
activeAtlassianSubcategory: activeAtlassianSubcategory,
|
|
449
|
+
productivityColorPreviewEmojis: productivityColorPreviewEmojis,
|
|
450
|
+
selectedProductivityColor: selectedProductivityColor,
|
|
457
451
|
uploading: uploading,
|
|
458
452
|
uploadEnabled: uploadEnabled,
|
|
459
453
|
emojiToDelete: emojiToDelete,
|
|
@@ -466,7 +460,7 @@ export const EmojiPickerVirtualListInternal = /*#__PURE__*/React.forwardRef((pro
|
|
|
466
460
|
onDeleteEmoji: onDeleteEmoji,
|
|
467
461
|
onFileChooserClicked: onFileChooserClicked,
|
|
468
462
|
onOpenUpload: onOpenUpload,
|
|
469
|
-
onProductivityColorSelected:
|
|
463
|
+
onProductivityColorSelected: onProductivityColorSelected,
|
|
470
464
|
query: query,
|
|
471
465
|
onChange: onSearch,
|
|
472
466
|
resultsCount: visibleEmojis.length,
|
|
@@ -8,13 +8,10 @@ import SearchIcon from '@atlaskit/icon/core/search';
|
|
|
8
8
|
import TextField from '@atlaskit/textfield/text-field';
|
|
9
9
|
import VisuallyHidden from '@atlaskit/visually-hidden/visually-hidden';
|
|
10
10
|
import { EMOJI_SEARCH_DEBOUNCE } from '../../util/constants';
|
|
11
|
-
import { isRefreshEmojiPickerEnabled } from '../common/isRefreshEmojiPickerEnabled';
|
|
12
11
|
import { messages } from '../i18n';
|
|
13
|
-
const input = null;
|
|
14
12
|
const inputNew = null;
|
|
15
13
|
const textFieldWrapperNew = null;
|
|
16
14
|
const pickerSearch = null;
|
|
17
|
-
const searchIcon = null;
|
|
18
15
|
const searchIconNew = null;
|
|
19
16
|
const hidden = null;
|
|
20
17
|
export const emojiPickerSearchTestId = 'emoji-picker-search';
|
|
@@ -50,7 +47,7 @@ export const EmojiPickerListSearch = props => {
|
|
|
50
47
|
role: "status"
|
|
51
48
|
}, dirty ? query === '' ? formatMessage(messages.searchResultsStatusSeeAll) : formatMessage(messages.searchResultsStatus, {
|
|
52
49
|
count: resultsCount
|
|
53
|
-
}) : null),
|
|
50
|
+
}) : null), /*#__PURE__*/React.createElement("div", {
|
|
54
51
|
className: ax(["_n6341l7x _18z11b66"])
|
|
55
52
|
}, /*#__PURE__*/React.createElement(TextField, {
|
|
56
53
|
role: "searchbox",
|
|
@@ -71,24 +68,5 @@ export const EmojiPickerListSearch = props => {
|
|
|
71
68
|
ref: textRef,
|
|
72
69
|
isCompact: true,
|
|
73
70
|
className: ax(["_11c8fhey _12ji1r31 _1qu2glyw _12y31o36 _vchhusvi _syaz1kw7 _80om1kw7 _1q51yh40 _y4tize3t _85i5v77o _bozg12x7 _1bsb1osq _13xeglyw _1goxglyw"])
|
|
74
|
-
}))
|
|
75
|
-
role: "searchbox",
|
|
76
|
-
"aria-label": formatMessage(messages.searchLabel),
|
|
77
|
-
autoComplete: "off",
|
|
78
|
-
name: "search",
|
|
79
|
-
placeholder: `${formatMessage(messages.searchPlaceholder)}...`,
|
|
80
|
-
defaultValue: query || '',
|
|
81
|
-
onChange: handleOnChange,
|
|
82
|
-
elemBeforeInput: /*#__PURE__*/React.createElement("span", {
|
|
83
|
-
className: ax(["_tzy4105o _18u01i6y"])
|
|
84
|
-
}, /*#__PURE__*/React.createElement(SearchIcon, {
|
|
85
|
-
color: "currentColor",
|
|
86
|
-
spacing: "spacious",
|
|
87
|
-
label: ""
|
|
88
|
-
})),
|
|
89
|
-
testId: emojiPickerSearchTestId,
|
|
90
|
-
ref: textRef,
|
|
91
|
-
isCompact: true,
|
|
92
|
-
className: ax(["_11c8fhey _12ji1r31 _1qu2glyw _12y31o36 _vchhusvi _syaz1kw7 _80om1kw7 _1q51t94y _y4tize3t _85i5v77o _bozg12x7 _1bsb1osq _13xeglyw _1goxglyw"])
|
|
93
|
-
}));
|
|
71
|
+
})));
|
|
94
72
|
};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { emojiPickerListHeightNew, emojiPickerWidth } from '../../util/constants';
|
|
2
2
|
export const sizes = {
|
|
3
|
-
listHeight: emojiPickerListHeight,
|
|
4
3
|
listHeightNew: emojiPickerListHeightNew,
|
|
5
4
|
listWidth: emojiPickerWidth,
|
|
6
5
|
searchHeight: 52,
|
|
@@ -5,7 +5,6 @@ import React, { useCallback, useImperativeHandle } from 'react';
|
|
|
5
5
|
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
6
6
|
import { useEmojiPickerListContext } from '../../hooks/useEmojiPickerListContext';
|
|
7
7
|
import { EMOJIPICKERLIST_KEYBOARD_KEYS_SUPPORTED, EMOJI_LIST_COLUMNS, EMOJI_LIST_PAGE_COUNT, KeyboardNavigationDirection, KeyboardKeys } from '../../util/constants';
|
|
8
|
-
import { isRefreshEmojiPickerEnabled } from '../common/isRefreshEmojiPickerEnabled';
|
|
9
8
|
const virtualList = null;
|
|
10
9
|
const virtualRowStyle = null;
|
|
11
10
|
export const virtualListScrollContainerTestId = 'virtual-list-scroll-container';
|
|
@@ -54,7 +53,7 @@ export const VirtualList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
54
53
|
const elemBottom = elementRect.bottom;
|
|
55
54
|
const parentTop = parentRect.top;
|
|
56
55
|
const parentBottom = parentRect.bottom;
|
|
57
|
-
const isVisible =
|
|
56
|
+
const isVisible = elemTop >= parentTop && elemBottom <= parentBottom;
|
|
58
57
|
return isVisible;
|
|
59
58
|
};
|
|
60
59
|
const getFirstVisibleListElementIndex = useCallback(() => {
|
|
@@ -71,7 +70,7 @@ export const VirtualList = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
71
70
|
var _virtualList$firstVis;
|
|
72
71
|
return ((_virtualList$firstVis = virtualList[firstVisibleIndex]) === null || _virtualList$firstVis === void 0 ? void 0 : _virtualList$firstVis.index) || 0;
|
|
73
72
|
}
|
|
74
|
-
return
|
|
73
|
+
return ((_virtualList$ = virtualList[0]) === null || _virtualList$ === void 0 ? void 0 : _virtualList$.index) || 0;
|
|
75
74
|
}, [rowVirtualizer]);
|
|
76
75
|
|
|
77
76
|
/**
|