@atlaskit/reactions 27.2.1 → 29.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 +20 -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/ReactionPicker/ReactionPicker.js +2 -5
- package/dist/cjs/components/ReactionSummary/ReactionSummaryViewEmojiPicker.js +7 -12
- package/dist/cjs/components/Reactions/Reactions.js +0 -3
- package/dist/cjs/components/Trigger/Trigger.js +1 -8
- 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 +374 -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/ReactionPicker/ReactionPicker.js +2 -4
- package/dist/es2019/components/ReactionSummary/ReactionSummaryViewEmojiPicker.js +4 -10
- package/dist/es2019/components/Reactions/Reactions.js +0 -2
- package/dist/es2019/components/Trigger/Trigger.js +1 -7
- 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 +323 -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/ReactionPicker/ReactionPicker.js +2 -5
- package/dist/esm/components/ReactionSummary/ReactionSummaryViewEmojiPicker.js +4 -10
- package/dist/esm/components/Reactions/Reactions.js +0 -3
- package/dist/esm/components/Trigger/Trigger.js +1 -8
- 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 +362 -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/ReactionPicker/ReactionPicker.d.ts +1 -5
- package/dist/types/components/ReactionSummary/ReactionSummaryViewEmojiPicker.d.ts +2 -2
- package/dist/types/components/Reactions/Reactions.d.ts +2 -6
- package/dist/types/components/Trigger/Trigger.d.ts +0 -4
- 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 +177 -0
- package/dist/types/components/compiled/StaticReaction.d.ts +12 -0
- package/dist/types/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +1 -1
- package/dist/types/index.d.ts +5 -1
- package/dist/types-ts4.5/components/ReactionPicker/ReactionPicker.d.ts +1 -5
- package/dist/types-ts4.5/components/ReactionSummary/ReactionSummaryViewEmojiPicker.d.ts +2 -2
- package/dist/types-ts4.5/components/Reactions/Reactions.d.ts +2 -6
- package/dist/types-ts4.5/components/Trigger/Trigger.d.ts +0 -4
- 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 +177 -0
- package/dist/types-ts4.5/components/compiled/StaticReaction.d.ts +12 -0
- package/dist/types-ts4.5/containers/ConnectedReactionsView/ConnectedReactionsView.d.ts +1 -1
- package/dist/types-ts4.5/index.d.ts +5 -1
- package/package.json +13 -3
|
@@ -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 = "29.0.0";
|
|
5
5
|
/**
|
|
6
6
|
* TODO: move to utility package?
|
|
7
7
|
* A random sampling function
|
|
@@ -52,7 +52,6 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
52
52
|
showOpaqueBackground = false,
|
|
53
53
|
subtleReactionsSummaryAndPicker = false,
|
|
54
54
|
showAddReactionText = false,
|
|
55
|
-
showRoundTrigger = false,
|
|
56
55
|
reactionPickerAdditionalStyle = undefined,
|
|
57
56
|
reactionPickerTriggerIcon,
|
|
58
57
|
useButtonAlignmentStyling,
|
|
@@ -67,7 +66,7 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
67
66
|
const wrapperRef = useRef(null);
|
|
68
67
|
const [selectionStyle, setSelectionStyle] = useState(undefined);
|
|
69
68
|
const updatePopper = useRef();
|
|
70
|
-
const popperPlacement =
|
|
69
|
+
const popperPlacement = reactionPickerPlacement || 'bottom-start';
|
|
71
70
|
const popperModifiers = [
|
|
72
71
|
/**
|
|
73
72
|
Removing this applyStyle modifier as it throws client errors ref:
|
|
@@ -108,7 +107,7 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
108
107
|
*/
|
|
109
108
|
showFullPicker: !!allowAllEmojis && Array.isArray(pickerQuickReactionEmojiIds) && pickerQuickReactionEmojiIds.length === 0,
|
|
110
109
|
/**
|
|
111
|
-
*
|
|
110
|
+
* Placement for popper
|
|
112
111
|
*/
|
|
113
112
|
popperPlacement
|
|
114
113
|
});
|
|
@@ -234,7 +233,6 @@ export const ReactionPicker = /*#__PURE__*/React.memo(props => {
|
|
|
234
233
|
showOpaqueBackground: showOpaqueBackground,
|
|
235
234
|
showAddReactionText: showAddReactionText,
|
|
236
235
|
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
237
|
-
showRoundTrigger: showRoundTrigger,
|
|
238
236
|
reactionPickerTriggerIcon: reactionPickerTriggerIcon,
|
|
239
237
|
useButtonAlignmentStyling: useButtonAlignmentStyling
|
|
240
238
|
})), settings.isOpen && jsx(PopperWrapper, {
|
|
@@ -1,11 +1,5 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
|
|
3
|
-
* @jsxRuntime classic
|
|
4
|
-
* @jsx jsx
|
|
5
|
-
*/
|
|
6
|
-
import { useCallback, useState } from 'react';
|
|
7
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
8
|
-
import { jsx } from '@emotion/react';
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
9
3
|
import { EmojiPicker } from '@atlaskit/emoji/picker';
|
|
10
4
|
import Popup from '@atlaskit/popup';
|
|
11
5
|
import { PickerRender } from '../../ufo';
|
|
@@ -58,17 +52,17 @@ export const ReactionSummaryViewEmojiPicker = ({
|
|
|
58
52
|
onSelection(item.id, 'emojiPicker');
|
|
59
53
|
close(item.id);
|
|
60
54
|
}, [onSelection, close]);
|
|
61
|
-
return
|
|
55
|
+
return /*#__PURE__*/React.createElement(Popup, {
|
|
62
56
|
testId: "reaction-summary-view-emoji-picker",
|
|
63
57
|
isOpen: isOpen,
|
|
64
58
|
placement: "right",
|
|
65
59
|
onClose: () => close(),
|
|
66
|
-
content: () =>
|
|
60
|
+
content: () => /*#__PURE__*/React.createElement(EmojiPicker, {
|
|
67
61
|
emojiProvider: emojiProvider,
|
|
68
62
|
onSelection: onEmojiSelected,
|
|
69
63
|
size: emojiPickerSize
|
|
70
64
|
}),
|
|
71
|
-
trigger: triggerProps =>
|
|
65
|
+
trigger: triggerProps => /*#__PURE__*/React.createElement(Trigger, _extends({}, triggerProps, {
|
|
72
66
|
disabled: disabled,
|
|
73
67
|
reactionPickerTriggerIcon: reactionPickerTriggerIcon,
|
|
74
68
|
tooltipContent: tooltipContent,
|
|
@@ -117,7 +117,6 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
117
117
|
hideDefaultReactions = false,
|
|
118
118
|
ProfileCardWrapper,
|
|
119
119
|
onlyRenderPicker = false,
|
|
120
|
-
showRoundTrigger = false,
|
|
121
120
|
reactionPickerPlacement,
|
|
122
121
|
reactionsPickerPreventOverflowOptions,
|
|
123
122
|
isViewOnly = false,
|
|
@@ -329,7 +328,6 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
329
328
|
showOpaqueBackground: showOpaqueBackground,
|
|
330
329
|
showAddReactionText: showAddReactionText,
|
|
331
330
|
subtleReactionsSummaryAndPicker: subtleReactionsSummaryAndPicker,
|
|
332
|
-
showRoundTrigger: showRoundTrigger,
|
|
333
331
|
reactionPickerTriggerIcon: reactionPickerTriggerIcon,
|
|
334
332
|
reactionPickerAdditionalStyle: reactionPickerAdditionalStyle,
|
|
335
333
|
useButtonAlignmentStyling: useButtonAlignmentStyling,
|
|
@@ -47,11 +47,6 @@ const expandedTriggerStyles = xcss({
|
|
|
47
47
|
const triggerStylesRefresh = xcss({
|
|
48
48
|
borderRadius: 'border.radius'
|
|
49
49
|
});
|
|
50
|
-
const roundTriggerStyles = xcss({
|
|
51
|
-
borderRadius: '50%',
|
|
52
|
-
height: '2rem',
|
|
53
|
-
width: '2rem'
|
|
54
|
-
});
|
|
55
50
|
const transparentEnabledTriggerStyles = xcss({
|
|
56
51
|
borderColor: 'color.border',
|
|
57
52
|
backgroundColor: 'color.background.neutral.subtle',
|
|
@@ -107,7 +102,6 @@ export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
107
102
|
showOpaqueBackground = false,
|
|
108
103
|
showAddReactionText = false,
|
|
109
104
|
subtleReactionsSummaryAndPicker = false,
|
|
110
|
-
showRoundTrigger = false,
|
|
111
105
|
selectionStyle,
|
|
112
106
|
reactionPickerTriggerIcon,
|
|
113
107
|
useButtonAlignmentStyling
|
|
@@ -122,7 +116,7 @@ export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
|
122
116
|
content: tooltipContent
|
|
123
117
|
}, jsx(Pressable, _extends({
|
|
124
118
|
testId: RENDER_TRIGGER_BUTTON_TESTID,
|
|
125
|
-
xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh,
|
|
119
|
+
xcss: [triggerStyles, subtleReactionsSummaryAndPicker && subtleTriggerStyles, showAddReactionText && expandedTriggerStyles, disabled ? disabledTriggerStyles : showOpaqueBackground ? opaqueEnabledTriggerStyles : transparentEnabledTriggerStyles, miniMode && miniModeStyles, fg('platform-component-visual-refresh') && triggerStylesRefresh,
|
|
126
120
|
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage
|
|
127
121
|
selectionStyle],
|
|
128
122
|
onClick: handleMouseDown,
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
._11c81o8v{font:var(--ds-font-body-small,normal 400 11px/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._18m915vq{overflow-y:hidden}
|
|
3
|
+
._19bvidpf{padding-left:0}
|
|
4
|
+
._19pk1b66{margin-top:var(--ds-space-050,4px)}
|
|
5
|
+
._1e0c1txw{display:flex}
|
|
6
|
+
._1reo15vq{overflow-x:hidden}
|
|
7
|
+
._1x821ts4{font-variant-numeric:tabular-nums}
|
|
8
|
+
._2lx21bp4{flex-direction:column}
|
|
9
|
+
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
10
|
+
._kqswh2mm{position:relative}
|
|
11
|
+
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
12
|
+
._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
|
|
13
|
+
._syaz1ifp{color:var(--ds-text-subtlest,#8993a4)}
|
|
14
|
+
._syaz1ldt{color:var(--ds-text-selected,#0052cc)}
|
|
15
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
16
|
+
._vwz4dlk8{line-height:14px}
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/* Counter.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./Counter.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useEffect, useMemo, useRef } from 'react';
|
|
6
|
+
import { SlideIn, ExitingPersistence } from '@atlaskit/motion';
|
|
7
|
+
import { formatLargeNumber } from '../../shared/utils';
|
|
8
|
+
import { B400, N90 } from '@atlaskit/theme/colors';
|
|
9
|
+
const containerStyle = null;
|
|
10
|
+
const counterLabelStyle = null;
|
|
11
|
+
const countStyle = null;
|
|
12
|
+
const highlightStyle = null;
|
|
13
|
+
const darkerFontStyle = null;
|
|
14
|
+
const updatedStyles = null;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* Test id for component top level div
|
|
18
|
+
*/
|
|
19
|
+
export const RENDER_COMPONENT_WRAPPER = 'counter-wrapper';
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Test id for wrapper div of the counter inside the slider
|
|
23
|
+
*/
|
|
24
|
+
export const RENDER_COUNTER_TESTID = 'counter-container';
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Counter label value wrapper div
|
|
28
|
+
*/
|
|
29
|
+
export const RENDER_LABEL_TESTID = 'counter_label_wrapper';
|
|
30
|
+
/**
|
|
31
|
+
* Display reaction count next to the emoji button
|
|
32
|
+
*/
|
|
33
|
+
export const Counter = ({
|
|
34
|
+
highlight = false,
|
|
35
|
+
limit,
|
|
36
|
+
overLimitLabel,
|
|
37
|
+
className,
|
|
38
|
+
value,
|
|
39
|
+
animationDuration = 'medium',
|
|
40
|
+
useDarkerFont,
|
|
41
|
+
useUpdatedStyles
|
|
42
|
+
}) => {
|
|
43
|
+
const getLabel = value => {
|
|
44
|
+
// Check if reached limit
|
|
45
|
+
if (limit && overLimitLabel && value >= limit) {
|
|
46
|
+
return overLimitLabel || '';
|
|
47
|
+
} else if (value === 0) {
|
|
48
|
+
return '';
|
|
49
|
+
} else {
|
|
50
|
+
return formatLargeNumber(value);
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const lastValue = useRef();
|
|
54
|
+
const label = getLabel(value);
|
|
55
|
+
useEffect(() => {
|
|
56
|
+
lastValue.current = value;
|
|
57
|
+
}, [value]);
|
|
58
|
+
const isIncreasing = useMemo(() => {
|
|
59
|
+
return lastValue.current ? lastValue.current < value : false;
|
|
60
|
+
}, [value]);
|
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
62
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
63
|
+
className: ax(["_11c81o8v _1reo15vq _18m915vq _syaz1ifp _kqswh2mm _ca0q1b66 _u5f3u2gc _n3td1b66 _19bvidpf _vwz4dlk8", useDarkerFont && "_syaz1gjq", useUpdatedStyles && "_19pk1b66", className]),
|
|
64
|
+
"data-testid": RENDER_COMPONENT_WRAPPER
|
|
65
|
+
}, /*#__PURE__*/React.createElement(ExitingPersistence, null, /*#__PURE__*/React.createElement(SlideIn, {
|
|
66
|
+
enterFrom: isIncreasing ? 'top' : 'bottom',
|
|
67
|
+
exitTo: isIncreasing ? 'top' : 'bottom',
|
|
68
|
+
key: value,
|
|
69
|
+
duration: animationDuration
|
|
70
|
+
}, (motion, direction) => {
|
|
71
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
72
|
+
ref: motion.ref,
|
|
73
|
+
style: {
|
|
74
|
+
position: direction === 'exiting' ? 'absolute' : undefined
|
|
75
|
+
}
|
|
76
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
77
|
+
,
|
|
78
|
+
className: ax(["_1e0c1txw _2lx21bp4", motion.className]),
|
|
79
|
+
"data-testid": RENDER_COUNTER_TESTID
|
|
80
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
81
|
+
"data-testid": RENDER_LABEL_TESTID,
|
|
82
|
+
key: value,
|
|
83
|
+
className: ax(["_1x821ts4", highlight && "_syaz1ldt"])
|
|
84
|
+
}, label));
|
|
85
|
+
})));
|
|
86
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
|
|
2
|
+
._y44v1li1{animation:k1qrjcqm .7s ease-in-out}._1bsb1osq{width:100%}
|
|
3
|
+
._4t3i1osq{height:100%}
|
|
4
|
+
@keyframes k1qrjcqm{20%{border-color:var(--ds-border-selected,#0065ff);background-color:var(--ds-background-selected-pressed,#b3d4ff)}75%{border-color:var(--ds-border-selected,#0065ff);background-color:var(--ds-background-selected-pressed,#b3d4ff)}to{border-color:var(--ds-border-selected,#0065ff);background-color:var(--ds-background-selected-pressed,#b3d4ff)}0%{background-color:transparent}}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/* FlashAnimation.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./FlashAnimation.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { B75, B300 } from '@atlaskit/theme/colors';
|
|
6
|
+
const flashTime = 700;
|
|
7
|
+
const flashAnimation = null;
|
|
8
|
+
const containerStyle = null;
|
|
9
|
+
const flashStyle = null;
|
|
10
|
+
/**
|
|
11
|
+
* Test id for wrapper FlashAnimation div
|
|
12
|
+
*/
|
|
13
|
+
export const RENDER_FLASHANIMATION_TESTID = 'flash-animation';
|
|
14
|
+
/**
|
|
15
|
+
* Flash animation background component. See Reaction component for usage.
|
|
16
|
+
*/
|
|
17
|
+
export const FlashAnimation = props => /*#__PURE__*/React.createElement("div", {
|
|
18
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
19
|
+
className: ax(["_1bsb1osq _4t3i1osq", props.flash && "", props.flash && "_y44v1li1", props.className]),
|
|
20
|
+
"data-testid": RENDER_FLASHANIMATION_TESTID
|
|
21
|
+
}, props.children);
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
._19bv19bv{padding-left:10px}
|
|
2
|
+
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
3
|
+
._8hrz1nam{transform-origin:center center 0}
|
|
4
|
+
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
5
|
+
._kqswh2mm{position:relative}
|
|
6
|
+
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
7
|
+
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
8
|
+
._u5f3v77o{padding-right:var(--ds-space-025,2px)}
|
|
9
|
+
._vwz41crf{line-height:9pt}
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/* Reaction.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./Reaction.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useCallback, useEffect, useRef, useState } from 'react';
|
|
6
|
+
import { useIntl } from 'react-intl-next';
|
|
7
|
+
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
8
|
+
import { ResourcedEmoji } from '@atlaskit/emoji';
|
|
9
|
+
import { createAndFireSafe, createReactionClickedEvent, createReactionFocusedEvent, createReactionHoveredEvent } from '../../analytics';
|
|
10
|
+
import { Counter } from '../Counter';
|
|
11
|
+
import { ReactionParticleEffect } from './ReactionParticleEffect';
|
|
12
|
+
import { ReactionTooltip } from './ReactionTooltip';
|
|
13
|
+
import { messages } from '../../shared/i18n';
|
|
14
|
+
import { isLeftClick } from '../../shared/utils';
|
|
15
|
+
import { ReactionButton } from './ReactionButton';
|
|
16
|
+
import { StaticReaction } from './StaticReaction';
|
|
17
|
+
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
18
|
+
const styles = {
|
|
19
|
+
container: "_kqswh2mm"
|
|
20
|
+
};
|
|
21
|
+
const emojiStyle = null;
|
|
22
|
+
const emojiNoReactionStyle = null;
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Test id for Reaction item wrapper div
|
|
26
|
+
*/
|
|
27
|
+
export const RENDER_REACTION_TESTID = 'render_reaction_wrapper';
|
|
28
|
+
/**
|
|
29
|
+
* Render an emoji reaction button
|
|
30
|
+
*/
|
|
31
|
+
export const Reaction = ({
|
|
32
|
+
emojiProvider,
|
|
33
|
+
onClick,
|
|
34
|
+
reaction,
|
|
35
|
+
onMouseEnter = () => {},
|
|
36
|
+
onFocused = () => {},
|
|
37
|
+
flash = false,
|
|
38
|
+
showParticleEffect = false,
|
|
39
|
+
showOpaqueBackground = false,
|
|
40
|
+
allowUserDialog,
|
|
41
|
+
handleOpenReactionsDialog,
|
|
42
|
+
isViewOnly = false,
|
|
43
|
+
showSubtleStyle
|
|
44
|
+
}) => {
|
|
45
|
+
const intl = useIntl();
|
|
46
|
+
const hoverStart = useRef();
|
|
47
|
+
const focusStart = useRef();
|
|
48
|
+
const {
|
|
49
|
+
createAnalyticsEvent
|
|
50
|
+
} = useAnalyticsEvents();
|
|
51
|
+
const [emojiName, setEmojiName] = useState();
|
|
52
|
+
const [isTooltipEnabled, setIsTooltipEnabled] = useState(true);
|
|
53
|
+
const {
|
|
54
|
+
reacted
|
|
55
|
+
} = reaction;
|
|
56
|
+
const emojiId = {
|
|
57
|
+
id: reaction.emojiId,
|
|
58
|
+
shortName: ''
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// TODO: Extract the flow to a custom hook to retrieve emoji detailed description from an id using a custom hook. This will benefit a better optimization instead of the emojiProvider resolving everytime.
|
|
62
|
+
// Also optimize in future version to fetch in batch several emojiIds
|
|
63
|
+
useEffect(() => {
|
|
64
|
+
(async () => {
|
|
65
|
+
const emojiResource = await Promise.resolve(emojiProvider);
|
|
66
|
+
const foundEmoji = await emojiResource.findById(reaction.emojiId);
|
|
67
|
+
if (foundEmoji) {
|
|
68
|
+
setEmojiName(foundEmoji.name);
|
|
69
|
+
}
|
|
70
|
+
})();
|
|
71
|
+
}, [emojiProvider, reaction.emojiId]);
|
|
72
|
+
const handleClick = useCallback(event => {
|
|
73
|
+
event.preventDefault();
|
|
74
|
+
if (isLeftClick(event)) {
|
|
75
|
+
const {
|
|
76
|
+
reacted,
|
|
77
|
+
emojiId
|
|
78
|
+
} = reaction;
|
|
79
|
+
createAndFireSafe(createAnalyticsEvent, createReactionClickedEvent, !reacted, emojiId);
|
|
80
|
+
onClick(reaction.emojiId, event);
|
|
81
|
+
}
|
|
82
|
+
}, [createAnalyticsEvent, reaction, onClick]);
|
|
83
|
+
const handleMouseEnter = useCallback(event => {
|
|
84
|
+
event.preventDefault();
|
|
85
|
+
setIsTooltipEnabled(true);
|
|
86
|
+
if (!reaction.users || !reaction.users.length) {
|
|
87
|
+
focusStart.current = Date.now();
|
|
88
|
+
}
|
|
89
|
+
createAndFireSafe(createAnalyticsEvent, createReactionHoveredEvent, focusStart.current);
|
|
90
|
+
onMouseEnter(reaction.emojiId, event);
|
|
91
|
+
}, [createAnalyticsEvent, reaction, onMouseEnter]);
|
|
92
|
+
const handleFocused = useCallback(event => {
|
|
93
|
+
event.preventDefault();
|
|
94
|
+
setIsTooltipEnabled(true);
|
|
95
|
+
if (!reaction.users || !reaction.users.length) {
|
|
96
|
+
hoverStart.current = Date.now();
|
|
97
|
+
}
|
|
98
|
+
createAndFireSafe(createAnalyticsEvent, createReactionFocusedEvent, hoverStart.current);
|
|
99
|
+
onFocused(reaction.emojiId, event);
|
|
100
|
+
}, [createAnalyticsEvent, reaction, onFocused]);
|
|
101
|
+
const dismissTooltip = () => {
|
|
102
|
+
setIsTooltipEnabled(false);
|
|
103
|
+
};
|
|
104
|
+
const emojiAndCount = /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement("div", {
|
|
105
|
+
className: ax(["_8hrz1nam _vwz41crf _ca0q1b66 _u5f31b66 _n3td1b66 _19bvu2gc", reaction.count === 0 && "_ca0q1b66 _u5f3v77o _n3td1b66 _19bv19bv"])
|
|
106
|
+
}, /*#__PURE__*/React.createElement(ResourcedEmoji, {
|
|
107
|
+
emojiProvider: emojiProvider,
|
|
108
|
+
emojiId: emojiId,
|
|
109
|
+
fitToHeight: 16
|
|
110
|
+
})), /*#__PURE__*/React.createElement(Counter, {
|
|
111
|
+
value: reaction.count,
|
|
112
|
+
highlight: !isViewOnly && reaction.reacted
|
|
113
|
+
}));
|
|
114
|
+
return /*#__PURE__*/React.createElement(Box, {
|
|
115
|
+
xcss: styles.container
|
|
116
|
+
}, showParticleEffect && /*#__PURE__*/React.createElement(ReactionParticleEffect, {
|
|
117
|
+
emojiId: emojiId,
|
|
118
|
+
emojiProvider: emojiProvider
|
|
119
|
+
}), /*#__PURE__*/React.createElement(ReactionTooltip, {
|
|
120
|
+
emojiName: emojiName,
|
|
121
|
+
reaction: reaction,
|
|
122
|
+
isEnabled: isTooltipEnabled,
|
|
123
|
+
allowUserDialog: allowUserDialog,
|
|
124
|
+
handleOpenReactionsDialog: handleOpenReactionsDialog,
|
|
125
|
+
dismissTooltip: dismissTooltip
|
|
126
|
+
}, isViewOnly ? /*#__PURE__*/React.createElement(StaticReaction, {
|
|
127
|
+
onMouseEnter: handleMouseEnter,
|
|
128
|
+
onFocus: handleFocused,
|
|
129
|
+
testId: RENDER_REACTION_TESTID,
|
|
130
|
+
dataAttributes: {
|
|
131
|
+
'data-emoji-id': reaction.emojiId
|
|
132
|
+
}
|
|
133
|
+
}, emojiAndCount) : /*#__PURE__*/React.createElement(ReactionButton, {
|
|
134
|
+
onClick: handleClick,
|
|
135
|
+
flash: flash,
|
|
136
|
+
ariaLabel: intl.formatMessage(messages.reactWithEmoji, {
|
|
137
|
+
emoji: emojiName
|
|
138
|
+
}),
|
|
139
|
+
ariaPressed: reacted,
|
|
140
|
+
onMouseEnter: handleMouseEnter,
|
|
141
|
+
onFocus: handleFocused,
|
|
142
|
+
testId: RENDER_REACTION_TESTID,
|
|
143
|
+
dataAttributes: {
|
|
144
|
+
'data-emoji-id': reaction.emojiId,
|
|
145
|
+
'data-emoji-button-id': reaction.emojiId
|
|
146
|
+
},
|
|
147
|
+
showOpaqueBackground: showOpaqueBackground,
|
|
148
|
+
showSubtleStyle: showSubtleStyle,
|
|
149
|
+
reacted: reacted
|
|
150
|
+
}, emojiAndCount)));
|
|
151
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko14q2{border-radius:var(--ds-border-radius-circle,2002pc)}
|
|
3
|
+
._2rko19bv{border-radius:10px}
|
|
4
|
+
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
5
|
+
._2rkogqwt{border-radius:var(--ds-border-radius-050,2px)}
|
|
6
|
+
._189ee4h9{border-width:var(--ds-border-width,1px)}
|
|
7
|
+
._1dqonqa1{border-style:solid}
|
|
8
|
+
._1h6d1yqz{border-color:var(--ds-border-selected,#0c66e4)}
|
|
9
|
+
._1h6dmuej{border-color:var(--ds-border,#091e4224)}
|
|
10
|
+
._1kl7glyw{border-left:none}
|
|
11
|
+
._1s7zglyw{border-right:none}
|
|
12
|
+
._n7zlglyw{border-bottom:none}
|
|
13
|
+
._x3doglyw{border-top:none}._12l21b66{margin-inline-end:var(--ds-space-050,4px)}
|
|
14
|
+
._18m915vq{overflow-y:hidden}
|
|
15
|
+
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
16
|
+
._1e0c1txw{display:flex}
|
|
17
|
+
._1pfh1b66{margin-block-start:var(--ds-space-050,4px)}
|
|
18
|
+
._1reo15vq{overflow-x:hidden}
|
|
19
|
+
._1ul914no{min-width:36px}
|
|
20
|
+
._2lx2vrvc{flex-direction:row}
|
|
21
|
+
._4cvr1h6o{align-items:center}
|
|
22
|
+
._4cvr1y6m{align-items:flex-start}
|
|
23
|
+
._4t3i1tcg{height:24px}
|
|
24
|
+
._4t3iqslr{height:22px}
|
|
25
|
+
._bfhkfg4m{background-color:var(--ds-background-selected,#e9f2ff)}
|
|
26
|
+
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
27
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
28
|
+
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
29
|
+
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
30
|
+
._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
|
|
31
|
+
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
32
|
+
._irr3108i:hover{background-color:var(--ds-surface-hovered,#f1f2f4)}
|
|
33
|
+
._irr3166n:hover{background-color:var(--ds-background-neutral-subtle-hovered,#091e420f)}
|
|
34
|
+
._irr3i1yw:hover{background-color:var(--ds-background-selected-hovered,#cce0ff)}
|
|
35
|
+
._1di619ru:active{background-color:var(--ds-background-selected-pressed,#85b8ff)}
|
|
36
|
+
._1di61dty:active{background-color:var(--ds-background-neutral-subtle-pressed,#091e4224)}
|
|
37
|
+
._1di61ji5:active{background-color:var(--ds-surface-pressed,#dcdfe4)}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/* ReactionButton.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./ReactionButton.compiled.css";
|
|
4
|
+
import * as React from 'react';
|
|
5
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
+
import { cx } from '@compiled/react';
|
|
7
|
+
import { FlashAnimation } from './FlashAnimation';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
10
|
+
const styles = {
|
|
11
|
+
reactionButton: "_2rko14q2 _1reo15vq _18m915vq _189ee4h9 _1dqonqa1 _1h6dmuej _1e0c1txw _2lx2vrvc _4cvr1y6m _1ul914no _4t3i1tcg _bfhksm61 _syaz1gjq _1pfh1b66 _12l21b66 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _irr3166n _1di61dty",
|
|
12
|
+
reactionStylesRefresh: "_2rkoglpi",
|
|
13
|
+
borderless: "_x3doglyw _1kl7glyw _1s7zglyw _n7zlglyw",
|
|
14
|
+
reacted: "_1h6d1yqz _bfhkfg4m _irr3i1yw _1di619ru",
|
|
15
|
+
opaqueBackground: "_bfhkvuon _irr3108i _1di61ji5"
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Default styling px height for an emoji reaction
|
|
20
|
+
*/
|
|
21
|
+
const akHeight = 24;
|
|
22
|
+
const flashHeight = akHeight - 2; // height without the 1px border
|
|
23
|
+
|
|
24
|
+
const flashStyle = null;
|
|
25
|
+
const flashStyleOld = null;
|
|
26
|
+
export const ReactionButton = ({
|
|
27
|
+
onClick,
|
|
28
|
+
flash = false,
|
|
29
|
+
showSubtleStyle,
|
|
30
|
+
showOpaqueBackground,
|
|
31
|
+
reacted,
|
|
32
|
+
ariaLabel,
|
|
33
|
+
ariaPressed,
|
|
34
|
+
onMouseEnter,
|
|
35
|
+
onFocus,
|
|
36
|
+
children,
|
|
37
|
+
dataAttributes = {},
|
|
38
|
+
testId
|
|
39
|
+
}) => {
|
|
40
|
+
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
41
|
+
onClick: onClick,
|
|
42
|
+
onMouseEnter: onMouseEnter,
|
|
43
|
+
onFocus: onFocus,
|
|
44
|
+
"aria-label": ariaLabel,
|
|
45
|
+
"aria-pressed": ariaPressed,
|
|
46
|
+
testId: testId,
|
|
47
|
+
xcss: cx(styles.reactionButton, reacted && styles.reacted, !reacted && showSubtleStyle && styles.borderless, !reacted && showOpaqueBackground && styles.opaqueBackground,
|
|
48
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
49
|
+
fg('platform-component-visual-refresh') && styles.reactionStylesRefresh)
|
|
50
|
+
}, dataAttributes), /*#__PURE__*/React.createElement(FlashAnimation, {
|
|
51
|
+
flash: flash
|
|
52
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
53
|
+
,
|
|
54
|
+
className: ax([fg('platform-component-visual-refresh') ? "_2rkogqwt _1e0c1txw _2lx2vrvc _4cvr1h6o _4t3iqslr" : "_2rko19bv _1e0c1txw _2lx2vrvc _4cvr1h6o _4t3iqslr"])
|
|
55
|
+
}, children));
|
|
56
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
|
|
2
|
+
._y44vik89{animation:k102rpwx ease-in-out,k4txmy4 ease}._154iidpf{top:0}
|
|
3
|
+
._1lac188d:nth-child(3){animation-delay:.3s}
|
|
4
|
+
._1ltvftgi{left:8px}
|
|
5
|
+
._1ltvidpf{left:0}
|
|
6
|
+
._1pbyifev{z-index:10000}
|
|
7
|
+
._1qen1lpd:nth-child(2){left:-5px}
|
|
8
|
+
._5sagpwmj{animation-duration:.7s}
|
|
9
|
+
._7vm81dfm:nth-child(4){animation-delay:.45s}
|
|
10
|
+
._91vyftgi:nth-child(3){left:8px}
|
|
11
|
+
._jsy51n1a:nth-child(4){left:-1px}
|
|
12
|
+
._kqswh2mm{position:relative}
|
|
13
|
+
._kqswstnw{position:absolute}
|
|
14
|
+
._lcxvglyw{pointer-events:none}
|
|
15
|
+
._tzy4idpf{opacity:0}
|
|
16
|
+
._xg4k6ebc:nth-child(2){animation-delay:.15s}
|
|
17
|
+
@keyframes k102rpwx{0%{opacity:0}20%{opacity:1}60%{opacity:1}to{opacity:0}}
|
|
18
|
+
@keyframes k4txmy4{0%{transform:translateY(0) scale(1)}to{transform:translateY(-90pt) scale(1.7)}}
|
|
19
|
+
@media (prefers-reduced-motion:reduce){._m602idpf{opacity:0}}
|