@atlaskit/smart-card 26.27.2 → 26.28.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 +12 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +5 -3
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +4 -2
- package/dist/cjs/view/FlexibleCard/components/elements/index.js +10 -3
- package/dist/cjs/view/FlexibleCard/components/elements/preview/index.js +35 -0
- package/dist/cjs/view/FlexibleCard/components/elements/preview/types.js +5 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +4 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/elements/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/elements/preview/index.js +23 -0
- package/dist/es2019/view/FlexibleCard/components/elements/preview/types.js +1 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +5 -3
- package/dist/esm/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +4 -2
- package/dist/esm/view/FlexibleCard/components/elements/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/elements/preview/index.js +24 -0
- package/dist/esm/view/FlexibleCard/components/elements/preview/types.js +1 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/preview-block/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/elements/index.d.ts +1 -2
- package/dist/types/view/FlexibleCard/components/elements/preview/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/elements/preview/types.d.ts +13 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/preview-block/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/index.d.ts +1 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/preview/index.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/elements/preview/types.d.ts +13 -0
- package/package.json +3 -3
- package/report.api.md +1 -0
- package/tmp/api-report-tmp.d.ts +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.28.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [`1fedffbd64b`](https://bitbucket.org/atlassian/atlassian-frontend/commits/1fedffbd64b) - Update json-ld-types dependencies to be compatible with version
|
|
8
|
+
|
|
9
|
+
## 26.28.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- [`46afccdf430`](https://bitbucket.org/atlassian/atlassian-frontend/commits/46afccdf430) - Flexible-UI: Add url override option to preview block
|
|
14
|
+
|
|
3
15
|
## 26.27.2
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -23,7 +23,7 @@ exports.ANALYTICS_CHANNEL = ANALYTICS_CHANNEL;
|
|
|
23
23
|
var context = {
|
|
24
24
|
componentName: 'smart-cards',
|
|
25
25
|
packageName: "@atlaskit/smart-card",
|
|
26
|
-
packageVersion: "26.
|
|
26
|
+
packageVersion: "26.28.1"
|
|
27
27
|
};
|
|
28
28
|
exports.context = context;
|
|
29
29
|
var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
@@ -11,12 +11,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
11
11
|
var _react2 = require("@emotion/react");
|
|
12
12
|
var _constants = require("../../../../../constants");
|
|
13
13
|
var _resolved = _interopRequireDefault(require("./resolved"));
|
|
14
|
-
var _excluded = ["status", "testId"];
|
|
14
|
+
var _excluded = ["status", "testId", "overrideUrl"];
|
|
15
15
|
/** @jsx jsx */
|
|
16
16
|
/**
|
|
17
17
|
* Represents a PreviewBlock, which typically contains media or other large format content.
|
|
18
18
|
* @public
|
|
19
|
-
* @param {
|
|
19
|
+
* @param {PreviewBlockProps} PreviewBlock
|
|
20
20
|
* @see Block
|
|
21
21
|
*/
|
|
22
22
|
var PreviewBlock = function PreviewBlock(_ref) {
|
|
@@ -24,12 +24,14 @@ var PreviewBlock = function PreviewBlock(_ref) {
|
|
|
24
24
|
status = _ref$status === void 0 ? _constants.SmartLinkStatus.Fallback : _ref$status,
|
|
25
25
|
_ref$testId = _ref.testId,
|
|
26
26
|
testId = _ref$testId === void 0 ? 'smart-block-preview' : _ref$testId,
|
|
27
|
+
overrideUrl = _ref.overrideUrl,
|
|
27
28
|
blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
28
29
|
if (status !== _constants.SmartLinkStatus.Resolved) {
|
|
29
30
|
return null;
|
|
30
31
|
}
|
|
31
32
|
return (0, _react2.jsx)(_resolved.default, (0, _extends2.default)({}, blockProps, {
|
|
32
|
-
testId: testId
|
|
33
|
+
testId: testId,
|
|
34
|
+
overrideUrl: overrideUrl
|
|
33
35
|
}));
|
|
34
36
|
};
|
|
35
37
|
var _default = PreviewBlock;
|
|
@@ -15,7 +15,7 @@ var _react2 = require("@emotion/react");
|
|
|
15
15
|
var _constants = require("../../../../../../constants");
|
|
16
16
|
var _block = _interopRequireDefault(require("../../block"));
|
|
17
17
|
var _elements = require("../../../elements");
|
|
18
|
-
var _excluded = ["ignoreContainerPadding", "onError", "overrideCss", "placement", "testId"];
|
|
18
|
+
var _excluded = ["ignoreContainerPadding", "onError", "overrideCss", "placement", "testId", "overrideUrl"];
|
|
19
19
|
var _templateObject, _templateObject2, _templateObject3;
|
|
20
20
|
/** @jsx jsx */
|
|
21
21
|
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); }
|
|
@@ -58,6 +58,7 @@ var PreviewBlockResolvedView = function PreviewBlockResolvedView(_ref) {
|
|
|
58
58
|
overrideCss = _ref.overrideCss,
|
|
59
59
|
placement = _ref.placement,
|
|
60
60
|
testId = _ref.testId,
|
|
61
|
+
overrideUrl = _ref.overrideUrl,
|
|
61
62
|
blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
62
63
|
var _useState = (0, _react.useState)(overrideCss),
|
|
63
64
|
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
@@ -82,7 +83,8 @@ var PreviewBlockResolvedView = function PreviewBlockResolvedView(_ref) {
|
|
|
82
83
|
testId: "".concat(testId, "-resolved-view")
|
|
83
84
|
}), (0, _react2.jsx)(_elements.Preview, {
|
|
84
85
|
onError: handleOnError,
|
|
85
|
-
onLoad: handleOnLoad
|
|
86
|
+
onLoad: handleOnLoad,
|
|
87
|
+
overrideUrl: overrideUrl
|
|
86
88
|
}));
|
|
87
89
|
};
|
|
88
90
|
var _default = PreviewBlockResolvedView;
|
|
@@ -1,11 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
3
4
|
Object.defineProperty(exports, "__esModule", {
|
|
4
5
|
value: true
|
|
5
6
|
});
|
|
6
|
-
exports.
|
|
7
|
+
exports.OwnedByGroup = exports.OwnedBy = exports.ModifiedOn = exports.ModifiedBy = exports.Location = exports.LinkIcon = exports.LatestCommit = exports.DueOn = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.ChecklistProgress = exports.AuthorGroup = exports.AttachmentCount = exports.AssignedToGroup = exports.AssignedTo = void 0;
|
|
8
|
+
Object.defineProperty(exports, "Preview", {
|
|
9
|
+
enumerable: true,
|
|
10
|
+
get: function get() {
|
|
11
|
+
return _preview.default;
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
exports.VoteCount = exports.ViewCount = exports.Title = exports.TargetBranch = exports.SubscriberCount = exports.SubTasksProgress = exports.StoryPoints = exports.State = exports.SourceBranch = exports.Snippet = exports.SentOn = exports.ReadTime = exports.ReactCount = exports.Provider = exports.ProgrammingLanguage = exports.Priority = void 0;
|
|
7
15
|
var _utils = require("./utils");
|
|
8
16
|
var _constants = require("../../../../constants");
|
|
17
|
+
var _preview = _interopRequireDefault(require("./preview"));
|
|
9
18
|
// Attention: Keep the export name and element name the same.
|
|
10
19
|
// This will help reducing the code for mapping elements inside
|
|
11
20
|
// createElement and renderElementItems
|
|
@@ -115,12 +124,10 @@ var OwnedByGroup = (0, _utils.createElement)(_constants.ElementName.OwnedByGroup
|
|
|
115
124
|
* @see Preview
|
|
116
125
|
*/
|
|
117
126
|
exports.OwnedByGroup = OwnedByGroup;
|
|
118
|
-
var Preview = (0, _utils.createElement)(_constants.ElementName.Preview);
|
|
119
127
|
/**
|
|
120
128
|
* Creates a Priority Badge element using the data from Priority in the Flexible UI Context.
|
|
121
129
|
* @see Badge
|
|
122
130
|
*/
|
|
123
|
-
exports.Preview = Preview;
|
|
124
131
|
var Priority = (0, _utils.createElement)(_constants.ElementName.Priority);
|
|
125
132
|
/**
|
|
126
133
|
* Creates a ProgrammingLanguage Badge element using the data from ProgrammingLanguage in the Flexible UI Context.
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.default = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _react2 = require("@emotion/react");
|
|
13
|
+
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
14
|
+
var _constants = require("../../../../../constants");
|
|
15
|
+
var _media = _interopRequireDefault(require("../media"));
|
|
16
|
+
var _excluded = ["overrideUrl"];
|
|
17
|
+
/** @jsx jsx */
|
|
18
|
+
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); }
|
|
19
|
+
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; }
|
|
20
|
+
var Preview = function Preview(props) {
|
|
21
|
+
var _ref = props !== null && props !== void 0 ? props : {},
|
|
22
|
+
overrideUrl = _ref.overrideUrl,
|
|
23
|
+
rest = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
24
|
+
var context = (0, _react.useContext)(_flexibleUiContext.FlexibleUiContext);
|
|
25
|
+
var data = overrideUrl ? {
|
|
26
|
+
url: overrideUrl,
|
|
27
|
+
type: _constants.MediaType.Image
|
|
28
|
+
} : context === null || context === void 0 ? void 0 : context.preview;
|
|
29
|
+
if (!data) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
return (0, _react2.jsx)(_media.default, (0, _extends2.default)({}, rest, data));
|
|
33
|
+
};
|
|
34
|
+
var _default = Preview;
|
|
35
|
+
exports.default = _default;
|
|
@@ -18,7 +18,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
18
18
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
19
19
|
var PACKAGE_DATA = {
|
|
20
20
|
packageName: "@atlaskit/smart-card",
|
|
21
|
-
packageVersion: "26.
|
|
21
|
+
packageVersion: "26.28.1",
|
|
22
22
|
componentName: 'linkUrl'
|
|
23
23
|
};
|
|
24
24
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.
|
|
7
|
+
packageVersion: "26.28.1"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -8,19 +8,21 @@ import PreviewBlockResolvedView from './resolved';
|
|
|
8
8
|
/**
|
|
9
9
|
* Represents a PreviewBlock, which typically contains media or other large format content.
|
|
10
10
|
* @public
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {PreviewBlockProps} PreviewBlock
|
|
12
12
|
* @see Block
|
|
13
13
|
*/
|
|
14
14
|
const PreviewBlock = ({
|
|
15
15
|
status = SmartLinkStatus.Fallback,
|
|
16
16
|
testId = 'smart-block-preview',
|
|
17
|
+
overrideUrl,
|
|
17
18
|
...blockProps
|
|
18
19
|
}) => {
|
|
19
20
|
if (status !== SmartLinkStatus.Resolved) {
|
|
20
21
|
return null;
|
|
21
22
|
}
|
|
22
23
|
return jsx(PreviewBlockResolvedView, _extends({}, blockProps, {
|
|
23
|
-
testId: testId
|
|
24
|
+
testId: testId,
|
|
25
|
+
overrideUrl: overrideUrl
|
|
24
26
|
}));
|
|
25
27
|
};
|
|
26
28
|
export default PreviewBlock;
|
|
@@ -68,6 +68,7 @@ const PreviewBlockResolvedView = ({
|
|
|
68
68
|
overrideCss,
|
|
69
69
|
placement,
|
|
70
70
|
testId,
|
|
71
|
+
overrideUrl,
|
|
71
72
|
...blockProps
|
|
72
73
|
}) => {
|
|
73
74
|
const [styles, setStyles] = useState(overrideCss);
|
|
@@ -93,7 +94,8 @@ const PreviewBlockResolvedView = ({
|
|
|
93
94
|
testId: `${testId}-resolved-view`
|
|
94
95
|
}), jsx(Preview, {
|
|
95
96
|
onError: handleOnError,
|
|
96
|
-
onLoad: handleOnLoad
|
|
97
|
+
onLoad: handleOnLoad,
|
|
98
|
+
overrideUrl: overrideUrl
|
|
97
99
|
}));
|
|
98
100
|
};
|
|
99
101
|
export default PreviewBlockResolvedView;
|
|
@@ -92,7 +92,7 @@ export const OwnedByGroup = createElement(ElementName.OwnedByGroup);
|
|
|
92
92
|
* Creates a Preview element using the data from Preview in the Flexible UI Context.
|
|
93
93
|
* @see Preview
|
|
94
94
|
*/
|
|
95
|
-
export
|
|
95
|
+
export { default as Preview } from './preview';
|
|
96
96
|
/**
|
|
97
97
|
* Creates a Priority Badge element using the data from Priority in the Flexible UI Context.
|
|
98
98
|
* @see Badge
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
/** @jsx jsx */
|
|
3
|
+
import React, { useContext } from 'react';
|
|
4
|
+
import { jsx } from '@emotion/react';
|
|
5
|
+
import { FlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
6
|
+
import { MediaType } from '../../../../../constants';
|
|
7
|
+
import Media from '../media';
|
|
8
|
+
const Preview = props => {
|
|
9
|
+
const {
|
|
10
|
+
overrideUrl,
|
|
11
|
+
...rest
|
|
12
|
+
} = props !== null && props !== void 0 ? props : {};
|
|
13
|
+
const context = useContext(FlexibleUiContext);
|
|
14
|
+
const data = overrideUrl ? {
|
|
15
|
+
url: overrideUrl,
|
|
16
|
+
type: MediaType.Image
|
|
17
|
+
} : context === null || context === void 0 ? void 0 : context.preview;
|
|
18
|
+
if (!data) {
|
|
19
|
+
return null;
|
|
20
|
+
}
|
|
21
|
+
return jsx(Media, _extends({}, rest, data));
|
|
22
|
+
};
|
|
23
|
+
export default Preview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -8,7 +8,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
8
8
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
9
9
|
const PACKAGE_DATA = {
|
|
10
10
|
packageName: "@atlaskit/smart-card",
|
|
11
|
-
packageVersion: "26.
|
|
11
|
+
packageVersion: "26.28.1",
|
|
12
12
|
componentName: 'linkUrl'
|
|
13
13
|
};
|
|
14
14
|
const Link = withLinkClickedEvent('a');
|
|
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
15
15
|
export var context = {
|
|
16
16
|
componentName: 'smart-cards',
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "26.
|
|
18
|
+
packageVersion: "26.28.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -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 = ["status", "testId"];
|
|
3
|
+
var _excluded = ["status", "testId", "overrideUrl"];
|
|
4
4
|
/** @jsx jsx */
|
|
5
5
|
import React from 'react';
|
|
6
6
|
import { jsx } from '@emotion/react';
|
|
@@ -10,7 +10,7 @@ import PreviewBlockResolvedView from './resolved';
|
|
|
10
10
|
/**
|
|
11
11
|
* Represents a PreviewBlock, which typically contains media or other large format content.
|
|
12
12
|
* @public
|
|
13
|
-
* @param {
|
|
13
|
+
* @param {PreviewBlockProps} PreviewBlock
|
|
14
14
|
* @see Block
|
|
15
15
|
*/
|
|
16
16
|
var PreviewBlock = function PreviewBlock(_ref) {
|
|
@@ -18,12 +18,14 @@ var PreviewBlock = function PreviewBlock(_ref) {
|
|
|
18
18
|
status = _ref$status === void 0 ? SmartLinkStatus.Fallback : _ref$status,
|
|
19
19
|
_ref$testId = _ref.testId,
|
|
20
20
|
testId = _ref$testId === void 0 ? 'smart-block-preview' : _ref$testId,
|
|
21
|
+
overrideUrl = _ref.overrideUrl,
|
|
21
22
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
22
23
|
if (status !== SmartLinkStatus.Resolved) {
|
|
23
24
|
return null;
|
|
24
25
|
}
|
|
25
26
|
return jsx(PreviewBlockResolvedView, _extends({}, blockProps, {
|
|
26
|
-
testId: testId
|
|
27
|
+
testId: testId,
|
|
28
|
+
overrideUrl: overrideUrl
|
|
27
29
|
}));
|
|
28
30
|
};
|
|
29
31
|
export default PreviewBlock;
|
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
4
4
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
5
|
-
var _excluded = ["ignoreContainerPadding", "onError", "overrideCss", "placement", "testId"];
|
|
5
|
+
var _excluded = ["ignoreContainerPadding", "onError", "overrideCss", "placement", "testId", "overrideUrl"];
|
|
6
6
|
var _templateObject, _templateObject2, _templateObject3;
|
|
7
7
|
/** @jsx jsx */
|
|
8
8
|
import React, { useCallback, useEffect, useState } from 'react';
|
|
@@ -49,6 +49,7 @@ var PreviewBlockResolvedView = function PreviewBlockResolvedView(_ref) {
|
|
|
49
49
|
overrideCss = _ref.overrideCss,
|
|
50
50
|
placement = _ref.placement,
|
|
51
51
|
testId = _ref.testId,
|
|
52
|
+
overrideUrl = _ref.overrideUrl,
|
|
52
53
|
blockProps = _objectWithoutProperties(_ref, _excluded);
|
|
53
54
|
var _useState = useState(overrideCss),
|
|
54
55
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -73,7 +74,8 @@ var PreviewBlockResolvedView = function PreviewBlockResolvedView(_ref) {
|
|
|
73
74
|
testId: "".concat(testId, "-resolved-view")
|
|
74
75
|
}), jsx(Preview, {
|
|
75
76
|
onError: handleOnError,
|
|
76
|
-
onLoad: handleOnLoad
|
|
77
|
+
onLoad: handleOnLoad,
|
|
78
|
+
overrideUrl: overrideUrl
|
|
77
79
|
}));
|
|
78
80
|
};
|
|
79
81
|
export default PreviewBlockResolvedView;
|
|
@@ -92,7 +92,7 @@ export var OwnedByGroup = createElement(ElementName.OwnedByGroup);
|
|
|
92
92
|
* Creates a Preview element using the data from Preview in the Flexible UI Context.
|
|
93
93
|
* @see Preview
|
|
94
94
|
*/
|
|
95
|
-
export
|
|
95
|
+
export { default as Preview } from './preview';
|
|
96
96
|
/**
|
|
97
97
|
* Creates a Priority Badge element using the data from Priority in the Flexible UI Context.
|
|
98
98
|
* @see Badge
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["overrideUrl"];
|
|
4
|
+
/** @jsx jsx */
|
|
5
|
+
import React, { useContext } from 'react';
|
|
6
|
+
import { jsx } from '@emotion/react';
|
|
7
|
+
import { FlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
|
+
import { MediaType } from '../../../../../constants';
|
|
9
|
+
import Media from '../media';
|
|
10
|
+
var Preview = function Preview(props) {
|
|
11
|
+
var _ref = props !== null && props !== void 0 ? props : {},
|
|
12
|
+
overrideUrl = _ref.overrideUrl,
|
|
13
|
+
rest = _objectWithoutProperties(_ref, _excluded);
|
|
14
|
+
var context = useContext(FlexibleUiContext);
|
|
15
|
+
var data = overrideUrl ? {
|
|
16
|
+
url: overrideUrl,
|
|
17
|
+
type: MediaType.Image
|
|
18
|
+
} : context === null || context === void 0 ? void 0 : context.preview;
|
|
19
|
+
if (!data) {
|
|
20
|
+
return null;
|
|
21
|
+
}
|
|
22
|
+
return jsx(Media, _extends({}, rest, data));
|
|
23
|
+
};
|
|
24
|
+
export default Preview;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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.28.1",
|
|
15
15
|
componentName: 'linkUrl'
|
|
16
16
|
};
|
|
17
17
|
var Link = withLinkClickedEvent('a');
|
|
@@ -4,7 +4,7 @@ import { PreviewBlockProps } from './types';
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents a PreviewBlock, which typically contains media or other large format content.
|
|
6
6
|
* @public
|
|
7
|
-
* @param {
|
|
7
|
+
* @param {PreviewBlockProps} PreviewBlock
|
|
8
8
|
* @see Block
|
|
9
9
|
*/
|
|
10
10
|
declare const PreviewBlock: React.FC<PreviewBlockProps>;
|
|
@@ -6,7 +6,6 @@ import { LozengeProps } from './lozenge/types';
|
|
|
6
6
|
import { AvatarGroupProps } from './avatar-group/types';
|
|
7
7
|
import { TextProps } from './text/types';
|
|
8
8
|
import { DateTimeProps } from './date-time/types';
|
|
9
|
-
import { MediaProps } from './media/types';
|
|
10
9
|
import { AtlaskitBadgeProps } from './atlaskit-badge/types';
|
|
11
10
|
/**
|
|
12
11
|
* Creates a AssignedTo text element using the data from AssignedTo in the Flexible UI Context.
|
|
@@ -97,7 +96,7 @@ export declare const OwnedByGroup: import("react").FC<AvatarGroupProps>;
|
|
|
97
96
|
* Creates a Preview element using the data from Preview in the Flexible UI Context.
|
|
98
97
|
* @see Preview
|
|
99
98
|
*/
|
|
100
|
-
export
|
|
99
|
+
export { default as Preview } from './preview';
|
|
101
100
|
/**
|
|
102
101
|
* Creates a Priority Badge element using the data from Priority in the Flexible UI Context.
|
|
103
102
|
* @see Badge
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementProps } from '../types';
|
|
2
|
+
export type PreviewProps = ElementProps & {
|
|
3
|
+
/**
|
|
4
|
+
* An image URL to render. This will replace the default image from smart link data.
|
|
5
|
+
*/
|
|
6
|
+
overrideUrl?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Function to be called on error loading media.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
onError?: () => void;
|
|
12
|
+
onLoad?: () => void;
|
|
13
|
+
};
|
|
@@ -4,7 +4,7 @@ import { PreviewBlockProps } from './types';
|
|
|
4
4
|
/**
|
|
5
5
|
* Represents a PreviewBlock, which typically contains media or other large format content.
|
|
6
6
|
* @public
|
|
7
|
-
* @param {
|
|
7
|
+
* @param {PreviewBlockProps} PreviewBlock
|
|
8
8
|
* @see Block
|
|
9
9
|
*/
|
|
10
10
|
declare const PreviewBlock: React.FC<PreviewBlockProps>;
|
|
@@ -6,7 +6,6 @@ import { LozengeProps } from './lozenge/types';
|
|
|
6
6
|
import { AvatarGroupProps } from './avatar-group/types';
|
|
7
7
|
import { TextProps } from './text/types';
|
|
8
8
|
import { DateTimeProps } from './date-time/types';
|
|
9
|
-
import { MediaProps } from './media/types';
|
|
10
9
|
import { AtlaskitBadgeProps } from './atlaskit-badge/types';
|
|
11
10
|
/**
|
|
12
11
|
* Creates a AssignedTo text element using the data from AssignedTo in the Flexible UI Context.
|
|
@@ -97,7 +96,7 @@ export declare const OwnedByGroup: import("react").FC<AvatarGroupProps>;
|
|
|
97
96
|
* Creates a Preview element using the data from Preview in the Flexible UI Context.
|
|
98
97
|
* @see Preview
|
|
99
98
|
*/
|
|
100
|
-
export
|
|
99
|
+
export { default as Preview } from './preview';
|
|
101
100
|
/**
|
|
102
101
|
* Creates a Priority Badge element using the data from Priority in the Flexible UI Context.
|
|
103
102
|
* @see Badge
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ElementProps } from '../types';
|
|
2
|
+
export type PreviewProps = ElementProps & {
|
|
3
|
+
/**
|
|
4
|
+
* An image URL to render. This will replace the default image from smart link data.
|
|
5
|
+
*/
|
|
6
|
+
overrideUrl?: string;
|
|
7
|
+
/**
|
|
8
|
+
* Function to be called on error loading media.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
onError?: () => void;
|
|
12
|
+
onLoad?: () => void;
|
|
13
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/smart-card",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.28.1",
|
|
4
4
|
"description": "Smart card component",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"registry": "https://registry.npmjs.org/"
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@atlaskit/outbound-auth-flow-client": "^3.4.0",
|
|
47
47
|
"@atlaskit/platform-feature-flags": "^0.2.1",
|
|
48
48
|
"@atlaskit/popup": "^1.10.0",
|
|
49
|
-
"@atlaskit/spinner": "^15.
|
|
49
|
+
"@atlaskit/spinner": "^15.6.0",
|
|
50
50
|
"@atlaskit/theme": "^12.6.0",
|
|
51
51
|
"@atlaskit/tokens": "^1.25.0",
|
|
52
52
|
"@atlaskit/tooltip": "^17.8.0",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"@emotion/styled": "^11.0.0",
|
|
57
57
|
"@formatjs/intl-utils": "^3.8.4",
|
|
58
58
|
"facepaint": "^1.2.1",
|
|
59
|
-
"json-ld-types": "3.9.1",
|
|
59
|
+
"json-ld-types": "^3.9.1",
|
|
60
60
|
"react-error-boundary": "^3.1.3",
|
|
61
61
|
"react-lazily-render": "^1.2.0",
|
|
62
62
|
"react-loadable": "^5.1.0",
|
package/report.api.md
CHANGED