@atlaskit/reactions 26.3.1 → 26.4.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 +17 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/ReactionPicker/ReactionPicker.js +25 -9
- package/dist/cjs/components/Reactions/Reactions.js +28 -3
- package/dist/cjs/components/Reactions/styles.js +1 -15
- package/dist/cjs/components/Trigger/Trigger.js +5 -2
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/ReactionPicker/ReactionPicker.js +14 -2
- package/dist/es2019/components/Reactions/Reactions.js +27 -5
- package/dist/es2019/components/Reactions/styles.js +0 -14
- package/dist/es2019/components/Trigger/Trigger.js +5 -2
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/ReactionPicker/ReactionPicker.js +26 -10
- package/dist/esm/components/Reactions/Reactions.js +29 -5
- package/dist/esm/components/Reactions/styles.js +0 -14
- package/dist/esm/components/Trigger/Trigger.js +5 -2
- package/dist/types/components/ReactionPicker/ReactionPicker.d.ts +5 -0
- package/dist/types/components/Reactions/Reactions.d.ts +11 -1
- package/dist/types/components/Reactions/styles.d.ts +0 -1
- package/dist/types/components/Trigger/Trigger.d.ts +5 -0
- package/dist/types-ts4.5/components/ReactionPicker/ReactionPicker.d.ts +5 -0
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +11 -1
- package/dist/types-ts4.5/components/Reactions/styles.d.ts +0 -1
- package/dist/types-ts4.5/components/Trigger/Trigger.d.ts +5 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 26.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#117805](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/117805)
|
|
8
|
+
[`1eed800de1541`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/1eed800de1541) -
|
|
9
|
+
added conditional styles for container wrap and positioning
|
|
10
|
+
|
|
11
|
+
## 26.3.2
|
|
12
|
+
|
|
13
|
+
### Patch Changes
|
|
14
|
+
|
|
15
|
+
- [#118247](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/118247)
|
|
16
|
+
[`e1a483946dc0d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/e1a483946dc0d) -
|
|
17
|
+
[ux] Passing additional prop named reactionPickerAdditionalStyle to enable selected state on the
|
|
18
|
+
reaction picker
|
|
19
|
+
|
|
3
20
|
## 26.3.1
|
|
4
21
|
|
|
5
22
|
### 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 = "26.
|
|
14
|
+
var packageVersion = "26.4.0";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -97,7 +97,9 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
|
|
|
97
97
|
_props$showAddReactio = props.showAddReactionText,
|
|
98
98
|
showAddReactionText = _props$showAddReactio === void 0 ? false : _props$showAddReactio,
|
|
99
99
|
_props$showRoundTrigg = props.showRoundTrigger,
|
|
100
|
-
showRoundTrigger = _props$showRoundTrigg === void 0 ? false : _props$showRoundTrigg
|
|
100
|
+
showRoundTrigger = _props$showRoundTrigg === void 0 ? false : _props$showRoundTrigg,
|
|
101
|
+
_props$reactionPicker = props.reactionPickerAdditionalStyle,
|
|
102
|
+
reactionPickerAdditionalStyle = _props$reactionPicker === void 0 ? undefined : _props$reactionPicker;
|
|
101
103
|
var _useState = (0, _react.useState)(null),
|
|
102
104
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
103
105
|
triggerRef = _useState2[0],
|
|
@@ -107,8 +109,12 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
|
|
|
107
109
|
* Container <div /> reference (used by custom hook to detect click outside)
|
|
108
110
|
*/
|
|
109
111
|
var wrapperRef = (0, _react.useRef)(null);
|
|
112
|
+
var _useState3 = (0, _react.useState)(undefined),
|
|
113
|
+
_useState4 = (0, _slicedToArray2.default)(_useState3, 2),
|
|
114
|
+
selectionStyle = _useState4[0],
|
|
115
|
+
setSelectionStyle = _useState4[1];
|
|
110
116
|
var updatePopper = (0, _react.useRef)();
|
|
111
|
-
var
|
|
117
|
+
var _useState5 = (0, _react.useState)({
|
|
112
118
|
/**
|
|
113
119
|
* Show the picker floating panel
|
|
114
120
|
*/
|
|
@@ -122,9 +128,9 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
|
|
|
122
128
|
*/
|
|
123
129
|
useLeftPopperPlacement: showRoundTrigger
|
|
124
130
|
}),
|
|
125
|
-
|
|
126
|
-
settings =
|
|
127
|
-
setSettings =
|
|
131
|
+
_useState6 = (0, _slicedToArray2.default)(_useState5, 2),
|
|
132
|
+
settings = _useState6[0],
|
|
133
|
+
setSettings = _useState6[1];
|
|
128
134
|
|
|
129
135
|
/**
|
|
130
136
|
* Custom hook triggers when user clicks outside the reactions picker
|
|
@@ -199,6 +205,15 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
|
|
|
199
205
|
// ufo reactions picker opened success
|
|
200
206
|
_ufo.PickerRender.success();
|
|
201
207
|
};
|
|
208
|
+
(0, _react.useEffect)(function () {
|
|
209
|
+
if (settings.isOpen) {
|
|
210
|
+
setSelectionStyle(reactionPickerAdditionalStyle);
|
|
211
|
+
}
|
|
212
|
+
return function () {
|
|
213
|
+
setSelectionStyle(undefined);
|
|
214
|
+
};
|
|
215
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
216
|
+
}, [settings.isOpen]);
|
|
202
217
|
var wrapperClassName = " ".concat(settings.isOpen ? 'isOpen' : '', " ").concat(miniMode ? 'miniMode' : '', " ").concat(className);
|
|
203
218
|
(0, _react.useLayoutEffect)(function () {
|
|
204
219
|
var _updatePopper$current;
|
|
@@ -231,6 +246,7 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
|
|
|
231
246
|
setTriggerRef(node);
|
|
232
247
|
}
|
|
233
248
|
},
|
|
249
|
+
selectionStyle: selectionStyle,
|
|
234
250
|
onClick: onTriggerClick,
|
|
235
251
|
miniMode: miniMode,
|
|
236
252
|
disabled: disabled,
|
|
@@ -262,10 +278,10 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
|
|
|
262
278
|
var PopperWrapper = exports.PopperWrapper = function PopperWrapper(props) {
|
|
263
279
|
var settings = props.settings,
|
|
264
280
|
children = props.children;
|
|
265
|
-
var
|
|
266
|
-
|
|
267
|
-
popupRef =
|
|
268
|
-
setPopupRef =
|
|
281
|
+
var _useState7 = (0, _react.useState)(null),
|
|
282
|
+
_useState8 = (0, _slicedToArray2.default)(_useState7, 2),
|
|
283
|
+
popupRef = _useState8[0],
|
|
284
|
+
setPopupRef = _useState8[1];
|
|
269
285
|
/**
|
|
270
286
|
* add focus lock to popup
|
|
271
287
|
*/
|
|
@@ -36,6 +36,25 @@ function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e;
|
|
|
36
36
|
|
|
37
37
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
38
38
|
|
|
39
|
+
var wrapperStyle = (0, _react2.css)({
|
|
40
|
+
display: 'flex',
|
|
41
|
+
flexWrap: 'wrap',
|
|
42
|
+
position: 'relative',
|
|
43
|
+
alignItems: 'center',
|
|
44
|
+
borderRadius: '15px',
|
|
45
|
+
marginTop: "var(--ds-space-negative-050, -4px)",
|
|
46
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
47
|
+
'> :first-of-type > :first-of-type': {
|
|
48
|
+
marginLeft: 0
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
var noFlexWrapStyles = (0, _react2.css)({
|
|
52
|
+
flexWrap: 'nowrap'
|
|
53
|
+
});
|
|
54
|
+
var noContainerPositionStyles = (0, _react2.css)({
|
|
55
|
+
position: 'initial'
|
|
56
|
+
});
|
|
57
|
+
|
|
39
58
|
/**
|
|
40
59
|
* Set of all available UFO experiences relating to Reactions Dialog
|
|
41
60
|
*/
|
|
@@ -134,7 +153,12 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
134
153
|
_ref$showRoundTrigger = _ref.showRoundTrigger,
|
|
135
154
|
showRoundTrigger = _ref$showRoundTrigger === void 0 ? false : _ref$showRoundTrigger,
|
|
136
155
|
_ref$isViewOnly = _ref.isViewOnly,
|
|
137
|
-
isViewOnly = _ref$isViewOnly === void 0 ? false : _ref$isViewOnly
|
|
156
|
+
isViewOnly = _ref$isViewOnly === void 0 ? false : _ref$isViewOnly,
|
|
157
|
+
reactionPickerAdditionalStyle = _ref.reactionPickerAdditionalStyle,
|
|
158
|
+
_ref$noWrap = _ref.noWrap,
|
|
159
|
+
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
|
|
160
|
+
_ref$noRelativeContai = _ref.noRelativeContainer,
|
|
161
|
+
noRelativeContainer = _ref$noRelativeContai === void 0 ? false : _ref$noRelativeContai;
|
|
138
162
|
var _useState = (0, _react.useState)(),
|
|
139
163
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
140
164
|
selectedEmojiId = _useState2[0],
|
|
@@ -286,7 +310,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
286
310
|
return (0, _react2.jsx)(_segment.default, {
|
|
287
311
|
name: "reactions"
|
|
288
312
|
}, (0, _react2.jsx)("div", {
|
|
289
|
-
css:
|
|
313
|
+
css: [wrapperStyle, noWrap && noFlexWrapStyles, noRelativeContainer && noContainerPositionStyles],
|
|
290
314
|
"data-testid": RENDER_REACTIONS_TESTID
|
|
291
315
|
}, !onlyRenderPicker && (shouldShowSummaryView ? (0, _react2.jsx)("div", {
|
|
292
316
|
"data-testid": RENDER_REACTIONS_SUMMARY_TESTID
|
|
@@ -341,7 +365,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
341
365
|
showOpaqueBackground: showOpaqueBackground,
|
|
342
366
|
showAddReactionText: showAddReactionText,
|
|
343
367
|
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
344
|
-
showRoundTrigger: showRoundTrigger
|
|
368
|
+
showRoundTrigger: showRoundTrigger,
|
|
369
|
+
reactionPickerAdditionalStyle: reactionPickerAdditionalStyle
|
|
345
370
|
}), (0, _react2.jsx)(_modalDialog.ModalTransition, null, !!selectedEmojiId && (0, _react2.jsx)(_segment.default, {
|
|
346
371
|
name: "reactions-dialog"
|
|
347
372
|
}, (0, _react2.jsx)(_ReactionDialog.ReactionsDialog, {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
6
|
+
exports.reactionPickerStyle = void 0;
|
|
7
7
|
var _react = require("@emotion/react");
|
|
8
8
|
/**
|
|
9
9
|
* @jsxRuntime classic
|
|
@@ -15,18 +15,4 @@ var _react = require("@emotion/react");
|
|
|
15
15
|
var reactionPickerStyle = exports.reactionPickerStyle = (0, _react.css)({
|
|
16
16
|
display: 'inline-block',
|
|
17
17
|
marginTop: "var(--ds-space-050, 4px)"
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
21
|
-
var wrapperStyle = exports.wrapperStyle = (0, _react.css)({
|
|
22
|
-
display: 'flex',
|
|
23
|
-
flexWrap: 'wrap',
|
|
24
|
-
position: 'relative',
|
|
25
|
-
alignItems: 'center',
|
|
26
|
-
borderRadius: '15px',
|
|
27
|
-
marginTop: "var(--ds-space-negative-050, -4px)",
|
|
28
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
29
|
-
'> :first-of-type > :first-of-type': {
|
|
30
|
-
marginLeft: 0
|
|
31
|
-
}
|
|
32
18
|
});
|
|
@@ -116,7 +116,8 @@ var Trigger = exports.Trigger = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
116
116
|
_props$subtleReaction = props.subtleReactionsSummaryAndPicker,
|
|
117
117
|
subtleReactionsSummaryAndPicker = _props$subtleReaction === void 0 ? false : _props$subtleReaction,
|
|
118
118
|
_props$showRoundTrigg = props.showRoundTrigger,
|
|
119
|
-
showRoundTrigger = _props$showRoundTrigg === void 0 ? false : _props$showRoundTrigg
|
|
119
|
+
showRoundTrigger = _props$showRoundTrigg === void 0 ? false : _props$showRoundTrigg,
|
|
120
|
+
selectionStyle = props.selectionStyle;
|
|
120
121
|
var handleMouseDown = function handleMouseDown(e, analyticsEvent) {
|
|
121
122
|
if (onClick && !disabled) {
|
|
122
123
|
onClick(e, analyticsEvent);
|
|
@@ -127,7 +128,9 @@ var Trigger = exports.Trigger = /*#__PURE__*/_react.default.forwardRef(function
|
|
|
127
128
|
content: tooltipContent
|
|
128
129
|
}, (0, _react2.jsx)(_primitives.Pressable, (0, _extends2.default)({
|
|
129
130
|
testId: RENDER_TRIGGER_BUTTON_TESTID,
|
|
130
|
-
xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && triggerStylesRefresh, showRoundTrigger && roundTriggerStyles
|
|
131
|
+
xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, (0, _platformFeatureFlags.fg)('platform-component-visual-refresh') && triggerStylesRefresh, showRoundTrigger && roundTriggerStyles,
|
|
132
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
133
|
+
selectionStyle],
|
|
131
134
|
onClick: handleMouseDown,
|
|
132
135
|
isDisabled: disabled,
|
|
133
136
|
ref: ref
|
|
@@ -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 = "26.
|
|
4
|
+
const packageVersion = "26.4.0";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @jsxRuntime classic
|
|
3
3
|
* @jsx jsx
|
|
4
4
|
*/
|
|
5
|
-
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
5
|
+
import React, { useCallback, useLayoutEffect, useRef, useState, useEffect } from 'react';
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
7
|
import { jsx } from '@emotion/react';
|
|
8
8
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -79,7 +79,8 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
79
79
|
showOpaqueBackground = false,
|
|
80
80
|
subtleReactionsSummaryAndPicker = false,
|
|
81
81
|
showAddReactionText = false,
|
|
82
|
-
showRoundTrigger = false
|
|
82
|
+
showRoundTrigger = false,
|
|
83
|
+
reactionPickerAdditionalStyle = undefined
|
|
83
84
|
} = props;
|
|
84
85
|
const [triggerRef, setTriggerRef] = useState(null);
|
|
85
86
|
|
|
@@ -87,6 +88,7 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
87
88
|
* Container <div /> reference (used by custom hook to detect click outside)
|
|
88
89
|
*/
|
|
89
90
|
const wrapperRef = useRef(null);
|
|
91
|
+
const [selectionStyle, setSelectionStyle] = useState(undefined);
|
|
90
92
|
const updatePopper = useRef();
|
|
91
93
|
const [settings, setSettings] = useState({
|
|
92
94
|
/**
|
|
@@ -175,6 +177,15 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
175
177
|
// ufo reactions picker opened success
|
|
176
178
|
PickerRender.success();
|
|
177
179
|
};
|
|
180
|
+
useEffect(() => {
|
|
181
|
+
if (settings.isOpen) {
|
|
182
|
+
setSelectionStyle(reactionPickerAdditionalStyle);
|
|
183
|
+
}
|
|
184
|
+
return () => {
|
|
185
|
+
setSelectionStyle(undefined);
|
|
186
|
+
};
|
|
187
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
188
|
+
}, [settings.isOpen]);
|
|
178
189
|
const wrapperClassName = ` ${settings.isOpen ? 'isOpen' : ''} ${miniMode ? 'miniMode' : ''} ${className}`;
|
|
179
190
|
useLayoutEffect(() => {
|
|
180
191
|
var _updatePopper$current;
|
|
@@ -207,6 +218,7 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
207
218
|
setTriggerRef(node);
|
|
208
219
|
}
|
|
209
220
|
},
|
|
221
|
+
selectionStyle: selectionStyle,
|
|
210
222
|
onClick: onTriggerClick,
|
|
211
223
|
miniMode: miniMode,
|
|
212
224
|
disabled: disabled,
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
6
6
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
7
|
-
import { jsx } from '@emotion/react';
|
|
7
|
+
import { css, jsx } from '@emotion/react';
|
|
8
8
|
import { FormattedMessage } from 'react-intl-next';
|
|
9
9
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
10
|
import { ModalTransition } from '@atlaskit/modal-dialog';
|
|
@@ -19,7 +19,25 @@ import { Reaction } from '../Reaction';
|
|
|
19
19
|
import { ReactionsDialog } from '../ReactionDialog';
|
|
20
20
|
import { ReactionPicker } from '../ReactionPicker';
|
|
21
21
|
import { ReactionSummaryView } from '../ReactionSummary/';
|
|
22
|
-
import { reactionPickerStyle
|
|
22
|
+
import { reactionPickerStyle } from './styles';
|
|
23
|
+
const wrapperStyle = css({
|
|
24
|
+
display: 'flex',
|
|
25
|
+
flexWrap: 'wrap',
|
|
26
|
+
position: 'relative',
|
|
27
|
+
alignItems: 'center',
|
|
28
|
+
borderRadius: '15px',
|
|
29
|
+
marginTop: "var(--ds-space-negative-050, -4px)",
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
31
|
+
'> :first-of-type > :first-of-type': {
|
|
32
|
+
marginLeft: 0
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
const noFlexWrapStyles = css({
|
|
36
|
+
flexWrap: 'nowrap'
|
|
37
|
+
});
|
|
38
|
+
const noContainerPositionStyles = css({
|
|
39
|
+
position: 'initial'
|
|
40
|
+
});
|
|
23
41
|
|
|
24
42
|
/**
|
|
25
43
|
* Set of all available UFO experiences relating to Reactions Dialog
|
|
@@ -100,7 +118,10 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
100
118
|
ProfileCardWrapper,
|
|
101
119
|
onlyRenderPicker = false,
|
|
102
120
|
showRoundTrigger = false,
|
|
103
|
-
isViewOnly = false
|
|
121
|
+
isViewOnly = false,
|
|
122
|
+
reactionPickerAdditionalStyle,
|
|
123
|
+
noWrap = false,
|
|
124
|
+
noRelativeContainer = false
|
|
104
125
|
}) => {
|
|
105
126
|
const [selectedEmojiId, setSelectedEmojiId] = useState();
|
|
106
127
|
const {
|
|
@@ -241,7 +262,7 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
241
262
|
return jsx(UFOSegment, {
|
|
242
263
|
name: "reactions"
|
|
243
264
|
}, jsx("div", {
|
|
244
|
-
css: wrapperStyle,
|
|
265
|
+
css: [wrapperStyle, noWrap && noFlexWrapStyles, noRelativeContainer && noContainerPositionStyles],
|
|
245
266
|
"data-testid": RENDER_REACTIONS_TESTID
|
|
246
267
|
}, !onlyRenderPicker && (shouldShowSummaryView ? jsx("div", {
|
|
247
268
|
"data-testid": RENDER_REACTIONS_SUMMARY_TESTID
|
|
@@ -292,7 +313,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
292
313
|
showOpaqueBackground: showOpaqueBackground,
|
|
293
314
|
showAddReactionText: showAddReactionText,
|
|
294
315
|
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
295
|
-
showRoundTrigger: showRoundTrigger
|
|
316
|
+
showRoundTrigger: showRoundTrigger,
|
|
317
|
+
reactionPickerAdditionalStyle: reactionPickerAdditionalStyle
|
|
296
318
|
}), jsx(ModalTransition, null, !!selectedEmojiId && jsx(UFOSegment, {
|
|
297
319
|
name: "reactions-dialog"
|
|
298
320
|
}, jsx(ReactionsDialog, {
|
|
@@ -8,18 +8,4 @@ import { css } from '@emotion/react';
|
|
|
8
8
|
export const reactionPickerStyle = css({
|
|
9
9
|
display: 'inline-block',
|
|
10
10
|
marginTop: "var(--ds-space-050, 4px)"
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
14
|
-
export const wrapperStyle = css({
|
|
15
|
-
display: 'flex',
|
|
16
|
-
flexWrap: 'wrap',
|
|
17
|
-
position: 'relative',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
borderRadius: '15px',
|
|
20
|
-
marginTop: "var(--ds-space-negative-050, -4px)",
|
|
21
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
22
|
-
'> :first-of-type > :first-of-type': {
|
|
23
|
-
marginLeft: 0
|
|
24
|
-
}
|
|
25
11
|
});
|
|
@@ -104,7 +104,8 @@ export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
104
104
|
showOpaqueBackground = false,
|
|
105
105
|
showAddReactionText = false,
|
|
106
106
|
subtleReactionsSummaryAndPicker = false,
|
|
107
|
-
showRoundTrigger = false
|
|
107
|
+
showRoundTrigger = false,
|
|
108
|
+
selectionStyle
|
|
108
109
|
} = props;
|
|
109
110
|
const handleMouseDown = (e, analyticsEvent) => {
|
|
110
111
|
if (onClick && !disabled) {
|
|
@@ -116,7 +117,9 @@ export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
116
117
|
content: tooltipContent
|
|
117
118
|
}, jsx(Pressable, _extends({
|
|
118
119
|
testId: RENDER_TRIGGER_BUTTON_TESTID,
|
|
119
|
-
xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh, showRoundTrigger && roundTriggerStyles
|
|
120
|
+
xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh, showRoundTrigger && roundTriggerStyles,
|
|
121
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
122
|
+
selectionStyle],
|
|
120
123
|
onClick: handleMouseDown,
|
|
121
124
|
isDisabled: disabled,
|
|
122
125
|
ref: ref
|
|
@@ -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 = "26.
|
|
7
|
+
var packageVersion = "26.4.0";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -6,7 +6,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
6
6
|
* @jsxRuntime classic
|
|
7
7
|
* @jsx jsx
|
|
8
8
|
*/
|
|
9
|
-
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
9
|
+
import React, { useCallback, useLayoutEffect, useRef, useState, useEffect } from 'react';
|
|
10
10
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
11
11
|
import { jsx } from '@emotion/react';
|
|
12
12
|
import { FormattedMessage } from 'react-intl-next';
|
|
@@ -90,7 +90,9 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
90
90
|
_props$showAddReactio = props.showAddReactionText,
|
|
91
91
|
showAddReactionText = _props$showAddReactio === void 0 ? false : _props$showAddReactio,
|
|
92
92
|
_props$showRoundTrigg = props.showRoundTrigger,
|
|
93
|
-
showRoundTrigger = _props$showRoundTrigg === void 0 ? false : _props$showRoundTrigg
|
|
93
|
+
showRoundTrigger = _props$showRoundTrigg === void 0 ? false : _props$showRoundTrigg,
|
|
94
|
+
_props$reactionPicker = props.reactionPickerAdditionalStyle,
|
|
95
|
+
reactionPickerAdditionalStyle = _props$reactionPicker === void 0 ? undefined : _props$reactionPicker;
|
|
94
96
|
var _useState = useState(null),
|
|
95
97
|
_useState2 = _slicedToArray(_useState, 2),
|
|
96
98
|
triggerRef = _useState2[0],
|
|
@@ -100,8 +102,12 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
100
102
|
* Container <div /> reference (used by custom hook to detect click outside)
|
|
101
103
|
*/
|
|
102
104
|
var wrapperRef = useRef(null);
|
|
105
|
+
var _useState3 = useState(undefined),
|
|
106
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
107
|
+
selectionStyle = _useState4[0],
|
|
108
|
+
setSelectionStyle = _useState4[1];
|
|
103
109
|
var updatePopper = useRef();
|
|
104
|
-
var
|
|
110
|
+
var _useState5 = useState({
|
|
105
111
|
/**
|
|
106
112
|
* Show the picker floating panel
|
|
107
113
|
*/
|
|
@@ -115,9 +121,9 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
115
121
|
*/
|
|
116
122
|
useLeftPopperPlacement: showRoundTrigger
|
|
117
123
|
}),
|
|
118
|
-
|
|
119
|
-
settings =
|
|
120
|
-
setSettings =
|
|
124
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
125
|
+
settings = _useState6[0],
|
|
126
|
+
setSettings = _useState6[1];
|
|
121
127
|
|
|
122
128
|
/**
|
|
123
129
|
* Custom hook triggers when user clicks outside the reactions picker
|
|
@@ -192,6 +198,15 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
192
198
|
// ufo reactions picker opened success
|
|
193
199
|
PickerRender.success();
|
|
194
200
|
};
|
|
201
|
+
useEffect(function () {
|
|
202
|
+
if (settings.isOpen) {
|
|
203
|
+
setSelectionStyle(reactionPickerAdditionalStyle);
|
|
204
|
+
}
|
|
205
|
+
return function () {
|
|
206
|
+
setSelectionStyle(undefined);
|
|
207
|
+
};
|
|
208
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
209
|
+
}, [settings.isOpen]);
|
|
195
210
|
var wrapperClassName = " ".concat(settings.isOpen ? 'isOpen' : '', " ").concat(miniMode ? 'miniMode' : '', " ").concat(className);
|
|
196
211
|
useLayoutEffect(function () {
|
|
197
212
|
var _updatePopper$current;
|
|
@@ -224,6 +239,7 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
224
239
|
setTriggerRef(node);
|
|
225
240
|
}
|
|
226
241
|
},
|
|
242
|
+
selectionStyle: selectionStyle,
|
|
227
243
|
onClick: onTriggerClick,
|
|
228
244
|
miniMode: miniMode,
|
|
229
245
|
disabled: disabled,
|
|
@@ -255,10 +271,10 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
|
|
|
255
271
|
export var PopperWrapper = function PopperWrapper(props) {
|
|
256
272
|
var settings = props.settings,
|
|
257
273
|
children = props.children;
|
|
258
|
-
var
|
|
259
|
-
|
|
260
|
-
popupRef =
|
|
261
|
-
setPopupRef =
|
|
274
|
+
var _useState7 = useState(null),
|
|
275
|
+
_useState8 = _slicedToArray(_useState7, 2),
|
|
276
|
+
popupRef = _useState8[0],
|
|
277
|
+
setPopupRef = _useState8[1];
|
|
262
278
|
/**
|
|
263
279
|
* add focus lock to popup
|
|
264
280
|
*/
|
|
@@ -6,7 +6,7 @@ import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
|
6
6
|
*/
|
|
7
7
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
8
8
|
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
9
|
-
import { jsx } from '@emotion/react';
|
|
9
|
+
import { css, jsx } from '@emotion/react';
|
|
10
10
|
import { FormattedMessage } from 'react-intl-next';
|
|
11
11
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
12
12
|
import { ModalTransition } from '@atlaskit/modal-dialog';
|
|
@@ -21,7 +21,25 @@ import { Reaction } from '../Reaction';
|
|
|
21
21
|
import { ReactionsDialog } from '../ReactionDialog';
|
|
22
22
|
import { ReactionPicker } from '../ReactionPicker';
|
|
23
23
|
import { ReactionSummaryView } from '../ReactionSummary/';
|
|
24
|
-
import { reactionPickerStyle
|
|
24
|
+
import { reactionPickerStyle } from './styles';
|
|
25
|
+
var wrapperStyle = css({
|
|
26
|
+
display: 'flex',
|
|
27
|
+
flexWrap: 'wrap',
|
|
28
|
+
position: 'relative',
|
|
29
|
+
alignItems: 'center',
|
|
30
|
+
borderRadius: '15px',
|
|
31
|
+
marginTop: "var(--ds-space-negative-050, -4px)",
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
33
|
+
'> :first-of-type > :first-of-type': {
|
|
34
|
+
marginLeft: 0
|
|
35
|
+
}
|
|
36
|
+
});
|
|
37
|
+
var noFlexWrapStyles = css({
|
|
38
|
+
flexWrap: 'nowrap'
|
|
39
|
+
});
|
|
40
|
+
var noContainerPositionStyles = css({
|
|
41
|
+
position: 'initial'
|
|
42
|
+
});
|
|
25
43
|
|
|
26
44
|
/**
|
|
27
45
|
* Set of all available UFO experiences relating to Reactions Dialog
|
|
@@ -121,7 +139,12 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
121
139
|
_ref$showRoundTrigger = _ref.showRoundTrigger,
|
|
122
140
|
showRoundTrigger = _ref$showRoundTrigger === void 0 ? false : _ref$showRoundTrigger,
|
|
123
141
|
_ref$isViewOnly = _ref.isViewOnly,
|
|
124
|
-
isViewOnly = _ref$isViewOnly === void 0 ? false : _ref$isViewOnly
|
|
142
|
+
isViewOnly = _ref$isViewOnly === void 0 ? false : _ref$isViewOnly,
|
|
143
|
+
reactionPickerAdditionalStyle = _ref.reactionPickerAdditionalStyle,
|
|
144
|
+
_ref$noWrap = _ref.noWrap,
|
|
145
|
+
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
|
|
146
|
+
_ref$noRelativeContai = _ref.noRelativeContainer,
|
|
147
|
+
noRelativeContainer = _ref$noRelativeContai === void 0 ? false : _ref$noRelativeContai;
|
|
125
148
|
var _useState = useState(),
|
|
126
149
|
_useState2 = _slicedToArray(_useState, 2),
|
|
127
150
|
selectedEmojiId = _useState2[0],
|
|
@@ -273,7 +296,7 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
273
296
|
return jsx(UFOSegment, {
|
|
274
297
|
name: "reactions"
|
|
275
298
|
}, jsx("div", {
|
|
276
|
-
css: wrapperStyle,
|
|
299
|
+
css: [wrapperStyle, noWrap && noFlexWrapStyles, noRelativeContainer && noContainerPositionStyles],
|
|
277
300
|
"data-testid": RENDER_REACTIONS_TESTID
|
|
278
301
|
}, !onlyRenderPicker && (shouldShowSummaryView ? jsx("div", {
|
|
279
302
|
"data-testid": RENDER_REACTIONS_SUMMARY_TESTID
|
|
@@ -328,7 +351,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
328
351
|
showOpaqueBackground: showOpaqueBackground,
|
|
329
352
|
showAddReactionText: showAddReactionText,
|
|
330
353
|
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
331
|
-
showRoundTrigger: showRoundTrigger
|
|
354
|
+
showRoundTrigger: showRoundTrigger,
|
|
355
|
+
reactionPickerAdditionalStyle: reactionPickerAdditionalStyle
|
|
332
356
|
}), jsx(ModalTransition, null, !!selectedEmojiId && jsx(UFOSegment, {
|
|
333
357
|
name: "reactions-dialog"
|
|
334
358
|
}, jsx(ReactionsDialog, {
|
|
@@ -8,18 +8,4 @@ import { css } from '@emotion/react';
|
|
|
8
8
|
export var reactionPickerStyle = css({
|
|
9
9
|
display: 'inline-block',
|
|
10
10
|
marginTop: "var(--ds-space-050, 4px)"
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles -- Ignored via go/DSP-18766
|
|
14
|
-
export var wrapperStyle = css({
|
|
15
|
-
display: 'flex',
|
|
16
|
-
flexWrap: 'wrap',
|
|
17
|
-
position: 'relative',
|
|
18
|
-
alignItems: 'center',
|
|
19
|
-
borderRadius: '15px',
|
|
20
|
-
marginTop: "var(--ds-space-negative-050, -4px)",
|
|
21
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
22
|
-
'> :first-of-type > :first-of-type': {
|
|
23
|
-
marginLeft: 0
|
|
24
|
-
}
|
|
25
11
|
});
|
|
@@ -108,7 +108,8 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
108
108
|
_props$subtleReaction = props.subtleReactionsSummaryAndPicker,
|
|
109
109
|
subtleReactionsSummaryAndPicker = _props$subtleReaction === void 0 ? false : _props$subtleReaction,
|
|
110
110
|
_props$showRoundTrigg = props.showRoundTrigger,
|
|
111
|
-
showRoundTrigger = _props$showRoundTrigg === void 0 ? false : _props$showRoundTrigg
|
|
111
|
+
showRoundTrigger = _props$showRoundTrigg === void 0 ? false : _props$showRoundTrigg,
|
|
112
|
+
selectionStyle = props.selectionStyle;
|
|
112
113
|
var handleMouseDown = function handleMouseDown(e, analyticsEvent) {
|
|
113
114
|
if (onClick && !disabled) {
|
|
114
115
|
onClick(e, analyticsEvent);
|
|
@@ -119,7 +120,9 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
119
120
|
content: tooltipContent
|
|
120
121
|
}, jsx(Pressable, _extends({
|
|
121
122
|
testId: RENDER_TRIGGER_BUTTON_TESTID,
|
|
122
|
-
xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh, showRoundTrigger && roundTriggerStyles
|
|
123
|
+
xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh, showRoundTrigger && roundTriggerStyles,
|
|
124
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
125
|
+
selectionStyle],
|
|
123
126
|
onClick: handleMouseDown,
|
|
124
127
|
isDisabled: disabled,
|
|
125
128
|
ref: ref
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import React, { type PropsWithChildren } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type PickerSize } from '@atlaskit/emoji/types';
|
|
8
|
+
import { type XCSS } from '@atlaskit/primitives';
|
|
8
9
|
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
9
10
|
import { type ReactionSource } from '../../types';
|
|
10
11
|
import { type SelectorProps } from '../Selector';
|
|
@@ -72,6 +73,10 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
|
|
|
72
73
|
* Optional prop for controlling if the picker hover border will be rounded
|
|
73
74
|
*/
|
|
74
75
|
showRoundTrigger?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Option prop for controlling the reaction picker selection style
|
|
78
|
+
*/
|
|
79
|
+
reactionPickerAdditionalStyle?: XCSS;
|
|
75
80
|
}
|
|
76
81
|
/**
|
|
77
82
|
* Picker component for adding reactions
|
|
@@ -6,6 +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 XCSS } from '@atlaskit/primitives';
|
|
9
10
|
import { ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary, type ProfileCardWrapper } from '../../types';
|
|
10
11
|
import { type ReactionPickerProps } from '../ReactionPicker';
|
|
11
12
|
import { type SelectorProps } from '../Selector';
|
|
@@ -141,6 +142,15 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
141
142
|
* Optional prop for controlling if the reactions component is view only, disabling adding reactions
|
|
142
143
|
*/
|
|
143
144
|
isViewOnly?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Option prop for controlling the reaction picker selection style
|
|
147
|
+
*/
|
|
148
|
+
reactionPickerAdditionalStyle?: XCSS;
|
|
149
|
+
noWrap?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Optional prop for using your own container for relative positioning for emoji picker popup
|
|
152
|
+
*/
|
|
153
|
+
noRelativeContainer?: boolean;
|
|
144
154
|
}
|
|
145
155
|
export interface OpenReactionsDialogOptions {
|
|
146
156
|
emojiId?: string;
|
|
@@ -153,4 +163,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
153
163
|
/**
|
|
154
164
|
* Renders list of reactions
|
|
155
165
|
*/
|
|
156
|
-
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, showRoundTrigger, isViewOnly, }: ReactionsProps) => jsx.JSX.Element>;
|
|
166
|
+
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, showRoundTrigger, isViewOnly, reactionPickerAdditionalStyle, noWrap, noRelativeContainer, }: ReactionsProps) => jsx.JSX.Element>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React, { type AriaAttributes } from 'react';
|
|
6
6
|
import { type AnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
|
+
import { type XCSS } from '@atlaskit/primitives';
|
|
7
8
|
/**
|
|
8
9
|
* Test id for the tooltip
|
|
9
10
|
*/
|
|
@@ -48,6 +49,10 @@ export interface TriggerProps {
|
|
|
48
49
|
* Optional prop for controlling if the picker hover border will be rounded
|
|
49
50
|
*/
|
|
50
51
|
showRoundTrigger?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Option prop for controlling the reaction picker selection style
|
|
54
|
+
*/
|
|
55
|
+
selectionStyle?: XCSS;
|
|
51
56
|
}
|
|
52
57
|
/**
|
|
53
58
|
* Render an emoji button to open the reactions select picker
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
import React, { type PropsWithChildren } from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
7
7
|
import { type PickerSize } from '@atlaskit/emoji/types';
|
|
8
|
+
import { type XCSS } from '@atlaskit/primitives';
|
|
8
9
|
import { type EmojiProvider } from '@atlaskit/emoji/resource';
|
|
9
10
|
import { type ReactionSource } from '../../types';
|
|
10
11
|
import { type SelectorProps } from '../Selector';
|
|
@@ -72,6 +73,10 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
|
|
|
72
73
|
* Optional prop for controlling if the picker hover border will be rounded
|
|
73
74
|
*/
|
|
74
75
|
showRoundTrigger?: boolean;
|
|
76
|
+
/**
|
|
77
|
+
* Option prop for controlling the reaction picker selection style
|
|
78
|
+
*/
|
|
79
|
+
reactionPickerAdditionalStyle?: XCSS;
|
|
75
80
|
}
|
|
76
81
|
/**
|
|
77
82
|
* Picker component for adding reactions
|
|
@@ -6,6 +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 XCSS } from '@atlaskit/primitives';
|
|
9
10
|
import { ReactionStatus, type ReactionClick, type ReactionSummary, type QuickReactionEmojiSummary, type ProfileCardWrapper } from '../../types';
|
|
10
11
|
import { type ReactionPickerProps } from '../ReactionPicker';
|
|
11
12
|
import { type SelectorProps } from '../Selector';
|
|
@@ -141,6 +142,15 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
141
142
|
* Optional prop for controlling if the reactions component is view only, disabling adding reactions
|
|
142
143
|
*/
|
|
143
144
|
isViewOnly?: boolean;
|
|
145
|
+
/**
|
|
146
|
+
* Option prop for controlling the reaction picker selection style
|
|
147
|
+
*/
|
|
148
|
+
reactionPickerAdditionalStyle?: XCSS;
|
|
149
|
+
noWrap?: boolean;
|
|
150
|
+
/**
|
|
151
|
+
* Optional prop for using your own container for relative positioning for emoji picker popup
|
|
152
|
+
*/
|
|
153
|
+
noRelativeContainer?: boolean;
|
|
144
154
|
}
|
|
145
155
|
export interface OpenReactionsDialogOptions {
|
|
146
156
|
emojiId?: string;
|
|
@@ -153,4 +163,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
153
163
|
/**
|
|
154
164
|
* Renders list of reactions
|
|
155
165
|
*/
|
|
156
|
-
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, showRoundTrigger, isViewOnly, }: ReactionsProps) => jsx.JSX.Element>;
|
|
166
|
+
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, showRoundTrigger, isViewOnly, reactionPickerAdditionalStyle, noWrap, noRelativeContainer, }: ReactionsProps) => jsx.JSX.Element>;
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React, { type AriaAttributes } from 'react';
|
|
6
6
|
import { type AnalyticsEvent } from '@atlaskit/analytics-next';
|
|
7
|
+
import { type XCSS } from '@atlaskit/primitives';
|
|
7
8
|
/**
|
|
8
9
|
* Test id for the tooltip
|
|
9
10
|
*/
|
|
@@ -48,6 +49,10 @@ export interface TriggerProps {
|
|
|
48
49
|
* Optional prop for controlling if the picker hover border will be rounded
|
|
49
50
|
*/
|
|
50
51
|
showRoundTrigger?: boolean;
|
|
52
|
+
/**
|
|
53
|
+
* Option prop for controlling the reaction picker selection style
|
|
54
|
+
*/
|
|
55
|
+
selectionStyle?: XCSS;
|
|
51
56
|
}
|
|
52
57
|
/**
|
|
53
58
|
* Render an emoji button to open the reactions select picker
|