@atlaskit/reactions 37.1.1 → 37.1.3
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 +18 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/Reaction.js +1 -2
- package/dist/cjs/components/ReactionPicker.js +4 -7
- package/dist/cjs/components/ReactionSummaryView.js +2 -3
- package/dist/cjs/components/ReactionTooltip.js +5 -3
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/Reaction.js +1 -2
- package/dist/es2019/components/ReactionPicker.js +5 -9
- package/dist/es2019/components/ReactionSummaryView.js +2 -3
- package/dist/es2019/components/ReactionTooltip.js +5 -4
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/Reaction.js +1 -2
- package/dist/esm/components/ReactionPicker.js +5 -8
- package/dist/esm/components/ReactionSummaryView.js +2 -3
- package/dist/esm/components/ReactionTooltip.js +5 -3
- package/dist/types/components/ReactionTooltip.d.ts +1 -1
- package/dist/types/types/reaction.d.ts +3 -2
- package/package.json +5 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 37.1.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`8bea3ef71a661`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/8bea3ef71a661) -
|
|
8
|
+
Clean up `platform_a11y_fixes_reading_order` and make the accessible reading-order behavior
|
|
9
|
+
permanent.
|
|
10
|
+
- Updated dependencies
|
|
11
|
+
|
|
12
|
+
## 37.1.2
|
|
13
|
+
|
|
14
|
+
### Patch Changes
|
|
15
|
+
|
|
16
|
+
- [`7318b656851b1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7318b656851b1) -
|
|
17
|
+
Type `ReactionSummary.users` as `User[] | null` to match the reactions service, which can send
|
|
18
|
+
`null` for the user list. `ReactionTooltip` now normalises a `null` list with `?? []` instead of a
|
|
19
|
+
destructuring default, which only covered `undefined`. Rendered output is unchanged.
|
|
20
|
+
|
|
3
21
|
## 37.1.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
|
@@ -11,7 +11,7 @@ var _createAndFireEvents = _interopRequireDefault(require("@atlaskit/analytics-n
|
|
|
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; } // eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
13
13
|
var packageName = "@atlaskit/reactions";
|
|
14
|
-
var packageVersion = "37.1.
|
|
14
|
+
var packageVersion = "37.1.2";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -18,7 +18,6 @@ var _reactIntl = require("react-intl");
|
|
|
18
18
|
var _useAnalyticsEvents2 = require("@atlaskit/analytics-next/useAnalyticsEvents");
|
|
19
19
|
var _css = require("@atlaskit/css");
|
|
20
20
|
var _resourcedEmoji = _interopRequireDefault(require("@atlaskit/emoji/resourced-emoji"));
|
|
21
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
22
21
|
var _box = require("@atlaskit/primitives/compiled/box");
|
|
23
22
|
var _inline = require("@atlaskit/primitives/compiled/inline");
|
|
24
23
|
var _analytics = require("../analytics");
|
|
@@ -164,7 +163,7 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
164
163
|
});
|
|
165
164
|
}
|
|
166
165
|
return /*#__PURE__*/React.createElement(_box.Box, {
|
|
167
|
-
xcss: (0, _css.cx)(styles.container, rootElement === 'li' ? styles.listItem : undefined, rootElement === 'li'
|
|
166
|
+
xcss: (0, _css.cx)(styles.container, rootElement === 'li' ? styles.listItem : undefined, rootElement === 'li' ? styles.listItemNoMarker : undefined),
|
|
168
167
|
as: rootElement
|
|
169
168
|
}, showParticleEffect && /*#__PURE__*/React.createElement(_ReactionParticleEffect.ReactionParticleEffect, {
|
|
170
169
|
emojiId: emojiId,
|
|
@@ -386,8 +386,6 @@ var PopperWrapper = exports.PopperWrapper = function PopperWrapper(props) {
|
|
|
386
386
|
_useState12 = (0, _slicedToArray2.default)(_useState11, 2),
|
|
387
387
|
popupRef = _useState12[0],
|
|
388
388
|
setPopupRef = _useState12[1];
|
|
389
|
-
var _useIntl = (0, _reactIntl.useIntl)(),
|
|
390
|
-
formatMessage = _useIntl.formatMessage;
|
|
391
389
|
/**
|
|
392
390
|
* add focus lock to popup
|
|
393
391
|
*/
|
|
@@ -416,9 +414,8 @@ var PopperWrapper = exports.PopperWrapper = function PopperWrapper(props) {
|
|
|
416
414
|
update = _ref3.update;
|
|
417
415
|
return /*#__PURE__*/_react.default.createElement("div", {
|
|
418
416
|
role: "dialog",
|
|
419
|
-
"aria-
|
|
420
|
-
"aria-
|
|
421
|
-
"aria-labelledby": (0, _fg.fg)('platform_a11y_fixes_reading_order') ? PICKER_LABEL_ID : undefined,
|
|
417
|
+
"aria-modal": "false",
|
|
418
|
+
"aria-labelledby": PICKER_LABEL_ID,
|
|
422
419
|
id: PICKER_CONTROL_ID,
|
|
423
420
|
"data-testid": RENDER_REACTIONPICKERPANEL_TESTID,
|
|
424
421
|
style: _objectSpread({
|
|
@@ -437,13 +434,13 @@ var PopperWrapper = exports.PopperWrapper = function PopperWrapper(props) {
|
|
|
437
434
|
// eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
|
|
438
435
|
tabIndex: (0, _fg.fg)('platform_suppression_removal_fix_reactions') ? undefined : 0,
|
|
439
436
|
className: (0, _runtime.ax)(["_nt751r31 _49pcglyw _1hvw1o36"])
|
|
440
|
-
},
|
|
437
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
441
438
|
className: (0, _runtime.ax)(["_1reo15vq _18m915vq _ogto7mnp _4t3it94y _kqswstnw _o5721q9c _1bsbt94y"])
|
|
442
439
|
}, /*#__PURE__*/_react.default.createElement(_heading.default, {
|
|
443
440
|
as: "h2",
|
|
444
441
|
size: "small",
|
|
445
442
|
id: PICKER_LABEL_ID
|
|
446
|
-
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _i18n.messages.popperWrapperLabel)))
|
|
443
|
+
}, /*#__PURE__*/_react.default.createElement(_reactIntl.FormattedMessage, _i18n.messages.popperWrapperLabel))), /*#__PURE__*/_react.default.createElement(_RepositionOnUpdate.RepositionOnUpdate, {
|
|
447
444
|
update: update,
|
|
448
445
|
settings: settings
|
|
449
446
|
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
@@ -14,7 +14,6 @@ var _runtime = require("@compiled/react/runtime");
|
|
|
14
14
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
15
15
|
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
16
|
var _emojiPicker = _interopRequireDefault(require("@atlaskit/emoji/emoji-picker"));
|
|
17
|
-
var _fg = require("@atlaskit/platform-feature-flags/fg");
|
|
18
17
|
var _popup = require("@atlaskit/popup/popup");
|
|
19
18
|
var _box = require("@atlaskit/primitives/compiled/box");
|
|
20
19
|
var _flex = require("@atlaskit/primitives/compiled/flex");
|
|
@@ -243,8 +242,8 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
|
|
|
243
242
|
},
|
|
244
243
|
isOpen: isSummaryPopupOpen || isEmojiPickerOpen,
|
|
245
244
|
onClose: handlePopupClose,
|
|
246
|
-
shouldRenderToParent:
|
|
247
|
-
strategy:
|
|
245
|
+
shouldRenderToParent: true,
|
|
246
|
+
strategy: "absolute",
|
|
248
247
|
trigger: function trigger(triggerProps) {
|
|
249
248
|
return /*#__PURE__*/React.createElement(_ReactionSummaryButton.ReactionSummaryButton, (0, _extends2.default)({}, triggerProps, {
|
|
250
249
|
emojiProvider: emojiProvider,
|
|
@@ -31,10 +31,10 @@ var footerButtonColorStyle = null;
|
|
|
31
31
|
*/
|
|
32
32
|
var RENDER_REACTIONTOOLTIP_TESTID = exports.RENDER_REACTIONTOOLTIP_TESTID = 'render-reactionTooltip';
|
|
33
33
|
var ReactionTooltip = exports.ReactionTooltip = function ReactionTooltip(_ref) {
|
|
34
|
+
var _reaction$users;
|
|
34
35
|
var children = _ref.children,
|
|
35
36
|
emojiName = _ref.emojiName,
|
|
36
|
-
|
|
37
|
-
users = _ref$reaction$users === void 0 ? [] : _ref$reaction$users,
|
|
37
|
+
reaction = _ref.reaction,
|
|
38
38
|
_ref$maxReactions = _ref.maxReactions,
|
|
39
39
|
maxReactions = _ref$maxReactions === void 0 ? _constants.TOOLTIP_USERS_LIMIT : _ref$maxReactions,
|
|
40
40
|
_ref$isEnabled = _ref.isEnabled,
|
|
@@ -44,13 +44,15 @@ var ReactionTooltip = exports.ReactionTooltip = function ReactionTooltip(_ref) {
|
|
|
44
44
|
dismissTooltip = _ref.dismissTooltip,
|
|
45
45
|
_ref$wideTooltip = _ref.wideTooltip,
|
|
46
46
|
wideTooltip = _ref$wideTooltip === void 0 ? false : _ref$wideTooltip;
|
|
47
|
+
// A destructuring default only covers `undefined`; the service can also send `null`.
|
|
48
|
+
var users = (_reaction$users = reaction.users) !== null && _reaction$users !== void 0 ? _reaction$users : [];
|
|
47
49
|
var handleClick = function handleClick() {
|
|
48
50
|
if (allowUserDialog && handleOpenReactionsDialog) {
|
|
49
51
|
dismissTooltip();
|
|
50
52
|
handleOpenReactionsDialog();
|
|
51
53
|
}
|
|
52
54
|
};
|
|
53
|
-
var content =
|
|
55
|
+
var content = users.length === 0 || !isEnabled ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
54
56
|
tabIndex: (0, _fg.fg)('platform_suppression_removal_fix_reactions') ? undefined : 0,
|
|
55
57
|
className: (0, _runtime.ax)(["_1reo15vq _18m915vq _p12f1w81 _1bto1l2s _o5721q9c _otyr14y2 _d1n8glyw _102oidpf _1kvxidpf _1ysjidpf _17d4idpf _1hziidpf _3n4midpf _ltofidpf _k7zyidpf _1ywo1e5h _1pru15vq _u0h115vq _5qec1l2s _1eg614y2", wideTooltip && "_p12fnklw"])
|
|
56
58
|
}, /*#__PURE__*/_react.default.createElement("ul", null, emojiName ? /*#__PURE__*/_react.default.createElement("li", {
|
|
@@ -2,7 +2,7 @@ import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-t
|
|
|
2
2
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
3
3
|
import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
|
|
4
4
|
const packageName = "@atlaskit/reactions";
|
|
5
|
-
const packageVersion = "37.1.
|
|
5
|
+
const packageVersion = "37.1.2";
|
|
6
6
|
/**
|
|
7
7
|
* TODO: move to utility package?
|
|
8
8
|
* A random sampling function
|
|
@@ -7,7 +7,6 @@ import { useIntl } from 'react-intl';
|
|
|
7
7
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
8
8
|
import { cx } from '@atlaskit/css';
|
|
9
9
|
import ResourcedEmoji from '@atlaskit/emoji/resourced-emoji';
|
|
10
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
11
10
|
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
12
11
|
import { Inline } from '@atlaskit/primitives/compiled/inline';
|
|
13
12
|
import { createAndFireSafe, createReactionClickedEvent, createReactionFocusedEvent, createReactionHoveredEvent } from '../analytics';
|
|
@@ -131,7 +130,7 @@ export const Reaction = ({
|
|
|
131
130
|
});
|
|
132
131
|
}
|
|
133
132
|
return /*#__PURE__*/React.createElement(Box, {
|
|
134
|
-
xcss: cx(styles.container, rootElement === 'li' ? styles.listItem : undefined, rootElement === 'li'
|
|
133
|
+
xcss: cx(styles.container, rootElement === 'li' ? styles.listItem : undefined, rootElement === 'li' ? styles.listItemNoMarker : undefined),
|
|
135
134
|
as: rootElement
|
|
136
135
|
}, showParticleEffect && /*#__PURE__*/React.createElement(ReactionParticleEffect, {
|
|
137
136
|
emojiId: emojiId,
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import "./ReactionPicker.compiled.css";
|
|
3
3
|
import { ax, ix } from "@compiled/react/runtime";
|
|
4
4
|
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
5
|
-
import { FormattedMessage
|
|
5
|
+
import { FormattedMessage } from 'react-intl';
|
|
6
6
|
import EmojiPicker from '@atlaskit/emoji/emoji-picker';
|
|
7
7
|
import Heading from '@atlaskit/heading/heading';
|
|
8
8
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -342,9 +342,6 @@ export const PopperWrapper = props => {
|
|
|
342
342
|
zIndex
|
|
343
343
|
} = props;
|
|
344
344
|
const [popupRef, setPopupRef] = useState(null);
|
|
345
|
-
const {
|
|
346
|
-
formatMessage
|
|
347
|
-
} = useIntl();
|
|
348
345
|
/**
|
|
349
346
|
* add focus lock to popup
|
|
350
347
|
*/
|
|
@@ -372,9 +369,8 @@ export const PopperWrapper = props => {
|
|
|
372
369
|
}) => {
|
|
373
370
|
return /*#__PURE__*/React.createElement("div", {
|
|
374
371
|
role: "dialog",
|
|
375
|
-
"aria-
|
|
376
|
-
"aria-
|
|
377
|
-
"aria-labelledby": fg('platform_a11y_fixes_reading_order') ? PICKER_LABEL_ID : undefined,
|
|
372
|
+
"aria-modal": "false",
|
|
373
|
+
"aria-labelledby": PICKER_LABEL_ID,
|
|
378
374
|
id: PICKER_CONTROL_ID,
|
|
379
375
|
"data-testid": RENDER_REACTIONPICKERPANEL_TESTID,
|
|
380
376
|
style: {
|
|
@@ -395,13 +391,13 @@ export const PopperWrapper = props => {
|
|
|
395
391
|
// eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
|
|
396
392
|
tabIndex: fg('platform_suppression_removal_fix_reactions') ? undefined : 0,
|
|
397
393
|
className: ax(["_nt751r31 _49pcglyw _1hvw1o36"])
|
|
398
|
-
},
|
|
394
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
399
395
|
className: ax(["_1reo15vq _18m915vq _ogto7mnp _4t3it94y _kqswstnw _o5721q9c _1bsbt94y"])
|
|
400
396
|
}, /*#__PURE__*/React.createElement(Heading, {
|
|
401
397
|
as: "h2",
|
|
402
398
|
size: "small",
|
|
403
399
|
id: PICKER_LABEL_ID
|
|
404
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.popperWrapperLabel)))
|
|
400
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.popperWrapperLabel))), /*#__PURE__*/React.createElement(RepositionOnUpdate, {
|
|
405
401
|
update: update,
|
|
406
402
|
settings: settings
|
|
407
403
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -5,7 +5,6 @@ import * as React from 'react';
|
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
6
|
import { useCallback, useState } from 'react';
|
|
7
7
|
import EmojiPicker from '@atlaskit/emoji/emoji-picker';
|
|
8
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
9
8
|
import { Popup } from '@atlaskit/popup/popup';
|
|
10
9
|
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
11
10
|
import { Flex } from '@atlaskit/primitives/compiled/flex';
|
|
@@ -209,8 +208,8 @@ export const ReactionSummaryView = ({
|
|
|
209
208
|
}))),
|
|
210
209
|
isOpen: isSummaryPopupOpen || isEmojiPickerOpen,
|
|
211
210
|
onClose: handlePopupClose,
|
|
212
|
-
shouldRenderToParent:
|
|
213
|
-
strategy:
|
|
211
|
+
shouldRenderToParent: true,
|
|
212
|
+
strategy: "absolute",
|
|
214
213
|
trigger: triggerProps => /*#__PURE__*/React.createElement(ReactionSummaryButton, _extends({}, triggerProps, {
|
|
215
214
|
emojiProvider: emojiProvider,
|
|
216
215
|
reactions: reactions,
|
|
@@ -26,9 +26,7 @@ export const RENDER_REACTIONTOOLTIP_TESTID = 'render-reactionTooltip';
|
|
|
26
26
|
export const ReactionTooltip = ({
|
|
27
27
|
children,
|
|
28
28
|
emojiName,
|
|
29
|
-
reaction
|
|
30
|
-
users = []
|
|
31
|
-
},
|
|
29
|
+
reaction,
|
|
32
30
|
maxReactions = TOOLTIP_USERS_LIMIT,
|
|
33
31
|
isEnabled = true,
|
|
34
32
|
allowUserDialog,
|
|
@@ -36,13 +34,16 @@ export const ReactionTooltip = ({
|
|
|
36
34
|
dismissTooltip,
|
|
37
35
|
wideTooltip = false
|
|
38
36
|
}) => {
|
|
37
|
+
var _reaction$users;
|
|
38
|
+
// A destructuring default only covers `undefined`; the service can also send `null`.
|
|
39
|
+
const users = (_reaction$users = reaction.users) !== null && _reaction$users !== void 0 ? _reaction$users : [];
|
|
39
40
|
const handleClick = () => {
|
|
40
41
|
if (allowUserDialog && handleOpenReactionsDialog) {
|
|
41
42
|
dismissTooltip();
|
|
42
43
|
handleOpenReactionsDialog();
|
|
43
44
|
}
|
|
44
45
|
};
|
|
45
|
-
const content =
|
|
46
|
+
const content = users.length === 0 || !isEnabled ? null : /*#__PURE__*/React.createElement("div", {
|
|
46
47
|
tabIndex: fg('platform_suppression_removal_fix_reactions') ? undefined : 0,
|
|
47
48
|
className: ax(["_1reo15vq _18m915vq _p12f1w81 _1bto1l2s _o5721q9c _otyr14y2 _d1n8glyw _102oidpf _1kvxidpf _1ysjidpf _17d4idpf _1hziidpf _3n4midpf _ltofidpf _k7zyidpf _1ywo1e5h _1pru15vq _u0h115vq _5qec1l2s _1eg614y2", wideTooltip && "_p12fnklw"])
|
|
48
49
|
}, /*#__PURE__*/React.createElement("ul", null, emojiName ? /*#__PURE__*/React.createElement("li", {
|
|
@@ -5,7 +5,7 @@ import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-t
|
|
|
5
5
|
// eslint-disable-next-line @typescript-eslint/consistent-type-imports
|
|
6
6
|
import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
|
|
7
7
|
var packageName = "@atlaskit/reactions";
|
|
8
|
-
var packageVersion = "37.1.
|
|
8
|
+
var packageVersion = "37.1.2";
|
|
9
9
|
/**
|
|
10
10
|
* TODO: move to utility package?
|
|
11
11
|
* A random sampling function
|
|
@@ -10,7 +10,6 @@ import { useIntl } from 'react-intl';
|
|
|
10
10
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next/useAnalyticsEvents';
|
|
11
11
|
import { cx } from '@atlaskit/css';
|
|
12
12
|
import ResourcedEmoji from '@atlaskit/emoji/resourced-emoji';
|
|
13
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
14
13
|
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
15
14
|
import { Inline } from '@atlaskit/primitives/compiled/inline';
|
|
16
15
|
import { createAndFireSafe, createReactionClickedEvent, createReactionFocusedEvent, createReactionHoveredEvent } from '../analytics';
|
|
@@ -155,7 +154,7 @@ export var Reaction = function Reaction(_ref) {
|
|
|
155
154
|
});
|
|
156
155
|
}
|
|
157
156
|
return /*#__PURE__*/React.createElement(Box, {
|
|
158
|
-
xcss: cx(styles.container, rootElement === 'li' ? styles.listItem : undefined, rootElement === 'li'
|
|
157
|
+
xcss: cx(styles.container, rootElement === 'li' ? styles.listItem : undefined, rootElement === 'li' ? styles.listItemNoMarker : undefined),
|
|
159
158
|
as: rootElement
|
|
160
159
|
}, showParticleEffect && /*#__PURE__*/React.createElement(ReactionParticleEffect, {
|
|
161
160
|
emojiId: emojiId,
|
|
@@ -6,7 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
|
|
|
6
6
|
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; }
|
|
7
7
|
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) { _defineProperty(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; }
|
|
8
8
|
import React, { useCallback, useLayoutEffect, useRef, useState } from 'react';
|
|
9
|
-
import { FormattedMessage
|
|
9
|
+
import { FormattedMessage } from 'react-intl';
|
|
10
10
|
import EmojiPicker from '@atlaskit/emoji/emoji-picker';
|
|
11
11
|
import Heading from '@atlaskit/heading/heading';
|
|
12
12
|
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
@@ -378,8 +378,6 @@ export var PopperWrapper = function PopperWrapper(props) {
|
|
|
378
378
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
379
379
|
popupRef = _useState12[0],
|
|
380
380
|
setPopupRef = _useState12[1];
|
|
381
|
-
var _useIntl = useIntl(),
|
|
382
|
-
formatMessage = _useIntl.formatMessage;
|
|
383
381
|
/**
|
|
384
382
|
* add focus lock to popup
|
|
385
383
|
*/
|
|
@@ -408,9 +406,8 @@ export var PopperWrapper = function PopperWrapper(props) {
|
|
|
408
406
|
update = _ref3.update;
|
|
409
407
|
return /*#__PURE__*/React.createElement("div", {
|
|
410
408
|
role: "dialog",
|
|
411
|
-
"aria-
|
|
412
|
-
"aria-
|
|
413
|
-
"aria-labelledby": fg('platform_a11y_fixes_reading_order') ? PICKER_LABEL_ID : undefined,
|
|
409
|
+
"aria-modal": "false",
|
|
410
|
+
"aria-labelledby": PICKER_LABEL_ID,
|
|
414
411
|
id: PICKER_CONTROL_ID,
|
|
415
412
|
"data-testid": RENDER_REACTIONPICKERPANEL_TESTID,
|
|
416
413
|
style: _objectSpread({
|
|
@@ -429,13 +426,13 @@ export var PopperWrapper = function PopperWrapper(props) {
|
|
|
429
426
|
// eslint-disable-next-line @atlassian/a11y/no-noninteractive-tabindex
|
|
430
427
|
tabIndex: fg('platform_suppression_removal_fix_reactions') ? undefined : 0,
|
|
431
428
|
className: ax(["_nt751r31 _49pcglyw _1hvw1o36"])
|
|
432
|
-
},
|
|
429
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
433
430
|
className: ax(["_1reo15vq _18m915vq _ogto7mnp _4t3it94y _kqswstnw _o5721q9c _1bsbt94y"])
|
|
434
431
|
}, /*#__PURE__*/React.createElement(Heading, {
|
|
435
432
|
as: "h2",
|
|
436
433
|
size: "small",
|
|
437
434
|
id: PICKER_LABEL_ID
|
|
438
|
-
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.popperWrapperLabel)))
|
|
435
|
+
}, /*#__PURE__*/React.createElement(FormattedMessage, messages.popperWrapperLabel))), /*#__PURE__*/React.createElement(RepositionOnUpdate, {
|
|
439
436
|
update: update,
|
|
440
437
|
settings: settings
|
|
441
438
|
}, /*#__PURE__*/React.createElement("div", {
|
|
@@ -6,7 +6,6 @@ import * as React from 'react';
|
|
|
6
6
|
import { ax, ix } from "@compiled/react/runtime";
|
|
7
7
|
import { useCallback, useState } from 'react';
|
|
8
8
|
import EmojiPicker from '@atlaskit/emoji/emoji-picker';
|
|
9
|
-
import { fg } from '@atlaskit/platform-feature-flags/fg';
|
|
10
9
|
import { Popup } from '@atlaskit/popup/popup';
|
|
11
10
|
import { Box } from '@atlaskit/primitives/compiled/box';
|
|
12
11
|
import { Flex } from '@atlaskit/primitives/compiled/flex';
|
|
@@ -234,8 +233,8 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
|
|
|
234
233
|
},
|
|
235
234
|
isOpen: isSummaryPopupOpen || isEmojiPickerOpen,
|
|
236
235
|
onClose: handlePopupClose,
|
|
237
|
-
shouldRenderToParent:
|
|
238
|
-
strategy:
|
|
236
|
+
shouldRenderToParent: true,
|
|
237
|
+
strategy: "absolute",
|
|
239
238
|
trigger: function trigger(triggerProps) {
|
|
240
239
|
return /*#__PURE__*/React.createElement(ReactionSummaryButton, _extends({}, triggerProps, {
|
|
241
240
|
emojiProvider: emojiProvider,
|
|
@@ -24,10 +24,10 @@ var footerButtonColorStyle = null;
|
|
|
24
24
|
*/
|
|
25
25
|
export var RENDER_REACTIONTOOLTIP_TESTID = 'render-reactionTooltip';
|
|
26
26
|
export var ReactionTooltip = function ReactionTooltip(_ref) {
|
|
27
|
+
var _reaction$users;
|
|
27
28
|
var children = _ref.children,
|
|
28
29
|
emojiName = _ref.emojiName,
|
|
29
|
-
|
|
30
|
-
users = _ref$reaction$users === void 0 ? [] : _ref$reaction$users,
|
|
30
|
+
reaction = _ref.reaction,
|
|
31
31
|
_ref$maxReactions = _ref.maxReactions,
|
|
32
32
|
maxReactions = _ref$maxReactions === void 0 ? TOOLTIP_USERS_LIMIT : _ref$maxReactions,
|
|
33
33
|
_ref$isEnabled = _ref.isEnabled,
|
|
@@ -37,13 +37,15 @@ export var ReactionTooltip = function ReactionTooltip(_ref) {
|
|
|
37
37
|
dismissTooltip = _ref.dismissTooltip,
|
|
38
38
|
_ref$wideTooltip = _ref.wideTooltip,
|
|
39
39
|
wideTooltip = _ref$wideTooltip === void 0 ? false : _ref$wideTooltip;
|
|
40
|
+
// A destructuring default only covers `undefined`; the service can also send `null`.
|
|
41
|
+
var users = (_reaction$users = reaction.users) !== null && _reaction$users !== void 0 ? _reaction$users : [];
|
|
40
42
|
var handleClick = function handleClick() {
|
|
41
43
|
if (allowUserDialog && handleOpenReactionsDialog) {
|
|
42
44
|
dismissTooltip();
|
|
43
45
|
handleOpenReactionsDialog();
|
|
44
46
|
}
|
|
45
47
|
};
|
|
46
|
-
var content =
|
|
48
|
+
var content = users.length === 0 || !isEnabled ? null : /*#__PURE__*/React.createElement("div", {
|
|
47
49
|
tabIndex: fg('platform_suppression_removal_fix_reactions') ? undefined : 0,
|
|
48
50
|
className: ax(["_1reo15vq _18m915vq _p12f1w81 _1bto1l2s _o5721q9c _otyr14y2 _d1n8glyw _102oidpf _1kvxidpf _1ysjidpf _17d4idpf _1hziidpf _3n4midpf _ltofidpf _k7zyidpf _1ywo1e5h _1pru15vq _u0h115vq _5qec1l2s _1eg614y2", wideTooltip && "_p12fnklw"])
|
|
49
51
|
}, /*#__PURE__*/React.createElement("ul", null, emojiName ? /*#__PURE__*/React.createElement("li", {
|
|
@@ -41,4 +41,4 @@ export type ReactionTooltipProps = PropsWithChildren<{
|
|
|
41
41
|
reaction: ReactionSummary;
|
|
42
42
|
wideTooltip?: boolean;
|
|
43
43
|
}>;
|
|
44
|
-
export declare const ReactionTooltip: ({ children, emojiName, reaction
|
|
44
|
+
export declare const ReactionTooltip: ({ children, emojiName, reaction, maxReactions, isEnabled, allowUserDialog, handleOpenReactionsDialog, dismissTooltip, wideTooltip, }: ReactionTooltipProps) => JSX.Element;
|
|
@@ -32,9 +32,10 @@ export interface ReactionSummary {
|
|
|
32
32
|
*/
|
|
33
33
|
reacted: boolean;
|
|
34
34
|
/**
|
|
35
|
-
* Users collection
|
|
35
|
+
* Users collection. The reactions service can send `null` rather than omitting the field, so
|
|
36
|
+
* readers must handle both `null` and `undefined`.
|
|
36
37
|
*/
|
|
37
|
-
users?: User[];
|
|
38
|
+
users?: User[] | null;
|
|
38
39
|
}
|
|
39
40
|
/**
|
|
40
41
|
* Metadata for composing a summary of emojis that will be shown in the the primary view even if the reaction count is zero
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/reactions",
|
|
3
|
-
"version": "37.1.
|
|
3
|
+
"version": "37.1.3",
|
|
4
4
|
"description": "Reactions component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/icon": "^38.0.0",
|
|
47
47
|
"@atlaskit/link": "^5.1.0",
|
|
48
48
|
"@atlaskit/modal-dialog": "^17.1.0",
|
|
49
|
-
"@atlaskit/motion": "^9.
|
|
49
|
+
"@atlaskit/motion": "^9.5.0",
|
|
50
50
|
"@atlaskit/platform-feature-experiments": "^0.3.0",
|
|
51
51
|
"@atlaskit/platform-feature-flags": "^2.2.0",
|
|
52
52
|
"@atlaskit/popper": "^9.4.0",
|
|
@@ -54,12 +54,12 @@
|
|
|
54
54
|
"@atlaskit/portal": "^7.1.0",
|
|
55
55
|
"@atlaskit/primitives": "^22.6.0",
|
|
56
56
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
57
|
-
"@atlaskit/react-ufo": "^8.
|
|
57
|
+
"@atlaskit/react-ufo": "^8.3.0",
|
|
58
58
|
"@atlaskit/spinner": "^20.4.0",
|
|
59
59
|
"@atlaskit/tabs": "^21.3.0",
|
|
60
60
|
"@atlaskit/theme": "^28.2.0",
|
|
61
|
-
"@atlaskit/tmp-editor-statsig": "^
|
|
62
|
-
"@atlaskit/tokens": "^20.
|
|
61
|
+
"@atlaskit/tmp-editor-statsig": "^247.0.0",
|
|
62
|
+
"@atlaskit/tokens": "^20.8.0",
|
|
63
63
|
"@atlaskit/tooltip": "^24.4.0",
|
|
64
64
|
"@atlaskit/ufo": "^2.0.0",
|
|
65
65
|
"@atlaskit/util-service-support": "^7.4.0",
|
|
@@ -133,9 +133,6 @@
|
|
|
133
133
|
"a11y_reactions_reading_order": {
|
|
134
134
|
"type": "boolean"
|
|
135
135
|
},
|
|
136
|
-
"platform_a11y_fixes_reading_order": {
|
|
137
|
-
"type": "boolean"
|
|
138
|
-
},
|
|
139
136
|
"platform_reactions_a11y_group_added_reactions": {
|
|
140
137
|
"type": "boolean"
|
|
141
138
|
},
|