@atlaskit/reactions 22.6.3 → 22.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/Reaction/Reaction.js +11 -5
- package/dist/cjs/components/Reaction/styles.js +7 -1
- package/dist/cjs/components/ReactionParticleEffect/ReactionParticleEffect.js +30 -0
- package/dist/cjs/components/ReactionParticleEffect/index.js +12 -0
- package/dist/cjs/components/ReactionParticleEffect/styles.js +58 -0
- package/dist/cjs/components/Reactions/Reactions.js +4 -1
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/Reaction/Reaction.js +11 -6
- package/dist/es2019/components/Reaction/styles.js +6 -0
- package/dist/es2019/components/ReactionParticleEffect/ReactionParticleEffect.js +20 -0
- package/dist/es2019/components/ReactionParticleEffect/index.js +1 -0
- package/dist/es2019/components/ReactionParticleEffect/styles.js +52 -0
- package/dist/es2019/components/Reactions/Reactions.js +3 -1
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/Reaction/Reaction.js +12 -6
- package/dist/esm/components/Reaction/styles.js +6 -0
- package/dist/esm/components/ReactionParticleEffect/ReactionParticleEffect.js +22 -0
- package/dist/esm/components/ReactionParticleEffect/index.js +1 -0
- package/dist/esm/components/ReactionParticleEffect/styles.js +52 -0
- package/dist/esm/components/Reactions/Reactions.js +4 -1
- package/dist/types/components/Reaction/Reaction.d.ts +9 -5
- package/dist/types/components/Reaction/styles.d.ts +2 -0
- package/dist/types/components/ReactionParticleEffect/ReactionParticleEffect.d.ts +16 -0
- package/dist/types/components/ReactionParticleEffect/index.d.ts +1 -0
- package/dist/types/components/ReactionParticleEffect/styles.d.ts +2 -0
- package/dist/types/components/Reactions/Reactions.d.ts +11 -6
- package/dist/types-ts4.5/components/Reaction/Reaction.d.ts +9 -5
- package/dist/types-ts4.5/components/Reaction/styles.d.ts +2 -0
- package/dist/types-ts4.5/components/ReactionParticleEffect/ReactionParticleEffect.d.ts +16 -0
- package/dist/types-ts4.5/components/ReactionParticleEffect/index.d.ts +1 -0
- package/dist/types-ts4.5/components/ReactionParticleEffect/styles.d.ts +2 -0
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +11 -6
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 22.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#93855](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/93855)
|
|
8
|
+
[`2c1bba58469b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2c1bba58469b) -
|
|
9
|
+
[ux] Added Particle effect to reactions
|
|
10
|
+
|
|
3
11
|
## 22.6.3
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -11,7 +11,7 @@ var _analyticsGasTypes = require("@atlaskit/analytics-gas-types");
|
|
|
11
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
13
|
var packageName = "@atlaskit/reactions";
|
|
14
|
-
var packageVersion = "22.
|
|
14
|
+
var packageVersion = "22.7.0";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -17,6 +17,7 @@ var _emoji = require("@atlaskit/emoji");
|
|
|
17
17
|
var _analytics = require("../../analytics");
|
|
18
18
|
var _Counter = require("../Counter");
|
|
19
19
|
var _FlashAnimation = require("../FlashAnimation");
|
|
20
|
+
var _ReactionParticleEffect = require("../ReactionParticleEffect");
|
|
20
21
|
var _ReactionTooltip = require("../ReactionTooltip");
|
|
21
22
|
var _i18n = require("../../shared/i18n");
|
|
22
23
|
var _utils = require("../../shared/utils");
|
|
@@ -43,6 +44,8 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
43
44
|
className = _ref.className,
|
|
44
45
|
_ref$flash = _ref.flash,
|
|
45
46
|
flash = _ref$flash === void 0 ? false : _ref$flash,
|
|
47
|
+
_ref$showParticleEffe = _ref.showParticleEffect,
|
|
48
|
+
showParticleEffect = _ref$showParticleEffe === void 0 ? false : _ref$showParticleEffe,
|
|
46
49
|
_ref$handleUserListCl = _ref.handleUserListClick,
|
|
47
50
|
handleUserListClick = _ref$handleUserListCl === void 0 ? function () {} : _ref$handleUserListCl,
|
|
48
51
|
allowUserDialog = _ref.allowUserDialog;
|
|
@@ -121,7 +124,12 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
121
124
|
handleUserListClick(emojiId);
|
|
122
125
|
setIsTooltipEnabled(false);
|
|
123
126
|
};
|
|
124
|
-
return (0, _react2.jsx)(
|
|
127
|
+
return (0, _react2.jsx)("div", {
|
|
128
|
+
css: _styles.containerStyle
|
|
129
|
+
}, showParticleEffect && (0, _react2.jsx)(_ReactionParticleEffect.ReactionParticleEffect, {
|
|
130
|
+
emojiId: emojiId,
|
|
131
|
+
emojiProvider: emojiProvider
|
|
132
|
+
}), (0, _react2.jsx)(_ReactionTooltip.ReactionTooltip, {
|
|
125
133
|
emojiName: emojiName,
|
|
126
134
|
reaction: reaction,
|
|
127
135
|
handleUserListClick: handleOpenReactionsDialog,
|
|
@@ -144,9 +152,7 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
144
152
|
flash: flash,
|
|
145
153
|
css: _styles.flashStyle
|
|
146
154
|
}, (0, _react2.jsx)("div", {
|
|
147
|
-
css: [_styles.emojiStyle, reaction.count === 0 &&
|
|
148
|
-
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)", " ", "var(--ds-space-050, 4px)", " 10px")
|
|
149
|
-
}]
|
|
155
|
+
css: [_styles.emojiStyle, reaction.count === 0 && _styles.emojiNoReactionStyle]
|
|
150
156
|
}, (0, _react2.jsx)(_emoji.ResourcedEmoji, {
|
|
151
157
|
emojiProvider: emojiProvider,
|
|
152
158
|
emojiId: emojiId,
|
|
@@ -154,5 +160,5 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
154
160
|
})), (0, _react2.jsx)(_Counter.Counter, {
|
|
155
161
|
value: reaction.count,
|
|
156
162
|
highlight: reaction.reacted
|
|
157
|
-
}))));
|
|
163
|
+
})))));
|
|
158
164
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.reactionStyle = exports.reactedStyle = exports.flashStyle = exports.flashHeight = exports.emojiStyle = void 0;
|
|
6
|
+
exports.reactionStyle = exports.reactedStyle = exports.flashStyle = exports.flashHeight = exports.emojiStyle = exports.emojiNoReactionStyle = exports.containerStyle = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
var _colors = require("@atlaskit/theme/colors");
|
|
9
9
|
/** @jsx jsx */
|
|
@@ -19,6 +19,9 @@ var akHeight = 24;
|
|
|
19
19
|
* of FlashAnimation b/c it otherwise throws off the flash styling
|
|
20
20
|
*/
|
|
21
21
|
|
|
22
|
+
var containerStyle = exports.containerStyle = (0, _react.css)({
|
|
23
|
+
position: 'relative'
|
|
24
|
+
});
|
|
22
25
|
var emojiStyle = exports.emojiStyle = (0, _react.css)({
|
|
23
26
|
transformOrigin: 'center center 0',
|
|
24
27
|
lineHeight: '12px',
|
|
@@ -66,4 +69,7 @@ var flashStyle = exports.flashStyle = (0, _react.css)({
|
|
|
66
69
|
alignItems: 'center',
|
|
67
70
|
borderRadius: '10px',
|
|
68
71
|
height: "".concat(flashHeight, "px")
|
|
72
|
+
});
|
|
73
|
+
var emojiNoReactionStyle = exports.emojiNoReactionStyle = (0, _react.css)({
|
|
74
|
+
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)", " ", "var(--ds-space-050, 4px)", " 10px")
|
|
69
75
|
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ReactionParticleEffect = exports.PARTICLE_COUNT = void 0;
|
|
8
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
9
|
+
var _emoji = require("@atlaskit/emoji");
|
|
10
|
+
var _react = require("@emotion/react");
|
|
11
|
+
var _styles = require("./styles");
|
|
12
|
+
/** @jsx jsx */
|
|
13
|
+
|
|
14
|
+
var PARTICLE_COUNT = exports.PARTICLE_COUNT = 4;
|
|
15
|
+
var ReactionParticleEffect = exports.ReactionParticleEffect = function ReactionParticleEffect(_ref) {
|
|
16
|
+
var emojiProvider = _ref.emojiProvider,
|
|
17
|
+
emojiId = _ref.emojiId;
|
|
18
|
+
return (0, _react.jsx)("div", {
|
|
19
|
+
css: _styles.containerStyle
|
|
20
|
+
}, (0, _toConsumableArray2.default)(Array(PARTICLE_COUNT)).map(function (_, index) {
|
|
21
|
+
return (0, _react.jsx)("div", {
|
|
22
|
+
key: index,
|
|
23
|
+
css: _styles.reactionParticleStyle
|
|
24
|
+
}, (0, _react.jsx)(_emoji.ResourcedEmoji, {
|
|
25
|
+
emojiProvider: emojiProvider,
|
|
26
|
+
emojiId: emojiId,
|
|
27
|
+
fitToHeight: 16
|
|
28
|
+
}));
|
|
29
|
+
}));
|
|
30
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "ReactionParticleEffect", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function get() {
|
|
9
|
+
return _ReactionParticleEffect.ReactionParticleEffect;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
var _ReactionParticleEffect = require("./ReactionParticleEffect");
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.reactionParticleStyle = exports.containerStyle = void 0;
|
|
7
|
+
var _constants = require("@atlaskit/theme/constants");
|
|
8
|
+
var _react = require("@emotion/react");
|
|
9
|
+
var fade = (0, _react.keyframes)({
|
|
10
|
+
'0%': {
|
|
11
|
+
opacity: 0
|
|
12
|
+
},
|
|
13
|
+
'20%': {
|
|
14
|
+
opacity: 1
|
|
15
|
+
},
|
|
16
|
+
'60%': {
|
|
17
|
+
opacity: 1
|
|
18
|
+
},
|
|
19
|
+
'100%': {
|
|
20
|
+
opacity: 0
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
var float = (0, _react.keyframes)({
|
|
24
|
+
'0%': {
|
|
25
|
+
transform: 'translateY(0) scale(1)'
|
|
26
|
+
},
|
|
27
|
+
'100%': {
|
|
28
|
+
transform: 'translateY(-120px) scale(1.7)'
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
var containerStyle = exports.containerStyle = (0, _react.css)({
|
|
32
|
+
position: 'relative',
|
|
33
|
+
left: 8,
|
|
34
|
+
// Ensure the effect displays above tooltips
|
|
35
|
+
zIndex: _constants.layers.tooltip() + 1
|
|
36
|
+
});
|
|
37
|
+
var reactionParticleStyle = exports.reactionParticleStyle = (0, _react.css)({
|
|
38
|
+
position: 'absolute',
|
|
39
|
+
top: 0,
|
|
40
|
+
left: 0,
|
|
41
|
+
pointerEvents: 'none',
|
|
42
|
+
opacity: 0,
|
|
43
|
+
animation: "".concat(fade, " ease-in-out, ").concat(float, " ease"),
|
|
44
|
+
animationDuration: '700ms',
|
|
45
|
+
// Override position and delay for each particle
|
|
46
|
+
':nth-child(2)': {
|
|
47
|
+
left: -5,
|
|
48
|
+
animationDelay: '0.15s'
|
|
49
|
+
},
|
|
50
|
+
':nth-child(3)': {
|
|
51
|
+
left: 8,
|
|
52
|
+
animationDelay: '0.3s'
|
|
53
|
+
},
|
|
54
|
+
':nth-child(4)': {
|
|
55
|
+
left: -1,
|
|
56
|
+
animationDelay: '0.45s'
|
|
57
|
+
}
|
|
58
|
+
});
|
|
@@ -79,6 +79,8 @@ function getTooltip(status, errorMessage) {
|
|
|
79
79
|
var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
80
80
|
var _ref$flash = _ref.flash,
|
|
81
81
|
flash = _ref$flash === void 0 ? {} : _ref$flash,
|
|
82
|
+
_ref$particleEffectBy = _ref.particleEffectByEmoji,
|
|
83
|
+
particleEffectByEmoji = _ref$particleEffectBy === void 0 ? {} : _ref$particleEffectBy,
|
|
82
84
|
status = _ref.status,
|
|
83
85
|
errorMessage = _ref.errorMessage,
|
|
84
86
|
loadReaction = _ref.loadReaction,
|
|
@@ -270,7 +272,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
270
272
|
onFocused: handleReactionFocused,
|
|
271
273
|
flash: flash[reaction.emojiId],
|
|
272
274
|
handleUserListClick: handleOpenReactionsDialog,
|
|
273
|
-
allowUserDialog: allowUserDialog
|
|
275
|
+
allowUserDialog: allowUserDialog,
|
|
276
|
+
showParticleEffect: particleEffectByEmoji[reaction.emojiId]
|
|
274
277
|
});
|
|
275
278
|
}), (0, _react2.jsx)(_ReactionPicker.ReactionPicker, {
|
|
276
279
|
css: _styles.reactionPickerStyle,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
2
2
|
import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
3
3
|
const packageName = "@atlaskit/reactions";
|
|
4
|
-
const packageVersion = "22.
|
|
4
|
+
const packageVersion = "22.7.0";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|
|
@@ -7,10 +7,11 @@ import { ResourcedEmoji } from '@atlaskit/emoji';
|
|
|
7
7
|
import { createAndFireSafe, createReactionClickedEvent, createReactionFocusedEvent, createReactionHoveredEvent } from '../../analytics';
|
|
8
8
|
import { Counter } from '../Counter';
|
|
9
9
|
import { FlashAnimation } from '../FlashAnimation';
|
|
10
|
+
import { ReactionParticleEffect } from '../ReactionParticleEffect';
|
|
10
11
|
import { ReactionTooltip } from '../ReactionTooltip';
|
|
11
12
|
import { messages } from '../../shared/i18n';
|
|
12
13
|
import { isLeftClick } from '../../shared/utils';
|
|
13
|
-
import { emojiStyle, flashStyle, reactedStyle, reactionStyle } from './styles';
|
|
14
|
+
import { containerStyle, emojiStyle, emojiNoReactionStyle, flashStyle, reactedStyle, reactionStyle } from './styles';
|
|
14
15
|
/**
|
|
15
16
|
* Test id for Reaction item wrapper div
|
|
16
17
|
*/
|
|
@@ -26,6 +27,7 @@ export const Reaction = ({
|
|
|
26
27
|
onFocused = () => {},
|
|
27
28
|
className,
|
|
28
29
|
flash = false,
|
|
30
|
+
showParticleEffect = false,
|
|
29
31
|
handleUserListClick = () => {},
|
|
30
32
|
allowUserDialog
|
|
31
33
|
}) => {
|
|
@@ -86,7 +88,12 @@ export const Reaction = ({
|
|
|
86
88
|
handleUserListClick(emojiId);
|
|
87
89
|
setIsTooltipEnabled(false);
|
|
88
90
|
};
|
|
89
|
-
return jsx(
|
|
91
|
+
return jsx("div", {
|
|
92
|
+
css: containerStyle
|
|
93
|
+
}, showParticleEffect && jsx(ReactionParticleEffect, {
|
|
94
|
+
emojiId: emojiId,
|
|
95
|
+
emojiProvider: emojiProvider
|
|
96
|
+
}), jsx(ReactionTooltip, {
|
|
90
97
|
emojiName: emojiName,
|
|
91
98
|
reaction: reaction,
|
|
92
99
|
handleUserListClick: handleOpenReactionsDialog,
|
|
@@ -109,9 +116,7 @@ export const Reaction = ({
|
|
|
109
116
|
flash: flash,
|
|
110
117
|
css: flashStyle
|
|
111
118
|
}, jsx("div", {
|
|
112
|
-
css: [emojiStyle, reaction.count === 0 &&
|
|
113
|
-
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-025, 2px)"} ${"var(--ds-space-050, 4px)"} 10px`
|
|
114
|
-
}]
|
|
119
|
+
css: [emojiStyle, reaction.count === 0 && emojiNoReactionStyle]
|
|
115
120
|
}, jsx(ResourcedEmoji, {
|
|
116
121
|
emojiProvider: emojiProvider,
|
|
117
122
|
emojiId: emojiId,
|
|
@@ -119,5 +124,5 @@ export const Reaction = ({
|
|
|
119
124
|
})), jsx(Counter, {
|
|
120
125
|
value: reaction.count,
|
|
121
126
|
highlight: reaction.reacted
|
|
122
|
-
}))));
|
|
127
|
+
})))));
|
|
123
128
|
};
|
|
@@ -12,6 +12,9 @@ const akHeight = 24;
|
|
|
12
12
|
* of FlashAnimation b/c it otherwise throws off the flash styling
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
export const containerStyle = css({
|
|
16
|
+
position: 'relative'
|
|
17
|
+
});
|
|
15
18
|
export const emojiStyle = css({
|
|
16
19
|
transformOrigin: 'center center 0',
|
|
17
20
|
lineHeight: '12px',
|
|
@@ -59,4 +62,7 @@ export const flashStyle = css({
|
|
|
59
62
|
alignItems: 'center',
|
|
60
63
|
borderRadius: '10px',
|
|
61
64
|
height: `${flashHeight}px`
|
|
65
|
+
});
|
|
66
|
+
export const emojiNoReactionStyle = css({
|
|
67
|
+
padding: `${"var(--ds-space-050, 4px)"} ${"var(--ds-space-025, 2px)"} ${"var(--ds-space-050, 4px)"} 10px`
|
|
62
68
|
});
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { ResourcedEmoji } from '@atlaskit/emoji';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
import { containerStyle, reactionParticleStyle } from './styles';
|
|
5
|
+
export const PARTICLE_COUNT = 4;
|
|
6
|
+
export const ReactionParticleEffect = ({
|
|
7
|
+
emojiProvider,
|
|
8
|
+
emojiId
|
|
9
|
+
}) => jsx("div", {
|
|
10
|
+
css: containerStyle
|
|
11
|
+
}, [...Array(PARTICLE_COUNT)].map((_, index) => {
|
|
12
|
+
return jsx("div", {
|
|
13
|
+
key: index,
|
|
14
|
+
css: reactionParticleStyle
|
|
15
|
+
}, jsx(ResourcedEmoji, {
|
|
16
|
+
emojiProvider: emojiProvider,
|
|
17
|
+
emojiId: emojiId,
|
|
18
|
+
fitToHeight: 16
|
|
19
|
+
}));
|
|
20
|
+
}));
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReactionParticleEffect } from './ReactionParticleEffect';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { layers } from '@atlaskit/theme/constants';
|
|
2
|
+
import { css, keyframes } from '@emotion/react';
|
|
3
|
+
const fade = keyframes({
|
|
4
|
+
'0%': {
|
|
5
|
+
opacity: 0
|
|
6
|
+
},
|
|
7
|
+
'20%': {
|
|
8
|
+
opacity: 1
|
|
9
|
+
},
|
|
10
|
+
'60%': {
|
|
11
|
+
opacity: 1
|
|
12
|
+
},
|
|
13
|
+
'100%': {
|
|
14
|
+
opacity: 0
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
const float = keyframes({
|
|
18
|
+
'0%': {
|
|
19
|
+
transform: 'translateY(0) scale(1)'
|
|
20
|
+
},
|
|
21
|
+
'100%': {
|
|
22
|
+
transform: 'translateY(-120px) scale(1.7)'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export const containerStyle = css({
|
|
26
|
+
position: 'relative',
|
|
27
|
+
left: 8,
|
|
28
|
+
// Ensure the effect displays above tooltips
|
|
29
|
+
zIndex: layers.tooltip() + 1
|
|
30
|
+
});
|
|
31
|
+
export const reactionParticleStyle = css({
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
top: 0,
|
|
34
|
+
left: 0,
|
|
35
|
+
pointerEvents: 'none',
|
|
36
|
+
opacity: 0,
|
|
37
|
+
animation: `${fade} ease-in-out, ${float} ease`,
|
|
38
|
+
animationDuration: '700ms',
|
|
39
|
+
// Override position and delay for each particle
|
|
40
|
+
':nth-child(2)': {
|
|
41
|
+
left: -5,
|
|
42
|
+
animationDelay: '0.15s'
|
|
43
|
+
},
|
|
44
|
+
':nth-child(3)': {
|
|
45
|
+
left: 8,
|
|
46
|
+
animationDelay: '0.3s'
|
|
47
|
+
},
|
|
48
|
+
':nth-child(4)': {
|
|
49
|
+
left: -1,
|
|
50
|
+
animationDelay: '0.45s'
|
|
51
|
+
}
|
|
52
|
+
});
|
|
@@ -65,6 +65,7 @@ export function getTooltip(status, errorMessage) {
|
|
|
65
65
|
*/
|
|
66
66
|
export const Reactions = /*#__PURE__*/React.memo(({
|
|
67
67
|
flash = {},
|
|
68
|
+
particleEffectByEmoji = {},
|
|
68
69
|
status,
|
|
69
70
|
errorMessage,
|
|
70
71
|
loadReaction,
|
|
@@ -242,7 +243,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
242
243
|
onFocused: handleReactionFocused,
|
|
243
244
|
flash: flash[reaction.emojiId],
|
|
244
245
|
handleUserListClick: handleOpenReactionsDialog,
|
|
245
|
-
allowUserDialog: allowUserDialog
|
|
246
|
+
allowUserDialog: allowUserDialog,
|
|
247
|
+
showParticleEffect: particleEffectByEmoji[reaction.emojiId]
|
|
246
248
|
})), jsx(ReactionPicker, {
|
|
247
249
|
css: reactionPickerStyle,
|
|
248
250
|
emojiProvider: emojiProvider,
|
|
@@ -4,7 +4,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
4
4
|
import { createAndFireEvent } from '@atlaskit/analytics-next';
|
|
5
5
|
import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-types';
|
|
6
6
|
var packageName = "@atlaskit/reactions";
|
|
7
|
-
var packageVersion = "22.
|
|
7
|
+
var packageVersion = "22.7.0";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -10,10 +10,11 @@ import { ResourcedEmoji } from '@atlaskit/emoji';
|
|
|
10
10
|
import { createAndFireSafe, createReactionClickedEvent, createReactionFocusedEvent, createReactionHoveredEvent } from '../../analytics';
|
|
11
11
|
import { Counter } from '../Counter';
|
|
12
12
|
import { FlashAnimation } from '../FlashAnimation';
|
|
13
|
+
import { ReactionParticleEffect } from '../ReactionParticleEffect';
|
|
13
14
|
import { ReactionTooltip } from '../ReactionTooltip';
|
|
14
15
|
import { messages } from '../../shared/i18n';
|
|
15
16
|
import { isLeftClick } from '../../shared/utils';
|
|
16
|
-
import { emojiStyle, flashStyle, reactedStyle, reactionStyle } from './styles';
|
|
17
|
+
import { containerStyle, emojiStyle, emojiNoReactionStyle, flashStyle, reactedStyle, reactionStyle } from './styles';
|
|
17
18
|
/**
|
|
18
19
|
* Test id for Reaction item wrapper div
|
|
19
20
|
*/
|
|
@@ -32,6 +33,8 @@ export var Reaction = function Reaction(_ref) {
|
|
|
32
33
|
className = _ref.className,
|
|
33
34
|
_ref$flash = _ref.flash,
|
|
34
35
|
flash = _ref$flash === void 0 ? false : _ref$flash,
|
|
36
|
+
_ref$showParticleEffe = _ref.showParticleEffect,
|
|
37
|
+
showParticleEffect = _ref$showParticleEffe === void 0 ? false : _ref$showParticleEffe,
|
|
35
38
|
_ref$handleUserListCl = _ref.handleUserListClick,
|
|
36
39
|
handleUserListClick = _ref$handleUserListCl === void 0 ? function () {} : _ref$handleUserListCl,
|
|
37
40
|
allowUserDialog = _ref.allowUserDialog;
|
|
@@ -110,7 +113,12 @@ export var Reaction = function Reaction(_ref) {
|
|
|
110
113
|
handleUserListClick(emojiId);
|
|
111
114
|
setIsTooltipEnabled(false);
|
|
112
115
|
};
|
|
113
|
-
return jsx(
|
|
116
|
+
return jsx("div", {
|
|
117
|
+
css: containerStyle
|
|
118
|
+
}, showParticleEffect && jsx(ReactionParticleEffect, {
|
|
119
|
+
emojiId: emojiId,
|
|
120
|
+
emojiProvider: emojiProvider
|
|
121
|
+
}), jsx(ReactionTooltip, {
|
|
114
122
|
emojiName: emojiName,
|
|
115
123
|
reaction: reaction,
|
|
116
124
|
handleUserListClick: handleOpenReactionsDialog,
|
|
@@ -133,9 +141,7 @@ export var Reaction = function Reaction(_ref) {
|
|
|
133
141
|
flash: flash,
|
|
134
142
|
css: flashStyle
|
|
135
143
|
}, jsx("div", {
|
|
136
|
-
css: [emojiStyle, reaction.count === 0 &&
|
|
137
|
-
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)", " ", "var(--ds-space-050, 4px)", " 10px")
|
|
138
|
-
}]
|
|
144
|
+
css: [emojiStyle, reaction.count === 0 && emojiNoReactionStyle]
|
|
139
145
|
}, jsx(ResourcedEmoji, {
|
|
140
146
|
emojiProvider: emojiProvider,
|
|
141
147
|
emojiId: emojiId,
|
|
@@ -143,5 +149,5 @@ export var Reaction = function Reaction(_ref) {
|
|
|
143
149
|
})), jsx(Counter, {
|
|
144
150
|
value: reaction.count,
|
|
145
151
|
highlight: reaction.reacted
|
|
146
|
-
}))));
|
|
152
|
+
})))));
|
|
147
153
|
};
|
|
@@ -12,6 +12,9 @@ var akHeight = 24;
|
|
|
12
12
|
* of FlashAnimation b/c it otherwise throws off the flash styling
|
|
13
13
|
*/
|
|
14
14
|
|
|
15
|
+
export var containerStyle = css({
|
|
16
|
+
position: 'relative'
|
|
17
|
+
});
|
|
15
18
|
export var emojiStyle = css({
|
|
16
19
|
transformOrigin: 'center center 0',
|
|
17
20
|
lineHeight: '12px',
|
|
@@ -59,4 +62,7 @@ export var flashStyle = css({
|
|
|
59
62
|
alignItems: 'center',
|
|
60
63
|
borderRadius: '10px',
|
|
61
64
|
height: "".concat(flashHeight, "px")
|
|
65
|
+
});
|
|
66
|
+
export var emojiNoReactionStyle = css({
|
|
67
|
+
padding: "var(--ds-space-050, 4px)".concat(" ", "var(--ds-space-025, 2px)", " ", "var(--ds-space-050, 4px)", " 10px")
|
|
62
68
|
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import { ResourcedEmoji } from '@atlaskit/emoji';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import { containerStyle, reactionParticleStyle } from './styles';
|
|
6
|
+
export var PARTICLE_COUNT = 4;
|
|
7
|
+
export var ReactionParticleEffect = function ReactionParticleEffect(_ref) {
|
|
8
|
+
var emojiProvider = _ref.emojiProvider,
|
|
9
|
+
emojiId = _ref.emojiId;
|
|
10
|
+
return jsx("div", {
|
|
11
|
+
css: containerStyle
|
|
12
|
+
}, _toConsumableArray(Array(PARTICLE_COUNT)).map(function (_, index) {
|
|
13
|
+
return jsx("div", {
|
|
14
|
+
key: index,
|
|
15
|
+
css: reactionParticleStyle
|
|
16
|
+
}, jsx(ResourcedEmoji, {
|
|
17
|
+
emojiProvider: emojiProvider,
|
|
18
|
+
emojiId: emojiId,
|
|
19
|
+
fitToHeight: 16
|
|
20
|
+
}));
|
|
21
|
+
}));
|
|
22
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReactionParticleEffect } from './ReactionParticleEffect';
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { layers } from '@atlaskit/theme/constants';
|
|
2
|
+
import { css, keyframes } from '@emotion/react';
|
|
3
|
+
var fade = keyframes({
|
|
4
|
+
'0%': {
|
|
5
|
+
opacity: 0
|
|
6
|
+
},
|
|
7
|
+
'20%': {
|
|
8
|
+
opacity: 1
|
|
9
|
+
},
|
|
10
|
+
'60%': {
|
|
11
|
+
opacity: 1
|
|
12
|
+
},
|
|
13
|
+
'100%': {
|
|
14
|
+
opacity: 0
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
var float = keyframes({
|
|
18
|
+
'0%': {
|
|
19
|
+
transform: 'translateY(0) scale(1)'
|
|
20
|
+
},
|
|
21
|
+
'100%': {
|
|
22
|
+
transform: 'translateY(-120px) scale(1.7)'
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
export var containerStyle = css({
|
|
26
|
+
position: 'relative',
|
|
27
|
+
left: 8,
|
|
28
|
+
// Ensure the effect displays above tooltips
|
|
29
|
+
zIndex: layers.tooltip() + 1
|
|
30
|
+
});
|
|
31
|
+
export var reactionParticleStyle = css({
|
|
32
|
+
position: 'absolute',
|
|
33
|
+
top: 0,
|
|
34
|
+
left: 0,
|
|
35
|
+
pointerEvents: 'none',
|
|
36
|
+
opacity: 0,
|
|
37
|
+
animation: "".concat(fade, " ease-in-out, ").concat(float, " ease"),
|
|
38
|
+
animationDuration: '700ms',
|
|
39
|
+
// Override position and delay for each particle
|
|
40
|
+
':nth-child(2)': {
|
|
41
|
+
left: -5,
|
|
42
|
+
animationDelay: '0.15s'
|
|
43
|
+
},
|
|
44
|
+
':nth-child(3)': {
|
|
45
|
+
left: 8,
|
|
46
|
+
animationDelay: '0.3s'
|
|
47
|
+
},
|
|
48
|
+
':nth-child(4)': {
|
|
49
|
+
left: -1,
|
|
50
|
+
animationDelay: '0.45s'
|
|
51
|
+
}
|
|
52
|
+
});
|
|
@@ -67,6 +67,8 @@ export function getTooltip(status, errorMessage) {
|
|
|
67
67
|
export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
68
68
|
var _ref$flash = _ref.flash,
|
|
69
69
|
flash = _ref$flash === void 0 ? {} : _ref$flash,
|
|
70
|
+
_ref$particleEffectBy = _ref.particleEffectByEmoji,
|
|
71
|
+
particleEffectByEmoji = _ref$particleEffectBy === void 0 ? {} : _ref$particleEffectBy,
|
|
70
72
|
status = _ref.status,
|
|
71
73
|
errorMessage = _ref.errorMessage,
|
|
72
74
|
loadReaction = _ref.loadReaction,
|
|
@@ -258,7 +260,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
258
260
|
onFocused: handleReactionFocused,
|
|
259
261
|
flash: flash[reaction.emojiId],
|
|
260
262
|
handleUserListClick: handleOpenReactionsDialog,
|
|
261
|
-
allowUserDialog: allowUserDialog
|
|
263
|
+
allowUserDialog: allowUserDialog,
|
|
264
|
+
showParticleEffect: particleEffectByEmoji[reaction.emojiId]
|
|
262
265
|
});
|
|
263
266
|
}), jsx(ReactionPicker, {
|
|
264
267
|
css: reactionPickerStyle,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
-
import { EmojiProvider } from '@atlaskit/emoji';
|
|
3
|
-
import { ReactionSummary, ReactionClick, ReactionMouseEnter } from '../../types';
|
|
4
|
-
import { ReactionTooltipProps } from '../ReactionTooltip';
|
|
5
|
-
import { ReactionFocused } from '../../types/reaction';
|
|
2
|
+
import { type EmojiProvider } from '@atlaskit/emoji';
|
|
3
|
+
import { type ReactionSummary, type ReactionClick, type ReactionMouseEnter } from '../../types';
|
|
4
|
+
import { type ReactionTooltipProps } from '../ReactionTooltip';
|
|
5
|
+
import { type ReactionFocused } from '../../types/reaction';
|
|
6
6
|
/**
|
|
7
7
|
* Test id for Reaction item wrapper div
|
|
8
8
|
*/
|
|
@@ -36,6 +36,10 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
36
36
|
* Show custom animation or render as standard without animation (defaults to false)
|
|
37
37
|
*/
|
|
38
38
|
flash?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Show a floating emoji particle effect (usually in response to a new reaction) (defaults to false)
|
|
41
|
+
*/
|
|
42
|
+
showParticleEffect?: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* Optional function when the user wants to see more users in a modal
|
|
41
45
|
*/
|
|
@@ -44,4 +48,4 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
44
48
|
/**
|
|
45
49
|
* Render an emoji reaction button
|
|
46
50
|
*/
|
|
47
|
-
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, className, flash, handleUserListClick, allowUserDialog, }: ReactionProps) => jsx.JSX.Element;
|
|
51
|
+
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, className, flash, showParticleEffect, handleUserListClick, allowUserDialog, }: ReactionProps) => jsx.JSX.Element;
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
* Padding and line height are set within the child components
|
|
4
4
|
* of FlashAnimation b/c it otherwise throws off the flash styling
|
|
5
5
|
*/
|
|
6
|
+
export declare const containerStyle: import("@emotion/react").SerializedStyles;
|
|
6
7
|
export declare const emojiStyle: import("@emotion/react").SerializedStyles;
|
|
7
8
|
export declare const reactionStyle: import("@emotion/react").SerializedStyles;
|
|
8
9
|
export declare const reactedStyle: import("@emotion/react").SerializedStyles;
|
|
9
10
|
export declare const flashHeight: number;
|
|
10
11
|
export declare const flashStyle: import("@emotion/react").SerializedStyles;
|
|
12
|
+
export declare const emojiNoReactionStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { type EmojiProvider, type EmojiId } from '@atlaskit/emoji';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export declare const PARTICLE_COUNT = 4;
|
|
5
|
+
interface ReactionParticleEffectProps {
|
|
6
|
+
/**
|
|
7
|
+
* ID of the emoji to show within the particle effect
|
|
8
|
+
*/
|
|
9
|
+
emojiId: EmojiId;
|
|
10
|
+
/**
|
|
11
|
+
* Provider for loading emojis
|
|
12
|
+
*/
|
|
13
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
14
|
+
}
|
|
15
|
+
export declare const ReactionParticleEffect: ({ emojiProvider, emojiId }: ReactionParticleEffectProps) => jsx.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReactionParticleEffect } from './ReactionParticleEffect';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
5
|
-
import { onDialogSelectReactionChange, ReactionStatus, ReactionClick, ReactionSummary, QuickReactionEmojiSummary } from '../../types';
|
|
6
|
-
import { ReactionProps } from '../Reaction';
|
|
7
|
-
import { ReactionPickerProps } from '../ReactionPicker';
|
|
8
|
-
import { SelectorProps } from '../Selector';
|
|
4
|
+
import { type OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
5
|
+
import { type onDialogSelectReactionChange, ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary } from '../../types';
|
|
6
|
+
import { type ReactionProps } from '../Reaction';
|
|
7
|
+
import { type ReactionPickerProps } from '../ReactionPicker';
|
|
8
|
+
import { type SelectorProps } from '../Selector';
|
|
9
9
|
/**
|
|
10
10
|
* Set of all available UFO experiences relating to reactions dialog
|
|
11
11
|
*/
|
|
@@ -56,6 +56,11 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
56
56
|
* Optional emoji reactions list to show custom animation or render as standard (key => emoji string "id", value => true/false to show custom animation)
|
|
57
57
|
*/
|
|
58
58
|
flash?: Record<string, boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* Optional emoji reactions list to show floating emoji particle effect (key => emoji string "id", value => true/false to show the particle effect).
|
|
61
|
+
* Generally used for newly added reactions.
|
|
62
|
+
*/
|
|
63
|
+
particleEffectByEmoji?: Record<string, boolean>;
|
|
59
64
|
/**
|
|
60
65
|
* Optional event to get reaction details for an emoji
|
|
61
66
|
* @param emojiId current reaction emoji id
|
|
@@ -93,4 +98,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
93
98
|
/**
|
|
94
99
|
* Renders list of reactions
|
|
95
100
|
*/
|
|
96
|
-
export declare const Reactions: React.MemoExoticComponent<({ flash, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, emojiPickerSize, miniMode, }: ReactionsProps) => jsx.JSX.Element>;
|
|
101
|
+
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, emojiPickerSize, miniMode, }: ReactionsProps) => jsx.JSX.Element>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
-
import { EmojiProvider } from '@atlaskit/emoji';
|
|
3
|
-
import { ReactionSummary, ReactionClick, ReactionMouseEnter } from '../../types';
|
|
4
|
-
import { ReactionTooltipProps } from '../ReactionTooltip';
|
|
5
|
-
import { ReactionFocused } from '../../types/reaction';
|
|
2
|
+
import { type EmojiProvider } from '@atlaskit/emoji';
|
|
3
|
+
import { type ReactionSummary, type ReactionClick, type ReactionMouseEnter } from '../../types';
|
|
4
|
+
import { type ReactionTooltipProps } from '../ReactionTooltip';
|
|
5
|
+
import { type ReactionFocused } from '../../types/reaction';
|
|
6
6
|
/**
|
|
7
7
|
* Test id for Reaction item wrapper div
|
|
8
8
|
*/
|
|
@@ -36,6 +36,10 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
36
36
|
* Show custom animation or render as standard without animation (defaults to false)
|
|
37
37
|
*/
|
|
38
38
|
flash?: boolean;
|
|
39
|
+
/**
|
|
40
|
+
* Show a floating emoji particle effect (usually in response to a new reaction) (defaults to false)
|
|
41
|
+
*/
|
|
42
|
+
showParticleEffect?: boolean;
|
|
39
43
|
/**
|
|
40
44
|
* Optional function when the user wants to see more users in a modal
|
|
41
45
|
*/
|
|
@@ -44,4 +48,4 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
44
48
|
/**
|
|
45
49
|
* Render an emoji reaction button
|
|
46
50
|
*/
|
|
47
|
-
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, className, flash, handleUserListClick, allowUserDialog, }: ReactionProps) => jsx.JSX.Element;
|
|
51
|
+
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, className, flash, showParticleEffect, handleUserListClick, allowUserDialog, }: ReactionProps) => jsx.JSX.Element;
|
|
@@ -3,8 +3,10 @@
|
|
|
3
3
|
* Padding and line height are set within the child components
|
|
4
4
|
* of FlashAnimation b/c it otherwise throws off the flash styling
|
|
5
5
|
*/
|
|
6
|
+
export declare const containerStyle: import("@emotion/react").SerializedStyles;
|
|
6
7
|
export declare const emojiStyle: import("@emotion/react").SerializedStyles;
|
|
7
8
|
export declare const reactionStyle: import("@emotion/react").SerializedStyles;
|
|
8
9
|
export declare const reactedStyle: import("@emotion/react").SerializedStyles;
|
|
9
10
|
export declare const flashHeight: number;
|
|
10
11
|
export declare const flashStyle: import("@emotion/react").SerializedStyles;
|
|
12
|
+
export declare const emojiNoReactionStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { type EmojiProvider, type EmojiId } from '@atlaskit/emoji';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
|
+
export declare const PARTICLE_COUNT = 4;
|
|
5
|
+
interface ReactionParticleEffectProps {
|
|
6
|
+
/**
|
|
7
|
+
* ID of the emoji to show within the particle effect
|
|
8
|
+
*/
|
|
9
|
+
emojiId: EmojiId;
|
|
10
|
+
/**
|
|
11
|
+
* Provider for loading emojis
|
|
12
|
+
*/
|
|
13
|
+
emojiProvider: Promise<EmojiProvider>;
|
|
14
|
+
}
|
|
15
|
+
export declare const ReactionParticleEffect: ({ emojiProvider, emojiId }: ReactionParticleEffectProps) => jsx.JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { ReactionParticleEffect } from './ReactionParticleEffect';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
|
-
import { OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
5
|
-
import { onDialogSelectReactionChange, ReactionStatus, ReactionClick, ReactionSummary, QuickReactionEmojiSummary } from '../../types';
|
|
6
|
-
import { ReactionProps } from '../Reaction';
|
|
7
|
-
import { ReactionPickerProps } from '../ReactionPicker';
|
|
8
|
-
import { SelectorProps } from '../Selector';
|
|
4
|
+
import { type OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
5
|
+
import { type onDialogSelectReactionChange, ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary } from '../../types';
|
|
6
|
+
import { type ReactionProps } from '../Reaction';
|
|
7
|
+
import { type ReactionPickerProps } from '../ReactionPicker';
|
|
8
|
+
import { type SelectorProps } from '../Selector';
|
|
9
9
|
/**
|
|
10
10
|
* Set of all available UFO experiences relating to reactions dialog
|
|
11
11
|
*/
|
|
@@ -56,6 +56,11 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
56
56
|
* Optional emoji reactions list to show custom animation or render as standard (key => emoji string "id", value => true/false to show custom animation)
|
|
57
57
|
*/
|
|
58
58
|
flash?: Record<string, boolean>;
|
|
59
|
+
/**
|
|
60
|
+
* Optional emoji reactions list to show floating emoji particle effect (key => emoji string "id", value => true/false to show the particle effect).
|
|
61
|
+
* Generally used for newly added reactions.
|
|
62
|
+
*/
|
|
63
|
+
particleEffectByEmoji?: Record<string, boolean>;
|
|
59
64
|
/**
|
|
60
65
|
* Optional event to get reaction details for an emoji
|
|
61
66
|
* @param emojiId current reaction emoji id
|
|
@@ -93,4 +98,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
93
98
|
/**
|
|
94
99
|
* Renders list of reactions
|
|
95
100
|
*/
|
|
96
|
-
export declare const Reactions: React.MemoExoticComponent<({ flash, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, emojiPickerSize, miniMode, }: ReactionsProps) => jsx.JSX.Element>;
|
|
101
|
+
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, emojiPickerSize, miniMode, }: ReactionsProps) => jsx.JSX.Element>;
|