@atlaskit/emoji 67.1.0 → 67.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +29 -0
- package/dist/cjs/api/EmojiResource.js +29 -24
- 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 +60 -24
- 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/ResourcedEmoji.js +5 -3
- 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 +13 -7
- package/dist/cjs/components/picker/EmojiPickerEmojiRow.js +32 -4
- package/dist/cjs/components/picker/EmojiPickerList.js +140 -51
- package/dist/cjs/components/picker/EmojiPickerListSearch.js +16 -3
- package/dist/cjs/components/picker/EmojiPickerVirtualItems.js +5 -2
- package/dist/cjs/components/picker/VirtualList.js +196 -14
- package/dist/cjs/components/picker/styles.js +43 -51
- package/dist/cjs/context/EmojiPickerListContext.js +33 -0
- package/dist/cjs/hooks/useEmojiPickerListContext.js +12 -0
- package/dist/cjs/util/constants.js +40 -1
- package/dist/cjs/util/shared-styles.js +3 -4
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/api/EmojiResource.js +29 -24
- 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 +54 -23
- 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/ResourcedEmoji.js +5 -3
- 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 +14 -7
- package/dist/es2019/components/picker/EmojiPickerEmojiRow.js +51 -21
- package/dist/es2019/components/picker/EmojiPickerList.js +102 -21
- package/dist/es2019/components/picker/EmojiPickerListSearch.js +14 -4
- package/dist/es2019/components/picker/EmojiPickerVirtualItems.js +4 -1
- package/dist/es2019/components/picker/VirtualList.js +193 -12
- package/dist/es2019/components/picker/styles.js +20 -28
- package/dist/es2019/context/EmojiPickerListContext.js +17 -0
- package/dist/es2019/hooks/useEmojiPickerListContext.js +3 -0
- package/dist/es2019/util/constants.js +31 -0
- package/dist/es2019/util/shared-styles.js +1 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/api/EmojiResource.js +29 -24
- 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 +61 -25
- 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/ResourcedEmoji.js +5 -3
- 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 +13 -7
- package/dist/esm/components/picker/EmojiPickerEmojiRow.js +32 -4
- package/dist/esm/components/picker/EmojiPickerList.js +141 -52
- package/dist/esm/components/picker/EmojiPickerListSearch.js +17 -4
- package/dist/esm/components/picker/EmojiPickerVirtualItems.js +5 -2
- package/dist/esm/components/picker/VirtualList.js +195 -12
- package/dist/esm/components/picker/styles.js +37 -45
- package/dist/esm/context/EmojiPickerListContext.js +21 -0
- package/dist/esm/hooks/useEmojiPickerListContext.js +5 -0
- package/dist/esm/util/constants.js +31 -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 +3 -2
- 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 +10 -5
- package/dist/types/components/picker/EmojiPickerListSearch.d.ts +1 -0
- package/dist/types/components/picker/EmojiPickerVirtualItems.d.ts +1 -1
- package/dist/types/components/picker/VirtualList.d.ts +2 -0
- 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/util/constants.d.ts +27 -0
- package/dist/types/util/shared-styles.d.ts +1 -1
- package/dist/types/util/type-helpers.d.ts +1 -1
- package/package.json +9 -6
- package/report.api.md +52 -1
- package/README.md +0 -3
- package/dist/es2019/components/common/EmojiButton.js +0 -49
- package/dist/esm/components/common/EmojiButton.js +0 -43
- /package/dist/cjs/{components/hooks.js → hooks/useIsMounted.js} +0 -0
- /package/dist/es2019/{components/hooks.js → hooks/useIsMounted.js} +0 -0
- /package/dist/esm/{components/hooks.js → hooks/useIsMounted.js} +0 -0
- /package/dist/types/{components/hooks.d.ts → hooks/useIsMounted.d.ts} +0 -0
|
@@ -1,17 +1,26 @@
|
|
|
1
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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; }
|
|
1
4
|
/** @jsx jsx */
|
|
2
5
|
import { jsx } from '@emotion/react';
|
|
3
6
|
import React, { useCallback, useImperativeHandle } from 'react';
|
|
4
7
|
import { virtualList } from './styles';
|
|
5
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';
|
|
6
11
|
export var virtualListScrollContainerTestId = 'virtual-list-scroll-container';
|
|
7
12
|
export var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
8
13
|
var parentRef = React.useRef(null);
|
|
9
|
-
var
|
|
14
|
+
var virtualistItemsRef = React.useRef(null);
|
|
10
15
|
var rowRenderer = props.rowRenderer,
|
|
11
16
|
onRowsRendered = props.onRowsRendered,
|
|
12
17
|
scrollToAlignment = props.scrollToAlignment,
|
|
13
18
|
width = props.width,
|
|
14
|
-
height = props.height
|
|
19
|
+
height = props.height,
|
|
20
|
+
rowCount = props.rowCount;
|
|
21
|
+
var _useEmojiPickerListCo = useEmojiPickerListContext(),
|
|
22
|
+
currentEmojisFocus = _useEmojiPickerListCo.currentEmojisFocus,
|
|
23
|
+
setEmojisFocus = _useEmojiPickerListCo.setEmojisFocus;
|
|
15
24
|
var getVirtualizerOptions = function getVirtualizerOptions() {
|
|
16
25
|
var rowCount = props.rowCount,
|
|
17
26
|
rowHeight = props.rowHeight,
|
|
@@ -28,7 +37,9 @@ export var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
28
37
|
onRowsRendered({
|
|
29
38
|
startIndex: startIndex
|
|
30
39
|
});
|
|
31
|
-
}
|
|
40
|
+
},
|
|
41
|
+
scrollPaddingStart: 28,
|
|
42
|
+
scrollPaddingEnd: 28
|
|
32
43
|
};
|
|
33
44
|
};
|
|
34
45
|
var rowVirtualizer = useVirtualizer(getVirtualizerOptions());
|
|
@@ -64,38 +75,208 @@ export var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
64
75
|
return 0;
|
|
65
76
|
}, [rowVirtualizer]);
|
|
66
77
|
|
|
78
|
+
/**
|
|
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
|
|
89
|
+
*/
|
|
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) {
|
|
96
|
+
return {
|
|
97
|
+
element: emojiToFocus,
|
|
98
|
+
rowIndex: rowIndex,
|
|
99
|
+
columnIndex: columnIndex
|
|
100
|
+
};
|
|
101
|
+
}
|
|
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;
|
|
133
|
+
}
|
|
134
|
+
}, [rowCount]);
|
|
135
|
+
|
|
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
|
|
145
|
+
});
|
|
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
|
|
152
|
+
});
|
|
153
|
+
}
|
|
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);
|
|
171
|
+
}
|
|
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;
|
|
178
|
+
}
|
|
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;
|
|
191
|
+
}
|
|
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;
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
|
|
67
228
|
// Exposing a custom ref handle to the parent component EmojiPickerList to trigger scrollToRow via the listRef
|
|
68
229
|
// https://beta.reactjs.org/reference/react/useImperativeHandle
|
|
69
230
|
useImperativeHandle(ref, function () {
|
|
70
231
|
return {
|
|
71
232
|
scrollToRow: function scrollToRow(index) {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
233
|
+
if (index !== undefined) {
|
|
234
|
+
rowVirtualizer.setOptions(_objectSpread(_objectSpread({}, rowVirtualizer.options), {}, {
|
|
235
|
+
scrollPaddingStart: 0
|
|
236
|
+
}));
|
|
75
237
|
rowVirtualizer.scrollToIndex(index, {
|
|
76
238
|
align: scrollToAlignment,
|
|
77
239
|
smoothScroll: false
|
|
78
240
|
});
|
|
79
241
|
}
|
|
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
|
+
}
|
|
80
257
|
}
|
|
81
258
|
};
|
|
82
|
-
}, [
|
|
259
|
+
}, [setEmojisFocus, focusEmoji, rowVirtualizer, scrollToAlignment]);
|
|
83
260
|
return jsx("div", {
|
|
84
261
|
ref: parentRef,
|
|
85
|
-
role: "grid",
|
|
86
262
|
style: {
|
|
87
263
|
height: "".concat(height, "px"),
|
|
88
264
|
width: "".concat(width, "px")
|
|
89
265
|
},
|
|
90
266
|
css: virtualList,
|
|
91
|
-
"data-testid": virtualListScrollContainerTestId
|
|
267
|
+
"data-testid": virtualListScrollContainerTestId,
|
|
268
|
+
"aria-labelledby": "emoji-picker-table-description",
|
|
269
|
+
role: "grid"
|
|
92
270
|
}, jsx("div", {
|
|
93
271
|
style: {
|
|
94
272
|
height: "".concat(rowVirtualizer.getTotalSize(), "px"),
|
|
95
273
|
width: '100%',
|
|
96
274
|
position: 'relative'
|
|
97
|
-
}
|
|
98
|
-
|
|
275
|
+
},
|
|
276
|
+
ref: virtualistItemsRef,
|
|
277
|
+
onKeyDown: handleKeyDown,
|
|
278
|
+
role: "presentation"
|
|
279
|
+
}, rowVirtualizer.getVirtualItems().map(function (virtualRow, index) {
|
|
99
280
|
return jsx("div", {
|
|
100
281
|
key: virtualRow.key,
|
|
101
282
|
style: {
|
|
@@ -105,7 +286,9 @@ export var VirtualList = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
105
286
|
width: '100%',
|
|
106
287
|
height: "".concat(virtualRow.size, "px"),
|
|
107
288
|
transform: "translateY(".concat(virtualRow.start, "px)")
|
|
108
|
-
}
|
|
289
|
+
},
|
|
290
|
+
role: "row",
|
|
291
|
+
"aria-rowindex": index + 1
|
|
109
292
|
}, rowRenderer(virtualRow));
|
|
110
293
|
})));
|
|
111
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({
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
+
import React, { createContext, useState } from 'react';
|
|
3
|
+
export var EmojiPickerListContext = /*#__PURE__*/createContext({
|
|
4
|
+
currentEmojisFocus: {
|
|
5
|
+
rowIndex: 0,
|
|
6
|
+
columnIndex: 0
|
|
7
|
+
},
|
|
8
|
+
setEmojisFocus: function setEmojisFocus() {}
|
|
9
|
+
});
|
|
10
|
+
export var EmojiPickerListContextProvider = function EmojiPickerListContextProvider(props) {
|
|
11
|
+
var _useState = useState(props.initialEmojisFocus),
|
|
12
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
13
|
+
currentEmojisFocus = _useState2[0],
|
|
14
|
+
setEmojisFocus = _useState2[1];
|
|
15
|
+
return /*#__PURE__*/React.createElement(EmojiPickerListContext.Provider, {
|
|
16
|
+
value: {
|
|
17
|
+
currentEmojisFocus: currentEmojisFocus,
|
|
18
|
+
setEmojisFocus: setEmojisFocus
|
|
19
|
+
}
|
|
20
|
+
}, props.children);
|
|
21
|
+
};
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export var customCategory = 'CUSTOM';
|
|
2
2
|
export var frequentCategory = 'FREQUENT';
|
|
3
3
|
export var customType = 'SITE';
|
|
4
|
+
export var searchCategory = 'SEARCH';
|
|
5
|
+
export var yourUploadsCategory = 'USER_CUSTOM';
|
|
4
6
|
export var customTitle = 'allUploadsCustomCategory';
|
|
5
7
|
export var userCustomTitle = 'userUploadsCustomCategory';
|
|
6
8
|
export var dataURLPrefix = 'data:';
|
|
@@ -24,9 +26,38 @@ export var emojiPickerHeightWithPreview = emojiPickerHeight + emojiPickerPreview
|
|
|
24
26
|
export var localStoragePrefix = 'fabric.emoji';
|
|
25
27
|
export var selectedToneStorageKey = "".concat(localStoragePrefix, ".selectedTone");
|
|
26
28
|
export var defaultCategories = ['PEOPLE', 'NATURE', 'FOODS', 'ACTIVITY', 'PLACES', 'OBJECTS', 'SYMBOLS', 'FLAGS'];
|
|
29
|
+
export var KeyboardKeys;
|
|
30
|
+
|
|
31
|
+
// Used to search available emoji in the picker list to focus
|
|
32
|
+
(function (KeyboardKeys) {
|
|
33
|
+
KeyboardKeys["ArrowLeft"] = "ArrowLeft";
|
|
34
|
+
KeyboardKeys["ArrowRight"] = "ArrowRight";
|
|
35
|
+
KeyboardKeys["ArrowUp"] = "ArrowUp";
|
|
36
|
+
KeyboardKeys["ArrowDown"] = "ArrowDown";
|
|
37
|
+
KeyboardKeys["PageUp"] = "PageUp";
|
|
38
|
+
KeyboardKeys["PageDown"] = "PageDown";
|
|
39
|
+
KeyboardKeys["Home"] = "Home";
|
|
40
|
+
KeyboardKeys["End"] = "End";
|
|
41
|
+
KeyboardKeys["Enter"] = "Enter";
|
|
42
|
+
KeyboardKeys["Tab"] = "Tab";
|
|
43
|
+
KeyboardKeys["Space"] = " ";
|
|
44
|
+
})(KeyboardKeys || (KeyboardKeys = {}));
|
|
45
|
+
export var KeyboardNavigationDirection;
|
|
46
|
+
(function (KeyboardNavigationDirection) {
|
|
47
|
+
KeyboardNavigationDirection["Down"] = "Down";
|
|
48
|
+
KeyboardNavigationDirection["Up"] = "Up";
|
|
49
|
+
KeyboardNavigationDirection["Left"] = "Left";
|
|
50
|
+
KeyboardNavigationDirection["Right"] = "Right";
|
|
51
|
+
})(KeyboardNavigationDirection || (KeyboardNavigationDirection = {}));
|
|
52
|
+
export var CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED = [KeyboardKeys.ArrowRight, KeyboardKeys.ArrowLeft, KeyboardKeys.Home, KeyboardKeys.End];
|
|
53
|
+
export var TONESELECTOR_KEYBOARD_KEYS_SUPPORTED = [KeyboardKeys.Enter, KeyboardKeys.Tab, KeyboardKeys.Space];
|
|
54
|
+
export var EMOJIPICKERLIST_KEYBOARD_KEYS_SUPPORTED = [KeyboardKeys.ArrowRight, KeyboardKeys.ArrowLeft, KeyboardKeys.Home, KeyboardKeys.End, KeyboardKeys.ArrowUp, KeyboardKeys.ArrowDown, KeyboardKeys.PageUp, KeyboardKeys.PageDown];
|
|
55
|
+
export var DEFAULT_TONE = 0;
|
|
27
56
|
export var defaultListLimit = 50;
|
|
28
57
|
export var migrationUserId = 'hipchat_migration_emoticons';
|
|
29
58
|
export var analyticsEmojiPrefix = 'atlassian.fabric.emoji.picker';
|
|
59
|
+
export var EMOJI_LIST_COLUMNS = 8;
|
|
60
|
+
export var EMOJI_LIST_PAGE_COUNT = 5;
|
|
30
61
|
export var EMOJI_SEARCH_DEBOUNCE = 150;
|
|
31
62
|
|
|
32
63
|
// This is the base sampling rate in Emoji
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
2
1
|
import { N40, N30 } from '@atlaskit/theme/colors';
|
|
3
2
|
import { emojiPickerWidth } from './constants';
|
|
4
3
|
export var emojiPickerListWidth = emojiPickerWidth;
|
|
@@ -6,7 +5,7 @@ export var emojiPickerListHeight = 205;
|
|
|
6
5
|
export var emojiPickerBorderColor = "var(--ds-border, ".concat(N40, ")");
|
|
7
6
|
export var emojiPickerBoxShadow = "var(--ds-shadow-overlay, 0 3px 6px rgba(0, 0, 0, 0.2))";
|
|
8
7
|
export var noDialogContainerBorderColor = "var(--ds-border, ".concat(N40, ")");
|
|
9
|
-
export var noDialogContainerBorderRadius = "
|
|
8
|
+
export var noDialogContainerBorderRadius = "var(--ds-radius-100, 3px)";
|
|
10
9
|
export var noDialogContainerBoxShadow = "var(--ds-shadow-overlay, 0 3px 6px rgba(0, 0, 0, 0.2))";
|
|
11
10
|
export var akEmojiSelectedBackgroundColor = "var(--ds-background-neutral-subtle-hovered, ".concat(N30, ")");
|
|
12
11
|
export var emojiPreviewSelectedColor = "var(--ds-background-neutral, ".concat(N30, ")");
|
package/dist/esm/version.json
CHANGED
|
@@ -74,6 +74,7 @@ export declare class EmojiResource extends AbstractResource<string, EmojiSearchR
|
|
|
74
74
|
protected emojiRepository?: EmojiRepository;
|
|
75
75
|
protected lastQuery?: LastQuery;
|
|
76
76
|
protected activeLoaders: number;
|
|
77
|
+
protected initialLoaders: number;
|
|
77
78
|
protected retries: Map<Retry<any>, ResolveReject<any>>;
|
|
78
79
|
protected siteEmojiResource?: SiteEmojiResource;
|
|
79
80
|
protected selectedTone: ToneSelection;
|
|
@@ -95,6 +96,7 @@ export declare class EmojiResource extends AbstractResource<string, EmojiSearchR
|
|
|
95
96
|
protected initSiteEmojiResource(emojiResponse: EmojiResponse, provider: ServiceConfig): Promise<void>;
|
|
96
97
|
private performRetries;
|
|
97
98
|
getOptimisticImageURL: (emojiId: EmojiId) => string | undefined;
|
|
99
|
+
protected isRepositoryAvailable: <T>(repository?: T | undefined) => repository is T;
|
|
98
100
|
private isLoaded;
|
|
99
101
|
private loadStoredTone;
|
|
100
102
|
protected refreshLastFilter(): void;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import React from 'react';
|
|
1
3
|
import { jsx } from '@emotion/react';
|
|
2
4
|
import { EmojiDescription, OnEmojiEvent } from '../../types';
|
|
3
|
-
export interface Props {
|
|
5
|
+
export interface Props extends Omit<React.HTMLAttributes<HTMLSpanElement>, 'onMouseMove' | 'onFocus'> {
|
|
4
6
|
/**
|
|
5
7
|
* The emoji to render
|
|
6
8
|
*/
|
|
@@ -23,6 +25,10 @@ export interface Props {
|
|
|
23
25
|
* Called when the mouse moves over the emoji.
|
|
24
26
|
*/
|
|
25
27
|
onMouseMove?: OnEmojiEvent;
|
|
28
|
+
/**
|
|
29
|
+
* Called when the mouse moves over the emoji.
|
|
30
|
+
*/
|
|
31
|
+
onFocus?: OnEmojiEvent;
|
|
26
32
|
/**
|
|
27
33
|
* Called when an emoji is deleted
|
|
28
34
|
*/
|
|
@@ -22,13 +22,14 @@ export interface Props {
|
|
|
22
22
|
onOpenUpload: () => void;
|
|
23
23
|
query?: string;
|
|
24
24
|
onChange: (value: string) => void;
|
|
25
|
+
resultsCount?: number;
|
|
25
26
|
}
|
|
26
27
|
export declare const emojiActionsTestId = "emoji-actions";
|
|
27
28
|
export declare const uploadEmojiTestId = "upload-emoji";
|
|
28
29
|
declare type PropsWithWrappedComponentPropsType = Props & WrappedComponentProps;
|
|
29
30
|
declare type EmojiActionsProps = PropsWithWrappedComponentPropsType;
|
|
30
31
|
export declare const EmojiActions: FC<EmojiActionsProps>;
|
|
31
|
-
declare const _default: FC<import("react-intl-next").WithIntlProps<
|
|
32
|
-
WrappedComponent: import("react").ComponentType<
|
|
32
|
+
declare const _default: FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
33
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
33
34
|
};
|
|
34
35
|
export default _default;
|
|
@@ -6,9 +6,8 @@ export interface Props {
|
|
|
6
6
|
onSelected?: () => void;
|
|
7
7
|
selectOnHover?: boolean;
|
|
8
8
|
ariaLabelText?: string;
|
|
9
|
-
|
|
10
|
-
shouldHideButton?: boolean;
|
|
9
|
+
defaultChecked?: boolean;
|
|
11
10
|
}
|
|
12
|
-
export declare const
|
|
13
|
-
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Props & React.RefAttributes<
|
|
11
|
+
export declare const EmojiRadioButton: React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>;
|
|
12
|
+
declare const _default: React.MemoExoticComponent<React.ForwardRefExoticComponent<Props & React.RefAttributes<HTMLInputElement>>>;
|
|
14
13
|
export default _default;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
2
|
+
import { FC } from 'react';
|
|
3
3
|
import { WrappedComponentProps } from 'react-intl-next';
|
|
4
4
|
import { EmojiUpload, Message } from '../../types';
|
|
5
5
|
export interface OnUploadEmoji {
|
|
6
6
|
(upload: EmojiUpload, retry: boolean, onSuccessHandler?: () => void): void;
|
|
7
7
|
}
|
|
8
8
|
export declare const uploadEmojiNameInputTestId = "upload-emoji-name-input";
|
|
9
|
+
export declare const uploadEmojiComponentTestId = "upload-emoji-component";
|
|
10
|
+
export declare const cancelEmojiUploadPickerTestId = "cancel-emoji-upload-picker";
|
|
9
11
|
export interface Props {
|
|
10
12
|
onUploadEmoji: OnUploadEmoji;
|
|
11
13
|
onUploadCancelled: () => void;
|
|
@@ -13,7 +15,7 @@ export interface Props {
|
|
|
13
15
|
errorMessage?: Message;
|
|
14
16
|
initialUploadName?: string;
|
|
15
17
|
}
|
|
16
|
-
declare const
|
|
17
|
-
WrappedComponent:
|
|
18
|
+
declare const EmojiUploadPickerComponent: FC<import("react-intl-next").WithIntlProps<Props & WrappedComponentProps<"intl">>> & {
|
|
19
|
+
WrappedComponent: import("react").ComponentType<Props & WrappedComponentProps<"intl">>;
|
|
18
20
|
};
|
|
19
|
-
export default
|
|
21
|
+
export default EmojiUploadPickerComponent;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { EmojiDescription } from '../../types';
|
|
3
|
+
export declare const tonePreviewTestId = "tone-preview";
|
|
4
|
+
export interface Props {
|
|
5
|
+
emoji: EmojiDescription;
|
|
6
|
+
isVisible?: boolean;
|
|
7
|
+
onSelected?: () => void;
|
|
8
|
+
selectOnHover?: boolean;
|
|
9
|
+
ariaLabelText?: string;
|
|
10
|
+
ariaExpanded?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export declare const TonePreviewButton: import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLButtonElement>>;
|
|
13
|
+
declare const _default: import("react").MemoExoticComponent<import("react").ForwardRefExoticComponent<Props & import("react").RefAttributes<HTMLButtonElement>>>;
|
|
14
|
+
export default _default;
|