@atlaskit/smart-card 19.1.25 → 19.1.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/HoverCard/components/hover-card-content.js +15 -5
- package/dist/cjs/view/HoverCard/styled.js +10 -4
- package/dist/cjs/view/HoverCard/utils.js +2 -2
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/HoverCard/components/hover-card-content.js +15 -6
- package/dist/es2019/view/HoverCard/styled.js +29 -2
- package/dist/es2019/view/HoverCard/utils.js +2 -2
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/HoverCard/components/hover-card-content.js +15 -6
- package/dist/esm/view/HoverCard/styled.js +5 -2
- package/dist/esm/view/HoverCard/utils.js +2 -2
- package/dist/types/view/HoverCard/styled.d.ts +3 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cjs/version.json
CHANGED
|
@@ -29,15 +29,18 @@ var _shortcut = _interopRequireDefault(require("@atlaskit/icon/glyph/shortcut"))
|
|
|
29
29
|
|
|
30
30
|
var _helpers = require("../../../state/helpers");
|
|
31
31
|
|
|
32
|
+
var _styled = require("../styled");
|
|
33
|
+
|
|
32
34
|
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); }
|
|
33
35
|
|
|
34
36
|
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; }
|
|
35
37
|
|
|
36
38
|
var flexibleUiOptions = {
|
|
37
39
|
hideElevation: true,
|
|
38
|
-
size: _constants.SmartLinkSize.
|
|
40
|
+
size: _constants.SmartLinkSize.Medium,
|
|
39
41
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
40
|
-
theme: _constants.SmartLinkTheme.Black
|
|
42
|
+
theme: _constants.SmartLinkTheme.Black,
|
|
43
|
+
hidePadding: true
|
|
41
44
|
};
|
|
42
45
|
|
|
43
46
|
var getOpenAction = function getOpenAction(url, analytics) {
|
|
@@ -112,13 +115,20 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
112
115
|
ui: flexibleUiOptions,
|
|
113
116
|
url: url
|
|
114
117
|
}, /*#__PURE__*/_react.default.createElement(_blocks.TitleBlock, {
|
|
115
|
-
actions: titleActions
|
|
118
|
+
actions: titleActions,
|
|
119
|
+
overrideCss: _styled.titleBlockCss,
|
|
120
|
+
size: _constants.SmartLinkSize.Large,
|
|
121
|
+
position: _constants.SmartLinkPosition.Center
|
|
116
122
|
}), /*#__PURE__*/_react.default.createElement(_blocks.MetadataBlock, {
|
|
117
123
|
primary: primary,
|
|
118
124
|
secondary: secondary,
|
|
119
|
-
size: _constants.SmartLinkSize.
|
|
125
|
+
size: _constants.SmartLinkSize.Large,
|
|
126
|
+
overrideCss: _styled.metadataBlockCss,
|
|
127
|
+
maxLines: 1
|
|
120
128
|
}), body, /*#__PURE__*/_react.default.createElement(_blocks.FooterBlock, {
|
|
121
|
-
actions: footerActions
|
|
129
|
+
actions: footerActions,
|
|
130
|
+
size: _constants.SmartLinkSize.Large,
|
|
131
|
+
overrideCss: _styled.footerBlockCss
|
|
122
132
|
}));
|
|
123
133
|
};
|
|
124
134
|
|
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.HoverCardContainer = void 0;
|
|
8
|
+
exports.titleBlockCss = exports.metadataBlockCss = exports.footerBlockCss = exports.HoverCardContainer = void 0;
|
|
9
9
|
|
|
10
10
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
11
11
|
|
|
@@ -13,7 +13,13 @@ var _core = require("@emotion/core");
|
|
|
13
13
|
|
|
14
14
|
var _index = require("../../index");
|
|
15
15
|
|
|
16
|
-
var _templateObject;
|
|
16
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
17
17
|
|
|
18
|
-
var HoverCardContainer = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: none;\n border-width: 0;\n
|
|
19
|
-
exports.HoverCardContainer = HoverCardContainer;
|
|
18
|
+
var HoverCardContainer = (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: 24rem;\n padding: 1rem;\n\n .", " {\n display: none;\n }\n"])), _index.loadingPlaceholderClassName);
|
|
19
|
+
exports.HoverCardContainer = HoverCardContainer;
|
|
20
|
+
var titleBlockCss = (0, _core.css)(_templateObject2 || (_templateObject2 = (0, _taggedTemplateLiteral2.default)(["\n gap: 0.5rem;\n"])));
|
|
21
|
+
exports.titleBlockCss = titleBlockCss;
|
|
22
|
+
var metadataBlockCss = (0, _core.css)(_templateObject3 || (_templateObject3 = (0, _taggedTemplateLiteral2.default)(["\n gap: 0px;\n\n /* primary element group */\n [data-smart-element-group]:first-of-type {\n flex-grow: 7;\n /* horizontal spacing between elements in group */\n > span {\n margin-right: 0.5rem;\n }\n }\n /* secondary element group */\n [data-smart-element-group]:last-of-type {\n flex-grow: 3;\n /* horizontal spacing between elements in group */\n > span {\n margin-left: 0.5rem;\n }\n }\n"])));
|
|
23
|
+
exports.metadataBlockCss = metadataBlockCss;
|
|
24
|
+
var footerBlockCss = (0, _core.css)(_templateObject4 || (_templateObject4 = (0, _taggedTemplateLiteral2.default)(["\n padding-top: 0.25rem;\n"])));
|
|
25
|
+
exports.footerBlockCss = footerBlockCss;
|
|
@@ -17,8 +17,8 @@ var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
17
17
|
case 'confluence-object-provider':
|
|
18
18
|
return {
|
|
19
19
|
metadata: {
|
|
20
|
-
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.CreatedBy
|
|
21
|
-
secondary: []
|
|
20
|
+
primary: [_constants.ElementName.AuthorGroup, _constants.ElementName.CreatedBy],
|
|
21
|
+
secondary: [_constants.ElementName.CommentCount, _constants.ElementName.ReactCount]
|
|
22
22
|
}
|
|
23
23
|
};
|
|
24
24
|
|
package/dist/es2019/version.json
CHANGED
|
@@ -2,17 +2,19 @@ import React, { useCallback, useEffect, useMemo } from 'react';
|
|
|
2
2
|
import { extractMetadata } from '../../../extractors/hover/extractMetadata';
|
|
3
3
|
import { getSimulatedMetadata, HOVER_CARD_ANALYTICS_DISPLAY } from '../utils';
|
|
4
4
|
import extractPreview from '../../../extractors/flexible/extract-preview';
|
|
5
|
-
import { ActionName, SmartLinkSize, SmartLinkTheme } from '../../../constants';
|
|
5
|
+
import { ActionName, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from '../../../constants';
|
|
6
6
|
import FlexibleCard from '../../FlexibleCard';
|
|
7
7
|
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
|
|
8
8
|
import { isSpecialEvent } from '../../../utils';
|
|
9
9
|
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
10
10
|
import { getExtensionKey } from '../../../state/helpers';
|
|
11
|
+
import { titleBlockCss, metadataBlockCss, footerBlockCss } from '../styled';
|
|
11
12
|
const flexibleUiOptions = {
|
|
12
13
|
hideElevation: true,
|
|
13
|
-
size: SmartLinkSize.
|
|
14
|
+
size: SmartLinkSize.Medium,
|
|
14
15
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
15
|
-
theme: SmartLinkTheme.Black
|
|
16
|
+
theme: SmartLinkTheme.Black,
|
|
17
|
+
hidePadding: true
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
const getOpenAction = (url, analytics) => ({
|
|
@@ -73,13 +75,20 @@ const HoverCardContent = ({
|
|
|
73
75
|
ui: flexibleUiOptions,
|
|
74
76
|
url: url
|
|
75
77
|
}, /*#__PURE__*/React.createElement(TitleBlock, {
|
|
76
|
-
actions: titleActions
|
|
78
|
+
actions: titleActions,
|
|
79
|
+
overrideCss: titleBlockCss,
|
|
80
|
+
size: SmartLinkSize.Large,
|
|
81
|
+
position: SmartLinkPosition.Center
|
|
77
82
|
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
78
83
|
primary: primary,
|
|
79
84
|
secondary: secondary,
|
|
80
|
-
size: SmartLinkSize.
|
|
85
|
+
size: SmartLinkSize.Large,
|
|
86
|
+
overrideCss: metadataBlockCss,
|
|
87
|
+
maxLines: 1
|
|
81
88
|
}), body, /*#__PURE__*/React.createElement(FooterBlock, {
|
|
82
|
-
actions: footerActions
|
|
89
|
+
actions: footerActions,
|
|
90
|
+
size: SmartLinkSize.Large,
|
|
91
|
+
overrideCss: footerBlockCss
|
|
83
92
|
}));
|
|
84
93
|
};
|
|
85
94
|
|
|
@@ -3,10 +3,37 @@ import { loadingPlaceholderClassName } from '../../index';
|
|
|
3
3
|
export const HoverCardContainer = css`
|
|
4
4
|
background: none;
|
|
5
5
|
border-width: 0;
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
box-sizing: border-box;
|
|
7
|
+
width: 24rem;
|
|
8
|
+
padding: 1rem;
|
|
8
9
|
|
|
9
10
|
.${loadingPlaceholderClassName} {
|
|
10
11
|
display: none;
|
|
11
12
|
}
|
|
13
|
+
`;
|
|
14
|
+
export const titleBlockCss = css`
|
|
15
|
+
gap: 0.5rem;
|
|
16
|
+
`;
|
|
17
|
+
export const metadataBlockCss = css`
|
|
18
|
+
gap: 0px;
|
|
19
|
+
|
|
20
|
+
/* primary element group */
|
|
21
|
+
[data-smart-element-group]:first-of-type {
|
|
22
|
+
flex-grow: 7;
|
|
23
|
+
/* horizontal spacing between elements in group */
|
|
24
|
+
> span {
|
|
25
|
+
margin-right: 0.5rem;
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
/* secondary element group */
|
|
29
|
+
[data-smart-element-group]:last-of-type {
|
|
30
|
+
flex-grow: 3;
|
|
31
|
+
/* horizontal spacing between elements in group */
|
|
32
|
+
> span {
|
|
33
|
+
margin-left: 0.5rem;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
`;
|
|
37
|
+
export const footerBlockCss = css`
|
|
38
|
+
padding-top: 0.25rem;
|
|
12
39
|
`;
|
|
@@ -5,8 +5,8 @@ export const getSimulatedMetadata = (extensionKey = '') => {
|
|
|
5
5
|
case 'confluence-object-provider':
|
|
6
6
|
return {
|
|
7
7
|
metadata: {
|
|
8
|
-
primary: [ElementName.AuthorGroup, ElementName.CreatedBy
|
|
9
|
-
secondary: []
|
|
8
|
+
primary: [ElementName.AuthorGroup, ElementName.CreatedBy],
|
|
9
|
+
secondary: [ElementName.CommentCount, ElementName.ReactCount]
|
|
10
10
|
}
|
|
11
11
|
};
|
|
12
12
|
|
package/dist/esm/version.json
CHANGED
|
@@ -2,17 +2,19 @@ import React, { useCallback, useEffect, useMemo } from 'react';
|
|
|
2
2
|
import { extractMetadata } from '../../../extractors/hover/extractMetadata';
|
|
3
3
|
import { getSimulatedMetadata, HOVER_CARD_ANALYTICS_DISPLAY } from '../utils';
|
|
4
4
|
import extractPreview from '../../../extractors/flexible/extract-preview';
|
|
5
|
-
import { ActionName, SmartLinkSize, SmartLinkTheme } from '../../../constants';
|
|
5
|
+
import { ActionName, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from '../../../constants';
|
|
6
6
|
import FlexibleCard from '../../FlexibleCard';
|
|
7
7
|
import { FooterBlock, MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from '../../FlexibleCard/components/blocks';
|
|
8
8
|
import { isSpecialEvent } from '../../../utils';
|
|
9
9
|
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
10
10
|
import { getExtensionKey } from '../../../state/helpers';
|
|
11
|
+
import { titleBlockCss, metadataBlockCss, footerBlockCss } from '../styled';
|
|
11
12
|
var flexibleUiOptions = {
|
|
12
13
|
hideElevation: true,
|
|
13
|
-
size: SmartLinkSize.
|
|
14
|
+
size: SmartLinkSize.Medium,
|
|
14
15
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
15
|
-
theme: SmartLinkTheme.Black
|
|
16
|
+
theme: SmartLinkTheme.Black,
|
|
17
|
+
hidePadding: true
|
|
16
18
|
};
|
|
17
19
|
|
|
18
20
|
var getOpenAction = function getOpenAction(url, analytics) {
|
|
@@ -87,13 +89,20 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
87
89
|
ui: flexibleUiOptions,
|
|
88
90
|
url: url
|
|
89
91
|
}, /*#__PURE__*/React.createElement(TitleBlock, {
|
|
90
|
-
actions: titleActions
|
|
92
|
+
actions: titleActions,
|
|
93
|
+
overrideCss: titleBlockCss,
|
|
94
|
+
size: SmartLinkSize.Large,
|
|
95
|
+
position: SmartLinkPosition.Center
|
|
91
96
|
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
92
97
|
primary: primary,
|
|
93
98
|
secondary: secondary,
|
|
94
|
-
size: SmartLinkSize.
|
|
99
|
+
size: SmartLinkSize.Large,
|
|
100
|
+
overrideCss: metadataBlockCss,
|
|
101
|
+
maxLines: 1
|
|
95
102
|
}), body, /*#__PURE__*/React.createElement(FooterBlock, {
|
|
96
|
-
actions: footerActions
|
|
103
|
+
actions: footerActions,
|
|
104
|
+
size: SmartLinkSize.Large,
|
|
105
|
+
overrideCss: footerBlockCss
|
|
97
106
|
}));
|
|
98
107
|
};
|
|
99
108
|
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/core';
|
|
6
6
|
import { loadingPlaceholderClassName } from '../../index';
|
|
7
|
-
export var HoverCardContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n
|
|
7
|
+
export var HoverCardContainer = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n background: none;\n border-width: 0;\n box-sizing: border-box;\n width: 24rem;\n padding: 1rem;\n\n .", " {\n display: none;\n }\n"])), loadingPlaceholderClassName);
|
|
8
|
+
export var titleBlockCss = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n gap: 0.5rem;\n"])));
|
|
9
|
+
export var metadataBlockCss = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n gap: 0px;\n\n /* primary element group */\n [data-smart-element-group]:first-of-type {\n flex-grow: 7;\n /* horizontal spacing between elements in group */\n > span {\n margin-right: 0.5rem;\n }\n }\n /* secondary element group */\n [data-smart-element-group]:last-of-type {\n flex-grow: 3;\n /* horizontal spacing between elements in group */\n > span {\n margin-left: 0.5rem;\n }\n }\n"])));
|
|
10
|
+
export var footerBlockCss = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n padding-top: 0.25rem;\n"])));
|
|
@@ -7,8 +7,8 @@ export var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
7
7
|
case 'confluence-object-provider':
|
|
8
8
|
return {
|
|
9
9
|
metadata: {
|
|
10
|
-
primary: [ElementName.AuthorGroup, ElementName.CreatedBy
|
|
11
|
-
secondary: []
|
|
10
|
+
primary: [ElementName.AuthorGroup, ElementName.CreatedBy],
|
|
11
|
+
secondary: [ElementName.CommentCount, ElementName.ReactCount]
|
|
12
12
|
}
|
|
13
13
|
};
|
|
14
14
|
|
|
@@ -1 +1,4 @@
|
|
|
1
1
|
export declare const HoverCardContainer: import("@emotion/utils").SerializedStyles;
|
|
2
|
+
export declare const titleBlockCss: import("@emotion/utils").SerializedStyles;
|
|
3
|
+
export declare const metadataBlockCss: import("@emotion/utils").SerializedStyles;
|
|
4
|
+
export declare const footerBlockCss: import("@emotion/utils").SerializedStyles;
|