@atlaskit/reactions 24.1.0 → 24.2.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 +9 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/ReactionDialog/ReactionView.js +20 -4
- package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +4 -2
- package/dist/cjs/components/ReactionDialog/ReactionsList.js +4 -2
- package/dist/cjs/components/Reactions/Reactions.js +4 -2
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/ReactionDialog/ReactionView.js +21 -5
- package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +4 -2
- package/dist/es2019/components/ReactionDialog/ReactionsList.js +4 -2
- package/dist/es2019/components/Reactions/Reactions.js +4 -2
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/ReactionDialog/ReactionView.js +21 -5
- package/dist/esm/components/ReactionDialog/ReactionsDialog.js +4 -2
- package/dist/esm/components/ReactionDialog/ReactionsList.js +4 -2
- package/dist/esm/components/Reactions/Reactions.js +4 -2
- package/dist/types/components/ReactionDialog/ReactionView.d.ts +3 -2
- package/dist/types/components/ReactionDialog/ReactionsDialog.d.ts +3 -2
- package/dist/types/components/ReactionDialog/ReactionsList.d.ts +6 -2
- package/dist/types/components/Reactions/Reactions.d.ts +6 -2
- package/dist/types/types/User.d.ts +1 -0
- package/dist/types/types/index.d.ts +15 -0
- package/dist/types-ts4.5/components/ReactionDialog/ReactionView.d.ts +3 -2
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsDialog.d.ts +3 -2
- package/dist/types-ts4.5/components/ReactionDialog/ReactionsList.d.ts +6 -2
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +6 -2
- package/dist/types-ts4.5/types/User.d.ts +1 -0
- package/dist/types-ts4.5/types/index.d.ts +18 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 24.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#108078](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/108078)
|
|
8
|
+
[`d7e3f8c56ff08`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d7e3f8c56ff08) -
|
|
9
|
+
[ux] Adds the profileCardWrapper prop which adds an on-hover interaction to the Avatar picture and
|
|
10
|
+
shows the user's profile card
|
|
11
|
+
|
|
3
12
|
## 24.1.0
|
|
4
13
|
|
|
5
14
|
### Minor 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 = "24.
|
|
14
|
+
var packageVersion = "24.2.0";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -26,10 +26,14 @@ var _styles = require("./styles");
|
|
|
26
26
|
|
|
27
27
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
28
28
|
|
|
29
|
+
var userDescriptionStyle = (0, _primitives.xcss)({
|
|
30
|
+
marginLeft: 'space.200'
|
|
31
|
+
});
|
|
29
32
|
var ReactionView = exports.ReactionView = function ReactionView(_ref) {
|
|
30
33
|
var selectedEmojiId = _ref.selectedEmojiId,
|
|
31
34
|
emojiProvider = _ref.emojiProvider,
|
|
32
|
-
reaction = _ref.reaction
|
|
35
|
+
reaction = _ref.reaction,
|
|
36
|
+
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
33
37
|
var _useState = (0, _react.useState)(''),
|
|
34
38
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
39
|
emojiShortName = _useState2[0],
|
|
@@ -85,7 +89,7 @@ var ReactionView = exports.ReactionView = function ReactionView(_ref) {
|
|
|
85
89
|
id: selectedEmojiId,
|
|
86
90
|
shortName: ''
|
|
87
91
|
},
|
|
88
|
-
fitToHeight:
|
|
92
|
+
fitToHeight: 24
|
|
89
93
|
})), alphabeticalNames.length === 0 ?
|
|
90
94
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
91
95
|
(0, _react2.jsx)("div", {
|
|
@@ -104,10 +108,22 @@ var ReactionView = exports.ReactionView = function ReactionView(_ref) {
|
|
|
104
108
|
(0, _react2.jsx)("li", {
|
|
105
109
|
css: _styles.userStyle,
|
|
106
110
|
key: user.id
|
|
111
|
+
}, ProfileCardWrapper && user.accountId ? (0, _react2.jsx)(ProfileCardWrapper, {
|
|
112
|
+
userId: user.accountId,
|
|
113
|
+
isAnonymous: false,
|
|
114
|
+
canViewProfile: true,
|
|
115
|
+
position: "left-start"
|
|
107
116
|
}, (0, _react2.jsx)(_Avatar.default, {
|
|
108
117
|
size: "large",
|
|
109
|
-
src: profile
|
|
110
|
-
|
|
118
|
+
src: profile,
|
|
119
|
+
testId: "profile"
|
|
120
|
+
})) : (0, _react2.jsx)(_Avatar.default, {
|
|
121
|
+
size: "large",
|
|
122
|
+
src: profile,
|
|
123
|
+
testId: "profile"
|
|
124
|
+
}), (0, _react2.jsx)(_primitives.Flex, {
|
|
125
|
+
xcss: userDescriptionStyle
|
|
126
|
+
}, (0, _react2.jsx)("div", null, user.displayName)))
|
|
111
127
|
);
|
|
112
128
|
})))
|
|
113
129
|
);
|
|
@@ -110,7 +110,8 @@ var ReactionsDialog = exports.ReactionsDialog = function ReactionsDialog(_ref2)
|
|
|
110
110
|
_ref2$handleSelectRea = _ref2.handleSelectReaction,
|
|
111
111
|
handleSelectReaction = _ref2$handleSelectRea === void 0 ? function () {} : _ref2$handleSelectRea,
|
|
112
112
|
_ref2$handlePaginatio = _ref2.handlePaginationChange,
|
|
113
|
-
handlePaginationChange = _ref2$handlePaginatio === void 0 ? function () {} : _ref2$handlePaginatio
|
|
113
|
+
handlePaginationChange = _ref2$handlePaginatio === void 0 ? function () {} : _ref2$handlePaginatio,
|
|
114
|
+
ProfileCardWrapper = _ref2.ProfileCardWrapper;
|
|
114
115
|
var _useState = (0, _react.useState)(),
|
|
115
116
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
116
117
|
elementToScroll = _useState2[0],
|
|
@@ -251,7 +252,8 @@ var ReactionsDialog = exports.ReactionsDialog = function ReactionsDialog(_ref2)
|
|
|
251
252
|
initialEmojiId: selectedEmojiId,
|
|
252
253
|
reactions: currentReactions,
|
|
253
254
|
emojiProvider: emojiProvider,
|
|
254
|
-
onReactionChanged: handleSelectReaction
|
|
255
|
+
onReactionChanged: handleSelectReaction,
|
|
256
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
255
257
|
}))), (0, _react2.jsx)(_modalDialog.ModalFooter, null, (0, _react2.jsx)(_new.default, {
|
|
256
258
|
appearance: "subtle",
|
|
257
259
|
onClick: handleCloseReactionsDialog
|
|
@@ -32,7 +32,8 @@ var ReactionsList = exports.ReactionsList = function ReactionsList(_ref) {
|
|
|
32
32
|
var reactions = _ref.reactions,
|
|
33
33
|
initialEmojiId = _ref.initialEmojiId,
|
|
34
34
|
emojiProvider = _ref.emojiProvider,
|
|
35
|
-
onReactionChanged = _ref.onReactionChanged
|
|
35
|
+
onReactionChanged = _ref.onReactionChanged,
|
|
36
|
+
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
36
37
|
var _useState = (0, _react.useState)(function () {
|
|
37
38
|
// Calculate this only on initialize the List of Tabs and each Reactions View collection
|
|
38
39
|
return {
|
|
@@ -110,7 +111,8 @@ var ReactionsList = exports.ReactionsList = function ReactionsList(_ref) {
|
|
|
110
111
|
key: reaction.emojiId,
|
|
111
112
|
reaction: reaction,
|
|
112
113
|
selectedEmojiId: selectedEmoji.id,
|
|
113
|
-
emojiProvider: emojiProvider
|
|
114
|
+
emojiProvider: emojiProvider,
|
|
115
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
114
116
|
});
|
|
115
117
|
}));
|
|
116
118
|
};
|
|
@@ -130,7 +130,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
130
130
|
_ref$showAddReactionT = _ref.showAddReactionText,
|
|
131
131
|
showAddReactionText = _ref$showAddReactionT === void 0 ? false : _ref$showAddReactionT,
|
|
132
132
|
_ref$hideDefaultReact = _ref.hideDefaultReactions,
|
|
133
|
-
hideDefaultReactions = _ref$hideDefaultReact === void 0 ? false : _ref$hideDefaultReact
|
|
133
|
+
hideDefaultReactions = _ref$hideDefaultReact === void 0 ? false : _ref$hideDefaultReact,
|
|
134
|
+
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
134
135
|
var _useState = (0, _react.useState)(),
|
|
135
136
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
136
137
|
selectedEmojiId = _useState2[0],
|
|
@@ -370,7 +371,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
370
371
|
emojiProvider: emojiProvider,
|
|
371
372
|
handleCloseReactionsDialog: handleCloseReactionsDialog,
|
|
372
373
|
handleSelectReaction: handleSelectReactionInDialog,
|
|
373
|
-
handlePaginationChange: handlePaginationChange
|
|
374
|
+
handlePaginationChange: handlePaginationChange,
|
|
375
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
374
376
|
})))
|
|
375
377
|
);
|
|
376
378
|
});
|
|
@@ -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 = "24.
|
|
4
|
+
const packageVersion = "24.2.0";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|
|
@@ -11,13 +11,17 @@ import { ResourcedEmoji } from '@atlaskit/emoji/element';
|
|
|
11
11
|
import Avatar from '@atlaskit/avatar/Avatar';
|
|
12
12
|
import Spinner from '@atlaskit/spinner';
|
|
13
13
|
import { useTabPanel } from '@atlaskit/tabs';
|
|
14
|
-
import { Text } from '@atlaskit/primitives';
|
|
14
|
+
import { Text, Flex, xcss } from '@atlaskit/primitives';
|
|
15
15
|
import { messages } from '../../shared/i18n';
|
|
16
16
|
import { reactionViewStyle, userListStyle, userStyle, centerSpinner } from './styles';
|
|
17
|
+
const userDescriptionStyle = xcss({
|
|
18
|
+
marginLeft: 'space.200'
|
|
19
|
+
});
|
|
17
20
|
export const ReactionView = ({
|
|
18
21
|
selectedEmojiId,
|
|
19
22
|
emojiProvider,
|
|
20
|
-
reaction
|
|
23
|
+
reaction,
|
|
24
|
+
ProfileCardWrapper
|
|
21
25
|
}) => {
|
|
22
26
|
const [emojiShortName, setEmojiShortName] = useState('');
|
|
23
27
|
useEffect(() => {
|
|
@@ -54,7 +58,7 @@ export const ReactionView = ({
|
|
|
54
58
|
id: selectedEmojiId,
|
|
55
59
|
shortName: ''
|
|
56
60
|
},
|
|
57
|
-
fitToHeight:
|
|
61
|
+
fitToHeight: 24
|
|
58
62
|
})), alphabeticalNames.length === 0 ?
|
|
59
63
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
60
64
|
jsx("div", {
|
|
@@ -73,10 +77,22 @@ export const ReactionView = ({
|
|
|
73
77
|
jsx("li", {
|
|
74
78
|
css: userStyle,
|
|
75
79
|
key: user.id
|
|
80
|
+
}, ProfileCardWrapper && user.accountId ? jsx(ProfileCardWrapper, {
|
|
81
|
+
userId: user.accountId,
|
|
82
|
+
isAnonymous: false,
|
|
83
|
+
canViewProfile: true,
|
|
84
|
+
position: "left-start"
|
|
76
85
|
}, jsx(Avatar, {
|
|
77
86
|
size: "large",
|
|
78
|
-
src: profile
|
|
79
|
-
|
|
87
|
+
src: profile,
|
|
88
|
+
testId: "profile"
|
|
89
|
+
})) : jsx(Avatar, {
|
|
90
|
+
size: "large",
|
|
91
|
+
src: profile,
|
|
92
|
+
testId: "profile"
|
|
93
|
+
}), jsx(Flex, {
|
|
94
|
+
xcss: userDescriptionStyle
|
|
95
|
+
}, jsx("div", null, user.displayName)))
|
|
80
96
|
);
|
|
81
97
|
})))
|
|
82
98
|
);
|
|
@@ -86,7 +86,8 @@ export const ReactionsDialog = ({
|
|
|
86
86
|
emojiProvider,
|
|
87
87
|
selectedEmojiId,
|
|
88
88
|
handleSelectReaction = () => {},
|
|
89
|
-
handlePaginationChange = () => {}
|
|
89
|
+
handlePaginationChange = () => {},
|
|
90
|
+
ProfileCardWrapper
|
|
90
91
|
}) => {
|
|
91
92
|
var _currentReactions$;
|
|
92
93
|
const [elementToScroll, setElementToScroll] = useState();
|
|
@@ -215,7 +216,8 @@ export const ReactionsDialog = ({
|
|
|
215
216
|
initialEmojiId: selectedEmojiId,
|
|
216
217
|
reactions: currentReactions,
|
|
217
218
|
emojiProvider: emojiProvider,
|
|
218
|
-
onReactionChanged: handleSelectReaction
|
|
219
|
+
onReactionChanged: handleSelectReaction,
|
|
220
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
219
221
|
}))), jsx(ModalFooter, null, jsx(Button, {
|
|
220
222
|
appearance: "subtle",
|
|
221
223
|
onClick: handleCloseReactionsDialog
|
|
@@ -19,7 +19,8 @@ export const ReactionsList = ({
|
|
|
19
19
|
reactions,
|
|
20
20
|
initialEmojiId,
|
|
21
21
|
emojiProvider,
|
|
22
|
-
onReactionChanged
|
|
22
|
+
onReactionChanged,
|
|
23
|
+
ProfileCardWrapper
|
|
23
24
|
}) => {
|
|
24
25
|
const [selectedEmoji, setSelectedEmoji] = useState(() => {
|
|
25
26
|
// Calculate this only on initialize the List of Tabs and each Reactions View collection
|
|
@@ -91,6 +92,7 @@ export const ReactionsList = ({
|
|
|
91
92
|
key: reaction.emojiId,
|
|
92
93
|
reaction: reaction,
|
|
93
94
|
selectedEmojiId: selectedEmoji.id,
|
|
94
|
-
emojiProvider: emojiProvider
|
|
95
|
+
emojiProvider: emojiProvider,
|
|
96
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
95
97
|
})));
|
|
96
98
|
};
|
|
@@ -100,7 +100,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
100
100
|
showOpaqueBackground = false,
|
|
101
101
|
subtleReactionsSummaryAndPicker = false,
|
|
102
102
|
showAddReactionText = false,
|
|
103
|
-
hideDefaultReactions = false
|
|
103
|
+
hideDefaultReactions = false,
|
|
104
|
+
ProfileCardWrapper
|
|
104
105
|
}) => {
|
|
105
106
|
const [selectedEmojiId, setSelectedEmojiId] = useState();
|
|
106
107
|
const {
|
|
@@ -331,7 +332,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
331
332
|
emojiProvider: emojiProvider,
|
|
332
333
|
handleCloseReactionsDialog: handleCloseReactionsDialog,
|
|
333
334
|
handleSelectReaction: handleSelectReactionInDialog,
|
|
334
|
-
handlePaginationChange: handlePaginationChange
|
|
335
|
+
handlePaginationChange: handlePaginationChange,
|
|
336
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
335
337
|
})))
|
|
336
338
|
);
|
|
337
339
|
});
|
|
@@ -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 = "24.
|
|
7
|
+
var packageVersion = "24.2.0";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -14,13 +14,17 @@ import { ResourcedEmoji } from '@atlaskit/emoji/element';
|
|
|
14
14
|
import Avatar from '@atlaskit/avatar/Avatar';
|
|
15
15
|
import Spinner from '@atlaskit/spinner';
|
|
16
16
|
import { useTabPanel } from '@atlaskit/tabs';
|
|
17
|
-
import { Text } from '@atlaskit/primitives';
|
|
17
|
+
import { Text, Flex, xcss } from '@atlaskit/primitives';
|
|
18
18
|
import { messages } from '../../shared/i18n';
|
|
19
19
|
import { reactionViewStyle, userListStyle, userStyle, centerSpinner } from './styles';
|
|
20
|
+
var userDescriptionStyle = xcss({
|
|
21
|
+
marginLeft: 'space.200'
|
|
22
|
+
});
|
|
20
23
|
export var ReactionView = function ReactionView(_ref) {
|
|
21
24
|
var selectedEmojiId = _ref.selectedEmojiId,
|
|
22
25
|
emojiProvider = _ref.emojiProvider,
|
|
23
|
-
reaction = _ref.reaction
|
|
26
|
+
reaction = _ref.reaction,
|
|
27
|
+
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
24
28
|
var _useState = useState(''),
|
|
25
29
|
_useState2 = _slicedToArray(_useState, 2),
|
|
26
30
|
emojiShortName = _useState2[0],
|
|
@@ -76,7 +80,7 @@ export var ReactionView = function ReactionView(_ref) {
|
|
|
76
80
|
id: selectedEmojiId,
|
|
77
81
|
shortName: ''
|
|
78
82
|
},
|
|
79
|
-
fitToHeight:
|
|
83
|
+
fitToHeight: 24
|
|
80
84
|
})), alphabeticalNames.length === 0 ?
|
|
81
85
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
82
86
|
jsx("div", {
|
|
@@ -95,10 +99,22 @@ export var ReactionView = function ReactionView(_ref) {
|
|
|
95
99
|
jsx("li", {
|
|
96
100
|
css: userStyle,
|
|
97
101
|
key: user.id
|
|
102
|
+
}, ProfileCardWrapper && user.accountId ? jsx(ProfileCardWrapper, {
|
|
103
|
+
userId: user.accountId,
|
|
104
|
+
isAnonymous: false,
|
|
105
|
+
canViewProfile: true,
|
|
106
|
+
position: "left-start"
|
|
98
107
|
}, jsx(Avatar, {
|
|
99
108
|
size: "large",
|
|
100
|
-
src: profile
|
|
101
|
-
|
|
109
|
+
src: profile,
|
|
110
|
+
testId: "profile"
|
|
111
|
+
})) : jsx(Avatar, {
|
|
112
|
+
size: "large",
|
|
113
|
+
src: profile,
|
|
114
|
+
testId: "profile"
|
|
115
|
+
}), jsx(Flex, {
|
|
116
|
+
xcss: userDescriptionStyle
|
|
117
|
+
}, jsx("div", null, user.displayName)))
|
|
102
118
|
);
|
|
103
119
|
})))
|
|
104
120
|
);
|
|
@@ -98,7 +98,8 @@ export var ReactionsDialog = function ReactionsDialog(_ref2) {
|
|
|
98
98
|
_ref2$handleSelectRea = _ref2.handleSelectReaction,
|
|
99
99
|
handleSelectReaction = _ref2$handleSelectRea === void 0 ? function () {} : _ref2$handleSelectRea,
|
|
100
100
|
_ref2$handlePaginatio = _ref2.handlePaginationChange,
|
|
101
|
-
handlePaginationChange = _ref2$handlePaginatio === void 0 ? function () {} : _ref2$handlePaginatio
|
|
101
|
+
handlePaginationChange = _ref2$handlePaginatio === void 0 ? function () {} : _ref2$handlePaginatio,
|
|
102
|
+
ProfileCardWrapper = _ref2.ProfileCardWrapper;
|
|
102
103
|
var _useState = useState(),
|
|
103
104
|
_useState2 = _slicedToArray(_useState, 2),
|
|
104
105
|
elementToScroll = _useState2[0],
|
|
@@ -239,7 +240,8 @@ export var ReactionsDialog = function ReactionsDialog(_ref2) {
|
|
|
239
240
|
initialEmojiId: selectedEmojiId,
|
|
240
241
|
reactions: currentReactions,
|
|
241
242
|
emojiProvider: emojiProvider,
|
|
242
|
-
onReactionChanged: handleSelectReaction
|
|
243
|
+
onReactionChanged: handleSelectReaction,
|
|
244
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
243
245
|
}))), jsx(ModalFooter, null, jsx(Button, {
|
|
244
246
|
appearance: "subtle",
|
|
245
247
|
onClick: handleCloseReactionsDialog
|
|
@@ -20,7 +20,8 @@ export var ReactionsList = function ReactionsList(_ref) {
|
|
|
20
20
|
var reactions = _ref.reactions,
|
|
21
21
|
initialEmojiId = _ref.initialEmojiId,
|
|
22
22
|
emojiProvider = _ref.emojiProvider,
|
|
23
|
-
onReactionChanged = _ref.onReactionChanged
|
|
23
|
+
onReactionChanged = _ref.onReactionChanged,
|
|
24
|
+
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
24
25
|
var _useState = useState(function () {
|
|
25
26
|
// Calculate this only on initialize the List of Tabs and each Reactions View collection
|
|
26
27
|
return {
|
|
@@ -98,7 +99,8 @@ export var ReactionsList = function ReactionsList(_ref) {
|
|
|
98
99
|
key: reaction.emojiId,
|
|
99
100
|
reaction: reaction,
|
|
100
101
|
selectedEmojiId: selectedEmoji.id,
|
|
101
|
-
emojiProvider: emojiProvider
|
|
102
|
+
emojiProvider: emojiProvider,
|
|
103
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
102
104
|
});
|
|
103
105
|
}));
|
|
104
106
|
};
|
|
@@ -117,7 +117,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
117
117
|
_ref$showAddReactionT = _ref.showAddReactionText,
|
|
118
118
|
showAddReactionText = _ref$showAddReactionT === void 0 ? false : _ref$showAddReactionT,
|
|
119
119
|
_ref$hideDefaultReact = _ref.hideDefaultReactions,
|
|
120
|
-
hideDefaultReactions = _ref$hideDefaultReact === void 0 ? false : _ref$hideDefaultReact
|
|
120
|
+
hideDefaultReactions = _ref$hideDefaultReact === void 0 ? false : _ref$hideDefaultReact,
|
|
121
|
+
ProfileCardWrapper = _ref.ProfileCardWrapper;
|
|
121
122
|
var _useState = useState(),
|
|
122
123
|
_useState2 = _slicedToArray(_useState, 2),
|
|
123
124
|
selectedEmojiId = _useState2[0],
|
|
@@ -357,7 +358,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
357
358
|
emojiProvider: emojiProvider,
|
|
358
359
|
handleCloseReactionsDialog: handleCloseReactionsDialog,
|
|
359
360
|
handleSelectReaction: handleSelectReactionInDialog,
|
|
360
|
-
handlePaginationChange: handlePaginationChange
|
|
361
|
+
handlePaginationChange: handlePaginationChange,
|
|
362
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
361
363
|
})))
|
|
362
364
|
);
|
|
363
365
|
});
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
3
|
-
import { type ReactionSummary } from '../../types';
|
|
3
|
+
import { type ReactionSummary, type ProfileCardWrapper } from '../../types';
|
|
4
4
|
export interface ReactionViewProps {
|
|
5
5
|
/**
|
|
6
6
|
* Selected reaction to get user data from
|
|
@@ -14,5 +14,6 @@ export interface ReactionViewProps {
|
|
|
14
14
|
* Provider for loading emojis
|
|
15
15
|
*/
|
|
16
16
|
emojiProvider: Promise<EmojiProvider>;
|
|
17
|
+
ProfileCardWrapper?: ProfileCardWrapper;
|
|
17
18
|
}
|
|
18
|
-
export declare const ReactionView: ({ selectedEmojiId, emojiProvider, reaction }: ReactionViewProps) => jsx.JSX.Element;
|
|
19
|
+
export declare const ReactionView: ({ selectedEmojiId, emojiProvider, reaction, ProfileCardWrapper, }: ReactionViewProps) => jsx.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
3
3
|
import { type OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
4
|
-
import { type onDialogSelectReactionChange, type ReactionSummary } from '../../types';
|
|
4
|
+
import { type onDialogSelectReactionChange, type ReactionSummary, type ProfileCardWrapper } from '../../types';
|
|
5
5
|
/**
|
|
6
6
|
* Test id for the Reactions modal dialog
|
|
7
7
|
*/
|
|
@@ -28,5 +28,6 @@ export interface ReactionsDialogProps {
|
|
|
28
28
|
*/
|
|
29
29
|
handleSelectReaction?: onDialogSelectReactionChange;
|
|
30
30
|
handlePaginationChange?: (emojiId: string) => void;
|
|
31
|
+
ProfileCardWrapper?: ProfileCardWrapper;
|
|
31
32
|
}
|
|
32
|
-
export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, }: ReactionsDialogProps) => jsx.JSX.Element;
|
|
33
|
+
export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, ProfileCardWrapper, }: ReactionsDialogProps) => jsx.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
3
|
-
import { type onDialogSelectReactionChange, type ReactionSummary } from '../../types';
|
|
3
|
+
import { type onDialogSelectReactionChange, type ReactionSummary, type ProfileCardWrapper } from '../../types';
|
|
4
4
|
export interface ReactionsListProps {
|
|
5
5
|
/**
|
|
6
6
|
* Sorted list of reactions to render in list
|
|
@@ -18,5 +18,9 @@ export interface ReactionsListProps {
|
|
|
18
18
|
* Function to handle clicking on an emoji from the list
|
|
19
19
|
*/
|
|
20
20
|
onReactionChanged: onDialogSelectReactionChange;
|
|
21
|
+
/**
|
|
22
|
+
* A functional component from Confluence to show a profile card on hover
|
|
23
|
+
*/
|
|
24
|
+
ProfileCardWrapper?: ProfileCardWrapper;
|
|
21
25
|
}
|
|
22
|
-
export declare const ReactionsList: ({ reactions, initialEmojiId, emojiProvider, onReactionChanged, }: ReactionsListProps) => jsx.JSX.Element;
|
|
26
|
+
export declare const ReactionsList: ({ reactions, initialEmojiId, emojiProvider, onReactionChanged, ProfileCardWrapper, }: ReactionsListProps) => jsx.JSX.Element;
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
8
8
|
import { type Placement } from '@atlaskit/popper';
|
|
9
|
-
import { type onDialogSelectReactionChange, ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary } from '../../types';
|
|
9
|
+
import { type onDialogSelectReactionChange, ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary, type ProfileCardWrapper } from '../../types';
|
|
10
10
|
import { type ReactionProps } from '../Reaction';
|
|
11
11
|
import { type ReactionPickerProps } from '../ReactionPicker';
|
|
12
12
|
import { type SelectorProps } from '../Selector';
|
|
@@ -126,6 +126,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
126
126
|
* Optional prop for hiding default reactions displayed when there are no existing reactions
|
|
127
127
|
*/
|
|
128
128
|
hideDefaultReactions?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Optional prop for rendering a profile card wrapper in the Reactions Dialog
|
|
131
|
+
*/
|
|
132
|
+
ProfileCardWrapper?: ProfileCardWrapper;
|
|
129
133
|
}
|
|
130
134
|
/**
|
|
131
135
|
* Get content of the tooltip
|
|
@@ -134,4 +138,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
134
138
|
/**
|
|
135
139
|
* Renders list of reactions
|
|
136
140
|
*/
|
|
137
|
-
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, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, }: ReactionsProps) => jsx.JSX.Element>;
|
|
141
|
+
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, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, }: ReactionsProps) => jsx.JSX.Element>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
export type { ReactionAction, Actions } from './Actions';
|
|
2
3
|
export { ReactionStatus, ReactionUpdateType } from './reaction';
|
|
3
4
|
export type { ReactionSource, ReactionsError, ReactionsLoading, ReactionsReadyState, ReactionsState, ReactionSummary, ReactionFocused, QuickReactionEmojiSummary, ReactionsNotLoaded, Reactions, ReactionClick, ReactionMouseEnter, onDialogSelectReactionChange, } from './reaction';
|
|
@@ -5,3 +6,17 @@ export type { Client, Request } from './client';
|
|
|
5
6
|
export type { Updater } from './Updater';
|
|
6
7
|
export type { User } from './User';
|
|
7
8
|
export type { Store, StorePropInput, State, OnChangeCallback } from './store';
|
|
9
|
+
type TriggerPosition = 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' | 'top-end' | 'top' | 'top-start' | 'right-end' | 'right' | 'right-start';
|
|
10
|
+
type ProfileCardWrapperProps = {
|
|
11
|
+
userId?: string | null;
|
|
12
|
+
position?: TriggerPosition;
|
|
13
|
+
isAnonymous?: boolean;
|
|
14
|
+
canViewProfile?: boolean;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
fullName?: string;
|
|
17
|
+
disabledAriaAttributes?: boolean;
|
|
18
|
+
onVisibilityChange?: (isVisible: boolean) => void;
|
|
19
|
+
offset?: [number, number];
|
|
20
|
+
ariaLabel?: string;
|
|
21
|
+
};
|
|
22
|
+
export type ProfileCardWrapper = React.ComponentType<ProfileCardWrapperProps>;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
3
|
-
import { type ReactionSummary } from '../../types';
|
|
3
|
+
import { type ReactionSummary, type ProfileCardWrapper } from '../../types';
|
|
4
4
|
export interface ReactionViewProps {
|
|
5
5
|
/**
|
|
6
6
|
* Selected reaction to get user data from
|
|
@@ -14,5 +14,6 @@ export interface ReactionViewProps {
|
|
|
14
14
|
* Provider for loading emojis
|
|
15
15
|
*/
|
|
16
16
|
emojiProvider: Promise<EmojiProvider>;
|
|
17
|
+
ProfileCardWrapper?: ProfileCardWrapper;
|
|
17
18
|
}
|
|
18
|
-
export declare const ReactionView: ({ selectedEmojiId, emojiProvider, reaction }: ReactionViewProps) => jsx.JSX.Element;
|
|
19
|
+
export declare const ReactionView: ({ selectedEmojiId, emojiProvider, reaction, ProfileCardWrapper, }: ReactionViewProps) => jsx.JSX.Element;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
3
3
|
import { type OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
4
|
-
import { type onDialogSelectReactionChange, type ReactionSummary } from '../../types';
|
|
4
|
+
import { type onDialogSelectReactionChange, type ReactionSummary, type ProfileCardWrapper } from '../../types';
|
|
5
5
|
/**
|
|
6
6
|
* Test id for the Reactions modal dialog
|
|
7
7
|
*/
|
|
@@ -28,5 +28,6 @@ export interface ReactionsDialogProps {
|
|
|
28
28
|
*/
|
|
29
29
|
handleSelectReaction?: onDialogSelectReactionChange;
|
|
30
30
|
handlePaginationChange?: (emojiId: string) => void;
|
|
31
|
+
ProfileCardWrapper?: ProfileCardWrapper;
|
|
31
32
|
}
|
|
32
|
-
export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, }: ReactionsDialogProps) => jsx.JSX.Element;
|
|
33
|
+
export declare const ReactionsDialog: ({ reactions, handleCloseReactionsDialog, emojiProvider, selectedEmojiId, handleSelectReaction, handlePaginationChange, ProfileCardWrapper, }: ReactionsDialogProps) => jsx.JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
2
|
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
3
|
-
import { type onDialogSelectReactionChange, type ReactionSummary } from '../../types';
|
|
3
|
+
import { type onDialogSelectReactionChange, type ReactionSummary, type ProfileCardWrapper } from '../../types';
|
|
4
4
|
export interface ReactionsListProps {
|
|
5
5
|
/**
|
|
6
6
|
* Sorted list of reactions to render in list
|
|
@@ -18,5 +18,9 @@ export interface ReactionsListProps {
|
|
|
18
18
|
* Function to handle clicking on an emoji from the list
|
|
19
19
|
*/
|
|
20
20
|
onReactionChanged: onDialogSelectReactionChange;
|
|
21
|
+
/**
|
|
22
|
+
* A functional component from Confluence to show a profile card on hover
|
|
23
|
+
*/
|
|
24
|
+
ProfileCardWrapper?: ProfileCardWrapper;
|
|
21
25
|
}
|
|
22
|
-
export declare const ReactionsList: ({ reactions, initialEmojiId, emojiProvider, onReactionChanged, }: ReactionsListProps) => jsx.JSX.Element;
|
|
26
|
+
export declare const ReactionsList: ({ reactions, initialEmojiId, emojiProvider, onReactionChanged, ProfileCardWrapper, }: ReactionsListProps) => jsx.JSX.Element;
|
|
@@ -6,7 +6,7 @@ import React from 'react';
|
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type OnCloseHandler } from '@atlaskit/modal-dialog';
|
|
8
8
|
import { type Placement } from '@atlaskit/popper';
|
|
9
|
-
import { type onDialogSelectReactionChange, ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary } from '../../types';
|
|
9
|
+
import { type onDialogSelectReactionChange, ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary, type ProfileCardWrapper } from '../../types';
|
|
10
10
|
import { type ReactionProps } from '../Reaction';
|
|
11
11
|
import { type ReactionPickerProps } from '../ReactionPicker';
|
|
12
12
|
import { type SelectorProps } from '../Selector';
|
|
@@ -126,6 +126,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
126
126
|
* Optional prop for hiding default reactions displayed when there are no existing reactions
|
|
127
127
|
*/
|
|
128
128
|
hideDefaultReactions?: boolean;
|
|
129
|
+
/**
|
|
130
|
+
* Optional prop for rendering a profile card wrapper in the Reactions Dialog
|
|
131
|
+
*/
|
|
132
|
+
ProfileCardWrapper?: ProfileCardWrapper;
|
|
129
133
|
}
|
|
130
134
|
/**
|
|
131
135
|
* Get content of the tooltip
|
|
@@ -134,4 +138,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
134
138
|
/**
|
|
135
139
|
* Renders list of reactions
|
|
136
140
|
*/
|
|
137
|
-
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, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, }: ReactionsProps) => jsx.JSX.Element>;
|
|
141
|
+
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, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, }: ReactionsProps) => jsx.JSX.Element>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
1
2
|
export type { ReactionAction, Actions } from './Actions';
|
|
2
3
|
export { ReactionStatus, ReactionUpdateType } from './reaction';
|
|
3
4
|
export type { ReactionSource, ReactionsError, ReactionsLoading, ReactionsReadyState, ReactionsState, ReactionSummary, ReactionFocused, QuickReactionEmojiSummary, ReactionsNotLoaded, Reactions, ReactionClick, ReactionMouseEnter, onDialogSelectReactionChange, } from './reaction';
|
|
@@ -5,3 +6,20 @@ export type { Client, Request } from './client';
|
|
|
5
6
|
export type { Updater } from './Updater';
|
|
6
7
|
export type { User } from './User';
|
|
7
8
|
export type { Store, StorePropInput, State, OnChangeCallback } from './store';
|
|
9
|
+
type TriggerPosition = 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' | 'top-end' | 'top' | 'top-start' | 'right-end' | 'right' | 'right-start';
|
|
10
|
+
type ProfileCardWrapperProps = {
|
|
11
|
+
userId?: string | null;
|
|
12
|
+
position?: TriggerPosition;
|
|
13
|
+
isAnonymous?: boolean;
|
|
14
|
+
canViewProfile?: boolean;
|
|
15
|
+
children: ReactNode;
|
|
16
|
+
fullName?: string;
|
|
17
|
+
disabledAriaAttributes?: boolean;
|
|
18
|
+
onVisibilityChange?: (isVisible: boolean) => void;
|
|
19
|
+
offset?: [
|
|
20
|
+
number,
|
|
21
|
+
number
|
|
22
|
+
];
|
|
23
|
+
ariaLabel?: string;
|
|
24
|
+
};
|
|
25
|
+
export type ProfileCardWrapper = React.ComponentType<ProfileCardWrapperProps>;
|