@atlaskit/profilecard 24.37.3 → 24.39.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +23 -0
  2. package/afm-cc/tsconfig.json +3 -0
  3. package/afm-jira/tsconfig.json +3 -0
  4. package/afm-products/tsconfig.json +3 -0
  5. package/dist/cjs/client/getOrgIdForCloudIdFromAGG.js +1 -1
  6. package/dist/cjs/client/getTeamFromAGG.js +1 -1
  7. package/dist/cjs/components/Agent/AgentProfileCardResourced.js +37 -126
  8. package/dist/cjs/components/User/ProfileCard.js +3 -1
  9. package/dist/cjs/components/User/ProfileCardDetails.js +22 -5
  10. package/dist/cjs/components/User/ProfileCardTrigger.js +7 -2
  11. package/dist/cjs/util/analytics.js +2 -2
  12. package/dist/es2019/client/getOrgIdForCloudIdFromAGG.js +1 -1
  13. package/dist/es2019/client/getTeamFromAGG.js +1 -1
  14. package/dist/es2019/components/Agent/AgentProfileCardResourced.js +9 -67
  15. package/dist/es2019/components/User/ProfileCard.js +3 -1
  16. package/dist/es2019/components/User/ProfileCardDetails.js +22 -5
  17. package/dist/es2019/components/User/ProfileCardTrigger.js +7 -2
  18. package/dist/es2019/util/analytics.js +2 -2
  19. package/dist/esm/client/getOrgIdForCloudIdFromAGG.js +1 -1
  20. package/dist/esm/client/getTeamFromAGG.js +1 -1
  21. package/dist/esm/components/Agent/AgentProfileCardResourced.js +37 -126
  22. package/dist/esm/components/User/ProfileCard.js +3 -1
  23. package/dist/esm/components/User/ProfileCardDetails.js +22 -5
  24. package/dist/esm/components/User/ProfileCardTrigger.js +7 -2
  25. package/dist/esm/util/analytics.js +2 -2
  26. package/dist/types/components/User/ProfileCardTrigger.d.ts +1 -1
  27. package/dist/types/types.d.ts +14 -0
  28. package/dist/types-ts4.5/components/User/ProfileCardTrigger.d.ts +1 -1
  29. package/dist/types-ts4.5/types.d.ts +14 -0
  30. package/package.json +3 -5
package/CHANGELOG.md CHANGED
@@ -1,5 +1,28 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 24.39.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`ab3866dd7f659`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/ab3866dd7f659) -
8
+ Focus on the heading in a profile card when it's rendered to keep the user in the focus trap
9
+
10
+ ### Patch Changes
11
+
12
+ - Updated dependencies
13
+
14
+ ## 24.38.0
15
+
16
+ ### Minor Changes
17
+
18
+ - [`6162db4501346`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6162db4501346) -
19
+ [ux] Removes feature gate rovo_agent_show_creator_on_profile_card_fix and deprecated function to
20
+ get creator details.
21
+
22
+ ### Patch Changes
23
+
24
+ - Updated dependencies
25
+
3
26
  ## 24.37.3
4
27
 
5
28
  ### Patch Changes
@@ -107,6 +107,9 @@
107
107
  {
108
108
  "path": "../../../design-system/theme/afm-cc/tsconfig.json"
109
109
  },
110
+ {
111
+ "path": "../../../editor/tmp-editor-statsig/afm-cc/tsconfig.json"
112
+ },
110
113
  {
111
114
  "path": "../../../design-system/tokens/afm-cc/tsconfig.json"
112
115
  },
@@ -107,6 +107,9 @@
107
107
  {
108
108
  "path": "../../../design-system/theme/afm-jira/tsconfig.json"
109
109
  },
110
+ {
111
+ "path": "../../../editor/tmp-editor-statsig/afm-jira/tsconfig.json"
112
+ },
110
113
  {
111
114
  "path": "../../../design-system/tokens/afm-jira/tsconfig.json"
112
115
  },
@@ -107,6 +107,9 @@
107
107
  {
108
108
  "path": "../../../design-system/theme/afm-products/tsconfig.json"
109
109
  },
110
+ {
111
+ "path": "../../../editor/tmp-editor-statsig/afm-products/tsconfig.json"
112
+ },
110
113
  {
111
114
  "path": "../../../design-system/tokens/afm-products/tsconfig.json"
112
115
  },
@@ -11,7 +11,7 @@ var _graphqlUtils = require("./graphqlUtils");
11
11
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
12
12
  var addHeaders = function addHeaders(headers) {
13
13
  headers.append('atl-client-name', "@atlaskit/profilecard");
14
- headers.append('atl-client-version', "24.37.2");
14
+ headers.append('atl-client-version', "24.38.0");
15
15
  return headers;
16
16
  };
17
17
  function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -66,7 +66,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
66
66
  headers.append('X-ExperimentalApi', 'teams-beta');
67
67
  headers.append('X-ExperimentalApi', 'team-members-beta');
68
68
  headers.append('atl-client-name', "@atlaskit/profilecard");
69
- headers.append('atl-client-version', "24.37.2");
69
+ headers.append('atl-client-version', "24.38.0");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -48,102 +48,28 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
48
48
  cloudId: props.cloudId
49
49
  }),
50
50
  profileHref = _navigateToTeamsApp.href;
51
-
52
- /**
53
- * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
54
- * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
55
- */
56
- var getCreatorDeprecated = (0, _react.useCallback)( /*#__PURE__*/function () {
51
+ var getCreator = (0, _react.useCallback)( /*#__PURE__*/function () {
57
52
  var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
58
- var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, creatorInfo;
53
+ var creator_type, creator, authoringTeam, _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
59
54
  return _regenerator.default.wrap(function _callee$(_context) {
60
55
  while (1) switch (_context.prev = _context.next) {
61
56
  case 0:
62
57
  creator_type = _ref.creator_type, creator = _ref.creator, authoringTeam = _ref.authoringTeam;
63
- if (creator) {
64
- _context.next = 3;
65
- break;
66
- }
67
- return _context.abrupt("return", undefined);
68
- case 3:
69
- _context.t0 = creator_type;
70
- _context.next = _context.t0 === 'SYSTEM' ? 6 : _context.t0 === 'THIRD_PARTY' ? 7 : _context.t0 === 'CUSTOMER' ? 8 : 22;
71
- break;
72
- case 6:
73
- return _context.abrupt("return", {
74
- type: 'SYSTEM'
75
- });
76
- case 7:
77
- return _context.abrupt("return", {
78
- type: 'THIRD_PARTY',
79
- name: creator !== null && creator !== void 0 ? creator : ''
80
- });
81
- case 8:
82
- _context.prev = 8;
83
- if (!(!creatorUserId || !props.cloudId)) {
84
- _context.next = 11;
85
- break;
86
- }
87
- return _context.abrupt("return", undefined);
88
- case 11:
89
- if (!authoringTeam) {
90
- _context.next = 13;
91
- break;
92
- }
93
- return _context.abrupt("return", {
94
- type: 'CUSTOMER',
95
- name: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
96
- profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : ''
97
- });
98
- case 13:
99
- _context.next = 15;
100
- return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
101
- case 15:
102
- creatorInfo = _context.sent;
103
- return _context.abrupt("return", {
104
- type: 'CUSTOMER',
105
- name: creatorInfo.fullName,
106
- profileLink: (0, _platformFeatureFlags.fg)('platform-adopt-teams-nav-config') ? profileHref : "/people/".concat(creatorUserId),
107
- id: creatorUserId
108
- });
109
- case 19:
110
- _context.prev = 19;
111
- _context.t1 = _context["catch"](8);
112
- return _context.abrupt("return", undefined);
113
- case 22:
114
- return _context.abrupt("return", undefined);
115
- case 23:
116
- case "end":
117
- return _context.stop();
118
- }
119
- }, _callee, null, [[8, 19]]);
120
- }));
121
- return function (_x) {
122
- return _ref2.apply(this, arguments);
123
- };
124
- }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
125
- var getCreator = (0, _react.useCallback)( /*#__PURE__*/function () {
126
- var _ref4 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(_ref3) {
127
- var creator_type, creator, authoringTeam, _authoringTeam$displa2, _authoringTeam$profil2, _userCreatorInfo$full, userCreatorInfo, creatorInfo;
128
- return _regenerator.default.wrap(function _callee2$(_context2) {
129
- while (1) switch (_context2.prev = _context2.next) {
130
- case 0:
131
- creator_type = _ref3.creator_type, creator = _ref3.creator, authoringTeam = _ref3.authoringTeam;
132
- _context2.prev = 1;
58
+ _context.prev = 1;
133
59
  if (!(creatorUserId && props.cloudId)) {
134
- _context2.next = 6;
60
+ _context.next = 6;
135
61
  break;
136
62
  }
137
- _context2.next = 5;
63
+ _context.next = 5;
138
64
  return props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
139
65
  case 5:
140
- userCreatorInfo = _context2.sent;
66
+ userCreatorInfo = _context.sent;
141
67
  case 6:
142
68
  creatorInfo = (0, _AgentProfileInfo.getAgentCreator)({
143
69
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
144
70
  authoringTeam: authoringTeam ? {
145
- displayName: (_authoringTeam$displa2 = authoringTeam.displayName) !== null && _authoringTeam$displa2 !== void 0 ? _authoringTeam$displa2 : '',
146
- profileLink: (_authoringTeam$profil2 = authoringTeam.profileUrl) !== null && _authoringTeam$profil2 !== void 0 ? _authoringTeam$profil2 : undefined
71
+ displayName: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
72
+ profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : undefined
147
73
  } : undefined,
148
74
  userCreator: userCreatorInfo ? {
149
75
  name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
@@ -151,79 +77,64 @@ var AgentProfileCardResourced = exports.AgentProfileCardResourced = function Age
151
77
  } : undefined,
152
78
  forgeCreator: creator !== null && creator !== void 0 ? creator : undefined
153
79
  });
154
- return _context2.abrupt("return", creatorInfo);
80
+ return _context.abrupt("return", creatorInfo);
155
81
  case 10:
156
- _context2.prev = 10;
157
- _context2.t0 = _context2["catch"](1);
158
- return _context2.abrupt("return", undefined);
82
+ _context.prev = 10;
83
+ _context.t0 = _context["catch"](1);
84
+ return _context.abrupt("return", undefined);
159
85
  case 13:
160
86
  case "end":
161
- return _context2.stop();
87
+ return _context.stop();
162
88
  }
163
- }, _callee2, null, [[1, 10]]);
89
+ }, _callee, null, [[1, 10]]);
164
90
  }));
165
- return function (_x2) {
166
- return _ref4.apply(this, arguments);
91
+ return function (_x) {
92
+ return _ref2.apply(this, arguments);
167
93
  };
168
94
  }(), [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
169
- var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
170
- var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo, agentCreatorInfoDeprecated;
171
- return _regenerator.default.wrap(function _callee3$(_context3) {
172
- while (1) switch (_context3.prev = _context3.next) {
95
+ var fetchData = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
96
+ var _profileResult$aggDat, _profileResult$aggDat2, profileResult, profileData, creatorInfoProps, agentCreatorInfo;
97
+ return _regenerator.default.wrap(function _callee2$(_context2) {
98
+ while (1) switch (_context2.prev = _context2.next) {
173
99
  case 0:
174
100
  setIsLoading(true);
175
- _context3.prev = 1;
176
- _context3.next = 4;
101
+ _context2.prev = 1;
102
+ _context2.next = 4;
177
103
  return props.resourceClient.getRovoAgentProfile({
178
104
  type: 'identity',
179
105
  value: props.accountId
180
106
  }, fireEvent);
181
107
  case 4:
182
- profileResult = _context3.sent;
108
+ profileResult = _context2.sent;
183
109
  profileData = profileResult.restData;
184
110
  creatorInfoProps = {
185
111
  creator_type: profileData === null || profileData === void 0 ? void 0 : profileData.creator_type,
186
112
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
187
113
  authoringTeam: (_profileResult$aggDat = (_profileResult$aggDat2 = profileResult.aggData) === null || _profileResult$aggDat2 === void 0 ? void 0 : _profileResult$aggDat2.authoringTeam) !== null && _profileResult$aggDat !== void 0 ? _profileResult$aggDat : undefined
188
114
  };
189
- if (!(0, _platformFeatureFlags.fg)('rovo_agent_show_creator_on_profile_card_fix')) {
190
- _context3.next = 14;
191
- break;
192
- }
193
- _context3.next = 10;
115
+ _context2.next = 9;
194
116
  return getCreator(creatorInfoProps);
195
- case 10:
196
- agentCreatorInfo = _context3.sent;
117
+ case 9:
118
+ agentCreatorInfo = _context2.sent;
197
119
  setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
198
120
  creatorInfo: agentCreatorInfo
199
121
  }));
200
- _context3.next = 18;
122
+ _context2.next = 16;
201
123
  break;
202
- case 14:
203
- _context3.next = 16;
204
- return getCreatorDeprecated(creatorInfoProps);
124
+ case 13:
125
+ _context2.prev = 13;
126
+ _context2.t0 = _context2["catch"](1);
127
+ setError(_context2.t0);
205
128
  case 16:
206
- agentCreatorInfoDeprecated = _context3.sent;
207
- setAgentData(_objectSpread(_objectSpread({}, profileData), {}, {
208
- creatorInfo: agentCreatorInfoDeprecated
209
- }));
210
- case 18:
211
- _context3.next = 23;
212
- break;
213
- case 20:
214
- _context3.prev = 20;
215
- _context3.t0 = _context3["catch"](1);
216
- setError(_context3.t0);
217
- case 23:
218
- _context3.prev = 23;
129
+ _context2.prev = 16;
219
130
  setIsLoading(false);
220
- return _context3.finish(23);
221
- case 26:
131
+ return _context2.finish(16);
132
+ case 19:
222
133
  case "end":
223
- return _context3.stop();
134
+ return _context2.stop();
224
135
  }
225
- }, _callee3, null, [[1, 20, 23, 26]]);
226
- })), [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
136
+ }, _callee2, null, [[1, 13, 16, 19]]);
137
+ })), [fireEvent, getCreator, props.accountId, props.resourceClient]);
227
138
  (0, _react.useEffect)(function () {
228
139
  fetchData();
229
140
  }, [fetchData]);
@@ -170,6 +170,7 @@ var ProfilecardInternal = exports.ProfilecardInternal = function ProfilecardInte
170
170
  actions: realActions,
171
171
  fireAnalyticsWithDuration: fireAnalyticsWithDuration,
172
172
  isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard,
173
+ isRenderedInPortal: props.isRenderedInPortal,
173
174
  fireAnalyticsWithDurationNext: fireAnalyticsWithDurationNext
174
175
  }))))));
175
176
  };
@@ -178,6 +179,7 @@ var Actions = function Actions(_ref) {
178
179
  fireAnalyticsWithDuration = _ref.fireAnalyticsWithDuration,
179
180
  fireAnalyticsWithDurationNext = _ref.fireAnalyticsWithDurationNext,
180
181
  isTriggeredUsingKeyboard = _ref.isTriggeredUsingKeyboard,
182
+ isRenderedInPortal = _ref.isRenderedInPortal,
181
183
  fullName = _ref.fullName;
182
184
  var onActionClick = (0, _react.useCallback)(function (action, args, event, index) {
183
185
  if ((0, _platformFeatureFlags.fg)('ptc-enable-profile-card-analytics-refactor')) {
@@ -228,7 +230,7 @@ var Actions = function Actions(_ref) {
228
230
  },
229
231
  href: action.link || '',
230
232
  target: action.target,
231
- autoFocus: index === 0 && isTriggeredUsingKeyboard,
233
+ autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
232
234
  id: "action-button-".concat(action.id),
233
235
  "aria-labelledby": (0, _platformFeatureFlags.fg)('enable_userprofilecard_arialabelfix') ? "action-button-".concat(action.id, " profilecard-name-label") : ''
234
236
  }, action.label, isKudos && /*#__PURE__*/_react.default.createElement(_Card.AnimationWrapper, null, /*#__PURE__*/_react.default.createElement(_Card.KudosBlobAnimation, null)));
@@ -17,6 +17,7 @@ var _reactIntlNext = require("react-intl-next");
17
17
  var _lozenge = _interopRequireDefault(require("@atlaskit/lozenge"));
18
18
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
19
19
  var _compiled = require("@atlaskit/primitives/compiled");
20
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
20
21
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
21
22
  var _relativeDate = _interopRequireDefault(require("../../internal/relative-date"));
22
23
  var _messages = _interopRequireDefault(require("../../messages"));
@@ -35,7 +36,7 @@ var styles = {
35
36
  disabledAccount: "_syazi7uo",
36
37
  activeAccount: "_syaz15cr"
37
38
  };
38
- var renderName = function renderName(nickname, fullName, meta, nameRef) {
39
+ var renderName = function renderName(nickname, fullName, meta, nameRef, isRenderedInPortal, isTriggeredUsingKeyboard) {
39
40
  if (!fullName && !nickname) {
40
41
  return null;
41
42
  }
@@ -58,12 +59,15 @@ var renderName = function renderName(nickname, fullName, meta, nameRef) {
58
59
  as: "h2",
59
60
  xcss: (0, _react2.cx)(styles.fullNameLabel, styles.activeAccount, meta ? (0, _platformFeatureFlags.fg)('enable_absolute_positioning_profile_card') ? styles.metaLabelWithHighSpecificity : styles.metaLabel : (0, _platformFeatureFlags.fg)('enable_absolute_positioning_profile_card') ? styles.noMetaLabelWithHighSpecificity : styles.noMetaLabel),
60
61
  testId: "profilecard-name",
61
- id: "profilecard-name-label"
62
+ id: "profilecard-name-label",
63
+ tabIndex: isTriggeredUsingKeyboard && isRenderedInPortal && (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? -1 : undefined
62
64
  }, displayName)) : /*#__PURE__*/_react.default.createElement(_compiled.Box, {
65
+ ref: nameRef,
63
66
  as: "h2",
64
67
  xcss: (0, _react2.cx)(styles.fullNameLabel, styles.activeAccount, meta ? (0, _platformFeatureFlags.fg)('enable_absolute_positioning_profile_card') ? styles.metaLabelWithHighSpecificity : styles.metaLabel : (0, _platformFeatureFlags.fg)('enable_absolute_positioning_profile_card') ? styles.noMetaLabelWithHighSpecificity : styles.noMetaLabel),
65
68
  testId: "profilecard-name",
66
- id: "profilecard-name-label"
69
+ id: "profilecard-name-label",
70
+ tabIndex: isTriggeredUsingKeyboard && isRenderedInPortal && (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? -1 : undefined
67
71
  }, displayName);
68
72
  };
69
73
  var disabledAccountDesc = function disabledAccountDesc(statusModifiedDate, disabledAccountMessage) {
@@ -129,8 +133,21 @@ var DisabledProfileCardDetails = function DisabledProfileCardDetails(props) {
129
133
  };
130
134
  var ProfileCardDetails = exports.ProfileCardDetails = function ProfileCardDetails(props) {
131
135
  var meta = props.meta,
132
- status = props.status;
136
+ status = props.status,
137
+ isRenderedInPortal = props.isRenderedInPortal,
138
+ isTriggeredUsingKeyboard = props.isTriggeredUsingKeyboard;
133
139
  var nameRef = (0, _react.useRef)(null);
140
+ _react.default.useEffect(function () {
141
+ if (nameRef !== null && nameRef !== void 0 && nameRef.current && isRenderedInPortal && isTriggeredUsingKeyboard && (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true)) {
142
+ var rafId = requestAnimationFrame(function () {
143
+ var _nameRef$current;
144
+ (_nameRef$current = nameRef.current) === null || _nameRef$current === void 0 || _nameRef$current.focus();
145
+ });
146
+ return function () {
147
+ cancelAnimationFrame(rafId);
148
+ };
149
+ }
150
+ }, [isRenderedInPortal, isTriggeredUsingKeyboard]);
134
151
  if (props.isServiceAccount) {
135
152
  return /*#__PURE__*/_react.default.createElement(ServiceAccountProfileCardDetails, props);
136
153
  }
@@ -145,7 +162,7 @@ var ProfileCardDetails = exports.ProfileCardDetails = function ProfileCardDetail
145
162
  var lozenges = /*#__PURE__*/_react.default.createElement(CustomLozenges, {
146
163
  lozenges: props.customLozenges
147
164
  });
148
- return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef), meta && /*#__PURE__*/_react.default.createElement(_Card.JobTitleLabel, null, meta), meta && props.customLozenges && props.customLozenges.length > 0 ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
165
+ return /*#__PURE__*/_react.default.createElement(_Card.DetailsGroup, null, renderName(props.nickname, props.fullName, meta, nameRef, isRenderedInPortal, isTriggeredUsingKeyboard), meta && /*#__PURE__*/_react.default.createElement(_Card.JobTitleLabel, null, meta), meta && props.customLozenges && props.customLozenges.length > 0 ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
149
166
  paddingBlockStart: "space.150"
150
167
  }, lozenges) : lozenges, /*#__PURE__*/_react.default.createElement(_compiled.Box, {
151
168
  xcss: styles.detailedListWrapperNext
@@ -20,6 +20,7 @@ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
20
20
  var _popup = _interopRequireDefault(require("@atlaskit/popup"));
21
21
  var _teamsAppInternalAnalytics = require("@atlaskit/teams-app-internal-analytics");
22
22
  var _constants = require("@atlaskit/theme/constants");
23
+ var _expValEquals = require("@atlaskit/tmp-editor-statsig/exp-val-equals");
23
24
  var _filterActions = _interopRequireDefault(require("../../internal/filterActions"));
24
25
  var _getLabelMessage = _interopRequireDefault(require("../../internal/getLabelMessage"));
25
26
  var _UserTrigger = require("../../styled/UserTrigger");
@@ -45,6 +46,7 @@ function ProfileCardContent(_ref) {
45
46
  hasError = _ref.hasError,
46
47
  errorType = _ref.errorType,
47
48
  agentActions = _ref.agentActions,
49
+ isRenderedInPortal = _ref.isRenderedInPortal,
48
50
  addFlag = _ref.addFlag,
49
51
  hideAgentMoreActions = _ref.hideAgentMoreActions,
50
52
  hideAiDisclaimer = _ref.hideAiDisclaimer;
@@ -64,6 +66,7 @@ function ProfileCardContent(_ref) {
64
66
  return /*#__PURE__*/_react.default.createElement(_react.Suspense, {
65
67
  fallback: null
66
68
  }, /*#__PURE__*/_react.default.createElement(_lazyProfileCard.ProfileCardLazy, (0, _extends2.default)({}, profilecardProps, {
69
+ isRenderedInPortal: isRenderedInPortal,
67
70
  actions: profileCardAction,
68
71
  hasError: hasError,
69
72
  errorType: errorType,
@@ -100,6 +103,7 @@ function ProfilecardTriggerNext(_ref2) {
100
103
  _ref2$ariaHideProfile = _ref2.ariaHideProfileTrigger,
101
104
  ariaHideProfileTrigger = _ref2$ariaHideProfile === void 0 ? false : _ref2$ariaHideProfile,
102
105
  propsIsVisible = _ref2.isVisible,
106
+ isRenderedInPortal = _ref2.isRenderedInPortal,
103
107
  ssrPlaceholderId = _ref2.ssrPlaceholderId,
104
108
  customShowDelay = _ref2.showDelay,
105
109
  customHideDelay = _ref2.hideDelay;
@@ -395,7 +399,8 @@ function ProfilecardTriggerNext(_ref2) {
395
399
  agentActions: agentActions,
396
400
  addFlag: addFlag,
397
401
  hideAgentMoreActions: hideAgentMoreActions,
398
- hideAiDisclaimer: hideAiDisclaimer
402
+ hideAiDisclaimer: hideAiDisclaimer,
403
+ isRenderedInPortal: isRenderedInPortal
399
404
  }));
400
405
  },
401
406
  trigger: function trigger(triggerProps) {
@@ -426,7 +431,7 @@ function ProfilecardTriggerNext(_ref2) {
426
431
  },
427
432
  zIndex: _constants.layers.modal(),
428
433
  shouldUseCaptureOnOutsideClick: true,
429
- autoFocus: autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
434
+ autoFocus: (0, _expValEquals.expValEquals)('editor_a11y_7152_profile_card_tab_order', 'isEnabled', true) ? isRenderedInPortal && isTriggeredUsingKeyboard ? false : autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click' : autoFocus !== null && autoFocus !== void 0 ? autoFocus : trigger === 'click'
430
435
  // This feature gate is currently enabled only for Jira_Web to avoid UI issues in Confluence_Web.
431
436
  ,
432
437
  shouldRenderToParent: (0, _platformFeatureFlags.fg)('enable_appropriate_reading_order_in_profile_card'),
@@ -13,7 +13,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
13
13
  var ANALYTICS_CHANNEL = 'peopleTeams';
14
14
  var PACKAGE_META_DATA = exports.PACKAGE_META_DATA = {
15
15
  packageName: "@atlaskit/profilecard",
16
- packageVersion: "24.37.2"
16
+ packageVersion: "24.38.0"
17
17
  };
18
18
  var runItLater = function runItLater(cb) {
19
19
  var requestIdleCallback = window.requestIdleCallback;
@@ -58,7 +58,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
58
58
  actionSubjectId: actionSubjectId,
59
59
  attributes: _objectSpread(_objectSpread({
60
60
  packageName: "@atlaskit/profilecard",
61
- packageVersion: "24.37.2"
61
+ packageVersion: "24.38.0"
62
62
  }, attributes), {}, {
63
63
  firedAt: Math.round((0, _performance.getPageTime)())
64
64
  })
@@ -6,7 +6,7 @@ const ORG_ID_FROM_CLOUD_ID_QUERY = `query OrgIdFromCloudId($cloudId: ID!) {
6
6
  }`;
7
7
  const addHeaders = headers => {
8
8
  headers.append('atl-client-name', "@atlaskit/profilecard");
9
- headers.append('atl-client-version', "24.37.2");
9
+ headers.append('atl-client-version', "24.38.0");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -78,7 +78,7 @@ export const addHeaders = headers => {
78
78
  headers.append('X-ExperimentalApi', 'teams-beta');
79
79
  headers.append('X-ExperimentalApi', 'team-members-beta');
80
80
  headers.append('atl-client-name', "@atlaskit/profilecard");
81
- headers.append('atl-client-version', "24.37.2");
81
+ headers.append('atl-client-version', "24.38.0");
82
82
  return headers;
83
83
  };
84
84
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -24,63 +24,13 @@ export const AgentProfileCardResourced = props => {
24
24
  },
25
25
  cloudId: props.cloudId
26
26
  });
27
-
28
- /**
29
- * @TODO replace with `getAgentCreator` from `@atlassian/rovo-agent-components`
30
- * @deprecated use `getAgentCreator` from `@atlassian/rovo-agent-components`
31
- */
32
- const getCreatorDeprecated = useCallback(async ({
33
- creator_type,
34
- creator,
35
- authoringTeam
36
- }) => {
37
- if (!creator) {
38
- return undefined;
39
- }
40
- switch (creator_type) {
41
- case 'SYSTEM':
42
- return {
43
- type: 'SYSTEM'
44
- };
45
- case 'THIRD_PARTY':
46
- return {
47
- type: 'THIRD_PARTY',
48
- name: creator !== null && creator !== void 0 ? creator : ''
49
- };
50
- case 'CUSTOMER':
51
- try {
52
- if (!creatorUserId || !props.cloudId) {
53
- return undefined;
54
- }
55
- if (authoringTeam) {
56
- var _authoringTeam$displa, _authoringTeam$profil;
57
- return {
58
- type: 'CUSTOMER',
59
- name: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
60
- profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : ''
61
- };
62
- }
63
- const creatorInfo = await props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
64
- return {
65
- type: 'CUSTOMER',
66
- name: creatorInfo.fullName,
67
- profileLink: fg('platform-adopt-teams-nav-config') ? profileHref : `/people/${creatorUserId}`,
68
- id: creatorUserId
69
- };
70
- } catch {
71
- return undefined;
72
- }
73
- default:
74
- return undefined;
75
- }
76
- }, [creatorUserId, fireEvent, props.cloudId, props.resourceClient, profileHref]);
77
27
  const getCreator = useCallback(async ({
78
28
  creator_type,
79
29
  creator,
80
30
  authoringTeam
81
31
  }) => {
82
32
  try {
83
- var _authoringTeam$displa2, _authoringTeam$profil2, _userCreatorInfo$full;
33
+ var _authoringTeam$displa, _authoringTeam$profil, _userCreatorInfo$full;
84
34
  let userCreatorInfo;
85
35
  if (creatorUserId && props.cloudId) {
86
36
  userCreatorInfo = await props.resourceClient.getProfile(props.cloudId, creatorUserId, fireEvent);
@@ -88,8 +38,8 @@ export const AgentProfileCardResourced = props => {
88
38
  const creatorInfo = getAgentCreator({
89
39
  creatorType: creator_type !== null && creator_type !== void 0 ? creator_type : '',
90
40
  authoringTeam: authoringTeam ? {
91
- displayName: (_authoringTeam$displa2 = authoringTeam.displayName) !== null && _authoringTeam$displa2 !== void 0 ? _authoringTeam$displa2 : '',
92
- profileLink: (_authoringTeam$profil2 = authoringTeam.profileUrl) !== null && _authoringTeam$profil2 !== void 0 ? _authoringTeam$profil2 : undefined
41
+ displayName: (_authoringTeam$displa = authoringTeam.displayName) !== null && _authoringTeam$displa !== void 0 ? _authoringTeam$displa : '',
42
+ profileLink: (_authoringTeam$profil = authoringTeam.profileUrl) !== null && _authoringTeam$profil !== void 0 ? _authoringTeam$profil : undefined
93
43
  } : undefined,
94
44
  userCreator: userCreatorInfo ? {
95
45
  name: (_userCreatorInfo$full = userCreatorInfo.fullName) !== null && _userCreatorInfo$full !== void 0 ? _userCreatorInfo$full : '',
@@ -116,25 +66,17 @@ export const AgentProfileCardResourced = props => {
116
66
  creator: (profileData === null || profileData === void 0 ? void 0 : profileData.creator) || undefined,
117
67
  authoringTeam: (_profileResult$aggDat = (_profileResult$aggDat2 = profileResult.aggData) === null || _profileResult$aggDat2 === void 0 ? void 0 : _profileResult$aggDat2.authoringTeam) !== null && _profileResult$aggDat !== void 0 ? _profileResult$aggDat : undefined
118
68
  };
119
- if (fg('rovo_agent_show_creator_on_profile_card_fix')) {
120
- const agentCreatorInfo = await getCreator(creatorInfoProps);
121
- setAgentData({
122
- ...profileData,
123
- creatorInfo: agentCreatorInfo
124
- });
125
- } else {
126
- const agentCreatorInfoDeprecated = await getCreatorDeprecated(creatorInfoProps);
127
- setAgentData({
128
- ...profileData,
129
- creatorInfo: agentCreatorInfoDeprecated
130
- });
131
- }
69
+ const agentCreatorInfo = await getCreator(creatorInfoProps);
70
+ setAgentData({
71
+ ...profileData,
72
+ creatorInfo: agentCreatorInfo
73
+ });
132
74
  } catch (err) {
133
75
  setError(err);
134
76
  } finally {
135
77
  setIsLoading(false);
136
78
  }
137
- }, [fireEvent, getCreator, props.accountId, props.resourceClient, getCreatorDeprecated]);
79
+ }, [fireEvent, getCreator, props.accountId, props.resourceClient]);
138
80
  useEffect(() => {
139
81
  fetchData();
140
82
  }, [fetchData]);
@@ -155,6 +155,7 @@ export const ProfilecardInternal = props => {
155
155
  actions: realActions,
156
156
  fireAnalyticsWithDuration: fireAnalyticsWithDuration,
157
157
  isTriggeredUsingKeyboard: props.isTriggeredUsingKeyboard,
158
+ isRenderedInPortal: props.isRenderedInPortal,
158
159
  fireAnalyticsWithDurationNext: fireAnalyticsWithDurationNext
159
160
  }))))));
160
161
  };
@@ -163,6 +164,7 @@ const Actions = ({
163
164
  fireAnalyticsWithDuration,
164
165
  fireAnalyticsWithDurationNext,
165
166
  isTriggeredUsingKeyboard,
167
+ isRenderedInPortal,
166
168
  fullName
167
169
  }) => {
168
170
  const onActionClick = useCallback((action, args, event, index) => {
@@ -206,7 +208,7 @@ const Actions = ({
206
208
  onClick: (event, ...args) => onActionClick(action, args, event, index),
207
209
  href: action.link || '',
208
210
  target: action.target,
209
- autoFocus: index === 0 && isTriggeredUsingKeyboard,
211
+ autoFocus: index === 0 && isTriggeredUsingKeyboard && !isRenderedInPortal,
210
212
  id: `action-button-${action.id}`,
211
213
  "aria-labelledby": fg('enable_userprofilecard_arialabelfix') ? `action-button-${action.id} profilecard-name-label` : ''
212
214
  }, action.label, isKudos && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));