@atlaskit/smart-card 26.15.9 → 26.15.11
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 +2 -1
- package/dist/cjs/view/BlockCard/views/flexible/styled.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/atlaskit-badge/index.js +4 -1
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +18 -8
- package/dist/cjs/view/HoverCard/components/views/resolved/styled.js +3 -2
- package/dist/cjs/view/HoverCard/styled.js +1 -1
- package/dist/cjs/view/HoverCard/utils.js +1 -1
- 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 -1
- package/dist/es2019/view/BlockCard/views/flexible/styled.js +3 -0
- package/dist/es2019/view/FlexibleCard/components/elements/atlaskit-badge/index.js +7 -2
- package/dist/es2019/view/HoverCard/components/HoverCardComponent.js +15 -6
- package/dist/es2019/view/HoverCard/components/views/resolved/styled.js +5 -2
- package/dist/es2019/view/HoverCard/styled.js +4 -0
- package/dist/es2019/view/HoverCard/utils.js +1 -1
- 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 -1
- package/dist/esm/view/BlockCard/views/flexible/styled.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/atlaskit-badge/index.js +6 -2
- package/dist/esm/view/HoverCard/components/HoverCardComponent.js +18 -8
- package/dist/esm/view/HoverCard/components/views/resolved/styled.js +3 -2
- package/dist/esm/view/HoverCard/styled.js +1 -1
- package/dist/esm/view/HoverCard/utils.js +1 -1
- 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
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.15.11
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`3d5b709c646`](https://bitbucket.org/atlassian/atlassian-frontend/commits/3d5b709c646) - Update css styles for metadata block elements in Block & Hover Card
|
|
8
|
+
|
|
9
|
+
## 26.15.10
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`9eed222eff6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/9eed222eff6) - noFadeDelay internal hover card prop added.
|
|
14
|
+
|
|
3
15
|
## 26.15.9
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -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.11"
|
|
25
25
|
};
|
|
26
26
|
exports.context = context;
|
|
27
27
|
var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
@@ -83,7 +83,8 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
83
83
|
overrideCss: _styled.metadataBlockCss
|
|
84
84
|
})), /*#__PURE__*/_react.default.createElement(_blocks.SnippetBlock, null), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, {
|
|
85
85
|
primary: bottomMetadata,
|
|
86
|
-
maxLines: 1
|
|
86
|
+
maxLines: 1,
|
|
87
|
+
overrideCss: _styled.metadataBlockCss
|
|
87
88
|
}), !isPreviewBlockErrored ? /*#__PURE__*/_react.default.createElement(_blocks.PreviewBlock, {
|
|
88
89
|
placement: _constants.MediaPlacement.Right,
|
|
89
90
|
ignoreContainerPadding: true,
|
|
@@ -12,7 +12,7 @@ var _colors = require("@atlaskit/theme/colors");
|
|
|
12
12
|
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
13
13
|
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
14
14
|
// in editor prosemirror adds padding-left so we need to overwrite it
|
|
15
|
-
var metadataBlockCss = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* primary element group */\n span[data-smart-element-avatar-group] {\n > ul {\n padding-left: 0px;\n }\n }\n"])));
|
|
15
|
+
var metadataBlockCss = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n /* primary element group */\n span[data-smart-element-avatar-group] {\n > ul {\n padding-left: 0px;\n }\n }\n [data-smart-element-group] {\n line-height: 1rem;\n }\n"])));
|
|
16
16
|
exports.metadataBlockCss = metadataBlockCss;
|
|
17
17
|
var titleBlockCss = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n"])), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? "gap: 0.5em;" : "", (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "[data-smart-element=\"Title\"] {\n font-weight: 600;\n }" : "");
|
|
18
18
|
exports.titleBlockCss = titleBlockCss;
|
|
@@ -5,10 +5,13 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
8
9
|
var _react = _interopRequireDefault(require("react"));
|
|
9
10
|
var _badge = _interopRequireDefault(require("@atlaskit/badge"));
|
|
10
11
|
var _react2 = require("@emotion/react");
|
|
12
|
+
var _templateObject;
|
|
11
13
|
/** @jsx jsx */
|
|
14
|
+
var badgeStyles = (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n align-items: center;\n display: inline-flex;\n"])));
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* A base element that displays a visual indicator for a numeric value
|
|
@@ -26,7 +29,7 @@ var AtlaskitBadge = function AtlaskitBadge(_ref) {
|
|
|
26
29
|
return null;
|
|
27
30
|
}
|
|
28
31
|
return (0, _react2.jsx)("span", {
|
|
29
|
-
css: overrideCss,
|
|
32
|
+
css: [badgeStyles, overrideCss],
|
|
30
33
|
"data-fit-to-content": true,
|
|
31
34
|
"data-smart-element": name,
|
|
32
35
|
"data-smart-element-atlaskit-badge": true,
|
|
@@ -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,
|
|
@@ -8,11 +8,12 @@ exports.metadataBlockCss = exports.hiddenSnippetStyles = exports.footerBlockCss
|
|
|
8
8
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
9
9
|
var _react = require("@emotion/react");
|
|
10
10
|
var _styled = require("../../../styled");
|
|
11
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
11
12
|
var _templateObject, _templateObject2, _templateObject3;
|
|
12
13
|
var elementGap = '0.5rem';
|
|
13
|
-
var metadataBlockCss = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n gap: 0px;\n
|
|
14
|
+
var metadataBlockCss = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n gap: 0px;\n /* primary element group */\n [data-smart-element-group]:nth-of-type(1) {\n flex-grow: 7;\n\n // a separator between text-based element\n ", "\n\n /* horizontal spacing between elements in group */\n > span {\n margin-right: ", ";\n }\n }\n /* secondary element group */\n [data-smart-element-group]:nth-of-type(2) {\n flex-grow: 3;\n /* horizontal spacing between elements in group */\n > span {\n margin-left: ", ";\n }\n }\n ", "\n"])), _styled.separatorCss, elementGap, elementGap, (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? "[data-smart-element-group] {\n line-height: 1rem;\n }" : "");
|
|
14
15
|
exports.metadataBlockCss = metadataBlockCss;
|
|
15
|
-
var footerBlockCss = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n padding-top: 0.25rem
|
|
16
|
+
var footerBlockCss = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n"])), !(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? "padding-top: 0.25rem;" : "");
|
|
16
17
|
exports.footerBlockCss = footerBlockCss;
|
|
17
18
|
var hiddenSnippetStyles = (0, _react.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n visibility: hidden;\n position: absolute;\n"])));
|
|
18
19
|
exports.hiddenSnippetStyles = hiddenSnippetStyles;
|
|
@@ -37,7 +37,7 @@ var CARD_GAP_PX = 10;
|
|
|
37
37
|
exports.CARD_GAP_PX = CARD_GAP_PX;
|
|
38
38
|
var blockGap = '0.5rem';
|
|
39
39
|
var elementGap = '0.5rem';
|
|
40
|
-
var separatorCss = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n [data-separator] + [data-separator]:before {\n margin-right: ", ";\n }\n"])), elementGap);
|
|
40
|
+
var separatorCss = (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n [data-separator] + [data-separator]:before {\n margin-right: ", ";\n }\n ", "\n"])), elementGap, (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? " [data-smart-element-avatar-group] + [data-separator]:before {\n content: '\u2022';\n margin-right: ".concat(elementGap, ";\n }") : "");
|
|
41
41
|
exports.separatorCss = separatorCss;
|
|
42
42
|
var HoverCardContainer = (0, _react.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: ", "rem;\n padding: 1rem;\n\n .", " {\n display: none;\n }\n"])), CARD_WIDTH_REM, _index.loadingPlaceholderClassName);
|
|
43
43
|
exports.HoverCardContainer = HoverCardContainer;
|
|
@@ -93,7 +93,7 @@ var getSimulatedBetterMetadata = function getSimulatedBetterMetadata() {
|
|
|
93
93
|
var types = data ? (0, _linkExtractors.extractType)(data) : undefined;
|
|
94
94
|
var defaultMetadata = {
|
|
95
95
|
topMetadataBlock: {
|
|
96
|
-
primary: [_constants.ElementName.
|
|
96
|
+
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.ModifiedOn],
|
|
97
97
|
secondary: [],
|
|
98
98
|
subtitle: []
|
|
99
99
|
},
|
|
@@ -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.11",
|
|
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.11"
|
|
7
7
|
};
|
|
8
8
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
9
9
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -67,7 +67,8 @@ const FlexibleResolvedView = ({
|
|
|
67
67
|
overrideCss: metadataBlockCss
|
|
68
68
|
})), /*#__PURE__*/React.createElement(SnippetBlock, null), getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
69
69
|
primary: bottomMetadata,
|
|
70
|
-
maxLines: 1
|
|
70
|
+
maxLines: 1,
|
|
71
|
+
overrideCss: metadataBlockCss
|
|
71
72
|
}), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(PreviewBlock, {
|
|
72
73
|
placement: MediaPlacement.Right,
|
|
73
74
|
ignoreContainerPadding: true,
|
|
@@ -11,6 +11,9 @@ export const metadataBlockCss = css`
|
|
|
11
11
|
padding-left: 0px;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
+
[data-smart-element-group] {
|
|
15
|
+
line-height: 1rem;
|
|
16
|
+
}
|
|
14
17
|
`;
|
|
15
18
|
export const titleBlockCss = css`
|
|
16
19
|
${getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? `gap: 0.5em;` : ``}
|
|
@@ -1,7 +1,12 @@
|
|
|
1
1
|
/** @jsx jsx */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import AKBadge from '@atlaskit/badge';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
4
|
+
import { css, jsx } from '@emotion/react';
|
|
5
|
+
const badgeStyles = css`
|
|
6
|
+
align-items: center;
|
|
7
|
+
display: inline-flex;
|
|
8
|
+
`;
|
|
9
|
+
|
|
5
10
|
/**
|
|
6
11
|
* A base element that displays a visual indicator for a numeric value
|
|
7
12
|
* @internal
|
|
@@ -18,7 +23,7 @@ const AtlaskitBadge = ({
|
|
|
18
23
|
return null;
|
|
19
24
|
}
|
|
20
25
|
return jsx("span", {
|
|
21
|
-
css: overrideCss,
|
|
26
|
+
css: [badgeStyles, overrideCss],
|
|
22
27
|
"data-fit-to-content": true,
|
|
23
28
|
"data-smart-element": name,
|
|
24
29
|
"data-smart-element-atlaskit-badge": true,
|
|
@@ -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,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { css } from '@emotion/react';
|
|
2
2
|
import { separatorCss } from '../../../styled';
|
|
3
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
const elementGap = '0.5rem';
|
|
4
5
|
export const metadataBlockCss = css`
|
|
5
6
|
gap: 0px;
|
|
6
|
-
|
|
7
7
|
/* primary element group */
|
|
8
8
|
[data-smart-element-group]:nth-of-type(1) {
|
|
9
9
|
flex-grow: 7;
|
|
@@ -24,9 +24,12 @@ export const metadataBlockCss = css`
|
|
|
24
24
|
margin-left: ${elementGap};
|
|
25
25
|
}
|
|
26
26
|
}
|
|
27
|
+
${getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? `[data-smart-element-group] {
|
|
28
|
+
line-height: 1rem;
|
|
29
|
+
}` : ``}
|
|
27
30
|
`;
|
|
28
31
|
export const footerBlockCss = css`
|
|
29
|
-
padding-top: 0.25rem
|
|
32
|
+
${!getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? `padding-top: 0.25rem;` : ``}
|
|
30
33
|
`;
|
|
31
34
|
export const hiddenSnippetStyles = css`
|
|
32
35
|
visibility: hidden;
|
|
@@ -27,6 +27,10 @@ export const separatorCss = css`
|
|
|
27
27
|
[data-separator] + [data-separator]:before {
|
|
28
28
|
margin-right: ${elementGap};
|
|
29
29
|
}
|
|
30
|
+
${getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? ` [data-smart-element-avatar-group] + [data-separator]:before {
|
|
31
|
+
content: '•';
|
|
32
|
+
margin-right: ${elementGap};
|
|
33
|
+
}` : ``}
|
|
30
34
|
`;
|
|
31
35
|
export const HoverCardContainer = css`
|
|
32
36
|
background: none;
|
|
@@ -78,7 +78,7 @@ export const getSimulatedBetterMetadata = (extensionKey = '', data) => {
|
|
|
78
78
|
const types = data ? extractType(data) : undefined;
|
|
79
79
|
const defaultMetadata = {
|
|
80
80
|
topMetadataBlock: {
|
|
81
|
-
primary: [ElementName.
|
|
81
|
+
primary: [ElementName.AuthorGroup, ElementName.ModifiedOn],
|
|
82
82
|
secondary: [],
|
|
83
83
|
subtitle: []
|
|
84
84
|
},
|
|
@@ -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.11",
|
|
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.11"
|
|
17
17
|
};
|
|
18
18
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
19
19
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -74,7 +74,8 @@ var FlexibleResolvedView = function FlexibleResolvedView(_ref) {
|
|
|
74
74
|
overrideCss: metadataBlockCss
|
|
75
75
|
})), /*#__PURE__*/React.createElement(SnippetBlock, null), getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') && /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
76
76
|
primary: bottomMetadata,
|
|
77
|
-
maxLines: 1
|
|
77
|
+
maxLines: 1,
|
|
78
|
+
overrideCss: metadataBlockCss
|
|
78
79
|
}), !isPreviewBlockErrored ? /*#__PURE__*/React.createElement(PreviewBlock, {
|
|
79
80
|
placement: MediaPlacement.Right,
|
|
80
81
|
ignoreContainerPadding: true,
|
|
@@ -6,7 +6,7 @@ import { N40 } from '@atlaskit/theme/colors';
|
|
|
6
6
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
7
7
|
|
|
8
8
|
// in editor prosemirror adds padding-left so we need to overwrite it
|
|
9
|
-
export var metadataBlockCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* primary element group */\n span[data-smart-element-avatar-group] {\n > ul {\n padding-left: 0px;\n }\n }\n"])));
|
|
9
|
+
export var metadataBlockCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n /* primary element group */\n span[data-smart-element-avatar-group] {\n > ul {\n padding-left: 0px;\n }\n }\n [data-smart-element-group] {\n line-height: 1rem;\n }\n"])));
|
|
10
10
|
export var titleBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n ", "\n"])), getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? "gap: 0.5em;" : "", getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "[data-smart-element=\"Title\"] {\n font-weight: 600;\n }" : "");
|
|
11
11
|
var flexibleBlockCardElevationStyle = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n border-radius: 1.5px;\n box-shadow: ", ";\n margin: ", ";\n"])), tokens.elevation, "var(--ds-space-025, 2px)");
|
|
12
12
|
var refreshedFlexibleBlockCardStyle = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n & > div {\n border-radius: ", ";\n border: 1px solid ", ";\n }\n"])), "var(--ds-border-radius-300, 12px)", "var(--ds-border-input, ".concat(N40, ")"));
|
|
@@ -1,7 +1,11 @@
|
|
|
1
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
+
var _templateObject;
|
|
1
3
|
/** @jsx jsx */
|
|
2
4
|
import React from 'react';
|
|
3
5
|
import AKBadge from '@atlaskit/badge';
|
|
4
|
-
import { jsx } from '@emotion/react';
|
|
6
|
+
import { css, jsx } from '@emotion/react';
|
|
7
|
+
var badgeStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n display: inline-flex;\n"])));
|
|
8
|
+
|
|
5
9
|
/**
|
|
6
10
|
* A base element that displays a visual indicator for a numeric value
|
|
7
11
|
* @internal
|
|
@@ -18,7 +22,7 @@ var AtlaskitBadge = function AtlaskitBadge(_ref) {
|
|
|
18
22
|
return null;
|
|
19
23
|
}
|
|
20
24
|
return jsx("span", {
|
|
21
|
-
css: overrideCss,
|
|
25
|
+
css: [badgeStyles, overrideCss],
|
|
22
26
|
"data-fit-to-content": true,
|
|
23
27
|
"data-smart-element": name,
|
|
24
28
|
"data-smart-element-atlaskit-badge": true,
|
|
@@ -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,
|
|
@@ -2,7 +2,8 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
2
2
|
var _templateObject, _templateObject2, _templateObject3;
|
|
3
3
|
import { css } from '@emotion/react';
|
|
4
4
|
import { separatorCss } from '../../../styled';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
var elementGap = '0.5rem';
|
|
6
|
-
export var metadataBlockCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n gap: 0px;\n
|
|
7
|
-
export var footerBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n padding-top: 0.25rem
|
|
7
|
+
export var metadataBlockCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n gap: 0px;\n /* primary element group */\n [data-smart-element-group]:nth-of-type(1) {\n flex-grow: 7;\n\n // a separator between text-based element\n ", "\n\n /* horizontal spacing between elements in group */\n > span {\n margin-right: ", ";\n }\n }\n /* secondary element group */\n [data-smart-element-group]:nth-of-type(2) {\n flex-grow: 3;\n /* horizontal spacing between elements in group */\n > span {\n margin-left: ", ";\n }\n }\n ", "\n"])), separatorCss, elementGap, elementGap, getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? "[data-smart-element-group] {\n line-height: 1rem;\n }" : "");
|
|
8
|
+
export var footerBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", "\n"])), !getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? "padding-top: 0.25rem;" : "");
|
|
8
9
|
export var hiddenSnippetStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n visibility: hidden;\n position: absolute;\n"])));
|
|
@@ -27,7 +27,7 @@ export var CARD_WIDTH_REM = 24;
|
|
|
27
27
|
export var CARD_GAP_PX = 10;
|
|
28
28
|
var blockGap = '0.5rem';
|
|
29
29
|
var elementGap = '0.5rem';
|
|
30
|
-
export var separatorCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [data-separator] + [data-separator]:before {\n margin-right: ", ";\n }\n"])), elementGap);
|
|
30
|
+
export var separatorCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [data-separator] + [data-separator]:before {\n margin-right: ", ";\n }\n ", "\n"])), elementGap, getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? " [data-smart-element-avatar-group] + [data-separator]:before {\n content: '\u2022';\n margin-right: ".concat(elementGap, ";\n }") : "");
|
|
31
31
|
export var HoverCardContainer = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: ", "rem;\n padding: 1rem;\n\n .", " {\n display: none;\n }\n"])), CARD_WIDTH_REM, loadingPlaceholderClassName);
|
|
32
32
|
export var titleBlockCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n gap: ", ";\n\n ", "\n\n // title and subtitle element group\n [data-smart-element-group] {\n // gap between title and subtitle\n gap: 0.06rem;\n display: flex;\n /* subtitle element group */\n > [data-smart-element-group] {\n > span {\n margin-right: ", ";\n }\n }\n }\n\n ", "\n"])), blockGap, separatorCss, elementGap, getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "[data-smart-element=\"Title\"] {\n font-weight: 600;\n }" : "");
|
|
33
33
|
export var getTransitionStyles = function getTransitionStyles(snippetHeight) {
|
|
@@ -85,7 +85,7 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata() {
|
|
|
85
85
|
var types = data ? extractType(data) : undefined;
|
|
86
86
|
var defaultMetadata = {
|
|
87
87
|
topMetadataBlock: {
|
|
88
|
-
primary: [ElementName.
|
|
88
|
+
primary: [ElementName.AuthorGroup, ElementName.ModifiedOn],
|
|
89
89
|
secondary: [],
|
|
90
90
|
subtitle: []
|
|
91
91
|
},
|
|
@@ -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.11",
|
|
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;
|