@atlaskit/smart-card 26.9.2 → 26.9.5
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 +20 -0
- package/dist/cjs/extractors/block/index.js +10 -10
- package/dist/cjs/extractors/common/actions/extractPreviewAction.js +3 -3
- package/dist/cjs/extractors/common/byline/extractByline.js +5 -5
- package/dist/cjs/extractors/common/icon/extractIcon.js +4 -4
- package/dist/cjs/extractors/common/lozenge/extractLozenge.js +2 -2
- package/dist/cjs/extractors/common/lozenge/extractTaskType.js +2 -2
- package/dist/cjs/extractors/embed/index.js +5 -5
- package/dist/cjs/extractors/flexible/actions/extract-preview-action.js +5 -6
- package/dist/cjs/extractors/flexible/actions/extract-view-action.js +2 -2
- package/dist/cjs/extractors/flexible/collaboratorGroup/index.js +3 -3
- package/dist/cjs/extractors/flexible/extract-preview.js +2 -2
- package/dist/cjs/extractors/flexible/extract-priority.js +2 -2
- package/dist/cjs/extractors/flexible/extract-state.js +2 -2
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +2 -2
- package/dist/cjs/extractors/flexible/icon/extract-provider-icon.js +2 -2
- package/dist/cjs/extractors/flexible/icon/extract-url-icon.js +2 -2
- package/dist/cjs/extractors/flexible/index.js +6 -6
- package/dist/cjs/extractors/flexible/utils.js +4 -4
- package/dist/cjs/extractors/inline/index.js +4 -4
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenView.js +2 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +2 -2
- package/dist/cjs/view/CardWithUrl/component.js +2 -4
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +74 -0
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/container/index.js +11 -41
- package/dist/cjs/view/FlexibleCard/utils.js +2 -2
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +2 -2
- package/dist/cjs/view/HoverCard/utils.js +2 -2
- package/dist/cjs/view/InlineCard/index.js +4 -4
- package/dist/es2019/extractors/block/index.js +1 -1
- package/dist/es2019/extractors/common/actions/extractPreviewAction.js +1 -1
- package/dist/es2019/extractors/common/byline/extractByline.js +1 -1
- package/dist/es2019/extractors/common/icon/extractIcon.js +1 -1
- package/dist/es2019/extractors/common/lozenge/extractLozenge.js +1 -1
- package/dist/es2019/extractors/common/lozenge/extractTaskType.js +1 -1
- package/dist/es2019/extractors/embed/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/extract-preview-action.js +1 -2
- package/dist/es2019/extractors/flexible/actions/extract-view-action.js +1 -1
- package/dist/es2019/extractors/flexible/collaboratorGroup/index.js +1 -1
- package/dist/es2019/extractors/flexible/extract-preview.js +1 -1
- package/dist/es2019/extractors/flexible/extract-priority.js +1 -1
- package/dist/es2019/extractors/flexible/extract-state.js +1 -1
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +1 -1
- package/dist/es2019/extractors/flexible/icon/extract-provider-icon.js +1 -1
- package/dist/es2019/extractors/flexible/icon/extract-url-icon.js +1 -1
- package/dist/es2019/extractors/flexible/index.js +1 -1
- package/dist/es2019/extractors/flexible/utils.js +1 -1
- package/dist/es2019/extractors/inline/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenView.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +1 -1
- package/dist/es2019/view/CardWithUrl/component.js +2 -4
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +60 -0
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/container/index.js +13 -39
- package/dist/es2019/view/FlexibleCard/utils.js +1 -1
- package/dist/es2019/view/HoverCard/components/views/unauthorised/index.js +1 -1
- package/dist/es2019/view/HoverCard/utils.js +1 -1
- package/dist/es2019/view/InlineCard/index.js +1 -1
- package/dist/esm/extractors/block/index.js +1 -1
- package/dist/esm/extractors/common/actions/extractPreviewAction.js +1 -1
- package/dist/esm/extractors/common/byline/extractByline.js +1 -1
- package/dist/esm/extractors/common/icon/extractIcon.js +1 -1
- package/dist/esm/extractors/common/lozenge/extractLozenge.js +1 -1
- package/dist/esm/extractors/common/lozenge/extractTaskType.js +1 -1
- package/dist/esm/extractors/embed/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/extract-preview-action.js +1 -2
- package/dist/esm/extractors/flexible/actions/extract-view-action.js +1 -1
- package/dist/esm/extractors/flexible/collaboratorGroup/index.js +1 -1
- package/dist/esm/extractors/flexible/extract-preview.js +1 -1
- package/dist/esm/extractors/flexible/extract-priority.js +1 -1
- package/dist/esm/extractors/flexible/extract-state.js +1 -1
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +1 -1
- package/dist/esm/extractors/flexible/icon/extract-provider-icon.js +1 -1
- package/dist/esm/extractors/flexible/icon/extract-url-icon.js +1 -1
- package/dist/esm/extractors/flexible/index.js +1 -1
- package/dist/esm/extractors/flexible/utils.js +1 -1
- package/dist/esm/extractors/inline/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenView.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +1 -1
- package/dist/esm/view/CardWithUrl/component.js +2 -4
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +63 -0
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/container/index.js +13 -43
- package/dist/esm/view/FlexibleCard/utils.js +1 -1
- package/dist/esm/view/HoverCard/components/views/unauthorised/index.js +1 -1
- package/dist/esm/view/HoverCard/utils.js +1 -1
- package/dist/esm/view/InlineCard/index.js +1 -1
- package/dist/types/extractors/block/index.d.ts +1 -1
- package/dist/types/extractors/common/icon/extractIcon.d.ts +1 -1
- package/dist/types/extractors/flexible/collaboratorGroup/index.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +2 -1
- package/dist/types/view/FlexibleCard/components/container/hover-card-control/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/container/hover-card-control/types.d.ts +6 -0
- package/dist/types-ts4.5/extractors/block/index.d.ts +1 -1
- package/dist/types-ts4.5/extractors/common/icon/extractIcon.d.ts +1 -1
- package/dist/types-ts4.5/extractors/flexible/collaboratorGroup/index.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +1 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +2 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/types.d.ts +6 -0
- package/package.json +3 -2
- package/report.api.md +1 -1
- package/tmp/api-report-tmp.d.ts +937 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
10
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
11
|
+
var _HoverCard = require("../../../../HoverCard");
|
|
12
|
+
var _constants = require("../../../../../constants");
|
|
13
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
14
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
15
|
+
var FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY = 100;
|
|
16
|
+
var HoverCardControl = function HoverCardControl(_ref) {
|
|
17
|
+
var children = _ref.children,
|
|
18
|
+
hideHoverCardPreviewButton = _ref.hideHoverCardPreviewButton,
|
|
19
|
+
isHoverPreview = _ref.isHoverPreview,
|
|
20
|
+
isAuthTooltip = _ref.isAuthTooltip,
|
|
21
|
+
showServerActions = _ref.showServerActions,
|
|
22
|
+
url = _ref.url;
|
|
23
|
+
var _useState = (0, _react.useState)(true),
|
|
24
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
25
|
+
canOpen = _useState2[0],
|
|
26
|
+
setCanOpen = _useState2[1];
|
|
27
|
+
var mouseStopTimer = (0, _react.useRef)();
|
|
28
|
+
(0, _react.useEffect)(function () {
|
|
29
|
+
return function () {
|
|
30
|
+
if (mouseStopTimer.current) {
|
|
31
|
+
clearTimeout(mouseStopTimer.current);
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
}, []);
|
|
35
|
+
var onMouseMove = (0, _react.useCallback)(function (e) {
|
|
36
|
+
var _e$target$closest;
|
|
37
|
+
if (mouseStopTimer.current) {
|
|
38
|
+
clearTimeout(mouseStopTimer.current);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// Never show hover card on action or when action dropdown opens.
|
|
42
|
+
// The code below can be simplified by using :is() and :has()
|
|
43
|
+
// but the pseudo-class isn't support by Firefox yet.
|
|
44
|
+
var action =
|
|
45
|
+
// Any action button group (title/footer block)
|
|
46
|
+
e.target.closest('.actions-button-group') || ( // When action dropdown list is opened on action button group or lozenge action
|
|
47
|
+
(_e$target$closest = e.target.closest('[data-smart-link-container]')) === null || _e$target$closest === void 0 ? void 0 : _e$target$closest.querySelector('[data-action-open="true"]'));
|
|
48
|
+
var canOpenOnElement = isAuthTooltip && !action ||
|
|
49
|
+
// EDM-7060: For hover preview, also hide hover card on all elements
|
|
50
|
+
// except title element (link title)
|
|
51
|
+
isHoverPreview && !action && !e.target.closest("[data-smart-element]:not([data-smart-element=\"".concat(_constants.ElementName.Title, "\"])"));
|
|
52
|
+
mouseStopTimer.current = setTimeout(function () {
|
|
53
|
+
if (canOpen !== canOpenOnElement) {
|
|
54
|
+
setCanOpen(Boolean(canOpenOnElement));
|
|
55
|
+
}
|
|
56
|
+
}, FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY);
|
|
57
|
+
}, [isAuthTooltip, isHoverPreview, canOpen]);
|
|
58
|
+
return /*#__PURE__*/_react.default.createElement(_HoverCard.HoverCard, {
|
|
59
|
+
allowEventPropagation: true,
|
|
60
|
+
canOpen: canOpen,
|
|
61
|
+
closeOnChildClick: true,
|
|
62
|
+
hidePreviewButton: hideHoverCardPreviewButton
|
|
63
|
+
// EDM-6709 extends the internal prop for showServerActions type to be
|
|
64
|
+
// an object. If we decide to use expose the type for hover preview
|
|
65
|
+
// remove the Boolean() conversion here.
|
|
66
|
+
,
|
|
67
|
+
showServerActions: Boolean(showServerActions),
|
|
68
|
+
url: url
|
|
69
|
+
}, /*#__PURE__*/_react.default.createElement("span", {
|
|
70
|
+
onMouseMove: onMouseMove
|
|
71
|
+
}, children));
|
|
72
|
+
};
|
|
73
|
+
var _default = HoverCardControl;
|
|
74
|
+
exports.default = _default;
|
|
@@ -6,8 +6,6 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
8
|
exports.getContainerStyles = exports.default = void 0;
|
|
9
|
-
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
11
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
12
10
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
11
|
var _react2 = require("@emotion/react");
|
|
@@ -16,7 +14,7 @@ var _flexible = require("../../../../utils/flexible");
|
|
|
16
14
|
var _token = require("../../../../utils/token");
|
|
17
15
|
var _flexibleUiContext = require("../../../../state/flexible-ui-context");
|
|
18
16
|
var _layeredLink = _interopRequireDefault(require("./layered-link"));
|
|
19
|
-
var
|
|
17
|
+
var _hoverCardControl = _interopRequireDefault(require("./hover-card-control"));
|
|
20
18
|
var _utils = require("../../../../state/flexible-ui-context/utils");
|
|
21
19
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
22
20
|
/** @jsx jsx */
|
|
@@ -167,51 +165,23 @@ var Container = function Container(_ref3) {
|
|
|
167
165
|
theme = _ref3$theme === void 0 ? _constants.SmartLinkTheme.Link : _ref3$theme;
|
|
168
166
|
var context = (0, _react.useContext)(_flexibleUiContext.FlexibleUiContext);
|
|
169
167
|
var childrenOptions = getChildrenOptions(children, context);
|
|
170
|
-
var _useState = (0, _react.useState)(true),
|
|
171
|
-
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
172
|
-
hoverCardCanOpen = _useState2[0],
|
|
173
|
-
setHoverCardCanOpen = _useState2[1];
|
|
174
168
|
var canShowHoverPreview = showHoverPreview && status === 'resolved';
|
|
175
169
|
var canShowAuthTooltip = showAuthTooltip && status === 'unauthorized';
|
|
176
|
-
var
|
|
177
|
-
var _e$target$closest;
|
|
178
|
-
// Never show hover card on action or when action dropdown opens.
|
|
179
|
-
// The code below can be simplified by using :is() and :has()
|
|
180
|
-
// but the pseudo-class isn't support by Firefox yet.
|
|
181
|
-
var action =
|
|
182
|
-
// Any action button group (title/footer block)
|
|
183
|
-
e.target.closest('.actions-button-group') || ( // When action dropdown list is opened on action button group or lozenge action
|
|
184
|
-
(_e$target$closest = e.target.closest('[data-smart-link-container]')) === null || _e$target$closest === void 0 ? void 0 : _e$target$closest.querySelector('[data-action-open="true"]'));
|
|
185
|
-
var canOpen = canShowAuthTooltip && !action ||
|
|
186
|
-
// EDM-7060: For hover preview, also hide hover card on all elements
|
|
187
|
-
// except title element (link title)
|
|
188
|
-
canShowHoverPreview && !action && !e.target.closest("[data-smart-element]:not([data-smart-element=\"".concat(_constants.ElementName.Title, "\"])"));
|
|
189
|
-
if (hoverCardCanOpen !== canOpen) {
|
|
190
|
-
setHoverCardCanOpen(canOpen);
|
|
191
|
-
}
|
|
192
|
-
}, [canShowAuthTooltip, canShowHoverPreview, hoverCardCanOpen]);
|
|
193
|
-
var containerContent = (0, _react2.jsx)("div", (0, _extends2.default)({
|
|
170
|
+
var container = (0, _react2.jsx)("div", {
|
|
194
171
|
css: getContainerStyles(size, hideBackground, hideElevation, hidePadding, clickableContainer, childrenOptions),
|
|
195
172
|
"data-smart-link-container": true,
|
|
196
173
|
"data-testid": testId
|
|
197
|
-
},
|
|
198
|
-
onMouseOver: onMouseOver
|
|
199
|
-
} : undefined), clickableContainer ? getLayeredLink(testId, context, children, onClick) : null, renderChildren(children, size, theme, status, retry, onClick));
|
|
174
|
+
}, clickableContainer ? getLayeredLink(testId, context, children, onClick) : null, renderChildren(children, size, theme, status, retry, onClick));
|
|
200
175
|
if (context !== null && context !== void 0 && context.url && (canShowHoverPreview || canShowAuthTooltip)) {
|
|
201
|
-
return (0, _react2.jsx)(
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
// an object. If we decide to use expose the type for hover preview
|
|
209
|
-
// remove the Boolean() conversion here.
|
|
210
|
-
,
|
|
211
|
-
showServerActions: Boolean(showServerActions)
|
|
212
|
-
}, containerContent);
|
|
176
|
+
return (0, _react2.jsx)(_hoverCardControl.default, {
|
|
177
|
+
hideHoverCardPreviewButton: hideHoverCardPreviewButton,
|
|
178
|
+
isHoverPreview: canShowHoverPreview,
|
|
179
|
+
isAuthTooltip: canShowAuthTooltip,
|
|
180
|
+
showServerActions: showServerActions,
|
|
181
|
+
url: context.url
|
|
182
|
+
}, container);
|
|
213
183
|
}
|
|
214
|
-
return
|
|
184
|
+
return container;
|
|
215
185
|
};
|
|
216
186
|
var _default = Container;
|
|
217
187
|
exports.default = _default;
|
|
@@ -12,7 +12,7 @@ var _messages = require("../../messages");
|
|
|
12
12
|
var _flexible = _interopRequireDefault(require("../../extractors/flexible"));
|
|
13
13
|
var _icon = require("../../extractors/flexible/icon");
|
|
14
14
|
var _utils = require("../../utils");
|
|
15
|
-
var
|
|
15
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
16
16
|
var _extractProviderIcon = _interopRequireDefault(require("../../extractors/flexible/icon/extract-provider-icon"));
|
|
17
17
|
var getContextByStatus = function getContextByStatus(params) {
|
|
18
18
|
var _ref = params !== null && params !== void 0 ? params : {},
|
|
@@ -66,7 +66,7 @@ var getForbiddenMessageKey = function getForbiddenMessageKey(meta) {
|
|
|
66
66
|
var getRetryOptions = function getRetryOptions(url, status, response, onAuthorize) {
|
|
67
67
|
var _response$meta, _access$action;
|
|
68
68
|
var data = response && response.data || (0, _jsonld.getEmptyJsonLd)();
|
|
69
|
-
var provider = (0,
|
|
69
|
+
var provider = (0, _linkExtractors.extractProvider)(data);
|
|
70
70
|
var context = provider === null || provider === void 0 ? void 0 : provider.text;
|
|
71
71
|
var values = context ? {
|
|
72
72
|
context: context
|
|
@@ -12,7 +12,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
12
12
|
var _FlexibleCard = _interopRequireDefault(require("../../../../FlexibleCard"));
|
|
13
13
|
var _messages = require("../../../../../messages");
|
|
14
14
|
var _blocks = require("../../../../FlexibleCard/components/blocks");
|
|
15
|
-
var
|
|
15
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
16
16
|
var _styled = require("./styled");
|
|
17
17
|
var _UnauthorisedViewContent = _interopRequireDefault(require("../../../../common/UnauthorisedViewContent"));
|
|
18
18
|
var _actionGroup = _interopRequireDefault(require("../../../../FlexibleCard/components/blocks/action-group"));
|
|
@@ -33,7 +33,7 @@ var HoverCardUnauthorisedView = function HoverCardUnauthorisedView(_ref) {
|
|
|
33
33
|
url = _ref.url;
|
|
34
34
|
var cardState = flexibleCardProps.cardState;
|
|
35
35
|
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
36
|
-
var providerName = (_extractProvider = (0,
|
|
36
|
+
var providerName = (_extractProvider = (0, _linkExtractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text;
|
|
37
37
|
var _useSmartCardActions = (0, _actions.useSmartCardActions)(id, url, analytics),
|
|
38
38
|
authorize = _useSmartCardActions.authorize;
|
|
39
39
|
var handleAuthorize = (0, _react.useCallback)(function () {
|
|
@@ -5,12 +5,12 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
});
|
|
6
6
|
exports.getSimulatedMetadata = void 0;
|
|
7
7
|
var _constants = require("../../constants");
|
|
8
|
-
var
|
|
8
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
9
9
|
var _utils = require("../../extractors/flexible/utils");
|
|
10
10
|
var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
11
11
|
var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
12
12
|
var data = arguments.length > 1 ? arguments[1] : undefined;
|
|
13
|
-
var types = data ? (0,
|
|
13
|
+
var types = data ? (0, _linkExtractors.extractType)(data) : undefined;
|
|
14
14
|
switch (extensionKey) {
|
|
15
15
|
case 'bitbucket-object-provider':
|
|
16
16
|
case 'native-bitbucket-object-provider':
|
|
@@ -46,7 +46,7 @@ var _ForbiddenView = require("./ForbiddenView");
|
|
|
46
46
|
var _ResolvedView = require("./ResolvedView");
|
|
47
47
|
var _ResolvingView = require("./ResolvingView");
|
|
48
48
|
var _UnauthorisedView = require("./UnauthorisedView");
|
|
49
|
-
var
|
|
49
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
50
50
|
var _linkProvider = require("@atlaskit/link-provider");
|
|
51
51
|
var _helpers = require("../../state/helpers");
|
|
52
52
|
var InlineCard = function InlineCard(_ref) {
|
|
@@ -109,7 +109,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
109
109
|
status: status
|
|
110
110
|
});
|
|
111
111
|
}
|
|
112
|
-
var provider = (0,
|
|
112
|
+
var provider = (0, _linkExtractors.extractProvider)(cardDetails);
|
|
113
113
|
return /*#__PURE__*/_react.default.createElement(_UnauthorisedView.InlineCardUnauthorizedView, {
|
|
114
114
|
icon: provider && provider.icon,
|
|
115
115
|
context: provider && provider.text,
|
|
@@ -130,7 +130,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
130
130
|
status: status
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
var providerForbidden = (0,
|
|
133
|
+
var providerForbidden = (0, _linkExtractors.extractProvider)(cardDetails);
|
|
134
134
|
var cardMetadata = (_details$meta = details === null || details === void 0 ? void 0 : details.meta) !== null && _details$meta !== void 0 ? _details$meta : (0, _jsonld.getForbiddenJsonLd)().meta;
|
|
135
135
|
var requestAccessContext = (0, _context.extractRequestAccessContext)({
|
|
136
136
|
jsonLd: cardMetadata,
|
|
@@ -154,7 +154,7 @@ var InlineCard = function InlineCard(_ref) {
|
|
|
154
154
|
status: status
|
|
155
155
|
});
|
|
156
156
|
}
|
|
157
|
-
var providerNotFound = (0,
|
|
157
|
+
var providerNotFound = (0, _linkExtractors.extractProvider)(cardDetails);
|
|
158
158
|
return /*#__PURE__*/_react.default.createElement(_ErroredView.InlineCardErroredView, {
|
|
159
159
|
url: url,
|
|
160
160
|
icon: providerNotFound && providerNotFound.icon,
|
|
@@ -2,7 +2,7 @@ import { extractTitleTextColor, extractSummary } from '../common/primitives';
|
|
|
2
2
|
import { extractLozenge } from '../common/lozenge';
|
|
3
3
|
import { extractIcon } from '../common/icon';
|
|
4
4
|
import { extractCommentCount, extractProgrammingLanguage, extractSubscriberCount, extractAttachmentCount } from '../common/detail';
|
|
5
|
-
import { extractLink, extractTitle, extractProvider, extractMembers, extractPersonAssignedTo, extractPersonCreatedBy, extractPersonUpdatedBy, extractImage } from '@atlaskit/
|
|
5
|
+
import { extractLink, extractTitle, extractProvider, extractMembers, extractPersonAssignedTo, extractPersonCreatedBy, extractPersonUpdatedBy, extractImage } from '@atlaskit/link-extractors';
|
|
6
6
|
import { extractByline } from '../common/byline/extractByline';
|
|
7
7
|
import { extractTitlePrefix } from '../common/title-prefix/extractTitlePrefix';
|
|
8
8
|
import { extractActions } from '../common/actions/extractActions';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { extractDownloadUrl } from '../detail';
|
|
2
|
-
import { extractPreview, extractProvider } from '@atlaskit/
|
|
2
|
+
import { extractPreview, extractProvider } from '@atlaskit/link-extractors';
|
|
3
3
|
import { PreviewAction } from '../../../view/BlockCard';
|
|
4
4
|
import { CardDisplay } from '../../../constants';
|
|
5
5
|
import { extractIsSupportTheming } from '../../common/meta/extractIsSupportTheming';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { FormattedRelativeTime } from 'react-intl-next';
|
|
3
3
|
import { selectUnit } from '@formatjs/intl-utils';
|
|
4
|
-
import { extractDateCreated, extractDateUpdated, extractPersonCreatedBy, extractPersonUpdatedBy } from '@atlaskit/
|
|
4
|
+
import { extractDateCreated, extractDateUpdated, extractPersonCreatedBy, extractPersonUpdatedBy } from '@atlaskit/link-extractors';
|
|
5
5
|
export const extractByline = jsonLd => {
|
|
6
6
|
const updatedAt = extractDateUpdated(jsonLd);
|
|
7
7
|
const createdAt = extractDateCreated(jsonLd);
|
|
@@ -6,7 +6,7 @@ import BranchIcon from '@atlaskit/icon-object/glyph/branch/16';
|
|
|
6
6
|
import RepoIcon from '@atlaskit/icon-object/glyph/code/16';
|
|
7
7
|
import TaskIcon from '@atlaskit/icon-object/glyph/task/16';
|
|
8
8
|
import { extractorPriorityMap } from './priority';
|
|
9
|
-
import { extractProvider, extractUrlFromIconJsonLd, extractTitle } from '@atlaskit/
|
|
9
|
+
import { extractProvider, extractUrlFromIconJsonLd, extractTitle } from '@atlaskit/link-extractors';
|
|
10
10
|
import { extractFileFormat } from './extractFileFormat';
|
|
11
11
|
import { extractIconFromDocument } from './extractIconFromDocument';
|
|
12
12
|
import { extractIconFromTask } from './extractIconFromTask';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractState } from './extractState';
|
|
2
2
|
import { extractTag } from './extractTag';
|
|
3
3
|
import { extractTaskStatus } from './extractTaskStatus';
|
|
4
|
-
import { extractType } from '@atlaskit/
|
|
4
|
+
import { extractType } from '@atlaskit/link-extractors';
|
|
5
5
|
import { extractTaskType } from './extractTaskType';
|
|
6
6
|
const DOC_TYPES = ['schema:BlogPosting', 'schema:TextDigitalDocument', 'schema:DigitalDocument', 'schema:PresentationDigitalDocument', 'schema:SpreadsheetDigitalDocument'];
|
|
7
7
|
export const extractLozenge = jsonLd => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractUrlFromIconJsonLd } from '@atlaskit/
|
|
1
|
+
import { extractUrlFromIconJsonLd } from '@atlaskit/link-extractors';
|
|
2
2
|
export const extractTaskType = jsonLd => {
|
|
3
3
|
// TODO: Remove once Jira migrate to the correct type.
|
|
4
4
|
const taskType = jsonLd['atlassian:taskType'] || jsonLd.taskType;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractLink, extractTitle, extractProvider, extractPreview } from '@atlaskit/
|
|
1
|
+
import { extractLink, extractTitle, extractProvider, extractPreview } from '@atlaskit/link-extractors';
|
|
2
2
|
import { extractIsTrusted } from '../common/meta/extractIsTrusted';
|
|
3
3
|
import { extractIsSupportTheming } from '../common/meta/extractIsSupportTheming';
|
|
4
4
|
const extractEmbedPreview = (jsonLd, platform, iframeUrlType) => {
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { extractDownloadUrl } from '../../common/detail';
|
|
2
|
-
import { extractPreview as extractPreviewData } from '@atlaskit/
|
|
3
|
-
import { extractLink, extractProvider, extractTitle } from '@atlaskit/linking-common/extractors';
|
|
2
|
+
import { extractPreview as extractPreviewData, extractLink, extractProvider, extractTitle } from '@atlaskit/link-extractors';
|
|
4
3
|
import { extractLinkIcon } from '../icon';
|
|
5
4
|
import { extractIsSupportTheming } from '../../common/meta/extractIsSupportTheming';
|
|
6
5
|
export const extractPreviewAction = response => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractLink } from '@atlaskit/
|
|
1
|
+
import { extractLink } from '@atlaskit/link-extractors';
|
|
2
2
|
import { getActionsFromJsonLd } from '../../common/actions/extractActions';
|
|
3
3
|
export const extractViewAction = data => {
|
|
4
4
|
const viewActionExists = getActionsFromJsonLd(data).find(action => action['@type'] === 'ViewAction');
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractMembers, extractPersonFromJsonLd } from '@atlaskit/
|
|
1
|
+
import { extractMembers, extractPersonFromJsonLd } from '@atlaskit/link-extractors';
|
|
2
2
|
export const extractPersonsUpdatedBy = jsonLd => {
|
|
3
3
|
if (jsonLd['@type'] === 'atlassian:Project') {
|
|
4
4
|
const members = extractMembers(jsonLd);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IconType } from '../../constants';
|
|
2
|
-
import { extractUrlFromIconJsonLd } from '@atlaskit/
|
|
2
|
+
import { extractUrlFromIconJsonLd } from '@atlaskit/link-extractors';
|
|
3
3
|
const priorityMapper = {
|
|
4
4
|
blocker: IconType.PriorityBlocker,
|
|
5
5
|
critical: IconType.PriorityCritical,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { extractLozenge } from '../common/lozenge';
|
|
2
2
|
import { getExtensionKey } from '../../state/helpers';
|
|
3
3
|
import extractServerAction from './extract-server-action';
|
|
4
|
-
import { extractLink } from '@atlaskit/
|
|
4
|
+
import { extractLink } from '@atlaskit/link-extractors';
|
|
5
5
|
import { extractPreviewAction } from './actions/extract-preview-action';
|
|
6
6
|
const toInvokeRequest = (extensionKey, resourceIdentifiers, actionType, details) => {
|
|
7
7
|
if (!actionType) {
|
|
@@ -5,7 +5,7 @@ import extractJiraTaskIcon from './extract-jira-task-icon';
|
|
|
5
5
|
import extractProviderIcon from './extract-provider-icon';
|
|
6
6
|
import extractUrlIcon from './extract-url-icon';
|
|
7
7
|
import { extractTaskType } from '../../common/lozenge';
|
|
8
|
-
import { extractTitle } from '@atlaskit/
|
|
8
|
+
import { extractTitle } from '@atlaskit/link-extractors';
|
|
9
9
|
import { extractorPriorityMap as priorityMap } from '../../common/icon/priority';
|
|
10
10
|
import { IconType } from '../../../constants';
|
|
11
11
|
const extractTask = (data, label) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { CONFLUENCE_GENERATOR_ID, JIRA_GENERATOR_ID } from '../../constants';
|
|
2
2
|
import { IconType } from '../../../constants';
|
|
3
3
|
import extractUrlIcon from './extract-url-icon';
|
|
4
|
-
import { extractTitle } from '@atlaskit/
|
|
4
|
+
import { extractTitle } from '@atlaskit/link-extractors';
|
|
5
5
|
const extractProviderIcon = data => {
|
|
6
6
|
if (!data) {
|
|
7
7
|
return undefined;
|
|
@@ -2,7 +2,7 @@ import { extractSummary } from '../common/primitives';
|
|
|
2
2
|
import { extractLinkIcon } from './icon';
|
|
3
3
|
import { extractAttachmentCount, extractChecklistProgress, extractCommentCount, extractCreatedBy, extractModifiedBy, extractProgrammingLanguage, extractSubscriberCount, extractViewCount, extractReactCount, extractVoteCount, extractSourceBranch, extractTargetBranch, extractDueOn, extractLocation, extractOwnedBy } from './utils';
|
|
4
4
|
import { extractPersonsUpdatedBy } from './collaboratorGroup';
|
|
5
|
-
import { extractPersonCreatedBy, extractTitle, extractDateUpdated, extractDateCreated, extractLink } from '@atlaskit/
|
|
5
|
+
import { extractPersonCreatedBy, extractTitle, extractDateUpdated, extractDateCreated, extractLink } from '@atlaskit/link-extractors';
|
|
6
6
|
import extractPriority from './extract-priority';
|
|
7
7
|
import extractProviderIcon from './icon/extract-provider-icon';
|
|
8
8
|
import extractPreview from './extract-preview';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractPersonOwnedBy, extractPersonCreatedBy, extractPersonUpdatedBy } from '@atlaskit/
|
|
1
|
+
import { extractPersonOwnedBy, extractPersonCreatedBy, extractPersonUpdatedBy } from '@atlaskit/link-extractors';
|
|
2
2
|
const extractLinkName = link => {
|
|
3
3
|
if (link && typeof link === 'object' && link['@type'] === 'Link') {
|
|
4
4
|
return link.name;
|
|
@@ -2,7 +2,7 @@ import { extractTitleTextColor } from '../common/primitives';
|
|
|
2
2
|
import { extractLozenge } from '../common/lozenge';
|
|
3
3
|
import { extractIcon } from '../common/icon';
|
|
4
4
|
import { extractTitlePrefix } from '../common/title-prefix';
|
|
5
|
-
import { extractLink, extractTitle, extractProvider } from '@atlaskit/
|
|
5
|
+
import { extractLink, extractTitle, extractProvider } from '@atlaskit/link-extractors';
|
|
6
6
|
import { CONFLUENCE_GENERATOR_ID, JIRA_GENERATOR_ID } from '../constants';
|
|
7
7
|
export const extractInlineIcon = jsonLd => {
|
|
8
8
|
const provider = extractProvider(jsonLd);
|
package/dist/es2019/version.json
CHANGED
|
@@ -9,7 +9,7 @@ import BlockCardFooter from '../../components/flexible/footer';
|
|
|
9
9
|
import { ForbiddenAction } from '../../actions/flexible/ForbiddenAction';
|
|
10
10
|
import Text from '../../../FlexibleCard/components/elements/text';
|
|
11
11
|
import { getForbiddenJsonLd } from '../../../../utils/jsonld';
|
|
12
|
-
import { extractProvider } from '@atlaskit/
|
|
12
|
+
import { extractProvider } from '@atlaskit/link-extractors';
|
|
13
13
|
import { extractRequestAccessContext } from '../../../../extractors/common/context';
|
|
14
14
|
|
|
15
15
|
/**
|
|
@@ -4,7 +4,7 @@ import { AuthorizeAction } from '../../actions/flexible/AuthorizeAction';
|
|
|
4
4
|
import BlockCardFooter from '../../components/flexible/footer';
|
|
5
5
|
import { CustomBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
|
|
6
6
|
import { SmartLinkStatus } from '../../../../constants';
|
|
7
|
-
import { extractProvider } from '@atlaskit/
|
|
7
|
+
import { extractProvider } from '@atlaskit/link-extractors';
|
|
8
8
|
import UnauthorisedViewContent from '../../../common/UnauthorisedViewContent';
|
|
9
9
|
import { css } from '@emotion/react';
|
|
10
10
|
import { tokens } from '../../../../utils/token';
|
|
@@ -35,7 +35,7 @@ function Component({
|
|
|
35
35
|
ui,
|
|
36
36
|
children,
|
|
37
37
|
showHoverPreview,
|
|
38
|
-
showAuthTooltip
|
|
38
|
+
showAuthTooltip,
|
|
39
39
|
analyticsEvents
|
|
40
40
|
}) {
|
|
41
41
|
const {
|
|
@@ -59,8 +59,6 @@ function Component({
|
|
|
59
59
|
const subproduct = getSubproduct(state.details);
|
|
60
60
|
const services = getServices(state.details);
|
|
61
61
|
let isFlexibleUi = useMemo(() => isFlexibleUiCard(children), [children]);
|
|
62
|
-
const showAuthTooltipFeatureFlagValue = useFeatureFlag('showAuthTooltip');
|
|
63
|
-
const showAuthTooltip = showAuthTooltipFeatureFlagValue !== undefined ? showAuthTooltipFeatureFlagValue === 'experiment' : showAuthTooltipProp;
|
|
64
62
|
const enableFlexibleBlockCardFlag = Boolean(useFeatureFlag('enableFlexibleBlockCard'));
|
|
65
63
|
const showServerActions = showServerActionsProp && platform !== 'mobile';
|
|
66
64
|
|
|
@@ -178,7 +176,7 @@ function Component({
|
|
|
178
176
|
renderers: renderers,
|
|
179
177
|
ui: ui,
|
|
180
178
|
showHoverPreview: showHoverPreview,
|
|
181
|
-
showAuthTooltip:
|
|
179
|
+
showAuthTooltip: showAuthTooltip,
|
|
182
180
|
showServerActions: showServerActions,
|
|
183
181
|
url: url,
|
|
184
182
|
testId: testId,
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import React, { useCallback, useEffect, useRef, useState } from 'react';
|
|
2
|
+
import { HoverCard } from '../../../../HoverCard';
|
|
3
|
+
import { ElementName } from '../../../../../constants';
|
|
4
|
+
const FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY = 100;
|
|
5
|
+
const HoverCardControl = ({
|
|
6
|
+
children,
|
|
7
|
+
hideHoverCardPreviewButton,
|
|
8
|
+
isHoverPreview,
|
|
9
|
+
isAuthTooltip,
|
|
10
|
+
showServerActions,
|
|
11
|
+
url
|
|
12
|
+
}) => {
|
|
13
|
+
const [canOpen, setCanOpen] = useState(true);
|
|
14
|
+
const mouseStopTimer = useRef();
|
|
15
|
+
useEffect(() => {
|
|
16
|
+
return () => {
|
|
17
|
+
if (mouseStopTimer.current) {
|
|
18
|
+
clearTimeout(mouseStopTimer.current);
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
}, []);
|
|
22
|
+
const onMouseMove = useCallback(e => {
|
|
23
|
+
var _e$target$closest;
|
|
24
|
+
if (mouseStopTimer.current) {
|
|
25
|
+
clearTimeout(mouseStopTimer.current);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
// Never show hover card on action or when action dropdown opens.
|
|
29
|
+
// The code below can be simplified by using :is() and :has()
|
|
30
|
+
// but the pseudo-class isn't support by Firefox yet.
|
|
31
|
+
const action =
|
|
32
|
+
// Any action button group (title/footer block)
|
|
33
|
+
e.target.closest('.actions-button-group') || ( // When action dropdown list is opened on action button group or lozenge action
|
|
34
|
+
(_e$target$closest = e.target.closest('[data-smart-link-container]')) === null || _e$target$closest === void 0 ? void 0 : _e$target$closest.querySelector('[data-action-open="true"]'));
|
|
35
|
+
const canOpenOnElement = isAuthTooltip && !action ||
|
|
36
|
+
// EDM-7060: For hover preview, also hide hover card on all elements
|
|
37
|
+
// except title element (link title)
|
|
38
|
+
isHoverPreview && !action && !e.target.closest(`[data-smart-element]:not([data-smart-element="${ElementName.Title}"])`);
|
|
39
|
+
mouseStopTimer.current = setTimeout(() => {
|
|
40
|
+
if (canOpen !== canOpenOnElement) {
|
|
41
|
+
setCanOpen(Boolean(canOpenOnElement));
|
|
42
|
+
}
|
|
43
|
+
}, FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY);
|
|
44
|
+
}, [isAuthTooltip, isHoverPreview, canOpen]);
|
|
45
|
+
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
46
|
+
allowEventPropagation: true,
|
|
47
|
+
canOpen: canOpen,
|
|
48
|
+
closeOnChildClick: true,
|
|
49
|
+
hidePreviewButton: hideHoverCardPreviewButton
|
|
50
|
+
// EDM-6709 extends the internal prop for showServerActions type to be
|
|
51
|
+
// an object. If we decide to use expose the type for hover preview
|
|
52
|
+
// remove the Boolean() conversion here.
|
|
53
|
+
,
|
|
54
|
+
showServerActions: Boolean(showServerActions),
|
|
55
|
+
url: url
|
|
56
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
57
|
+
onMouseMove: onMouseMove
|
|
58
|
+
}, children));
|
|
59
|
+
};
|
|
60
|
+
export default HoverCardControl;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
import _extends from "@babel/runtime/helpers/extends";
|
|
2
1
|
/** @jsx jsx */
|
|
3
|
-
import React, { useContext
|
|
2
|
+
import React, { useContext } from 'react';
|
|
4
3
|
import { css, jsx } from '@emotion/react';
|
|
5
|
-
import {
|
|
4
|
+
import { MediaPlacement, SmartLinkSize, SmartLinkTheme } from '../../../../constants';
|
|
6
5
|
import { isFlexibleUiBlock, isFlexibleUiPreviewBlock, isFlexibleUiTitleBlock } from '../../../../utils/flexible';
|
|
7
6
|
import { tokens } from '../../../../utils/token';
|
|
8
7
|
import { FlexibleUiContext } from '../../../../state/flexible-ui-context';
|
|
9
8
|
import LayeredLink from './layered-link';
|
|
10
|
-
import
|
|
9
|
+
import HoverCardControl from './hover-card-control';
|
|
11
10
|
import { isFlexUiPreviewPresent } from '../../../../state/flexible-ui-context/utils';
|
|
12
11
|
const elevationStyles = css`
|
|
13
12
|
border: 1px solid transparent;
|
|
@@ -187,47 +186,22 @@ const Container = ({
|
|
|
187
186
|
}) => {
|
|
188
187
|
const context = useContext(FlexibleUiContext);
|
|
189
188
|
const childrenOptions = getChildrenOptions(children, context);
|
|
190
|
-
const [hoverCardCanOpen, setHoverCardCanOpen] = useState(true);
|
|
191
189
|
const canShowHoverPreview = showHoverPreview && status === 'resolved';
|
|
192
190
|
const canShowAuthTooltip = showAuthTooltip && status === 'unauthorized';
|
|
193
|
-
const
|
|
194
|
-
var _e$target$closest;
|
|
195
|
-
// Never show hover card on action or when action dropdown opens.
|
|
196
|
-
// The code below can be simplified by using :is() and :has()
|
|
197
|
-
// but the pseudo-class isn't support by Firefox yet.
|
|
198
|
-
const action =
|
|
199
|
-
// Any action button group (title/footer block)
|
|
200
|
-
e.target.closest('.actions-button-group') || ( // When action dropdown list is opened on action button group or lozenge action
|
|
201
|
-
(_e$target$closest = e.target.closest('[data-smart-link-container]')) === null || _e$target$closest === void 0 ? void 0 : _e$target$closest.querySelector('[data-action-open="true"]'));
|
|
202
|
-
const canOpen = canShowAuthTooltip && !action ||
|
|
203
|
-
// EDM-7060: For hover preview, also hide hover card on all elements
|
|
204
|
-
// except title element (link title)
|
|
205
|
-
canShowHoverPreview && !action && !e.target.closest(`[data-smart-element]:not([data-smart-element="${ElementName.Title}"])`);
|
|
206
|
-
if (hoverCardCanOpen !== canOpen) {
|
|
207
|
-
setHoverCardCanOpen(canOpen);
|
|
208
|
-
}
|
|
209
|
-
}, [canShowAuthTooltip, canShowHoverPreview, hoverCardCanOpen]);
|
|
210
|
-
const containerContent = jsx("div", _extends({
|
|
191
|
+
const container = jsx("div", {
|
|
211
192
|
css: getContainerStyles(size, hideBackground, hideElevation, hidePadding, clickableContainer, childrenOptions),
|
|
212
193
|
"data-smart-link-container": true,
|
|
213
194
|
"data-testid": testId
|
|
214
|
-
},
|
|
215
|
-
onMouseOver
|
|
216
|
-
} : undefined), clickableContainer ? getLayeredLink(testId, context, children, onClick) : null, renderChildren(children, size, theme, status, retry, onClick));
|
|
195
|
+
}, clickableContainer ? getLayeredLink(testId, context, children, onClick) : null, renderChildren(children, size, theme, status, retry, onClick));
|
|
217
196
|
if (context !== null && context !== void 0 && context.url && (canShowHoverPreview || canShowAuthTooltip)) {
|
|
218
|
-
return jsx(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
// an object. If we decide to use expose the type for hover preview
|
|
226
|
-
// remove the Boolean() conversion here.
|
|
227
|
-
,
|
|
228
|
-
showServerActions: Boolean(showServerActions)
|
|
229
|
-
}, containerContent);
|
|
197
|
+
return jsx(HoverCardControl, {
|
|
198
|
+
hideHoverCardPreviewButton: hideHoverCardPreviewButton,
|
|
199
|
+
isHoverPreview: canShowHoverPreview,
|
|
200
|
+
isAuthTooltip: canShowAuthTooltip,
|
|
201
|
+
showServerActions: showServerActions,
|
|
202
|
+
url: context.url
|
|
203
|
+
}, container);
|
|
230
204
|
}
|
|
231
|
-
return
|
|
205
|
+
return container;
|
|
232
206
|
};
|
|
233
207
|
export default Container;
|