@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,127 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
/** @jsx jsx */
|
|
4
|
-
import { jsx, css, keyframes } from '@emotion/core';
|
|
5
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
-
import React from 'react';
|
|
7
|
-
import { PureComponent } from 'react';
|
|
8
|
-
import { EmojiButton } from './EmojiButton';
|
|
9
|
-
import { ShowMore } from './ShowMore';
|
|
10
|
-
import { equalEmojiId } from './utils';
|
|
11
|
-
export const renderEmojiTestId = 'render-emoji';
|
|
12
|
-
const selectorStyle = css({
|
|
13
|
-
boxSizing: 'border-box',
|
|
14
|
-
display: 'flex',
|
|
15
|
-
padding: 0
|
|
16
|
-
});
|
|
17
|
-
const emojiStyle = css({
|
|
18
|
-
display: 'inline-block',
|
|
19
|
-
opacity: 0,
|
|
20
|
-
'&.selected': {
|
|
21
|
-
transition: 'transform 200ms ease-in-out ',
|
|
22
|
-
transform: 'translateY(-48px) scale(2.667)'
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
const revealAnimation = keyframes({
|
|
26
|
-
'0%': {
|
|
27
|
-
opacity: 1,
|
|
28
|
-
transform: 'scale(0.5)'
|
|
29
|
-
},
|
|
30
|
-
'75%': {
|
|
31
|
-
transform: 'scale(1.25)'
|
|
32
|
-
},
|
|
33
|
-
'100%': {
|
|
34
|
-
opacity: 1,
|
|
35
|
-
transform: 'scale(1)'
|
|
36
|
-
}
|
|
37
|
-
});
|
|
38
|
-
export const revealStyle = css({
|
|
39
|
-
animation: `${revealAnimation} 150ms ease-in-out forwards`
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
const revealDelay = index => ({
|
|
43
|
-
animationDelay: `${index * 50}ms`
|
|
44
|
-
});
|
|
45
|
-
|
|
46
|
-
export const defaultReactions = [{
|
|
47
|
-
id: '1f44d',
|
|
48
|
-
shortName: ':thumbsup:'
|
|
49
|
-
}, {
|
|
50
|
-
id: '1f44f',
|
|
51
|
-
shortName: ':clap:'
|
|
52
|
-
}, {
|
|
53
|
-
id: '1f525',
|
|
54
|
-
shortName: ':fire:'
|
|
55
|
-
}, {
|
|
56
|
-
id: '2764',
|
|
57
|
-
shortName: ':heart:'
|
|
58
|
-
}, {
|
|
59
|
-
id: '1f632',
|
|
60
|
-
shortName: ':astonished:'
|
|
61
|
-
}, {
|
|
62
|
-
id: '1f914',
|
|
63
|
-
shortName: ':thinking:'
|
|
64
|
-
}];
|
|
65
|
-
export const defaultReactionsByShortName = new Map(defaultReactions.map(reaction => [reaction.shortName, reaction]));
|
|
66
|
-
export const isDefaultReaction = emojiId => defaultReactions.filter(otherEmojiId => equalEmojiId(otherEmojiId, emojiId)).length > 0;
|
|
67
|
-
export class Selector extends PureComponent {
|
|
68
|
-
constructor(props) {
|
|
69
|
-
super(props);
|
|
70
|
-
|
|
71
|
-
_defineProperty(this, "onEmojiSelected", (emojiId, emoji, event) => {
|
|
72
|
-
this.timeouts.push(window.setTimeout(() => this.props.onSelection(emojiId, emoji, event), 250));
|
|
73
|
-
this.setState({
|
|
74
|
-
selection: emojiId
|
|
75
|
-
});
|
|
76
|
-
});
|
|
77
|
-
|
|
78
|
-
_defineProperty(this, "renderEmoji", (emojiId, index) => {
|
|
79
|
-
const {
|
|
80
|
-
emojiProvider
|
|
81
|
-
} = this.props;
|
|
82
|
-
const key = emojiId.id || emojiId.shortName;
|
|
83
|
-
const style = revealDelay(index);
|
|
84
|
-
return jsx("div", {
|
|
85
|
-
key: key,
|
|
86
|
-
className: emojiId === this.state.selection ? 'selected' : '',
|
|
87
|
-
css: [emojiStyle, revealStyle],
|
|
88
|
-
style: style,
|
|
89
|
-
"data-testid": renderEmojiTestId
|
|
90
|
-
}, jsx(Tooltip, {
|
|
91
|
-
content: emojiId.shortName
|
|
92
|
-
}, jsx(EmojiButton, {
|
|
93
|
-
emojiId: emojiId,
|
|
94
|
-
emojiProvider: emojiProvider,
|
|
95
|
-
onClick: this.onEmojiSelected
|
|
96
|
-
})));
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
_defineProperty(this, "renderShowMore", () => jsx(ShowMore, {
|
|
100
|
-
key: "more",
|
|
101
|
-
revealStyle: revealStyle,
|
|
102
|
-
style: {
|
|
103
|
-
button: revealDelay(defaultReactions.length)
|
|
104
|
-
},
|
|
105
|
-
onClick: this.props.onMoreClick
|
|
106
|
-
}));
|
|
107
|
-
|
|
108
|
-
this.timeouts = [];
|
|
109
|
-
this.state = {
|
|
110
|
-
selection: undefined
|
|
111
|
-
};
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
componentWillUnmount() {
|
|
115
|
-
this.timeouts.forEach(clearTimeout);
|
|
116
|
-
}
|
|
117
|
-
|
|
118
|
-
render() {
|
|
119
|
-
const {
|
|
120
|
-
showMore
|
|
121
|
-
} = this.props;
|
|
122
|
-
return jsx("div", {
|
|
123
|
-
css: selectorStyle
|
|
124
|
-
}, defaultReactions.map(this.renderEmoji), showMore ? this.renderShowMore() : null);
|
|
125
|
-
}
|
|
126
|
-
|
|
127
|
-
}
|
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
|
|
3
|
-
/** @jsx jsx */
|
|
4
|
-
import { jsx, css } from '@emotion/core';
|
|
5
|
-
import EditorMoreIcon from '@atlaskit/icon/glyph/editor/more';
|
|
6
|
-
import { borderRadius } from '@atlaskit/theme/constants';
|
|
7
|
-
import { N30A } from '@atlaskit/theme/colors';
|
|
8
|
-
import { token } from '@atlaskit/tokens';
|
|
9
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
10
|
-
import React from 'react';
|
|
11
|
-
import { messages } from './i18n';
|
|
12
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
13
|
-
import { revealStyle } from './Selector';
|
|
14
|
-
const moreEmojiContainerStyle = css({
|
|
15
|
-
display: 'flex'
|
|
16
|
-
});
|
|
17
|
-
const moreButtonStyle = css({
|
|
18
|
-
opacity: 0,
|
|
19
|
-
outline: 'none',
|
|
20
|
-
backgroundColor: 'transparent',
|
|
21
|
-
border: 0,
|
|
22
|
-
borderRadius: `${borderRadius()}px`,
|
|
23
|
-
cursor: 'pointer',
|
|
24
|
-
margin: '4px 4px 4px 0',
|
|
25
|
-
padding: '4px',
|
|
26
|
-
width: '38px',
|
|
27
|
-
verticalAlign: 'top',
|
|
28
|
-
'&:hover': {
|
|
29
|
-
backgroundColor: token('color.background.neutral.subtle.hovered', N30A)
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const separatorStyle = css({
|
|
33
|
-
backgroundColor: token('color.border', N30A),
|
|
34
|
-
margin: '8px 8px 8px 4px',
|
|
35
|
-
width: '1px',
|
|
36
|
-
height: '60%',
|
|
37
|
-
display: 'inline-block'
|
|
38
|
-
});
|
|
39
|
-
export const showMoreTestId = 'show-more-button';
|
|
40
|
-
export class ShowMore extends React.PureComponent {
|
|
41
|
-
render() {
|
|
42
|
-
const {
|
|
43
|
-
style,
|
|
44
|
-
onClick,
|
|
45
|
-
className: classNameProp
|
|
46
|
-
} = this.props;
|
|
47
|
-
return jsx("div", {
|
|
48
|
-
className: classNameProp.container,
|
|
49
|
-
css: moreEmojiContainerStyle,
|
|
50
|
-
style: style.container
|
|
51
|
-
}, jsx("div", {
|
|
52
|
-
css: separatorStyle
|
|
53
|
-
}), jsx(FormattedMessage, messages.moreEmoji, text => jsx(Tooltip, {
|
|
54
|
-
content: text
|
|
55
|
-
}, jsx("button", {
|
|
56
|
-
className: classNameProp.button,
|
|
57
|
-
css: [moreButtonStyle, revealStyle],
|
|
58
|
-
style: style.button,
|
|
59
|
-
onMouseDown: onClick,
|
|
60
|
-
"data-testid": showMoreTestId
|
|
61
|
-
}, jsx(EditorMoreIcon, {
|
|
62
|
-
label: "More"
|
|
63
|
-
})))));
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
_defineProperty(ShowMore, "defaultProps", {
|
|
69
|
-
className: {},
|
|
70
|
-
style: {}
|
|
71
|
-
});
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
export const akHeight = 24;
|
|
2
|
-
export const isLeftClick = event => event.button === 0 && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey;
|
|
3
|
-
export const equalEmojiId = (l, r) => {
|
|
4
|
-
if (isEmojiId(l) && isEmojiId(r)) {
|
|
5
|
-
return l === r || l && r && l.id === r.id && l.shortName === r.shortName;
|
|
6
|
-
} else {
|
|
7
|
-
return l === r;
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
const isEmojiId = emojiId => {
|
|
12
|
-
return emojiId.id !== undefined;
|
|
13
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React from 'react';
|
|
3
|
-
import { ReactionPicker, UfoErrorBoundary } from '../components';
|
|
4
|
-
import { ReactionConsumer } from '../store/ReactionConsumer';
|
|
5
|
-
import { UFO } from '../analytics';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* UFO Instance for picker
|
|
9
|
-
*/
|
|
10
|
-
export const ConnectedReactionPicker = props => {
|
|
11
|
-
const renderChild = innerProps => {
|
|
12
|
-
return /*#__PURE__*/React.createElement(ReactionPicker, _extends({}, props, innerProps));
|
|
13
|
-
};
|
|
14
|
-
/**
|
|
15
|
-
* Mapping actions for the picker selection
|
|
16
|
-
* @param actions
|
|
17
|
-
* @returns void
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
const actionsMapper = actions => ({
|
|
22
|
-
/**
|
|
23
|
-
* Event handler when an emoji gets selected
|
|
24
|
-
*/
|
|
25
|
-
onSelection: emojiId => {
|
|
26
|
-
actions.addReaction(props.containerAri, props.ari, emojiId);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
return /*#__PURE__*/React.createElement(UfoErrorBoundary, {
|
|
31
|
-
experiences: [UFO.PickerRender]
|
|
32
|
-
}, /*#__PURE__*/React.createElement(ReactionConsumer, {
|
|
33
|
-
store: props.store,
|
|
34
|
-
actionsMapper: actionsMapper
|
|
35
|
-
}, renderChild));
|
|
36
|
-
};
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React, { useEffect, useRef } from 'react';
|
|
3
|
-
import { FabricElementsAnalyticsContext } from '@atlaskit/analytics-namespaced-context';
|
|
4
|
-
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
5
|
-
import { Reactions, UfoErrorBoundary } from '../components';
|
|
6
|
-
import { ReactionConsumer } from '../store/ReactionConsumer';
|
|
7
|
-
import { ReactionStatus } from '../types/ReactionStatus';
|
|
8
|
-
import { ufoExperiences } from '../store/ReactionsStore';
|
|
9
|
-
|
|
10
|
-
const ReactionsView = props => {
|
|
11
|
-
// // compose a UFO experience object
|
|
12
|
-
let experienceInstance = useRef();
|
|
13
|
-
const {
|
|
14
|
-
ari,
|
|
15
|
-
createAnalyticsEvent,
|
|
16
|
-
store,
|
|
17
|
-
containerAri
|
|
18
|
-
} = props;
|
|
19
|
-
useEffect(() => {
|
|
20
|
-
experienceInstance.current = ufoExperiences.render(ari);
|
|
21
|
-
}, [ari]);
|
|
22
|
-
useEffect(() => {
|
|
23
|
-
Promise.resolve(store).then(_store => {
|
|
24
|
-
if (_store.setCreateAnalyticsEvent && createAnalyticsEvent) {
|
|
25
|
-
_store.setCreateAnalyticsEvent(createAnalyticsEvent);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
}, [createAnalyticsEvent, store]); // abort when component gets unmounted
|
|
29
|
-
|
|
30
|
-
useEffect(() => {
|
|
31
|
-
return function cleanup() {
|
|
32
|
-
var _experienceInstance$c;
|
|
33
|
-
|
|
34
|
-
(_experienceInstance$c = experienceInstance.current) === null || _experienceInstance$c === void 0 ? void 0 : _experienceInstance$c.abort({
|
|
35
|
-
metadata: {
|
|
36
|
-
source: 'Connected-Reactions-View',
|
|
37
|
-
data: {
|
|
38
|
-
ari,
|
|
39
|
-
containerAri
|
|
40
|
-
},
|
|
41
|
-
reason: 'unmount'
|
|
42
|
-
}
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
}, [experienceInstance, containerAri, ari]);
|
|
46
|
-
|
|
47
|
-
const renderChildren = innerProps => {
|
|
48
|
-
return /*#__PURE__*/React.createElement(FabricElementsAnalyticsContext, {
|
|
49
|
-
data: {
|
|
50
|
-
containerAri,
|
|
51
|
-
ari
|
|
52
|
-
}
|
|
53
|
-
}, /*#__PURE__*/React.createElement(Reactions, _extends({
|
|
54
|
-
key: `${props.containerAri}|${props.ari}`
|
|
55
|
-
}, props, innerProps)));
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const stateMapper = state => {
|
|
59
|
-
const {
|
|
60
|
-
containerAri,
|
|
61
|
-
ari
|
|
62
|
-
} = props;
|
|
63
|
-
const reactionsState = state && state.reactions[`${containerAri}|${ari}`];
|
|
64
|
-
|
|
65
|
-
if (!state || !reactionsState) {
|
|
66
|
-
return {
|
|
67
|
-
status: ReactionStatus.notLoaded,
|
|
68
|
-
reactions: []
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
switch (reactionsState.status) {
|
|
73
|
-
case ReactionStatus.ready:
|
|
74
|
-
return {
|
|
75
|
-
reactions: reactionsState.reactions,
|
|
76
|
-
status: reactionsState.status,
|
|
77
|
-
flash: state.flash[`${containerAri}|${ari}`]
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
case ReactionStatus.error:
|
|
81
|
-
return {
|
|
82
|
-
status: ReactionStatus.error,
|
|
83
|
-
reactions: []
|
|
84
|
-
};
|
|
85
|
-
|
|
86
|
-
default:
|
|
87
|
-
return {
|
|
88
|
-
status: ReactionStatus.loading,
|
|
89
|
-
reactions: []
|
|
90
|
-
};
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
|
|
94
|
-
const actionsMapper = actions => ({
|
|
95
|
-
loadReaction: () => {
|
|
96
|
-
actions.getReactions(props.containerAri, props.ari);
|
|
97
|
-
},
|
|
98
|
-
onReactionClick: emojiId => {
|
|
99
|
-
actions.toggleReaction(props.containerAri, props.ari, emojiId);
|
|
100
|
-
},
|
|
101
|
-
onReactionHover: emojiId => {
|
|
102
|
-
actions.getDetailedReaction(props.containerAri, props.ari, emojiId);
|
|
103
|
-
},
|
|
104
|
-
onSelection: emojiId => {
|
|
105
|
-
actions.addReaction(props.containerAri, props.ari, emojiId);
|
|
106
|
-
}
|
|
107
|
-
});
|
|
108
|
-
|
|
109
|
-
return /*#__PURE__*/React.createElement(UfoErrorBoundary, {
|
|
110
|
-
experiences: experienceInstance.current ? [experienceInstance.current] : []
|
|
111
|
-
}, /*#__PURE__*/React.createElement(ReactionConsumer, {
|
|
112
|
-
store: props.store,
|
|
113
|
-
actionsMapper: actionsMapper,
|
|
114
|
-
stateMapper: stateMapper
|
|
115
|
-
}, renderChildren));
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export const ConnectedReactionsView = withAnalyticsEvents()(ReactionsView);
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conditions of the reaction when loaded from the store
|
|
3
|
-
*/
|
|
4
|
-
export let ReactionStatus;
|
|
5
|
-
|
|
6
|
-
(function (ReactionStatus) {
|
|
7
|
-
ReactionStatus["ready"] = "READY";
|
|
8
|
-
ReactionStatus["loading"] = "LOADING";
|
|
9
|
-
ReactionStatus["error"] = "ERROR";
|
|
10
|
-
ReactionStatus["notLoaded"] = "NOT_LOADED";
|
|
11
|
-
})(ReactionStatus || (ReactionStatus = {}));
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
@@ -1,77 +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 { ResourcedEmoji } from '@atlaskit/emoji/element';
|
|
16
|
-
import React from 'react';
|
|
17
|
-
import { PureComponent } from 'react';
|
|
18
|
-
import { isLeftClick } from './utils';
|
|
19
|
-
var emojiButtonStyle = css({
|
|
20
|
-
outline: 'none',
|
|
21
|
-
display: 'flex',
|
|
22
|
-
backgroundColor: 'transparent',
|
|
23
|
-
border: 0,
|
|
24
|
-
borderRadius: '5px',
|
|
25
|
-
cursor: 'pointer',
|
|
26
|
-
margin: '0',
|
|
27
|
-
padding: '10px 8px',
|
|
28
|
-
'&:hover > span': {
|
|
29
|
-
transition: 'transform cubic-bezier(0.23, 1, 0.32, 1) 200ms',
|
|
30
|
-
transform: 'scale(1.33)'
|
|
31
|
-
}
|
|
32
|
-
});
|
|
33
|
-
export var EmojiButton = /*#__PURE__*/function (_PureComponent) {
|
|
34
|
-
_inherits(EmojiButton, _PureComponent);
|
|
35
|
-
|
|
36
|
-
var _super = _createSuper(EmojiButton);
|
|
37
|
-
|
|
38
|
-
function EmojiButton() {
|
|
39
|
-
var _this;
|
|
40
|
-
|
|
41
|
-
_classCallCheck(this, EmojiButton);
|
|
42
|
-
|
|
43
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
44
|
-
args[_key] = arguments[_key];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
_this = _super.call.apply(_super, [this].concat(args));
|
|
48
|
-
|
|
49
|
-
_defineProperty(_assertThisInitialized(_this), "handleMouseDown", function (event) {
|
|
50
|
-
event.preventDefault();
|
|
51
|
-
|
|
52
|
-
if (_this.props.onClick && isLeftClick(event)) {
|
|
53
|
-
_this.props.onClick(_this.props.emojiId, undefined, event);
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
return _this;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
_createClass(EmojiButton, [{
|
|
61
|
-
key: "render",
|
|
62
|
-
value: function render() {
|
|
63
|
-
var _this$props = this.props,
|
|
64
|
-
emojiId = _this$props.emojiId,
|
|
65
|
-
emojiProvider = _this$props.emojiProvider;
|
|
66
|
-
return jsx("button", {
|
|
67
|
-
onMouseUp: this.handleMouseDown,
|
|
68
|
-
css: emojiButtonStyle
|
|
69
|
-
}, jsx(ResourcedEmoji, {
|
|
70
|
-
emojiProvider: emojiProvider,
|
|
71
|
-
emojiId: emojiId
|
|
72
|
-
}));
|
|
73
|
-
}
|
|
74
|
-
}]);
|
|
75
|
-
|
|
76
|
-
return EmojiButton;
|
|
77
|
-
}(PureComponent);
|
|
@@ -1,207 +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 { ResourcedEmoji } from '@atlaskit/emoji/element';
|
|
17
|
-
import { B50, B75, B300, N20, N40, N400 } from '@atlaskit/theme/colors';
|
|
18
|
-
import { token } from '@atlaskit/tokens';
|
|
19
|
-
import React from 'react';
|
|
20
|
-
import { PureComponent } from 'react';
|
|
21
|
-
import { createAndFireSafe, createReactionClickedEvent, createReactionHoveredEvent } from '../analytics';
|
|
22
|
-
import { Counter } from './Counter';
|
|
23
|
-
import { FlashAnimation } from './FlashAnimation';
|
|
24
|
-
import { ReactionTooltip } from './ReactionTooltip';
|
|
25
|
-
import { isLeftClick, akHeight } from './utils';
|
|
26
|
-
/**
|
|
27
|
-
* Styling Note:
|
|
28
|
-
* Padding and line height are set within the child components
|
|
29
|
-
* of FlashAnimation b/c it otherwise throws off the flash styling
|
|
30
|
-
*/
|
|
31
|
-
|
|
32
|
-
var emojiStyle = css({
|
|
33
|
-
transformOrigin: 'center center 0',
|
|
34
|
-
lineHeight: '12px',
|
|
35
|
-
padding: '4px 4px 4px 8px'
|
|
36
|
-
});
|
|
37
|
-
var reactionStyle = css({
|
|
38
|
-
outline: 'none',
|
|
39
|
-
display: 'flex',
|
|
40
|
-
flexDirection: 'row',
|
|
41
|
-
alignItems: 'flex-start',
|
|
42
|
-
minWidth: '36px',
|
|
43
|
-
height: "".concat(akHeight, "px"),
|
|
44
|
-
background: 'transparent',
|
|
45
|
-
border: "1px solid ".concat(token('color.border', N40)),
|
|
46
|
-
boxSizing: 'border-box',
|
|
47
|
-
borderRadius: '20px',
|
|
48
|
-
color: "".concat(token('color.text.subtle', N400)),
|
|
49
|
-
cursor: 'pointer',
|
|
50
|
-
margin: 0,
|
|
51
|
-
padding: 0,
|
|
52
|
-
transition: '200ms ease-in-out',
|
|
53
|
-
'&:hover': {
|
|
54
|
-
background: "".concat(token('color.background.neutral.subtle.hovered', N20))
|
|
55
|
-
}
|
|
56
|
-
});
|
|
57
|
-
var reactedStyle = css({
|
|
58
|
-
backgroundColor: token('color.background.selected', B50),
|
|
59
|
-
borderColor: token('color.border.selected', B300),
|
|
60
|
-
'&:hover': {
|
|
61
|
-
background: "".concat(token('color.background.selected.hovered', B75))
|
|
62
|
-
}
|
|
63
|
-
});
|
|
64
|
-
var flashHeight = akHeight - 2; // height without the 1px border
|
|
65
|
-
|
|
66
|
-
var flashStyle = css({
|
|
67
|
-
display: 'flex',
|
|
68
|
-
flexDirection: 'row',
|
|
69
|
-
borderRadius: '10px',
|
|
70
|
-
height: "".concat(flashHeight, "px")
|
|
71
|
-
});
|
|
72
|
-
/**
|
|
73
|
-
* @param id give id for the emoji
|
|
74
|
-
* @param event selected mouse event proerties
|
|
75
|
-
*/
|
|
76
|
-
|
|
77
|
-
var ReactionWithoutAnalytics = /*#__PURE__*/function (_PureComponent) {
|
|
78
|
-
_inherits(ReactionWithoutAnalytics, _PureComponent);
|
|
79
|
-
|
|
80
|
-
var _super = _createSuper(ReactionWithoutAnalytics);
|
|
81
|
-
|
|
82
|
-
function ReactionWithoutAnalytics(props) {
|
|
83
|
-
var _this;
|
|
84
|
-
|
|
85
|
-
_classCallCheck(this, ReactionWithoutAnalytics);
|
|
86
|
-
|
|
87
|
-
_this = _super.call(this, props);
|
|
88
|
-
|
|
89
|
-
_defineProperty(_assertThisInitialized(_this), "mounted", false);
|
|
90
|
-
|
|
91
|
-
_defineProperty(_assertThisInitialized(_this), "handleMouseDown", function (event) {
|
|
92
|
-
event.preventDefault();
|
|
93
|
-
event.stopPropagation();
|
|
94
|
-
|
|
95
|
-
if (_this.props.onClick && isLeftClick(event)) {
|
|
96
|
-
var _this$props = _this.props,
|
|
97
|
-
_reaction = _this$props.reaction,
|
|
98
|
-
createAnalyticsEvent = _this$props.createAnalyticsEvent;
|
|
99
|
-
var reacted = _reaction.reacted,
|
|
100
|
-
emojiId = _reaction.emojiId;
|
|
101
|
-
createAndFireSafe(createAnalyticsEvent, createReactionClickedEvent, !reacted, emojiId);
|
|
102
|
-
|
|
103
|
-
_this.props.onClick(_this.props.reaction.emojiId, event);
|
|
104
|
-
}
|
|
105
|
-
});
|
|
106
|
-
|
|
107
|
-
_defineProperty(_assertThisInitialized(_this), "handleMouseEnter", function (event) {
|
|
108
|
-
event.preventDefault();
|
|
109
|
-
var _this$props2 = _this.props,
|
|
110
|
-
onMouseEnter = _this$props2.onMouseEnter,
|
|
111
|
-
reaction = _this$props2.reaction;
|
|
112
|
-
|
|
113
|
-
if (!reaction.users || !reaction.users.length) {
|
|
114
|
-
_this.hoverStart = Date.now();
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (onMouseEnter) {
|
|
118
|
-
onMouseEnter(_this.props.reaction, event);
|
|
119
|
-
}
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
_this.state = {};
|
|
123
|
-
return _this;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
_createClass(ReactionWithoutAnalytics, [{
|
|
127
|
-
key: "componentDidUpdate",
|
|
128
|
-
value: function componentDidUpdate(_ref) {
|
|
129
|
-
var prevReaction = _ref.reaction;
|
|
130
|
-
|
|
131
|
-
if (!prevReaction.users && this.props.reaction.users) {
|
|
132
|
-
createAndFireSafe(this.props.createAnalyticsEvent, createReactionHoveredEvent, this.hoverStart);
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}, {
|
|
136
|
-
key: "componentDidMount",
|
|
137
|
-
value: function componentDidMount() {
|
|
138
|
-
var _this2 = this;
|
|
139
|
-
|
|
140
|
-
this.mounted = true;
|
|
141
|
-
this.props.emojiProvider.then(function (emojiResource) {
|
|
142
|
-
return emojiResource.findByEmojiId({
|
|
143
|
-
shortName: '',
|
|
144
|
-
id: _this2.props.reaction.emojiId
|
|
145
|
-
});
|
|
146
|
-
}).then(function (foundEmoji) {
|
|
147
|
-
if (foundEmoji && _this2.mounted) {
|
|
148
|
-
_this2.setState({
|
|
149
|
-
emojiName: foundEmoji.name
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
}
|
|
154
|
-
}, {
|
|
155
|
-
key: "componentWillUnmount",
|
|
156
|
-
value: function componentWillUnmount() {
|
|
157
|
-
this.mounted = false;
|
|
158
|
-
}
|
|
159
|
-
}, {
|
|
160
|
-
key: "render",
|
|
161
|
-
value: function render() {
|
|
162
|
-
var _this$props3 = this.props,
|
|
163
|
-
emojiProvider = _this$props3.emojiProvider,
|
|
164
|
-
reaction = _this$props3.reaction,
|
|
165
|
-
classNameProp = _this$props3.className,
|
|
166
|
-
flash = _this$props3.flash;
|
|
167
|
-
var emojiName = this.state.emojiName;
|
|
168
|
-
var emojiId = {
|
|
169
|
-
id: reaction.emojiId,
|
|
170
|
-
shortName: ''
|
|
171
|
-
};
|
|
172
|
-
return jsx(ReactionTooltip, {
|
|
173
|
-
emojiName: emojiName,
|
|
174
|
-
reaction: reaction
|
|
175
|
-
}, jsx("button", {
|
|
176
|
-
className: classNameProp,
|
|
177
|
-
css: [reactionStyle, reaction.reacted && reactedStyle],
|
|
178
|
-
onMouseUp: this.handleMouseDown,
|
|
179
|
-
onMouseEnter: this.handleMouseEnter
|
|
180
|
-
}, jsx(FlashAnimation, {
|
|
181
|
-
flash: flash,
|
|
182
|
-
css: flashStyle
|
|
183
|
-
}, jsx("div", {
|
|
184
|
-
css: emojiStyle
|
|
185
|
-
}, jsx(ResourcedEmoji, {
|
|
186
|
-
emojiProvider: emojiProvider,
|
|
187
|
-
emojiId: emojiId,
|
|
188
|
-
fitToHeight: 16
|
|
189
|
-
})), jsx(Counter, {
|
|
190
|
-
value: reaction.count,
|
|
191
|
-
highlight: reaction.reacted
|
|
192
|
-
}))));
|
|
193
|
-
}
|
|
194
|
-
}]);
|
|
195
|
-
|
|
196
|
-
return ReactionWithoutAnalytics;
|
|
197
|
-
}(PureComponent);
|
|
198
|
-
|
|
199
|
-
_defineProperty(ReactionWithoutAnalytics, "defaultProps", {
|
|
200
|
-
flash: false,
|
|
201
|
-
className: undefined,
|
|
202
|
-
onMouseEnter: undefined
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
_defineProperty(ReactionWithoutAnalytics, "displayName", 'Reaction');
|
|
206
|
-
|
|
207
|
-
export var Reaction = withAnalyticsEvents()(ReactionWithoutAnalytics);
|