@atlaskit/reactions 37.1.1 → 37.1.2

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 CHANGED
@@ -1,5 +1,14 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 37.1.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`7318b656851b1`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7318b656851b1) -
8
+ Type `ReactionSummary.users` as `User[] | null` to match the reactions service, which can send
9
+ `null` for the user list. `ReactionTooltip` now normalises a `null` list with `?? []` instead of a
10
+ destructuring default, which only covered `undefined`. Rendered output is unchanged.
11
+
3
12
  ## 37.1.1
4
13
 
5
14
  ### 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.0";
14
+ var packageVersion = "37.1.1";
15
15
  /**
16
16
  * TODO: move to utility package?
17
17
  * A random sampling function
@@ -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
- _ref$reaction$users = _ref.reaction.users,
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 = !users || users.length === 0 || !isEnabled ? null : /*#__PURE__*/_react.default.createElement("div", {
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.0";
5
+ const packageVersion = "37.1.1";
6
6
  /**
7
7
  * TODO: move to utility package?
8
8
  * A random sampling function
@@ -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 = !users || users.length === 0 || !isEnabled ? null : /*#__PURE__*/React.createElement("div", {
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.0";
8
+ var packageVersion = "37.1.1";
9
9
  /**
10
10
  * TODO: move to utility package?
11
11
  * A random sampling function
@@ -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
- _ref$reaction$users = _ref.reaction.users,
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 = !users || users.length === 0 || !isEnabled ? null : /*#__PURE__*/React.createElement("div", {
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: { users }, maxReactions, isEnabled, allowUserDialog, handleOpenReactionsDialog, dismissTooltip, wideTooltip, }: ReactionTooltipProps) => JSX.Element;
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.1",
3
+ "version": "37.1.2",
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.4.0",
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.1.0",
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": "^246.0.0",
62
- "@atlaskit/tokens": "^20.7.0",
61
+ "@atlaskit/tmp-editor-statsig": "^246.1.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",