@atlaskit/reactions 27.2.0 → 28.0.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 +18 -0
- package/afm-cc/tsconfig.json +3 -0
- package/afm-jira/tsconfig.json +3 -0
- package/afm-post-office/tsconfig.json +3 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/ReactionSummary/ReactionSummaryViewEmojiPicker.js +7 -12
- package/dist/cjs/components/compiled/Counter.compiled.css +16 -0
- package/dist/cjs/components/compiled/Counter.js +102 -0
- package/dist/cjs/components/compiled/FlashAnimation.compiled.css +3 -0
- package/dist/cjs/components/compiled/FlashAnimation.js +35 -0
- package/dist/cjs/components/compiled/Reaction.compiled.css +9 -0
- package/dist/cjs/components/compiled/Reaction.js +185 -0
- package/dist/cjs/components/compiled/ReactionButton.compiled.css +37 -0
- package/dist/cjs/components/compiled/ReactionButton.js +70 -0
- package/dist/cjs/components/compiled/ReactionParticleEffect.compiled.css +17 -0
- package/dist/cjs/components/compiled/ReactionParticleEffect.js +41 -0
- package/dist/cjs/components/compiled/ReactionTooltip.compiled.css +29 -0
- package/dist/cjs/components/compiled/ReactionTooltip.js +77 -0
- package/dist/cjs/components/compiled/Reactions.compiled.css +11 -0
- package/dist/cjs/components/compiled/Reactions.js +377 -0
- package/dist/cjs/components/compiled/StaticReaction.compiled.css +17 -0
- package/dist/cjs/components/compiled/StaticReaction.js +34 -0
- package/dist/cjs/containers/ConnectedReactionsView/ConnectedReactionsView.js +6 -1
- package/dist/cjs/index.js +12 -15
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/ReactionSummary/ReactionSummaryViewEmojiPicker.js +4 -10
- package/dist/es2019/components/compiled/Counter.compiled.css +16 -0
- package/dist/es2019/components/compiled/Counter.js +86 -0
- package/dist/es2019/components/compiled/FlashAnimation.compiled.css +4 -0
- package/dist/es2019/components/compiled/FlashAnimation.js +21 -0
- package/dist/es2019/components/compiled/Reaction.compiled.css +9 -0
- package/dist/es2019/components/compiled/Reaction.js +151 -0
- package/dist/es2019/components/compiled/ReactionButton.compiled.css +37 -0
- package/dist/es2019/components/compiled/ReactionButton.js +56 -0
- package/dist/es2019/components/compiled/ReactionParticleEffect.compiled.css +19 -0
- package/dist/es2019/components/compiled/ReactionParticleEffect.js +26 -0
- package/dist/es2019/components/compiled/ReactionTooltip.compiled.css +29 -0
- package/dist/es2019/components/compiled/ReactionTooltip.js +62 -0
- package/dist/es2019/components/compiled/Reactions.compiled.css +11 -0
- package/dist/es2019/components/compiled/Reactions.js +325 -0
- package/dist/es2019/components/compiled/StaticReaction.compiled.css +17 -0
- package/dist/es2019/components/compiled/StaticReaction.js +24 -0
- package/dist/es2019/containers/ConnectedReactionsView/ConnectedReactionsView.js +7 -2
- package/dist/es2019/index.js +9 -1
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/ReactionSummary/ReactionSummaryViewEmojiPicker.js +4 -10
- package/dist/esm/components/compiled/Counter.compiled.css +16 -0
- package/dist/esm/components/compiled/Counter.js +93 -0
- package/dist/esm/components/compiled/FlashAnimation.compiled.css +3 -0
- package/dist/esm/components/compiled/FlashAnimation.js +26 -0
- package/dist/esm/components/compiled/Reaction.compiled.css +9 -0
- package/dist/esm/components/compiled/Reaction.js +175 -0
- package/dist/esm/components/compiled/ReactionButton.compiled.css +37 -0
- package/dist/esm/components/compiled/ReactionButton.js +60 -0
- package/dist/esm/components/compiled/ReactionParticleEffect.compiled.css +17 -0
- package/dist/esm/components/compiled/ReactionParticleEffect.js +31 -0
- package/dist/esm/components/compiled/ReactionTooltip.compiled.css +29 -0
- package/dist/esm/components/compiled/ReactionTooltip.js +70 -0
- package/dist/esm/components/compiled/Reactions.compiled.css +11 -0
- package/dist/esm/components/compiled/Reactions.js +365 -0
- package/dist/esm/components/compiled/StaticReaction.compiled.css +17 -0
- package/dist/esm/components/compiled/StaticReaction.js +24 -0
- package/dist/esm/containers/ConnectedReactionsView/ConnectedReactionsView.js +7 -2
- package/dist/esm/index.js +9 -1
- package/dist/types/components/ReactionSummary/ReactionSummaryViewEmojiPicker.d.ts +2 -2
- package/dist/types/components/compiled/Counter.d.ts +52 -0
- package/dist/types/components/compiled/FlashAnimation.d.ts +23 -0
- package/dist/types/components/compiled/Reaction.d.ts +63 -0
- package/dist/types/components/compiled/ReactionButton.d.ts +20 -0
- package/dist/types/components/compiled/ReactionParticleEffect.d.ts +19 -0
- package/dist/types/components/compiled/ReactionTooltip.d.ts +43 -0
- package/dist/types/components/compiled/Reactions.d.ts +181 -0
- package/dist/types/components/compiled/StaticReaction.d.ts +12 -0
- package/dist/types/index.d.ts +5 -1
- package/dist/types-ts4.5/components/ReactionSummary/ReactionSummaryViewEmojiPicker.d.ts +2 -2
- package/dist/types-ts4.5/components/compiled/Counter.d.ts +52 -0
- package/dist/types-ts4.5/components/compiled/FlashAnimation.d.ts +23 -0
- package/dist/types-ts4.5/components/compiled/Reaction.d.ts +63 -0
- package/dist/types-ts4.5/components/compiled/ReactionButton.d.ts +20 -0
- package/dist/types-ts4.5/components/compiled/ReactionParticleEffect.d.ts +19 -0
- package/dist/types-ts4.5/components/compiled/ReactionTooltip.d.ts +43 -0
- package/dist/types-ts4.5/components/compiled/Reactions.d.ts +181 -0
- package/dist/types-ts4.5/components/compiled/StaticReaction.d.ts +12 -0
- package/dist/types-ts4.5/index.d.ts +5 -1
- package/package.json +14 -4
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
|
|
2
|
+
._d1n8glyw ul{list-style:none}._102oidpf ul{margin-top:0}
|
|
3
|
+
._17d4idpf ul{margin-left:0}
|
|
4
|
+
._18m915vq{overflow-y:hidden}
|
|
5
|
+
._1bto1l2s{text-overflow:ellipsis}
|
|
6
|
+
._1eg614y2 li{margin-top:5px}
|
|
7
|
+
._1hms8stv{text-decoration-line:underline}
|
|
8
|
+
._1hziidpf ul{padding-top:0}
|
|
9
|
+
._1kvxidpf ul{margin-right:0}
|
|
10
|
+
._1p1d1dk0{text-transform:capitalize}
|
|
11
|
+
._1pru15vq li{overflow-x:hidden}
|
|
12
|
+
._1reo15vq{overflow-x:hidden}
|
|
13
|
+
._1ysjidpf ul{margin-bottom:0}
|
|
14
|
+
._1ywo1e5h ul{text-align:left}
|
|
15
|
+
._3n4midpf ul{padding-right:0}
|
|
16
|
+
._4bfu1r31{text-decoration-color:currentColor}
|
|
17
|
+
._5qec1l2s li{text-overflow:ellipsis}
|
|
18
|
+
._80omtlke{cursor:pointer}
|
|
19
|
+
._ajmmnqa1{text-decoration-style:solid}
|
|
20
|
+
._k48p1pd9{font-weight:var(--ds-font-weight-semibold,600)}
|
|
21
|
+
._k7zyidpf ul{padding-left:0}
|
|
22
|
+
._ltofidpf ul{padding-bottom:0}
|
|
23
|
+
._o5721q9c{white-space:nowrap}
|
|
24
|
+
._otyr14y2{margin-bottom:5px}
|
|
25
|
+
._p12f1w81{max-width:150px}
|
|
26
|
+
._syaz1lqe{color:var(--_14nrcaz)}
|
|
27
|
+
._u0h115vq li{overflow-y:hidden}
|
|
28
|
+
._30l31i9p:hover{color:var(--_ywovvi)}
|
|
29
|
+
._irr3pioe:hover{background-color:var(--_yr7xfv)}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/* ReactionTooltip.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.verticalMargin = exports.ReactionTooltip = exports.RENDER_REACTIONTOOLTIP_TESTID = void 0;
|
|
9
|
+
require("./ReactionTooltip.compiled.css");
|
|
10
|
+
var _runtime = require("@compiled/react/runtime");
|
|
11
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
12
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
|
+
var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
|
|
14
|
+
var _reactIntlNext = require("react-intl-next");
|
|
15
|
+
var _constants = require("../../shared/constants");
|
|
16
|
+
var _i18n = require("../../shared/i18n");
|
|
17
|
+
var _colors = require("@atlaskit/theme/colors");
|
|
18
|
+
var verticalMargin = exports.verticalMargin = 5;
|
|
19
|
+
var tooltipStyle = null;
|
|
20
|
+
var emojiNameStyle = null;
|
|
21
|
+
var footerStyle = null;
|
|
22
|
+
var underlineStyle = null;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Test id for wrapper ReactionTooltip div
|
|
26
|
+
*/
|
|
27
|
+
var RENDER_REACTIONTOOLTIP_TESTID = exports.RENDER_REACTIONTOOLTIP_TESTID = 'render-reactionTooltip';
|
|
28
|
+
var ReactionTooltip = exports.ReactionTooltip = function ReactionTooltip(_ref) {
|
|
29
|
+
var children = _ref.children,
|
|
30
|
+
emojiName = _ref.emojiName,
|
|
31
|
+
_ref$reaction$users = _ref.reaction.users,
|
|
32
|
+
users = _ref$reaction$users === void 0 ? [] : _ref$reaction$users,
|
|
33
|
+
_ref$maxReactions = _ref.maxReactions,
|
|
34
|
+
maxReactions = _ref$maxReactions === void 0 ? _constants.TOOLTIP_USERS_LIMIT : _ref$maxReactions,
|
|
35
|
+
_ref$isEnabled = _ref.isEnabled,
|
|
36
|
+
isEnabled = _ref$isEnabled === void 0 ? true : _ref$isEnabled,
|
|
37
|
+
allowUserDialog = _ref.allowUserDialog,
|
|
38
|
+
handleOpenReactionsDialog = _ref.handleOpenReactionsDialog,
|
|
39
|
+
dismissTooltip = _ref.dismissTooltip;
|
|
40
|
+
var handleClick = function handleClick() {
|
|
41
|
+
if (allowUserDialog && handleOpenReactionsDialog) {
|
|
42
|
+
dismissTooltip();
|
|
43
|
+
handleOpenReactionsDialog();
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
var content = !users || users.length === 0 || !isEnabled ? null : /*#__PURE__*/_react.default.createElement("div", {
|
|
47
|
+
tabIndex: 0,
|
|
48
|
+
className: (0, _runtime.ax)(["_1reo15vq _18m915vq _p12f1w81 _1bto1l2s _o5721q9c _otyr14y2 _d1n8glyw _102oidpf _1kvxidpf _1ysjidpf _17d4idpf _1hziidpf _3n4midpf _ltofidpf _k7zyidpf _1ywo1e5h _1pru15vq _u0h115vq _5qec1l2s _1eg614y2"])
|
|
49
|
+
}, /*#__PURE__*/_react.default.createElement("ul", null, emojiName ? /*#__PURE__*/_react.default.createElement("li", {
|
|
50
|
+
className: (0, _runtime.ax)(["_1p1d1dk0 _syaz1lqe _k48p1pd9"]),
|
|
51
|
+
style: {
|
|
52
|
+
"--_14nrcaz": (0, _runtime.ix)("var(--ds-text-inverse, ".concat(_colors.N90, ")"))
|
|
53
|
+
}
|
|
54
|
+
}, emojiName) : null, users.slice(0, maxReactions).map(function (user) {
|
|
55
|
+
return /*#__PURE__*/_react.default.createElement("li", {
|
|
56
|
+
key: user.id
|
|
57
|
+
}, user.displayName);
|
|
58
|
+
}), /*#__PURE__*/_react.default.createElement("li", {
|
|
59
|
+
onMouseDown: handleClick,
|
|
60
|
+
onClick: handleClick,
|
|
61
|
+
className: (0, _runtime.ax)(["_syaz1lqe", allowUserDialog && "_4bfu1r31 _1hms8stv _ajmmnqa1 _80omtlke _irr3pioe _30l31i9p"]),
|
|
62
|
+
style: {
|
|
63
|
+
"--_14nrcaz": (0, _runtime.ix)("var(--ds-text-inverse, ".concat(_colors.N90, ")")),
|
|
64
|
+
"--_yr7xfv": (0, _runtime.ix)("var(--ds-background-neutral-bold, ".concat(_colors.N800, ")")),
|
|
65
|
+
"--_ywovvi": (0, _runtime.ix)("var(--ds-text-inverse, ".concat(_colors.N0, ")"))
|
|
66
|
+
}
|
|
67
|
+
}, users.length > maxReactions && /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _i18n.messages.otherUsers, {
|
|
68
|
+
values: {
|
|
69
|
+
count: users.length - maxReactions
|
|
70
|
+
}
|
|
71
|
+
})))));
|
|
72
|
+
return /*#__PURE__*/_react.default.createElement(_tooltip.default, {
|
|
73
|
+
content: content,
|
|
74
|
+
position: "bottom",
|
|
75
|
+
testId: RENDER_REACTIONTOOLTIP_TESTID
|
|
76
|
+
}, _react.default.Children.only(children));
|
|
77
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
._2rkoo7ao{border-radius:15px}._13vtidpf >:first-of-type>:first-of-type{margin-left:0}
|
|
3
|
+
._19pk1b66{margin-top:var(--ds-space-050,4px)}
|
|
4
|
+
._19pkr5cr{margin-top:var(--ds-space-negative-050,-4px)}
|
|
5
|
+
._1e0c1o8l{display:inline-block}
|
|
6
|
+
._1e0c1txw{display:flex}
|
|
7
|
+
._1n261g80{flex-wrap:wrap}
|
|
8
|
+
._1n261q9c{flex-wrap:nowrap}
|
|
9
|
+
._4cvr1h6o{align-items:center}
|
|
10
|
+
._kqswh2mm{position:relative}
|
|
11
|
+
._kqswpfqs{position:static}
|
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
/* Reactions.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.Reactions = exports.RENDER_VIEWALL_REACTED_USERS_DIALOG = exports.RENDER_REACTIONS_TESTID = exports.RENDER_REACTIONS_SUMMARY_TESTID = void 0;
|
|
10
|
+
exports.getTooltip = getTooltip;
|
|
11
|
+
exports.ufoExperiences = void 0;
|
|
12
|
+
require("./Reactions.compiled.css");
|
|
13
|
+
var _runtime = require("@compiled/react/runtime");
|
|
14
|
+
var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
|
|
15
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
16
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
17
|
+
var _reactIntlNext = require("react-intl-next");
|
|
18
|
+
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
19
|
+
var _modalDialog = require("@atlaskit/modal-dialog");
|
|
20
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
21
|
+
var _segment = _interopRequireDefault(require("@atlaskit/react-ufo/segment"));
|
|
22
|
+
var _analytics = require("../../analytics");
|
|
23
|
+
var _constants = require("../../shared/constants");
|
|
24
|
+
var _i18n = require("../../shared/i18n");
|
|
25
|
+
var _types = require("../../types");
|
|
26
|
+
var _ufo = require("../../ufo");
|
|
27
|
+
var _Reaction = require("./Reaction");
|
|
28
|
+
var _ReactionDialog = require("../ReactionDialog");
|
|
29
|
+
var _ReactionPicker = require("../ReactionPicker");
|
|
30
|
+
var _ReactionSummary = require("../ReactionSummary/");
|
|
31
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
32
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
33
|
+
var wrapperStyle = null;
|
|
34
|
+
var noFlexWrapStyles = null;
|
|
35
|
+
var noContainerPositionStyles = null;
|
|
36
|
+
var reactionPickerStyle = null;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Set of all available UFO experiences relating to Reactions Dialog
|
|
40
|
+
*/
|
|
41
|
+
var ufoExperiences = exports.ufoExperiences = {
|
|
42
|
+
/**
|
|
43
|
+
* Experience when a reaction dialog is opened
|
|
44
|
+
*/
|
|
45
|
+
openDialog: _ufo.ReactionDialogOpened,
|
|
46
|
+
/**
|
|
47
|
+
* Experience when a reaction changed/fetched from inside the modal dialog
|
|
48
|
+
*/
|
|
49
|
+
selectedReactionChangeInsideDialog: _ufo.ReactionDialogSelectedReactionChanged
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Test id for wrapper Reactions div
|
|
54
|
+
*/
|
|
55
|
+
var RENDER_REACTIONS_TESTID = exports.RENDER_REACTIONS_TESTID = 'render-reactions';
|
|
56
|
+
/**
|
|
57
|
+
* Test id for the view all reacted user to trigger the dialog
|
|
58
|
+
*/
|
|
59
|
+
var RENDER_VIEWALL_REACTED_USERS_DIALOG = exports.RENDER_VIEWALL_REACTED_USERS_DIALOG = 'viewall-reacted-users-dialog';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Test id for summary view of reactions
|
|
63
|
+
*/
|
|
64
|
+
var RENDER_REACTIONS_SUMMARY_TESTID = exports.RENDER_REACTIONS_SUMMARY_TESTID = 'reaction-summary-view';
|
|
65
|
+
/**
|
|
66
|
+
* Get content of the tooltip
|
|
67
|
+
*/
|
|
68
|
+
function getTooltip(status, errorMessage, tooltipContent) {
|
|
69
|
+
switch (status) {
|
|
70
|
+
case _types.ReactionStatus.error:
|
|
71
|
+
return errorMessage || /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.unexpectedError);
|
|
72
|
+
// When reaction is not available don't show any tooltip (e.g. Archive page in Confluence)
|
|
73
|
+
case _types.ReactionStatus.disabled:
|
|
74
|
+
return null;
|
|
75
|
+
case _types.ReactionStatus.notLoaded:
|
|
76
|
+
case _types.ReactionStatus.loading:
|
|
77
|
+
return /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.loadingReactions);
|
|
78
|
+
case _types.ReactionStatus.ready:
|
|
79
|
+
return !!tooltipContent ? tooltipContent : /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _i18n.messages.addReaction);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Renders list of reactions
|
|
85
|
+
*/
|
|
86
|
+
var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_ref) {
|
|
87
|
+
var _ref$flash = _ref.flash,
|
|
88
|
+
flash = _ref$flash === void 0 ? {} : _ref$flash,
|
|
89
|
+
_ref$particleEffectBy = _ref.particleEffectByEmoji,
|
|
90
|
+
particleEffectByEmoji = _ref$particleEffectBy === void 0 ? {} : _ref$particleEffectBy,
|
|
91
|
+
status = _ref.status,
|
|
92
|
+
errorMessage = _ref.errorMessage,
|
|
93
|
+
loadReaction = _ref.loadReaction,
|
|
94
|
+
quickReactionEmojis = _ref.quickReactionEmojis,
|
|
95
|
+
pickerQuickReactionEmojiIds = _ref.pickerQuickReactionEmojiIds,
|
|
96
|
+
_ref$getReactionDetai = _ref.getReactionDetails,
|
|
97
|
+
getReactionDetails = _ref$getReactionDetai === void 0 ? function () {} : _ref$getReactionDetai,
|
|
98
|
+
onSelection = _ref.onSelection,
|
|
99
|
+
_ref$reactions = _ref.reactions,
|
|
100
|
+
reactions = _ref$reactions === void 0 ? [] : _ref$reactions,
|
|
101
|
+
emojiProvider = _ref.emojiProvider,
|
|
102
|
+
allowAllEmojis = _ref.allowAllEmojis,
|
|
103
|
+
onReactionClick = _ref.onReactionClick,
|
|
104
|
+
allowUserDialog = _ref.allowUserDialog,
|
|
105
|
+
_ref$onDialogOpenCall = _ref.onDialogOpenCallback,
|
|
106
|
+
onDialogOpenCallback = _ref$onDialogOpenCall === void 0 ? function () {} : _ref$onDialogOpenCall,
|
|
107
|
+
_ref$onDialogCloseCal = _ref.onDialogCloseCallback,
|
|
108
|
+
onDialogCloseCallback = _ref$onDialogCloseCal === void 0 ? function () {} : _ref$onDialogCloseCal,
|
|
109
|
+
_ref$onDialogSelectRe = _ref.onDialogSelectReactionCallback,
|
|
110
|
+
onDialogSelectReactionCallback = _ref$onDialogSelectRe === void 0 ? function () {} : _ref$onDialogSelectRe,
|
|
111
|
+
_ref$onDialogPageChan = _ref.onDialogPageChangeCallback,
|
|
112
|
+
onDialogPageChangeCallback = _ref$onDialogPageChan === void 0 ? function () {} : _ref$onDialogPageChan,
|
|
113
|
+
_ref$emojiPickerSize = _ref.emojiPickerSize,
|
|
114
|
+
emojiPickerSize = _ref$emojiPickerSize === void 0 ? 'medium' : _ref$emojiPickerSize,
|
|
115
|
+
_ref$miniMode = _ref.miniMode,
|
|
116
|
+
miniMode = _ref$miniMode === void 0 ? false : _ref$miniMode,
|
|
117
|
+
_ref$summaryViewEnabl = _ref.summaryViewEnabled,
|
|
118
|
+
summaryViewEnabled = _ref$summaryViewEnabl === void 0 ? false : _ref$summaryViewEnabl,
|
|
119
|
+
_ref$summaryViewThres = _ref.summaryViewThreshold,
|
|
120
|
+
summaryViewThreshold = _ref$summaryViewThres === void 0 ? 3 : _ref$summaryViewThres,
|
|
121
|
+
summaryViewPlacement = _ref.summaryViewPlacement,
|
|
122
|
+
_ref$showOpaqueBackgr = _ref.showOpaqueBackground,
|
|
123
|
+
showOpaqueBackground = _ref$showOpaqueBackgr === void 0 ? false : _ref$showOpaqueBackgr,
|
|
124
|
+
_ref$subtleReactionsS = _ref.subtleReactionsSummaryAndPicker,
|
|
125
|
+
subtleReactionsSummaryAndPicker = _ref$subtleReactionsS === void 0 ? false : _ref$subtleReactionsS,
|
|
126
|
+
_ref$showAddReactionT = _ref.showAddReactionText,
|
|
127
|
+
showAddReactionText = _ref$showAddReactionT === void 0 ? false : _ref$showAddReactionT,
|
|
128
|
+
_ref$hideDefaultReact = _ref.hideDefaultReactions,
|
|
129
|
+
hideDefaultReactions = _ref$hideDefaultReact === void 0 ? false : _ref$hideDefaultReact,
|
|
130
|
+
ProfileCardWrapper = _ref.ProfileCardWrapper,
|
|
131
|
+
_ref$onlyRenderPicker = _ref.onlyRenderPicker,
|
|
132
|
+
onlyRenderPicker = _ref$onlyRenderPicker === void 0 ? false : _ref$onlyRenderPicker,
|
|
133
|
+
_ref$showRoundTrigger = _ref.showRoundTrigger,
|
|
134
|
+
showRoundTrigger = _ref$showRoundTrigger === void 0 ? false : _ref$showRoundTrigger,
|
|
135
|
+
_ref$isViewOnly = _ref.isViewOnly,
|
|
136
|
+
isViewOnly = _ref$isViewOnly === void 0 ? false : _ref$isViewOnly,
|
|
137
|
+
reactionPickerAdditionalStyle = _ref.reactionPickerAdditionalStyle,
|
|
138
|
+
_ref$noWrap = _ref.noWrap,
|
|
139
|
+
noWrap = _ref$noWrap === void 0 ? false : _ref$noWrap,
|
|
140
|
+
_ref$noRelativeContai = _ref.noRelativeContainer,
|
|
141
|
+
noRelativeContainer = _ref$noRelativeContai === void 0 ? false : _ref$noRelativeContai,
|
|
142
|
+
showSubtleDefaultReactions = _ref.showSubtleDefaultReactions,
|
|
143
|
+
reactionPickerTriggerToolipContent = _ref.reactionPickerTriggerToolipContent,
|
|
144
|
+
reactionPickerTriggerIcon = _ref.reactionPickerTriggerIcon,
|
|
145
|
+
_ref$allowSelectFromS = _ref.allowSelectFromSummaryView,
|
|
146
|
+
allowSelectFromSummaryView = _ref$allowSelectFromS === void 0 ? false : _ref$allowSelectFromS,
|
|
147
|
+
_ref$useButtonAlignme = _ref.useButtonAlignmentStyling,
|
|
148
|
+
useButtonAlignmentStyling = _ref$useButtonAlignme === void 0 ? false : _ref$useButtonAlignme;
|
|
149
|
+
var _useState = (0, _react.useState)(),
|
|
150
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
151
|
+
selectedEmojiId = _useState2[0],
|
|
152
|
+
setSelectedEmojiId = _useState2[1];
|
|
153
|
+
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
154
|
+
createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
|
|
155
|
+
var openTime = (0, _react.useRef)();
|
|
156
|
+
var renderTime = (0, _react.useRef)();
|
|
157
|
+
(0, _react.useEffect)(function () {
|
|
158
|
+
if (status === _types.ReactionStatus.notLoaded) {
|
|
159
|
+
loadReaction();
|
|
160
|
+
}
|
|
161
|
+
}, [status, loadReaction]);
|
|
162
|
+
(0, _react.useEffect)(function () {
|
|
163
|
+
if (status !== _types.ReactionStatus.ready) {
|
|
164
|
+
renderTime.current = Date.now();
|
|
165
|
+
} else {
|
|
166
|
+
var isSSR = process.env.REACT_SSR && (0, _platformFeatureFlags.fg)('platform_fix_analytics_error');
|
|
167
|
+
if ((0, _analytics.isSampled)(_constants.SAMPLING_RATE_REACTIONS_RENDERED_EXP) && !isSSR) {
|
|
168
|
+
var _renderTime$current;
|
|
169
|
+
(0, _analytics.createAndFireSafe)(createAnalyticsEvent, _analytics.createReactionsRenderedEvent, (_renderTime$current = renderTime.current) !== null && _renderTime$current !== void 0 ? _renderTime$current : Date.now() //renderTime.current can be null during unit test cases
|
|
170
|
+
);
|
|
171
|
+
}
|
|
172
|
+
renderTime.current = undefined;
|
|
173
|
+
}
|
|
174
|
+
}, [createAnalyticsEvent, status]);
|
|
175
|
+
var handleReactionMouseEnter = (0, _react.useCallback)(function (emojiId) {
|
|
176
|
+
getReactionDetails(emojiId);
|
|
177
|
+
}, [getReactionDetails]);
|
|
178
|
+
var handleReactionFocused = (0, _react.useCallback)(function (emojiId) {
|
|
179
|
+
getReactionDetails(emojiId);
|
|
180
|
+
}, [getReactionDetails]);
|
|
181
|
+
var handlePickerOpen = (0, _react.useCallback)(function () {
|
|
182
|
+
openTime.current = Date.now();
|
|
183
|
+
(0, _analytics.createAndFireSafe)(createAnalyticsEvent, _analytics.createPickerButtonClickedEvent, reactions.length);
|
|
184
|
+
}, [createAnalyticsEvent, reactions]);
|
|
185
|
+
var handleOnCancel = (0, _react.useCallback)(function () {
|
|
186
|
+
(0, _analytics.createAndFireSafe)(createAnalyticsEvent, _analytics.createPickerCancelledEvent, openTime.current);
|
|
187
|
+
openTime.current = undefined;
|
|
188
|
+
}, [createAnalyticsEvent]);
|
|
189
|
+
var handleOnMore = (0, _react.useCallback)(function () {
|
|
190
|
+
(0, _analytics.createAndFireSafe)(createAnalyticsEvent, _analytics.createPickerMoreClickedEvent, openTime.current);
|
|
191
|
+
}, [createAnalyticsEvent]);
|
|
192
|
+
var handleOnSelection = (0, _react.useCallback)(function (emojiId, source) {
|
|
193
|
+
(0, _analytics.createAndFireSafe)(createAnalyticsEvent, _analytics.createReactionSelectionEvent, source, emojiId, reactions.find(function (reaction) {
|
|
194
|
+
return reaction.emojiId === emojiId;
|
|
195
|
+
}), openTime.current);
|
|
196
|
+
openTime.current = undefined;
|
|
197
|
+
onSelection(emojiId);
|
|
198
|
+
}, [createAnalyticsEvent, onSelection, reactions]);
|
|
199
|
+
var handleCloseReactionsDialog = function handleCloseReactionsDialog(e, analyticsEvent) {
|
|
200
|
+
setSelectedEmojiId('');
|
|
201
|
+
onDialogCloseCallback(e, analyticsEvent);
|
|
202
|
+
};
|
|
203
|
+
var handleSelectReactionInDialog = function handleSelectReactionInDialog(emojiId) {
|
|
204
|
+
// ufo selected reaction inside the modal dialog
|
|
205
|
+
ufoExperiences.selectedReactionChangeInsideDialog.start();
|
|
206
|
+
handleReactionMouseEnter(emojiId);
|
|
207
|
+
setSelectedEmojiId(emojiId);
|
|
208
|
+
onDialogSelectReactionCallback(emojiId);
|
|
209
|
+
|
|
210
|
+
// ufo selected reaction inside the modal dialog success
|
|
211
|
+
ufoExperiences.selectedReactionChangeInsideDialog.success({
|
|
212
|
+
metadata: {
|
|
213
|
+
emojiId: emojiId,
|
|
214
|
+
source: 'Reactions',
|
|
215
|
+
reason: 'Selected Emoji changed'
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
};
|
|
219
|
+
var handlePaginationChange = (0, _react.useCallback)(function (emojiId, currentPage, maxPages) {
|
|
220
|
+
// fetch the latest active emoji from the new page
|
|
221
|
+
getReactionDetails(emojiId);
|
|
222
|
+
setSelectedEmojiId(emojiId);
|
|
223
|
+
onDialogPageChangeCallback(emojiId, currentPage, maxPages);
|
|
224
|
+
},
|
|
225
|
+
// Exclude unstable getReactionDetails to avoid extra re-renders
|
|
226
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
227
|
+
[setSelectedEmojiId]);
|
|
228
|
+
|
|
229
|
+
/**
|
|
230
|
+
* Get the reactions that we want to render are any reactions with a count greater than zero as well as any default emoji not already shown
|
|
231
|
+
*/
|
|
232
|
+
var memorizedReactions = (0, _react.useMemo)(function () {
|
|
233
|
+
//
|
|
234
|
+
/**
|
|
235
|
+
* If reactions not empty, don't show quick reactions Pre defined emoji or if its empty and default reactions not hidden => return the current list of reactions
|
|
236
|
+
*/
|
|
237
|
+
if (reactions.length === 0 && hideDefaultReactions || reactions.length > 0 || !quickReactionEmojis) {
|
|
238
|
+
return reactions;
|
|
239
|
+
}
|
|
240
|
+
|
|
241
|
+
// add any missing default reactions
|
|
242
|
+
var ari = quickReactionEmojis.ari,
|
|
243
|
+
containerAri = quickReactionEmojis.containerAri,
|
|
244
|
+
emojiIds = quickReactionEmojis.emojiIds;
|
|
245
|
+
var items = emojiIds.filter(function (emojiId) {
|
|
246
|
+
return !reactions.some(function (reaction) {
|
|
247
|
+
return reaction.emojiId === emojiId;
|
|
248
|
+
});
|
|
249
|
+
}).map(function (emojiId) {
|
|
250
|
+
return {
|
|
251
|
+
ari: ari,
|
|
252
|
+
containerAri: containerAri,
|
|
253
|
+
emojiId: emojiId,
|
|
254
|
+
count: 0,
|
|
255
|
+
reacted: false
|
|
256
|
+
};
|
|
257
|
+
});
|
|
258
|
+
return reactions.concat(items);
|
|
259
|
+
}, [quickReactionEmojis, reactions, hideDefaultReactions]);
|
|
260
|
+
var shouldShowSummaryView = summaryViewEnabled && memorizedReactions.length >= summaryViewThreshold && reactions.length > 0;
|
|
261
|
+
|
|
262
|
+
// criteria to show Reactions Dialog
|
|
263
|
+
var hasEmojiWithFivePlusReactions = reactions.some(function (reaction) {
|
|
264
|
+
return reaction.count >= 5;
|
|
265
|
+
});
|
|
266
|
+
var sortedReactions = (0, _react.useMemo)(function () {
|
|
267
|
+
return (0, _toConsumableArray2.default)(memorizedReactions).sort(function (a, b) {
|
|
268
|
+
return (b === null || b === void 0 ? void 0 : b.count) - (a === null || a === void 0 ? void 0 : a.count);
|
|
269
|
+
});
|
|
270
|
+
}, [memorizedReactions]);
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* event handler to open dialog with selected reaction
|
|
274
|
+
* @param emojiId initial emoji id to load dialog with
|
|
275
|
+
*/
|
|
276
|
+
var _handleOpenReactionsDialog = function handleOpenReactionsDialog() {
|
|
277
|
+
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
|
|
278
|
+
_ref2$emojiId = _ref2.emojiId,
|
|
279
|
+
emojiId = _ref2$emojiId === void 0 ? sortedReactions[0].emojiId : _ref2$emojiId,
|
|
280
|
+
_ref2$source = _ref2.source,
|
|
281
|
+
source = _ref2$source === void 0 ? 'endOfPageReactions' : _ref2$source;
|
|
282
|
+
// ufo start opening reaction dialog
|
|
283
|
+
ufoExperiences.openDialog.start();
|
|
284
|
+
getReactionDetails(emojiId);
|
|
285
|
+
setSelectedEmojiId(emojiId);
|
|
286
|
+
onDialogOpenCallback(emojiId, source);
|
|
287
|
+
|
|
288
|
+
// ufo opening reaction dialog success
|
|
289
|
+
ufoExperiences.openDialog.success({
|
|
290
|
+
metadata: {
|
|
291
|
+
emojiId: emojiId,
|
|
292
|
+
source: 'Reactions',
|
|
293
|
+
reason: 'Opening Reactions Dialog successfully'
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
};
|
|
297
|
+
return /*#__PURE__*/_react.default.createElement(_segment.default, {
|
|
298
|
+
name: "reactions"
|
|
299
|
+
}, /*#__PURE__*/_react.default.createElement("div", {
|
|
300
|
+
"data-testid": RENDER_REACTIONS_TESTID,
|
|
301
|
+
className: (0, _runtime.ax)(["_2rkoo7ao _1e0c1txw _1n261g80 _kqswh2mm _4cvr1h6o _19pkr5cr _13vtidpf", noWrap && "_1n261q9c", noRelativeContainer && "_kqswpfqs"])
|
|
302
|
+
}, !onlyRenderPicker && (shouldShowSummaryView ? /*#__PURE__*/_react.default.createElement("div", {
|
|
303
|
+
"data-testid": RENDER_REACTIONS_SUMMARY_TESTID
|
|
304
|
+
}, /*#__PURE__*/_react.default.createElement(_ReactionSummary.ReactionSummaryView, {
|
|
305
|
+
reactions: sortedReactions,
|
|
306
|
+
emojiProvider: emojiProvider,
|
|
307
|
+
flash: flash,
|
|
308
|
+
particleEffectByEmoji: particleEffectByEmoji,
|
|
309
|
+
onSelection: handleOnSelection,
|
|
310
|
+
onReactionClick: onReactionClick,
|
|
311
|
+
onReactionFocused: handleReactionFocused,
|
|
312
|
+
onReactionMouseEnter: handleReactionMouseEnter,
|
|
313
|
+
placement: summaryViewPlacement,
|
|
314
|
+
showOpaqueBackground: showOpaqueBackground,
|
|
315
|
+
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
316
|
+
handleOpenReactionsDialog: function handleOpenReactionsDialog() {
|
|
317
|
+
return _handleOpenReactionsDialog({
|
|
318
|
+
source: 'summaryView'
|
|
319
|
+
});
|
|
320
|
+
},
|
|
321
|
+
allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions,
|
|
322
|
+
isViewOnly: isViewOnly,
|
|
323
|
+
allowSelectFromSummaryView: allowSelectFromSummaryView,
|
|
324
|
+
disabled: status !== _types.ReactionStatus.ready,
|
|
325
|
+
reactionPickerTriggerIcon: reactionPickerTriggerIcon,
|
|
326
|
+
tooltipContent: getTooltip(status, errorMessage, reactionPickerTriggerToolipContent),
|
|
327
|
+
emojiPickerSize: emojiPickerSize,
|
|
328
|
+
onOpen: handlePickerOpen,
|
|
329
|
+
useButtonAlignmentStyling: useButtonAlignmentStyling
|
|
330
|
+
})) : memorizedReactions.map(function (reaction) {
|
|
331
|
+
return /*#__PURE__*/_react.default.createElement(_Reaction.Reaction, {
|
|
332
|
+
key: reaction.emojiId,
|
|
333
|
+
reaction: reaction,
|
|
334
|
+
emojiProvider: emojiProvider,
|
|
335
|
+
onClick: onReactionClick,
|
|
336
|
+
onMouseEnter: handleReactionMouseEnter,
|
|
337
|
+
onFocused: handleReactionFocused,
|
|
338
|
+
flash: flash[reaction.emojiId],
|
|
339
|
+
showParticleEffect: particleEffectByEmoji[reaction.emojiId],
|
|
340
|
+
showOpaqueBackground: showOpaqueBackground,
|
|
341
|
+
allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions,
|
|
342
|
+
handleOpenReactionsDialog: _handleOpenReactionsDialog,
|
|
343
|
+
isViewOnly: isViewOnly,
|
|
344
|
+
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0
|
|
345
|
+
});
|
|
346
|
+
})), isViewOnly || allowSelectFromSummaryView ? null : /*#__PURE__*/_react.default.createElement(_ReactionPicker.ReactionPicker, {
|
|
347
|
+
emojiProvider: emojiProvider,
|
|
348
|
+
allowAllEmojis: allowAllEmojis,
|
|
349
|
+
pickerQuickReactionEmojiIds: pickerQuickReactionEmojiIds,
|
|
350
|
+
disabled: status !== _types.ReactionStatus.ready,
|
|
351
|
+
onSelection: handleOnSelection,
|
|
352
|
+
onOpen: handlePickerOpen,
|
|
353
|
+
onCancel: handleOnCancel,
|
|
354
|
+
onShowMore: handleOnMore,
|
|
355
|
+
tooltipContent: getTooltip(status, errorMessage, reactionPickerTriggerToolipContent),
|
|
356
|
+
emojiPickerSize: emojiPickerSize,
|
|
357
|
+
miniMode: miniMode,
|
|
358
|
+
showOpaqueBackground: showOpaqueBackground,
|
|
359
|
+
showAddReactionText: showAddReactionText,
|
|
360
|
+
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
361
|
+
showRoundTrigger: showRoundTrigger,
|
|
362
|
+
reactionPickerTriggerIcon: reactionPickerTriggerIcon,
|
|
363
|
+
reactionPickerAdditionalStyle: reactionPickerAdditionalStyle,
|
|
364
|
+
useButtonAlignmentStyling: useButtonAlignmentStyling,
|
|
365
|
+
className: (0, _runtime.ax)(["_1e0c1o8l _19pk1b66"])
|
|
366
|
+
}), /*#__PURE__*/_react.default.createElement(_modalDialog.ModalTransition, null, !!selectedEmojiId && /*#__PURE__*/_react.default.createElement(_segment.default, {
|
|
367
|
+
name: "reactions-dialog"
|
|
368
|
+
}, /*#__PURE__*/_react.default.createElement(_ReactionDialog.ReactionsDialog, {
|
|
369
|
+
selectedEmojiId: selectedEmojiId,
|
|
370
|
+
reactions: sortedReactions,
|
|
371
|
+
emojiProvider: emojiProvider,
|
|
372
|
+
handleCloseReactionsDialog: handleCloseReactionsDialog,
|
|
373
|
+
handleSelectReaction: handleSelectReactionInDialog,
|
|
374
|
+
handlePaginationChange: handlePaginationChange,
|
|
375
|
+
ProfileCardWrapper: ProfileCardWrapper
|
|
376
|
+
})))));
|
|
377
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
._19itglyw{border:none}
|
|
3
|
+
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}._12l21b66{margin-inline-end:var(--ds-space-050,4px)}
|
|
4
|
+
._18m915vq{overflow-y:hidden}
|
|
5
|
+
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
6
|
+
._1e0c1txw{display:flex}
|
|
7
|
+
._1pfh1b66{margin-block-start:var(--ds-space-050,4px)}
|
|
8
|
+
._1reo15vq{overflow-x:hidden}
|
|
9
|
+
._1ul914no{min-width:36px}
|
|
10
|
+
._2lx2vrvc{flex-direction:row}
|
|
11
|
+
._4cvr1y6m{align-items:flex-start}
|
|
12
|
+
._4t3i1tcg{height:24px}
|
|
13
|
+
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
14
|
+
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
15
|
+
._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
|
|
16
|
+
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
17
|
+
._d0al73ad:hover{cursor:default}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/* StaticReaction.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
"use strict";
|
|
3
|
+
|
|
4
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
5
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
6
|
+
Object.defineProperty(exports, "__esModule", {
|
|
7
|
+
value: true
|
|
8
|
+
});
|
|
9
|
+
exports.StaticReaction = void 0;
|
|
10
|
+
require("./StaticReaction.compiled.css");
|
|
11
|
+
var React = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _runtime = require("@compiled/react/runtime");
|
|
13
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
14
|
+
var _compiled = require("@atlaskit/primitives/compiled");
|
|
15
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
16
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
17
|
+
var styles = {
|
|
18
|
+
staticReaction: "_1reo15vq _18m915vq _19itglyw _2rkoglpi _1e0c1txw _2lx2vrvc _4cvr1y6m _1ul914no _4t3i1tcg _syaz1gjq _1pfh1b66 _12l21b66 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _d0al73ad"
|
|
19
|
+
};
|
|
20
|
+
var StaticReaction = exports.StaticReaction = function StaticReaction(_ref) {
|
|
21
|
+
var onMouseEnter = _ref.onMouseEnter,
|
|
22
|
+
onFocus = _ref.onFocus,
|
|
23
|
+
children = _ref.children,
|
|
24
|
+
testId = _ref.testId,
|
|
25
|
+
_ref$dataAttributes = _ref.dataAttributes,
|
|
26
|
+
dataAttributes = _ref$dataAttributes === void 0 ? {} : _ref$dataAttributes;
|
|
27
|
+
return /*#__PURE__*/React.createElement(_compiled.Box, (0, _extends2.default)({
|
|
28
|
+
onMouseEnter: onMouseEnter,
|
|
29
|
+
onFocus: onFocus,
|
|
30
|
+
testId: testId,
|
|
31
|
+
xcss: styles.staticReaction,
|
|
32
|
+
backgroundColor: "color.background.neutral.subtle"
|
|
33
|
+
}, dataAttributes), children);
|
|
34
|
+
};
|
|
@@ -15,8 +15,11 @@ var _react = _interopRequireWildcard(require("react"));
|
|
|
15
15
|
var _analyticsNamespacedContext = require("@atlaskit/analytics-namespaced-context");
|
|
16
16
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
17
17
|
var _components = require("../../components");
|
|
18
|
+
var _Reactions = require("../../components/Reactions");
|
|
19
|
+
var _Reactions2 = require("../../components/compiled/Reactions");
|
|
18
20
|
var _store2 = require("../../store");
|
|
19
21
|
var _types = require("../../types");
|
|
22
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
20
23
|
var _excluded = ["ari", "containerAri", "store", "particleEffectByEmojiEnabled", "onReactionSuccess"];
|
|
21
24
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
25
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && {}.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
@@ -220,7 +223,9 @@ var ConnectedReactionsView = exports.ConnectedReactionsView = function Connected
|
|
|
220
223
|
}
|
|
221
224
|
}, /*#__PURE__*/_react.default.createElement(_components.UfoErrorBoundary, {
|
|
222
225
|
experiences: experienceInstance.current ? [experienceInstance.current] : []
|
|
223
|
-
}, stateData && dispatchData ? /*#__PURE__*/_react.default.createElement(
|
|
226
|
+
}, stateData && dispatchData && (0, _platformFeatureFlags.fg)('platform_editor_css_migrate_reactions') ? /*#__PURE__*/_react.default.createElement(_Reactions2.Reactions, (0, _extends2.default)({
|
|
227
|
+
key: "".concat(containerAri, "|").concat(ari)
|
|
228
|
+
}, rest, dispatchData, stateData)) : null, stateData && dispatchData && !(0, _platformFeatureFlags.fg)('platform_editor_css_migrate_reactions') ? /*#__PURE__*/_react.default.createElement(_Reactions.Reactions, (0, _extends2.default)({
|
|
224
229
|
key: "".concat(containerAri, "|").concat(ari)
|
|
225
230
|
}, rest, dispatchData, stateData)) : null));
|
|
226
231
|
};
|
package/dist/cjs/index.js
CHANGED
|
@@ -21,12 +21,7 @@ Object.defineProperty(exports, "MemoryReactionsStore", {
|
|
|
21
21
|
return _store.MemoryReactionsStore;
|
|
22
22
|
}
|
|
23
23
|
});
|
|
24
|
-
|
|
25
|
-
enumerable: true,
|
|
26
|
-
get: function get() {
|
|
27
|
-
return _components.Reaction;
|
|
28
|
-
}
|
|
29
|
-
});
|
|
24
|
+
exports.Reaction = void 0;
|
|
30
25
|
Object.defineProperty(exports, "ReactionConsumer", {
|
|
31
26
|
enumerable: true,
|
|
32
27
|
get: function get() {
|
|
@@ -36,7 +31,7 @@ Object.defineProperty(exports, "ReactionConsumer", {
|
|
|
36
31
|
Object.defineProperty(exports, "ReactionPicker", {
|
|
37
32
|
enumerable: true,
|
|
38
33
|
get: function get() {
|
|
39
|
-
return
|
|
34
|
+
return _ReactionPicker.ReactionPicker;
|
|
40
35
|
}
|
|
41
36
|
});
|
|
42
37
|
Object.defineProperty(exports, "ReactionServiceClient", {
|
|
@@ -57,13 +52,7 @@ Object.defineProperty(exports, "ReactionUpdateType", {
|
|
|
57
52
|
return _types.ReactionUpdateType;
|
|
58
53
|
}
|
|
59
54
|
});
|
|
60
|
-
|
|
61
|
-
enumerable: true,
|
|
62
|
-
get: function get() {
|
|
63
|
-
return _components.Reactions;
|
|
64
|
-
}
|
|
65
|
-
});
|
|
66
|
-
exports.constants = exports.UFO = void 0;
|
|
55
|
+
exports.constants = exports.UFO = exports.Reactions = void 0;
|
|
67
56
|
Object.defineProperty(exports, "useCloseManager", {
|
|
68
57
|
enumerable: true,
|
|
69
58
|
get: function get() {
|
|
@@ -72,12 +61,20 @@ Object.defineProperty(exports, "useCloseManager", {
|
|
|
72
61
|
});
|
|
73
62
|
var _constants = require("./shared/constants");
|
|
74
63
|
var _ufo = require("./ufo");
|
|
64
|
+
var _Reaction = require("./components/Reaction");
|
|
65
|
+
var _Reaction2 = require("./components/compiled/Reaction");
|
|
66
|
+
var _Reactions = require("./components/Reactions");
|
|
67
|
+
var _Reactions2 = require("./components/compiled/Reactions");
|
|
68
|
+
var _platformFeatureFlagsReact = require("@atlaskit/platform-feature-flags-react");
|
|
75
69
|
var _client = require("./client");
|
|
76
|
-
var
|
|
70
|
+
var _ReactionPicker = require("./components/ReactionPicker/ReactionPicker");
|
|
77
71
|
var _useCloseManager = require("./hooks/useCloseManager");
|
|
78
72
|
var _containers = require("./containers");
|
|
79
73
|
var _store = require("./store");
|
|
80
74
|
var _types = require("./types");
|
|
75
|
+
var Reaction = exports.Reaction = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_css_migrate_reactions', _Reaction2.Reaction, _Reaction.Reaction);
|
|
76
|
+
var Reactions = exports.Reactions = (0, _platformFeatureFlagsReact.componentWithFG)('platform_editor_css_migrate_reactions', _Reactions2.Reactions, _Reactions.Reactions);
|
|
77
|
+
|
|
81
78
|
// TODO: Convert all calls for ReactionRequest to Request, RequestClient to Client and ReactionsStore to Store
|
|
82
79
|
|
|
83
80
|
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 = "
|
|
4
|
+
const packageVersion = "28.0.0";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|