@atlaskit/reactions 19.1.4 → 21.0.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 +68 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/client/MockReactionsClient.js +2 -2
- package/dist/cjs/client/ReactionServiceClient.js +10 -6
- package/dist/cjs/components/Counter.js +5 -3
- package/dist/cjs/components/FlashAnimation.js +9 -4
- package/dist/cjs/components/Reaction.js +18 -5
- package/dist/cjs/components/ReactionPicker.js +5 -7
- package/dist/cjs/components/ReactionTooltip.js +25 -7
- package/dist/cjs/components/Reactions.js +4 -4
- package/dist/cjs/components/Selector.js +3 -3
- package/dist/cjs/components/ShowMore.js +6 -4
- package/dist/cjs/components/i18n.js +7 -2
- package/dist/cjs/components/utils.js +1 -1
- package/dist/cjs/i18n/en.js +2 -1
- package/dist/cjs/i18n/en_GB.js +2 -1
- package/dist/cjs/i18n/index.js +36 -36
- package/dist/cjs/index.js +16 -16
- package/dist/cjs/reaction-store/ReactionsStore.js +4 -2
- package/dist/cjs/reaction-store/index.js +4 -4
- package/dist/cjs/reaction-store/utils.js +2 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/client/MockReactionsClient.js +1 -1
- package/dist/es2019/client/ReactionServiceClient.js +10 -4
- package/dist/es2019/components/Counter.js +3 -2
- package/dist/es2019/components/FlashAnimation.js +8 -4
- package/dist/es2019/components/Reaction.js +20 -6
- package/dist/es2019/components/ReactionPicker.js +4 -7
- package/dist/es2019/components/ReactionTooltip.js +20 -7
- package/dist/es2019/components/Reactions.js +1 -1
- package/dist/es2019/components/Selector.js +2 -2
- package/dist/es2019/components/ShowMore.js +4 -3
- package/dist/es2019/components/i18n.js +6 -1
- package/dist/es2019/i18n/en.js +2 -1
- package/dist/es2019/i18n/en_GB.js +2 -1
- package/dist/es2019/reaction-store/ReactionsStore.js +4 -3
- package/dist/es2019/version.json +1 -1
- package/dist/esm/client/MockReactionsClient.js +1 -1
- package/dist/esm/client/ReactionServiceClient.js +10 -6
- package/dist/esm/components/Counter.js +3 -2
- package/dist/esm/components/FlashAnimation.js +8 -4
- package/dist/esm/components/Reaction.js +18 -6
- package/dist/esm/components/ReactionPicker.js +4 -7
- package/dist/esm/components/ReactionTooltip.js +20 -7
- package/dist/esm/components/Reactions.js +1 -1
- package/dist/esm/components/Selector.js +2 -2
- package/dist/esm/components/ShowMore.js +4 -3
- package/dist/esm/components/i18n.js +6 -1
- package/dist/esm/i18n/en.js +2 -1
- package/dist/esm/i18n/en_GB.js +2 -1
- package/dist/esm/reaction-store/ReactionsStore.js +4 -2
- package/dist/esm/version.json +1 -1
- package/dist/types/client/ReactionClient.d.ts +3 -1
- package/dist/types/client/ReactionServiceClient.d.ts +6 -2
- package/dist/types/components/i18n.d.ts +5 -0
- package/dist/types/i18n/en.d.ts +1 -0
- package/dist/types/i18n/en_GB.d.ts +1 -0
- package/dist/types/reaction-store/ReactionsStore.d.ts +6 -1
- package/package.json +14 -10
package/dist/cjs/i18n/index.js
CHANGED
|
@@ -5,34 +5,40 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
Object.defineProperty(exports, "
|
|
8
|
+
Object.defineProperty(exports, "cs", {
|
|
9
9
|
enumerable: true,
|
|
10
10
|
get: function get() {
|
|
11
|
-
return
|
|
11
|
+
return _cs.default;
|
|
12
12
|
}
|
|
13
13
|
});
|
|
14
|
-
Object.defineProperty(exports, "
|
|
14
|
+
Object.defineProperty(exports, "da", {
|
|
15
15
|
enumerable: true,
|
|
16
16
|
get: function get() {
|
|
17
|
-
return
|
|
17
|
+
return _da.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
-
Object.defineProperty(exports, "
|
|
20
|
+
Object.defineProperty(exports, "de", {
|
|
21
21
|
enumerable: true,
|
|
22
22
|
get: function get() {
|
|
23
|
-
return
|
|
23
|
+
return _de.default;
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
|
-
Object.defineProperty(exports, "
|
|
26
|
+
Object.defineProperty(exports, "en", {
|
|
27
27
|
enumerable: true,
|
|
28
28
|
get: function get() {
|
|
29
|
-
return
|
|
29
|
+
return _en.default;
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
|
-
Object.defineProperty(exports, "
|
|
32
|
+
Object.defineProperty(exports, "en_GB", {
|
|
33
33
|
enumerable: true,
|
|
34
34
|
get: function get() {
|
|
35
|
-
return
|
|
35
|
+
return _en_GB.default;
|
|
36
|
+
}
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "es", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function get() {
|
|
41
|
+
return _es.default;
|
|
36
42
|
}
|
|
37
43
|
});
|
|
38
44
|
Object.defineProperty(exports, "et", {
|
|
@@ -53,16 +59,16 @@ Object.defineProperty(exports, "fr", {
|
|
|
53
59
|
return _fr.default;
|
|
54
60
|
}
|
|
55
61
|
});
|
|
56
|
-
Object.defineProperty(exports, "
|
|
62
|
+
Object.defineProperty(exports, "hu", {
|
|
57
63
|
enumerable: true,
|
|
58
64
|
get: function get() {
|
|
59
|
-
return
|
|
65
|
+
return _hu.default;
|
|
60
66
|
}
|
|
61
67
|
});
|
|
62
|
-
Object.defineProperty(exports, "
|
|
68
|
+
Object.defineProperty(exports, "is", {
|
|
63
69
|
enumerable: true,
|
|
64
70
|
get: function get() {
|
|
65
|
-
return
|
|
71
|
+
return _is.default;
|
|
66
72
|
}
|
|
67
73
|
});
|
|
68
74
|
Object.defineProperty(exports, "it", {
|
|
@@ -89,6 +95,12 @@ Object.defineProperty(exports, "nb", {
|
|
|
89
95
|
return _nb.default;
|
|
90
96
|
}
|
|
91
97
|
});
|
|
98
|
+
Object.defineProperty(exports, "nl", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function get() {
|
|
101
|
+
return _nl.default;
|
|
102
|
+
}
|
|
103
|
+
});
|
|
92
104
|
Object.defineProperty(exports, "pl", {
|
|
93
105
|
enumerable: true,
|
|
94
106
|
get: function get() {
|
|
@@ -107,22 +119,22 @@ Object.defineProperty(exports, "pt_PT", {
|
|
|
107
119
|
return _pt_PT.default;
|
|
108
120
|
}
|
|
109
121
|
});
|
|
110
|
-
Object.defineProperty(exports, "
|
|
122
|
+
Object.defineProperty(exports, "ro", {
|
|
111
123
|
enumerable: true,
|
|
112
124
|
get: function get() {
|
|
113
|
-
return
|
|
125
|
+
return _ro.default;
|
|
114
126
|
}
|
|
115
127
|
});
|
|
116
|
-
Object.defineProperty(exports, "
|
|
128
|
+
Object.defineProperty(exports, "ru", {
|
|
117
129
|
enumerable: true,
|
|
118
130
|
get: function get() {
|
|
119
|
-
return
|
|
131
|
+
return _ru.default;
|
|
120
132
|
}
|
|
121
133
|
});
|
|
122
|
-
Object.defineProperty(exports, "
|
|
134
|
+
Object.defineProperty(exports, "sk", {
|
|
123
135
|
enumerable: true,
|
|
124
136
|
get: function get() {
|
|
125
|
-
return
|
|
137
|
+
return _sk.default;
|
|
126
138
|
}
|
|
127
139
|
});
|
|
128
140
|
Object.defineProperty(exports, "sv", {
|
|
@@ -155,28 +167,16 @@ Object.defineProperty(exports, "vi", {
|
|
|
155
167
|
return _vi.default;
|
|
156
168
|
}
|
|
157
169
|
});
|
|
158
|
-
Object.defineProperty(exports, "
|
|
159
|
-
enumerable: true,
|
|
160
|
-
get: function get() {
|
|
161
|
-
return _en.default;
|
|
162
|
-
}
|
|
163
|
-
});
|
|
164
|
-
Object.defineProperty(exports, "en_GB", {
|
|
165
|
-
enumerable: true,
|
|
166
|
-
get: function get() {
|
|
167
|
-
return _en_GB.default;
|
|
168
|
-
}
|
|
169
|
-
});
|
|
170
|
-
Object.defineProperty(exports, "is", {
|
|
170
|
+
Object.defineProperty(exports, "zh", {
|
|
171
171
|
enumerable: true,
|
|
172
172
|
get: function get() {
|
|
173
|
-
return
|
|
173
|
+
return _zh.default;
|
|
174
174
|
}
|
|
175
175
|
});
|
|
176
|
-
Object.defineProperty(exports, "
|
|
176
|
+
Object.defineProperty(exports, "zh_TW", {
|
|
177
177
|
enumerable: true,
|
|
178
178
|
get: function get() {
|
|
179
|
-
return
|
|
179
|
+
return _zh_TW.default;
|
|
180
180
|
}
|
|
181
181
|
});
|
|
182
182
|
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,52 +3,52 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "ConnectedReactionPicker", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _containers.ConnectedReactionPicker;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "ConnectedReactionsView", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _containers.ConnectedReactionsView;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
|
-
Object.defineProperty(exports, "
|
|
18
|
+
Object.defineProperty(exports, "MemoryReactionsStore", {
|
|
19
19
|
enumerable: true,
|
|
20
20
|
get: function get() {
|
|
21
|
-
return
|
|
21
|
+
return _reactionStore.MemoryReactionsStore;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
Object.defineProperty(exports, "
|
|
24
|
+
Object.defineProperty(exports, "Reaction", {
|
|
25
25
|
enumerable: true,
|
|
26
26
|
get: function get() {
|
|
27
|
-
return _components.
|
|
27
|
+
return _components.Reaction;
|
|
28
28
|
}
|
|
29
29
|
});
|
|
30
|
-
Object.defineProperty(exports, "
|
|
30
|
+
Object.defineProperty(exports, "ReactionConsumer", {
|
|
31
31
|
enumerable: true,
|
|
32
32
|
get: function get() {
|
|
33
|
-
return
|
|
33
|
+
return _reactionStore.ReactionConsumer;
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
|
-
Object.defineProperty(exports, "
|
|
36
|
+
Object.defineProperty(exports, "ReactionPicker", {
|
|
37
37
|
enumerable: true,
|
|
38
38
|
get: function get() {
|
|
39
|
-
return
|
|
39
|
+
return _components.ReactionPicker;
|
|
40
40
|
}
|
|
41
41
|
});
|
|
42
|
-
Object.defineProperty(exports, "
|
|
42
|
+
Object.defineProperty(exports, "ReactionServiceClient", {
|
|
43
43
|
enumerable: true,
|
|
44
44
|
get: function get() {
|
|
45
|
-
return
|
|
45
|
+
return _client.ReactionServiceClient;
|
|
46
46
|
}
|
|
47
47
|
});
|
|
48
|
-
Object.defineProperty(exports, "
|
|
48
|
+
Object.defineProperty(exports, "Reactions", {
|
|
49
49
|
enumerable: true,
|
|
50
50
|
get: function get() {
|
|
51
|
-
return
|
|
51
|
+
return _components.Reactions;
|
|
52
52
|
}
|
|
53
53
|
});
|
|
54
54
|
|
|
@@ -39,6 +39,7 @@ var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
|
39
39
|
reactions: {},
|
|
40
40
|
flash: {}
|
|
41
41
|
};
|
|
42
|
+
var metadata = arguments.length > 2 ? arguments[2] : undefined;
|
|
42
43
|
(0, _classCallCheck2.default)(this, MemoryReactionsStore);
|
|
43
44
|
(0, _defineProperty2.default)(this, "callbacks", []);
|
|
44
45
|
(0, _defineProperty2.default)(this, "setState", function (newState) {
|
|
@@ -122,7 +123,7 @@ var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
|
122
123
|
|
|
123
124
|
_this.flash(reaction);
|
|
124
125
|
|
|
125
|
-
_this.client.addReaction(containerAri, ari, emojiId).then(function (
|
|
126
|
+
_this.client.addReaction(containerAri, ari, emojiId, _this.metadata).then(function (_) {
|
|
126
127
|
if (_this.createAnalyticsEvent) {
|
|
127
128
|
(0, _analytics.createAndFireSafe)(_this.createAnalyticsEvent, _analytics.createRestSucceededEvent, 'addReaction');
|
|
128
129
|
}
|
|
@@ -141,7 +142,7 @@ var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
|
141
142
|
|
|
142
143
|
_this.optmisticUpdate(containerAri, ari, emojiId)(utils.removeOne);
|
|
143
144
|
|
|
144
|
-
_this.client.deleteReaction(containerAri, ari, emojiId);
|
|
145
|
+
_this.client.deleteReaction(containerAri, ari, emojiId, _this.metadata);
|
|
145
146
|
});
|
|
146
147
|
(0, _defineProperty2.default)(this, "setCreateAnalyticsEvent", function (createAnalyticsEvent) {
|
|
147
148
|
_this.createAnalyticsEvent = createAnalyticsEvent;
|
|
@@ -185,6 +186,7 @@ var MemoryReactionsStore = /*#__PURE__*/function () {
|
|
|
185
186
|
});
|
|
186
187
|
this.client = client;
|
|
187
188
|
this.state = state;
|
|
189
|
+
this.metadata = metadata;
|
|
188
190
|
}
|
|
189
191
|
|
|
190
192
|
(0, _createClass2.default)(MemoryReactionsStore, [{
|
|
@@ -3,16 +3,16 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
Object.defineProperty(exports, "
|
|
6
|
+
Object.defineProperty(exports, "MemoryReactionsStore", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return
|
|
9
|
+
return _ReactionsStore.MemoryReactionsStore;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "ReactionConsumer", {
|
|
13
13
|
enumerable: true,
|
|
14
14
|
get: function get() {
|
|
15
|
-
return
|
|
15
|
+
return _ReactionConsumer.ReactionConsumer;
|
|
16
16
|
}
|
|
17
17
|
});
|
|
18
18
|
|
|
@@ -5,8 +5,9 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
+
exports.getReactionsSortFunction = exports.flattenAris = exports.compareEmojiId = exports.byEmojiId = exports.addOne = void 0;
|
|
8
9
|
exports.isRealErrorFromService = isRealErrorFromService;
|
|
9
|
-
exports.
|
|
10
|
+
exports.updateByEmojiId = exports.sortByRelevance = exports.sortByPreviousPosition = exports.removeOne = exports.readyState = void 0;
|
|
10
11
|
|
|
11
12
|
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
|
|
12
13
|
|
package/dist/cjs/version.json
CHANGED
|
@@ -22,7 +22,7 @@ const defaultUsers = [user('oscar', 'Oscar Wallhult'), user('julien', 'Julien Mi
|
|
|
22
22
|
export class MockReactionsClient {
|
|
23
23
|
constructor(delay = 0) {
|
|
24
24
|
_defineProperty(this, "mockData", {
|
|
25
|
-
[objectReactionKey(containerAri, ari)]: [reaction(':fire:', 1, true), reaction(':thumbsup:', 9, false), reaction(':astonished:', 5, false), reaction(':
|
|
25
|
+
[objectReactionKey(containerAri, ari)]: [reaction(':fire:', 1, true), reaction(':thumbsup:', 9, false), reaction(':astonished:', 5, false), reaction(':heart:', 100, false)]
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
_defineProperty(this, "delayPromise", () => new Promise(resolve => window.setTimeout(resolve, this.delay)));
|
|
@@ -59,7 +59,7 @@ export class ReactionServiceClient {
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
addReaction(containerAri, ari, emojiId) {
|
|
62
|
+
addReaction(containerAri, ari, emojiId, metadata) {
|
|
63
63
|
return this.requestService('reactions', {
|
|
64
64
|
requestInit: {
|
|
65
65
|
method: 'POST',
|
|
@@ -67,7 +67,10 @@ export class ReactionServiceClient {
|
|
|
67
67
|
body: JSON.stringify({
|
|
68
68
|
emojiId,
|
|
69
69
|
ari,
|
|
70
|
-
containerAri
|
|
70
|
+
containerAri,
|
|
71
|
+
...(metadata ? {
|
|
72
|
+
metadata: JSON.stringify(metadata)
|
|
73
|
+
} : {})
|
|
71
74
|
}),
|
|
72
75
|
credentials: 'include'
|
|
73
76
|
}
|
|
@@ -76,12 +79,15 @@ export class ReactionServiceClient {
|
|
|
76
79
|
}) => reactions);
|
|
77
80
|
}
|
|
78
81
|
|
|
79
|
-
deleteReaction(containerAri, ari, emojiId) {
|
|
82
|
+
deleteReaction(containerAri, ari, emojiId, metadata) {
|
|
80
83
|
return this.requestService('reactions', {
|
|
81
84
|
queryParams: {
|
|
82
85
|
ari,
|
|
83
86
|
emojiId,
|
|
84
|
-
containerAri
|
|
87
|
+
containerAri,
|
|
88
|
+
...(metadata ? {
|
|
89
|
+
metadata: JSON.stringify(metadata)
|
|
90
|
+
} : {})
|
|
85
91
|
},
|
|
86
92
|
requestInit: {
|
|
87
93
|
method: 'DELETE',
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { N90, B400 } from '@atlaskit/theme/colors';
|
|
3
|
+
import { token } from '@atlaskit/tokens';
|
|
3
4
|
import cx from 'classnames';
|
|
4
5
|
import React from 'react';
|
|
5
6
|
import { CSSTransition } from 'react-transition-group';
|
|
@@ -8,13 +9,13 @@ import { akHeight } from './utils';
|
|
|
8
9
|
const animationTime = 300;
|
|
9
10
|
export const countStyle = style({
|
|
10
11
|
fontSize: '11px',
|
|
11
|
-
color: N90,
|
|
12
|
+
color: token('color.text.lowEmphasis', N90),
|
|
12
13
|
overflow: 'hidden',
|
|
13
14
|
height: `${akHeight}px`,
|
|
14
15
|
transition: `width ${animationTime}ms ease-in-out`
|
|
15
16
|
});
|
|
16
17
|
export const highlightStyle = style({
|
|
17
|
-
color: B400,
|
|
18
|
+
color: token('color.text.selected', B400),
|
|
18
19
|
fontWeight: 600
|
|
19
20
|
});
|
|
20
21
|
export const containerStyle = style({
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { B75 } from '@atlaskit/theme/colors';
|
|
1
|
+
import { B75, B300 } from '@atlaskit/theme/colors';
|
|
2
|
+
import { token } from '@atlaskit/tokens';
|
|
2
3
|
import cx from 'classnames';
|
|
3
4
|
import React from 'react';
|
|
4
5
|
import { keyframes, style } from 'typestyle';
|
|
@@ -12,13 +13,16 @@ const flashAnimation = keyframes({
|
|
|
12
13
|
backgroundColor: 'transparent'
|
|
13
14
|
},
|
|
14
15
|
'20%': {
|
|
15
|
-
backgroundColor: B75
|
|
16
|
+
backgroundColor: token('color.background.selected.pressed', B75),
|
|
17
|
+
borderColor: token('color.iconBorder.brand', B300)
|
|
16
18
|
},
|
|
17
19
|
'75%': {
|
|
18
|
-
backgroundColor: B75
|
|
20
|
+
backgroundColor: token('color.background.selected.pressed', B75),
|
|
21
|
+
borderColor: token('color.iconBorder.brand', B300)
|
|
19
22
|
},
|
|
20
23
|
'100%': {
|
|
21
|
-
backgroundColor: '
|
|
24
|
+
backgroundColor: token('color.background.selected.pressed', B75),
|
|
25
|
+
borderColor: token('color.iconBorder.brand', B300)
|
|
22
26
|
}
|
|
23
27
|
});
|
|
24
28
|
export const flashStyle = style({
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
2
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
3
|
import { ResourcedEmoji } from '@atlaskit/emoji/element';
|
|
4
|
-
import { N20, N40, N400 } from '@atlaskit/theme/colors';
|
|
4
|
+
import { B50, B75, B300, N20, N40, N400 } from '@atlaskit/theme/colors';
|
|
5
|
+
import { token } from '@atlaskit/tokens';
|
|
5
6
|
import cx from 'classnames';
|
|
6
7
|
import React from 'react';
|
|
7
8
|
import { PureComponent } from 'react';
|
|
@@ -30,25 +31,36 @@ const reactionStyle = style({
|
|
|
30
31
|
minWidth: '36px',
|
|
31
32
|
height: `${akHeight}px`,
|
|
32
33
|
background: 'transparent',
|
|
33
|
-
border: `1px solid ${N40}`,
|
|
34
|
+
border: `1px solid ${token('color.border.neutral', N40)}`,
|
|
34
35
|
boxSizing: 'border-box',
|
|
35
36
|
borderRadius: '20px',
|
|
36
|
-
color: `${N400}`,
|
|
37
|
+
color: `${token('color.text.mediumEmphasis', N400)}`,
|
|
37
38
|
cursor: 'pointer',
|
|
38
39
|
margin: 0,
|
|
39
40
|
padding: 0,
|
|
40
41
|
transition: '200ms ease-in-out',
|
|
41
42
|
$nest: {
|
|
42
43
|
'&:hover': {
|
|
43
|
-
background: `${N20}`
|
|
44
|
+
background: `${token('color.background.transparentNeutral.hover', N20)}`
|
|
44
45
|
}
|
|
45
46
|
}
|
|
46
47
|
});
|
|
48
|
+
const reactedStyle = style({
|
|
49
|
+
backgroundColor: token('color.background.selected.resting', B50),
|
|
50
|
+
borderColor: token('color.iconBorder.brand', B300),
|
|
51
|
+
$nest: {
|
|
52
|
+
'&:hover': {
|
|
53
|
+
background: `${token('color.background.selected.hover', B75)}`
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
});
|
|
57
|
+
const flashHeight = akHeight - 2; // height without the 1px border
|
|
58
|
+
|
|
47
59
|
const flashStyle = style({
|
|
48
60
|
display: 'flex',
|
|
49
61
|
flexDirection: 'row',
|
|
50
62
|
borderRadius: '10px',
|
|
51
|
-
height: `${
|
|
63
|
+
height: `${flashHeight}px`
|
|
52
64
|
});
|
|
53
65
|
const counterStyle = style({
|
|
54
66
|
padding: '4px 8px 4px 0',
|
|
@@ -133,7 +145,9 @@ class ReactionWithoutAnalytics extends PureComponent {
|
|
|
133
145
|
const {
|
|
134
146
|
emojiName
|
|
135
147
|
} = this.state;
|
|
136
|
-
const classNames = cx(reactionStyle, classNameProp
|
|
148
|
+
const classNames = cx(reactionStyle, classNameProp, {
|
|
149
|
+
[reactedStyle]: reaction.reacted
|
|
150
|
+
});
|
|
137
151
|
const emojiId = {
|
|
138
152
|
id: reaction.emojiId,
|
|
139
153
|
shortName: ''
|
|
@@ -3,6 +3,7 @@ import { EmojiPicker } from '@atlaskit/emoji/picker';
|
|
|
3
3
|
import { Manager, Popper, Reference } from '@atlaskit/popper';
|
|
4
4
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
5
5
|
import { N0, N50A, N60A } from '@atlaskit/theme/colors';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
6
7
|
import cx from 'classnames';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
import { PureComponent } from 'react';
|
|
@@ -11,10 +12,6 @@ import { style } from 'typestyle';
|
|
|
11
12
|
import { Selector } from './Selector';
|
|
12
13
|
import { Trigger } from './Trigger';
|
|
13
14
|
import { layers } from '@atlaskit/theme/constants';
|
|
14
|
-
const akBorderRadius = `${borderRadius()}px`;
|
|
15
|
-
const akColorN0 = N0;
|
|
16
|
-
const akColorN50A = N50A;
|
|
17
|
-
const akColorN60A = N60A;
|
|
18
15
|
const pickerStyle = style({
|
|
19
16
|
verticalAlign: 'middle',
|
|
20
17
|
$nest: {
|
|
@@ -28,9 +25,9 @@ const contentStyle = style({
|
|
|
28
25
|
display: 'flex'
|
|
29
26
|
});
|
|
30
27
|
const popupStyle = style({
|
|
31
|
-
background:
|
|
32
|
-
borderRadius:
|
|
33
|
-
boxShadow: `0 4px 8px -2px ${
|
|
28
|
+
background: token('color.background.overlay', N0),
|
|
29
|
+
borderRadius: `${borderRadius()}px`,
|
|
30
|
+
boxShadow: token('shadow.overlay', `0 4px 8px -2px ${N50A}, 0 0 1px ${N60A}`),
|
|
34
31
|
$nest: {
|
|
35
32
|
'&> div': {
|
|
36
33
|
boxShadow: undefined
|
|
@@ -1,11 +1,18 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
1
2
|
import Tooltip from '@atlaskit/tooltip';
|
|
2
3
|
import React from 'react';
|
|
4
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
3
5
|
import { style } from 'typestyle';
|
|
6
|
+
import { token } from '@atlaskit/tokens';
|
|
7
|
+
import { N90 } from '@atlaskit/theme/colors';
|
|
8
|
+
import { messages } from './i18n';
|
|
9
|
+
const verticalMargin = 5;
|
|
4
10
|
const tooltipStyle = style({
|
|
5
11
|
maxWidth: '150px',
|
|
6
12
|
textOverflow: 'ellipsis',
|
|
7
13
|
whiteSpace: 'nowrap',
|
|
8
14
|
overflow: 'hidden',
|
|
15
|
+
marginBottom: verticalMargin,
|
|
9
16
|
$nest: {
|
|
10
17
|
ul: {
|
|
11
18
|
listStyle: 'none',
|
|
@@ -16,16 +23,18 @@ const tooltipStyle = style({
|
|
|
16
23
|
li: {
|
|
17
24
|
overflow: 'hidden',
|
|
18
25
|
textOverflow: 'ellipsis',
|
|
19
|
-
marginTop:
|
|
26
|
+
marginTop: verticalMargin
|
|
20
27
|
}
|
|
21
28
|
}
|
|
22
29
|
});
|
|
23
30
|
const emojiNameStyle = style({
|
|
24
31
|
textTransform: 'capitalize',
|
|
25
|
-
|
|
32
|
+
color: token('color.text.mediumEmphasis', N90),
|
|
33
|
+
fontWeight: 600
|
|
26
34
|
});
|
|
27
35
|
const footerStyle = style({
|
|
28
|
-
|
|
36
|
+
color: token('color.text.mediumEmphasis', N90),
|
|
37
|
+
fontWeight: 300
|
|
29
38
|
});
|
|
30
39
|
const TOOLTIP_USERS_LIMIT = 5;
|
|
31
40
|
export const ReactionTooltip = ({
|
|
@@ -41,15 +50,19 @@ export const ReactionTooltip = ({
|
|
|
41
50
|
|
|
42
51
|
const content = /*#__PURE__*/React.createElement("div", {
|
|
43
52
|
className: tooltipStyle
|
|
44
|
-
}, emojiName ? /*#__PURE__*/React.createElement("
|
|
53
|
+
}, /*#__PURE__*/React.createElement("ul", null, emojiName ? /*#__PURE__*/React.createElement("li", {
|
|
45
54
|
className: emojiNameStyle
|
|
46
|
-
}, emojiName) : null,
|
|
55
|
+
}, emojiName) : null, users.slice(0, TOOLTIP_USERS_LIMIT).map((user, index) => {
|
|
47
56
|
return /*#__PURE__*/React.createElement("li", {
|
|
48
57
|
key: index
|
|
49
58
|
}, user.displayName);
|
|
50
|
-
})
|
|
59
|
+
}), users.length > TOOLTIP_USERS_LIMIT ? /*#__PURE__*/React.createElement("li", {
|
|
51
60
|
className: footerStyle
|
|
52
|
-
},
|
|
61
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages.otherUsers, {
|
|
62
|
+
values: {
|
|
63
|
+
count: users.length - TOOLTIP_USERS_LIMIT
|
|
64
|
+
}
|
|
65
|
+
}))) : null));
|
|
53
66
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
54
67
|
content: content,
|
|
55
68
|
position: "bottom"
|
|
@@ -2,7 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import { withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
3
3
|
import Tooltip from '@atlaskit/tooltip';
|
|
4
4
|
import React from 'react';
|
|
5
|
-
import { FormattedMessage } from 'react-intl';
|
|
5
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import { style } from 'typestyle';
|
|
7
7
|
import { createAndFireSafe, createPickerButtonClickedEvent, createPickerCancelledEvent, createPickerMoreClickedEvent, createReactionSelectionEvent, createReactionsRenderedEvent } from '../analytics';
|
|
8
8
|
import { ReactionStatus } from '../types/ReactionStatus';
|
|
@@ -2,12 +2,13 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
import EditorMoreIcon from '@atlaskit/icon/glyph/editor/more';
|
|
3
3
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
4
4
|
import { N30A } from '@atlaskit/theme/colors';
|
|
5
|
+
import { token } from '@atlaskit/tokens';
|
|
5
6
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
7
|
import cx from 'classnames';
|
|
7
8
|
import React from 'react';
|
|
8
9
|
import { style } from 'typestyle';
|
|
9
10
|
import { messages } from './i18n';
|
|
10
|
-
import { FormattedMessage } from 'react-intl';
|
|
11
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
11
12
|
const moreEmojiContainerStyle = style({
|
|
12
13
|
display: 'flex'
|
|
13
14
|
});
|
|
@@ -24,12 +25,12 @@ const moreButtonStyle = style({
|
|
|
24
25
|
verticalAlign: 'top',
|
|
25
26
|
$nest: {
|
|
26
27
|
'&:hover': {
|
|
27
|
-
backgroundColor: N30A
|
|
28
|
+
backgroundColor: token('color.background.transparentNeutral.hover', N30A)
|
|
28
29
|
}
|
|
29
30
|
}
|
|
30
31
|
});
|
|
31
32
|
const separatorStyle = style({
|
|
32
|
-
backgroundColor: N30A,
|
|
33
|
+
backgroundColor: token('color.border.neutral', N30A),
|
|
33
34
|
margin: '8px 8px 8px 4px',
|
|
34
35
|
width: '1px',
|
|
35
36
|
height: '60%',
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineMessages } from 'react-intl';
|
|
1
|
+
import { defineMessages } from 'react-intl-next';
|
|
2
2
|
export const messages = defineMessages({
|
|
3
3
|
loadingReactions: {
|
|
4
4
|
id: 'fabric.reactions.loading',
|
|
@@ -14,5 +14,10 @@ export const messages = defineMessages({
|
|
|
14
14
|
id: 'fabric.reactions.error.unexpected',
|
|
15
15
|
defaultMessage: 'Something went wrong',
|
|
16
16
|
description: 'Unexpected error message'
|
|
17
|
+
},
|
|
18
|
+
otherUsers: {
|
|
19
|
+
id: 'fabric.reactions.other.reacted.users',
|
|
20
|
+
defaultMessage: '{count, plural, one {and one other} other {and {count} others}}',
|
|
21
|
+
description: "The number of users that have reacted similarly, but aren't shown"
|
|
17
22
|
}
|
|
18
23
|
});
|
package/dist/es2019/i18n/en.js
CHANGED
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
export default {
|
|
3
3
|
'fabric.reactions.loading': 'Loading...',
|
|
4
4
|
'fabric.reactions.more.emoji': 'More emoji',
|
|
5
|
-
'fabric.reactions.error.unexpected': 'Something went wrong'
|
|
5
|
+
'fabric.reactions.error.unexpected': 'Something went wrong',
|
|
6
|
+
'fabric.reactions.other.reacted.users': '{count, plural, one {and one other} other {and "{count}" others}}'
|
|
6
7
|
};
|
|
@@ -2,5 +2,6 @@
|
|
|
2
2
|
export default {
|
|
3
3
|
'fabric.reactions.loading': 'Loading...',
|
|
4
4
|
'fabric.reactions.more.emoji': 'More emoji',
|
|
5
|
-
'fabric.reactions.error.unexpected': 'Something went wrong'
|
|
5
|
+
'fabric.reactions.error.unexpected': 'Something went wrong',
|
|
6
|
+
'fabric.reactions.other.reacted.users': '{count, plural, one {and one other} other {and "{count}" others}}'
|
|
6
7
|
};
|