@atlaskit/profilecard 22.2.4 → 23.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,38 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 23.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#116595](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/116595)
8
+ [`7491a878d7b16`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7491a878d7b16) -
9
+ Remove rovo_profile_card_open_chat_sidebar flag
10
+
11
+ ### Patch Changes
12
+
13
+ - [#117215](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117215)
14
+ [`e7fe78a1d113f`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e7fe78a1d113f) -
15
+ Fix for isVisible
16
+ - Updated dependencies
17
+
18
+ ## 23.0.0
19
+
20
+ ### Major Changes
21
+
22
+ - [#117363](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117363)
23
+ [`10a0f7f6c2027`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/10a0f7f6c2027) -
24
+ This package's `peerDependencies` have been adjusted for `react` and/or `react-dom` to reflect the
25
+ status of only supporting React 18 going forward. No explicit breaking change to React support has
26
+ been made in this release, but this is to signify going forward, breaking changes for React 16 or
27
+ React 17 may come via non-major semver releases.
28
+
29
+ Please refer this community post for more details:
30
+ https://community.developer.atlassian.com/t/rfc-78-dropping-support-for-react-16-and-rendering-in-a-react-18-concurrent-root-in-jira-and-confluence/87026
31
+
32
+ ### Patch Changes
33
+
34
+ - Updated dependencies
35
+
3
36
  ## 22.2.4
4
37
 
5
38
  ### Patch Changes
@@ -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', "22.2.4");
14
+ headers.append('atl-client-version', "23.1.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', "22.2.4");
69
+ headers.append('atl-client-version', "23.1.0");
70
70
  return headers;
71
71
  };
72
72
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -9,7 +9,6 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
  var _react = require("react");
11
11
  var _atlassianContext = require("@atlaskit/atlassian-context");
12
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
13
12
  var _rovoTriggers = require("@atlaskit/rovo-triggers");
14
13
  var _url = require("../../../util/url");
15
14
  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; }
@@ -70,26 +69,22 @@ var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlAction
70
69
  })));
71
70
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
72
71
  };
73
- if ((0, _platformFeatureFlags.fg)('rovo_profile_card_open_chat_sidebar')) {
74
- publishWithPostMessage({
75
- targetWindow: window,
76
- payload: {
77
- type: 'chat-new',
78
- source: 'AgentProfileCard',
79
- data: {
80
- name: prompt.slice(0, 50),
81
- prompt: prompt,
82
- agentId: agentId,
83
- dialogues: []
84
- }
85
- },
86
- onAcknowledgeTimeout: function onAcknowledgeTimeout() {
87
- startConversationInNewTab();
72
+ publishWithPostMessage({
73
+ targetWindow: window,
74
+ payload: {
75
+ type: 'chat-new',
76
+ source: 'AgentProfileCard',
77
+ data: {
78
+ name: prompt.slice(0, 50),
79
+ prompt: prompt,
80
+ agentId: agentId,
81
+ dialogues: []
88
82
  }
89
- });
90
- } else {
91
- startConversationInNewTab();
92
- }
83
+ },
84
+ onAcknowledgeTimeout: function onAcknowledgeTimeout() {
85
+ startConversationInNewTab();
86
+ }
87
+ });
93
88
  };
94
89
  var onOpenChat = function onOpenChat(agentId, agentName) {
95
90
  var openChatInNewTab = function openChatInNewTab() {
@@ -102,25 +97,21 @@ var useAgentUrlActions = exports.useAgentUrlActions = function useAgentUrlAction
102
97
  })));
103
98
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
104
99
  };
105
- if ((0, _platformFeatureFlags.fg)('rovo_profile_card_open_chat_sidebar')) {
106
- publishWithPostMessage({
107
- targetWindow: window,
108
- payload: {
109
- type: 'chat-new',
110
- source: 'AgentProfileCard',
111
- data: {
112
- agentId: agentId,
113
- dialogues: [],
114
- name: "Chat with ".concat(agentName)
115
- }
116
- },
117
- onAcknowledgeTimeout: function onAcknowledgeTimeout() {
118
- openChatInNewTab();
100
+ publishWithPostMessage({
101
+ targetWindow: window,
102
+ payload: {
103
+ type: 'chat-new',
104
+ source: 'AgentProfileCard',
105
+ data: {
106
+ agentId: agentId,
107
+ dialogues: [],
108
+ name: "Chat with ".concat(agentName)
119
109
  }
120
- });
121
- } else {
122
- openChatInNewTab();
123
- }
110
+ },
111
+ onAcknowledgeTimeout: function onAcknowledgeTimeout() {
112
+ openChatInNewTab();
113
+ }
114
+ });
124
115
  };
125
116
  var onViewFullProfile = function onViewFullProfile(agentId) {
126
117
  window.open("".concat(window.location.origin, "/people/agent/").concat(agentId), '_blank', 'noopener, noreferrer');
@@ -294,6 +294,11 @@ function ProfilecardTriggerNext(_ref2) {
294
294
  if (!(0, _platformFeatureFlags.fg)('fix_profilecard_trigger_isvisible')) {
295
295
  return;
296
296
  }
297
+ // If the prop isVisible is not defined, we don't want to do anything
298
+ if (propsIsVisible === undefined) {
299
+ return;
300
+ }
301
+ // If the prop isVisible is defined, we want to show or hide the profile card based on the value
297
302
  if (propsIsVisible) {
298
303
  showProfilecard();
299
304
  } else {
@@ -45,7 +45,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
45
45
  actionSubjectId: actionSubjectId,
46
46
  attributes: _objectSpread(_objectSpread({
47
47
  packageName: "@atlaskit/profilecard",
48
- packageVersion: "22.2.4"
48
+ packageVersion: "23.1.0"
49
49
  }, attributes), {}, {
50
50
  firedAt: Math.round((0, _performance.getPageTime)())
51
51
  })
@@ -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', "22.2.4");
9
+ headers.append('atl-client-version', "23.1.0");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -75,7 +75,7 @@ export const addHeaders = headers => {
75
75
  headers.append('X-ExperimentalApi', 'teams-beta');
76
76
  headers.append('X-ExperimentalApi', 'team-members-beta');
77
77
  headers.append('atl-client-name', "@atlaskit/profilecard");
78
- headers.append('atl-client-version', "22.2.4");
78
+ headers.append('atl-client-version', "23.1.0");
79
79
  return headers;
80
80
  };
81
81
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -1,6 +1,5 @@
1
1
  import { useCallback } from 'react';
2
2
  import { getATLContextUrl } from '@atlaskit/atlassian-context';
3
- import { fg } from '@atlaskit/platform-feature-flags';
4
3
  import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers';
5
4
  import { encodeParamsToUrl } from '../../../util/url';
6
5
  export const firstCharUpper = str => str.charAt(0).toUpperCase() + str.slice(1);
@@ -60,26 +59,22 @@ export const useAgentUrlActions = ({
60
59
  });
61
60
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
62
61
  };
63
- if (fg('rovo_profile_card_open_chat_sidebar')) {
64
- publishWithPostMessage({
65
- targetWindow: window,
66
- payload: {
67
- type: 'chat-new',
68
- source: 'AgentProfileCard',
69
- data: {
70
- name: prompt.slice(0, 50),
71
- prompt,
72
- agentId,
73
- dialogues: []
74
- }
75
- },
76
- onAcknowledgeTimeout: () => {
77
- startConversationInNewTab();
62
+ publishWithPostMessage({
63
+ targetWindow: window,
64
+ payload: {
65
+ type: 'chat-new',
66
+ source: 'AgentProfileCard',
67
+ data: {
68
+ name: prompt.slice(0, 50),
69
+ prompt,
70
+ agentId,
71
+ dialogues: []
78
72
  }
79
- });
80
- } else {
81
- startConversationInNewTab();
82
- }
73
+ },
74
+ onAcknowledgeTimeout: () => {
75
+ startConversationInNewTab();
76
+ }
77
+ });
83
78
  };
84
79
  const onOpenChat = (agentId, agentName) => {
85
80
  const openChatInNewTab = () => {
@@ -93,25 +88,21 @@ export const useAgentUrlActions = ({
93
88
  });
94
89
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
95
90
  };
96
- if (fg('rovo_profile_card_open_chat_sidebar')) {
97
- publishWithPostMessage({
98
- targetWindow: window,
99
- payload: {
100
- type: 'chat-new',
101
- source: 'AgentProfileCard',
102
- data: {
103
- agentId,
104
- dialogues: [],
105
- name: `Chat with ${agentName}`
106
- }
107
- },
108
- onAcknowledgeTimeout: () => {
109
- openChatInNewTab();
91
+ publishWithPostMessage({
92
+ targetWindow: window,
93
+ payload: {
94
+ type: 'chat-new',
95
+ source: 'AgentProfileCard',
96
+ data: {
97
+ agentId,
98
+ dialogues: [],
99
+ name: `Chat with ${agentName}`
110
100
  }
111
- });
112
- } else {
113
- openChatInNewTab();
114
- }
101
+ },
102
+ onAcknowledgeTimeout: () => {
103
+ openChatInNewTab();
104
+ }
105
+ });
115
106
  };
116
107
  const onViewFullProfile = agentId => {
117
108
  window.open(`${window.location.origin}/people/agent/${agentId}`, '_blank', 'noopener, noreferrer');
@@ -227,6 +227,11 @@ export default function ProfilecardTriggerNext({
227
227
  if (!fg('fix_profilecard_trigger_isvisible')) {
228
228
  return;
229
229
  }
230
+ // If the prop isVisible is not defined, we don't want to do anything
231
+ if (propsIsVisible === undefined) {
232
+ return;
233
+ }
234
+ // If the prop isVisible is defined, we want to show or hide the profile card based on the value
230
235
  if (propsIsVisible) {
231
236
  showProfilecard();
232
237
  } else {
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
32
32
  actionSubjectId,
33
33
  attributes: {
34
34
  packageName: "@atlaskit/profilecard",
35
- packageVersion: "22.2.4",
35
+ packageVersion: "23.1.0",
36
36
  ...attributes,
37
37
  firedAt: Math.round(getPageTime())
38
38
  }
@@ -4,7 +4,7 @@ import { AGGQuery } from './graphqlUtils';
4
4
  var ORG_ID_FROM_CLOUD_ID_QUERY = "query OrgIdFromCloudId($cloudId: ID!) {\n\ttenantContexts(cloudIds: [$cloudId]) {\n\t\torgId\n\t}\n}";
5
5
  var addHeaders = function addHeaders(headers) {
6
6
  headers.append('atl-client-name', "@atlaskit/profilecard");
7
- headers.append('atl-client-version', "22.2.4");
7
+ headers.append('atl-client-version', "23.1.0");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -57,7 +57,7 @@ export var addHeaders = function addHeaders(headers) {
57
57
  headers.append('X-ExperimentalApi', 'teams-beta');
58
58
  headers.append('X-ExperimentalApi', 'team-members-beta');
59
59
  headers.append('atl-client-name', "@atlaskit/profilecard");
60
- headers.append('atl-client-version', "22.2.4");
60
+ headers.append('atl-client-version', "23.1.0");
61
61
  return headers;
62
62
  };
63
63
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -4,7 +4,6 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
4
4
  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; }
5
5
  import { useCallback } from 'react';
6
6
  import { getATLContextUrl } from '@atlaskit/atlassian-context';
7
- import { fg } from '@atlaskit/platform-feature-flags';
8
7
  import { useRovoPostMessageToPubsub } from '@atlaskit/rovo-triggers';
9
8
  import { encodeParamsToUrl } from '../../../util/url';
10
9
  export var firstCharUpper = function firstCharUpper(str) {
@@ -63,26 +62,22 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
63
62
  })));
64
63
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
65
64
  };
66
- if (fg('rovo_profile_card_open_chat_sidebar')) {
67
- publishWithPostMessage({
68
- targetWindow: window,
69
- payload: {
70
- type: 'chat-new',
71
- source: 'AgentProfileCard',
72
- data: {
73
- name: prompt.slice(0, 50),
74
- prompt: prompt,
75
- agentId: agentId,
76
- dialogues: []
77
- }
78
- },
79
- onAcknowledgeTimeout: function onAcknowledgeTimeout() {
80
- startConversationInNewTab();
65
+ publishWithPostMessage({
66
+ targetWindow: window,
67
+ payload: {
68
+ type: 'chat-new',
69
+ source: 'AgentProfileCard',
70
+ data: {
71
+ name: prompt.slice(0, 50),
72
+ prompt: prompt,
73
+ agentId: agentId,
74
+ dialogues: []
81
75
  }
82
- });
83
- } else {
84
- startConversationInNewTab();
85
- }
76
+ },
77
+ onAcknowledgeTimeout: function onAcknowledgeTimeout() {
78
+ startConversationInNewTab();
79
+ }
80
+ });
86
81
  };
87
82
  var onOpenChat = function onOpenChat(agentId, agentName) {
88
83
  var openChatInNewTab = function openChatInNewTab() {
@@ -95,25 +90,21 @@ export var useAgentUrlActions = function useAgentUrlActions(_ref3) {
95
90
  })));
96
91
  window.open(urlWithParams, '_blank', 'noopener, noreferrer');
97
92
  };
98
- if (fg('rovo_profile_card_open_chat_sidebar')) {
99
- publishWithPostMessage({
100
- targetWindow: window,
101
- payload: {
102
- type: 'chat-new',
103
- source: 'AgentProfileCard',
104
- data: {
105
- agentId: agentId,
106
- dialogues: [],
107
- name: "Chat with ".concat(agentName)
108
- }
109
- },
110
- onAcknowledgeTimeout: function onAcknowledgeTimeout() {
111
- openChatInNewTab();
93
+ publishWithPostMessage({
94
+ targetWindow: window,
95
+ payload: {
96
+ type: 'chat-new',
97
+ source: 'AgentProfileCard',
98
+ data: {
99
+ agentId: agentId,
100
+ dialogues: [],
101
+ name: "Chat with ".concat(agentName)
112
102
  }
113
- });
114
- } else {
115
- openChatInNewTab();
116
- }
103
+ },
104
+ onAcknowledgeTimeout: function onAcknowledgeTimeout() {
105
+ openChatInNewTab();
106
+ }
107
+ });
117
108
  };
118
109
  var onViewFullProfile = function onViewFullProfile(agentId) {
119
110
  window.open("".concat(window.location.origin, "/people/agent/").concat(agentId), '_blank', 'noopener, noreferrer');
@@ -284,6 +284,11 @@ export default function ProfilecardTriggerNext(_ref2) {
284
284
  if (!fg('fix_profilecard_trigger_isvisible')) {
285
285
  return;
286
286
  }
287
+ // If the prop isVisible is not defined, we don't want to do anything
288
+ if (propsIsVisible === undefined) {
289
+ return;
290
+ }
291
+ // If the prop isVisible is defined, we want to show or hide the profile card based on the value
287
292
  if (propsIsVisible) {
288
293
  showProfilecard();
289
294
  } else {
@@ -39,7 +39,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
39
39
  actionSubjectId: actionSubjectId,
40
40
  attributes: _objectSpread(_objectSpread({
41
41
  packageName: "@atlaskit/profilecard",
42
- packageVersion: "22.2.4"
42
+ packageVersion: "23.1.0"
43
43
  }, attributes), {}, {
44
44
  firedAt: Math.round(getPageTime())
45
45
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "22.2.4",
3
+ "version": "23.1.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -50,30 +50,30 @@
50
50
  "access": "public"
51
51
  },
52
52
  "dependencies": {
53
- "@atlaskit/analytics-next": "^10.3.0",
54
- "@atlaskit/atlassian-context": "^0.1.0",
55
- "@atlaskit/avatar": "^21.18.0",
56
- "@atlaskit/avatar-group": "^11.2.0",
57
- "@atlaskit/button": "^20.5.0",
58
- "@atlaskit/css": "^0.9.0",
59
- "@atlaskit/dropdown-menu": "^12.26.0",
60
- "@atlaskit/empty-state": "^8.3.0",
61
- "@atlaskit/focus-ring": "^2.1.0",
62
- "@atlaskit/give-kudos": "^3.2.0",
63
- "@atlaskit/icon": "^23.11.0",
64
- "@atlaskit/lozenge": "^11.14.0",
65
- "@atlaskit/menu": "^2.14.0",
66
- "@atlaskit/modal-dialog": "^12.20.0",
67
- "@atlaskit/people-teams-ui-public": "^2.1.0",
53
+ "@atlaskit/analytics-next": "^11.0.0",
54
+ "@atlaskit/atlassian-context": "^0.2.0",
55
+ "@atlaskit/avatar": "^23.0.0",
56
+ "@atlaskit/avatar-group": "^12.0.0",
57
+ "@atlaskit/button": "^21.1.0",
58
+ "@atlaskit/css": "^0.10.0",
59
+ "@atlaskit/dropdown-menu": "^13.0.0",
60
+ "@atlaskit/empty-state": "^9.0.0",
61
+ "@atlaskit/focus-ring": "^3.0.0",
62
+ "@atlaskit/give-kudos": "^4.0.0",
63
+ "@atlaskit/icon": "^24.0.0",
64
+ "@atlaskit/lozenge": "^12.0.0",
65
+ "@atlaskit/menu": "^3.0.0",
66
+ "@atlaskit/modal-dialog": "^13.0.0",
67
+ "@atlaskit/people-teams-ui-public": "^3.0.0",
68
68
  "@atlaskit/platform-feature-flags": "^1.1.0",
69
- "@atlaskit/popup": "^1.32.0",
70
- "@atlaskit/primitives": "^13.6.0",
71
- "@atlaskit/rovo-agent-components": "^1.19.0",
72
- "@atlaskit/rovo-triggers": "^1.6.0",
73
- "@atlaskit/spinner": "^17.2.0",
74
- "@atlaskit/theme": "^16.0.0",
75
- "@atlaskit/tokens": "^3.3.0",
76
- "@atlaskit/tooltip": "^19.2.0",
69
+ "@atlaskit/popup": "^2.0.0",
70
+ "@atlaskit/primitives": "^14.0.0",
71
+ "@atlaskit/rovo-agent-components": "^2.0.0",
72
+ "@atlaskit/rovo-triggers": "^2.0.0",
73
+ "@atlaskit/spinner": "^18.0.0",
74
+ "@atlaskit/theme": "^17.0.0",
75
+ "@atlaskit/tokens": "^4.1.0",
76
+ "@atlaskit/tooltip": "^20.0.0",
77
77
  "@babel/runtime": "^7.0.0",
78
78
  "@compiled/react": "^0.18.2",
79
79
  "@emotion/react": "^11.7.1",
@@ -87,7 +87,7 @@
87
87
  "react-intl-next": "npm:react-intl@^5.18.1"
88
88
  },
89
89
  "peerDependencies": {
90
- "react": "^16.8.0 || ^17.0.0 || ^18.2.0",
90
+ "react": "^18.2.0",
91
91
  "react-dom": "^18.2.0"
92
92
  },
93
93
  "devDependencies": {
@@ -138,9 +138,6 @@
138
138
  "rovo_use_agent_permissions": {
139
139
  "type": "boolean"
140
140
  },
141
- "rovo_profile_card_open_chat_sidebar": {
142
- "type": "boolean"
143
- },
144
141
  "show_verified_team_icon_in_profile_card": {
145
142
  "type": "boolean"
146
143
  },