@atlaskit/smart-card 26.9.0 → 26.9.2
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 +13 -0
- package/dist/cjs/hoverCard.js +1 -1
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/FlexibleCard/components/container/index.js +1 -0
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +18 -14
- package/dist/cjs/view/HoverCard/index.js +18 -2
- package/dist/es2019/hoverCard.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/FlexibleCard/components/container/index.js +1 -0
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +18 -15
- package/dist/es2019/view/HoverCard/index.js +14 -1
- package/dist/esm/hoverCard.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/FlexibleCard/components/container/index.js +1 -0
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +18 -14
- package/dist/esm/view/HoverCard/index.js +15 -0
- package/dist/types/hoverCard.d.ts +1 -1
- package/dist/types/view/HoverCard/index.d.ts +13 -2
- package/dist/types/view/HoverCard/types.d.ts +14 -1
- package/dist/types-ts4.5/hoverCard.d.ts +1 -1
- package/dist/types-ts4.5/view/HoverCard/index.d.ts +13 -2
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +14 -1
- package/package.json +3 -17
- package/tmp/api-report-tmp.d.ts +0 -937
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.9.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`99643bdd534`](https://bitbucket.org/atlassian/atlassian-frontend/commits/99643bdd534) - Fix flexible smart links onclick event not bubble up when hover preview is enabled
|
|
8
|
+
|
|
9
|
+
## 26.9.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`88cc5a0088c`](https://bitbucket.org/atlassian/atlassian-frontend/commits/88cc5a0088c) - [ux] Flexible Smart Links: Hover preview to follow mouse position
|
|
14
|
+
- Updated dependencies
|
|
15
|
+
|
|
3
16
|
## 26.9.0
|
|
4
17
|
|
|
5
18
|
### Minor Changes
|
package/dist/cjs/hoverCard.js
CHANGED
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
Object.defineProperty(exports, "HoverCard", {
|
|
7
7
|
enumerable: true,
|
|
8
8
|
get: function get() {
|
|
9
|
-
return _HoverCard.
|
|
9
|
+
return _HoverCard.StandaloneHoverCard;
|
|
10
10
|
}
|
|
11
11
|
});
|
|
12
12
|
var _HoverCard = require("./view/HoverCard");
|
package/dist/cjs/version.json
CHANGED
|
@@ -200,6 +200,7 @@ var Container = function Container(_ref3) {
|
|
|
200
200
|
if (context !== null && context !== void 0 && context.url && (canShowHoverPreview || canShowAuthTooltip)) {
|
|
201
201
|
return (0, _react2.jsx)(_HoverCard.HoverCard, {
|
|
202
202
|
url: context === null || context === void 0 ? void 0 : context.url,
|
|
203
|
+
allowEventPropagation: true,
|
|
203
204
|
canOpen: hoverCardCanOpen,
|
|
204
205
|
closeOnChildClick: true,
|
|
205
206
|
hidePreviewButton: hideHoverCardPreviewButton
|
|
@@ -41,7 +41,9 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
41
41
|
_ref$hidePreviewButto = _ref.hidePreviewButton,
|
|
42
42
|
hidePreviewButton = _ref$hidePreviewButto === void 0 ? false : _ref$hidePreviewButto,
|
|
43
43
|
_ref$showServerAction = _ref.showServerActions,
|
|
44
|
-
showServerActions = _ref$showServerAction === void 0 ? false : _ref$showServerAction
|
|
44
|
+
showServerActions = _ref$showServerAction === void 0 ? false : _ref$showServerAction,
|
|
45
|
+
_ref$allowEventPropag = _ref.allowEventPropagation,
|
|
46
|
+
allowEventPropagation = _ref$allowEventPropag === void 0 ? false : _ref$allowEventPropag;
|
|
45
47
|
var _React$useState = _react2.default.useState(false),
|
|
46
48
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
47
49
|
isOpen = _React$useState2[0],
|
|
@@ -58,14 +60,14 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
58
60
|
var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
|
|
59
61
|
loadMetadata = _useSmartCardActions.loadMetadata;
|
|
60
62
|
var setMousePosition = (0, _react2.useCallback)(function (event) {
|
|
61
|
-
if (isOpen) {
|
|
63
|
+
if (isOpen && canOpen) {
|
|
62
64
|
return;
|
|
63
65
|
}
|
|
64
66
|
mousePos.current = {
|
|
65
67
|
x: event.clientX,
|
|
66
68
|
y: event.clientY
|
|
67
69
|
};
|
|
68
|
-
}, [isOpen]);
|
|
70
|
+
}, [canOpen, isOpen]);
|
|
69
71
|
var hideCard = (0, _react2.useCallback)(function () {
|
|
70
72
|
setIsOpen(false);
|
|
71
73
|
}, []);
|
|
@@ -131,20 +133,21 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
131
133
|
|
|
132
134
|
//Set mouse position in the case it's not already set by onMouseMove, as in the case of scrolling
|
|
133
135
|
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
|
+
}
|
|
134
144
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
135
145
|
// setting a timeout to show a Hover Card after delay runs out
|
|
136
146
|
fadeInTimeoutId.current = setTimeout(function () {
|
|
137
|
-
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
138
|
-
if (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
147
|
setIsOpen(true);
|
|
145
148
|
}, FADE_IN_DELAY);
|
|
146
149
|
}
|
|
147
|
-
}, [initResolve, isOpen, setMousePosition]);
|
|
150
|
+
}, [canOpen, initResolve, isOpen, setMousePosition]);
|
|
148
151
|
var linkActions = (0, _useSmartLinkActions.useSmartLinkActions)({
|
|
149
152
|
url: url,
|
|
150
153
|
appearance: _constants.CardDisplay.HoverCardPreview,
|
|
@@ -163,13 +166,14 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
163
166
|
}, [hideCard]);
|
|
164
167
|
|
|
165
168
|
// Stop hover preview content to propagate event to parent.
|
|
166
|
-
|
|
167
169
|
var onChildClick = (0, _react2.useCallback)(function (e) {
|
|
168
|
-
|
|
170
|
+
if (!allowEventPropagation) {
|
|
171
|
+
e.stopPropagation();
|
|
172
|
+
}
|
|
169
173
|
if (closeOnChildClick) {
|
|
170
174
|
hideCard();
|
|
171
175
|
}
|
|
172
|
-
}, [closeOnChildClick, hideCard]);
|
|
176
|
+
}, [allowEventPropagation, closeOnChildClick, hideCard]);
|
|
173
177
|
var content = (0, _react2.useCallback)(function (_ref2) {
|
|
174
178
|
var update = _ref2.update;
|
|
175
179
|
var hoverCardContentProps = {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.HoverCard = void 0;
|
|
6
|
+
exports.StandaloneHoverCard = exports.HoverCard = void 0;
|
|
7
7
|
var _analyticsNext = require("@atlaskit/analytics-next");
|
|
8
8
|
var _react = require("@emotion/react");
|
|
9
9
|
var _react2 = require("react");
|
|
@@ -32,7 +32,23 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
32
32
|
}, (0, _react.jsx)(_HoverCardComponent.HoverCardComponent, props, children));
|
|
33
33
|
};
|
|
34
34
|
var HoverCardWithoutAnalyticsContext = (0, _analyticsNext.withAnalyticsEvents)()(HoverCardWithErrorBoundary);
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* A hover preview component using within smart links,
|
|
38
|
+
* e.g. inline card's hover preview and auth tooltip, flexible card's hover preview.
|
|
39
|
+
*
|
|
40
|
+
* This component contains additional props that smart-card internal components
|
|
41
|
+
* use to configure hover preview behaviour.
|
|
42
|
+
*/
|
|
35
43
|
var HoverCard = function HoverCard(props) {
|
|
36
44
|
return (0, _react.jsx)(HoverCardWithoutAnalyticsContext, props);
|
|
37
45
|
};
|
|
38
|
-
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* A standalone hover preview component
|
|
49
|
+
*/
|
|
50
|
+
exports.HoverCard = HoverCard;
|
|
51
|
+
var StandaloneHoverCard = function StandaloneHoverCard(props) {
|
|
52
|
+
return (0, _react.jsx)(HoverCard, props);
|
|
53
|
+
};
|
|
54
|
+
exports.StandaloneHoverCard = StandaloneHoverCard;
|
package/dist/es2019/hoverCard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { HoverCard } from './view/HoverCard';
|
|
1
|
+
export { StandaloneHoverCard as HoverCard } from './view/HoverCard';
|
package/dist/es2019/version.json
CHANGED
|
@@ -217,6 +217,7 @@ const Container = ({
|
|
|
217
217
|
if (context !== null && context !== void 0 && context.url && (canShowHoverPreview || canShowAuthTooltip)) {
|
|
218
218
|
return jsx(HoverCard, {
|
|
219
219
|
url: context === null || context === void 0 ? void 0 : context.url,
|
|
220
|
+
allowEventPropagation: true,
|
|
220
221
|
canOpen: hoverCardCanOpen,
|
|
221
222
|
closeOnChildClick: true,
|
|
222
223
|
hidePreviewButton: hideHoverCardPreviewButton
|
|
@@ -24,7 +24,8 @@ export const HoverCardComponent = ({
|
|
|
24
24
|
canOpen = true,
|
|
25
25
|
closeOnChildClick = false,
|
|
26
26
|
hidePreviewButton = false,
|
|
27
|
-
showServerActions = false
|
|
27
|
+
showServerActions = false,
|
|
28
|
+
allowEventPropagation = false
|
|
28
29
|
}) => {
|
|
29
30
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
30
31
|
const fadeOutTimeoutId = useRef();
|
|
@@ -40,14 +41,14 @@ export const HoverCardComponent = ({
|
|
|
40
41
|
loadMetadata
|
|
41
42
|
} = useSmartCardActions(id, url, analytics);
|
|
42
43
|
const setMousePosition = useCallback(event => {
|
|
43
|
-
if (isOpen) {
|
|
44
|
+
if (isOpen && canOpen) {
|
|
44
45
|
return;
|
|
45
46
|
}
|
|
46
47
|
mousePos.current = {
|
|
47
48
|
x: event.clientX,
|
|
48
49
|
y: event.clientY
|
|
49
50
|
};
|
|
50
|
-
}, [isOpen]);
|
|
51
|
+
}, [canOpen, isOpen]);
|
|
51
52
|
const hideCard = useCallback(() => {
|
|
52
53
|
setIsOpen(false);
|
|
53
54
|
}, []);
|
|
@@ -111,21 +112,22 @@ export const HoverCardComponent = ({
|
|
|
111
112
|
|
|
112
113
|
//Set mouse position in the case it's not already set by onMouseMove, as in the case of scrolling
|
|
113
114
|
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
|
+
}
|
|
114
124
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
115
125
|
// setting a timeout to show a Hover Card after delay runs out
|
|
116
126
|
fadeInTimeoutId.current = setTimeout(() => {
|
|
117
|
-
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
118
|
-
if (parentSpan.current && mousePos.current) {
|
|
119
|
-
const {
|
|
120
|
-
bottom,
|
|
121
|
-
left
|
|
122
|
-
} = parentSpan.current.getBoundingClientRect();
|
|
123
|
-
popupOffset.current = [mousePos.current.x - left, mousePos.current.y - bottom + CARD_GAP_PX];
|
|
124
|
-
}
|
|
125
127
|
setIsOpen(true);
|
|
126
128
|
}, FADE_IN_DELAY);
|
|
127
129
|
}
|
|
128
|
-
}, [initResolve, isOpen, setMousePosition]);
|
|
130
|
+
}, [canOpen, initResolve, isOpen, setMousePosition]);
|
|
129
131
|
const linkActions = useSmartLinkActions({
|
|
130
132
|
url,
|
|
131
133
|
appearance: CardDisplay.HoverCardPreview,
|
|
@@ -142,13 +144,14 @@ export const HoverCardComponent = ({
|
|
|
142
144
|
}, [hideCard]);
|
|
143
145
|
|
|
144
146
|
// Stop hover preview content to propagate event to parent.
|
|
145
|
-
|
|
146
147
|
const onChildClick = useCallback(e => {
|
|
147
|
-
|
|
148
|
+
if (!allowEventPropagation) {
|
|
149
|
+
e.stopPropagation();
|
|
150
|
+
}
|
|
148
151
|
if (closeOnChildClick) {
|
|
149
152
|
hideCard();
|
|
150
153
|
}
|
|
151
|
-
}, [closeOnChildClick, hideCard]);
|
|
154
|
+
}, [allowEventPropagation, closeOnChildClick, hideCard]);
|
|
152
155
|
const content = useCallback(({
|
|
153
156
|
update
|
|
154
157
|
}) => {
|
|
@@ -27,6 +27,19 @@ const HoverCardWithErrorBoundary = props => {
|
|
|
27
27
|
}, jsx(HoverCardComponent, props, children));
|
|
28
28
|
};
|
|
29
29
|
const HoverCardWithoutAnalyticsContext = withAnalyticsEvents()(HoverCardWithErrorBoundary);
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* A hover preview component using within smart links,
|
|
33
|
+
* e.g. inline card's hover preview and auth tooltip, flexible card's hover preview.
|
|
34
|
+
*
|
|
35
|
+
* This component contains additional props that smart-card internal components
|
|
36
|
+
* use to configure hover preview behaviour.
|
|
37
|
+
*/
|
|
30
38
|
export const HoverCard = props => {
|
|
31
39
|
return jsx(HoverCardWithoutAnalyticsContext, props);
|
|
32
|
-
};
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* A standalone hover preview component
|
|
44
|
+
*/
|
|
45
|
+
export const StandaloneHoverCard = props => jsx(HoverCard, props);
|
package/dist/esm/hoverCard.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { HoverCard } from './view/HoverCard';
|
|
1
|
+
export { StandaloneHoverCard as HoverCard } from './view/HoverCard';
|
package/dist/esm/version.json
CHANGED
|
@@ -189,6 +189,7 @@ var Container = function Container(_ref3) {
|
|
|
189
189
|
if (context !== null && context !== void 0 && context.url && (canShowHoverPreview || canShowAuthTooltip)) {
|
|
190
190
|
return jsx(HoverCard, {
|
|
191
191
|
url: context === null || context === void 0 ? void 0 : context.url,
|
|
192
|
+
allowEventPropagation: true,
|
|
192
193
|
canOpen: hoverCardCanOpen,
|
|
193
194
|
closeOnChildClick: true,
|
|
194
195
|
hidePreviewButton: hideHoverCardPreviewButton
|
|
@@ -30,7 +30,9 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
30
30
|
_ref$hidePreviewButto = _ref.hidePreviewButton,
|
|
31
31
|
hidePreviewButton = _ref$hidePreviewButto === void 0 ? false : _ref$hidePreviewButto,
|
|
32
32
|
_ref$showServerAction = _ref.showServerActions,
|
|
33
|
-
showServerActions = _ref$showServerAction === void 0 ? false : _ref$showServerAction
|
|
33
|
+
showServerActions = _ref$showServerAction === void 0 ? false : _ref$showServerAction,
|
|
34
|
+
_ref$allowEventPropag = _ref.allowEventPropagation,
|
|
35
|
+
allowEventPropagation = _ref$allowEventPropag === void 0 ? false : _ref$allowEventPropag;
|
|
34
36
|
var _React$useState = React.useState(false),
|
|
35
37
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
36
38
|
isOpen = _React$useState2[0],
|
|
@@ -47,14 +49,14 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
47
49
|
var _useSmartCardActions = useSmartCardActions(id, url, analytics),
|
|
48
50
|
loadMetadata = _useSmartCardActions.loadMetadata;
|
|
49
51
|
var setMousePosition = useCallback(function (event) {
|
|
50
|
-
if (isOpen) {
|
|
52
|
+
if (isOpen && canOpen) {
|
|
51
53
|
return;
|
|
52
54
|
}
|
|
53
55
|
mousePos.current = {
|
|
54
56
|
x: event.clientX,
|
|
55
57
|
y: event.clientY
|
|
56
58
|
};
|
|
57
|
-
}, [isOpen]);
|
|
59
|
+
}, [canOpen, isOpen]);
|
|
58
60
|
var hideCard = useCallback(function () {
|
|
59
61
|
setIsOpen(false);
|
|
60
62
|
}, []);
|
|
@@ -120,20 +122,21 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
120
122
|
|
|
121
123
|
//Set mouse position in the case it's not already set by onMouseMove, as in the case of scrolling
|
|
122
124
|
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
|
+
}
|
|
123
133
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
124
134
|
// setting a timeout to show a Hover Card after delay runs out
|
|
125
135
|
fadeInTimeoutId.current = setTimeout(function () {
|
|
126
|
-
//If these are undefined then popupOffset is undefined and we fallback to default bottom-start placement
|
|
127
|
-
if (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
136
|
setIsOpen(true);
|
|
134
137
|
}, FADE_IN_DELAY);
|
|
135
138
|
}
|
|
136
|
-
}, [initResolve, isOpen, setMousePosition]);
|
|
139
|
+
}, [canOpen, initResolve, isOpen, setMousePosition]);
|
|
137
140
|
var linkActions = useSmartLinkActions({
|
|
138
141
|
url: url,
|
|
139
142
|
appearance: CardDisplay.HoverCardPreview,
|
|
@@ -152,13 +155,14 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
152
155
|
}, [hideCard]);
|
|
153
156
|
|
|
154
157
|
// Stop hover preview content to propagate event to parent.
|
|
155
|
-
|
|
156
158
|
var onChildClick = useCallback(function (e) {
|
|
157
|
-
|
|
159
|
+
if (!allowEventPropagation) {
|
|
160
|
+
e.stopPropagation();
|
|
161
|
+
}
|
|
158
162
|
if (closeOnChildClick) {
|
|
159
163
|
hideCard();
|
|
160
164
|
}
|
|
161
|
-
}, [closeOnChildClick, hideCard]);
|
|
165
|
+
}, [allowEventPropagation, closeOnChildClick, hideCard]);
|
|
162
166
|
var content = useCallback(function (_ref2) {
|
|
163
167
|
var update = _ref2.update;
|
|
164
168
|
var hoverCardContentProps = {
|
|
@@ -25,6 +25,21 @@ var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
|
25
25
|
}, jsx(HoverCardComponent, props, children));
|
|
26
26
|
};
|
|
27
27
|
var HoverCardWithoutAnalyticsContext = withAnalyticsEvents()(HoverCardWithErrorBoundary);
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* A hover preview component using within smart links,
|
|
31
|
+
* e.g. inline card's hover preview and auth tooltip, flexible card's hover preview.
|
|
32
|
+
*
|
|
33
|
+
* This component contains additional props that smart-card internal components
|
|
34
|
+
* use to configure hover preview behaviour.
|
|
35
|
+
*/
|
|
28
36
|
export var HoverCard = function HoverCard(props) {
|
|
29
37
|
return jsx(HoverCardWithoutAnalyticsContext, props);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* A standalone hover preview component
|
|
42
|
+
*/
|
|
43
|
+
export var StandaloneHoverCard = function StandaloneHoverCard(props) {
|
|
44
|
+
return jsx(HoverCard, props);
|
|
30
45
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { HoverCard } from './view/HoverCard';
|
|
1
|
+
export { StandaloneHoverCard as HoverCard } from './view/HoverCard';
|
|
2
2
|
export type { HoverCardProps } from './view/HoverCard/types';
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
-
import { HoverCardProps } from './types';
|
|
3
|
-
|
|
2
|
+
import { HoverCardInternalProps, HoverCardProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A hover preview component using within smart links,
|
|
5
|
+
* e.g. inline card's hover preview and auth tooltip, flexible card's hover preview.
|
|
6
|
+
*
|
|
7
|
+
* This component contains additional props that smart-card internal components
|
|
8
|
+
* use to configure hover preview behaviour.
|
|
9
|
+
*/
|
|
10
|
+
export declare const HoverCard: (props: HoverCardProps & HoverCardInternalProps) => jsx.JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* A standalone hover preview component
|
|
13
|
+
*/
|
|
14
|
+
export declare const StandaloneHoverCard: (props: HoverCardProps) => jsx.JSX.Element;
|
|
@@ -43,7 +43,20 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
|
43
43
|
*/
|
|
44
44
|
showServerActions?: boolean;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* An internal props that internal smart-card components can use to configure
|
|
48
|
+
* hover preview behaviour. The prop contains here are suitable for unsafe
|
|
49
|
+
* or experiment props that will not be or are yet ready to be available on
|
|
50
|
+
* standalone hover card.
|
|
51
|
+
*/
|
|
52
|
+
export interface HoverCardInternalProps {
|
|
53
|
+
/**
|
|
54
|
+
* Allow click event to bubble up from hover preview trigger component.
|
|
55
|
+
* @see EDM-7187 for further details
|
|
56
|
+
*/
|
|
57
|
+
allowEventPropagation?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface HoverCardComponentProps extends HoverCardProps, HoverCardInternalProps {
|
|
47
60
|
analyticsHandler?: AnalyticsHandler;
|
|
48
61
|
analytics?: AnalyticsFacade;
|
|
49
62
|
canOpen?: boolean;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { HoverCard } from './view/HoverCard';
|
|
1
|
+
export { StandaloneHoverCard as HoverCard } from './view/HoverCard';
|
|
2
2
|
export type { HoverCardProps } from './view/HoverCard/types';
|
|
@@ -1,3 +1,14 @@
|
|
|
1
1
|
import { jsx } from '@emotion/react';
|
|
2
|
-
import { HoverCardProps } from './types';
|
|
3
|
-
|
|
2
|
+
import { HoverCardInternalProps, HoverCardProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A hover preview component using within smart links,
|
|
5
|
+
* e.g. inline card's hover preview and auth tooltip, flexible card's hover preview.
|
|
6
|
+
*
|
|
7
|
+
* This component contains additional props that smart-card internal components
|
|
8
|
+
* use to configure hover preview behaviour.
|
|
9
|
+
*/
|
|
10
|
+
export declare const HoverCard: (props: HoverCardProps & HoverCardInternalProps) => jsx.JSX.Element;
|
|
11
|
+
/**
|
|
12
|
+
* A standalone hover preview component
|
|
13
|
+
*/
|
|
14
|
+
export declare const StandaloneHoverCard: (props: HoverCardProps) => jsx.JSX.Element;
|
|
@@ -43,7 +43,20 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
|
43
43
|
*/
|
|
44
44
|
showServerActions?: boolean;
|
|
45
45
|
}
|
|
46
|
-
|
|
46
|
+
/**
|
|
47
|
+
* An internal props that internal smart-card components can use to configure
|
|
48
|
+
* hover preview behaviour. The prop contains here are suitable for unsafe
|
|
49
|
+
* or experiment props that will not be or are yet ready to be available on
|
|
50
|
+
* standalone hover card.
|
|
51
|
+
*/
|
|
52
|
+
export interface HoverCardInternalProps {
|
|
53
|
+
/**
|
|
54
|
+
* Allow click event to bubble up from hover preview trigger component.
|
|
55
|
+
* @see EDM-7187 for further details
|
|
56
|
+
*/
|
|
57
|
+
allowEventPropagation?: boolean;
|
|
58
|
+
}
|
|
59
|
+
export interface HoverCardComponentProps extends HoverCardProps, HoverCardInternalProps {
|
|
47
60
|
analyticsHandler?: AnalyticsHandler;
|
|
48
61
|
analytics?: AnalyticsFacade;
|
|
49
62
|
canOpen?: boolean;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.9.
|
|
3
|
+
"version": "26.9.2",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -42,9 +42,9 @@
|
|
|
42
42
|
"@atlaskit/icon-object": "^6.3.0",
|
|
43
43
|
"@atlaskit/icon-priority": "^6.3.0",
|
|
44
44
|
"@atlaskit/in-product-testing": "^0.2.0",
|
|
45
|
-
"@atlaskit/link-analytics": "^8.
|
|
45
|
+
"@atlaskit/link-analytics": "^8.2.0",
|
|
46
46
|
"@atlaskit/link-client-extension": "^1.5.0",
|
|
47
|
-
"@atlaskit/linking-common": "^3.
|
|
47
|
+
"@atlaskit/linking-common": "^3.2.0",
|
|
48
48
|
"@atlaskit/linking-types": "^8.1.0",
|
|
49
49
|
"@atlaskit/logo": "^13.14.0",
|
|
50
50
|
"@atlaskit/lozenge": "^11.4.0",
|
|
@@ -79,25 +79,11 @@
|
|
|
79
79
|
},
|
|
80
80
|
"devDependencies": {
|
|
81
81
|
"@atlaskit/avatar": "^21.3.0",
|
|
82
|
-
"@atlaskit/checkbox": "^12.6.0",
|
|
83
|
-
"@atlaskit/code": "^14.6.0",
|
|
84
82
|
"@atlaskit/css-reset": "^6.5.0",
|
|
85
|
-
"@atlaskit/docs": "*",
|
|
86
|
-
"@atlaskit/form": "^8.11.0",
|
|
87
|
-
"@atlaskit/inline-message": "^11.5.0",
|
|
88
83
|
"@atlaskit/link-test-helpers": "^4.1.0",
|
|
89
84
|
"@atlaskit/lozenge": "^11.4.0",
|
|
90
85
|
"@atlaskit/media-integration-test-helpers": "^3.0.0",
|
|
91
86
|
"@atlaskit/media-test-helpers": "^33.0.0",
|
|
92
|
-
"@atlaskit/page": "^12.3.0",
|
|
93
|
-
"@atlaskit/radio": "^5.6.0",
|
|
94
|
-
"@atlaskit/range": "^7.1.0",
|
|
95
|
-
"@atlaskit/section-message": "^6.4.0",
|
|
96
|
-
"@atlaskit/select": "^16.5.0",
|
|
97
|
-
"@atlaskit/table-tree": "^9.6.0",
|
|
98
|
-
"@atlaskit/tabs": "^13.4.0",
|
|
99
|
-
"@atlaskit/textfield": "^5.5.0",
|
|
100
|
-
"@atlaskit/toggle": "^12.6.0",
|
|
101
87
|
"@atlaskit/visual-regression": "*",
|
|
102
88
|
"@atlassian/atlassian-frontend-prettier-config-1.0.1": "npm:@atlassian/atlassian-frontend-prettier-config@1.0.1",
|
|
103
89
|
"@atlassian/feature-flags-test-utils": "^0.1.1",
|