@atlaskit/reactions 30.0.1 → 30.0.3
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 +14 -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/ShowMore/ShowMore.js +4 -10
- package/dist/cjs/components/compiled/EmojiButton.compiled.css +17 -0
- package/dist/cjs/components/compiled/EmojiButton.js +48 -0
- package/dist/cjs/components/compiled/ReactionButton.compiled.css +4 -5
- package/dist/cjs/components/compiled/ReactionButton.js +5 -3
- package/dist/cjs/components/compiled/ReactionPicker.compiled.css +11 -0
- package/dist/cjs/components/compiled/ReactionPicker.js +325 -0
- package/dist/cjs/components/compiled/ReactionSummaryButton.compiled.css +7 -0
- package/dist/cjs/components/compiled/ReactionSummaryButton.js +110 -0
- package/dist/cjs/components/compiled/ReactionSummaryView.compiled.css +5 -0
- package/dist/cjs/components/compiled/ReactionSummaryView.js +117 -0
- package/dist/cjs/components/compiled/Reactions.js +4 -4
- package/dist/cjs/components/compiled/Selector.compiled.css +13 -0
- package/dist/cjs/components/compiled/Selector.js +81 -0
- package/dist/cjs/components/compiled/StaticReaction.compiled.css +3 -1
- package/dist/cjs/components/compiled/StaticReaction.js +3 -4
- package/dist/cjs/components/compiled/Trigger.compiled.css +34 -0
- package/dist/cjs/components/compiled/Trigger.js +100 -0
- package/dist/cjs/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +5 -1
- package/dist/cjs/index.js +3 -7
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/ShowMore/ShowMore.js +3 -8
- package/dist/es2019/components/compiled/EmojiButton.compiled.css +17 -0
- package/dist/es2019/components/compiled/EmojiButton.js +40 -0
- package/dist/es2019/components/compiled/ReactionButton.compiled.css +4 -5
- package/dist/es2019/components/compiled/ReactionButton.js +5 -3
- package/dist/es2019/components/compiled/ReactionPicker.compiled.css +11 -0
- package/dist/es2019/components/compiled/ReactionPicker.js +295 -0
- package/dist/es2019/components/compiled/ReactionSummaryButton.compiled.css +7 -0
- package/dist/es2019/components/compiled/ReactionSummaryButton.js +88 -0
- package/dist/es2019/components/compiled/ReactionSummaryView.compiled.css +5 -0
- package/dist/es2019/components/compiled/ReactionSummaryView.js +87 -0
- package/dist/es2019/components/compiled/Reactions.js +3 -3
- package/dist/es2019/components/compiled/Selector.compiled.css +14 -0
- package/dist/es2019/components/compiled/Selector.js +69 -0
- package/dist/es2019/components/compiled/StaticReaction.compiled.css +3 -1
- package/dist/es2019/components/compiled/StaticReaction.js +4 -5
- package/dist/es2019/components/compiled/Trigger.compiled.css +34 -0
- package/dist/es2019/components/compiled/Trigger.js +90 -0
- package/dist/es2019/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +5 -1
- package/dist/es2019/index.js +6 -2
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/ShowMore/ShowMore.js +4 -9
- package/dist/esm/components/compiled/EmojiButton.compiled.css +17 -0
- package/dist/esm/components/compiled/EmojiButton.js +39 -0
- package/dist/esm/components/compiled/ReactionButton.compiled.css +4 -5
- package/dist/esm/components/compiled/ReactionButton.js +5 -3
- package/dist/esm/components/compiled/ReactionPicker.compiled.css +11 -0
- package/dist/esm/components/compiled/ReactionPicker.js +316 -0
- package/dist/esm/components/compiled/ReactionSummaryButton.compiled.css +7 -0
- package/dist/esm/components/compiled/ReactionSummaryButton.js +100 -0
- package/dist/esm/components/compiled/ReactionSummaryView.compiled.css +5 -0
- package/dist/esm/components/compiled/ReactionSummaryView.js +107 -0
- package/dist/esm/components/compiled/Reactions.js +3 -3
- package/dist/esm/components/compiled/Selector.compiled.css +13 -0
- package/dist/esm/components/compiled/Selector.js +71 -0
- package/dist/esm/components/compiled/StaticReaction.compiled.css +3 -1
- package/dist/esm/components/compiled/StaticReaction.js +4 -5
- package/dist/esm/components/compiled/Trigger.compiled.css +34 -0
- package/dist/esm/components/compiled/Trigger.js +93 -0
- package/dist/esm/containers/ConnectedReactionPicker/ConnectedReactionPicker.js +5 -1
- package/dist/esm/index.js +6 -2
- package/dist/types/components/ShowMore/ShowMore.d.ts +2 -7
- package/dist/types/components/compiled/EmojiButton.d.ts +21 -0
- package/dist/types/components/compiled/ReactionButton.d.ts +2 -1
- package/dist/types/components/compiled/ReactionPicker.d.ts +100 -0
- package/dist/types/components/compiled/ReactionSummaryButton.d.ts +34 -0
- package/dist/types/components/compiled/ReactionSummaryView.d.ts +58 -0
- package/dist/types/components/compiled/Reactions.d.ts +2 -2
- package/dist/types/components/compiled/Selector.d.ts +33 -0
- package/dist/types/components/compiled/Trigger.d.ts +64 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types-ts4.5/components/ShowMore/ShowMore.d.ts +2 -7
- package/dist/types-ts4.5/components/compiled/EmojiButton.d.ts +21 -0
- package/dist/types-ts4.5/components/compiled/ReactionButton.d.ts +2 -1
- package/dist/types-ts4.5/components/compiled/ReactionPicker.d.ts +100 -0
- package/dist/types-ts4.5/components/compiled/ReactionSummaryButton.d.ts +34 -0
- package/dist/types-ts4.5/components/compiled/ReactionSummaryView.d.ts +58 -0
- package/dist/types-ts4.5/components/compiled/Reactions.d.ts +2 -2
- package/dist/types-ts4.5/components/compiled/Selector.d.ts +33 -0
- package/dist/types-ts4.5/components/compiled/Trigger.d.ts +64 -0
- package/dist/types-ts4.5/index.d.ts +4 -2
- package/package.json +4 -3
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
/* Selector.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./Selector.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { Fragment } from 'react';
|
|
6
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
7
|
+
import { DefaultReactions } from '../../shared/constants';
|
|
8
|
+
import { EmojiButton } from './EmojiButton';
|
|
9
|
+
import { ShowMore } from '../ShowMore';
|
|
10
|
+
import { Box, Inline } from '@atlaskit/primitives/compiled';
|
|
11
|
+
const styles = {
|
|
12
|
+
container: "_ca0q1b66 _u5f31b66 _n3td1b66 _19bv1b66",
|
|
13
|
+
separator: "_t6vde4h9 _5wramuej _1p3lnqa1 _ahbq1b66 _12l2u2gc _4t3i1tcg _1e0c1o8l"
|
|
14
|
+
};
|
|
15
|
+
const revealAnimation = null;
|
|
16
|
+
const revealStyle = null;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Test id for wrapper Selector div
|
|
20
|
+
*/
|
|
21
|
+
export const RENDER_SELECTOR_TESTID = 'render-selector';
|
|
22
|
+
const Reveal = ({
|
|
23
|
+
children,
|
|
24
|
+
testId
|
|
25
|
+
}) => {
|
|
26
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
27
|
+
"data-testid": testId,
|
|
28
|
+
className: ax(["_y44v8out _tzy4idpf"])
|
|
29
|
+
}, children);
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Reactions picker panel part of the <ReactionPicker /> component
|
|
34
|
+
*/
|
|
35
|
+
export const Selector = ({
|
|
36
|
+
emojiProvider,
|
|
37
|
+
onMoreClick,
|
|
38
|
+
onSelection,
|
|
39
|
+
showMore,
|
|
40
|
+
pickerQuickReactionEmojiIds = DefaultReactions
|
|
41
|
+
}) => {
|
|
42
|
+
/**
|
|
43
|
+
* Render the default emoji icon
|
|
44
|
+
* @param emoji emoji item
|
|
45
|
+
* @param index location of the emoji in the array
|
|
46
|
+
*/
|
|
47
|
+
const renderEmoji = (emoji, index) => {
|
|
48
|
+
var _emoji$id;
|
|
49
|
+
return /*#__PURE__*/React.createElement(Reveal, {
|
|
50
|
+
key: (_emoji$id = emoji.id) !== null && _emoji$id !== void 0 ? _emoji$id : emoji.shortName,
|
|
51
|
+
testId: RENDER_SELECTOR_TESTID
|
|
52
|
+
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
53
|
+
content: emoji.shortName
|
|
54
|
+
}, /*#__PURE__*/React.createElement(EmojiButton, {
|
|
55
|
+
emojiId: emoji,
|
|
56
|
+
emojiProvider: emojiProvider,
|
|
57
|
+
onClick: onSelection
|
|
58
|
+
})));
|
|
59
|
+
};
|
|
60
|
+
return /*#__PURE__*/React.createElement(Inline, {
|
|
61
|
+
alignBlock: "center",
|
|
62
|
+
xcss: styles.container
|
|
63
|
+
}, pickerQuickReactionEmojiIds ? pickerQuickReactionEmojiIds.map(renderEmoji) : null, showMore ? /*#__PURE__*/React.createElement(Fragment, null, /*#__PURE__*/React.createElement(Box, {
|
|
64
|
+
xcss: styles.separator
|
|
65
|
+
}), /*#__PURE__*/React.createElement(Reveal, null, /*#__PURE__*/React.createElement(ShowMore, {
|
|
66
|
+
key: "more",
|
|
67
|
+
onClick: onMoreClick
|
|
68
|
+
}))) : null);
|
|
69
|
+
};
|
|
@@ -10,8 +10,10 @@
|
|
|
10
10
|
._2lx2vrvc{flex-direction:row}
|
|
11
11
|
._4cvr1y6m{align-items:flex-start}
|
|
12
12
|
._4t3i1tcg{height:24px}
|
|
13
|
+
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
13
14
|
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
14
15
|
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
15
16
|
._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
|
|
16
17
|
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
17
|
-
._d0al73ad:hover{cursor:default}
|
|
18
|
+
._d0al73ad:hover{cursor:default}
|
|
19
|
+
._irr3166n:hover{background-color:var(--ds-background-neutral-subtle-hovered,#091e420f)}
|
|
@@ -3,9 +3,9 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
3
3
|
import "./StaticReaction.compiled.css";
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { ax, ix } from "@compiled/react/runtime";
|
|
6
|
-
import {
|
|
6
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
7
7
|
const styles = {
|
|
8
|
-
staticReaction: "_1reo15vq _18m915vq _19itglyw _2rkoglpi _1e0c1txw _2lx2vrvc _4cvr1y6m _1ul914no _4t3i1tcg _syaz1gjq _1pfh1b66 _12l21b66 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _d0al73ad"
|
|
8
|
+
staticReaction: "_1reo15vq _18m915vq _19itglyw _2rkoglpi _1e0c1txw _2lx2vrvc _4cvr1y6m _1ul914no _4t3i1tcg _bfhksm61 _syaz1gjq _1pfh1b66 _12l21b66 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _d0al73ad _irr3166n"
|
|
9
9
|
};
|
|
10
10
|
export const StaticReaction = ({
|
|
11
11
|
onMouseEnter,
|
|
@@ -14,11 +14,10 @@ export const StaticReaction = ({
|
|
|
14
14
|
testId,
|
|
15
15
|
dataAttributes = {}
|
|
16
16
|
}) => {
|
|
17
|
-
return /*#__PURE__*/React.createElement(
|
|
17
|
+
return /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
18
18
|
onMouseEnter: onMouseEnter,
|
|
19
19
|
onFocus: onFocus,
|
|
20
20
|
testId: testId,
|
|
21
|
-
xcss: styles.staticReaction
|
|
22
|
-
backgroundColor: "color.background.neutral.subtle"
|
|
21
|
+
xcss: styles.staticReaction
|
|
23
22
|
}, dataAttributes), children);
|
|
24
23
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
._11c8dcr7{font:var(--ds-font-body-UNSAFE_small,normal 400 9pt/1pc ui-sans-serif,-apple-system,BlinkMacSystemFont,"Segoe UI",Ubuntu,"Helvetica Neue",sans-serif)}
|
|
2
|
+
._2rko14q2{border-radius:var(--ds-border-radius-circle,2002pc)}
|
|
3
|
+
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
4
|
+
._189ee4h9{border-width:var(--ds-border-width,1px)}
|
|
5
|
+
._1dqoglyw{border-style:none}
|
|
6
|
+
._1dqonqa1{border-style:solid}
|
|
7
|
+
._1h6d13gt{border-color:var(--ds-border-disabled,#091e420f)}
|
|
8
|
+
._1h6dmuej{border-color:var(--ds-border,#091e4224)}
|
|
9
|
+
._18u01b66{margin-left:var(--ds-space-050,4px)}
|
|
10
|
+
._19bv1b66{padding-left:var(--ds-space-050,4px)}
|
|
11
|
+
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
12
|
+
._1bah1h6o{justify-content:center}
|
|
13
|
+
._1bsbviql{width:2rem}
|
|
14
|
+
._1e0c1txw{display:flex}
|
|
15
|
+
._1ul9146b{min-width:110px}
|
|
16
|
+
._1ul91tcg{min-width:24px}
|
|
17
|
+
._1ul9zwfg{min-width:2pc}
|
|
18
|
+
._4cvr1h6o{align-items:center}
|
|
19
|
+
._4t3i1tcg{height:24px}
|
|
20
|
+
._4t3iviql{height:2rem}
|
|
21
|
+
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
22
|
+
._bfhksyzs{background-color:var(--ds-background-disabled,#091e4208)}
|
|
23
|
+
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
24
|
+
._ca0q1b66{padding-top:var(--ds-space-050,4px)}
|
|
25
|
+
._ca0qze3t{padding-top:var(--ds-space-0,0)}
|
|
26
|
+
._n3td1b66{padding-bottom:var(--ds-space-050,4px)}
|
|
27
|
+
._n3tdze3t{padding-bottom:var(--ds-space-0,0)}
|
|
28
|
+
._syaz1gjq{color:var(--ds-text-subtle,#44546f)}
|
|
29
|
+
._u5f31b66{padding-right:var(--ds-space-050,4px)}
|
|
30
|
+
._u5f3ze3t{padding-right:var(--ds-space-0,0)}
|
|
31
|
+
._irr3108i:hover{background-color:var(--ds-surface-hovered,#f1f2f4)}
|
|
32
|
+
._irr3166n:hover{background-color:var(--ds-background-neutral-subtle-hovered,#091e420f)}
|
|
33
|
+
._1di61dty:active{background-color:var(--ds-background-neutral-subtle-pressed,#091e4224)}
|
|
34
|
+
._1di61ji5:active{background-color:var(--ds-surface-pressed,#dcdfe4)}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
/* Trigger.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
import "./Trigger.compiled.css";
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { defineMessages, useIntl } from 'react-intl-next';
|
|
6
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
7
|
+
import EmojiAddIcon from '@atlaskit/icon/core/migration/emoji-add';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
9
|
+
import { Box, Pressable } from '@atlaskit/primitives/compiled';
|
|
10
|
+
import { cx } from '@compiled/react';
|
|
11
|
+
import React from 'react';
|
|
12
|
+
const styles = {
|
|
13
|
+
trigger: "_2rko14q2 _189ee4h9 _1dqonqa1 _1ul9zwfg _4t3i1tcg _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _1e0c1txw _1bah1h6o _4cvr1h6o",
|
|
14
|
+
subtleTrigger: "_1dqoglyw _1ul91tcg",
|
|
15
|
+
expandedTrigger: "_1ul9146b",
|
|
16
|
+
triggerStylesRefresh: "_2rkoglpi",
|
|
17
|
+
roundTrigger: "_2rko14q2 _4t3iviql _1bsbviql",
|
|
18
|
+
transparentEnabledTrigger: "_1h6dmuej _bfhksm61 _irr3166n _1di61dty",
|
|
19
|
+
opaqueEnabledTrigger: "_1h6dmuej _bfhkvuon _irr3108i _1di61ji5",
|
|
20
|
+
disabledTrigger: "_1h6d13gt _bfhksyzs",
|
|
21
|
+
miniMode: "_2rkoglpi _1dqoglyw _1ul91tcg _ca0q1b66 _u5f31b66 _n3td1b66 _19bv1b66"
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Test id for the tooltip
|
|
26
|
+
*/
|
|
27
|
+
export const RENDER_TOOLTIP_TRIGGER_TESTID = 'render-tooltip-trigger';
|
|
28
|
+
export const RENDER_TRIGGER_BUTTON_TESTID = 'render-trigger-button';
|
|
29
|
+
const i18n = defineMessages({
|
|
30
|
+
addReaction: {
|
|
31
|
+
id: 'reaction-picker-trigger.add.reaction.message',
|
|
32
|
+
description: 'Message displayed when there are no page reactions existing on the page.',
|
|
33
|
+
defaultMessage: 'Add a reaction'
|
|
34
|
+
}
|
|
35
|
+
});
|
|
36
|
+
const addReactionStyles = {
|
|
37
|
+
addReactionMessage: "_11c8dcr7 _syaz1gjq _18u01b66"
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Render an emoji button to open the reactions select picker
|
|
42
|
+
*/
|
|
43
|
+
export const Trigger = /*#__PURE__*/React.forwardRef((props, ref) => {
|
|
44
|
+
const {
|
|
45
|
+
formatMessage
|
|
46
|
+
} = useIntl();
|
|
47
|
+
const {
|
|
48
|
+
onClick,
|
|
49
|
+
miniMode,
|
|
50
|
+
tooltipContent,
|
|
51
|
+
disabled = false,
|
|
52
|
+
ariaAttributes = {},
|
|
53
|
+
showOpaqueBackground = false,
|
|
54
|
+
showAddReactionText = false,
|
|
55
|
+
subtleReactionsSummaryAndPicker = false,
|
|
56
|
+
showRoundTrigger = false,
|
|
57
|
+
reactionPickerTriggerIcon
|
|
58
|
+
} = props;
|
|
59
|
+
const handleMouseDown = (e, analyticsEvent) => {
|
|
60
|
+
if (onClick && !disabled) {
|
|
61
|
+
onClick(e, analyticsEvent);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
65
|
+
testId: RENDER_TOOLTIP_TRIGGER_TESTID,
|
|
66
|
+
content: tooltipContent
|
|
67
|
+
}, /*#__PURE__*/React.createElement(Pressable, _extends({
|
|
68
|
+
testId: RENDER_TRIGGER_BUTTON_TESTID,
|
|
69
|
+
xcss: cx(styles.trigger, subtleReactionsSummaryAndPicker && styles.subtleTrigger, showAddReactionText && styles.expandedTrigger, disabled ? styles.disabledTrigger : showOpaqueBackground ? styles.opaqueEnabledTrigger : styles.transparentEnabledTrigger, miniMode && styles.miniMode,
|
|
70
|
+
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
71
|
+
fg('platform-component-visual-refresh') && styles.triggerStylesRefresh, showRoundTrigger && styles.roundTrigger),
|
|
72
|
+
style: {
|
|
73
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop, @atlaskit/design-system/use-tokens-typography
|
|
74
|
+
lineHeight: '16px'
|
|
75
|
+
},
|
|
76
|
+
onClick: handleMouseDown,
|
|
77
|
+
isDisabled: disabled,
|
|
78
|
+
ref: ref
|
|
79
|
+
}, ariaAttributes), !!reactionPickerTriggerIcon ? reactionPickerTriggerIcon :
|
|
80
|
+
/*#__PURE__*/
|
|
81
|
+
// TODO: https://product-fabric.atlassian.net/browse/DSP-21007
|
|
82
|
+
React.createElement(EmojiAddIcon, {
|
|
83
|
+
testId: "emoji-add-icon",
|
|
84
|
+
color: disabled ? "var(--ds-icon-disabled, #091E424F)" : "var(--ds-icon, #44546F)",
|
|
85
|
+
LEGACY_size: "small",
|
|
86
|
+
label: "Add reaction"
|
|
87
|
+
}), showAddReactionText && /*#__PURE__*/React.createElement(Box, {
|
|
88
|
+
xcss: cx(addReactionStyles.addReactionMessage)
|
|
89
|
+
}, formatMessage(i18n.addReaction))));
|
|
90
|
+
});
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { UfoErrorBoundary } from '../../components';
|
|
4
4
|
import { PickerRender } from '../../ufo';
|
|
5
|
+
import { ReactionPicker as EmotionReactionPicker } from '../../components/ReactionPicker';
|
|
6
|
+
import { ReactionPicker as CompiledReactionPicker } from '../../components/compiled/ReactionPicker';
|
|
7
|
+
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
8
|
+
const ReactionPicker = componentWithFG('platform_editor_css_migrate_reactions', CompiledReactionPicker, EmotionReactionPicker);
|
|
5
9
|
/**
|
|
6
10
|
* Reaction Picker component
|
|
7
11
|
*/
|
package/dist/es2019/index.js
CHANGED
|
@@ -4,12 +4,16 @@ import { Reaction as EmotionReaction } from './components/Reaction';
|
|
|
4
4
|
import { Reaction as CompiledReaction } from './components/compiled/Reaction';
|
|
5
5
|
import { Reactions as EmotionReactions } from './components/Reactions';
|
|
6
6
|
import { Reactions as CompiledReactions } from './components/compiled/Reactions';
|
|
7
|
+
import { ReactionPicker as EmotionReactionPicker } from './components/ReactionPicker/ReactionPicker';
|
|
8
|
+
import { ReactionPicker as CompiledReactionPicker } from './components/ReactionPicker/ReactionPicker';
|
|
7
9
|
import { componentWithFG } from '@atlaskit/platform-feature-flags-react';
|
|
8
10
|
const Reaction = componentWithFG('platform_editor_css_migrate_reactions', CompiledReaction, EmotionReaction);
|
|
9
11
|
const Reactions = componentWithFG('platform_editor_css_migrate_reactions', CompiledReactions, EmotionReactions);
|
|
12
|
+
const ReactionPicker = componentWithFG('platform_editor_css_migrate_reactions', CompiledReactionPicker, EmotionReactionPicker);
|
|
10
13
|
export { ReactionServiceClient } from './client';
|
|
11
|
-
export { Reaction
|
|
12
|
-
export {
|
|
14
|
+
export { Reaction };
|
|
15
|
+
export { Reactions };
|
|
16
|
+
export { ReactionPicker };
|
|
13
17
|
export { useCloseManager } from './hooks/useCloseManager';
|
|
14
18
|
export { ConnectedReactionPicker, ConnectedReactionsView } from './containers';
|
|
15
19
|
export { MemoryReactionsStore, ReactionConsumer } from './store';
|
|
@@ -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 = "30.0.
|
|
7
|
+
var packageVersion = "30.0.3";
|
|
8
8
|
/**
|
|
9
9
|
* TODO: move to utility package?
|
|
10
10
|
* A random sampling function
|
|
@@ -1,9 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* @jsxRuntime classic
|
|
3
|
-
* @jsx jsx
|
|
4
|
-
*/
|
|
5
|
-
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
6
|
-
import { jsx } from '@emotion/react';
|
|
1
|
+
import React from 'react';
|
|
7
2
|
import { FormattedMessage } from 'react-intl-next';
|
|
8
3
|
import { IconButton } from '@atlaskit/button/new';
|
|
9
4
|
import EditorMoreIcon from '@atlaskit/icon/core/migration/show-more-horizontal--editor-more';
|
|
@@ -19,10 +14,10 @@ export var RENDER_SHOWMORE_TESTID = 'show-more-button';
|
|
|
19
14
|
*/
|
|
20
15
|
export var ShowMore = function ShowMore(_ref) {
|
|
21
16
|
var onClick = _ref.onClick;
|
|
22
|
-
return
|
|
23
|
-
return
|
|
17
|
+
return /*#__PURE__*/React.createElement(FormattedMessage, messages.moreEmoji, function (message) {
|
|
18
|
+
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
24
19
|
content: message
|
|
25
|
-
},
|
|
20
|
+
}, /*#__PURE__*/React.createElement(IconButton, {
|
|
26
21
|
label: messages.moreEmoji.defaultMessage,
|
|
27
22
|
onClick: onClick,
|
|
28
23
|
testId: RENDER_SHOWMORE_TESTID,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
3
|
+
._189eidpf{border-width:0}._12ji1r31{outline-color:currentColor}
|
|
4
|
+
._12y31o36{outline-width:medium}
|
|
5
|
+
._18u0ze3t{margin-left:var(--ds-space-0,0)}
|
|
6
|
+
._19bvu2gc{padding-left:var(--ds-space-100,8px)}
|
|
7
|
+
._19pkze3t{margin-top:var(--ds-space-0,0)}
|
|
8
|
+
._1e0c1txw{display:flex}
|
|
9
|
+
._1qu2glyw{outline-style:none}
|
|
10
|
+
._2hwxze3t{margin-right:var(--ds-space-0,0)}
|
|
11
|
+
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
12
|
+
._ca0qu2gc{padding-top:var(--ds-space-100,8px)}
|
|
13
|
+
._n3tdu2gc{padding-bottom:var(--ds-space-100,8px)}
|
|
14
|
+
._otyrze3t{margin-bottom:var(--ds-space-0,0)}
|
|
15
|
+
._u5f3u2gc{padding-right:var(--ds-space-100,8px)}
|
|
16
|
+
._o7ksrkh3:hover{transition:transform .2s cubic-bezier(.23,1,.32,1)}
|
|
17
|
+
._1llw1q5f:hover{transform:scale(1.33)}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/* EmojiButton.tsx generated by @compiled/babel-plugin v0.36.1 */
|
|
2
|
+
import "./EmojiButton.compiled.css";
|
|
3
|
+
import * as React from 'react';
|
|
4
|
+
import { ax, ix } from "@compiled/react/runtime";
|
|
5
|
+
import { useIntl } from 'react-intl-next';
|
|
6
|
+
import { ResourcedEmoji } from '@atlaskit/emoji';
|
|
7
|
+
import { messages } from '../../shared/i18n';
|
|
8
|
+
import { isLeftClick } from '../../shared/utils';
|
|
9
|
+
import { Pressable } from '@atlaskit/primitives/compiled';
|
|
10
|
+
var styles = {
|
|
11
|
+
emojiButton: "_12ji1r31 _1qu2glyw _12y31o36 _2rkoglpi _189eidpf _1e0c1txw _bfhksm61 _19pkze3t _2hwxze3t _otyrze3t _18u0ze3t _ca0qu2gc _u5f3u2gc _n3tdu2gc _19bvu2gc _o7ksrkh3 _1llw1q5f"
|
|
12
|
+
};
|
|
13
|
+
export var RENDER_BUTTON_TESTID = 'button-emoji-id';
|
|
14
|
+
/**
|
|
15
|
+
* custom button to render the custom emoji selector inside the reaction picker
|
|
16
|
+
*/
|
|
17
|
+
export var EmojiButton = function EmojiButton(_ref) {
|
|
18
|
+
var emojiId = _ref.emojiId,
|
|
19
|
+
onClick = _ref.onClick,
|
|
20
|
+
emojiProvider = _ref.emojiProvider;
|
|
21
|
+
var onButtonClick = function onButtonClick(event) {
|
|
22
|
+
event.preventDefault();
|
|
23
|
+
if (onClick && isLeftClick(event)) {
|
|
24
|
+
onClick(emojiId, undefined, event);
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
var intl = useIntl();
|
|
28
|
+
return /*#__PURE__*/React.createElement(Pressable, {
|
|
29
|
+
testId: RENDER_BUTTON_TESTID,
|
|
30
|
+
onClick: onButtonClick,
|
|
31
|
+
"aria-label": intl.formatMessage(messages.reactWithEmoji, {
|
|
32
|
+
emoji: emojiId.shortName
|
|
33
|
+
}),
|
|
34
|
+
xcss: styles.emojiButton
|
|
35
|
+
}, /*#__PURE__*/React.createElement(ResourcedEmoji, {
|
|
36
|
+
emojiProvider: emojiProvider,
|
|
37
|
+
emojiId: emojiId
|
|
38
|
+
}));
|
|
39
|
+
};
|
|
@@ -4,15 +4,13 @@
|
|
|
4
4
|
._2rkoglpi{border-radius:var(--ds-border-radius,4px)}
|
|
5
5
|
._2rkogqwt{border-radius:var(--ds-border-radius-050,2px)}
|
|
6
6
|
._189ee4h9{border-width:var(--ds-border-width,1px)}
|
|
7
|
+
._1dqoglyw{border-style:none}
|
|
7
8
|
._1dqonqa1{border-style:solid}
|
|
8
9
|
._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)}
|
|
10
|
+
._1h6dmuej{border-color:var(--ds-border,#091e4224)}._12l21b66{margin-inline-end:var(--ds-space-050,4px)}
|
|
14
11
|
._18m915vq{overflow-y:hidden}
|
|
15
12
|
._19bvze3t{padding-left:var(--ds-space-0,0)}
|
|
13
|
+
._19pk12x7{margin-top:var(--ds-space-075,6px)}
|
|
16
14
|
._1e0c1txw{display:flex}
|
|
17
15
|
._1pfh1b66{margin-block-start:var(--ds-space-050,4px)}
|
|
18
16
|
._1reo15vq{overflow-x:hidden}
|
|
@@ -22,6 +20,7 @@
|
|
|
22
20
|
._4cvr1y6m{align-items:flex-start}
|
|
23
21
|
._4t3i1tcg{height:24px}
|
|
24
22
|
._4t3i3698{height:var(--_1ed2mu0)}
|
|
23
|
+
._4t3igktf{height:20px}
|
|
25
24
|
._bfhkfg4m{background-color:var(--ds-background-selected,#e9f2ff)}
|
|
26
25
|
._bfhksm61{background-color:var(--ds-background-neutral-subtle,#00000000)}
|
|
27
26
|
._bfhkvuon{background-color:var(--ds-surface,#fff)}
|
|
@@ -10,9 +10,10 @@ import { Pressable } from '@atlaskit/primitives/compiled';
|
|
|
10
10
|
var styles = {
|
|
11
11
|
reactionButton: "_2rko14q2 _1reo15vq _18m915vq _189ee4h9 _1dqonqa1 _1h6dmuej _1e0c1txw _2lx2vrvc _4cvr1y6m _1ul914no _4t3i1tcg _bfhksm61 _syaz1gjq _1pfh1b66 _12l21b66 _ca0qze3t _u5f3ze3t _n3tdze3t _19bvze3t _irr3166n _1di61dty",
|
|
12
12
|
reactionStylesRefresh: "_2rkoglpi",
|
|
13
|
-
borderless: "_x3doglyw _1kl7glyw _1s7zglyw _n7zlglyw",
|
|
14
13
|
reacted: "_1h6d1yqz _bfhkfg4m _irr3i1yw _1di619ru",
|
|
15
|
-
opaqueBackground: "_bfhkvuon _irr3108i _1di61ji5"
|
|
14
|
+
opaqueBackground: "_bfhkvuon _irr3108i _1di61ji5",
|
|
15
|
+
compactButton: "_4t3igktf _4cvr1h6o _19pk12x7",
|
|
16
|
+
borderless: "_1dqoglyw"
|
|
16
17
|
};
|
|
17
18
|
|
|
18
19
|
/**
|
|
@@ -29,6 +30,7 @@ export var ReactionButton = function ReactionButton(_ref) {
|
|
|
29
30
|
flash = _ref$flash === void 0 ? false : _ref$flash,
|
|
30
31
|
showSubtleStyle = _ref.showSubtleStyle,
|
|
31
32
|
showOpaqueBackground = _ref.showOpaqueBackground,
|
|
33
|
+
useCompactStyles = _ref.useCompactStyles,
|
|
32
34
|
reacted = _ref.reacted,
|
|
33
35
|
ariaLabel = _ref.ariaLabel,
|
|
34
36
|
ariaPressed = _ref.ariaPressed,
|
|
@@ -45,7 +47,7 @@ export var ReactionButton = function ReactionButton(_ref) {
|
|
|
45
47
|
"aria-label": ariaLabel,
|
|
46
48
|
"aria-pressed": ariaPressed,
|
|
47
49
|
testId: testId,
|
|
48
|
-
xcss: cx(styles.reactionButton, reacted && styles.reacted, !reacted && showSubtleStyle && styles.borderless, !reacted && showOpaqueBackground && styles.opaqueBackground,
|
|
50
|
+
xcss: cx(styles.reactionButton, useCompactStyles && styles.compactButton, reacted && styles.reacted, !reacted && showSubtleStyle && styles.borderless, !reacted && showOpaqueBackground && styles.opaqueBackground,
|
|
49
51
|
// eslint-disable-next-line @atlaskit/platform/ensure-feature-flag-prefix
|
|
50
52
|
fg('platform-component-visual-refresh') && styles.reactionStylesRefresh)
|
|
51
53
|
}, dataAttributes), /*#__PURE__*/React.createElement(FlashAnimation, {
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
|
|
2
|
+
._2rko1sit{border-radius:var(--ds-border-radius,3px)}._16qs1a23{box-shadow:var(--_3t1odq)}
|
|
3
|
+
._1bch1b66>div{margin-top:var(--ds-space-050,4px)}
|
|
4
|
+
._1e0c1txw{display:flex}
|
|
5
|
+
._1pra1o8l.miniMode{display:inline-block}
|
|
6
|
+
._79pa1b66>div{margin-bottom:var(--ds-space-050,4px)}
|
|
7
|
+
._bfhk13b4{background-color:var(--_1f6rtr1)}
|
|
8
|
+
._s7n4nkob{vertical-align:middle}
|
|
9
|
+
._1hvw1o36:focus{outline-width:medium}
|
|
10
|
+
._49pcglyw:focus{outline-style:none}
|
|
11
|
+
._nt751r31:focus{outline-color:currentColor}
|