@atlaskit/reactions 33.0.2 → 33.1.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 CHANGED
@@ -1,5 +1,13 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 33.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#170825](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/170825)
8
+ [`944add6db1310`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/944add6db1310) -
9
+ Adding an option to optimistically load the emoji using the reaction imagePath.
10
+
3
11
  ## 33.0.2
4
12
 
5
13
  ### Patch Changes
@@ -11,7 +11,7 @@ var _analyticsGasTypes = require("@atlaskit/analytics-gas-types");
11
11
  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; }
12
12
  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) { (0, _defineProperty2.default)(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; }
13
13
  var packageName = "@atlaskit/reactions";
14
- var packageVersion = "33.0.2";
14
+ var packageVersion = "33.1.0";
15
15
  /**
16
16
  * TODO: move to utility package?
17
17
  * A random sampling function
@@ -12,6 +12,7 @@ var _react = _interopRequireWildcard(require("react"));
12
12
  var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
15
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
16
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
16
17
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
17
18
  var _reactIntlNext = require("react-intl-next");
@@ -27,6 +28,7 @@ var _constants = require("../shared/constants");
27
28
  var _ReactionButton = require("./ReactionButton");
28
29
  var _StaticReaction = require("./StaticReaction");
29
30
  var _compiled = require("@atlaskit/primitives/compiled");
31
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
30
32
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
31
33
  var styles = {
32
34
  container: "_kqswh2mm"
@@ -137,11 +139,14 @@ var Reaction = exports.Reaction = function Reaction(_ref) {
137
139
  };
138
140
  var emojiAndCount = /*#__PURE__*/React.createElement(_compiled.Inline, null, /*#__PURE__*/React.createElement("div", {
139
141
  className: (0, _runtime.ax)(["_8hrz1nam _vwz41crf _ca0q1b66 _u5f31b66 _n3td1b66 _19bvu2gc", reaction.count === 0 && "_ca0q1b66 _u5f3v77o _n3td1b66 _19bv19bv"])
140
- }, /*#__PURE__*/React.createElement(_emoji.ResourcedEmoji, {
142
+ }, /*#__PURE__*/React.createElement(_emoji.ResourcedEmoji, (0, _extends2.default)({
141
143
  emojiProvider: emojiProvider,
142
144
  emojiId: emojiId,
143
145
  fitToHeight: _constants.RESOURCED_EMOJI_COMPACT_HEIGHT
144
- })), /*#__PURE__*/React.createElement(_Counter.Counter, {
146
+ }, reaction.emojiPath && (0, _platformFeatureFlags.fg)('platform_optimistic_reaction_emoji') ? {
147
+ optimistic: true,
148
+ optimisticImageURL: reaction.emojiPath
149
+ } : {}))), /*#__PURE__*/React.createElement(_Counter.Counter, {
145
150
  value: reaction.count,
146
151
  highlight: !isViewOnly && reaction.reacted
147
152
  }));
@@ -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 = "33.0.2";
4
+ const packageVersion = "33.1.0";
5
5
  /**
6
6
  * TODO: move to utility package?
7
7
  * A random sampling function
@@ -1,4 +1,5 @@
1
1
  /* Reaction.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import "./Reaction.compiled.css";
3
4
  import * as React from 'react';
4
5
  import { ax, ix } from "@compiled/react/runtime";
@@ -16,6 +17,7 @@ import { RESOURCED_EMOJI_COMPACT_HEIGHT } from '../shared/constants';
16
17
  import { ReactionButton } from './ReactionButton';
17
18
  import { StaticReaction } from './StaticReaction';
18
19
  import { Box, Inline } from '@atlaskit/primitives/compiled';
20
+ import { fg } from '@atlaskit/platform-feature-flags';
19
21
  const styles = {
20
22
  container: "_kqswh2mm"
21
23
  };
@@ -104,11 +106,14 @@ export const Reaction = ({
104
106
  };
105
107
  const emojiAndCount = /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement("div", {
106
108
  className: ax(["_8hrz1nam _vwz41crf _ca0q1b66 _u5f31b66 _n3td1b66 _19bvu2gc", reaction.count === 0 && "_ca0q1b66 _u5f3v77o _n3td1b66 _19bv19bv"])
107
- }, /*#__PURE__*/React.createElement(ResourcedEmoji, {
109
+ }, /*#__PURE__*/React.createElement(ResourcedEmoji, _extends({
108
110
  emojiProvider: emojiProvider,
109
111
  emojiId: emojiId,
110
112
  fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT
111
- })), /*#__PURE__*/React.createElement(Counter, {
113
+ }, reaction.emojiPath && fg('platform_optimistic_reaction_emoji') ? {
114
+ optimistic: true,
115
+ optimisticImageURL: reaction.emojiPath
116
+ } : {}))), /*#__PURE__*/React.createElement(Counter, {
112
117
  value: reaction.count,
113
118
  highlight: !isViewOnly && reaction.reacted
114
119
  }));
@@ -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 = "33.0.2";
7
+ var packageVersion = "33.1.0";
8
8
  /**
9
9
  * TODO: move to utility package?
10
10
  * A random sampling function
@@ -1,4 +1,5 @@
1
1
  /* Reaction.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
2
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
4
  import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
4
5
  import "./Reaction.compiled.css";
@@ -19,6 +20,7 @@ import { RESOURCED_EMOJI_COMPACT_HEIGHT } from '../shared/constants';
19
20
  import { ReactionButton } from './ReactionButton';
20
21
  import { StaticReaction } from './StaticReaction';
21
22
  import { Box, Inline } from '@atlaskit/primitives/compiled';
23
+ import { fg } from '@atlaskit/platform-feature-flags';
22
24
  var styles = {
23
25
  container: "_kqswh2mm"
24
26
  };
@@ -128,11 +130,14 @@ export var Reaction = function Reaction(_ref) {
128
130
  };
129
131
  var emojiAndCount = /*#__PURE__*/React.createElement(Inline, null, /*#__PURE__*/React.createElement("div", {
130
132
  className: ax(["_8hrz1nam _vwz41crf _ca0q1b66 _u5f31b66 _n3td1b66 _19bvu2gc", reaction.count === 0 && "_ca0q1b66 _u5f3v77o _n3td1b66 _19bv19bv"])
131
- }, /*#__PURE__*/React.createElement(ResourcedEmoji, {
133
+ }, /*#__PURE__*/React.createElement(ResourcedEmoji, _extends({
132
134
  emojiProvider: emojiProvider,
133
135
  emojiId: emojiId,
134
136
  fitToHeight: RESOURCED_EMOJI_COMPACT_HEIGHT
135
- })), /*#__PURE__*/React.createElement(Counter, {
137
+ }, reaction.emojiPath && fg('platform_optimistic_reaction_emoji') ? {
138
+ optimistic: true,
139
+ optimisticImageURL: reaction.emojiPath
140
+ } : {}))), /*#__PURE__*/React.createElement(Counter, {
136
141
  value: reaction.count,
137
142
  highlight: !isViewOnly && reaction.reacted
138
143
  }));
@@ -36,6 +36,10 @@ export interface ReactionSummary {
36
36
  * @deprecated Legacy content Not in use anymore
37
37
  */
38
38
  optimisticallyUpdated?: boolean;
39
+ /**
40
+ * A path to the emoji image, used for optimistic rendering.
41
+ */
42
+ emojiPath?: string;
39
43
  }
40
44
  /**
41
45
  * Metadata for composing a summary of emojis that will be shown in the the primary view even if the reaction count is zero
@@ -36,6 +36,10 @@ export interface ReactionSummary {
36
36
  * @deprecated Legacy content Not in use anymore
37
37
  */
38
38
  optimisticallyUpdated?: boolean;
39
+ /**
40
+ * A path to the emoji image, used for optimistic rendering.
41
+ */
42
+ emojiPath?: string;
39
43
  }
40
44
  /**
41
45
  * Metadata for composing a summary of emojis that will be shown in the the primary view even if the reaction count is zero
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "33.0.2",
3
+ "version": "33.1.0",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -137,6 +137,9 @@
137
137
  },
138
138
  "should-render-to-parent-should-be-true-editor-coll": {
139
139
  "type": "boolean"
140
+ },
141
+ "platform_optimistic_reaction_emoji": {
142
+ "type": "boolean"
140
143
  }
141
144
  },
142
145
  "sideEffects": [