@atlaskit/profilecard 16.4.3 → 16.4.4

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,11 @@
1
1
  # @atlaskit/profilecard
2
2
 
3
+ ## 16.4.4
4
+
5
+ ### Patch Changes
6
+
7
+ - [`b876346271a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/b876346271a) - Ensure that component wrapping a ProfileCardTrigger is not clicked when clicking the trigger
8
+
3
9
  ## 16.4.3
4
10
 
5
11
  ### Patch Changes
@@ -99,11 +99,19 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
99
99
  }
100
100
  }, _this.showDelay);
101
101
  });
102
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "onClick", function (event) {
103
+ // If the user clicks on the trigger then we don't want that click event to
104
+ // propagate out to parent containers. For example when clicking a mention
105
+ // lozenge in an inline-edit.
106
+ event.stopPropagation();
107
+
108
+ _this.showProfilecard();
109
+ });
102
110
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "containerListeners", _this.props.trigger === 'hover' ? {
103
111
  onMouseEnter: _this.showProfilecard,
104
112
  onMouseLeave: _this.hideProfilecard
105
113
  } : {
106
- onClick: _this.showProfilecard
114
+ onClick: _this.onClick
107
115
  });
108
116
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "layerListeners", {
109
117
  handleClickOutside: _this.hideProfilecard,
@@ -56,7 +56,7 @@ var createEvent = function createEvent(eventType, action, actionSubject, actionS
56
56
  actionSubjectId: actionSubjectId,
57
57
  attributes: _objectSpread(_objectSpread({
58
58
  packageName: "@atlaskit/profilecard",
59
- packageVersion: "16.4.3"
59
+ packageVersion: "16.4.4"
60
60
  }, attributes), {}, {
61
61
  firedAt: (0, _performance.getPageTime)()
62
62
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.4.3"
3
+ "version": "16.4.4"
4
4
  }
@@ -46,11 +46,19 @@ class ProfilecardTrigger extends React.PureComponent {
46
46
  }, this.showDelay);
47
47
  });
48
48
 
49
+ _defineProperty(this, "onClick", event => {
50
+ // If the user clicks on the trigger then we don't want that click event to
51
+ // propagate out to parent containers. For example when clicking a mention
52
+ // lozenge in an inline-edit.
53
+ event.stopPropagation();
54
+ this.showProfilecard();
55
+ });
56
+
49
57
  _defineProperty(this, "containerListeners", this.props.trigger === 'hover' ? {
50
58
  onMouseEnter: this.showProfilecard,
51
59
  onMouseLeave: this.hideProfilecard
52
60
  } : {
53
- onClick: this.showProfilecard
61
+ onClick: this.onClick
54
62
  });
55
63
 
56
64
  _defineProperty(this, "layerListeners", {
@@ -35,7 +35,7 @@ const createEvent = (eventType, action, actionSubject, actionSubjectId, attribut
35
35
  actionSubjectId,
36
36
  attributes: {
37
37
  packageName: "@atlaskit/profilecard",
38
- packageVersion: "16.4.3",
38
+ packageVersion: "16.4.4",
39
39
  ...attributes,
40
40
  firedAt: getPageTime()
41
41
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.4.3"
3
+ "version": "16.4.4"
4
4
  }
@@ -76,11 +76,20 @@ var ProfilecardTrigger = /*#__PURE__*/function (_React$PureComponent) {
76
76
  }, _this.showDelay);
77
77
  });
78
78
 
79
+ _defineProperty(_assertThisInitialized(_this), "onClick", function (event) {
80
+ // If the user clicks on the trigger then we don't want that click event to
81
+ // propagate out to parent containers. For example when clicking a mention
82
+ // lozenge in an inline-edit.
83
+ event.stopPropagation();
84
+
85
+ _this.showProfilecard();
86
+ });
87
+
79
88
  _defineProperty(_assertThisInitialized(_this), "containerListeners", _this.props.trigger === 'hover' ? {
80
89
  onMouseEnter: _this.showProfilecard,
81
90
  onMouseLeave: _this.hideProfilecard
82
91
  } : {
83
- onClick: _this.showProfilecard
92
+ onClick: _this.onClick
84
93
  });
85
94
 
86
95
  _defineProperty(_assertThisInitialized(_this), "layerListeners", {
@@ -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: "16.4.3"
48
+ packageVersion: "16.4.4"
49
49
  }, attributes), {}, {
50
50
  firedAt: getPageTime()
51
51
  })
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.4.3"
3
+ "version": "16.4.4"
4
4
  }
@@ -9,12 +9,13 @@ declare class ProfilecardTrigger extends React.PureComponent<ProfileCardTriggerP
9
9
  hideTimer: number;
10
10
  hideProfilecard: () => void;
11
11
  showProfilecard: () => void;
12
+ onClick: (event: React.MouseEvent) => void;
12
13
  containerListeners: {
13
14
  onMouseEnter: () => void;
14
15
  onMouseLeave: () => void;
15
16
  onClick?: undefined;
16
17
  } | {
17
- onClick: () => void;
18
+ onClick: (event: React.MouseEvent) => void;
18
19
  onMouseEnter?: undefined;
19
20
  onMouseLeave?: undefined;
20
21
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/profilecard",
3
- "version": "16.4.3",
3
+ "version": "16.4.4",
4
4
  "description": "A React component to display a card with user information.",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"