@atlaskit/profilecard 19.1.1 → 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 +6 -0
- 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/components/User/ProfileCardTrigger.js +13 -4
- package/dist/es2019/util/analytics.js +1 -1
- package/dist/es2019/version.json +1 -1
- 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/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
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
|
+
|
|
3
9
|
## 19.1.1
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
@@ -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
|
@@ -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
|
@@ -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
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",
|