@atlaskit/smart-card 27.8.4 → 27.9.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 +8 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/CardWithUrl/component.js +3 -0
- package/dist/cjs/view/CardWithUrl/loader.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/container/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/index.js +2 -0
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +6 -3
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/cjs/view/InlineCard/index.js +2 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +3 -0
- package/dist/es2019/view/CardWithUrl/loader.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +4 -2
- package/dist/es2019/view/FlexibleCard/components/container/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/index.js +2 -0
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +6 -3
- package/dist/es2019/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/es2019/view/InlineCard/index.js +2 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +3 -0
- package/dist/esm/view/CardWithUrl/loader.js +2 -0
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/container/index.js +3 -1
- package/dist/esm/view/FlexibleCard/index.js +2 -0
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +6 -3
- package/dist/esm/view/InlineCard/ResolvedView/index.js +3 -1
- package/dist/esm/view/InlineCard/index.js +2 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/Card/index.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +2 -0
- package/dist/types/view/CardWithUrl/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/container/hover-card-control/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/container/hover-card-control/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/container/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/container/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/types.d.ts +5 -0
- package/dist/types/view/HoverCard/types.d.ts +7 -0
- package/dist/types/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types/view/InlineCard/types.d.ts +2 -0
- package/dist/types-ts4.5/view/Card/index.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +2 -0
- package/dist/types-ts4.5/view/CardWithUrl/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/container/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/container/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +5 -0
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +7 -0
- package/dist/types-ts4.5/view/InlineCard/ResolvedView/index.d.ts +2 -0
- package/dist/types-ts4.5/view/InlineCard/types.d.ts +2 -0
- package/package.json +8 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 27.9.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#117451](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/117451)
|
|
8
|
+
[`0ecc0082a92e6`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0ecc0082a92e6) -
|
|
9
|
+
Add hover card configs prop, with an option to control fade in delay
|
|
10
|
+
|
|
3
11
|
## 27.8.4
|
|
4
12
|
|
|
5
13
|
### Patch Changes
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "27.
|
|
25
|
+
packageVersion: "27.9.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -49,6 +49,7 @@ function Component(_ref) {
|
|
|
49
49
|
ui = _ref.ui,
|
|
50
50
|
children = _ref.children,
|
|
51
51
|
showHoverPreview = _ref.showHoverPreview,
|
|
52
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
52
53
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
53
54
|
analyticsEvents = _ref.analyticsEvents,
|
|
54
55
|
useLegacyBlockCard = _ref.useLegacyBlockCard;
|
|
@@ -198,6 +199,7 @@ function Component(_ref) {
|
|
|
198
199
|
renderers: renderers,
|
|
199
200
|
ui: ui,
|
|
200
201
|
showHoverPreview: showHoverPreview,
|
|
202
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
201
203
|
showAuthTooltip: showAuthTooltip,
|
|
202
204
|
actionOptions: actionOptions,
|
|
203
205
|
url: url,
|
|
@@ -229,6 +231,7 @@ function Component(_ref) {
|
|
|
229
231
|
testId: testId,
|
|
230
232
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
231
233
|
showHoverPreview: showHoverPreview,
|
|
234
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
232
235
|
showAuthTooltip: showAuthTooltip,
|
|
233
236
|
actionOptions: actionOptions
|
|
234
237
|
});
|
|
@@ -59,6 +59,7 @@ function CardWithURLRenderer(props) {
|
|
|
59
59
|
children = props.children,
|
|
60
60
|
ui = props.ui,
|
|
61
61
|
showHoverPreview = props.showHoverPreview,
|
|
62
|
+
hoverPreviewOptions = props.hoverPreviewOptions,
|
|
62
63
|
showAuthTooltip = props.showAuthTooltip,
|
|
63
64
|
analyticsEvents = props.analyticsEvents,
|
|
64
65
|
placeholder = props.placeholder,
|
|
@@ -129,6 +130,7 @@ function CardWithURLRenderer(props) {
|
|
|
129
130
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
130
131
|
ui: ui,
|
|
131
132
|
showHoverPreview: showHoverPreview,
|
|
133
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
132
134
|
showAuthTooltip: showAuthTooltip,
|
|
133
135
|
analyticsEvents: analyticsEvents,
|
|
134
136
|
placeholder: placeholder,
|
|
@@ -22,7 +22,8 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
22
22
|
testId = _ref.testId,
|
|
23
23
|
url = _ref.url,
|
|
24
24
|
_ref$delay = _ref.delay,
|
|
25
|
-
delay = _ref$delay === void 0 ? FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY : _ref$delay
|
|
25
|
+
delay = _ref$delay === void 0 ? FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY : _ref$delay,
|
|
26
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions;
|
|
26
27
|
var _useState = (0, _react.useState)(true),
|
|
27
28
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
28
29
|
canOpen = _useState2[0],
|
|
@@ -69,7 +70,8 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
69
70
|
closeOnChildClick: true,
|
|
70
71
|
hidePreviewButton: hideHoverCardPreviewButton,
|
|
71
72
|
actionOptions: actionOptions,
|
|
72
|
-
url: url
|
|
73
|
+
url: url,
|
|
74
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
73
75
|
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
74
76
|
onMouseLeave: onMouseLeave,
|
|
75
77
|
onMouseMove: onMouseMove,
|
|
@@ -187,6 +187,7 @@ var Container = function Container(_ref3) {
|
|
|
187
187
|
showAuthTooltip = _ref3$showAuthTooltip === void 0 ? false : _ref3$showAuthTooltip,
|
|
188
188
|
_ref3$showHoverPrevie = _ref3.showHoverPreview,
|
|
189
189
|
showHoverPreview = _ref3$showHoverPrevie === void 0 ? false : _ref3$showHoverPrevie,
|
|
190
|
+
hoverPreviewOptions = _ref3.hoverPreviewOptions,
|
|
190
191
|
actionOptions = _ref3.actionOptions,
|
|
191
192
|
_ref3$size = _ref3.size,
|
|
192
193
|
size = _ref3$size === void 0 ? _constants.SmartLinkSize.Medium : _ref3$size,
|
|
@@ -214,7 +215,8 @@ var Container = function Container(_ref3) {
|
|
|
214
215
|
isAuthTooltip: canShowAuthTooltip,
|
|
215
216
|
actionOptions: actionOptions,
|
|
216
217
|
testId: testId,
|
|
217
|
-
url: context.url
|
|
218
|
+
url: context.url,
|
|
219
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
218
220
|
}, container);
|
|
219
221
|
}
|
|
220
222
|
return container;
|
|
@@ -39,6 +39,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
39
39
|
renderers = _ref.renderers,
|
|
40
40
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
41
41
|
showHoverPreview = _ref.showHoverPreview,
|
|
42
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
42
43
|
actionOptions = _ref.actionOptions,
|
|
43
44
|
testId = _ref.testId,
|
|
44
45
|
ui = _ref.ui,
|
|
@@ -104,6 +105,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
104
105
|
onClick: onClick,
|
|
105
106
|
retry: retry,
|
|
106
107
|
showHoverPreview: showHoverPreview,
|
|
108
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
107
109
|
actionOptions: actionOptions,
|
|
108
110
|
showAuthTooltip: showAuthTooltip,
|
|
109
111
|
status: status
|
|
@@ -33,6 +33,7 @@ var FADE_IN_DELAY = 500;
|
|
|
33
33
|
var FADE_OUT_DELAY = 300;
|
|
34
34
|
var RESOLVE_DELAY = 100;
|
|
35
35
|
var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponent(_ref) {
|
|
36
|
+
var _hoverPreviewOptions$;
|
|
36
37
|
var children = _ref.children,
|
|
37
38
|
url = _ref.url,
|
|
38
39
|
_ref$id = _ref.id,
|
|
@@ -51,7 +52,9 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
51
52
|
_ref$zIndex = _ref.zIndex,
|
|
52
53
|
zIndex = _ref$zIndex === void 0 ? _styled.HOVER_CARD_Z_INDEX : _ref$zIndex,
|
|
53
54
|
_ref$noFadeDelay = _ref.noFadeDelay,
|
|
54
|
-
noFadeDelay = _ref$noFadeDelay === void 0 ? false : _ref$noFadeDelay
|
|
55
|
+
noFadeDelay = _ref$noFadeDelay === void 0 ? false : _ref$noFadeDelay,
|
|
56
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions;
|
|
57
|
+
var fadeInDelay = (_hoverPreviewOptions$ = hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.fadeInDelay) !== null && _hoverPreviewOptions$ !== void 0 ? _hoverPreviewOptions$ : FADE_IN_DELAY;
|
|
55
58
|
var _React$useState = _react2.default.useState(false),
|
|
56
59
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
57
60
|
isOpen = _React$useState2[0],
|
|
@@ -161,10 +164,10 @@ var HoverCardComponent = exports.HoverCardComponent = function HoverCardComponen
|
|
|
161
164
|
} else {
|
|
162
165
|
fadeInTimeoutId.current = setTimeout(function () {
|
|
163
166
|
setIsOpen(true);
|
|
164
|
-
},
|
|
167
|
+
}, fadeInDelay);
|
|
165
168
|
}
|
|
166
169
|
}
|
|
167
|
-
}, [initResolve, isOpen, setMousePosition, noFadeDelay]);
|
|
170
|
+
}, [initResolve, isOpen, setMousePosition, noFadeDelay, fadeInDelay]);
|
|
168
171
|
var linkActions = (0, _useSmartLinkActions.useSmartLinkActions)({
|
|
169
172
|
url: url,
|
|
170
173
|
appearance: _constants.CardDisplay.HoverCardPreview,
|
|
@@ -60,6 +60,7 @@ var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/funct
|
|
|
60
60
|
titlePrefix = _this$props.titlePrefix,
|
|
61
61
|
_this$props$showHover = _this$props.showHoverPreview,
|
|
62
62
|
showHoverPreview = _this$props$showHover === void 0 ? false : _this$props$showHover,
|
|
63
|
+
hoverPreviewOptions = _this$props.hoverPreviewOptions,
|
|
63
64
|
actionOptions = _this$props.actionOptions;
|
|
64
65
|
var inlineCardResolvedView = /*#__PURE__*/_react.default.createElement(_Frame.Frame, {
|
|
65
66
|
testId: testId,
|
|
@@ -77,7 +78,8 @@ var InlineCardResolvedView = exports.InlineCardResolvedView = /*#__PURE__*/funct
|
|
|
77
78
|
return /*#__PURE__*/_react.default.createElement(_index.HoverCard, {
|
|
78
79
|
id: id,
|
|
79
80
|
url: link,
|
|
80
|
-
actionOptions: actionOptions
|
|
81
|
+
actionOptions: actionOptions,
|
|
82
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
81
83
|
}, inlineCardResolvedView);
|
|
82
84
|
}
|
|
83
85
|
return inlineCardResolvedView;
|
|
@@ -70,6 +70,7 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
|
70
70
|
testId = _ref.testId,
|
|
71
71
|
inlinePreloaderStyle = _ref.inlinePreloaderStyle,
|
|
72
72
|
showHoverPreview = _ref.showHoverPreview,
|
|
73
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
73
74
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
74
75
|
actionOptions = _ref.actionOptions;
|
|
75
76
|
var _useAnalyticsEvents = (0, _analyticsNext.useAnalyticsEvents)(),
|
|
@@ -120,6 +121,7 @@ var InlineCard = exports.InlineCard = function InlineCard(_ref) {
|
|
|
120
121
|
return /*#__PURE__*/_react.default.createElement(_ResolvedView.InlineCardResolvedView, (0, _extends2.default)({}, resolvedProps, {
|
|
121
122
|
id: id,
|
|
122
123
|
showHoverPreview: showHoverPreview,
|
|
124
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
123
125
|
actionOptions: actionOptions,
|
|
124
126
|
link: url,
|
|
125
127
|
isSelected: isSelected,
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "27.
|
|
20
|
+
packageVersion: "27.9.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "27.
|
|
7
|
+
packageVersion: "27.9.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -39,6 +39,7 @@ function Component({
|
|
|
39
39
|
ui,
|
|
40
40
|
children,
|
|
41
41
|
showHoverPreview,
|
|
42
|
+
hoverPreviewOptions,
|
|
42
43
|
showAuthTooltip,
|
|
43
44
|
analyticsEvents,
|
|
44
45
|
useLegacyBlockCard
|
|
@@ -185,6 +186,7 @@ function Component({
|
|
|
185
186
|
renderers: renderers,
|
|
186
187
|
ui: ui,
|
|
187
188
|
showHoverPreview: showHoverPreview,
|
|
189
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
188
190
|
showAuthTooltip: showAuthTooltip,
|
|
189
191
|
actionOptions: actionOptions,
|
|
190
192
|
url: url,
|
|
@@ -216,6 +218,7 @@ function Component({
|
|
|
216
218
|
testId: testId,
|
|
217
219
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
218
220
|
showHoverPreview: showHoverPreview,
|
|
221
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
219
222
|
showAuthTooltip: showAuthTooltip,
|
|
220
223
|
actionOptions: actionOptions
|
|
221
224
|
});
|
|
@@ -39,6 +39,7 @@ export function CardWithURLRenderer(props) {
|
|
|
39
39
|
children,
|
|
40
40
|
ui,
|
|
41
41
|
showHoverPreview,
|
|
42
|
+
hoverPreviewOptions,
|
|
42
43
|
showAuthTooltip,
|
|
43
44
|
analyticsEvents,
|
|
44
45
|
placeholder,
|
|
@@ -108,6 +109,7 @@ export function CardWithURLRenderer(props) {
|
|
|
108
109
|
inlinePreloaderStyle,
|
|
109
110
|
ui,
|
|
110
111
|
showHoverPreview,
|
|
112
|
+
hoverPreviewOptions,
|
|
111
113
|
showAuthTooltip,
|
|
112
114
|
analyticsEvents,
|
|
113
115
|
placeholder,
|
|
@@ -10,7 +10,8 @@ const HoverCardControl = ({
|
|
|
10
10
|
actionOptions,
|
|
11
11
|
testId,
|
|
12
12
|
url,
|
|
13
|
-
delay = FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY
|
|
13
|
+
delay = FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY,
|
|
14
|
+
hoverPreviewOptions
|
|
14
15
|
}) => {
|
|
15
16
|
const [canOpen, setCanOpen] = useState(true);
|
|
16
17
|
const mouseStopTimer = useRef();
|
|
@@ -55,7 +56,8 @@ const HoverCardControl = ({
|
|
|
55
56
|
closeOnChildClick: true,
|
|
56
57
|
hidePreviewButton: hideHoverCardPreviewButton,
|
|
57
58
|
actionOptions: actionOptions,
|
|
58
|
-
url: url
|
|
59
|
+
url: url,
|
|
60
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
59
61
|
}, /*#__PURE__*/React.createElement("span", {
|
|
60
62
|
onMouseLeave: onMouseLeave,
|
|
61
63
|
onMouseMove: onMouseMove,
|
|
@@ -189,6 +189,7 @@ const Container = ({
|
|
|
189
189
|
retry,
|
|
190
190
|
showAuthTooltip = false,
|
|
191
191
|
showHoverPreview = false,
|
|
192
|
+
hoverPreviewOptions,
|
|
192
193
|
actionOptions,
|
|
193
194
|
size = SmartLinkSize.Medium,
|
|
194
195
|
status,
|
|
@@ -214,7 +215,8 @@ const Container = ({
|
|
|
214
215
|
isAuthTooltip: canShowAuthTooltip,
|
|
215
216
|
actionOptions: actionOptions,
|
|
216
217
|
testId: testId,
|
|
217
|
-
url: context.url
|
|
218
|
+
url: context.url,
|
|
219
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
218
220
|
}, container);
|
|
219
221
|
}
|
|
220
222
|
return container;
|
|
@@ -25,6 +25,7 @@ const FlexibleCard = ({
|
|
|
25
25
|
renderers,
|
|
26
26
|
showAuthTooltip,
|
|
27
27
|
showHoverPreview,
|
|
28
|
+
hoverPreviewOptions,
|
|
28
29
|
actionOptions,
|
|
29
30
|
testId,
|
|
30
31
|
ui,
|
|
@@ -94,6 +95,7 @@ const FlexibleCard = ({
|
|
|
94
95
|
onClick: onClick,
|
|
95
96
|
retry: retry,
|
|
96
97
|
showHoverPreview: showHoverPreview,
|
|
98
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
97
99
|
actionOptions: actionOptions,
|
|
98
100
|
showAuthTooltip: showAuthTooltip,
|
|
99
101
|
status: status
|
|
@@ -31,8 +31,11 @@ export const HoverCardComponent = ({
|
|
|
31
31
|
actionOptions: actionOptionsProp,
|
|
32
32
|
allowEventPropagation = false,
|
|
33
33
|
zIndex = HOVER_CARD_Z_INDEX,
|
|
34
|
-
noFadeDelay = false
|
|
34
|
+
noFadeDelay = false,
|
|
35
|
+
hoverPreviewOptions
|
|
35
36
|
}) => {
|
|
37
|
+
var _hoverPreviewOptions$;
|
|
38
|
+
const fadeInDelay = (_hoverPreviewOptions$ = hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.fadeInDelay) !== null && _hoverPreviewOptions$ !== void 0 ? _hoverPreviewOptions$ : FADE_IN_DELAY;
|
|
36
39
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
37
40
|
const fadeOutTimeoutId = useRef();
|
|
38
41
|
const fadeInTimeoutId = useRef();
|
|
@@ -139,10 +142,10 @@ export const HoverCardComponent = ({
|
|
|
139
142
|
} else {
|
|
140
143
|
fadeInTimeoutId.current = setTimeout(() => {
|
|
141
144
|
setIsOpen(true);
|
|
142
|
-
},
|
|
145
|
+
}, fadeInDelay);
|
|
143
146
|
}
|
|
144
147
|
}
|
|
145
|
-
}, [initResolve, isOpen, setMousePosition, noFadeDelay]);
|
|
148
|
+
}, [initResolve, isOpen, setMousePosition, noFadeDelay, fadeInDelay]);
|
|
146
149
|
const linkActions = useSmartLinkActions({
|
|
147
150
|
url,
|
|
148
151
|
appearance: CardDisplay.HoverCardPreview,
|
|
@@ -35,6 +35,7 @@ export class InlineCardResolvedView extends React.Component {
|
|
|
35
35
|
titleTextColor,
|
|
36
36
|
titlePrefix,
|
|
37
37
|
showHoverPreview = false,
|
|
38
|
+
hoverPreviewOptions,
|
|
38
39
|
actionOptions
|
|
39
40
|
} = this.props;
|
|
40
41
|
const inlineCardResolvedView = /*#__PURE__*/React.createElement(Frame, {
|
|
@@ -53,7 +54,8 @@ export class InlineCardResolvedView extends React.Component {
|
|
|
53
54
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
54
55
|
id: id,
|
|
55
56
|
url: link,
|
|
56
|
-
actionOptions: actionOptions
|
|
57
|
+
actionOptions: actionOptions,
|
|
58
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
57
59
|
}, inlineCardResolvedView);
|
|
58
60
|
}
|
|
59
61
|
return inlineCardResolvedView;
|
|
@@ -30,6 +30,7 @@ export const InlineCard = ({
|
|
|
30
30
|
testId,
|
|
31
31
|
inlinePreloaderStyle,
|
|
32
32
|
showHoverPreview,
|
|
33
|
+
hoverPreviewOptions,
|
|
33
34
|
showAuthTooltip,
|
|
34
35
|
actionOptions
|
|
35
36
|
}) => {
|
|
@@ -85,6 +86,7 @@ export const InlineCard = ({
|
|
|
85
86
|
return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
|
|
86
87
|
id: id,
|
|
87
88
|
showHoverPreview: showHoverPreview,
|
|
89
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
88
90
|
actionOptions: actionOptions,
|
|
89
91
|
link: url,
|
|
90
92
|
isSelected: isSelected,
|
|
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
7
7
|
import LinkWarningModal from './LinkWarningModal';
|
|
8
8
|
const PACKAGE_DATA = {
|
|
9
9
|
packageName: "@atlaskit/smart-card",
|
|
10
|
-
packageVersion: "27.
|
|
10
|
+
packageVersion: "27.9.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "27.
|
|
18
|
+
packageVersion: "27.9.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -39,6 +39,7 @@ function Component(_ref) {
|
|
|
39
39
|
ui = _ref.ui,
|
|
40
40
|
children = _ref.children,
|
|
41
41
|
showHoverPreview = _ref.showHoverPreview,
|
|
42
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
42
43
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
43
44
|
analyticsEvents = _ref.analyticsEvents,
|
|
44
45
|
useLegacyBlockCard = _ref.useLegacyBlockCard;
|
|
@@ -188,6 +189,7 @@ function Component(_ref) {
|
|
|
188
189
|
renderers: renderers,
|
|
189
190
|
ui: ui,
|
|
190
191
|
showHoverPreview: showHoverPreview,
|
|
192
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
191
193
|
showAuthTooltip: showAuthTooltip,
|
|
192
194
|
actionOptions: actionOptions,
|
|
193
195
|
url: url,
|
|
@@ -219,6 +221,7 @@ function Component(_ref) {
|
|
|
219
221
|
testId: testId,
|
|
220
222
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
221
223
|
showHoverPreview: showHoverPreview,
|
|
224
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
222
225
|
showAuthTooltip: showAuthTooltip,
|
|
223
226
|
actionOptions: actionOptions
|
|
224
227
|
});
|
|
@@ -47,6 +47,7 @@ export function CardWithURLRenderer(props) {
|
|
|
47
47
|
children = props.children,
|
|
48
48
|
ui = props.ui,
|
|
49
49
|
showHoverPreview = props.showHoverPreview,
|
|
50
|
+
hoverPreviewOptions = props.hoverPreviewOptions,
|
|
50
51
|
showAuthTooltip = props.showAuthTooltip,
|
|
51
52
|
analyticsEvents = props.analyticsEvents,
|
|
52
53
|
placeholder = props.placeholder,
|
|
@@ -117,6 +118,7 @@ export function CardWithURLRenderer(props) {
|
|
|
117
118
|
inlinePreloaderStyle: inlinePreloaderStyle,
|
|
118
119
|
ui: ui,
|
|
119
120
|
showHoverPreview: showHoverPreview,
|
|
121
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
120
122
|
showAuthTooltip: showAuthTooltip,
|
|
121
123
|
analyticsEvents: analyticsEvents,
|
|
122
124
|
placeholder: placeholder,
|
|
@@ -12,7 +12,8 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
12
12
|
testId = _ref.testId,
|
|
13
13
|
url = _ref.url,
|
|
14
14
|
_ref$delay = _ref.delay,
|
|
15
|
-
delay = _ref$delay === void 0 ? FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY : _ref$delay
|
|
15
|
+
delay = _ref$delay === void 0 ? FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY : _ref$delay,
|
|
16
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions;
|
|
16
17
|
var _useState = useState(true),
|
|
17
18
|
_useState2 = _slicedToArray(_useState, 2),
|
|
18
19
|
canOpen = _useState2[0],
|
|
@@ -59,7 +60,8 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
59
60
|
closeOnChildClick: true,
|
|
60
61
|
hidePreviewButton: hideHoverCardPreviewButton,
|
|
61
62
|
actionOptions: actionOptions,
|
|
62
|
-
url: url
|
|
63
|
+
url: url,
|
|
64
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
63
65
|
}, /*#__PURE__*/React.createElement("span", {
|
|
64
66
|
onMouseLeave: onMouseLeave,
|
|
65
67
|
onMouseMove: onMouseMove,
|
|
@@ -177,6 +177,7 @@ var Container = function Container(_ref3) {
|
|
|
177
177
|
showAuthTooltip = _ref3$showAuthTooltip === void 0 ? false : _ref3$showAuthTooltip,
|
|
178
178
|
_ref3$showHoverPrevie = _ref3.showHoverPreview,
|
|
179
179
|
showHoverPreview = _ref3$showHoverPrevie === void 0 ? false : _ref3$showHoverPrevie,
|
|
180
|
+
hoverPreviewOptions = _ref3.hoverPreviewOptions,
|
|
180
181
|
actionOptions = _ref3.actionOptions,
|
|
181
182
|
_ref3$size = _ref3.size,
|
|
182
183
|
size = _ref3$size === void 0 ? SmartLinkSize.Medium : _ref3$size,
|
|
@@ -204,7 +205,8 @@ var Container = function Container(_ref3) {
|
|
|
204
205
|
isAuthTooltip: canShowAuthTooltip,
|
|
205
206
|
actionOptions: actionOptions,
|
|
206
207
|
testId: testId,
|
|
207
|
-
url: context.url
|
|
208
|
+
url: context.url,
|
|
209
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
208
210
|
}, container);
|
|
209
211
|
}
|
|
210
212
|
return container;
|
|
@@ -30,6 +30,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
30
30
|
renderers = _ref.renderers,
|
|
31
31
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
32
32
|
showHoverPreview = _ref.showHoverPreview,
|
|
33
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
33
34
|
actionOptions = _ref.actionOptions,
|
|
34
35
|
testId = _ref.testId,
|
|
35
36
|
ui = _ref.ui,
|
|
@@ -95,6 +96,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
95
96
|
onClick: onClick,
|
|
96
97
|
retry: retry,
|
|
97
98
|
showHoverPreview: showHoverPreview,
|
|
99
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
98
100
|
actionOptions: actionOptions,
|
|
99
101
|
showAuthTooltip: showAuthTooltip,
|
|
100
102
|
status: status
|
|
@@ -21,6 +21,7 @@ var FADE_IN_DELAY = 500;
|
|
|
21
21
|
var FADE_OUT_DELAY = 300;
|
|
22
22
|
var RESOLVE_DELAY = 100;
|
|
23
23
|
export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
24
|
+
var _hoverPreviewOptions$;
|
|
24
25
|
var children = _ref.children,
|
|
25
26
|
url = _ref.url,
|
|
26
27
|
_ref$id = _ref.id,
|
|
@@ -39,7 +40,9 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
39
40
|
_ref$zIndex = _ref.zIndex,
|
|
40
41
|
zIndex = _ref$zIndex === void 0 ? HOVER_CARD_Z_INDEX : _ref$zIndex,
|
|
41
42
|
_ref$noFadeDelay = _ref.noFadeDelay,
|
|
42
|
-
noFadeDelay = _ref$noFadeDelay === void 0 ? false : _ref$noFadeDelay
|
|
43
|
+
noFadeDelay = _ref$noFadeDelay === void 0 ? false : _ref$noFadeDelay,
|
|
44
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions;
|
|
45
|
+
var fadeInDelay = (_hoverPreviewOptions$ = hoverPreviewOptions === null || hoverPreviewOptions === void 0 ? void 0 : hoverPreviewOptions.fadeInDelay) !== null && _hoverPreviewOptions$ !== void 0 ? _hoverPreviewOptions$ : FADE_IN_DELAY;
|
|
43
46
|
var _React$useState = React.useState(false),
|
|
44
47
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
45
48
|
isOpen = _React$useState2[0],
|
|
@@ -149,10 +152,10 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
149
152
|
} else {
|
|
150
153
|
fadeInTimeoutId.current = setTimeout(function () {
|
|
151
154
|
setIsOpen(true);
|
|
152
|
-
},
|
|
155
|
+
}, fadeInDelay);
|
|
153
156
|
}
|
|
154
157
|
}
|
|
155
|
-
}, [initResolve, isOpen, setMousePosition, noFadeDelay]);
|
|
158
|
+
}, [initResolve, isOpen, setMousePosition, noFadeDelay, fadeInDelay]);
|
|
156
159
|
var linkActions = useSmartLinkActions({
|
|
157
160
|
url: url,
|
|
158
161
|
appearance: CardDisplay.HoverCardPreview,
|
|
@@ -53,6 +53,7 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
53
53
|
titlePrefix = _this$props.titlePrefix,
|
|
54
54
|
_this$props$showHover = _this$props.showHoverPreview,
|
|
55
55
|
showHoverPreview = _this$props$showHover === void 0 ? false : _this$props$showHover,
|
|
56
|
+
hoverPreviewOptions = _this$props.hoverPreviewOptions,
|
|
56
57
|
actionOptions = _this$props.actionOptions;
|
|
57
58
|
var inlineCardResolvedView = /*#__PURE__*/React.createElement(Frame, {
|
|
58
59
|
testId: testId,
|
|
@@ -70,7 +71,8 @@ export var InlineCardResolvedView = /*#__PURE__*/function (_React$Component) {
|
|
|
70
71
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
71
72
|
id: id,
|
|
72
73
|
url: link,
|
|
73
|
-
actionOptions: actionOptions
|
|
74
|
+
actionOptions: actionOptions,
|
|
75
|
+
hoverPreviewOptions: hoverPreviewOptions
|
|
74
76
|
}, inlineCardResolvedView);
|
|
75
77
|
}
|
|
76
78
|
return inlineCardResolvedView;
|
|
@@ -31,6 +31,7 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
31
31
|
testId = _ref.testId,
|
|
32
32
|
inlinePreloaderStyle = _ref.inlinePreloaderStyle,
|
|
33
33
|
showHoverPreview = _ref.showHoverPreview,
|
|
34
|
+
hoverPreviewOptions = _ref.hoverPreviewOptions,
|
|
34
35
|
showAuthTooltip = _ref.showAuthTooltip,
|
|
35
36
|
actionOptions = _ref.actionOptions;
|
|
36
37
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
@@ -81,6 +82,7 @@ export var InlineCard = function InlineCard(_ref) {
|
|
|
81
82
|
return /*#__PURE__*/React.createElement(InlineCardResolvedView, _extends({}, resolvedProps, {
|
|
82
83
|
id: id,
|
|
83
84
|
showHoverPreview: showHoverPreview,
|
|
85
|
+
hoverPreviewOptions: hoverPreviewOptions,
|
|
84
86
|
actionOptions: actionOptions,
|
|
85
87
|
link: url,
|
|
86
88
|
isSelected: isSelected,
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "27.
|
|
13
|
+
packageVersion: "27.9.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
3
3
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -6,6 +6,7 @@ import { type AnalyticsFacade } from '../../state/analytics';
|
|
|
6
6
|
import { type FlexibleUiOptions } from '../FlexibleCard/types';
|
|
7
7
|
import { type InlinePreloaderStyle, type OnErrorCallback } from '../types';
|
|
8
8
|
import { type FrameStyle } from '../EmbedCard/types';
|
|
9
|
+
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
9
10
|
export type { CardAppearance, CardPlatform };
|
|
10
11
|
export type CardInnerAppearance = CardAppearance | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
11
12
|
export type EmbedIframeUrlType = 'href' | 'interactiveHref';
|
|
@@ -96,6 +97,7 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
96
97
|
ui?: FlexibleUiOptions;
|
|
97
98
|
children?: React.ReactNode;
|
|
98
99
|
showHoverPreview?: boolean;
|
|
100
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
99
101
|
showAuthTooltip?: boolean;
|
|
100
102
|
/**
|
|
101
103
|
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
|
|
@@ -5,6 +5,7 @@ import { type FlexibleUiOptions } from '../FlexibleCard/types';
|
|
|
5
5
|
import { type InlinePreloaderStyle, type OnErrorCallback } from '../types';
|
|
6
6
|
import { type AnalyticsFacade } from '../../state/analytics';
|
|
7
7
|
import { type FrameStyle } from '../EmbedCard/types';
|
|
8
|
+
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
8
9
|
export type CardWithUrlContentProps = {
|
|
9
10
|
id: string;
|
|
10
11
|
url: string;
|
|
@@ -44,6 +45,7 @@ export type CardWithUrlContentProps = {
|
|
|
44
45
|
ui?: FlexibleUiOptions;
|
|
45
46
|
children?: React.ReactNode;
|
|
46
47
|
showHoverPreview?: boolean;
|
|
48
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
47
49
|
showAuthTooltip?: boolean;
|
|
48
50
|
analyticsEvents?: AnalyticsFacade;
|
|
49
51
|
placeholder?: string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type HoverCardDelayProps } from './types';
|
|
3
|
-
declare const HoverCardControl: ({ children, hideHoverCardPreviewButton, isHoverPreview, isAuthTooltip, actionOptions, testId, url, delay, }: HoverCardDelayProps) => JSX.Element;
|
|
3
|
+
declare const HoverCardControl: ({ children, hideHoverCardPreviewButton, isHoverPreview, isAuthTooltip, actionOptions, testId, url, delay, hoverPreviewOptions, }: HoverCardDelayProps) => JSX.Element;
|
|
4
4
|
export default HoverCardControl;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
import { type ContainerProps } from '../types';
|
|
3
|
-
export type HoverCardDelayProps = PropsWithChildren<Pick<ContainerProps, 'hideHoverCardPreviewButton' | 'actionOptions'> & {
|
|
3
|
+
export type HoverCardDelayProps = PropsWithChildren<Pick<ContainerProps, 'hideHoverCardPreviewButton' | 'actionOptions' | 'hoverPreviewOptions'> & {
|
|
4
4
|
isHoverPreview?: boolean;
|
|
5
5
|
isAuthTooltip?: boolean;
|
|
6
6
|
testId?: string;
|
|
@@ -10,5 +10,5 @@ export declare const getContainerStyles: (size: SmartLinkSize, hideBackground: b
|
|
|
10
10
|
* @internal
|
|
11
11
|
* @see Block
|
|
12
12
|
*/
|
|
13
|
-
declare const Container: ({ children, clickableContainer, hideBackground, hideElevation, hideHoverCardPreviewButton, hidePadding, onClick, retry, showAuthTooltip, showHoverPreview, actionOptions, size, status, testId, theme, }: ContainerProps) => jsx.JSX.Element;
|
|
13
|
+
declare const Container: ({ children, clickableContainer, hideBackground, hideElevation, hideHoverCardPreviewButton, hidePadding, onClick, retry, showAuthTooltip, showHoverPreview, hoverPreviewOptions, actionOptions, size, status, testId, theme, }: ContainerProps) => jsx.JSX.Element;
|
|
14
14
|
export default Container;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
import { type SmartLinkStatus } from '../../../../constants';
|
|
3
3
|
import { type FlexibleCardProps, type FlexibleUiOptions, type RetryOptions } from '../../types';
|
|
4
|
-
export type ContainerProps = PropsWithChildren<Pick<FlexibleCardProps, 'onClick' | 'showHoverPreview' | 'actionOptions' | 'showAuthTooltip'> & FlexibleUiOptions & {
|
|
4
|
+
export type ContainerProps = PropsWithChildren<Pick<FlexibleCardProps, 'onClick' | 'showHoverPreview' | 'hoverPreviewOptions' | 'actionOptions' | 'showAuthTooltip'> & FlexibleUiOptions & {
|
|
5
5
|
/**
|
|
6
6
|
* The options that determine the retry behaviour when a Smart Link errors.
|
|
7
7
|
*/
|
|
@@ -8,6 +8,7 @@ import type { CardInnerAppearance, OnResolveCallback, CardActionOptions } from '
|
|
|
8
8
|
import { type OnErrorCallback } from '../types';
|
|
9
9
|
import { type AnalyticsFacade } from '../../state/analytics';
|
|
10
10
|
import { type AISummaryConfig } from '../../state/hooks/use-ai-summary-config/types';
|
|
11
|
+
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
11
12
|
export type FlexibleCardProps = {
|
|
12
13
|
/**
|
|
13
14
|
* @internal A unique ID for a Smart Link.
|
|
@@ -81,6 +82,10 @@ export type FlexibleCardProps = {
|
|
|
81
82
|
* over the smartlink. Default value is false.
|
|
82
83
|
*/
|
|
83
84
|
showHoverPreview?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Configuration options for hover preview
|
|
87
|
+
*/
|
|
88
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
84
89
|
/**
|
|
85
90
|
* Determines whether to show an unauthorised view of the hover card
|
|
86
91
|
* when a user hovers over a smartlink.
|
|
@@ -55,6 +55,7 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
|
55
55
|
* This is passed to the portal component.
|
|
56
56
|
*/
|
|
57
57
|
zIndex?: number;
|
|
58
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
60
61
|
* An internal props that internal smart-card components can use to configure
|
|
@@ -103,3 +104,9 @@ export type ImagePreviewProps = {
|
|
|
103
104
|
data: JsonLd.Data.BaseData;
|
|
104
105
|
fallbackElementHeight: number;
|
|
105
106
|
};
|
|
107
|
+
export interface HoverPreviewOptions {
|
|
108
|
+
/**
|
|
109
|
+
* Delay (in milliseconds) between hovering over the trigger element and the hover card opening. Defaults to 500ms.
|
|
110
|
+
*/
|
|
111
|
+
fadeInDelay?: number;
|
|
112
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type LozengeProps } from '../../../types';
|
|
3
3
|
import type { CardActionOptions } from '../../Card/types';
|
|
4
|
+
import { type HoverPreviewOptions } from '../../HoverCard/types';
|
|
4
5
|
export interface InlineCardResolvedViewProps {
|
|
5
6
|
/** A unique ID for a Smart Link. */
|
|
6
7
|
id?: string;
|
|
@@ -26,6 +27,7 @@ export interface InlineCardResolvedViewProps {
|
|
|
26
27
|
titlePrefix?: React.ReactNode;
|
|
27
28
|
/** Enables showing a custom preview on hover of link */
|
|
28
29
|
showHoverPreview?: boolean;
|
|
30
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
29
31
|
/** Configure visibility of server and client actions */
|
|
30
32
|
actionOptions?: CardActionOptions;
|
|
31
33
|
}
|
|
@@ -4,6 +4,7 @@ import { type CardState } from '../../state/types';
|
|
|
4
4
|
import { type InlinePreloaderStyle, type OnErrorCallback } from '../types';
|
|
5
5
|
import { type AnalyticsFacade } from '../../state/analytics';
|
|
6
6
|
import type { CardActionOptions } from '../Card/types';
|
|
7
|
+
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
7
8
|
export type InlineCardProps = {
|
|
8
9
|
id: string;
|
|
9
10
|
url: string;
|
|
@@ -21,6 +22,7 @@ export type InlineCardProps = {
|
|
|
21
22
|
inlinePreloaderStyle?: InlinePreloaderStyle;
|
|
22
23
|
renderers?: CardProviderRenderers;
|
|
23
24
|
showHoverPreview?: boolean;
|
|
25
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
24
26
|
showAuthTooltip?: boolean;
|
|
25
27
|
actionOptions?: CardActionOptions;
|
|
26
28
|
analytics: AnalyticsFacade;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type CardAppearance, type CardPlatform, type CardProps } from './types';
|
|
3
3
|
import { type WrappedComponentProps } from 'react-intl-next';
|
|
4
|
-
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
4
|
+
export declare const Card: React.ForwardRefExoticComponent<Pick<Omit<import("react-intl-next").WithIntlProps<CardProps & WrappedComponentProps>, keyof import("@atlaskit/analytics-next").WithAnalyticsEventsProps> & React.RefAttributes<any> & import("@atlaskit/analytics-next").WithContextProps, "url" | "appearance" | "container" | "children" | "data" | "key" | "id" | "placeholder" | "onError" | "onClick" | "testId" | "analyticsContext" | "isSelected" | "inheritDimensions" | "actionOptions" | "onResolve" | "ui" | "showHoverPreview" | "hoverPreviewOptions" | "showAuthTooltip" | "platform" | "isHovered" | "isFrameVisible" | "frameStyle" | "importer" | "showActions" | "showServerActions" | "fallbackComponent" | "embedIframeRef" | "embedIframeUrlType" | "inlinePreloaderStyle" | "analyticsEvents" | "useLegacyBlockCard" | "forwardedRef"> & React.RefAttributes<any>>;
|
|
5
5
|
export type { CardAppearance, CardProps, CardPlatform };
|
|
@@ -6,6 +6,7 @@ import { type AnalyticsFacade } from '../../state/analytics';
|
|
|
6
6
|
import { type FlexibleUiOptions } from '../FlexibleCard/types';
|
|
7
7
|
import { type InlinePreloaderStyle, type OnErrorCallback } from '../types';
|
|
8
8
|
import { type FrameStyle } from '../EmbedCard/types';
|
|
9
|
+
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
9
10
|
export type { CardAppearance, CardPlatform };
|
|
10
11
|
export type CardInnerAppearance = CardAppearance | 'embedPreview' | 'flexible' | 'hoverCardPreview';
|
|
11
12
|
export type EmbedIframeUrlType = 'href' | 'interactiveHref';
|
|
@@ -96,6 +97,7 @@ export interface CardProps extends WithAnalyticsEventsProps {
|
|
|
96
97
|
ui?: FlexibleUiOptions;
|
|
97
98
|
children?: React.ReactNode;
|
|
98
99
|
showHoverPreview?: boolean;
|
|
100
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
99
101
|
showAuthTooltip?: boolean;
|
|
100
102
|
/**
|
|
101
103
|
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-2681 Internal documentation for deprecation (no external access)}
|
|
@@ -5,6 +5,7 @@ import { type FlexibleUiOptions } from '../FlexibleCard/types';
|
|
|
5
5
|
import { type InlinePreloaderStyle, type OnErrorCallback } from '../types';
|
|
6
6
|
import { type AnalyticsFacade } from '../../state/analytics';
|
|
7
7
|
import { type FrameStyle } from '../EmbedCard/types';
|
|
8
|
+
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
8
9
|
export type CardWithUrlContentProps = {
|
|
9
10
|
id: string;
|
|
10
11
|
url: string;
|
|
@@ -44,6 +45,7 @@ export type CardWithUrlContentProps = {
|
|
|
44
45
|
ui?: FlexibleUiOptions;
|
|
45
46
|
children?: React.ReactNode;
|
|
46
47
|
showHoverPreview?: boolean;
|
|
48
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
47
49
|
showAuthTooltip?: boolean;
|
|
48
50
|
analyticsEvents?: AnalyticsFacade;
|
|
49
51
|
placeholder?: string;
|
package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { type HoverCardDelayProps } from './types';
|
|
3
|
-
declare const HoverCardControl: ({ children, hideHoverCardPreviewButton, isHoverPreview, isAuthTooltip, actionOptions, testId, url, delay, }: HoverCardDelayProps) => JSX.Element;
|
|
3
|
+
declare const HoverCardControl: ({ children, hideHoverCardPreviewButton, isHoverPreview, isAuthTooltip, actionOptions, testId, url, delay, hoverPreviewOptions, }: HoverCardDelayProps) => JSX.Element;
|
|
4
4
|
export default HoverCardControl;
|
package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/types.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
import { type ContainerProps } from '../types';
|
|
3
|
-
export type HoverCardDelayProps = PropsWithChildren<Pick<ContainerProps, 'hideHoverCardPreviewButton' | 'actionOptions'> & {
|
|
3
|
+
export type HoverCardDelayProps = PropsWithChildren<Pick<ContainerProps, 'hideHoverCardPreviewButton' | 'actionOptions' | 'hoverPreviewOptions'> & {
|
|
4
4
|
isHoverPreview?: boolean;
|
|
5
5
|
isAuthTooltip?: boolean;
|
|
6
6
|
testId?: string;
|
|
@@ -10,5 +10,5 @@ export declare const getContainerStyles: (size: SmartLinkSize, hideBackground: b
|
|
|
10
10
|
* @internal
|
|
11
11
|
* @see Block
|
|
12
12
|
*/
|
|
13
|
-
declare const Container: ({ children, clickableContainer, hideBackground, hideElevation, hideHoverCardPreviewButton, hidePadding, onClick, retry, showAuthTooltip, showHoverPreview, actionOptions, size, status, testId, theme, }: ContainerProps) => jsx.JSX.Element;
|
|
13
|
+
declare const Container: ({ children, clickableContainer, hideBackground, hideElevation, hideHoverCardPreviewButton, hidePadding, onClick, retry, showAuthTooltip, showHoverPreview, hoverPreviewOptions, actionOptions, size, status, testId, theme, }: ContainerProps) => jsx.JSX.Element;
|
|
14
14
|
export default Container;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PropsWithChildren } from 'react';
|
|
2
2
|
import { type SmartLinkStatus } from '../../../../constants';
|
|
3
3
|
import { type FlexibleCardProps, type FlexibleUiOptions, type RetryOptions } from '../../types';
|
|
4
|
-
export type ContainerProps = PropsWithChildren<Pick<FlexibleCardProps, 'onClick' | 'showHoverPreview' | 'actionOptions' | 'showAuthTooltip'> & FlexibleUiOptions & {
|
|
4
|
+
export type ContainerProps = PropsWithChildren<Pick<FlexibleCardProps, 'onClick' | 'showHoverPreview' | 'hoverPreviewOptions' | 'actionOptions' | 'showAuthTooltip'> & FlexibleUiOptions & {
|
|
5
5
|
/**
|
|
6
6
|
* The options that determine the retry behaviour when a Smart Link errors.
|
|
7
7
|
*/
|
|
@@ -8,6 +8,7 @@ import type { CardInnerAppearance, OnResolveCallback, CardActionOptions } from '
|
|
|
8
8
|
import { type OnErrorCallback } from '../types';
|
|
9
9
|
import { type AnalyticsFacade } from '../../state/analytics';
|
|
10
10
|
import { type AISummaryConfig } from '../../state/hooks/use-ai-summary-config/types';
|
|
11
|
+
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
11
12
|
export type FlexibleCardProps = {
|
|
12
13
|
/**
|
|
13
14
|
* @internal A unique ID for a Smart Link.
|
|
@@ -81,6 +82,10 @@ export type FlexibleCardProps = {
|
|
|
81
82
|
* over the smartlink. Default value is false.
|
|
82
83
|
*/
|
|
83
84
|
showHoverPreview?: boolean;
|
|
85
|
+
/**
|
|
86
|
+
* Configuration options for hover preview
|
|
87
|
+
*/
|
|
88
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
84
89
|
/**
|
|
85
90
|
* Determines whether to show an unauthorised view of the hover card
|
|
86
91
|
* when a user hovers over a smartlink.
|
|
@@ -55,6 +55,7 @@ export interface HoverCardProps extends WithAnalyticsEventsProps {
|
|
|
55
55
|
* This is passed to the portal component.
|
|
56
56
|
*/
|
|
57
57
|
zIndex?: number;
|
|
58
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
58
59
|
}
|
|
59
60
|
/**
|
|
60
61
|
* An internal props that internal smart-card components can use to configure
|
|
@@ -103,3 +104,9 @@ export type ImagePreviewProps = {
|
|
|
103
104
|
data: JsonLd.Data.BaseData;
|
|
104
105
|
fallbackElementHeight: number;
|
|
105
106
|
};
|
|
107
|
+
export interface HoverPreviewOptions {
|
|
108
|
+
/**
|
|
109
|
+
* Delay (in milliseconds) between hovering over the trigger element and the hover card opening. Defaults to 500ms.
|
|
110
|
+
*/
|
|
111
|
+
fadeInDelay?: number;
|
|
112
|
+
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { type LozengeProps } from '../../../types';
|
|
3
3
|
import type { CardActionOptions } from '../../Card/types';
|
|
4
|
+
import { type HoverPreviewOptions } from '../../HoverCard/types';
|
|
4
5
|
export interface InlineCardResolvedViewProps {
|
|
5
6
|
/** A unique ID for a Smart Link. */
|
|
6
7
|
id?: string;
|
|
@@ -26,6 +27,7 @@ export interface InlineCardResolvedViewProps {
|
|
|
26
27
|
titlePrefix?: React.ReactNode;
|
|
27
28
|
/** Enables showing a custom preview on hover of link */
|
|
28
29
|
showHoverPreview?: boolean;
|
|
30
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
29
31
|
/** Configure visibility of server and client actions */
|
|
30
32
|
actionOptions?: CardActionOptions;
|
|
31
33
|
}
|
|
@@ -4,6 +4,7 @@ import { type CardState } from '../../state/types';
|
|
|
4
4
|
import { type InlinePreloaderStyle, type OnErrorCallback } from '../types';
|
|
5
5
|
import { type AnalyticsFacade } from '../../state/analytics';
|
|
6
6
|
import type { CardActionOptions } from '../Card/types';
|
|
7
|
+
import { type HoverPreviewOptions } from '../HoverCard/types';
|
|
7
8
|
export type InlineCardProps = {
|
|
8
9
|
id: string;
|
|
9
10
|
url: string;
|
|
@@ -21,6 +22,7 @@ export type InlineCardProps = {
|
|
|
21
22
|
inlinePreloaderStyle?: InlinePreloaderStyle;
|
|
22
23
|
renderers?: CardProviderRenderers;
|
|
23
24
|
showHoverPreview?: boolean;
|
|
25
|
+
hoverPreviewOptions?: HoverPreviewOptions;
|
|
24
26
|
showAuthTooltip?: boolean;
|
|
25
27
|
actionOptions?: CardActionOptions;
|
|
26
28
|
analytics: AnalyticsFacade;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "27.
|
|
3
|
+
"version": "27.9.0",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"@atlaskit/badge": "^16.3.0",
|
|
36
36
|
"@atlaskit/button": "^18.1.0",
|
|
37
37
|
"@atlaskit/checkbox": "^13.5.0",
|
|
38
|
-
"@atlaskit/dropdown-menu": "^12.
|
|
38
|
+
"@atlaskit/dropdown-menu": "^12.14.0",
|
|
39
39
|
"@atlaskit/form": "^10.4.0",
|
|
40
40
|
"@atlaskit/frontend-utilities": "^2.7.0",
|
|
41
41
|
"@atlaskit/heading": "^2.4.0",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@atlaskit/linking-types": "^8.9.0",
|
|
51
51
|
"@atlaskit/logo": "^14.1.0",
|
|
52
52
|
"@atlaskit/lozenge": "^11.8.0",
|
|
53
|
-
"@atlaskit/menu": "^2.
|
|
53
|
+
"@atlaskit/menu": "^2.7.0",
|
|
54
54
|
"@atlaskit/modal-dialog": "^12.14.0",
|
|
55
55
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
56
56
|
"@atlaskit/platform-feature-flags": "^0.3.0",
|
|
@@ -98,7 +98,7 @@
|
|
|
98
98
|
"@atlaskit/visual-regression": "*",
|
|
99
99
|
"@atlassian/analytics-tooling": "*",
|
|
100
100
|
"@atlassian/feature-flags-test-utils": "^0.2.0",
|
|
101
|
-
"@testing-library/dom": "^
|
|
101
|
+
"@testing-library/dom": "^10.1.0",
|
|
102
102
|
"@testing-library/jest-dom": "^6.4.5",
|
|
103
103
|
"@testing-library/react": "^12.1.5",
|
|
104
104
|
"@testing-library/react-hooks": "^8.0.1",
|
|
@@ -112,9 +112,10 @@
|
|
|
112
112
|
"brace": "^0.11.1",
|
|
113
113
|
"fetch-mock": "^8.0.0",
|
|
114
114
|
"jest-emotion": "^10.0.32",
|
|
115
|
-
"jest-extended": "^0.
|
|
115
|
+
"jest-extended": "^4.0.2",
|
|
116
116
|
"jest-fetch-mock": "^3.0.3",
|
|
117
|
-
"
|
|
117
|
+
"jest-mock": "^29.7.0",
|
|
118
|
+
"jsdom": "^22.0.0",
|
|
118
119
|
"lorem-ipsum": "^1.0.6",
|
|
119
120
|
"react": "^16.8.0",
|
|
120
121
|
"react-ace": "^6.1.0",
|
|
@@ -122,7 +123,7 @@
|
|
|
122
123
|
"react-dom": "^16.8.0",
|
|
123
124
|
"react-intl-next": "npm:react-intl@^5.18.1",
|
|
124
125
|
"react-test-renderer": "^16.8.0",
|
|
125
|
-
"ts-jest": "
|
|
126
|
+
"ts-jest": "29.1.2",
|
|
126
127
|
"typescript": "~5.4.2",
|
|
127
128
|
"xhr-mock": "^2.4.0"
|
|
128
129
|
},
|