@atlaskit/reactions 21.3.0 → 21.3.3
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 +19 -0
- package/dist/cjs/analytics/ufo.js +10 -2
- package/dist/cjs/components/ReactionTooltip.js +3 -14
- package/dist/cjs/components/Reactions.js +3 -3
- package/dist/cjs/store/ReactionsStore.js +33 -2
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/analytics/ufo.js +7 -0
- package/dist/es2019/components/ReactionTooltip.js +2 -6
- package/dist/es2019/components/Reactions.js +3 -3
- package/dist/es2019/store/ReactionsStore.js +31 -2
- package/dist/es2019/version.json +1 -1
- package/dist/esm/analytics/ufo.js +7 -0
- package/dist/esm/components/ReactionTooltip.js +2 -7
- package/dist/esm/components/Reactions.js +3 -3
- package/dist/esm/store/ReactionsStore.js +33 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/analytics/ufo.d.ts +8 -2
- package/dist/types/client/ReactionClient.d.ts +14 -0
- package/dist/types/components/ReactionTooltip.d.ts +1 -0
- package/dist/types/store/ReactionsStore.d.ts +13 -0
- package/package.json +5 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,24 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 21.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`7f1dd280229`](https://bitbucket.org/atlassian/atlassian-frontend/commits/7f1dd280229) - Fix styling issue in the reaction emoji while hovering on it for the first time
|
|
8
|
+
|
|
9
|
+
## 21.3.2
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`1940b04de7d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1940b04de7d) - Adding new UFO experience for contents list of reacted users should be able to be fetched reliably
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
16
|
+
## 21.3.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies
|
|
21
|
+
|
|
3
22
|
## 21.3.0
|
|
4
23
|
|
|
5
24
|
### Minor Changes
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.ReactionsRendered = exports.ReactionsRemove = exports.ReactionsAdd = exports.PickerRender = exports.ExperienceName = exports.ComponentName = void 0;
|
|
6
|
+
exports.ReactionsRendered = exports.ReactionsRemove = exports.ReactionsAdd = exports.ReactionDetailsFetch = exports.PickerRender = exports.ExperienceName = exports.ComponentName = void 0;
|
|
7
7
|
|
|
8
8
|
var _ufo = require("@atlaskit/ufo");
|
|
9
9
|
|
|
@@ -37,6 +37,7 @@ exports.ExperienceName = ExperienceName;
|
|
|
37
37
|
ExperienceName["PICKER_OPENED"] = "reactions-picker-opened";
|
|
38
38
|
ExperienceName["REACTION_ADDED"] = "reaction-added";
|
|
39
39
|
ExperienceName["REACTION_REMOVED"] = "reaction-removed";
|
|
40
|
+
ExperienceName["REACTION_DETAILS_FETCHED"] = "reaction-details-fetched";
|
|
40
41
|
})(ExperienceName || (exports.ExperienceName = ExperienceName = {}));
|
|
41
42
|
|
|
42
43
|
var ComponentName;
|
|
@@ -49,6 +50,7 @@ exports.ComponentName = ComponentName;
|
|
|
49
50
|
(function (ComponentName) {
|
|
50
51
|
ComponentName["PICKER_RENDERED"] = "reactions-picker";
|
|
51
52
|
ComponentName["REACTIONS"] = "reactions-list";
|
|
53
|
+
ComponentName["REACTION_ITEM"] = "reaction-item";
|
|
52
54
|
})(ComponentName || (exports.ComponentName = ComponentName = {}));
|
|
53
55
|
|
|
54
56
|
var PickerRender = new _ufo.UFOExperience(ExperienceName.PICKER_OPENED, createExperienceConfig(ComponentName.PICKER_RENDERED, _ufo.ExperienceTypes.Experience, _ufo.ExperiencePerformanceTypes.InlineResult));
|
|
@@ -65,9 +67,15 @@ var ReactionsRendered = new _ufo.ConcurrentExperience(ExperienceName.REACTIONS_R
|
|
|
65
67
|
exports.ReactionsRendered = ReactionsRendered;
|
|
66
68
|
var ReactionsAdd = new _ufo.ConcurrentExperience(ExperienceName.REACTION_ADDED, createExperienceConfig(ComponentName.REACTIONS, _ufo.ExperienceTypes.Experience, _ufo.ExperiencePerformanceTypes.InlineResult));
|
|
67
69
|
/**
|
|
68
|
-
* Experience when a reaction
|
|
70
|
+
* Experience when a reaction details gets fetched
|
|
69
71
|
*/
|
|
70
72
|
|
|
71
73
|
exports.ReactionsAdd = ReactionsAdd;
|
|
74
|
+
var ReactionDetailsFetch = new _ufo.ConcurrentExperience(ExperienceName.REACTION_DETAILS_FETCHED, createExperienceConfig(ComponentName.REACTION_ITEM, _ufo.ExperienceTypes.Experience, _ufo.ExperiencePerformanceTypes.InlineResult));
|
|
75
|
+
/**
|
|
76
|
+
* Experience when a reaction emoji gets removed/decrement
|
|
77
|
+
*/
|
|
78
|
+
|
|
79
|
+
exports.ReactionDetailsFetch = ReactionDetailsFetch;
|
|
72
80
|
var ReactionsRemove = new _ufo.ConcurrentExperience(ExperienceName.REACTION_REMOVED, createExperienceConfig(ComponentName.REACTIONS, _ufo.ExperienceTypes.Experience, _ufo.ExperiencePerformanceTypes.InlineResult));
|
|
73
81
|
exports.ReactionsRemove = ReactionsRemove;
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
4
|
|
|
5
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
-
|
|
7
5
|
Object.defineProperty(exports, "__esModule", {
|
|
8
6
|
value: true
|
|
9
7
|
});
|
|
@@ -11,12 +9,12 @@ exports.ReactionTooltip = void 0;
|
|
|
11
9
|
|
|
12
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
13
11
|
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
|
|
14
14
|
var _core = require("@emotion/core");
|
|
15
15
|
|
|
16
16
|
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
17
17
|
|
|
18
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
19
|
-
|
|
20
18
|
var _reactIntlNext = require("react-intl-next");
|
|
21
19
|
|
|
22
20
|
var _tokens = require("@atlaskit/tokens");
|
|
@@ -25,10 +23,6 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
25
23
|
|
|
26
24
|
var _i18n = require("./i18n");
|
|
27
25
|
|
|
28
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
29
|
-
|
|
30
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
|
-
|
|
32
26
|
/** @jsx jsx */
|
|
33
27
|
var verticalMargin = 5;
|
|
34
28
|
var tooltipStyle = (0, _core.css)({
|
|
@@ -64,12 +58,7 @@ var ReactionTooltip = function ReactionTooltip(_ref) {
|
|
|
64
58
|
var emojiName = _ref.emojiName,
|
|
65
59
|
children = _ref.children,
|
|
66
60
|
users = _ref.reaction.users;
|
|
67
|
-
|
|
68
|
-
if (!users || users.length === 0) {
|
|
69
|
-
return (0, _core.jsx)(_react.Fragment, null, _react.default.Children.only(children));
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
var content = (0, _core.jsx)("div", {
|
|
61
|
+
var content = !users || users.length === 0 ? null : (0, _core.jsx)("div", {
|
|
73
62
|
css: tooltipStyle
|
|
74
63
|
}, (0, _core.jsx)("ul", null, emojiName ? (0, _core.jsx)("li", {
|
|
75
64
|
css: emojiNameStyle
|
|
@@ -50,7 +50,7 @@ var reactionStyle = (0, _core.css)({
|
|
|
50
50
|
// top margin of 2px to allow spacing between rows when wrapped (paired with top margin in reactionsStyle)
|
|
51
51
|
margin: '2px 4px 0 4px'
|
|
52
52
|
});
|
|
53
|
-
var
|
|
53
|
+
var wrapperStyle = (0, _core.css)({
|
|
54
54
|
display: 'flex',
|
|
55
55
|
flexWrap: 'wrap',
|
|
56
56
|
position: 'relative',
|
|
@@ -58,7 +58,7 @@ var reactionsStyle = (0, _core.css)({
|
|
|
58
58
|
borderRadius: '15px',
|
|
59
59
|
// To allow to row spacing of 2px on wrap, and 0px on first row
|
|
60
60
|
marginTop: '-2px',
|
|
61
|
-
'
|
|
61
|
+
'> :first-of-type > :first-child': {
|
|
62
62
|
marginLeft: 0
|
|
63
63
|
}
|
|
64
64
|
});
|
|
@@ -177,7 +177,7 @@ var ReactionsWithoutAnalytics = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
177
177
|
key: "render",
|
|
178
178
|
value: function render() {
|
|
179
179
|
return (0, _core.jsx)("div", {
|
|
180
|
-
css:
|
|
180
|
+
css: wrapperStyle
|
|
181
181
|
}, this.props.reactions.map(this.renderReaction), this.renderPicker());
|
|
182
182
|
}
|
|
183
183
|
}]);
|
|
@@ -35,9 +35,25 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { va
|
|
|
35
35
|
* Set of all available UFO experiences relating to reaction element
|
|
36
36
|
*/
|
|
37
37
|
var ufoExperiences = {
|
|
38
|
+
/**
|
|
39
|
+
* Experience when a reaction emoji gets added
|
|
40
|
+
*/
|
|
38
41
|
add: Analytics.UFO.ReactionsAdd,
|
|
42
|
+
|
|
43
|
+
/**
|
|
44
|
+
* Experience when a reaction emoji gets removed/decrement
|
|
45
|
+
*/
|
|
39
46
|
remove: Analytics.UFO.ReactionsRemove,
|
|
40
|
-
|
|
47
|
+
|
|
48
|
+
/**
|
|
49
|
+
* Experience when the list of reactions gets rendered
|
|
50
|
+
*/
|
|
51
|
+
render: Analytics.UFO.ReactionsRendered,
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* Experience when a reaction details gets fetched
|
|
55
|
+
*/
|
|
56
|
+
fetchDetails: Analytics.UFO.ReactionDetailsFetch
|
|
41
57
|
};
|
|
42
58
|
exports.ufoExperiences = ufoExperiences;
|
|
43
59
|
|
|
@@ -220,7 +236,22 @@ var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
|
220
236
|
(0, _defineProperty2.default)(this, "toggleReaction", this.withReaction(this.doRemoveReaction, this.doAddReaction));
|
|
221
237
|
(0, _defineProperty2.default)(this, "addReaction", this.withReaction(this.flash, this.doAddReaction));
|
|
222
238
|
(0, _defineProperty2.default)(this, "getDetailedReaction", function (containerAri, ari, emojiId) {
|
|
223
|
-
|
|
239
|
+
var exp = ufoExperiences.fetchDetails.getInstance("".concat(ari, "|").concat(emojiId));
|
|
240
|
+
exp.start();
|
|
241
|
+
|
|
242
|
+
_this.client.getDetailedReaction(containerAri, ari, emojiId).then(function (summary) {
|
|
243
|
+
// ufo get reaction details success
|
|
244
|
+
exp.success();
|
|
245
|
+
|
|
246
|
+
_this.handleDetailedReactionResponse(summary);
|
|
247
|
+
}).catch(function (error) {
|
|
248
|
+
// ufo get reaction details failure
|
|
249
|
+
exp.failure({
|
|
250
|
+
metadata: {
|
|
251
|
+
error: error
|
|
252
|
+
}
|
|
253
|
+
});
|
|
254
|
+
});
|
|
224
255
|
});
|
|
225
256
|
(0, _defineProperty2.default)(this, "getState", function () {
|
|
226
257
|
return _this.state;
|
package/dist/cjs/version.json
CHANGED
|
@@ -32,6 +32,7 @@ export let ExperienceName;
|
|
|
32
32
|
ExperienceName["PICKER_OPENED"] = "reactions-picker-opened";
|
|
33
33
|
ExperienceName["REACTION_ADDED"] = "reaction-added";
|
|
34
34
|
ExperienceName["REACTION_REMOVED"] = "reaction-removed";
|
|
35
|
+
ExperienceName["REACTION_DETAILS_FETCHED"] = "reaction-details-fetched";
|
|
35
36
|
})(ExperienceName || (ExperienceName = {}));
|
|
36
37
|
|
|
37
38
|
export let ComponentName;
|
|
@@ -42,6 +43,7 @@ export let ComponentName;
|
|
|
42
43
|
(function (ComponentName) {
|
|
43
44
|
ComponentName["PICKER_RENDERED"] = "reactions-picker";
|
|
44
45
|
ComponentName["REACTIONS"] = "reactions-list";
|
|
46
|
+
ComponentName["REACTION_ITEM"] = "reaction-item";
|
|
45
47
|
})(ComponentName || (ComponentName = {}));
|
|
46
48
|
|
|
47
49
|
export const PickerRender = new UFOExperience(ExperienceName.PICKER_OPENED, createExperienceConfig(ComponentName.PICKER_RENDERED, ExperienceTypes.Experience, ExperiencePerformanceTypes.InlineResult));
|
|
@@ -55,6 +57,11 @@ export const ReactionsRendered = new ConcurrentExperience(ExperienceName.REACTIO
|
|
|
55
57
|
*/
|
|
56
58
|
|
|
57
59
|
export const ReactionsAdd = new ConcurrentExperience(ExperienceName.REACTION_ADDED, createExperienceConfig(ComponentName.REACTIONS, ExperienceTypes.Experience, ExperiencePerformanceTypes.InlineResult));
|
|
60
|
+
/**
|
|
61
|
+
* Experience when a reaction details gets fetched
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
export const ReactionDetailsFetch = new ConcurrentExperience(ExperienceName.REACTION_DETAILS_FETCHED, createExperienceConfig(ComponentName.REACTION_ITEM, ExperienceTypes.Experience, ExperiencePerformanceTypes.InlineResult));
|
|
58
65
|
/**
|
|
59
66
|
* Experience when a reaction emoji gets removed/decrement
|
|
60
67
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
import React from 'react';
|
|
4
5
|
import { jsx, css } from '@emotion/core';
|
|
5
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
-
import React, { Fragment } from 'react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { token } from '@atlaskit/tokens';
|
|
9
9
|
import { N90 } from '@atlaskit/theme/colors';
|
|
@@ -44,11 +44,7 @@ export const ReactionTooltip = ({
|
|
|
44
44
|
users
|
|
45
45
|
}
|
|
46
46
|
}) => {
|
|
47
|
-
|
|
48
|
-
return jsx(Fragment, null, React.Children.only(children));
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const content = jsx("div", {
|
|
47
|
+
const content = !users || users.length === 0 ? null : jsx("div", {
|
|
52
48
|
css: tooltipStyle
|
|
53
49
|
}, jsx("ul", null, emojiName ? jsx("li", {
|
|
54
50
|
css: emojiNameStyle
|
|
@@ -16,7 +16,7 @@ const reactionStyle = css({
|
|
|
16
16
|
// top margin of 2px to allow spacing between rows when wrapped (paired with top margin in reactionsStyle)
|
|
17
17
|
margin: '2px 4px 0 4px'
|
|
18
18
|
});
|
|
19
|
-
const
|
|
19
|
+
const wrapperStyle = css({
|
|
20
20
|
display: 'flex',
|
|
21
21
|
flexWrap: 'wrap',
|
|
22
22
|
position: 'relative',
|
|
@@ -24,7 +24,7 @@ const reactionsStyle = css({
|
|
|
24
24
|
borderRadius: '15px',
|
|
25
25
|
// To allow to row spacing of 2px on wrap, and 0px on first row
|
|
26
26
|
marginTop: '-2px',
|
|
27
|
-
'
|
|
27
|
+
'> :first-of-type > :first-child': {
|
|
28
28
|
marginLeft: 0
|
|
29
29
|
}
|
|
30
30
|
});
|
|
@@ -134,7 +134,7 @@ export class ReactionsWithoutAnalytics extends React.PureComponent {
|
|
|
134
134
|
|
|
135
135
|
render() {
|
|
136
136
|
return jsx("div", {
|
|
137
|
-
css:
|
|
137
|
+
css: wrapperStyle
|
|
138
138
|
}, this.props.reactions.map(this.renderReaction), this.renderPicker());
|
|
139
139
|
}
|
|
140
140
|
|
|
@@ -9,9 +9,25 @@ import { isRealErrorFromService } from './utils';
|
|
|
9
9
|
* Set of all available UFO experiences relating to reaction element
|
|
10
10
|
*/
|
|
11
11
|
export const ufoExperiences = {
|
|
12
|
+
/**
|
|
13
|
+
* Experience when a reaction emoji gets added
|
|
14
|
+
*/
|
|
12
15
|
add: Analytics.UFO.ReactionsAdd,
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Experience when a reaction emoji gets removed/decrement
|
|
19
|
+
*/
|
|
13
20
|
remove: Analytics.UFO.ReactionsRemove,
|
|
14
|
-
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Experience when the list of reactions gets rendered
|
|
24
|
+
*/
|
|
25
|
+
render: Analytics.UFO.ReactionsRendered,
|
|
26
|
+
|
|
27
|
+
/**
|
|
28
|
+
* Experience when a reaction details gets fetched
|
|
29
|
+
*/
|
|
30
|
+
fetchDetails: Analytics.UFO.ReactionDetailsFetch
|
|
15
31
|
};
|
|
16
32
|
export class MemoryReactionsStore {
|
|
17
33
|
constructor(client, state = {
|
|
@@ -188,7 +204,20 @@ export class MemoryReactionsStore {
|
|
|
188
204
|
_defineProperty(this, "addReaction", this.withReaction(this.flash, this.doAddReaction));
|
|
189
205
|
|
|
190
206
|
_defineProperty(this, "getDetailedReaction", (containerAri, ari, emojiId) => {
|
|
191
|
-
|
|
207
|
+
const exp = ufoExperiences.fetchDetails.getInstance(`${ari}|${emojiId}`);
|
|
208
|
+
exp.start();
|
|
209
|
+
this.client.getDetailedReaction(containerAri, ari, emojiId).then(summary => {
|
|
210
|
+
// ufo get reaction details success
|
|
211
|
+
exp.success();
|
|
212
|
+
this.handleDetailedReactionResponse(summary);
|
|
213
|
+
}).catch(error => {
|
|
214
|
+
// ufo get reaction details failure
|
|
215
|
+
exp.failure({
|
|
216
|
+
metadata: {
|
|
217
|
+
error
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
});
|
|
192
221
|
});
|
|
193
222
|
|
|
194
223
|
_defineProperty(this, "getState", () => this.state);
|
package/dist/es2019/version.json
CHANGED
|
@@ -32,6 +32,7 @@ export var ExperienceName;
|
|
|
32
32
|
ExperienceName["PICKER_OPENED"] = "reactions-picker-opened";
|
|
33
33
|
ExperienceName["REACTION_ADDED"] = "reaction-added";
|
|
34
34
|
ExperienceName["REACTION_REMOVED"] = "reaction-removed";
|
|
35
|
+
ExperienceName["REACTION_DETAILS_FETCHED"] = "reaction-details-fetched";
|
|
35
36
|
})(ExperienceName || (ExperienceName = {}));
|
|
36
37
|
|
|
37
38
|
export var ComponentName;
|
|
@@ -42,6 +43,7 @@ export var ComponentName;
|
|
|
42
43
|
(function (ComponentName) {
|
|
43
44
|
ComponentName["PICKER_RENDERED"] = "reactions-picker";
|
|
44
45
|
ComponentName["REACTIONS"] = "reactions-list";
|
|
46
|
+
ComponentName["REACTION_ITEM"] = "reaction-item";
|
|
45
47
|
})(ComponentName || (ComponentName = {}));
|
|
46
48
|
|
|
47
49
|
export var PickerRender = new UFOExperience(ExperienceName.PICKER_OPENED, createExperienceConfig(ComponentName.PICKER_RENDERED, ExperienceTypes.Experience, ExperiencePerformanceTypes.InlineResult));
|
|
@@ -55,6 +57,11 @@ export var ReactionsRendered = new ConcurrentExperience(ExperienceName.REACTIONS
|
|
|
55
57
|
*/
|
|
56
58
|
|
|
57
59
|
export var ReactionsAdd = new ConcurrentExperience(ExperienceName.REACTION_ADDED, createExperienceConfig(ComponentName.REACTIONS, ExperienceTypes.Experience, ExperiencePerformanceTypes.InlineResult));
|
|
60
|
+
/**
|
|
61
|
+
* Experience when a reaction details gets fetched
|
|
62
|
+
*/
|
|
63
|
+
|
|
64
|
+
export var ReactionDetailsFetch = new ConcurrentExperience(ExperienceName.REACTION_DETAILS_FETCHED, createExperienceConfig(ComponentName.REACTION_ITEM, ExperienceTypes.Experience, ExperiencePerformanceTypes.InlineResult));
|
|
58
65
|
/**
|
|
59
66
|
* Experience when a reaction emoji gets removed/decrement
|
|
60
67
|
*/
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
|
|
3
3
|
/** @jsx jsx */
|
|
4
|
+
import React from 'react';
|
|
4
5
|
import { jsx, css } from '@emotion/core';
|
|
5
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
-
import React, { Fragment } from 'react';
|
|
7
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
8
|
import { token } from '@atlaskit/tokens';
|
|
9
9
|
import { N90 } from '@atlaskit/theme/colors';
|
|
@@ -41,12 +41,7 @@ export var ReactionTooltip = function ReactionTooltip(_ref) {
|
|
|
41
41
|
var emojiName = _ref.emojiName,
|
|
42
42
|
children = _ref.children,
|
|
43
43
|
users = _ref.reaction.users;
|
|
44
|
-
|
|
45
|
-
if (!users || users.length === 0) {
|
|
46
|
-
return jsx(Fragment, null, React.Children.only(children));
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
var content = jsx("div", {
|
|
44
|
+
var content = !users || users.length === 0 ? null : jsx("div", {
|
|
50
45
|
css: tooltipStyle
|
|
51
46
|
}, jsx("ul", null, emojiName ? jsx("li", {
|
|
52
47
|
css: emojiNameStyle
|
|
@@ -26,7 +26,7 @@ var reactionStyle = css({
|
|
|
26
26
|
// top margin of 2px to allow spacing between rows when wrapped (paired with top margin in reactionsStyle)
|
|
27
27
|
margin: '2px 4px 0 4px'
|
|
28
28
|
});
|
|
29
|
-
var
|
|
29
|
+
var wrapperStyle = css({
|
|
30
30
|
display: 'flex',
|
|
31
31
|
flexWrap: 'wrap',
|
|
32
32
|
position: 'relative',
|
|
@@ -34,7 +34,7 @@ var reactionsStyle = css({
|
|
|
34
34
|
borderRadius: '15px',
|
|
35
35
|
// To allow to row spacing of 2px on wrap, and 0px on first row
|
|
36
36
|
marginTop: '-2px',
|
|
37
|
-
'
|
|
37
|
+
'> :first-of-type > :first-child': {
|
|
38
38
|
marginLeft: 0
|
|
39
39
|
}
|
|
40
40
|
});
|
|
@@ -162,7 +162,7 @@ export var ReactionsWithoutAnalytics = /*#__PURE__*/function (_React$PureCompone
|
|
|
162
162
|
key: "render",
|
|
163
163
|
value: function render() {
|
|
164
164
|
return jsx("div", {
|
|
165
|
-
css:
|
|
165
|
+
css: wrapperStyle
|
|
166
166
|
}, this.props.reactions.map(this.renderReaction), this.renderPicker());
|
|
167
167
|
}
|
|
168
168
|
}]);
|
|
@@ -16,9 +16,25 @@ import { isRealErrorFromService } from './utils';
|
|
|
16
16
|
* Set of all available UFO experiences relating to reaction element
|
|
17
17
|
*/
|
|
18
18
|
export var ufoExperiences = {
|
|
19
|
+
/**
|
|
20
|
+
* Experience when a reaction emoji gets added
|
|
21
|
+
*/
|
|
19
22
|
add: Analytics.UFO.ReactionsAdd,
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Experience when a reaction emoji gets removed/decrement
|
|
26
|
+
*/
|
|
20
27
|
remove: Analytics.UFO.ReactionsRemove,
|
|
21
|
-
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* Experience when the list of reactions gets rendered
|
|
31
|
+
*/
|
|
32
|
+
render: Analytics.UFO.ReactionsRendered,
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Experience when a reaction details gets fetched
|
|
36
|
+
*/
|
|
37
|
+
fetchDetails: Analytics.UFO.ReactionDetailsFetch
|
|
22
38
|
};
|
|
23
39
|
export var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
24
40
|
function MemoryReactionsStore(client) {
|
|
@@ -214,7 +230,22 @@ export var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
|
214
230
|
_defineProperty(this, "addReaction", this.withReaction(this.flash, this.doAddReaction));
|
|
215
231
|
|
|
216
232
|
_defineProperty(this, "getDetailedReaction", function (containerAri, ari, emojiId) {
|
|
217
|
-
|
|
233
|
+
var exp = ufoExperiences.fetchDetails.getInstance("".concat(ari, "|").concat(emojiId));
|
|
234
|
+
exp.start();
|
|
235
|
+
|
|
236
|
+
_this.client.getDetailedReaction(containerAri, ari, emojiId).then(function (summary) {
|
|
237
|
+
// ufo get reaction details success
|
|
238
|
+
exp.success();
|
|
239
|
+
|
|
240
|
+
_this.handleDetailedReactionResponse(summary);
|
|
241
|
+
}).catch(function (error) {
|
|
242
|
+
// ufo get reaction details failure
|
|
243
|
+
exp.failure({
|
|
244
|
+
metadata: {
|
|
245
|
+
error: error
|
|
246
|
+
}
|
|
247
|
+
});
|
|
248
|
+
});
|
|
218
249
|
});
|
|
219
250
|
|
|
220
251
|
_defineProperty(this, "getState", function () {
|
package/dist/esm/version.json
CHANGED
|
@@ -6,14 +6,16 @@ export declare enum ExperienceName {
|
|
|
6
6
|
REACTIONS_RENDERED = "reactions-rendered",
|
|
7
7
|
PICKER_OPENED = "reactions-picker-opened",
|
|
8
8
|
REACTION_ADDED = "reaction-added",
|
|
9
|
-
REACTION_REMOVED = "reaction-removed"
|
|
9
|
+
REACTION_REMOVED = "reaction-removed",
|
|
10
|
+
REACTION_DETAILS_FETCHED = "reaction-details-fetched"
|
|
10
11
|
}
|
|
11
12
|
/**
|
|
12
13
|
* UFO types of components been instrumented
|
|
13
14
|
*/
|
|
14
15
|
export declare enum ComponentName {
|
|
15
16
|
PICKER_RENDERED = "reactions-picker",
|
|
16
|
-
REACTIONS = "reactions-list"
|
|
17
|
+
REACTIONS = "reactions-list",
|
|
18
|
+
REACTION_ITEM = "reaction-item"
|
|
17
19
|
}
|
|
18
20
|
/**
|
|
19
21
|
* Experience when the emoji picker is opened
|
|
@@ -27,6 +29,10 @@ export declare const ReactionsRendered: ConcurrentExperience;
|
|
|
27
29
|
* Experience when a reaction emoji gets added
|
|
28
30
|
*/
|
|
29
31
|
export declare const ReactionsAdd: ConcurrentExperience;
|
|
32
|
+
/**
|
|
33
|
+
* Experience when a reaction details gets fetched
|
|
34
|
+
*/
|
|
35
|
+
export declare const ReactionDetailsFetch: ConcurrentExperience;
|
|
30
36
|
/**
|
|
31
37
|
* Experience when a reaction emoji gets removed/decrement
|
|
32
38
|
*/
|
|
@@ -4,8 +4,22 @@ export declare type ReactionRequest<T> = (containerAri: string, ari: string, emo
|
|
|
4
4
|
[k: string]: any;
|
|
5
5
|
}) => Promise<T>;
|
|
6
6
|
export interface ReactionClient {
|
|
7
|
+
/**
|
|
8
|
+
* Fetch list of reactions for a given ARI.
|
|
9
|
+
* @param containerAri F
|
|
10
|
+
* @param aris
|
|
11
|
+
*/
|
|
7
12
|
getReactions(containerAri: string, aris: string[]): Promise<Reactions>;
|
|
13
|
+
/**
|
|
14
|
+
* Fetch details for a given reaction.
|
|
15
|
+
*/
|
|
8
16
|
getDetailedReaction: ReactionRequest<ReactionSummary>;
|
|
17
|
+
/**
|
|
18
|
+
* Fetch request when adding a reaction to a container.
|
|
19
|
+
*/
|
|
9
20
|
addReaction: ReactionRequest<ReactionSummary[]>;
|
|
21
|
+
/**
|
|
22
|
+
* Fetch request when removing a reaction from a container.
|
|
23
|
+
*/
|
|
10
24
|
deleteReaction: ReactionRequest<ReactionSummary[]>;
|
|
11
25
|
}
|
|
@@ -20,9 +20,22 @@ export interface StoreMetadata {
|
|
|
20
20
|
* Set of all available UFO experiences relating to reaction element
|
|
21
21
|
*/
|
|
22
22
|
export declare const ufoExperiences: {
|
|
23
|
+
/**
|
|
24
|
+
* Experience when a reaction emoji gets added
|
|
25
|
+
*/
|
|
23
26
|
add: import("@atlaskit/ufo").ConcurrentExperience;
|
|
27
|
+
/**
|
|
28
|
+
* Experience when a reaction emoji gets removed/decrement
|
|
29
|
+
*/
|
|
24
30
|
remove: import("@atlaskit/ufo").ConcurrentExperience;
|
|
31
|
+
/**
|
|
32
|
+
* Experience when the list of reactions gets rendered
|
|
33
|
+
*/
|
|
25
34
|
render: import("@atlaskit/ufo").ConcurrentExperience;
|
|
35
|
+
/**
|
|
36
|
+
* Experience when a reaction details gets fetched
|
|
37
|
+
*/
|
|
38
|
+
fetchDetails: import("@atlaskit/ufo").ConcurrentExperience;
|
|
26
39
|
};
|
|
27
40
|
export interface ReactionsStore extends Types.Actions {
|
|
28
41
|
getState: () => State;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/reactions",
|
|
3
|
-
"version": "21.3.
|
|
3
|
+
"version": "21.3.3",
|
|
4
4
|
"description": "Reactions component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -30,12 +30,12 @@
|
|
|
30
30
|
"@atlaskit/analytics-next": "^8.2.0",
|
|
31
31
|
"@atlaskit/button": "^16.3.0",
|
|
32
32
|
"@atlaskit/ds-lib": "^1.4.0",
|
|
33
|
-
"@atlaskit/emoji": "^64.
|
|
33
|
+
"@atlaskit/emoji": "^64.7.0",
|
|
34
34
|
"@atlaskit/icon": "^21.10.0",
|
|
35
|
-
"@atlaskit/motion": "^1.0
|
|
35
|
+
"@atlaskit/motion": "^1.1.0",
|
|
36
36
|
"@atlaskit/popper": "^5.0.0",
|
|
37
37
|
"@atlaskit/theme": "^12.1.0",
|
|
38
|
-
"@atlaskit/tokens": "^0.
|
|
38
|
+
"@atlaskit/tokens": "^0.10.0",
|
|
39
39
|
"@atlaskit/tooltip": "^17.5.0",
|
|
40
40
|
"@atlaskit/ufo": "^0.1.0",
|
|
41
41
|
"@atlaskit/util-service-support": "^6.1.0",
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
"@atlaskit/editor-test-helpers": "^17.0.0",
|
|
54
54
|
"@atlaskit/elements-test-helpers": "^0.7.0",
|
|
55
55
|
"@atlaskit/tooltip": "^17.5.0",
|
|
56
|
-
"@atlaskit/util-data-test": "^17.
|
|
56
|
+
"@atlaskit/util-data-test": "^17.3.0",
|
|
57
57
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
58
58
|
"@atlassian/ufo": "^0.1.0",
|
|
59
59
|
"@types/webpack-dev-server": "^3.11.2",
|