@atlaskit/smart-card 26.43.0 → 26.43.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/unresolved-view/index.js +1 -1
- package/dist/cjs/view/BlockCard/views/flexible/utils/index.js +7 -13
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +5 -3
- package/dist/cjs/view/FlexibleCard/components/container/index.js +1 -0
- package/dist/cjs/view/HoverCard/index.js +1 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +2 -2
- package/dist/es2019/view/BlockCard/views/flexible/unresolved-view/index.js +2 -2
- package/dist/es2019/view/BlockCard/views/flexible/utils/index.js +3 -7
- package/dist/es2019/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/container/hover-card-control/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/container/index.js +1 -0
- package/dist/es2019/view/HoverCard/index.js +1 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +2 -2
- package/dist/esm/view/BlockCard/views/flexible/unresolved-view/index.js +2 -2
- package/dist/esm/view/BlockCard/views/flexible/utils/index.js +6 -12
- package/dist/esm/view/FlexibleCard/components/blocks/action-group/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/container/hover-card-control/index.js +5 -3
- package/dist/esm/view/FlexibleCard/components/container/index.js +1 -0
- package/dist/esm/view/HoverCard/index.js +1 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/BlockCard/views/flexible/utils/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/container/hover-card-control/types.d.ts +1 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/utils/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/container/hover-card-control/types.d.ts +1 -0
- package/package.json +1 -4
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.43.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#59452](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/59452) [`c069c37bbfb1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c069c37bbfb1) - Add delay property to flex-card action group
|
|
8
|
+
|
|
9
|
+
## 26.43.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#60015](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/60015) [`7015b54914d8`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7015b54914d8) - [ux] Clean up of "platform.linking-platform.smart-card.enable-block-card-clicks-opening-in-same-tab" FF
|
|
14
|
+
|
|
3
15
|
## 26.43.0
|
|
4
16
|
|
|
5
17
|
### Minor 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: "26.43.
|
|
25
|
+
packageVersion: "26.43.2"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -69,7 +69,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
69
69
|
testId: testId,
|
|
70
70
|
ui: _utils.FlexibleCardUiOptions,
|
|
71
71
|
url: url
|
|
72
|
-
}, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, (0, _extends2.default)({},
|
|
72
|
+
}, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, _utils.titleBlockOptions, {
|
|
73
73
|
metadata: titleMetadata,
|
|
74
74
|
subtitle: [{
|
|
75
75
|
name: _constants.ElementName.Location
|
|
@@ -31,7 +31,7 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
31
31
|
testId: testId,
|
|
32
32
|
ui: _utils.FlexibleCardUiOptions,
|
|
33
33
|
url: url
|
|
34
|
-
}, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, (0, _extends2.default)({},
|
|
34
|
+
}, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, _utils.titleBlockOptions, {
|
|
35
35
|
hideIcon: !!title,
|
|
36
36
|
text: title
|
|
37
37
|
})), /*#__PURE__*/_react.default.createElement(_blocks.CustomBlock, null, children), showPreview && /*#__PURE__*/_react.default.createElement(_blocks.PreviewBlock, _utils.PreviewBlockOptions), /*#__PURE__*/_react.default.createElement(_blocks.InternalFooterBlock, (0, _extends2.default)({}, _utils.FooterBlockOptions, {
|
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.
|
|
7
|
-
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
6
|
+
exports.titleBlockOptions = exports.getSimulatedBetterMetadata = exports.PreviewBlockOptions = exports.FooterBlockOptions = exports.FlexibleCardUiOptions = void 0;
|
|
8
7
|
var _constants = require("../../../../../constants");
|
|
9
8
|
var _utils = require("../../../../../extractors/flexible/utils");
|
|
10
9
|
var _helpers = require("../../../../../state/helpers");
|
|
@@ -109,17 +108,12 @@ var getSimulatedBetterMetadata = exports.getSimulatedBetterMetadata = function g
|
|
|
109
108
|
var FlexibleCardUiOptions = exports.FlexibleCardUiOptions = {
|
|
110
109
|
hideElevation: true
|
|
111
110
|
};
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
position: _constants.SmartLinkPosition.Center,
|
|
119
|
-
overrideCss: _styled.titleBlockCss,
|
|
120
|
-
hideRetry: true,
|
|
121
|
-
size: _constants.SmartLinkSize.Large
|
|
122
|
-
};
|
|
111
|
+
var titleBlockOptions = exports.titleBlockOptions = {
|
|
112
|
+
anchorTarget: '_self',
|
|
113
|
+
position: _constants.SmartLinkPosition.Center,
|
|
114
|
+
overrideCss: _styled.titleBlockCss,
|
|
115
|
+
hideRetry: true,
|
|
116
|
+
size: _constants.SmartLinkSize.Large
|
|
123
117
|
};
|
|
124
118
|
var PreviewBlockOptions = exports.PreviewBlockOptions = {
|
|
125
119
|
placement: _constants.MediaPlacement.Right,
|
|
@@ -23,6 +23,7 @@ var _messages = require("../../../../../messages");
|
|
|
23
23
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
24
24
|
var _actionGroupItem = _interopRequireDefault(require("./action-group-item"));
|
|
25
25
|
var _utils2 = require("../utils");
|
|
26
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
26
27
|
var _excluded = ["triggerRef"];
|
|
27
28
|
var _templateObject;
|
|
28
29
|
/** @jsx jsx */
|
|
@@ -20,7 +20,9 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
20
20
|
isAuthTooltip = _ref.isAuthTooltip,
|
|
21
21
|
showServerActions = _ref.showServerActions,
|
|
22
22
|
testId = _ref.testId,
|
|
23
|
-
url = _ref.url
|
|
23
|
+
url = _ref.url,
|
|
24
|
+
_ref$delay = _ref.delay,
|
|
25
|
+
delay = _ref$delay === void 0 ? FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY : _ref$delay;
|
|
24
26
|
var _useState = (0, _react.useState)(true),
|
|
25
27
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
26
28
|
canOpen = _useState2[0],
|
|
@@ -59,8 +61,8 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
59
61
|
if (canOpen !== canOpenOnElement) {
|
|
60
62
|
setCanOpen(Boolean(canOpenOnElement));
|
|
61
63
|
}
|
|
62
|
-
},
|
|
63
|
-
}, [isAuthTooltip, isHoverPreview, canOpen]);
|
|
64
|
+
}, delay);
|
|
65
|
+
}, [isAuthTooltip, isHoverPreview, canOpen, delay]);
|
|
64
66
|
return /*#__PURE__*/_react.default.createElement(_HoverCard.HoverCard, {
|
|
65
67
|
allowEventPropagation: true,
|
|
66
68
|
canOpen: canOpen,
|
|
@@ -17,6 +17,7 @@ var _layeredLink = _interopRequireDefault(require("./layered-link"));
|
|
|
17
17
|
var _hoverCardControl = _interopRequireDefault(require("./hover-card-control"));
|
|
18
18
|
var _utils = require("../../../../state/flexible-ui-context/utils");
|
|
19
19
|
var _colors = require("@atlaskit/theme/colors");
|
|
20
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
20
21
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
21
22
|
/** @jsx jsx */
|
|
22
23
|
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); }
|
|
@@ -11,6 +11,7 @@ var _reactErrorBoundary = require("react-error-boundary");
|
|
|
11
11
|
var _analytics = require("../../state/analytics");
|
|
12
12
|
var _HoverCardComponent = require("./components/HoverCardComponent");
|
|
13
13
|
var _constants = require("../../constants");
|
|
14
|
+
var _reactMagneticDi = require("react-magnetic-di");
|
|
14
15
|
/** @jsx jsx */
|
|
15
16
|
|
|
16
17
|
var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
@@ -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: "26.43.
|
|
20
|
+
packageVersion: "26.43.2",
|
|
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: "26.43.
|
|
7
|
+
packageVersion: "26.43.2"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -4,7 +4,7 @@ import FlexibleCard from '../../../FlexibleCard';
|
|
|
4
4
|
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
|
|
5
5
|
import { metadataBlockCss } from './styled';
|
|
6
6
|
import { ActionName, ElementName, SmartLinkPosition } from '../../../../constants';
|
|
7
|
-
import { getSimulatedBetterMetadata,
|
|
7
|
+
import { getSimulatedBetterMetadata, titleBlockOptions, PreviewBlockOptions, FlexibleCardUiOptions, FooterBlockOptions } from './utils';
|
|
8
8
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
9
9
|
/**
|
|
10
10
|
* This view represents a Block card that has an 'Resolved' status.
|
|
@@ -54,7 +54,7 @@ const FlexibleResolvedView = ({
|
|
|
54
54
|
testId: testId,
|
|
55
55
|
ui: FlexibleCardUiOptions,
|
|
56
56
|
url: url
|
|
57
|
-
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({},
|
|
57
|
+
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
|
|
58
58
|
metadata: titleMetadata,
|
|
59
59
|
subtitle: [{
|
|
60
60
|
name: ElementName.Location
|
|
@@ -3,7 +3,7 @@ import { CustomBlock, PreviewBlock, TitleBlock } from '../../../../FlexibleCard/
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
5
5
|
import { InternalFooterBlock } from '../../../../FlexibleCard/components/blocks';
|
|
6
|
-
import { FlexibleCardUiOptions, PreviewBlockOptions,
|
|
6
|
+
import { FlexibleCardUiOptions, PreviewBlockOptions, titleBlockOptions, FooterBlockOptions } from '../utils';
|
|
7
7
|
const UnresolvedView = ({
|
|
8
8
|
actions,
|
|
9
9
|
cardState,
|
|
@@ -24,7 +24,7 @@ const UnresolvedView = ({
|
|
|
24
24
|
testId: testId,
|
|
25
25
|
ui: FlexibleCardUiOptions,
|
|
26
26
|
url: url
|
|
27
|
-
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({},
|
|
27
|
+
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
|
|
28
28
|
hideIcon: !!title,
|
|
29
29
|
text: title
|
|
30
30
|
})), /*#__PURE__*/React.createElement(CustomBlock, null, children), showPreview && /*#__PURE__*/React.createElement(PreviewBlock, PreviewBlockOptions), /*#__PURE__*/React.createElement(InternalFooterBlock, _extends({}, FooterBlockOptions, {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
3
2
|
import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
|
|
4
3
|
import { getExtensionKey } from '../../../../../state/helpers';
|
|
@@ -103,16 +102,13 @@ export const getSimulatedBetterMetadata = cardDetails => {
|
|
|
103
102
|
export const FlexibleCardUiOptions = {
|
|
104
103
|
hideElevation: true
|
|
105
104
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
// Make this a const object after ff cleanup.
|
|
109
|
-
export const getTitleBlockOptions = () => ({
|
|
110
|
-
anchorTarget: getBooleanFF('platform.linking-platform.smart-card.enable-block-card-clicks-opening-in-same-tab') ? '_self' : undefined,
|
|
105
|
+
export const titleBlockOptions = {
|
|
106
|
+
anchorTarget: '_self',
|
|
111
107
|
position: SmartLinkPosition.Center,
|
|
112
108
|
overrideCss: titleBlockCss,
|
|
113
109
|
hideRetry: true,
|
|
114
110
|
size: SmartLinkSize.Large
|
|
115
|
-
}
|
|
111
|
+
};
|
|
116
112
|
export const PreviewBlockOptions = {
|
|
117
113
|
placement: MediaPlacement.Right,
|
|
118
114
|
ignoreContainerPadding: true
|
|
@@ -14,6 +14,7 @@ import { messages } from '../../../../../messages';
|
|
|
14
14
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
15
15
|
import ActionGroupItem from './action-group-item';
|
|
16
16
|
import { filterActionItems } from '../utils';
|
|
17
|
+
import { di } from 'react-magnetic-di';
|
|
17
18
|
const styles = css`
|
|
18
19
|
display: inline-flex;
|
|
19
20
|
line-height: 1rem;
|
|
@@ -9,7 +9,8 @@ const HoverCardControl = ({
|
|
|
9
9
|
isAuthTooltip,
|
|
10
10
|
showServerActions,
|
|
11
11
|
testId,
|
|
12
|
-
url
|
|
12
|
+
url,
|
|
13
|
+
delay = FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY
|
|
13
14
|
}) => {
|
|
14
15
|
const [canOpen, setCanOpen] = useState(true);
|
|
15
16
|
const mouseStopTimer = useRef();
|
|
@@ -46,8 +47,8 @@ const HoverCardControl = ({
|
|
|
46
47
|
if (canOpen !== canOpenOnElement) {
|
|
47
48
|
setCanOpen(Boolean(canOpenOnElement));
|
|
48
49
|
}
|
|
49
|
-
},
|
|
50
|
-
}, [isAuthTooltip, isHoverPreview, canOpen]);
|
|
50
|
+
}, delay);
|
|
51
|
+
}, [isAuthTooltip, isHoverPreview, canOpen, delay]);
|
|
51
52
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
52
53
|
allowEventPropagation: true,
|
|
53
54
|
canOpen: canOpen,
|
|
@@ -9,6 +9,7 @@ import LayeredLink from './layered-link';
|
|
|
9
9
|
import HoverCardControl from './hover-card-control';
|
|
10
10
|
import { isFlexUiPreviewPresent } from '../../../../state/flexible-ui-context/utils';
|
|
11
11
|
import { N40 } from '@atlaskit/theme/colors';
|
|
12
|
+
import { di } from 'react-magnetic-di';
|
|
12
13
|
const elevationStyles = css`
|
|
13
14
|
border: 1px solid ${`var(--ds-border, ${N40})`};
|
|
14
15
|
border-radius: ${"var(--ds-border-radius-200, 8px)"};
|
|
@@ -6,6 +6,7 @@ import { ErrorBoundary } from 'react-error-boundary';
|
|
|
6
6
|
import { useSmartLinkAnalytics } from '../../state/analytics';
|
|
7
7
|
import { HoverCardComponent } from './components/HoverCardComponent';
|
|
8
8
|
import { CardDisplay } from '../../constants';
|
|
9
|
+
import { di } from 'react-magnetic-di';
|
|
9
10
|
const HoverCardWithErrorBoundary = props => {
|
|
10
11
|
const {
|
|
11
12
|
url,
|
|
@@ -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: "26.43.
|
|
10
|
+
packageVersion: "26.43.2",
|
|
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: "26.43.
|
|
18
|
+
packageVersion: "26.43.2"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -5,7 +5,7 @@ import FlexibleCard from '../../../FlexibleCard';
|
|
|
5
5
|
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
|
|
6
6
|
import { metadataBlockCss } from './styled';
|
|
7
7
|
import { ActionName, ElementName, SmartLinkPosition } from '../../../../constants';
|
|
8
|
-
import { getSimulatedBetterMetadata,
|
|
8
|
+
import { getSimulatedBetterMetadata, titleBlockOptions, PreviewBlockOptions, FlexibleCardUiOptions, FooterBlockOptions } from './utils';
|
|
9
9
|
import { withFlexibleUIBlockCardStyle } from './utils/withFlexibleUIBlockCardStyle';
|
|
10
10
|
/**
|
|
11
11
|
* This view represents a Block card that has an 'Resolved' status.
|
|
@@ -59,7 +59,7 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
59
59
|
testId: testId,
|
|
60
60
|
ui: FlexibleCardUiOptions,
|
|
61
61
|
url: url
|
|
62
|
-
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({},
|
|
62
|
+
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
|
|
63
63
|
metadata: titleMetadata,
|
|
64
64
|
subtitle: [{
|
|
65
65
|
name: ElementName.Location
|
|
@@ -3,7 +3,7 @@ import { CustomBlock, PreviewBlock, TitleBlock } from '../../../../FlexibleCard/
|
|
|
3
3
|
import React from 'react';
|
|
4
4
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
5
5
|
import { InternalFooterBlock } from '../../../../FlexibleCard/components/blocks';
|
|
6
|
-
import { FlexibleCardUiOptions, PreviewBlockOptions,
|
|
6
|
+
import { FlexibleCardUiOptions, PreviewBlockOptions, titleBlockOptions, FooterBlockOptions } from '../utils';
|
|
7
7
|
var UnresolvedView = function UnresolvedView(_ref) {
|
|
8
8
|
var actions = _ref.actions,
|
|
9
9
|
cardState = _ref.cardState,
|
|
@@ -25,7 +25,7 @@ var UnresolvedView = function UnresolvedView(_ref) {
|
|
|
25
25
|
testId: testId,
|
|
26
26
|
ui: FlexibleCardUiOptions,
|
|
27
27
|
url: url
|
|
28
|
-
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({},
|
|
28
|
+
}, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
|
|
29
29
|
hideIcon: !!title,
|
|
30
30
|
text: title
|
|
31
31
|
})), /*#__PURE__*/React.createElement(CustomBlock, null, children), showPreview && /*#__PURE__*/React.createElement(PreviewBlock, PreviewBlockOptions), /*#__PURE__*/React.createElement(InternalFooterBlock, _extends({}, FooterBlockOptions, {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
1
|
import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
3
2
|
import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
|
|
4
3
|
import { getExtensionKey } from '../../../../../state/helpers';
|
|
@@ -103,17 +102,12 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata(card
|
|
|
103
102
|
export var FlexibleCardUiOptions = {
|
|
104
103
|
hideElevation: true
|
|
105
104
|
};
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
position: SmartLinkPosition.Center,
|
|
113
|
-
overrideCss: titleBlockCss,
|
|
114
|
-
hideRetry: true,
|
|
115
|
-
size: SmartLinkSize.Large
|
|
116
|
-
};
|
|
105
|
+
export var titleBlockOptions = {
|
|
106
|
+
anchorTarget: '_self',
|
|
107
|
+
position: SmartLinkPosition.Center,
|
|
108
|
+
overrideCss: titleBlockCss,
|
|
109
|
+
hideRetry: true,
|
|
110
|
+
size: SmartLinkSize.Large
|
|
117
111
|
};
|
|
118
112
|
export var PreviewBlockOptions = {
|
|
119
113
|
placement: MediaPlacement.Right,
|
|
@@ -19,6 +19,7 @@ import { messages } from '../../../../../messages';
|
|
|
19
19
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
20
20
|
import ActionGroupItem from './action-group-item';
|
|
21
21
|
import { filterActionItems } from '../utils';
|
|
22
|
+
import { di } from 'react-magnetic-di';
|
|
22
23
|
var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: inline-flex;\n line-height: 1rem;\n > div {\n align-items: center;\n button:focus-visible {\n // AK button removes the default browser outline on focus and apply\n // box-shadow styling to create the outline appearance.\n // Due to our container elements (Container/Block/ElementGroup) has\n // overflow hidden to prevent the metadata element from leaking outside\n // of its container, the box-shadow doesn't show properly.\n // Invert the AK box-shadow styling.\n outline-offset: -2px;\n }\n }\n"])));
|
|
23
24
|
var renderActionItems = function renderActionItems() {
|
|
24
25
|
var items = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
@@ -10,7 +10,9 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
10
10
|
isAuthTooltip = _ref.isAuthTooltip,
|
|
11
11
|
showServerActions = _ref.showServerActions,
|
|
12
12
|
testId = _ref.testId,
|
|
13
|
-
url = _ref.url
|
|
13
|
+
url = _ref.url,
|
|
14
|
+
_ref$delay = _ref.delay,
|
|
15
|
+
delay = _ref$delay === void 0 ? FLEXIBLE_HOVER_CARD_CAN_OPEN_DELAY : _ref$delay;
|
|
14
16
|
var _useState = useState(true),
|
|
15
17
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16
18
|
canOpen = _useState2[0],
|
|
@@ -49,8 +51,8 @@ var HoverCardControl = function HoverCardControl(_ref) {
|
|
|
49
51
|
if (canOpen !== canOpenOnElement) {
|
|
50
52
|
setCanOpen(Boolean(canOpenOnElement));
|
|
51
53
|
}
|
|
52
|
-
},
|
|
53
|
-
}, [isAuthTooltip, isHoverPreview, canOpen]);
|
|
54
|
+
}, delay);
|
|
55
|
+
}, [isAuthTooltip, isHoverPreview, canOpen, delay]);
|
|
54
56
|
return /*#__PURE__*/React.createElement(HoverCard, {
|
|
55
57
|
allowEventPropagation: true,
|
|
56
58
|
canOpen: canOpen,
|
|
@@ -11,6 +11,7 @@ import LayeredLink from './layered-link';
|
|
|
11
11
|
import HoverCardControl from './hover-card-control';
|
|
12
12
|
import { isFlexUiPreviewPresent } from '../../../../state/flexible-ui-context/utils';
|
|
13
13
|
import { N40 } from '@atlaskit/theme/colors';
|
|
14
|
+
import { di } from 'react-magnetic-di';
|
|
14
15
|
var elevationStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n border: 1px solid ", ";\n border-radius: ", ";\n margin: ", ";\n"])), "var(--ds-border, ".concat(N40, ")"), "var(--ds-border-radius-200, 8px)", "var(--ds-space-025, 2px)");
|
|
15
16
|
var getGap = function getGap(size) {
|
|
16
17
|
switch (size) {
|
|
@@ -6,6 +6,7 @@ import { ErrorBoundary } from 'react-error-boundary';
|
|
|
6
6
|
import { useSmartLinkAnalytics } from '../../state/analytics';
|
|
7
7
|
import { HoverCardComponent } from './components/HoverCardComponent';
|
|
8
8
|
import { CardDisplay } from '../../constants';
|
|
9
|
+
import { di } from 'react-magnetic-di';
|
|
9
10
|
var HoverCardWithErrorBoundary = function HoverCardWithErrorBoundary(props) {
|
|
10
11
|
var url = props.url,
|
|
11
12
|
id = props.id,
|
|
@@ -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: "26.43.
|
|
13
|
+
packageVersion: "26.43.2",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -11,7 +11,7 @@ type SimulatedMetadata = {
|
|
|
11
11
|
bottomMetadata?: ElementItem[];
|
|
12
12
|
};
|
|
13
13
|
export declare const FlexibleCardUiOptions: FlexibleUiOptions;
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const titleBlockOptions: Partial<TitleBlockProps>;
|
|
15
15
|
export declare const PreviewBlockOptions: Partial<PreviewBlockProps>;
|
|
16
16
|
export declare const FooterBlockOptions: Partial<FooterBlockProps>;
|
|
17
17
|
export {};
|
|
@@ -11,7 +11,7 @@ type SimulatedMetadata = {
|
|
|
11
11
|
bottomMetadata?: ElementItem[];
|
|
12
12
|
};
|
|
13
13
|
export declare const FlexibleCardUiOptions: FlexibleUiOptions;
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const titleBlockOptions: Partial<TitleBlockProps>;
|
|
15
15
|
export declare const PreviewBlockOptions: Partial<PreviewBlockProps>;
|
|
16
16
|
export declare const FooterBlockOptions: Partial<FooterBlockProps>;
|
|
17
17
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.43.
|
|
3
|
+
"version": "26.43.2",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -135,9 +135,6 @@
|
|
|
135
135
|
".": "./src/index.ts"
|
|
136
136
|
},
|
|
137
137
|
"platform-feature-flags": {
|
|
138
|
-
"platform.linking-platform.smart-card.enable-block-card-clicks-opening-in-same-tab": {
|
|
139
|
-
"type": "boolean"
|
|
140
|
-
},
|
|
141
138
|
"platform.linking-platform.smart-card.follow-button": {
|
|
142
139
|
"type": "boolean"
|
|
143
140
|
},
|