@atlaskit/reactions 31.6.3 → 31.8.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 +20 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/ReactionSummaryButton.compiled.css +5 -1
- package/dist/cjs/components/ReactionSummaryButton.js +7 -3
- package/dist/cjs/components/ReactionSummaryView.js +4 -2
- package/dist/cjs/components/Reactions.js +6 -2
- package/dist/cjs/components/Trigger.js +4 -1
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/ReactionSummaryButton.compiled.css +5 -1
- package/dist/es2019/components/ReactionSummaryButton.js +7 -3
- package/dist/es2019/components/ReactionSummaryView.js +4 -2
- package/dist/es2019/components/Reactions.js +6 -2
- package/dist/es2019/components/Trigger.js +2 -1
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/ReactionSummaryButton.compiled.css +5 -1
- package/dist/esm/components/ReactionSummaryButton.js +7 -3
- package/dist/esm/components/ReactionSummaryView.js +4 -2
- package/dist/esm/components/Reactions.js +6 -2
- package/dist/esm/components/Trigger.js +4 -1
- package/dist/types/components/ReactionSummaryButton.d.ts +4 -0
- package/dist/types/components/ReactionSummaryView.d.ts +5 -1
- package/dist/types/components/Reactions.d.ts +9 -1
- package/dist/types-ts4.5/components/ReactionSummaryButton.d.ts +4 -0
- package/dist/types-ts4.5/components/ReactionSummaryView.d.ts +5 -1
- package/dist/types-ts4.5/components/Reactions.d.ts +9 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 31.8.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#152134](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/152134)
|
|
8
|
+
[`9d7c343ded23e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9d7c343ded23e) -
|
|
9
|
+
[ux] Adds an optional side picker emoji icon to the reaction summary button
|
|
10
|
+
|
|
11
|
+
## 31.7.0
|
|
12
|
+
|
|
13
|
+
### Minor Changes
|
|
14
|
+
|
|
15
|
+
- [#150353](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/150353)
|
|
16
|
+
[`fb0f2127ccd01`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/fb0f2127ccd01) -
|
|
17
|
+
[ux] Removes reactions trigger tooltip when the reaction trigger already has text
|
|
18
|
+
- [#152335](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/152335)
|
|
19
|
+
[`e863365b1e932`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e863365b1e932) -
|
|
20
|
+
Pass reactionPickerPlacement prop into Reactions component to allow for differing aligment of
|
|
21
|
+
reaction picker popup
|
|
22
|
+
|
|
3
23
|
## 31.6.3
|
|
4
24
|
|
|
5
25
|
### 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 = "31.
|
|
14
|
+
var packageVersion = "31.8.0";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
2
|
+
._1bah1h6o{justify-content:center}
|
|
3
|
+
._1e0c1txw{display:flex}
|
|
4
|
+
._4cvr1h6o{align-items:center}
|
|
2
5
|
._8hrz1nam{transform-origin:center center 0}
|
|
3
6
|
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
4
7
|
._kqswh2mm{position:relative}
|
|
5
8
|
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
6
|
-
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
9
|
+
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
10
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
@@ -25,7 +25,8 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
25
25
|
var styles = {
|
|
26
26
|
emoji: "_8hrz1nam",
|
|
27
27
|
button: "_ca0q1b66 _u5f31b66 _n3td1b66 _19bvu2gc",
|
|
28
|
-
container: "_kqswh2mm"
|
|
28
|
+
container: "_kqswh2mm",
|
|
29
|
+
summaryButtonIconAfter: "_u5f3u2gc _1e0c1txw _4cvr1h6o _1bah1h6o"
|
|
29
30
|
};
|
|
30
31
|
/**
|
|
31
32
|
* Test id for summary reaction wrapper button
|
|
@@ -52,7 +53,8 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
|
|
|
52
53
|
_ref$useButtonAlignme = _ref.useButtonAlignmentStyling,
|
|
53
54
|
useButtonAlignmentStyling = _ref$useButtonAlignme === void 0 ? false : _ref$useButtonAlignme,
|
|
54
55
|
onMouseEnter = _ref.onMouseEnter,
|
|
55
|
-
onMouseLeave = _ref.onMouseLeave
|
|
56
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
57
|
+
summaryButtonIconAfter = _ref.summaryButtonIconAfter;
|
|
56
58
|
var intl = (0, _reactIntlNext.useIntl)();
|
|
57
59
|
|
|
58
60
|
// Helper function to sort reactions by count and return top N
|
|
@@ -107,5 +109,7 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
|
|
|
107
109
|
value: totalReactionsCount,
|
|
108
110
|
useDarkerFont: useButtonAlignmentStyling,
|
|
109
111
|
useUpdatedStyles: useButtonAlignmentStyling
|
|
110
|
-
})
|
|
112
|
+
}), summaryButtonIconAfter && /*#__PURE__*/React.createElement(_compiled.Box, {
|
|
113
|
+
xcss: styles.summaryButtonIconAfter
|
|
114
|
+
}, summaryButtonIconAfter)));
|
|
111
115
|
});
|
|
@@ -64,7 +64,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
|
|
|
64
64
|
_ref$hoverableSummary = _ref.hoverableSummaryView,
|
|
65
65
|
hoverableSummaryView = _ref$hoverableSummary === void 0 ? false : _ref$hoverableSummary,
|
|
66
66
|
_ref$hoverableSummary2 = _ref.hoverableSummaryViewDelay,
|
|
67
|
-
hoverableSummaryViewDelay = _ref$hoverableSummary2 === void 0 ? 300 : _ref$hoverableSummary2
|
|
67
|
+
hoverableSummaryViewDelay = _ref$hoverableSummary2 === void 0 ? 300 : _ref$hoverableSummary2,
|
|
68
|
+
summaryButtonIconAfter = _ref.summaryButtonIconAfter;
|
|
68
69
|
var _useDelayedState = (0, _useDelayedState3.useDelayedState)(false, hoverableSummaryViewDelay),
|
|
69
70
|
_useDelayedState2 = (0, _slicedToArray2.default)(_useDelayedState, 2),
|
|
70
71
|
isSummaryPopupOpen = _useDelayedState2[0],
|
|
@@ -216,7 +217,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
|
|
|
216
217
|
onMouseLeave: handleButtonMouseLeave,
|
|
217
218
|
showOpaqueBackground: showOpaqueBackground,
|
|
218
219
|
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
219
|
-
useButtonAlignmentStyling: useButtonAlignmentStyling
|
|
220
|
+
useButtonAlignmentStyling: useButtonAlignmentStyling,
|
|
221
|
+
summaryButtonIconAfter: summaryButtonIconAfter
|
|
220
222
|
}));
|
|
221
223
|
}
|
|
222
224
|
});
|
|
@@ -146,7 +146,9 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
146
146
|
_ref$hoverableSummary = _ref.hoverableSummaryView,
|
|
147
147
|
hoverableSummaryView = _ref$hoverableSummary === void 0 ? false : _ref$hoverableSummary,
|
|
148
148
|
_ref$isListItem = _ref.isListItem,
|
|
149
|
-
isListItem = _ref$isListItem === void 0 ? false : _ref$isListItem
|
|
149
|
+
isListItem = _ref$isListItem === void 0 ? false : _ref$isListItem,
|
|
150
|
+
reactionPickerPlacement = _ref.reactionPickerPlacement,
|
|
151
|
+
summaryButtonIconAfter = _ref.summaryButtonIconAfter;
|
|
150
152
|
var _useState = (0, _react.useState)(''),
|
|
151
153
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
152
154
|
selectedEmojiId = _useState2[0],
|
|
@@ -329,7 +331,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
329
331
|
onOpen: handlePickerOpen,
|
|
330
332
|
useButtonAlignmentStyling: useButtonAlignmentStyling,
|
|
331
333
|
reactionPickerTriggerText: reactionPickerTriggerText,
|
|
332
|
-
hoverableSummaryView: hoverableSummaryView
|
|
334
|
+
hoverableSummaryView: hoverableSummaryView,
|
|
335
|
+
summaryButtonIconAfter: summaryButtonIconAfter
|
|
333
336
|
})) : memorizedReactions.map(function (reaction) {
|
|
334
337
|
return /*#__PURE__*/_react.default.createElement(_Reaction.Reaction, {
|
|
335
338
|
key: reaction.emojiId,
|
|
@@ -366,6 +369,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
366
369
|
isListItem: isListItem,
|
|
367
370
|
hoverableReactionPicker: hoverableSummaryView,
|
|
368
371
|
hoverableReactionPickerDelay: hoverableSummaryView ? 300 : 0,
|
|
372
|
+
reactionPickerPlacement: reactionPickerPlacement,
|
|
369
373
|
className: (0, _runtime.ax)(["_1e0c1o8l _19pk1b66"])
|
|
370
374
|
}), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, !!selectedEmojiId && /*#__PURE__*/_react.default.createElement(_segment.default, {
|
|
371
375
|
name: "reactions-dialog"
|
|
@@ -117,7 +117,10 @@ var Trigger = exports.Trigger = /*#__PURE__*/_react2.default.forwardRef(function
|
|
|
117
117
|
testId: RENDER_TRIGGER_CONTAINER_TESTID
|
|
118
118
|
}, /*#__PURE__*/_react2.default.createElement(_tooltip.default, {
|
|
119
119
|
testId: RENDER_TOOLTIP_TRIGGER_TESTID,
|
|
120
|
-
content: tooltipContent
|
|
120
|
+
content: tooltipContent,
|
|
121
|
+
canAppear: function canAppear() {
|
|
122
|
+
return !showAddReactionText;
|
|
123
|
+
}
|
|
121
124
|
}, isListItem ? /*#__PURE__*/_react2.default.createElement("li", {
|
|
122
125
|
"data-testid": RENDER_LIST_ITEM_WRAPPER_TESTID,
|
|
123
126
|
className: (0, _runtime.ax)(["_qtt8glyw"])
|
|
@@ -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 = "31.
|
|
4
|
+
const packageVersion = "31.8.0";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
2
|
+
._1bah1h6o{justify-content:center}
|
|
3
|
+
._1e0c1txw{display:flex}
|
|
4
|
+
._4cvr1h6o{align-items:center}
|
|
2
5
|
._8hrz1nam{transform-origin:center center 0}
|
|
3
6
|
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
4
7
|
._kqswh2mm{position:relative}
|
|
5
8
|
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
6
|
-
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
9
|
+
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
10
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
@@ -14,7 +14,8 @@ import { cx } from '@compiled/react';
|
|
|
14
14
|
const styles = {
|
|
15
15
|
emoji: "_8hrz1nam",
|
|
16
16
|
button: "_ca0q1b66 _u5f31b66 _n3td1b66 _19bvu2gc",
|
|
17
|
-
container: "_kqswh2mm"
|
|
17
|
+
container: "_kqswh2mm",
|
|
18
|
+
summaryButtonIconAfter: "_u5f3u2gc _1e0c1txw _4cvr1h6o _1bah1h6o"
|
|
18
19
|
};
|
|
19
20
|
/**
|
|
20
21
|
* Test id for summary reaction wrapper button
|
|
@@ -36,7 +37,8 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
|
|
|
36
37
|
subtleReactionsSummaryAndPicker = false,
|
|
37
38
|
useButtonAlignmentStyling = false,
|
|
38
39
|
onMouseEnter,
|
|
39
|
-
onMouseLeave
|
|
40
|
+
onMouseLeave,
|
|
41
|
+
summaryButtonIconAfter
|
|
40
42
|
}, ref) => {
|
|
41
43
|
const intl = useIntl();
|
|
42
44
|
|
|
@@ -86,5 +88,7 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
|
|
|
86
88
|
value: totalReactionsCount,
|
|
87
89
|
useDarkerFont: useButtonAlignmentStyling,
|
|
88
90
|
useUpdatedStyles: useButtonAlignmentStyling
|
|
89
|
-
})
|
|
91
|
+
}), summaryButtonIconAfter && /*#__PURE__*/React.createElement(Box, {
|
|
92
|
+
xcss: styles.summaryButtonIconAfter
|
|
93
|
+
}, summaryButtonIconAfter)));
|
|
90
94
|
});
|
|
@@ -44,7 +44,8 @@ export const ReactionSummaryView = ({
|
|
|
44
44
|
useButtonAlignmentStyling,
|
|
45
45
|
reactionPickerTriggerText,
|
|
46
46
|
hoverableSummaryView = false,
|
|
47
|
-
hoverableSummaryViewDelay = 300
|
|
47
|
+
hoverableSummaryViewDelay = 300,
|
|
48
|
+
summaryButtonIconAfter
|
|
48
49
|
}) => {
|
|
49
50
|
const [isSummaryPopupOpen, setSummaryPopupOpen] = useDelayedState(false, hoverableSummaryViewDelay);
|
|
50
51
|
const [isHoveringSummaryView, setIsHoveringSummaryView] = useState(false);
|
|
@@ -177,7 +178,8 @@ export const ReactionSummaryView = ({
|
|
|
177
178
|
onMouseLeave: handleButtonMouseLeave,
|
|
178
179
|
showOpaqueBackground: showOpaqueBackground,
|
|
179
180
|
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
180
|
-
useButtonAlignmentStyling: useButtonAlignmentStyling
|
|
181
|
+
useButtonAlignmentStyling: useButtonAlignmentStyling,
|
|
182
|
+
summaryButtonIconAfter: summaryButtonIconAfter
|
|
181
183
|
}))
|
|
182
184
|
});
|
|
183
185
|
};
|
|
@@ -108,7 +108,9 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
108
108
|
useButtonAlignmentStyling = false,
|
|
109
109
|
reactionPickerTriggerText,
|
|
110
110
|
hoverableSummaryView = false,
|
|
111
|
-
isListItem = false
|
|
111
|
+
isListItem = false,
|
|
112
|
+
reactionPickerPlacement,
|
|
113
|
+
summaryButtonIconAfter
|
|
112
114
|
}) => {
|
|
113
115
|
const [selectedEmojiId, setSelectedEmojiId] = useState('');
|
|
114
116
|
const {
|
|
@@ -278,7 +280,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
278
280
|
onOpen: handlePickerOpen,
|
|
279
281
|
useButtonAlignmentStyling: useButtonAlignmentStyling,
|
|
280
282
|
reactionPickerTriggerText: reactionPickerTriggerText,
|
|
281
|
-
hoverableSummaryView: hoverableSummaryView
|
|
283
|
+
hoverableSummaryView: hoverableSummaryView,
|
|
284
|
+
summaryButtonIconAfter: summaryButtonIconAfter
|
|
282
285
|
})) : memorizedReactions.map(reaction => /*#__PURE__*/React.createElement(Reaction, {
|
|
283
286
|
key: reaction.emojiId,
|
|
284
287
|
reaction: reaction,
|
|
@@ -313,6 +316,7 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
313
316
|
isListItem: isListItem,
|
|
314
317
|
hoverableReactionPicker: hoverableSummaryView,
|
|
315
318
|
hoverableReactionPickerDelay: hoverableSummaryView ? 300 : 0,
|
|
319
|
+
reactionPickerPlacement: reactionPickerPlacement,
|
|
316
320
|
className: ax(["_1e0c1o8l _19pk1b66"])
|
|
317
321
|
}), /*#__PURE__*/React.createElement(ModalTransition, null, !!selectedEmojiId && /*#__PURE__*/React.createElement(UFOSegment, {
|
|
318
322
|
name: "reactions-dialog"
|
|
@@ -101,7 +101,8 @@ export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
101
101
|
testId: RENDER_TRIGGER_CONTAINER_TESTID
|
|
102
102
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
103
103
|
testId: RENDER_TOOLTIP_TRIGGER_TESTID,
|
|
104
|
-
content: tooltipContent
|
|
104
|
+
content: tooltipContent,
|
|
105
|
+
canAppear: () => !showAddReactionText
|
|
105
106
|
}, isListItem ? /*#__PURE__*/React.createElement("li", {
|
|
106
107
|
"data-testid": RENDER_LIST_ITEM_WRAPPER_TESTID,
|
|
107
108
|
className: ax(["_qtt8glyw"])
|
|
@@ -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 = "31.
|
|
7
|
+
var packageVersion = "31.8.0";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
2
|
+
._1bah1h6o{justify-content:center}
|
|
3
|
+
._1e0c1txw{display:flex}
|
|
4
|
+
._4cvr1h6o{align-items:center}
|
|
2
5
|
._8hrz1nam{transform-origin:center center 0}
|
|
3
6
|
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
4
7
|
._kqswh2mm{position:relative}
|
|
5
8
|
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
6
|
-
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
9
|
+
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
10
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
@@ -15,7 +15,8 @@ import { cx } from '@compiled/react';
|
|
|
15
15
|
var styles = {
|
|
16
16
|
emoji: "_8hrz1nam",
|
|
17
17
|
button: "_ca0q1b66 _u5f31b66 _n3td1b66 _19bvu2gc",
|
|
18
|
-
container: "_kqswh2mm"
|
|
18
|
+
container: "_kqswh2mm",
|
|
19
|
+
summaryButtonIconAfter: "_u5f3u2gc _1e0c1txw _4cvr1h6o _1bah1h6o"
|
|
19
20
|
};
|
|
20
21
|
/**
|
|
21
22
|
* Test id for summary reaction wrapper button
|
|
@@ -42,7 +43,8 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
42
43
|
_ref$useButtonAlignme = _ref.useButtonAlignmentStyling,
|
|
43
44
|
useButtonAlignmentStyling = _ref$useButtonAlignme === void 0 ? false : _ref$useButtonAlignme,
|
|
44
45
|
onMouseEnter = _ref.onMouseEnter,
|
|
45
|
-
onMouseLeave = _ref.onMouseLeave
|
|
46
|
+
onMouseLeave = _ref.onMouseLeave,
|
|
47
|
+
summaryButtonIconAfter = _ref.summaryButtonIconAfter;
|
|
46
48
|
var intl = useIntl();
|
|
47
49
|
|
|
48
50
|
// Helper function to sort reactions by count and return top N
|
|
@@ -97,5 +99,7 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
97
99
|
value: totalReactionsCount,
|
|
98
100
|
useDarkerFont: useButtonAlignmentStyling,
|
|
99
101
|
useUpdatedStyles: useButtonAlignmentStyling
|
|
100
|
-
})
|
|
102
|
+
}), summaryButtonIconAfter && /*#__PURE__*/React.createElement(Box, {
|
|
103
|
+
xcss: styles.summaryButtonIconAfter
|
|
104
|
+
}, summaryButtonIconAfter)));
|
|
101
105
|
});
|
|
@@ -54,7 +54,8 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
|
|
|
54
54
|
_ref$hoverableSummary = _ref.hoverableSummaryView,
|
|
55
55
|
hoverableSummaryView = _ref$hoverableSummary === void 0 ? false : _ref$hoverableSummary,
|
|
56
56
|
_ref$hoverableSummary2 = _ref.hoverableSummaryViewDelay,
|
|
57
|
-
hoverableSummaryViewDelay = _ref$hoverableSummary2 === void 0 ? 300 : _ref$hoverableSummary2
|
|
57
|
+
hoverableSummaryViewDelay = _ref$hoverableSummary2 === void 0 ? 300 : _ref$hoverableSummary2,
|
|
58
|
+
summaryButtonIconAfter = _ref.summaryButtonIconAfter;
|
|
58
59
|
var _useDelayedState = useDelayedState(false, hoverableSummaryViewDelay),
|
|
59
60
|
_useDelayedState2 = _slicedToArray(_useDelayedState, 2),
|
|
60
61
|
isSummaryPopupOpen = _useDelayedState2[0],
|
|
@@ -206,7 +207,8 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
|
|
|
206
207
|
onMouseLeave: handleButtonMouseLeave,
|
|
207
208
|
showOpaqueBackground: showOpaqueBackground,
|
|
208
209
|
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
209
|
-
useButtonAlignmentStyling: useButtonAlignmentStyling
|
|
210
|
+
useButtonAlignmentStyling: useButtonAlignmentStyling,
|
|
211
|
+
summaryButtonIconAfter: summaryButtonIconAfter
|
|
210
212
|
}));
|
|
211
213
|
}
|
|
212
214
|
});
|
|
@@ -134,7 +134,9 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
134
134
|
_ref$hoverableSummary = _ref.hoverableSummaryView,
|
|
135
135
|
hoverableSummaryView = _ref$hoverableSummary === void 0 ? false : _ref$hoverableSummary,
|
|
136
136
|
_ref$isListItem = _ref.isListItem,
|
|
137
|
-
isListItem = _ref$isListItem === void 0 ? false : _ref$isListItem
|
|
137
|
+
isListItem = _ref$isListItem === void 0 ? false : _ref$isListItem,
|
|
138
|
+
reactionPickerPlacement = _ref.reactionPickerPlacement,
|
|
139
|
+
summaryButtonIconAfter = _ref.summaryButtonIconAfter;
|
|
138
140
|
var _useState = useState(''),
|
|
139
141
|
_useState2 = _slicedToArray(_useState, 2),
|
|
140
142
|
selectedEmojiId = _useState2[0],
|
|
@@ -317,7 +319,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
317
319
|
onOpen: handlePickerOpen,
|
|
318
320
|
useButtonAlignmentStyling: useButtonAlignmentStyling,
|
|
319
321
|
reactionPickerTriggerText: reactionPickerTriggerText,
|
|
320
|
-
hoverableSummaryView: hoverableSummaryView
|
|
322
|
+
hoverableSummaryView: hoverableSummaryView,
|
|
323
|
+
summaryButtonIconAfter: summaryButtonIconAfter
|
|
321
324
|
})) : memorizedReactions.map(function (reaction) {
|
|
322
325
|
return /*#__PURE__*/React.createElement(Reaction, {
|
|
323
326
|
key: reaction.emojiId,
|
|
@@ -354,6 +357,7 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
354
357
|
isListItem: isListItem,
|
|
355
358
|
hoverableReactionPicker: hoverableSummaryView,
|
|
356
359
|
hoverableReactionPickerDelay: hoverableSummaryView ? 300 : 0,
|
|
360
|
+
reactionPickerPlacement: reactionPickerPlacement,
|
|
357
361
|
className: ax(["_1e0c1o8l _19pk1b66"])
|
|
358
362
|
}), /*#__PURE__*/React.createElement(ModalTransition, null, !!selectedEmojiId && /*#__PURE__*/React.createElement(UFOSegment, {
|
|
359
363
|
name: "reactions-dialog"
|
|
@@ -110,7 +110,10 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
110
110
|
testId: RENDER_TRIGGER_CONTAINER_TESTID
|
|
111
111
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
112
112
|
testId: RENDER_TOOLTIP_TRIGGER_TESTID,
|
|
113
|
-
content: tooltipContent
|
|
113
|
+
content: tooltipContent,
|
|
114
|
+
canAppear: function canAppear() {
|
|
115
|
+
return !showAddReactionText;
|
|
116
|
+
}
|
|
114
117
|
}, isListItem ? /*#__PURE__*/React.createElement("li", {
|
|
115
118
|
"data-testid": RENDER_LIST_ITEM_WRAPPER_TESTID,
|
|
116
119
|
className: ax(["_qtt8glyw"])
|
|
@@ -25,6 +25,10 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
|
|
|
25
25
|
* Optional event handler when mouse leaves the button
|
|
26
26
|
*/
|
|
27
27
|
onMouseLeave?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Optional prop to add an icon to the end of the summary button
|
|
30
|
+
*/
|
|
31
|
+
summaryButtonIconAfter?: React.ReactNode;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* Test id for summary reaction wrapper button
|
|
@@ -61,6 +61,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
|
|
|
61
61
|
* Optional prop to set a delay for the summary view when it opens/closes on hover
|
|
62
62
|
*/
|
|
63
63
|
hoverableSummaryViewDelay?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Optional prop to control if the side picker is shown
|
|
66
|
+
*/
|
|
67
|
+
summaryButtonIconAfter?: React.ReactNode;
|
|
64
68
|
}
|
|
65
|
-
export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, allowUserDialog, handleOpenReactionsDialog, isViewOnly, allowSelectFromSummaryView, disabled, emojiPickerSize, onSelection, tooltipContent, reactionPickerTriggerIcon, onOpen, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, hoverableSummaryViewDelay, }: ReactionSummaryViewProps) => JSX.Element;
|
|
69
|
+
export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, allowUserDialog, handleOpenReactionsDialog, isViewOnly, allowSelectFromSummaryView, disabled, emojiPickerSize, onSelection, tooltipContent, reactionPickerTriggerIcon, onOpen, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, hoverableSummaryViewDelay, summaryButtonIconAfter, }: ReactionSummaryViewProps) => JSX.Element;
|
|
66
70
|
export {};
|
|
@@ -169,6 +169,14 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
169
169
|
* Optional prop to say if the reactions component is in a list
|
|
170
170
|
*/
|
|
171
171
|
isListItem?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Optional prop to change the placement of the reaction picker popup
|
|
174
|
+
*/
|
|
175
|
+
reactionPickerPlacement?: Placement;
|
|
176
|
+
/**
|
|
177
|
+
* Optional prop to add an icon to the end of the summary button
|
|
178
|
+
*/
|
|
179
|
+
summaryButtonIconAfter?: React.ReactNode;
|
|
172
180
|
}
|
|
173
181
|
export interface OpenReactionsDialogOptions {
|
|
174
182
|
emojiId?: string;
|
|
@@ -181,4 +189,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
181
189
|
/**
|
|
182
190
|
* Renders list of reactions
|
|
183
191
|
*/
|
|
184
|
-
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, isListItem, }: ReactionsProps) => JSX.Element>;
|
|
192
|
+
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, isListItem, reactionPickerPlacement, summaryButtonIconAfter, }: ReactionsProps) => JSX.Element>;
|
|
@@ -25,6 +25,10 @@ interface ReactionSummaryButtonProps extends Pick<ReactionsProps, 'emojiProvider
|
|
|
25
25
|
* Optional event handler when mouse leaves the button
|
|
26
26
|
*/
|
|
27
27
|
onMouseLeave?: () => void;
|
|
28
|
+
/**
|
|
29
|
+
* Optional prop to add an icon to the end of the summary button
|
|
30
|
+
*/
|
|
31
|
+
summaryButtonIconAfter?: React.ReactNode;
|
|
28
32
|
}
|
|
29
33
|
/**
|
|
30
34
|
* Test id for summary reaction wrapper button
|
|
@@ -61,6 +61,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
|
|
|
61
61
|
* Optional prop to set a delay for the summary view when it opens/closes on hover
|
|
62
62
|
*/
|
|
63
63
|
hoverableSummaryViewDelay?: number;
|
|
64
|
+
/**
|
|
65
|
+
* Optional prop to control if the side picker is shown
|
|
66
|
+
*/
|
|
67
|
+
summaryButtonIconAfter?: React.ReactNode;
|
|
64
68
|
}
|
|
65
|
-
export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, allowUserDialog, handleOpenReactionsDialog, isViewOnly, allowSelectFromSummaryView, disabled, emojiPickerSize, onSelection, tooltipContent, reactionPickerTriggerIcon, onOpen, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, hoverableSummaryViewDelay, }: ReactionSummaryViewProps) => JSX.Element;
|
|
69
|
+
export declare const ReactionSummaryView: ({ emojiProvider, reactions, flash, particleEffectByEmoji, placement, onReactionClick, onReactionFocused, onReactionMouseEnter, showOpaqueBackground, subtleReactionsSummaryAndPicker, allowUserDialog, handleOpenReactionsDialog, isViewOnly, allowSelectFromSummaryView, disabled, emojiPickerSize, onSelection, tooltipContent, reactionPickerTriggerIcon, onOpen, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, hoverableSummaryViewDelay, summaryButtonIconAfter, }: ReactionSummaryViewProps) => JSX.Element;
|
|
66
70
|
export {};
|
|
@@ -169,6 +169,14 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
169
169
|
* Optional prop to say if the reactions component is in a list
|
|
170
170
|
*/
|
|
171
171
|
isListItem?: boolean;
|
|
172
|
+
/**
|
|
173
|
+
* Optional prop to change the placement of the reaction picker popup
|
|
174
|
+
*/
|
|
175
|
+
reactionPickerPlacement?: Placement;
|
|
176
|
+
/**
|
|
177
|
+
* Optional prop to add an icon to the end of the summary button
|
|
178
|
+
*/
|
|
179
|
+
summaryButtonIconAfter?: React.ReactNode;
|
|
172
180
|
}
|
|
173
181
|
export interface OpenReactionsDialogOptions {
|
|
174
182
|
emojiId?: string;
|
|
@@ -181,4 +189,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
181
189
|
/**
|
|
182
190
|
* Renders list of reactions
|
|
183
191
|
*/
|
|
184
|
-
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, isListItem, }: ReactionsProps) => JSX.Element>;
|
|
192
|
+
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, isListItem, reactionPickerPlacement, summaryButtonIconAfter, }: ReactionsProps) => JSX.Element>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/reactions",
|
|
3
|
-
"version": "31.
|
|
3
|
+
"version": "31.8.0",
|
|
4
4
|
"description": "Reactions component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -40,7 +40,7 @@
|
|
|
40
40
|
"@atlaskit/css": "^0.10.0",
|
|
41
41
|
"@atlaskit/emoji": "^69.1.0",
|
|
42
42
|
"@atlaskit/heading": "^5.2.0",
|
|
43
|
-
"@atlaskit/icon": "^25.
|
|
43
|
+
"@atlaskit/icon": "^25.8.0",
|
|
44
44
|
"@atlaskit/modal-dialog": "^14.1.0",
|
|
45
45
|
"@atlaskit/motion": "^5.1.0",
|
|
46
46
|
"@atlaskit/platform-feature-flags": "^1.1.0",
|