@atlaskit/smart-card 26.9.9 → 26.9.11
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/version.json +1 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +9 -9
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +10 -10
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +9 -9
- package/package.json +6 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.9.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3fb20c4aeba`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3fb20c4aeba) - Add postinstall check to enforce internal peer dependencies
|
|
8
|
+
|
|
9
|
+
## 26.9.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`74c892f10de`](https://bitbucket.org/atlassian/atlassian-frontend/commits/74c892f10de) - [ux] Hover card will open closer to the mouse position, but with a slight offset of 10px to the right and to the top.
|
|
14
|
+
|
|
3
15
|
## 26.9.9
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/cjs/version.json
CHANGED
|
@@ -67,6 +67,14 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
67
67
|
x: event.clientX,
|
|
68
68
|
y: event.clientY
|
|
69
69
|
};
|
|
70
|
+
|
|
71
|
+
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
72
|
+
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
73
|
+
var _parentSpan$current$g = parentSpan.current.getBoundingClientRect(),
|
|
74
|
+
bottom = _parentSpan$current$g.bottom,
|
|
75
|
+
left = _parentSpan$current$g.left;
|
|
76
|
+
popupOffset.current = [mousePos.current.x - left + _styled.CARD_GAP_PX, mousePos.current.y - bottom + _styled.CARD_GAP_PX];
|
|
77
|
+
}
|
|
70
78
|
}, [canOpen, isOpen]);
|
|
71
79
|
var hideCard = (0, _react2.useCallback)(function () {
|
|
72
80
|
setIsOpen(false);
|
|
@@ -133,21 +141,13 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
133
141
|
|
|
134
142
|
//Set mouse position in the case it's not already set by onMouseMove, as in the case of scrolling
|
|
135
143
|
setMousePosition(event);
|
|
136
|
-
|
|
137
|
-
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
138
|
-
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
139
|
-
var _parentSpan$current$g = parentSpan.current.getBoundingClientRect(),
|
|
140
|
-
bottom = _parentSpan$current$g.bottom,
|
|
141
|
-
left = _parentSpan$current$g.left;
|
|
142
|
-
popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + _styled.CARD_GAP_PX];
|
|
143
|
-
}
|
|
144
144
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
145
145
|
// setting a timeout to show a Hover Card after delay runs out
|
|
146
146
|
fadeInTimeoutId.current = setTimeout(function () {
|
|
147
147
|
setIsOpen(true);
|
|
148
148
|
}, FADE_IN_DELAY);
|
|
149
149
|
}
|
|
150
|
-
}, [
|
|
150
|
+
}, [initResolve, isOpen, setMousePosition]);
|
|
151
151
|
var linkActions = (0, _useSmartLinkActions.useSmartLinkActions)({
|
|
152
152
|
url: url,
|
|
153
153
|
appearance: _constants.CardDisplay.HoverCardPreview,
|
package/dist/es2019/version.json
CHANGED
|
@@ -48,6 +48,15 @@ export const HoverCardComponent = ({
|
|
|
48
48
|
x: event.clientX,
|
|
49
49
|
y: event.clientY
|
|
50
50
|
};
|
|
51
|
+
|
|
52
|
+
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
53
|
+
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
54
|
+
const {
|
|
55
|
+
bottom,
|
|
56
|
+
left
|
|
57
|
+
} = parentSpan.current.getBoundingClientRect();
|
|
58
|
+
popupOffset.current = [mousePos.current.x - left + CARD_GAP_PX, mousePos.current.y - bottom + CARD_GAP_PX];
|
|
59
|
+
}
|
|
51
60
|
}, [canOpen, isOpen]);
|
|
52
61
|
const hideCard = useCallback(() => {
|
|
53
62
|
setIsOpen(false);
|
|
@@ -112,22 +121,13 @@ export const HoverCardComponent = ({
|
|
|
112
121
|
|
|
113
122
|
//Set mouse position in the case it's not already set by onMouseMove, as in the case of scrolling
|
|
114
123
|
setMousePosition(event);
|
|
115
|
-
|
|
116
|
-
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
117
|
-
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
118
|
-
const {
|
|
119
|
-
bottom,
|
|
120
|
-
left
|
|
121
|
-
} = parentSpan.current.getBoundingClientRect();
|
|
122
|
-
popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + CARD_GAP_PX];
|
|
123
|
-
}
|
|
124
124
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
125
125
|
// setting a timeout to show a Hover Card after delay runs out
|
|
126
126
|
fadeInTimeoutId.current = setTimeout(() => {
|
|
127
127
|
setIsOpen(true);
|
|
128
128
|
}, FADE_IN_DELAY);
|
|
129
129
|
}
|
|
130
|
-
}, [
|
|
130
|
+
}, [initResolve, isOpen, setMousePosition]);
|
|
131
131
|
const linkActions = useSmartLinkActions({
|
|
132
132
|
url,
|
|
133
133
|
appearance: CardDisplay.HoverCardPreview,
|
package/dist/esm/version.json
CHANGED
|
@@ -56,6 +56,14 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
56
56
|
x: event.clientX,
|
|
57
57
|
y: event.clientY
|
|
58
58
|
};
|
|
59
|
+
|
|
60
|
+
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
61
|
+
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
62
|
+
var _parentSpan$current$g = parentSpan.current.getBoundingClientRect(),
|
|
63
|
+
bottom = _parentSpan$current$g.bottom,
|
|
64
|
+
left = _parentSpan$current$g.left;
|
|
65
|
+
popupOffset.current = [mousePos.current.x - left + CARD_GAP_PX, mousePos.current.y - bottom + CARD_GAP_PX];
|
|
66
|
+
}
|
|
59
67
|
}, [canOpen, isOpen]);
|
|
60
68
|
var hideCard = useCallback(function () {
|
|
61
69
|
setIsOpen(false);
|
|
@@ -122,21 +130,13 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
122
130
|
|
|
123
131
|
//Set mouse position in the case it's not already set by onMouseMove, as in the case of scrolling
|
|
124
132
|
setMousePosition(event);
|
|
125
|
-
|
|
126
|
-
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
127
|
-
if ((!isOpen || !canOpen) && parentSpan.current && mousePos.current) {
|
|
128
|
-
var _parentSpan$current$g = parentSpan.current.getBoundingClientRect(),
|
|
129
|
-
bottom = _parentSpan$current$g.bottom,
|
|
130
|
-
left = _parentSpan$current$g.left;
|
|
131
|
-
popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + CARD_GAP_PX];
|
|
132
|
-
}
|
|
133
133
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
134
134
|
// setting a timeout to show a Hover Card after delay runs out
|
|
135
135
|
fadeInTimeoutId.current = setTimeout(function () {
|
|
136
136
|
setIsOpen(true);
|
|
137
137
|
}, FADE_IN_DELAY);
|
|
138
138
|
}
|
|
139
|
-
}, [
|
|
139
|
+
}, [initResolve, isOpen, setMousePosition]);
|
|
140
140
|
var linkActions = useSmartLinkActions({
|
|
141
141
|
url: url,
|
|
142
142
|
appearance: CardDisplay.HoverCardPreview,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.9.
|
|
3
|
+
"version": "26.9.11",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
"@atlaskit/avatar-group": "^9.3.0",
|
|
29
29
|
"@atlaskit/button": "^16.8.0",
|
|
30
30
|
"@atlaskit/dropdown-menu": "^11.10.0",
|
|
31
|
+
"@atlaskit/enforce-peer-dependencies": "^1.0.1",
|
|
31
32
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
32
33
|
"@atlaskit/icon": "^21.12.0",
|
|
33
34
|
"@atlaskit/icon-file-type": "^6.4.0",
|
|
@@ -144,5 +145,8 @@
|
|
|
144
145
|
"type": "boolean"
|
|
145
146
|
}
|
|
146
147
|
},
|
|
147
|
-
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"
|
|
148
|
+
"prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1",
|
|
149
|
+
"scripts": {
|
|
150
|
+
"postinstall": "npx enforce-peer-dependencies --internal-packages"
|
|
151
|
+
}
|
|
148
152
|
}
|