@atlaskit/reactions 22.1.0 → 22.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 +17 -0
- package/dist/cjs/MockReactionsClient.js +1 -49
- package/dist/cjs/analytics/analytics.js +1 -40
- package/dist/cjs/analytics/index.js +0 -7
- package/dist/cjs/analytics/ufo.js +8 -20
- package/dist/cjs/client/ReactionServiceClient.js +2 -16
- package/dist/cjs/client/index.js +0 -1
- package/dist/cjs/components/Counter/Counter.js +10 -24
- package/dist/cjs/components/Counter/index.js +0 -6
- package/dist/cjs/components/Counter/styles.js +1 -3
- package/dist/cjs/components/EmojiButton/EmojiButton.js +3 -18
- package/dist/cjs/components/EmojiButton/index.js +0 -1
- package/dist/cjs/components/EmojiButton/styles.js +1 -2
- package/dist/cjs/components/FlashAnimation/FlashAnimation.js +1 -11
- package/dist/cjs/components/FlashAnimation/index.js +0 -1
- package/dist/cjs/components/FlashAnimation/styles.js +1 -3
- package/dist/cjs/components/Reaction/Reaction.js +23 -62
- package/dist/cjs/components/Reaction/index.js +0 -1
- package/dist/cjs/components/Reaction/styles.js +1 -4
- package/dist/cjs/components/ReactionDialog/ReactionView.js +6 -29
- package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +19 -48
- package/dist/cjs/components/ReactionDialog/ReactionsList.js +18 -34
- package/dist/cjs/components/ReactionDialog/index.js +0 -1
- package/dist/cjs/components/ReactionDialog/styles.js +3 -13
- package/dist/cjs/components/ReactionPicker/ReactionPicker.js +45 -75
- package/dist/cjs/components/ReactionPicker/index.js +0 -1
- package/dist/cjs/components/ReactionPicker/styles.js +1 -4
- package/dist/cjs/components/ReactionTooltip/ReactionTooltip.js +13 -28
- package/dist/cjs/components/ReactionTooltip/index.js +0 -1
- package/dist/cjs/components/ReactionTooltip/styles.js +1 -3
- package/dist/cjs/components/Reactions/Reactions.js +48 -86
- package/dist/cjs/components/Reactions/index.js +0 -1
- package/dist/cjs/components/Reactions/styles.js +2 -2
- package/dist/cjs/components/Selector/Selector.js +12 -34
- package/dist/cjs/components/Selector/index.js +0 -6
- package/dist/cjs/components/Selector/styles.js +2 -5
- package/dist/cjs/components/ShowMore/ShowMore.js +5 -19
- package/dist/cjs/components/ShowMore/index.js +0 -1
- package/dist/cjs/components/ShowMore/styles.js +1 -4
- package/dist/cjs/components/Trigger/Trigger.js +6 -22
- package/dist/cjs/components/Trigger/index.js +0 -1
- package/dist/cjs/components/Trigger/styles.js +3 -13
- package/dist/cjs/components/UfoErrorBoundary/UfoErrorBoundary.js +1 -19
- package/dist/cjs/components/UfoErrorBoundary/index.js +0 -1
- package/dist/cjs/components/index.js +0 -5
- package/dist/cjs/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +2 -17
- package/dist/cjs/containers/ConnectedReactionPicker/index.js +0 -1
- package/dist/cjs/containers/ConnectedReactionsView/ConnectedReactionsView.js +17 -62
- package/dist/cjs/containers/ConnectedReactionsView/index.js +0 -1
- package/dist/cjs/containers/index.js +0 -4
- package/dist/cjs/hooks/index.js +0 -1
- package/dist/cjs/hooks/useClickAway.js +6 -7
- package/dist/cjs/i18n/cs.js +12 -4
- package/dist/cjs/i18n/da.js +12 -4
- package/dist/cjs/i18n/de.js +12 -4
- package/dist/cjs/i18n/en.js +20 -4
- package/dist/cjs/i18n/en_GB.js +20 -4
- package/dist/cjs/i18n/en_ZZ.js +13 -4
- package/dist/cjs/i18n/es.js +12 -4
- package/dist/cjs/i18n/et.js +1 -3
- package/dist/cjs/i18n/fi.js +12 -4
- package/dist/cjs/i18n/fr.js +12 -4
- package/dist/cjs/i18n/hu.js +12 -4
- package/dist/cjs/i18n/index.js +0 -30
- package/dist/cjs/i18n/it.js +12 -4
- package/dist/cjs/i18n/ja.js +12 -4
- package/dist/cjs/i18n/ko.js +12 -4
- package/dist/cjs/i18n/nb.js +12 -4
- package/dist/cjs/i18n/nl.js +12 -4
- package/dist/cjs/i18n/pl.js +12 -4
- package/dist/cjs/i18n/pt_BR.js +12 -4
- package/dist/cjs/i18n/pt_PT.js +1 -3
- package/dist/cjs/i18n/ru.js +12 -4
- package/dist/cjs/i18n/sk.js +1 -3
- package/dist/cjs/i18n/sv.js +12 -4
- package/dist/cjs/i18n/th.js +12 -4
- package/dist/cjs/i18n/tr.js +12 -4
- package/dist/cjs/i18n/uk.js +12 -4
- package/dist/cjs/i18n/vi.js +12 -4
- package/dist/cjs/i18n/zh.js +12 -4
- package/dist/cjs/i18n/zh_TW.js +12 -4
- package/dist/cjs/index.js +0 -6
- package/dist/cjs/shared/constants.js +5 -6
- package/dist/cjs/shared/i18n.js +0 -2
- package/dist/cjs/shared/index.js +0 -9
- package/dist/cjs/shared/utils.js +6 -25
- package/dist/cjs/store/MemoryReactionsStore.js +21 -74
- package/dist/cjs/store/ReactionConsumer.js +0 -28
- package/dist/cjs/store/batched.js +0 -6
- package/dist/cjs/store/index.js +0 -2
- package/dist/cjs/store/utils.js +0 -25
- package/dist/cjs/types/index.js +0 -1
- package/dist/cjs/types/reaction.js +0 -10
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/MockReactionsClient.js +7 -21
- package/dist/es2019/analytics/analytics.js +3 -9
- package/dist/es2019/analytics/ufo.js +11 -13
- package/dist/es2019/client/ReactionServiceClient.js +4 -13
- package/dist/es2019/components/Counter/Counter.js +5 -7
- package/dist/es2019/components/EmojiButton/EmojiButton.js +0 -3
- package/dist/es2019/components/FlashAnimation/FlashAnimation.js +1 -2
- package/dist/es2019/components/Reaction/Reaction.js +3 -12
- package/dist/es2019/components/Reaction/styles.js +1 -1
- package/dist/es2019/components/ReactionDialog/ReactionView.js +0 -4
- package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +6 -15
- package/dist/es2019/components/ReactionDialog/ReactionsList.js +4 -3
- package/dist/es2019/components/ReactionDialog/styles.js +2 -5
- package/dist/es2019/components/ReactionPicker/ReactionPicker.js +18 -23
- package/dist/es2019/components/ReactionTooltip/ReactionTooltip.js +1 -2
- package/dist/es2019/components/Reactions/Reactions.js +16 -25
- package/dist/es2019/components/Reactions/styles.js +1 -0
- package/dist/es2019/components/Selector/Selector.js +5 -11
- package/dist/es2019/components/Selector/styles.js +1 -1
- package/dist/es2019/components/ShowMore/ShowMore.js +1 -2
- package/dist/es2019/components/Trigger/Trigger.js +1 -5
- package/dist/es2019/components/UfoErrorBoundary/UfoErrorBoundary.js +0 -3
- package/dist/es2019/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +0 -4
- package/dist/es2019/containers/ConnectedReactionsView/ConnectedReactionsView.js +8 -20
- package/dist/es2019/hooks/useClickAway.js +7 -7
- package/dist/es2019/i18n/cs.js +12 -3
- package/dist/es2019/i18n/da.js +12 -3
- package/dist/es2019/i18n/de.js +12 -3
- package/dist/es2019/i18n/en.js +20 -4
- package/dist/es2019/i18n/en_GB.js +20 -4
- package/dist/es2019/i18n/en_ZZ.js +13 -3
- package/dist/es2019/i18n/es.js +12 -3
- package/dist/es2019/i18n/et.js +1 -2
- package/dist/es2019/i18n/fi.js +12 -3
- package/dist/es2019/i18n/fr.js +12 -3
- package/dist/es2019/i18n/hu.js +12 -3
- package/dist/es2019/i18n/it.js +12 -3
- package/dist/es2019/i18n/ja.js +12 -3
- package/dist/es2019/i18n/ko.js +12 -3
- package/dist/es2019/i18n/nb.js +12 -3
- package/dist/es2019/i18n/nl.js +12 -3
- package/dist/es2019/i18n/pl.js +12 -3
- package/dist/es2019/i18n/pt_BR.js +12 -3
- package/dist/es2019/i18n/pt_PT.js +1 -2
- package/dist/es2019/i18n/ru.js +12 -3
- package/dist/es2019/i18n/sk.js +1 -2
- package/dist/es2019/i18n/sv.js +12 -3
- package/dist/es2019/i18n/th.js +12 -3
- package/dist/es2019/i18n/tr.js +12 -3
- package/dist/es2019/i18n/uk.js +12 -3
- package/dist/es2019/i18n/vi.js +12 -3
- package/dist/es2019/i18n/zh.js +12 -3
- package/dist/es2019/i18n/zh_TW.js +12 -3
- package/dist/es2019/index.js +2 -1
- package/dist/es2019/shared/constants.js +5 -5
- package/dist/es2019/shared/utils.js +7 -15
- package/dist/es2019/store/MemoryReactionsStore.js +36 -61
- package/dist/es2019/store/ReactionConsumer.js +1 -12
- package/dist/es2019/store/batched.js +0 -2
- package/dist/es2019/store/utils.js +4 -8
- package/dist/es2019/types/reaction.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/MockReactionsClient.js +1 -42
- package/dist/esm/analytics/analytics.js +1 -12
- package/dist/esm/analytics/ufo.js +11 -13
- package/dist/esm/client/ReactionServiceClient.js +2 -14
- package/dist/esm/components/Counter/Counter.js +12 -15
- package/dist/esm/components/EmojiButton/EmojiButton.js +2 -6
- package/dist/esm/components/FlashAnimation/FlashAnimation.js +1 -2
- package/dist/esm/components/Reaction/Reaction.js +23 -40
- package/dist/esm/components/Reaction/styles.js +1 -1
- package/dist/esm/components/ReactionDialog/ReactionView.js +5 -14
- package/dist/esm/components/ReactionDialog/ReactionsDialog.js +20 -35
- package/dist/esm/components/ReactionDialog/ReactionsList.js +17 -20
- package/dist/esm/components/ReactionDialog/styles.js +2 -5
- package/dist/esm/components/ReactionPicker/ReactionPicker.js +46 -56
- package/dist/esm/components/ReactionTooltip/ReactionTooltip.js +14 -16
- package/dist/esm/components/Reactions/Reactions.js +49 -62
- package/dist/esm/components/Reactions/styles.js +1 -0
- package/dist/esm/components/Selector/Selector.js +13 -22
- package/dist/esm/components/Selector/styles.js +1 -1
- package/dist/esm/components/ShowMore/ShowMore.js +6 -7
- package/dist/esm/components/Trigger/Trigger.js +7 -11
- package/dist/esm/components/Trigger/styles.js +3 -6
- package/dist/esm/components/UfoErrorBoundary/UfoErrorBoundary.js +1 -14
- package/dist/esm/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +2 -9
- package/dist/esm/containers/ConnectedReactionsView/ConnectedReactionsView.js +17 -43
- package/dist/esm/hooks/useClickAway.js +7 -6
- package/dist/esm/i18n/cs.js +12 -3
- package/dist/esm/i18n/da.js +12 -3
- package/dist/esm/i18n/de.js +12 -3
- package/dist/esm/i18n/en.js +20 -4
- package/dist/esm/i18n/en_GB.js +20 -4
- package/dist/esm/i18n/en_ZZ.js +13 -3
- package/dist/esm/i18n/es.js +12 -3
- package/dist/esm/i18n/et.js +1 -2
- package/dist/esm/i18n/fi.js +12 -3
- package/dist/esm/i18n/fr.js +12 -3
- package/dist/esm/i18n/hu.js +12 -3
- package/dist/esm/i18n/it.js +12 -3
- package/dist/esm/i18n/ja.js +12 -3
- package/dist/esm/i18n/ko.js +12 -3
- package/dist/esm/i18n/nb.js +12 -3
- package/dist/esm/i18n/nl.js +12 -3
- package/dist/esm/i18n/pl.js +12 -3
- package/dist/esm/i18n/pt_BR.js +12 -3
- package/dist/esm/i18n/pt_PT.js +1 -2
- package/dist/esm/i18n/ru.js +12 -3
- package/dist/esm/i18n/sk.js +1 -2
- package/dist/esm/i18n/sv.js +12 -3
- package/dist/esm/i18n/th.js +12 -3
- package/dist/esm/i18n/tr.js +12 -3
- package/dist/esm/i18n/uk.js +12 -3
- package/dist/esm/i18n/vi.js +12 -3
- package/dist/esm/i18n/zh.js +12 -3
- package/dist/esm/i18n/zh_TW.js +12 -3
- package/dist/esm/index.js +2 -1
- package/dist/esm/shared/constants.js +5 -5
- package/dist/esm/shared/utils.js +7 -17
- package/dist/esm/store/MemoryReactionsStore.js +22 -78
- package/dist/esm/store/ReactionConsumer.js +0 -23
- package/dist/esm/store/batched.js +0 -4
- package/dist/esm/store/utils.js +0 -9
- package/dist/esm/types/reaction.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/components/ReactionDialog/styles.d.ts +1 -2
- package/dist/types/hooks/useClickAway.d.ts +2 -1
- package/dist/types/i18n/cs.d.ts +10 -1
- package/dist/types/i18n/da.d.ts +10 -1
- package/dist/types/i18n/de.d.ts +10 -1
- package/dist/types/i18n/en.d.ts +18 -2
- package/dist/types/i18n/en_GB.d.ts +18 -2
- package/dist/types/i18n/en_ZZ.d.ts +11 -1
- package/dist/types/i18n/es.d.ts +10 -1
- package/dist/types/i18n/et.d.ts +0 -1
- package/dist/types/i18n/fi.d.ts +10 -1
- package/dist/types/i18n/fr.d.ts +10 -1
- package/dist/types/i18n/hu.d.ts +10 -1
- package/dist/types/i18n/it.d.ts +10 -1
- package/dist/types/i18n/ja.d.ts +10 -1
- package/dist/types/i18n/ko.d.ts +10 -1
- package/dist/types/i18n/nb.d.ts +10 -1
- package/dist/types/i18n/nl.d.ts +10 -1
- package/dist/types/i18n/pl.d.ts +10 -1
- package/dist/types/i18n/pt_BR.d.ts +10 -1
- package/dist/types/i18n/pt_PT.d.ts +0 -1
- package/dist/types/i18n/ru.d.ts +10 -1
- package/dist/types/i18n/sk.d.ts +0 -1
- package/dist/types/i18n/sv.d.ts +10 -1
- package/dist/types/i18n/th.d.ts +10 -1
- package/dist/types/i18n/tr.d.ts +10 -1
- package/dist/types/i18n/uk.d.ts +10 -1
- package/dist/types/i18n/vi.d.ts +10 -1
- package/dist/types/i18n/zh.d.ts +10 -1
- package/dist/types/i18n/zh_TW.d.ts +10 -1
- package/package.json +3 -3
|
@@ -1,10 +1,7 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
-
|
|
4
3
|
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; }
|
|
5
|
-
|
|
6
4
|
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; }
|
|
7
|
-
|
|
8
5
|
/** @jsx jsx */
|
|
9
6
|
import React, { Fragment, useCallback, useEffect, useRef, useState } from 'react';
|
|
10
7
|
import { jsx } from '@emotion/react';
|
|
@@ -18,15 +15,15 @@ import { UFO } from '../../analytics';
|
|
|
18
15
|
import { i18n } from '../../shared';
|
|
19
16
|
import { useClickAway } from '../../hooks';
|
|
20
17
|
import * as styles from './styles';
|
|
18
|
+
|
|
21
19
|
/**
|
|
22
20
|
* Test id for wrapper ReactionPicker div
|
|
23
21
|
*/
|
|
24
|
-
|
|
25
22
|
export var RENDER_REACTIONPICKER_TESTID = 'reactionPicker-testid';
|
|
23
|
+
|
|
26
24
|
/**
|
|
27
25
|
* Emoji Picker Controller Id for Accessibility Labels
|
|
28
26
|
*/
|
|
29
|
-
|
|
30
27
|
var PICKER_CONTROL_ID = 'emoji-picker';
|
|
31
28
|
var popperModifiers = [
|
|
32
29
|
/**
|
|
@@ -55,72 +52,66 @@ https://popper.js.org/docs/v1/#modifiers..applyStyle
|
|
|
55
52
|
name: 'preventOverflow',
|
|
56
53
|
enabled: true
|
|
57
54
|
}];
|
|
58
|
-
|
|
59
55
|
/**
|
|
60
56
|
* Picker component for adding reactions
|
|
61
57
|
*/
|
|
62
58
|
export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
63
59
|
var miniMode = props.miniMode,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
60
|
+
className = props.className,
|
|
61
|
+
emojiProvider = props.emojiProvider,
|
|
62
|
+
onSelection = props.onSelection,
|
|
63
|
+
allowAllEmojis = props.allowAllEmojis,
|
|
64
|
+
disabled = props.disabled,
|
|
65
|
+
pickerQuickReactionEmojiIds = props.pickerQuickReactionEmojiIds,
|
|
66
|
+
_props$onShowMore = props.onShowMore,
|
|
67
|
+
onShowMore = _props$onShowMore === void 0 ? function () {} : _props$onShowMore,
|
|
68
|
+
_props$onOpen = props.onOpen,
|
|
69
|
+
onOpen = _props$onOpen === void 0 ? function () {} : _props$onOpen,
|
|
70
|
+
_props$onCancel = props.onCancel,
|
|
71
|
+
onCancel = _props$onCancel === void 0 ? function () {} : _props$onCancel,
|
|
72
|
+
_props$tooltipContent = props.tooltipContent,
|
|
73
|
+
tooltipContent = _props$tooltipContent === void 0 ? jsx(FormattedMessage, i18n.messages.addReaction) : _props$tooltipContent,
|
|
74
|
+
emojiPickerSize = props.emojiPickerSize;
|
|
79
75
|
/**
|
|
80
76
|
* Container <div /> reference (used by custom hook to detect click outside)
|
|
81
77
|
*/
|
|
82
|
-
|
|
83
78
|
var wrapperRef = useRef(null);
|
|
84
79
|
/**
|
|
85
80
|
* a function you can ask Popper to recompute your tooltip's position. It will directly call the Popper#update method
|
|
86
81
|
*/
|
|
87
|
-
|
|
88
82
|
var updatePopper = useRef();
|
|
89
|
-
|
|
90
83
|
var _useState = useState({
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Show the picker floating panel
|
|
86
|
+
*/
|
|
87
|
+
isOpen: false,
|
|
88
|
+
/**
|
|
89
|
+
* Show the full custom emoji list picker or the default list of emojis
|
|
90
|
+
*/
|
|
91
|
+
showFullPicker: !!allowAllEmojis && Array.isArray(pickerQuickReactionEmojiIds) && pickerQuickReactionEmojiIds.length === 0
|
|
92
|
+
}),
|
|
93
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
94
|
+
settings = _useState2[0],
|
|
95
|
+
setSettings = _useState2[1];
|
|
95
96
|
|
|
96
|
-
/**
|
|
97
|
-
* Show the full custom emoji list picker or the default list of emojis
|
|
98
|
-
*/
|
|
99
|
-
showFullPicker: !!allowAllEmojis && Array.isArray(pickerQuickReactionEmojiIds) && pickerQuickReactionEmojiIds.length === 0
|
|
100
|
-
}),
|
|
101
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
102
|
-
settings = _useState2[0],
|
|
103
|
-
setSettings = _useState2[1];
|
|
104
97
|
/**
|
|
105
98
|
* Custom hook triggers when user clicks outside the reactions picker
|
|
106
99
|
*/
|
|
107
|
-
|
|
108
|
-
|
|
109
100
|
useClickAway(wrapperRef, function () {
|
|
110
101
|
onCancel();
|
|
111
102
|
close();
|
|
112
|
-
}, 'click', true);
|
|
103
|
+
}, 'click', true, settings.isOpen);
|
|
104
|
+
|
|
113
105
|
/**
|
|
114
106
|
* Event callback when the picker is closed
|
|
115
107
|
* @param _id Optional id if an emoji button was selected or undefineed if was clicked outside the picker
|
|
116
108
|
*/
|
|
117
|
-
|
|
118
109
|
var close = useCallback(function (_id) {
|
|
119
110
|
setSettings({
|
|
120
111
|
isOpen: false,
|
|
121
112
|
showFullPicker: !!allowAllEmojis && Array.isArray(pickerQuickReactionEmojiIds) && pickerQuickReactionEmojiIds.length === 0
|
|
122
|
-
});
|
|
123
|
-
|
|
113
|
+
});
|
|
114
|
+
// ufo abort reaction experience
|
|
124
115
|
UFO.PickerRender.abort({
|
|
125
116
|
metadata: {
|
|
126
117
|
emojiId: _id,
|
|
@@ -129,11 +120,11 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
129
120
|
}
|
|
130
121
|
});
|
|
131
122
|
}, [allowAllEmojis, pickerQuickReactionEmojiIds]);
|
|
123
|
+
|
|
132
124
|
/**
|
|
133
125
|
* Event handle rwhen selecting to show the custom emoji icons picker
|
|
134
126
|
* @param e event param
|
|
135
127
|
*/
|
|
136
|
-
|
|
137
128
|
var onSelectMoreClick = useCallback(function (e) {
|
|
138
129
|
e.preventDefault();
|
|
139
130
|
setSettings({
|
|
@@ -142,24 +133,23 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
142
133
|
});
|
|
143
134
|
onShowMore();
|
|
144
135
|
}, [onShowMore]);
|
|
136
|
+
|
|
145
137
|
/**
|
|
146
138
|
* Event callback when an emoji icon is selected
|
|
147
139
|
* @param item selected item
|
|
148
140
|
*/
|
|
149
|
-
|
|
150
141
|
var onEmojiSelected = useCallback(function (item) {
|
|
151
142
|
// no emoji was selected
|
|
152
143
|
if (!item.id) {
|
|
153
144
|
return;
|
|
154
145
|
}
|
|
155
|
-
|
|
156
146
|
onSelection(item.id, settings.showFullPicker ? 'emojiPicker' : 'quickSelector');
|
|
157
147
|
close(item.id);
|
|
158
148
|
}, [close, onSelection, settings.showFullPicker]);
|
|
149
|
+
|
|
159
150
|
/**
|
|
160
151
|
* Event handler when the emoji icon to open the custom picker is selected
|
|
161
152
|
*/
|
|
162
|
-
|
|
163
153
|
var onTriggerClick = function onTriggerClick() {
|
|
164
154
|
// ufo start reactions picker open experience
|
|
165
155
|
UFO.PickerRender.start();
|
|
@@ -167,15 +157,14 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
167
157
|
isOpen: !settings.isOpen,
|
|
168
158
|
showFullPicker: !!allowAllEmojis && Array.isArray(pickerQuickReactionEmojiIds) && pickerQuickReactionEmojiIds.length === 0
|
|
169
159
|
});
|
|
170
|
-
onOpen();
|
|
171
|
-
|
|
160
|
+
onOpen();
|
|
161
|
+
// ufo reactions picker opened success
|
|
172
162
|
UFO.PickerRender.success();
|
|
173
163
|
};
|
|
164
|
+
|
|
174
165
|
/**
|
|
175
166
|
* When picker is opened, re-calculate the picker position
|
|
176
167
|
*/
|
|
177
|
-
|
|
178
|
-
|
|
179
168
|
useEffect(function () {
|
|
180
169
|
if (settings.isOpen) {
|
|
181
170
|
if (updatePopper.current) {
|
|
@@ -187,10 +176,12 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
187
176
|
return jsx("div", {
|
|
188
177
|
className: wrapperClassName,
|
|
189
178
|
css: styles.pickerStyle,
|
|
190
|
-
"data-testid": RENDER_REACTIONPICKER_TESTID
|
|
179
|
+
"data-testid": RENDER_REACTIONPICKER_TESTID,
|
|
180
|
+
ref: wrapperRef
|
|
191
181
|
}, jsx(Manager, null, jsx(Reference, null, function (_ref) {
|
|
192
182
|
var popperRef = _ref.ref;
|
|
193
|
-
return (
|
|
183
|
+
return (
|
|
184
|
+
// Render a button to open the <Selector /> panel
|
|
194
185
|
jsx(Trigger, {
|
|
195
186
|
ariaAttributes: {
|
|
196
187
|
'aria-expanded': settings.isOpen,
|
|
@@ -208,8 +199,8 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
208
199
|
modifiers: popperModifiers
|
|
209
200
|
}, function (_ref2) {
|
|
210
201
|
var ref = _ref2.ref,
|
|
211
|
-
|
|
212
|
-
|
|
202
|
+
style = _ref2.style,
|
|
203
|
+
update = _ref2.update;
|
|
213
204
|
updatePopper.current = update;
|
|
214
205
|
return jsx(Fragment, null, settings.isOpen && jsx("div", {
|
|
215
206
|
id: PICKER_CONTROL_ID,
|
|
@@ -218,8 +209,7 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
218
209
|
}, style),
|
|
219
210
|
ref: ref
|
|
220
211
|
}, jsx("div", {
|
|
221
|
-
css: styles.popupStyle
|
|
222
|
-
ref: wrapperRef
|
|
212
|
+
css: styles.popupStyle
|
|
223
213
|
}, settings.showFullPicker ? jsx(EmojiPicker, {
|
|
224
214
|
emojiProvider: emojiProvider,
|
|
225
215
|
onSelection: onEmojiSelected,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import React from 'react';
|
|
5
4
|
import { jsx } from '@emotion/react';
|
|
@@ -7,27 +6,26 @@ import Tooltip from '@atlaskit/tooltip';
|
|
|
7
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
7
|
import { constants, i18n } from '../../shared';
|
|
9
8
|
import * as styles from './styles';
|
|
9
|
+
|
|
10
10
|
/**
|
|
11
11
|
* Test id for wrapper ReactionTooltip div
|
|
12
12
|
*/
|
|
13
|
-
|
|
14
13
|
export var RENDER_REACTIONTOOLTIP_TESTID = 'render-reactionTooltip';
|
|
15
14
|
export var ReactionTooltip = function ReactionTooltip(_ref) {
|
|
16
15
|
var children = _ref.children,
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
16
|
+
emojiName = _ref.emojiName,
|
|
17
|
+
_ref$reaction = _ref.reaction,
|
|
18
|
+
_ref$reaction$users = _ref$reaction.users,
|
|
19
|
+
users = _ref$reaction$users === void 0 ? [] : _ref$reaction$users,
|
|
20
|
+
_ref$reaction$emojiId = _ref$reaction.emojiId,
|
|
21
|
+
emojiId = _ref$reaction$emojiId === void 0 ? '' : _ref$reaction$emojiId,
|
|
22
|
+
_ref$maxReactions = _ref.maxReactions,
|
|
23
|
+
maxReactions = _ref$maxReactions === void 0 ? constants.TOOLTIP_USERS_LIMIT : _ref$maxReactions,
|
|
24
|
+
handleUserListClick = _ref.handleUserListClick,
|
|
25
|
+
_ref$allowUserDialog = _ref.allowUserDialog,
|
|
26
|
+
allowUserDialog = _ref$allowUserDialog === void 0 ? false : _ref$allowUserDialog,
|
|
27
|
+
_ref$isEnabled = _ref.isEnabled,
|
|
28
|
+
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled;
|
|
31
29
|
/**
|
|
32
30
|
* Render list of users in the tooltip box
|
|
33
31
|
*/
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
5
4
|
import { jsx } from '@emotion/react';
|
|
@@ -15,37 +14,33 @@ import { Reaction } from '../Reaction';
|
|
|
15
14
|
import { ReactionsDialog } from '../ReactionDialog';
|
|
16
15
|
import { ReactionPicker } from '../ReactionPicker';
|
|
17
16
|
import * as styles from './styles';
|
|
17
|
+
|
|
18
18
|
/**
|
|
19
19
|
* Set of all available UFO experiences relating to reactions dialog
|
|
20
20
|
*/
|
|
21
|
-
|
|
22
21
|
export var ufoExperiences = {
|
|
23
22
|
/**
|
|
24
23
|
* Expeirence when a reaction dialog is opened
|
|
25
24
|
*/
|
|
26
25
|
openDialog: UFO.ReactionDialogOpened,
|
|
27
|
-
|
|
28
26
|
/**
|
|
29
27
|
* Experience when a reaction dialog is closed
|
|
30
28
|
*/
|
|
31
29
|
closeDialog: UFO.ReactionDialogClosed,
|
|
32
|
-
|
|
33
30
|
/**
|
|
34
31
|
* Experience when a reaction changed/fetched from inside the modal dialog
|
|
35
32
|
*/
|
|
36
33
|
selectedReactionChangeInsideDialog: UFO.ReactionDialogSelectedReactionChanged
|
|
37
34
|
};
|
|
35
|
+
|
|
38
36
|
/**
|
|
39
37
|
* Test id for wrapper Reactions div
|
|
40
38
|
*/
|
|
41
|
-
|
|
42
39
|
export var RENDER_REACTIONS_TESTID = 'render-reactions';
|
|
43
40
|
/**
|
|
44
41
|
* Test id for the view all reacted user to trigger the dialog
|
|
45
42
|
*/
|
|
46
|
-
|
|
47
43
|
export var RENDER_VIEWALL_REACTED_USERS_DIALOG = 'viewall-reacted-users-dialog';
|
|
48
|
-
|
|
49
44
|
/**
|
|
50
45
|
* Get content of the tooltip
|
|
51
46
|
*/
|
|
@@ -54,60 +49,54 @@ export function getTooltip(status, errorMessage) {
|
|
|
54
49
|
case ReactionStatus.error:
|
|
55
50
|
return errorMessage || jsx(FormattedMessage, i18n.messages.unexpectedError);
|
|
56
51
|
// When reaction is not available don't show any tooltip (e.g. Archive page in Confluence)
|
|
57
|
-
|
|
58
52
|
case ReactionStatus.disabled:
|
|
59
53
|
return null;
|
|
60
|
-
|
|
61
54
|
case ReactionStatus.notLoaded:
|
|
62
55
|
case ReactionStatus.loading:
|
|
63
56
|
return jsx(FormattedMessage, i18n.messages.loadingReactions);
|
|
64
|
-
|
|
65
57
|
case ReactionStatus.ready:
|
|
66
58
|
return jsx(FormattedMessage, i18n.messages.addReaction);
|
|
67
59
|
}
|
|
68
60
|
}
|
|
61
|
+
|
|
69
62
|
/**
|
|
70
63
|
* Renders list of reactions
|
|
71
64
|
*/
|
|
72
|
-
|
|
73
65
|
export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
74
66
|
var _ref$flash = _ref.flash,
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
67
|
+
flash = _ref$flash === void 0 ? {} : _ref$flash,
|
|
68
|
+
status = _ref.status,
|
|
69
|
+
errorMessage = _ref.errorMessage,
|
|
70
|
+
loadReaction = _ref.loadReaction,
|
|
71
|
+
quickReactionEmojis = _ref.quickReactionEmojis,
|
|
72
|
+
pickerQuickReactionEmojiIds = _ref.pickerQuickReactionEmojiIds,
|
|
73
|
+
_ref$getReactionDetai = _ref.getReactionDetails,
|
|
74
|
+
getReactionDetails = _ref$getReactionDetai === void 0 ? function () {} : _ref$getReactionDetai,
|
|
75
|
+
_ref$onReactionHover = _ref.onReactionHover,
|
|
76
|
+
onReactionHover = _ref$onReactionHover === void 0 ? function () {} : _ref$onReactionHover,
|
|
77
|
+
onSelection = _ref.onSelection,
|
|
78
|
+
_ref$reactions = _ref.reactions,
|
|
79
|
+
reactions = _ref$reactions === void 0 ? [] : _ref$reactions,
|
|
80
|
+
emojiProvider = _ref.emojiProvider,
|
|
81
|
+
allowAllEmojis = _ref.allowAllEmojis,
|
|
82
|
+
onReactionClick = _ref.onReactionClick,
|
|
83
|
+
allowUserDialog = _ref.allowUserDialog,
|
|
84
|
+
_ref$onDialogOpenCall = _ref.onDialogOpenCallback,
|
|
85
|
+
onDialogOpenCallback = _ref$onDialogOpenCall === void 0 ? function () {} : _ref$onDialogOpenCall,
|
|
86
|
+
_ref$onDialogCloseCal = _ref.onDialogCloseCallback,
|
|
87
|
+
onDialogCloseCallback = _ref$onDialogCloseCal === void 0 ? function () {} : _ref$onDialogCloseCal,
|
|
88
|
+
_ref$onDialogSelectRe = _ref.onDialogSelectReactionCallback,
|
|
89
|
+
onDialogSelectReactionCallback = _ref$onDialogSelectRe === void 0 ? function () {} : _ref$onDialogSelectRe,
|
|
90
|
+
_ref$emojiPickerSize = _ref.emojiPickerSize,
|
|
91
|
+
emojiPickerSize = _ref$emojiPickerSize === void 0 ? 'medium' : _ref$emojiPickerSize,
|
|
92
|
+
_ref$miniMode = _ref.miniMode,
|
|
93
|
+
miniMode = _ref$miniMode === void 0 ? false : _ref$miniMode;
|
|
103
94
|
var _useState = useState(),
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
95
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
96
|
+
selectedEmojiId = _useState2[0],
|
|
97
|
+
setSelectedEmojiId = _useState2[1];
|
|
108
98
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
111
100
|
var openTime = useRef();
|
|
112
101
|
var renderTime = useRef();
|
|
113
102
|
useEffect(function () {
|
|
@@ -120,7 +109,6 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
120
109
|
renderTime.current = Date.now();
|
|
121
110
|
} else {
|
|
122
111
|
var _renderTime$current;
|
|
123
|
-
|
|
124
112
|
Analytics.createAndFireSafe(createAnalyticsEvent, Analytics.createReactionsRenderedEvent, (_renderTime$current = renderTime.current) !== null && _renderTime$current !== void 0 ? _renderTime$current : Date.now() //renderTime.current can be null during unit test cases
|
|
125
113
|
);
|
|
126
114
|
renderTime.current = undefined;
|
|
@@ -151,17 +139,18 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
151
139
|
openTime.current = undefined;
|
|
152
140
|
onSelection(emojiId);
|
|
153
141
|
}, [createAnalyticsEvent, onSelection, reactions]);
|
|
142
|
+
|
|
154
143
|
/**
|
|
155
144
|
* event handler to open selected reaction from tooltip
|
|
156
145
|
* @param emojiId selected emoji id
|
|
157
146
|
*/
|
|
158
|
-
|
|
159
147
|
var handleOpenReactionsDialog = function handleOpenReactionsDialog(emojiId) {
|
|
160
148
|
// ufo start opening reaction dialog
|
|
161
149
|
ufoExperiences.openDialog.start();
|
|
162
150
|
setSelectedEmojiId(emojiId);
|
|
163
|
-
onDialogOpenCallback(emojiId, 'tooltip');
|
|
151
|
+
onDialogOpenCallback(emojiId, 'tooltip');
|
|
164
152
|
|
|
153
|
+
// ufo opening reaction dialog success
|
|
165
154
|
ufoExperiences.openDialog.success({
|
|
166
155
|
metadata: {
|
|
167
156
|
emojiId: emojiId,
|
|
@@ -170,19 +159,19 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
170
159
|
}
|
|
171
160
|
});
|
|
172
161
|
};
|
|
162
|
+
|
|
173
163
|
/**
|
|
174
164
|
* Event handler to oepn all reactions link button
|
|
175
165
|
*/
|
|
176
|
-
|
|
177
|
-
|
|
178
166
|
var handleOpenAllReactionsDialog = function handleOpenAllReactionsDialog() {
|
|
179
167
|
// ufo start opening reaction dialog
|
|
180
168
|
ufoExperiences.openDialog.start();
|
|
181
169
|
var emojiId = reactions[0].emojiId;
|
|
182
170
|
getReactionDetails(emojiId);
|
|
183
171
|
setSelectedEmojiId(emojiId);
|
|
184
|
-
onDialogOpenCallback(emojiId, 'button');
|
|
172
|
+
onDialogOpenCallback(emojiId, 'button');
|
|
185
173
|
|
|
174
|
+
// ufo opening reaction dialog success
|
|
186
175
|
ufoExperiences.openDialog.success({
|
|
187
176
|
metadata: {
|
|
188
177
|
emojiId: emojiId,
|
|
@@ -191,13 +180,13 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
191
180
|
}
|
|
192
181
|
});
|
|
193
182
|
};
|
|
194
|
-
|
|
195
183
|
var handleCloseReactionsDialog = function handleCloseReactionsDialog(e, analyticsEvent) {
|
|
196
184
|
// ufo closing opening reaction dialog
|
|
197
185
|
ufoExperiences.closeDialog.start();
|
|
198
186
|
setSelectedEmojiId('');
|
|
199
|
-
onDialogCloseCallback(e, analyticsEvent);
|
|
187
|
+
onDialogCloseCallback(e, analyticsEvent);
|
|
200
188
|
|
|
189
|
+
// ufo closing reaction dialog success
|
|
201
190
|
ufoExperiences.closeDialog.success({
|
|
202
191
|
metadata: {
|
|
203
192
|
source: 'Reactions',
|
|
@@ -205,13 +194,13 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
205
194
|
}
|
|
206
195
|
});
|
|
207
196
|
};
|
|
208
|
-
|
|
209
197
|
var handleSelectReactionInDialog = function handleSelectReactionInDialog(emojiId, analyticsEvent) {
|
|
210
198
|
// ufo selected reaction inside the modal dialog
|
|
211
199
|
ufoExperiences.selectedReactionChangeInsideDialog.start();
|
|
212
200
|
handleReactionMouseEnter(emojiId);
|
|
213
|
-
onDialogSelectReactionCallback(emojiId, analyticsEvent);
|
|
201
|
+
onDialogSelectReactionCallback(emojiId, analyticsEvent);
|
|
214
202
|
|
|
203
|
+
// ufo selected reaction inside the modal dialog success
|
|
215
204
|
ufoExperiences.selectedReactionChangeInsideDialog.success({
|
|
216
205
|
metadata: {
|
|
217
206
|
emojiId: emojiId,
|
|
@@ -220,25 +209,23 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
220
209
|
}
|
|
221
210
|
});
|
|
222
211
|
};
|
|
212
|
+
|
|
223
213
|
/**
|
|
224
214
|
* Get the reactions that we want to render are any reactions with a count greater than zero as well as any default emoji not already shown
|
|
225
215
|
*/
|
|
226
|
-
|
|
227
|
-
|
|
228
216
|
var memorizedReactions = useMemo(function () {
|
|
229
217
|
//
|
|
230
|
-
|
|
231
218
|
/**
|
|
232
219
|
* If reactions not empty, don't show quick reactions Pre defined emoji or if its empty => return the current list of reactions
|
|
233
220
|
*/
|
|
234
221
|
if (reactions.length > 0 || !quickReactionEmojis) {
|
|
235
222
|
return reactions;
|
|
236
|
-
}
|
|
237
|
-
|
|
223
|
+
}
|
|
238
224
|
|
|
225
|
+
// add any missing default reactions
|
|
239
226
|
var ari = quickReactionEmojis.ari,
|
|
240
|
-
|
|
241
|
-
|
|
227
|
+
containerAri = quickReactionEmojis.containerAri,
|
|
228
|
+
emojiIds = quickReactionEmojis.emojiIds;
|
|
242
229
|
var items = emojiIds.filter(function (emojiId) {
|
|
243
230
|
return !reactions.some(function (reaction) {
|
|
244
231
|
return reaction.emojiId === emojiId;
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
|
|
3
2
|
/** @jsx jsx */
|
|
4
3
|
import React, { useEffect, useRef, useState } from 'react';
|
|
5
4
|
import { jsx } from '@emotion/react';
|
|
@@ -8,77 +7,70 @@ import { constants } from '../../shared';
|
|
|
8
7
|
import { EmojiButton } from '../EmojiButton';
|
|
9
8
|
import { ShowMore } from '../ShowMore';
|
|
10
9
|
import * as styles from './styles';
|
|
10
|
+
|
|
11
11
|
/**
|
|
12
12
|
* Test id for wrapper Selector div
|
|
13
13
|
*/
|
|
14
|
-
|
|
15
14
|
export var RENDER_SELECTOR_TESTID = 'render-selector';
|
|
16
|
-
|
|
17
15
|
/**
|
|
18
16
|
* Reactions picker panel part of the <ReactionPicker /> component
|
|
19
17
|
*/
|
|
20
18
|
export var Selector = function Selector(_ref) {
|
|
21
19
|
var emojiProvider = _ref.emojiProvider,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
20
|
+
onMoreClick = _ref.onMoreClick,
|
|
21
|
+
onSelection = _ref.onSelection,
|
|
22
|
+
showMore = _ref.showMore,
|
|
23
|
+
_ref$pickerQuickReact = _ref.pickerQuickReactionEmojiIds,
|
|
24
|
+
pickerQuickReactionEmojiIds = _ref$pickerQuickReact === void 0 ? constants.DefaultReactions : _ref$pickerQuickReact;
|
|
28
25
|
var _useState = useState(),
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
selection = _useState2[0],
|
|
28
|
+
setSelection = _useState2[1];
|
|
32
29
|
/**
|
|
33
30
|
* Collection of global DOM timeout ids when user selects emojis for animation display
|
|
34
31
|
*/
|
|
35
|
-
|
|
36
|
-
|
|
37
32
|
var timeoutIds = useRef([]);
|
|
33
|
+
|
|
38
34
|
/**
|
|
39
35
|
* Clear the timeouts for the selected emojis when the component unmounts
|
|
40
36
|
*/
|
|
41
|
-
|
|
42
37
|
useEffect(function () {
|
|
43
38
|
var timeoutValues = timeoutIds.current;
|
|
44
39
|
return function cleanup() {
|
|
45
40
|
timeoutValues.forEach(clearTimeout);
|
|
46
41
|
};
|
|
47
42
|
}, []);
|
|
43
|
+
|
|
48
44
|
/**
|
|
49
45
|
* event handler when an emoji gets selected
|
|
50
46
|
* @param item selected emoji
|
|
51
47
|
* @param description depth detail of the selected emoji
|
|
52
48
|
* @param event Dom event data
|
|
53
49
|
*/
|
|
54
|
-
|
|
55
50
|
var onSelected = function onSelected(item, description, event) {
|
|
56
51
|
timeoutIds.current.push(window.setTimeout(function () {
|
|
57
52
|
onSelection(item, description, event);
|
|
58
53
|
}, 250));
|
|
59
54
|
setSelection(item);
|
|
60
55
|
};
|
|
56
|
+
|
|
61
57
|
/**
|
|
62
58
|
* custom css styling for the emoji icon
|
|
63
59
|
* @param index location of the emoji in the rendered list of items
|
|
64
60
|
*/
|
|
65
|
-
|
|
66
|
-
|
|
67
61
|
var emojiStyleAnimation = function emojiStyleAnimation(index) {
|
|
68
62
|
return {
|
|
69
63
|
animationDelay: "".concat(index * 50, "ms")
|
|
70
64
|
};
|
|
71
65
|
};
|
|
66
|
+
|
|
72
67
|
/**
|
|
73
68
|
* Render the default emoji icon
|
|
74
69
|
* @param emoji emoji item
|
|
75
70
|
* @param index location of the emoji in the array
|
|
76
71
|
*/
|
|
77
|
-
|
|
78
|
-
|
|
79
72
|
var renderEmoji = function renderEmoji(emoji, index) {
|
|
80
73
|
var _emoji$id;
|
|
81
|
-
|
|
82
74
|
return jsx("div", {
|
|
83
75
|
key: (_emoji$id = emoji.id) !== null && _emoji$id !== void 0 ? _emoji$id : emoji.shortName,
|
|
84
76
|
className: emoji === selection ? 'selected' : undefined,
|
|
@@ -93,7 +85,6 @@ export var Selector = function Selector(_ref) {
|
|
|
93
85
|
onClick: onSelected
|
|
94
86
|
})));
|
|
95
87
|
};
|
|
96
|
-
|
|
97
88
|
return jsx("div", {
|
|
98
89
|
css: styles.selectorStyle
|
|
99
90
|
}, pickerQuickReactionEmojiIds ? pickerQuickReactionEmojiIds.map(renderEmoji) : null, showMore ? jsx(ShowMore, {
|
|
@@ -29,11 +29,11 @@ export var revealAnimation = keyframes({
|
|
|
29
29
|
export var revealStyle = css({
|
|
30
30
|
animation: "".concat(revealAnimation, " 150ms ease-in-out forwards")
|
|
31
31
|
});
|
|
32
|
+
|
|
32
33
|
/**
|
|
33
34
|
* custom css styling for the emoji icon
|
|
34
35
|
* @param index location of the emoji in the rendered list of items
|
|
35
36
|
*/
|
|
36
|
-
|
|
37
37
|
export var emojiStyleAnimation = function emojiStyleAnimation(index) {
|
|
38
38
|
return {
|
|
39
39
|
animationDelay: "".concat(index * 50, "ms")
|