@atlaskit/reactions 22.8.0 → 22.8.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,22 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 22.8.2
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+
9
+ ## 22.8.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [#115247](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/115247)
14
+ [`f0dec2710f268`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/f0dec2710f268) -
15
+ [ux] Removes selected reaction animation. The previous version 22.7.4 unintentionally
16
+ re-introduced an animation of selected reactions which already existed but was previously broken.
17
+ It was decided to remove this animation instead. The delay between selecting a reaction and
18
+ closing the selection popup was removed as this was only delayed to accomodate the animation.
19
+
3
20
  ## 22.8.0
4
21
 
5
22
  ### 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 = "22.8.0";
14
+ var packageVersion = "22.8.2";
15
15
  /**
16
16
  * TODO: move to utility package?
17
17
  * A random sampling function
@@ -6,7 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.Selector = exports.RENDER_SELECTOR_TESTID = void 0;
9
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
9
  var _react = _interopRequireWildcard(require("react"));
11
10
  var _react2 = require("@emotion/react");
12
11
  var _primitives = require("@atlaskit/primitives");
@@ -44,9 +43,12 @@ var separatorStyles = (0, _primitives.xcss)({
44
43
  });
45
44
  var Reveal = function Reveal(_ref) {
46
45
  var children = _ref.children,
47
- delay = _ref.delay;
46
+ delay = _ref.delay,
47
+ testId = _ref.testId;
48
48
  return (0, _react2.jsx)("div", {
49
+ "data-testid": testId
49
50
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
51
+ ,
50
52
  css: _styles.revealStyle
51
53
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
52
54
  ,
@@ -66,38 +68,6 @@ var Selector = exports.Selector = function Selector(_ref2) {
66
68
  showMore = _ref2.showMore,
67
69
  _ref2$pickerQuickReac = _ref2.pickerQuickReactionEmojiIds,
68
70
  pickerQuickReactionEmojiIds = _ref2$pickerQuickReac === void 0 ? _constants.DefaultReactions : _ref2$pickerQuickReac;
69
- var _useState = (0, _react.useState)(),
70
- _useState2 = (0, _slicedToArray2.default)(_useState, 2),
71
- selection = _useState2[0],
72
- setSelection = _useState2[1];
73
- /**
74
- * Collection of global DOM timeout ids when user selects emojis for animation display
75
- */
76
- var timeoutIds = (0, _react.useRef)([]);
77
-
78
- /**
79
- * Clear the timeouts for the selected emojis when the component unmounts
80
- */
81
- (0, _react.useEffect)(function () {
82
- var timeoutValues = timeoutIds.current;
83
- return function cleanup() {
84
- timeoutValues.forEach(clearTimeout);
85
- };
86
- }, []);
87
-
88
- /**
89
- * event handler when an emoji gets selected
90
- * @param item selected emoji
91
- * @param description depth detail of the selected emoji
92
- * @param event Dom event data
93
- */
94
- var onSelected = function onSelected(item, description, event) {
95
- timeoutIds.current.push(window.setTimeout(function () {
96
- onSelection(item, description, event);
97
- }, 250));
98
- setSelection(item);
99
- };
100
-
101
71
  /**
102
72
  * Render the default emoji icon
103
73
  * @param emoji emoji item
@@ -107,21 +77,15 @@ var Selector = exports.Selector = function Selector(_ref2) {
107
77
  var _emoji$id;
108
78
  return (0, _react2.jsx)(Reveal, {
109
79
  delay: index * REVEAL_DELAY,
110
- key: (_emoji$id = emoji.id) !== null && _emoji$id !== void 0 ? _emoji$id : emoji.shortName
111
- }, (0, _react2.jsx)("div", {
112
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
113
- className: emoji === selection ? 'selected' : undefined
114
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
115
- ,
116
- css: _styles.emojiStyle,
117
- "data-testid": RENDER_SELECTOR_TESTID
80
+ key: (_emoji$id = emoji.id) !== null && _emoji$id !== void 0 ? _emoji$id : emoji.shortName,
81
+ testId: RENDER_SELECTOR_TESTID
118
82
  }, (0, _react2.jsx)(_tooltip.default, {
119
83
  content: emoji.shortName
120
84
  }, (0, _react2.jsx)(_EmojiButton.EmojiButton, {
121
85
  emojiId: emoji,
122
86
  emojiProvider: emojiProvider,
123
- onClick: onSelected
124
- }))));
87
+ onClick: onSelection
88
+ })));
125
89
  };
126
90
  return (0, _react2.jsx)(_primitives.Inline, {
127
91
  alignBlock: "center",
@@ -3,21 +3,11 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.revealStyle = exports.revealAnimation = exports.emojiStyle = void 0;
6
+ exports.revealStyle = exports.revealAnimation = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  /** @jsx jsx */
9
9
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
10
10
 
11
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
12
- var emojiStyle = exports.emojiStyle = (0, _react.css)({
13
- display: 'inline-block',
14
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
15
- '&.selected': {
16
- transition: 'transform 200ms ease-in-out',
17
- transform: 'translateY(-48px) scale(2.667)'
18
- }
19
- });
20
-
21
11
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-keyframes -- Ignored via go/DSP-18766
22
12
  var revealAnimation = exports.revealAnimation = (0, _react.keyframes)({
23
13
  '0%': {
@@ -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 = "22.8.0";
4
+ const packageVersion = "22.8.2";
5
5
  /**
6
6
  * TODO: move to utility package?
7
7
  * A random sampling function
@@ -1,5 +1,5 @@
1
1
  /** @jsx jsx */
2
- import React, { Fragment, useEffect, useRef, useState } from 'react';
2
+ import React, { Fragment } from 'react';
3
3
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
4
4
  import { jsx } from '@emotion/react';
5
5
  import { Box, Inline, xcss } from '@atlaskit/primitives';
@@ -7,7 +7,7 @@ import Tooltip from '@atlaskit/tooltip';
7
7
  import { DefaultReactions } from '../../shared/constants';
8
8
  import { EmojiButton } from '../EmojiButton';
9
9
  import { ShowMore } from '../ShowMore';
10
- import { emojiStyle, revealStyle } from './styles';
10
+ import { revealStyle } from './styles';
11
11
 
12
12
  /**
13
13
  * Test id for wrapper Selector div
@@ -32,10 +32,13 @@ const separatorStyles = xcss({
32
32
  });
33
33
  const Reveal = ({
34
34
  children,
35
- delay
35
+ delay,
36
+ testId
36
37
  }) => {
37
38
  return jsx("div", {
39
+ "data-testid": testId
38
40
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
41
+ ,
39
42
  css: revealStyle
40
43
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
41
44
  ,
@@ -55,35 +58,6 @@ export const Selector = ({
55
58
  showMore,
56
59
  pickerQuickReactionEmojiIds = DefaultReactions
57
60
  }) => {
58
- const [selection, setSelection] = useState();
59
- /**
60
- * Collection of global DOM timeout ids when user selects emojis for animation display
61
- */
62
- const timeoutIds = useRef([]);
63
-
64
- /**
65
- * Clear the timeouts for the selected emojis when the component unmounts
66
- */
67
- useEffect(() => {
68
- const timeoutValues = timeoutIds.current;
69
- return function cleanup() {
70
- timeoutValues.forEach(clearTimeout);
71
- };
72
- }, []);
73
-
74
- /**
75
- * event handler when an emoji gets selected
76
- * @param item selected emoji
77
- * @param description depth detail of the selected emoji
78
- * @param event Dom event data
79
- */
80
- const onSelected = (item, description, event) => {
81
- timeoutIds.current.push(window.setTimeout(() => {
82
- onSelection(item, description, event);
83
- }, 250));
84
- setSelection(item);
85
- };
86
-
87
61
  /**
88
62
  * Render the default emoji icon
89
63
  * @param emoji emoji item
@@ -93,21 +67,15 @@ export const Selector = ({
93
67
  var _emoji$id;
94
68
  return jsx(Reveal, {
95
69
  delay: index * REVEAL_DELAY,
96
- key: (_emoji$id = emoji.id) !== null && _emoji$id !== void 0 ? _emoji$id : emoji.shortName
97
- }, jsx("div", {
98
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
99
- className: emoji === selection ? 'selected' : undefined
100
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
101
- ,
102
- css: emojiStyle,
103
- "data-testid": RENDER_SELECTOR_TESTID
70
+ key: (_emoji$id = emoji.id) !== null && _emoji$id !== void 0 ? _emoji$id : emoji.shortName,
71
+ testId: RENDER_SELECTOR_TESTID
104
72
  }, jsx(Tooltip, {
105
73
  content: emoji.shortName
106
74
  }, jsx(EmojiButton, {
107
75
  emojiId: emoji,
108
76
  emojiProvider: emojiProvider,
109
- onClick: onSelected
110
- }))));
77
+ onClick: onSelection
78
+ })));
111
79
  };
112
80
  return jsx(Inline, {
113
81
  alignBlock: "center",
@@ -2,16 +2,6 @@
2
2
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
3
  import { css, keyframes } from '@emotion/react';
4
4
 
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
6
- export const emojiStyle = css({
7
- display: 'inline-block',
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
9
- '&.selected': {
10
- transition: 'transform 200ms ease-in-out',
11
- transform: 'translateY(-48px) scale(2.667)'
12
- }
13
- });
14
-
15
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-keyframes -- Ignored via go/DSP-18766
16
6
  export const revealAnimation = keyframes({
17
7
  '0%': {
@@ -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 = "22.8.0";
7
+ var packageVersion = "22.8.2";
8
8
  /**
9
9
  * TODO: move to utility package?
10
10
  * A random sampling function
@@ -1,6 +1,5 @@
1
- import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
2
1
  /** @jsx jsx */
3
- import React, { Fragment, useEffect, useRef, useState } from 'react';
2
+ import React, { Fragment } from 'react';
4
3
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
4
  import { jsx } from '@emotion/react';
6
5
  import { Box, Inline, xcss } from '@atlaskit/primitives';
@@ -8,7 +7,7 @@ import Tooltip from '@atlaskit/tooltip';
8
7
  import { DefaultReactions } from '../../shared/constants';
9
8
  import { EmojiButton } from '../EmojiButton';
10
9
  import { ShowMore } from '../ShowMore';
11
- import { emojiStyle, revealStyle } from './styles';
10
+ import { revealStyle } from './styles';
12
11
 
13
12
  /**
14
13
  * Test id for wrapper Selector div
@@ -33,9 +32,12 @@ var separatorStyles = xcss({
33
32
  });
34
33
  var Reveal = function Reveal(_ref) {
35
34
  var children = _ref.children,
36
- delay = _ref.delay;
35
+ delay = _ref.delay,
36
+ testId = _ref.testId;
37
37
  return jsx("div", {
38
+ "data-testid": testId
38
39
  // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
40
+ ,
39
41
  css: revealStyle
40
42
  // eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
41
43
  ,
@@ -55,38 +57,6 @@ export var Selector = function Selector(_ref2) {
55
57
  showMore = _ref2.showMore,
56
58
  _ref2$pickerQuickReac = _ref2.pickerQuickReactionEmojiIds,
57
59
  pickerQuickReactionEmojiIds = _ref2$pickerQuickReac === void 0 ? DefaultReactions : _ref2$pickerQuickReac;
58
- var _useState = useState(),
59
- _useState2 = _slicedToArray(_useState, 2),
60
- selection = _useState2[0],
61
- setSelection = _useState2[1];
62
- /**
63
- * Collection of global DOM timeout ids when user selects emojis for animation display
64
- */
65
- var timeoutIds = useRef([]);
66
-
67
- /**
68
- * Clear the timeouts for the selected emojis when the component unmounts
69
- */
70
- useEffect(function () {
71
- var timeoutValues = timeoutIds.current;
72
- return function cleanup() {
73
- timeoutValues.forEach(clearTimeout);
74
- };
75
- }, []);
76
-
77
- /**
78
- * event handler when an emoji gets selected
79
- * @param item selected emoji
80
- * @param description depth detail of the selected emoji
81
- * @param event Dom event data
82
- */
83
- var onSelected = function onSelected(item, description, event) {
84
- timeoutIds.current.push(window.setTimeout(function () {
85
- onSelection(item, description, event);
86
- }, 250));
87
- setSelection(item);
88
- };
89
-
90
60
  /**
91
61
  * Render the default emoji icon
92
62
  * @param emoji emoji item
@@ -96,21 +66,15 @@ export var Selector = function Selector(_ref2) {
96
66
  var _emoji$id;
97
67
  return jsx(Reveal, {
98
68
  delay: index * REVEAL_DELAY,
99
- key: (_emoji$id = emoji.id) !== null && _emoji$id !== void 0 ? _emoji$id : emoji.shortName
100
- }, jsx("div", {
101
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
102
- className: emoji === selection ? 'selected' : undefined
103
- // eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
104
- ,
105
- css: emojiStyle,
106
- "data-testid": RENDER_SELECTOR_TESTID
69
+ key: (_emoji$id = emoji.id) !== null && _emoji$id !== void 0 ? _emoji$id : emoji.shortName,
70
+ testId: RENDER_SELECTOR_TESTID
107
71
  }, jsx(Tooltip, {
108
72
  content: emoji.shortName
109
73
  }, jsx(EmojiButton, {
110
74
  emojiId: emoji,
111
75
  emojiProvider: emojiProvider,
112
- onClick: onSelected
113
- }))));
76
+ onClick: onSelection
77
+ })));
114
78
  };
115
79
  return jsx(Inline, {
116
80
  alignBlock: "center",
@@ -2,16 +2,6 @@
2
2
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
3
3
  import { css, keyframes } from '@emotion/react';
4
4
 
5
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
6
- export var emojiStyle = css({
7
- display: 'inline-block',
8
- // eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
9
- '&.selected': {
10
- transition: 'transform 200ms ease-in-out',
11
- transform: 'translateY(-48px) scale(2.667)'
12
- }
13
- });
14
-
15
5
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-keyframes -- Ignored via go/DSP-18766
16
6
  export var revealAnimation = keyframes({
17
7
  '0%': {
@@ -1,5 +1,4 @@
1
1
  /** @jsx jsx */
2
2
  import { keyframes } from '@emotion/react';
3
- export declare const emojiStyle: import("@emotion/react").SerializedStyles;
4
3
  export declare const revealAnimation: typeof keyframes;
5
4
  export declare const revealStyle: import("@emotion/react").SerializedStyles;
@@ -1,5 +1,4 @@
1
1
  /** @jsx jsx */
2
2
  import { keyframes } from '@emotion/react';
3
- export declare const emojiStyle: import("@emotion/react").SerializedStyles;
4
3
  export declare const revealAnimation: typeof keyframes;
5
4
  export declare const revealStyle: import("@emotion/react").SerializedStyles;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "22.8.0",
3
+ "version": "22.8.2",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,8 +43,8 @@
43
43
  "@atlaskit/modal-dialog": "^12.14.0",
44
44
  "@atlaskit/motion": "^1.7.0",
45
45
  "@atlaskit/popper": "^6.1.0",
46
- "@atlaskit/popup": "1.19.3",
47
- "@atlaskit/primitives": "^9.0.0",
46
+ "@atlaskit/popup": "1.19.4",
47
+ "@atlaskit/primitives": "^10.0.0",
48
48
  "@atlaskit/spinner": "^16.2.0",
49
49
  "@atlaskit/tabs": "^16.2.0",
50
50
  "@atlaskit/theme": "^12.11.0",