@atlaskit/reactions 36.6.0 → 36.7.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,12 @@
1
1
  # @atlaskit/reactions
2
2
 
3
+ ## 36.7.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`7fc9148294cc8`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7fc9148294cc8) -
8
+ Render agent and person avatars in the reaction dialog when the actor has agent data.
9
+
3
10
  ## 36.6.0
4
11
 
5
12
  ### Minor Changes
@@ -11,7 +11,7 @@ var _createAndFireEvents = _interopRequireDefault(require("@atlaskit/analytics-n
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; } // eslint-disable-next-line @typescript-eslint/consistent-type-imports
13
13
  var packageName = "@atlaskit/reactions";
14
- var packageVersion = "36.5.0";
14
+ var packageVersion = "36.6.0";
15
15
  /**
16
16
  * TODO: move to utility package?
17
17
  * A random sampling function
@@ -0,0 +1,16 @@
1
+ ._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}._12l21i6y{margin-inline-end:var(--ds-space-negative-025,-2px)}
2
+ ._154if6fq{top:18px}
3
+ ._16qsz8ju{box-shadow:0 0 0 1px var(--ds-surface,#fff)}
4
+ ._18m915vq{overflow-y:hidden}
5
+ ._1bsb7vkz{width:1pc}
6
+ ._1bsbzwfg{width:2pc}
7
+ ._1e02f6fq{inset-inline-start:18px}
8
+ ._1o9zidpf{flex-shrink:0}
9
+ ._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
10
+ ._1reo15vq{overflow-x:hidden}
11
+ ._4t3i7vkz{height:1pc}
12
+ ._4t3izwfg{height:2pc}
13
+ ._6rth1i6y{margin-block-end:var(--ds-space-negative-025,-2px)}
14
+ ._ahbq1i6y{margin-inline-start:var(--ds-space-negative-025,-2px)}
15
+ ._kqswh2mm{position:relative}
16
+ ._kqswstnw{position:absolute}
@@ -0,0 +1,61 @@
1
+ /* AgentReactionAvatar.tsx generated by @compiled/babel-plugin v3.0.2 */
2
+ "use strict";
3
+
4
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
5
+ var _typeof = require("@babel/runtime/helpers/typeof");
6
+ Object.defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.AgentReactionAvatar = void 0;
10
+ require("./AgentReactionAvatar.compiled.css");
11
+ var React = _interopRequireWildcard(require("react"));
12
+ var _runtime = require("@compiled/react/runtime");
13
+ var _Avatar = _interopRequireDefault(require("@atlaskit/avatar/Avatar"));
14
+ 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); }
15
+ var agentAvatarStyle = null;
16
+ var personAvatarStyle = null;
17
+ var personAvatarClipStyle = null;
18
+ var personAvatarShiftStyle = null;
19
+ var AgentReactionAvatar = exports.AgentReactionAvatar = function AgentReactionAvatar(_ref) {
20
+ var _user$profilePicture;
21
+ var user = _ref.user,
22
+ agent = _ref.agent,
23
+ ProfileCardWrapper = _ref.ProfileCardWrapper;
24
+ var profile = (_user$profilePicture = user.profilePicture) === null || _user$profilePicture === void 0 ? void 0 : _user$profilePicture.path;
25
+ var agentAvatar = /*#__PURE__*/React.createElement(_Avatar.default, {
26
+ appearance: "hexagon",
27
+ size: "medium",
28
+ src: agent.avatarUrl,
29
+ name: agent.name,
30
+ borderColor: "transparent",
31
+ label: "",
32
+ testId: "agent-profile"
33
+ });
34
+ var personAvatar = /*#__PURE__*/React.createElement("div", {
35
+ className: (0, _runtime.ax)(["_1reo15vq _18m915vq _2rko1rr0 _1bsb7vkz _4t3i7vkz"])
36
+ }, /*#__PURE__*/React.createElement("div", {
37
+ className: (0, _runtime.ax)(["_1pfh1i6y _6rth1i6y _ahbq1i6y _12l21i6y"])
38
+ }, /*#__PURE__*/React.createElement(_Avatar.default, {
39
+ size: "xxsmall",
40
+ src: profile,
41
+ name: user.displayName,
42
+ borderColor: "transparent",
43
+ label: "",
44
+ testId: "agent-person-profile"
45
+ })));
46
+ return /*#__PURE__*/React.createElement("div", {
47
+ className: (0, _runtime.ax)(["_kqswh2mm _1bsbzwfg _4t3izwfg _1o9zidpf"])
48
+ }, ProfileCardWrapper && agent.identityAccountId ? /*#__PURE__*/React.createElement(ProfileCardWrapper, {
49
+ userId: agent.identityAccountId,
50
+ isAnonymous: false,
51
+ canViewProfile: true,
52
+ position: "left-start"
53
+ }, agentAvatar) : agentAvatar, /*#__PURE__*/React.createElement("div", {
54
+ className: (0, _runtime.ax)(["_2rko1rr0 _kqswstnw _154if6fq _1e02f6fq _1bsb7vkz _4t3i7vkz _16qsz8ju"])
55
+ }, ProfileCardWrapper && user.accountId ? /*#__PURE__*/React.createElement(ProfileCardWrapper, {
56
+ userId: user.accountId,
57
+ isAnonymous: false,
58
+ canViewProfile: true,
59
+ position: "left-start"
60
+ }, personAvatar) : personAvatar));
61
+ };
@@ -18,6 +18,7 @@ var _compiled = require("@atlaskit/primitives/compiled");
18
18
  var _spinner = _interopRequireDefault(require("@atlaskit/spinner/spinner"));
19
19
  var _tabPanel = _interopRequireDefault(require("@atlaskit/tabs/tab-panel"));
20
20
  var _i18n = require("../shared/i18n");
21
+ var _AgentReactionAvatar = require("./AgentReactionAvatar");
21
22
  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); }
22
23
  var userListStyle = null;
23
24
  var userStyle = null;
@@ -54,7 +55,11 @@ var ReactionView = exports.ReactionView = function ReactionView(_ref) {
54
55
  return /*#__PURE__*/React.createElement("li", {
55
56
  key: user.id,
56
57
  className: (0, _runtime.ax)(["_1e0c1txw _4cvr1h6o _ca0q1b66 _n3td1b66 _19bvidpf _u5f3idpf _24rcpxbi"])
57
- }, ProfileCardWrapper && user.accountId ? /*#__PURE__*/React.createElement(_compiled.Box, {
58
+ }, user.agent ? /*#__PURE__*/React.createElement(_AgentReactionAvatar.AgentReactionAvatar, {
59
+ user: user,
60
+ agent: user.agent,
61
+ ProfileCardWrapper: ProfileCardWrapper
62
+ }) : ProfileCardWrapper && user.accountId ? /*#__PURE__*/React.createElement(_compiled.Box, {
58
63
  xcss: styles.profileWrapperStyle
59
64
  }, /*#__PURE__*/React.createElement(ProfileCardWrapper, {
60
65
  userId: user.accountId,
@@ -2,7 +2,7 @@ import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-t
2
2
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
3
3
  import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
4
4
  const packageName = "@atlaskit/reactions";
5
- const packageVersion = "36.5.0";
5
+ const packageVersion = "36.6.0";
6
6
  /**
7
7
  * TODO: move to utility package?
8
8
  * A random sampling function
@@ -0,0 +1,16 @@
1
+ ._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}._12l21i6y{margin-inline-end:var(--ds-space-negative-025,-2px)}
2
+ ._154if6fq{top:18px}
3
+ ._16qsz8ju{box-shadow:0 0 0 1px var(--ds-surface,#fff)}
4
+ ._18m915vq{overflow-y:hidden}
5
+ ._1bsb7vkz{width:1pc}
6
+ ._1bsbzwfg{width:2pc}
7
+ ._1e02f6fq{inset-inline-start:18px}
8
+ ._1o9zidpf{flex-shrink:0}
9
+ ._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
10
+ ._1reo15vq{overflow-x:hidden}
11
+ ._4t3i7vkz{height:1pc}
12
+ ._4t3izwfg{height:2pc}
13
+ ._6rth1i6y{margin-block-end:var(--ds-space-negative-025,-2px)}
14
+ ._ahbq1i6y{margin-inline-start:var(--ds-space-negative-025,-2px)}
15
+ ._kqswh2mm{position:relative}
16
+ ._kqswstnw{position:absolute}
@@ -0,0 +1,53 @@
1
+ /* AgentReactionAvatar.tsx generated by @compiled/babel-plugin v3.0.2 */
2
+ import "./AgentReactionAvatar.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import Avatar from '@atlaskit/avatar/Avatar';
6
+ const agentAvatarStyle = null;
7
+ const personAvatarStyle = null;
8
+ const personAvatarClipStyle = null;
9
+ const personAvatarShiftStyle = null;
10
+ export const AgentReactionAvatar = ({
11
+ user,
12
+ agent,
13
+ ProfileCardWrapper
14
+ }) => {
15
+ var _user$profilePicture;
16
+ const profile = (_user$profilePicture = user.profilePicture) === null || _user$profilePicture === void 0 ? void 0 : _user$profilePicture.path;
17
+ const agentAvatar = /*#__PURE__*/React.createElement(Avatar, {
18
+ appearance: "hexagon",
19
+ size: "medium",
20
+ src: agent.avatarUrl,
21
+ name: agent.name,
22
+ borderColor: "transparent",
23
+ label: "",
24
+ testId: "agent-profile"
25
+ });
26
+ const personAvatar = /*#__PURE__*/React.createElement("div", {
27
+ className: ax(["_1reo15vq _18m915vq _2rko1rr0 _1bsb7vkz _4t3i7vkz"])
28
+ }, /*#__PURE__*/React.createElement("div", {
29
+ className: ax(["_1pfh1i6y _6rth1i6y _ahbq1i6y _12l21i6y"])
30
+ }, /*#__PURE__*/React.createElement(Avatar, {
31
+ size: "xxsmall",
32
+ src: profile,
33
+ name: user.displayName,
34
+ borderColor: "transparent",
35
+ label: "",
36
+ testId: "agent-person-profile"
37
+ })));
38
+ return /*#__PURE__*/React.createElement("div", {
39
+ className: ax(["_kqswh2mm _1bsbzwfg _4t3izwfg _1o9zidpf"])
40
+ }, ProfileCardWrapper && agent.identityAccountId ? /*#__PURE__*/React.createElement(ProfileCardWrapper, {
41
+ userId: agent.identityAccountId,
42
+ isAnonymous: false,
43
+ canViewProfile: true,
44
+ position: "left-start"
45
+ }, agentAvatar) : agentAvatar, /*#__PURE__*/React.createElement("div", {
46
+ className: ax(["_2rko1rr0 _kqswstnw _154if6fq _1e02f6fq _1bsb7vkz _4t3i7vkz _16qsz8ju"])
47
+ }, ProfileCardWrapper && user.accountId ? /*#__PURE__*/React.createElement(ProfileCardWrapper, {
48
+ userId: user.accountId,
49
+ isAnonymous: false,
50
+ canViewProfile: true,
51
+ position: "left-start"
52
+ }, personAvatar) : personAvatar));
53
+ };
@@ -10,6 +10,7 @@ import { Box, Flex } from '@atlaskit/primitives/compiled';
10
10
  import Spinner from '@atlaskit/spinner/spinner';
11
11
  import TabPanel from '@atlaskit/tabs/tab-panel';
12
12
  import { messages } from '../shared/i18n';
13
+ import { AgentReactionAvatar } from './AgentReactionAvatar';
13
14
  const userListStyle = null;
14
15
  const userStyle = null;
15
16
  const styles = {
@@ -46,7 +47,11 @@ export const ReactionView = ({
46
47
  return /*#__PURE__*/React.createElement("li", {
47
48
  key: user.id,
48
49
  className: ax(["_1e0c1txw _4cvr1h6o _ca0q1b66 _n3td1b66 _19bvidpf _u5f3idpf _24rcpxbi"])
49
- }, ProfileCardWrapper && user.accountId ? /*#__PURE__*/React.createElement(Box, {
50
+ }, user.agent ? /*#__PURE__*/React.createElement(AgentReactionAvatar, {
51
+ user: user,
52
+ agent: user.agent,
53
+ ProfileCardWrapper: ProfileCardWrapper
54
+ }) : ProfileCardWrapper && user.accountId ? /*#__PURE__*/React.createElement(Box, {
50
55
  xcss: styles.profileWrapperStyle
51
56
  }, /*#__PURE__*/React.createElement(ProfileCardWrapper, {
52
57
  userId: user.accountId,
@@ -5,7 +5,7 @@ import { UI_EVENT_TYPE, OPERATIONAL_EVENT_TYPE } from '@atlaskit/analytics-gas-t
5
5
  // eslint-disable-next-line @typescript-eslint/consistent-type-imports
6
6
  import createAndFireEvent from '@atlaskit/analytics-next/createAndFireEvents';
7
7
  var packageName = "@atlaskit/reactions";
8
- var packageVersion = "36.5.0";
8
+ var packageVersion = "36.6.0";
9
9
  /**
10
10
  * TODO: move to utility package?
11
11
  * A random sampling function
@@ -0,0 +1,16 @@
1
+ ._2rko1rr0{border-radius:var(--ds-radius-full,9999px)}._12l21i6y{margin-inline-end:var(--ds-space-negative-025,-2px)}
2
+ ._154if6fq{top:18px}
3
+ ._16qsz8ju{box-shadow:0 0 0 1px var(--ds-surface,#fff)}
4
+ ._18m915vq{overflow-y:hidden}
5
+ ._1bsb7vkz{width:1pc}
6
+ ._1bsbzwfg{width:2pc}
7
+ ._1e02f6fq{inset-inline-start:18px}
8
+ ._1o9zidpf{flex-shrink:0}
9
+ ._1pfh1i6y{margin-block-start:var(--ds-space-negative-025,-2px)}
10
+ ._1reo15vq{overflow-x:hidden}
11
+ ._4t3i7vkz{height:1pc}
12
+ ._4t3izwfg{height:2pc}
13
+ ._6rth1i6y{margin-block-end:var(--ds-space-negative-025,-2px)}
14
+ ._ahbq1i6y{margin-inline-start:var(--ds-space-negative-025,-2px)}
15
+ ._kqswh2mm{position:relative}
16
+ ._kqswstnw{position:absolute}
@@ -0,0 +1,52 @@
1
+ /* AgentReactionAvatar.tsx generated by @compiled/babel-plugin v3.0.2 */
2
+ import "./AgentReactionAvatar.compiled.css";
3
+ import * as React from 'react';
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import Avatar from '@atlaskit/avatar/Avatar';
6
+ var agentAvatarStyle = null;
7
+ var personAvatarStyle = null;
8
+ var personAvatarClipStyle = null;
9
+ var personAvatarShiftStyle = null;
10
+ export var AgentReactionAvatar = function AgentReactionAvatar(_ref) {
11
+ var _user$profilePicture;
12
+ var user = _ref.user,
13
+ agent = _ref.agent,
14
+ ProfileCardWrapper = _ref.ProfileCardWrapper;
15
+ var profile = (_user$profilePicture = user.profilePicture) === null || _user$profilePicture === void 0 ? void 0 : _user$profilePicture.path;
16
+ var agentAvatar = /*#__PURE__*/React.createElement(Avatar, {
17
+ appearance: "hexagon",
18
+ size: "medium",
19
+ src: agent.avatarUrl,
20
+ name: agent.name,
21
+ borderColor: "transparent",
22
+ label: "",
23
+ testId: "agent-profile"
24
+ });
25
+ var personAvatar = /*#__PURE__*/React.createElement("div", {
26
+ className: ax(["_1reo15vq _18m915vq _2rko1rr0 _1bsb7vkz _4t3i7vkz"])
27
+ }, /*#__PURE__*/React.createElement("div", {
28
+ className: ax(["_1pfh1i6y _6rth1i6y _ahbq1i6y _12l21i6y"])
29
+ }, /*#__PURE__*/React.createElement(Avatar, {
30
+ size: "xxsmall",
31
+ src: profile,
32
+ name: user.displayName,
33
+ borderColor: "transparent",
34
+ label: "",
35
+ testId: "agent-person-profile"
36
+ })));
37
+ return /*#__PURE__*/React.createElement("div", {
38
+ className: ax(["_kqswh2mm _1bsbzwfg _4t3izwfg _1o9zidpf"])
39
+ }, ProfileCardWrapper && agent.identityAccountId ? /*#__PURE__*/React.createElement(ProfileCardWrapper, {
40
+ userId: agent.identityAccountId,
41
+ isAnonymous: false,
42
+ canViewProfile: true,
43
+ position: "left-start"
44
+ }, agentAvatar) : agentAvatar, /*#__PURE__*/React.createElement("div", {
45
+ className: ax(["_2rko1rr0 _kqswstnw _154if6fq _1e02f6fq _1bsb7vkz _4t3i7vkz _16qsz8ju"])
46
+ }, ProfileCardWrapper && user.accountId ? /*#__PURE__*/React.createElement(ProfileCardWrapper, {
47
+ userId: user.accountId,
48
+ isAnonymous: false,
49
+ canViewProfile: true,
50
+ position: "left-start"
51
+ }, personAvatar) : personAvatar));
52
+ };
@@ -10,6 +10,7 @@ import { Box, Flex } from '@atlaskit/primitives/compiled';
10
10
  import Spinner from '@atlaskit/spinner/spinner';
11
11
  import TabPanel from '@atlaskit/tabs/tab-panel';
12
12
  import { messages } from '../shared/i18n';
13
+ import { AgentReactionAvatar } from './AgentReactionAvatar';
13
14
  var userListStyle = null;
14
15
  var userStyle = null;
15
16
  var styles = {
@@ -45,7 +46,11 @@ export var ReactionView = function ReactionView(_ref) {
45
46
  return /*#__PURE__*/React.createElement("li", {
46
47
  key: user.id,
47
48
  className: ax(["_1e0c1txw _4cvr1h6o _ca0q1b66 _n3td1b66 _19bvidpf _u5f3idpf _24rcpxbi"])
48
- }, ProfileCardWrapper && user.accountId ? /*#__PURE__*/React.createElement(Box, {
49
+ }, user.agent ? /*#__PURE__*/React.createElement(AgentReactionAvatar, {
50
+ user: user,
51
+ agent: user.agent,
52
+ ProfileCardWrapper: ProfileCardWrapper
53
+ }) : ProfileCardWrapper && user.accountId ? /*#__PURE__*/React.createElement(Box, {
49
54
  xcss: styles.profileWrapperStyle
50
55
  }, /*#__PURE__*/React.createElement(ProfileCardWrapper, {
51
56
  userId: user.accountId,
@@ -0,0 +1,6 @@
1
+ import { type ProfileCardWrapper, type User } from '../types';
2
+ export declare const AgentReactionAvatar: ({ user, agent, ProfileCardWrapper, }: {
3
+ agent: NonNullable<User['agent']>;
4
+ ProfileCardWrapper?: ProfileCardWrapper;
5
+ user: User;
6
+ }) => JSX.Element;
@@ -1,10 +1,10 @@
1
1
  export interface User {
2
2
  accountId?: string;
3
- /**
4
- * Agent that reacted with the user
5
- */
3
+ /** Agent identity for a reaction made with a person. */
6
4
  agent?: {
7
5
  name: string;
6
+ avatarUrl?: string;
7
+ identityAccountId?: string;
8
8
  };
9
9
  /**
10
10
  * name of user clicked on the reaction
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/reactions",
3
- "version": "36.6.0",
3
+ "version": "36.7.0",
4
4
  "description": "Reactions component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"