@atlaskit/smart-card 26.14.1 → 26.14.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 (30) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/utils/index.js +25 -2
  3. package/dist/cjs/version.json +1 -1
  4. package/dist/cjs/view/BlockCard/actions/ViewAction.js +4 -33
  5. package/dist/cjs/view/CardWithUrl/component.js +1 -1
  6. package/dist/cjs/view/EmbedCard/components/styled.js +15 -9
  7. package/dist/cjs/view/FlexibleCard/components/actions/action/view-action/index.js +2 -31
  8. package/dist/es2019/utils/index.js +6 -0
  9. package/dist/es2019/version.json +1 -1
  10. package/dist/es2019/view/BlockCard/actions/ViewAction.js +2 -11
  11. package/dist/es2019/view/CardWithUrl/component.js +1 -1
  12. package/dist/es2019/view/EmbedCard/components/styled.js +26 -12
  13. package/dist/es2019/view/FlexibleCard/components/actions/action/view-action/index.js +2 -11
  14. package/dist/esm/utils/index.js +22 -0
  15. package/dist/esm/version.json +1 -1
  16. package/dist/esm/view/BlockCard/actions/ViewAction.js +4 -32
  17. package/dist/esm/view/CardWithUrl/component.js +1 -1
  18. package/dist/esm/view/EmbedCard/components/styled.js +15 -7
  19. package/dist/esm/view/FlexibleCard/components/actions/action/view-action/index.js +2 -30
  20. package/dist/types/utils/index.d.ts +1 -0
  21. package/dist/types/view/BlockCard/actions/ViewAction.d.ts +0 -4
  22. package/dist/types/view/EmbedCard/components/styled.d.ts +0 -1
  23. package/dist/types/view/FlexibleCard/components/actions/action/view-action/index.d.ts +1 -2
  24. package/dist/types/view/FlexibleCard/components/actions/action/view-action/types.d.ts +0 -3
  25. package/dist/types-ts4.5/utils/index.d.ts +1 -0
  26. package/dist/types-ts4.5/view/BlockCard/actions/ViewAction.d.ts +0 -4
  27. package/dist/types-ts4.5/view/EmbedCard/components/styled.d.ts +0 -1
  28. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/view-action/index.d.ts +1 -2
  29. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/view-action/types.d.ts +0 -3
  30. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.14.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [`c5a8ab5629d`](https://bitbucket.org/atlassian/atlassian-frontend/commits/c5a8ab5629d) - Refactor view url action
8
+
9
+ ## 26.14.2
10
+
11
+ ### Patch Changes
12
+
13
+ - [`6a807668da6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6a807668da6) - [ux] Refreshed design for the Embed Smart Links view added under the FF
14
+
3
15
  ## 26.14.1
4
16
 
5
17
  ### Patch Changes
@@ -5,7 +5,7 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.sleep = exports.isSpecialKey = exports.isSpecialEvent = exports.isSpecialClick = exports.isIntersectionObserverSupported = exports.isIframe = exports.isCardWithData = exports.importWithRetry = exports.handleOnClick = exports.getLabelForFileType = exports.getIframeSandboxAttribute = exports.getIconForFileType = void 0;
8
+ exports.sleep = exports.openUrl = exports.isSpecialKey = exports.isSpecialEvent = exports.isSpecialClick = exports.isIntersectionObserverSupported = exports.isIframe = exports.isCardWithData = exports.importWithRetry = exports.handleOnClick = exports.getLabelForFileType = exports.getIframeSandboxAttribute = exports.getIconForFileType = void 0;
9
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
10
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
11
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
@@ -397,4 +397,27 @@ var importWithRetry = /*#__PURE__*/function () {
397
397
  return _ref.apply(this, arguments);
398
398
  };
399
399
  }();
400
- exports.importWithRetry = importWithRetry;
400
+ exports.importWithRetry = importWithRetry;
401
+ var openUrl = /*#__PURE__*/function () {
402
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(url) {
403
+ return _regenerator.default.wrap(function _callee2$(_context2) {
404
+ while (1) switch (_context2.prev = _context2.next) {
405
+ case 0:
406
+ if (url) {
407
+ _context2.next = 2;
408
+ break;
409
+ }
410
+ return _context2.abrupt("return");
411
+ case 2:
412
+ window.open(url, '_blank', 'noopener=yes');
413
+ case 3:
414
+ case "end":
415
+ return _context2.stop();
416
+ }
417
+ }, _callee2);
418
+ }));
419
+ return function openUrl(_x2) {
420
+ return _ref2.apply(this, arguments);
421
+ };
422
+ }();
423
+ exports.openUrl = openUrl;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.14.1",
3
+ "version": "26.14.3",
4
4
  "sideEffects": false
5
5
  }
@@ -5,46 +5,17 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.ViewAction = void 0;
8
- exports.viewFunction = viewFunction;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
8
  var _react = _interopRequireDefault(require("react"));
12
9
  var _reactIntlNext = require("react-intl-next");
13
10
  var _messages = require("../../../messages");
14
- function viewFunction(_x) {
15
- return _viewFunction.apply(this, arguments);
16
- }
17
- function _viewFunction() {
18
- _viewFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
19
- var url;
20
- return _regenerator.default.wrap(function _callee$(_context) {
21
- while (1) switch (_context.prev = _context.next) {
22
- case 0:
23
- url = _ref.url;
24
- if (url) {
25
- _context.next = 3;
26
- break;
27
- }
28
- return _context.abrupt("return");
29
- case 3:
30
- window.open(url, '_blank', 'noopener=yes');
31
- case 4:
32
- case "end":
33
- return _context.stop();
34
- }
35
- }, _callee);
36
- }));
37
- return _viewFunction.apply(this, arguments);
38
- }
39
- var ViewAction = function ViewAction(_ref2) {
40
- var url = _ref2.url;
11
+ var _utils = require("../../../utils");
12
+ var ViewAction = function ViewAction(_ref) {
13
+ var url = _ref.url;
41
14
  return {
42
15
  id: 'view-content',
43
16
  text: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.view),
44
17
  promise: function promise() {
45
- return viewFunction({
46
- url: url
47
- });
18
+ return (0, _utils.openUrl)(url);
48
19
  }
49
20
  };
50
21
  };
@@ -224,7 +224,7 @@ function Component(_ref) {
224
224
  showAuthTooltip: showAuthTooltip,
225
225
  showServerActions: showServerActions
226
226
  };
227
- return (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-inline-card-refreshed-design') ? /*#__PURE__*/_react.default.createElement(_RedesignedInlineCard.InlineCard, inlineProps) : /*#__PURE__*/_react.default.createElement(_InlineCard.InlineCard, inlineProps);
227
+ return (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? /*#__PURE__*/_react.default.createElement(_RedesignedInlineCard.InlineCard, inlineProps) : /*#__PURE__*/_react.default.createElement(_InlineCard.InlineCard, inlineProps);
228
228
  case 'block':
229
229
  return /*#__PURE__*/_react.default.createElement(_BlockCard.BlockCard, {
230
230
  id: id,
@@ -5,21 +5,24 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.maxAvatarCount = exports.embedHeaderHeight = exports.ellipsis = exports.csssize = exports.className = exports.cardShadow = exports.borderRadius = exports.Wrapper = exports.UsersWrapper = exports.Title = exports.Thumbnail = exports.TextWrapper = exports.ResolvedViewIconWrapper = exports.LinkWrapper = exports.Image = exports.IconWrapper = exports.Header = exports.Description = exports.ContentWrapper = exports.Content = exports.Byline = exports.AlertWrapper = exports.ActionsWrapper = void 0;
8
+ exports.maxAvatarCount = exports.embedHeaderHeight = exports.ellipsis = exports.csssize = exports.className = exports.borderRadius = exports.Wrapper = exports.UsersWrapper = exports.Title = exports.Thumbnail = exports.TextWrapper = exports.ResolvedViewIconWrapper = exports.LinkWrapper = exports.Image = exports.IconWrapper = exports.Header = exports.Description = exports.ContentWrapper = exports.Content = exports.Byline = exports.AlertWrapper = exports.ActionsWrapper = void 0;
9
9
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
10
10
  var _styled = _interopRequireDefault(require("@emotion/styled"));
11
11
  var _constants = require("@atlaskit/theme/constants");
12
12
  var colors = _interopRequireWildcard(require("@atlaskit/theme/colors"));
13
13
  var _utils = require("../../common/utils");
14
+ var _components = require("@atlaskit/theme/components");
15
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
16
  var _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6, _templateObject7, _templateObject8, _templateObject9, _templateObject10, _templateObject11, _templateObject12, _templateObject13, _templateObject14, _templateObject15, _templateObject16;
15
17
  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); }
16
18
  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; }
17
19
  var className = 'media-card-frame';
18
20
  exports.className = className;
19
- var cardShadow = "";
20
- exports.cardShadow = cardShadow;
21
21
  var borderRadius = "\n border-radius: ".concat((0, _constants.borderRadius)(), "px;\n");
22
22
  exports.borderRadius = borderRadius;
23
+ var BACKGROUND_COLOR_DARK = '#262B31';
24
+ var wrapperBorderRadius = "\n border-radius: ".concat("var(--ds-border-radius-400, 16px)", ";\n");
25
+ var contentBorderRadius = "\n border-radius: ".concat("var(--ds-border-radius-300, 12px)", ";\n");
23
26
  var ellipsis = function ellipsis() {
24
27
  var maxWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
25
28
  var unit = typeof maxWidth === 'number' ? 'px' : '';
@@ -51,21 +54,24 @@ function maxWidth(_ref2) {
51
54
  function getInteractiveStyles(_ref3) {
52
55
  var isInteractive = _ref3.isInteractive,
53
56
  frameStyle = _ref3.frameStyle;
54
- return isInteractive ? "\n &:hover {\n ".concat(frameStyle !== 'hide' && visibleStyles, "\n }\n &:active {\n background-color: ", "var(--ds-background-selected, ".concat(colors.B50, ")"), ";\n }\n ") : '';
57
+ return isInteractive ? "\n &:hover {\n ".concat(frameStyle !== 'hide' && visibleStyles, "\n\n }\n &:active {\n background-color: ", "var(--ds-background-selected, ".concat(colors.B50, ")"), ";\n }\n ") : '';
55
58
  }
56
59
  function selected(_ref4) {
57
60
  var isSelected = _ref4.isSelected,
58
61
  frameStyle = _ref4.frameStyle;
59
- return isSelected && frameStyle !== 'hide' ? "\n ".concat(visibleStyles, "\n &::after {\n cursor: pointer;\n box-shadow: 0 0 0 3px ", "var(--ds-border-selected, ".concat(colors.B100, ")"), ";\n content: '';\n outline: none;\n position: absolute;\n height: 100%;\n width: 100%;\n left: 0;\n ").concat(borderRadius, "\n }\n ") : isSelected && frameStyle === 'hide' ? "\n box-shadow: 0 0 0 3px ".concat("var(--ds-border-selected, ".concat(colors.B100, ")"), ";\n ", borderRadius, "\n ") : '';
62
+ return isSelected && frameStyle !== 'hide' ? "\n ".concat(visibleStyles, "\n &::after {\n cursor: pointer;\n box-shadow: 0 0 0 3px ", "var(--ds-border-selected, ".concat(colors.B100, ")"), ";\n content: '';\n outline: none;\n position: absolute;\n height: 100%;\n width: 100%;\n left: 0;\n ").concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : borderRadius, "\n }\n ") : isSelected && frameStyle === 'hide' ? "\n ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? contentBorderRadius : "box-shadow: 0 0 0 3px ".concat("var(--ds-border-selected, ".concat(colors.B100, ")"), ";\n ", borderRadius), "\n ") : '';
60
63
  }
61
64
  var height = function height(_ref5) {
62
65
  var inheritDimensions = _ref5.inheritDimensions;
63
66
  return inheritDimensions ? 'height: 100%;' : "height: ".concat((0, _utils.gs)(54));
64
67
  };
65
68
  var wrapperStyles = function wrapperStyles(props) {
66
- return "\n ".concat(borderRadius, "\n ").concat(minWidth(props), "\n ").concat(maxWidth(props), "\n ").concat(getInteractiveStyles(props), "\n ").concat(visible(props), "\n display: inline-flex;\n flex-direction: column;\n box-sizing: border-box;\n font-family: ").concat((0, _constants.fontFamily)(), ";\n width: 100%;\n user-select: none;\n line-height: initial;\n transition: background 0.3s;\n position: relative;\n ").concat(height(props), ";\n ").concat(selected(props), "\n\n &:after {\n content: '';\n background: transparent;\n transition: background 0.3s, box-shadow 0.3s;\n position: absolute;\n width: calc(100% + ", "var(--ds-space-200, 16px)", ");\n height: calc(100% + ", "var(--ds-space-100, 8px)", ");\n left: calc(-1 * ", "var(--ds-space-100, 8px)", ");\n ").concat(borderRadius, "\n }\n");
69
+ return "\n ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : borderRadius, "\n ").concat(minWidth(props), "\n ").concat(maxWidth(props), "\n ").concat(getInteractiveStyles(props), "\n ").concat(visible(props), "\n display: inline-flex;\n flex-direction: column;\n box-sizing: border-box;\n font-family: ").concat((0, _constants.fontFamily)(), ";\n width: 100%;\n user-select: none;\n line-height: initial;\n transition: background 0.3s;\n position: relative;\n ").concat(height(props), ";\n ").concat(selected(props), "\n\n &:after {\n content: '';\n transition: background 0.3s, box-shadow 0.3s;\n position: absolute;\n width: calc(100% + ", "var(--ds-space-200, 16px)", ");\n height: calc(100% + ", "var(--ds-space-100, 8px)", ");\n left: calc(-1 * ", "var(--ds-space-100, 8px)", ");\n ").concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : "background: transparent;\n ".concat(borderRadius), "\n }\n");
67
70
  };
68
- var visibleStyles = "\n background-color: ".concat("var(--ds-background-neutral-subtle, ".concat(colors.N30, ")"), ";\n\n &:after {\n background: ", "var(--ds-background-neutral, ".concat(colors.N30, ")"), " !important;\n }\n .embed-header {\n opacity: 1;\n }");
71
+ var visibleStyles = "\n ".concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "" : "background-color: ".concat("var(--ds-background-neutral-subtle, ".concat(colors.N30, ")"), ";"), "\n\n &:after {\n ").concat((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "outline: 1px solid ".concat("var(--ds-border-input, ".concat(colors.N40, ")"), ";\n background-color: ", (0, _components.themed)({
72
+ light: "var(--ds-surface-raised, white)",
73
+ dark: "var(--ds-surface-raised, ".concat(BACKGROUND_COLOR_DARK, ")")
74
+ })(), ";") : "background: ".concat("var(--ds-background-neutral, ".concat(colors.N30, ")"), " !important;"), "\n }\n .embed-header {\n opacity: 1;\n }");
69
75
  function visible(_ref6) {
70
76
  var frameStyle = _ref6.frameStyle;
71
77
  return frameStyle === 'show' ? visibleStyles : '';
@@ -105,9 +111,9 @@ exports.TextWrapper = TextWrapper;
105
111
  // NB: `overflow` is kept as `hidden` since
106
112
  // the internal contents of the `iframe` should
107
113
  // manage scrolling behaviour.
108
- var Content = _styled.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n ", "\n background-color: ", ";\n position: absolute;\n z-index: 1;\n width: 100%;\n transition: box-shadow 0.3s;\n\n > .calc-height > div > div {\n left: unset !important;\n width: unset !important;\n height: unset !important;\n position: initial !important;\n padding-bottom: unset !important;\n }\n > .embed-preview > div {\n margin: 0 auto;\n }\n\n ", ";\n\n ", "\n\n ", "\n"])), borderRadius, cardShadow, "var(--ds-surface-raised, white)", function (_ref9) {
114
+ var Content = _styled.default.div(_templateObject6 || (_templateObject6 = (0, _taggedTemplateLiteral2.default)(["\n ", "\n background-color: ", ";\n position: absolute;\n z-index: 1;\n width: 100%;\n transition: box-shadow 0.3s;\n\n > .calc-height > div > div {\n left: unset !important;\n width: unset !important;\n height: unset !important;\n position: initial !important;\n padding-bottom: unset !important;\n }\n > .embed-preview > div {\n margin: 0 auto;\n }\n\n ", ";\n\n ", "\n\n ", "\n"])), (0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "".concat(contentBorderRadius, ";\n outline: 1px solid ", "var(--ds-border-input, ".concat(colors.N40, ")"), ";") : borderRadius, "var(--ds-surface-raised, white)", function (_ref9) {
109
115
  var isInteractive = _ref9.isInteractive;
110
- if (isInteractive) {
116
+ if (isInteractive && !(0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.show-smart-links-refreshed-design')) {
111
117
  return "\n .".concat(className, ":hover & {\n box-shadow: ", "var(--ds-shadow-overlay, 0 4px 8px -2px rgba(23, 43, 77, 0.32), 0 0 1px rgba(23, 43, 77, 0.25))", ";\n }\n ");
112
118
  } else {
113
119
  return '';
@@ -5,13 +5,11 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.default = void 0;
8
- exports.viewFunction = viewFunction;
9
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
8
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
12
9
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
10
  var _react = _interopRequireDefault(require("react"));
14
11
  var _index = _interopRequireDefault(require("../index"));
12
+ var _utils = require("../../../../../../utils");
15
13
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
16
14
  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; }
17
15
  var ViewAction = function ViewAction(props) {
@@ -24,9 +22,7 @@ var ViewAction = function ViewAction(props) {
24
22
  if (viewUrl && url) {
25
23
  var action = _objectSpread(_objectSpread({}, props), {}, {
26
24
  onClick: function onClick() {
27
- viewFunction({
28
- url: viewUrl
29
- });
25
+ (0, _utils.openUrl)(viewUrl);
30
26
  if (_onClick) {
31
27
  _onClick();
32
28
  }
@@ -41,30 +37,5 @@ var ViewAction = function ViewAction(props) {
41
37
  return null;
42
38
  }
43
39
  };
44
- function viewFunction(_x) {
45
- return _viewFunction.apply(this, arguments);
46
- }
47
- function _viewFunction() {
48
- _viewFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
49
- var url;
50
- return _regenerator.default.wrap(function _callee$(_context) {
51
- while (1) switch (_context.prev = _context.next) {
52
- case 0:
53
- url = _ref.url;
54
- if (url) {
55
- _context.next = 3;
56
- break;
57
- }
58
- return _context.abrupt("return");
59
- case 3:
60
- window.open(url, '_blank', 'noopener=yes');
61
- case 4:
62
- case "end":
63
- return _context.stop();
64
- }
65
- }, _callee);
66
- }));
67
- return _viewFunction.apply(this, arguments);
68
- }
69
40
  var _default = ViewAction;
70
41
  exports.default = _default;
@@ -119,4 +119,10 @@ export const importWithRetry = async (importFn, retries = 2, interval = 500) =>
119
119
  throw error;
120
120
  }
121
121
  }
122
+ };
123
+ export const openUrl = async url => {
124
+ if (!url) {
125
+ return;
126
+ }
127
+ window.open(url, '_blank', 'noopener=yes');
122
128
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.14.1",
3
+ "version": "26.14.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,20 +1,11 @@
1
1
  import React from 'react';
2
2
  import { FormattedMessage } from 'react-intl-next';
3
3
  import { messages } from '../../../messages';
4
- export async function viewFunction({
5
- url
6
- }) {
7
- if (!url) {
8
- return;
9
- }
10
- window.open(url, '_blank', 'noopener=yes');
11
- }
4
+ import { openUrl } from '../../../utils';
12
5
  export const ViewAction = ({
13
6
  url
14
7
  }) => ({
15
8
  id: 'view-content',
16
9
  text: /*#__PURE__*/React.createElement(FormattedMessage, messages.view),
17
- promise: () => viewFunction({
18
- url
19
- })
10
+ promise: () => openUrl(url)
20
11
  });
@@ -211,7 +211,7 @@ function Component({
211
211
  showAuthTooltip: showAuthTooltip,
212
212
  showServerActions: showServerActions
213
213
  };
214
- return getBooleanFF('platform.linking-platform.smart-card.show-inline-card-refreshed-design') ? /*#__PURE__*/React.createElement(RedesignedInlineCard, inlineProps) : /*#__PURE__*/React.createElement(InlineCard, inlineProps);
214
+ return getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? /*#__PURE__*/React.createElement(RedesignedInlineCard, inlineProps) : /*#__PURE__*/React.createElement(InlineCard, inlineProps);
215
215
  case 'block':
216
216
  return /*#__PURE__*/React.createElement(BlockCard, {
217
217
  id: id,
@@ -2,11 +2,20 @@ import styled from '@emotion/styled';
2
2
  import { borderRadius as akBorderRadius, fontFamily } from '@atlaskit/theme/constants';
3
3
  import * as colors from '@atlaskit/theme/colors';
4
4
  import { gs as gridSize } from '../../common/utils';
5
+ import { N40 } from '@atlaskit/theme/colors';
6
+ import { themed } from '@atlaskit/theme/components';
7
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
5
8
  export const className = 'media-card-frame';
6
- export const cardShadow = ``;
7
9
  export const borderRadius = `
8
10
  border-radius: ${akBorderRadius()}px;
9
11
  `;
12
+ const BACKGROUND_COLOR_DARK = '#262B31';
13
+ const wrapperBorderRadius = `
14
+ border-radius: ${"var(--ds-border-radius-400, 16px)"};
15
+ `;
16
+ const contentBorderRadius = `
17
+ border-radius: ${"var(--ds-border-radius-300, 12px)"};
18
+ `;
10
19
  export const ellipsis = (maxWidth = '100%') => {
11
20
  const unit = typeof maxWidth === 'number' ? 'px' : '';
12
21
  return `
@@ -48,6 +57,7 @@ function getInteractiveStyles({
48
57
  return isInteractive ? `
49
58
  &:hover {
50
59
  ${frameStyle !== 'hide' && visibleStyles}
60
+
51
61
  }
52
62
  &:active {
53
63
  background-color: ${`var(--ds-background-selected, ${colors.B50})`};
@@ -69,18 +79,18 @@ function selected({
69
79
  height: 100%;
70
80
  width: 100%;
71
81
  left: 0;
72
- ${borderRadius}
82
+ ${getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : borderRadius}
73
83
  }
74
84
  ` : isSelected && frameStyle === 'hide' ? `
75
- box-shadow: 0 0 0 3px ${`var(--ds-border-selected, ${colors.B100})`};
76
- ${borderRadius}
85
+ ${getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? contentBorderRadius : `box-shadow: 0 0 0 3px ${`var(--ds-border-selected, ${colors.B100})`};
86
+ ${borderRadius}`}
77
87
  ` : '';
78
88
  }
79
89
  const height = ({
80
90
  inheritDimensions
81
91
  }) => inheritDimensions ? 'height: 100%;' : `height: ${gridSize(54)}`;
82
92
  const wrapperStyles = props => `
83
- ${borderRadius}
93
+ ${getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : borderRadius}
84
94
  ${minWidth(props)}
85
95
  ${maxWidth(props)}
86
96
  ${getInteractiveStyles(props)}
@@ -99,20 +109,24 @@ const wrapperStyles = props => `
99
109
 
100
110
  &:after {
101
111
  content: '';
102
- background: transparent;
103
112
  transition: background 0.3s, box-shadow 0.3s;
104
113
  position: absolute;
105
114
  width: calc(100% + ${"var(--ds-space-200, 16px)"});
106
115
  height: calc(100% + ${"var(--ds-space-100, 8px)"});
107
116
  left: calc(-1 * ${"var(--ds-space-100, 8px)"});
108
- ${borderRadius}
117
+ ${getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : `background: transparent;
118
+ ${borderRadius}`}
109
119
  }
110
120
  `;
111
121
  const visibleStyles = `
112
- background-color: ${`var(--ds-background-neutral-subtle, ${colors.N30})`};
122
+ ${getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? `` : `background-color: ${`var(--ds-background-neutral-subtle, ${colors.N30})`};`}
113
123
 
114
124
  &:after {
115
- background: ${`var(--ds-background-neutral, ${colors.N30})`} !important;
125
+ ${getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? `outline: 1px solid ${`var(--ds-border-input, ${N40})`};
126
+ background-color: ${themed({
127
+ light: "var(--ds-surface-raised, white)",
128
+ dark: `var(--ds-surface-raised, ${BACKGROUND_COLOR_DARK})`
129
+ })()};` : `background: ${`var(--ds-background-neutral, ${colors.N30})`} !important;`}
116
130
  }
117
131
  .embed-header {
118
132
  opacity: 1;
@@ -183,8 +197,8 @@ export const TextWrapper = styled.div`
183
197
  // the internal contents of the `iframe` should
184
198
  // manage scrolling behaviour.
185
199
  export const Content = styled.div`
186
- ${borderRadius}
187
- ${cardShadow}
200
+ ${getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? `${contentBorderRadius};
201
+ outline: 1px solid ${`var(--ds-border-input, ${N40})`};` : borderRadius}
188
202
  background-color: ${"var(--ds-surface-raised, white)"};
189
203
  position: absolute;
190
204
  z-index: 1;
@@ -205,7 +219,7 @@ export const Content = styled.div`
205
219
  ${({
206
220
  isInteractive
207
221
  }) => {
208
- if (isInteractive) {
222
+ if (isInteractive && !getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design')) {
209
223
  return `
210
224
  .${className}:hover & {
211
225
  box-shadow: ${"var(--ds-shadow-overlay, 0 4px 8px -2px rgba(23, 43, 77, 0.32), 0 0 1px rgba(23, 43, 77, 0.25))"};
@@ -1,6 +1,7 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import Action from '../index';
4
+ import { openUrl } from '../../../../../../utils';
4
5
  const ViewAction = props => {
5
6
  const {
6
7
  appearance,
@@ -14,9 +15,7 @@ const ViewAction = props => {
14
15
  const action = {
15
16
  ...props,
16
17
  onClick: () => {
17
- viewFunction({
18
- url: viewUrl
19
- });
18
+ openUrl(viewUrl);
20
19
  if (onClick) {
21
20
  onClick();
22
21
  }
@@ -31,12 +30,4 @@ const ViewAction = props => {
31
30
  return null;
32
31
  }
33
32
  };
34
- export async function viewFunction({
35
- url
36
- }) {
37
- if (!url) {
38
- return;
39
- }
40
- window.open(url, '_blank', 'noopener=yes');
41
- }
42
33
  export default ViewAction;
@@ -275,4 +275,26 @@ export var importWithRetry = /*#__PURE__*/function () {
275
275
  return function importWithRetry(_x) {
276
276
  return _ref.apply(this, arguments);
277
277
  };
278
+ }();
279
+ export var openUrl = /*#__PURE__*/function () {
280
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(url) {
281
+ return _regeneratorRuntime.wrap(function _callee2$(_context2) {
282
+ while (1) switch (_context2.prev = _context2.next) {
283
+ case 0:
284
+ if (url) {
285
+ _context2.next = 2;
286
+ break;
287
+ }
288
+ return _context2.abrupt("return");
289
+ case 2:
290
+ window.open(url, '_blank', 'noopener=yes');
291
+ case 3:
292
+ case "end":
293
+ return _context2.stop();
294
+ }
295
+ }, _callee2);
296
+ }));
297
+ return function openUrl(_x2) {
298
+ return _ref2.apply(this, arguments);
299
+ };
278
300
  }();
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.14.1",
3
+ "version": "26.14.3",
4
4
  "sideEffects": false
5
5
  }
@@ -1,42 +1,14 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
- import _regeneratorRuntime from "@babel/runtime/regenerator";
3
1
  import React from 'react';
4
2
  import { FormattedMessage } from 'react-intl-next';
5
3
  import { messages } from '../../../messages';
6
- export function viewFunction(_x) {
7
- return _viewFunction.apply(this, arguments);
8
- }
9
- function _viewFunction() {
10
- _viewFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
11
- var url;
12
- return _regeneratorRuntime.wrap(function _callee$(_context) {
13
- while (1) switch (_context.prev = _context.next) {
14
- case 0:
15
- url = _ref.url;
16
- if (url) {
17
- _context.next = 3;
18
- break;
19
- }
20
- return _context.abrupt("return");
21
- case 3:
22
- window.open(url, '_blank', 'noopener=yes');
23
- case 4:
24
- case "end":
25
- return _context.stop();
26
- }
27
- }, _callee);
28
- }));
29
- return _viewFunction.apply(this, arguments);
30
- }
31
- export var ViewAction = function ViewAction(_ref2) {
32
- var url = _ref2.url;
4
+ import { openUrl } from '../../../utils';
5
+ export var ViewAction = function ViewAction(_ref) {
6
+ var url = _ref.url;
33
7
  return {
34
8
  id: 'view-content',
35
9
  text: /*#__PURE__*/React.createElement(FormattedMessage, messages.view),
36
10
  promise: function promise() {
37
- return viewFunction({
38
- url: url
39
- });
11
+ return openUrl(url);
40
12
  }
41
13
  };
42
14
  };
@@ -214,7 +214,7 @@ function Component(_ref) {
214
214
  showAuthTooltip: showAuthTooltip,
215
215
  showServerActions: showServerActions
216
216
  };
217
- return getBooleanFF('platform.linking-platform.smart-card.show-inline-card-refreshed-design') ? /*#__PURE__*/React.createElement(RedesignedInlineCard, inlineProps) : /*#__PURE__*/React.createElement(InlineCard, inlineProps);
217
+ return getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? /*#__PURE__*/React.createElement(RedesignedInlineCard, inlineProps) : /*#__PURE__*/React.createElement(InlineCard, inlineProps);
218
218
  case 'block':
219
219
  return /*#__PURE__*/React.createElement(BlockCard, {
220
220
  id: id,
@@ -4,9 +4,14 @@ import styled from '@emotion/styled';
4
4
  import { borderRadius as akBorderRadius, fontFamily } from '@atlaskit/theme/constants';
5
5
  import * as colors from '@atlaskit/theme/colors';
6
6
  import { gs as gridSize } from '../../common/utils';
7
+ import { N40 } from '@atlaskit/theme/colors';
8
+ import { themed } from '@atlaskit/theme/components';
9
+ import { getBooleanFF } from '@atlaskit/platform-feature-flags';
7
10
  export var className = 'media-card-frame';
8
- export var cardShadow = "";
9
11
  export var borderRadius = "\n border-radius: ".concat(akBorderRadius(), "px;\n");
12
+ var BACKGROUND_COLOR_DARK = '#262B31';
13
+ var wrapperBorderRadius = "\n border-radius: ".concat("var(--ds-border-radius-400, 16px)", ";\n");
14
+ var contentBorderRadius = "\n border-radius: ".concat("var(--ds-border-radius-300, 12px)", ";\n");
10
15
  export var ellipsis = function ellipsis() {
11
16
  var maxWidth = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '100%';
12
17
  var unit = typeof maxWidth === 'number' ? 'px' : '';
@@ -36,21 +41,24 @@ function maxWidth(_ref2) {
36
41
  function getInteractiveStyles(_ref3) {
37
42
  var isInteractive = _ref3.isInteractive,
38
43
  frameStyle = _ref3.frameStyle;
39
- return isInteractive ? "\n &:hover {\n ".concat(frameStyle !== 'hide' && visibleStyles, "\n }\n &:active {\n background-color: ", "var(--ds-background-selected, ".concat(colors.B50, ")"), ";\n }\n ") : '';
44
+ return isInteractive ? "\n &:hover {\n ".concat(frameStyle !== 'hide' && visibleStyles, "\n\n }\n &:active {\n background-color: ", "var(--ds-background-selected, ".concat(colors.B50, ")"), ";\n }\n ") : '';
40
45
  }
41
46
  function selected(_ref4) {
42
47
  var isSelected = _ref4.isSelected,
43
48
  frameStyle = _ref4.frameStyle;
44
- return isSelected && frameStyle !== 'hide' ? "\n ".concat(visibleStyles, "\n &::after {\n cursor: pointer;\n box-shadow: 0 0 0 3px ", "var(--ds-border-selected, ".concat(colors.B100, ")"), ";\n content: '';\n outline: none;\n position: absolute;\n height: 100%;\n width: 100%;\n left: 0;\n ").concat(borderRadius, "\n }\n ") : isSelected && frameStyle === 'hide' ? "\n box-shadow: 0 0 0 3px ".concat("var(--ds-border-selected, ".concat(colors.B100, ")"), ";\n ", borderRadius, "\n ") : '';
49
+ return isSelected && frameStyle !== 'hide' ? "\n ".concat(visibleStyles, "\n &::after {\n cursor: pointer;\n box-shadow: 0 0 0 3px ", "var(--ds-border-selected, ".concat(colors.B100, ")"), ";\n content: '';\n outline: none;\n position: absolute;\n height: 100%;\n width: 100%;\n left: 0;\n ").concat(getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : borderRadius, "\n }\n ") : isSelected && frameStyle === 'hide' ? "\n ".concat(getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? contentBorderRadius : "box-shadow: 0 0 0 3px ".concat("var(--ds-border-selected, ".concat(colors.B100, ")"), ";\n ", borderRadius), "\n ") : '';
45
50
  }
46
51
  var height = function height(_ref5) {
47
52
  var inheritDimensions = _ref5.inheritDimensions;
48
53
  return inheritDimensions ? 'height: 100%;' : "height: ".concat(gridSize(54));
49
54
  };
50
55
  var wrapperStyles = function wrapperStyles(props) {
51
- return "\n ".concat(borderRadius, "\n ").concat(minWidth(props), "\n ").concat(maxWidth(props), "\n ").concat(getInteractiveStyles(props), "\n ").concat(visible(props), "\n display: inline-flex;\n flex-direction: column;\n box-sizing: border-box;\n font-family: ").concat(fontFamily(), ";\n width: 100%;\n user-select: none;\n line-height: initial;\n transition: background 0.3s;\n position: relative;\n ").concat(height(props), ";\n ").concat(selected(props), "\n\n &:after {\n content: '';\n background: transparent;\n transition: background 0.3s, box-shadow 0.3s;\n position: absolute;\n width: calc(100% + ", "var(--ds-space-200, 16px)", ");\n height: calc(100% + ", "var(--ds-space-100, 8px)", ");\n left: calc(-1 * ", "var(--ds-space-100, 8px)", ");\n ").concat(borderRadius, "\n }\n");
56
+ return "\n ".concat(getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : borderRadius, "\n ").concat(minWidth(props), "\n ").concat(maxWidth(props), "\n ").concat(getInteractiveStyles(props), "\n ").concat(visible(props), "\n display: inline-flex;\n flex-direction: column;\n box-sizing: border-box;\n font-family: ").concat(fontFamily(), ";\n width: 100%;\n user-select: none;\n line-height: initial;\n transition: background 0.3s;\n position: relative;\n ").concat(height(props), ";\n ").concat(selected(props), "\n\n &:after {\n content: '';\n transition: background 0.3s, box-shadow 0.3s;\n position: absolute;\n width: calc(100% + ", "var(--ds-space-200, 16px)", ");\n height: calc(100% + ", "var(--ds-space-100, 8px)", ");\n left: calc(-1 * ", "var(--ds-space-100, 8px)", ");\n ").concat(getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? wrapperBorderRadius : "background: transparent;\n ".concat(borderRadius), "\n }\n");
52
57
  };
53
- var visibleStyles = "\n background-color: ".concat("var(--ds-background-neutral-subtle, ".concat(colors.N30, ")"), ";\n\n &:after {\n background: ", "var(--ds-background-neutral, ".concat(colors.N30, ")"), " !important;\n }\n .embed-header {\n opacity: 1;\n }");
58
+ var visibleStyles = "\n ".concat(getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "" : "background-color: ".concat("var(--ds-background-neutral-subtle, ".concat(colors.N30, ")"), ";"), "\n\n &:after {\n ").concat(getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "outline: 1px solid ".concat("var(--ds-border-input, ".concat(N40, ")"), ";\n background-color: ", themed({
59
+ light: "var(--ds-surface-raised, white)",
60
+ dark: "var(--ds-surface-raised, ".concat(BACKGROUND_COLOR_DARK, ")")
61
+ })(), ";") : "background: ".concat("var(--ds-background-neutral, ".concat(colors.N30, ")"), " !important;"), "\n }\n .embed-header {\n opacity: 1;\n }");
54
62
  function visible(_ref6) {
55
63
  var frameStyle = _ref6.frameStyle;
56
64
  return frameStyle === 'show' ? visibleStyles : '';
@@ -84,9 +92,9 @@ export var TextWrapper = styled.div(_templateObject5 || (_templateObject5 = _tag
84
92
  // NB: `overflow` is kept as `hidden` since
85
93
  // the internal contents of the `iframe` should
86
94
  // manage scrolling behaviour.
87
- export var Content = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n ", "\n background-color: ", ";\n position: absolute;\n z-index: 1;\n width: 100%;\n transition: box-shadow 0.3s;\n\n > .calc-height > div > div {\n left: unset !important;\n width: unset !important;\n height: unset !important;\n position: initial !important;\n padding-bottom: unset !important;\n }\n > .embed-preview > div {\n margin: 0 auto;\n }\n\n ", ";\n\n ", "\n\n ", "\n"])), borderRadius, cardShadow, "var(--ds-surface-raised, white)", function (_ref9) {
95
+ export var Content = styled.div(_templateObject6 || (_templateObject6 = _taggedTemplateLiteral(["\n ", "\n background-color: ", ";\n position: absolute;\n z-index: 1;\n width: 100%;\n transition: box-shadow 0.3s;\n\n > .calc-height > div > div {\n left: unset !important;\n width: unset !important;\n height: unset !important;\n position: initial !important;\n padding-bottom: unset !important;\n }\n > .embed-preview > div {\n margin: 0 auto;\n }\n\n ", ";\n\n ", "\n\n ", "\n"])), getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design') ? "".concat(contentBorderRadius, ";\n outline: 1px solid ", "var(--ds-border-input, ".concat(N40, ")"), ";") : borderRadius, "var(--ds-surface-raised, white)", function (_ref9) {
88
96
  var isInteractive = _ref9.isInteractive;
89
- if (isInteractive) {
97
+ if (isInteractive && !getBooleanFF('platform.linking-platform.smart-card.show-smart-links-refreshed-design')) {
90
98
  return "\n .".concat(className, ":hover & {\n box-shadow: ", "var(--ds-shadow-overlay, 0 4px 8px -2px rgba(23, 43, 77, 0.32), 0 0 1px rgba(23, 43, 77, 0.25))", ";\n }\n ");
91
99
  } else {
92
100
  return '';
@@ -1,11 +1,10 @@
1
- import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
1
  import _extends from "@babel/runtime/helpers/extends";
3
2
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
- import _regeneratorRuntime from "@babel/runtime/regenerator";
5
3
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
6
4
  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) { _defineProperty(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; }
7
5
  import React from 'react';
8
6
  import Action from '../index';
7
+ import { openUrl } from '../../../../../../utils';
9
8
  var ViewAction = function ViewAction(props) {
10
9
  var appearance = props.appearance,
11
10
  asDropDownItem = props.asDropDownItem,
@@ -16,9 +15,7 @@ var ViewAction = function ViewAction(props) {
16
15
  if (viewUrl && url) {
17
16
  var action = _objectSpread(_objectSpread({}, props), {}, {
18
17
  onClick: function onClick() {
19
- viewFunction({
20
- url: viewUrl
21
- });
18
+ openUrl(viewUrl);
22
19
  if (_onClick) {
23
20
  _onClick();
24
21
  }
@@ -33,29 +30,4 @@ var ViewAction = function ViewAction(props) {
33
30
  return null;
34
31
  }
35
32
  };
36
- export function viewFunction(_x) {
37
- return _viewFunction.apply(this, arguments);
38
- }
39
- function _viewFunction() {
40
- _viewFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref) {
41
- var url;
42
- return _regeneratorRuntime.wrap(function _callee$(_context) {
43
- while (1) switch (_context.prev = _context.next) {
44
- case 0:
45
- url = _ref.url;
46
- if (url) {
47
- _context.next = 3;
48
- break;
49
- }
50
- return _context.abrupt("return");
51
- case 3:
52
- window.open(url, '_blank', 'noopener=yes');
53
- case 4:
54
- case "end":
55
- return _context.stop();
56
- }
57
- }, _callee);
58
- }));
59
- return _viewFunction.apply(this, arguments);
60
- }
61
33
  export default ViewAction;
@@ -21,3 +21,4 @@ export declare const handleOnClick: (handler: Function) => (e: React.BaseSynthet
21
21
  export declare const isIntersectionObserverSupported: () => boolean;
22
22
  export declare const sleep: (ms: number) => Promise<void>;
23
23
  export declare const importWithRetry: <T>(importFn: () => Promise<T>, retries?: number, interval?: number) => Promise<T>;
24
+ export declare const openUrl: (url?: string) => Promise<void>;
@@ -1,8 +1,4 @@
1
1
  import { ActionProps } from '../components/Action';
2
- export interface ViewFunctionArg {
3
- url?: string;
4
- }
5
- export declare function viewFunction({ url }: ViewFunctionArg): Promise<void>;
6
2
  export declare const ViewAction: ({ url }: {
7
3
  url?: string | undefined;
8
4
  }) => ActionProps;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FrameStyle } from '../types';
3
3
  export declare const className = "media-card-frame";
4
- export declare const cardShadow = "";
5
4
  export interface WrapperProps {
6
5
  minWidth?: number;
7
6
  maxWidth?: number;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ViewActionProps, ViewFunctionProps } from './types';
2
+ import { ViewActionProps } from './types';
3
3
  declare const ViewAction: React.FC<ViewActionProps>;
4
- export declare function viewFunction({ url }: ViewFunctionProps): Promise<void>;
5
4
  export default ViewAction;
@@ -3,6 +3,3 @@ export type ViewActionProps = ActionProps & {
3
3
  viewUrl?: string;
4
4
  url: string;
5
5
  };
6
- export interface ViewFunctionProps {
7
- url?: string;
8
- }
@@ -21,3 +21,4 @@ export declare const handleOnClick: (handler: Function) => (e: React.BaseSynthet
21
21
  export declare const isIntersectionObserverSupported: () => boolean;
22
22
  export declare const sleep: (ms: number) => Promise<void>;
23
23
  export declare const importWithRetry: <T>(importFn: () => Promise<T>, retries?: number, interval?: number) => Promise<T>;
24
+ export declare const openUrl: (url?: string) => Promise<void>;
@@ -1,8 +1,4 @@
1
1
  import { ActionProps } from '../components/Action';
2
- export interface ViewFunctionArg {
3
- url?: string;
4
- }
5
- export declare function viewFunction({ url }: ViewFunctionArg): Promise<void>;
6
2
  export declare const ViewAction: ({ url }: {
7
3
  url?: string | undefined;
8
4
  }) => ActionProps;
@@ -1,7 +1,6 @@
1
1
  /// <reference types="react" />
2
2
  import { FrameStyle } from '../types';
3
3
  export declare const className = "media-card-frame";
4
- export declare const cardShadow = "";
5
4
  export interface WrapperProps {
6
5
  minWidth?: number;
7
6
  maxWidth?: number;
@@ -1,5 +1,4 @@
1
1
  import React from 'react';
2
- import { ViewActionProps, ViewFunctionProps } from './types';
2
+ import { ViewActionProps } from './types';
3
3
  declare const ViewAction: React.FC<ViewActionProps>;
4
- export declare function viewFunction({ url }: ViewFunctionProps): Promise<void>;
5
4
  export default ViewAction;
@@ -3,6 +3,3 @@ export type ViewActionProps = ActionProps & {
3
3
  viewUrl?: string;
4
4
  url: string;
5
5
  };
6
- export interface ViewFunctionProps {
7
- url?: string;
8
- }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.14.1",
3
+ "version": "26.14.3",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -140,7 +140,7 @@
140
140
  "platform.linking-platform.smart-card.should-call-onclick-in-warning-modal-only-when-safe": {
141
141
  "type": "boolean"
142
142
  },
143
- "platform.linking-platform.smart-card.show-inline-card-refreshed-design": {
143
+ "platform.linking-platform.smart-card.show-smart-links-refreshed-design": {
144
144
  "type": "boolean"
145
145
  },
146
146
  "platform.linking-platform.smart-card.enable-better-metadata_iojwg": {