@atlaskit/reactions 25.1.0 → 25.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 25.2.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#113141](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/113141)
8
+ [`2b9b00172281b`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/2b9b00172281b) -
9
+ Added new 'onlyRenderPicker' property to hide user reactions and only render picker
10
+
3
11
  ## 25.1.0
4
12
 
5
13
  ### Minor Changes
@@ -11,7 +11,7 @@ var _analyticsGasTypes = require("@atlaskit/analytics-gas-types");
11
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
12
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
13
13
  var packageName = "@atlaskit/reactions";
14
- var packageVersion = "25.1.0";
14
+ var packageVersion = "25.2.0";
15
15
  /**
16
16
  * TODO: move to utility package?
17
17
  * A random sampling function
@@ -146,7 +146,9 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
146
146
  showAddReactionText = _ref$showAddReactionT === void 0 ? false : _ref$showAddReactionT,
147
147
  _ref$hideDefaultReact = _ref.hideDefaultReactions,
148
148
  hideDefaultReactions = _ref$hideDefaultReact === void 0 ? false : _ref$hideDefaultReact,
149
- ProfileCardWrapper = _ref.ProfileCardWrapper;
149
+ ProfileCardWrapper = _ref.ProfileCardWrapper,
150
+ _ref$onlyRenderPicker = _ref.onlyRenderPicker,
151
+ onlyRenderPicker = _ref$onlyRenderPicker === void 0 ? false : _ref$onlyRenderPicker;
150
152
  var _useState = (0, _react.useState)(),
151
153
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
152
154
  selectedEmojiId = _useState2[0],
@@ -316,7 +318,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
316
318
  (0, _react2.jsx)("div", {
317
319
  css: _styles.wrapperStyle,
318
320
  "data-testid": RENDER_REACTIONS_TESTID
319
- }, shouldShowSummaryView ? (0, _react2.jsx)("div", {
321
+ }, !onlyRenderPicker && (shouldShowSummaryView ? (0, _react2.jsx)("div", {
320
322
  "data-testid": RENDER_REACTIONS_SUMMARY_TESTID
321
323
  }, (0, _react2.jsx)(_ReactionSummary.ReactionSummaryView, {
322
324
  reactions: sortedReactions,
@@ -343,7 +345,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
343
345
  showParticleEffect: particleEffectByEmoji[reaction.emojiId],
344
346
  showOpaqueBackground: showOpaqueBackground
345
347
  });
346
- }), allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && (0, _react2.jsx)(_primitives.Box, {
348
+ })), !onlyRenderPicker && allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && (0, _react2.jsx)(_primitives.Box, {
347
349
  xcss: dialogEntrypointButtonStyle
348
350
  }, (0, _react2.jsx)(_primitives.Pressable, {
349
351
  backgroundColor: "color.background.neutral.subtle",
package/dist/cjs/index.js CHANGED
@@ -45,6 +45,12 @@ Object.defineProperty(exports, "ReactionServiceClient", {
45
45
  return _client.ReactionServiceClient;
46
46
  }
47
47
  });
48
+ Object.defineProperty(exports, "ReactionStatus", {
49
+ enumerable: true,
50
+ get: function get() {
51
+ return _types.ReactionStatus;
52
+ }
53
+ });
48
54
  Object.defineProperty(exports, "ReactionUpdateType", {
49
55
  enumerable: true,
50
56
  get: function get() {
@@ -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 = "25.1.0";
4
+ const packageVersion = "25.2.0";
5
5
  /**
6
6
  * TODO: move to utility package?
7
7
  * A random sampling function
@@ -114,7 +114,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
114
114
  subtleReactionsSummaryAndPicker = false,
115
115
  showAddReactionText = false,
116
116
  hideDefaultReactions = false,
117
- ProfileCardWrapper
117
+ ProfileCardWrapper,
118
+ onlyRenderPicker = false
118
119
  }) => {
119
120
  const [selectedEmojiId, setSelectedEmojiId] = useState();
120
121
  const {
@@ -275,7 +276,7 @@ export const Reactions = /*#__PURE__*/React.memo(({
275
276
  jsx("div", {
276
277
  css: wrapperStyle,
277
278
  "data-testid": RENDER_REACTIONS_TESTID
278
- }, shouldShowSummaryView ? jsx("div", {
279
+ }, !onlyRenderPicker && (shouldShowSummaryView ? jsx("div", {
279
280
  "data-testid": RENDER_REACTIONS_SUMMARY_TESTID
280
281
  }, jsx(ReactionSummaryView, {
281
282
  reactions: sortedReactions,
@@ -300,7 +301,7 @@ export const Reactions = /*#__PURE__*/React.memo(({
300
301
  flash: flash[reaction.emojiId],
301
302
  showParticleEffect: particleEffectByEmoji[reaction.emojiId],
302
303
  showOpaqueBackground: showOpaqueBackground
303
- })), allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && jsx(Box, {
304
+ }))), !onlyRenderPicker && allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && jsx(Box, {
304
305
  xcss: dialogEntrypointButtonStyle
305
306
  }, jsx(Pressable, {
306
307
  backgroundColor: "color.background.neutral.subtle",
@@ -6,7 +6,7 @@ export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
6
6
  export { MemoryReactionsStore, ReactionConsumer } from './store';
7
7
  // TODO: Convert all calls for ReactionRequest to Request, RequestClient to Client and ReactionsStore to Store
8
8
 
9
- export { ReactionUpdateType } from './types';
9
+ export { ReactionUpdateType, ReactionStatus } from './types';
10
10
  export const constants = {
11
11
  DefaultReactions,
12
12
  DefaultReactionsByShortName,
@@ -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 = "25.1.0";
7
+ var packageVersion = "25.2.0";
8
8
  /**
9
9
  * TODO: move to utility package?
10
10
  * A random sampling function
@@ -133,7 +133,9 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
133
133
  showAddReactionText = _ref$showAddReactionT === void 0 ? false : _ref$showAddReactionT,
134
134
  _ref$hideDefaultReact = _ref.hideDefaultReactions,
135
135
  hideDefaultReactions = _ref$hideDefaultReact === void 0 ? false : _ref$hideDefaultReact,
136
- ProfileCardWrapper = _ref.ProfileCardWrapper;
136
+ ProfileCardWrapper = _ref.ProfileCardWrapper,
137
+ _ref$onlyRenderPicker = _ref.onlyRenderPicker,
138
+ onlyRenderPicker = _ref$onlyRenderPicker === void 0 ? false : _ref$onlyRenderPicker;
137
139
  var _useState = useState(),
138
140
  _useState2 = _slicedToArray(_useState, 2),
139
141
  selectedEmojiId = _useState2[0],
@@ -303,7 +305,7 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
303
305
  jsx("div", {
304
306
  css: wrapperStyle,
305
307
  "data-testid": RENDER_REACTIONS_TESTID
306
- }, shouldShowSummaryView ? jsx("div", {
308
+ }, !onlyRenderPicker && (shouldShowSummaryView ? jsx("div", {
307
309
  "data-testid": RENDER_REACTIONS_SUMMARY_TESTID
308
310
  }, jsx(ReactionSummaryView, {
309
311
  reactions: sortedReactions,
@@ -330,7 +332,7 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
330
332
  showParticleEffect: particleEffectByEmoji[reaction.emojiId],
331
333
  showOpaqueBackground: showOpaqueBackground
332
334
  });
333
- }), allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && jsx(Box, {
335
+ })), !onlyRenderPicker && allowUserDialog && hasEmojiWithFivePlusReactions && !shouldShowSummaryView && jsx(Box, {
334
336
  xcss: dialogEntrypointButtonStyle
335
337
  }, jsx(Pressable, {
336
338
  backgroundColor: "color.background.neutral.subtle",
package/dist/esm/index.js CHANGED
@@ -6,7 +6,7 @@ export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
6
6
  export { MemoryReactionsStore, ReactionConsumer } from './store';
7
7
  // TODO: Convert all calls for ReactionRequest to Request, RequestClient to Client and ReactionsStore to Store
8
8
 
9
- export { ReactionUpdateType } from './types';
9
+ export { ReactionUpdateType, ReactionStatus } from './types';
10
10
  export var constants = {
11
11
  DefaultReactions: DefaultReactions,
12
12
  DefaultReactionsByShortName: DefaultReactionsByShortName,
@@ -139,6 +139,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
139
139
  * Optional prop for rendering a profile card wrapper in the Reactions Dialog
140
140
  */
141
141
  ProfileCardWrapper?: ProfileCardWrapper;
142
+ /**
143
+ * Optional prop to hide the user reactions and only render the picker
144
+ */
145
+ onlyRenderPicker?: boolean;
142
146
  }
143
147
  /**
144
148
  * Get content of the tooltip
@@ -147,4 +151,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
147
151
  /**
148
152
  * Renders list of reactions
149
153
  */
150
- export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, }: ReactionsProps) => jsx.JSX.Element>;
154
+ export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, }: ReactionsProps) => jsx.JSX.Element>;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { type ReactionsProps, type ReactionPickerProps } from '../../components';
3
3
  import { ReactionStatus, type Actions, type State, type StorePropInput } from '../../types';
4
4
  import { type ReactionUpdateSuccess } from '../../types/reaction';
5
- export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis' | 'onDialogOpenCallback' | 'onDialogCloseCallback' | 'onDialogSelectReactionCallback' | 'allowUserDialog' | 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize' | 'miniMode' | 'summaryViewEnabled' | 'subtleReactionsSummaryAndPicker'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
5
+ export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis' | 'onDialogOpenCallback' | 'onDialogCloseCallback' | 'onDialogSelectReactionCallback' | 'allowUserDialog' | 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize' | 'miniMode' | 'summaryViewEnabled' | 'subtleReactionsSummaryAndPicker' | 'onlyRenderPicker'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
6
6
  /**
7
7
  * Wrapper id for reactions list
8
8
  */
@@ -4,7 +4,7 @@ export { Reaction, ReactionPicker, Reactions } from './components';
4
4
  export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
5
5
  export { MemoryReactionsStore, ReactionConsumer } from './store';
6
6
  export type { Client as ReactionClient, Request as ReactionRequest, Store as ReactionsStore, StorePropInput, State, } from './types';
7
- export { ReactionUpdateType } from './types';
7
+ export { ReactionUpdateType, ReactionStatus } from './types';
8
8
  export declare const constants: {
9
9
  DefaultReactions: import("@atlaskit/emoji").EmojiId[];
10
10
  DefaultReactionsByShortName: Map<string, import("@atlaskit/emoji").EmojiId>;
@@ -139,6 +139,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
139
139
  * Optional prop for rendering a profile card wrapper in the Reactions Dialog
140
140
  */
141
141
  ProfileCardWrapper?: ProfileCardWrapper;
142
+ /**
143
+ * Optional prop to hide the user reactions and only render the picker
144
+ */
145
+ onlyRenderPicker?: boolean;
142
146
  }
143
147
  /**
144
148
  * Get content of the tooltip
@@ -147,4 +151,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
147
151
  /**
148
152
  * Renders list of reactions
149
153
  */
150
- export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, }: ReactionsProps) => jsx.JSX.Element>;
154
+ export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onReactionHover, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, }: ReactionsProps) => jsx.JSX.Element>;
@@ -2,7 +2,7 @@ import React from 'react';
2
2
  import { type ReactionsProps, type ReactionPickerProps } from '../../components';
3
3
  import { ReactionStatus, type Actions, type State, type StorePropInput } from '../../types';
4
4
  import { type ReactionUpdateSuccess } from '../../types/reaction';
5
- export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis' | 'onDialogOpenCallback' | 'onDialogCloseCallback' | 'onDialogSelectReactionCallback' | 'allowUserDialog' | 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize' | 'miniMode' | 'summaryViewEnabled' | 'subtleReactionsSummaryAndPicker'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
5
+ export interface ConnectedReactionsViewProps extends Pick<ReactionsProps, 'quickReactionEmojis' | 'onDialogOpenCallback' | 'onDialogCloseCallback' | 'onDialogSelectReactionCallback' | 'allowUserDialog' | 'allowAllEmojis' | 'emojiProvider' | 'emojiPickerSize' | 'miniMode' | 'summaryViewEnabled' | 'subtleReactionsSummaryAndPicker' | 'onlyRenderPicker'>, Pick<ReactionPickerProps, 'pickerQuickReactionEmojiIds'> {
6
6
  /**
7
7
  * Wrapper id for reactions list
8
8
  */
@@ -4,7 +4,7 @@ export { Reaction, ReactionPicker, Reactions } from './components';
4
4
  export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
5
5
  export { MemoryReactionsStore, ReactionConsumer } from './store';
6
6
  export type { Client as ReactionClient, Request as ReactionRequest, Store as ReactionsStore, StorePropInput, State, } from './types';
7
- export { ReactionUpdateType } from './types';
7
+ export { ReactionUpdateType, ReactionStatus } from './types';
8
8
  export declare const constants: {
9
9
  DefaultReactions: import("@atlaskit/emoji").EmojiId[];
10
10
  DefaultReactionsByShortName: Map<string, import("@atlaskit/emoji").EmojiId>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "25.1.0",
3
+ "version": "25.2.0",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -37,9 +37,9 @@
37
37
  "@atlaskit/analytics-next": "^10.3.0",
38
38
  "@atlaskit/avatar": "^21.18.0",
39
39
  "@atlaskit/button": "^20.5.0",
40
- "@atlaskit/emoji": "^67.13.0",
40
+ "@atlaskit/emoji": "^67.14.0",
41
41
  "@atlaskit/heading": "^4.1.0",
42
- "@atlaskit/icon": "^23.8.0",
42
+ "@atlaskit/icon": "^23.9.0",
43
43
  "@atlaskit/modal-dialog": "^12.20.0",
44
44
  "@atlaskit/motion": "^2.0.0",
45
45
  "@atlaskit/platform-feature-flags": "^1.0.0",