@atlaskit/reactions 33.2.20 → 33.2.22

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.
Files changed (32) hide show
  1. package/CHANGELOG.md +16 -0
  2. package/dist/cjs/components/ReactionPicker.js +30 -19
  3. package/dist/cjs/components/Reactions.js +1 -7
  4. package/dist/cjs/components/ReactionsDialogHeader.compiled.css +1 -1
  5. package/dist/cjs/components/ReactionsDialogHeader.js +2 -2
  6. package/dist/cjs/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +1 -7
  7. package/dist/cjs/index.js +6 -8
  8. package/dist/es2019/components/ReactionPicker.js +28 -17
  9. package/dist/es2019/components/Reactions.js +1 -7
  10. package/dist/es2019/components/ReactionsDialogHeader.compiled.css +1 -1
  11. package/dist/es2019/components/ReactionsDialogHeader.js +1 -1
  12. package/dist/es2019/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +1 -7
  13. package/dist/es2019/index.js +1 -7
  14. package/dist/esm/components/ReactionPicker.js +31 -20
  15. package/dist/esm/components/Reactions.js +1 -7
  16. package/dist/esm/components/ReactionsDialogHeader.compiled.css +1 -1
  17. package/dist/esm/components/ReactionsDialogHeader.js +2 -2
  18. package/dist/esm/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +1 -7
  19. package/dist/esm/index.js +1 -7
  20. package/dist/types/components/ReactionPicker.d.ts +7 -0
  21. package/dist/types/index.d.ts +1 -1
  22. package/dist/types-ts4.5/components/ReactionPicker.d.ts +7 -0
  23. package/dist/types-ts4.5/index.d.ts +1 -1
  24. package/package.json +5 -15
  25. package/dist/cjs/components/ReactionPickerNew.compiled.css +0 -11
  26. package/dist/cjs/components/ReactionPickerNew.js +0 -421
  27. package/dist/es2019/components/ReactionPickerNew.compiled.css +0 -11
  28. package/dist/es2019/components/ReactionPickerNew.js +0 -374
  29. package/dist/esm/components/ReactionPickerNew.compiled.css +0 -11
  30. package/dist/esm/components/ReactionPickerNew.js +0 -412
  31. package/dist/types/components/ReactionPickerNew.d.ts +0 -114
  32. package/dist/types-ts4.5/components/ReactionPickerNew.d.ts +0 -114
package/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 33.2.22
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6fb79942fc3a5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6fb79942fc3a5) -
8
+ Internal changes to how borders are applied.
9
+ - Updated dependencies
10
+
11
+ ## 33.2.21
12
+
13
+ ### Patch Changes
14
+
15
+ - [`2ca8e1156c6f5`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2ca8e1156c6f5) -
16
+ tidy up FF for reactions picker
17
+ - Updated dependencies
18
+
3
19
  ## 33.2.20
4
20
 
5
21
  ### Patch Changes
@@ -27,6 +27,7 @@ var _Selector = require("./Selector");
27
27
  var _Trigger = require("./Trigger");
28
28
  var _RepositionOnUpdate = require("./RepositionOnUpdate");
29
29
  var _colors = require("@atlaskit/theme/colors");
30
+ var _portal = _interopRequireDefault(require("@atlaskit/portal"));
30
31
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
31
32
  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; }
32
33
  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; }
@@ -156,19 +157,6 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
156
157
  settings = _useState10[0],
157
158
  setSettings = _useState10[1];
158
159
 
159
- /**
160
- * Custom hook triggers when user clicks outside the reactions picker
161
- */
162
- (0, _useCloseManager.useCloseManager)(wrapperRef, function (callbackType) {
163
- close();
164
- onCancel();
165
- if (triggerRef && callbackType === 'ESCAPE') {
166
- requestAnimationFrame(function () {
167
- return triggerRef.focus();
168
- });
169
- }
170
- }, true, isPopupTrayOpen);
171
-
172
160
  /**
173
161
  * Event callback when the picker is closed
174
162
  * @param _id Optional id if an emoji button was selected or undefineed if was clicked outside the picker
@@ -287,6 +275,10 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
287
275
  var _updatePopper$current;
288
276
  (_updatePopper$current = updatePopper.current) === null || _updatePopper$current === void 0 || _updatePopper$current.call(updatePopper);
289
277
  }, [settings]);
278
+ var onClose = function onClose() {
279
+ close();
280
+ onCancel();
281
+ };
290
282
  return /*#__PURE__*/_react.default.createElement("div", {
291
283
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
292
284
  className: (0, _runtime.ax)(["_s7n4nkob _1pra1o8l", wrapperClassName]),
@@ -328,9 +320,14 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
328
320
  isListItem: isListItem
329
321
  }))
330
322
  );
331
- }), isPopupTrayOpen && /*#__PURE__*/_react.default.createElement(PopperWrapper, {
323
+ }), isPopupTrayOpen && /*#__PURE__*/_react.default.createElement(_portal.default, {
324
+ zIndex: _constants.layers.flag()
325
+ }, /*#__PURE__*/_react.default.createElement(PopperWrapper, {
332
326
  settings: settings,
333
- popperModifiers: popperModifiers
327
+ popperModifiers: popperModifiers,
328
+ isOpen: isPopupTrayOpen,
329
+ onClose: onClose,
330
+ triggerRef: triggerRef
334
331
  }, settings.showFullPicker || hoverableReactionPicker && isHoverableReactionPickerEmojiPickerOpen ? /*#__PURE__*/_react.default.createElement(_picker.EmojiPicker, {
335
332
  emojiProvider: emojiProvider,
336
333
  onSelection: onEmojiSelected,
@@ -346,10 +343,13 @@ var ReactionPicker = exports.ReactionPicker = /*#__PURE__*/_react.default.memo(f
346
343
  onMoreClick: onSelectMoreClick,
347
344
  pickerQuickReactionEmojiIds: pickerQuickReactionEmojiIds,
348
345
  hoverableReactionPickerSelector: hoverableReactionPicker
349
- })))));
346
+ }))))));
350
347
  });
351
348
  var PopperWrapper = exports.PopperWrapper = function PopperWrapper(props) {
352
- var settings = props.settings,
349
+ var triggerRef = props.triggerRef,
350
+ settings = props.settings,
351
+ isOpen = props.isOpen,
352
+ onClose = props.onClose,
353
353
  children = props.children,
354
354
  popperModifiers = props.popperModifiers;
355
355
  var _useState11 = (0, _react.useState)(null),
@@ -365,10 +365,21 @@ var PopperWrapper = exports.PopperWrapper = function PopperWrapper(props) {
365
365
  initialFocusRef: null,
366
366
  targetRef: popupRef
367
367
  });
368
+
369
+ /**
370
+ * Custom hook triggers when user clicks outside the reactions picker
371
+ */
372
+ (0, _useCloseManager.useCloseManagerV2)(popupRef, triggerRef, function (callbackType) {
373
+ onClose();
374
+ if (popupRef && callbackType === 'ESCAPE') {
375
+ requestAnimationFrame(function () {
376
+ return triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.focus();
377
+ });
378
+ }
379
+ }, true, isOpen);
368
380
  return /*#__PURE__*/_react.default.createElement(_popper.Popper, {
369
381
  placement: settings.popperPlacement,
370
- modifiers: popperModifiers,
371
- strategy: "absolute"
382
+ modifiers: popperModifiers
372
383
  }, function (_ref3) {
373
384
  var _ref4 = _ref3.ref,
374
385
  style = _ref3.style,
@@ -26,14 +26,8 @@ var _ufo = require("../ufo");
26
26
  var _Reaction = require("./Reaction");
27
27
  var _ReactionsDialog = require("./ReactionsDialog");
28
28
  var _ReactionPicker = require("./ReactionPicker");
29
- var _ReactionPickerNew = require("./ReactionPickerNew");
30
29
  var _ReactionSummaryView = require("./ReactionSummaryView");
31
- var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
32
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
33
30
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
34
- var ReactionPicker = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
35
- return (0, _platformFeatureFlags.fg)('platform_editor_reactions_picker_fix') || (0, _platformFeatureFlags.fg)('platform_editor_reactions_picker_fix_jira');
36
- }, _ReactionPickerNew.ReactionPicker, _ReactionPicker.ReactionPicker);
37
31
  var wrapperStyle = null;
38
32
  var noFlexWrapStyles = null;
39
33
  var noContainerPositionStyles = null;
@@ -390,7 +384,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
390
384
  isViewOnly: isViewOnly,
391
385
  showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0
392
386
  });
393
- })), isViewOnly || !onlyRenderPicker && shouldShowSummaryView && allowSelectFromSummaryView ? null : /*#__PURE__*/_react.default.createElement(ReactionPicker, {
387
+ })), isViewOnly || !onlyRenderPicker && shouldShowSummaryView && allowSelectFromSummaryView ? null : /*#__PURE__*/_react.default.createElement(_ReactionPicker.ReactionPicker, {
394
388
  emojiProvider: emojiProvider,
395
389
  allowAllEmojis: allowAllEmojis,
396
390
  pickerQuickReactionEmojiIds: pickerQuickReactionEmojiIds,
@@ -5,7 +5,7 @@
5
5
  ._nhktlyvf.disabled:after{background:linear-gradient(270deg,hsla(0,0%,100%,.95) 40.23%,hsla(0,0%,100%,.55) 58.33%,hsla(0,0%,100%,0) 77.49%)}
6
6
  ._1rjc1b66{padding-block:var(--ds-space-050,4px)}
7
7
  ._80wau2gc div[role=tablist]{padding-inline:var(--ds-space-100,8px)}
8
- ._n7zlfl6d{border-bottom:var(--_1wtzbnt)}._10d67vkz>span{min-height:1pc}
8
+ ._n7zl4gxu{border-bottom:var(--_1i0gnx0)}._10d67vkz>span{min-height:1pc}
9
9
  ._141m1j28 div[role=tablist]:before{background-color:transparent}
10
10
  ._18m91wug{overflow-y:auto}
11
11
  ._18u01wug{margin-left:auto}
@@ -154,9 +154,9 @@ var ReactionsDialogHeader = exports.ReactionsDialogHeader = function ReactionsDi
154
154
  onClick: handleCloseReactionsDialog
155
155
  })), /*#__PURE__*/React.createElement(_compiled.Inline, null, /*#__PURE__*/React.createElement("div", {
156
156
  id: "reactions-dialog-tabs-list",
157
- className: (0, _runtime.ax)(["_1reo1wug _18m91wug _n7zlfl6d _1e0c1txw _1bsb1osq _4cvr1y6m _80wau2gc _s2c4kb7n _141m1j28"]),
157
+ className: (0, _runtime.ax)(["_1reo1wug _18m91wug _n7zl4gxu _1e0c1txw _1bsb1osq _4cvr1y6m _80wau2gc _s2c4kb7n _141m1j28"]),
158
158
  style: {
159
- "--_1wtzbnt": (0, _runtime.ix)("1px solid ".concat("var(--ds-border, #EBECF0)"))
159
+ "--_1i0gnx0": (0, _runtime.ix)("var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, #EBECF0)"))
160
160
  }
161
161
  }, !isSinglePage && !isOnFirstPage && /*#__PURE__*/React.createElement(LeftNavigationButton, {
162
162
  handlePreviousPage: handlePreviousPage
@@ -12,12 +12,6 @@ var _react = _interopRequireDefault(require("react"));
12
12
  var _components = require("../../components");
13
13
  var _ufo = require("../../ufo");
14
14
  var _ReactionPicker = require("../../components/ReactionPicker");
15
- var _ReactionPickerNew = require("../../components/ReactionPickerNew");
16
- var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
17
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
18
- var ReactionPicker = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
19
- return (0, _platformFeatureFlags.fg)('platform_editor_reactions_picker_fix') || (0, _platformFeatureFlags.fg)('platform_editor_reactions_picker_fix_jira');
20
- }, _ReactionPickerNew.ReactionPicker, _ReactionPicker.ReactionPicker);
21
15
  /**
22
16
  * Reaction Picker component
23
17
  */
@@ -49,7 +43,7 @@ var ConnectedReactionPicker = exports.ConnectedReactionPicker = function Connect
49
43
  };
50
44
  return /*#__PURE__*/_react.default.createElement(_components.UfoErrorBoundary, {
51
45
  experiences: [_ufo.PickerRender]
52
- }, /*#__PURE__*/_react.default.createElement(ReactionPicker, (0, _extends2.default)({}, props, {
46
+ }, /*#__PURE__*/_react.default.createElement(_ReactionPicker.ReactionPicker, (0, _extends2.default)({}, props, {
53
47
  onSelection: onSelection
54
48
  })));
55
49
  };
package/dist/cjs/index.js CHANGED
@@ -33,7 +33,12 @@ Object.defineProperty(exports, "ReactionConsumer", {
33
33
  return _store.ReactionConsumer;
34
34
  }
35
35
  });
36
- exports.ReactionPicker = void 0;
36
+ Object.defineProperty(exports, "ReactionPicker", {
37
+ enumerable: true,
38
+ get: function get() {
39
+ return _ReactionPicker.ReactionPicker;
40
+ }
41
+ });
37
42
  Object.defineProperty(exports, "ReactionServiceClient", {
38
43
  enumerable: true,
39
44
  get: function get() {
@@ -68,9 +73,6 @@ Object.defineProperty(exports, "useCloseManager", {
68
73
  var _constants = require("./shared/constants");
69
74
  var _ufo = require("./ufo");
70
75
  var _ReactionPicker = require("./components/ReactionPicker");
71
- var _ReactionPickerNew = require("./components/ReactionPickerNew");
72
- var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
73
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
74
76
  var _client = require("./client");
75
77
  var _Reaction = require("./components/Reaction");
76
78
  var _Reactions = require("./components/Reactions");
@@ -78,10 +80,6 @@ var _useCloseManager = require("./hooks/useCloseManager");
78
80
  var _containers = require("./containers");
79
81
  var _store = require("./store");
80
82
  var _types = require("./types");
81
- var ReactionPicker = exports.ReactionPicker = (0, _platformFeatureFlagsReact.componentWithCondition)(function () {
82
- return (0, _platformFeatureFlags.fg)('platform_editor_reactions_picker_fix') || (0, _platformFeatureFlags.fg)('platform_editor_reactions_picker_fix_jira');
83
- }, _ReactionPickerNew.ReactionPicker, _ReactionPicker.ReactionPicker);
84
-
85
83
  // TODO: Convert all calls for ReactionRequest to Request, RequestClient to Client and ReactionsStore to Store
86
84
 
87
85
  var constants = exports.constants = {
@@ -8,7 +8,7 @@ import { Manager, Popper, Reference } from '@atlaskit/popper';
8
8
  import { layers } from '@atlaskit/theme/constants';
9
9
  import { Box } from '@atlaskit/primitives/compiled';
10
10
  import { fg } from '@atlaskit/platform-feature-flags';
11
- import { useCloseManager } from '../hooks/useCloseManager';
11
+ import { useCloseManagerV2 } from '../hooks/useCloseManager';
12
12
  import { useDelayedState } from '../hooks/useDelayedState';
13
13
  import { useFocusTrap } from '../hooks/useFocusTrap';
14
14
  import { messages } from '../shared/i18n';
@@ -17,6 +17,7 @@ import { Selector } from './Selector';
17
17
  import { Trigger } from './Trigger';
18
18
  import { RepositionOnUpdate } from './RepositionOnUpdate';
19
19
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
20
+ import Portal from '@atlaskit/portal';
20
21
  const pickerStyle = null;
21
22
  const popupWrapperStyle = null;
22
23
  const popupStyle = null;
@@ -114,17 +115,6 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
114
115
  popperPlacement
115
116
  });
116
117
 
117
- /**
118
- * Custom hook triggers when user clicks outside the reactions picker
119
- */
120
- useCloseManager(wrapperRef, callbackType => {
121
- close();
122
- onCancel();
123
- if (triggerRef && callbackType === 'ESCAPE') {
124
- requestAnimationFrame(() => triggerRef.focus());
125
- }
126
- }, true, isPopupTrayOpen);
127
-
128
118
  /**
129
119
  * Event callback when the picker is closed
130
120
  * @param _id Optional id if an emoji button was selected or undefineed if was clicked outside the picker
@@ -244,6 +234,10 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
244
234
  var _updatePopper$current;
245
235
  (_updatePopper$current = updatePopper.current) === null || _updatePopper$current === void 0 ? void 0 : _updatePopper$current.call(updatePopper);
246
236
  }, [settings]);
237
+ const onClose = () => {
238
+ close();
239
+ onCancel();
240
+ };
247
241
  return /*#__PURE__*/React.createElement("div", {
248
242
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
249
243
  className: ax(["_s7n4nkob _1pra1o8l", wrapperClassName]),
@@ -283,9 +277,14 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
283
277
  reactionPickerTriggerIcon: reactionPickerTriggerIcon,
284
278
  reactionPickerTriggerText: reactionPickerTriggerText,
285
279
  isListItem: isListItem
286
- }))), isPopupTrayOpen && /*#__PURE__*/React.createElement(PopperWrapper, {
280
+ }))), isPopupTrayOpen && /*#__PURE__*/React.createElement(Portal, {
281
+ zIndex: layers.flag()
282
+ }, /*#__PURE__*/React.createElement(PopperWrapper, {
287
283
  settings: settings,
288
- popperModifiers: popperModifiers
284
+ popperModifiers: popperModifiers,
285
+ isOpen: isPopupTrayOpen,
286
+ onClose: onClose,
287
+ triggerRef: triggerRef
289
288
  }, settings.showFullPicker || hoverableReactionPicker && isHoverableReactionPickerEmojiPickerOpen ? /*#__PURE__*/React.createElement(EmojiPicker, {
290
289
  emojiProvider: emojiProvider,
291
290
  onSelection: onEmojiSelected,
@@ -301,11 +300,14 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
301
300
  onMoreClick: onSelectMoreClick,
302
301
  pickerQuickReactionEmojiIds: pickerQuickReactionEmojiIds,
303
302
  hoverableReactionPickerSelector: hoverableReactionPicker
304
- })))));
303
+ }))))));
305
304
  });
306
305
  export const PopperWrapper = props => {
307
306
  const {
307
+ triggerRef,
308
308
  settings,
309
+ isOpen,
310
+ onClose,
309
311
  children,
310
312
  popperModifiers
311
313
  } = props;
@@ -320,10 +322,19 @@ export const PopperWrapper = props => {
320
322
  initialFocusRef: null,
321
323
  targetRef: popupRef
322
324
  });
325
+
326
+ /**
327
+ * Custom hook triggers when user clicks outside the reactions picker
328
+ */
329
+ useCloseManagerV2(popupRef, triggerRef, callbackType => {
330
+ onClose();
331
+ if (popupRef && callbackType === 'ESCAPE') {
332
+ requestAnimationFrame(() => triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.focus());
333
+ }
334
+ }, true, isOpen);
323
335
  return /*#__PURE__*/React.createElement(Popper, {
324
336
  placement: settings.popperPlacement,
325
- modifiers: popperModifiers,
326
- strategy: "absolute"
337
+ modifiers: popperModifiers
327
338
  }, ({
328
339
  ref,
329
340
  style,
@@ -13,14 +13,8 @@ import { ReactionStatus } from '../types';
13
13
  import { ReactionDialogOpened, ReactionDialogSelectedReactionChanged } from '../ufo';
14
14
  import { Reaction } from './Reaction';
15
15
  import { ReactionsDialog } from './ReactionsDialog';
16
- import { ReactionPicker as ReactionPickerOld } from './ReactionPicker';
17
- import { ReactionPicker as ReactionPickerNew } from './ReactionPickerNew';
16
+ import { ReactionPicker } from './ReactionPicker';
18
17
  import { ReactionSummaryView } from './ReactionSummaryView';
19
- import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
20
- import { fg } from '@atlaskit/platform-feature-flags';
21
- const ReactionPicker = componentWithCondition(() => {
22
- return fg('platform_editor_reactions_picker_fix') || fg('platform_editor_reactions_picker_fix_jira');
23
- }, ReactionPickerNew, ReactionPickerOld);
24
18
  const wrapperStyle = null;
25
19
  const noFlexWrapStyles = null;
26
20
  const noContainerPositionStyles = null;
@@ -5,7 +5,7 @@
5
5
  ._nhktlyvf.disabled:after{background:linear-gradient(270deg,hsla(0,0%,100%,.95) 40.23%,hsla(0,0%,100%,.55) 58.33%,hsla(0,0%,100%,0) 77.49%)}
6
6
  ._1rjc1b66{padding-block:var(--ds-space-050,4px)}
7
7
  ._80wau2gc div[role=tablist]{padding-inline:var(--ds-space-100,8px)}
8
- ._n7zl1l7n{border-bottom:1px solid var(--ds-border,#ebecf0)}._10d67vkz>span{min-height:1pc}
8
+ ._n7zl17ba{border-bottom:var(--ds-border-width,1px) solid var(--ds-border,#ebecf0)}._10d67vkz>span{min-height:1pc}
9
9
  ._141m1j28 div[role=tablist]:before{background-color:transparent}
10
10
  ._18m91wug{overflow-y:auto}
11
11
  ._18u01wug{margin-left:auto}
@@ -125,7 +125,7 @@ export const ReactionsDialogHeader = ({
125
125
  onClick: handleCloseReactionsDialog
126
126
  })), /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement("div", {
127
127
  id: "reactions-dialog-tabs-list",
128
- className: ax(["_1reo1wug _18m91wug _n7zl1l7n _1e0c1txw _1bsb1osq _4cvr1y6m _80wau2gc _s2c4kb7n _141m1j28"])
128
+ className: ax(["_1reo1wug _18m91wug _n7zl17ba _1e0c1txw _1bsb1osq _4cvr1y6m _80wau2gc _s2c4kb7n _141m1j28"])
129
129
  }, !isSinglePage && !isOnFirstPage && /*#__PURE__*/React.createElement(LeftNavigationButton, {
130
130
  handlePreviousPage: handlePreviousPage
131
131
  }), /*#__PURE__*/React.createElement(TabList, null, currentReactions.map((reaction, index) => {
@@ -2,13 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import { UfoErrorBoundary } from '../../components';
4
4
  import { PickerRender } from '../../ufo';
5
- import { ReactionPicker as ReactionPickerOld } from '../../components/ReactionPicker';
6
- import { ReactionPicker as ReactionPickerNew } from '../../components/ReactionPickerNew';
7
- import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
8
- import { fg } from '@atlaskit/platform-feature-flags';
9
- const ReactionPicker = componentWithCondition(() => {
10
- return fg('platform_editor_reactions_picker_fix') || fg('platform_editor_reactions_picker_fix_jira');
11
- }, ReactionPickerNew, ReactionPickerOld);
5
+ import { ReactionPicker } from '../../components/ReactionPicker';
12
6
  /**
13
7
  * Reaction Picker component
14
8
  */
@@ -1,12 +1,6 @@
1
1
  import { DefaultReactions, DefaultReactionsByShortName, ExtendedReactions, ExtendedReactionsByShortName, NUMBER_OF_REACTIONS_TO_DISPLAY, SAMPLING_RATE_REACTIONS_RENDERED_EXP, TOOLTIP_USERS_LIMIT } from './shared/constants';
2
2
  import { ComponentName, ExperienceName, PickerRender, ReactionsAdd, ReactionDetailsFetch, ReactionDialogOpened, ReactionDialogSelectedReactionChanged, ReactionsRemove, ReactionsRendered, sampledReactionsRendered } from './ufo';
3
- import { ReactionPicker as ReactionPickerLegacy } from './components/ReactionPicker';
4
- import { ReactionPicker as ReactionPickerNew } from './components/ReactionPickerNew';
5
- import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
- const ReactionPicker = componentWithCondition(() => {
8
- return fg('platform_editor_reactions_picker_fix') || fg('platform_editor_reactions_picker_fix_jira');
9
- }, ReactionPickerNew, ReactionPickerLegacy);
3
+ import { ReactionPicker } from './components/ReactionPicker';
10
4
  export { ReactionServiceClient } from './client';
11
5
  export { Reaction } from './components/Reaction';
12
6
  export { ReactionPicker };
@@ -12,7 +12,7 @@ import { Manager, Popper, Reference } from '@atlaskit/popper';
12
12
  import { layers } from '@atlaskit/theme/constants';
13
13
  import { Box } from '@atlaskit/primitives/compiled';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
- import { useCloseManager } from '../hooks/useCloseManager';
15
+ import { useCloseManagerV2 } from '../hooks/useCloseManager';
16
16
  import { useDelayedState } from '../hooks/useDelayedState';
17
17
  import { useFocusTrap } from '../hooks/useFocusTrap';
18
18
  import { messages } from '../shared/i18n';
@@ -21,6 +21,7 @@ import { Selector } from './Selector';
21
21
  import { Trigger } from './Trigger';
22
22
  import { RepositionOnUpdate } from './RepositionOnUpdate';
23
23
  import { N0, N50A, N60A } from '@atlaskit/theme/colors';
24
+ import Portal from '@atlaskit/portal';
24
25
  var pickerStyle = null;
25
26
  var popupWrapperStyle = null;
26
27
  var popupStyle = null;
@@ -147,19 +148,6 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
147
148
  settings = _useState10[0],
148
149
  setSettings = _useState10[1];
149
150
 
150
- /**
151
- * Custom hook triggers when user clicks outside the reactions picker
152
- */
153
- useCloseManager(wrapperRef, function (callbackType) {
154
- close();
155
- onCancel();
156
- if (triggerRef && callbackType === 'ESCAPE') {
157
- requestAnimationFrame(function () {
158
- return triggerRef.focus();
159
- });
160
- }
161
- }, true, isPopupTrayOpen);
162
-
163
151
  /**
164
152
  * Event callback when the picker is closed
165
153
  * @param _id Optional id if an emoji button was selected or undefineed if was clicked outside the picker
@@ -278,6 +266,10 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
278
266
  var _updatePopper$current;
279
267
  (_updatePopper$current = updatePopper.current) === null || _updatePopper$current === void 0 || _updatePopper$current.call(updatePopper);
280
268
  }, [settings]);
269
+ var onClose = function onClose() {
270
+ close();
271
+ onCancel();
272
+ };
281
273
  return /*#__PURE__*/React.createElement("div", {
282
274
  // eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
283
275
  className: ax(["_s7n4nkob _1pra1o8l", wrapperClassName]),
@@ -319,9 +311,14 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
319
311
  isListItem: isListItem
320
312
  }))
321
313
  );
322
- }), isPopupTrayOpen && /*#__PURE__*/React.createElement(PopperWrapper, {
314
+ }), isPopupTrayOpen && /*#__PURE__*/React.createElement(Portal, {
315
+ zIndex: layers.flag()
316
+ }, /*#__PURE__*/React.createElement(PopperWrapper, {
323
317
  settings: settings,
324
- popperModifiers: popperModifiers
318
+ popperModifiers: popperModifiers,
319
+ isOpen: isPopupTrayOpen,
320
+ onClose: onClose,
321
+ triggerRef: triggerRef
325
322
  }, settings.showFullPicker || hoverableReactionPicker && isHoverableReactionPickerEmojiPickerOpen ? /*#__PURE__*/React.createElement(EmojiPicker, {
326
323
  emojiProvider: emojiProvider,
327
324
  onSelection: onEmojiSelected,
@@ -337,10 +334,13 @@ export var ReactionPicker = /*#__PURE__*/React.memo(function (props) {
337
334
  onMoreClick: onSelectMoreClick,
338
335
  pickerQuickReactionEmojiIds: pickerQuickReactionEmojiIds,
339
336
  hoverableReactionPickerSelector: hoverableReactionPicker
340
- })))));
337
+ }))))));
341
338
  });
342
339
  export var PopperWrapper = function PopperWrapper(props) {
343
- var settings = props.settings,
340
+ var triggerRef = props.triggerRef,
341
+ settings = props.settings,
342
+ isOpen = props.isOpen,
343
+ onClose = props.onClose,
344
344
  children = props.children,
345
345
  popperModifiers = props.popperModifiers;
346
346
  var _useState11 = useState(null),
@@ -356,10 +356,21 @@ export var PopperWrapper = function PopperWrapper(props) {
356
356
  initialFocusRef: null,
357
357
  targetRef: popupRef
358
358
  });
359
+
360
+ /**
361
+ * Custom hook triggers when user clicks outside the reactions picker
362
+ */
363
+ useCloseManagerV2(popupRef, triggerRef, function (callbackType) {
364
+ onClose();
365
+ if (popupRef && callbackType === 'ESCAPE') {
366
+ requestAnimationFrame(function () {
367
+ return triggerRef === null || triggerRef === void 0 ? void 0 : triggerRef.focus();
368
+ });
369
+ }
370
+ }, true, isOpen);
359
371
  return /*#__PURE__*/React.createElement(Popper, {
360
372
  placement: settings.popperPlacement,
361
- modifiers: popperModifiers,
362
- strategy: "absolute"
373
+ modifiers: popperModifiers
363
374
  }, function (_ref3) {
364
375
  var _ref4 = _ref3.ref,
365
376
  style = _ref3.style,
@@ -15,14 +15,8 @@ import { ReactionStatus } from '../types';
15
15
  import { ReactionDialogOpened, ReactionDialogSelectedReactionChanged } from '../ufo';
16
16
  import { Reaction } from './Reaction';
17
17
  import { ReactionsDialog } from './ReactionsDialog';
18
- import { ReactionPicker as ReactionPickerOld } from './ReactionPicker';
19
- import { ReactionPicker as ReactionPickerNew } from './ReactionPickerNew';
18
+ import { ReactionPicker } from './ReactionPicker';
20
19
  import { ReactionSummaryView } from './ReactionSummaryView';
21
- import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
22
- import { fg } from '@atlaskit/platform-feature-flags';
23
- var ReactionPicker = componentWithCondition(function () {
24
- return fg('platform_editor_reactions_picker_fix') || fg('platform_editor_reactions_picker_fix_jira');
25
- }, ReactionPickerNew, ReactionPickerOld);
26
20
  var wrapperStyle = null;
27
21
  var noFlexWrapStyles = null;
28
22
  var noContainerPositionStyles = null;
@@ -5,7 +5,7 @@
5
5
  ._nhktlyvf.disabled:after{background:linear-gradient(270deg,hsla(0,0%,100%,.95) 40.23%,hsla(0,0%,100%,.55) 58.33%,hsla(0,0%,100%,0) 77.49%)}
6
6
  ._1rjc1b66{padding-block:var(--ds-space-050,4px)}
7
7
  ._80wau2gc div[role=tablist]{padding-inline:var(--ds-space-100,8px)}
8
- ._n7zlfl6d{border-bottom:var(--_1wtzbnt)}._10d67vkz>span{min-height:1pc}
8
+ ._n7zl4gxu{border-bottom:var(--_1i0gnx0)}._10d67vkz>span{min-height:1pc}
9
9
  ._141m1j28 div[role=tablist]:before{background-color:transparent}
10
10
  ._18m91wug{overflow-y:auto}
11
11
  ._18u01wug{margin-left:auto}
@@ -146,9 +146,9 @@ export var ReactionsDialogHeader = function ReactionsDialogHeader(_ref3) {
146
146
  onClick: handleCloseReactionsDialog
147
147
  })), /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement("div", {
148
148
  id: "reactions-dialog-tabs-list",
149
- className: ax(["_1reo1wug _18m91wug _n7zlfl6d _1e0c1txw _1bsb1osq _4cvr1y6m _80wau2gc _s2c4kb7n _141m1j28"]),
149
+ className: ax(["_1reo1wug _18m91wug _n7zl4gxu _1e0c1txw _1bsb1osq _4cvr1y6m _80wau2gc _s2c4kb7n _141m1j28"]),
150
150
  style: {
151
- "--_1wtzbnt": ix("1px solid ".concat("var(--ds-border, #EBECF0)"))
151
+ "--_1i0gnx0": ix("var(--ds-border-width, 1px)".concat(" solid ", "var(--ds-border, #EBECF0)"))
152
152
  }
153
153
  }, !isSinglePage && !isOnFirstPage && /*#__PURE__*/React.createElement(LeftNavigationButton, {
154
154
  handlePreviousPage: handlePreviousPage
@@ -4,13 +4,7 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
4
4
  import React from 'react';
5
5
  import { UfoErrorBoundary } from '../../components';
6
6
  import { PickerRender } from '../../ufo';
7
- import { ReactionPicker as ReactionPickerOld } from '../../components/ReactionPicker';
8
- import { ReactionPicker as ReactionPickerNew } from '../../components/ReactionPickerNew';
9
- import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
10
- import { fg } from '@atlaskit/platform-feature-flags';
11
- var ReactionPicker = componentWithCondition(function () {
12
- return fg('platform_editor_reactions_picker_fix') || fg('platform_editor_reactions_picker_fix_jira');
13
- }, ReactionPickerNew, ReactionPickerOld);
7
+ import { ReactionPicker } from '../../components/ReactionPicker';
14
8
  /**
15
9
  * Reaction Picker component
16
10
  */
package/dist/esm/index.js CHANGED
@@ -1,12 +1,6 @@
1
1
  import { DefaultReactions, DefaultReactionsByShortName, ExtendedReactions, ExtendedReactionsByShortName, NUMBER_OF_REACTIONS_TO_DISPLAY, SAMPLING_RATE_REACTIONS_RENDERED_EXP, TOOLTIP_USERS_LIMIT } from './shared/constants';
2
2
  import { ComponentName, ExperienceName, PickerRender, ReactionsAdd, ReactionDetailsFetch, ReactionDialogOpened, ReactionDialogSelectedReactionChanged, ReactionsRemove, ReactionsRendered, sampledReactionsRendered } from './ufo';
3
- import { ReactionPicker as ReactionPickerLegacy } from './components/ReactionPicker';
4
- import { ReactionPicker as ReactionPickerNew } from './components/ReactionPickerNew';
5
- import { componentWithCondition } from '@atlaskit/platform-feature-flags-react';
6
- import { fg } from '@atlaskit/platform-feature-flags';
7
- var ReactionPicker = componentWithCondition(function () {
8
- return fg('platform_editor_reactions_picker_fix') || fg('platform_editor_reactions_picker_fix_jira');
9
- }, ReactionPickerNew, ReactionPickerLegacy);
3
+ import { ReactionPicker } from './components/ReactionPicker';
10
4
  export { ReactionServiceClient } from './client';
11
5
  export { Reaction } from './components/Reaction';
12
6
  export { ReactionPicker };
@@ -72,6 +72,10 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
72
72
  * Optional prop for controlling the picker location
73
73
  */
74
74
  reactionPickerPlacement?: Placement;
75
+ /**
76
+ * Optional prop to set the strategy of the reaction picker popup
77
+ */
78
+ reactionPickerStrategy?: PopperProps<{}>['strategy'];
75
79
  /**
76
80
  * Optional prop for controlling icon inside Trigger
77
81
  */
@@ -98,10 +102,13 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
98
102
  */
99
103
  export declare const ReactionPicker: React.MemoExoticComponent<(props: ReactionPickerProps) => JSX.Element>;
100
104
  export interface PopperWrapperProps {
105
+ isOpen: boolean;
106
+ onClose: () => void;
101
107
  popperModifiers?: PopperProps<{}>['modifiers'];
102
108
  settings: {
103
109
  popperPlacement: Placement;
104
110
  showFullPicker: boolean;
105
111
  };
112
+ triggerRef: HTMLDivElement | HTMLButtonElement | null;
106
113
  }
107
114
  export declare const PopperWrapper: (props: PropsWithChildren<PopperWrapperProps>) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { ComponentName, ExperienceName } from './ufo';
2
- declare const ReactionPicker: import("react").FC<import("./components/ReactionPickerNew").ReactionPickerProps & import("./components/ReactionPicker").ReactionPickerProps>;
2
+ import { ReactionPicker } from './components/ReactionPicker';
3
3
  export { ReactionServiceClient } from './client';
4
4
  export { Reaction } from './components/Reaction';
5
5
  export { ReactionPicker };
@@ -72,6 +72,10 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
72
72
  * Optional prop for controlling the picker location
73
73
  */
74
74
  reactionPickerPlacement?: Placement;
75
+ /**
76
+ * Optional prop to set the strategy of the reaction picker popup
77
+ */
78
+ reactionPickerStrategy?: PopperProps<{}>['strategy'];
75
79
  /**
76
80
  * Optional prop for controlling icon inside Trigger
77
81
  */
@@ -98,10 +102,13 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
98
102
  */
99
103
  export declare const ReactionPicker: React.MemoExoticComponent<(props: ReactionPickerProps) => JSX.Element>;
100
104
  export interface PopperWrapperProps {
105
+ isOpen: boolean;
106
+ onClose: () => void;
101
107
  popperModifiers?: PopperProps<{}>['modifiers'];
102
108
  settings: {
103
109
  popperPlacement: Placement;
104
110
  showFullPicker: boolean;
105
111
  };
112
+ triggerRef: HTMLDivElement | HTMLButtonElement | null;
106
113
  }
107
114
  export declare const PopperWrapper: (props: PropsWithChildren<PopperWrapperProps>) => JSX.Element;
@@ -1,5 +1,5 @@
1
1
  import { ComponentName, ExperienceName } from './ufo';
2
- declare const ReactionPicker: import("react").FC<import("./components/ReactionPickerNew").ReactionPickerProps & import("./components/ReactionPicker").ReactionPickerProps>;
2
+ import { ReactionPicker } from './components/ReactionPicker';
3
3
  export { ReactionServiceClient } from './client';
4
4
  export { Reaction } from './components/Reaction';
5
5
  export { ReactionPicker };