@atlaskit/reactions 21.4.0 → 21.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/MockReactionsClient/package.json +7 -0
- package/dist/cjs/MockReactionsClient.js +276 -0
- package/dist/cjs/analytics/analytics.js +141 -0
- package/dist/cjs/analytics/index.js +4 -134
- package/dist/cjs/client/ReactionServiceClient.js +29 -6
- package/dist/cjs/components/{Counter.js → Counter/Counter.js} +32 -39
- package/dist/cjs/components/Counter/index.js +36 -0
- package/dist/cjs/components/Counter/styles.js +33 -0
- package/dist/cjs/components/EmojiButton/EmojiButton.js +58 -0
- package/dist/cjs/components/EmojiButton/index.js +19 -0
- package/dist/cjs/components/EmojiButton/styles.js +25 -0
- package/dist/cjs/components/FlashAnimation/FlashAnimation.js +42 -0
- package/dist/cjs/components/FlashAnimation/index.js +19 -0
- package/dist/cjs/components/{FlashAnimation.js → FlashAnimation/styles.js} +7 -26
- package/dist/cjs/components/Reaction/Reaction.js +163 -0
- package/dist/cjs/components/Reaction/index.js +19 -0
- package/dist/cjs/components/Reaction/styles.js +70 -0
- package/dist/cjs/components/ReactionPicker/ReactionPicker.js +272 -0
- package/dist/cjs/components/ReactionPicker/index.js +19 -0
- package/dist/cjs/components/ReactionPicker/styles.js +37 -0
- package/dist/cjs/components/ReactionTooltip/ReactionTooltip.js +71 -0
- package/dist/cjs/components/ReactionTooltip/index.js +19 -0
- package/dist/cjs/components/ReactionTooltip/styles.js +46 -0
- package/dist/cjs/components/Reactions/Reactions.js +200 -0
- package/dist/cjs/components/Reactions/index.js +25 -0
- package/dist/cjs/components/Reactions/styles.js +29 -0
- package/dist/cjs/components/Selector/Selector.js +132 -0
- package/dist/cjs/components/Selector/index.js +30 -0
- package/dist/cjs/components/Selector/styles.js +56 -0
- package/dist/cjs/components/ShowMore/ShowMore.js +71 -0
- package/dist/cjs/components/ShowMore/index.js +19 -0
- package/dist/cjs/components/ShowMore/styles.js +44 -0
- package/dist/cjs/components/Trigger/Trigger.js +59 -0
- package/dist/cjs/components/Trigger/index.js +13 -0
- package/dist/cjs/components/Trigger/styles.js +46 -0
- package/dist/cjs/components/{UfoErrorBoundary.js → UfoErrorBoundary/UfoErrorBoundary.js} +3 -0
- package/dist/cjs/components/UfoErrorBoundary/index.js +13 -0
- package/dist/cjs/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +62 -0
- package/dist/cjs/containers/ConnectedReactionPicker/index.js +13 -0
- package/dist/cjs/containers/ConnectedReactionsView/ConnectedReactionsView.js +258 -0
- package/dist/cjs/containers/ConnectedReactionsView/index.js +13 -0
- package/dist/cjs/containers/index.js +23 -13
- package/dist/cjs/hooks/index.js +13 -0
- package/dist/cjs/hooks/useClickAway.js +35 -0
- package/dist/cjs/index.js +8 -0
- package/dist/cjs/shared/constants.js +44 -0
- package/dist/cjs/{components → shared}/i18n.js +1 -1
- package/dist/cjs/shared/index.js +24 -0
- package/dist/cjs/shared/utils.js +54 -0
- package/dist/cjs/store/{ReactionsStore.js → MemoryReactionsStore.js} +41 -18
- package/dist/cjs/store/ReactionConsumer.js +43 -15
- package/dist/cjs/store/index.js +8 -2
- package/dist/cjs/store/utils.js +4 -10
- package/dist/cjs/{client/ReactionClient.js → types/client.js} +0 -0
- package/dist/cjs/types/index.js +2 -2
- package/dist/cjs/types/reaction.js +43 -0
- package/dist/cjs/types/{DetailedReaction.js → store.js} +0 -0
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/MockReactionsClient.js +126 -0
- package/dist/es2019/analytics/analytics.js +64 -0
- package/dist/es2019/analytics/index.js +3 -65
- package/dist/es2019/analytics/ufo.js +0 -1
- package/dist/es2019/client/ReactionServiceClient.js +31 -6
- package/dist/es2019/components/{Counter.js → Counter/Counter.js} +26 -31
- package/dist/es2019/components/Counter/index.js +3 -0
- package/dist/es2019/components/Counter/styles.js +20 -0
- package/dist/es2019/components/EmojiButton/EmojiButton.js +35 -0
- package/dist/es2019/components/EmojiButton/index.js +1 -0
- package/dist/es2019/components/EmojiButton/styles.js +16 -0
- package/dist/es2019/components/FlashAnimation/FlashAnimation.js +18 -0
- package/dist/es2019/components/FlashAnimation/index.js +1 -0
- package/dist/es2019/components/{FlashAnimation.js → FlashAnimation/styles.js} +6 -17
- package/dist/es2019/components/Reaction/Reaction.js +104 -0
- package/dist/es2019/components/Reaction/index.js +1 -0
- package/dist/es2019/components/Reaction/styles.js +55 -0
- package/dist/es2019/components/ReactionPicker/ReactionPicker.js +208 -0
- package/dist/es2019/components/ReactionPicker/index.js +1 -0
- package/dist/es2019/components/ReactionPicker/styles.js +23 -0
- package/dist/es2019/components/ReactionTooltip/ReactionTooltip.js +46 -0
- package/dist/es2019/components/ReactionTooltip/index.js +1 -0
- package/dist/es2019/components/ReactionTooltip/styles.js +32 -0
- package/dist/es2019/components/Reactions/Reactions.js +156 -0
- package/dist/es2019/components/Reactions/index.js +1 -0
- package/dist/es2019/components/Reactions/styles.js +19 -0
- package/dist/es2019/components/Selector/Selector.js +98 -0
- package/dist/es2019/components/Selector/index.js +3 -0
- package/dist/es2019/components/Selector/styles.js +39 -0
- package/dist/es2019/components/ShowMore/ShowMore.js +43 -0
- package/dist/es2019/components/ShowMore/index.js +1 -0
- package/dist/es2019/components/ShowMore/styles.js +30 -0
- package/dist/es2019/components/{Trigger.js → Trigger/Trigger.js} +15 -20
- package/dist/es2019/components/Trigger/index.js +1 -0
- package/dist/es2019/components/Trigger/styles.js +24 -0
- package/dist/es2019/components/{UfoErrorBoundary.js → UfoErrorBoundary/UfoErrorBoundary.js} +4 -0
- package/dist/es2019/components/UfoErrorBoundary/index.js +1 -0
- package/dist/es2019/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +27 -0
- package/dist/es2019/containers/ConnectedReactionPicker/index.js +1 -0
- package/dist/es2019/containers/ConnectedReactionsView/ConnectedReactionsView.js +166 -0
- package/dist/es2019/containers/ConnectedReactionsView/index.js +1 -0
- package/dist/es2019/containers/index.js +2 -2
- package/dist/es2019/hooks/index.js +1 -0
- package/dist/es2019/hooks/useClickAway.js +27 -0
- package/dist/es2019/index.js +3 -1
- package/dist/es2019/shared/constants.js +32 -0
- package/dist/es2019/{components → shared}/i18n.js +1 -1
- package/dist/es2019/shared/index.js +6 -0
- package/dist/es2019/shared/utils.js +35 -0
- package/dist/es2019/store/{ReactionsStore.js → MemoryReactionsStore.js} +40 -14
- package/dist/es2019/store/ReactionConsumer.js +18 -12
- package/dist/es2019/store/index.js +1 -1
- package/dist/es2019/store/utils.js +8 -4
- package/dist/es2019/{client/ReactionClient.js → types/client.js} +0 -0
- package/dist/es2019/types/index.js +1 -1
- package/dist/es2019/types/reaction.js +34 -0
- package/dist/es2019/types/{DetailedReaction.js → store.js} +0 -0
- package/dist/es2019/version.json +1 -1
- package/dist/esm/MockReactionsClient.js +257 -0
- package/dist/esm/analytics/analytics.js +99 -0
- package/dist/esm/analytics/index.js +3 -99
- package/dist/esm/analytics/ufo.js +0 -1
- package/dist/esm/client/ReactionServiceClient.js +30 -6
- package/dist/esm/components/{Counter.js → Counter/Counter.js} +26 -31
- package/dist/esm/components/Counter/index.js +3 -0
- package/dist/esm/components/Counter/styles.js +20 -0
- package/dist/esm/components/EmojiButton/EmojiButton.js +35 -0
- package/dist/esm/components/EmojiButton/index.js +1 -0
- package/dist/esm/components/EmojiButton/styles.js +16 -0
- package/dist/esm/components/FlashAnimation/FlashAnimation.js +20 -0
- package/dist/esm/components/FlashAnimation/index.js +1 -0
- package/dist/esm/components/{FlashAnimation.js → FlashAnimation/styles.js} +6 -19
- package/dist/esm/components/Reaction/Reaction.js +131 -0
- package/dist/esm/components/Reaction/index.js +1 -0
- package/dist/esm/components/Reaction/styles.js +55 -0
- package/dist/esm/components/ReactionPicker/ReactionPicker.js +243 -0
- package/dist/esm/components/ReactionPicker/index.js +1 -0
- package/dist/esm/components/ReactionPicker/styles.js +23 -0
- package/dist/esm/components/ReactionTooltip/ReactionTooltip.js +46 -0
- package/dist/esm/components/ReactionTooltip/index.js +1 -0
- package/dist/esm/components/ReactionTooltip/styles.js +32 -0
- package/dist/esm/components/Reactions/Reactions.js +166 -0
- package/dist/esm/components/Reactions/index.js +1 -0
- package/dist/esm/components/Reactions/styles.js +19 -0
- package/dist/esm/components/Selector/Selector.js +107 -0
- package/dist/esm/components/Selector/index.js +3 -0
- package/dist/esm/components/Selector/styles.js +41 -0
- package/dist/esm/components/ShowMore/ShowMore.js +46 -0
- package/dist/esm/components/ShowMore/index.js +1 -0
- package/dist/esm/components/ShowMore/styles.js +30 -0
- package/dist/esm/components/{Trigger.js → Trigger/Trigger.js} +15 -20
- package/dist/esm/components/Trigger/index.js +1 -0
- package/dist/esm/components/Trigger/styles.js +31 -0
- package/dist/esm/components/{UfoErrorBoundary.js → UfoErrorBoundary/UfoErrorBoundary.js} +4 -0
- package/dist/esm/components/UfoErrorBoundary/index.js +1 -0
- package/dist/esm/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +46 -0
- package/dist/esm/containers/ConnectedReactionPicker/index.js +1 -0
- package/dist/esm/containers/ConnectedReactionsView/ConnectedReactionsView.js +227 -0
- package/dist/esm/containers/ConnectedReactionsView/index.js +1 -0
- package/dist/esm/containers/index.js +2 -2
- package/dist/esm/hooks/index.js +1 -0
- package/dist/esm/hooks/useClickAway.js +28 -0
- package/dist/esm/index.js +3 -1
- package/dist/esm/shared/constants.js +34 -0
- package/dist/esm/{components → shared}/i18n.js +1 -1
- package/dist/esm/shared/index.js +6 -0
- package/dist/esm/shared/utils.js +41 -0
- package/dist/esm/store/{ReactionsStore.js → MemoryReactionsStore.js} +40 -17
- package/dist/esm/store/ReactionConsumer.js +42 -15
- package/dist/esm/store/index.js +1 -1
- package/dist/esm/store/utils.js +8 -4
- package/dist/{es2019/types/ReactionSource.js → esm/types/client.js} +0 -0
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/reaction.js +34 -0
- package/dist/{es2019/types/ReactionSummary.js → esm/types/store.js} +0 -0
- package/dist/esm/version.json +1 -1
- package/dist/types/MockReactionsClient.d.ts +20 -0
- package/dist/types/analytics/analytics.d.ts +96 -0
- package/dist/types/analytics/index.d.ts +1 -96
- package/dist/types/client/ReactionServiceClient.d.ts +27 -10
- package/dist/types/client/index.d.ts +0 -1
- package/dist/types/components/Counter/Counter.d.ts +40 -0
- package/dist/types/components/Counter/index.d.ts +3 -0
- package/dist/types/components/Counter/styles.d.ts +3 -0
- package/dist/types/components/EmojiButton/EmojiButton.d.ts +22 -0
- package/dist/types/components/EmojiButton/index.d.ts +2 -0
- package/dist/types/components/EmojiButton/styles.d.ts +1 -0
- package/dist/types/components/FlashAnimation/FlashAnimation.d.ts +20 -0
- package/dist/types/components/FlashAnimation/index.d.ts +2 -0
- package/dist/types/components/FlashAnimation/styles.d.ts +3 -0
- package/dist/types/components/Reaction/Reaction.d.ts +38 -0
- package/dist/types/components/Reaction/index.d.ts +2 -0
- package/dist/types/components/Reaction/styles.d.ts +10 -0
- package/dist/types/components/ReactionPicker/ReactionPicker.d.ts +53 -0
- package/dist/types/components/ReactionPicker/index.d.ts +2 -0
- package/dist/types/components/ReactionPicker/styles.d.ts +3 -0
- package/dist/types/components/ReactionTooltip/ReactionTooltip.d.ts +22 -0
- package/dist/types/components/ReactionTooltip/index.d.ts +2 -0
- package/dist/types/components/ReactionTooltip/styles.d.ts +4 -0
- package/dist/types/components/Reactions/Reactions.d.ts +64 -0
- package/dist/types/components/Reactions/index.d.ts +2 -0
- package/dist/types/components/Reactions/styles.d.ts +2 -0
- package/dist/types/components/Selector/Selector.d.ts +34 -0
- package/dist/types/components/Selector/index.d.ts +3 -0
- package/dist/types/components/Selector/styles.d.ts +10 -0
- package/dist/types/components/ShowMore/ShowMore.d.ts +34 -0
- package/dist/types/components/ShowMore/index.d.ts +2 -0
- package/dist/types/components/ShowMore/styles.d.ts +3 -0
- package/dist/types/components/Trigger/Trigger.d.ts +23 -0
- package/dist/types/components/Trigger/index.d.ts +2 -0
- package/dist/types/components/Trigger/styles.d.ts +5 -0
- package/dist/types/components/UfoErrorBoundary/UfoErrorBoundary.d.ts +16 -0
- package/dist/types/components/UfoErrorBoundary/index.d.ts +2 -0
- package/dist/types/components/index.d.ts +4 -1
- package/dist/types/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +27 -0
- package/dist/types/containers/ConnectedReactionPicker/index.d.ts +2 -0
- package/dist/types/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +52 -0
- package/dist/types/containers/ConnectedReactionsView/index.d.ts +2 -0
- package/dist/types/containers/index.d.ts +2 -2
- package/dist/types/hooks/index.d.ts +1 -0
- package/dist/types/hooks/useClickAway.d.ts +8 -0
- package/dist/types/index.d.ts +2 -2
- package/dist/types/shared/constants.d.ts +13 -0
- package/dist/types/{components → shared}/i18n.d.ts +0 -0
- package/dist/types/shared/index.d.ts +3 -0
- package/dist/types/shared/utils.d.ts +11 -0
- package/dist/types/store/{ReactionsStore.d.ts → MemoryReactionsStore.d.ts} +23 -26
- package/dist/types/store/ReactionConsumer.d.ts +47 -19
- package/dist/types/store/index.d.ts +2 -2
- package/dist/types/store/utils.d.ts +3 -7
- package/dist/types/types/Actions.d.ts +20 -4
- package/dist/types/types/User.d.ts +6 -0
- package/dist/types/types/client.d.ts +38 -0
- package/dist/types/types/index.d.ts +5 -7
- package/dist/types/types/reaction.d.ts +82 -0
- package/dist/types/types/store.d.ts +63 -0
- package/docs/0-intro.tsx +118 -27
- package/docs/1-connected-reaction-picker.tsx +133 -0
- package/docs/2-connected-reactions-view.tsx +130 -0
- package/docs/3-reactions-store.tsx +71 -0
- package/docs/4-reaction-service-client.tsx +42 -0
- package/extract-react-type/ConnectedReactionPicker.ts +6 -0
- package/extract-react-type/ConnectedReactionsView.ts +6 -0
- package/extract-react-type/Reaction.ts +6 -0
- package/extract-react-type/Reactions.ts +6 -0
- package/extract-react-type/actions.ts +6 -0
- package/extract-react-type/reactionClient.ts +6 -0
- package/extract-react-type/reactionsStore.ts +6 -0
- package/package.json +24 -7
- package/dist/cjs/client/MockReactionsClient.js +0 -183
- package/dist/cjs/components/EmojiButton.js +0 -100
- package/dist/cjs/components/Reaction.js +0 -226
- package/dist/cjs/components/ReactionPicker.js +0 -289
- package/dist/cjs/components/ReactionTooltip.js +0 -82
- package/dist/cjs/components/Reactions.js +0 -194
- package/dist/cjs/components/Selector.js +0 -189
- package/dist/cjs/components/ShowMore.js +0 -119
- package/dist/cjs/components/Trigger.js +0 -58
- package/dist/cjs/components/utils.js +0 -28
- package/dist/cjs/containers/ConnectedReactionPicker.js +0 -44
- package/dist/cjs/containers/ConnectedReactionsView.js +0 -139
- package/dist/cjs/types/ReactionSource.js +0 -5
- package/dist/cjs/types/ReactionStatus.js +0 -15
- package/dist/cjs/types/ReactionSummary.js +0 -5
- package/dist/cjs/types/Reactions.js +0 -5
- package/dist/cjs/types/ReactionsState.js +0 -5
- package/dist/es2019/client/MockReactionsClient.js +0 -123
- package/dist/es2019/components/EmojiButton.js +0 -50
- package/dist/es2019/components/Reaction.js +0 -180
- package/dist/es2019/components/ReactionPicker.js +0 -239
- package/dist/es2019/components/ReactionTooltip.js +0 -66
- package/dist/es2019/components/Reactions.js +0 -150
- package/dist/es2019/components/Selector.js +0 -127
- package/dist/es2019/components/ShowMore.js +0 -71
- package/dist/es2019/components/utils.js +0 -13
- package/dist/es2019/containers/ConnectedReactionPicker.js +0 -27
- package/dist/es2019/containers/ConnectedReactionsView.js +0 -118
- package/dist/es2019/types/ReactionStatus.js +0 -8
- package/dist/es2019/types/Reactions.js +0 -1
- package/dist/es2019/types/ReactionsState.js +0 -1
- package/dist/esm/client/MockReactionsClient.js +0 -164
- package/dist/esm/client/ReactionClient.js +0 -1
- package/dist/esm/components/EmojiButton.js +0 -77
- package/dist/esm/components/Reaction.js +0 -204
- package/dist/esm/components/ReactionPicker.js +0 -266
- package/dist/esm/components/ReactionTooltip.js +0 -63
- package/dist/esm/components/Reactions.js +0 -180
- package/dist/esm/components/Selector.js +0 -160
- package/dist/esm/components/ShowMore.js +0 -95
- package/dist/esm/components/utils.js +0 -15
- package/dist/esm/containers/ConnectedReactionPicker.js +0 -29
- package/dist/esm/containers/ConnectedReactionsView.js +0 -116
- package/dist/esm/types/DetailedReaction.js +0 -1
- package/dist/esm/types/ReactionSource.js +0 -1
- package/dist/esm/types/ReactionStatus.js +0 -8
- package/dist/esm/types/ReactionSummary.js +0 -1
- package/dist/esm/types/Reactions.js +0 -1
- package/dist/esm/types/ReactionsState.js +0 -1
- package/dist/types/client/MockReactionsClient.d.ts +0 -28
- package/dist/types/client/ReactionClient.d.ts +0 -25
- package/dist/types/components/Counter.d.ts +0 -14
- package/dist/types/components/EmojiButton.d.ts +0 -12
- package/dist/types/components/FlashAnimation.d.ts +0 -13
- package/dist/types/components/Reaction.d.ts +0 -25
- package/dist/types/components/ReactionPicker.d.ts +0 -39
- package/dist/types/components/ReactionTooltip.d.ts +0 -9
- package/dist/types/components/Reactions.d.ts +0 -49
- package/dist/types/components/Selector.d.ts +0 -27
- package/dist/types/components/ShowMore.d.ts +0 -21
- package/dist/types/components/Trigger.d.ts +0 -7
- package/dist/types/components/UfoErrorBoundary.d.ts +0 -9
- package/dist/types/components/utils.d.ts +0 -4
- package/dist/types/containers/ConnectedReactionPicker.d.ts +0 -10
- package/dist/types/containers/ConnectedReactionsView.d.ts +0 -19
- package/dist/types/types/DetailedReaction.d.ts +0 -7
- package/dist/types/types/ReactionSource.d.ts +0 -1
- package/dist/types/types/ReactionStatus.d.ts +0 -6
- package/dist/types/types/ReactionSummary.d.ts +0 -10
- package/dist/types/types/Reactions.d.ts +0 -4
- package/dist/types/types/ReactionsState.d.ts +0 -17
|
@@ -1,289 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
|
-
Object.defineProperty(exports, "__esModule", {
|
|
8
|
-
value: true
|
|
9
|
-
});
|
|
10
|
-
exports.ReactionPicker = void 0;
|
|
11
|
-
|
|
12
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
13
|
-
|
|
14
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
15
|
-
|
|
16
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
17
|
-
|
|
18
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
19
|
-
|
|
20
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
21
|
-
|
|
22
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
23
|
-
|
|
24
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
25
|
-
|
|
26
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
27
|
-
|
|
28
|
-
var _reactDom = _interopRequireDefault(require("react-dom"));
|
|
29
|
-
|
|
30
|
-
var _core = require("@emotion/core");
|
|
31
|
-
|
|
32
|
-
var _picker = require("@atlaskit/emoji/picker");
|
|
33
|
-
|
|
34
|
-
var _popper = require("@atlaskit/popper");
|
|
35
|
-
|
|
36
|
-
var _constants = require("@atlaskit/theme/constants");
|
|
37
|
-
|
|
38
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
39
|
-
|
|
40
|
-
var _tokens = require("@atlaskit/tokens");
|
|
41
|
-
|
|
42
|
-
var _Selector = require("./Selector");
|
|
43
|
-
|
|
44
|
-
var _Trigger = require("./Trigger");
|
|
45
|
-
|
|
46
|
-
var _analytics = require("../analytics");
|
|
47
|
-
|
|
48
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
49
|
-
|
|
50
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
51
|
-
|
|
52
|
-
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; }
|
|
53
|
-
|
|
54
|
-
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) { (0, _defineProperty2.default)(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; }
|
|
55
|
-
|
|
56
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
57
|
-
|
|
58
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
59
|
-
|
|
60
|
-
var pickerStyle = (0, _core.css)({
|
|
61
|
-
verticalAlign: 'middle',
|
|
62
|
-
'&.miniMode': {
|
|
63
|
-
display: 'inline-block',
|
|
64
|
-
marginRight: '4px'
|
|
65
|
-
}
|
|
66
|
-
});
|
|
67
|
-
var contentStyle = (0, _core.css)({
|
|
68
|
-
display: 'flex'
|
|
69
|
-
});
|
|
70
|
-
var popupStyle = (0, _core.css)({
|
|
71
|
-
background: (0, _tokens.token)('elevation.surface.overlay', _colors.N0),
|
|
72
|
-
borderRadius: "".concat((0, _constants.borderRadius)(), "px"),
|
|
73
|
-
boxShadow: (0, _tokens.token)('elevation.shadow.overlay', "0 4px 8px -2px ".concat(_colors.N50A, ", 0 0 1px ").concat(_colors.N60A)),
|
|
74
|
-
'&> div': {
|
|
75
|
-
boxShadow: undefined
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
function noop() {}
|
|
80
|
-
|
|
81
|
-
var ReactionPicker = /*#__PURE__*/function (_PureComponent) {
|
|
82
|
-
(0, _inherits2.default)(ReactionPicker, _PureComponent);
|
|
83
|
-
|
|
84
|
-
var _super = _createSuper(ReactionPicker);
|
|
85
|
-
|
|
86
|
-
function ReactionPicker(props) {
|
|
87
|
-
var _this;
|
|
88
|
-
|
|
89
|
-
(0, _classCallCheck2.default)(this, ReactionPicker);
|
|
90
|
-
_this = _super.call(this, props);
|
|
91
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "updatePopper", noop);
|
|
92
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleClickOutside", function (e) {
|
|
93
|
-
var isOpen = _this.state.isOpen;
|
|
94
|
-
|
|
95
|
-
if (!isOpen) {
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
var domNode = _reactDom.default.findDOMNode((0, _assertThisInitialized2.default)(_this));
|
|
100
|
-
|
|
101
|
-
if (!domNode || e.target instanceof Node && !domNode.contains(e.target)) {
|
|
102
|
-
if (_this.props.onCancel) {
|
|
103
|
-
_this.props.onCancel();
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
_this.close();
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "showFullPicker", function (e) {
|
|
110
|
-
e.preventDefault();
|
|
111
|
-
var onMore = _this.props.onMore;
|
|
112
|
-
|
|
113
|
-
if (onMore) {
|
|
114
|
-
onMore();
|
|
115
|
-
} // Update popper position
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
_this.setState({
|
|
119
|
-
isOpen: true,
|
|
120
|
-
showFullPicker: true
|
|
121
|
-
}, function () {
|
|
122
|
-
return _this.updatePopper();
|
|
123
|
-
});
|
|
124
|
-
});
|
|
125
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onEmojiSelected", function (emoji) {
|
|
126
|
-
var onSelection = _this.props.onSelection;
|
|
127
|
-
|
|
128
|
-
if (!emoji.id) {
|
|
129
|
-
return;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
onSelection(emoji.id, _this.state.showFullPicker ? 'emojiPicker' : 'quickSelector');
|
|
133
|
-
|
|
134
|
-
_this.close(emoji.id);
|
|
135
|
-
});
|
|
136
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onTriggerClick", function () {
|
|
137
|
-
// ufo start reaction experience
|
|
138
|
-
_analytics.UFO.PickerRender.start();
|
|
139
|
-
|
|
140
|
-
if (_this.props.onOpen) {
|
|
141
|
-
_this.props.onOpen();
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
_this.setState({
|
|
145
|
-
isOpen: !_this.state.isOpen,
|
|
146
|
-
showFullPicker: false
|
|
147
|
-
}, function () {
|
|
148
|
-
// ufo add reaction success
|
|
149
|
-
_analytics.UFO.PickerRender.success();
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "popperModifiers", [{
|
|
153
|
-
name: 'applyStyle',
|
|
154
|
-
enabled: false
|
|
155
|
-
}, {
|
|
156
|
-
name: 'hide',
|
|
157
|
-
enabled: false
|
|
158
|
-
}, {
|
|
159
|
-
name: 'offset',
|
|
160
|
-
enabled: true,
|
|
161
|
-
options: {
|
|
162
|
-
offset: [0, 0]
|
|
163
|
-
}
|
|
164
|
-
}, {
|
|
165
|
-
name: 'flip',
|
|
166
|
-
enabled: true,
|
|
167
|
-
options: {
|
|
168
|
-
flipVariations: true,
|
|
169
|
-
boundariesElement: 'scrollParent'
|
|
170
|
-
}
|
|
171
|
-
}, {
|
|
172
|
-
name: 'preventOverflow',
|
|
173
|
-
enabled: true
|
|
174
|
-
}]);
|
|
175
|
-
_this.state = {
|
|
176
|
-
isOpen: false,
|
|
177
|
-
showFullPicker: false
|
|
178
|
-
};
|
|
179
|
-
return _this;
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
(0, _createClass2.default)(ReactionPicker, [{
|
|
183
|
-
key: "componentDidMount",
|
|
184
|
-
value: function componentDidMount() {
|
|
185
|
-
document.addEventListener('click', this.handleClickOutside);
|
|
186
|
-
}
|
|
187
|
-
}, {
|
|
188
|
-
key: "componentWillUnmount",
|
|
189
|
-
value: function componentWillUnmount() {
|
|
190
|
-
document.removeEventListener('click', this.handleClickOutside);
|
|
191
|
-
|
|
192
|
-
_analytics.UFO.PickerRender.abort({
|
|
193
|
-
metadata: {
|
|
194
|
-
source: 'Reaction-Picker',
|
|
195
|
-
reason: 'unmount'
|
|
196
|
-
}
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
}, {
|
|
200
|
-
key: "close",
|
|
201
|
-
value: function close(_emojiId) {
|
|
202
|
-
this.setState({
|
|
203
|
-
isOpen: false,
|
|
204
|
-
showFullPicker: false
|
|
205
|
-
}, function () {
|
|
206
|
-
// ufo abort reaction experience
|
|
207
|
-
_analytics.UFO.PickerRender.abort({
|
|
208
|
-
metadata: {
|
|
209
|
-
emojiId: _emojiId,
|
|
210
|
-
source: 'Reaction-Picker',
|
|
211
|
-
reason: 'close dialog'
|
|
212
|
-
}
|
|
213
|
-
});
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
}, {
|
|
217
|
-
key: "renderSelector",
|
|
218
|
-
value: function renderSelector() {
|
|
219
|
-
var _this$props = this.props,
|
|
220
|
-
emojiProvider = _this$props.emojiProvider,
|
|
221
|
-
allowAllEmojis = _this$props.allowAllEmojis;
|
|
222
|
-
return (0, _core.jsx)("div", {
|
|
223
|
-
css: contentStyle
|
|
224
|
-
}, (0, _core.jsx)(_Selector.Selector, {
|
|
225
|
-
emojiProvider: emojiProvider,
|
|
226
|
-
onSelection: this.onEmojiSelected,
|
|
227
|
-
showMore: allowAllEmojis,
|
|
228
|
-
onMoreClick: this.showFullPicker
|
|
229
|
-
}));
|
|
230
|
-
}
|
|
231
|
-
}, {
|
|
232
|
-
key: "renderEmojiPicker",
|
|
233
|
-
value: function renderEmojiPicker() {
|
|
234
|
-
return (0, _core.jsx)(_picker.EmojiPicker, {
|
|
235
|
-
emojiProvider: this.props.emojiProvider,
|
|
236
|
-
onSelection: this.onEmojiSelected
|
|
237
|
-
});
|
|
238
|
-
}
|
|
239
|
-
}, {
|
|
240
|
-
key: "renderContent",
|
|
241
|
-
value: function renderContent() {
|
|
242
|
-
return this.state.showFullPicker ? this.renderEmojiPicker() : this.renderSelector();
|
|
243
|
-
}
|
|
244
|
-
}, {
|
|
245
|
-
key: "render",
|
|
246
|
-
value: function render() {
|
|
247
|
-
var _this2 = this;
|
|
248
|
-
|
|
249
|
-
var isOpen = this.state.isOpen;
|
|
250
|
-
var _this$props2 = this.props,
|
|
251
|
-
miniMode = _this$props2.miniMode,
|
|
252
|
-
className = _this$props2.className;
|
|
253
|
-
return (0, _core.jsx)("div", {
|
|
254
|
-
className: " ".concat(isOpen ? 'isOpen' : '', " ").concat(miniMode ? 'miniMode' : '', " ").concat(className),
|
|
255
|
-
css: pickerStyle
|
|
256
|
-
}, (0, _core.jsx)(_popper.Manager, null, (0, _core.jsx)(_popper.Reference, null, function (_ref) {
|
|
257
|
-
var ref = _ref.ref;
|
|
258
|
-
return (0, _core.jsx)(_Trigger.Trigger, {
|
|
259
|
-
ref: ref,
|
|
260
|
-
onClick: _this2.onTriggerClick,
|
|
261
|
-
miniMode: miniMode,
|
|
262
|
-
disabled: _this2.props.disabled
|
|
263
|
-
});
|
|
264
|
-
}), (0, _core.jsx)(_popper.Popper, {
|
|
265
|
-
placement: "bottom-start",
|
|
266
|
-
modifiers: this.popperModifiers
|
|
267
|
-
}, function (_ref2) {
|
|
268
|
-
var ref = _ref2.ref,
|
|
269
|
-
style = _ref2.style,
|
|
270
|
-
update = _ref2.update;
|
|
271
|
-
_this2.updatePopper = update;
|
|
272
|
-
return (0, _core.jsx)(_react.Fragment, null, isOpen && (0, _core.jsx)("div", {
|
|
273
|
-
style: _objectSpread({
|
|
274
|
-
zIndex: _constants.layers.layer()
|
|
275
|
-
}, style),
|
|
276
|
-
ref: ref
|
|
277
|
-
}, (0, _core.jsx)("div", {
|
|
278
|
-
css: popupStyle
|
|
279
|
-
}, _this2.renderContent())));
|
|
280
|
-
})));
|
|
281
|
-
}
|
|
282
|
-
}]);
|
|
283
|
-
return ReactionPicker;
|
|
284
|
-
}(_react.PureComponent);
|
|
285
|
-
|
|
286
|
-
exports.ReactionPicker = ReactionPicker;
|
|
287
|
-
(0, _defineProperty2.default)(ReactionPicker, "defaultProps", {
|
|
288
|
-
disabled: false
|
|
289
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.ReactionTooltip = void 0;
|
|
9
|
-
|
|
10
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
-
|
|
12
|
-
var _react = _interopRequireDefault(require("react"));
|
|
13
|
-
|
|
14
|
-
var _core = require("@emotion/core");
|
|
15
|
-
|
|
16
|
-
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
|
-
|
|
18
|
-
var _reactIntlNext = require("react-intl-next");
|
|
19
|
-
|
|
20
|
-
var _tokens = require("@atlaskit/tokens");
|
|
21
|
-
|
|
22
|
-
var _colors = require("@atlaskit/theme/colors");
|
|
23
|
-
|
|
24
|
-
var _i18n = require("./i18n");
|
|
25
|
-
|
|
26
|
-
/** @jsx jsx */
|
|
27
|
-
var verticalMargin = 5;
|
|
28
|
-
var tooltipStyle = (0, _core.css)({
|
|
29
|
-
maxWidth: '150px',
|
|
30
|
-
textOverflow: 'ellipsis',
|
|
31
|
-
whiteSpace: 'nowrap',
|
|
32
|
-
overflow: 'hidden',
|
|
33
|
-
marginBottom: verticalMargin,
|
|
34
|
-
ul: {
|
|
35
|
-
listStyle: 'none',
|
|
36
|
-
margin: 0,
|
|
37
|
-
padding: 0,
|
|
38
|
-
textAlign: 'left'
|
|
39
|
-
},
|
|
40
|
-
li: {
|
|
41
|
-
overflow: 'hidden',
|
|
42
|
-
textOverflow: 'ellipsis',
|
|
43
|
-
marginTop: verticalMargin
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
var emojiNameStyle = (0, _core.css)({
|
|
47
|
-
textTransform: 'capitalize',
|
|
48
|
-
color: (0, _tokens.token)('color.text.inverse', _colors.N90),
|
|
49
|
-
fontWeight: 600
|
|
50
|
-
});
|
|
51
|
-
var footerStyle = (0, _core.css)({
|
|
52
|
-
color: (0, _tokens.token)('color.text.inverse', _colors.N90),
|
|
53
|
-
fontWeight: 300
|
|
54
|
-
});
|
|
55
|
-
var TOOLTIP_USERS_LIMIT = 5;
|
|
56
|
-
|
|
57
|
-
var ReactionTooltip = function ReactionTooltip(_ref) {
|
|
58
|
-
var emojiName = _ref.emojiName,
|
|
59
|
-
children = _ref.children,
|
|
60
|
-
users = _ref.reaction.users;
|
|
61
|
-
var content = !users || users.length === 0 ? null : (0, _core.jsx)("div", {
|
|
62
|
-
css: tooltipStyle
|
|
63
|
-
}, (0, _core.jsx)("ul", null, emojiName ? (0, _core.jsx)("li", {
|
|
64
|
-
css: emojiNameStyle
|
|
65
|
-
}, emojiName) : null, users.slice(0, TOOLTIP_USERS_LIMIT).map(function (user, index) {
|
|
66
|
-
return (0, _core.jsx)("li", {
|
|
67
|
-
key: index
|
|
68
|
-
}, user.displayName);
|
|
69
|
-
}), users.length > TOOLTIP_USERS_LIMIT ? (0, _core.jsx)("li", {
|
|
70
|
-
css: footerStyle
|
|
71
|
-
}, (0, _core.jsx)(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.otherUsers, {
|
|
72
|
-
values: {
|
|
73
|
-
count: users.length - TOOLTIP_USERS_LIMIT
|
|
74
|
-
}
|
|
75
|
-
}))) : null));
|
|
76
|
-
return (0, _core.jsx)(_tooltip.default, {
|
|
77
|
-
content: content,
|
|
78
|
-
position: "bottom"
|
|
79
|
-
}, _react.default.Children.only(children));
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
exports.ReactionTooltip = ReactionTooltip;
|
|
@@ -1,194 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
|
|
5
|
-
Object.defineProperty(exports, "__esModule", {
|
|
6
|
-
value: true
|
|
7
|
-
});
|
|
8
|
-
exports.ReactionsWithoutAnalytics = exports.Reactions = void 0;
|
|
9
|
-
|
|
10
|
-
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
|
|
11
|
-
|
|
12
|
-
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
|
|
13
|
-
|
|
14
|
-
var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime/helpers/assertThisInitialized"));
|
|
15
|
-
|
|
16
|
-
var _inherits2 = _interopRequireDefault(require("@babel/runtime/helpers/inherits"));
|
|
17
|
-
|
|
18
|
-
var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime/helpers/possibleConstructorReturn"));
|
|
19
|
-
|
|
20
|
-
var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime/helpers/getPrototypeOf"));
|
|
21
|
-
|
|
22
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
23
|
-
|
|
24
|
-
var _core = require("@emotion/core");
|
|
25
|
-
|
|
26
|
-
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
27
|
-
|
|
28
|
-
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
29
|
-
|
|
30
|
-
var _react = _interopRequireDefault(require("react"));
|
|
31
|
-
|
|
32
|
-
var _reactIntlNext = require("react-intl-next");
|
|
33
|
-
|
|
34
|
-
var _analytics = require("../analytics");
|
|
35
|
-
|
|
36
|
-
var _ReactionStatus = require("../types/ReactionStatus");
|
|
37
|
-
|
|
38
|
-
var _i18n = require("./i18n");
|
|
39
|
-
|
|
40
|
-
var _Reaction = require("./Reaction");
|
|
41
|
-
|
|
42
|
-
var _ReactionPicker = require("./ReactionPicker");
|
|
43
|
-
|
|
44
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
|
|
45
|
-
|
|
46
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
47
|
-
|
|
48
|
-
var reactionStyle = (0, _core.css)({
|
|
49
|
-
display: 'inline-block',
|
|
50
|
-
// top margin of 2px to allow spacing between rows when wrapped (paired with top margin in reactionsStyle)
|
|
51
|
-
margin: '2px 4px 0 4px'
|
|
52
|
-
});
|
|
53
|
-
var wrapperStyle = (0, _core.css)({
|
|
54
|
-
display: 'flex',
|
|
55
|
-
flexWrap: 'wrap',
|
|
56
|
-
position: 'relative',
|
|
57
|
-
alignItems: 'center',
|
|
58
|
-
borderRadius: '15px',
|
|
59
|
-
// To allow to row spacing of 2px on wrap, and 0px on first row
|
|
60
|
-
marginTop: '-2px',
|
|
61
|
-
'> :first-of-type > :first-child': {
|
|
62
|
-
marginLeft: 0
|
|
63
|
-
}
|
|
64
|
-
});
|
|
65
|
-
|
|
66
|
-
var ReactionsWithoutAnalytics = /*#__PURE__*/function (_React$PureComponent) {
|
|
67
|
-
(0, _inherits2.default)(ReactionsWithoutAnalytics, _React$PureComponent);
|
|
68
|
-
|
|
69
|
-
var _super = _createSuper(ReactionsWithoutAnalytics);
|
|
70
|
-
|
|
71
|
-
function ReactionsWithoutAnalytics(props) {
|
|
72
|
-
var _this;
|
|
73
|
-
|
|
74
|
-
(0, _classCallCheck2.default)(this, ReactionsWithoutAnalytics);
|
|
75
|
-
_this = _super.call(this, props);
|
|
76
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "componentDidUpdate", function () {
|
|
77
|
-
if (_this.props.status === _ReactionStatus.ReactionStatus.ready && _this.renderTime) {
|
|
78
|
-
(0, _analytics.createAndFireSafe)(_this.props.createAnalyticsEvent, _analytics.createReactionsRenderedEvent, _this.renderTime);
|
|
79
|
-
_this.renderTime = undefined;
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isDisabled", function () {
|
|
83
|
-
return _this.props.status !== _ReactionStatus.ReactionStatus.ready;
|
|
84
|
-
});
|
|
85
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "getTooltip", function () {
|
|
86
|
-
var _this$props = _this.props,
|
|
87
|
-
status = _this$props.status,
|
|
88
|
-
errorMessage = _this$props.errorMessage;
|
|
89
|
-
|
|
90
|
-
switch (status) {
|
|
91
|
-
case _ReactionStatus.ReactionStatus.error:
|
|
92
|
-
return errorMessage ? errorMessage : (0, _core.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.unexpectedError);
|
|
93
|
-
|
|
94
|
-
case _ReactionStatus.ReactionStatus.loading:
|
|
95
|
-
case _ReactionStatus.ReactionStatus.notLoaded:
|
|
96
|
-
return (0, _core.jsx)(_reactIntlNext.FormattedMessage, _i18n.messages.loadingReactions);
|
|
97
|
-
|
|
98
|
-
default:
|
|
99
|
-
return undefined;
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleReactionMouseEnter", function (reaction) {
|
|
103
|
-
if (_this.props.onReactionHover) {
|
|
104
|
-
_this.props.onReactionHover(reaction.emojiId);
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handlePickerOpen", function () {
|
|
108
|
-
_this.openTime = Date.now();
|
|
109
|
-
(0, _analytics.createAndFireSafe)(_this.props.createAnalyticsEvent, _analytics.createPickerButtonClickedEvent, _this.props.reactions.length);
|
|
110
|
-
});
|
|
111
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOnCancel", function () {
|
|
112
|
-
(0, _analytics.createAndFireSafe)(_this.props.createAnalyticsEvent, _analytics.createPickerCancelledEvent, _this.openTime);
|
|
113
|
-
_this.openTime = undefined;
|
|
114
|
-
});
|
|
115
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOnMore", function () {
|
|
116
|
-
(0, _analytics.createAndFireSafe)(_this.props.createAnalyticsEvent, _analytics.createPickerMoreClickedEvent, _this.openTime);
|
|
117
|
-
});
|
|
118
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleOnSelection", function (emojiId, source) {
|
|
119
|
-
(0, _analytics.createAndFireSafe)(_this.props.createAnalyticsEvent, _analytics.createReactionSelectionEvent, source, emojiId, _this.props.reactions.find(function (reaction) {
|
|
120
|
-
return reaction.emojiId === emojiId;
|
|
121
|
-
}), _this.openTime);
|
|
122
|
-
_this.openTime = undefined;
|
|
123
|
-
|
|
124
|
-
if (_this.props.onSelection) {
|
|
125
|
-
_this.props.onSelection(emojiId);
|
|
126
|
-
}
|
|
127
|
-
});
|
|
128
|
-
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "renderReaction", function (reaction) {
|
|
129
|
-
return (0, _core.jsx)(_Reaction.Reaction, {
|
|
130
|
-
key: reaction.emojiId,
|
|
131
|
-
css: reactionStyle,
|
|
132
|
-
reaction: reaction,
|
|
133
|
-
emojiProvider: _this.props.emojiProvider,
|
|
134
|
-
onClick: _this.props.onReactionClick,
|
|
135
|
-
onMouseEnter: _this.handleReactionMouseEnter,
|
|
136
|
-
flash: _this.props.flash[reaction.emojiId]
|
|
137
|
-
});
|
|
138
|
-
});
|
|
139
|
-
|
|
140
|
-
if (props.status !== _ReactionStatus.ReactionStatus.ready) {
|
|
141
|
-
_this.renderTime = Date.now();
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
return _this;
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
(0, _createClass2.default)(ReactionsWithoutAnalytics, [{
|
|
148
|
-
key: "componentDidMount",
|
|
149
|
-
value: function componentDidMount() {
|
|
150
|
-
if (this.props.status === _ReactionStatus.ReactionStatus.notLoaded) {
|
|
151
|
-
this.props.loadReaction();
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "renderPicker",
|
|
156
|
-
value: function renderPicker() {
|
|
157
|
-
var _this$props2 = this.props,
|
|
158
|
-
emojiProvider = _this$props2.emojiProvider,
|
|
159
|
-
boundariesElement = _this$props2.boundariesElement,
|
|
160
|
-
allowAllEmojis = _this$props2.allowAllEmojis;
|
|
161
|
-
return (0, _core.jsx)(_tooltip.default, {
|
|
162
|
-
content: this.getTooltip()
|
|
163
|
-
}, (0, _core.jsx)(_ReactionPicker.ReactionPicker, {
|
|
164
|
-
css: reactionStyle,
|
|
165
|
-
emojiProvider: emojiProvider,
|
|
166
|
-
miniMode: true,
|
|
167
|
-
boundariesElement: boundariesElement,
|
|
168
|
-
allowAllEmojis: allowAllEmojis,
|
|
169
|
-
disabled: this.isDisabled(),
|
|
170
|
-
onSelection: this.handleOnSelection,
|
|
171
|
-
onOpen: this.handlePickerOpen,
|
|
172
|
-
onCancel: this.handleOnCancel,
|
|
173
|
-
onMore: this.handleOnMore
|
|
174
|
-
}));
|
|
175
|
-
}
|
|
176
|
-
}, {
|
|
177
|
-
key: "render",
|
|
178
|
-
value: function render() {
|
|
179
|
-
return (0, _core.jsx)("div", {
|
|
180
|
-
css: wrapperStyle
|
|
181
|
-
}, this.props.reactions.map(this.renderReaction), this.renderPicker());
|
|
182
|
-
}
|
|
183
|
-
}]);
|
|
184
|
-
return ReactionsWithoutAnalytics;
|
|
185
|
-
}(_react.default.PureComponent);
|
|
186
|
-
|
|
187
|
-
exports.ReactionsWithoutAnalytics = ReactionsWithoutAnalytics;
|
|
188
|
-
(0, _defineProperty2.default)(ReactionsWithoutAnalytics, "defaultProps", {
|
|
189
|
-
flash: {},
|
|
190
|
-
reactions: []
|
|
191
|
-
});
|
|
192
|
-
(0, _defineProperty2.default)(ReactionsWithoutAnalytics, "displayName", 'Reactions');
|
|
193
|
-
var Reactions = (0, _analyticsNext.withAnalyticsEvents)()(ReactionsWithoutAnalytics);
|
|
194
|
-
exports.Reactions = Reactions;
|