@atlaskit/smart-card 17.5.0 → 17.5.3

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.
Files changed (54) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/dist/cjs/constants.js +14 -2
  3. package/dist/cjs/extractors/flexible/extract-preview.js +21 -0
  4. package/dist/cjs/extractors/flexible/index.js +3 -0
  5. package/dist/cjs/index.js +6 -0
  6. package/dist/cjs/version.json +1 -1
  7. package/dist/cjs/view/FlexibleCard/components/blocks/index.js +8 -0
  8. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +41 -0
  9. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/types.js +5 -0
  10. package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +1 -1
  11. package/dist/cjs/view/FlexibleCard/components/elements/index.js +3 -1
  12. package/dist/cjs/view/FlexibleCard/components/elements/media/index.js +45 -0
  13. package/dist/cjs/view/FlexibleCard/components/elements/media/types.js +5 -0
  14. package/dist/cjs/view/FlexibleCard/components/elements/utils.js +4 -0
  15. package/dist/cjs/view/InlineCard/Frame/index.js +1 -6
  16. package/dist/es2019/constants.js +11 -1
  17. package/dist/es2019/extractors/flexible/extract-preview.js +12 -0
  18. package/dist/es2019/extractors/flexible/index.js +2 -0
  19. package/dist/es2019/index.js +1 -1
  20. package/dist/es2019/version.json +1 -1
  21. package/dist/es2019/view/FlexibleCard/components/blocks/index.js +1 -0
  22. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +21 -0
  23. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/types.js +1 -0
  24. package/dist/es2019/view/FlexibleCard/components/blocks/utils.js +1 -0
  25. package/dist/es2019/view/FlexibleCard/components/elements/index.js +1 -0
  26. package/dist/es2019/view/FlexibleCard/components/elements/media/index.js +35 -0
  27. package/dist/es2019/view/FlexibleCard/components/elements/media/types.js +1 -0
  28. package/dist/es2019/view/FlexibleCard/components/elements/utils.js +4 -0
  29. package/dist/es2019/view/InlineCard/Frame/index.js +1 -6
  30. package/dist/esm/constants.js +11 -1
  31. package/dist/esm/extractors/flexible/extract-preview.js +12 -0
  32. package/dist/esm/extractors/flexible/index.js +2 -0
  33. package/dist/esm/index.js +1 -1
  34. package/dist/esm/version.json +1 -1
  35. package/dist/esm/view/FlexibleCard/components/blocks/index.js +1 -0
  36. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +25 -0
  37. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/types.js +1 -0
  38. package/dist/esm/view/FlexibleCard/components/blocks/utils.js +1 -1
  39. package/dist/esm/view/FlexibleCard/components/elements/index.js +1 -0
  40. package/dist/esm/view/FlexibleCard/components/elements/media/index.js +34 -0
  41. package/dist/esm/view/FlexibleCard/components/elements/media/types.js +1 -0
  42. package/dist/esm/view/FlexibleCard/components/elements/utils.js +3 -0
  43. package/dist/esm/view/InlineCard/Frame/index.js +1 -6
  44. package/dist/types/constants.d.ts +7 -0
  45. package/dist/types/extractors/flexible/extract-preview.d.ts +4 -0
  46. package/dist/types/index.d.ts +1 -1
  47. package/dist/types/state/flexible-ui-context/types.d.ts +6 -1
  48. package/dist/types/view/FlexibleCard/components/blocks/index.d.ts +1 -0
  49. package/dist/types/view/FlexibleCard/components/blocks/preview-block/index.d.ts +4 -0
  50. package/dist/types/view/FlexibleCard/components/blocks/preview-block/types.d.ts +2 -0
  51. package/dist/types/view/FlexibleCard/components/elements/index.d.ts +2 -0
  52. package/dist/types/view/FlexibleCard/components/elements/media/index.d.ts +5 -0
  53. package/dist/types/view/FlexibleCard/components/elements/media/types.d.ts +6 -0
  54. package/package.json +1 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,23 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 17.5.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`e68f0f554fa`](https://bitbucket.org/atlassian/atlassian-frontend/commits/e68f0f554fa) - remove mousedown handler for inline links and add a vr test for the logic
8
+
9
+ ## 17.5.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`0fb7e85e70a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/0fb7e85e70a) - Flexible UI: Add PreviewBlock
14
+
15
+ ## 17.5.1
16
+
17
+ ### Patch Changes
18
+
19
+ - [`238facb8e1a`](https://bitbucket.org/atlassian/atlassian-frontend/commits/238facb8e1a) - Flexible UI: Add Preview element
20
+
3
21
  ## 17.5.0
4
22
 
5
23
  ### Minor Changes
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.SmartLinkWidth = exports.SmartLinkTheme = exports.SmartLinkStatus = exports.SmartLinkSize = exports.SmartLinkPosition = exports.SmartLinkDirection = exports.SmartLinkAlignment = exports.IconType = exports.ElementName = exports.ActionName = void 0;
6
+ exports.SmartLinkWidth = exports.SmartLinkTheme = exports.SmartLinkStatus = exports.SmartLinkSize = exports.SmartLinkPosition = exports.SmartLinkDirection = exports.SmartLinkAlignment = exports.MediaType = exports.IconType = exports.ElementName = exports.ActionName = void 0;
7
7
 
8
8
  /**
9
9
  * The alignment of Flexible UI component.
@@ -137,6 +137,7 @@ exports.ElementName = ElementName;
137
137
  ElementName["LinkIcon"] = "LinkIcon";
138
138
  ElementName["ModifiedBy"] = "ModifiedBy";
139
139
  ElementName["ModifiedOn"] = "ModifiedOn";
140
+ ElementName["Preview"] = "Preview";
140
141
  ElementName["Priority"] = "Priority";
141
142
  ElementName["ProgrammingLanguage"] = "ProgrammingLanguage";
142
143
  ElementName["Snippet"] = "Snippet";
@@ -158,6 +159,10 @@ exports.ActionName = ActionName;
158
159
  })(ActionName || (exports.ActionName = ActionName = {}));
159
160
 
160
161
  var IconType;
162
+ /**
163
+ * Type for Flexible UI's Media element
164
+ */
165
+
161
166
  exports.IconType = IconType;
162
167
 
163
168
  (function (IconType) {
@@ -218,4 +223,11 @@ exports.IconType = IconType;
218
223
  IconType["PriorityUndefined"] = "Badge:PriorityUndefined";
219
224
  IconType["ProgrammingLanguage"] = "Badge:ProgrammingLanguage";
220
225
  IconType["Subscriber"] = "Badge:Subscriber";
221
- })(IconType || (exports.IconType = IconType = {}));
226
+ })(IconType || (exports.IconType = IconType = {}));
227
+
228
+ var MediaType;
229
+ exports.MediaType = MediaType;
230
+
231
+ (function (MediaType) {
232
+ MediaType["Image"] = "image";
233
+ })(MediaType || (exports.MediaType = MediaType = {}));
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+
8
+ var _preview = require("../common/preview");
9
+
10
+ var _constants = require("../../constants");
11
+
12
+ var extractPreview = function extractPreview(data) {
13
+ var url = (0, _preview.extractImage)(data);
14
+ return url ? {
15
+ type: _constants.MediaType.Image,
16
+ url: url
17
+ } : undefined;
18
+ };
19
+
20
+ var _default = extractPreview;
21
+ exports.default = _default;
@@ -27,6 +27,8 @@ var _extractPriority = _interopRequireDefault(require("./extract-priority"));
27
27
 
28
28
  var _extractProviderIcon = _interopRequireDefault(require("./icon/extract-provider-icon"));
29
29
 
30
+ var _extractPreview = _interopRequireDefault(require("./extract-preview"));
31
+
30
32
  var extractFlexibleUiContext = function extractFlexibleUiContext(response, renderers) {
31
33
  if (!response) {
32
34
  return undefined;
@@ -43,6 +45,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext(response, rende
43
45
  linkIcon: (0, _icon.extractLinkIcon)(response, renderers),
44
46
  modifiedBy: (0, _utils.extractModifiedBy)(data),
45
47
  modifiedOn: (0, _extractDateUpdated.extractDateUpdated)(data),
48
+ preview: (0, _extractPreview.default)(data),
46
49
  priority: (0, _extractPriority.default)(data),
47
50
  programmingLanguage: (0, _utils.extractProgrammingLanguage)(data),
48
51
  snippet: (0, _primitives.extractSummary)(data) || undefined,
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() {
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.5.0",
3
+ "version": "17.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -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;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -48,7 +48,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
48
48
 
49
49
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
50
50
 
51
- var ElementDisplaySchema = (_ElementDisplaySchema = {}, (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AuthorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CollaboratorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CommentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LinkIcon, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Priority, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ProgrammingLanguage, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Snippet, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.State, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubscriberCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Title, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Provider, ['inline']), _ElementDisplaySchema);
51
+ var ElementDisplaySchema = (_ElementDisplaySchema = {}, (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.AuthorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CollaboratorGroup, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CommentCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.CreatedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.LinkIcon, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedBy, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ModifiedOn, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Preview, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Priority, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.ProgrammingLanguage, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Snippet, ['block']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.State, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.SubscriberCount, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Title, ['inline']), (0, _defineProperty2.default)(_ElementDisplaySchema, _constants.ElementName.Provider, ['inline']), _ElementDisplaySchema);
52
52
  exports.ElementDisplaySchema = ElementDisplaySchema;
53
53
 
54
54
  var getDirectionStyles = function getDirectionStyles(direction) {
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.Title = exports.SubscriberCount = exports.State = exports.Snippet = exports.Provider = exports.ProgrammingLanguage = exports.Priority = exports.ModifiedOn = exports.ModifiedBy = exports.LinkIcon = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.AuthorGroup = void 0;
6
+ exports.Title = exports.SubscriberCount = exports.State = exports.Snippet = exports.Provider = exports.ProgrammingLanguage = exports.Priority = exports.Preview = exports.ModifiedOn = exports.ModifiedBy = exports.LinkIcon = exports.CreatedOn = exports.CreatedBy = exports.CommentCount = exports.CollaboratorGroup = exports.AuthorGroup = void 0;
7
7
 
8
8
  var _utils = require("./utils");
9
9
 
@@ -28,6 +28,8 @@ var ModifiedBy = (0, _utils.createElement)(_constants.ElementName.ModifiedBy);
28
28
  exports.ModifiedBy = ModifiedBy;
29
29
  var ModifiedOn = (0, _utils.createElement)(_constants.ElementName.ModifiedOn);
30
30
  exports.ModifiedOn = ModifiedOn;
31
+ var Preview = (0, _utils.createElement)(_constants.ElementName.Preview);
32
+ exports.Preview = Preview;
31
33
  var Priority = (0, _utils.createElement)(_constants.ElementName.Priority);
32
34
  exports.Priority = Priority;
33
35
  var ProgrammingLanguage = (0, _utils.createElement)(_constants.ElementName.ProgrammingLanguage);
@@ -0,0 +1,45 @@
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 _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
11
+
12
+ var _react = _interopRequireDefault(require("react"));
13
+
14
+ var _core = require("@emotion/core");
15
+
16
+ var _imageIcon = _interopRequireDefault(require("../../common/image-icon"));
17
+
18
+ var _templateObject;
19
+
20
+ var styles = function styles(url) {
21
+ return (0, _core.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n display: flex;\n justify-content: center;\n width: 100%;\n > img {\n max-width: 100%;\n max-height: 100%;\n }\n"])));
22
+ };
23
+
24
+ var Media = function Media(_ref) {
25
+ var _ref$testId = _ref.testId,
26
+ testId = _ref$testId === void 0 ? 'smart-element-media' : _ref$testId,
27
+ type = _ref.type,
28
+ url = _ref.url;
29
+
30
+ if (!type || !url) {
31
+ return null;
32
+ }
33
+
34
+ return (0, _core.jsx)("div", {
35
+ css: styles(url),
36
+ "data-smart-element-media": true,
37
+ "data-testid": testId
38
+ }, (0, _core.jsx)(_imageIcon.default, {
39
+ testId: "".concat(testId, "-image"),
40
+ url: url
41
+ }));
42
+ };
43
+
44
+ var _default = Media;
45
+ exports.default = _default;
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -29,6 +29,8 @@ var _badge = _interopRequireDefault(require("./badge"));
29
29
 
30
30
  var _avatarGroup = _interopRequireDefault(require("./avatar-group"));
31
31
 
32
+ var _media = _interopRequireDefault(require("./media"));
33
+
32
34
  var _text = _interopRequireDefault(require("./text"));
33
35
 
34
36
  var _messages = require("../../../../messages");
@@ -59,6 +61,8 @@ var elementMappings = (_elementMappings = {}, (0, _defineProperty2.default)(_ele
59
61
  component: _icon.default
60
62
  }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.ModifiedBy, {
61
63
  component: _text.default
64
+ }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.Preview, {
65
+ component: _media.default
62
66
  }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.Priority, {
63
67
  component: _badge.default
64
68
  }), (0, _defineProperty2.default)(_elementMappings, _constants.ElementName.ProgrammingLanguage, {
@@ -43,11 +43,7 @@ var Frame = function Frame(props) {
43
43
  event.stopPropagation();
44
44
  onClick(event);
45
45
  }
46
- }, [onClick]); // prevent default on mousedown to avoid inline card losing focus
47
-
48
- var handleMouseDown = (0, _react.useCallback)(function (e) {
49
- e.preventDefault();
50
- }, []);
46
+ }, [onClick]);
51
47
  var isInteractive = Boolean(onClick); // TODO Theming doesn't work right now in editor. Required React context does not trickle down atm.
52
48
  // It will be worked as part of https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-154
53
49
 
@@ -61,7 +57,6 @@ var Frame = function Frame(props) {
61
57
  tabIndex: isInteractive ? 0 : undefined,
62
58
  role: isInteractive ? 'button' : undefined,
63
59
  onClick: handleClick,
64
- onMouseDown: handleMouseDown,
65
60
  onKeyPress: handleKeyPress,
66
61
  "data-testid": testId,
67
62
  className: className
@@ -114,6 +114,7 @@ export let ElementName;
114
114
  ElementName["LinkIcon"] = "LinkIcon";
115
115
  ElementName["ModifiedBy"] = "ModifiedBy";
116
116
  ElementName["ModifiedOn"] = "ModifiedOn";
117
+ ElementName["Preview"] = "Preview";
117
118
  ElementName["Priority"] = "Priority";
118
119
  ElementName["ProgrammingLanguage"] = "ProgrammingLanguage";
119
120
  ElementName["Snippet"] = "Snippet";
@@ -133,6 +134,9 @@ export let ActionName;
133
134
  })(ActionName || (ActionName = {}));
134
135
 
135
136
  export let IconType;
137
+ /**
138
+ * Type for Flexible UI's Media element
139
+ */
136
140
 
137
141
  (function (IconType) {
138
142
  IconType["Archive"] = "FileType:Archive";
@@ -192,4 +196,10 @@ export let IconType;
192
196
  IconType["PriorityUndefined"] = "Badge:PriorityUndefined";
193
197
  IconType["ProgrammingLanguage"] = "Badge:ProgrammingLanguage";
194
198
  IconType["Subscriber"] = "Badge:Subscriber";
195
- })(IconType || (IconType = {}));
199
+ })(IconType || (IconType = {}));
200
+
201
+ export let MediaType;
202
+
203
+ (function (MediaType) {
204
+ MediaType["Image"] = "image";
205
+ })(MediaType || (MediaType = {}));
@@ -0,0 +1,12 @@
1
+ import { extractImage } from '../common/preview';
2
+ import { MediaType } from '../../constants';
3
+
4
+ const extractPreview = data => {
5
+ const url = extractImage(data);
6
+ return url ? {
7
+ type: MediaType.Image,
8
+ url
9
+ } : undefined;
10
+ };
11
+
12
+ export default extractPreview;
@@ -8,6 +8,7 @@ import { extractDateUpdated } from '../common/date/extractDateUpdated';
8
8
  import { extractDateCreated } from '../common/date/extractDateCreated';
9
9
  import extractPriority from './extract-priority';
10
10
  import extractProviderIcon from './icon/extract-provider-icon';
11
+ import extractPreview from './extract-preview';
11
12
 
12
13
  const extractFlexibleUiContext = (response, renderers) => {
13
14
  if (!response) {
@@ -25,6 +26,7 @@ const extractFlexibleUiContext = (response, renderers) => {
25
26
  linkIcon: extractLinkIcon(response, renderers),
26
27
  modifiedBy: extractModifiedBy(data),
27
28
  modifiedOn: extractDateUpdated(data),
29
+ preview: extractPreview(data),
28
30
  priority: extractPriority(data),
29
31
  programmingLanguage: extractProgrammingLanguage(data),
30
32
  snippet: extractSummary(data) || undefined,
@@ -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';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.5.0",
3
+ "version": "17.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -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;
@@ -16,6 +16,7 @@ export const ElementDisplaySchema = {
16
16
  [ElementName.LinkIcon]: ['inline'],
17
17
  [ElementName.ModifiedBy]: ['inline'],
18
18
  [ElementName.ModifiedOn]: ['inline'],
19
+ [ElementName.Preview]: ['block'],
19
20
  [ElementName.Priority]: ['inline'],
20
21
  [ElementName.ProgrammingLanguage]: ['inline'],
21
22
  [ElementName.Snippet]: ['block'],
@@ -11,6 +11,7 @@ export const CreatedOn = createElement(ElementName.CreatedOn);
11
11
  export const LinkIcon = createElement(ElementName.LinkIcon);
12
12
  export const ModifiedBy = createElement(ElementName.ModifiedBy);
13
13
  export const ModifiedOn = createElement(ElementName.ModifiedOn);
14
+ export const Preview = createElement(ElementName.Preview);
14
15
  export const Priority = createElement(ElementName.Priority);
15
16
  export const ProgrammingLanguage = createElement(ElementName.ProgrammingLanguage);
16
17
  export const Snippet = createElement(ElementName.Snippet);
@@ -0,0 +1,35 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { css, jsx } from '@emotion/core';
4
+ import ImageIcon from '../../common/image-icon';
5
+
6
+ const styles = url => css`
7
+ display: flex;
8
+ justify-content: center;
9
+ width: 100%;
10
+ > img {
11
+ max-width: 100%;
12
+ max-height: 100%;
13
+ }
14
+ `;
15
+
16
+ const Media = ({
17
+ testId = 'smart-element-media',
18
+ type,
19
+ url
20
+ }) => {
21
+ if (!type || !url) {
22
+ return null;
23
+ }
24
+
25
+ return jsx("div", {
26
+ css: styles(url),
27
+ "data-smart-element-media": true,
28
+ "data-testid": testId
29
+ }, jsx(ImageIcon, {
30
+ testId: `${testId}-image`,
31
+ url: url
32
+ }));
33
+ };
34
+
35
+ export default Media;
@@ -7,6 +7,7 @@ import Lozenge from './lozenge';
7
7
  import { FlexibleUiContext } from '../../../../state/flexible-ui-context';
8
8
  import Badge from './badge';
9
9
  import AvatarGroup from './avatar-group';
10
+ import Media from './media';
10
11
  import Text from './text';
11
12
  import { messages } from '../../../../messages';
12
13
  import DateTime from './date-time';
@@ -34,6 +35,9 @@ const elementMappings = {
34
35
  [ElementName.ModifiedBy]: {
35
36
  component: Text
36
37
  },
38
+ [ElementName.Preview]: {
39
+ component: Media
40
+ },
37
41
  [ElementName.Priority]: {
38
42
  component: Badge
39
43
  },
@@ -29,11 +29,7 @@ export const Frame = props => {
29
29
  event.stopPropagation();
30
30
  onClick(event);
31
31
  }
32
- }, [onClick]); // prevent default on mousedown to avoid inline card losing focus
33
-
34
- const handleMouseDown = useCallback(e => {
35
- e.preventDefault();
36
- }, []);
32
+ }, [onClick]);
37
33
  const isInteractive = Boolean(onClick); // TODO Theming doesn't work right now in editor. Required React context does not trickle down atm.
38
34
  // It will be worked as part of https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-154
39
35
 
@@ -47,7 +43,6 @@ export const Frame = props => {
47
43
  tabIndex: isInteractive ? 0 : undefined,
48
44
  role: isInteractive ? 'button' : undefined,
49
45
  onClick: handleClick,
50
- onMouseDown: handleMouseDown,
51
46
  onKeyPress: handleKeyPress,
52
47
  "data-testid": testId,
53
48
  className: className
@@ -114,6 +114,7 @@ export var ElementName;
114
114
  ElementName["LinkIcon"] = "LinkIcon";
115
115
  ElementName["ModifiedBy"] = "ModifiedBy";
116
116
  ElementName["ModifiedOn"] = "ModifiedOn";
117
+ ElementName["Preview"] = "Preview";
117
118
  ElementName["Priority"] = "Priority";
118
119
  ElementName["ProgrammingLanguage"] = "ProgrammingLanguage";
119
120
  ElementName["Snippet"] = "Snippet";
@@ -133,6 +134,9 @@ export var ActionName;
133
134
  })(ActionName || (ActionName = {}));
134
135
 
135
136
  export var IconType;
137
+ /**
138
+ * Type for Flexible UI's Media element
139
+ */
136
140
 
137
141
  (function (IconType) {
138
142
  IconType["Archive"] = "FileType:Archive";
@@ -192,4 +196,10 @@ export var IconType;
192
196
  IconType["PriorityUndefined"] = "Badge:PriorityUndefined";
193
197
  IconType["ProgrammingLanguage"] = "Badge:ProgrammingLanguage";
194
198
  IconType["Subscriber"] = "Badge:Subscriber";
195
- })(IconType || (IconType = {}));
199
+ })(IconType || (IconType = {}));
200
+
201
+ export var MediaType;
202
+
203
+ (function (MediaType) {
204
+ MediaType["Image"] = "image";
205
+ })(MediaType || (MediaType = {}));
@@ -0,0 +1,12 @@
1
+ import { extractImage } from '../common/preview';
2
+ import { MediaType } from '../../constants';
3
+
4
+ var extractPreview = function extractPreview(data) {
5
+ var url = extractImage(data);
6
+ return url ? {
7
+ type: MediaType.Image,
8
+ url: url
9
+ } : undefined;
10
+ };
11
+
12
+ export default extractPreview;
@@ -8,6 +8,7 @@ import { extractDateUpdated } from '../common/date/extractDateUpdated';
8
8
  import { extractDateCreated } from '../common/date/extractDateCreated';
9
9
  import extractPriority from './extract-priority';
10
10
  import extractProviderIcon from './icon/extract-provider-icon';
11
+ import extractPreview from './extract-preview';
11
12
 
12
13
  var extractFlexibleUiContext = function extractFlexibleUiContext(response, renderers) {
13
14
  if (!response) {
@@ -25,6 +26,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext(response, rende
25
26
  linkIcon: extractLinkIcon(response, renderers),
26
27
  modifiedBy: extractModifiedBy(data),
27
28
  modifiedOn: extractDateUpdated(data),
29
+ preview: extractPreview(data),
28
30
  priority: extractPriority(data),
29
31
  programmingLanguage: extractProgrammingLanguage(data),
30
32
  snippet: extractSummary(data) || undefined,
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';
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.5.0",
3
+ "version": "17.5.3",
4
4
  "sideEffects": false
5
5
  }
@@ -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;
@@ -20,7 +20,7 @@ import * as Actions from '../actions';
20
20
  import { isFlexibleUiElement } from '../../../../utils/flexible';
21
21
  import ActionGroup from './action-group';
22
22
  import ElementGroup from './element-group';
23
- export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_ElementDisplaySchema, ElementName.AuthorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CollaboratorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CommentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LinkIcon, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Priority, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ProgrammingLanguage, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Snippet, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.State, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubscriberCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Title, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Provider, ['inline']), _ElementDisplaySchema);
23
+ export var ElementDisplaySchema = (_ElementDisplaySchema = {}, _defineProperty(_ElementDisplaySchema, ElementName.AuthorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CollaboratorGroup, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CommentCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.CreatedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.LinkIcon, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedBy, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ModifiedOn, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Preview, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.Priority, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.ProgrammingLanguage, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Snippet, ['block']), _defineProperty(_ElementDisplaySchema, ElementName.State, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.SubscriberCount, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Title, ['inline']), _defineProperty(_ElementDisplaySchema, ElementName.Provider, ['inline']), _ElementDisplaySchema);
24
24
 
25
25
  var getDirectionStyles = function getDirectionStyles(direction) {
26
26
  switch (direction) {
@@ -11,6 +11,7 @@ export var CreatedOn = createElement(ElementName.CreatedOn);
11
11
  export var LinkIcon = createElement(ElementName.LinkIcon);
12
12
  export var ModifiedBy = createElement(ElementName.ModifiedBy);
13
13
  export var ModifiedOn = createElement(ElementName.ModifiedOn);
14
+ export var Preview = createElement(ElementName.Preview);
14
15
  export var Priority = createElement(ElementName.Priority);
15
16
  export var ProgrammingLanguage = createElement(ElementName.ProgrammingLanguage);
16
17
  export var Snippet = createElement(ElementName.Snippet);
@@ -0,0 +1,34 @@
1
+ import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
2
+
3
+ var _templateObject;
4
+
5
+ /** @jsx jsx */
6
+ import React from 'react';
7
+ import { css, jsx } from '@emotion/core';
8
+ import ImageIcon from '../../common/image-icon';
9
+
10
+ var styles = function styles(url) {
11
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n display: flex;\n justify-content: center;\n width: 100%;\n > img {\n max-width: 100%;\n max-height: 100%;\n }\n"])));
12
+ };
13
+
14
+ var Media = function Media(_ref) {
15
+ var _ref$testId = _ref.testId,
16
+ testId = _ref$testId === void 0 ? 'smart-element-media' : _ref$testId,
17
+ type = _ref.type,
18
+ url = _ref.url;
19
+
20
+ if (!type || !url) {
21
+ return null;
22
+ }
23
+
24
+ return jsx("div", {
25
+ css: styles(url),
26
+ "data-smart-element-media": true,
27
+ "data-testid": testId
28
+ }, jsx(ImageIcon, {
29
+ testId: "".concat(testId, "-image"),
30
+ url: url
31
+ }));
32
+ };
33
+
34
+ export default Media;
@@ -11,6 +11,7 @@ import Lozenge from './lozenge';
11
11
  import { FlexibleUiContext } from '../../../../state/flexible-ui-context';
12
12
  import Badge from './badge';
13
13
  import AvatarGroup from './avatar-group';
14
+ import Media from './media';
14
15
  import Text from './text';
15
16
  import { messages } from '../../../../messages';
16
17
  import DateTime from './date-time';
@@ -31,6 +32,8 @@ var elementMappings = (_elementMappings = {}, _defineProperty(_elementMappings,
31
32
  component: Icon
32
33
  }), _defineProperty(_elementMappings, ElementName.ModifiedBy, {
33
34
  component: Text
35
+ }), _defineProperty(_elementMappings, ElementName.Preview, {
36
+ component: Media
34
37
  }), _defineProperty(_elementMappings, ElementName.Priority, {
35
38
  component: Badge
36
39
  }), _defineProperty(_elementMappings, ElementName.ProgrammingLanguage, {
@@ -27,11 +27,7 @@ export var Frame = function Frame(props) {
27
27
  event.stopPropagation();
28
28
  onClick(event);
29
29
  }
30
- }, [onClick]); // prevent default on mousedown to avoid inline card losing focus
31
-
32
- var handleMouseDown = useCallback(function (e) {
33
- e.preventDefault();
34
- }, []);
30
+ }, [onClick]);
35
31
  var isInteractive = Boolean(onClick); // TODO Theming doesn't work right now in editor. Required React context does not trickle down atm.
36
32
  // It will be worked as part of https://product-fabric.atlassian.net/jira/servicedesk/projects/DTR/queues/issue/DTR-154
37
33
 
@@ -45,7 +41,6 @@ export var Frame = function Frame(props) {
45
41
  tabIndex: isInteractive ? 0 : undefined,
46
42
  role: isInteractive ? 'button' : undefined,
47
43
  onClick: handleClick,
48
- onMouseDown: handleMouseDown,
49
44
  onKeyPress: handleKeyPress,
50
45
  "data-testid": testId,
51
46
  className: className
@@ -88,6 +88,7 @@ export declare enum ElementName {
88
88
  LinkIcon = "LinkIcon",
89
89
  ModifiedBy = "ModifiedBy",
90
90
  ModifiedOn = "ModifiedOn",
91
+ Preview = "Preview",
91
92
  Priority = "Priority",
92
93
  ProgrammingLanguage = "ProgrammingLanguage",
93
94
  Snippet = "Snippet",
@@ -164,3 +165,9 @@ export declare enum IconType {
164
165
  ProgrammingLanguage = "Badge:ProgrammingLanguage",
165
166
  Subscriber = "Badge:Subscriber"
166
167
  }
168
+ /**
169
+ * Type for Flexible UI's Media element
170
+ */
171
+ export declare enum MediaType {
172
+ Image = "image"
173
+ }
@@ -0,0 +1,4 @@
1
+ import { JsonLd } from 'json-ld-types';
2
+ import { Media } from '../../state/flexible-ui-context/types';
3
+ declare const extractPreview: (data: JsonLd.Data.BaseData) => Media | undefined;
4
+ export default extractPreview;
@@ -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,6 +1,6 @@
1
1
  import { LinkLozenge } from '../../extractors/common/lozenge/types';
2
2
  import { LinkPerson } from '../../extractors/common/person/types';
3
- import { IconType } from '../../constants';
3
+ import { IconType, MediaType } from '../../constants';
4
4
  export declare type FlexibleUiDataContext = {
5
5
  authorGroup?: LinkPerson[];
6
6
  collaboratorGroup?: LinkPerson[];
@@ -10,6 +10,7 @@ export declare type FlexibleUiDataContext = {
10
10
  linkIcon?: Icon;
11
11
  modifiedBy?: string;
12
12
  modifiedOn?: string;
13
+ preview?: Media;
13
14
  priority?: Icon;
14
15
  programmingLanguage?: string;
15
16
  snippet?: string;
@@ -24,3 +25,7 @@ export declare type Icon = {
24
25
  label?: string;
25
26
  url?: string;
26
27
  };
28
+ export declare type Media = {
29
+ type: MediaType;
30
+ url: string;
31
+ };
@@ -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,4 @@
1
+ import React from 'react';
2
+ import { PreviewBlockProps } from './types';
3
+ declare const PreviewBlock: React.FC<PreviewBlockProps>;
4
+ export default PreviewBlock;
@@ -0,0 +1,2 @@
1
+ import { BlockProps } from '../types';
2
+ export declare type PreviewBlockProps = BlockProps;
@@ -6,6 +6,7 @@ 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';
9
10
  export declare const AuthorGroup: import("react").FC<AvatarGroupProps>;
10
11
  export declare const CollaboratorGroup: import("react").FC<AvatarGroupProps>;
11
12
  export declare const CommentCount: import("react").FC<BadgeProps>;
@@ -14,6 +15,7 @@ export declare const CreatedOn: import("react").FC<DateTimeProps>;
14
15
  export declare const LinkIcon: import("react").FC<IconProps>;
15
16
  export declare const ModifiedBy: import("react").FC<TextProps>;
16
17
  export declare const ModifiedOn: import("react").FC<DateTimeProps>;
18
+ export declare const Preview: import("react").FC<MediaProps>;
17
19
  export declare const Priority: import("react").FC<BadgeProps>;
18
20
  export declare const ProgrammingLanguage: import("react").FC<BadgeProps>;
19
21
  export declare const Snippet: import("react").FC<TextProps>;
@@ -0,0 +1,5 @@
1
+ /** @jsx jsx */
2
+ import React from 'react';
3
+ import { MediaProps } from './types';
4
+ declare const Media: React.FC<MediaProps>;
5
+ export default Media;
@@ -0,0 +1,6 @@
1
+ import { ElementProps } from '../types';
2
+ import { MediaType } from '../../../../../constants';
3
+ export declare type MediaProps = ElementProps & {
4
+ type?: MediaType;
5
+ url?: string;
6
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "17.5.0",
3
+ "version": "17.5.3",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"