@atlaskit/smart-card 17.5.1 → 17.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/cjs/index.js +6 -0
- package/dist/cjs/version.json +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/index.js +8 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +41 -0
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/types.js +5 -0
- package/dist/es2019/index.js +1 -1
- package/dist/es2019/version.json +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +21 -0
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/types.js +1 -0
- package/dist/esm/index.js +1 -1
- package/dist/esm/version.json +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +25 -0
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/types.js +1 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/types.d.ts +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/cjs/index.js
CHANGED
|
@@ -59,6 +59,12 @@ Object.defineProperty(exports, "MetadataBlock", {
|
|
|
59
59
|
return _blocks.MetadataBlock;
|
|
60
60
|
}
|
|
61
61
|
});
|
|
62
|
+
Object.defineProperty(exports, "PreviewBlock", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function get() {
|
|
65
|
+
return _blocks.PreviewBlock;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
62
68
|
Object.defineProperty(exports, "Provider", {
|
|
63
69
|
enumerable: true,
|
|
64
70
|
get: function get() {
|
package/dist/cjs/version.json
CHANGED
|
@@ -17,6 +17,12 @@ Object.defineProperty(exports, "MetadataBlock", {
|
|
|
17
17
|
return _metadataBlock.default;
|
|
18
18
|
}
|
|
19
19
|
});
|
|
20
|
+
Object.defineProperty(exports, "PreviewBlock", {
|
|
21
|
+
enumerable: true,
|
|
22
|
+
get: function get() {
|
|
23
|
+
return _previewBlock.default;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
20
26
|
Object.defineProperty(exports, "SnippetBlock", {
|
|
21
27
|
enumerable: true,
|
|
22
28
|
get: function get() {
|
|
@@ -34,6 +40,8 @@ var _footerBlock = _interopRequireDefault(require("./footer-block"));
|
|
|
34
40
|
|
|
35
41
|
var _metadataBlock = _interopRequireDefault(require("./metadata-block"));
|
|
36
42
|
|
|
43
|
+
var _previewBlock = _interopRequireDefault(require("./preview-block"));
|
|
44
|
+
|
|
37
45
|
var _snippetBlock = _interopRequireDefault(require("./snippet-block"));
|
|
38
46
|
|
|
39
47
|
var _titleBlock = _interopRequireDefault(require("./title-block"));
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
|
|
12
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
13
|
+
|
|
14
|
+
var _react = _interopRequireDefault(require("react"));
|
|
15
|
+
|
|
16
|
+
var _constants = require("../../../../../constants");
|
|
17
|
+
|
|
18
|
+
var _block = _interopRequireDefault(require("../block"));
|
|
19
|
+
|
|
20
|
+
var _elements = require("../../elements");
|
|
21
|
+
|
|
22
|
+
var _excluded = ["status", "testId"];
|
|
23
|
+
|
|
24
|
+
var PreviewBlock = function PreviewBlock(_ref) {
|
|
25
|
+
var _ref$status = _ref.status,
|
|
26
|
+
status = _ref$status === void 0 ? _constants.SmartLinkStatus.Fallback : _ref$status,
|
|
27
|
+
_ref$testId = _ref.testId,
|
|
28
|
+
testId = _ref$testId === void 0 ? 'smart-block-preview' : _ref$testId,
|
|
29
|
+
blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
30
|
+
|
|
31
|
+
if (status !== _constants.SmartLinkStatus.Resolved) {
|
|
32
|
+
return null;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
|
|
36
|
+
testId: "".concat(testId, "-resolved-view")
|
|
37
|
+
}), /*#__PURE__*/_react.default.createElement(_elements.Preview, null));
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
var _default = PreviewBlock;
|
|
41
|
+
exports.default = _default;
|
package/dist/es2019/index.js
CHANGED
|
@@ -13,4 +13,4 @@ export { contentFooterClassName, metadataListClassName, blockCardResolvingViewCl
|
|
|
13
13
|
export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/LazyFallback'; // Flexible UI
|
|
14
14
|
|
|
15
15
|
export { ActionName, ElementName, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from './constants';
|
|
16
|
-
export { MetadataBlock, SnippetBlock, TitleBlock } from './view/FlexibleCard/components/blocks';
|
|
16
|
+
export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from './view/FlexibleCard/components/blocks';
|
package/dist/es2019/version.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as FooterBlock } from './footer-block';
|
|
2
2
|
export { default as MetadataBlock } from './metadata-block';
|
|
3
|
+
export { default as PreviewBlock } from './preview-block';
|
|
3
4
|
export { default as SnippetBlock } from './snippet-block';
|
|
4
5
|
export { default as TitleBlock } from './title-block';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { SmartLinkStatus } from '../../../../../constants';
|
|
4
|
+
import Block from '../block';
|
|
5
|
+
import { Preview } from '../../elements';
|
|
6
|
+
|
|
7
|
+
const PreviewBlock = ({
|
|
8
|
+
status = SmartLinkStatus.Fallback,
|
|
9
|
+
testId = 'smart-block-preview',
|
|
10
|
+
...blockProps
|
|
11
|
+
}) => {
|
|
12
|
+
if (status !== SmartLinkStatus.Resolved) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
17
|
+
testId: `${testId}-resolved-view`
|
|
18
|
+
}), /*#__PURE__*/React.createElement(Preview, null));
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
export default PreviewBlock;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/esm/index.js
CHANGED
|
@@ -13,4 +13,4 @@ export { contentFooterClassName, metadataListClassName, blockCardResolvingViewCl
|
|
|
13
13
|
export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/LazyFallback'; // Flexible UI
|
|
14
14
|
|
|
15
15
|
export { ActionName, ElementName, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from './constants';
|
|
16
|
-
export { MetadataBlock, SnippetBlock, TitleBlock } from './view/FlexibleCard/components/blocks';
|
|
16
|
+
export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock } from './view/FlexibleCard/components/blocks';
|
package/dist/esm/version.json
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as FooterBlock } from './footer-block';
|
|
2
2
|
export { default as MetadataBlock } from './metadata-block';
|
|
3
|
+
export { default as PreviewBlock } from './preview-block';
|
|
3
4
|
export { default as SnippetBlock } from './snippet-block';
|
|
4
5
|
export { default as TitleBlock } from './title-block';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["status", "testId"];
|
|
4
|
+
import React from 'react';
|
|
5
|
+
import { SmartLinkStatus } from '../../../../../constants';
|
|
6
|
+
import Block from '../block';
|
|
7
|
+
import { Preview } from '../../elements';
|
|
8
|
+
|
|
9
|
+
var PreviewBlock = function PreviewBlock(_ref) {
|
|
10
|
+
var _ref$status = _ref.status,
|
|
11
|
+
status = _ref$status === void 0 ? SmartLinkStatus.Fallback : _ref$status,
|
|
12
|
+
_ref$testId = _ref.testId,
|
|
13
|
+
testId = _ref$testId === void 0 ? 'smart-block-preview' : _ref$testId,
|
|
14
|
+
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
15
|
+
|
|
16
|
+
if (status !== SmartLinkStatus.Resolved) {
|
|
17
|
+
return null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
|
|
21
|
+
testId: "".concat(testId, "-resolved-view")
|
|
22
|
+
}), /*#__PURE__*/React.createElement(Preview, null));
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default PreviewBlock;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -17,5 +17,5 @@ export { useSmartLinkEvents } from './view/SmartLinkEvents/useSmartLinkEvents';
|
|
|
17
17
|
export { contentFooterClassName, metadataListClassName, blockCardResolvingViewClassName, blockCardResolvedViewClassName, blockCardForbiddenViewClassName, blockCardIconImageClassName, blockCardResolvedViewByClassName, blockCardForbiddenViewLinkClassName, blockCardContentClassName, blockCardContentHeaderClassName, blockCardContentHeaderNameClassName, blockCardNotFoundViewClassName, blockCardErroredViewClassName, } from './classNames';
|
|
18
18
|
export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/LazyFallback';
|
|
19
19
|
export { ActionName, ElementName, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, } from './constants';
|
|
20
|
-
export { MetadataBlock, SnippetBlock, TitleBlock, } from './view/FlexibleCard/components/blocks';
|
|
20
|
+
export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, } from './view/FlexibleCard/components/blocks';
|
|
21
21
|
export type { ActionItem, ElementItem, } from './view/FlexibleCard/components/blocks/types';
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export { default as FooterBlock } from './footer-block';
|
|
2
2
|
export { default as MetadataBlock } from './metadata-block';
|
|
3
|
+
export { default as PreviewBlock } from './preview-block';
|
|
3
4
|
export { default as SnippetBlock } from './snippet-block';
|
|
4
5
|
export { default as TitleBlock } from './title-block';
|