@atlaskit/emoji 67.0.7 → 67.2.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 +37 -0
- package/dist/cjs/api/EmojiResource.js +41 -25
- package/dist/cjs/api/media/TokenManager.js +4 -4
- package/dist/cjs/components/common/CachingEmoji.js +14 -6
- package/dist/cjs/components/common/Emoji.js +48 -12
- package/dist/cjs/components/common/EmojiActions.js +62 -26
- package/dist/cjs/components/common/EmojiErrorMessage.js +12 -7
- package/dist/cjs/components/common/EmojiPlaceholder.js +1 -0
- package/dist/cjs/components/common/{EmojiButton.js → EmojiRadioButton.js} +28 -19
- package/dist/cjs/components/common/EmojiUploadPicker.js +80 -37
- package/dist/cjs/components/common/EmojiUploadPreview.js +11 -2
- package/dist/cjs/components/common/FileChooser.js +2 -2
- package/dist/cjs/components/common/ResourcedEmojiComponent.js +4 -0
- package/dist/cjs/components/common/RetryableButton.js +7 -3
- package/dist/cjs/components/common/TonePreviewButton.js +44 -0
- package/dist/cjs/components/common/ToneSelector.js +53 -25
- package/dist/cjs/components/common/styles.js +45 -16
- package/dist/cjs/components/i18n.js +44 -4
- package/dist/cjs/components/picker/CategorySelector.js +112 -90
- package/dist/cjs/components/picker/CategoryTracker.js +0 -28
- package/dist/cjs/components/picker/EmojiPickerCategoryHeading.js +2 -1
- package/dist/cjs/components/picker/EmojiPickerComponent.js +33 -44
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +32 -4
- package/dist/cjs/components/picker/EmojiPickerList.js +154 -88
- package/dist/cjs/components/picker/EmojiPickerListSearch.js +66 -117
- package/dist/cjs/components/picker/EmojiPickerVirtualItems.js +5 -2
- package/dist/cjs/components/picker/VirtualList.js +273 -171
- package/dist/cjs/components/picker/styles.js +43 -51
- package/dist/cjs/components/typeahead/EmojiTypeAheadComponent.js +0 -10
- package/dist/cjs/context/EmojiPickerListContext.js +33 -0
- package/dist/cjs/hooks/useEmojiPickerListContext.js +12 -0
- package/dist/cjs/hooks/useIsMounted.js +17 -0
- package/dist/cjs/i18n/cs.js +35 -34
- package/dist/cjs/i18n/da.js +35 -34
- package/dist/cjs/i18n/de.js +35 -34
- package/dist/cjs/i18n/en.js +35 -34
- package/dist/cjs/i18n/en_GB.js +35 -34
- package/dist/cjs/i18n/es.js +35 -34
- package/dist/cjs/i18n/fi.js +35 -34
- package/dist/cjs/i18n/fr.js +35 -34
- package/dist/cjs/i18n/hu.js +35 -34
- package/dist/cjs/i18n/it.js +35 -34
- package/dist/cjs/i18n/ja.js +35 -34
- package/dist/cjs/i18n/ko.js +35 -34
- package/dist/cjs/i18n/nb.js +35 -34
- package/dist/cjs/i18n/nl.js +35 -34
- package/dist/cjs/i18n/pl.js +35 -34
- package/dist/cjs/i18n/pt_BR.js +35 -34
- package/dist/cjs/i18n/ru.js +35 -34
- package/dist/cjs/i18n/sv.js +35 -34
- package/dist/cjs/i18n/th.js +35 -34
- package/dist/cjs/i18n/tr.js +35 -34
- package/dist/cjs/i18n/uk.js +35 -34
- package/dist/cjs/i18n/vi.js +35 -34
- package/dist/cjs/i18n/zh.js +35 -34
- package/dist/cjs/i18n/zh_TW.js +35 -34
- package/dist/cjs/types.js +7 -1
- package/dist/cjs/util/constants.js +43 -2
- package/dist/cjs/util/shared-styles.js +3 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/api/EmojiResource.js +42 -26
- package/dist/es2019/api/media/TokenManager.js +4 -4
- package/dist/es2019/components/common/CachingEmoji.js +10 -3
- package/dist/es2019/components/common/Emoji.js +44 -11
- package/dist/es2019/components/common/EmojiActions.js +55 -24
- package/dist/es2019/components/common/EmojiErrorMessage.js +7 -3
- package/dist/es2019/components/common/EmojiPlaceholder.js +1 -0
- package/dist/es2019/components/common/EmojiRadioButton.js +54 -0
- package/dist/es2019/components/common/EmojiUploadPicker.js +75 -36
- package/dist/es2019/components/common/EmojiUploadPreview.js +11 -2
- package/dist/es2019/components/common/FileChooser.js +1 -1
- package/dist/es2019/components/common/ResourcedEmojiComponent.js +4 -0
- package/dist/es2019/components/common/RetryableButton.js +7 -3
- package/dist/es2019/components/common/TonePreviewButton.js +34 -0
- package/dist/es2019/components/common/ToneSelector.js +55 -21
- package/dist/es2019/components/common/styles.js +41 -10
- package/dist/es2019/components/i18n.js +44 -4
- package/dist/es2019/components/picker/CategorySelector.js +114 -89
- package/dist/es2019/components/picker/CategoryTracker.js +0 -24
- package/dist/es2019/components/picker/EmojiPickerCategoryHeading.js +2 -2
- package/dist/es2019/components/picker/EmojiPickerComponent.js +36 -46
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +51 -21
- package/dist/es2019/components/picker/EmojiPickerList.js +113 -55
- package/dist/es2019/components/picker/EmojiPickerListSearch.js +61 -98
- package/dist/es2019/components/picker/EmojiPickerVirtualItems.js +4 -1
- package/dist/es2019/components/picker/VirtualList.js +247 -108
- package/dist/es2019/components/picker/styles.js +20 -28
- package/dist/es2019/components/typeahead/EmojiTypeAheadComponent.js +0 -10
- package/dist/es2019/context/EmojiPickerListContext.js +17 -0
- package/dist/es2019/hooks/useEmojiPickerListContext.js +3 -0
- package/dist/es2019/hooks/useIsMounted.js +11 -0
- package/dist/es2019/i18n/cs.js +35 -34
- package/dist/es2019/i18n/da.js +35 -34
- package/dist/es2019/i18n/de.js +35 -34
- package/dist/es2019/i18n/en.js +35 -34
- package/dist/es2019/i18n/en_GB.js +35 -34
- package/dist/es2019/i18n/es.js +35 -34
- package/dist/es2019/i18n/fi.js +35 -34
- package/dist/es2019/i18n/fr.js +35 -34
- package/dist/es2019/i18n/hu.js +35 -34
- package/dist/es2019/i18n/it.js +35 -34
- package/dist/es2019/i18n/ja.js +35 -34
- package/dist/es2019/i18n/ko.js +35 -34
- package/dist/es2019/i18n/nb.js +35 -34
- package/dist/es2019/i18n/nl.js +35 -34
- package/dist/es2019/i18n/pl.js +35 -34
- package/dist/es2019/i18n/pt_BR.js +35 -34
- package/dist/es2019/i18n/ru.js +35 -34
- package/dist/es2019/i18n/sv.js +35 -34
- package/dist/es2019/i18n/th.js +35 -34
- package/dist/es2019/i18n/tr.js +35 -34
- package/dist/es2019/i18n/uk.js +35 -34
- package/dist/es2019/i18n/vi.js +35 -34
- package/dist/es2019/i18n/zh.js +35 -34
- package/dist/es2019/i18n/zh_TW.js +35 -34
- package/dist/es2019/types.js +5 -0
- package/dist/es2019/util/constants.js +32 -0
- package/dist/es2019/util/shared-styles.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/EmojiResource.js +42 -26
- package/dist/esm/api/media/TokenManager.js +4 -4
- package/dist/esm/components/common/CachingEmoji.js +14 -6
- package/dist/esm/components/common/Emoji.js +48 -12
- package/dist/esm/components/common/EmojiActions.js +62 -26
- package/dist/esm/components/common/EmojiErrorMessage.js +7 -3
- package/dist/esm/components/common/EmojiPlaceholder.js +1 -0
- package/dist/esm/components/common/EmojiRadioButton.js +52 -0
- package/dist/esm/components/common/EmojiUploadPicker.js +77 -36
- package/dist/esm/components/common/EmojiUploadPreview.js +11 -2
- package/dist/esm/components/common/FileChooser.js +1 -1
- package/dist/esm/components/common/ResourcedEmojiComponent.js +4 -0
- package/dist/esm/components/common/RetryableButton.js +7 -3
- package/dist/esm/components/common/TonePreviewButton.js +33 -0
- package/dist/esm/components/common/ToneSelector.js +49 -18
- package/dist/esm/components/common/styles.js +40 -12
- package/dist/esm/components/i18n.js +44 -4
- package/dist/esm/components/picker/CategorySelector.js +114 -95
- package/dist/esm/components/picker/CategoryTracker.js +0 -28
- package/dist/esm/components/picker/EmojiPickerCategoryHeading.js +2 -2
- package/dist/esm/components/picker/EmojiPickerComponent.js +35 -46
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +32 -4
- package/dist/esm/components/picker/EmojiPickerList.js +156 -86
- package/dist/esm/components/picker/EmojiPickerListSearch.js +64 -117
- package/dist/esm/components/picker/EmojiPickerVirtualItems.js +5 -2
- package/dist/esm/components/picker/VirtualList.js +274 -172
- package/dist/esm/components/picker/styles.js +37 -45
- package/dist/esm/components/typeahead/EmojiTypeAheadComponent.js +0 -10
- package/dist/esm/context/EmojiPickerListContext.js +21 -0
- package/dist/esm/hooks/useEmojiPickerListContext.js +5 -0
- package/dist/esm/hooks/useIsMounted.js +11 -0
- package/dist/esm/i18n/cs.js +35 -34
- package/dist/esm/i18n/da.js +35 -34
- package/dist/esm/i18n/de.js +35 -34
- package/dist/esm/i18n/en.js +35 -34
- package/dist/esm/i18n/en_GB.js +35 -34
- package/dist/esm/i18n/es.js +35 -34
- package/dist/esm/i18n/fi.js +35 -34
- package/dist/esm/i18n/fr.js +35 -34
- package/dist/esm/i18n/hu.js +35 -34
- package/dist/esm/i18n/it.js +35 -34
- package/dist/esm/i18n/ja.js +35 -34
- package/dist/esm/i18n/ko.js +35 -34
- package/dist/esm/i18n/nb.js +35 -34
- package/dist/esm/i18n/nl.js +35 -34
- package/dist/esm/i18n/pl.js +35 -34
- package/dist/esm/i18n/pt_BR.js +35 -34
- package/dist/esm/i18n/ru.js +35 -34
- package/dist/esm/i18n/sv.js +35 -34
- package/dist/esm/i18n/th.js +35 -34
- package/dist/esm/i18n/tr.js +35 -34
- package/dist/esm/i18n/uk.js +35 -34
- package/dist/esm/i18n/vi.js +35 -34
- package/dist/esm/i18n/zh.js +35 -34
- package/dist/esm/i18n/zh_TW.js +35 -34
- package/dist/esm/types.js +5 -0
- package/dist/esm/util/constants.js +32 -0
- package/dist/esm/util/shared-styles.js +1 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/api/EmojiResource.d.ts +2 -0
- package/dist/types/components/common/Emoji.d.ts +7 -1
- package/dist/types/components/common/EmojiActions.d.ts +4 -3
- package/dist/types/components/common/{EmojiButton.d.ts → EmojiRadioButton.d.ts} +3 -4
- package/dist/types/components/common/EmojiUploadPicker.d.ts +6 -4
- package/dist/types/components/common/RetryableButton.d.ts +1 -0
- package/dist/types/components/common/TonePreviewButton.d.ts +14 -0
- package/dist/types/components/common/ToneSelector.d.ts +8 -5
- package/dist/types/components/common/internal-types.d.ts +9 -0
- package/dist/types/components/common/styles.d.ts +2 -1
- package/dist/types/components/i18n.d.ts +40 -0
- package/dist/types/components/picker/CategorySelector.d.ts +3 -10
- package/dist/types/components/picker/CategoryTracker.d.ts +0 -2
- package/dist/types/components/picker/EmojiPickerCategoryHeading.d.ts +2 -1
- package/dist/types/components/picker/EmojiPickerEmojiRow.d.ts +5 -0
- package/dist/types/components/picker/EmojiPickerList.d.ts +14 -7
- package/dist/types/components/picker/EmojiPickerListSearch.d.ts +4 -8
- package/dist/types/components/picker/EmojiPickerVirtualItems.d.ts +1 -1
- package/dist/types/components/picker/VirtualList.d.ts +7 -24
- package/dist/types/components/picker/styles.d.ts +1 -1
- package/dist/types/context/EmojiPickerListContext.d.ts +10 -0
- package/dist/types/hooks/useEmojiPickerListContext.d.ts +1 -0
- package/dist/types/hooks/useIsMounted.d.ts +1 -0
- package/dist/types/i18n/cs.d.ts +34 -34
- package/dist/types/i18n/da.d.ts +34 -34
- package/dist/types/i18n/de.d.ts +34 -34
- package/dist/types/i18n/en.d.ts +34 -34
- package/dist/types/i18n/en_GB.d.ts +34 -34
- package/dist/types/i18n/es.d.ts +34 -34
- package/dist/types/i18n/fi.d.ts +34 -34
- package/dist/types/i18n/fr.d.ts +34 -34
- package/dist/types/i18n/hu.d.ts +34 -34
- package/dist/types/i18n/it.d.ts +34 -34
- package/dist/types/i18n/ja.d.ts +34 -34
- package/dist/types/i18n/ko.d.ts +34 -34
- package/dist/types/i18n/nb.d.ts +34 -34
- package/dist/types/i18n/nl.d.ts +34 -34
- package/dist/types/i18n/pl.d.ts +34 -34
- package/dist/types/i18n/pt_BR.d.ts +34 -34
- package/dist/types/i18n/ru.d.ts +34 -34
- package/dist/types/i18n/sv.d.ts +34 -34
- package/dist/types/i18n/th.d.ts +34 -34
- package/dist/types/i18n/tr.d.ts +34 -34
- package/dist/types/i18n/uk.d.ts +34 -34
- package/dist/types/i18n/vi.d.ts +34 -34
- package/dist/types/i18n/zh.d.ts +34 -34
- package/dist/types/i18n/zh_TW.d.ts +34 -34
- package/dist/types/types.d.ts +5 -0
- package/dist/types/util/constants.d.ts +28 -0
- package/dist/types/util/shared-styles.d.ts +1 -1
- package/dist/types/util/type-helpers.d.ts +1 -1
- package/package.json +12 -8
- package/report.api.md +62 -1
- package/README.md +0 -3
- package/dist/cjs/components/hooks.js +0 -14
- package/dist/es2019/components/common/EmojiButton.js +0 -49
- package/dist/es2019/components/hooks.js +0 -8
- package/dist/esm/components/common/EmojiButton.js +0 -43
- package/dist/esm/components/hooks.js +0 -8
- package/dist/types/components/hooks.d.ts +0 -1
|
@@ -1,17 +1,18 @@
|
|
|
1
1
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
4
|
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
5
|
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
6
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
7
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
8
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
10
|
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
11
11
|
/** @jsx jsx */
|
|
12
|
-
import
|
|
12
|
+
import { createRef, PureComponent } from 'react';
|
|
13
13
|
import { jsx } from '@emotion/react';
|
|
14
|
-
import
|
|
14
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
15
|
+
import { customCategory, defaultEmojiPickerSize, frequentCategory, searchCategory, userCustomTitle, yourUploadsCategory } from '../../util/constants';
|
|
15
16
|
import { CategoryDescriptionMap } from './categories';
|
|
16
17
|
import CategoryTracker from './CategoryTracker';
|
|
17
18
|
import { sizes } from './EmojiPickerSizes';
|
|
@@ -20,6 +21,10 @@ import EmojiActions from '../common/EmojiActions';
|
|
|
20
21
|
import { emojiPickerList } from './styles';
|
|
21
22
|
import { emojiPickerHeightOffset } from './utils';
|
|
22
23
|
import { VirtualList } from './VirtualList';
|
|
24
|
+
import { injectIntl } from 'react-intl-next';
|
|
25
|
+
import { messages } from '../i18n';
|
|
26
|
+
import { EmojiPickerListContextProvider } from '../../context/EmojiPickerListContext';
|
|
27
|
+
|
|
23
28
|
/**
|
|
24
29
|
* Test id for wrapper Emoji Picker List div
|
|
25
30
|
*/
|
|
@@ -28,29 +33,66 @@ var categoryClassname = 'emoji-category';
|
|
|
28
33
|
var byOrder = function byOrder(orderableA, orderableB) {
|
|
29
34
|
return (orderableA.order || 0) - (orderableB.order || 0);
|
|
30
35
|
};
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* TODO: have to use class component here as unit test is relying on ref.root. Will refactor this whole file to functional component in future
|
|
39
|
+
* ticket: COLLAB-2317
|
|
40
|
+
*/
|
|
41
|
+
var EmojiPickerTabPanelInternal = /*#__PURE__*/function (_PureComponent) {
|
|
42
|
+
_inherits(EmojiPickerTabPanelInternal, _PureComponent);
|
|
43
|
+
var _super = _createSuper(EmojiPickerTabPanelInternal);
|
|
44
|
+
function EmojiPickerTabPanelInternal() {
|
|
45
|
+
_classCallCheck(this, EmojiPickerTabPanelInternal);
|
|
46
|
+
return _super.apply(this, arguments);
|
|
47
|
+
}
|
|
48
|
+
_createClass(EmojiPickerTabPanelInternal, [{
|
|
49
|
+
key: "render",
|
|
50
|
+
value: function render() {
|
|
51
|
+
var _this$props = this.props,
|
|
52
|
+
formatMessage = _this$props.intl.formatMessage,
|
|
53
|
+
children = _this$props.children,
|
|
54
|
+
showSearchResults = _this$props.showSearchResults;
|
|
55
|
+
return jsx("div", {
|
|
56
|
+
ref: "root",
|
|
57
|
+
css: emojiPickerList,
|
|
58
|
+
"data-testid": RENDER_EMOJI_PICKER_LIST_TESTID,
|
|
59
|
+
id: RENDER_EMOJI_PICKER_LIST_TESTID,
|
|
60
|
+
role: "tabpanel",
|
|
61
|
+
"aria-label": formatMessage(messages.emojiPickerListPanel)
|
|
62
|
+
}, jsx(VisuallyHidden, {
|
|
63
|
+
id: "emoji-picker-table-description"
|
|
64
|
+
}, formatMessage(messages.emojiPickerGrid, {
|
|
65
|
+
showSearchResults: showSearchResults
|
|
66
|
+
})), children);
|
|
67
|
+
}
|
|
68
|
+
}]);
|
|
69
|
+
return EmojiPickerTabPanelInternal;
|
|
70
|
+
}(PureComponent);
|
|
71
|
+
var EmojiPickerTabPanel = injectIntl(EmojiPickerTabPanelInternal);
|
|
72
|
+
var EmojiPickerVirtualListInternal = /*#__PURE__*/function (_PureComponent2) {
|
|
73
|
+
_inherits(EmojiPickerVirtualListInternal, _PureComponent2);
|
|
74
|
+
var _super2 = _createSuper(EmojiPickerVirtualListInternal);
|
|
75
|
+
function EmojiPickerVirtualListInternal(_props) {
|
|
35
76
|
var _this;
|
|
36
|
-
_classCallCheck(this,
|
|
37
|
-
_this =
|
|
77
|
+
_classCallCheck(this, EmojiPickerVirtualListInternal);
|
|
78
|
+
_this = _super2.call(this, _props);
|
|
38
79
|
_defineProperty(_assertThisInitialized(_this), "virtualItems", []);
|
|
39
80
|
_defineProperty(_assertThisInitialized(_this), "categoryTracker", new CategoryTracker());
|
|
40
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
81
|
+
_defineProperty(_assertThisInitialized(_this), "listRef", /*#__PURE__*/createRef());
|
|
82
|
+
_defineProperty(_assertThisInitialized(_this), "onEmojiActive", function (emojiId, emoji) {
|
|
41
83
|
if (_this.props.onEmojiActive) {
|
|
42
84
|
_this.props.onEmojiActive(emojiId, emoji);
|
|
43
85
|
}
|
|
44
86
|
});
|
|
45
|
-
_defineProperty(_assertThisInitialized(_this), "onSearch", function (
|
|
87
|
+
_defineProperty(_assertThisInitialized(_this), "onSearch", function (value) {
|
|
46
88
|
if (_this.props.onSearch) {
|
|
47
|
-
_this.props.onSearch(
|
|
89
|
+
_this.props.onSearch(value);
|
|
48
90
|
}
|
|
49
91
|
});
|
|
50
92
|
_defineProperty(_assertThisInitialized(_this), "buildVirtualItemFromGroup", function (group) {
|
|
51
|
-
var _this$
|
|
52
|
-
onEmojiSelected = _this$
|
|
53
|
-
onEmojiDelete = _this$
|
|
93
|
+
var _this$props2 = _this.props,
|
|
94
|
+
onEmojiSelected = _this$props2.onEmojiSelected,
|
|
95
|
+
onEmojiDelete = _this$props2.onEmojiDelete;
|
|
54
96
|
var items = [];
|
|
55
97
|
items.push(new CategoryHeadingItem({
|
|
56
98
|
id: group.category,
|
|
@@ -62,12 +104,14 @@ var EmojiPickerVirtualList = /*#__PURE__*/function (_PureComponent) {
|
|
|
62
104
|
var rowEmojis = remainingEmojis.slice(0, sizes.emojiPerRow);
|
|
63
105
|
remainingEmojis = remainingEmojis.slice(sizes.emojiPerRow);
|
|
64
106
|
items.push(new EmojisRowItem({
|
|
107
|
+
category: group.category,
|
|
65
108
|
emojis: rowEmojis,
|
|
66
109
|
title: group.title,
|
|
67
110
|
showDelete: group.title === userCustomTitle,
|
|
68
111
|
onSelected: onEmojiSelected,
|
|
69
112
|
onDelete: onEmojiDelete,
|
|
70
|
-
onMouseMove: _this.
|
|
113
|
+
onMouseMove: _this.onEmojiActive,
|
|
114
|
+
onFocus: _this.onEmojiActive
|
|
71
115
|
}));
|
|
72
116
|
}
|
|
73
117
|
return items;
|
|
@@ -85,7 +129,7 @@ var EmojiPickerVirtualList = /*#__PURE__*/function (_PureComponent) {
|
|
|
85
129
|
var search = CategoryDescriptionMap.SEARCH;
|
|
86
130
|
// Only a single "result" category
|
|
87
131
|
items = [].concat(_toConsumableArray(items), _toConsumableArray(_this.buildVirtualItemFromGroup({
|
|
88
|
-
category:
|
|
132
|
+
category: searchCategory,
|
|
89
133
|
title: search.name,
|
|
90
134
|
emojis: emojis,
|
|
91
135
|
order: search.order
|
|
@@ -99,22 +143,16 @@ var EmojiPickerVirtualList = /*#__PURE__*/function (_PureComponent) {
|
|
|
99
143
|
// by not passing it to irrelevant groups
|
|
100
144
|
_this.categoryTracker.add(group.emojis[0].category, items.length);
|
|
101
145
|
items = [].concat(_toConsumableArray(items), _toConsumableArray(_this.buildVirtualItemFromGroup(group)));
|
|
146
|
+
if (group.category === yourUploadsCategory) {
|
|
147
|
+
_this.lastYourUploadsRow = items.length - 1;
|
|
148
|
+
}
|
|
149
|
+
});
|
|
150
|
+
_this.onRowsRendered({
|
|
151
|
+
startIndex: 0
|
|
102
152
|
});
|
|
103
153
|
}
|
|
104
154
|
}
|
|
105
|
-
var rowCountChanged = _this.virtualItems.length !== items.length;
|
|
106
155
|
_this.virtualItems = items;
|
|
107
|
-
var list = _this.refs.list;
|
|
108
|
-
if (!rowCountChanged && list) {
|
|
109
|
-
// Row count has not changed, so need to tell list to rerender.
|
|
110
|
-
list.forceUpdateGrid();
|
|
111
|
-
}
|
|
112
|
-
if (!query && list) {
|
|
113
|
-
// VirtualList can apply stale heights since it performs a shallow
|
|
114
|
-
// compare to check if the list has changed. Should manually recompute
|
|
115
|
-
// row heights for the case when frequent category come in later
|
|
116
|
-
list.recomputeRowHeights();
|
|
117
|
-
}
|
|
118
156
|
});
|
|
119
157
|
_defineProperty(_assertThisInitialized(_this), "addToCategoryMap", function (categoryToGroupMap, emoji, category) {
|
|
120
158
|
if (!categoryToGroupMap[category]) {
|
|
@@ -134,7 +172,7 @@ var EmojiPickerVirtualList = /*#__PURE__*/function (_PureComponent) {
|
|
|
134
172
|
_this.addToCategoryMap(categoryToGroupMap, emoji, emoji.category);
|
|
135
173
|
// separate user emojis
|
|
136
174
|
if (emoji.category === customCategory && currentUser && emoji.creatorUserId === currentUser.id) {
|
|
137
|
-
_this.addToCategoryMap(categoryToGroupMap, emoji,
|
|
175
|
+
_this.addToCategoryMap(categoryToGroupMap, emoji, yourUploadsCategory);
|
|
138
176
|
}
|
|
139
177
|
return categoryToGroupMap;
|
|
140
178
|
};
|
|
@@ -144,37 +182,45 @@ var EmojiPickerVirtualList = /*#__PURE__*/function (_PureComponent) {
|
|
|
144
182
|
_this.allEmojiGroups = Object.keys(categoryToGroupMap).map(function (key) {
|
|
145
183
|
return categoryToGroupMap[key];
|
|
146
184
|
}).map(function (group) {
|
|
147
|
-
if (group.category !==
|
|
185
|
+
if (group.category !== frequentCategory) {
|
|
148
186
|
group.emojis.sort(byOrder);
|
|
149
187
|
}
|
|
150
188
|
return group;
|
|
151
189
|
}).sort(byOrder);
|
|
152
190
|
});
|
|
153
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
191
|
+
_defineProperty(_assertThisInitialized(_this), "findCategoryToActivate", function (row) {
|
|
192
|
+
var category = null;
|
|
193
|
+
if (row instanceof CategoryHeadingItem) {
|
|
194
|
+
category = row.props.id;
|
|
195
|
+
} else if (row instanceof EmojisRowItem) {
|
|
196
|
+
category = row.props.category;
|
|
197
|
+
}
|
|
198
|
+
// your uploads is rendered, take it as upload category, so could be highlighted in category selector
|
|
199
|
+
if (category === yourUploadsCategory) {
|
|
200
|
+
return customCategory;
|
|
201
|
+
// search results is rendered, return null so won't be highlighted for category selector
|
|
202
|
+
} else if (category === searchCategory) {
|
|
203
|
+
return null;
|
|
163
204
|
}
|
|
205
|
+
return category;
|
|
164
206
|
});
|
|
165
|
-
_defineProperty(_assertThisInitialized(_this), "
|
|
207
|
+
_defineProperty(_assertThisInitialized(_this), "onRowsRendered", function (indexes) {
|
|
166
208
|
var startIndex = indexes.startIndex;
|
|
209
|
+
var rowItem = _this.virtualItems[startIndex];
|
|
210
|
+
var list = _this.listRef.current;
|
|
167
211
|
|
|
168
|
-
//
|
|
169
|
-
if (
|
|
170
|
-
|
|
212
|
+
// update tabIndex manually, startIndex is not 0 based here
|
|
213
|
+
if (rowItem instanceof CategoryHeadingItem) {
|
|
214
|
+
// if top of row rendered is category heading, update tabIndex for the next emoji row
|
|
215
|
+
list === null || list === void 0 ? void 0 : list.updateFocusIndex(startIndex + 1);
|
|
216
|
+
} else if (rowItem instanceof EmojisRowItem) {
|
|
217
|
+
// if top of row rendered is emoji row, update it's tabIndex.
|
|
218
|
+
list === null || list === void 0 ? void 0 : list.updateFocusIndex(startIndex);
|
|
171
219
|
}
|
|
172
220
|
if (!_this.props.query) {
|
|
173
221
|
// Calculate category in view - only relevant if categories shown, i.e. no query
|
|
174
|
-
var
|
|
175
|
-
|
|
176
|
-
if (currentCategory && _this.activeCategoryId !== currentCategory) {
|
|
177
|
-
_this.activeCategoryId = currentCategory;
|
|
222
|
+
var currentCategory = _this.findCategoryToActivate(rowItem);
|
|
223
|
+
if (currentCategory !== null && _this.props.activeCategoryId !== currentCategory) {
|
|
178
224
|
if (_this.props.onCategoryActivated) {
|
|
179
225
|
_this.props.onCategoryActivated(currentCategory);
|
|
180
226
|
}
|
|
@@ -188,11 +234,12 @@ var EmojiPickerVirtualList = /*#__PURE__*/function (_PureComponent) {
|
|
|
188
234
|
_defineProperty(_assertThisInitialized(_this), "renderRow", function (context) {
|
|
189
235
|
return virtualItemRenderer(_this.virtualItems, context);
|
|
190
236
|
});
|
|
237
|
+
_this.lastYourUploadsRow = 0;
|
|
191
238
|
_this.buildEmojiGroupedByCategory(_props.emojis, _props.currentUser);
|
|
192
239
|
_this.buildVirtualItems(_props, _this.state);
|
|
193
240
|
return _this;
|
|
194
241
|
}
|
|
195
|
-
_createClass(
|
|
242
|
+
_createClass(EmojiPickerVirtualListInternal, [{
|
|
196
243
|
key: "UNSAFE_componentWillUpdate",
|
|
197
244
|
value: function UNSAFE_componentWillUpdate(nextProps, nextState) {
|
|
198
245
|
if (this.props.emojis !== nextProps.emojis || this.props.selectedTone !== nextProps.selectedTone || this.props.loading !== nextProps.loading || this.props.query !== nextProps.query) {
|
|
@@ -211,42 +258,59 @@ var EmojiPickerVirtualList = /*#__PURE__*/function (_PureComponent) {
|
|
|
211
258
|
*/
|
|
212
259
|
function reveal(category) {
|
|
213
260
|
var row = this.categoryTracker.getRow(category);
|
|
214
|
-
|
|
215
|
-
list.scrollToRow(row);
|
|
261
|
+
this.scrollToRow(row);
|
|
216
262
|
}
|
|
217
263
|
}, {
|
|
218
264
|
key: "scrollToBottom",
|
|
219
265
|
value: function scrollToBottom() {
|
|
220
|
-
|
|
221
|
-
|
|
266
|
+
this.scrollToRow(this.virtualItems.length);
|
|
267
|
+
}
|
|
268
|
+
}, {
|
|
269
|
+
key: "scrollToTop",
|
|
270
|
+
value: function scrollToTop() {
|
|
271
|
+
this.scrollToRow(0);
|
|
272
|
+
}
|
|
273
|
+
}, {
|
|
274
|
+
key: "scrollToRow",
|
|
275
|
+
value: function scrollToRow(index) {
|
|
276
|
+
var _this$listRef$current;
|
|
277
|
+
(_this$listRef$current = this.listRef.current) === null || _this$listRef$current === void 0 ? void 0 : _this$listRef$current.scrollToRow(index);
|
|
278
|
+
}
|
|
279
|
+
}, {
|
|
280
|
+
key: "scrollToRecentlyUploaded",
|
|
281
|
+
value: function scrollToRecentlyUploaded() {
|
|
282
|
+
var row = this.lastYourUploadsRow;
|
|
283
|
+
if (row > 0) {
|
|
284
|
+
var _this$listRef$current2;
|
|
285
|
+
(_this$listRef$current2 = this.listRef.current) === null || _this$listRef$current2 === void 0 ? void 0 : _this$listRef$current2.scrollToRowAndFocusLastEmoji(this.lastYourUploadsRow);
|
|
286
|
+
}
|
|
222
287
|
}
|
|
223
288
|
}, {
|
|
224
289
|
key: "render",
|
|
225
290
|
value: function render() {
|
|
226
|
-
var _this$
|
|
227
|
-
query = _this$
|
|
228
|
-
selectedTone = _this$
|
|
229
|
-
onToneSelected = _this$
|
|
230
|
-
onToneSelectorCancelled = _this$
|
|
231
|
-
toneEmoji = _this$
|
|
232
|
-
uploading = _this$
|
|
233
|
-
uploadEnabled = _this$
|
|
234
|
-
emojiToDelete = _this$
|
|
235
|
-
initialUploadName = _this$
|
|
236
|
-
uploadErrorMessage = _this$
|
|
237
|
-
onUploadCancelled = _this$
|
|
238
|
-
onUploadEmoji = _this$
|
|
239
|
-
onCloseDelete = _this$
|
|
240
|
-
onDeleteEmoji = _this$
|
|
241
|
-
onFileChooserClicked = _this$
|
|
242
|
-
onOpenUpload = _this$
|
|
243
|
-
_this$
|
|
244
|
-
size = _this$
|
|
291
|
+
var _this$props3 = this.props,
|
|
292
|
+
query = _this$props3.query,
|
|
293
|
+
selectedTone = _this$props3.selectedTone,
|
|
294
|
+
onToneSelected = _this$props3.onToneSelected,
|
|
295
|
+
onToneSelectorCancelled = _this$props3.onToneSelectorCancelled,
|
|
296
|
+
toneEmoji = _this$props3.toneEmoji,
|
|
297
|
+
uploading = _this$props3.uploading,
|
|
298
|
+
uploadEnabled = _this$props3.uploadEnabled,
|
|
299
|
+
emojiToDelete = _this$props3.emojiToDelete,
|
|
300
|
+
initialUploadName = _this$props3.initialUploadName,
|
|
301
|
+
uploadErrorMessage = _this$props3.uploadErrorMessage,
|
|
302
|
+
onUploadCancelled = _this$props3.onUploadCancelled,
|
|
303
|
+
onUploadEmoji = _this$props3.onUploadEmoji,
|
|
304
|
+
onCloseDelete = _this$props3.onCloseDelete,
|
|
305
|
+
onDeleteEmoji = _this$props3.onDeleteEmoji,
|
|
306
|
+
onFileChooserClicked = _this$props3.onFileChooserClicked,
|
|
307
|
+
onOpenUpload = _this$props3.onOpenUpload,
|
|
308
|
+
_this$props3$size = _this$props3.size,
|
|
309
|
+
size = _this$props3$size === void 0 ? defaultEmojiPickerSize : _this$props3$size,
|
|
310
|
+
emojis = _this$props3.emojis;
|
|
245
311
|
var virtualListHeight = sizes.listHeight + emojiPickerHeightOffset(size);
|
|
246
|
-
return jsx(
|
|
247
|
-
|
|
248
|
-
css: emojiPickerList,
|
|
249
|
-
"data-testid": RENDER_EMOJI_PICKER_LIST_TESTID
|
|
312
|
+
return jsx(EmojiPickerTabPanel, {
|
|
313
|
+
showSearchResults: !!query
|
|
250
314
|
}, jsx(EmojiActions, {
|
|
251
315
|
selectedTone: selectedTone,
|
|
252
316
|
onToneSelected: onToneSelected,
|
|
@@ -264,9 +328,15 @@ var EmojiPickerVirtualList = /*#__PURE__*/function (_PureComponent) {
|
|
|
264
328
|
onFileChooserClicked: onFileChooserClicked,
|
|
265
329
|
onOpenUpload: onOpenUpload,
|
|
266
330
|
query: query,
|
|
267
|
-
onChange: this.onSearch
|
|
268
|
-
|
|
269
|
-
|
|
331
|
+
onChange: this.onSearch,
|
|
332
|
+
resultsCount: emojis.length
|
|
333
|
+
}), jsx(EmojiPickerListContextProvider, {
|
|
334
|
+
initialEmojisFocus: {
|
|
335
|
+
rowIndex: 1,
|
|
336
|
+
columnIndex: 0
|
|
337
|
+
}
|
|
338
|
+
}, jsx(VirtualList, {
|
|
339
|
+
ref: this.listRef,
|
|
270
340
|
height: virtualListHeight,
|
|
271
341
|
overscanRowCount: 10,
|
|
272
342
|
rowCount: this.virtualItems.length,
|
|
@@ -274,13 +344,13 @@ var EmojiPickerVirtualList = /*#__PURE__*/function (_PureComponent) {
|
|
|
274
344
|
rowRenderer: this.renderRow,
|
|
275
345
|
scrollToAlignment: "start",
|
|
276
346
|
width: sizes.listWidth,
|
|
277
|
-
onRowsRendered: this.
|
|
278
|
-
}));
|
|
347
|
+
onRowsRendered: this.onRowsRendered
|
|
348
|
+
})));
|
|
279
349
|
}
|
|
280
350
|
}]);
|
|
281
|
-
return
|
|
351
|
+
return EmojiPickerVirtualListInternal;
|
|
282
352
|
}(PureComponent);
|
|
283
|
-
_defineProperty(
|
|
353
|
+
_defineProperty(EmojiPickerVirtualListInternal, "defaultProps", {
|
|
284
354
|
onEmojiSelected: function onEmojiSelected() {},
|
|
285
355
|
onEmojiActive: function onEmojiActive() {},
|
|
286
356
|
onEmojiDelete: function onEmojiDelete() {},
|
|
@@ -288,4 +358,4 @@ _defineProperty(EmojiPickerVirtualList, "defaultProps", {
|
|
|
288
358
|
onSearch: function onSearch() {},
|
|
289
359
|
size: defaultEmojiPickerSize
|
|
290
360
|
});
|
|
291
|
-
export {
|
|
361
|
+
export { EmojiPickerVirtualListInternal as default };
|
|
@@ -1,126 +1,73 @@
|
|
|
1
|
-
import
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
10
2
|
/** @jsx jsx */
|
|
11
|
-
import React, {
|
|
3
|
+
import React, { useLayoutEffect, useRef, useState } from 'react';
|
|
12
4
|
import { jsx } from '@emotion/react';
|
|
13
5
|
import TextField from '@atlaskit/textfield';
|
|
14
6
|
import SearchIcon from '@atlaskit/icon/glyph/search';
|
|
15
|
-
import
|
|
7
|
+
import VisuallyHidden from '@atlaskit/visually-hidden';
|
|
8
|
+
import { useIntl } from 'react-intl-next';
|
|
16
9
|
import { messages } from '../i18n';
|
|
17
10
|
import { input, pickerSearch, searchIcon } from './styles';
|
|
11
|
+
import { EMOJI_SEARCH_DEBOUNCE } from '../../util/constants';
|
|
12
|
+
import { useDebouncedCallback } from 'use-debounce';
|
|
18
13
|
export var emojiPickerSearchTestId = 'emoji-picker-serach';
|
|
19
|
-
var EmojiPickerListSearch =
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
14
|
+
export var EmojiPickerListSearch = function EmojiPickerListSearch(props) {
|
|
15
|
+
var style = props.style,
|
|
16
|
+
query = props.query,
|
|
17
|
+
resultsCount = props.resultsCount,
|
|
18
|
+
onChange = props.onChange;
|
|
19
|
+
var textRef = useRef(null);
|
|
20
|
+
var _useState = useState(false),
|
|
21
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
22
|
+
dirty = _useState2[0],
|
|
23
|
+
setDirty = _useState2[1];
|
|
24
|
+
var _useIntl = useIntl(),
|
|
25
|
+
formatMessage = _useIntl.formatMessage;
|
|
26
|
+
|
|
27
|
+
// Debounce callback
|
|
28
|
+
var _useDebouncedCallback = useDebouncedCallback(function (value) {
|
|
29
|
+
onChange(value);
|
|
30
|
+
setDirty(true);
|
|
31
|
+
},
|
|
32
|
+
// delay in ms
|
|
33
|
+
EMOJI_SEARCH_DEBOUNCE),
|
|
34
|
+
_useDebouncedCallback2 = _slicedToArray(_useDebouncedCallback, 1),
|
|
35
|
+
debouncedSearch = _useDebouncedCallback2[0];
|
|
36
|
+
var handleOnChange = function handleOnChange(e) {
|
|
37
|
+
debouncedSearch(e.target.value);
|
|
38
|
+
};
|
|
39
|
+
useLayoutEffect(function () {
|
|
40
|
+
requestAnimationFrame(function () {
|
|
41
|
+
if (textRef) {
|
|
42
|
+
var _textRef$current;
|
|
43
|
+
(_textRef$current = textRef.current) === null || _textRef$current === void 0 ? void 0 : _textRef$current.focus();
|
|
35
44
|
}
|
|
36
45
|
});
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
var _this$inputRef = this.inputRef,
|
|
66
|
-
selectionStart = _this$inputRef.selectionStart,
|
|
67
|
-
selectionEnd = _this$inputRef.selectionEnd,
|
|
68
|
-
selectionDirection = _this$inputRef.selectionDirection;
|
|
69
|
-
if (selectionStart && selectionEnd && selectionDirection) {
|
|
70
|
-
this.inputSelection = {
|
|
71
|
-
selectionStart: selectionStart,
|
|
72
|
-
selectionEnd: selectionEnd,
|
|
73
|
-
selectionDirection: selectionDirection
|
|
74
|
-
};
|
|
75
|
-
}
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}, {
|
|
79
|
-
key: "restoreInputFocus",
|
|
80
|
-
value: function restoreInputFocus() {
|
|
81
|
-
this.focusInput();
|
|
82
|
-
if (this.inputSelection && this.inputRef && this.inputRef.setSelectionRange) {
|
|
83
|
-
var _this$inputSelection = this.inputSelection,
|
|
84
|
-
selectionStart = _this$inputSelection.selectionStart,
|
|
85
|
-
selectionEnd = _this$inputSelection.selectionEnd,
|
|
86
|
-
selectionDirection = _this$inputSelection.selectionDirection;
|
|
87
|
-
this.inputRef.setSelectionRange(selectionStart, selectionEnd, selectionDirection);
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
}, {
|
|
91
|
-
key: "render",
|
|
92
|
-
value: function render() {
|
|
93
|
-
var _this$props = this.props,
|
|
94
|
-
style = _this$props.style,
|
|
95
|
-
query = _this$props.query,
|
|
96
|
-
intl = _this$props.intl;
|
|
97
|
-
var formatMessage = intl.formatMessage;
|
|
98
|
-
return jsx("div", {
|
|
99
|
-
css: pickerSearch,
|
|
100
|
-
style: style
|
|
101
|
-
}, jsx(TextField, {
|
|
102
|
-
"aria-label": formatMessage(messages.searchLabel),
|
|
103
|
-
css: input,
|
|
104
|
-
autoComplete: "off",
|
|
105
|
-
name: "search",
|
|
106
|
-
placeholder: "".concat(formatMessage(messages.searchPlaceholder), "..."),
|
|
107
|
-
onChange: this.onChange,
|
|
108
|
-
value: query || '',
|
|
109
|
-
ref: this.handleInputRef,
|
|
110
|
-
isCompact: true,
|
|
111
|
-
onBlur: this.onBlur,
|
|
112
|
-
elemBeforeInput: jsx("span", {
|
|
113
|
-
css: searchIcon
|
|
114
|
-
}, jsx(SearchIcon, {
|
|
115
|
-
label: ""
|
|
116
|
-
})),
|
|
117
|
-
testId: emojiPickerSearchTestId
|
|
118
|
-
}));
|
|
119
|
-
}
|
|
120
|
-
}]);
|
|
121
|
-
return EmojiPickerListSearch;
|
|
122
|
-
}(PureComponent);
|
|
123
|
-
_defineProperty(EmojiPickerListSearch, "defaultProps", {
|
|
124
|
-
style: {}
|
|
125
|
-
});
|
|
126
|
-
export default injectIntl(EmojiPickerListSearch);
|
|
46
|
+
}, []);
|
|
47
|
+
return jsx("div", {
|
|
48
|
+
css: pickerSearch,
|
|
49
|
+
style: style
|
|
50
|
+
}, jsx(VisuallyHidden, {
|
|
51
|
+
id: "emoji-search-results-status",
|
|
52
|
+
role: "status"
|
|
53
|
+
}, dirty && query === '' && formatMessage(messages.searchResultsStatusSeeAll), query !== '' && formatMessage(messages.searchResultsStatus, {
|
|
54
|
+
count: resultsCount
|
|
55
|
+
})), jsx(TextField, {
|
|
56
|
+
role: "searchbox",
|
|
57
|
+
"aria-label": formatMessage(messages.searchLabel),
|
|
58
|
+
css: input,
|
|
59
|
+
autoComplete: "off",
|
|
60
|
+
name: "search",
|
|
61
|
+
placeholder: "".concat(formatMessage(messages.searchPlaceholder), "..."),
|
|
62
|
+
defaultValue: query || '',
|
|
63
|
+
onChange: handleOnChange,
|
|
64
|
+
elemBeforeInput: jsx("span", {
|
|
65
|
+
css: searchIcon
|
|
66
|
+
}, jsx(SearchIcon, {
|
|
67
|
+
label: ""
|
|
68
|
+
})),
|
|
69
|
+
testId: emojiPickerSearchTestId,
|
|
70
|
+
ref: textRef,
|
|
71
|
+
isCompact: true
|
|
72
|
+
}));
|
|
73
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
2
3
|
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
@@ -27,8 +28,10 @@ export var EmojisRowItem = /*#__PURE__*/function (_AbstractItem) {
|
|
|
27
28
|
var _this;
|
|
28
29
|
_classCallCheck(this, EmojisRowItem);
|
|
29
30
|
_this = _super.call(this, props, sizes.emojiRowHeight);
|
|
30
|
-
_defineProperty(_assertThisInitialized(_this), "renderItem", function () {
|
|
31
|
-
return jsx(EmojiPickerEmojiRow, _this.props
|
|
31
|
+
_defineProperty(_assertThisInitialized(_this), "renderItem", function (context) {
|
|
32
|
+
return jsx(EmojiPickerEmojiRow, _extends({}, _this.props, {
|
|
33
|
+
virtualItemContext: context
|
|
34
|
+
}));
|
|
32
35
|
});
|
|
33
36
|
return _this;
|
|
34
37
|
}
|