@atlaskit/reactions 22.8.5 → 22.9.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 +13 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/ReactionSummary/ReactionSummaryButton.js +10 -1
- package/dist/cjs/components/ReactionSummary/ReactionSummaryView.js +2 -2
- package/dist/cjs/components/Reactions/Reactions.js +4 -2
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/ReactionSummary/ReactionSummaryButton.js +10 -1
- package/dist/es2019/components/ReactionSummary/ReactionSummaryView.js +1 -1
- package/dist/es2019/components/Reactions/Reactions.js +4 -2
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/ReactionSummary/ReactionSummaryButton.js +10 -1
- package/dist/esm/components/ReactionSummary/ReactionSummaryView.js +2 -2
- package/dist/esm/components/Reactions/Reactions.js +4 -2
- package/dist/types/components/Reactions/Reactions.d.ts +6 -1
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +6 -1
- package/package.json +4 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 22.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#120256](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/120256)
|
|
8
|
+
[`2cbfadca64339`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2cbfadca64339) -
|
|
9
|
+
Added ability to adjust placement of Summarized Reactions Pop-up. Made the Summarized Reactions
|
|
10
|
+
button toggleable
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 22.8.5
|
|
4
17
|
|
|
5
18
|
### 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.9.0";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -69,7 +69,16 @@ var ReactionSummaryButton = exports.ReactionSummaryButton = /*#__PURE__*/(0, _re
|
|
|
69
69
|
}, /*#__PURE__*/_react.default.createElement(_Reaction.ReactionButton, {
|
|
70
70
|
onClick: onClick,
|
|
71
71
|
testId: RENDER_SUMMARY_BUTTON_TESTID,
|
|
72
|
-
ariaLabel: intl.formatMessage(_i18n.messages.summary)
|
|
72
|
+
ariaLabel: intl.formatMessage(_i18n.messages.summary),
|
|
73
|
+
additionalStyles: [(0, _primitives.xcss)({
|
|
74
|
+
backgroundColor: 'elevation.surface',
|
|
75
|
+
':hover': {
|
|
76
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
77
|
+
},
|
|
78
|
+
':active': {
|
|
79
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
80
|
+
}
|
|
81
|
+
})]
|
|
73
82
|
}, /*#__PURE__*/_react.default.createElement(_primitives.Inline, {
|
|
74
83
|
space: "space.050",
|
|
75
84
|
xcss: buttonStyle
|
|
@@ -47,8 +47,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
|
|
|
47
47
|
return setSummaryPopupOpen(false);
|
|
48
48
|
}, []);
|
|
49
49
|
var handleSummaryClick = (0, _react.useCallback)(function () {
|
|
50
|
-
return setSummaryPopupOpen(
|
|
51
|
-
}, []);
|
|
50
|
+
return setSummaryPopupOpen(!isSummaryPopupOpen);
|
|
51
|
+
}, [isSummaryPopupOpen]);
|
|
52
52
|
return /*#__PURE__*/_react.default.createElement(_popup.default, {
|
|
53
53
|
placement: placement,
|
|
54
54
|
content: function content() {
|
|
@@ -118,7 +118,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
118
118
|
_ref$summaryViewEnabl = _ref.summaryViewEnabled,
|
|
119
119
|
summaryViewEnabled = _ref$summaryViewEnabl === void 0 ? false : _ref$summaryViewEnabl,
|
|
120
120
|
_ref$summaryViewThres = _ref.summaryViewThreshold,
|
|
121
|
-
summaryViewThreshold = _ref$summaryViewThres === void 0 ? 3 : _ref$summaryViewThres
|
|
121
|
+
summaryViewThreshold = _ref$summaryViewThres === void 0 ? 3 : _ref$summaryViewThres,
|
|
122
|
+
summaryViewPlacement = _ref.summaryViewPlacement;
|
|
122
123
|
var _useState = (0, _react.useState)(),
|
|
123
124
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
124
125
|
selectedEmojiId = _useState2[0],
|
|
@@ -288,7 +289,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
288
289
|
allowUserDialog: allowUserDialog,
|
|
289
290
|
onReactionClick: onReactionClick,
|
|
290
291
|
onReactionFocused: handleReactionFocused,
|
|
291
|
-
onReactionMouseEnter: handleReactionMouseEnter
|
|
292
|
+
onReactionMouseEnter: handleReactionMouseEnter,
|
|
293
|
+
placement: summaryViewPlacement
|
|
292
294
|
})) : memorizedReactions.map(function (reaction) {
|
|
293
295
|
return (0, _react2.jsx)(_Reaction.Reaction, {
|
|
294
296
|
key: reaction.emojiId,
|
|
@@ -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.9.0";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|
|
@@ -53,7 +53,16 @@ export const ReactionSummaryButton = /*#__PURE__*/forwardRef(({
|
|
|
53
53
|
}, /*#__PURE__*/React.createElement(ReactionButton, {
|
|
54
54
|
onClick: onClick,
|
|
55
55
|
testId: RENDER_SUMMARY_BUTTON_TESTID,
|
|
56
|
-
ariaLabel: intl.formatMessage(messages.summary)
|
|
56
|
+
ariaLabel: intl.formatMessage(messages.summary),
|
|
57
|
+
additionalStyles: [xcss({
|
|
58
|
+
backgroundColor: 'elevation.surface',
|
|
59
|
+
':hover': {
|
|
60
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
61
|
+
},
|
|
62
|
+
':active': {
|
|
63
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
64
|
+
}
|
|
65
|
+
})]
|
|
57
66
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
58
67
|
space: "space.050",
|
|
59
68
|
xcss: buttonStyle
|
|
@@ -27,7 +27,7 @@ export const ReactionSummaryView = ({
|
|
|
27
27
|
}) => {
|
|
28
28
|
const [isSummaryPopupOpen, setSummaryPopupOpen] = useState(false);
|
|
29
29
|
const handlePopupClose = useCallback(() => setSummaryPopupOpen(false), []);
|
|
30
|
-
const handleSummaryClick = useCallback(() => setSummaryPopupOpen(
|
|
30
|
+
const handleSummaryClick = useCallback(() => setSummaryPopupOpen(!isSummaryPopupOpen), [isSummaryPopupOpen]);
|
|
31
31
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
32
32
|
placement: placement,
|
|
33
33
|
content: () => /*#__PURE__*/React.createElement(Inline, {
|
|
@@ -92,7 +92,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
92
92
|
emojiPickerSize = 'medium',
|
|
93
93
|
miniMode = false,
|
|
94
94
|
summaryViewEnabled = false,
|
|
95
|
-
summaryViewThreshold = 3
|
|
95
|
+
summaryViewThreshold = 3,
|
|
96
|
+
summaryViewPlacement
|
|
96
97
|
}) => {
|
|
97
98
|
const [selectedEmojiId, setSelectedEmojiId] = useState();
|
|
98
99
|
const {
|
|
@@ -257,7 +258,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
257
258
|
allowUserDialog: allowUserDialog,
|
|
258
259
|
onReactionClick: onReactionClick,
|
|
259
260
|
onReactionFocused: handleReactionFocused,
|
|
260
|
-
onReactionMouseEnter: handleReactionMouseEnter
|
|
261
|
+
onReactionMouseEnter: handleReactionMouseEnter,
|
|
262
|
+
placement: summaryViewPlacement
|
|
261
263
|
})) : memorizedReactions.map(reaction => jsx(Reaction, {
|
|
262
264
|
key: reaction.emojiId,
|
|
263
265
|
reaction: reaction,
|
|
@@ -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.9.0";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -59,7 +59,16 @@ export var ReactionSummaryButton = /*#__PURE__*/forwardRef(function (_ref, ref)
|
|
|
59
59
|
}, /*#__PURE__*/React.createElement(ReactionButton, {
|
|
60
60
|
onClick: onClick,
|
|
61
61
|
testId: RENDER_SUMMARY_BUTTON_TESTID,
|
|
62
|
-
ariaLabel: intl.formatMessage(messages.summary)
|
|
62
|
+
ariaLabel: intl.formatMessage(messages.summary),
|
|
63
|
+
additionalStyles: [xcss({
|
|
64
|
+
backgroundColor: 'elevation.surface',
|
|
65
|
+
':hover': {
|
|
66
|
+
backgroundColor: 'elevation.surface.hovered'
|
|
67
|
+
},
|
|
68
|
+
':active': {
|
|
69
|
+
backgroundColor: 'elevation.surface.pressed'
|
|
70
|
+
}
|
|
71
|
+
})]
|
|
63
72
|
}, /*#__PURE__*/React.createElement(Inline, {
|
|
64
73
|
space: "space.050",
|
|
65
74
|
xcss: buttonStyle
|
|
@@ -37,8 +37,8 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
|
|
|
37
37
|
return setSummaryPopupOpen(false);
|
|
38
38
|
}, []);
|
|
39
39
|
var handleSummaryClick = useCallback(function () {
|
|
40
|
-
return setSummaryPopupOpen(
|
|
41
|
-
}, []);
|
|
40
|
+
return setSummaryPopupOpen(!isSummaryPopupOpen);
|
|
41
|
+
}, [isSummaryPopupOpen]);
|
|
42
42
|
return /*#__PURE__*/React.createElement(Popup, {
|
|
43
43
|
placement: placement,
|
|
44
44
|
content: function content() {
|
|
@@ -105,7 +105,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
105
105
|
_ref$summaryViewEnabl = _ref.summaryViewEnabled,
|
|
106
106
|
summaryViewEnabled = _ref$summaryViewEnabl === void 0 ? false : _ref$summaryViewEnabl,
|
|
107
107
|
_ref$summaryViewThres = _ref.summaryViewThreshold,
|
|
108
|
-
summaryViewThreshold = _ref$summaryViewThres === void 0 ? 3 : _ref$summaryViewThres
|
|
108
|
+
summaryViewThreshold = _ref$summaryViewThres === void 0 ? 3 : _ref$summaryViewThres,
|
|
109
|
+
summaryViewPlacement = _ref.summaryViewPlacement;
|
|
109
110
|
var _useState = useState(),
|
|
110
111
|
_useState2 = _slicedToArray(_useState, 2),
|
|
111
112
|
selectedEmojiId = _useState2[0],
|
|
@@ -275,7 +276,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
275
276
|
allowUserDialog: allowUserDialog,
|
|
276
277
|
onReactionClick: onReactionClick,
|
|
277
278
|
onReactionFocused: handleReactionFocused,
|
|
278
|
-
onReactionMouseEnter: handleReactionMouseEnter
|
|
279
|
+
onReactionMouseEnter: handleReactionMouseEnter,
|
|
280
|
+
placement: summaryViewPlacement
|
|
279
281
|
})) : memorizedReactions.map(function (reaction) {
|
|
280
282
|
return jsx(Reaction, {
|
|
281
283
|
key: reaction.emojiId,
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { type OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
5
|
+
import { type Placement } from '@atlaskit/popper';
|
|
5
6
|
import { type onDialogSelectReactionChange, ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary } from '../../types';
|
|
6
7
|
import { type ReactionProps } from '../Reaction';
|
|
7
8
|
import { type ReactionPickerProps } from '../ReactionPicker';
|
|
@@ -102,6 +103,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
102
103
|
* The minimum number of reactions required to switch to the summary view when summaryViewEnabled is true. Defaults to 3 if not specified.
|
|
103
104
|
*/
|
|
104
105
|
summaryViewThreshold?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Optional prop to change the placement of the summary popup reaction list
|
|
108
|
+
*/
|
|
109
|
+
summaryViewPlacement?: Placement;
|
|
105
110
|
}
|
|
106
111
|
/**
|
|
107
112
|
* Get content of the tooltip
|
|
@@ -110,4 +115,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
110
115
|
/**
|
|
111
116
|
* Renders list of reactions
|
|
112
117
|
*/
|
|
113
|
-
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, summaryViewEnabled, summaryViewThreshold, }: ReactionsProps) => jsx.JSX.Element>;
|
|
118
|
+
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, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, }: ReactionsProps) => jsx.JSX.Element>;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { type OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
5
|
+
import { type Placement } from '@atlaskit/popper';
|
|
5
6
|
import { type onDialogSelectReactionChange, ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary } from '../../types';
|
|
6
7
|
import { type ReactionProps } from '../Reaction';
|
|
7
8
|
import { type ReactionPickerProps } from '../ReactionPicker';
|
|
@@ -102,6 +103,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
102
103
|
* The minimum number of reactions required to switch to the summary view when summaryViewEnabled is true. Defaults to 3 if not specified.
|
|
103
104
|
*/
|
|
104
105
|
summaryViewThreshold?: number;
|
|
106
|
+
/**
|
|
107
|
+
* Optional prop to change the placement of the summary popup reaction list
|
|
108
|
+
*/
|
|
109
|
+
summaryViewPlacement?: Placement;
|
|
105
110
|
}
|
|
106
111
|
/**
|
|
107
112
|
* Get content of the tooltip
|
|
@@ -110,4 +115,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
110
115
|
/**
|
|
111
116
|
* Renders list of reactions
|
|
112
117
|
*/
|
|
113
|
-
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, summaryViewEnabled, summaryViewThreshold, }: ReactionsProps) => jsx.JSX.Element>;
|
|
118
|
+
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, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, }: ReactionsProps) => jsx.JSX.Element>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/reactions",
|
|
3
|
-
"version": "22.
|
|
3
|
+
"version": "22.9.0",
|
|
4
4
|
"description": "Reactions component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
"@atlaskit/analytics-namespaced-context": "^6.10.0",
|
|
38
38
|
"@atlaskit/analytics-next": "^9.3.0",
|
|
39
39
|
"@atlaskit/avatar": "^21.11.0",
|
|
40
|
-
"@atlaskit/button": "^18.
|
|
40
|
+
"@atlaskit/button": "^18.4.0",
|
|
41
41
|
"@atlaskit/emoji": "^67.6.0",
|
|
42
42
|
"@atlaskit/icon": "^22.6.0",
|
|
43
43
|
"@atlaskit/modal-dialog": "^12.14.0",
|
|
@@ -46,9 +46,9 @@
|
|
|
46
46
|
"@atlaskit/popup": "1.20.1",
|
|
47
47
|
"@atlaskit/primitives": "^11.0.0",
|
|
48
48
|
"@atlaskit/spinner": "^16.2.0",
|
|
49
|
-
"@atlaskit/tabs": "^16.
|
|
49
|
+
"@atlaskit/tabs": "^16.3.0",
|
|
50
50
|
"@atlaskit/theme": "^12.11.0",
|
|
51
|
-
"@atlaskit/tokens": "^1.
|
|
51
|
+
"@atlaskit/tokens": "^1.54.0",
|
|
52
52
|
"@atlaskit/tooltip": "^18.5.0",
|
|
53
53
|
"@atlaskit/ufo": "^0.2.0",
|
|
54
54
|
"@atlaskit/util-service-support": "^6.2.0",
|