@atlaskit/smart-card 26.37.2 → 26.38.1
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 +13 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/BlockCard/actions/flexible/AuthorizeAction.js +1 -0
- package/dist/cjs/view/BlockCard/index.js +5 -18
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleErroredView.js +12 -34
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenView.js +25 -51
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +13 -32
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +9 -31
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +7 -18
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +28 -51
- package/dist/cjs/view/BlockCard/views/flexible/styled.js +5 -5
- package/dist/cjs/view/BlockCard/views/flexible/unresolved-view/index.js +41 -0
- package/dist/cjs/view/BlockCard/views/flexible/utils/index.js +30 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +12 -57
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +65 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/index.js +8 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +3 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/BlockCard/actions/flexible/AuthorizeAction.js +1 -0
- package/dist/es2019/view/BlockCard/index.js +1 -15
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleErroredView.js +8 -32
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenView.js +25 -52
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +12 -31
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleNotFoundView.js +15 -41
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleResolvedView.js +10 -21
- package/dist/es2019/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +24 -43
- package/dist/es2019/view/BlockCard/views/flexible/styled.js +3 -4
- package/dist/es2019/view/BlockCard/views/flexible/unresolved-view/index.js +33 -0
- package/dist/es2019/view/BlockCard/views/flexible/utils/index.js +27 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +11 -54
- package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +56 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/index.js +4 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +3 -2
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/BlockCard/actions/flexible/AuthorizeAction.js +1 -0
- package/dist/esm/view/BlockCard/index.js +3 -18
- package/dist/esm/view/BlockCard/views/flexible/FlexibleErroredView.js +12 -34
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenView.js +26 -52
- package/dist/esm/view/BlockCard/views/flexible/FlexibleForbiddenViewOld.js +13 -32
- package/dist/esm/view/BlockCard/views/flexible/FlexibleNotFoundView.js +9 -31
- package/dist/esm/view/BlockCard/views/flexible/FlexibleResolvedView.js +10 -21
- package/dist/esm/view/BlockCard/views/flexible/FlexibleUnauthorisedView.js +25 -45
- package/dist/esm/view/BlockCard/views/flexible/styled.js +4 -4
- package/dist/esm/view/BlockCard/views/flexible/unresolved-view/index.js +35 -0
- package/dist/esm/view/BlockCard/views/flexible/utils/index.js +30 -1
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +13 -54
- package/dist/esm/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +55 -0
- package/dist/esm/view/FlexibleCard/components/blocks/index.js +4 -1
- package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/elements/text/index.js +3 -2
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +3 -1
- package/dist/types/view/BlockCard/views/flexible/styled.d.ts +0 -1
- package/dist/types/view/BlockCard/views/flexible/types.d.ts +2 -83
- package/dist/types/view/BlockCard/views/flexible/unresolved-view/index.d.ts +4 -0
- package/dist/types/view/BlockCard/views/flexible/unresolved-view/types.d.ts +7 -0
- package/dist/types/view/BlockCard/views/flexible/utils/index.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/blocks/footer-block/resolved/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/snippet-block/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/elements/text/types.d.ts +4 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/FlexibleUnauthorisedView.d.ts +3 -1
- package/dist/types-ts4.5/view/BlockCard/views/flexible/styled.d.ts +0 -1
- package/dist/types-ts4.5/view/BlockCard/views/flexible/types.d.ts +2 -83
- package/dist/types-ts4.5/view/BlockCard/views/flexible/unresolved-view/index.d.ts +4 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/unresolved-view/types.d.ts +7 -0
- package/dist/types-ts4.5/view/BlockCard/views/flexible/utils/index.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/footer-block/resolved/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/snippet-block/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/text/types.d.ts +4 -0
- package/package.json +1 -1
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
- package/dist/cjs/view/BlockCard/components/flexible/footer/index.js +0 -56
- package/dist/es2019/view/BlockCard/components/flexible/footer/index.js +0 -52
- package/dist/esm/view/BlockCard/components/flexible/footer/index.js +0 -49
- package/dist/types/view/BlockCard/components/flexible/footer/index.d.ts +0 -12
- package/dist/types/view/BlockCard/components/flexible/footer/types.d.ts +0 -5
- package/dist/types-ts4.5/view/BlockCard/components/flexible/footer/index.d.ts +0 -12
- package/dist/types-ts4.5/view/BlockCard/components/flexible/footer/types.d.ts +0 -5
- /package/dist/cjs/view/BlockCard/{components/flexible/footer → views/flexible/unresolved-view}/types.js +0 -0
- /package/dist/es2019/view/BlockCard/{components/flexible/footer → views/flexible/unresolved-view}/types.js +0 -0
- /package/dist/esm/view/BlockCard/{components/flexible/footer → views/flexible/unresolved-view}/types.js +0 -0
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
2
3
|
import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
|
|
3
4
|
import { getExtensionKey } from '../../../../../state/helpers';
|
|
5
|
+
import { footerBlockCss, titleBlockCss } from '../styled';
|
|
4
6
|
var baseTopMetadata = [{
|
|
5
7
|
name: ElementName.ModifiedOn
|
|
6
8
|
}, {
|
|
@@ -134,4 +136,31 @@ export var getSimulatedMetadata = function getSimulatedMetadata(cardDetails) {
|
|
|
134
136
|
titleMetadata: titleMetadata,
|
|
135
137
|
topMetadata: topMetadata
|
|
136
138
|
};
|
|
139
|
+
};
|
|
140
|
+
export var FlexibleCardUiOptions = {
|
|
141
|
+
hideElevation: true
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
// Due to the use of getBooleanFF(), this has to be a function.
|
|
145
|
+
// Make this a const object after ff cleanup.
|
|
146
|
+
export var getTitleBlockOptions = function getTitleBlockOptions() {
|
|
147
|
+
return {
|
|
148
|
+
anchorTarget: getBooleanFF('platform.linking-platform.smart-card.enable-block-card-clicks-opening-in-same-tab') ? '_self' : undefined,
|
|
149
|
+
position: SmartLinkPosition.Center,
|
|
150
|
+
overrideCss: titleBlockCss,
|
|
151
|
+
hideRetry: true,
|
|
152
|
+
size: getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? SmartLinkSize.Large : undefined
|
|
153
|
+
};
|
|
154
|
+
};
|
|
155
|
+
export var PreviewBlockOptions = {
|
|
156
|
+
placement: MediaPlacement.Right,
|
|
157
|
+
ignoreContainerPadding: true
|
|
158
|
+
};
|
|
159
|
+
|
|
160
|
+
// Due to the use of getBooleanFF(), this has to be a function.
|
|
161
|
+
// Make this a const object after ff cleanup.
|
|
162
|
+
export var getFooterBlockOptions = function getFooterBlockOptions() {
|
|
163
|
+
return {
|
|
164
|
+
overrideCss: getBooleanFF('platform.linking-platform.smart-card.enable-better-metadata_iojwg') ? footerBlockCss : undefined
|
|
165
|
+
};
|
|
137
166
|
};
|
|
@@ -1,23 +1,9 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
import React
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
7
|
-
import Block from '../block';
|
|
8
|
-
import ElementGroup from '../element-group';
|
|
9
|
-
import { Provider } from '../../elements';
|
|
10
|
-
import ActionGroup from '../action-group';
|
|
11
|
-
import { filterActionItems } from '../utils';
|
|
12
|
-
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
13
|
-
var getActionGroupStyles = function getActionGroupStyles(size) {
|
|
14
|
-
if (size === SmartLinkSize.XLarge) {
|
|
15
|
-
// The biggest height of the action button exceeds the max line-height
|
|
16
|
-
// of the elements causing the action on the block with x-large size to
|
|
17
|
-
// get cut at the bottom.
|
|
18
|
-
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n max-height: 2rem;\n "])));
|
|
19
|
-
}
|
|
20
|
-
};
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["status", "testId"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import FooterBlockResolvedView from './resolved';
|
|
6
|
+
import { SmartLinkStatus } from '../../../../../constants';
|
|
21
7
|
|
|
22
8
|
/**
|
|
23
9
|
* Represents a FooterBlock, designed to contain elements and actions that should appear
|
|
@@ -26,43 +12,16 @@ var getActionGroupStyles = function getActionGroupStyles(size) {
|
|
|
26
12
|
* @param {FooterBlockProps} FooterBlockProps
|
|
27
13
|
* @see Block
|
|
28
14
|
*/
|
|
29
|
-
var FooterBlock = function FooterBlock(
|
|
30
|
-
var status =
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
_props$testId = props.testId,
|
|
35
|
-
testId = _props$testId === void 0 ? 'smart-footer-block' : _props$testId,
|
|
36
|
-
onActionMenuOpenChange = props.onActionMenuOpenChange;
|
|
37
|
-
var context = useFlexibleUiContext();
|
|
38
|
-
var hasActions = useMemo(function () {
|
|
39
|
-
var _filterActionItems;
|
|
40
|
-
return ((_filterActionItems = filterActionItems(actions, context)) === null || _filterActionItems === void 0 ? void 0 : _filterActionItems.length) > 0;
|
|
41
|
-
}, [actions, context]);
|
|
42
|
-
var onDropdownOpenChange = useCallback(function (isOpen) {
|
|
43
|
-
if (onActionMenuOpenChange) {
|
|
44
|
-
onActionMenuOpenChange({
|
|
45
|
-
isOpen: isOpen
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
}, [onActionMenuOpenChange]);
|
|
15
|
+
var FooterBlock = function FooterBlock(_ref) {
|
|
16
|
+
var status = _ref.status,
|
|
17
|
+
_ref$testId = _ref.testId,
|
|
18
|
+
testId = _ref$testId === void 0 ? 'smart-footer-block' : _ref$testId,
|
|
19
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
49
20
|
if (status !== SmartLinkStatus.Resolved) {
|
|
50
21
|
return null;
|
|
51
22
|
}
|
|
52
|
-
return /*#__PURE__*/React.createElement(
|
|
53
|
-
testId:
|
|
54
|
-
})
|
|
55
|
-
testId: "".concat(testId, "-provider")
|
|
56
|
-
}), actions && hasActions ? /*#__PURE__*/React.createElement(ElementGroup, {
|
|
57
|
-
testId: "smart-element-group-actions",
|
|
58
|
-
align: SmartLinkAlignment.Right,
|
|
59
|
-
direction: SmartLinkDirection.Horizontal,
|
|
60
|
-
overrideCss: getActionGroupStyles(size),
|
|
61
|
-
width: SmartLinkWidth.Flexible
|
|
62
|
-
}, /*#__PURE__*/React.createElement(ActionGroup, {
|
|
63
|
-
onDropdownOpenChange: onDropdownOpenChange,
|
|
64
|
-
items: actions,
|
|
65
|
-
appearance: "default"
|
|
66
|
-
})) : null);
|
|
23
|
+
return /*#__PURE__*/React.createElement(FooterBlockResolvedView, _extends({}, props, {
|
|
24
|
+
testId: testId
|
|
25
|
+
}));
|
|
67
26
|
};
|
|
68
27
|
export default FooterBlock;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
3
|
+
var _templateObject;
|
|
4
|
+
import { css } from '@emotion/react';
|
|
5
|
+
import React, { useCallback, useMemo } from 'react';
|
|
6
|
+
import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
7
|
+
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
8
|
+
import { Provider } from '../../../elements';
|
|
9
|
+
import ActionGroup from '../../action-group';
|
|
10
|
+
import Block from '../../block';
|
|
11
|
+
import ElementGroup from '../../element-group';
|
|
12
|
+
import { filterActionItems } from '../../utils';
|
|
13
|
+
var getActionGroupStyles = function getActionGroupStyles(size) {
|
|
14
|
+
if (size === SmartLinkSize.XLarge) {
|
|
15
|
+
// The biggest height of the action button exceeds the max line-height
|
|
16
|
+
// of the elements causing the action on the block with x-large size to
|
|
17
|
+
// get cut at the bottom.
|
|
18
|
+
return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n max-height: 2rem;\n "])));
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
var FooterBlockResolvedView = function FooterBlockResolvedView(props) {
|
|
22
|
+
var actions = props.actions,
|
|
23
|
+
testId = props.testId,
|
|
24
|
+
onActionMenuOpenChange = props.onActionMenuOpenChange,
|
|
25
|
+
_props$size = props.size,
|
|
26
|
+
size = _props$size === void 0 ? SmartLinkSize.Medium : _props$size;
|
|
27
|
+
var context = useFlexibleUiContext();
|
|
28
|
+
var hasActions = useMemo(function () {
|
|
29
|
+
var _filterActionItems;
|
|
30
|
+
return ((_filterActionItems = filterActionItems(actions, context)) === null || _filterActionItems === void 0 ? void 0 : _filterActionItems.length) > 0;
|
|
31
|
+
}, [actions, context]);
|
|
32
|
+
var onDropdownOpenChange = useCallback(function (isOpen) {
|
|
33
|
+
if (onActionMenuOpenChange) {
|
|
34
|
+
onActionMenuOpenChange({
|
|
35
|
+
isOpen: isOpen
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}, [onActionMenuOpenChange]);
|
|
39
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
40
|
+
testId: "".concat(testId, "-resolved-view")
|
|
41
|
+
}), /*#__PURE__*/React.createElement(Provider, {
|
|
42
|
+
testId: "".concat(testId, "-provider")
|
|
43
|
+
}), actions && hasActions ? /*#__PURE__*/React.createElement(ElementGroup, {
|
|
44
|
+
testId: "smart-element-group-actions",
|
|
45
|
+
align: SmartLinkAlignment.Right,
|
|
46
|
+
direction: SmartLinkDirection.Horizontal,
|
|
47
|
+
overrideCss: getActionGroupStyles(size),
|
|
48
|
+
width: SmartLinkWidth.Flexible
|
|
49
|
+
}, /*#__PURE__*/React.createElement(ActionGroup, {
|
|
50
|
+
onDropdownOpenChange: onDropdownOpenChange,
|
|
51
|
+
items: actions,
|
|
52
|
+
appearance: "default"
|
|
53
|
+
})) : null);
|
|
54
|
+
};
|
|
55
|
+
export default FooterBlockResolvedView;
|
|
@@ -3,4 +3,7 @@ export { default as MetadataBlock } from './metadata-block';
|
|
|
3
3
|
export { default as PreviewBlock } from './preview-block';
|
|
4
4
|
export { default as SnippetBlock } from './snippet-block';
|
|
5
5
|
export { default as TitleBlock } from './title-block';
|
|
6
|
-
export { default as CustomBlock } from './block';
|
|
6
|
+
export { default as CustomBlock } from './block';
|
|
7
|
+
|
|
8
|
+
// Internal components to be used within @atlaskit/smart-card only.
|
|
9
|
+
export { default as InternalFooterBlock } from './footer-block/resolved';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["maxLines", "status", "testId"];
|
|
3
|
+
var _excluded = ["maxLines", "status", "testId", "text"];
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import Block from '../block';
|
|
6
6
|
import { SmartLinkStatus } from '../../../../../constants';
|
|
@@ -23,6 +23,7 @@ var SnippetBlock = function SnippetBlock(_ref) {
|
|
|
23
23
|
status = _ref$status === void 0 ? SmartLinkStatus.Fallback : _ref$status,
|
|
24
24
|
_ref$testId = _ref.testId,
|
|
25
25
|
testId = _ref$testId === void 0 ? 'smart-block-snippet' : _ref$testId,
|
|
26
|
+
text = _ref.text,
|
|
26
27
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
27
28
|
if (status !== SmartLinkStatus.Resolved) {
|
|
28
29
|
return null;
|
|
@@ -31,7 +32,8 @@ var SnippetBlock = function SnippetBlock(_ref) {
|
|
|
31
32
|
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
32
33
|
testId: "".concat(testId, "-resolved-view")
|
|
33
34
|
}), /*#__PURE__*/React.createElement(Snippet, {
|
|
34
|
-
maxLines: snippetMaxLines
|
|
35
|
+
maxLines: snippetMaxLines,
|
|
36
|
+
text: text
|
|
35
37
|
}));
|
|
36
38
|
};
|
|
37
39
|
export default SnippetBlock;
|
|
@@ -23,7 +23,8 @@ var Text = function Text(_ref) {
|
|
|
23
23
|
name = _ref.name,
|
|
24
24
|
overrideCss = _ref.overrideCss,
|
|
25
25
|
_ref$testId = _ref.testId,
|
|
26
|
-
testId = _ref$testId === void 0 ? 'smart-element-text' : _ref$testId
|
|
26
|
+
testId = _ref$testId === void 0 ? 'smart-element-text' : _ref$testId,
|
|
27
|
+
text = _ref.text;
|
|
27
28
|
if (!message && !content) {
|
|
28
29
|
return null;
|
|
29
30
|
}
|
|
@@ -33,6 +34,6 @@ var Text = function Text(_ref) {
|
|
|
33
34
|
"data-smart-element": name,
|
|
34
35
|
"data-smart-element-text": true,
|
|
35
36
|
"data-testid": testId
|
|
36
|
-
}, getFormattedMessage(message) || content);
|
|
37
|
+
}, text ? text : getFormattedMessage(message) || content);
|
|
37
38
|
};
|
|
38
39
|
export default Text;
|
|
@@ -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.
|
|
14
|
+
packageVersion: "26.38.1",
|
|
15
15
|
componentName: 'linkUrl'
|
|
16
16
|
};
|
|
17
17
|
var Link = withLinkClickedEvent('a');
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
1
3
|
import { FlexibleBlockCardProps } from './types';
|
|
2
|
-
declare const _default: (props: FlexibleBlockCardProps) =>
|
|
4
|
+
declare const _default: (props: FlexibleBlockCardProps) => jsx.JSX.Element;
|
|
3
5
|
export default _default;
|
|
@@ -2,4 +2,3 @@ export declare const metadataBlockCss: import("@emotion/react").SerializedStyles
|
|
|
2
2
|
export declare const titleBlockCss: import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const footerBlockCss: import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const flexibleBlockCardStyle: import("@emotion/react").SerializedStyles;
|
|
5
|
-
export declare const forbiddenViewTitleStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -1,83 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { OnErrorCallback } from '../../../types';
|
|
4
|
-
import { FlexibleUiOptions } from '../../../FlexibleCard/types';
|
|
5
|
-
import { OnResolveCallback } from '../../../Card/types';
|
|
6
|
-
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
7
|
-
import { AnalyticsFacade } from '../../../../state/analytics';
|
|
8
|
-
import { AnchorTarget } from '../../../FlexibleCard/components/types';
|
|
9
|
-
import { TitleBlockProps } from '../../../FlexibleCard/components/blocks/title-block/types';
|
|
10
|
-
export type FlexibleBlockCardProps = {
|
|
11
|
-
/**
|
|
12
|
-
* An AnalyticsFacade object used for calling analytics.
|
|
13
|
-
*/
|
|
14
|
-
analytics: AnalyticsFacade;
|
|
15
|
-
/**
|
|
16
|
-
* Determines the anchor target to be passed to the title block.
|
|
17
|
-
*/
|
|
18
|
-
anchorTarget?: AnchorTarget;
|
|
19
|
-
/**
|
|
20
|
-
* Determines the status and data of the Smart Link.
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
cardState: CardState;
|
|
24
|
-
/**
|
|
25
|
-
* Provides the extensionKey of a Smart Link resolver invoked.
|
|
26
|
-
*/
|
|
27
|
-
extensionKey?: string;
|
|
28
|
-
/**
|
|
29
|
-
* A unique id for this Smart Link instance, used for analytics.
|
|
30
|
-
*/
|
|
31
|
-
id?: string;
|
|
32
|
-
/**
|
|
33
|
-
* An additional action that can be performed when link is not resolved, e.g.
|
|
34
|
-
* connect account to gain access to 403 link.
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
onAuthorize?: () => void;
|
|
38
|
-
/**
|
|
39
|
-
* Determines the onClick behaviour of Flexible UI. This will proxy to the
|
|
40
|
-
* TitleBlock if supplied.
|
|
41
|
-
*/
|
|
42
|
-
onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
|
|
43
|
-
/**
|
|
44
|
-
* function to be called after a flexible card has rendered its error states
|
|
45
|
-
*/
|
|
46
|
-
onError?: OnErrorCallback;
|
|
47
|
-
/**
|
|
48
|
-
* function to be called after a flexible card has rendered its resolved state
|
|
49
|
-
*/
|
|
50
|
-
onResolve?: OnResolveCallback;
|
|
51
|
-
/**
|
|
52
|
-
* A name of the provider, needed to specify to user which account has to be connected
|
|
53
|
-
*/
|
|
54
|
-
providerName?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Any additional renderers required by Flexible UI. Currently used by icon
|
|
57
|
-
* to render Emoji.
|
|
58
|
-
*/
|
|
59
|
-
renderers?: CardProviderRenderers;
|
|
60
|
-
/**
|
|
61
|
-
* Determines whether to show available server actions.
|
|
62
|
-
*/
|
|
63
|
-
showServerActions?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
66
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
67
|
-
* serving as a hook for automated tests
|
|
68
|
-
*/
|
|
69
|
-
testId?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Determines the appearance of Flexible UI.
|
|
72
|
-
* @see FlexibleUiOptions
|
|
73
|
-
*/
|
|
74
|
-
ui?: FlexibleUiOptions;
|
|
75
|
-
/**
|
|
76
|
-
* Determines the URL of the Smart Link.
|
|
77
|
-
*/
|
|
78
|
-
url: string;
|
|
79
|
-
/**
|
|
80
|
-
* Determines a style of the Title Block.
|
|
81
|
-
*/
|
|
82
|
-
titleBlockProps?: TitleBlockProps;
|
|
83
|
-
};
|
|
1
|
+
import { FlexibleCardProps } from '../../../FlexibleCard/types';
|
|
2
|
+
export type FlexibleBlockCardProps = Pick<FlexibleCardProps, 'analytics' | 'cardState' | 'id' | 'onAuthorize' | 'onClick' | 'onError' | 'onResolve' | 'renderers' | 'showServerActions' | 'testId' | 'url'>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ActionItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
2
|
+
import type { FlexibleBlockCardProps } from '../types';
|
|
3
|
+
export type UnresolvedViewProps = FlexibleBlockCardProps & {
|
|
4
|
+
actions?: ActionItem[];
|
|
5
|
+
showPreview?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
+
import type { FlexibleUiOptions } from '../../../../FlexibleCard/types';
|
|
3
|
+
import type { FooterBlockProps } from '../../../../FlexibleCard/components/blocks/footer-block/types';
|
|
4
|
+
import type { PreviewBlockProps } from '../../../../FlexibleCard/components/blocks/preview-block/types';
|
|
5
|
+
import type { TitleBlockProps } from '../../../../FlexibleCard/components/blocks/title-block/types';
|
|
2
6
|
import { ElementItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
3
7
|
export declare const getSimulatedBetterMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
|
|
4
8
|
export declare const getSimulatedMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
|
|
@@ -7,4 +11,8 @@ type SimulatedMetadata = {
|
|
|
7
11
|
topMetadata: ElementItem[];
|
|
8
12
|
bottomMetadata?: ElementItem[];
|
|
9
13
|
};
|
|
14
|
+
export declare const FlexibleCardUiOptions: FlexibleUiOptions;
|
|
15
|
+
export declare const getTitleBlockOptions: () => Partial<TitleBlockProps>;
|
|
16
|
+
export declare const PreviewBlockOptions: Partial<PreviewBlockProps>;
|
|
17
|
+
export declare const getFooterBlockOptions: () => Partial<FooterBlockProps>;
|
|
10
18
|
export {};
|
|
@@ -4,3 +4,4 @@ export { default as PreviewBlock } from './preview-block';
|
|
|
4
4
|
export { default as SnippetBlock } from './snippet-block';
|
|
5
5
|
export { default as TitleBlock } from './title-block';
|
|
6
6
|
export { default as CustomBlock } from './block';
|
|
7
|
+
export { default as InternalFooterBlock } from './footer-block/resolved';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
/** @jsx jsx */
|
|
2
|
+
import { jsx } from '@emotion/react';
|
|
1
3
|
import { FlexibleBlockCardProps } from './types';
|
|
2
|
-
declare const _default: (props: FlexibleBlockCardProps) =>
|
|
4
|
+
declare const _default: (props: FlexibleBlockCardProps) => jsx.JSX.Element;
|
|
3
5
|
export default _default;
|
|
@@ -2,4 +2,3 @@ export declare const metadataBlockCss: import("@emotion/react").SerializedStyles
|
|
|
2
2
|
export declare const titleBlockCss: import("@emotion/react").SerializedStyles;
|
|
3
3
|
export declare const footerBlockCss: import("@emotion/react").SerializedStyles;
|
|
4
4
|
export declare const flexibleBlockCardStyle: import("@emotion/react").SerializedStyles;
|
|
5
|
-
export declare const forbiddenViewTitleStyle: import("@emotion/react").SerializedStyles;
|
|
@@ -1,83 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
import { OnErrorCallback } from '../../../types';
|
|
4
|
-
import { FlexibleUiOptions } from '../../../FlexibleCard/types';
|
|
5
|
-
import { OnResolveCallback } from '../../../Card/types';
|
|
6
|
-
import { CardProviderRenderers } from '@atlaskit/link-provider';
|
|
7
|
-
import { AnalyticsFacade } from '../../../../state/analytics';
|
|
8
|
-
import { AnchorTarget } from '../../../FlexibleCard/components/types';
|
|
9
|
-
import { TitleBlockProps } from '../../../FlexibleCard/components/blocks/title-block/types';
|
|
10
|
-
export type FlexibleBlockCardProps = {
|
|
11
|
-
/**
|
|
12
|
-
* An AnalyticsFacade object used for calling analytics.
|
|
13
|
-
*/
|
|
14
|
-
analytics: AnalyticsFacade;
|
|
15
|
-
/**
|
|
16
|
-
* Determines the anchor target to be passed to the title block.
|
|
17
|
-
*/
|
|
18
|
-
anchorTarget?: AnchorTarget;
|
|
19
|
-
/**
|
|
20
|
-
* Determines the status and data of the Smart Link.
|
|
21
|
-
* @internal
|
|
22
|
-
*/
|
|
23
|
-
cardState: CardState;
|
|
24
|
-
/**
|
|
25
|
-
* Provides the extensionKey of a Smart Link resolver invoked.
|
|
26
|
-
*/
|
|
27
|
-
extensionKey?: string;
|
|
28
|
-
/**
|
|
29
|
-
* A unique id for this Smart Link instance, used for analytics.
|
|
30
|
-
*/
|
|
31
|
-
id?: string;
|
|
32
|
-
/**
|
|
33
|
-
* An additional action that can be performed when link is not resolved, e.g.
|
|
34
|
-
* connect account to gain access to 403 link.
|
|
35
|
-
* @internal
|
|
36
|
-
*/
|
|
37
|
-
onAuthorize?: () => void;
|
|
38
|
-
/**
|
|
39
|
-
* Determines the onClick behaviour of Flexible UI. This will proxy to the
|
|
40
|
-
* TitleBlock if supplied.
|
|
41
|
-
*/
|
|
42
|
-
onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
|
|
43
|
-
/**
|
|
44
|
-
* function to be called after a flexible card has rendered its error states
|
|
45
|
-
*/
|
|
46
|
-
onError?: OnErrorCallback;
|
|
47
|
-
/**
|
|
48
|
-
* function to be called after a flexible card has rendered its resolved state
|
|
49
|
-
*/
|
|
50
|
-
onResolve?: OnResolveCallback;
|
|
51
|
-
/**
|
|
52
|
-
* A name of the provider, needed to specify to user which account has to be connected
|
|
53
|
-
*/
|
|
54
|
-
providerName?: string;
|
|
55
|
-
/**
|
|
56
|
-
* Any additional renderers required by Flexible UI. Currently used by icon
|
|
57
|
-
* to render Emoji.
|
|
58
|
-
*/
|
|
59
|
-
renderers?: CardProviderRenderers;
|
|
60
|
-
/**
|
|
61
|
-
* Determines whether to show available server actions.
|
|
62
|
-
*/
|
|
63
|
-
showServerActions?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* A `testId` prop is provided for specified elements, which is a unique
|
|
66
|
-
* string that appears as a data attribute `data-testid` in the rendered code,
|
|
67
|
-
* serving as a hook for automated tests
|
|
68
|
-
*/
|
|
69
|
-
testId?: string;
|
|
70
|
-
/**
|
|
71
|
-
* Determines the appearance of Flexible UI.
|
|
72
|
-
* @see FlexibleUiOptions
|
|
73
|
-
*/
|
|
74
|
-
ui?: FlexibleUiOptions;
|
|
75
|
-
/**
|
|
76
|
-
* Determines the URL of the Smart Link.
|
|
77
|
-
*/
|
|
78
|
-
url: string;
|
|
79
|
-
/**
|
|
80
|
-
* Determines a style of the Title Block.
|
|
81
|
-
*/
|
|
82
|
-
titleBlockProps?: TitleBlockProps;
|
|
83
|
-
};
|
|
1
|
+
import { FlexibleCardProps } from '../../../FlexibleCard/types';
|
|
2
|
+
export type FlexibleBlockCardProps = Pick<FlexibleCardProps, 'analytics' | 'cardState' | 'id' | 'onAuthorize' | 'onClick' | 'onError' | 'onResolve' | 'renderers' | 'showServerActions' | 'testId' | 'url'>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { ActionItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
2
|
+
import type { FlexibleBlockCardProps } from '../types';
|
|
3
|
+
export type UnresolvedViewProps = FlexibleBlockCardProps & {
|
|
4
|
+
actions?: ActionItem[];
|
|
5
|
+
showPreview?: boolean;
|
|
6
|
+
title?: string;
|
|
7
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
import { JsonLd } from 'json-ld-types';
|
|
2
|
+
import type { FlexibleUiOptions } from '../../../../FlexibleCard/types';
|
|
3
|
+
import type { FooterBlockProps } from '../../../../FlexibleCard/components/blocks/footer-block/types';
|
|
4
|
+
import type { PreviewBlockProps } from '../../../../FlexibleCard/components/blocks/preview-block/types';
|
|
5
|
+
import type { TitleBlockProps } from '../../../../FlexibleCard/components/blocks/title-block/types';
|
|
2
6
|
import { ElementItem } from '../../../../FlexibleCard/components/blocks/types';
|
|
3
7
|
export declare const getSimulatedBetterMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
|
|
4
8
|
export declare const getSimulatedMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
|
|
@@ -7,4 +11,8 @@ type SimulatedMetadata = {
|
|
|
7
11
|
topMetadata: ElementItem[];
|
|
8
12
|
bottomMetadata?: ElementItem[];
|
|
9
13
|
};
|
|
14
|
+
export declare const FlexibleCardUiOptions: FlexibleUiOptions;
|
|
15
|
+
export declare const getTitleBlockOptions: () => Partial<TitleBlockProps>;
|
|
16
|
+
export declare const PreviewBlockOptions: Partial<PreviewBlockProps>;
|
|
17
|
+
export declare const getFooterBlockOptions: () => Partial<FooterBlockProps>;
|
|
10
18
|
export {};
|
|
@@ -4,3 +4,4 @@ export { default as PreviewBlock } from './preview-block';
|
|
|
4
4
|
export { default as SnippetBlock } from './snippet-block';
|
|
5
5
|
export { default as TitleBlock } from './title-block';
|
|
6
6
|
export { default as CustomBlock } from './block';
|
|
7
|
+
export { default as InternalFooterBlock } from './footer-block/resolved';
|
package/package.json
CHANGED
package/report.api.md
CHANGED