@atlaskit/reactions 21.5.1 → 21.6.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/MockReactionsClient/package.json +14 -0
- package/dist/cjs/{client/MockReactionsClient.js → MockReactionsClient.js} +4 -6
- 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/client/index.js +1 -33
- 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 +39 -8
- package/dist/cjs/{components → shared}/i18n.js +1 -1
- package/dist/cjs/shared/index.js +11 -3
- package/dist/cjs/shared/utils.js +54 -0
- package/dist/cjs/store/{ReactionsStore.js → MemoryReactionsStore.js} +37 -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/{client/MockReactionsClient.js → MockReactionsClient.js} +4 -5
- 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/client/index.js +1 -2
- 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 -4
- package/dist/es2019/{components → shared}/i18n.js +1 -1
- package/dist/es2019/shared/index.js +6 -2
- package/dist/es2019/shared/utils.js +35 -0
- package/dist/es2019/store/{ReactionsStore.js → MemoryReactionsStore.js} +36 -17
- 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/{client/MockReactionsClient.js → MockReactionsClient.js} +4 -5
- 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/client/index.js +1 -2
- 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 -4
- package/dist/esm/{components → shared}/i18n.js +1 -1
- package/dist/esm/shared/index.js +6 -2
- package/dist/esm/shared/utils.js +41 -0
- package/dist/esm/store/{ReactionsStore.js → MemoryReactionsStore.js} +36 -20
- 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 -2
- 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 -3
- package/dist/types/shared/i18n.d.ts +22 -0
- package/dist/types/shared/index.d.ts +3 -1
- package/dist/types/shared/utils.d.ts +11 -0
- package/dist/types/store/MemoryReactionsStore.d.ts +94 -0
- 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 +3 -0
- 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 +4 -6
- package/dist/types/types/reaction.d.ts +82 -0
- package/dist/types/types/store.d.ts +63 -0
- package/dist/{types/client → types-ts4.0}/MockReactionsClient.d.ts +4 -5
- package/dist/types-ts4.0/analytics/analytics.d.ts +96 -0
- package/dist/types-ts4.0/analytics/constants.d.ts +1 -0
- package/dist/types-ts4.0/analytics/index.d.ts +2 -0
- package/dist/types-ts4.0/analytics/ufo.d.ts +40 -0
- package/dist/types-ts4.0/client/ReactionServiceClient.d.ts +35 -0
- package/dist/types-ts4.0/client/index.d.ts +1 -0
- package/dist/{types/components → types-ts4.0/components/Counter}/Counter.d.ts +15 -7
- package/dist/types-ts4.0/components/Counter/index.d.ts +3 -0
- package/dist/types-ts4.0/components/Counter/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/EmojiButton/EmojiButton.d.ts +22 -0
- package/dist/types-ts4.0/components/EmojiButton/index.d.ts +2 -0
- package/dist/types-ts4.0/components/EmojiButton/styles.d.ts +1 -0
- package/dist/types-ts4.0/components/FlashAnimation/FlashAnimation.d.ts +20 -0
- package/dist/types-ts4.0/components/FlashAnimation/index.d.ts +2 -0
- package/dist/types-ts4.0/components/FlashAnimation/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/Reaction/Reaction.d.ts +38 -0
- package/dist/types-ts4.0/components/Reaction/index.d.ts +2 -0
- package/dist/types-ts4.0/components/Reaction/styles.d.ts +10 -0
- package/dist/{types/components → types-ts4.0/components/ReactionPicker}/ReactionPicker.d.ts +12 -33
- package/dist/types-ts4.0/components/ReactionPicker/index.d.ts +2 -0
- package/dist/types-ts4.0/components/ReactionPicker/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/ReactionTooltip/ReactionTooltip.d.ts +22 -0
- package/dist/types-ts4.0/components/ReactionTooltip/index.d.ts +2 -0
- package/dist/types-ts4.0/components/ReactionTooltip/styles.d.ts +4 -0
- package/dist/types-ts4.0/components/Reactions/Reactions.d.ts +64 -0
- package/dist/types-ts4.0/components/Reactions/index.d.ts +2 -0
- package/dist/types-ts4.0/components/Reactions/styles.d.ts +2 -0
- package/dist/types-ts4.0/components/Selector/Selector.d.ts +34 -0
- package/dist/types-ts4.0/components/Selector/index.d.ts +3 -0
- package/dist/types-ts4.0/components/Selector/styles.d.ts +10 -0
- package/dist/{types/components → types-ts4.0/components/ShowMore}/ShowMore.d.ts +14 -13
- package/dist/types-ts4.0/components/ShowMore/index.d.ts +2 -0
- package/dist/types-ts4.0/components/ShowMore/styles.d.ts +3 -0
- package/dist/types-ts4.0/components/Trigger/Trigger.d.ts +23 -0
- package/dist/types-ts4.0/components/Trigger/index.d.ts +2 -0
- package/dist/types-ts4.0/components/Trigger/styles.d.ts +5 -0
- package/dist/types-ts4.0/components/UfoErrorBoundary/UfoErrorBoundary.d.ts +16 -0
- package/dist/types-ts4.0/components/UfoErrorBoundary/index.d.ts +2 -0
- package/dist/types-ts4.0/components/index.d.ts +8 -0
- package/dist/types-ts4.0/containers/ConnectedReactionPicker/ConnectedReactionPicker.d.ts +27 -0
- package/dist/types-ts4.0/containers/ConnectedReactionPicker/index.d.ts +2 -0
- package/dist/types-ts4.0/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +52 -0
- package/dist/types-ts4.0/containers/ConnectedReactionsView/index.d.ts +2 -0
- package/dist/types-ts4.0/containers/index.d.ts +2 -0
- package/dist/types-ts4.0/hooks/index.d.ts +1 -0
- package/dist/types-ts4.0/hooks/useClickAway.d.ts +8 -0
- package/dist/types-ts4.0/i18n/cs.d.ts +13 -0
- package/dist/types-ts4.0/i18n/da.d.ts +13 -0
- package/dist/types-ts4.0/i18n/de.d.ts +13 -0
- package/dist/types-ts4.0/i18n/en.d.ts +7 -0
- package/dist/types-ts4.0/i18n/en_GB.d.ts +7 -0
- package/dist/types-ts4.0/i18n/en_ZZ.d.ts +13 -0
- package/dist/types-ts4.0/i18n/es.d.ts +13 -0
- package/dist/types-ts4.0/i18n/et.d.ts +12 -0
- package/dist/types-ts4.0/i18n/fi.d.ts +13 -0
- package/dist/types-ts4.0/i18n/fr.d.ts +13 -0
- package/dist/types-ts4.0/i18n/hu.d.ts +13 -0
- package/dist/types-ts4.0/i18n/index.d.ts +35 -0
- package/dist/types-ts4.0/i18n/is.d.ts +6 -0
- package/dist/types-ts4.0/i18n/it.d.ts +13 -0
- package/dist/types-ts4.0/i18n/ja.d.ts +13 -0
- package/dist/types-ts4.0/i18n/ko.d.ts +13 -0
- package/dist/types-ts4.0/i18n/languages.d.ts +27 -0
- package/dist/types-ts4.0/i18n/nb.d.ts +13 -0
- package/dist/types-ts4.0/i18n/nl.d.ts +13 -0
- package/dist/types-ts4.0/i18n/pl.d.ts +13 -0
- package/dist/types-ts4.0/i18n/pt_BR.d.ts +13 -0
- package/dist/types-ts4.0/i18n/pt_PT.d.ts +12 -0
- package/dist/types-ts4.0/i18n/ro.d.ts +6 -0
- package/dist/types-ts4.0/i18n/ru.d.ts +13 -0
- package/dist/types-ts4.0/i18n/sk.d.ts +12 -0
- package/dist/types-ts4.0/i18n/sv.d.ts +13 -0
- package/dist/types-ts4.0/i18n/th.d.ts +13 -0
- package/dist/types-ts4.0/i18n/tr.d.ts +13 -0
- package/dist/types-ts4.0/i18n/uk.d.ts +13 -0
- package/dist/types-ts4.0/i18n/vi.d.ts +13 -0
- package/dist/types-ts4.0/i18n/zh.d.ts +13 -0
- package/dist/types-ts4.0/i18n/zh_TW.d.ts +13 -0
- package/dist/types-ts4.0/index.d.ts +7 -0
- package/dist/types-ts4.0/shared/constants.d.ts +13 -0
- package/dist/{types/components → types-ts4.0/shared}/i18n.d.ts +0 -0
- package/dist/types-ts4.0/shared/index.d.ts +3 -0
- package/dist/types-ts4.0/shared/utils.d.ts +11 -0
- package/dist/{types/store/ReactionsStore.d.ts → types-ts4.0/store/MemoryReactionsStore.d.ts} +21 -61
- package/dist/types-ts4.0/store/ReactionConsumer.d.ts +57 -0
- package/dist/types-ts4.0/store/batched.d.ts +2 -0
- package/dist/types-ts4.0/store/index.d.ts +3 -0
- package/dist/types-ts4.0/store/utils.d.ts +11 -0
- package/dist/types-ts4.0/types/Actions.d.ts +27 -0
- package/dist/types-ts4.0/types/Updater.d.ts +1 -0
- package/dist/types-ts4.0/types/User.d.ts +10 -0
- package/dist/types-ts4.0/types/client.d.ts +38 -0
- package/dist/types-ts4.0/types/index.d.ts +7 -0
- package/dist/types-ts4.0/types/reaction.d.ts +82 -0
- package/dist/types-ts4.0/types/store.d.ts +63 -0
- package/extract-react-type/ConnectedReactionPicker.ts +2 -4
- package/extract-react-type/ConnectedReactionsView.ts +3 -5
- package/extract-react-type/Reaction.ts +2 -4
- package/extract-react-type/Reactions.ts +2 -4
- package/extract-react-type/actions.ts +1 -3
- package/extract-react-type/reactionClient.ts +3 -5
- package/extract-react-type/reactionsStore.ts +3 -5
- package/package.json +30 -7
- package/dist/cjs/components/EmojiButton.js +0 -100
- package/dist/cjs/components/Reaction.js +0 -229
- package/dist/cjs/components/ReactionPicker.js +0 -297
- 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 -53
- package/dist/cjs/containers/ConnectedReactionsView.js +0 -139
- package/dist/cjs/types/ReactionSource.js +0 -5
- package/dist/cjs/types/ReactionStatus.js +0 -19
- 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/components/EmojiButton.js +0 -50
- package/dist/es2019/components/Reaction.js +0 -183
- package/dist/es2019/components/ReactionPicker.js +0 -247
- 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 -36
- package/dist/es2019/containers/ConnectedReactionsView.js +0 -118
- package/dist/es2019/types/ReactionStatus.js +0 -11
- package/dist/es2019/types/Reactions.js +0 -1
- package/dist/es2019/types/ReactionsState.js +0 -1
- package/dist/esm/client/ReactionClient.js +0 -1
- package/dist/esm/components/EmojiButton.js +0 -77
- package/dist/esm/components/Reaction.js +0 -207
- package/dist/esm/components/ReactionPicker.js +0 -274
- 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 -38
- 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 -11
- 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/ReactionClient.d.ts +0 -28
- package/dist/types/components/EmojiButton.d.ts +0 -21
- package/dist/types/components/FlashAnimation.d.ts +0 -18
- package/dist/types/components/Reaction.d.ts +0 -44
- package/dist/types/components/ReactionTooltip.d.ts +0 -14
- package/dist/types/components/Reactions.d.ts +0 -83
- package/dist/types/components/Selector.d.ts +0 -39
- package/dist/types/components/Trigger.d.ts +0 -16
- 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 -16
- package/dist/types/containers/ConnectedReactionsView.d.ts +0 -31
- package/dist/types/types/DetailedReaction.d.ts +0 -7
- package/dist/types/types/ReactionSource.d.ts +0 -4
- package/dist/types/types/ReactionStatus.d.ts +0 -9
- 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 -20
|
@@ -1,274 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
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; }
|
|
10
|
-
|
|
11
|
-
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; }
|
|
12
|
-
|
|
13
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
14
|
-
|
|
15
|
-
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; } }
|
|
16
|
-
|
|
17
|
-
/** @jsx jsx */
|
|
18
|
-
import React, { Fragment, PureComponent } from 'react';
|
|
19
|
-
import ReactDOM from 'react-dom';
|
|
20
|
-
import { jsx, css } from '@emotion/core';
|
|
21
|
-
import { EmojiPicker } from '@atlaskit/emoji/picker';
|
|
22
|
-
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
23
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
24
|
-
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
25
|
-
import { token } from '@atlaskit/tokens';
|
|
26
|
-
import { Selector } from './Selector';
|
|
27
|
-
import { Trigger } from './Trigger';
|
|
28
|
-
import { UFO } from '../analytics';
|
|
29
|
-
import { layers } from '@atlaskit/theme/constants';
|
|
30
|
-
var pickerStyle = css({
|
|
31
|
-
verticalAlign: 'middle',
|
|
32
|
-
'&.miniMode': {
|
|
33
|
-
display: 'inline-block',
|
|
34
|
-
marginRight: '4px'
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
var contentStyle = css({
|
|
38
|
-
display: 'flex'
|
|
39
|
-
});
|
|
40
|
-
var popupStyle = css({
|
|
41
|
-
background: token('elevation.surface.overlay', N0),
|
|
42
|
-
borderRadius: "".concat(borderRadius(), "px"),
|
|
43
|
-
boxShadow: token('elevation.shadow.overlay', "0 4px 8px -2px ".concat(N50A, ", 0 0 1px ").concat(N60A)),
|
|
44
|
-
'&> div': {
|
|
45
|
-
boxShadow: undefined
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
function noop() {}
|
|
50
|
-
/**
|
|
51
|
-
* This renders the picker component (wrapped by the ConnectedReactionPicker)
|
|
52
|
-
*/
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
export var ReactionPicker = /*#__PURE__*/function (_PureComponent) {
|
|
56
|
-
_inherits(ReactionPicker, _PureComponent);
|
|
57
|
-
|
|
58
|
-
var _super = _createSuper(ReactionPicker);
|
|
59
|
-
|
|
60
|
-
function ReactionPicker(props) {
|
|
61
|
-
var _this;
|
|
62
|
-
|
|
63
|
-
_classCallCheck(this, ReactionPicker);
|
|
64
|
-
|
|
65
|
-
_this = _super.call(this, props);
|
|
66
|
-
|
|
67
|
-
_defineProperty(_assertThisInitialized(_this), "updatePopper", noop);
|
|
68
|
-
|
|
69
|
-
_defineProperty(_assertThisInitialized(_this), "handleClickOutside", function (e) {
|
|
70
|
-
var isOpen = _this.state.isOpen;
|
|
71
|
-
|
|
72
|
-
if (!isOpen) {
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
var domNode = ReactDOM.findDOMNode(_assertThisInitialized(_this));
|
|
77
|
-
|
|
78
|
-
if (!domNode || e.target instanceof Node && !domNode.contains(e.target)) {
|
|
79
|
-
if (_this.props.onCancel) {
|
|
80
|
-
_this.props.onCancel();
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
_this.close();
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
_defineProperty(_assertThisInitialized(_this), "showFullPicker", function (e) {
|
|
88
|
-
e.preventDefault();
|
|
89
|
-
var onShowMore = _this.props.onShowMore;
|
|
90
|
-
|
|
91
|
-
if (onShowMore) {
|
|
92
|
-
onShowMore();
|
|
93
|
-
} // Update popper position
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
_this.setState({
|
|
97
|
-
isOpen: true,
|
|
98
|
-
showFullPicker: true
|
|
99
|
-
}, function () {
|
|
100
|
-
return _this.updatePopper();
|
|
101
|
-
});
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
_defineProperty(_assertThisInitialized(_this), "onEmojiSelected", function (emoji) {
|
|
105
|
-
var onSelection = _this.props.onSelection;
|
|
106
|
-
|
|
107
|
-
if (!emoji.id) {
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
onSelection(emoji.id, _this.state.showFullPicker ? 'emojiPicker' : 'quickSelector');
|
|
112
|
-
|
|
113
|
-
_this.close(emoji.id);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
_defineProperty(_assertThisInitialized(_this), "onTriggerClick", function () {
|
|
117
|
-
// ufo start reaction experience
|
|
118
|
-
UFO.PickerRender.start();
|
|
119
|
-
|
|
120
|
-
if (_this.props.onOpen) {
|
|
121
|
-
_this.props.onOpen();
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
_this.setState({
|
|
125
|
-
isOpen: !_this.state.isOpen,
|
|
126
|
-
showFullPicker: false
|
|
127
|
-
}, function () {
|
|
128
|
-
// ufo add reaction success
|
|
129
|
-
UFO.PickerRender.success();
|
|
130
|
-
});
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
_defineProperty(_assertThisInitialized(_this), "popperModifiers", [{
|
|
134
|
-
name: 'applyStyle',
|
|
135
|
-
enabled: false
|
|
136
|
-
}, {
|
|
137
|
-
name: 'hide',
|
|
138
|
-
enabled: false
|
|
139
|
-
}, {
|
|
140
|
-
name: 'offset',
|
|
141
|
-
enabled: true,
|
|
142
|
-
options: {
|
|
143
|
-
offset: [0, 0]
|
|
144
|
-
}
|
|
145
|
-
}, {
|
|
146
|
-
name: 'flip',
|
|
147
|
-
enabled: true,
|
|
148
|
-
options: {
|
|
149
|
-
flipVariations: true,
|
|
150
|
-
boundariesElement: 'scrollParent'
|
|
151
|
-
}
|
|
152
|
-
}, {
|
|
153
|
-
name: 'preventOverflow',
|
|
154
|
-
enabled: true
|
|
155
|
-
}]);
|
|
156
|
-
|
|
157
|
-
_this.state = {
|
|
158
|
-
isOpen: false,
|
|
159
|
-
showFullPicker: false
|
|
160
|
-
};
|
|
161
|
-
return _this;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
_createClass(ReactionPicker, [{
|
|
165
|
-
key: "componentDidMount",
|
|
166
|
-
value: function componentDidMount() {
|
|
167
|
-
document.addEventListener('click', this.handleClickOutside, {
|
|
168
|
-
capture: true
|
|
169
|
-
});
|
|
170
|
-
}
|
|
171
|
-
}, {
|
|
172
|
-
key: "componentWillUnmount",
|
|
173
|
-
value: function componentWillUnmount() {
|
|
174
|
-
document.removeEventListener('click', this.handleClickOutside, {
|
|
175
|
-
capture: true
|
|
176
|
-
});
|
|
177
|
-
UFO.PickerRender.abort({
|
|
178
|
-
metadata: {
|
|
179
|
-
source: 'Reaction-Picker',
|
|
180
|
-
reason: 'unmount'
|
|
181
|
-
}
|
|
182
|
-
});
|
|
183
|
-
}
|
|
184
|
-
}, {
|
|
185
|
-
key: "close",
|
|
186
|
-
value: function close(_emojiId) {
|
|
187
|
-
this.setState({
|
|
188
|
-
isOpen: false,
|
|
189
|
-
showFullPicker: false
|
|
190
|
-
}, function () {
|
|
191
|
-
// ufo abort reaction experience
|
|
192
|
-
UFO.PickerRender.abort({
|
|
193
|
-
metadata: {
|
|
194
|
-
emojiId: _emojiId,
|
|
195
|
-
source: 'Reaction-Picker',
|
|
196
|
-
reason: 'close dialog'
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
});
|
|
200
|
-
}
|
|
201
|
-
}, {
|
|
202
|
-
key: "renderSelector",
|
|
203
|
-
value: function renderSelector() {
|
|
204
|
-
var _this$props = this.props,
|
|
205
|
-
emojiProvider = _this$props.emojiProvider,
|
|
206
|
-
allowAllEmojis = _this$props.allowAllEmojis;
|
|
207
|
-
return jsx("div", {
|
|
208
|
-
css: contentStyle
|
|
209
|
-
}, jsx(Selector, {
|
|
210
|
-
emojiProvider: emojiProvider,
|
|
211
|
-
onSelection: this.onEmojiSelected,
|
|
212
|
-
showMore: allowAllEmojis,
|
|
213
|
-
onMoreClick: this.showFullPicker
|
|
214
|
-
}));
|
|
215
|
-
}
|
|
216
|
-
}, {
|
|
217
|
-
key: "renderEmojiPicker",
|
|
218
|
-
value: function renderEmojiPicker() {
|
|
219
|
-
return jsx(EmojiPicker, {
|
|
220
|
-
emojiProvider: this.props.emojiProvider,
|
|
221
|
-
onSelection: this.onEmojiSelected
|
|
222
|
-
});
|
|
223
|
-
}
|
|
224
|
-
}, {
|
|
225
|
-
key: "renderContent",
|
|
226
|
-
value: function renderContent() {
|
|
227
|
-
return this.state.showFullPicker ? this.renderEmojiPicker() : this.renderSelector();
|
|
228
|
-
}
|
|
229
|
-
}, {
|
|
230
|
-
key: "render",
|
|
231
|
-
value: function render() {
|
|
232
|
-
var _this2 = this;
|
|
233
|
-
|
|
234
|
-
var isOpen = this.state.isOpen;
|
|
235
|
-
var _this$props2 = this.props,
|
|
236
|
-
miniMode = _this$props2.miniMode,
|
|
237
|
-
className = _this$props2.className;
|
|
238
|
-
return jsx("div", {
|
|
239
|
-
className: " ".concat(isOpen ? 'isOpen' : '', " ").concat(miniMode ? 'miniMode' : '', " ").concat(className),
|
|
240
|
-
css: pickerStyle
|
|
241
|
-
}, jsx(Manager, null, jsx(Reference, null, function (_ref) {
|
|
242
|
-
var ref = _ref.ref;
|
|
243
|
-
return jsx(Trigger, {
|
|
244
|
-
ref: ref,
|
|
245
|
-
onClick: _this2.onTriggerClick,
|
|
246
|
-
miniMode: miniMode,
|
|
247
|
-
disabled: _this2.props.disabled
|
|
248
|
-
});
|
|
249
|
-
}), jsx(Popper, {
|
|
250
|
-
placement: "bottom-start",
|
|
251
|
-
modifiers: this.popperModifiers
|
|
252
|
-
}, function (_ref2) {
|
|
253
|
-
var ref = _ref2.ref,
|
|
254
|
-
style = _ref2.style,
|
|
255
|
-
update = _ref2.update;
|
|
256
|
-
_this2.updatePopper = update;
|
|
257
|
-
return jsx(Fragment, null, isOpen && jsx("div", {
|
|
258
|
-
style: _objectSpread({
|
|
259
|
-
zIndex: layers.layer()
|
|
260
|
-
}, style),
|
|
261
|
-
ref: ref
|
|
262
|
-
}, jsx("div", {
|
|
263
|
-
css: popupStyle
|
|
264
|
-
}, _this2.renderContent())));
|
|
265
|
-
})));
|
|
266
|
-
}
|
|
267
|
-
}]);
|
|
268
|
-
|
|
269
|
-
return ReactionPicker;
|
|
270
|
-
}(PureComponent);
|
|
271
|
-
|
|
272
|
-
_defineProperty(ReactionPicker, "defaultProps", {
|
|
273
|
-
disabled: false
|
|
274
|
-
});
|
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
/** @jsx jsx */
|
|
4
|
-
import React from 'react';
|
|
5
|
-
import { jsx, css } from '@emotion/core';
|
|
6
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
7
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
8
|
-
import { token } from '@atlaskit/tokens';
|
|
9
|
-
import { N90 } from '@atlaskit/theme/colors';
|
|
10
|
-
import { messages } from './i18n';
|
|
11
|
-
var verticalMargin = 5;
|
|
12
|
-
var tooltipStyle = css({
|
|
13
|
-
maxWidth: '150px',
|
|
14
|
-
textOverflow: 'ellipsis',
|
|
15
|
-
whiteSpace: 'nowrap',
|
|
16
|
-
overflow: 'hidden',
|
|
17
|
-
marginBottom: verticalMargin,
|
|
18
|
-
ul: {
|
|
19
|
-
listStyle: 'none',
|
|
20
|
-
margin: 0,
|
|
21
|
-
padding: 0,
|
|
22
|
-
textAlign: 'left'
|
|
23
|
-
},
|
|
24
|
-
li: {
|
|
25
|
-
overflow: 'hidden',
|
|
26
|
-
textOverflow: 'ellipsis',
|
|
27
|
-
marginTop: verticalMargin
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var emojiNameStyle = css({
|
|
31
|
-
textTransform: 'capitalize',
|
|
32
|
-
color: token('color.text.inverse', N90),
|
|
33
|
-
fontWeight: 600
|
|
34
|
-
});
|
|
35
|
-
var footerStyle = css({
|
|
36
|
-
color: token('color.text.inverse', N90),
|
|
37
|
-
fontWeight: 300
|
|
38
|
-
});
|
|
39
|
-
var TOOLTIP_USERS_LIMIT = 5;
|
|
40
|
-
export var ReactionTooltip = function ReactionTooltip(_ref) {
|
|
41
|
-
var emojiName = _ref.emojiName,
|
|
42
|
-
children = _ref.children,
|
|
43
|
-
users = _ref.reaction.users;
|
|
44
|
-
var content = !users || users.length === 0 ? null : jsx("div", {
|
|
45
|
-
css: tooltipStyle
|
|
46
|
-
}, jsx("ul", null, emojiName ? jsx("li", {
|
|
47
|
-
css: emojiNameStyle
|
|
48
|
-
}, emojiName) : null, users.slice(0, TOOLTIP_USERS_LIMIT).map(function (user, index) {
|
|
49
|
-
return jsx("li", {
|
|
50
|
-
key: index
|
|
51
|
-
}, user.displayName);
|
|
52
|
-
}), users.length > TOOLTIP_USERS_LIMIT ? jsx("li", {
|
|
53
|
-
css: footerStyle
|
|
54
|
-
}, jsx(FormattedMessage, _extends({}, messages.otherUsers, {
|
|
55
|
-
values: {
|
|
56
|
-
count: users.length - TOOLTIP_USERS_LIMIT
|
|
57
|
-
}
|
|
58
|
-
}))) : null));
|
|
59
|
-
return jsx(Tooltip, {
|
|
60
|
-
content: content,
|
|
61
|
-
position: "bottom"
|
|
62
|
-
}, React.Children.only(children));
|
|
63
|
-
};
|
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
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; } }
|
|
12
|
-
|
|
13
|
-
/** @jsx jsx */
|
|
14
|
-
import { jsx, css } from '@emotion/core';
|
|
15
|
-
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
16
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
17
|
-
import React from 'react';
|
|
18
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
19
|
-
import { createAndFireSafe, createPickerButtonClickedEvent, createPickerCancelledEvent, createPickerMoreClickedEvent, createReactionSelectionEvent, createReactionsRenderedEvent } from '../analytics';
|
|
20
|
-
import { ReactionStatus } from '../types/ReactionStatus';
|
|
21
|
-
import { messages } from './i18n';
|
|
22
|
-
import { Reaction } from './Reaction';
|
|
23
|
-
import { ReactionPicker } from './ReactionPicker';
|
|
24
|
-
var reactionStyle = css({
|
|
25
|
-
display: 'inline-block',
|
|
26
|
-
// top margin of 2px to allow spacing between rows when wrapped (paired with top margin in reactionsStyle)
|
|
27
|
-
margin: '2px 4px 0 4px'
|
|
28
|
-
});
|
|
29
|
-
var wrapperStyle = css({
|
|
30
|
-
display: 'flex',
|
|
31
|
-
flexWrap: 'wrap',
|
|
32
|
-
position: 'relative',
|
|
33
|
-
alignItems: 'center',
|
|
34
|
-
borderRadius: '15px',
|
|
35
|
-
// To allow to row spacing of 2px on wrap, and 0px on first row
|
|
36
|
-
marginTop: '-2px',
|
|
37
|
-
'> :first-of-type > :first-child': {
|
|
38
|
-
marginLeft: 0
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
export var ReactionsWithoutAnalytics = /*#__PURE__*/function (_React$PureComponent) {
|
|
42
|
-
_inherits(ReactionsWithoutAnalytics, _React$PureComponent);
|
|
43
|
-
|
|
44
|
-
var _super = _createSuper(ReactionsWithoutAnalytics);
|
|
45
|
-
|
|
46
|
-
function ReactionsWithoutAnalytics(props) {
|
|
47
|
-
var _this;
|
|
48
|
-
|
|
49
|
-
_classCallCheck(this, ReactionsWithoutAnalytics);
|
|
50
|
-
|
|
51
|
-
_this = _super.call(this, props);
|
|
52
|
-
|
|
53
|
-
_defineProperty(_assertThisInitialized(_this), "componentDidUpdate", function () {
|
|
54
|
-
if (_this.props.status === ReactionStatus.ready && _this.renderTime) {
|
|
55
|
-
createAndFireSafe(_this.props.createAnalyticsEvent, createReactionsRenderedEvent, _this.renderTime);
|
|
56
|
-
_this.renderTime = undefined;
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
_defineProperty(_assertThisInitialized(_this), "isDisabled", function () {
|
|
61
|
-
return _this.props.status !== ReactionStatus.ready;
|
|
62
|
-
});
|
|
63
|
-
|
|
64
|
-
_defineProperty(_assertThisInitialized(_this), "getTooltip", function () {
|
|
65
|
-
var _this$props = _this.props,
|
|
66
|
-
status = _this$props.status,
|
|
67
|
-
errorMessage = _this$props.errorMessage;
|
|
68
|
-
|
|
69
|
-
switch (status) {
|
|
70
|
-
case ReactionStatus.error:
|
|
71
|
-
return errorMessage ? errorMessage : jsx(FormattedMessage, messages.unexpectedError);
|
|
72
|
-
|
|
73
|
-
case ReactionStatus.loading:
|
|
74
|
-
case ReactionStatus.notLoaded:
|
|
75
|
-
return jsx(FormattedMessage, messages.loadingReactions);
|
|
76
|
-
|
|
77
|
-
default:
|
|
78
|
-
return undefined;
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
|
|
82
|
-
_defineProperty(_assertThisInitialized(_this), "handleReactionMouseEnter", function (reaction) {
|
|
83
|
-
if (_this.props.onReactionHover) {
|
|
84
|
-
_this.props.onReactionHover(reaction.emojiId);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
_defineProperty(_assertThisInitialized(_this), "handlePickerOpen", function () {
|
|
89
|
-
_this.openTime = Date.now();
|
|
90
|
-
createAndFireSafe(_this.props.createAnalyticsEvent, createPickerButtonClickedEvent, _this.props.reactions.length);
|
|
91
|
-
});
|
|
92
|
-
|
|
93
|
-
_defineProperty(_assertThisInitialized(_this), "handleOnCancel", function () {
|
|
94
|
-
createAndFireSafe(_this.props.createAnalyticsEvent, createPickerCancelledEvent, _this.openTime);
|
|
95
|
-
_this.openTime = undefined;
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
_defineProperty(_assertThisInitialized(_this), "handleOnMore", function () {
|
|
99
|
-
createAndFireSafe(_this.props.createAnalyticsEvent, createPickerMoreClickedEvent, _this.openTime);
|
|
100
|
-
});
|
|
101
|
-
|
|
102
|
-
_defineProperty(_assertThisInitialized(_this), "handleOnSelection", function (emojiId, source) {
|
|
103
|
-
createAndFireSafe(_this.props.createAnalyticsEvent, createReactionSelectionEvent, source, emojiId, _this.props.reactions.find(function (reaction) {
|
|
104
|
-
return reaction.emojiId === emojiId;
|
|
105
|
-
}), _this.openTime);
|
|
106
|
-
_this.openTime = undefined;
|
|
107
|
-
|
|
108
|
-
if (_this.props.onSelection) {
|
|
109
|
-
_this.props.onSelection(emojiId);
|
|
110
|
-
}
|
|
111
|
-
});
|
|
112
|
-
|
|
113
|
-
_defineProperty(_assertThisInitialized(_this), "renderReaction", function (reaction) {
|
|
114
|
-
return jsx(Reaction, {
|
|
115
|
-
key: reaction.emojiId,
|
|
116
|
-
css: reactionStyle,
|
|
117
|
-
reaction: reaction,
|
|
118
|
-
emojiProvider: _this.props.emojiProvider,
|
|
119
|
-
onClick: _this.props.onReactionClick,
|
|
120
|
-
onMouseEnter: _this.handleReactionMouseEnter,
|
|
121
|
-
flash: _this.props.flash[reaction.emojiId]
|
|
122
|
-
});
|
|
123
|
-
});
|
|
124
|
-
|
|
125
|
-
if (props.status !== ReactionStatus.ready) {
|
|
126
|
-
_this.renderTime = Date.now();
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return _this;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
_createClass(ReactionsWithoutAnalytics, [{
|
|
133
|
-
key: "componentDidMount",
|
|
134
|
-
value: function componentDidMount() {
|
|
135
|
-
if (this.props.status === ReactionStatus.notLoaded) {
|
|
136
|
-
this.props.loadReaction();
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
}, {
|
|
140
|
-
key: "renderPicker",
|
|
141
|
-
value: function renderPicker() {
|
|
142
|
-
var _this$props2 = this.props,
|
|
143
|
-
emojiProvider = _this$props2.emojiProvider,
|
|
144
|
-
boundariesElement = _this$props2.boundariesElement,
|
|
145
|
-
allowAllEmojis = _this$props2.allowAllEmojis;
|
|
146
|
-
return jsx(Tooltip, {
|
|
147
|
-
content: this.getTooltip()
|
|
148
|
-
}, jsx(ReactionPicker, {
|
|
149
|
-
css: reactionStyle,
|
|
150
|
-
emojiProvider: emojiProvider,
|
|
151
|
-
miniMode: true,
|
|
152
|
-
boundariesElement: boundariesElement,
|
|
153
|
-
allowAllEmojis: allowAllEmojis,
|
|
154
|
-
disabled: this.isDisabled(),
|
|
155
|
-
onSelection: this.handleOnSelection,
|
|
156
|
-
onOpen: this.handlePickerOpen,
|
|
157
|
-
onCancel: this.handleOnCancel,
|
|
158
|
-
onShowMore: this.handleOnMore
|
|
159
|
-
}));
|
|
160
|
-
}
|
|
161
|
-
}, {
|
|
162
|
-
key: "render",
|
|
163
|
-
value: function render() {
|
|
164
|
-
return jsx("div", {
|
|
165
|
-
css: wrapperStyle
|
|
166
|
-
}, this.props.reactions.map(this.renderReaction), this.renderPicker());
|
|
167
|
-
}
|
|
168
|
-
}]);
|
|
169
|
-
|
|
170
|
-
return ReactionsWithoutAnalytics;
|
|
171
|
-
}(React.PureComponent);
|
|
172
|
-
|
|
173
|
-
_defineProperty(ReactionsWithoutAnalytics, "defaultProps", {
|
|
174
|
-
flash: {},
|
|
175
|
-
reactions: []
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
_defineProperty(ReactionsWithoutAnalytics, "displayName", 'Reactions');
|
|
179
|
-
|
|
180
|
-
export var Reactions = withAnalyticsEvents()(ReactionsWithoutAnalytics);
|
|
@@ -1,160 +0,0 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
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; } }
|
|
12
|
-
|
|
13
|
-
/** @jsx jsx */
|
|
14
|
-
import { jsx, css, keyframes } from '@emotion/core';
|
|
15
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import { PureComponent } from 'react';
|
|
18
|
-
import { EmojiButton } from './EmojiButton';
|
|
19
|
-
import { ShowMore } from './ShowMore';
|
|
20
|
-
import { equalEmojiId } from './utils';
|
|
21
|
-
export var renderEmojiTestId = 'render-emoji';
|
|
22
|
-
var selectorStyle = css({
|
|
23
|
-
boxSizing: 'border-box',
|
|
24
|
-
display: 'flex',
|
|
25
|
-
padding: 0
|
|
26
|
-
});
|
|
27
|
-
var emojiStyle = css({
|
|
28
|
-
display: 'inline-block',
|
|
29
|
-
opacity: 0,
|
|
30
|
-
'&.selected': {
|
|
31
|
-
transition: 'transform 200ms ease-in-out ',
|
|
32
|
-
transform: 'translateY(-48px) scale(2.667)'
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
var revealAnimation = keyframes({
|
|
36
|
-
'0%': {
|
|
37
|
-
opacity: 1,
|
|
38
|
-
transform: 'scale(0.5)'
|
|
39
|
-
},
|
|
40
|
-
'75%': {
|
|
41
|
-
transform: 'scale(1.25)'
|
|
42
|
-
},
|
|
43
|
-
'100%': {
|
|
44
|
-
opacity: 1,
|
|
45
|
-
transform: 'scale(1)'
|
|
46
|
-
}
|
|
47
|
-
});
|
|
48
|
-
export var revealStyle = css({
|
|
49
|
-
animation: "".concat(revealAnimation, " 150ms ease-in-out forwards")
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
var revealDelay = function revealDelay(index) {
|
|
53
|
-
return {
|
|
54
|
-
animationDelay: "".concat(index * 50, "ms")
|
|
55
|
-
};
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
export var defaultReactions = [{
|
|
59
|
-
id: '1f44d',
|
|
60
|
-
shortName: ':thumbsup:'
|
|
61
|
-
}, {
|
|
62
|
-
id: '1f44f',
|
|
63
|
-
shortName: ':clap:'
|
|
64
|
-
}, {
|
|
65
|
-
id: '1f525',
|
|
66
|
-
shortName: ':fire:'
|
|
67
|
-
}, {
|
|
68
|
-
id: '2764',
|
|
69
|
-
shortName: ':heart:'
|
|
70
|
-
}, {
|
|
71
|
-
id: '1f632',
|
|
72
|
-
shortName: ':astonished:'
|
|
73
|
-
}, {
|
|
74
|
-
id: '1f914',
|
|
75
|
-
shortName: ':thinking:'
|
|
76
|
-
}];
|
|
77
|
-
export var defaultReactionsByShortName = new Map(defaultReactions.map(function (reaction) {
|
|
78
|
-
return [reaction.shortName, reaction];
|
|
79
|
-
}));
|
|
80
|
-
export var isDefaultReaction = function isDefaultReaction(emojiId) {
|
|
81
|
-
return defaultReactions.filter(function (otherEmojiId) {
|
|
82
|
-
return equalEmojiId(otherEmojiId, emojiId);
|
|
83
|
-
}).length > 0;
|
|
84
|
-
};
|
|
85
|
-
export var Selector = /*#__PURE__*/function (_PureComponent) {
|
|
86
|
-
_inherits(Selector, _PureComponent);
|
|
87
|
-
|
|
88
|
-
var _super = _createSuper(Selector);
|
|
89
|
-
|
|
90
|
-
function Selector(props) {
|
|
91
|
-
var _this;
|
|
92
|
-
|
|
93
|
-
_classCallCheck(this, Selector);
|
|
94
|
-
|
|
95
|
-
_this = _super.call(this, props);
|
|
96
|
-
|
|
97
|
-
_defineProperty(_assertThisInitialized(_this), "onEmojiSelected", function (emojiId, emoji, event) {
|
|
98
|
-
_this.timeouts.push(window.setTimeout(function () {
|
|
99
|
-
return _this.props.onSelection(emojiId, emoji, event);
|
|
100
|
-
}, 250));
|
|
101
|
-
|
|
102
|
-
_this.setState({
|
|
103
|
-
selection: emojiId
|
|
104
|
-
});
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
_defineProperty(_assertThisInitialized(_this), "renderEmoji", function (emojiId, index) {
|
|
108
|
-
var emojiProvider = _this.props.emojiProvider;
|
|
109
|
-
var key = emojiId.id || emojiId.shortName;
|
|
110
|
-
var style = revealDelay(index);
|
|
111
|
-
return jsx("div", {
|
|
112
|
-
key: key,
|
|
113
|
-
className: emojiId === _this.state.selection ? 'selected' : '',
|
|
114
|
-
css: [emojiStyle, revealStyle],
|
|
115
|
-
style: style,
|
|
116
|
-
"data-testid": renderEmojiTestId
|
|
117
|
-
}, jsx(Tooltip, {
|
|
118
|
-
content: emojiId.shortName
|
|
119
|
-
}, jsx(EmojiButton, {
|
|
120
|
-
emojiId: emojiId,
|
|
121
|
-
emojiProvider: emojiProvider,
|
|
122
|
-
onClick: _this.onEmojiSelected
|
|
123
|
-
})));
|
|
124
|
-
});
|
|
125
|
-
|
|
126
|
-
_defineProperty(_assertThisInitialized(_this), "renderShowMore", function () {
|
|
127
|
-
return jsx(ShowMore, {
|
|
128
|
-
key: "more",
|
|
129
|
-
revealStyle: revealStyle,
|
|
130
|
-
style: {
|
|
131
|
-
button: revealDelay(defaultReactions.length)
|
|
132
|
-
},
|
|
133
|
-
onClick: _this.props.onMoreClick
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
_this.timeouts = [];
|
|
138
|
-
_this.state = {
|
|
139
|
-
selection: undefined
|
|
140
|
-
};
|
|
141
|
-
return _this;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
_createClass(Selector, [{
|
|
145
|
-
key: "componentWillUnmount",
|
|
146
|
-
value: function componentWillUnmount() {
|
|
147
|
-
this.timeouts.forEach(clearTimeout);
|
|
148
|
-
}
|
|
149
|
-
}, {
|
|
150
|
-
key: "render",
|
|
151
|
-
value: function render() {
|
|
152
|
-
var showMore = this.props.showMore;
|
|
153
|
-
return jsx("div", {
|
|
154
|
-
css: selectorStyle
|
|
155
|
-
}, defaultReactions.map(this.renderEmoji), showMore ? this.renderShowMore() : null);
|
|
156
|
-
}
|
|
157
|
-
}]);
|
|
158
|
-
|
|
159
|
-
return Selector;
|
|
160
|
-
}(PureComponent);
|