@atlaskit/reactions 34.0.1 → 34.0.2
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 +9 -0
- package/dist/cjs/components/Reaction.js +6 -3
- package/dist/cjs/components/ReactionParticleEffect.js +4 -2
- package/dist/cjs/components/Reactions.js +5 -2
- package/dist/es2019/components/Reaction.js +6 -3
- package/dist/es2019/components/ReactionParticleEffect.js +4 -2
- package/dist/es2019/components/Reactions.js +5 -2
- package/dist/esm/components/Reaction.js +6 -3
- package/dist/esm/components/ReactionParticleEffect.js +4 -2
- package/dist/esm/components/Reactions.js +5 -2
- package/dist/types/components/Reaction.d.ts +6 -1
- package/dist/types/components/ReactionParticleEffect.d.ts +5 -1
- package/dist/types/components/Reactions.d.ts +5 -1
- package/dist/types-ts4.5/components/Reaction.d.ts +6 -1
- package/dist/types-ts4.5/components/ReactionParticleEffect.d.ts +5 -1
- package/dist/types-ts4.5/components/Reactions.d.ts +5 -1
- package/package.json +4 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @atlaskit/reactions
|
|
2
2
|
|
|
3
|
+
## 34.0.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`64e0668502293`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/64e0668502293) -
|
|
8
|
+
Add getOptimisticImageURL prop to Reactions and optimisticImageURL prop to Reaction and
|
|
9
|
+
ReactionParticleEffect components, enabling reaction emoji to render immediately without waiting
|
|
10
|
+
for the catalogue to load
|
|
11
|
+
|
|
3
12
|
## 34.0.1
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -62,7 +62,8 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
62
62
|
handleOpenReactionsDialog = _ref.handleOpenReactionsDialog,
|
|
63
63
|
_ref$isViewOnly = _ref.isViewOnly,
|
|
64
64
|
isViewOnly = _ref$isViewOnly === void 0 ? false : _ref$isViewOnly,
|
|
65
|
-
showSubtleStyle = _ref.showSubtleStyle
|
|
65
|
+
showSubtleStyle = _ref.showSubtleStyle,
|
|
66
|
+
optimisticImageURL = _ref.optimisticImageURL;
|
|
66
67
|
var intl = (0, _reactIntl.useIntl)();
|
|
67
68
|
var hoverStart = (0, _react.useRef)();
|
|
68
69
|
var focusStart = (0, _react.useRef)();
|
|
@@ -143,7 +144,8 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
143
144
|
}, /*#__PURE__*/React.createElement(_emoji.ResourcedEmoji, {
|
|
144
145
|
emojiProvider: emojiProvider,
|
|
145
146
|
emojiId: emojiId,
|
|
146
|
-
fitToHeight: _constants.RESOURCED_EMOJI_COMPACT_HEIGHT
|
|
147
|
+
fitToHeight: _constants.RESOURCED_EMOJI_COMPACT_HEIGHT,
|
|
148
|
+
optimisticImageURL: optimisticImageURL
|
|
147
149
|
})), /*#__PURE__*/React.createElement(_Counter.Counter, {
|
|
148
150
|
value: reaction.count,
|
|
149
151
|
highlight: !isViewOnly && reaction.reacted
|
|
@@ -162,7 +164,8 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
|
|
|
162
164
|
as: (0, _platformFeatureFlags.fg)('jfp_a11y_team_comment_actions_semantic') ? 'li' : undefined
|
|
163
165
|
}, showParticleEffect && /*#__PURE__*/React.createElement(_ReactionParticleEffect.ReactionParticleEffect, {
|
|
164
166
|
emojiId: emojiId,
|
|
165
|
-
emojiProvider: emojiProvider
|
|
167
|
+
emojiProvider: emojiProvider,
|
|
168
|
+
optimisticImageURL: optimisticImageURL
|
|
166
169
|
}), /*#__PURE__*/React.createElement(_ReactionTooltip.ReactionTooltip, {
|
|
167
170
|
emojiName: emojiName,
|
|
168
171
|
reaction: reaction,
|
|
@@ -20,7 +20,8 @@ var reactionParticleStyle = null;
|
|
|
20
20
|
var PARTICLE_COUNT = exports.PARTICLE_COUNT = 4;
|
|
21
21
|
var ReactionParticleEffect = exports.ReactionParticleEffect = function ReactionParticleEffect(_ref) {
|
|
22
22
|
var emojiProvider = _ref.emojiProvider,
|
|
23
|
-
emojiId = _ref.emojiId
|
|
23
|
+
emojiId = _ref.emojiId,
|
|
24
|
+
optimisticImageURL = _ref.optimisticImageURL;
|
|
24
25
|
return /*#__PURE__*/React.createElement("div", {
|
|
25
26
|
className: (0, _runtime.ax)(["_kqswh2mm _1ltvftgi _1pbyifev _m602idpf"])
|
|
26
27
|
}, (0, _toConsumableArray2.default)(Array(PARTICLE_COUNT)).map(function (_, index) {
|
|
@@ -30,7 +31,8 @@ var ReactionParticleEffect = exports.ReactionParticleEffect = function ReactionP
|
|
|
30
31
|
}, /*#__PURE__*/React.createElement(_emoji.ResourcedEmoji, {
|
|
31
32
|
emojiProvider: emojiProvider,
|
|
32
33
|
emojiId: emojiId,
|
|
33
|
-
fitToHeight: _constants2.RESOURCED_EMOJI_COMPACT_HEIGHT
|
|
34
|
+
fitToHeight: _constants2.RESOURCED_EMOJI_COMPACT_HEIGHT,
|
|
35
|
+
optimisticImageURL: optimisticImageURL
|
|
34
36
|
}));
|
|
35
37
|
}));
|
|
36
38
|
};
|
|
@@ -149,6 +149,7 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
149
149
|
_ref$isListItem = _ref.isListItem,
|
|
150
150
|
isListItem = _ref$isListItem === void 0 ? false : _ref$isListItem,
|
|
151
151
|
summaryGetOptimisticImageURL = _ref.summaryGetOptimisticImageURL,
|
|
152
|
+
getOptimisticImageURL = _ref.getOptimisticImageURL,
|
|
152
153
|
reactionPickerPlacement = _ref.reactionPickerPlacement,
|
|
153
154
|
summaryButtonIconAfter = _ref.summaryButtonIconAfter,
|
|
154
155
|
_ref$renderParticleEf = _ref.renderParticleEffectOnSummaryView,
|
|
@@ -388,7 +389,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
388
389
|
allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions,
|
|
389
390
|
handleOpenReactionsDialog: _handleOpenReactionsDialog,
|
|
390
391
|
isViewOnly: isViewOnly,
|
|
391
|
-
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0
|
|
392
|
+
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0,
|
|
393
|
+
optimisticImageURL: (0, _platformFeatureFlags.fg)('platform_reactions_optimistic_url') ? getOptimisticImageURL === null || getOptimisticImageURL === void 0 ? void 0 : getOptimisticImageURL(reaction.emojiId) : undefined
|
|
392
394
|
});
|
|
393
395
|
})) : /*#__PURE__*/_react.default.createElement(_react.default.Fragment, null, memorizedReactions.map(function (reaction) {
|
|
394
396
|
return /*#__PURE__*/_react.default.createElement(_Reaction.Reaction, {
|
|
@@ -404,7 +406,8 @@ var Reactions = exports.Reactions = /*#__PURE__*/_react.default.memo(function (_
|
|
|
404
406
|
allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions,
|
|
405
407
|
handleOpenReactionsDialog: _handleOpenReactionsDialog,
|
|
406
408
|
isViewOnly: isViewOnly,
|
|
407
|
-
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0
|
|
409
|
+
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0,
|
|
410
|
+
optimisticImageURL: (0, _platformFeatureFlags.fg)('platform_reactions_optimistic_url') ? getOptimisticImageURL === null || getOptimisticImageURL === void 0 ? void 0 : getOptimisticImageURL(reaction.emojiId) : undefined
|
|
408
411
|
});
|
|
409
412
|
}))), shouldShowPicker && /*#__PURE__*/_react.default.createElement(_ReactionPicker.ReactionPicker, {
|
|
410
413
|
emojiProvider: emojiProvider,
|
|
@@ -44,7 +44,8 @@ export const Reaction = ({
|
|
|
44
44
|
allowUserDialog,
|
|
45
45
|
handleOpenReactionsDialog,
|
|
46
46
|
isViewOnly = false,
|
|
47
|
-
showSubtleStyle
|
|
47
|
+
showSubtleStyle,
|
|
48
|
+
optimisticImageURL
|
|
48
49
|
}) => {
|
|
49
50
|
const intl = useIntl();
|
|
50
51
|
const hoverStart = useRef();
|
|
@@ -110,7 +111,8 @@ export const Reaction = ({
|
|
|
110
111
|
}, /*#__PURE__*/React.createElement(ResourcedEmoji, {
|
|
111
112
|
emojiProvider: emojiProvider,
|
|
112
113
|
emojiId: emojiId,
|
|
113
|
-
fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT
|
|
114
|
+
fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT,
|
|
115
|
+
optimisticImageURL: optimisticImageURL
|
|
114
116
|
})), /*#__PURE__*/React.createElement(Counter, {
|
|
115
117
|
value: reaction.count,
|
|
116
118
|
highlight: !isViewOnly && reaction.reacted
|
|
@@ -129,7 +131,8 @@ export const Reaction = ({
|
|
|
129
131
|
as: fg('jfp_a11y_team_comment_actions_semantic') ? 'li' : undefined
|
|
130
132
|
}, showParticleEffect && /*#__PURE__*/React.createElement(ReactionParticleEffect, {
|
|
131
133
|
emojiId: emojiId,
|
|
132
|
-
emojiProvider: emojiProvider
|
|
134
|
+
emojiProvider: emojiProvider,
|
|
135
|
+
optimisticImageURL: optimisticImageURL
|
|
133
136
|
}), /*#__PURE__*/React.createElement(ReactionTooltip, {
|
|
134
137
|
emojiName: emojiName,
|
|
135
138
|
reaction: reaction,
|
|
@@ -10,7 +10,8 @@ const reactionParticleStyle = null;
|
|
|
10
10
|
export const PARTICLE_COUNT = 4;
|
|
11
11
|
export const ReactionParticleEffect = ({
|
|
12
12
|
emojiProvider,
|
|
13
|
-
emojiId
|
|
13
|
+
emojiId,
|
|
14
|
+
optimisticImageURL
|
|
14
15
|
}) => /*#__PURE__*/React.createElement("div", {
|
|
15
16
|
className: ax(["_kqswh2mm _1ltvftgi _1pbyifev _m602idpf"])
|
|
16
17
|
}, [...Array(PARTICLE_COUNT)].map((_, index) => {
|
|
@@ -20,6 +21,7 @@ export const ReactionParticleEffect = ({
|
|
|
20
21
|
}, /*#__PURE__*/React.createElement(ResourcedEmoji, {
|
|
21
22
|
emojiProvider: emojiProvider,
|
|
22
23
|
emojiId: emojiId,
|
|
23
|
-
fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT
|
|
24
|
+
fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT,
|
|
25
|
+
optimisticImageURL: optimisticImageURL
|
|
24
26
|
}));
|
|
25
27
|
}));
|
|
@@ -112,6 +112,7 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
112
112
|
hoverableSummaryView = false,
|
|
113
113
|
isListItem = false,
|
|
114
114
|
summaryGetOptimisticImageURL,
|
|
115
|
+
getOptimisticImageURL,
|
|
115
116
|
reactionPickerPlacement,
|
|
116
117
|
summaryButtonIconAfter,
|
|
117
118
|
renderParticleEffectOnSummaryView = false,
|
|
@@ -331,7 +332,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
331
332
|
allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions,
|
|
332
333
|
handleOpenReactionsDialog: handleOpenReactionsDialog,
|
|
333
334
|
isViewOnly: isViewOnly,
|
|
334
|
-
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0
|
|
335
|
+
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0,
|
|
336
|
+
optimisticImageURL: fg('platform_reactions_optimistic_url') ? getOptimisticImageURL === null || getOptimisticImageURL === void 0 ? void 0 : getOptimisticImageURL(reaction.emojiId) : undefined
|
|
335
337
|
}))) : /*#__PURE__*/React.createElement(React.Fragment, null, memorizedReactions.map(reaction => /*#__PURE__*/React.createElement(Reaction, {
|
|
336
338
|
key: reaction.emojiId,
|
|
337
339
|
reaction: reaction,
|
|
@@ -345,7 +347,8 @@ export const Reactions = /*#__PURE__*/React.memo(({
|
|
|
345
347
|
allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions,
|
|
346
348
|
handleOpenReactionsDialog: handleOpenReactionsDialog,
|
|
347
349
|
isViewOnly: isViewOnly,
|
|
348
|
-
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0
|
|
350
|
+
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0,
|
|
351
|
+
optimisticImageURL: fg('platform_reactions_optimistic_url') ? getOptimisticImageURL === null || getOptimisticImageURL === void 0 ? void 0 : getOptimisticImageURL(reaction.emojiId) : undefined
|
|
349
352
|
})))), shouldShowPicker && /*#__PURE__*/React.createElement(ReactionPicker, {
|
|
350
353
|
emojiProvider: emojiProvider,
|
|
351
354
|
allowAllEmojis: allowAllEmojis,
|
|
@@ -53,7 +53,8 @@ export var Reaction = function Reaction(_ref) {
|
|
|
53
53
|
handleOpenReactionsDialog = _ref.handleOpenReactionsDialog,
|
|
54
54
|
_ref$isViewOnly = _ref.isViewOnly,
|
|
55
55
|
isViewOnly = _ref$isViewOnly === void 0 ? false : _ref$isViewOnly,
|
|
56
|
-
showSubtleStyle = _ref.showSubtleStyle
|
|
56
|
+
showSubtleStyle = _ref.showSubtleStyle,
|
|
57
|
+
optimisticImageURL = _ref.optimisticImageURL;
|
|
57
58
|
var intl = useIntl();
|
|
58
59
|
var hoverStart = useRef();
|
|
59
60
|
var focusStart = useRef();
|
|
@@ -134,7 +135,8 @@ export var Reaction = function Reaction(_ref) {
|
|
|
134
135
|
}, /*#__PURE__*/React.createElement(ResourcedEmoji, {
|
|
135
136
|
emojiProvider: emojiProvider,
|
|
136
137
|
emojiId: emojiId,
|
|
137
|
-
fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT
|
|
138
|
+
fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT,
|
|
139
|
+
optimisticImageURL: optimisticImageURL
|
|
138
140
|
})), /*#__PURE__*/React.createElement(Counter, {
|
|
139
141
|
value: reaction.count,
|
|
140
142
|
highlight: !isViewOnly && reaction.reacted
|
|
@@ -153,7 +155,8 @@ export var Reaction = function Reaction(_ref) {
|
|
|
153
155
|
as: fg('jfp_a11y_team_comment_actions_semantic') ? 'li' : undefined
|
|
154
156
|
}, showParticleEffect && /*#__PURE__*/React.createElement(ReactionParticleEffect, {
|
|
155
157
|
emojiId: emojiId,
|
|
156
|
-
emojiProvider: emojiProvider
|
|
158
|
+
emojiProvider: emojiProvider,
|
|
159
|
+
optimisticImageURL: optimisticImageURL
|
|
157
160
|
}), /*#__PURE__*/React.createElement(ReactionTooltip, {
|
|
158
161
|
emojiName: emojiName,
|
|
159
162
|
reaction: reaction,
|
|
@@ -11,7 +11,8 @@ var reactionParticleStyle = null;
|
|
|
11
11
|
export var PARTICLE_COUNT = 4;
|
|
12
12
|
export var ReactionParticleEffect = function ReactionParticleEffect(_ref) {
|
|
13
13
|
var emojiProvider = _ref.emojiProvider,
|
|
14
|
-
emojiId = _ref.emojiId
|
|
14
|
+
emojiId = _ref.emojiId,
|
|
15
|
+
optimisticImageURL = _ref.optimisticImageURL;
|
|
15
16
|
return /*#__PURE__*/React.createElement("div", {
|
|
16
17
|
className: ax(["_kqswh2mm _1ltvftgi _1pbyifev _m602idpf"])
|
|
17
18
|
}, _toConsumableArray(Array(PARTICLE_COUNT)).map(function (_, index) {
|
|
@@ -21,7 +22,8 @@ export var ReactionParticleEffect = function ReactionParticleEffect(_ref) {
|
|
|
21
22
|
}, /*#__PURE__*/React.createElement(ResourcedEmoji, {
|
|
22
23
|
emojiProvider: emojiProvider,
|
|
23
24
|
emojiId: emojiId,
|
|
24
|
-
fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT
|
|
25
|
+
fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT,
|
|
26
|
+
optimisticImageURL: optimisticImageURL
|
|
25
27
|
}));
|
|
26
28
|
}));
|
|
27
29
|
};
|
|
@@ -138,6 +138,7 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
138
138
|
_ref$isListItem = _ref.isListItem,
|
|
139
139
|
isListItem = _ref$isListItem === void 0 ? false : _ref$isListItem,
|
|
140
140
|
summaryGetOptimisticImageURL = _ref.summaryGetOptimisticImageURL,
|
|
141
|
+
getOptimisticImageURL = _ref.getOptimisticImageURL,
|
|
141
142
|
reactionPickerPlacement = _ref.reactionPickerPlacement,
|
|
142
143
|
summaryButtonIconAfter = _ref.summaryButtonIconAfter,
|
|
143
144
|
_ref$renderParticleEf = _ref.renderParticleEffectOnSummaryView,
|
|
@@ -377,7 +378,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
377
378
|
allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions,
|
|
378
379
|
handleOpenReactionsDialog: _handleOpenReactionsDialog,
|
|
379
380
|
isViewOnly: isViewOnly,
|
|
380
|
-
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0
|
|
381
|
+
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0,
|
|
382
|
+
optimisticImageURL: fg('platform_reactions_optimistic_url') ? getOptimisticImageURL === null || getOptimisticImageURL === void 0 ? void 0 : getOptimisticImageURL(reaction.emojiId) : undefined
|
|
381
383
|
});
|
|
382
384
|
})) : /*#__PURE__*/React.createElement(React.Fragment, null, memorizedReactions.map(function (reaction) {
|
|
383
385
|
return /*#__PURE__*/React.createElement(Reaction, {
|
|
@@ -393,7 +395,8 @@ export var Reactions = /*#__PURE__*/React.memo(function (_ref) {
|
|
|
393
395
|
allowUserDialog: allowUserDialog && hasEmojiWithFivePlusReactions,
|
|
394
396
|
handleOpenReactionsDialog: _handleOpenReactionsDialog,
|
|
395
397
|
isViewOnly: isViewOnly,
|
|
396
|
-
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0
|
|
398
|
+
showSubtleStyle: showSubtleDefaultReactions && reactions.length === 0,
|
|
399
|
+
optimisticImageURL: fg('platform_reactions_optimistic_url') ? getOptimisticImageURL === null || getOptimisticImageURL === void 0 ? void 0 : getOptimisticImageURL(reaction.emojiId) : undefined
|
|
397
400
|
});
|
|
398
401
|
}))), shouldShowPicker && /*#__PURE__*/React.createElement(ReactionPicker, {
|
|
399
402
|
emojiProvider: emojiProvider,
|
|
@@ -55,8 +55,13 @@ export interface ReactionProps {
|
|
|
55
55
|
* Optional prop for controlling if the reaction displayed is a default one and should not have a border
|
|
56
56
|
*/
|
|
57
57
|
showSubtleStyle?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Optional URL to optimistically render the emoji image before the catalogue arrives.
|
|
60
|
+
* When provided, the emoji will render immediately without waiting for the emoji provider to resolve.
|
|
61
|
+
*/
|
|
62
|
+
optimisticImageURL?: string;
|
|
58
63
|
}
|
|
59
64
|
/**
|
|
60
65
|
* Render an emoji reaction button
|
|
61
66
|
*/
|
|
62
|
-
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, showOpaqueBackground, allowUserDialog, handleOpenReactionsDialog, isViewOnly, showSubtleStyle, }: ReactionProps) => JSX.Element;
|
|
67
|
+
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, showOpaqueBackground, allowUserDialog, handleOpenReactionsDialog, isViewOnly, showSubtleStyle, optimisticImageURL, }: ReactionProps) => JSX.Element;
|
|
@@ -13,6 +13,10 @@ interface ReactionParticleEffectProps {
|
|
|
13
13
|
* Provider for loading emojis
|
|
14
14
|
*/
|
|
15
15
|
emojiProvider: Promise<EmojiProvider>;
|
|
16
|
+
/**
|
|
17
|
+
* Optional URL to optimistically render the emoji image before the catalogue arrives.
|
|
18
|
+
*/
|
|
19
|
+
optimisticImageURL?: string;
|
|
16
20
|
}
|
|
17
|
-
export declare const ReactionParticleEffect: ({ emojiProvider, emojiId, }: ReactionParticleEffectProps) => JSX.Element;
|
|
21
|
+
export declare const ReactionParticleEffect: ({ emojiProvider, emojiId, optimisticImageURL, }: ReactionParticleEffectProps) => JSX.Element;
|
|
18
22
|
export {};
|
|
@@ -171,6 +171,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
171
171
|
* Optional prop to optimistically render the image URL for a given emoji id. Typically used in SSR before the emoji Provider resolves & the real image is loaded.
|
|
172
172
|
*/
|
|
173
173
|
summaryGetOptimisticImageURL?: (emojiId: string) => string;
|
|
174
|
+
/**
|
|
175
|
+
* Optional function to get an optimistic image URL for a reaction emoji, used to render immediately without waiting for the catalogue.
|
|
176
|
+
*/
|
|
177
|
+
getOptimisticImageURL?: (emojiId: string) => string;
|
|
174
178
|
/**
|
|
175
179
|
* Enables a summary view for displaying reactions. If enabled and the number of reactions meets or exceeds the summaryViewThreshold, reactions will be shown in a more aggregated format.
|
|
176
180
|
*/
|
|
@@ -199,4 +203,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
199
203
|
/**
|
|
200
204
|
* Renders list of reactions
|
|
201
205
|
*/
|
|
202
|
-
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, isListItem, summaryGetOptimisticImageURL, reactionPickerPlacement, summaryButtonIconAfter, renderParticleEffectOnSummaryView, reactionPickerPopperZIndex, }: ReactionsProps) => JSX.Element>;
|
|
206
|
+
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, isListItem, summaryGetOptimisticImageURL, getOptimisticImageURL, reactionPickerPlacement, summaryButtonIconAfter, renderParticleEffectOnSummaryView, reactionPickerPopperZIndex, }: ReactionsProps) => JSX.Element>;
|
|
@@ -55,8 +55,13 @@ export interface ReactionProps {
|
|
|
55
55
|
* Optional prop for controlling if the reaction displayed is a default one and should not have a border
|
|
56
56
|
*/
|
|
57
57
|
showSubtleStyle?: boolean;
|
|
58
|
+
/**
|
|
59
|
+
* Optional URL to optimistically render the emoji image before the catalogue arrives.
|
|
60
|
+
* When provided, the emoji will render immediately without waiting for the emoji provider to resolve.
|
|
61
|
+
*/
|
|
62
|
+
optimisticImageURL?: string;
|
|
58
63
|
}
|
|
59
64
|
/**
|
|
60
65
|
* Render an emoji reaction button
|
|
61
66
|
*/
|
|
62
|
-
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, showOpaqueBackground, allowUserDialog, handleOpenReactionsDialog, isViewOnly, showSubtleStyle, }: ReactionProps) => JSX.Element;
|
|
67
|
+
export declare const Reaction: ({ emojiProvider, onClick, reaction, onMouseEnter, onFocused, flash, showParticleEffect, showOpaqueBackground, allowUserDialog, handleOpenReactionsDialog, isViewOnly, showSubtleStyle, optimisticImageURL, }: ReactionProps) => JSX.Element;
|
|
@@ -13,6 +13,10 @@ interface ReactionParticleEffectProps {
|
|
|
13
13
|
* Provider for loading emojis
|
|
14
14
|
*/
|
|
15
15
|
emojiProvider: Promise<EmojiProvider>;
|
|
16
|
+
/**
|
|
17
|
+
* Optional URL to optimistically render the emoji image before the catalogue arrives.
|
|
18
|
+
*/
|
|
19
|
+
optimisticImageURL?: string;
|
|
16
20
|
}
|
|
17
|
-
export declare const ReactionParticleEffect: ({ emojiProvider, emojiId, }: ReactionParticleEffectProps) => JSX.Element;
|
|
21
|
+
export declare const ReactionParticleEffect: ({ emojiProvider, emojiId, optimisticImageURL, }: ReactionParticleEffectProps) => JSX.Element;
|
|
18
22
|
export {};
|
|
@@ -171,6 +171,10 @@ export interface ReactionsProps extends Pick<ReactionPickerProps, 'allowAllEmoji
|
|
|
171
171
|
* Optional prop to optimistically render the image URL for a given emoji id. Typically used in SSR before the emoji Provider resolves & the real image is loaded.
|
|
172
172
|
*/
|
|
173
173
|
summaryGetOptimisticImageURL?: (emojiId: string) => string;
|
|
174
|
+
/**
|
|
175
|
+
* Optional function to get an optimistic image URL for a reaction emoji, used to render immediately without waiting for the catalogue.
|
|
176
|
+
*/
|
|
177
|
+
getOptimisticImageURL?: (emojiId: string) => string;
|
|
174
178
|
/**
|
|
175
179
|
* Enables a summary view for displaying reactions. If enabled and the number of reactions meets or exceeds the summaryViewThreshold, reactions will be shown in a more aggregated format.
|
|
176
180
|
*/
|
|
@@ -199,4 +203,4 @@ export declare function getTooltip(status: ReactionStatus, errorMessage?: string
|
|
|
199
203
|
/**
|
|
200
204
|
* Renders list of reactions
|
|
201
205
|
*/
|
|
202
|
-
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, isListItem, summaryGetOptimisticImageURL, reactionPickerPlacement, summaryButtonIconAfter, renderParticleEffectOnSummaryView, reactionPickerPopperZIndex, }: ReactionsProps) => JSX.Element>;
|
|
206
|
+
export declare const Reactions: React.MemoExoticComponent<({ flash, particleEffectByEmoji, status, errorMessage, loadReaction, quickReactionEmojis, pickerQuickReactionEmojiIds, getReactionDetails, onSelection, reactions, emojiProvider, allowAllEmojis, onReactionClick, allowUserDialog, onDialogOpenCallback, onDialogCloseCallback, onDialogSelectReactionCallback, onDialogPageChangeCallback, emojiPickerSize, miniMode, summaryViewEnabled, summaryViewThreshold, summaryViewPlacement, showOpaqueBackground, subtleReactionsSummaryAndPicker, showAddReactionText, hideDefaultReactions, ProfileCardWrapper, onlyRenderPicker, isViewOnly, noWrap, noRelativeContainer, showSubtleDefaultReactions, reactionPickerTriggerTooltipContent, reactionPickerTriggerIcon, allowSelectFromSummaryView, useButtonAlignmentStyling, reactionPickerTriggerText, hoverableSummaryView, isListItem, summaryGetOptimisticImageURL, getOptimisticImageURL, reactionPickerPlacement, summaryButtonIconAfter, renderParticleEffectOnSummaryView, reactionPickerPopperZIndex, }: ReactionsProps) => JSX.Element>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/reactions",
|
|
3
|
-
"version": "34.0.
|
|
3
|
+
"version": "34.0.2",
|
|
4
4
|
"description": "Reactions component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -114,6 +114,9 @@
|
|
|
114
114
|
"start:edge": "cd ../../ && PROXY_TARGET_ENV=edge yarn start:webpack reactions --proxy ./packages/elements/reactions/proxy.ts"
|
|
115
115
|
},
|
|
116
116
|
"platform-feature-flags": {
|
|
117
|
+
"platform_reactions_optimistic_url": {
|
|
118
|
+
"type": "boolean"
|
|
119
|
+
},
|
|
117
120
|
"platform-component-visual-refresh": {
|
|
118
121
|
"type": "boolean"
|
|
119
122
|
},
|