@atlaskit/reactions 33.2.8 → 33.2.9
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 +7 -0
- package/afm-cc/tsconfig.json +0 -3
- package/afm-jira/tsconfig.json +0 -3
- package/afm-post-office/tsconfig.json +0 -3
- package/afm-townsquare/tsconfig.json +0 -3
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/ReactionPicker.js +30 -19
- package/dist/cjs/components/Reactions.js +1 -4
- package/dist/cjs/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +1 -4
- package/dist/cjs/index.js +7 -6
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/ReactionPicker.js +28 -17
- package/dist/es2019/components/Reactions.js +1 -4
- package/dist/es2019/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +1 -4
- package/dist/es2019/index.js +1 -5
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/ReactionPicker.js +31 -20
- package/dist/esm/components/Reactions.js +1 -4
- package/dist/esm/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +1 -4
- package/dist/esm/index.js +1 -5
- package/dist/types/components/ReactionPicker.d.ts +7 -0
- package/dist/types/index.d.ts +1 -3
- package/dist/types-ts4.5/components/ReactionPicker.d.ts +7 -0
- package/dist/types-ts4.5/index.d.ts +1 -3
- package/package.json +3 -7
- package/dist/cjs/components/ReactionPickerNew.compiled.css +0 -11
- package/dist/cjs/components/ReactionPickerNew.js +0 -421
- package/dist/es2019/components/ReactionPickerNew.compiled.css +0 -11
- package/dist/es2019/components/ReactionPickerNew.js +0 -374
- package/dist/esm/components/ReactionPickerNew.compiled.css +0 -11
- package/dist/esm/components/ReactionPickerNew.js +0 -412
- package/dist/types/components/ReactionPickerNew.d.ts +0 -114
- package/dist/types-ts4.5/components/ReactionPickerNew.d.ts +0 -114
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 33.2.9
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`c171a86fa9ec4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/c171a86fa9ec4) -
|
|
8
|
+
tidy up feature flag to ensable reactions picker with portal
|
|
9
|
+
|
|
3
10
|
## 33.2.8
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/afm-cc/tsconfig.json
CHANGED
package/afm-jira/tsconfig.json
CHANGED
|
@@ -62,9 +62,6 @@
|
|
|
62
62
|
{
|
|
63
63
|
"path": "../../../platform/feature-flags/afm-post-office/tsconfig.json"
|
|
64
64
|
},
|
|
65
|
-
{
|
|
66
|
-
"path": "../../../platform/feature-flags-react/afm-post-office/tsconfig.json"
|
|
67
|
-
},
|
|
68
65
|
{
|
|
69
66
|
"path": "../../../design-system/popper/afm-post-office/tsconfig.json"
|
|
70
67
|
},
|
|
@@ -62,9 +62,6 @@
|
|
|
62
62
|
{
|
|
63
63
|
"path": "../../../platform/feature-flags/afm-townsquare/tsconfig.json"
|
|
64
64
|
},
|
|
65
|
-
{
|
|
66
|
-
"path": "../../../platform/feature-flags-react/afm-townsquare/tsconfig.json"
|
|
67
|
-
},
|
|
68
65
|
{
|
|
69
66
|
"path": "../../../design-system/popper/afm-townsquare/tsconfig.json"
|
|
70
67
|
},
|
|
@@ -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.2.
|
|
14
|
+
var packageVersion = "33.2.8";
|
|
15
15
|
/**
|
|
16
16
|
* TODO: move to utility package?
|
|
17
17
|
* A random sampling function
|
|
@@ -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(
|
|
323
|
+
}), isPopupTrayOpen && /*#__PURE__*/_react.default.createElement(_portal.default, {
|
|
324
|
+
zIndex: _constants.layers.layer()
|
|
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
|
|
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,11 +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
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); }
|
|
33
|
-
var ReactionPicker = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_reactions_picker_fix', _ReactionPickerNew.ReactionPicker, _ReactionPicker.ReactionPicker);
|
|
34
31
|
var wrapperStyle = null;
|
|
35
32
|
var noFlexWrapStyles = null;
|
|
36
33
|
var noContainerPositionStyles = null;
|
|
@@ -387,7 +384,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
387
384
|
isViewOnly: isViewOnly,
|
|
388
385
|
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0
|
|
389
386
|
});
|
|
390
|
-
})), isViewOnly || !onlyRenderPicker && shouldShowSummaryView && allowSelectFromSummaryView ? null : /*#__PURE__*/_react.default.createElement(ReactionPicker, {
|
|
387
|
+
})), isViewOnly || !onlyRenderPicker && shouldShowSummaryView && allowSelectFromSummaryView ? null : /*#__PURE__*/_react.default.createElement(_ReactionPicker.ReactionPicker, {
|
|
391
388
|
emojiProvider: emojiProvider,
|
|
392
389
|
allowAllEmojis: allowAllEmojis,
|
|
393
390
|
pickerQuickReactionEmojiIds: pickerQuickReactionEmojiIds,
|
|
@@ -12,9 +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 ReactionPicker = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_reactions_picker_fix', _ReactionPickerNew.ReactionPicker, _ReactionPicker.ReactionPicker);
|
|
18
15
|
/**
|
|
19
16
|
* Reaction Picker component
|
|
20
17
|
*/
|
|
@@ -46,7 +43,7 @@ var ConnectedReactionPicker = exports.ConnectedReactionPicker = function Connect
|
|
|
46
43
|
};
|
|
47
44
|
return /*#__PURE__*/_react.default.createElement(_components.UfoErrorBoundary, {
|
|
48
45
|
experiences: [_ufo.PickerRender]
|
|
49
|
-
}, /*#__PURE__*/_react.default.createElement(ReactionPicker, (0, _extends2.default)({}, props, {
|
|
46
|
+
}, /*#__PURE__*/_react.default.createElement(_ReactionPicker.ReactionPicker, (0, _extends2.default)({}, props, {
|
|
50
47
|
onSelection: onSelection
|
|
51
48
|
})));
|
|
52
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
|
|
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() {
|
|
@@ -67,18 +72,14 @@ Object.defineProperty(exports, "useCloseManager", {
|
|
|
67
72
|
});
|
|
68
73
|
var _constants = require("./shared/constants");
|
|
69
74
|
var _ufo = require("./ufo");
|
|
70
|
-
var _ReactionPicker = require("./components/ReactionPicker");
|
|
71
|
-
var _ReactionPickerNew = require("./components/ReactionPickerNew");
|
|
72
|
-
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
73
75
|
var _client = require("./client");
|
|
74
76
|
var _Reaction = require("./components/Reaction");
|
|
77
|
+
var _ReactionPicker = require("./components/ReactionPicker");
|
|
75
78
|
var _Reactions = require("./components/Reactions");
|
|
76
79
|
var _useCloseManager = require("./hooks/useCloseManager");
|
|
77
80
|
var _containers = require("./containers");
|
|
78
81
|
var _store = require("./store");
|
|
79
82
|
var _types = require("./types");
|
|
80
|
-
var ReactionPicker = exports.ReactionPicker = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_reactions_picker_fix', _ReactionPickerNew.ReactionPicker, _ReactionPicker.ReactionPicker);
|
|
81
|
-
|
|
82
83
|
// TODO: Convert all calls for ReactionRequest to Request, RequestClient to Client and ReactionsStore to Store
|
|
83
84
|
|
|
84
85
|
var constants = exports.constants = {
|
|
@@ -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.2.
|
|
4
|
+
const packageVersion = "33.2.8";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|
|
@@ -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 {
|
|
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(
|
|
280
|
+
}))), isPopupTrayOpen && /*#__PURE__*/React.createElement(Portal, {
|
|
281
|
+
zIndex: layers.layer()
|
|
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,11 +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
|
|
17
|
-
import { ReactionPicker as ReactionPickerNew } from './ReactionPickerNew';
|
|
16
|
+
import { ReactionPicker } from './ReactionPicker';
|
|
18
17
|
import { ReactionSummaryView } from './ReactionSummaryView';
|
|
19
|
-
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
20
|
-
const ReactionPicker = componentWithFG('platform_editor_reactions_picker_fix', ReactionPickerNew, ReactionPickerOld);
|
|
21
18
|
const wrapperStyle = null;
|
|
22
19
|
const noFlexWrapStyles = null;
|
|
23
20
|
const noContainerPositionStyles = null;
|
|
@@ -2,10 +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
|
|
6
|
-
import { ReactionPicker as ReactionPickerNew } from '../../components/ReactionPickerNew';
|
|
7
|
-
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
8
|
-
const ReactionPicker = componentWithFG('platform_editor_reactions_picker_fix', ReactionPickerNew, ReactionPickerOld);
|
|
5
|
+
import { ReactionPicker } from '../../components/ReactionPicker';
|
|
9
6
|
/**
|
|
10
7
|
* Reaction Picker component
|
|
11
8
|
*/
|
package/dist/es2019/index.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
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 { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
6
|
-
const ReactionPicker = componentWithFG('platform_editor_reactions_picker_fix', ReactionPickerNew, ReactionPickerLegacy);
|
|
7
3
|
export { ReactionServiceClient } from './client';
|
|
8
4
|
export { Reaction } from './components/Reaction';
|
|
9
|
-
export { ReactionPicker };
|
|
5
|
+
export { ReactionPicker } from './components/ReactionPicker';
|
|
10
6
|
export { Reactions } from './components/Reactions';
|
|
11
7
|
export { useCloseManager } from './hooks/useCloseManager';
|
|
12
8
|
export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
|
|
@@ -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.2.
|
|
7
|
+
var packageVersion = "33.2.8";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -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 {
|
|
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(
|
|
314
|
+
}), isPopupTrayOpen && /*#__PURE__*/React.createElement(Portal, {
|
|
315
|
+
zIndex: layers.layer()
|
|
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
|
|
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,11 +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
|
|
19
|
-
import { ReactionPicker as ReactionPickerNew } from './ReactionPickerNew';
|
|
18
|
+
import { ReactionPicker } from './ReactionPicker';
|
|
20
19
|
import { ReactionSummaryView } from './ReactionSummaryView';
|
|
21
|
-
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
22
|
-
var ReactionPicker = componentWithFG('platform_editor_reactions_picker_fix', ReactionPickerNew, ReactionPickerOld);
|
|
23
20
|
var wrapperStyle = null;
|
|
24
21
|
var noFlexWrapStyles = null;
|
|
25
22
|
var noContainerPositionStyles = null;
|
|
@@ -4,10 +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
|
|
8
|
-
import { ReactionPicker as ReactionPickerNew } from '../../components/ReactionPickerNew';
|
|
9
|
-
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
10
|
-
var ReactionPicker = componentWithFG('platform_editor_reactions_picker_fix', ReactionPickerNew, ReactionPickerOld);
|
|
7
|
+
import { ReactionPicker } from '../../components/ReactionPicker';
|
|
11
8
|
/**
|
|
12
9
|
* Reaction Picker component
|
|
13
10
|
*/
|
package/dist/esm/index.js
CHANGED
|
@@ -1,12 +1,8 @@
|
|
|
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 { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
6
|
-
var ReactionPicker = componentWithFG('platform_editor_reactions_picker_fix', ReactionPickerNew, ReactionPickerLegacy);
|
|
7
3
|
export { ReactionServiceClient } from './client';
|
|
8
4
|
export { Reaction } from './components/Reaction';
|
|
9
|
-
export { ReactionPicker };
|
|
5
|
+
export { ReactionPicker } from './components/ReactionPicker';
|
|
10
6
|
export { Reactions } from './components/Reactions';
|
|
11
7
|
export { useCloseManager } from './hooks/useCloseManager';
|
|
12
8
|
export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
|
|
@@ -92,16 +92,23 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
|
|
|
92
92
|
* Optional prop to set a delay for the reaction picker when it opens/closes on hover
|
|
93
93
|
*/
|
|
94
94
|
hoverableReactionPickerDelay?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Optional prop to set the strategy of the reaction picker popup
|
|
97
|
+
*/
|
|
98
|
+
reactionPickerStrategy?: PopperProps<{}>['strategy'];
|
|
95
99
|
}
|
|
96
100
|
/**
|
|
97
101
|
* Picker component for adding reactions
|
|
98
102
|
*/
|
|
99
103
|
export declare const ReactionPicker: React.MemoExoticComponent<(props: ReactionPickerProps) => JSX.Element>;
|
|
100
104
|
export interface PopperWrapperProps {
|
|
105
|
+
triggerRef: HTMLDivElement | HTMLButtonElement | null;
|
|
101
106
|
settings: {
|
|
102
107
|
showFullPicker: boolean;
|
|
103
108
|
popperPlacement: Placement;
|
|
104
109
|
};
|
|
110
|
+
isOpen: boolean;
|
|
111
|
+
onClose: () => void;
|
|
105
112
|
popperModifiers?: PopperProps<{}>['modifiers'];
|
|
106
113
|
}
|
|
107
114
|
export declare const PopperWrapper: (props: PropsWithChildren<PopperWrapperProps>) => JSX.Element;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ComponentName, ExperienceName } from './ufo';
|
|
3
|
-
declare const ReactionPicker: import("react").FC<import("./components/ReactionPickerNew").ReactionPickerProps & import("./components/ReactionPicker").ReactionPickerProps>;
|
|
4
2
|
export { ReactionServiceClient } from './client';
|
|
5
3
|
export { Reaction } from './components/Reaction';
|
|
6
|
-
export { ReactionPicker };
|
|
4
|
+
export { ReactionPicker } from './components/ReactionPicker';
|
|
7
5
|
export { Reactions } from './components/Reactions';
|
|
8
6
|
export { useCloseManager } from './hooks/useCloseManager';
|
|
9
7
|
export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
|
|
@@ -92,16 +92,23 @@ export interface ReactionPickerProps extends Pick<SelectorProps, 'pickerQuickRea
|
|
|
92
92
|
* Optional prop to set a delay for the reaction picker when it opens/closes on hover
|
|
93
93
|
*/
|
|
94
94
|
hoverableReactionPickerDelay?: number;
|
|
95
|
+
/**
|
|
96
|
+
* Optional prop to set the strategy of the reaction picker popup
|
|
97
|
+
*/
|
|
98
|
+
reactionPickerStrategy?: PopperProps<{}>['strategy'];
|
|
95
99
|
}
|
|
96
100
|
/**
|
|
97
101
|
* Picker component for adding reactions
|
|
98
102
|
*/
|
|
99
103
|
export declare const ReactionPicker: React.MemoExoticComponent<(props: ReactionPickerProps) => JSX.Element>;
|
|
100
104
|
export interface PopperWrapperProps {
|
|
105
|
+
triggerRef: HTMLDivElement | HTMLButtonElement | null;
|
|
101
106
|
settings: {
|
|
102
107
|
showFullPicker: boolean;
|
|
103
108
|
popperPlacement: Placement;
|
|
104
109
|
};
|
|
110
|
+
isOpen: boolean;
|
|
111
|
+
onClose: () => void;
|
|
105
112
|
popperModifiers?: PopperProps<{}>['modifiers'];
|
|
106
113
|
}
|
|
107
114
|
export declare const PopperWrapper: (props: PropsWithChildren<PopperWrapperProps>) => JSX.Element;
|
|
@@ -1,9 +1,7 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { ComponentName, ExperienceName } from './ufo';
|
|
3
|
-
declare const ReactionPicker: import("react").FC<import("./components/ReactionPickerNew").ReactionPickerProps & import("./components/ReactionPicker").ReactionPickerProps>;
|
|
4
2
|
export { ReactionServiceClient } from './client';
|
|
5
3
|
export { Reaction } from './components/Reaction';
|
|
6
|
-
export { ReactionPicker };
|
|
4
|
+
export { ReactionPicker } from './components/ReactionPicker';
|
|
7
5
|
export { Reactions } from './components/Reactions';
|
|
8
6
|
export { useCloseManager } from './hooks/useCloseManager';
|
|
9
7
|
export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
|