@atlaskit/reactions 33.0.0 → 33.0.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,19 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 33.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 33.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#168917](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/168917)
14
+ [`06e3a9a376da3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/06e3a9a376da3) -
15
+ [ux] Bug fix for wrong animation being rendered on the byline for page reactions
16
+
3
17
  ## 33.0.0
4
18
 
5
19
  ### Major 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 = "33.0.0";
14
+ var packageVersion = "33.0.2";
15
15
  /**
16
16
  * TODO: move to utility package?
17
17
  * A random sampling function
@@ -15,6 +15,7 @@ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends")
15
15
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
16
16
  var _popup = _interopRequireDefault(require("@atlaskit/popup"));
17
17
  var _picker = require("@atlaskit/emoji/picker");
18
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
19
  var _useDelayedState3 = require("../hooks/useDelayedState");
19
20
  var _Reaction = require("./Reaction");
20
21
  var _Trigger = require("./Trigger");
@@ -248,6 +249,7 @@ var ReactionSummaryView = exports.ReactionSummaryView = function ReactionSummary
248
249
  summaryButtonIconAfter: summaryButtonIconAfter,
249
250
  summaryViewParticleEffectEmojiId: summaryViewParticleEffectEmojiId
250
251
  }));
251
- }
252
+ },
253
+ shouldRenderToParent: (0, _platformFeatureFlags.fg)('should-render-to-parent-should-be-true-editor-coll')
252
254
  });
253
255
  };
@@ -162,6 +162,13 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
162
162
  _useState4 = (0, _slicedToArray2.default)(_useState3, 2),
163
163
  summaryViewParticleEffectEmojiId = _useState4[0],
164
164
  setSummaryViewParticleEffectEmojiId = _useState4[1];
165
+
166
+ // if the reactions are empty, then set summaryViewParticleEffectEmojiId to null to clear the particle effect state
167
+ (0, _react.useEffect)(function () {
168
+ if (reactions.length === 0) {
169
+ setSummaryViewParticleEffectEmojiId(null);
170
+ }
171
+ }, [reactions]);
165
172
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
166
173
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
167
174
  var openTime = (0, _react.useRef)();
@@ -15,6 +15,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"))
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
16
16
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
17
17
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
18
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
18
19
  var _reactIntlNext = require("react-intl-next");
19
20
  var _tokens = require("@atlaskit/tokens");
20
21
  var _modalDialog = require("@atlaskit/modal-dialog");
@@ -23,8 +24,8 @@ var _compiled = require("@atlaskit/primitives/compiled");
23
24
  var _new = require("@atlaskit/button/new");
24
25
  var _heading = _interopRequireDefault(require("@atlaskit/heading"));
25
26
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
26
- var _chevronLeft = _interopRequireDefault(require("@atlaskit/icon/utility/chevron-left"));
27
- var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/utility/chevron-right"));
27
+ var _chevronRight = _interopRequireDefault(require("@atlaskit/icon/core/chevron-right"));
28
+ var _chevronLeft = _interopRequireDefault(require("@atlaskit/icon/core/chevron-left"));
28
29
  var _close = _interopRequireDefault(require("@atlaskit/icon/core/close"));
29
30
  var _element = require("@atlaskit/emoji/element");
30
31
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
@@ -68,7 +69,11 @@ var LeftNavigationButton = function LeftNavigationButton(_ref2) {
68
69
  }, /*#__PURE__*/React.createElement(_new.IconButton, {
69
70
  spacing: "compact",
70
71
  onClick: handlePreviousPage,
71
- icon: _chevronLeft.default,
72
+ icon: function icon(iconProps) {
73
+ return /*#__PURE__*/React.createElement(_chevronLeft.default, (0, _extends2.default)({}, iconProps, {
74
+ size: "small"
75
+ }));
76
+ },
72
77
  label: intl.formatMessage(_i18n.messages.leftNavigateLabel),
73
78
  isTooltipDisabled: false
74
79
  }));
@@ -81,7 +86,11 @@ var RightNavigationButton = function RightNavigationButton(_ref3) {
81
86
  }, /*#__PURE__*/React.createElement(_new.IconButton, {
82
87
  spacing: "compact",
83
88
  onClick: handleNextPage,
84
- icon: _chevronRight.default,
89
+ icon: function icon(iconProps) {
90
+ return /*#__PURE__*/React.createElement(_chevronRight.default, (0, _extends2.default)({}, iconProps, {
91
+ size: "small"
92
+ }));
93
+ },
85
94
  label: intl.formatMessage(_i18n.messages.rightNavigateLabel),
86
95
  isTooltipDisabled: false
87
96
  }));
@@ -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 = "33.0.0";
4
+ const packageVersion = "33.0.2";
5
5
  /**
6
6
  * TODO: move to utility package?
7
7
  * A random sampling function
@@ -6,6 +6,7 @@ import { ax, ix } from "@compiled/react/runtime";
6
6
  import { useCallback, useState } from 'react';
7
7
  import Popup from '@atlaskit/popup';
8
8
  import { EmojiPicker } from '@atlaskit/emoji/picker';
9
+ import { fg } from '@atlaskit/platform-feature-flags';
9
10
  import { useDelayedState } from '../hooks/useDelayedState';
10
11
  import { Reaction } from './Reaction';
11
12
  import { Trigger as EmojiPickerTrigger } from './Trigger';
@@ -210,6 +211,7 @@ export const ReactionSummaryView = ({
210
211
  summaryGetOptimisticImageURL: summaryGetOptimisticImageURL,
211
212
  summaryButtonIconAfter: summaryButtonIconAfter,
212
213
  summaryViewParticleEffectEmojiId: summaryViewParticleEffectEmojiId
213
- }))
214
+ })),
215
+ shouldRenderToParent: fg('should-render-to-parent-should-be-true-editor-coll')
214
216
  });
215
217
  };
@@ -119,6 +119,13 @@ export const Reactions = /*#__PURE__*/React.memo(({
119
119
  }) => {
120
120
  const [selectedEmojiId, setSelectedEmojiId] = useState('');
121
121
  const [summaryViewParticleEffectEmojiId, setSummaryViewParticleEffectEmojiId] = useState(null);
122
+
123
+ // if the reactions are empty, then set summaryViewParticleEffectEmojiId to null to clear the particle effect state
124
+ useEffect(() => {
125
+ if (reactions.length === 0) {
126
+ setSummaryViewParticleEffectEmojiId(null);
127
+ }
128
+ }, [reactions]);
122
129
  const {
123
130
  createAnalyticsEvent
124
131
  } = useAnalyticsEvents();
@@ -1,4 +1,5 @@
1
1
  /* ReactionsDialogHeader.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import "./ReactionsDialogHeader.compiled.css";
3
4
  import * as React from 'react';
4
5
  import { ax, ix } from "@compiled/react/runtime";
@@ -12,8 +13,8 @@ import { IconButton } from '@atlaskit/button/new';
12
13
  import Heading from '@atlaskit/heading';
13
14
  import { useModal } from '@atlaskit/modal-dialog';
14
15
  import Tooltip from '@atlaskit/tooltip';
15
- import ChevronLeftIcon from '@atlaskit/icon/utility/chevron-left';
16
- import ChevronRightIcon from '@atlaskit/icon/utility/chevron-right';
16
+ import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
17
+ import ChevronLeftIcon from '@atlaskit/icon/core/chevron-left';
17
18
  import CloseIcon from '@atlaskit/icon/core/close';
18
19
  import { ResourcedEmoji } from '@atlaskit/emoji/element';
19
20
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -56,7 +57,9 @@ const LeftNavigationButton = ({
56
57
  }, /*#__PURE__*/React.createElement(IconButton, {
57
58
  spacing: "compact",
58
59
  onClick: handlePreviousPage,
59
- icon: ChevronLeftIcon,
60
+ icon: iconProps => /*#__PURE__*/React.createElement(ChevronLeftIcon, _extends({}, iconProps, {
61
+ size: "small"
62
+ })),
60
63
  label: intl.formatMessage(messages.leftNavigateLabel),
61
64
  isTooltipDisabled: false
62
65
  }));
@@ -70,7 +73,9 @@ const RightNavigationButton = ({
70
73
  }, /*#__PURE__*/React.createElement(IconButton, {
71
74
  spacing: "compact",
72
75
  onClick: handleNextPage,
73
- icon: ChevronRightIcon,
76
+ icon: iconProps => /*#__PURE__*/React.createElement(ChevronRightIcon, _extends({}, iconProps, {
77
+ size: "small"
78
+ })),
74
79
  label: intl.formatMessage(messages.rightNavigateLabel),
75
80
  isTooltipDisabled: false
76
81
  }));
@@ -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 = "33.0.0";
7
+ var packageVersion = "33.0.2";
8
8
  /**
9
9
  * TODO: move to utility package?
10
10
  * A random sampling function
@@ -7,6 +7,7 @@ import { ax, ix } from "@compiled/react/runtime";
7
7
  import { useCallback, useState } from 'react';
8
8
  import Popup from '@atlaskit/popup';
9
9
  import { EmojiPicker } from '@atlaskit/emoji/picker';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  import { useDelayedState } from '../hooks/useDelayedState';
11
12
  import { Reaction } from './Reaction';
12
13
  import { Trigger as EmojiPickerTrigger } from './Trigger';
@@ -239,6 +240,7 @@ export var ReactionSummaryView = function ReactionSummaryView(_ref) {
239
240
  summaryButtonIconAfter: summaryButtonIconAfter,
240
241
  summaryViewParticleEffectEmojiId: summaryViewParticleEffectEmojiId
241
242
  }));
242
- }
243
+ },
244
+ shouldRenderToParent: fg('should-render-to-parent-should-be-true-editor-coll')
243
245
  });
244
246
  };
@@ -151,6 +151,13 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
151
151
  _useState4 = _slicedToArray(_useState3, 2),
152
152
  summaryViewParticleEffectEmojiId = _useState4[0],
153
153
  setSummaryViewParticleEffectEmojiId = _useState4[1];
154
+
155
+ // if the reactions are empty, then set summaryViewParticleEffectEmojiId to null to clear the particle effect state
156
+ useEffect(function () {
157
+ if (reactions.length === 0) {
158
+ setSummaryViewParticleEffectEmojiId(null);
159
+ }
160
+ }, [reactions]);
154
161
  var _useAnalyticsEvents = useAnalyticsEvents(),
155
162
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
156
163
  var openTime = useRef();
@@ -2,6 +2,7 @@
2
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
4
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
5
+ import _extends from "@babel/runtime/helpers/extends";
5
6
  import "./ReactionsDialogHeader.compiled.css";
6
7
  import * as React from 'react';
7
8
  import { ax, ix } from "@compiled/react/runtime";
@@ -18,8 +19,8 @@ import { IconButton } from '@atlaskit/button/new';
18
19
  import Heading from '@atlaskit/heading';
19
20
  import { useModal } from '@atlaskit/modal-dialog';
20
21
  import Tooltip from '@atlaskit/tooltip';
21
- import ChevronLeftIcon from '@atlaskit/icon/utility/chevron-left';
22
- import ChevronRightIcon from '@atlaskit/icon/utility/chevron-right';
22
+ import ChevronRightIcon from '@atlaskit/icon/core/chevron-right';
23
+ import ChevronLeftIcon from '@atlaskit/icon/core/chevron-left';
23
24
  import CloseIcon from '@atlaskit/icon/core/close';
24
25
  import { ResourcedEmoji } from '@atlaskit/emoji/element';
25
26
  import { fg } from '@atlaskit/platform-feature-flags';
@@ -60,7 +61,11 @@ var LeftNavigationButton = function LeftNavigationButton(_ref2) {
60
61
  }, /*#__PURE__*/React.createElement(IconButton, {
61
62
  spacing: "compact",
62
63
  onClick: handlePreviousPage,
63
- icon: ChevronLeftIcon,
64
+ icon: function icon(iconProps) {
65
+ return /*#__PURE__*/React.createElement(ChevronLeftIcon, _extends({}, iconProps, {
66
+ size: "small"
67
+ }));
68
+ },
64
69
  label: intl.formatMessage(messages.leftNavigateLabel),
65
70
  isTooltipDisabled: false
66
71
  }));
@@ -73,7 +78,11 @@ var RightNavigationButton = function RightNavigationButton(_ref3) {
73
78
  }, /*#__PURE__*/React.createElement(IconButton, {
74
79
  spacing: "compact",
75
80
  onClick: handleNextPage,
76
- icon: ChevronRightIcon,
81
+ icon: function icon(iconProps) {
82
+ return /*#__PURE__*/React.createElement(ChevronRightIcon, _extends({}, iconProps, {
83
+ size: "small"
84
+ }));
85
+ },
77
86
  label: intl.formatMessage(messages.rightNavigateLabel),
78
87
  isTooltipDisabled: false
79
88
  }));
@@ -45,9 +45,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
45
45
  /**
46
46
  * Optional function when the user wants to open the Reactions Dialog
47
47
  */
48
- handleOpenReactionsDialog?: (options?: OpenReactionsDialogOptions) => void /**
48
+ handleOpenReactionsDialog?: (options?: OpenReactionsDialogOptions) => void;
49
+ /**
49
50
  * Optional prop for controlling if the reactions component is view only, disabling adding reactions
50
- */;
51
+ */
51
52
  isViewOnly?: boolean;
52
53
  /**
53
54
  * Optional event handler when the emoji picker is opened
@@ -45,9 +45,10 @@ interface ReactionSummaryViewProps extends Pick<ReactionsProps, 'emojiProvider'
45
45
  /**
46
46
  * Optional function when the user wants to open the Reactions Dialog
47
47
  */
48
- handleOpenReactionsDialog?: (options?: OpenReactionsDialogOptions) => void /**
48
+ handleOpenReactionsDialog?: (options?: OpenReactionsDialogOptions) => void;
49
+ /**
49
50
  * Optional prop for controlling if the reactions component is view only, disabling adding reactions
50
- */;
51
+ */
51
52
  isViewOnly?: boolean;
52
53
  /**
53
54
  * Optional event handler when the emoji picker is opened
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "33.0.0",
3
+ "version": "33.0.2",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -40,7 +40,7 @@
40
40
  "@atlaskit/css": "^0.10.0",
41
41
  "@atlaskit/emoji": "^69.3.0",
42
42
  "@atlaskit/heading": "^5.2.0",
43
- "@atlaskit/icon": "^26.4.0",
43
+ "@atlaskit/icon": "^27.0.0",
44
44
  "@atlaskit/link": "^3.2.0",
45
45
  "@atlaskit/modal-dialog": "^14.2.0",
46
46
  "@atlaskit/motion": "^5.1.0",
@@ -54,7 +54,7 @@
54
54
  "@atlaskit/spinner": "^18.0.0",
55
55
  "@atlaskit/tabs": "^18.1.0",
56
56
  "@atlaskit/theme": "^18.0.0",
57
- "@atlaskit/tokens": "^5.1.0",
57
+ "@atlaskit/tokens": "^5.2.0",
58
58
  "@atlaskit/tooltip": "^20.3.0",
59
59
  "@atlaskit/ufo": "^0.4.0",
60
60
  "@atlaskit/util-service-support": "^6.3.0",
@@ -134,6 +134,9 @@
134
134
  },
135
135
  "dst-a11y__replace-anchor-with-link__editor-collabo": {
136
136
  "type": "boolean"
137
+ },
138
+ "should-render-to-parent-should-be-true-editor-coll": {
139
+ "type": "boolean"
137
140
  }
138
141
  },
139
142
  "sideEffects": [