@atlaskit/smart-card 19.1.28 → 19.1.31
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/constants.js +4 -1
- package/dist/cjs/extractors/common/icon/extractIcon.js +7 -0
- package/dist/cjs/extractors/common/icon/priority.js +1 -0
- package/dist/cjs/extractors/common/lozenge/extractLozenge.js +7 -1
- package/dist/cjs/extractors/common/lozenge/extractState.js +2 -2
- package/dist/cjs/extractors/flexible/icon/extract-jsonld-data-icon.js +6 -0
- package/dist/cjs/extractors/flexible/index.js +5 -2
- package/dist/cjs/extractors/flexible/utils.js +30 -2
- package/dist/cjs/extractors/hover/extractMetadata.js +3 -2
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +25 -4
- package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/index.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +2 -0
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +42 -12
- package/dist/cjs/view/HoverCard/components/hover-card-content.js +12 -5
- package/dist/cjs/view/HoverCard/index.js +1 -1
- package/dist/cjs/view/HoverCard/styled.js +8 -5
- package/dist/cjs/view/HoverCard/utils.js +46 -3
- package/dist/es2019/constants.js +4 -1
- package/dist/es2019/extractors/common/icon/extractIcon.js +6 -0
- package/dist/es2019/extractors/common/icon/priority.js +1 -0
- package/dist/es2019/extractors/common/lozenge/extractLozenge.js +4 -0
- package/dist/es2019/extractors/common/lozenge/extractState.js +2 -2
- package/dist/es2019/extractors/flexible/icon/extract-jsonld-data-icon.js +6 -0
- package/dist/es2019/extractors/flexible/index.js +6 -3
- package/dist/es2019/extractors/flexible/utils.js +10 -1
- package/dist/es2019/extractors/hover/extractMetadata.js +3 -2
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +11 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +6 -3
- package/dist/es2019/view/FlexibleCard/components/elements/avatar-group/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/elements/icon/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +18 -0
- package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/elements/lozenge/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +2 -0
- package/dist/es2019/view/FlexibleCard/components/elements/utils.js +48 -16
- package/dist/es2019/view/HoverCard/components/hover-card-content.js +11 -5
- package/dist/es2019/view/HoverCard/index.js +1 -1
- package/dist/es2019/view/HoverCard/styled.js +31 -5
- package/dist/es2019/view/HoverCard/utils.js +46 -4
- package/dist/esm/constants.js +4 -1
- package/dist/esm/extractors/common/icon/extractIcon.js +6 -0
- package/dist/esm/extractors/common/icon/priority.js +1 -0
- package/dist/esm/extractors/common/lozenge/extractLozenge.js +7 -1
- package/dist/esm/extractors/common/lozenge/extractState.js +2 -2
- package/dist/esm/extractors/flexible/icon/extract-jsonld-data-icon.js +6 -0
- package/dist/esm/extractors/flexible/index.js +6 -3
- package/dist/esm/extractors/flexible/utils.js +16 -0
- package/dist/esm/extractors/hover/extractMetadata.js +3 -2
- package/dist/esm/state/actions/index.js +1 -1
- package/dist/esm/state/hooks/usePrefetch.js +1 -1
- package/dist/esm/utils/mocks.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/BlockCard/actions/DownloadAction.js +1 -1
- package/dist/esm/view/BlockCard/actions/PreviewAction.js +1 -1
- package/dist/esm/view/BlockCard/actions/RetryAction.js +1 -1
- package/dist/esm/view/BlockCard/actions/ViewAction.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/avatar-group/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/elements/icon/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/elements/index.js +18 -0
- package/dist/esm/view/FlexibleCard/components/elements/link/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/elements/lozenge/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/elements/media/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +2 -0
- package/dist/esm/view/FlexibleCard/components/elements/utils.js +41 -12
- package/dist/esm/view/HoverCard/components/hover-card-content.js +11 -5
- package/dist/esm/view/HoverCard/index.js +1 -1
- package/dist/esm/view/HoverCard/styled.js +8 -5
- package/dist/esm/view/HoverCard/utils.js +46 -3
- package/dist/types/constants.d.ts +4 -1
- package/dist/types/extractors/common/__mocks__/jsonld.d.ts +11 -6
- package/dist/types/extractors/common/lozenge/extractState.d.ts +1 -1
- package/dist/types/extractors/flexible/utils.d.ts +3 -0
- package/dist/types/state/flexible-ui-context/types.d.ts +29 -10
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +22 -1
- package/dist/types/view/FlexibleCard/components/elements/index.d.ts +15 -0
- package/dist/types/view/FlexibleCard/components/elements/lozenge/types.d.ts +2 -1
- package/dist/types/view/FlexibleCard/components/elements/types.d.ts +7 -1
- package/dist/types/view/HoverCard/types.d.ts +1 -0
- package/dist/types/view/HoverCard/utils.d.ts +1 -1
- package/package.json +2 -2
- package/report.api.md +6 -0
|
@@ -26,7 +26,8 @@ var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["
|
|
|
26
26
|
*/
|
|
27
27
|
|
|
28
28
|
var Media = function Media(_ref) {
|
|
29
|
-
var
|
|
29
|
+
var name = _ref.name,
|
|
30
|
+
overrideCss = _ref.overrideCss,
|
|
30
31
|
_ref$testId = _ref.testId,
|
|
31
32
|
testId = _ref$testId === void 0 ? 'smart-element-media' : _ref$testId,
|
|
32
33
|
type = _ref.type,
|
|
@@ -38,6 +39,7 @@ var Media = function Media(_ref) {
|
|
|
38
39
|
|
|
39
40
|
return jsx("div", {
|
|
40
41
|
css: [styles, overrideCss],
|
|
42
|
+
"data-smart-element": name,
|
|
41
43
|
"data-smart-element-media": true,
|
|
42
44
|
"data-testid": testId
|
|
43
45
|
}, jsx(ImageIcon, {
|
|
@@ -24,6 +24,7 @@ var Text = function Text(_ref) {
|
|
|
24
24
|
_ref$maxLines = _ref.maxLines,
|
|
25
25
|
maxLines = _ref$maxLines === void 0 ? 1 : _ref$maxLines,
|
|
26
26
|
message = _ref.message,
|
|
27
|
+
name = _ref.name,
|
|
27
28
|
overrideCss = _ref.overrideCss,
|
|
28
29
|
_ref$testId = _ref.testId,
|
|
29
30
|
testId = _ref$testId === void 0 ? 'smart-element-text' : _ref$testId;
|
|
@@ -35,6 +36,7 @@ var Text = function Text(_ref) {
|
|
|
35
36
|
return jsx("span", {
|
|
36
37
|
css: [getStyles(maxLines), overrideCss],
|
|
37
38
|
"data-separator": true,
|
|
39
|
+
"data-smart-element": name,
|
|
38
40
|
"data-smart-element-text": true,
|
|
39
41
|
"data-testid": testId
|
|
40
42
|
}, getFormattedMessage(message) || content);
|
|
@@ -5,6 +5,7 @@ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral
|
|
|
5
5
|
var _templateObject, _elementMappings;
|
|
6
6
|
|
|
7
7
|
import React, { useContext } from 'react';
|
|
8
|
+
import { FormattedDate } from 'react-intl-next';
|
|
8
9
|
import { css } from '@emotion/core';
|
|
9
10
|
import { ElementName, IconType } from '../../../../constants';
|
|
10
11
|
import Icon from './icon';
|
|
@@ -45,10 +46,21 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
|
|
|
45
46
|
}
|
|
46
47
|
}), _defineProperty(_elementMappings, ElementName.CreatedBy, {
|
|
47
48
|
component: Text
|
|
49
|
+
}), _defineProperty(_elementMappings, ElementName.CreatedOn, {
|
|
50
|
+
component: DateTime
|
|
51
|
+
}), _defineProperty(_elementMappings, ElementName.DueOn, {
|
|
52
|
+
component: Lozenge
|
|
53
|
+
}), _defineProperty(_elementMappings, ElementName.LatestCommit, {
|
|
54
|
+
component: Badge,
|
|
55
|
+
props: {
|
|
56
|
+
icon: IconType.Commit
|
|
57
|
+
}
|
|
48
58
|
}), _defineProperty(_elementMappings, ElementName.LinkIcon, {
|
|
49
59
|
component: Icon
|
|
50
60
|
}), _defineProperty(_elementMappings, ElementName.ModifiedBy, {
|
|
51
61
|
component: Text
|
|
62
|
+
}), _defineProperty(_elementMappings, ElementName.ModifiedOn, {
|
|
63
|
+
component: DateTime
|
|
52
64
|
}), _defineProperty(_elementMappings, ElementName.Preview, {
|
|
53
65
|
component: Media
|
|
54
66
|
}), _defineProperty(_elementMappings, ElementName.Priority, {
|
|
@@ -58,12 +70,16 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
|
|
|
58
70
|
props: {
|
|
59
71
|
icon: IconType.ProgrammingLanguage
|
|
60
72
|
}
|
|
73
|
+
}), _defineProperty(_elementMappings, ElementName.Provider, {
|
|
74
|
+
component: Badge
|
|
61
75
|
}), _defineProperty(_elementMappings, ElementName.Snippet, {
|
|
62
76
|
component: Text,
|
|
63
77
|
props: {
|
|
64
78
|
maxLines: SNIPPET_DEFAULT_MAX_LINES,
|
|
65
79
|
overrideCss: css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n "])), tokens.snippet)
|
|
66
80
|
}
|
|
81
|
+
}), _defineProperty(_elementMappings, ElementName.SourceBranch, {
|
|
82
|
+
component: Text
|
|
67
83
|
}), _defineProperty(_elementMappings, ElementName.State, {
|
|
68
84
|
component: Lozenge
|
|
69
85
|
}), _defineProperty(_elementMappings, ElementName.SubscriberCount, {
|
|
@@ -71,19 +87,10 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
|
|
|
71
87
|
props: {
|
|
72
88
|
icon: IconType.Subscriber
|
|
73
89
|
}
|
|
90
|
+
}), _defineProperty(_elementMappings, ElementName.TargetBranch, {
|
|
91
|
+
component: Text
|
|
74
92
|
}), _defineProperty(_elementMappings, ElementName.Title, {
|
|
75
93
|
component: Link
|
|
76
|
-
}), _defineProperty(_elementMappings, ElementName.CreatedOn, {
|
|
77
|
-
component: DateTime
|
|
78
|
-
}), _defineProperty(_elementMappings, ElementName.ModifiedOn, {
|
|
79
|
-
component: DateTime
|
|
80
|
-
}), _defineProperty(_elementMappings, ElementName.Provider, {
|
|
81
|
-
component: Badge
|
|
82
|
-
}), _defineProperty(_elementMappings, ElementName.LatestCommit, {
|
|
83
|
-
component: Badge,
|
|
84
|
-
props: {
|
|
85
|
-
icon: IconType.Commit
|
|
86
|
-
}
|
|
87
94
|
}), _elementMappings);
|
|
88
95
|
|
|
89
96
|
var getContextKey = function getContextKey(name) {
|
|
@@ -119,6 +126,9 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
119
126
|
case ElementName.CreatedOn:
|
|
120
127
|
return toDateTimeProps('created', context.createdOn);
|
|
121
128
|
|
|
129
|
+
case ElementName.DueOn:
|
|
130
|
+
return toDateLozengeProps(context.dueOn);
|
|
131
|
+
|
|
122
132
|
case ElementName.ModifiedBy:
|
|
123
133
|
return toFormattedTextProps(messages.modified_by, context.modifiedBy);
|
|
124
134
|
|
|
@@ -126,6 +136,8 @@ var getData = function getData(elementName, contextKey, context) {
|
|
|
126
136
|
return toDateTimeProps('modified', context.modifiedOn);
|
|
127
137
|
|
|
128
138
|
case ElementName.Snippet:
|
|
139
|
+
case ElementName.SourceBranch:
|
|
140
|
+
case ElementName.TargetBranch:
|
|
129
141
|
return toTextProps(data);
|
|
130
142
|
|
|
131
143
|
case ElementName.Title:
|
|
@@ -148,6 +160,21 @@ var toBadgeProps = function toBadgeProps(label) {
|
|
|
148
160
|
} : undefined;
|
|
149
161
|
};
|
|
150
162
|
|
|
163
|
+
var toDateLozengeProps = function toDateLozengeProps(dateString) {
|
|
164
|
+
if (dateString) {
|
|
165
|
+
var text = Date.parse(dateString) ? /*#__PURE__*/React.createElement(FormattedDate, {
|
|
166
|
+
value: new Date(dateString),
|
|
167
|
+
year: "numeric",
|
|
168
|
+
month: "short",
|
|
169
|
+
day: "numeric",
|
|
170
|
+
formatMatcher: "best fit"
|
|
171
|
+
}) : dateString;
|
|
172
|
+
return {
|
|
173
|
+
text: text
|
|
174
|
+
};
|
|
175
|
+
}
|
|
176
|
+
};
|
|
177
|
+
|
|
151
178
|
var toDateTimeProps = function toDateTimeProps(type, dateString) {
|
|
152
179
|
return dateString ? {
|
|
153
180
|
date: new Date(dateString),
|
|
@@ -193,6 +220,8 @@ export var createElement = function createElement(name) {
|
|
|
193
220
|
return function (overrides) {
|
|
194
221
|
var context = useContext(FlexibleUiContext);
|
|
195
222
|
var data = getData(name, contextKey, context);
|
|
196
|
-
return data ? /*#__PURE__*/React.createElement(BaseElement, _extends({}, props, data, overrides
|
|
223
|
+
return data ? /*#__PURE__*/React.createElement(BaseElement, _extends({}, props, data, overrides, {
|
|
224
|
+
name: name
|
|
225
|
+
})) : null;
|
|
197
226
|
};
|
|
198
227
|
};
|
|
@@ -9,6 +9,7 @@ import { isSpecialEvent } from '../../../utils';
|
|
|
9
9
|
import ShortcutIcon from '@atlaskit/icon/glyph/shortcut';
|
|
10
10
|
import { getExtensionKey } from '../../../state/helpers';
|
|
11
11
|
import { titleBlockCss, metadataBlockCss, footerBlockCss } from '../styled';
|
|
12
|
+
import { extractType } from '../../../extractors/common/primitives/extractType';
|
|
12
13
|
var flexibleUiOptions = {
|
|
13
14
|
hideElevation: true,
|
|
14
15
|
size: SmartLinkSize.Medium,
|
|
@@ -73,13 +74,16 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
73
74
|
}, [url, analytics]);
|
|
74
75
|
var footerActions = useMemo(function () {
|
|
75
76
|
return toFooterActions(cardActions);
|
|
76
|
-
}, [cardActions]);
|
|
77
|
+
}, [cardActions]);
|
|
78
|
+
var data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
79
|
+
var types = data ? extractType(data) : undefined; //TODO: EDM-3224 deleted simulated and use real JsonLd
|
|
77
80
|
|
|
78
|
-
var _extractMetadata = extractMetadata(getSimulatedMetadata(extensionKey)),
|
|
81
|
+
var _extractMetadata = extractMetadata(getSimulatedMetadata(extensionKey, types)),
|
|
79
82
|
primary = _extractMetadata.primary,
|
|
80
|
-
secondary = _extractMetadata.secondary
|
|
83
|
+
secondary = _extractMetadata.secondary,
|
|
84
|
+
subtitle = _extractMetadata.subtitle;
|
|
81
85
|
|
|
82
|
-
var
|
|
86
|
+
var titleMaxLines = subtitle && subtitle.length > 0 ? 1 : 2;
|
|
83
87
|
var body = data && extractPreview(data) ? /*#__PURE__*/React.createElement(PreviewBlock, null) : /*#__PURE__*/React.createElement(SnippetBlock, null);
|
|
84
88
|
return /*#__PURE__*/React.createElement(FlexibleCard, {
|
|
85
89
|
cardState: cardState,
|
|
@@ -90,9 +94,11 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
90
94
|
url: url
|
|
91
95
|
}, /*#__PURE__*/React.createElement(TitleBlock, {
|
|
92
96
|
actions: titleActions,
|
|
97
|
+
maxLines: titleMaxLines,
|
|
93
98
|
overrideCss: titleBlockCss,
|
|
94
99
|
size: SmartLinkSize.Large,
|
|
95
|
-
position: SmartLinkPosition.Center
|
|
100
|
+
position: SmartLinkPosition.Center,
|
|
101
|
+
subtitle: subtitle
|
|
96
102
|
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
97
103
|
primary: primary,
|
|
98
104
|
secondary: secondary,
|
|
@@ -99,7 +99,7 @@ export var HoverCardComponent = function HoverCardComponent(_ref) {
|
|
|
99
99
|
onMouseLeave: initHideCard
|
|
100
100
|
}), children);
|
|
101
101
|
},
|
|
102
|
-
zIndex:
|
|
102
|
+
zIndex: 511 // Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
|
|
103
103
|
|
|
104
104
|
});
|
|
105
105
|
};
|
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
2
|
|
|
3
|
-
var _templateObject, _templateObject2, _templateObject3, _templateObject4;
|
|
3
|
+
var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5;
|
|
4
4
|
|
|
5
5
|
import { css } from '@emotion/core';
|
|
6
6
|
import { loadingPlaceholderClassName } from '../../index';
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
export var
|
|
7
|
+
var blockGap = '0.5rem';
|
|
8
|
+
var elementGap = '0.5rem';
|
|
9
|
+
var separatorCss = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n [data-separator] + [data-separator]:before {\n margin-right: ", ";\n }\n"])), elementGap);
|
|
10
|
+
export var HoverCardContainer = css(_templateObject2 || (_templateObject2 = _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);
|
|
11
|
+
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\n /* subtitle element group */\n > [data-smart-element-group] {\n > span {\n margin-right: ", ";\n }\n }\n }\n"])), blockGap, separatorCss, elementGap);
|
|
12
|
+
export var metadataBlockCss = css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n gap: 0px;\n\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"])), separatorCss, elementGap, elementGap);
|
|
13
|
+
export var footerBlockCss = css(_templateObject5 || (_templateObject5 = _taggedTemplateLiteral(["\n padding-top: 0.25rem;\n"])));
|
|
@@ -2,13 +2,35 @@ import { ElementName } from '../../constants';
|
|
|
2
2
|
export var HOVER_CARD_ANALYTICS_DISPLAY = 'flexible';
|
|
3
3
|
export var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
4
4
|
var extensionKey = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
5
|
+
var types = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
5
6
|
|
|
6
7
|
switch (extensionKey) {
|
|
8
|
+
case 'bitbucket-object-provider':
|
|
9
|
+
case 'native-bitbucket-object-provider':
|
|
10
|
+
if (types.includes('atlassian:SourceCodePullRequest')) {
|
|
11
|
+
return {
|
|
12
|
+
metadata: {
|
|
13
|
+
primary: [ElementName.AuthorGroup, ElementName.ModifiedOn, ElementName.SubscriberCount, ElementName.State],
|
|
14
|
+
secondary: [],
|
|
15
|
+
subtitle: [ElementName.SourceBranch, ElementName.TargetBranch]
|
|
16
|
+
}
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return {
|
|
21
|
+
metadata: {
|
|
22
|
+
primary: [ElementName.ModifiedOn, ElementName.CreatedBy],
|
|
23
|
+
secondary: [],
|
|
24
|
+
subtitle: []
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
|
|
7
28
|
case 'confluence-object-provider':
|
|
8
29
|
return {
|
|
9
30
|
metadata: {
|
|
10
31
|
primary: [ElementName.AuthorGroup, ElementName.CreatedBy],
|
|
11
|
-
secondary: [ElementName.CommentCount, ElementName.ReactCount]
|
|
32
|
+
secondary: [ElementName.CommentCount, ElementName.ReactCount],
|
|
33
|
+
subtitle: []
|
|
12
34
|
}
|
|
13
35
|
};
|
|
14
36
|
|
|
@@ -16,7 +38,27 @@ export var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
16
38
|
return {
|
|
17
39
|
metadata: {
|
|
18
40
|
primary: [ElementName.AuthorGroup, ElementName.State, ElementName.Priority],
|
|
19
|
-
secondary: []
|
|
41
|
+
secondary: [],
|
|
42
|
+
subtitle: []
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
case 'watermelon-object-provider':
|
|
47
|
+
if (types.includes('atlassian:Project')) {
|
|
48
|
+
return {
|
|
49
|
+
metadata: {
|
|
50
|
+
primary: [ElementName.AuthorGroup, ElementName.ModifiedOn, ElementName.State, ElementName.DueOn],
|
|
51
|
+
secondary: [],
|
|
52
|
+
subtitle: []
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
return {
|
|
58
|
+
metadata: {
|
|
59
|
+
primary: [ElementName.AuthorGroup, ElementName.State, ElementName.DueOn],
|
|
60
|
+
secondary: [],
|
|
61
|
+
subtitle: []
|
|
20
62
|
}
|
|
21
63
|
};
|
|
22
64
|
|
|
@@ -24,7 +66,8 @@ export var getSimulatedMetadata = function getSimulatedMetadata() {
|
|
|
24
66
|
return {
|
|
25
67
|
metadata: {
|
|
26
68
|
primary: [ElementName.ModifiedOn, ElementName.CreatedBy],
|
|
27
|
-
secondary: []
|
|
69
|
+
secondary: [],
|
|
70
|
+
subtitle: []
|
|
28
71
|
}
|
|
29
72
|
};
|
|
30
73
|
}
|
|
@@ -68,7 +68,7 @@ export declare enum SmartLinkWidth {
|
|
|
68
68
|
* When adding an element...
|
|
69
69
|
* 1) Create base element if it doesn't already exist.
|
|
70
70
|
* Base element are inside src/view/FlexibleCard/components/elements.
|
|
71
|
-
* E.g. Badge,DateTime, Icon, Lozenge, etc.
|
|
71
|
+
* E.g. Badge, DateTime, Icon, Lozenge, etc.
|
|
72
72
|
* 2) Update FlexibleUiContext with the new prop for data representing
|
|
73
73
|
* the element, preferably with the same name as the element itself.
|
|
74
74
|
* (src/state/flexible-ui-context/types.ts)
|
|
@@ -85,6 +85,7 @@ export declare enum ElementName {
|
|
|
85
85
|
CommentCount = "CommentCount",
|
|
86
86
|
CreatedBy = "CreatedBy",
|
|
87
87
|
CreatedOn = "CreatedOn",
|
|
88
|
+
DueOn = "DueOn",
|
|
88
89
|
LinkIcon = "LinkIcon",
|
|
89
90
|
ModifiedBy = "ModifiedBy",
|
|
90
91
|
ModifiedOn = "ModifiedOn",
|
|
@@ -94,8 +95,10 @@ export declare enum ElementName {
|
|
|
94
95
|
Provider = "Provider",
|
|
95
96
|
ReactCount = "ReactCount",
|
|
96
97
|
Snippet = "Snippet",
|
|
98
|
+
SourceBranch = "SourceBranch",
|
|
97
99
|
State = "State",
|
|
98
100
|
SubscriberCount = "SubscriberCount",
|
|
101
|
+
TargetBranch = "TargetBranch",
|
|
99
102
|
Title = "Title",
|
|
100
103
|
ViewCount = "ViewCount",
|
|
101
104
|
VoteCount = "VoteCount",
|
|
@@ -17,6 +17,7 @@ export declare const TEST_BASE_DATA: JsonLd.Data.BaseData;
|
|
|
17
17
|
export declare const TEST_DATA_WITH_EMOJI: JsonLd.Data.BaseData;
|
|
18
18
|
export declare const TEST_DATA_WITH_NO_PREFIX: JsonLd.Data.BaseData;
|
|
19
19
|
export declare const TEST_PROJECT: JsonLd.Data.Project;
|
|
20
|
+
export declare const TEST_PULL_REQUEST: JsonLd.Data.SourceCodePullRequest;
|
|
20
21
|
export declare const TEST_TASK: JsonLd.Data.Task;
|
|
21
22
|
export declare const TEST_META_DATA: JsonLd.Meta.BaseMeta;
|
|
22
23
|
export declare const TEST_DOCUMENT: JsonLd.Data.Document;
|
|
@@ -30,19 +31,19 @@ export declare const TEST_DOCUMENT_WITH_ACTIONS: {
|
|
|
30
31
|
'@type': "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink" | ("Object" | "Document")[] | (JsonLd.Data.DocumentChildType | JsonLd.Data.DocumentParentType)[] | ("Document" | "schema:DigitalDocument")[];
|
|
31
32
|
'schema:fileFormat'?: string | undefined;
|
|
32
33
|
'atlassian:fileSize'?: number | undefined;
|
|
33
|
-
'schema:dateCreated'?: string | undefined;
|
|
34
|
-
'atlassian:updatedBy'?: JsonLd.Primitives.Link | JsonLd.Primitives.Person<any> | undefined;
|
|
35
34
|
'schema:commentCount'?: number | undefined;
|
|
36
35
|
'atlassian:isDeleted'?: boolean | undefined;
|
|
37
36
|
'atlassian:dateViewed'?: string | undefined;
|
|
38
37
|
'atlassian:reactCount'?: number | undefined;
|
|
39
|
-
'atlassian:state'?: string | undefined;
|
|
38
|
+
'atlassian:state'?: string | JsonLd.Primitives.Object<any> | undefined;
|
|
40
39
|
'atlassian:viewCount'?: number | undefined;
|
|
41
40
|
'atlassian:voteCount'?: number | undefined;
|
|
42
41
|
'@context': JsonLd.Primitives.Context;
|
|
43
42
|
'atlassian:downloadUrl'?: string | undefined;
|
|
44
43
|
'atlassian:visitUrl'?: string | undefined;
|
|
45
44
|
'atlassian:titlePrefix'?: JsonLd.Data.TitlePrefix | undefined;
|
|
45
|
+
'atlassian:updatedBy'?: JsonLd.Primitives.Link | JsonLd.Primitives.Person<any> | JsonLd.Primitives.Collection<JsonLd.Primitives.Link | JsonLd.Primitives.Person<any>> | undefined;
|
|
46
|
+
'schema:dateCreated'?: string | undefined;
|
|
46
47
|
'@id'?: string | undefined;
|
|
47
48
|
attachment?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
|
|
48
49
|
attributedTo?: JsonLd.Primitives.Property<(JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link) & {
|
|
@@ -85,20 +86,20 @@ export declare const TEST_DOCUMENT_WITH_PREVIEW: {
|
|
|
85
86
|
'@type': "Collection" | "Document" | "schema:BlogPosting" | "schema:TextDigitalDocument" | "schema:DigitalDocument" | "schema:PresentationDigitalDocument" | "schema:SpreadsheetDigitalDocument" | "atlassian:UndefinedLink" | ("Object" | "Document")[] | (JsonLd.Data.DocumentChildType | JsonLd.Data.DocumentParentType)[] | ("Document" | "schema:DigitalDocument")[];
|
|
86
87
|
'schema:fileFormat'?: string | undefined;
|
|
87
88
|
'atlassian:fileSize'?: number | undefined;
|
|
88
|
-
'schema:dateCreated'?: string | undefined;
|
|
89
|
-
'atlassian:updatedBy'?: JsonLd.Primitives.Link | JsonLd.Primitives.Person<any> | undefined;
|
|
90
89
|
'schema:commentCount'?: number | undefined;
|
|
91
90
|
'atlassian:isDeleted'?: boolean | undefined;
|
|
92
91
|
'schema:potentialAction'?: JsonLd.Primitives.Property<JsonLd.Data.DocumentAction> | undefined;
|
|
93
92
|
'atlassian:dateViewed'?: string | undefined;
|
|
94
93
|
'atlassian:reactCount'?: number | undefined;
|
|
95
|
-
'atlassian:state'?: string | undefined;
|
|
94
|
+
'atlassian:state'?: string | JsonLd.Primitives.Object<any> | undefined;
|
|
96
95
|
'atlassian:viewCount'?: number | undefined;
|
|
97
96
|
'atlassian:voteCount'?: number | undefined;
|
|
98
97
|
'@context': JsonLd.Primitives.Context;
|
|
99
98
|
'atlassian:downloadUrl'?: string | undefined;
|
|
100
99
|
'atlassian:visitUrl'?: string | undefined;
|
|
101
100
|
'atlassian:titlePrefix'?: JsonLd.Data.TitlePrefix | undefined;
|
|
101
|
+
'atlassian:updatedBy'?: JsonLd.Primitives.Link | JsonLd.Primitives.Person<any> | JsonLd.Primitives.Collection<JsonLd.Primitives.Link | JsonLd.Primitives.Person<any>> | undefined;
|
|
102
|
+
'schema:dateCreated'?: string | undefined;
|
|
102
103
|
'@id'?: string | undefined;
|
|
103
104
|
attachment?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
|
|
104
105
|
attributedTo?: JsonLd.Primitives.Property<(JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link) & {
|
|
@@ -145,6 +146,8 @@ export declare const TEST_DATA_WITH_LATEST_COMMIT_OBJ: {
|
|
|
145
146
|
'atlassian:downloadUrl'?: string | undefined;
|
|
146
147
|
'atlassian:visitUrl'?: string | undefined;
|
|
147
148
|
'atlassian:titlePrefix'?: JsonLd.Data.TitlePrefix | undefined;
|
|
149
|
+
'atlassian:updatedBy'?: JsonLd.Primitives.Link | JsonLd.Primitives.Person<any> | JsonLd.Primitives.Collection<JsonLd.Primitives.Link | JsonLd.Primitives.Person<any>> | undefined;
|
|
150
|
+
'schema:dateCreated'?: string | undefined;
|
|
148
151
|
'@id'?: string | undefined;
|
|
149
152
|
attachment?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
|
|
150
153
|
attributedTo?: JsonLd.Primitives.Property<(JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link) & {
|
|
@@ -189,6 +192,8 @@ export declare const TEST_DATA_WITH_LATEST_COMMIT_TEXT: {
|
|
|
189
192
|
'atlassian:downloadUrl'?: string | undefined;
|
|
190
193
|
'atlassian:visitUrl'?: string | undefined;
|
|
191
194
|
'atlassian:titlePrefix'?: JsonLd.Data.TitlePrefix | undefined;
|
|
195
|
+
'atlassian:updatedBy'?: JsonLd.Primitives.Link | JsonLd.Primitives.Person<any> | JsonLd.Primitives.Collection<JsonLd.Primitives.Link | JsonLd.Primitives.Person<any>> | undefined;
|
|
196
|
+
'schema:dateCreated'?: string | undefined;
|
|
192
197
|
'@id'?: string | undefined;
|
|
193
198
|
attachment?: JsonLd.Primitives.Property<JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link> | undefined;
|
|
194
199
|
attributedTo?: JsonLd.Primitives.Property<(JsonLd.Primitives.Object<any> | JsonLd.Primitives.Link) & {
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
import { LinkLozenge } from './types';
|
|
3
|
-
export declare const extractState: (jsonLd: JsonLd.Data.SourceCodePullRequest | JsonLd.Data.Document | JsonLd.Data.Project) => LinkLozenge | undefined;
|
|
3
|
+
export declare const extractState: (jsonLd: JsonLd.Data.SourceCodePullRequest | JsonLd.Data.Document | JsonLd.Data.Project | JsonLd.Data.Goal) => LinkLozenge | undefined;
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
export declare const extractCommentCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
3
|
+
export declare const extractDueOn: (data: JsonLd.Data.BaseData) => string | undefined;
|
|
3
4
|
export declare const extractViewCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
4
5
|
export declare const extractReactCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
5
6
|
export declare const extractVoteCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
6
7
|
export declare const extractCreatedBy: (data: JsonLd.Data.BaseData) => string | undefined;
|
|
7
8
|
export declare const extractModifiedBy: (data: JsonLd.Data.BaseData) => string | undefined;
|
|
8
9
|
export declare const extractProgrammingLanguage: (data: JsonLd.Data.BaseData) => string | undefined;
|
|
10
|
+
export declare const extractSourceBranch: (data: JsonLd.Data.SourceCodePullRequest) => string | undefined;
|
|
9
11
|
export declare const extractSubscriberCount: (data: JsonLd.Data.BaseData) => number | undefined;
|
|
12
|
+
export declare const extractTargetBranch: (data: JsonLd.Data.SourceCodePullRequest) => string | undefined;
|
|
@@ -22,6 +22,13 @@ export declare type FlexibleUiDataContext = {
|
|
|
22
22
|
* @see CommentCount
|
|
23
23
|
*/
|
|
24
24
|
commentCount?: number;
|
|
25
|
+
/**
|
|
26
|
+
* Contains the ISO timestamp of when the resource was due.
|
|
27
|
+
* This value is mapped to JsonLD endTime.
|
|
28
|
+
* @type string - ISO Timestamp
|
|
29
|
+
* @see DueOn
|
|
30
|
+
*/
|
|
31
|
+
dueOn?: string;
|
|
25
32
|
/**
|
|
26
33
|
* Contains the number of views of the linked resource.
|
|
27
34
|
* @type number
|
|
@@ -52,6 +59,10 @@ export declare type FlexibleUiDataContext = {
|
|
|
52
59
|
* @see CreatedOn
|
|
53
60
|
*/
|
|
54
61
|
createdOn?: string;
|
|
62
|
+
/**
|
|
63
|
+
* Contains the information about the latest commit in the repository
|
|
64
|
+
*/
|
|
65
|
+
latestCommit?: string;
|
|
55
66
|
/**
|
|
56
67
|
* Contains the favicon of the resource.
|
|
57
68
|
* @type Icon
|
|
@@ -88,12 +99,24 @@ export declare type FlexibleUiDataContext = {
|
|
|
88
99
|
* @see ProgrammingLanguage
|
|
89
100
|
*/
|
|
90
101
|
programmingLanguage?: string;
|
|
102
|
+
/**
|
|
103
|
+
* Contains the provider icon of the linked resource.
|
|
104
|
+
* @type Icon
|
|
105
|
+
* @see Provider
|
|
106
|
+
*/
|
|
107
|
+
provider?: Icon;
|
|
91
108
|
/**
|
|
92
109
|
* Contains the snippet of the resource.
|
|
93
110
|
* @type string
|
|
94
111
|
* @see Snippet
|
|
95
112
|
*/
|
|
96
113
|
snippet?: string;
|
|
114
|
+
/**
|
|
115
|
+
* Contains the source branch name of the link typed pull request.
|
|
116
|
+
* @type string
|
|
117
|
+
* @see SourceBranch
|
|
118
|
+
*/
|
|
119
|
+
sourceBranch?: string;
|
|
97
120
|
/**
|
|
98
121
|
* Contains the number of subscribers of the linked resource.
|
|
99
122
|
* @type number
|
|
@@ -106,6 +129,12 @@ export declare type FlexibleUiDataContext = {
|
|
|
106
129
|
* @see SubscriberCount
|
|
107
130
|
*/
|
|
108
131
|
state?: LinkLozenge;
|
|
132
|
+
/**
|
|
133
|
+
* Contains the target branch name of the link typed pull request.
|
|
134
|
+
* @type string
|
|
135
|
+
* @see TargetBranch
|
|
136
|
+
*/
|
|
137
|
+
targetBranch?: string;
|
|
109
138
|
/**
|
|
110
139
|
* Contains the Title of the linked resource.
|
|
111
140
|
* @type string
|
|
@@ -118,16 +147,6 @@ export declare type FlexibleUiDataContext = {
|
|
|
118
147
|
* @see Title
|
|
119
148
|
*/
|
|
120
149
|
url?: string;
|
|
121
|
-
/**
|
|
122
|
-
* Contains the provider icon of the linked resource.
|
|
123
|
-
* @type Icon
|
|
124
|
-
* @see Provider
|
|
125
|
-
*/
|
|
126
|
-
provider?: Icon;
|
|
127
|
-
/**
|
|
128
|
-
* Contains the information about the latest commit in the repository
|
|
129
|
-
*/
|
|
130
|
-
latestCommit?: string;
|
|
131
150
|
};
|
|
132
151
|
export declare type Icon = {
|
|
133
152
|
icon?: IconType;
|
|
@@ -103,7 +103,7 @@ export declare type ActionItem = NamedActionItem | CustomActionItem;
|
|
|
103
103
|
/**
|
|
104
104
|
* A type that contains all the possible combinations of elements with their corresponding props.
|
|
105
105
|
*/
|
|
106
|
-
export declare type ElementItemProps = AuthorGroup | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | Snippet | State | SubscriberCount | Title | ViewCount | VoteCount;
|
|
106
|
+
export declare type ElementItemProps = AuthorGroup | CollaboratorGroup | CommentCount | CreatedBy | CreatedOn | DueOn | LatestCommit | LinkIcon | ModifiedBy | ModifiedOn | Preview | Priority | ProgrammingLanguage | Provider | ReactCount | Snippet | SourceBranch | State | SubscriberCount | TargetBranch | Title | ViewCount | VoteCount;
|
|
107
107
|
/**
|
|
108
108
|
* Represents the props available for an AuthorGroup element.
|
|
109
109
|
* @see AuthorGroup
|
|
@@ -143,6 +143,13 @@ export declare type CreatedOn = {
|
|
|
143
143
|
*/
|
|
144
144
|
text?: string;
|
|
145
145
|
};
|
|
146
|
+
/**
|
|
147
|
+
* Represents the props available for an DueOn element.
|
|
148
|
+
* @see CreatedOn
|
|
149
|
+
*/
|
|
150
|
+
export declare type DueOn = {
|
|
151
|
+
name: ElementName.DueOn;
|
|
152
|
+
};
|
|
146
153
|
/**
|
|
147
154
|
* Represents the props available for an LastCommit element.
|
|
148
155
|
* @see BadgeProps
|
|
@@ -217,6 +224,13 @@ export declare type ReactCount = {
|
|
|
217
224
|
export declare type Snippet = {
|
|
218
225
|
name: ElementName.Snippet;
|
|
219
226
|
};
|
|
227
|
+
/**
|
|
228
|
+
* Represents the props available for an SourceBranch element.
|
|
229
|
+
* @see SourceBranch
|
|
230
|
+
*/
|
|
231
|
+
export declare type SourceBranch = {
|
|
232
|
+
name: ElementName.SourceBranch;
|
|
233
|
+
};
|
|
220
234
|
/**
|
|
221
235
|
* Represents the props available for an State element.
|
|
222
236
|
* @see State
|
|
@@ -231,6 +245,13 @@ export declare type State = {
|
|
|
231
245
|
export declare type SubscriberCount = {
|
|
232
246
|
name: ElementName.SubscriberCount;
|
|
233
247
|
};
|
|
248
|
+
/**
|
|
249
|
+
* Represents the props available for an TargetBranch element.
|
|
250
|
+
* @see TargetBranch
|
|
251
|
+
*/
|
|
252
|
+
export declare type TargetBranch = {
|
|
253
|
+
name: ElementName.TargetBranch;
|
|
254
|
+
};
|
|
234
255
|
/**
|
|
235
256
|
* Represents the props available for an Title element.
|
|
236
257
|
* @see Title
|
|
@@ -32,6 +32,11 @@ export declare const CreatedOn: import("react").FC<DateTimeProps>;
|
|
|
32
32
|
* @see Text
|
|
33
33
|
*/
|
|
34
34
|
export declare const CreatedBy: import("react").FC<TextProps>;
|
|
35
|
+
/**
|
|
36
|
+
* Creates a DueOn Lozenge element using the data from dueOn in the Flexible UI Context.
|
|
37
|
+
* @see Lozenge
|
|
38
|
+
*/
|
|
39
|
+
export declare const DueOn: import("react").FC<LozengeProps>;
|
|
35
40
|
/**
|
|
36
41
|
* Creates an element that contains Last Commit hash
|
|
37
42
|
*/
|
|
@@ -81,6 +86,11 @@ export declare const ReactCount: import("react").FC<BadgeProps>;
|
|
|
81
86
|
* @see Text
|
|
82
87
|
*/
|
|
83
88
|
export declare const Snippet: import("react").FC<TextProps>;
|
|
89
|
+
/**
|
|
90
|
+
* Creates a SourceBranch Text element using the data from sourceBranch in the Flexible UI Context.
|
|
91
|
+
* @see Text
|
|
92
|
+
*/
|
|
93
|
+
export declare const SourceBranch: import("react").FC<TextProps>;
|
|
84
94
|
/**
|
|
85
95
|
* Creates a State Lozenge element using the data from State in the Flexible UI Context.
|
|
86
96
|
* @see Lozenge
|
|
@@ -91,6 +101,11 @@ export declare const State: import("react").FC<LozengeProps>;
|
|
|
91
101
|
* @see Badge
|
|
92
102
|
*/
|
|
93
103
|
export declare const SubscriberCount: import("react").FC<BadgeProps>;
|
|
104
|
+
/**
|
|
105
|
+
* Creates a TargetBranch Text element using the data from targetBranch in the Flexible UI Context.
|
|
106
|
+
* @see Text
|
|
107
|
+
*/
|
|
108
|
+
export declare const TargetBranch: import("react").FC<TextProps>;
|
|
94
109
|
/**
|
|
95
110
|
* Creates a Title Link element using the data from Title in the Flexible UI Context.
|
|
96
111
|
* This represents the main link text within the Smart Link.
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
1
2
|
import { ElementProps } from '../types';
|
|
2
3
|
export declare type LozengeAppearance = 'default' | 'inprogress' | 'moved' | 'new' | 'removed' | 'success';
|
|
3
4
|
export declare type LozengeProps = ElementProps & {
|
|
@@ -8,5 +9,5 @@ export declare type LozengeProps = ElementProps & {
|
|
|
8
9
|
/**
|
|
9
10
|
* The text to display within the lozenge.
|
|
10
11
|
*/
|
|
11
|
-
text?: string;
|
|
12
|
+
text?: string | React.ReactNode;
|
|
12
13
|
};
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import { SerializedStyles } from '@emotion/core';
|
|
2
|
-
import { SmartLinkSize } from '../../../../constants';
|
|
2
|
+
import { ElementName, SmartLinkSize } from '../../../../constants';
|
|
3
3
|
export declare type ElementProps = {
|
|
4
|
+
/**
|
|
5
|
+
* Name of the element, can be used as a selector.
|
|
6
|
+
* E.g. [data-smart-element="Provider"]
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
name?: ElementName;
|
|
4
10
|
/**
|
|
5
11
|
* Any additional CSS properties to apply to the element.
|
|
6
12
|
*/
|
|
@@ -13,6 +13,7 @@ export declare type PreviewInvokeMethod = 'keyboard' | 'mouse_hover' | 'mouse_cl
|
|
|
13
13
|
export interface MetadataOptions {
|
|
14
14
|
primary: Array<ElementItem>;
|
|
15
15
|
secondary: Array<ElementItem>;
|
|
16
|
+
subtitle: Array<ElementItem>;
|
|
16
17
|
}
|
|
17
18
|
export declare type HoverCardContentProps = {
|
|
18
19
|
analytics: AnalyticsFacade;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
2
|
export declare const HOVER_CARD_ANALYTICS_DISPLAY = "flexible";
|
|
3
|
-
export declare const getSimulatedMetadata: (extensionKey?: string) => JsonLd.Primitives.Property<any>;
|
|
3
|
+
export declare const getSimulatedMetadata: (extensionKey?: string, types?: JsonLd.Primitives.ObjectType[]) => JsonLd.Primitives.Property<any>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "19.1.
|
|
3
|
+
"version": "19.1.31",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@emotion/styled": "^10.0.7",
|
|
51
51
|
"@formatjs/intl-utils": "^3.8.4",
|
|
52
52
|
"facepaint": "^1.2.1",
|
|
53
|
-
"json-ld-types": "
|
|
53
|
+
"json-ld-types": "3.0.2",
|
|
54
54
|
"react-error-boundary": "^3.1.3",
|
|
55
55
|
"react-lazily-render": "^1.2.0",
|
|
56
56
|
"react-loadable": "^5.1.0",
|