@atlaskit/smart-card 26.14.0 → 26.14.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/version.json +1 -1
  3. package/dist/cjs/view/CardWithUrl/component.js +1 -1
  4. package/dist/cjs/view/EmbedCard/components/styled.js +15 -9
  5. package/dist/cjs/view/EmbedModal/utils.js +30 -56
  6. package/dist/cjs/view/FlexibleCard/components/actions/action/preview-action/index.js +2 -2
  7. package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +1 -2
  8. package/dist/cjs/view/FlexibleCard/components/utils.js +37 -2
  9. package/dist/es2019/version.json +1 -1
  10. package/dist/es2019/view/CardWithUrl/component.js +1 -1
  11. package/dist/es2019/view/EmbedCard/components/styled.js +26 -12
  12. package/dist/es2019/view/EmbedModal/utils.js +14 -46
  13. package/dist/es2019/view/FlexibleCard/components/actions/action/preview-action/index.js +2 -2
  14. package/dist/es2019/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +2 -3
  15. package/dist/es2019/view/FlexibleCard/components/utils.js +35 -0
  16. package/dist/esm/version.json +1 -1
  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/EmbedModal/utils.js +29 -53
  20. package/dist/esm/view/FlexibleCard/components/actions/action/preview-action/index.js +2 -2
  21. package/dist/esm/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-error/index.js +2 -3
  22. package/dist/esm/view/FlexibleCard/components/utils.js +34 -0
  23. package/dist/types/view/EmbedCard/components/styled.d.ts +0 -1
  24. package/dist/types/view/EmbedModal/utils.d.ts +2 -10
  25. package/dist/types/view/FlexibleCard/components/actions/action/preview-action/types.d.ts +0 -4
  26. package/dist/types/view/FlexibleCard/components/utils.d.ts +64 -0
  27. package/dist/types-ts4.5/view/EmbedCard/components/styled.d.ts +0 -1
  28. package/dist/types-ts4.5/view/EmbedModal/utils.d.ts +2 -10
  29. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/preview-action/types.d.ts +0 -4
  30. package/dist/types-ts4.5/view/FlexibleCard/components/utils.d.ts +64 -0
  31. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 26.14.2
4
+
5
+ ### Patch Changes
6
+
7
+ - [`6a807668da6`](https://bitbucket.org/atlassian/atlassian-frontend/commits/6a807668da6) - [ux] Refreshed design for the Embed Smart Links view added under the FF
8
+
9
+ ## 26.14.1
10
+
11
+ ### Patch Changes
12
+
13
+ - [`f3cefce58df`](https://bitbucket.org/atlassian/atlassian-frontend/commits/f3cefce58df) - Refactor embed modal helper function (internal)
14
+
3
15
  ## 26.14.0
4
16
 
5
17
  ### Minor Changes
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.14.0",
3
+ "version": "26.14.2",
4
4
  "sideEffects": false
5
5
  }
@@ -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,53 +5,19 @@ var _typeof = require("@babel/runtime/helpers/typeof");
5
5
  Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
- exports.openPreviewModal = void 0;
9
- exports.previewFunction = previewFunction;
8
+ exports.openEmbedModal = openEmbedModal;
10
9
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
10
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
11
11
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
12
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
13
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
14
13
  var _react = _interopRequireDefault(require("react"));
15
14
  var _reactDom = _interopRequireDefault(require("react-dom"));
16
15
  var _reactIntlNext = require("react-intl-next");
17
- var _icon = _interopRequireDefault(require("../FlexibleCard/components/elements/icon"));
18
- var _constants = require("../../constants");
19
- var _excluded = ["popupMountPointId", "onClose"];
16
+ var _excluded = ["onClose"];
20
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); }
21
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; }
22
- var openPreviewModal = function openPreviewModal(_ref) {
23
- var analytics = _ref.analytics,
24
- download = _ref.downloadUrl,
25
- isSupportTheming = _ref.isSupportTheming,
26
- linkIcon = _ref.linkIcon,
27
- _ref$onClose = _ref.onClose,
28
- onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
29
- providerName = _ref.providerName,
30
- src = _ref.src,
31
- title = _ref.title,
32
- url = _ref.url;
33
- var EmbedIcon = {
34
- icon: /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({}, linkIcon, {
35
- size: _constants.SmartLinkSize.Large
36
- })),
37
- isFlexibleUi: true
38
- };
39
- return previewFunction({
40
- popupMountPointId: 'twp-editor-preview-iframe',
41
- showModal: true,
42
- iframeName: 'twp-editor-preview-iframe',
43
- onClose: onClose,
44
- download: download,
45
- icon: EmbedIcon,
46
- providerName: providerName || 'Preview',
47
- src: src,
48
- title: title,
49
- url: url,
50
- analytics: analytics,
51
- origin: 'smartLinkCard',
52
- isSupportTheming: isSupportTheming
53
- });
54
- };
19
+ var IFRAME_NAME = 'twp-editor-preview-iframe';
20
+ var POPUP_MOUNT_POINT_ID = 'twp-editor-preview-iframe';
55
21
 
56
22
  /*
57
23
  Explanatory note:
@@ -66,47 +32,55 @@ var openPreviewModal = function openPreviewModal(_ref) {
66
32
  you find an elegant solution around this, you should definitely feel free to
67
33
  refactor it.
68
34
  */
69
- exports.openPreviewModal = openPreviewModal;
70
- function previewFunction(_x) {
71
- return _previewFunction.apply(this, arguments);
35
+ function openEmbedModal() {
36
+ return _openEmbedModal.apply(this, arguments);
72
37
  }
73
- function _previewFunction() {
74
- _previewFunction = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref2) {
75
- var popupMountPointId, onEmbedClose, rest, popupMountPoint, Modal;
38
+ function _openEmbedModal() {
39
+ _openEmbedModal = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
40
+ var _ref,
41
+ _ref$onClose,
42
+ _onClose,
43
+ props,
44
+ popupMountPoint,
45
+ Modal,
46
+ _args = arguments;
76
47
  return _regenerator.default.wrap(function _callee$(_context2) {
77
48
  while (1) switch (_context2.prev = _context2.next) {
78
49
  case 0:
79
- popupMountPointId = _ref2.popupMountPointId, onEmbedClose = _ref2.onClose, rest = (0, _objectWithoutProperties2.default)(_ref2, _excluded);
80
- popupMountPoint = document.getElementById(popupMountPointId);
50
+ _ref = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
51
+ _ref$onClose = _ref.onClose, _onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose, props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
52
+ popupMountPoint = document.getElementById(POPUP_MOUNT_POINT_ID);
81
53
  if (!popupMountPoint) {
82
54
  popupMountPoint = document.createElement('div');
83
- popupMountPoint.id = popupMountPointId;
55
+ popupMountPoint.id = POPUP_MOUNT_POINT_ID;
84
56
  popupMountPoint.setAttribute('data-testid', 'preview-modal');
85
57
  document.body.appendChild(popupMountPoint);
86
58
  }
87
- _context2.next = 5;
59
+ _context2.next = 6;
88
60
  return Promise.resolve().then(function () {
89
61
  return _interopRequireWildcard(require('./index'));
90
62
  });
91
- case 5:
63
+ case 6:
92
64
  Modal = _context2.sent;
93
65
  _reactDom.default.render( /*#__PURE__*/_react.default.createElement(_reactIntlNext.IntlProvider, {
94
66
  locale: "en"
95
- }, /*#__PURE__*/_react.default.createElement(Modal.default, (0, _extends2.default)({}, rest, {
67
+ }, /*#__PURE__*/_react.default.createElement(Modal.default, (0, _extends2.default)({}, props, {
68
+ iframeName: IFRAME_NAME,
96
69
  onClose: function onClose(_context) {
97
70
  if (popupMountPoint) {
98
71
  _reactDom.default.unmountComponentAtNode(popupMountPoint);
99
72
  }
100
- if (onEmbedClose) {
101
- onEmbedClose(_context);
73
+ if (_onClose) {
74
+ _onClose(_context);
102
75
  }
103
- }
76
+ },
77
+ showModal: true
104
78
  }))), popupMountPoint);
105
- case 7:
79
+ case 8:
106
80
  case "end":
107
81
  return _context2.stop();
108
82
  }
109
83
  }, _callee);
110
84
  }));
111
- return _previewFunction.apply(this, arguments);
85
+ return _openEmbedModal.apply(this, arguments);
112
86
  }
@@ -11,10 +11,10 @@ var _react = _interopRequireDefault(require("react"));
11
11
  var _index = _interopRequireDefault(require("../index"));
12
12
  var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
13
13
  var _state = require("../../../../../../state");
14
- var _utils = require("../../../../../EmbedModal/utils");
15
14
  var _reactIntlNext = require("react-intl-next");
16
15
  var _messages = require("../../../../../../messages");
17
16
  var _linkProvider = require("@atlaskit/link-provider");
17
+ var _utils = require("../../../utils");
18
18
  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; }
19
19
  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; }
20
20
  var PreviewAction = function PreviewAction(props) {
@@ -35,7 +35,7 @@ var PreviewAction = function PreviewAction(props) {
35
35
  var previewText = enableImprovedPreviewAction ? _messages.messages.preview_improved : _messages.messages.preview;
36
36
  if (src && url) {
37
37
  var embedModal = function embedModal() {
38
- return (0, _utils.openPreviewModal)({
38
+ return (0, _utils.openEmbedModalWithFlexibleUiIcon)({
39
39
  title: title,
40
40
  providerName: providerName,
41
41
  downloadUrl: downloadUrl,
@@ -16,7 +16,6 @@ var _styled = require("./styled");
16
16
  var _utils = require("../../../../utils");
17
17
  var _messages = require("../../../../../../../messages");
18
18
  var _flexibleUiContext = require("../../../../../../../state/flexible-ui-context");
19
- var _utils2 = require("../../../../../../EmbedModal/utils");
20
19
  var _useResolve = _interopRequireDefault(require("../../../../../../../state/hooks/use-resolve"));
21
20
  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; }
22
21
  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; } /** @jsx jsx */
@@ -39,7 +38,7 @@ var LozengeActionError = function LozengeActionError(_ref) {
39
38
  var handlePreviewOpen = (0, _react2.useCallback)(function () {
40
39
  if (isPreviewAvailable) {
41
40
  analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionErrorOpenPreviewClickedEvent();
42
- return (0, _utils2.openPreviewModal)(_objectSpread(_objectSpread({}, previewData), {}, {
41
+ return (0, _utils.openEmbedModalWithFlexibleUiIcon)(_objectSpread(_objectSpread({}, previewData), {}, {
43
42
  analytics: analytics,
44
43
  onClose: handlePreviewClose
45
44
  }));
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.sizeToButtonSpacing = exports.hasWhiteSpace = exports.getTruncateStyles = exports.getMaxLines = exports.getMaxLineHeight = exports.getLinkSizeStyles = exports.getLinkLineHeight = exports.getIconWidth = exports.getIconSizeStyles = exports.getFormattedMessage = void 0;
7
+ exports.sizeToButtonSpacing = exports.openEmbedModalWithFlexibleUiIcon = exports.hasWhiteSpace = exports.getTruncateStyles = exports.getMaxLines = exports.getMaxLineHeight = exports.getLinkSizeStyles = exports.getLinkLineHeight = exports.getIconWidth = exports.getIconSizeStyles = exports.getFormattedMessage = void 0;
8
8
  var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
9
9
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
10
10
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
@@ -12,6 +12,8 @@ var _react = _interopRequireDefault(require("react"));
12
12
  var _react2 = require("@emotion/react");
13
13
  var _reactIntlNext = require("react-intl-next");
14
14
  var _constants = require("../../../constants");
15
+ var _icon = _interopRequireDefault(require("./elements/icon"));
16
+ var _utils = require("../../EmbedModal/utils");
15
17
  var _sizeToButtonSpacing, _templateObject, _templateObject2, _templateObject3, _templateObject4, _templateObject5, _templateObject6;
16
18
  var sizeToButtonSpacing = (_sizeToButtonSpacing = {}, (0, _defineProperty2.default)(_sizeToButtonSpacing, _constants.SmartLinkSize.Small, 'none'), (0, _defineProperty2.default)(_sizeToButtonSpacing, _constants.SmartLinkSize.Medium, 'compact'), (0, _defineProperty2.default)(_sizeToButtonSpacing, _constants.SmartLinkSize.Large, 'compact'), (0, _defineProperty2.default)(_sizeToButtonSpacing, _constants.SmartLinkSize.XLarge, 'default'), _sizeToButtonSpacing);
17
19
  exports.sizeToButtonSpacing = sizeToButtonSpacing;
@@ -105,4 +107,37 @@ exports.getTruncateStyles = getTruncateStyles;
105
107
  var hasWhiteSpace = function hasWhiteSpace(str) {
106
108
  return str.search(/\s/) >= 0;
107
109
  };
108
- exports.hasWhiteSpace = hasWhiteSpace;
110
+ exports.hasWhiteSpace = hasWhiteSpace;
111
+ var openEmbedModalWithFlexibleUiIcon = function openEmbedModalWithFlexibleUiIcon(_ref) {
112
+ var analytics = _ref.analytics,
113
+ downloadUrl = _ref.downloadUrl,
114
+ linkIcon = _ref.linkIcon,
115
+ onClose = _ref.onClose,
116
+ providerName = _ref.providerName,
117
+ src = _ref.src,
118
+ title = _ref.title,
119
+ url = _ref.url,
120
+ isSupportTheming = _ref.isSupportTheming;
121
+ var icon = {
122
+ icon: /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({}, linkIcon, {
123
+ size: _constants.SmartLinkSize.Large
124
+ })),
125
+ isFlexibleUi: true
126
+ };
127
+ return (0, _utils.openEmbedModal)({
128
+ analytics: analytics,
129
+ download: downloadUrl,
130
+ icon: icon,
131
+ // Flex should not send origin as block card. It should be able to support
132
+ // its internal parent components like hover card, block card and
133
+ // itself as a standalone. To be investigated and fix in EDM-7520.
134
+ origin: 'smartLinkCard',
135
+ providerName: providerName,
136
+ onClose: onClose,
137
+ src: src,
138
+ title: title,
139
+ url: url,
140
+ isSupportTheming: isSupportTheming
141
+ });
142
+ };
143
+ exports.openEmbedModalWithFlexibleUiIcon = openEmbedModalWithFlexibleUiIcon;
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.14.0",
3
+ "version": "26.14.2",
4
4
  "sideEffects": false
5
5
  }
@@ -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))"};
@@ -2,41 +2,8 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import ReactDOM from 'react-dom';
4
4
  import { IntlProvider } from 'react-intl-next';
5
- import Icon from '../FlexibleCard/components/elements/icon';
6
- import { SmartLinkSize } from '../../constants';
7
- export const openPreviewModal = ({
8
- analytics,
9
- downloadUrl: download,
10
- isSupportTheming,
11
- linkIcon,
12
- onClose = () => {},
13
- providerName,
14
- src,
15
- title,
16
- url
17
- }) => {
18
- const EmbedIcon = {
19
- icon: /*#__PURE__*/React.createElement(Icon, _extends({}, linkIcon, {
20
- size: SmartLinkSize.Large
21
- })),
22
- isFlexibleUi: true
23
- };
24
- return previewFunction({
25
- popupMountPointId: 'twp-editor-preview-iframe',
26
- showModal: true,
27
- iframeName: 'twp-editor-preview-iframe',
28
- onClose,
29
- download,
30
- icon: EmbedIcon,
31
- providerName: providerName || 'Preview',
32
- src,
33
- title,
34
- url,
35
- analytics,
36
- origin: 'smartLinkCard',
37
- isSupportTheming
38
- });
39
- };
5
+ const IFRAME_NAME = 'twp-editor-preview-iframe';
6
+ const POPUP_MOUNT_POINT_ID = 'twp-editor-preview-iframe';
40
7
 
41
8
  /*
42
9
  Explanatory note:
@@ -51,30 +18,31 @@ export const openPreviewModal = ({
51
18
  you find an elegant solution around this, you should definitely feel free to
52
19
  refactor it.
53
20
  */
54
- export async function previewFunction({
55
- popupMountPointId,
56
- onClose: onEmbedClose,
57
- ...rest
58
- }) {
21
+ export async function openEmbedModal({
22
+ onClose = () => {},
23
+ ...props
24
+ } = {}) {
59
25
  let popupMountPoint;
60
- popupMountPoint = document.getElementById(popupMountPointId);
26
+ popupMountPoint = document.getElementById(POPUP_MOUNT_POINT_ID);
61
27
  if (!popupMountPoint) {
62
28
  popupMountPoint = document.createElement('div');
63
- popupMountPoint.id = popupMountPointId;
29
+ popupMountPoint.id = POPUP_MOUNT_POINT_ID;
64
30
  popupMountPoint.setAttribute('data-testid', 'preview-modal');
65
31
  document.body.appendChild(popupMountPoint);
66
32
  }
67
33
  let Modal = await import('./index');
68
34
  ReactDOM.render( /*#__PURE__*/React.createElement(IntlProvider, {
69
35
  locale: "en"
70
- }, /*#__PURE__*/React.createElement(Modal.default, _extends({}, rest, {
36
+ }, /*#__PURE__*/React.createElement(Modal.default, _extends({}, props, {
37
+ iframeName: IFRAME_NAME,
71
38
  onClose: _context => {
72
39
  if (popupMountPoint) {
73
40
  ReactDOM.unmountComponentAtNode(popupMountPoint);
74
41
  }
75
- if (onEmbedClose) {
76
- onEmbedClose(_context);
42
+ if (onClose) {
43
+ onClose(_context);
77
44
  }
78
- }
45
+ },
46
+ showModal: true
79
47
  }))), popupMountPoint);
80
48
  }
@@ -3,10 +3,10 @@ import React from 'react';
3
3
  import Action from '../index';
4
4
  import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
5
5
  import { useSmartLinkAnalytics } from '../../../../../../state';
6
- import { openPreviewModal } from '../../../../../EmbedModal/utils';
7
6
  import { FormattedMessage } from 'react-intl-next';
8
7
  import { messages } from '../../../../../../messages';
9
8
  import { useFeatureFlag } from '@atlaskit/link-provider';
9
+ import { openEmbedModalWithFlexibleUiIcon } from '../../../utils';
10
10
  const PreviewAction = props => {
11
11
  const {
12
12
  appearance,
@@ -26,7 +26,7 @@ const PreviewAction = props => {
26
26
  const enableImprovedPreviewAction = Boolean(useFeatureFlag('enableImprovedPreviewAction'));
27
27
  const previewText = enableImprovedPreviewAction ? messages.preview_improved : messages.preview;
28
28
  if (src && url) {
29
- const embedModal = () => openPreviewModal({
29
+ const embedModal = () => openEmbedModalWithFlexibleUiIcon({
30
30
  title,
31
31
  providerName,
32
32
  downloadUrl,
@@ -6,10 +6,9 @@ import { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
6
6
  import { R50, R500 } from '@atlaskit/theme/colors';
7
7
  import ErrorIcon from '@atlaskit/icon/glyph/error';
8
8
  import { dropdownItemGroupStyles, contentStyles, linkStyles, textStyles } from './styled';
9
- import { getFormattedMessage } from '../../../../utils';
9
+ import { getFormattedMessage, openEmbedModalWithFlexibleUiIcon } from '../../../../utils';
10
10
  import { messages } from '../../../../../../../messages';
11
11
  import { useFlexibleUiAnalyticsContext } from '../../../../../../../state/flexible-ui-context';
12
- import { openPreviewModal } from '../../../../../../EmbedModal/utils';
13
12
  import useResolve from '../../../../../../../state/hooks/use-resolve';
14
13
  const MAX_LINE_NUMBER = 8;
15
14
  const LozengeActionError = ({
@@ -30,7 +29,7 @@ const LozengeActionError = ({
30
29
  const handlePreviewOpen = useCallback(() => {
31
30
  if (isPreviewAvailable) {
32
31
  analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionErrorOpenPreviewClickedEvent();
33
- return openPreviewModal({
32
+ return openEmbedModalWithFlexibleUiIcon({
34
33
  ...previewData,
35
34
  analytics,
36
35
  onClose: handlePreviewClose
@@ -3,6 +3,8 @@ import React from 'react';
3
3
  import { css } from '@emotion/react';
4
4
  import { FormattedMessage } from 'react-intl-next';
5
5
  import { SmartLinkSize } from '../../../constants';
6
+ import Icon from './elements/icon';
7
+ import { openEmbedModal } from '../../EmbedModal/utils';
6
8
  export const sizeToButtonSpacing = {
7
9
  [SmartLinkSize.Small]: 'none',
8
10
  [SmartLinkSize.Medium]: 'compact',
@@ -130,4 +132,37 @@ export const getTruncateStyles = (maxLines, lineHeight = '1rem', wordBreak = 'br
130
132
  `;
131
133
  export const hasWhiteSpace = str => {
132
134
  return str.search(/\s/) >= 0;
135
+ };
136
+ export const openEmbedModalWithFlexibleUiIcon = ({
137
+ analytics,
138
+ downloadUrl,
139
+ linkIcon,
140
+ onClose,
141
+ providerName,
142
+ src,
143
+ title,
144
+ url,
145
+ isSupportTheming
146
+ }) => {
147
+ const icon = {
148
+ icon: /*#__PURE__*/React.createElement(Icon, _extends({}, linkIcon, {
149
+ size: SmartLinkSize.Large
150
+ })),
151
+ isFlexibleUi: true
152
+ };
153
+ return openEmbedModal({
154
+ analytics,
155
+ download: downloadUrl,
156
+ icon,
157
+ // Flex should not send origin as block card. It should be able to support
158
+ // its internal parent components like hover card, block card and
159
+ // itself as a standalone. To be investigated and fix in EDM-7520.
160
+ origin: 'smartLinkCard',
161
+ providerName,
162
+ onClose,
163
+ src,
164
+ title,
165
+ url,
166
+ isSupportTheming
167
+ });
133
168
  };
@@ -1,5 +1,5 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.14.0",
3
+ "version": "26.14.2",
4
4
  "sideEffects": false
5
5
  }
@@ -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,46 +1,13 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
2
3
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
3
- import _extends from "@babel/runtime/helpers/extends";
4
- var _excluded = ["popupMountPointId", "onClose"];
4
+ var _excluded = ["onClose"];
5
5
  import _regeneratorRuntime from "@babel/runtime/regenerator";
6
6
  import React from 'react';
7
7
  import ReactDOM from 'react-dom';
8
8
  import { IntlProvider } from 'react-intl-next';
9
- import Icon from '../FlexibleCard/components/elements/icon';
10
- import { SmartLinkSize } from '../../constants';
11
- export var openPreviewModal = function openPreviewModal(_ref) {
12
- var analytics = _ref.analytics,
13
- download = _ref.downloadUrl,
14
- isSupportTheming = _ref.isSupportTheming,
15
- linkIcon = _ref.linkIcon,
16
- _ref$onClose = _ref.onClose,
17
- onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose,
18
- providerName = _ref.providerName,
19
- src = _ref.src,
20
- title = _ref.title,
21
- url = _ref.url;
22
- var EmbedIcon = {
23
- icon: /*#__PURE__*/React.createElement(Icon, _extends({}, linkIcon, {
24
- size: SmartLinkSize.Large
25
- })),
26
- isFlexibleUi: true
27
- };
28
- return previewFunction({
29
- popupMountPointId: 'twp-editor-preview-iframe',
30
- showModal: true,
31
- iframeName: 'twp-editor-preview-iframe',
32
- onClose: onClose,
33
- download: download,
34
- icon: EmbedIcon,
35
- providerName: providerName || 'Preview',
36
- src: src,
37
- title: title,
38
- url: url,
39
- analytics: analytics,
40
- origin: 'smartLinkCard',
41
- isSupportTheming: isSupportTheming
42
- });
43
- };
9
+ var IFRAME_NAME = 'twp-editor-preview-iframe';
10
+ var POPUP_MOUNT_POINT_ID = 'twp-editor-preview-iframe';
44
11
 
45
12
  /*
46
13
  Explanatory note:
@@ -55,44 +22,53 @@ export var openPreviewModal = function openPreviewModal(_ref) {
55
22
  you find an elegant solution around this, you should definitely feel free to
56
23
  refactor it.
57
24
  */
58
- export function previewFunction(_x) {
59
- return _previewFunction.apply(this, arguments);
25
+ export function openEmbedModal() {
26
+ return _openEmbedModal.apply(this, arguments);
60
27
  }
61
- function _previewFunction() {
62
- _previewFunction = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
63
- var popupMountPointId, onEmbedClose, rest, popupMountPoint, Modal;
28
+ function _openEmbedModal() {
29
+ _openEmbedModal = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
30
+ var _ref,
31
+ _ref$onClose,
32
+ _onClose,
33
+ props,
34
+ popupMountPoint,
35
+ Modal,
36
+ _args = arguments;
64
37
  return _regeneratorRuntime.wrap(function _callee$(_context2) {
65
38
  while (1) switch (_context2.prev = _context2.next) {
66
39
  case 0:
67
- popupMountPointId = _ref2.popupMountPointId, onEmbedClose = _ref2.onClose, rest = _objectWithoutProperties(_ref2, _excluded);
68
- popupMountPoint = document.getElementById(popupMountPointId);
40
+ _ref = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
41
+ _ref$onClose = _ref.onClose, _onClose = _ref$onClose === void 0 ? function () {} : _ref$onClose, props = _objectWithoutProperties(_ref, _excluded);
42
+ popupMountPoint = document.getElementById(POPUP_MOUNT_POINT_ID);
69
43
  if (!popupMountPoint) {
70
44
  popupMountPoint = document.createElement('div');
71
- popupMountPoint.id = popupMountPointId;
45
+ popupMountPoint.id = POPUP_MOUNT_POINT_ID;
72
46
  popupMountPoint.setAttribute('data-testid', 'preview-modal');
73
47
  document.body.appendChild(popupMountPoint);
74
48
  }
75
- _context2.next = 5;
49
+ _context2.next = 6;
76
50
  return import('./index');
77
- case 5:
51
+ case 6:
78
52
  Modal = _context2.sent;
79
53
  ReactDOM.render( /*#__PURE__*/React.createElement(IntlProvider, {
80
54
  locale: "en"
81
- }, /*#__PURE__*/React.createElement(Modal.default, _extends({}, rest, {
55
+ }, /*#__PURE__*/React.createElement(Modal.default, _extends({}, props, {
56
+ iframeName: IFRAME_NAME,
82
57
  onClose: function onClose(_context) {
83
58
  if (popupMountPoint) {
84
59
  ReactDOM.unmountComponentAtNode(popupMountPoint);
85
60
  }
86
- if (onEmbedClose) {
87
- onEmbedClose(_context);
61
+ if (_onClose) {
62
+ _onClose(_context);
88
63
  }
89
- }
64
+ },
65
+ showModal: true
90
66
  }))), popupMountPoint);
91
- case 7:
67
+ case 8:
92
68
  case "end":
93
69
  return _context2.stop();
94
70
  }
95
71
  }, _callee);
96
72
  }));
97
- return _previewFunction.apply(this, arguments);
73
+ return _openEmbedModal.apply(this, arguments);
98
74
  }
@@ -6,10 +6,10 @@ import React from 'react';
6
6
  import Action from '../index';
7
7
  import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
8
8
  import { useSmartLinkAnalytics } from '../../../../../../state';
9
- import { openPreviewModal } from '../../../../../EmbedModal/utils';
10
9
  import { FormattedMessage } from 'react-intl-next';
11
10
  import { messages } from '../../../../../../messages';
12
11
  import { useFeatureFlag } from '@atlaskit/link-provider';
12
+ import { openEmbedModalWithFlexibleUiIcon } from '../../../utils';
13
13
  var PreviewAction = function PreviewAction(props) {
14
14
  var appearance = props.appearance,
15
15
  asDropDownItem = props.asDropDownItem,
@@ -28,7 +28,7 @@ var PreviewAction = function PreviewAction(props) {
28
28
  var previewText = enableImprovedPreviewAction ? messages.preview_improved : messages.preview;
29
29
  if (src && url) {
30
30
  var embedModal = function embedModal() {
31
- return openPreviewModal({
31
+ return openEmbedModalWithFlexibleUiIcon({
32
32
  title: title,
33
33
  providerName: providerName,
34
34
  downloadUrl: downloadUrl,
@@ -9,10 +9,9 @@ import { DropdownItem, DropdownItemGroup } from '@atlaskit/dropdown-menu';
9
9
  import { R50, R500 } from '@atlaskit/theme/colors';
10
10
  import ErrorIcon from '@atlaskit/icon/glyph/error';
11
11
  import { dropdownItemGroupStyles, contentStyles, linkStyles, textStyles } from './styled';
12
- import { getFormattedMessage } from '../../../../utils';
12
+ import { getFormattedMessage, openEmbedModalWithFlexibleUiIcon } from '../../../../utils';
13
13
  import { messages } from '../../../../../../../messages';
14
14
  import { useFlexibleUiAnalyticsContext } from '../../../../../../../state/flexible-ui-context';
15
- import { openPreviewModal } from '../../../../../../EmbedModal/utils';
16
15
  import useResolve from '../../../../../../../state/hooks/use-resolve';
17
16
  var MAX_LINE_NUMBER = 8;
18
17
  var LozengeActionError = function LozengeActionError(_ref) {
@@ -33,7 +32,7 @@ var LozengeActionError = function LozengeActionError(_ref) {
33
32
  var handlePreviewOpen = useCallback(function () {
34
33
  if (isPreviewAvailable) {
35
34
  analytics === null || analytics === void 0 ? void 0 : analytics.ui.smartLinkLozengeActionErrorOpenPreviewClickedEvent();
36
- return openPreviewModal(_objectSpread(_objectSpread({}, previewData), {}, {
35
+ return openEmbedModalWithFlexibleUiIcon(_objectSpread(_objectSpread({}, previewData), {}, {
37
36
  analytics: analytics,
38
37
  onClose: handlePreviewClose
39
38
  }));
@@ -6,6 +6,8 @@ import React from 'react';
6
6
  import { css } from '@emotion/react';
7
7
  import { FormattedMessage } from 'react-intl-next';
8
8
  import { SmartLinkSize } from '../../../constants';
9
+ import Icon from './elements/icon';
10
+ import { openEmbedModal } from '../../EmbedModal/utils';
9
11
  export var sizeToButtonSpacing = (_sizeToButtonSpacing = {}, _defineProperty(_sizeToButtonSpacing, SmartLinkSize.Small, 'none'), _defineProperty(_sizeToButtonSpacing, SmartLinkSize.Medium, 'compact'), _defineProperty(_sizeToButtonSpacing, SmartLinkSize.Large, 'compact'), _defineProperty(_sizeToButtonSpacing, SmartLinkSize.XLarge, 'default'), _sizeToButtonSpacing);
10
12
  export var getFormattedMessage = function getFormattedMessage(message) {
11
13
  if (message) {
@@ -88,4 +90,36 @@ export var getTruncateStyles = function getTruncateStyles(maxLines) {
88
90
  };
89
91
  export var hasWhiteSpace = function hasWhiteSpace(str) {
90
92
  return str.search(/\s/) >= 0;
93
+ };
94
+ export var openEmbedModalWithFlexibleUiIcon = function openEmbedModalWithFlexibleUiIcon(_ref) {
95
+ var analytics = _ref.analytics,
96
+ downloadUrl = _ref.downloadUrl,
97
+ linkIcon = _ref.linkIcon,
98
+ onClose = _ref.onClose,
99
+ providerName = _ref.providerName,
100
+ src = _ref.src,
101
+ title = _ref.title,
102
+ url = _ref.url,
103
+ isSupportTheming = _ref.isSupportTheming;
104
+ var icon = {
105
+ icon: /*#__PURE__*/React.createElement(Icon, _extends({}, linkIcon, {
106
+ size: SmartLinkSize.Large
107
+ })),
108
+ isFlexibleUi: true
109
+ };
110
+ return openEmbedModal({
111
+ analytics: analytics,
112
+ download: downloadUrl,
113
+ icon: icon,
114
+ // Flex should not send origin as block card. It should be able to support
115
+ // its internal parent components like hover card, block card and
116
+ // itself as a standalone. To be investigated and fix in EDM-7520.
117
+ origin: 'smartLinkCard',
118
+ providerName: providerName,
119
+ onClose: onClose,
120
+ src: src,
121
+ title: title,
122
+ url: url,
123
+ isSupportTheming: isSupportTheming
124
+ });
91
125
  };
@@ -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,10 +1,2 @@
1
- import { PreviewFunctionProps } from '../FlexibleCard/components/actions/action/preview-action/types';
2
- import { PreviewActionData } from '../../state/flexible-ui-context/types';
3
- import { AnalyticsFacade } from '../../state/analytics';
4
- type PreviewModalProps = {
5
- analytics?: AnalyticsFacade;
6
- onClose?: () => void;
7
- } & PreviewActionData;
8
- export declare const openPreviewModal: ({ analytics, downloadUrl: download, isSupportTheming, linkIcon, onClose, providerName, src, title, url, }: PreviewModalProps) => Promise<void>;
9
- export declare function previewFunction({ popupMountPointId, onClose: onEmbedClose, ...rest }: PreviewFunctionProps): Promise<void>;
10
- export {};
1
+ import { EmbedModalProps } from './types';
2
+ export declare function openEmbedModal({ onClose, ...props }?: Partial<EmbedModalProps>): Promise<void>;
@@ -1,5 +1,4 @@
1
1
  import { Icon } from '../../../../../../state/flexible-ui-context/types';
2
- import { EmbedModalProps } from '../../../../../../view/EmbedModal/types';
3
2
  import { ActionProps } from '../types';
4
3
  export type PreviewActionProps = ActionProps & FlexibleEmbedProps;
5
4
  export type FlexibleEmbedProps = {
@@ -11,6 +10,3 @@ export type FlexibleEmbedProps = {
11
10
  url: string;
12
11
  isSupportTheming?: boolean;
13
12
  };
14
- export interface PreviewFunctionProps extends EmbedModalProps {
15
- popupMountPointId: string;
16
- }
@@ -3,6 +3,8 @@ import { SerializedStyles } from '@emotion/react';
3
3
  import { Spacing } from '@atlaskit/button';
4
4
  import { SmartLinkSize } from '../../../constants';
5
5
  import { MessageProps } from './types';
6
+ import { AnalyticsFacade } from '../../../state/analytics';
7
+ import { PreviewActionData } from '../../../state/flexible-ui-context/types';
6
8
  export declare const sizeToButtonSpacing: Record<SmartLinkSize, Spacing>;
7
9
  export declare const getFormattedMessage: (message?: MessageProps) => JSX.Element | undefined;
8
10
  export declare const getIconSizeStyles: (width: string) => SerializedStyles;
@@ -13,3 +15,65 @@ export declare const getMaxLineHeight: (size: SmartLinkSize) => 1.5 | 1.75;
13
15
  export declare const getMaxLines: (value: number, defaultValue: number, max: number, min: number) => number;
14
16
  export declare const getTruncateStyles: (maxLines: number, lineHeight?: string, wordBreak?: 'break-word' | 'break-all') => SerializedStyles;
15
17
  export declare const hasWhiteSpace: (str: string) => boolean;
18
+ export declare const openEmbedModalWithFlexibleUiIcon: ({ analytics, downloadUrl, linkIcon, onClose, providerName, src, title, url, isSupportTheming, }: PreviewActionData & {
19
+ analytics?: {
20
+ ui: {
21
+ authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiAuthEventProps) => void;
22
+ authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiAuthAlternateAccountEventProps) => void;
23
+ buttonClickedEvent: (data: Partial<import("../../..").AnalyticsPayload> & {
24
+ actionSubjectId: string;
25
+ }) => void;
26
+ cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../../utils/analytics/types").UiCardClickedEventProps) => void;
27
+ iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../../utils/analytics/types").UiIframeDwelledEventProps) => void;
28
+ iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../../utils/analytics/types").UiIframeFocusedEventProps) => void;
29
+ actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiActionClickedEventProps) => void;
30
+ hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
31
+ closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiClosedAuthEventProps) => void;
32
+ modalClosedEvent: (data: Partial<import("../../..").AnalyticsPayload> & {
33
+ actionSubjectId: string;
34
+ }) => void;
35
+ renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiRenderSuccessEventProps) => void;
36
+ renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiRenderFailedEventProps) => void;
37
+ hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
38
+ hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
39
+ learnMoreClickedEvent: () => void;
40
+ smartLinkLozengeActionClickedEvent: () => void;
41
+ smartLinkLozengeActionListItemClickedEvent: () => void;
42
+ smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
43
+ };
44
+ operational: {
45
+ invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeSucceededEventProps) => void;
46
+ invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeFailedEventProps) => void;
47
+ connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").ConnectSucceededEventProps) => void;
48
+ connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").ConnectFailedEventProps) => void;
49
+ instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../../utils/analytics/types").InstrumentEventProps) => void;
50
+ chunkloadFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiRenderFailedEventProps) => void;
51
+ };
52
+ track: {
53
+ appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").CommonEventProps) => void;
54
+ appAccountAuthStarted: ({ extensionKey, location, }: import("../../../utils/analytics/types").CommonEventProps) => void;
55
+ linkUpdated: (props: import("../../../utils/analytics/types").CommonEventProps & {
56
+ [key: string]: any;
57
+ }) => void;
58
+ smartLinkQuickActionStarted: (props: {
59
+ smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../../utils/analytics/analytics").TrackQuickActionType;
60
+ }) => void;
61
+ smartLinkQuickActionSuccess: (props: {
62
+ smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../../utils/analytics/analytics").TrackQuickActionType;
63
+ }) => void;
64
+ smartLinkQuickActionFailed: (props: {
65
+ smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../../utils/analytics/analytics").TrackQuickActionType;
66
+ reason?: import("../../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
67
+ step?: string | undefined;
68
+ }) => void;
69
+ hoverCardResolutionStarted: () => void;
70
+ };
71
+ screen: {
72
+ authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").CommonEventProps) => void;
73
+ modalViewedEvent: (data: Partial<import("../../..").AnalyticsPayload> & {
74
+ name: "embedPreviewModal";
75
+ }) => void;
76
+ };
77
+ } | undefined;
78
+ onClose?: (() => void) | undefined;
79
+ }) => Promise<void>;
@@ -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,10 +1,2 @@
1
- import { PreviewFunctionProps } from '../FlexibleCard/components/actions/action/preview-action/types';
2
- import { PreviewActionData } from '../../state/flexible-ui-context/types';
3
- import { AnalyticsFacade } from '../../state/analytics';
4
- type PreviewModalProps = {
5
- analytics?: AnalyticsFacade;
6
- onClose?: () => void;
7
- } & PreviewActionData;
8
- export declare const openPreviewModal: ({ analytics, downloadUrl: download, isSupportTheming, linkIcon, onClose, providerName, src, title, url, }: PreviewModalProps) => Promise<void>;
9
- export declare function previewFunction({ popupMountPointId, onClose: onEmbedClose, ...rest }: PreviewFunctionProps): Promise<void>;
10
- export {};
1
+ import { EmbedModalProps } from './types';
2
+ export declare function openEmbedModal({ onClose, ...props }?: Partial<EmbedModalProps>): Promise<void>;
@@ -1,5 +1,4 @@
1
1
  import { Icon } from '../../../../../../state/flexible-ui-context/types';
2
- import { EmbedModalProps } from '../../../../../../view/EmbedModal/types';
3
2
  import { ActionProps } from '../types';
4
3
  export type PreviewActionProps = ActionProps & FlexibleEmbedProps;
5
4
  export type FlexibleEmbedProps = {
@@ -11,6 +10,3 @@ export type FlexibleEmbedProps = {
11
10
  url: string;
12
11
  isSupportTheming?: boolean;
13
12
  };
14
- export interface PreviewFunctionProps extends EmbedModalProps {
15
- popupMountPointId: string;
16
- }
@@ -3,6 +3,8 @@ import { SerializedStyles } from '@emotion/react';
3
3
  import { Spacing } from '@atlaskit/button';
4
4
  import { SmartLinkSize } from '../../../constants';
5
5
  import { MessageProps } from './types';
6
+ import { AnalyticsFacade } from '../../../state/analytics';
7
+ import { PreviewActionData } from '../../../state/flexible-ui-context/types';
6
8
  export declare const sizeToButtonSpacing: Record<SmartLinkSize, Spacing>;
7
9
  export declare const getFormattedMessage: (message?: MessageProps) => JSX.Element | undefined;
8
10
  export declare const getIconSizeStyles: (width: string) => SerializedStyles;
@@ -13,3 +15,65 @@ export declare const getMaxLineHeight: (size: SmartLinkSize) => 1.5 | 1.75;
13
15
  export declare const getMaxLines: (value: number, defaultValue: number, max: number, min: number) => number;
14
16
  export declare const getTruncateStyles: (maxLines: number, lineHeight?: string, wordBreak?: 'break-word' | 'break-all') => SerializedStyles;
15
17
  export declare const hasWhiteSpace: (str: string) => boolean;
18
+ export declare const openEmbedModalWithFlexibleUiIcon: ({ analytics, downloadUrl, linkIcon, onClose, providerName, src, title, url, isSupportTheming, }: PreviewActionData & {
19
+ analytics?: {
20
+ ui: {
21
+ authEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiAuthEventProps) => void;
22
+ authAlternateAccountEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiAuthAlternateAccountEventProps) => void;
23
+ buttonClickedEvent: (data: Partial<import("../../..").AnalyticsPayload> & {
24
+ actionSubjectId: string;
25
+ }) => void;
26
+ cardClickedEvent: ({ id, display, status, definitionId, extensionKey, isModifierKeyPressed, location, destinationProduct, destinationSubproduct, actionSubjectId, }: import("../../../utils/analytics/types").UiCardClickedEventProps) => void;
27
+ iframeDwelledEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, dwellTime, dwellPercentVisible, }: import("../../../utils/analytics/types").UiIframeDwelledEventProps) => void;
28
+ iframeFocusedEvent: ({ id, display, status, definitionId, extensionKey, location, destinationProduct, destinationSubproduct, }: import("../../../utils/analytics/types").UiIframeFocusedEventProps) => void;
29
+ actionClickedEvent: ({ id, actionType, display, invokeType, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiActionClickedEventProps) => void;
30
+ hoverCardOpenLinkClickedEvent: ({ previewDisplay, definitionId, extensionKey, destinationProduct, destinationSubproduct, location, previewInvokeMethod, }: import("../../../utils/analytics/types").UiHoverCardOpenLinkClickedEventProps) => void;
31
+ closedAuthEvent: ({ display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiClosedAuthEventProps) => void;
32
+ modalClosedEvent: (data: Partial<import("../../..").AnalyticsPayload> & {
33
+ actionSubjectId: string;
34
+ }) => void;
35
+ renderSuccessEvent: ({ display, status, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiRenderSuccessEventProps) => void;
36
+ renderFailedEvent: ({ display, id, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiRenderFailedEventProps) => void;
37
+ hoverCardViewedEvent: ({ previewDisplay, previewInvokeMethod, id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../../utils/analytics/types").UiHoverCardViewedEventProps) => void;
38
+ hoverCardDismissedEvent: ({ id, previewDisplay, hoverTime, previewInvokeMethod, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, status, }: import("../../../utils/analytics/types").UiHoverCardDismissedEventProps) => void;
39
+ learnMoreClickedEvent: () => void;
40
+ smartLinkLozengeActionClickedEvent: () => void;
41
+ smartLinkLozengeActionListItemClickedEvent: () => void;
42
+ smartLinkLozengeActionErrorOpenPreviewClickedEvent: () => void;
43
+ };
44
+ operational: {
45
+ invokeSucceededEvent: ({ id, actionType, display, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeSucceededEventProps) => void;
46
+ invokeFailedEvent: ({ id, actionType, display, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").InvokeFailedEventProps) => void;
47
+ connectSucceededEvent: ({ id, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").ConnectSucceededEventProps) => void;
48
+ connectFailedEvent: ({ id, reason, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").ConnectFailedEventProps) => void;
49
+ instrument: ({ id, status, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, error, }: import("../../../utils/analytics/types").InstrumentEventProps) => void;
50
+ chunkloadFailedEvent: ({ display, error, errorInfo, extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").UiRenderFailedEventProps) => void;
51
+ };
52
+ track: {
53
+ appAccountConnected: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").CommonEventProps) => void;
54
+ appAccountAuthStarted: ({ extensionKey, location, }: import("../../../utils/analytics/types").CommonEventProps) => void;
55
+ linkUpdated: (props: import("../../../utils/analytics/types").CommonEventProps & {
56
+ [key: string]: any;
57
+ }) => void;
58
+ smartLinkQuickActionStarted: (props: {
59
+ smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../../utils/analytics/analytics").TrackQuickActionType;
60
+ }) => void;
61
+ smartLinkQuickActionSuccess: (props: {
62
+ smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../../utils/analytics/analytics").TrackQuickActionType;
63
+ }) => void;
64
+ smartLinkQuickActionFailed: (props: {
65
+ smartLinkActionType: import("@atlaskit/linking-types").SmartLinkActionType | import("../../../utils/analytics/analytics").TrackQuickActionType;
66
+ reason?: import("../../../utils/analytics/analytics").TrackQuickActionFailureReason | undefined;
67
+ step?: string | undefined;
68
+ }) => void;
69
+ hoverCardResolutionStarted: () => void;
70
+ };
71
+ screen: {
72
+ authPopupEvent: ({ extensionKey, definitionId, resourceType, destinationProduct, destinationSubproduct, location, }: import("../../../utils/analytics/types").CommonEventProps) => void;
73
+ modalViewedEvent: (data: Partial<import("../../..").AnalyticsPayload> & {
74
+ name: "embedPreviewModal";
75
+ }) => void;
76
+ };
77
+ } | undefined;
78
+ onClose?: (() => void) | undefined;
79
+ }) => Promise<void>;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.14.0",
3
+ "version": "26.14.2",
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": {