@atlaskit/smart-card 26.15.9 → 26.15.10
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 +6 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +18 -8
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +15 -6
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +18 -8
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/HoverCard/types.d.ts +4 -0
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +4 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -21,7 +21,7 @@ exports.ANALYTICS_CHANNEL = ANALYTICS_CHANNEL;
|
|
|
21
21
|
var context = {
|
|
22
22
|
componentName: 'smart-cards',
|
|
23
23
|
packageName: "@atlaskit/smart-card",
|
|
24
|
-
packageVersion: "26.15.
|
|
24
|
+
packageVersion: "26.15.10"
|
|
25
25
|
};
|
|
26
26
|
exports.context = context;
|
|
27
27
|
var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
@@ -48,7 +48,9 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
48
48
|
_ref$allowEventPropag = _ref.allowEventPropagation,
|
|
49
49
|
allowEventPropagation = _ref$allowEventPropag === void 0 ? false : _ref$allowEventPropag,
|
|
50
50
|
_ref$zIndex = _ref.zIndex,
|
|
51
|
-
zIndex = _ref$zIndex === void 0 ? _styled.HOVER_CARD_Z_INDEX : _ref$zIndex
|
|
51
|
+
zIndex = _ref$zIndex === void 0 ? _styled.HOVER_CARD_Z_INDEX : _ref$zIndex,
|
|
52
|
+
_ref$noFadeDelay = _ref.noFadeDelay,
|
|
53
|
+
noFadeDelay = _ref$noFadeDelay === void 0 ? false : _ref$noFadeDelay;
|
|
52
54
|
var _React$useState = _react2.default.useState(false),
|
|
53
55
|
_React$useState2 = (0, _slicedToArray2.default)(_React$useState, 2),
|
|
54
56
|
isOpen = _React$useState2[0],
|
|
@@ -98,10 +100,14 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
98
100
|
// we want to clear out the reference to signify that there's no in-progress resolve event
|
|
99
101
|
resolveTimeOutId.current = undefined;
|
|
100
102
|
}
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
104
|
-
|
|
103
|
+
if (noFadeDelay) {
|
|
104
|
+
hideCard();
|
|
105
|
+
} else {
|
|
106
|
+
fadeOutTimeoutId.current = setTimeout(function () {
|
|
107
|
+
return hideCard();
|
|
108
|
+
}, FADE_OUT_DELAY);
|
|
109
|
+
}
|
|
110
|
+
}, [hideCard, noFadeDelay]);
|
|
105
111
|
|
|
106
112
|
// clearing out the timeouts in order to avoid memory leaks
|
|
107
113
|
// in case the component unmounts before they execute
|
|
@@ -152,11 +158,15 @@ var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
152
158
|
setMousePosition(event);
|
|
153
159
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
154
160
|
// setting a timeout to show a Hover Card after delay runs out
|
|
155
|
-
|
|
161
|
+
if (noFadeDelay) {
|
|
156
162
|
setIsOpen(true);
|
|
157
|
-
}
|
|
163
|
+
} else {
|
|
164
|
+
fadeInTimeoutId.current = setTimeout(function () {
|
|
165
|
+
setIsOpen(true);
|
|
166
|
+
}, FADE_IN_DELAY);
|
|
167
|
+
}
|
|
158
168
|
}
|
|
159
|
-
}, [initResolve, isOpen, setMousePosition]);
|
|
169
|
+
}, [initResolve, isOpen, setMousePosition, noFadeDelay]);
|
|
160
170
|
var linkActions = (0, _useSmartLinkActions.useSmartLinkActions)({
|
|
161
171
|
url: url,
|
|
162
172
|
appearance: _constants.CardDisplay.HoverCardPreview,
|
|
@@ -18,7 +18,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
18
18
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
19
19
|
var PACKAGE_DATA = {
|
|
20
20
|
packageName: "@atlaskit/smart-card",
|
|
21
|
-
packageVersion: "26.15.
|
|
21
|
+
packageVersion: "26.15.10",
|
|
22
22
|
componentName: 'linkUrl'
|
|
23
23
|
};
|
|
24
24
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -3,7 +3,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
3
3
|
export const context = {
|
|
4
4
|
componentName: 'smart-cards',
|
|
5
5
|
packageName: "@atlaskit/smart-card",
|
|
6
|
-
packageVersion: "26.15.
|
|
6
|
+
packageVersion: "26.15.10"
|
|
7
7
|
};
|
|
8
8
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
9
9
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -29,7 +29,8 @@ export const HoverCardComponent = ({
|
|
|
29
29
|
hidePreviewButton = false,
|
|
30
30
|
showServerActions = false,
|
|
31
31
|
allowEventPropagation = false,
|
|
32
|
-
zIndex = HOVER_CARD_Z_INDEX
|
|
32
|
+
zIndex = HOVER_CARD_Z_INDEX,
|
|
33
|
+
noFadeDelay = false
|
|
33
34
|
}) => {
|
|
34
35
|
const [isOpen, setIsOpen] = React.useState(false);
|
|
35
36
|
const fadeOutTimeoutId = useRef();
|
|
@@ -79,8 +80,12 @@ export const HoverCardComponent = ({
|
|
|
79
80
|
// we want to clear out the reference to signify that there's no in-progress resolve event
|
|
80
81
|
resolveTimeOutId.current = undefined;
|
|
81
82
|
}
|
|
82
|
-
|
|
83
|
-
|
|
83
|
+
if (noFadeDelay) {
|
|
84
|
+
hideCard();
|
|
85
|
+
} else {
|
|
86
|
+
fadeOutTimeoutId.current = setTimeout(() => hideCard(), FADE_OUT_DELAY);
|
|
87
|
+
}
|
|
88
|
+
}, [hideCard, noFadeDelay]);
|
|
84
89
|
|
|
85
90
|
// clearing out the timeouts in order to avoid memory leaks
|
|
86
91
|
// in case the component unmounts before they execute
|
|
@@ -131,11 +136,15 @@ export const HoverCardComponent = ({
|
|
|
131
136
|
setMousePosition(event);
|
|
132
137
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
133
138
|
// setting a timeout to show a Hover Card after delay runs out
|
|
134
|
-
|
|
139
|
+
if (noFadeDelay) {
|
|
135
140
|
setIsOpen(true);
|
|
136
|
-
}
|
|
141
|
+
} else {
|
|
142
|
+
fadeInTimeoutId.current = setTimeout(() => {
|
|
143
|
+
setIsOpen(true);
|
|
144
|
+
}, FADE_IN_DELAY);
|
|
145
|
+
}
|
|
137
146
|
}
|
|
138
|
-
}, [initResolve, isOpen, setMousePosition]);
|
|
147
|
+
}, [initResolve, isOpen, setMousePosition, noFadeDelay]);
|
|
139
148
|
const linkActions = useSmartLinkActions({
|
|
140
149
|
url,
|
|
141
150
|
appearance: CardDisplay.HoverCardPreview,
|
|
@@ -8,7 +8,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
8
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
const PACKAGE_DATA = {
|
|
10
10
|
packageName: "@atlaskit/smart-card",
|
|
11
|
-
packageVersion: "26.15.
|
|
11
|
+
packageVersion: "26.15.10",
|
|
12
12
|
componentName: 'linkUrl'
|
|
13
13
|
};
|
|
14
14
|
const Link = withLinkClickedEvent('a');
|
|
@@ -13,7 +13,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
13
13
|
export var context = {
|
|
14
14
|
componentName: 'smart-cards',
|
|
15
15
|
packageName: "@atlaskit/smart-card",
|
|
16
|
-
packageVersion: "26.15.
|
|
16
|
+
packageVersion: "26.15.10"
|
|
17
17
|
};
|
|
18
18
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
19
19
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -37,7 +37,9 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
37
37
|
_ref$allowEventPropag = _ref.allowEventPropagation,
|
|
38
38
|
allowEventPropagation = _ref$allowEventPropag === void 0 ? false : _ref$allowEventPropag,
|
|
39
39
|
_ref$zIndex = _ref.zIndex,
|
|
40
|
-
zIndex = _ref$zIndex === void 0 ? HOVER_CARD_Z_INDEX : _ref$zIndex
|
|
40
|
+
zIndex = _ref$zIndex === void 0 ? HOVER_CARD_Z_INDEX : _ref$zIndex,
|
|
41
|
+
_ref$noFadeDelay = _ref.noFadeDelay,
|
|
42
|
+
noFadeDelay = _ref$noFadeDelay === void 0 ? false : _ref$noFadeDelay;
|
|
41
43
|
var _React$useState = React.useState(false),
|
|
42
44
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
43
45
|
isOpen = _React$useState2[0],
|
|
@@ -87,10 +89,14 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
87
89
|
// we want to clear out the reference to signify that there's no in-progress resolve event
|
|
88
90
|
resolveTimeOutId.current = undefined;
|
|
89
91
|
}
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
92
|
+
if (noFadeDelay) {
|
|
93
|
+
hideCard();
|
|
94
|
+
} else {
|
|
95
|
+
fadeOutTimeoutId.current = setTimeout(function () {
|
|
96
|
+
return hideCard();
|
|
97
|
+
}, FADE_OUT_DELAY);
|
|
98
|
+
}
|
|
99
|
+
}, [hideCard, noFadeDelay]);
|
|
94
100
|
|
|
95
101
|
// clearing out the timeouts in order to avoid memory leaks
|
|
96
102
|
// in case the component unmounts before they execute
|
|
@@ -141,11 +147,15 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
141
147
|
setMousePosition(event);
|
|
142
148
|
if (!isOpen && !fadeInTimeoutId.current) {
|
|
143
149
|
// setting a timeout to show a Hover Card after delay runs out
|
|
144
|
-
|
|
150
|
+
if (noFadeDelay) {
|
|
145
151
|
setIsOpen(true);
|
|
146
|
-
}
|
|
152
|
+
} else {
|
|
153
|
+
fadeInTimeoutId.current = setTimeout(function () {
|
|
154
|
+
setIsOpen(true);
|
|
155
|
+
}, FADE_IN_DELAY);
|
|
156
|
+
}
|
|
147
157
|
}
|
|
148
|
-
}, [initResolve, isOpen, setMousePosition]);
|
|
158
|
+
}, [initResolve, isOpen, setMousePosition, noFadeDelay]);
|
|
149
159
|
var linkActions = useSmartLinkActions({
|
|
150
160
|
url: url,
|
|
151
161
|
appearance: CardDisplay.HoverCardPreview,
|
|
@@ -11,7 +11,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
11
11
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
12
12
|
var PACKAGE_DATA = {
|
|
13
13
|
packageName: "@atlaskit/smart-card",
|
|
14
|
-
packageVersion: "26.15.
|
|
14
|
+
packageVersion: "26.15.10",
|
|
15
15
|
componentName: 'linkUrl'
|
|
16
16
|
};
|
|
17
17
|
var Link = withLinkClickedEvent('a');
|
|
@@ -61,6 +61,10 @@ export interface HoverCardInternalProps {
|
|
|
61
61
|
* @see EDM-7187 for further details
|
|
62
62
|
*/
|
|
63
63
|
allowEventPropagation?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Suspend hover card UI delays (fade-in, fade-out) for VR testing purposes.
|
|
66
|
+
*/
|
|
67
|
+
noFadeDelay?: boolean;
|
|
64
68
|
}
|
|
65
69
|
export interface HoverCardComponentProps extends HoverCardProps, HoverCardInternalProps {
|
|
66
70
|
analyticsHandler?: AnalyticsHandler;
|
|
@@ -61,6 +61,10 @@ export interface HoverCardInternalProps {
|
|
|
61
61
|
* @see EDM-7187 for further details
|
|
62
62
|
*/
|
|
63
63
|
allowEventPropagation?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Suspend hover card UI delays (fade-in, fade-out) for VR testing purposes.
|
|
66
|
+
*/
|
|
67
|
+
noFadeDelay?: boolean;
|
|
64
68
|
}
|
|
65
69
|
export interface HoverCardComponentProps extends HoverCardProps, HoverCardInternalProps {
|
|
66
70
|
analyticsHandler?: AnalyticsHandler;
|