@atlaskit/smart-card 43.4.3 → 43.5.0

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 (26) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/view/BlockCard/views/unresolved-view/index.js +7 -2
  4. package/dist/cjs/view/EmbedModal/components/link-info/index.js +3 -17
  5. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +4 -0
  6. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +18 -2
  7. package/dist/cjs/view/LinkUrl/index.js +1 -1
  8. package/dist/es2019/utils/analytics/analytics.js +1 -1
  9. package/dist/es2019/view/BlockCard/views/unresolved-view/index.js +7 -2
  10. package/dist/es2019/view/EmbedModal/components/link-info/index.js +3 -15
  11. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +4 -0
  12. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +17 -1
  13. package/dist/es2019/view/LinkUrl/index.js +1 -1
  14. package/dist/esm/utils/analytics/analytics.js +1 -1
  15. package/dist/esm/view/BlockCard/views/unresolved-view/index.js +7 -2
  16. package/dist/esm/view/EmbedModal/components/link-info/index.js +3 -17
  17. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +4 -0
  18. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +18 -2
  19. package/dist/esm/view/LinkUrl/index.js +1 -1
  20. package/dist/types/view/BlockCard/views/unresolved-view/index.d.ts +1 -1
  21. package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
  22. package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +2 -2
  23. package/dist/types-ts4.5/view/BlockCard/views/unresolved-view/index.d.ts +1 -1
  24. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
  25. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/types.d.ts +2 -2
  26. package/package.json +3 -6
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 43.5.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`9465562138b8e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9465562138b8e) -
8
+ [ux] Display competitor link prompt for unresolved Smart Link Card.
9
+
10
+ ## 43.4.4
11
+
12
+ ### Patch Changes
13
+
14
+ - [`6b95bfd7b3619`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/6b95bfd7b3619) -
15
+ NAVX-1995 cleaning up navx-1895-a11y-close-button-in-preview-modal
16
+ - Updated dependencies
17
+
3
18
  ## 43.4.3
4
19
 
5
20
  ### Patch Changes
@@ -11,7 +11,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
11
11
  var context = exports.context = {
12
12
  componentName: 'smart-cards',
13
13
  packageName: "@atlaskit/smart-card",
14
- packageVersion: "43.4.2"
14
+ packageVersion: "43.4.4"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -13,6 +13,7 @@ var React = _react;
13
13
  var _runtime = require("@compiled/react/runtime");
14
14
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
15
15
  var _userAgent = require("@atlaskit/linking-common/user-agent");
16
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
16
17
  var _FlexibleCard = _interopRequireDefault(require("../../../FlexibleCard"));
17
18
  var _blocks = require("../../../FlexibleCard/components/blocks");
18
19
  var _utils = require("../utils");
@@ -32,7 +33,8 @@ var UnresolvedView = function UnresolvedView(_ref) {
32
33
  showPreview = _ref$showPreview === void 0 ? false : _ref$showPreview,
33
34
  testId = _ref.testId,
34
35
  title = _ref.title,
35
- url = _ref.url;
36
+ url = _ref.url,
37
+ CompetitorPrompt = _ref.CompetitorPrompt;
36
38
  // eslint-disable-next-line react-hooks/rules-of-hooks
37
39
  var _useMemo = (0, _react.useMemo)(function () {
38
40
  return (0, _userAgent.browser)();
@@ -51,7 +53,10 @@ var UnresolvedView = function UnresolvedView(_ref) {
51
53
  url: url
52
54
  }, /*#__PURE__*/React.createElement(_blocks.TitleBlock, (0, _extends2.default)({}, _utils.titleBlockOptions, {
53
55
  hideIcon: !!title,
54
- text: title,
56
+ text: title
57
+ }, (0, _platformFeatureFlags.fg)('prompt_whiteboard_competitor_link_gate') ? {
58
+ CompetitorPrompt: CompetitorPrompt
59
+ } : undefined, {
55
60
  className: (0, _runtime.ax)(["_zulpu2gc _13mh1pd9 _2yhz14q2"])
56
61
  })), /*#__PURE__*/React.createElement(_blocks.CustomBlock, {
57
62
  className: (0, _runtime.ax)(["_zulp1b66 _1e0c1txw _4cvr1y6m _1wpz1fhb _7yjtidpf _ngc01fxt"])
@@ -14,13 +14,11 @@ var _reactIntlNext = require("react-intl-next");
14
14
  var _heading = _interopRequireDefault(require("@atlaskit/heading"));
15
15
  var _download = _interopRequireDefault(require("@atlaskit/icon/core/download"));
16
16
  var _fullscreenExit = _interopRequireDefault(require("@atlaskit/icon/core/fullscreen-exit"));
17
- var _cross = _interopRequireDefault(require("@atlaskit/icon/core/migration/cross"));
18
17
  var _fullscreenEnterVidFullScreenOn = _interopRequireDefault(require("@atlaskit/icon/core/migration/fullscreen-enter--vid-full-screen-on"));
19
18
  var _linkExternalShortcut = _interopRequireDefault(require("@atlaskit/icon/core/migration/link-external--shortcut"));
20
19
  var _download2 = _interopRequireDefault(require("@atlaskit/icon/glyph/download"));
21
20
  var _vidFullScreenOff = _interopRequireDefault(require("@atlaskit/icon/glyph/vid-full-screen-off"));
22
21
  var _modalDialog = require("@atlaskit/modal-dialog");
23
- var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
24
22
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
25
23
  var _messages = require("../../../../messages");
26
24
  var _Icon = require("../../../common/Icon");
@@ -131,7 +129,7 @@ var LinkInfo = function LinkInfo(_ref) {
131
129
  "aria-hidden": true
132
130
  })), /*#__PURE__*/_react.default.createElement("div", {
133
131
  className: (0, _runtime.ax)(["_16jlidpf _1o9zidpf _i0dl1wug _zulp1b66 _1e0c1txw _3kllglyw"])
134
- }, downloadButton, urlButton, sizeButton, (0, _platformFeatureFlags.fg)('navx-1895-a11y-close-button-in-preview-modal') ? /*#__PURE__*/_react.default.createElement(_tooltip.default, {
132
+ }, downloadButton, urlButton, sizeButton, /*#__PURE__*/_react.default.createElement(_tooltip.default, {
135
133
  content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.preview_close),
136
134
  hideTooltipOnClick: true,
137
135
  tag: "span",
@@ -139,19 +137,7 @@ var LinkInfo = function LinkInfo(_ref) {
139
137
  }, /*#__PURE__*/_react.default.createElement(_modalDialog.CloseButton, {
140
138
  onClick: onClose,
141
139
  label: formatMessage(_messages.messages.preview_close),
142
- testId: "".concat(testId, "-close-button")
143
- })) : /*#__PURE__*/_react.default.createElement(_linkInfoButton.default, {
144
- content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.preview_close),
145
- icon: function icon() {
146
- return /*#__PURE__*/_react.default.createElement(_cross.default, {
147
- label: _messages.messages.preview_close.defaultMessage,
148
- color: "currentColor",
149
- spacing: "spacious"
150
- });
151
- },
152
- label: _messages.messages.preview_close,
153
- onClick: onClose,
154
- testId: "".concat(testId, "-close")
155
- })));
140
+ testId: testId
141
+ }))));
156
142
  };
157
143
  var _default = exports.default = LinkInfo;
@@ -0,0 +1,4 @@
1
+ ._1bsb1osq{width:100%}
2
+ ._1e0c1txw{display:flex}
3
+ ._2lx2vrvc{flex-direction:row}
4
+ ._4cvr1h6o{align-items:center}
@@ -1,3 +1,4 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
1
2
  "use strict";
2
3
 
3
4
  var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
@@ -5,16 +6,24 @@ Object.defineProperty(exports, "__esModule", {
5
6
  value: true
6
7
  });
7
8
  exports.default = void 0;
9
+ require("./index.compiled.css");
10
+ var _runtime = require("@compiled/react/runtime");
8
11
  var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
12
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
13
  var _react = _interopRequireDefault(require("react"));
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
15
+ var _compiled = require("@atlaskit/primitives/compiled");
11
16
  var _constants = require("../../../../../../constants");
12
17
  var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
13
18
  var _actions = require("../../../actions");
14
19
  var _elements = require("../../../elements");
15
20
  var _block = _interopRequireDefault(require("../../block"));
16
21
  var _elementGroup = _interopRequireDefault(require("../../element-group"));
17
- var _excluded = ["actionGroup", "hideRetry", "retry", "position", "testId", "title", "icon", "hideIcon"];
22
+ var _excluded = ["actionGroup", "hideRetry", "retry", "position", "testId", "title", "icon", "hideIcon", "CompetitorPrompt"];
23
+ var styles = {
24
+ titleBoxCard: "_1e0c1txw _2lx2vrvc _4cvr1h6o _1bsb1osq"
25
+ };
26
+
18
27
  /**
19
28
  * Represents an Errored TitleBlock view.
20
29
  * This will render when a Smart Link did not successfully resolve.
@@ -32,15 +41,22 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
32
41
  title = _ref.title,
33
42
  icon = _ref.icon,
34
43
  hideIcon = _ref.hideIcon,
44
+ CompetitorPrompt = _ref.CompetitorPrompt,
35
45
  blockProps = (0, _objectWithoutProperties2.default)(_ref, _excluded);
36
46
  var context = (0, _flexibleUiContext.useFlexibleUiContext)();
37
47
  var showRetry = !hideRetry && Boolean(context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.InternalActionName.UnresolvedAction]);
48
+ var competitorPrompt = CompetitorPrompt && context !== null && context !== void 0 && context.url && (0, _platformFeatureFlags.fg)('prompt_whiteboard_competitor_link_gate') ? /*#__PURE__*/_react.default.createElement(CompetitorPrompt, {
49
+ sourceUrl: context === null || context === void 0 ? void 0 : context.url,
50
+ linkType: 'card'
51
+ }) : null;
38
52
  return /*#__PURE__*/_react.default.createElement(_block.default, (0, _extends2.default)({}, blockProps, {
39
53
  testId: "".concat(testId, "-errored-view")
40
54
  }), !hideIcon && /*#__PURE__*/_react.default.createElement(_elements.LinkIcon, {
41
55
  overrideIcon: icon,
42
56
  position: position
43
- }), title, showRetry && /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
57
+ }), competitorPrompt ? /*#__PURE__*/_react.default.createElement(_compiled.Box, {
58
+ xcss: styles.titleBoxCard
59
+ }, title, competitorPrompt) : title, showRetry && /*#__PURE__*/_react.default.createElement(_elementGroup.default, {
44
60
  align: _constants.SmartLinkAlignment.Right
45
61
  }, /*#__PURE__*/_react.default.createElement(_actions.UnresolvedAction, {
46
62
  testId: testId
@@ -22,7 +22,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
22
22
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
23
23
  var PACKAGE_DATA = {
24
24
  packageName: "@atlaskit/smart-card",
25
- packageVersion: "43.4.2",
25
+ packageVersion: "43.4.4",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -2,7 +2,7 @@ export const ANALYTICS_CHANNEL = 'media';
2
2
  export const context = {
3
3
  componentName: 'smart-cards',
4
4
  packageName: "@atlaskit/smart-card",
5
- packageVersion: "43.4.2"
5
+ packageVersion: "43.4.4"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { useMemo } from 'react';
7
7
  import { browser } from '@atlaskit/linking-common/user-agent';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import FlexibleCard from '../../../FlexibleCard';
9
10
  import { CustomBlock, InternalFooterBlock, PreviewBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
10
11
  import { FlexibleCardUiOptions, PreviewBlockOptions, titleBlockOptions } from '../utils';
@@ -22,7 +23,8 @@ const UnresolvedView = ({
22
23
  showPreview = false,
23
24
  testId,
24
25
  title,
25
- url
26
+ url,
27
+ CompetitorPrompt
26
28
  }) => {
27
29
  // eslint-disable-next-line react-hooks/rules-of-hooks
28
30
  const {
@@ -40,7 +42,10 @@ const UnresolvedView = ({
40
42
  url: url
41
43
  }, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
42
44
  hideIcon: !!title,
43
- text: title,
45
+ text: title
46
+ }, fg('prompt_whiteboard_competitor_link_gate') ? {
47
+ CompetitorPrompt
48
+ } : undefined, {
44
49
  className: ax(["_zulpu2gc _13mh1pd9 _2yhz14q2"])
45
50
  })), /*#__PURE__*/React.createElement(CustomBlock, {
46
51
  className: ax(["_zulp1b66 _1e0c1txw _4cvr1y6m _1wpz1fhb _7yjtidpf _ngc01fxt"])
@@ -6,13 +6,11 @@ import { FormattedMessage, useIntl } from 'react-intl-next';
6
6
  import Heading from '@atlaskit/heading';
7
7
  import DownloadIcon from '@atlaskit/icon/core/download';
8
8
  import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
9
- import CrossIcon from '@atlaskit/icon/core/migration/cross';
10
9
  import VidFullScreenOnIcon from '@atlaskit/icon/core/migration/fullscreen-enter--vid-full-screen-on';
11
10
  import ShortcutIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
12
11
  import DownloadIconLegacy from '@atlaskit/icon/glyph/download';
13
12
  import VidFullScreenOffIcon from '@atlaskit/icon/glyph/vid-full-screen-off';
14
13
  import { CloseButton, useModal } from '@atlaskit/modal-dialog';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
14
  import Tooltip from '@atlaskit/tooltip';
17
15
  import { messages } from '../../../../messages';
18
16
  import { Icon } from '../../../common/Icon';
@@ -119,7 +117,7 @@ const LinkInfo = ({
119
117
  "aria-hidden": true
120
118
  })), /*#__PURE__*/React.createElement("div", {
121
119
  className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _zulp1b66 _1e0c1txw _3kllglyw"])
122
- }, downloadButton, urlButton, sizeButton, fg('navx-1895-a11y-close-button-in-preview-modal') ? /*#__PURE__*/React.createElement(Tooltip, {
120
+ }, downloadButton, urlButton, sizeButton, /*#__PURE__*/React.createElement(Tooltip, {
123
121
  content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_close),
124
122
  hideTooltipOnClick: true,
125
123
  tag: "span",
@@ -127,17 +125,7 @@ const LinkInfo = ({
127
125
  }, /*#__PURE__*/React.createElement(CloseButton, {
128
126
  onClick: onClose,
129
127
  label: formatMessage(messages.preview_close),
130
- testId: `${testId}-close-button`
131
- })) : /*#__PURE__*/React.createElement(LinkInfoButton, {
132
- content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_close),
133
- icon: () => /*#__PURE__*/React.createElement(CrossIcon, {
134
- label: messages.preview_close.defaultMessage,
135
- color: "currentColor",
136
- spacing: "spacious"
137
- }),
138
- label: messages.preview_close,
139
- onClick: onClose,
140
- testId: `${testId}-close`
141
- })));
128
+ testId: testId
129
+ }))));
142
130
  };
143
131
  export default LinkInfo;
@@ -0,0 +1,4 @@
1
+ ._1bsb1osq{width:100%}
2
+ ._1e0c1txw{display:flex}
3
+ ._2lx2vrvc{flex-direction:row}
4
+ ._4cvr1h6o{align-items:center}
@@ -1,11 +1,20 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
3
+ import "./index.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
2
5
  import React from 'react';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
7
+ import { Box } from '@atlaskit/primitives/compiled';
3
8
  import { InternalActionName, SmartLinkAlignment } from '../../../../../../constants';
4
9
  import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
5
10
  import { UnresolvedAction } from '../../../actions';
6
11
  import { LinkIcon } from '../../../elements';
7
12
  import Block from '../../block';
8
13
  import ElementGroup from '../../element-group';
14
+ const styles = {
15
+ titleBoxCard: "_1e0c1txw _2lx2vrvc _4cvr1h6o _1bsb1osq"
16
+ };
17
+
9
18
  /**
10
19
  * Represents an Errored TitleBlock view.
11
20
  * This will render when a Smart Link did not successfully resolve.
@@ -22,17 +31,24 @@ const TitleBlockErroredView = ({
22
31
  title,
23
32
  icon,
24
33
  hideIcon,
34
+ CompetitorPrompt,
25
35
  ...blockProps
26
36
  }) => {
27
37
  var _context$actions;
28
38
  const context = useFlexibleUiContext();
29
39
  const showRetry = !hideRetry && Boolean(context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction]);
40
+ const competitorPrompt = CompetitorPrompt && context !== null && context !== void 0 && context.url && fg('prompt_whiteboard_competitor_link_gate') ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
41
+ sourceUrl: context === null || context === void 0 ? void 0 : context.url,
42
+ linkType: 'card'
43
+ }) : null;
30
44
  return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
31
45
  testId: `${testId}-errored-view`
32
46
  }), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
33
47
  overrideIcon: icon,
34
48
  position: position
35
- }), title, showRetry && /*#__PURE__*/React.createElement(ElementGroup, {
49
+ }), competitorPrompt ? /*#__PURE__*/React.createElement(Box, {
50
+ xcss: styles.titleBoxCard
51
+ }, title, competitorPrompt) : title, showRetry && /*#__PURE__*/React.createElement(ElementGroup, {
36
52
  align: SmartLinkAlignment.Right
37
53
  }, /*#__PURE__*/React.createElement(UnresolvedAction, {
38
54
  testId: testId
@@ -12,7 +12,7 @@ import LinkWarningModal from './LinkWarningModal';
12
12
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
13
13
  const PACKAGE_DATA = {
14
14
  packageName: "@atlaskit/smart-card",
15
- packageVersion: "43.4.2",
15
+ packageVersion: "43.4.4",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
4
4
  export var context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "43.4.2"
7
+ packageVersion: "43.4.4"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -5,6 +5,7 @@ import * as React from 'react';
5
5
  import { ax, ix } from "@compiled/react/runtime";
6
6
  import { useMemo } from 'react';
7
7
  import { browser } from '@atlaskit/linking-common/user-agent';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
8
9
  import FlexibleCard from '../../../FlexibleCard';
9
10
  import { CustomBlock, InternalFooterBlock, PreviewBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
10
11
  import { FlexibleCardUiOptions, PreviewBlockOptions, titleBlockOptions } from '../utils';
@@ -23,7 +24,8 @@ var UnresolvedView = function UnresolvedView(_ref) {
23
24
  showPreview = _ref$showPreview === void 0 ? false : _ref$showPreview,
24
25
  testId = _ref.testId,
25
26
  title = _ref.title,
26
- url = _ref.url;
27
+ url = _ref.url,
28
+ CompetitorPrompt = _ref.CompetitorPrompt;
27
29
  // eslint-disable-next-line react-hooks/rules-of-hooks
28
30
  var _useMemo = useMemo(function () {
29
31
  return browser();
@@ -42,7 +44,10 @@ var UnresolvedView = function UnresolvedView(_ref) {
42
44
  url: url
43
45
  }, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockOptions, {
44
46
  hideIcon: !!title,
45
- text: title,
47
+ text: title
48
+ }, fg('prompt_whiteboard_competitor_link_gate') ? {
49
+ CompetitorPrompt: CompetitorPrompt
50
+ } : undefined, {
46
51
  className: ax(["_zulpu2gc _13mh1pd9 _2yhz14q2"])
47
52
  })), /*#__PURE__*/React.createElement(CustomBlock, {
48
53
  className: ax(["_zulp1b66 _1e0c1txw _4cvr1y6m _1wpz1fhb _7yjtidpf _ngc01fxt"])
@@ -6,13 +6,11 @@ import { FormattedMessage, useIntl } from 'react-intl-next';
6
6
  import Heading from '@atlaskit/heading';
7
7
  import DownloadIcon from '@atlaskit/icon/core/download';
8
8
  import FullscreenExitIcon from '@atlaskit/icon/core/fullscreen-exit';
9
- import CrossIcon from '@atlaskit/icon/core/migration/cross';
10
9
  import VidFullScreenOnIcon from '@atlaskit/icon/core/migration/fullscreen-enter--vid-full-screen-on';
11
10
  import ShortcutIcon from '@atlaskit/icon/core/migration/link-external--shortcut';
12
11
  import DownloadIconLegacy from '@atlaskit/icon/glyph/download';
13
12
  import VidFullScreenOffIcon from '@atlaskit/icon/glyph/vid-full-screen-off';
14
13
  import { CloseButton, useModal } from '@atlaskit/modal-dialog';
15
- import { fg } from '@atlaskit/platform-feature-flags';
16
14
  import Tooltip from '@atlaskit/tooltip';
17
15
  import { messages } from '../../../../messages';
18
16
  import { Icon } from '../../../common/Icon';
@@ -122,7 +120,7 @@ var LinkInfo = function LinkInfo(_ref) {
122
120
  "aria-hidden": true
123
121
  })), /*#__PURE__*/React.createElement("div", {
124
122
  className: ax(["_16jlidpf _1o9zidpf _i0dl1wug _zulp1b66 _1e0c1txw _3kllglyw"])
125
- }, downloadButton, urlButton, sizeButton, fg('navx-1895-a11y-close-button-in-preview-modal') ? /*#__PURE__*/React.createElement(Tooltip, {
123
+ }, downloadButton, urlButton, sizeButton, /*#__PURE__*/React.createElement(Tooltip, {
126
124
  content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_close),
127
125
  hideTooltipOnClick: true,
128
126
  tag: "span",
@@ -130,19 +128,7 @@ var LinkInfo = function LinkInfo(_ref) {
130
128
  }, /*#__PURE__*/React.createElement(CloseButton, {
131
129
  onClick: onClose,
132
130
  label: formatMessage(messages.preview_close),
133
- testId: "".concat(testId, "-close-button")
134
- })) : /*#__PURE__*/React.createElement(LinkInfoButton, {
135
- content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_close),
136
- icon: function icon() {
137
- return /*#__PURE__*/React.createElement(CrossIcon, {
138
- label: messages.preview_close.defaultMessage,
139
- color: "currentColor",
140
- spacing: "spacious"
141
- });
142
- },
143
- label: messages.preview_close,
144
- onClick: onClose,
145
- testId: "".concat(testId, "-close")
146
- })));
131
+ testId: testId
132
+ }))));
147
133
  };
148
134
  export default LinkInfo;
@@ -0,0 +1,4 @@
1
+ ._1bsb1osq{width:100%}
2
+ ._1e0c1txw{display:flex}
3
+ ._2lx2vrvc{flex-direction:row}
4
+ ._4cvr1h6o{align-items:center}
@@ -1,13 +1,22 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.38.1 */
1
2
  import _extends from "@babel/runtime/helpers/extends";
2
3
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["actionGroup", "hideRetry", "retry", "position", "testId", "title", "icon", "hideIcon"];
4
+ var _excluded = ["actionGroup", "hideRetry", "retry", "position", "testId", "title", "icon", "hideIcon", "CompetitorPrompt"];
5
+ import "./index.compiled.css";
6
+ import { ax, ix } from "@compiled/react/runtime";
4
7
  import React from 'react';
8
+ import { fg } from '@atlaskit/platform-feature-flags';
9
+ import { Box } from '@atlaskit/primitives/compiled';
5
10
  import { InternalActionName, SmartLinkAlignment } from '../../../../../../constants';
6
11
  import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
7
12
  import { UnresolvedAction } from '../../../actions';
8
13
  import { LinkIcon } from '../../../elements';
9
14
  import Block from '../../block';
10
15
  import ElementGroup from '../../element-group';
16
+ var styles = {
17
+ titleBoxCard: "_1e0c1txw _2lx2vrvc _4cvr1h6o _1bsb1osq"
18
+ };
19
+
11
20
  /**
12
21
  * Represents an Errored TitleBlock view.
13
22
  * This will render when a Smart Link did not successfully resolve.
@@ -25,15 +34,22 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
25
34
  title = _ref.title,
26
35
  icon = _ref.icon,
27
36
  hideIcon = _ref.hideIcon,
37
+ CompetitorPrompt = _ref.CompetitorPrompt,
28
38
  blockProps = _objectWithoutProperties(_ref, _excluded);
29
39
  var context = useFlexibleUiContext();
30
40
  var showRetry = !hideRetry && Boolean(context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction]);
41
+ var competitorPrompt = CompetitorPrompt && context !== null && context !== void 0 && context.url && fg('prompt_whiteboard_competitor_link_gate') ? /*#__PURE__*/React.createElement(CompetitorPrompt, {
42
+ sourceUrl: context === null || context === void 0 ? void 0 : context.url,
43
+ linkType: 'card'
44
+ }) : null;
31
45
  return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
32
46
  testId: "".concat(testId, "-errored-view")
33
47
  }), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
34
48
  overrideIcon: icon,
35
49
  position: position
36
- }), title, showRetry && /*#__PURE__*/React.createElement(ElementGroup, {
50
+ }), competitorPrompt ? /*#__PURE__*/React.createElement(Box, {
51
+ xcss: styles.titleBoxCard
52
+ }, title, competitorPrompt) : title, showRetry && /*#__PURE__*/React.createElement(ElementGroup, {
37
53
  align: SmartLinkAlignment.Right
38
54
  }, /*#__PURE__*/React.createElement(UnresolvedAction, {
39
55
  testId: testId
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
15
15
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
16
16
  var PACKAGE_DATA = {
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "43.4.2",
18
+ packageVersion: "43.4.4",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
@@ -3,5 +3,5 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type UnresolvedViewProps } from './types';
6
- declare const UnresolvedView: ({ actions, cardState, children, onAuthorize, onClick, onError, showPreview, testId, title, url, }: UnresolvedViewProps) => JSX.Element;
6
+ declare const UnresolvedView: ({ actions, cardState, children, onAuthorize, onClick, onError, showPreview, testId, title, url, CompetitorPrompt, }: UnresolvedViewProps) => JSX.Element;
7
7
  export default UnresolvedView;
@@ -7,5 +7,5 @@ import { type TitleBlockViewProps } from '../types';
7
7
  * or the backend response was errored or malformed.
8
8
  * @see TitleBlock
9
9
  */
10
- declare const TitleBlockErroredView: ({ actionGroup, hideRetry, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
10
+ declare const TitleBlockErroredView: ({ actionGroup, hideRetry, retry, position, testId, title, icon, hideIcon, CompetitorPrompt, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
11
11
  export default TitleBlockErroredView;
@@ -21,7 +21,7 @@ export type TitleBlockProps = {
21
21
  */
22
22
  anchorTarget?: AnchorTarget;
23
23
  /**
24
- * Competitor Prompt Component for Competitor link experiment
24
+ * Competitor Prompt Component for Competitor link
25
25
  */
26
26
  CompetitorPrompt?: React.ComponentType<{
27
27
  linkType?: string;
@@ -105,7 +105,7 @@ export type TitleBlockProps = {
105
105
  */
106
106
  text?: string;
107
107
  /**
108
- * The URL of the link for Competitor Prompt experiment
108
+ * The URL of the link for Competitor Prompt
109
109
  */
110
110
  url?: string;
111
111
  } & BlockProps;
@@ -3,5 +3,5 @@
3
3
  * @jsx jsx
4
4
  */
5
5
  import { type UnresolvedViewProps } from './types';
6
- declare const UnresolvedView: ({ actions, cardState, children, onAuthorize, onClick, onError, showPreview, testId, title, url, }: UnresolvedViewProps) => JSX.Element;
6
+ declare const UnresolvedView: ({ actions, cardState, children, onAuthorize, onClick, onError, showPreview, testId, title, url, CompetitorPrompt, }: UnresolvedViewProps) => JSX.Element;
7
7
  export default UnresolvedView;
@@ -7,5 +7,5 @@ import { type TitleBlockViewProps } from '../types';
7
7
  * or the backend response was errored or malformed.
8
8
  * @see TitleBlock
9
9
  */
10
- declare const TitleBlockErroredView: ({ actionGroup, hideRetry, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
10
+ declare const TitleBlockErroredView: ({ actionGroup, hideRetry, retry, position, testId, title, icon, hideIcon, CompetitorPrompt, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
11
11
  export default TitleBlockErroredView;
@@ -21,7 +21,7 @@ export type TitleBlockProps = {
21
21
  */
22
22
  anchorTarget?: AnchorTarget;
23
23
  /**
24
- * Competitor Prompt Component for Competitor link experiment
24
+ * Competitor Prompt Component for Competitor link
25
25
  */
26
26
  CompetitorPrompt?: React.ComponentType<{
27
27
  linkType?: string;
@@ -105,7 +105,7 @@ export type TitleBlockProps = {
105
105
  */
106
106
  text?: string;
107
107
  /**
108
- * The URL of the link for Competitor Prompt experiment
108
+ * The URL of the link for Competitor Prompt
109
109
  */
110
110
  url?: string;
111
111
  } & BlockProps;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "43.4.3",
3
+ "version": "43.5.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -43,7 +43,7 @@
43
43
  "@atlaskit/heading": "^5.2.0",
44
44
  "@atlaskit/icon": "^28.5.0",
45
45
  "@atlaskit/icon-file-type": "^7.0.0",
46
- "@atlaskit/icon-lab": "^5.10.0",
46
+ "@atlaskit/icon-lab": "^5.11.0",
47
47
  "@atlaskit/icon-object": "^7.3.0",
48
48
  "@atlaskit/icon-priority": "^6.3.0",
49
49
  "@atlaskit/image": "^3.0.0",
@@ -62,7 +62,7 @@
62
62
  "@atlaskit/modal-dialog": "^14.6.0",
63
63
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
64
64
  "@atlaskit/platform-feature-flags": "^1.1.0",
65
- "@atlaskit/popup": "^4.5.0",
65
+ "@atlaskit/popup": "^4.6.0",
66
66
  "@atlaskit/primitives": "^16.1.0",
67
67
  "@atlaskit/section-message": "^8.8.0",
68
68
  "@atlaskit/select": "^21.3.0",
@@ -214,9 +214,6 @@
214
214
  "hover-card-on-visibility-change-callback": {
215
215
  "type": "boolean"
216
216
  },
217
- "navx-1895-a11y-close-button-in-preview-modal": {
218
- "type": "boolean"
219
- },
220
217
  "navx-1895-new-logo-design": {
221
218
  "type": "boolean"
222
219
  },