@atlaskit/profilecard 24.3.2 → 24.5.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,25 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 24.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#200836](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/200836)
8
+ [`4403807b49aca`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4403807b49aca) -
9
+ add option to customise showDelay and hideDelay
10
+
11
+ ## 24.4.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [#200712](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/200712)
16
+ [`79f68c9a9ad77`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/79f68c9a9ad77) -
17
+ Allow target to be passed to action
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 24.3.2
4
24
 
5
25
  ### 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', "24.3.1");
14
+ headers.append('atl-client-version', "24.4.0");
15
15
  return headers;
16
16
  };
17
17
  function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -65,7 +65,7 @@ var addHeaders = exports.addHeaders = function addHeaders(headers) {
65
65
  headers.append('X-ExperimentalApi', 'teams-beta');
66
66
  headers.append('X-ExperimentalApi', 'team-members-beta');
67
67
  headers.append('atl-client-name', "@atlaskit/profilecard");
68
- headers.append('atl-client-version', "24.3.1");
68
+ headers.append('atl-client-version', "24.4.0");
69
69
  return headers;
70
70
  };
71
71
  function getTeamFromAGG(_x, _x2, _x3) {
@@ -157,6 +157,7 @@ var ActionButton = function ActionButton(_ref2) {
157
157
  key: action.id || index,
158
158
  onClick: onActionClick(action, analytics, index),
159
159
  href: action.link || '',
160
+ target: action.target,
160
161
  shouldFitContainer: true
161
162
  }, action.label, isGiveKudosActionButton && /*#__PURE__*/_react.default.createElement(_Card.AnimationWrapper, null, /*#__PURE__*/_react.default.createElement(_Card.KudosBlobAnimation, null)));
162
163
  if (isGiveKudosActionButton) {
@@ -73,7 +73,8 @@ var OverflowProfileCardButtons = exports.OverflowProfileCardButtons = function O
73
73
  }
74
74
  onItemClick(action, args, event, index);
75
75
  },
76
- href: action.link
76
+ href: action.link,
77
+ target: action.target
77
78
  }, action.label);
78
79
  }))));
79
80
  };
@@ -179,6 +179,7 @@ var Actions = function Actions(_ref) {
179
179
  return onActionClick(action, args, event, index);
180
180
  },
181
181
  href: action.link || '',
182
+ target: action.target,
182
183
  autoFocus: index === 0 && isTriggeredUsingKeyboard,
183
184
  id: "action-button-".concat(action.id),
184
185
  "aria-labelledby": (0, _platformFeatureFlags.fg)('enable_userprofilecard_arialabelfix') ? "action-button-".concat(action.id, " profilecard-name-label") : ''
@@ -93,14 +93,16 @@ function ProfilecardTriggerNext(_ref2) {
93
93
  _ref2$ariaHideProfile = _ref2.ariaHideProfileTrigger,
94
94
  ariaHideProfileTrigger = _ref2$ariaHideProfile === void 0 ? false : _ref2$ariaHideProfile,
95
95
  propsIsVisible = _ref2.isVisible,
96
- ssrPlaceholderId = _ref2.ssrPlaceholderId;
96
+ ssrPlaceholderId = _ref2.ssrPlaceholderId,
97
+ customShowDelay = _ref2.showDelay,
98
+ customHideDelay = _ref2.hideDelay;
97
99
  var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
98
100
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
99
101
  var _useIntl = (0, _reactIntlNext.useIntl)(),
100
102
  formatMessage = _useIntl.formatMessage;
101
103
  var isMounted = (0, _react.useRef)(false);
102
- var showDelay = trigger === 'click' || propsIsVisible && (0, _platformFeatureFlags.fg)('fix_profilecard_trigger_isvisible') ? 0 : _config.DELAY_MS_SHOW;
103
- var hideDelay = trigger === 'click' || propsIsVisible && (0, _platformFeatureFlags.fg)('fix_profilecard_trigger_isvisible') ? 0 : _config.DELAY_MS_HIDE;
104
+ var showDelay = trigger === 'click' || propsIsVisible && (0, _platformFeatureFlags.fg)('fix_profilecard_trigger_isvisible') ? 0 : customShowDelay !== null && customShowDelay !== void 0 ? customShowDelay : _config.DELAY_MS_SHOW;
105
+ var hideDelay = trigger === 'click' || propsIsVisible && (0, _platformFeatureFlags.fg)('fix_profilecard_trigger_isvisible') ? 0 : customHideDelay !== null && customHideDelay !== void 0 ? customHideDelay : _config.DELAY_MS_HIDE;
104
106
  var showTimer = (0, _react.useRef)(0);
105
107
  var hideTimer = (0, _react.useRef)(0);
106
108
  var _useState = (0, _react.useState)(false),
@@ -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: "24.3.1"
48
+ packageVersion: "24.4.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', "24.3.1");
9
+ headers.append('atl-client-version', "24.4.0");
10
10
  return headers;
11
11
  };
12
12
  export async function getOrgIdForCloudIdFromAGG(url, cloudId) {
@@ -74,7 +74,7 @@ export const addHeaders = headers => {
74
74
  headers.append('X-ExperimentalApi', 'teams-beta');
75
75
  headers.append('X-ExperimentalApi', 'team-members-beta');
76
76
  headers.append('atl-client-name', "@atlaskit/profilecard");
77
- headers.append('atl-client-version', "24.3.1");
77
+ headers.append('atl-client-version', "24.4.0");
78
78
  return headers;
79
79
  };
80
80
  export async function getTeamFromAGG(url, teamId, siteId) {
@@ -137,6 +137,7 @@ const ActionButton = ({
137
137
  key: action.id || index,
138
138
  onClick: onActionClick(action, analytics, index),
139
139
  href: action.link || '',
140
+ target: action.target,
140
141
  shouldFitContainer: true
141
142
  }, action.label, isGiveKudosActionButton && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
142
143
  if (isGiveKudosActionButton) {
@@ -57,6 +57,7 @@ export const OverflowProfileCardButtons = props => {
57
57
  onClick: (event, ...args) => {
58
58
  onItemClick(action, args, event, index);
59
59
  },
60
- href: action.link
60
+ href: action.link,
61
+ target: action.target
61
62
  }, action.label)))));
62
63
  };
@@ -161,6 +161,7 @@ const Actions = ({
161
161
  key: action.id || index,
162
162
  onClick: (event, ...args) => onActionClick(action, args, event, index),
163
163
  href: action.link || '',
164
+ target: action.target,
164
165
  autoFocus: index === 0 && isTriggeredUsingKeyboard,
165
166
  id: `action-button-${action.id}`,
166
167
  "aria-labelledby": fg('enable_userprofilecard_arialabelfix') ? `action-button-${action.id} profilecard-name-label` : ''
@@ -71,7 +71,9 @@ export default function ProfilecardTriggerNext({
71
71
  agentActions,
72
72
  ariaHideProfileTrigger = false,
73
73
  isVisible: propsIsVisible,
74
- ssrPlaceholderId
74
+ ssrPlaceholderId,
75
+ showDelay: customShowDelay,
76
+ hideDelay: customHideDelay
75
77
  }) {
76
78
  const {
77
79
  createAnalyticsEvent
@@ -80,8 +82,8 @@ export default function ProfilecardTriggerNext({
80
82
  formatMessage
81
83
  } = useIntl();
82
84
  const isMounted = useRef(false);
83
- const showDelay = trigger === 'click' || propsIsVisible && fg('fix_profilecard_trigger_isvisible') ? 0 : DELAY_MS_SHOW;
84
- const hideDelay = trigger === 'click' || propsIsVisible && fg('fix_profilecard_trigger_isvisible') ? 0 : DELAY_MS_HIDE;
85
+ const showDelay = trigger === 'click' || propsIsVisible && fg('fix_profilecard_trigger_isvisible') ? 0 : customShowDelay !== null && customShowDelay !== void 0 ? customShowDelay : DELAY_MS_SHOW;
86
+ const hideDelay = trigger === 'click' || propsIsVisible && fg('fix_profilecard_trigger_isvisible') ? 0 : customHideDelay !== null && customHideDelay !== void 0 ? customHideDelay : DELAY_MS_HIDE;
85
87
  const showTimer = useRef(0);
86
88
  const hideTimer = useRef(0);
87
89
  const [visible, setVisible] = useState(false);
@@ -32,7 +32,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
32
32
  actionSubjectId,
33
33
  attributes: {
34
34
  packageName: "@atlaskit/profilecard",
35
- packageVersion: "24.3.1",
35
+ packageVersion: "24.4.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', "24.3.1");
7
+ headers.append('atl-client-version', "24.4.0");
8
8
  return headers;
9
9
  };
10
10
  export function getOrgIdForCloudIdFromAGG(_x, _x2) {
@@ -56,7 +56,7 @@ export var addHeaders = function addHeaders(headers) {
56
56
  headers.append('X-ExperimentalApi', 'teams-beta');
57
57
  headers.append('X-ExperimentalApi', 'team-members-beta');
58
58
  headers.append('atl-client-name', "@atlaskit/profilecard");
59
- headers.append('atl-client-version', "24.3.1");
59
+ headers.append('atl-client-version', "24.4.0");
60
60
  return headers;
61
61
  };
62
62
  export function getTeamFromAGG(_x, _x2, _x3) {
@@ -148,6 +148,7 @@ var ActionButton = function ActionButton(_ref2) {
148
148
  key: action.id || index,
149
149
  onClick: onActionClick(action, analytics, index),
150
150
  href: action.link || '',
151
+ target: action.target,
151
152
  shouldFitContainer: true
152
153
  }, action.label, isGiveKudosActionButton && /*#__PURE__*/React.createElement(AnimationWrapper, null, /*#__PURE__*/React.createElement(KudosBlobAnimation, null)));
153
154
  if (isGiveKudosActionButton) {
@@ -64,7 +64,8 @@ export var OverflowProfileCardButtons = function OverflowProfileCardButtons(prop
64
64
  }
65
65
  onItemClick(action, args, event, index);
66
66
  },
67
- href: action.link
67
+ href: action.link,
68
+ target: action.target
68
69
  }, action.label);
69
70
  }))));
70
71
  };
@@ -170,6 +170,7 @@ var Actions = function Actions(_ref) {
170
170
  return onActionClick(action, args, event, index);
171
171
  },
172
172
  href: action.link || '',
173
+ target: action.target,
173
174
  autoFocus: index === 0 && isTriggeredUsingKeyboard,
174
175
  id: "action-button-".concat(action.id),
175
176
  "aria-labelledby": fg('enable_userprofilecard_arialabelfix') ? "action-button-".concat(action.id, " profilecard-name-label") : ''
@@ -84,14 +84,16 @@ export default function ProfilecardTriggerNext(_ref2) {
84
84
  _ref2$ariaHideProfile = _ref2.ariaHideProfileTrigger,
85
85
  ariaHideProfileTrigger = _ref2$ariaHideProfile === void 0 ? false : _ref2$ariaHideProfile,
86
86
  propsIsVisible = _ref2.isVisible,
87
- ssrPlaceholderId = _ref2.ssrPlaceholderId;
87
+ ssrPlaceholderId = _ref2.ssrPlaceholderId,
88
+ customShowDelay = _ref2.showDelay,
89
+ customHideDelay = _ref2.hideDelay;
88
90
  var _useAnalyticsEvents = useAnalyticsEvents(),
89
91
  createAnalyticsEvent = _useAnalyticsEvents.createAnalyticsEvent;
90
92
  var _useIntl = useIntl(),
91
93
  formatMessage = _useIntl.formatMessage;
92
94
  var isMounted = useRef(false);
93
- var showDelay = trigger === 'click' || propsIsVisible && fg('fix_profilecard_trigger_isvisible') ? 0 : DELAY_MS_SHOW;
94
- var hideDelay = trigger === 'click' || propsIsVisible && fg('fix_profilecard_trigger_isvisible') ? 0 : DELAY_MS_HIDE;
95
+ var showDelay = trigger === 'click' || propsIsVisible && fg('fix_profilecard_trigger_isvisible') ? 0 : customShowDelay !== null && customShowDelay !== void 0 ? customShowDelay : DELAY_MS_SHOW;
96
+ var hideDelay = trigger === 'click' || propsIsVisible && fg('fix_profilecard_trigger_isvisible') ? 0 : customHideDelay !== null && customHideDelay !== void 0 ? customHideDelay : DELAY_MS_HIDE;
95
97
  var showTimer = useRef(0);
96
98
  var hideTimer = useRef(0);
97
99
  var _useState = useState(false),
@@ -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: "24.3.1"
42
+ packageVersion: "24.4.0"
43
43
  }, attributes), {}, {
44
44
  firedAt: Math.round(getPageTime())
45
45
  })
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { type ProfileCardTriggerProps } from '../../types';
3
- export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, }: ProfileCardTriggerProps): React.JSX.Element;
3
+ export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
@@ -183,6 +183,8 @@ export interface ProfileCardTriggerProps {
183
183
  agentActions?: AgentActionsType;
184
184
  ariaHideProfileTrigger?: boolean;
185
185
  ssrPlaceholderId?: string;
186
+ showDelay?: number;
187
+ hideDelay?: number;
186
188
  }
187
189
  export interface ProfileCardTriggerState {
188
190
  visible?: boolean;
@@ -370,6 +372,7 @@ export interface ProfileCardAction {
370
372
  id?: string;
371
373
  label: React.ReactNode;
372
374
  link?: string;
375
+ target?: string;
373
376
  }
374
377
  export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
375
378
  export interface LozengeProps {
@@ -1,3 +1,3 @@
1
1
  import React from 'react';
2
2
  import { type ProfileCardTriggerProps } from '../../types';
3
- export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, }: ProfileCardTriggerProps): React.JSX.Element;
3
+ export default function ProfilecardTriggerNext({ autoFocus, trigger, userId, cloudId, resourceClient, actions, position, children, testId, addFlag, onReportingLinesClick, ariaLabel, ariaLabelledBy, prepopulatedData, disabledAriaAttributes, onVisibilityChange, offset, viewingUserId, product, agentActions, ariaHideProfileTrigger, isVisible: propsIsVisible, ssrPlaceholderId, showDelay: customShowDelay, hideDelay: customHideDelay, }: ProfileCardTriggerProps): React.JSX.Element;
@@ -186,6 +186,8 @@ export interface ProfileCardTriggerProps {
186
186
  agentActions?: AgentActionsType;
187
187
  ariaHideProfileTrigger?: boolean;
188
188
  ssrPlaceholderId?: string;
189
+ showDelay?: number;
190
+ hideDelay?: number;
189
191
  }
190
192
  export interface ProfileCardTriggerState {
191
193
  visible?: boolean;
@@ -376,6 +378,7 @@ export interface ProfileCardAction {
376
378
  id?: string;
377
379
  label: React.ReactNode;
378
380
  link?: string;
381
+ target?: string;
379
382
  }
380
383
  export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
381
384
  export interface LozengeProps {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "24.3.2",
3
+ "version": "24.5.0",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -61,11 +61,11 @@
61
61
  "@atlaskit/feature-gate-js-client": "^5.5.0",
62
62
  "@atlaskit/give-kudos": "^4.3.0",
63
63
  "@atlaskit/heading": "^5.2.0",
64
- "@atlaskit/icon": "^27.11.0",
64
+ "@atlaskit/icon": "^27.12.0",
65
65
  "@atlaskit/link": "^3.2.0",
66
66
  "@atlaskit/logo": "^19.6.0",
67
67
  "@atlaskit/lozenge": "^13.0.0",
68
- "@atlaskit/menu": "^8.2.0",
68
+ "@atlaskit/menu": "^8.3.0",
69
69
  "@atlaskit/modal-dialog": "^14.3.0",
70
70
  "@atlaskit/people-teams-ui-public": "^3.1.0",
71
71
  "@atlaskit/platform-feature-flags": "^1.1.0",