@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,192 +1,294 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
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
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
function
|
|
9
|
-
function
|
|
2
|
+
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
3
|
+
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
10
4
|
/** @jsx jsx */
|
|
11
5
|
import { jsx } from '@emotion/react';
|
|
12
|
-
import
|
|
13
|
-
import React, { PureComponent, createRef } from 'react';
|
|
6
|
+
import React, { useCallback, useImperativeHandle } from 'react';
|
|
14
7
|
import { virtualList } from './styles';
|
|
8
|
+
import { useVirtualizer } from '@tanstack/react-virtual';
|
|
9
|
+
import { useEmojiPickerListContext } from '../../hooks/useEmojiPickerListContext';
|
|
10
|
+
import { EMOJIPICKERLIST_KEYBOARD_KEYS_SUPPORTED, EMOJI_LIST_COLUMNS, EMOJI_LIST_PAGE_COUNT, KeyboardNavigationDirection, KeyboardKeys } from '../../util/constants';
|
|
15
11
|
export var virtualListScrollContainerTestId = 'virtual-list-scroll-container';
|
|
16
|
-
export var VirtualList = /*#__PURE__*/function (
|
|
17
|
-
|
|
18
|
-
var
|
|
12
|
+
export var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
13
|
+
var parentRef = React.useRef(null);
|
|
14
|
+
var virtualistItemsRef = React.useRef(null);
|
|
15
|
+
var rowRenderer = props.rowRenderer,
|
|
16
|
+
onRowsRendered = props.onRowsRendered,
|
|
17
|
+
scrollToAlignment = props.scrollToAlignment,
|
|
18
|
+
width = props.width,
|
|
19
|
+
height = props.height,
|
|
20
|
+
rowCount = props.rowCount;
|
|
21
|
+
var _useEmojiPickerListCo = useEmojiPickerListContext(),
|
|
22
|
+
currentEmojisFocus = _useEmojiPickerListCo.currentEmojisFocus,
|
|
23
|
+
setEmojisFocus = _useEmojiPickerListCo.setEmojisFocus;
|
|
24
|
+
var getVirtualizerOptions = function getVirtualizerOptions() {
|
|
25
|
+
var rowCount = props.rowCount,
|
|
26
|
+
rowHeight = props.rowHeight,
|
|
27
|
+
overscanRowCount = props.overscanRowCount;
|
|
28
|
+
return {
|
|
29
|
+
count: rowCount,
|
|
30
|
+
getScrollElement: function getScrollElement() {
|
|
31
|
+
return parentRef.current;
|
|
32
|
+
},
|
|
33
|
+
estimateSize: rowHeight,
|
|
34
|
+
overscan: overscanRowCount,
|
|
35
|
+
onChange: function onChange() {
|
|
36
|
+
var startIndex = getFirstVisibleListElementIndex();
|
|
37
|
+
onRowsRendered({
|
|
38
|
+
startIndex: startIndex
|
|
39
|
+
});
|
|
40
|
+
},
|
|
41
|
+
scrollPaddingStart: 28,
|
|
42
|
+
scrollPaddingEnd: 28
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
var rowVirtualizer = useVirtualizer(getVirtualizerOptions());
|
|
46
|
+
var isElementVisible = function isElementVisible(element) {
|
|
47
|
+
var parent = parentRef.current;
|
|
48
|
+
var elementRect = element.getBoundingClientRect();
|
|
49
|
+
var parentRect = parent.getBoundingClientRect();
|
|
50
|
+
var elemTop = elementRect.top;
|
|
51
|
+
var elemBottom = elementRect.bottom;
|
|
52
|
+
var parentTop = parentRect.top;
|
|
53
|
+
var parentBottom = parentRect.bottom;
|
|
54
|
+
|
|
55
|
+
// Only completely visible elements return true:
|
|
56
|
+
var isVisible = elemTop >= parentTop && elemBottom <= parentBottom;
|
|
57
|
+
return isVisible;
|
|
58
|
+
};
|
|
59
|
+
var getFirstVisibleListElementIndex = useCallback(function () {
|
|
60
|
+
var _parentRef$current, _parentRef$current$fi;
|
|
61
|
+
var virtualList = rowVirtualizer.getVirtualItems();
|
|
62
|
+
var renderedElements = (_parentRef$current = parentRef.current) === null || _parentRef$current === void 0 ? void 0 : (_parentRef$current$fi = _parentRef$current.firstChild) === null || _parentRef$current$fi === void 0 ? void 0 : _parentRef$current$fi.childNodes;
|
|
63
|
+
if (virtualList.length === 0 || !renderedElements || renderedElements.length === 0) {
|
|
64
|
+
return 0;
|
|
65
|
+
}
|
|
66
|
+
// Convert NodeListOf<ChildNodes> to ChildNodes[]
|
|
67
|
+
var renderedElementsToArray = Array.from(renderedElements);
|
|
68
|
+
var firstVisibleIndex = renderedElementsToArray.findIndex(function (elem) {
|
|
69
|
+
return isElementVisible(elem);
|
|
70
|
+
});
|
|
71
|
+
if (firstVisibleIndex !== -1) {
|
|
72
|
+
var _virtualList$firstVis;
|
|
73
|
+
return ((_virtualList$firstVis = virtualList[firstVisibleIndex]) === null || _virtualList$firstVis === void 0 ? void 0 : _virtualList$firstVis.index) || 0;
|
|
74
|
+
}
|
|
75
|
+
return 0;
|
|
76
|
+
}, [rowVirtualizer]);
|
|
77
|
+
|
|
19
78
|
/**
|
|
20
|
-
*
|
|
79
|
+
* Recurisive function to find next available emoji and it's focus indexes in the grid
|
|
80
|
+
*
|
|
81
|
+
* current focus element is at rowIndex.columnIndex
|
|
82
|
+
* if found element then return the element and focus indexes
|
|
83
|
+
* otherwise change row/column till find the element
|
|
84
|
+
* if can't find the element till reach the edge of grid, we keep current focus states
|
|
85
|
+
*
|
|
86
|
+
* @param rowIndex search from row index (0 based)
|
|
87
|
+
* @param columnIndex search from column index (0 based)
|
|
88
|
+
* @param direction search direction
|
|
21
89
|
*/
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
var
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
_this.parentRef = /*#__PURE__*/createRef();
|
|
29
|
-
_this.rowVirtualizer = new Virtualizer(_this.getVirtualizerOptions(props));
|
|
30
|
-
return _this;
|
|
31
|
-
}
|
|
32
|
-
_createClass(VirtualList, [{
|
|
33
|
-
key: "getVirtualizerOptions",
|
|
34
|
-
value: function getVirtualizerOptions(props) {
|
|
35
|
-
var _this2 = this;
|
|
36
|
-
var rowCount = props.rowCount,
|
|
37
|
-
rowHeight = props.rowHeight,
|
|
38
|
-
overscanRowCount = props.overscanRowCount;
|
|
90
|
+
var findNextEmoji = useCallback(function (rowIndex, columnIndex, direction) {
|
|
91
|
+
var _virtualistItemsRef$c;
|
|
92
|
+
var emojiToFocus = (_virtualistItemsRef$c = virtualistItemsRef.current) === null || _virtualistItemsRef$c === void 0 ? void 0 : _virtualistItemsRef$c.querySelector("[data-focus-index=\"".concat(rowIndex, "-").concat(columnIndex, "\"]"));
|
|
93
|
+
var lastRowIndex = rowCount - 1;
|
|
94
|
+
var lastColumnIndex = EMOJI_LIST_COLUMNS - 1;
|
|
95
|
+
if (emojiToFocus) {
|
|
39
96
|
return {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
count: rowCount,
|
|
44
|
-
getScrollElement: function getScrollElement() {
|
|
45
|
-
return _this2.parentRef.current;
|
|
46
|
-
},
|
|
47
|
-
estimateSize: rowHeight,
|
|
48
|
-
overscan: overscanRowCount,
|
|
49
|
-
onChange: function onChange() {
|
|
50
|
-
_this2.forceUpdateGrid();
|
|
51
|
-
}
|
|
97
|
+
element: emojiToFocus,
|
|
98
|
+
rowIndex: rowIndex,
|
|
99
|
+
columnIndex: columnIndex
|
|
52
100
|
};
|
|
53
101
|
}
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
102
|
+
switch (direction) {
|
|
103
|
+
case KeyboardNavigationDirection.Down:
|
|
104
|
+
if (rowIndex >= lastRowIndex) {
|
|
105
|
+
return null;
|
|
106
|
+
}
|
|
107
|
+
// find emoji in same column but lower row
|
|
108
|
+
return findNextEmoji(rowIndex + 1, columnIndex, KeyboardNavigationDirection.Down);
|
|
109
|
+
case KeyboardNavigationDirection.Up:
|
|
110
|
+
if (rowIndex <= 0) {
|
|
111
|
+
return null;
|
|
112
|
+
}
|
|
113
|
+
// find emoji in same column but upper row
|
|
114
|
+
return findNextEmoji(rowIndex - 1, columnIndex, KeyboardNavigationDirection.Up);
|
|
115
|
+
case KeyboardNavigationDirection.Left:
|
|
116
|
+
if (rowIndex <= 0) {
|
|
117
|
+
return null;
|
|
118
|
+
}
|
|
119
|
+
if (columnIndex < 0) {
|
|
120
|
+
// find emoji in upper row
|
|
121
|
+
return findNextEmoji(rowIndex - 1, lastColumnIndex, KeyboardNavigationDirection.Left);
|
|
122
|
+
}
|
|
123
|
+
// find emoji on left in the current row
|
|
124
|
+
return findNextEmoji(rowIndex, columnIndex - 1, KeyboardNavigationDirection.Left);
|
|
125
|
+
case KeyboardNavigationDirection.Right:
|
|
126
|
+
if (rowIndex >= lastRowIndex) {
|
|
127
|
+
return null;
|
|
128
|
+
}
|
|
129
|
+
// if no emoji on right, we try first emoji in next row
|
|
130
|
+
return findNextEmoji(rowIndex + 1, 0, KeyboardNavigationDirection.Right);
|
|
131
|
+
default:
|
|
132
|
+
return null;
|
|
68
133
|
}
|
|
69
|
-
},
|
|
70
|
-
key: "getFirstVisibleListElementIndex",
|
|
71
|
-
value: function getFirstVisibleListElementIndex() {
|
|
72
|
-
var _this$parentRef$curre,
|
|
73
|
-
_this$parentRef$curre2,
|
|
74
|
-
_this3 = this;
|
|
75
|
-
var virtualList = this.rowVirtualizer.getVirtualItems();
|
|
76
|
-
var renderedElements = (_this$parentRef$curre = this.parentRef.current) === null || _this$parentRef$curre === void 0 ? void 0 : (_this$parentRef$curre2 = _this$parentRef$curre.firstChild) === null || _this$parentRef$curre2 === void 0 ? void 0 : _this$parentRef$curre2.childNodes;
|
|
77
|
-
if (virtualList.length === 0 || !renderedElements || renderedElements.length === 0) {
|
|
78
|
-
return 0;
|
|
79
|
-
}
|
|
134
|
+
}, [rowCount]);
|
|
80
135
|
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
136
|
+
/**
|
|
137
|
+
* Find the valid emoji to scroll and focus
|
|
138
|
+
*/
|
|
139
|
+
var scrollToRowAndFocusEmoji = useCallback(function (emojiToFocus) {
|
|
140
|
+
if (emojiToFocus) {
|
|
141
|
+
var _emojiToFocus$element;
|
|
142
|
+
rowVirtualizer.scrollToIndex(emojiToFocus.rowIndex, {
|
|
143
|
+
align: 'auto',
|
|
144
|
+
smoothScroll: false
|
|
85
145
|
});
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}, {
|
|
93
|
-
key: "onRendered",
|
|
94
|
-
value: function onRendered() {
|
|
95
|
-
var onRowsRendered = this.props.onRowsRendered;
|
|
96
|
-
this.rowVirtualizer.setOptions(this.getVirtualizerOptions(this.props));
|
|
97
|
-
var startIndex = this.getFirstVisibleListElementIndex();
|
|
98
|
-
onRowsRendered({
|
|
99
|
-
startIndex: startIndex
|
|
146
|
+
(_emojiToFocus$element = emojiToFocus.element) === null || _emojiToFocus$element === void 0 ? void 0 : _emojiToFocus$element.focus({
|
|
147
|
+
preventScroll: true
|
|
148
|
+
});
|
|
149
|
+
setEmojisFocus({
|
|
150
|
+
rowIndex: emojiToFocus.rowIndex,
|
|
151
|
+
columnIndex: emojiToFocus.columnIndex
|
|
100
152
|
});
|
|
101
153
|
}
|
|
102
|
-
},
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
this._isMounted = false;
|
|
120
|
-
}
|
|
121
|
-
}, {
|
|
122
|
-
key: "scrollToRow",
|
|
123
|
-
value: function scrollToRow(index) {
|
|
124
|
-
var scrollToAlignment = this.props.scrollToAlignment;
|
|
125
|
-
if (index !== undefined) {
|
|
126
|
-
var _this$rowVirtualizer;
|
|
127
|
-
(_this$rowVirtualizer = this.rowVirtualizer) === null || _this$rowVirtualizer === void 0 ? void 0 : _this$rowVirtualizer.scrollToIndex(index, {
|
|
128
|
-
align: scrollToAlignment,
|
|
129
|
-
smoothScroll: false
|
|
130
|
-
});
|
|
131
|
-
this.forceUpdateGrid();
|
|
132
|
-
}
|
|
154
|
+
}, [rowVirtualizer, setEmojisFocus]);
|
|
155
|
+
var focusEmoji = useCallback(function (rIndex, cIndex, direction) {
|
|
156
|
+
var waitForScrollFinish = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;
|
|
157
|
+
if (waitForScrollFinish) {
|
|
158
|
+
// scroll to target rowIndex first to ensure the row is rendered in list.
|
|
159
|
+
// used in page up/down, ctrl+Home, ctrl+End
|
|
160
|
+
rowVirtualizer.scrollToIndex(rIndex, {
|
|
161
|
+
align: 'auto',
|
|
162
|
+
smoothScroll: false
|
|
163
|
+
});
|
|
164
|
+
setTimeout(function () {
|
|
165
|
+
var emojiToFocus = findNextEmoji(rIndex, cIndex, direction);
|
|
166
|
+
scrollToRowAndFocusEmoji(emojiToFocus);
|
|
167
|
+
}, 100); // 100ms is virtual list scrolling time
|
|
168
|
+
} else {
|
|
169
|
+
var emojiToFocus = findNextEmoji(rIndex, cIndex, direction);
|
|
170
|
+
scrollToRowAndFocusEmoji(emojiToFocus);
|
|
133
171
|
}
|
|
134
|
-
},
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
172
|
+
}, [scrollToRowAndFocusEmoji, findNextEmoji, rowVirtualizer]);
|
|
173
|
+
|
|
174
|
+
// following the guide from https://www.w3.org/WAI/ARIA/apg/patterns/grid/
|
|
175
|
+
var handleKeyDown = function handleKeyDown(e) {
|
|
176
|
+
if (!EMOJIPICKERLIST_KEYBOARD_KEYS_SUPPORTED.includes(e.key)) {
|
|
177
|
+
return;
|
|
140
178
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
179
|
+
e.preventDefault();
|
|
180
|
+
var lastRowIndex = rowCount - 1;
|
|
181
|
+
var lastColumnIndex = EMOJI_LIST_COLUMNS - 1;
|
|
182
|
+
|
|
183
|
+
// focus first emoji on first row
|
|
184
|
+
if (e.key === KeyboardKeys.Home && e.ctrlKey) {
|
|
185
|
+
focusEmoji(1, 0, KeyboardNavigationDirection.Up, true);
|
|
186
|
+
return;
|
|
187
|
+
} else if (e.key === KeyboardKeys.End && e.ctrlKey) {
|
|
188
|
+
// focus last available emoji on last row
|
|
189
|
+
focusEmoji(lastRowIndex, lastColumnIndex, KeyboardNavigationDirection.Left, true);
|
|
190
|
+
return;
|
|
146
191
|
}
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
192
|
+
switch (e.key) {
|
|
193
|
+
// navigate to the right column
|
|
194
|
+
case KeyboardKeys.ArrowRight:
|
|
195
|
+
focusEmoji(currentEmojisFocus.rowIndex, currentEmojisFocus.columnIndex + 1, KeyboardNavigationDirection.Right);
|
|
196
|
+
break;
|
|
197
|
+
// navigate to the left column
|
|
198
|
+
case KeyboardKeys.ArrowLeft:
|
|
199
|
+
focusEmoji(currentEmojisFocus.rowIndex, currentEmojisFocus.columnIndex - 1, KeyboardNavigationDirection.Left);
|
|
200
|
+
break;
|
|
201
|
+
// navigate to the down row
|
|
202
|
+
case KeyboardKeys.ArrowDown:
|
|
203
|
+
focusEmoji(currentEmojisFocus.rowIndex === lastRowIndex ? lastRowIndex : currentEmojisFocus.rowIndex + 1, currentEmojisFocus.columnIndex, KeyboardNavigationDirection.Down);
|
|
204
|
+
break;
|
|
205
|
+
// navigate to the row after {EMOJI_LIST_PAGE_COUNT} rows
|
|
206
|
+
case KeyboardKeys.PageDown:
|
|
207
|
+
focusEmoji(currentEmojisFocus.rowIndex + EMOJI_LIST_PAGE_COUNT, currentEmojisFocus.columnIndex, KeyboardNavigationDirection.Down, true);
|
|
208
|
+
break;
|
|
209
|
+
// navigate to the up row
|
|
210
|
+
case KeyboardKeys.ArrowUp:
|
|
211
|
+
focusEmoji(currentEmojisFocus.rowIndex <= 1 ? 1 : currentEmojisFocus.rowIndex - 1, currentEmojisFocus.columnIndex, KeyboardNavigationDirection.Up);
|
|
212
|
+
break;
|
|
213
|
+
// navigate to the row before {EMOJI_LIST_PAGE_COUNT} rows
|
|
214
|
+
case KeyboardKeys.PageUp:
|
|
215
|
+
focusEmoji(currentEmojisFocus.rowIndex - EMOJI_LIST_PAGE_COUNT, currentEmojisFocus.columnIndex, KeyboardNavigationDirection.Up, true);
|
|
216
|
+
break;
|
|
217
|
+
// navigate to the first cell of current row
|
|
218
|
+
case KeyboardKeys.Home:
|
|
219
|
+
focusEmoji(currentEmojisFocus.rowIndex, 0, KeyboardNavigationDirection.Left);
|
|
220
|
+
break;
|
|
221
|
+
// navigate to the last cell of current row
|
|
222
|
+
case KeyboardKeys.End:
|
|
223
|
+
focusEmoji(currentEmojisFocus.rowIndex, lastColumnIndex, KeyboardNavigationDirection.Left);
|
|
224
|
+
break;
|
|
151
225
|
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
css: virtualList,
|
|
168
|
-
"data-testid": virtualListScrollContainerTestId,
|
|
169
|
-
onScroll: this.handleScroll
|
|
170
|
-
}, jsx("div", {
|
|
171
|
-
style: {
|
|
172
|
-
height: "".concat((_this$rowVirtualizer3 = this.rowVirtualizer) === null || _this$rowVirtualizer3 === void 0 ? void 0 : _this$rowVirtualizer3.getTotalSize(), "px"),
|
|
173
|
-
width: '100%',
|
|
174
|
-
position: 'relative'
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
// Exposing a custom ref handle to the parent component EmojiPickerList to trigger scrollToRow via the listRef
|
|
229
|
+
// https://beta.reactjs.org/reference/react/useImperativeHandle
|
|
230
|
+
useImperativeHandle(ref, function () {
|
|
231
|
+
return {
|
|
232
|
+
scrollToRow: function scrollToRow(index) {
|
|
233
|
+
if (index !== undefined) {
|
|
234
|
+
rowVirtualizer.setOptions(_objectSpread(_objectSpread({}, rowVirtualizer.options), {}, {
|
|
235
|
+
scrollPaddingStart: 0
|
|
236
|
+
}));
|
|
237
|
+
rowVirtualizer.scrollToIndex(index, {
|
|
238
|
+
align: scrollToAlignment,
|
|
239
|
+
smoothScroll: false
|
|
240
|
+
});
|
|
175
241
|
}
|
|
176
|
-
},
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
}
|
|
242
|
+
},
|
|
243
|
+
scrollToRowAndFocusLastEmoji: function scrollToRowAndFocusLastEmoji(index) {
|
|
244
|
+
if (index !== undefined) {
|
|
245
|
+
focusEmoji(index, EMOJI_LIST_COLUMNS, KeyboardNavigationDirection.Left, true);
|
|
246
|
+
}
|
|
247
|
+
},
|
|
248
|
+
updateFocusIndex: function updateFocusIndex(index) {
|
|
249
|
+
var _virtualistItemsRef$c2;
|
|
250
|
+
// row could be removed from virtual list after scrolling, we'll update emoji cell tabIndex after losing focus
|
|
251
|
+
if (!((_virtualistItemsRef$c2 = virtualistItemsRef.current) !== null && _virtualistItemsRef$c2 !== void 0 && _virtualistItemsRef$c2.contains(document.activeElement))) {
|
|
252
|
+
setEmojisFocus({
|
|
253
|
+
rowIndex: index,
|
|
254
|
+
columnIndex: 0
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
};
|
|
259
|
+
}, [setEmojisFocus, focusEmoji, rowVirtualizer, scrollToAlignment]);
|
|
260
|
+
return jsx("div", {
|
|
261
|
+
ref: parentRef,
|
|
262
|
+
style: {
|
|
263
|
+
height: "".concat(height, "px"),
|
|
264
|
+
width: "".concat(width, "px")
|
|
265
|
+
},
|
|
266
|
+
css: virtualList,
|
|
267
|
+
"data-testid": virtualListScrollContainerTestId,
|
|
268
|
+
"aria-labelledby": "emoji-picker-table-description",
|
|
269
|
+
role: "grid"
|
|
270
|
+
}, jsx("div", {
|
|
271
|
+
style: {
|
|
272
|
+
height: "".concat(rowVirtualizer.getTotalSize(), "px"),
|
|
273
|
+
width: '100%',
|
|
274
|
+
position: 'relative'
|
|
275
|
+
},
|
|
276
|
+
ref: virtualistItemsRef,
|
|
277
|
+
onKeyDown: handleKeyDown,
|
|
278
|
+
role: "presentation"
|
|
279
|
+
}, rowVirtualizer.getVirtualItems().map(function (virtualRow, index) {
|
|
280
|
+
return jsx("div", {
|
|
281
|
+
key: virtualRow.key,
|
|
282
|
+
style: {
|
|
283
|
+
position: 'absolute',
|
|
284
|
+
top: 0,
|
|
285
|
+
left: 0,
|
|
286
|
+
width: '100%',
|
|
287
|
+
height: "".concat(virtualRow.size, "px"),
|
|
288
|
+
transform: "translateY(".concat(virtualRow.start, "px)")
|
|
289
|
+
},
|
|
290
|
+
role: "row",
|
|
291
|
+
"aria-rowindex": index + 1
|
|
292
|
+
}, rowRenderer(virtualRow));
|
|
293
|
+
})));
|
|
294
|
+
});
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
var _css4, _css5
|
|
2
|
+
var _css3, _css4, _css5;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
5
4
|
import { emojiPickerBorderColor, emojiPickerBoxShadow } from '../../util/shared-styles';
|
|
6
5
|
import { emojiSprite, placeholder, emojiNodeStyles } from '../common/styles';
|
|
7
6
|
import { defaultEmojiPickerSize, emojiPickerHeight, emojiPickerHeightWithPreview, emojiPickerMinHeight, emojiPickerWidth } from '../../util/constants';
|
|
8
|
-
import { B200, B300, N100A,
|
|
7
|
+
import { B100, B200, B300, N100A, N30, N30A, N50, N900 } from '@atlaskit/theme/colors';
|
|
9
8
|
import { emojiPickerHeightOffset } from './utils';
|
|
10
9
|
|
|
11
10
|
// Level 1 - picker
|
|
@@ -18,11 +17,10 @@ export var emojiPicker = function emojiPicker(hasPreview) {
|
|
|
18
17
|
justifyContent: 'space-between',
|
|
19
18
|
background: "var(--ds-surface-overlay, white)",
|
|
20
19
|
border: "".concat(emojiPickerBorderColor, " 1px solid"),
|
|
21
|
-
borderRadius: "
|
|
20
|
+
borderRadius: "var(--ds-radius-100, 3px)",
|
|
22
21
|
boxShadow: emojiPickerBoxShadow,
|
|
23
22
|
height: "".concat(hasPreview ? emojiPickerHeightWithPreview + heightOffset : emojiPickerHeight + heightOffset, "px"),
|
|
24
23
|
width: "".concat(emojiPickerWidth, "px"),
|
|
25
|
-
marginBottom: '8px',
|
|
26
24
|
minWidth: "".concat(emojiPickerWidth, "px"),
|
|
27
25
|
minHeight: "".concat(emojiPickerMinHeight + heightOffset, "px"),
|
|
28
26
|
maxHeight: 'calc(80vh - 86px)' // ensure showing full picker in small device: mobile header is 40px (Jira) - 56px(Confluence and Atlas), reaction picker height is 24px with margin 6px,
|
|
@@ -32,32 +30,21 @@ export var emojiPicker = function emojiPicker(hasPreview) {
|
|
|
32
30
|
// Level 2
|
|
33
31
|
|
|
34
32
|
/// Category Selector
|
|
35
|
-
|
|
36
|
-
export var addButton = 'emoji-picker-add-button';
|
|
37
|
-
export var categorySelector = css(_defineProperty({
|
|
33
|
+
export var categorySelector = css({
|
|
38
34
|
flex: '0 0 auto',
|
|
39
35
|
backgroundColor: "var(--ds-surface-sunken, ".concat(N30, ")"),
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
margin: '0 4px',
|
|
43
|
-
padding: '3px 0',
|
|
44
|
-
display: 'flex',
|
|
45
|
-
flexDirection: 'row',
|
|
46
|
-
justifyContent: 'space-around'
|
|
47
|
-
},
|
|
48
|
-
li: {
|
|
49
|
-
display: 'inline-block',
|
|
50
|
-
margin: 0,
|
|
51
|
-
padding: 0,
|
|
52
|
-
button: {
|
|
53
|
-
verticalAlign: 'middle'
|
|
54
|
-
}
|
|
36
|
+
button: {
|
|
37
|
+
display: 'flex' // this will ensure the button height is concise per design
|
|
55
38
|
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
export var categorySelectorTablist = css({
|
|
42
|
+
padding: '6px 8px',
|
|
43
|
+
display: 'flex',
|
|
44
|
+
flexDirection: 'row',
|
|
45
|
+
justifyContent: 'space-around',
|
|
46
|
+
alignItems: 'center'
|
|
47
|
+
});
|
|
61
48
|
export var active = css(_defineProperty({
|
|
62
49
|
color: "var(--ds-text-selected, ".concat(B300, ")")
|
|
63
50
|
}, '&:hover', {
|
|
@@ -69,20 +56,24 @@ export var disable = css(_defineProperty({
|
|
|
69
56
|
}, '&:hover', {
|
|
70
57
|
color: "var(--ds-text-subtlest, ".concat(N50, ")")
|
|
71
58
|
}));
|
|
72
|
-
export var categoryStyles = css((
|
|
59
|
+
export var categoryStyles = css((_css3 = {
|
|
73
60
|
backgroundColor: 'transparent',
|
|
74
61
|
border: 0,
|
|
62
|
+
borderRadius: "var(--ds-radius-100, 3px)",
|
|
75
63
|
color: "var(--ds-text-subtlest, ".concat(N100A, ")"),
|
|
76
64
|
cursor: 'pointer',
|
|
77
|
-
margin: '2px 0',
|
|
78
65
|
padding: 0,
|
|
79
66
|
transition: 'color 0.2s ease'
|
|
80
|
-
}, _defineProperty(
|
|
67
|
+
}, _defineProperty(_css3, '&::-moz-focus-inner', {
|
|
81
68
|
border: '0 none',
|
|
82
69
|
padding: 0
|
|
83
|
-
}), _defineProperty(
|
|
70
|
+
}), _defineProperty(_css3, '&:hover', {
|
|
84
71
|
color: "var(--ds-text-selected, ".concat(B200, ")")
|
|
85
|
-
}),
|
|
72
|
+
}), _defineProperty(_css3, '&:focus', {
|
|
73
|
+
boxShadow: "0 0 0 2px ".concat("var(--ds-border-focused, ".concat(B100, ")")),
|
|
74
|
+
transitionDuration: '0s, 0.2s',
|
|
75
|
+
outline: 'none'
|
|
76
|
+
}), _css3));
|
|
86
77
|
|
|
87
78
|
/// EmojiPickerList
|
|
88
79
|
|
|
@@ -100,7 +91,8 @@ export var virtualList = css({
|
|
|
100
91
|
overflowY: 'auto',
|
|
101
92
|
'&:focus': {
|
|
102
93
|
outline: 'none'
|
|
103
|
-
}
|
|
94
|
+
},
|
|
95
|
+
paddingBottom: '8px'
|
|
104
96
|
});
|
|
105
97
|
|
|
106
98
|
//// Search
|
|
@@ -108,7 +100,7 @@ export var virtualList = css({
|
|
|
108
100
|
export var searchIcon = css({
|
|
109
101
|
opacity: 0.5
|
|
110
102
|
});
|
|
111
|
-
export var input = css((
|
|
103
|
+
export var input = css((_css4 = {
|
|
112
104
|
boxSizing: 'border-box',
|
|
113
105
|
color: 'inherit',
|
|
114
106
|
cursor: 'inherit',
|
|
@@ -116,11 +108,11 @@ export var input = css((_css5 = {
|
|
|
116
108
|
outline: 'none',
|
|
117
109
|
padding: '1px 0 2px 6px',
|
|
118
110
|
width: '100%'
|
|
119
|
-
}, _defineProperty(
|
|
111
|
+
}, _defineProperty(_css4, '&:invalid', {
|
|
120
112
|
boxShadow: 'none'
|
|
121
|
-
}), _defineProperty(
|
|
113
|
+
}), _defineProperty(_css4, '&::-ms-clear', {
|
|
122
114
|
display: 'none'
|
|
123
|
-
}),
|
|
115
|
+
}), _css4));
|
|
124
116
|
export var pickerSearch = css({
|
|
125
117
|
boxSizing: 'border-box',
|
|
126
118
|
padding: '10px 10px 11px 10px',
|
|
@@ -155,24 +147,24 @@ export var emojiCategoryTitle = css({
|
|
|
155
147
|
textTransform: 'uppercase'
|
|
156
148
|
}
|
|
157
149
|
});
|
|
158
|
-
export var emojiItem = css((
|
|
150
|
+
export var emojiItem = css((_css5 = {
|
|
159
151
|
display: 'inline-block',
|
|
160
152
|
textAlign: 'center',
|
|
161
153
|
width: '40px'
|
|
162
|
-
}, _defineProperty(
|
|
154
|
+
}, _defineProperty(_css5, "& .".concat(emojiNodeStyles), {
|
|
163
155
|
cursor: 'pointer',
|
|
164
156
|
padding: '8px',
|
|
165
157
|
borderRadius: '5px',
|
|
166
158
|
width: '24px',
|
|
167
159
|
height: '24px'
|
|
168
|
-
}), _defineProperty(
|
|
160
|
+
}), _defineProperty(_css5, "& .".concat(placeholder), {
|
|
169
161
|
padding: '0',
|
|
170
162
|
margin: '7px',
|
|
171
163
|
minWidth: '24px',
|
|
172
164
|
maxWidth: '24px'
|
|
173
|
-
}), _defineProperty(
|
|
165
|
+
}), _defineProperty(_css5, "& .".concat(emojiNodeStyles, " .").concat(placeholder), {
|
|
174
166
|
margin: '0'
|
|
175
|
-
}), _defineProperty(
|
|
167
|
+
}), _defineProperty(_css5, "& .".concat(emojiNodeStyles, " > img"), {
|
|
176
168
|
position: 'relative',
|
|
177
169
|
left: '50%',
|
|
178
170
|
top: '50%',
|
|
@@ -180,10 +172,10 @@ export var emojiItem = css((_css6 = {
|
|
|
180
172
|
maxHeight: '24px',
|
|
181
173
|
maxWidth: '24px',
|
|
182
174
|
display: 'block'
|
|
183
|
-
}), _defineProperty(
|
|
175
|
+
}), _defineProperty(_css5, "& .".concat(emojiNodeStyles, " > .").concat(emojiSprite), {
|
|
184
176
|
height: '24px',
|
|
185
177
|
width: '24px'
|
|
186
|
-
}),
|
|
178
|
+
}), _css5));
|
|
187
179
|
|
|
188
180
|
/// Footer
|
|
189
181
|
export var emojiPickerFooter = css({
|