@atlaskit/reactions 22.7.1 → 22.7.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 +1185 -1179
- package/afm-cc/tsconfig.json +3 -0
- package/dist/cjs/analytics/index.js +1 -1
- package/dist/cjs/components/Counter/Counter.js +18 -4
- package/dist/cjs/components/Counter/styles.js +8 -0
- package/dist/cjs/components/EmojiButton/EmojiButton.js +21 -5
- package/dist/cjs/components/FlashAnimation/FlashAnimation.js +6 -1
- package/dist/cjs/components/FlashAnimation/styles.js +8 -0
- package/dist/cjs/components/Reaction/Reaction.js +45 -8
- package/dist/cjs/components/Reaction/styles.js +12 -0
- package/dist/cjs/components/ReactionDialog/ReactionView.js +40 -28
- package/dist/cjs/components/ReactionDialog/ReactionsDialog.js +2 -0
- package/dist/cjs/components/ReactionDialog/ReactionsList.js +6 -1
- package/dist/cjs/components/ReactionDialog/styles.js +40 -1
- package/dist/cjs/components/ReactionParticleEffect/ReactionParticleEffect.js +20 -12
- package/dist/cjs/components/ReactionParticleEffect/styles.js +9 -0
- package/dist/cjs/components/ReactionPicker/ReactionPicker.js +19 -10
- package/dist/cjs/components/ReactionPicker/styles.js +13 -0
- package/dist/cjs/components/ReactionTooltip/ReactionTooltip.js +6 -1
- package/dist/cjs/components/ReactionTooltip/styles.js +12 -0
- package/dist/cjs/components/Reactions/Reactions.js +57 -44
- package/dist/cjs/components/Reactions/styles.js +7 -0
- package/dist/cjs/components/Selector/Selector.js +60 -31
- package/dist/cjs/components/Selector/styles.js +13 -20
- package/dist/cjs/components/ShowMore/ShowMore.js +14 -31
- package/dist/cjs/components/ShowMore/index.js +0 -6
- package/dist/cjs/components/Trigger/Trigger.js +6 -1
- package/dist/cjs/components/Trigger/styles.js +3 -1
- package/dist/es2019/analytics/index.js +1 -1
- package/dist/es2019/components/Counter/Counter.js +17 -4
- package/dist/es2019/components/Counter/styles.js +8 -0
- package/dist/es2019/components/EmojiButton/EmojiButton.js +20 -5
- package/dist/es2019/components/FlashAnimation/FlashAnimation.js +5 -1
- package/dist/es2019/components/FlashAnimation/styles.js +8 -0
- package/dist/es2019/components/Reaction/Reaction.js +45 -9
- package/dist/es2019/components/Reaction/styles.js +12 -0
- package/dist/es2019/components/ReactionDialog/ReactionView.js +39 -28
- package/dist/es2019/components/ReactionDialog/ReactionsDialog.js +1 -0
- package/dist/es2019/components/ReactionDialog/ReactionsList.js +5 -1
- package/dist/es2019/components/ReactionDialog/styles.js +40 -1
- package/dist/es2019/components/ReactionParticleEffect/ReactionParticleEffect.js +15 -9
- package/dist/es2019/components/ReactionParticleEffect/styles.js +9 -0
- package/dist/es2019/components/ReactionPicker/ReactionPicker.js +19 -9
- package/dist/es2019/components/ReactionPicker/styles.js +13 -0
- package/dist/es2019/components/ReactionTooltip/ReactionTooltip.js +5 -1
- package/dist/es2019/components/ReactionTooltip/styles.js +12 -0
- package/dist/es2019/components/Reactions/Reactions.js +55 -43
- package/dist/es2019/components/Reactions/styles.js +7 -0
- package/dist/es2019/components/Selector/Selector.js +55 -24
- package/dist/es2019/components/Selector/styles.js +12 -16
- package/dist/es2019/components/ShowMore/ShowMore.js +10 -25
- package/dist/es2019/components/ShowMore/index.js +1 -1
- package/dist/es2019/components/Trigger/Trigger.js +5 -1
- package/dist/es2019/components/Trigger/styles.js +5 -0
- package/dist/esm/analytics/index.js +1 -1
- package/dist/esm/components/Counter/Counter.js +17 -4
- package/dist/esm/components/Counter/styles.js +8 -0
- package/dist/esm/components/EmojiButton/EmojiButton.js +20 -5
- package/dist/esm/components/FlashAnimation/FlashAnimation.js +5 -1
- package/dist/esm/components/FlashAnimation/styles.js +8 -0
- package/dist/esm/components/Reaction/Reaction.js +45 -9
- package/dist/esm/components/Reaction/styles.js +12 -0
- package/dist/esm/components/ReactionDialog/ReactionView.js +39 -28
- package/dist/esm/components/ReactionDialog/ReactionsDialog.js +1 -0
- package/dist/esm/components/ReactionDialog/ReactionsList.js +5 -1
- package/dist/esm/components/ReactionDialog/styles.js +40 -1
- package/dist/esm/components/ReactionParticleEffect/ReactionParticleEffect.js +19 -12
- package/dist/esm/components/ReactionParticleEffect/styles.js +9 -0
- package/dist/esm/components/ReactionPicker/ReactionPicker.js +19 -9
- package/dist/esm/components/ReactionPicker/styles.js +13 -0
- package/dist/esm/components/ReactionTooltip/ReactionTooltip.js +5 -1
- package/dist/esm/components/ReactionTooltip/styles.js +12 -0
- package/dist/esm/components/Reactions/Reactions.js +56 -44
- package/dist/esm/components/Reactions/styles.js +7 -0
- package/dist/esm/components/Selector/Selector.js +61 -33
- package/dist/esm/components/Selector/styles.js +13 -19
- package/dist/esm/components/ShowMore/ShowMore.js +11 -28
- package/dist/esm/components/ShowMore/index.js +1 -1
- package/dist/esm/components/Trigger/Trigger.js +5 -1
- package/dist/esm/components/Trigger/styles.js +3 -0
- package/dist/types/components/EmojiButton/EmojiButton.d.ts +1 -1
- package/dist/types/components/Reaction/Reaction.d.ts +1 -5
- package/dist/types/components/ReactionDialog/ReactionView.d.ts +1 -1
- package/dist/types/components/ReactionTooltip/index.d.ts +1 -1
- package/dist/types/components/Selector/styles.d.ts +0 -7
- package/dist/types/components/ShowMore/ShowMore.d.ts +3 -21
- package/dist/types/components/ShowMore/index.d.ts +1 -1
- package/dist/types/containers/index.d.ts +1 -1
- package/dist/types/hooks/useFocusTrap.d.ts +1 -1
- package/dist/types-ts4.5/components/EmojiButton/EmojiButton.d.ts +1 -1
- package/dist/types-ts4.5/components/Reaction/Reaction.d.ts +1 -5
- package/dist/types-ts4.5/components/ReactionDialog/ReactionView.d.ts +1 -1
- package/dist/types-ts4.5/components/ReactionTooltip/index.d.ts +1 -1
- package/dist/types-ts4.5/components/Selector/styles.d.ts +0 -7
- package/dist/types-ts4.5/components/ShowMore/ShowMore.d.ts +3 -21
- package/dist/types-ts4.5/components/ShowMore/index.d.ts +1 -1
- package/dist/types-ts4.5/containers/index.d.ts +1 -1
- package/dist/types-ts4.5/hooks/useFocusTrap.d.ts +1 -1
- package/docs/0-intro.tsx +42 -48
- package/docs/1-connected-reaction-picker.tsx +25 -25
- package/docs/2-connected-reactions-view.tsx +25 -25
- package/docs/3-reactions-store.tsx +29 -30
- package/docs/4-reaction-service-client.tsx +5 -5
- package/docs/5-graphql-support.tsx +24 -26
- package/local-config-example.ts +3 -3
- package/package.json +109 -110
- package/report.api.md +241 -273
- package/dist/cjs/components/EmojiButton/styles.js +0 -23
- package/dist/cjs/components/ShowMore/styles.js +0 -36
- package/dist/es2019/components/EmojiButton/styles.js +0 -16
- package/dist/es2019/components/ShowMore/styles.js +0 -29
- package/dist/esm/components/EmojiButton/styles.js +0 -16
- package/dist/esm/components/ShowMore/styles.js +0 -29
- package/dist/types/components/EmojiButton/styles.d.ts +0 -1
- package/dist/types/components/ShowMore/styles.d.ts +0 -3
- package/dist/types-ts4.5/components/EmojiButton/styles.d.ts +0 -1
- package/dist/types-ts4.5/components/ShowMore/styles.d.ts +0 -3
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
5
|
import { jsx } from '@emotion/react';
|
|
5
6
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
7
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
8
|
import { ModalTransition } from '@atlaskit/modal-dialog';
|
|
8
|
-
import Button from '@atlaskit/button';
|
|
9
|
+
import Button from '@atlaskit/button/standard-button';
|
|
9
10
|
import Tooltip from '@atlaskit/tooltip';
|
|
10
11
|
import { createAndFireSafe, createPickerButtonClickedEvent, createPickerCancelledEvent, createPickerMoreClickedEvent, createReactionsRenderedEvent, createReactionSelectionEvent, isSampled } from '../../analytics';
|
|
11
12
|
import { SAMPLING_RATE_REACTIONS_RENDERED_EXP } from '../../shared/constants';
|
|
@@ -247,48 +248,59 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
247
248
|
});
|
|
248
249
|
return reactions.concat(items);
|
|
249
250
|
}, [quickReactionEmojis, reactions]);
|
|
250
|
-
return
|
|
251
|
-
css
|
|
252
|
-
"
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
251
|
+
return (
|
|
252
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
253
|
+
jsx("div", {
|
|
254
|
+
css: wrapperStyle,
|
|
255
|
+
"data-testid": RENDER_REACTIONS_TESTID
|
|
256
|
+
}, memorizedReactions.map(function (reaction) {
|
|
257
|
+
return jsx(Reaction, {
|
|
258
|
+
key: reaction.emojiId,
|
|
259
|
+
reaction: reaction,
|
|
260
|
+
emojiProvider: emojiProvider,
|
|
261
|
+
onClick: onReactionClick,
|
|
262
|
+
onMouseEnter: handleReactionMouseEnter,
|
|
263
|
+
onFocused: handleReactionFocused,
|
|
264
|
+
flash: flash[reaction.emojiId],
|
|
265
|
+
handleUserListClick: handleOpenReactionsDialog,
|
|
266
|
+
allowUserDialog: allowUserDialog,
|
|
267
|
+
showParticleEffect: particleEffectByEmoji[reaction.emojiId]
|
|
268
|
+
});
|
|
269
|
+
}), jsx(ReactionPicker
|
|
270
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
271
|
+
, {
|
|
272
|
+
css: reactionPickerStyle,
|
|
257
273
|
emojiProvider: emojiProvider,
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
emojiProvider: emojiProvider,
|
|
291
|
-
handleCloseReactionsDialog: handleCloseReactionsDialog,
|
|
292
|
-
handleSelectReaction: handleSelectReactionInDialog
|
|
293
|
-
})));
|
|
274
|
+
allowAllEmojis: allowAllEmojis,
|
|
275
|
+
pickerQuickReactionEmojiIds: pickerQuickReactionEmojiIds,
|
|
276
|
+
disabled: status !== ReactionStatus.ready,
|
|
277
|
+
onSelection: handleOnSelection,
|
|
278
|
+
onOpen: handlePickerOpen,
|
|
279
|
+
onCancel: handleOnCancel,
|
|
280
|
+
onShowMore: handleOnMore,
|
|
281
|
+
tooltipContent: getTooltip(status, errorMessage),
|
|
282
|
+
emojiPickerSize: emojiPickerSize,
|
|
283
|
+
miniMode: miniMode
|
|
284
|
+
}), allowUserDialog && reactions.length > 0 && jsx(Tooltip, {
|
|
285
|
+
content: jsx(FormattedMessage, messages.seeWhoReactedTooltip),
|
|
286
|
+
hideTooltipOnClick: true
|
|
287
|
+
}, jsx(Button
|
|
288
|
+
// TODO: (from codemod) "link" and "subtle-link" appearances are only available in LinkButton, please either provide a href prop then migrate to LinkButton, or remove the appearance from the default button.
|
|
289
|
+
// https://product-fabric.atlassian.net/browse/DSP-18982
|
|
290
|
+
, {
|
|
291
|
+
appearance: "subtle-link",
|
|
292
|
+
onClick: handleOpenAllReactionsDialog
|
|
293
|
+
// TODO: (from codemod) Buttons with "component", "css" or "style" prop can't be automatically migrated with codemods. Please migrate it manually.
|
|
294
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
295
|
+
,
|
|
296
|
+
css: seeWhoReactedStyle,
|
|
297
|
+
testId: RENDER_VIEWALL_REACTED_USERS_DIALOG
|
|
298
|
+
}, jsx(FormattedMessage, messages.seeWhoReacted))), jsx(ModalTransition, null, !!selectedEmojiId && jsx(ReactionsDialog, {
|
|
299
|
+
selectedEmojiId: selectedEmojiId,
|
|
300
|
+
reactions: memorizedReactions,
|
|
301
|
+
emojiProvider: emojiProvider,
|
|
302
|
+
handleCloseReactionsDialog: handleCloseReactionsDialog,
|
|
303
|
+
handleSelectReaction: handleSelectReactionInDialog
|
|
304
|
+
})))
|
|
305
|
+
);
|
|
294
306
|
});
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { css } from '@emotion/react';
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
3
5
|
export var reactionPickerStyle = css({
|
|
4
6
|
display: 'inline-block',
|
|
5
7
|
marginTop: "var(--ds-space-050, 4px)"
|
|
6
8
|
});
|
|
9
|
+
|
|
10
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
7
11
|
export var seeWhoReactedStyle = css({
|
|
8
12
|
height: '24px',
|
|
9
13
|
lineHeight: '24px',
|
|
@@ -12,6 +16,8 @@ export var seeWhoReactedStyle = css({
|
|
|
12
16
|
marginTop: "var(--ds-space-050, 4px)",
|
|
13
17
|
marginLeft: "var(--ds-space-050, 4px)"
|
|
14
18
|
});
|
|
19
|
+
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
15
21
|
export var wrapperStyle = css({
|
|
16
22
|
display: 'flex',
|
|
17
23
|
flexWrap: 'wrap',
|
|
@@ -19,6 +25,7 @@ export var wrapperStyle = css({
|
|
|
19
25
|
alignItems: 'center',
|
|
20
26
|
borderRadius: '15px',
|
|
21
27
|
marginTop: "var(--ds-space-negative-050, -4px)",
|
|
28
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors, @atlaskit/ui-styling-standard/no-unsafe-selectors -- Ignored via go/DSP-18766
|
|
22
29
|
'> :first-of-type > :first-of-type': {
|
|
23
30
|
marginLeft: 0
|
|
24
31
|
}
|
|
@@ -1,27 +1,60 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
2
|
/** @jsx jsx */
|
|
3
|
-
import React, { useEffect, useRef, useState } from 'react';
|
|
3
|
+
import React, { Fragment, useEffect, useRef, useState } from 'react';
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
5
|
import { jsx } from '@emotion/react';
|
|
6
|
+
import { Box, Inline, xcss } from '@atlaskit/primitives';
|
|
5
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
6
8
|
import { DefaultReactions } from '../../shared/constants';
|
|
7
9
|
import { EmojiButton } from '../EmojiButton';
|
|
8
10
|
import { ShowMore } from '../ShowMore';
|
|
9
|
-
import { emojiStyle, revealStyle
|
|
11
|
+
import { emojiStyle, revealStyle } from './styles';
|
|
10
12
|
|
|
11
13
|
/**
|
|
12
14
|
* Test id for wrapper Selector div
|
|
13
15
|
*/
|
|
14
16
|
export var RENDER_SELECTOR_TESTID = 'render-selector';
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Delay for each emoji reveal animation, in ms
|
|
20
|
+
*/
|
|
21
|
+
var REVEAL_DELAY = 50;
|
|
22
|
+
var containerStyles = xcss({
|
|
23
|
+
padding: 'space.050'
|
|
24
|
+
});
|
|
25
|
+
var separatorStyles = xcss({
|
|
26
|
+
borderLeftColor: 'color.border',
|
|
27
|
+
borderLeftStyle: 'solid',
|
|
28
|
+
borderLeftWidth: 'border.width',
|
|
29
|
+
marginInlineStart: 'space.050',
|
|
30
|
+
marginInlineEnd: 'space.100',
|
|
31
|
+
height: '24px',
|
|
32
|
+
display: 'inline-block'
|
|
33
|
+
});
|
|
34
|
+
var Reveal = function Reveal(_ref) {
|
|
35
|
+
var children = _ref.children,
|
|
36
|
+
delay = _ref.delay;
|
|
37
|
+
return jsx("div", {
|
|
38
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values
|
|
39
|
+
css: revealStyle
|
|
40
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/enforce-style-prop
|
|
41
|
+
,
|
|
42
|
+
style: delay ? {
|
|
43
|
+
animationDelay: "".concat(delay, "ms")
|
|
44
|
+
} : undefined
|
|
45
|
+
}, children);
|
|
46
|
+
};
|
|
47
|
+
|
|
15
48
|
/**
|
|
16
49
|
* Reactions picker panel part of the <ReactionPicker /> component
|
|
17
50
|
*/
|
|
18
|
-
export var Selector = function Selector(
|
|
19
|
-
var emojiProvider =
|
|
20
|
-
onMoreClick =
|
|
21
|
-
onSelection =
|
|
22
|
-
showMore =
|
|
23
|
-
|
|
24
|
-
pickerQuickReactionEmojiIds =
|
|
51
|
+
export var Selector = function Selector(_ref2) {
|
|
52
|
+
var emojiProvider = _ref2.emojiProvider,
|
|
53
|
+
onMoreClick = _ref2.onMoreClick,
|
|
54
|
+
onSelection = _ref2.onSelection,
|
|
55
|
+
showMore = _ref2.showMore,
|
|
56
|
+
_ref2$pickerQuickReac = _ref2.pickerQuickReactionEmojiIds,
|
|
57
|
+
pickerQuickReactionEmojiIds = _ref2$pickerQuickReac === void 0 ? DefaultReactions : _ref2$pickerQuickReac;
|
|
25
58
|
var _useState = useState(),
|
|
26
59
|
_useState2 = _slicedToArray(_useState, 2),
|
|
27
60
|
selection = _useState2[0],
|
|
@@ -54,16 +87,6 @@ export var Selector = function Selector(_ref) {
|
|
|
54
87
|
setSelection(item);
|
|
55
88
|
};
|
|
56
89
|
|
|
57
|
-
/**
|
|
58
|
-
* custom css styling for the emoji icon
|
|
59
|
-
* @param index location of the emoji in the rendered list of items
|
|
60
|
-
*/
|
|
61
|
-
var emojiStyleAnimation = function emojiStyleAnimation(index) {
|
|
62
|
-
return {
|
|
63
|
-
animationDelay: "".concat(index * 50, "ms")
|
|
64
|
-
};
|
|
65
|
-
};
|
|
66
|
-
|
|
67
90
|
/**
|
|
68
91
|
* Render the default emoji icon
|
|
69
92
|
* @param emoji emoji item
|
|
@@ -71,11 +94,15 @@ export var Selector = function Selector(_ref) {
|
|
|
71
94
|
*/
|
|
72
95
|
var renderEmoji = function renderEmoji(emoji, index) {
|
|
73
96
|
var _emoji$id;
|
|
74
|
-
return jsx(
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
97
|
+
return jsx(Reveal, {
|
|
98
|
+
delay: index * REVEAL_DELAY,
|
|
99
|
+
key: (_emoji$id = emoji.id) !== null && _emoji$id !== void 0 ? _emoji$id : emoji.shortName
|
|
100
|
+
}, jsx("div", {
|
|
101
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-classname-prop -- Ignored via go/DSP-18766
|
|
102
|
+
className: emoji === selection ? 'selected' : undefined
|
|
103
|
+
// eslint-disable-next-line @atlaskit/design-system/consistent-css-prop-usage, @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
104
|
+
,
|
|
105
|
+
css: emojiStyle,
|
|
79
106
|
"data-testid": RENDER_SELECTOR_TESTID
|
|
80
107
|
}, jsx(Tooltip, {
|
|
81
108
|
content: emoji.shortName
|
|
@@ -83,16 +110,17 @@ export var Selector = function Selector(_ref) {
|
|
|
83
110
|
emojiId: emoji,
|
|
84
111
|
emojiProvider: emojiProvider,
|
|
85
112
|
onClick: onSelected
|
|
86
|
-
})));
|
|
113
|
+
}))));
|
|
87
114
|
};
|
|
88
|
-
return jsx(
|
|
89
|
-
|
|
90
|
-
|
|
115
|
+
return jsx(Inline, {
|
|
116
|
+
alignBlock: "center",
|
|
117
|
+
xcss: containerStyles
|
|
118
|
+
}, pickerQuickReactionEmojiIds ? pickerQuickReactionEmojiIds.map(renderEmoji) : null, showMore ? jsx(Fragment, null, jsx(Box, {
|
|
119
|
+
xcss: separatorStyles
|
|
120
|
+
}), jsx(Reveal, {
|
|
121
|
+
delay: DefaultReactions.length * REVEAL_DELAY
|
|
122
|
+
}, jsx(ShowMore, {
|
|
91
123
|
key: "more",
|
|
92
|
-
buttonStyle: revealStyle,
|
|
93
|
-
style: {
|
|
94
|
-
button: emojiStyleAnimation(DefaultReactions.length)
|
|
95
|
-
},
|
|
96
124
|
onClick: onMoreClick
|
|
97
|
-
}) : null);
|
|
125
|
+
}))) : null);
|
|
98
126
|
};
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
2
3
|
import { css, keyframes } from '@emotion/react';
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
display: 'flex',
|
|
6
|
-
padding: 0
|
|
7
|
-
});
|
|
4
|
+
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
8
6
|
export var emojiStyle = css({
|
|
9
7
|
display: 'inline-block',
|
|
10
|
-
|
|
8
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-nested-selectors -- Ignored via go/DSP-18766
|
|
11
9
|
'&.selected': {
|
|
12
|
-
transition: 'transform 200ms ease-in-out
|
|
10
|
+
transition: 'transform 200ms ease-in-out',
|
|
13
11
|
transform: 'translateY(-48px) scale(2.667)'
|
|
14
12
|
}
|
|
15
13
|
});
|
|
14
|
+
|
|
15
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-keyframes -- Ignored via go/DSP-18766
|
|
16
16
|
export var revealAnimation = keyframes({
|
|
17
17
|
'0%': {
|
|
18
18
|
opacity: 1,
|
|
@@ -26,16 +26,10 @@ export var revealAnimation = keyframes({
|
|
|
26
26
|
transform: 'scale(1)'
|
|
27
27
|
}
|
|
28
28
|
});
|
|
29
|
-
export var revealStyle = css({
|
|
30
|
-
animation: "".concat(revealAnimation, " 150ms ease-in-out forwards")
|
|
31
|
-
});
|
|
32
29
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
animationDelay: "".concat(index * 50, "ms")
|
|
40
|
-
};
|
|
41
|
-
};
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-exported-styles, @atlaskit/design-system/no-exported-css -- Ignored via go/DSP-18766
|
|
31
|
+
export var revealStyle = css({
|
|
32
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-unsafe-values -- Ignored via go/DSP-18766
|
|
33
|
+
animation: "".concat(revealAnimation, " 150ms ease-in-out forwards"),
|
|
34
|
+
opacity: 0
|
|
35
|
+
});
|
|
@@ -1,47 +1,30 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
|
-
|
|
2
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
3
3
|
import { jsx } from '@emotion/react';
|
|
4
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
5
|
+
import { IconButton } from '@atlaskit/button/new';
|
|
5
6
|
import EditorMoreIcon from '@atlaskit/icon/glyph/editor/more';
|
|
6
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
7
8
|
import { messages } from '../../shared/i18n';
|
|
8
|
-
import { moreButtonStyle, moreEmojiContainerStyle, separatorStyle } from './styles';
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Test id for wrapper button
|
|
12
12
|
*/
|
|
13
13
|
export var RENDER_SHOWMORE_TESTID = 'show-more-button';
|
|
14
|
-
export var RENDER_WRAPPER_TESTID = 'show-more-wrapper';
|
|
15
14
|
/**
|
|
16
15
|
* Show more custom emojis button
|
|
17
16
|
*/
|
|
18
17
|
export var ShowMore = function ShowMore(_ref) {
|
|
19
|
-
var onClick = _ref.onClick
|
|
20
|
-
|
|
21
|
-
style = _ref$style === void 0 ? {} : _ref$style,
|
|
22
|
-
_ref$className = _ref.className,
|
|
23
|
-
className = _ref$className === void 0 ? {} : _ref$className,
|
|
24
|
-
buttonStyle = _ref.buttonStyle;
|
|
25
|
-
return jsx("div", {
|
|
26
|
-
className: className.container,
|
|
27
|
-
css: moreEmojiContainerStyle,
|
|
28
|
-
style: style.container,
|
|
29
|
-
"data-testid": RENDER_WRAPPER_TESTID
|
|
30
|
-
}, jsx("div", {
|
|
31
|
-
css: separatorStyle
|
|
32
|
-
}), jsx(FormattedMessage, messages.moreEmoji, function (message) {
|
|
18
|
+
var onClick = _ref.onClick;
|
|
19
|
+
return jsx(FormattedMessage, messages.moreEmoji, function (message) {
|
|
33
20
|
return jsx(Tooltip, {
|
|
34
21
|
content: message
|
|
35
|
-
}, jsx(
|
|
36
|
-
|
|
37
|
-
css: [moreButtonStyle, buttonStyle],
|
|
38
|
-
"aria-label": messages.moreEmoji.defaultMessage,
|
|
39
|
-
type: "button",
|
|
40
|
-
style: style.button,
|
|
22
|
+
}, jsx(IconButton, {
|
|
23
|
+
label: messages.moreEmoji.defaultMessage,
|
|
41
24
|
onClick: onClick,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
}))
|
|
46
|
-
})
|
|
25
|
+
testId: RENDER_SHOWMORE_TESTID,
|
|
26
|
+
icon: EditorMoreIcon,
|
|
27
|
+
appearance: "subtle"
|
|
28
|
+
}));
|
|
29
|
+
});
|
|
47
30
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { ShowMore, RENDER_SHOWMORE_TESTID
|
|
1
|
+
export { ShowMore, RENDER_SHOWMORE_TESTID } from './ShowMore';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
/** @jsx jsx */
|
|
3
3
|
import React from 'react';
|
|
4
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
4
5
|
import { jsx } from '@emotion/react';
|
|
5
6
|
import Button from '@atlaskit/button/standard-button';
|
|
6
7
|
import Tooltip from '@atlaskit/tooltip';
|
|
@@ -32,7 +33,10 @@ export var Trigger = /*#__PURE__*/React.forwardRef(function (props, ref) {
|
|
|
32
33
|
testId: RENDER_TOOLTIP_TRIGGER_TESTID,
|
|
33
34
|
content: tooltipContent
|
|
34
35
|
}, jsx(Button, _extends({
|
|
35
|
-
testId: RENDER_TRIGGER_BUTTON_TESTID
|
|
36
|
+
testId: RENDER_TRIGGER_BUTTON_TESTID
|
|
37
|
+
// TODO: (from codemod) Buttons with "component", "css" or "style" prop can't be automatically migrated with codemods. Please migrate it manually.
|
|
38
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
39
|
+
,
|
|
36
40
|
css: triggerStyle({
|
|
37
41
|
miniMode: miniMode,
|
|
38
42
|
disabled: disabled
|
|
@@ -2,6 +2,7 @@ import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
|
2
2
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
3
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
4
|
/** @jsx jsx */
|
|
5
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
|
|
5
6
|
import { css } from '@emotion/react';
|
|
6
7
|
import { N70, N20, N40, B100 } from '@atlaskit/theme/colors';
|
|
7
8
|
import { borderRadius } from '@atlaskit/theme/constants';
|
|
@@ -16,6 +17,7 @@ export var triggerStyle = function triggerStyle(_ref) {
|
|
|
16
17
|
height: '24px',
|
|
17
18
|
padding: 0,
|
|
18
19
|
border: "1px solid ".concat("var(--ds-border, ".concat(N40, ")")),
|
|
20
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
19
21
|
borderRadius: '20px',
|
|
20
22
|
display: 'flex',
|
|
21
23
|
justifyContent: 'center',
|
|
@@ -25,6 +27,7 @@ export var triggerStyle = function triggerStyle(_ref) {
|
|
|
25
27
|
minWidth: '24px',
|
|
26
28
|
padding: "var(--ds-space-050, 4px)",
|
|
27
29
|
border: 'none',
|
|
30
|
+
// eslint-disable-next-line @atlaskit/ui-styling-standard/no-imported-style-values -- Ignored via go/DSP-18766
|
|
28
31
|
borderRadius: "".concat(borderRadius(), "px")
|
|
29
32
|
}), disabled && {
|
|
30
33
|
color: DISABLED_BUTTON_COLOR,
|
|
@@ -18,4 +18,4 @@ export interface EmojiButtonProps {
|
|
|
18
18
|
/**
|
|
19
19
|
* custom button to render the custom emoji selector inside the reaction picker
|
|
20
20
|
*/
|
|
21
|
-
export declare const EmojiButton: ({ emojiId, onClick, emojiProvider
|
|
21
|
+
export declare const EmojiButton: ({ emojiId, onClick, emojiProvider }: EmojiButtonProps) => jsx.JSX.Element;
|
|
@@ -20,10 +20,6 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
20
20
|
* event handler when the emoji button is clicked
|
|
21
21
|
*/
|
|
22
22
|
onClick: ReactionClick;
|
|
23
|
-
/**
|
|
24
|
-
* Optional wrapper reaction <button /> class name
|
|
25
|
-
*/
|
|
26
|
-
className?: string;
|
|
27
23
|
/**
|
|
28
24
|
* Optional event when the mouse cursor hovers over the reaction
|
|
29
25
|
*/
|
|
@@ -48,4 +44,4 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
48
44
|
/**
|
|
49
45
|
* Render an emoji reaction button
|
|
50
46
|
*/
|
|
51
|
-
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused,
|
|
47
|
+
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, handleUserListClick, allowUserDialog, }: ReactionProps) => jsx.JSX.Element;
|
|
@@ -15,4 +15,4 @@ export interface ReactionViewProps {
|
|
|
15
15
|
*/
|
|
16
16
|
emojiProvider: Promise<EmojiProvider>;
|
|
17
17
|
}
|
|
18
|
-
export declare const ReactionView: ({ selectedEmojiId, emojiProvider, reaction
|
|
18
|
+
export declare const ReactionView: ({ selectedEmojiId, emojiProvider, reaction }: ReactionViewProps) => jsx.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ReactionTooltip, RENDER_REACTIONTOOLTIP_TESTID
|
|
1
|
+
export { ReactionTooltip, RENDER_REACTIONTOOLTIP_TESTID } from './ReactionTooltip';
|
|
2
2
|
export type { ReactionTooltipProps } from './ReactionTooltip';
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/** @jsx jsx */
|
|
3
2
|
import { keyframes } from '@emotion/react';
|
|
4
|
-
export declare const selectorStyle: import("@emotion/react").SerializedStyles;
|
|
5
3
|
export declare const emojiStyle: import("@emotion/react").SerializedStyles;
|
|
6
4
|
export declare const revealAnimation: typeof keyframes;
|
|
7
5
|
export declare const revealStyle: import("@emotion/react").SerializedStyles;
|
|
8
|
-
/**
|
|
9
|
-
* custom css styling for the emoji icon
|
|
10
|
-
* @param index location of the emoji in the rendered list of items
|
|
11
|
-
*/
|
|
12
|
-
export declare const emojiStyleAnimation: (index: number) => React.CSSProperties;
|
|
@@ -1,35 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
3
|
-
import { jsx, type SerializedStyles } from '@emotion/react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
4
|
/**
|
|
5
5
|
* Test id for wrapper button
|
|
6
6
|
*/
|
|
7
7
|
export declare const RENDER_SHOWMORE_TESTID = "show-more-button";
|
|
8
|
-
export declare const RENDER_WRAPPER_TESTID = "show-more-wrapper";
|
|
9
|
-
interface CommonProps<T> {
|
|
10
|
-
container?: T;
|
|
11
|
-
button?: T;
|
|
12
|
-
}
|
|
13
8
|
export interface ShowMoreProps {
|
|
14
9
|
/**
|
|
15
10
|
* Optional mouse click DOM event on showing more emoji icon
|
|
16
11
|
*/
|
|
17
12
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
18
|
-
/**
|
|
19
|
-
* Optional button css
|
|
20
|
-
*/
|
|
21
|
-
buttonStyle?: SerializedStyles;
|
|
22
|
-
/**
|
|
23
|
-
* Optional custom styling for wrapper show more emoji button
|
|
24
|
-
*/
|
|
25
|
-
style?: CommonProps<React.CSSProperties>;
|
|
26
|
-
/**
|
|
27
|
-
* Optional custom styling for wrapper show more emoji button
|
|
28
|
-
*/
|
|
29
|
-
className?: CommonProps<string>;
|
|
30
13
|
}
|
|
31
14
|
/**
|
|
32
15
|
* Show more custom emojis button
|
|
33
16
|
*/
|
|
34
|
-
export declare const ShowMore: ({ onClick
|
|
35
|
-
export {};
|
|
17
|
+
export declare const ShowMore: ({ onClick }: ShowMoreProps) => jsx.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ShowMore, RENDER_SHOWMORE_TESTID
|
|
1
|
+
export { ShowMore, RENDER_SHOWMORE_TESTID } from './ShowMore';
|
|
2
2
|
export type { ShowMoreProps } from './ShowMore';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { ConnectedReactionPicker, type ConnectedReactionPickerProps, } from './ConnectedReactionPicker';
|
|
2
|
-
export { ConnectedReactionsView, type ConnectedReactionsViewProps
|
|
2
|
+
export { ConnectedReactionsView, type ConnectedReactionsViewProps } from './ConnectedReactionsView';
|
|
@@ -2,4 +2,4 @@ export type FocusManagerHook = {
|
|
|
2
2
|
targetRef: HTMLDivElement | null;
|
|
3
3
|
initialFocusRef: HTMLElement | null;
|
|
4
4
|
};
|
|
5
|
-
export declare const useFocusTrap: ({ targetRef, initialFocusRef
|
|
5
|
+
export declare const useFocusTrap: ({ targetRef, initialFocusRef }: FocusManagerHook) => void;
|
|
@@ -18,4 +18,4 @@ export interface EmojiButtonProps {
|
|
|
18
18
|
/**
|
|
19
19
|
* custom button to render the custom emoji selector inside the reaction picker
|
|
20
20
|
*/
|
|
21
|
-
export declare const EmojiButton: ({ emojiId, onClick, emojiProvider
|
|
21
|
+
export declare const EmojiButton: ({ emojiId, onClick, emojiProvider }: EmojiButtonProps) => jsx.JSX.Element;
|
|
@@ -20,10 +20,6 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
20
20
|
* event handler when the emoji button is clicked
|
|
21
21
|
*/
|
|
22
22
|
onClick: ReactionClick;
|
|
23
|
-
/**
|
|
24
|
-
* Optional wrapper reaction <button /> class name
|
|
25
|
-
*/
|
|
26
|
-
className?: string;
|
|
27
23
|
/**
|
|
28
24
|
* Optional event when the mouse cursor hovers over the reaction
|
|
29
25
|
*/
|
|
@@ -48,4 +44,4 @@ export interface ReactionProps extends Pick<ReactionTooltipProps, 'allowUserDial
|
|
|
48
44
|
/**
|
|
49
45
|
* Render an emoji reaction button
|
|
50
46
|
*/
|
|
51
|
-
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused,
|
|
47
|
+
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, handleUserListClick, allowUserDialog, }: ReactionProps) => jsx.JSX.Element;
|
|
@@ -15,4 +15,4 @@ export interface ReactionViewProps {
|
|
|
15
15
|
*/
|
|
16
16
|
emojiProvider: Promise<EmojiProvider>;
|
|
17
17
|
}
|
|
18
|
-
export declare const ReactionView: ({ selectedEmojiId, emojiProvider, reaction
|
|
18
|
+
export declare const ReactionView: ({ selectedEmojiId, emojiProvider, reaction }: ReactionViewProps) => jsx.JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { ReactionTooltip, RENDER_REACTIONTOOLTIP_TESTID
|
|
1
|
+
export { ReactionTooltip, RENDER_REACTIONTOOLTIP_TESTID } from './ReactionTooltip';
|
|
2
2
|
export type { ReactionTooltipProps } from './ReactionTooltip';
|
|
@@ -1,12 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
/** @jsx jsx */
|
|
3
2
|
import { keyframes } from '@emotion/react';
|
|
4
|
-
export declare const selectorStyle: import("@emotion/react").SerializedStyles;
|
|
5
3
|
export declare const emojiStyle: import("@emotion/react").SerializedStyles;
|
|
6
4
|
export declare const revealAnimation: typeof keyframes;
|
|
7
5
|
export declare const revealStyle: import("@emotion/react").SerializedStyles;
|
|
8
|
-
/**
|
|
9
|
-
* custom css styling for the emoji icon
|
|
10
|
-
* @param index location of the emoji in the rendered list of items
|
|
11
|
-
*/
|
|
12
|
-
export declare const emojiStyleAnimation: (index: number) => React.CSSProperties;
|
|
@@ -1,35 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
/** @jsx jsx */
|
|
2
|
-
import
|
|
3
|
-
import { jsx, type SerializedStyles } from '@emotion/react';
|
|
3
|
+
import { jsx } from '@emotion/react';
|
|
4
4
|
/**
|
|
5
5
|
* Test id for wrapper button
|
|
6
6
|
*/
|
|
7
7
|
export declare const RENDER_SHOWMORE_TESTID = "show-more-button";
|
|
8
|
-
export declare const RENDER_WRAPPER_TESTID = "show-more-wrapper";
|
|
9
|
-
interface CommonProps<T> {
|
|
10
|
-
container?: T;
|
|
11
|
-
button?: T;
|
|
12
|
-
}
|
|
13
8
|
export interface ShowMoreProps {
|
|
14
9
|
/**
|
|
15
10
|
* Optional mouse click DOM event on showing more emoji icon
|
|
16
11
|
*/
|
|
17
12
|
onClick?: React.MouseEventHandler<HTMLElement>;
|
|
18
|
-
/**
|
|
19
|
-
* Optional button css
|
|
20
|
-
*/
|
|
21
|
-
buttonStyle?: SerializedStyles;
|
|
22
|
-
/**
|
|
23
|
-
* Optional custom styling for wrapper show more emoji button
|
|
24
|
-
*/
|
|
25
|
-
style?: CommonProps<React.CSSProperties>;
|
|
26
|
-
/**
|
|
27
|
-
* Optional custom styling for wrapper show more emoji button
|
|
28
|
-
*/
|
|
29
|
-
className?: CommonProps<string>;
|
|
30
13
|
}
|
|
31
14
|
/**
|
|
32
15
|
* Show more custom emojis button
|
|
33
16
|
*/
|
|
34
|
-
export declare const ShowMore: ({ onClick
|
|
35
|
-
export {};
|
|
17
|
+
export declare const ShowMore: ({ onClick }: ShowMoreProps) => jsx.JSX.Element;
|