@atlaskit/emoji 69.0.1 → 69.0.3
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 +17 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/dist/cjs/components/compiled/common/EmojiActions.js +1 -1
- package/dist/cjs/components/compiled/common/EmojiPreviewComponent.compiled.css +0 -1
- package/dist/cjs/components/compiled/common/EmojiPreviewComponent.js +1 -1
- package/dist/cjs/components/compiled/picker/CategorySelector.compiled.css +24 -0
- package/dist/cjs/components/compiled/picker/CategorySelector.js +161 -0
- package/dist/cjs/components/compiled/picker/EmojiPicker.compiled.css +12 -0
- package/dist/cjs/components/compiled/picker/EmojiPicker.js +109 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerCategoryHeading.compiled.css +9 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerCategoryHeading.js +43 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerComponent.compiled.css +20 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerComponent.js +574 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerEmojiRow.compiled.css +35 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerEmojiRow.js +76 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerFooter.compiled.css +5 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerFooter.js +33 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerListSearch.compiled.css +23 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerListSearch.js +93 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerTabPanel.compiled.css +6 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerTabPanel.js +60 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerVirtualItems.compiled.css +8 -0
- package/dist/cjs/components/compiled/picker/EmojiPickerVirtualItems.js +86 -0
- package/dist/cjs/components/compiled/picker/VirtualList.compiled.css +10 -0
- package/dist/cjs/components/compiled/picker/VirtualList.js +303 -0
- package/dist/cjs/components/picker/EmojiPickerFooter.js +0 -2
- package/dist/cjs/components/picker/EmojiPickerList.js +219 -145
- package/dist/cjs/components/picker/EmojiPickerTabPanel.js +67 -0
- package/dist/cjs/components/picker/styles.js +1 -10
- package/dist/cjs/index.js +4 -6
- package/dist/cjs/picker.js +5 -7
- package/dist/cjs/util/analytics/analytics.js +1 -1
- package/dist/es2019/components/compiled/common/EmojiActions.js +1 -1
- package/dist/es2019/components/compiled/common/EmojiPreviewComponent.compiled.css +0 -1
- package/dist/es2019/components/compiled/common/EmojiPreviewComponent.js +1 -1
- package/dist/es2019/components/compiled/picker/CategorySelector.compiled.css +24 -0
- package/dist/es2019/components/compiled/picker/CategorySelector.js +136 -0
- package/dist/es2019/components/compiled/picker/EmojiPicker.compiled.css +12 -0
- package/dist/es2019/components/compiled/picker/EmojiPicker.js +67 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerCategoryHeading.compiled.css +9 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerCategoryHeading.js +30 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerComponent.compiled.css +19 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerComponent.js +506 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerEmojiRow.compiled.css +35 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerEmojiRow.js +69 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerFooter.compiled.css +5 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerFooter.js +19 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerListSearch.compiled.css +23 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerListSearch.js +79 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerTabPanel.compiled.css +6 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerTabPanel.js +39 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerVirtualItems.compiled.css +8 -0
- package/dist/es2019/components/compiled/picker/EmojiPickerVirtualItems.js +51 -0
- package/dist/es2019/components/compiled/picker/VirtualList.compiled.css +10 -0
- package/dist/es2019/components/compiled/picker/VirtualList.js +288 -0
- package/dist/es2019/components/picker/EmojiPickerFooter.js +1 -1
- package/dist/es2019/components/picker/EmojiPickerList.js +186 -114
- package/dist/es2019/components/picker/EmojiPickerTabPanel.js +48 -0
- package/dist/es2019/components/picker/styles.js +0 -9
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/picker.js +5 -1
- package/dist/es2019/util/analytics/analytics.js +1 -1
- package/dist/esm/components/compiled/common/EmojiActions.js +1 -1
- package/dist/esm/components/compiled/common/EmojiPreviewComponent.compiled.css +0 -1
- package/dist/esm/components/compiled/common/EmojiPreviewComponent.js +1 -1
- package/dist/esm/components/compiled/picker/CategorySelector.compiled.css +24 -0
- package/dist/esm/components/compiled/picker/CategorySelector.js +151 -0
- package/dist/esm/components/compiled/picker/EmojiPicker.compiled.css +12 -0
- package/dist/esm/components/compiled/picker/EmojiPicker.js +97 -0
- package/dist/esm/components/compiled/picker/EmojiPickerCategoryHeading.compiled.css +9 -0
- package/dist/esm/components/compiled/picker/EmojiPickerCategoryHeading.js +34 -0
- package/dist/esm/components/compiled/picker/EmojiPickerComponent.compiled.css +20 -0
- package/dist/esm/components/compiled/picker/EmojiPickerComponent.js +564 -0
- package/dist/esm/components/compiled/picker/EmojiPickerEmojiRow.compiled.css +35 -0
- package/dist/esm/components/compiled/picker/EmojiPickerEmojiRow.js +66 -0
- package/dist/esm/components/compiled/picker/EmojiPickerFooter.compiled.css +5 -0
- package/dist/esm/components/compiled/picker/EmojiPickerFooter.js +24 -0
- package/dist/esm/components/compiled/picker/EmojiPickerListSearch.compiled.css +23 -0
- package/dist/esm/components/compiled/picker/EmojiPickerListSearch.js +83 -0
- package/dist/esm/components/compiled/picker/EmojiPickerTabPanel.compiled.css +6 -0
- package/dist/esm/components/compiled/picker/EmojiPickerTabPanel.js +50 -0
- package/dist/esm/components/compiled/picker/EmojiPickerVirtualItems.compiled.css +8 -0
- package/dist/esm/components/compiled/picker/EmojiPickerVirtualItems.js +76 -0
- package/dist/esm/components/compiled/picker/VirtualList.compiled.css +10 -0
- package/dist/esm/components/compiled/picker/VirtualList.js +293 -0
- package/dist/esm/components/picker/EmojiPickerFooter.js +1 -1
- package/dist/esm/components/picker/EmojiPickerList.js +219 -147
- package/dist/esm/components/picker/EmojiPickerTabPanel.js +59 -0
- package/dist/esm/components/picker/styles.js +0 -9
- package/dist/esm/index.js +2 -1
- package/dist/esm/picker.js +5 -1
- package/dist/esm/util/analytics/analytics.js +1 -1
- package/dist/types/components/compiled/picker/CategorySelector.d.ts +17 -0
- package/dist/types/components/compiled/picker/EmojiPicker.d.ts +44 -0
- package/dist/types/components/compiled/picker/EmojiPickerCategoryHeading.d.ts +13 -0
- package/dist/types/components/compiled/picker/EmojiPickerComponent.d.ts +24 -0
- package/dist/types/components/compiled/picker/EmojiPickerEmojiRow.d.ts +17 -0
- package/dist/types/components/compiled/picker/EmojiPickerFooter.d.ts +8 -0
- package/dist/types/components/compiled/picker/EmojiPickerListSearch.d.ts +11 -0
- package/dist/types/components/compiled/picker/EmojiPickerTabPanel.d.ts +21 -0
- package/dist/types/components/compiled/picker/EmojiPickerVirtualItems.d.ts +35 -0
- package/dist/types/components/compiled/picker/VirtualList.d.ts +42 -0
- package/dist/types/components/picker/EmojiPickerList.d.ts +1 -6
- package/dist/types/components/picker/EmojiPickerTabPanel.d.ts +21 -0
- package/dist/types/components/picker/styles.d.ts +0 -1
- package/dist/types/index.d.ts +2 -1
- package/dist/types/picker.d.ts +3 -1
- package/dist/types-ts4.5/components/compiled/picker/CategorySelector.d.ts +17 -0
- package/dist/types-ts4.5/components/compiled/picker/EmojiPicker.d.ts +44 -0
- package/dist/types-ts4.5/components/compiled/picker/EmojiPickerCategoryHeading.d.ts +13 -0
- package/dist/types-ts4.5/components/compiled/picker/EmojiPickerComponent.d.ts +24 -0
- package/dist/types-ts4.5/components/compiled/picker/EmojiPickerEmojiRow.d.ts +17 -0
- package/dist/types-ts4.5/components/compiled/picker/EmojiPickerFooter.d.ts +8 -0
- package/dist/types-ts4.5/components/compiled/picker/EmojiPickerListSearch.d.ts +11 -0
- package/dist/types-ts4.5/components/compiled/picker/EmojiPickerTabPanel.d.ts +21 -0
- package/dist/types-ts4.5/components/compiled/picker/EmojiPickerVirtualItems.d.ts +35 -0
- package/dist/types-ts4.5/components/compiled/picker/VirtualList.d.ts +42 -0
- package/dist/types-ts4.5/components/picker/EmojiPickerList.d.ts +1 -6
- package/dist/types-ts4.5/components/picker/EmojiPickerTabPanel.d.ts +21 -0
- package/dist/types-ts4.5/components/picker/styles.d.ts +0 -1
- package/dist/types-ts4.5/index.d.ts +2 -1
- package/dist/types-ts4.5/picker.d.ts +3 -1
- package/package.json +4 -3
package/dist/cjs/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
@@ -38,7 +37,7 @@ Object.defineProperty(exports, "EmojiLoader", {
|
|
|
38
37
|
Object.defineProperty(exports, "EmojiPicker", {
|
|
39
38
|
enumerable: true,
|
|
40
39
|
get: function get() {
|
|
41
|
-
return
|
|
40
|
+
return _picker.EmojiPicker;
|
|
42
41
|
}
|
|
43
42
|
});
|
|
44
43
|
Object.defineProperty(exports, "EmojiPlaceholder", {
|
|
@@ -231,7 +230,8 @@ Object.defineProperty(exports, "withSampling", {
|
|
|
231
230
|
var _utilServiceSupport = require("@atlaskit/util-service-support");
|
|
232
231
|
var _element = require("./element");
|
|
233
232
|
var _ResourcedEmoji = _interopRequireDefault(require("./components/common/ResourcedEmoji"));
|
|
234
|
-
var
|
|
233
|
+
var _picker = require("./picker");
|
|
234
|
+
var _EmojiPicker = require("./components/picker/EmojiPicker");
|
|
235
235
|
var _EmojiUploader = _interopRequireDefault(require("./components/uploader/EmojiUploader"));
|
|
236
236
|
var _EmojiTypeAhead = _interopRequireDefault(require("./components/typeahead/EmojiTypeAhead"));
|
|
237
237
|
var _EmojiTypeAheadItem = _interopRequireDefault(require("./components/typeahead/EmojiTypeAheadItem"));
|
|
@@ -249,6 +249,4 @@ var _useEmojiContext = require("./hooks/useEmojiContext");
|
|
|
249
249
|
var _EmojiContextProvider = require("./context/EmojiContextProvider");
|
|
250
250
|
var _EmojiCommonProvider = require("./context/EmojiCommonProvider");
|
|
251
251
|
var _types = require("./types");
|
|
252
|
-
|
|
253
|
-
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
254
|
-
var _default = exports.default = _EmojiPicker.default;
|
|
252
|
+
var _default = exports.default = _picker.EmojiPicker;
|
package/dist/cjs/picker.js
CHANGED
|
@@ -4,10 +4,8 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
});
|
|
13
|
-
var _EmojiPicker = _interopRequireDefault(require("./components/picker/EmojiPicker"));
|
|
7
|
+
exports.EmojiPicker = void 0;
|
|
8
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
9
|
+
var _EmojiPicker = _interopRequireDefault(require("./components/picker/EmojiPicker"));
|
|
10
|
+
var _EmojiPicker2 = _interopRequireDefault(require("./components/compiled/picker/EmojiPicker"));
|
|
11
|
+
var EmojiPicker = exports.EmojiPicker = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_css_migrate_emoji', _EmojiPicker2.default, _EmojiPicker.default);
|
|
@@ -20,7 +20,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
20
20
|
actionSubjectId: actionSubjectId,
|
|
21
21
|
attributes: _objectSpread({
|
|
22
22
|
packageName: "@atlaskit/emoji",
|
|
23
|
-
packageVersion: "69.0.
|
|
23
|
+
packageVersion: "69.0.3"
|
|
24
24
|
}, attributes)
|
|
25
25
|
};
|
|
26
26
|
};
|
|
@@ -10,7 +10,7 @@ import EmojiDeletePreview from './EmojiDeletePreview';
|
|
|
10
10
|
import EmojiUploadPicker from './EmojiUploadPicker';
|
|
11
11
|
import TonePreviewButton from './TonePreviewButton';
|
|
12
12
|
import ToneSelector from './ToneSelector';
|
|
13
|
-
import { EmojiPickerListSearch } from '
|
|
13
|
+
import { EmojiPickerListSearch } from '../picker/EmojiPickerListSearch';
|
|
14
14
|
import { messages } from '../../i18n';
|
|
15
15
|
import AkButton from '@atlaskit/button/standard-button';
|
|
16
16
|
import AddIcon from '@atlaskit/icon/core/migration/add';
|
|
@@ -37,7 +37,6 @@
|
|
|
37
37
|
._7mh21ule span[role=img]>img{display:block}
|
|
38
38
|
._8fp6dbra span[role=img]>img{transform:translateX(-50%) translateY(-50%)}
|
|
39
39
|
._ca0q19bv{padding-top:10px}
|
|
40
|
-
._i0dl1wug{flex-basis:auto}
|
|
41
40
|
._n3td19bv{padding-bottom:10px}
|
|
42
41
|
._n3tdv77o{padding-bottom:var(--ds-space-025,2px)}
|
|
43
42
|
._o5721q9c{white-space:nowrap}
|
|
@@ -15,7 +15,7 @@ export const EmojiPreviewComponent = ({
|
|
|
15
15
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
16
|
className: ax(["_ca0q19bv _u5f319bv _n3td19bv _19bv19bv _1e0c1txw _2lx2vrvc _1n261q9c _4t3izwfg _4cvr1h6o"])
|
|
17
17
|
}, /*#__PURE__*/React.createElement("span", {
|
|
18
|
-
className: ax(["
|
|
18
|
+
className: ax(["_1e0c1o8l _1bsbzwfg _12s6idpf _1e4didpf _1dvqidpf _vwlxidpf _1gdiidpf _1f45idpf _pdfdidpf _mwo3idpf _5ilezwfg _boltzwfg _1pc7zwfg _u5wqzwfg _w7981kw7 _1vqe1kw7 _1l4xidpf _1l79idpf _118didpf _1pa4idpf _1pglh2mm _1vjf1ssb _1h6o1ssb _8fp6dbra _1os4zwfg _1e7azwfg _7mh21ule"])
|
|
19
19
|
}, /*#__PURE__*/React.createElement(CachingEmoji, {
|
|
20
20
|
key: emoji.id || emoji.shortName,
|
|
21
21
|
emoji: emoji
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
|
|
2
|
+
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
3
|
+
._v564h5h4{transition:color .2s ease}
|
|
4
|
+
._189eidpf{border-width:0}._16jlidpf{flex-grow:0}
|
|
5
|
+
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
6
|
+
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
7
|
+
._1bah1b1v{justify-content:space-around}
|
|
8
|
+
._1e0c1txw{display:flex}
|
|
9
|
+
._1o9zidpf{flex-shrink:0}
|
|
10
|
+
._2lx2vrvc{flex-direction:row}
|
|
11
|
+
._4cvr1h6o{align-items:center}
|
|
12
|
+
._bfhk1nmp{background-color:var(--ds-surface-sunken,#ebecf0)}
|
|
13
|
+
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
14
|
+
._ca0q12x7{padding-top:var(--ds-space-075,6px)}
|
|
15
|
+
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
16
|
+
._dpd31txw button{display:flex}
|
|
17
|
+
._i0dl1wug{flex-basis:auto}
|
|
18
|
+
._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
|
|
19
|
+
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
20
|
+
._syaz131l{color:var(--ds-text-subtlest,#626f86)}
|
|
21
|
+
._syazaqb7{color:var(--ds-text-selected,#0c66e4)}
|
|
22
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
23
|
+
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
24
|
+
._30l3aqb7:hover{color:var(--ds-text-selected,#0c66e4)}
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/* CategorySelector.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./CategorySelector.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
|
+
import { cx } from '@atlaskit/css';
|
|
7
|
+
import { N30 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { useIntl } from 'react-intl-next';
|
|
9
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
11
|
+
import { CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED, defaultCategories, KeyboardKeys } from '../../../util/constants';
|
|
12
|
+
import { messages } from '../../i18n';
|
|
13
|
+
import { CategoryDescriptionMap } from '../../picker/categories';
|
|
14
|
+
import { usePrevious } from '../../../hooks/usePrevious';
|
|
15
|
+
import { RENDER_EMOJI_PICKER_LIST_TESTID } from '../../picker/EmojiPickerList';
|
|
16
|
+
const styles = {
|
|
17
|
+
commonCategory: "_2rkoglpi _v564h5h4 _189eidpf _bfhksm61 _ca0qze3t _n3tdze3t _19bvze3t _u5f3ze3t",
|
|
18
|
+
defaultCategory: "_syaz131l _30l3aqb7",
|
|
19
|
+
activeCategory: "_syazaqb7 _30l3aqb7",
|
|
20
|
+
disabledCategory: "_syaz131l"
|
|
21
|
+
};
|
|
22
|
+
const categorySelector = null;
|
|
23
|
+
const categorySelectorTablist = null;
|
|
24
|
+
export const sortCategories = (c1, c2) => CategoryDescriptionMap[c1].order - CategoryDescriptionMap[c2].order;
|
|
25
|
+
const addNewCategories = (oldCategories, newCategories) => {
|
|
26
|
+
if (!newCategories) {
|
|
27
|
+
return oldCategories;
|
|
28
|
+
}
|
|
29
|
+
return oldCategories.concat(newCategories.filter(category => !!CategoryDescriptionMap[category])).sort(sortCategories);
|
|
30
|
+
};
|
|
31
|
+
export const categorySelectorComponentTestId = 'category-selector-component';
|
|
32
|
+
export const categorySelectorCategoryTestId = categoryId => `category-selector-${categoryId}`;
|
|
33
|
+
const CategorySelector = props => {
|
|
34
|
+
const {
|
|
35
|
+
disableCategories,
|
|
36
|
+
dynamicCategories,
|
|
37
|
+
activeCategoryId,
|
|
38
|
+
onCategorySelected
|
|
39
|
+
} = props;
|
|
40
|
+
const [categories, setCategories] = useState(addNewCategories(defaultCategories, dynamicCategories));
|
|
41
|
+
const [currentFocus, setCurrentFocus] = useState(0);
|
|
42
|
+
const categoryRef = useRef(null);
|
|
43
|
+
const prevDynamicCategories = usePrevious(dynamicCategories);
|
|
44
|
+
const {
|
|
45
|
+
formatMessage
|
|
46
|
+
} = useIntl();
|
|
47
|
+
const updateCategories = useCallback(() => {
|
|
48
|
+
const newCategories = addNewCategories(defaultCategories, dynamicCategories);
|
|
49
|
+
setCategories(newCategories);
|
|
50
|
+
}, [dynamicCategories]);
|
|
51
|
+
useEffect(() => {
|
|
52
|
+
if (prevDynamicCategories !== dynamicCategories) {
|
|
53
|
+
updateCategories();
|
|
54
|
+
}
|
|
55
|
+
}, [prevDynamicCategories, dynamicCategories, updateCategories]);
|
|
56
|
+
const focusCategory = useCallback(index => {
|
|
57
|
+
var _categoryRef$current;
|
|
58
|
+
const categoryToFocus = (_categoryRef$current = categoryRef.current) === null || _categoryRef$current === void 0 ? void 0 : _categoryRef$current.querySelector(`[data-focus-index="${index}"]`);
|
|
59
|
+
categoryToFocus && categoryToFocus.focus();
|
|
60
|
+
setCurrentFocus(index);
|
|
61
|
+
}, [categoryRef, setCurrentFocus]);
|
|
62
|
+
const handleKeyDown = e => {
|
|
63
|
+
if (!CATEGORYSELECTOR_KEYBOARD_KEYS_SUPPORTED.includes(e.key)) {
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
e.preventDefault();
|
|
67
|
+
e.stopPropagation();
|
|
68
|
+
const lastCategoryIndex = categories.length - 1;
|
|
69
|
+
switch (e.key) {
|
|
70
|
+
// navigate to the right category
|
|
71
|
+
case KeyboardKeys.ArrowRight:
|
|
72
|
+
focusCategory(currentFocus === lastCategoryIndex ? 0 : currentFocus + 1);
|
|
73
|
+
break;
|
|
74
|
+
// navigate to the left category
|
|
75
|
+
case KeyboardKeys.ArrowLeft:
|
|
76
|
+
focusCategory(currentFocus === 0 ? lastCategoryIndex : currentFocus - 1);
|
|
77
|
+
break;
|
|
78
|
+
// navigate to the first category
|
|
79
|
+
case KeyboardKeys.Home:
|
|
80
|
+
focusCategory(0);
|
|
81
|
+
break;
|
|
82
|
+
// navigate to the last category
|
|
83
|
+
case KeyboardKeys.End:
|
|
84
|
+
focusCategory(lastCategoryIndex);
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
const handleClick = (categoryId, index) => event => {
|
|
89
|
+
if (disableCategories) {
|
|
90
|
+
event.preventDefault();
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (onCategorySelected) {
|
|
94
|
+
onCategorySelected(categoryId);
|
|
95
|
+
}
|
|
96
|
+
setCurrentFocus(index);
|
|
97
|
+
};
|
|
98
|
+
let categoriesSection;
|
|
99
|
+
if (categories) {
|
|
100
|
+
categoriesSection = /*#__PURE__*/React.createElement("div", {
|
|
101
|
+
role: "tablist",
|
|
102
|
+
"aria-label": formatMessage(messages.categoriesSelectorLabel),
|
|
103
|
+
"data-testid": categorySelectorComponentTestId,
|
|
104
|
+
ref: categoryRef,
|
|
105
|
+
className: ax(["_ca0q12x7 _n3td12x7 _19bvu2gc _u5f3u2gc _1e0c1txw _2lx2vrvc _1bah1b1v _4cvr1h6o"])
|
|
106
|
+
}, categories.map((categoryId, index) => {
|
|
107
|
+
const category = CategoryDescriptionMap[categoryId];
|
|
108
|
+
const Icon = category.icon;
|
|
109
|
+
const categoryName = formatMessage(messages[category.name]);
|
|
110
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
111
|
+
content: categoryName,
|
|
112
|
+
position: "bottom",
|
|
113
|
+
key: category.id
|
|
114
|
+
}, /*#__PURE__*/React.createElement(Pressable, {
|
|
115
|
+
id: `category-selector-${category.id}`,
|
|
116
|
+
"data-focus-index": index,
|
|
117
|
+
"aria-label": categoryName,
|
|
118
|
+
"aria-controls": currentFocus === index ? RENDER_EMOJI_PICKER_LIST_TESTID : undefined,
|
|
119
|
+
"aria-selected": categoryId === activeCategoryId,
|
|
120
|
+
xcss: cx(styles.commonCategory, styles.defaultCategory, categoryId === activeCategoryId && styles.activeCategory, disableCategories && styles.disabledCategory),
|
|
121
|
+
isDisabled: disableCategories,
|
|
122
|
+
onClick: handleClick(categoryId, index),
|
|
123
|
+
testId: categorySelectorCategoryTestId(categoryId),
|
|
124
|
+
tabIndex: currentFocus === index ? 0 : -1,
|
|
125
|
+
onKeyDown: handleKeyDown,
|
|
126
|
+
role: "tab"
|
|
127
|
+
}, /*#__PURE__*/React.createElement(Icon, {
|
|
128
|
+
label: categoryName
|
|
129
|
+
})));
|
|
130
|
+
}));
|
|
131
|
+
}
|
|
132
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _bfhk1nmp _dpd31txw"])
|
|
134
|
+
}, categoriesSection);
|
|
135
|
+
};
|
|
136
|
+
export default CategorySelector;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
|
|
2
|
+
._19itcyqh{border:var(--ds-border,#dfe1e6) 1px solid}
|
|
3
|
+
._2rkosqtm{border-radius:var(--ds-border-radius-100,3px)}._16qsp2xt{box-shadow:var(--ds-shadow-overlay,0 3px 6px rgba(0,0,0,.2))}
|
|
4
|
+
._1bah1yb4{justify-content:space-between}
|
|
5
|
+
._1bsb1edt{width:350px}
|
|
6
|
+
._1e0c1txw{display:flex}
|
|
7
|
+
._1tke5x59{min-height:340px}
|
|
8
|
+
._1ul91edt{min-width:350px}
|
|
9
|
+
._2lx21bp4{flex-direction:column}
|
|
10
|
+
._4t3iixjv{height:375px}
|
|
11
|
+
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
12
|
+
._c71l1y6z{max-height:calc(80vh - 86px)}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
/* EmojiPicker.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
3
|
+
import "./EmojiPicker.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { N40 } from '@atlaskit/theme/colors';
|
|
7
|
+
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
8
|
+
import { ufoExperiences } from '../../../util/analytics';
|
|
9
|
+
import LoadingEmojiComponent from '../../common/LoadingEmojiComponent';
|
|
10
|
+
import { LoadingItem } from './EmojiPickerVirtualItems';
|
|
11
|
+
import { UfoErrorBoundary } from '../../common/UfoErrorBoundary';
|
|
12
|
+
import { defaultEmojiPickerSize } from '../../../util/constants';
|
|
13
|
+
import { EmojiCommonProvider } from '../../../context/EmojiCommonProvider';
|
|
14
|
+
const emojiPicker = null;
|
|
15
|
+
const emojiPickerModuleLoader = () => import( /* webpackChunkName:"@atlaskit-internal_emojiPickerComponent" */'./EmojiPickerComponent');
|
|
16
|
+
const emojiPickerLoader = () => emojiPickerModuleLoader().then(module => module.default);
|
|
17
|
+
export const preloadEmojiPicker = () => {
|
|
18
|
+
emojiPickerLoader().then(component => {
|
|
19
|
+
EmojiPickerInternal.AsyncLoadedComponent = component;
|
|
20
|
+
});
|
|
21
|
+
};
|
|
22
|
+
export class EmojiPickerInternal extends LoadingEmojiComponent {
|
|
23
|
+
constructor(props) {
|
|
24
|
+
super(props, {});
|
|
25
|
+
_defineProperty(this, "state", {
|
|
26
|
+
asyncLoadedComponent: EmojiPickerInternal.AsyncLoadedComponent
|
|
27
|
+
});
|
|
28
|
+
ufoExperiences['emoji-picker-opened'].start();
|
|
29
|
+
}
|
|
30
|
+
asyncLoadComponent() {
|
|
31
|
+
emojiPickerLoader().then(component => {
|
|
32
|
+
EmojiPickerInternal.AsyncLoadedComponent = component;
|
|
33
|
+
this.setAsyncState(component);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
renderLoading() {
|
|
37
|
+
const item = new LoadingItem();
|
|
38
|
+
const handlePickerRef = ref => {
|
|
39
|
+
if (this.props.onPickerRef) {
|
|
40
|
+
this.props.onPickerRef(ref);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
ufoExperiences['emoji-picker-opened'].markFMP();
|
|
44
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
45
|
+
ref: handlePickerRef,
|
|
46
|
+
className: ax(["_19itcyqh _2rkosqtm _1e0c1txw _2lx21bp4 _1bah1yb4 _bfhk1bhr _16qsp2xt _4t3iixjv _1bsb1edt _1ul91edt _1tke5x59 _c71l1y6z"])
|
|
47
|
+
}, item.renderItem());
|
|
48
|
+
}
|
|
49
|
+
renderLoaded(loadedEmojiProvider, EmojiPickerComponent) {
|
|
50
|
+
const {
|
|
51
|
+
emojiProvider,
|
|
52
|
+
...otherProps
|
|
53
|
+
} = this.props;
|
|
54
|
+
return /*#__PURE__*/React.createElement(UfoErrorBoundary, {
|
|
55
|
+
experiences: [ufoExperiences['emoji-picker-opened']]
|
|
56
|
+
}, /*#__PURE__*/React.createElement(EmojiCommonProvider, {
|
|
57
|
+
emojiProvider: loadedEmojiProvider
|
|
58
|
+
}, /*#__PURE__*/React.createElement(EmojiPickerComponent, otherProps)));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
// state initialised with static component to prevent
|
|
62
|
+
// rerender when the module has already been loaded
|
|
63
|
+
_defineProperty(EmojiPickerInternal, "defaultProps", {
|
|
64
|
+
size: defaultEmojiPickerSize
|
|
65
|
+
});
|
|
66
|
+
const EmojiPicker = withAnalyticsEvents()(EmojiPickerInternal);
|
|
67
|
+
export default EmojiPicker;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
._11c82smr{font:var(--ds-font-body,normal 400 14px/20px ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
3
|
+
._1p1d1qyh{text-transform:lowercase}
|
|
4
|
+
._299mangw:first-letter{text-transform:uppercase}
|
|
5
|
+
._ca0q12x7{padding-top:var(--ds-space-075,6px)}
|
|
6
|
+
._n3td12x7{padding-bottom:var(--ds-space-075,6px)}
|
|
7
|
+
._syazj3m3{color:var(--ds-text,#091e42)}
|
|
8
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
9
|
+
._vchhusvi{box-sizing:border-box}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/* EmojiPickerCategoryHeading.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./EmojiPickerCategoryHeading.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { N900 } from '@atlaskit/theme/colors';
|
|
6
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
7
|
+
import { isMessagesKey } from '../../../util/type-helpers';
|
|
8
|
+
import { messages } from '../../i18n';
|
|
9
|
+
const emojiCategoryTitle = null;
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Test id for wrapper Emoji Picker List div
|
|
13
|
+
*/
|
|
14
|
+
export const RENDER_EMOJI_PICKER_CATEGORY_HEADING_TESTID = 'render-emoji-picker-categorty-heading';
|
|
15
|
+
const EmojiPickerCategoryHeading = ({
|
|
16
|
+
id,
|
|
17
|
+
title,
|
|
18
|
+
className
|
|
19
|
+
}) => /*#__PURE__*/React.createElement("div", {
|
|
20
|
+
id: id,
|
|
21
|
+
"data-category-id": id
|
|
22
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
23
|
+
,
|
|
24
|
+
className: className,
|
|
25
|
+
"data-testid": RENDER_EMOJI_PICKER_CATEGORY_HEADING_TESTID,
|
|
26
|
+
role: "rowheader"
|
|
27
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
28
|
+
className: ax(["_11c82smr _vchhusvi _syazj3m3 _ca0q12x7 _n3td12x7 _19bvu2gc _u5f3u2gc _1p1d1qyh _299mangw"])
|
|
29
|
+
}, isMessagesKey(title) ? /*#__PURE__*/React.createElement(FormattedMessage, messages[title]) : title));
|
|
30
|
+
export default EmojiPickerCategoryHeading;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
._19itcyqh{border:var(--ds-border,#dfe1e6) 1px solid}
|
|
3
|
+
._2rkosqtm{border-radius:var(--ds-border-radius-100,3px)}._16qsp2xt{box-shadow:var(--ds-shadow-overlay,0 3px 6px rgba(0,0,0,.2))}
|
|
4
|
+
._1bah1yb4{justify-content:space-between}
|
|
5
|
+
._1bsb1edt{width:350px}
|
|
6
|
+
._1e0c1txw{display:flex}
|
|
7
|
+
._1tke1pna{min-height:420px}
|
|
8
|
+
._1tke5x59{min-height:340px}
|
|
9
|
+
._1tkegx0z{min-height:260px}
|
|
10
|
+
._1ul91edt{min-width:350px}
|
|
11
|
+
._2lx21bp4{flex-direction:column}
|
|
12
|
+
._4t3i1ckg{height:455px}
|
|
13
|
+
._4t3i2300{height:429px}
|
|
14
|
+
._4t3iaq3k{height:295px}
|
|
15
|
+
._4t3iixjv{height:375px}
|
|
16
|
+
._4t3ivixp{height:349px}
|
|
17
|
+
._4t3ixt2k{height:509px}
|
|
18
|
+
._bfhk1bhr{background-color:var(--ds-surface-overlay,#fff)}
|
|
19
|
+
._c71l1y6z{max-height:calc(80vh - 86px)}
|