@atlaskit/smart-card 26.9.5 → 26.9.6

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/smart-card
2
2
 
3
+ ## 26.9.6
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e0a2c926e63`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e0a2c926e63) - [ux] Flexible Smart Links: Fix hover preview shows on mouse leave
8
+
3
9
  ## 26.9.5
4
10
 
5
11
  ### Patch Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.9.5",
3
+ "version": "26.9.6",
4
4
  "sideEffects": false
5
5
  }
@@ -19,6 +19,7 @@ var HoverCardControl = function HoverCardControl(_ref) {
19
19
  isHoverPreview = _ref.isHoverPreview,
20
20
  isAuthTooltip = _ref.isAuthTooltip,
21
21
  showServerActions = _ref.showServerActions,
22
+ testId = _ref.testId,
22
23
  url = _ref.url;
23
24
  var _useState = (0, _react.useState)(true),
24
25
  _useState2 = (0, _slicedToArray2.default)(_useState, 2),
@@ -32,6 +33,11 @@ var HoverCardControl = function HoverCardControl(_ref) {
32
33
  }
33
34
  };
34
35
  }, []);
36
+ var onMouseLeave = (0, _react.useCallback)(function () {
37
+ if (mouseStopTimer.current) {
38
+ clearTimeout(mouseStopTimer.current);
39
+ }
40
+ }, []);
35
41
  var onMouseMove = (0, _react.useCallback)(function (e) {
36
42
  var _e$target$closest;
37
43
  if (mouseStopTimer.current) {
@@ -67,7 +73,9 @@ var HoverCardControl = function HoverCardControl(_ref) {
67
73
  showServerActions: Boolean(showServerActions),
68
74
  url: url
69
75
  }, /*#__PURE__*/_react.default.createElement("span", {
70
- onMouseMove: onMouseMove
76
+ onMouseLeave: onMouseLeave,
77
+ onMouseMove: onMouseMove,
78
+ "data-testid": "".concat(testId, "-hover-card-wrapper")
71
79
  }, children));
72
80
  };
73
81
  var _default = HoverCardControl;
@@ -178,6 +178,7 @@ var Container = function Container(_ref3) {
178
178
  isHoverPreview: canShowHoverPreview,
179
179
  isAuthTooltip: canShowAuthTooltip,
180
180
  showServerActions: showServerActions,
181
+ testId: testId,
181
182
  url: context.url
182
183
  }, container);
183
184
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.9.5",
3
+ "version": "26.9.6",
4
4
  "sideEffects": false
5
5
  }
@@ -8,6 +8,7 @@ const HoverCardControl = ({
8
8
  isHoverPreview,
9
9
  isAuthTooltip,
10
10
  showServerActions,
11
+ testId,
11
12
  url
12
13
  }) => {
13
14
  const [canOpen, setCanOpen] = useState(true);
@@ -19,6 +20,11 @@ const HoverCardControl = ({
19
20
  }
20
21
  };
21
22
  }, []);
23
+ const onMouseLeave = useCallback(() => {
24
+ if (mouseStopTimer.current) {
25
+ clearTimeout(mouseStopTimer.current);
26
+ }
27
+ }, []);
22
28
  const onMouseMove = useCallback(e => {
23
29
  var _e$target$closest;
24
30
  if (mouseStopTimer.current) {
@@ -54,7 +60,9 @@ const HoverCardControl = ({
54
60
  showServerActions: Boolean(showServerActions),
55
61
  url: url
56
62
  }, /*#__PURE__*/React.createElement("span", {
57
- onMouseMove: onMouseMove
63
+ onMouseLeave: onMouseLeave,
64
+ onMouseMove: onMouseMove,
65
+ "data-testid": `${testId}-hover-card-wrapper`
58
66
  }, children));
59
67
  };
60
68
  export default HoverCardControl;
@@ -199,6 +199,7 @@ const Container = ({
199
199
  isHoverPreview: canShowHoverPreview,
200
200
  isAuthTooltip: canShowAuthTooltip,
201
201
  showServerActions: showServerActions,
202
+ testId: testId,
202
203
  url: context.url
203
204
  }, container);
204
205
  }
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.9.5",
3
+ "version": "26.9.6",
4
4
  "sideEffects": false
5
5
  }
@@ -9,6 +9,7 @@ var HoverCardControl = function HoverCardControl(_ref) {
9
9
  isHoverPreview = _ref.isHoverPreview,
10
10
  isAuthTooltip = _ref.isAuthTooltip,
11
11
  showServerActions = _ref.showServerActions,
12
+ testId = _ref.testId,
12
13
  url = _ref.url;
13
14
  var _useState = useState(true),
14
15
  _useState2 = _slicedToArray(_useState, 2),
@@ -22,6 +23,11 @@ var HoverCardControl = function HoverCardControl(_ref) {
22
23
  }
23
24
  };
24
25
  }, []);
26
+ var onMouseLeave = useCallback(function () {
27
+ if (mouseStopTimer.current) {
28
+ clearTimeout(mouseStopTimer.current);
29
+ }
30
+ }, []);
25
31
  var onMouseMove = useCallback(function (e) {
26
32
  var _e$target$closest;
27
33
  if (mouseStopTimer.current) {
@@ -57,7 +63,9 @@ var HoverCardControl = function HoverCardControl(_ref) {
57
63
  showServerActions: Boolean(showServerActions),
58
64
  url: url
59
65
  }, /*#__PURE__*/React.createElement("span", {
60
- onMouseMove: onMouseMove
66
+ onMouseLeave: onMouseLeave,
67
+ onMouseMove: onMouseMove,
68
+ "data-testid": "".concat(testId, "-hover-card-wrapper")
61
69
  }, children));
62
70
  };
63
71
  export default HoverCardControl;
@@ -167,6 +167,7 @@ var Container = function Container(_ref3) {
167
167
  isHoverPreview: canShowHoverPreview,
168
168
  isAuthTooltip: canShowAuthTooltip,
169
169
  showServerActions: showServerActions,
170
+ testId: testId,
170
171
  url: context.url
171
172
  }, container);
172
173
  }
@@ -2,5 +2,6 @@ import { ContainerProps } from '../types';
2
2
  export type HoverCardDelayProps = Pick<ContainerProps, 'hideHoverCardPreviewButton' | 'showServerActions'> & {
3
3
  isHoverPreview?: boolean;
4
4
  isAuthTooltip?: boolean;
5
+ testId?: string;
5
6
  url: string;
6
7
  };
@@ -2,5 +2,6 @@ import { ContainerProps } from '../types';
2
2
  export type HoverCardDelayProps = Pick<ContainerProps, 'hideHoverCardPreviewButton' | 'showServerActions'> & {
3
3
  isHoverPreview?: boolean;
4
4
  isAuthTooltip?: boolean;
5
+ testId?: string;
5
6
  url: string;
6
7
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.9.5",
3
+ "version": "26.9.6",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -12,14 +12,6 @@
12
12
  "module": "dist/esm/index.js",
13
13
  "module:es2019": "dist/es2019/index.js",
14
14
  "types": "dist/types/index.d.ts",
15
- "typesVersions": {
16
- ">=4.5 <4.9": {
17
- "*": [
18
- "dist/types-ts4.5/*",
19
- "dist/types-ts4.5/index.d.ts"
20
- ]
21
- }
22
- },
23
15
  "sideEffects": false,
24
16
  "atlaskit:src": "src/index.ts",
25
17
  "atlassian": {
@@ -45,7 +37,7 @@
45
37
  "@atlaskit/link-analytics": "^8.2.0",
46
38
  "@atlaskit/link-client-extension": "^1.5.0",
47
39
  "@atlaskit/link-extractors": "^1.1.0",
48
- "@atlaskit/linking-common": "^3.3.0",
40
+ "@atlaskit/linking-common": "^3.4.0",
49
41
  "@atlaskit/linking-types": "^8.1.0",
50
42
  "@atlaskit/logo": "^13.14.0",
51
43
  "@atlaskit/lozenge": "^11.4.0",
@@ -79,6 +71,7 @@
79
71
  "react-intl-next": "npm:react-intl@^5.18.1"
80
72
  },
81
73
  "devDependencies": {
74
+ "@af/visual-regression": "*",
82
75
  "@atlaskit/avatar": "^21.3.0",
83
76
  "@atlaskit/css-reset": "^6.5.0",
84
77
  "@atlaskit/link-test-helpers": "^4.1.0",
@@ -114,6 +107,22 @@
114
107
  "typescript": "~4.9.5",
115
108
  "xhr-mock": "^2.4.0"
116
109
  },
110
+ "techstack": {
111
+ "@repo/internal": {
112
+ "design-tokens": [
113
+ "color",
114
+ "spacing"
115
+ ]
116
+ }
117
+ },
118
+ "typesVersions": {
119
+ ">=4.5 <4.9": {
120
+ "*": [
121
+ "dist/types-ts4.5/*",
122
+ "dist/types-ts4.5/index.d.ts"
123
+ ]
124
+ }
125
+ },
117
126
  "af:exports": {
118
127
  "./ssr": "./src/ssr.tsx",
119
128
  "./in-product": "./src/in-product.ts",
@@ -135,13 +144,5 @@
135
144
  "type": "boolean"
136
145
  }
137
146
  },
138
- "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
139
- "techstack": {
140
- "@repo/internal": {
141
- "design-tokens": [
142
- "color",
143
- "spacing"
144
- ]
145
- }
146
- }
147
+ "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
147
148
  }