@atlaskit/profilecard 19.1.0 → 19.2.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 +12 -0
- package/dist/cjs/client/errorUtils.js +5 -5
- package/dist/cjs/client/graphqlUtils.js +9 -4
- package/dist/cjs/components/User/ProfileCardTrigger.js +13 -4
- package/dist/cjs/util/analytics.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/es2019/client/errorUtils.js +5 -5
- package/dist/es2019/client/graphqlUtils.js +9 -4
- package/dist/es2019/components/User/ProfileCardTrigger.js +13 -4
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/esm/client/errorUtils.js +5 -5
- package/dist/esm/client/graphqlUtils.js +9 -4
- package/dist/esm/components/User/ProfileCardTrigger.js +13 -4
- package/dist/esm/util/analytics.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/types/client/errorUtils.d.ts +5 -3
- package/dist/types/client/graphqlUtils.d.ts +4 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/profilecard
|
|
2
2
|
|
|
3
|
+
## 19.2.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`2af6359970f`](https://bitbucket.org/atlassian/atlassian-frontend/commits/2af6359970f) - [ux] This change (related to TSLA-521) adds an onFocus handler for the profile card trigger that performs the same behavior as onHover. The change also adds an onBlur handler.
|
|
8
|
+
|
|
9
|
+
## 19.1.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`f80d2e43a41`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f80d2e43a41) - Added traceId, errorSource and errorMessage to analytic events
|
|
14
|
+
|
|
3
15
|
## 19.1.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
|
@@ -10,16 +10,16 @@ var IGNORED_ERRORS = [
|
|
|
10
10
|
// Error categories from AGG
|
|
11
11
|
'TEAMS_FORBIDDEN', 'TEAMS_TEAM_DELETED'];
|
|
12
12
|
function isIgnoredError(error) {
|
|
13
|
-
return !!error && IGNORED_ERRORS.includes(error.reason);
|
|
13
|
+
return !!error && !!error.reason && IGNORED_ERRORS.includes(error.reason);
|
|
14
14
|
}
|
|
15
15
|
var getErrorAttributes = function getErrorAttributes(error) {
|
|
16
|
-
var _error$
|
|
17
|
-
var traceId = !!error ? (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$heade = _error$response.headers) === null || _error$response$heade === void 0 ? void 0 : _error$response$heade.get('atl-traceid') : undefined;
|
|
16
|
+
var _error$traceId;
|
|
18
17
|
return {
|
|
18
|
+
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
19
19
|
errorStatus: error === null || error === void 0 ? void 0 : error.code,
|
|
20
|
-
errorReason: error === null || error === void 0 ? void 0 : error.reason,
|
|
20
|
+
errorReason: (error === null || error === void 0 ? void 0 : error.reason) || 'default',
|
|
21
21
|
isSLOFailure: !isIgnoredError(error),
|
|
22
|
-
traceId: traceId !== null && traceId !== void 0 ? traceId : undefined
|
|
22
|
+
traceId: (_error$traceId = error === null || error === void 0 ? void 0 : error.traceId) !== null && _error$traceId !== void 0 ? _error$traceId : undefined
|
|
23
23
|
};
|
|
24
24
|
};
|
|
25
25
|
exports.getErrorAttributes = getErrorAttributes;
|
|
@@ -29,9 +29,12 @@ function graphqlQuery(serviceUrl, query) {
|
|
|
29
29
|
body: JSON.stringify(query)
|
|
30
30
|
})).then(function (response) {
|
|
31
31
|
if (!response.ok) {
|
|
32
|
+
var _response$headers;
|
|
33
|
+
var traceIdFromHeaders = response === null || response === void 0 ? void 0 : (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.get('atl-traceid');
|
|
32
34
|
return Promise.reject({
|
|
33
35
|
code: response.status,
|
|
34
|
-
reason: response.statusText
|
|
36
|
+
reason: response.statusText,
|
|
37
|
+
traceId: traceIdFromHeaders
|
|
35
38
|
});
|
|
36
39
|
}
|
|
37
40
|
return response;
|
|
@@ -39,11 +42,13 @@ function graphqlQuery(serviceUrl, query) {
|
|
|
39
42
|
return response.json();
|
|
40
43
|
}).then(function (json) {
|
|
41
44
|
if (json.errors) {
|
|
42
|
-
var _json$errors$, _json$errors$2, _json$errors$2$extens, _json$errors$3, _json$errors$3$extens;
|
|
43
|
-
// We need to handle responses from pf-directory and AGG
|
|
45
|
+
var _json$errors$, _json$errors$2, _json$errors$2$extens, _json$errors$3, _json$errors$3$extens, _json$errors$4, _json$errors$4$extens, _json$extensions, _json$extensions$gate;
|
|
44
46
|
return Promise.reject({
|
|
45
47
|
reason: ((_json$errors$ = json.errors[0]) === null || _json$errors$ === void 0 ? void 0 : _json$errors$.category) || ((_json$errors$2 = json.errors[0]) === null || _json$errors$2 === void 0 ? void 0 : (_json$errors$2$extens = _json$errors$2.extensions) === null || _json$errors$2$extens === void 0 ? void 0 : _json$errors$2$extens.classification) || 'default',
|
|
46
|
-
code: (_json$errors$3 = json.errors[0]) === null || _json$errors$3 === void 0 ? void 0 : (_json$errors$3$extens = _json$errors$3.extensions) === null || _json$errors$3$extens === void 0 ? void 0 : _json$errors$3$extens.statusCode
|
|
48
|
+
code: (_json$errors$3 = json.errors[0]) === null || _json$errors$3 === void 0 ? void 0 : (_json$errors$3$extens = _json$errors$3.extensions) === null || _json$errors$3$extens === void 0 ? void 0 : _json$errors$3$extens.statusCode,
|
|
49
|
+
errorSource: (_json$errors$4 = json.errors[0]) === null || _json$errors$4 === void 0 ? void 0 : (_json$errors$4$extens = _json$errors$4.extensions) === null || _json$errors$4$extens === void 0 ? void 0 : _json$errors$4$extens.errorSource,
|
|
50
|
+
message: json.errors[0].message,
|
|
51
|
+
traceId: (_json$extensions = json.extensions) === null || _json$extensions === void 0 ? void 0 : (_json$extensions$gate = _json$extensions.gateway) === null || _json$extensions$gate === void 0 ? void 0 : _json$extensions$gate.request_id
|
|
47
52
|
});
|
|
48
53
|
}
|
|
49
54
|
return json.data;
|
|
@@ -95,6 +95,12 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
95
95
|
_this.fireAnalytics((0, _analytics.cardTriggered)('user', 'hover'));
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
|
+
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onFocus", function () {
|
|
99
|
+
_this.showProfilecard();
|
|
100
|
+
if (!_this.state.visible) {
|
|
101
|
+
_this.fireAnalytics((0, _analytics.cardTriggered)('user', 'hover'));
|
|
102
|
+
}
|
|
103
|
+
});
|
|
98
104
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onKeyPress", function (event) {
|
|
99
105
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
100
106
|
event.preventDefault();
|
|
@@ -106,7 +112,9 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
106
112
|
});
|
|
107
113
|
(0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerListeners", _this.props.trigger === 'hover' ? {
|
|
108
114
|
onMouseEnter: _this.onMouseEnter,
|
|
109
|
-
onMouseLeave: _this.hideProfilecard
|
|
115
|
+
onMouseLeave: _this.hideProfilecard,
|
|
116
|
+
onFocus: _this.onFocus,
|
|
117
|
+
onBlur: _this.hideProfilecard
|
|
110
118
|
} : {
|
|
111
119
|
onClick: _this.onClick,
|
|
112
120
|
onKeyPress: _this.onKeyPress
|
|
@@ -254,7 +262,8 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
254
262
|
});
|
|
255
263
|
var wrapperProps = this.props.trigger === 'hover' ? {
|
|
256
264
|
onMouseEnter: this.onMouseEnter,
|
|
257
|
-
onMouseLeave: this.hideProfilecard
|
|
265
|
+
onMouseLeave: this.hideProfilecard,
|
|
266
|
+
onFocus: this.onFocus
|
|
258
267
|
} : {};
|
|
259
268
|
return /*#__PURE__*/_react.default.createElement("div", wrapperProps, this.state.visible && /*#__PURE__*/_react.default.createElement(_react.Suspense, {
|
|
260
269
|
fallback: null
|
|
@@ -280,8 +289,8 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
280
289
|
return /*#__PURE__*/_react.default.createElement("span", (0, _extends2.default)({}, innerProps, _this3.containerListeners, {
|
|
281
290
|
ref: ref,
|
|
282
291
|
"data-testid": _this3.props.testId,
|
|
283
|
-
|
|
284
|
-
|
|
292
|
+
role: _this3.props.trigger !== 'hover' ? 'button' : '',
|
|
293
|
+
tabIndex: 0
|
|
285
294
|
}), _this3.props.children);
|
|
286
295
|
},
|
|
287
296
|
zIndex: _constants.layers.modal(),
|
|
@@ -44,7 +44,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
44
44
|
actionSubjectId: actionSubjectId,
|
|
45
45
|
attributes: _objectSpread(_objectSpread({
|
|
46
46
|
packageName: "@atlaskit/profilecard",
|
|
47
|
-
packageVersion: "19.
|
|
47
|
+
packageVersion: "19.2.0"
|
|
48
48
|
}, attributes), {}, {
|
|
49
49
|
firedAt: Math.round((0, _performance.getPageTime)())
|
|
50
50
|
})
|
package/dist/cjs/version.json
CHANGED
|
@@ -4,15 +4,15 @@ const IGNORED_ERRORS = [
|
|
|
4
4
|
// Error categories from AGG
|
|
5
5
|
'TEAMS_FORBIDDEN', 'TEAMS_TEAM_DELETED'];
|
|
6
6
|
function isIgnoredError(error) {
|
|
7
|
-
return !!error && IGNORED_ERRORS.includes(error.reason);
|
|
7
|
+
return !!error && !!error.reason && IGNORED_ERRORS.includes(error.reason);
|
|
8
8
|
}
|
|
9
9
|
export const getErrorAttributes = error => {
|
|
10
|
-
var _error$
|
|
11
|
-
const traceId = !!error ? (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$heade = _error$response.headers) === null || _error$response$heade === void 0 ? void 0 : _error$response$heade.get('atl-traceid') : undefined;
|
|
10
|
+
var _error$traceId;
|
|
12
11
|
return {
|
|
12
|
+
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
13
13
|
errorStatus: error === null || error === void 0 ? void 0 : error.code,
|
|
14
|
-
errorReason: error === null || error === void 0 ? void 0 : error.reason,
|
|
14
|
+
errorReason: (error === null || error === void 0 ? void 0 : error.reason) || 'default',
|
|
15
15
|
isSLOFailure: !isIgnoredError(error),
|
|
16
|
-
traceId: traceId !== null && traceId !== void 0 ? traceId : undefined
|
|
16
|
+
traceId: (_error$traceId = error === null || error === void 0 ? void 0 : error.traceId) !== null && _error$traceId !== void 0 ? _error$traceId : undefined
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -20,19 +20,24 @@ export function graphqlQuery(serviceUrl, query, processHeaders = id) {
|
|
|
20
20
|
body: JSON.stringify(query)
|
|
21
21
|
})).then(response => {
|
|
22
22
|
if (!response.ok) {
|
|
23
|
+
var _response$headers;
|
|
24
|
+
const traceIdFromHeaders = response === null || response === void 0 ? void 0 : (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.get('atl-traceid');
|
|
23
25
|
return Promise.reject({
|
|
24
26
|
code: response.status,
|
|
25
|
-
reason: response.statusText
|
|
27
|
+
reason: response.statusText,
|
|
28
|
+
traceId: traceIdFromHeaders
|
|
26
29
|
});
|
|
27
30
|
}
|
|
28
31
|
return response;
|
|
29
32
|
}).then(response => response.json()).then(json => {
|
|
30
33
|
if (json.errors) {
|
|
31
|
-
var _json$errors$, _json$errors$2, _json$errors$2$extens, _json$errors$3, _json$errors$3$extens;
|
|
32
|
-
// We need to handle responses from pf-directory and AGG
|
|
34
|
+
var _json$errors$, _json$errors$2, _json$errors$2$extens, _json$errors$3, _json$errors$3$extens, _json$errors$4, _json$errors$4$extens, _json$extensions, _json$extensions$gate;
|
|
33
35
|
return Promise.reject({
|
|
34
36
|
reason: ((_json$errors$ = json.errors[0]) === null || _json$errors$ === void 0 ? void 0 : _json$errors$.category) || ((_json$errors$2 = json.errors[0]) === null || _json$errors$2 === void 0 ? void 0 : (_json$errors$2$extens = _json$errors$2.extensions) === null || _json$errors$2$extens === void 0 ? void 0 : _json$errors$2$extens.classification) || 'default',
|
|
35
|
-
code: (_json$errors$3 = json.errors[0]) === null || _json$errors$3 === void 0 ? void 0 : (_json$errors$3$extens = _json$errors$3.extensions) === null || _json$errors$3$extens === void 0 ? void 0 : _json$errors$3$extens.statusCode
|
|
37
|
+
code: (_json$errors$3 = json.errors[0]) === null || _json$errors$3 === void 0 ? void 0 : (_json$errors$3$extens = _json$errors$3.extensions) === null || _json$errors$3$extens === void 0 ? void 0 : _json$errors$3$extens.statusCode,
|
|
38
|
+
errorSource: (_json$errors$4 = json.errors[0]) === null || _json$errors$4 === void 0 ? void 0 : (_json$errors$4$extens = _json$errors$4.extensions) === null || _json$errors$4$extens === void 0 ? void 0 : _json$errors$4$extens.errorSource,
|
|
39
|
+
message: json.errors[0].message,
|
|
40
|
+
traceId: (_json$extensions = json.extensions) === null || _json$extensions === void 0 ? void 0 : (_json$extensions$gate = _json$extensions.gateway) === null || _json$extensions$gate === void 0 ? void 0 : _json$extensions$gate.request_id
|
|
36
41
|
});
|
|
37
42
|
}
|
|
38
43
|
return json.data;
|
|
@@ -65,6 +65,12 @@ class ProfilecardTrigger extends React.PureComponent {
|
|
|
65
65
|
this.fireAnalytics(cardTriggered('user', 'hover'));
|
|
66
66
|
}
|
|
67
67
|
});
|
|
68
|
+
_defineProperty(this, "onFocus", () => {
|
|
69
|
+
this.showProfilecard();
|
|
70
|
+
if (!this.state.visible) {
|
|
71
|
+
this.fireAnalytics(cardTriggered('user', 'hover'));
|
|
72
|
+
}
|
|
73
|
+
});
|
|
68
74
|
_defineProperty(this, "onKeyPress", event => {
|
|
69
75
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
70
76
|
event.preventDefault();
|
|
@@ -76,7 +82,9 @@ class ProfilecardTrigger extends React.PureComponent {
|
|
|
76
82
|
});
|
|
77
83
|
_defineProperty(this, "containerListeners", this.props.trigger === 'hover' ? {
|
|
78
84
|
onMouseEnter: this.onMouseEnter,
|
|
79
|
-
onMouseLeave: this.hideProfilecard
|
|
85
|
+
onMouseLeave: this.hideProfilecard,
|
|
86
|
+
onFocus: this.onFocus,
|
|
87
|
+
onBlur: this.hideProfilecard
|
|
80
88
|
} : {
|
|
81
89
|
onClick: this.onClick,
|
|
82
90
|
onKeyPress: this.onKeyPress
|
|
@@ -210,7 +218,8 @@ class ProfilecardTrigger extends React.PureComponent {
|
|
|
210
218
|
};
|
|
211
219
|
const wrapperProps = this.props.trigger === 'hover' ? {
|
|
212
220
|
onMouseEnter: this.onMouseEnter,
|
|
213
|
-
onMouseLeave: this.hideProfilecard
|
|
221
|
+
onMouseLeave: this.hideProfilecard,
|
|
222
|
+
onFocus: this.onFocus
|
|
214
223
|
} : {};
|
|
215
224
|
return /*#__PURE__*/React.createElement("div", wrapperProps, this.state.visible && /*#__PURE__*/React.createElement(Suspense, {
|
|
216
225
|
fallback: null
|
|
@@ -235,8 +244,8 @@ class ProfilecardTrigger extends React.PureComponent {
|
|
|
235
244
|
return /*#__PURE__*/React.createElement("span", _extends({}, innerProps, this.containerListeners, {
|
|
236
245
|
ref: ref,
|
|
237
246
|
"data-testid": this.props.testId,
|
|
238
|
-
|
|
239
|
-
|
|
247
|
+
role: this.props.trigger !== 'hover' ? 'button' : '',
|
|
248
|
+
tabIndex: 0
|
|
240
249
|
}), this.props.children);
|
|
241
250
|
},
|
|
242
251
|
zIndex: layers.modal(),
|
|
@@ -31,7 +31,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
|
|
|
31
31
|
actionSubjectId,
|
|
32
32
|
attributes: {
|
|
33
33
|
packageName: "@atlaskit/profilecard",
|
|
34
|
-
packageVersion: "19.
|
|
34
|
+
packageVersion: "19.2.0",
|
|
35
35
|
...attributes,
|
|
36
36
|
firedAt: Math.round(getPageTime())
|
|
37
37
|
}
|
package/dist/es2019/version.json
CHANGED
|
@@ -4,15 +4,15 @@ var IGNORED_ERRORS = [
|
|
|
4
4
|
// Error categories from AGG
|
|
5
5
|
'TEAMS_FORBIDDEN', 'TEAMS_TEAM_DELETED'];
|
|
6
6
|
function isIgnoredError(error) {
|
|
7
|
-
return !!error && IGNORED_ERRORS.includes(error.reason);
|
|
7
|
+
return !!error && !!error.reason && IGNORED_ERRORS.includes(error.reason);
|
|
8
8
|
}
|
|
9
9
|
export var getErrorAttributes = function getErrorAttributes(error) {
|
|
10
|
-
var _error$
|
|
11
|
-
var traceId = !!error ? (_error$response = error.response) === null || _error$response === void 0 ? void 0 : (_error$response$heade = _error$response.headers) === null || _error$response$heade === void 0 ? void 0 : _error$response$heade.get('atl-traceid') : undefined;
|
|
10
|
+
var _error$traceId;
|
|
12
11
|
return {
|
|
12
|
+
errorMessage: error === null || error === void 0 ? void 0 : error.message,
|
|
13
13
|
errorStatus: error === null || error === void 0 ? void 0 : error.code,
|
|
14
|
-
errorReason: error === null || error === void 0 ? void 0 : error.reason,
|
|
14
|
+
errorReason: (error === null || error === void 0 ? void 0 : error.reason) || 'default',
|
|
15
15
|
isSLOFailure: !isIgnoredError(error),
|
|
16
|
-
traceId: traceId !== null && traceId !== void 0 ? traceId : undefined
|
|
16
|
+
traceId: (_error$traceId = error === null || error === void 0 ? void 0 : error.traceId) !== null && _error$traceId !== void 0 ? _error$traceId : undefined
|
|
17
17
|
};
|
|
18
18
|
};
|
|
@@ -23,9 +23,12 @@ export function graphqlQuery(serviceUrl, query) {
|
|
|
23
23
|
body: JSON.stringify(query)
|
|
24
24
|
})).then(function (response) {
|
|
25
25
|
if (!response.ok) {
|
|
26
|
+
var _response$headers;
|
|
27
|
+
var traceIdFromHeaders = response === null || response === void 0 ? void 0 : (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.get('atl-traceid');
|
|
26
28
|
return Promise.reject({
|
|
27
29
|
code: response.status,
|
|
28
|
-
reason: response.statusText
|
|
30
|
+
reason: response.statusText,
|
|
31
|
+
traceId: traceIdFromHeaders
|
|
29
32
|
});
|
|
30
33
|
}
|
|
31
34
|
return response;
|
|
@@ -33,11 +36,13 @@ export function graphqlQuery(serviceUrl, query) {
|
|
|
33
36
|
return response.json();
|
|
34
37
|
}).then(function (json) {
|
|
35
38
|
if (json.errors) {
|
|
36
|
-
var _json$errors$, _json$errors$2, _json$errors$2$extens, _json$errors$3, _json$errors$3$extens;
|
|
37
|
-
// We need to handle responses from pf-directory and AGG
|
|
39
|
+
var _json$errors$, _json$errors$2, _json$errors$2$extens, _json$errors$3, _json$errors$3$extens, _json$errors$4, _json$errors$4$extens, _json$extensions, _json$extensions$gate;
|
|
38
40
|
return Promise.reject({
|
|
39
41
|
reason: ((_json$errors$ = json.errors[0]) === null || _json$errors$ === void 0 ? void 0 : _json$errors$.category) || ((_json$errors$2 = json.errors[0]) === null || _json$errors$2 === void 0 ? void 0 : (_json$errors$2$extens = _json$errors$2.extensions) === null || _json$errors$2$extens === void 0 ? void 0 : _json$errors$2$extens.classification) || 'default',
|
|
40
|
-
code: (_json$errors$3 = json.errors[0]) === null || _json$errors$3 === void 0 ? void 0 : (_json$errors$3$extens = _json$errors$3.extensions) === null || _json$errors$3$extens === void 0 ? void 0 : _json$errors$3$extens.statusCode
|
|
42
|
+
code: (_json$errors$3 = json.errors[0]) === null || _json$errors$3 === void 0 ? void 0 : (_json$errors$3$extens = _json$errors$3.extensions) === null || _json$errors$3$extens === void 0 ? void 0 : _json$errors$3$extens.statusCode,
|
|
43
|
+
errorSource: (_json$errors$4 = json.errors[0]) === null || _json$errors$4 === void 0 ? void 0 : (_json$errors$4$extens = _json$errors$4.extensions) === null || _json$errors$4$extens === void 0 ? void 0 : _json$errors$4$extens.errorSource,
|
|
44
|
+
message: json.errors[0].message,
|
|
45
|
+
traceId: (_json$extensions = json.extensions) === null || _json$extensions === void 0 ? void 0 : (_json$extensions$gate = _json$extensions.gateway) === null || _json$extensions$gate === void 0 ? void 0 : _json$extensions$gate.request_id
|
|
41
46
|
});
|
|
42
47
|
}
|
|
43
48
|
return json.data;
|
|
@@ -85,6 +85,12 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
85
85
|
_this.fireAnalytics(cardTriggered('user', 'hover'));
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
|
+
_defineProperty(_assertThisInitialized(_this), "onFocus", function () {
|
|
89
|
+
_this.showProfilecard();
|
|
90
|
+
if (!_this.state.visible) {
|
|
91
|
+
_this.fireAnalytics(cardTriggered('user', 'hover'));
|
|
92
|
+
}
|
|
93
|
+
});
|
|
88
94
|
_defineProperty(_assertThisInitialized(_this), "onKeyPress", function (event) {
|
|
89
95
|
if (event.key === 'Enter' || event.key === ' ') {
|
|
90
96
|
event.preventDefault();
|
|
@@ -96,7 +102,9 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
96
102
|
});
|
|
97
103
|
_defineProperty(_assertThisInitialized(_this), "containerListeners", _this.props.trigger === 'hover' ? {
|
|
98
104
|
onMouseEnter: _this.onMouseEnter,
|
|
99
|
-
onMouseLeave: _this.hideProfilecard
|
|
105
|
+
onMouseLeave: _this.hideProfilecard,
|
|
106
|
+
onFocus: _this.onFocus,
|
|
107
|
+
onBlur: _this.hideProfilecard
|
|
100
108
|
} : {
|
|
101
109
|
onClick: _this.onClick,
|
|
102
110
|
onKeyPress: _this.onKeyPress
|
|
@@ -244,7 +252,8 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
244
252
|
});
|
|
245
253
|
var wrapperProps = this.props.trigger === 'hover' ? {
|
|
246
254
|
onMouseEnter: this.onMouseEnter,
|
|
247
|
-
onMouseLeave: this.hideProfilecard
|
|
255
|
+
onMouseLeave: this.hideProfilecard,
|
|
256
|
+
onFocus: this.onFocus
|
|
248
257
|
} : {};
|
|
249
258
|
return /*#__PURE__*/React.createElement("div", wrapperProps, this.state.visible && /*#__PURE__*/React.createElement(Suspense, {
|
|
250
259
|
fallback: null
|
|
@@ -270,8 +279,8 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
|
|
|
270
279
|
return /*#__PURE__*/React.createElement("span", _extends({}, innerProps, _this3.containerListeners, {
|
|
271
280
|
ref: ref,
|
|
272
281
|
"data-testid": _this3.props.testId,
|
|
273
|
-
|
|
274
|
-
|
|
282
|
+
role: _this3.props.trigger !== 'hover' ? 'button' : '',
|
|
283
|
+
tabIndex: 0
|
|
275
284
|
}), _this3.props.children);
|
|
276
285
|
},
|
|
277
286
|
zIndex: layers.modal(),
|
|
@@ -38,7 +38,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
|
|
|
38
38
|
actionSubjectId: actionSubjectId,
|
|
39
39
|
attributes: _objectSpread(_objectSpread({
|
|
40
40
|
packageName: "@atlaskit/profilecard",
|
|
41
|
-
packageVersion: "19.
|
|
41
|
+
packageVersion: "19.2.0"
|
|
42
42
|
}, attributes), {}, {
|
|
43
43
|
firedAt: Math.round(getPageTime())
|
|
44
44
|
})
|
package/dist/esm/version.json
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import { GraphQLError } from './graphqlUtils';
|
|
2
|
+
export declare const getErrorAttributes: (error?: GraphQLError | undefined) => {
|
|
3
|
+
errorMessage: string | undefined;
|
|
4
|
+
errorStatus: number | undefined;
|
|
5
|
+
errorReason: string;
|
|
4
6
|
isSLOFailure: boolean;
|
|
5
7
|
traceId: string | undefined;
|
|
6
8
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/profilecard",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.2.0",
|
|
4
4
|
"description": "A React component to display a card with user information.",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"@atlaskit/menu": "^1.5.0",
|
|
53
53
|
"@atlaskit/popup": "^1.5.0",
|
|
54
54
|
"@atlaskit/spinner": "^15.4.0",
|
|
55
|
-
"@atlaskit/theme": "^12.
|
|
55
|
+
"@atlaskit/theme": "^12.3.0",
|
|
56
56
|
"@atlaskit/tokens": "^1.2.0",
|
|
57
57
|
"@babel/runtime": "^7.0.0",
|
|
58
58
|
"@emotion/react": "^11.7.1",
|