@atlaskit/smart-card 43.4.4 → 43.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (34) 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/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +5 -3
  5. package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +8 -4
  6. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +4 -0
  7. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +18 -2
  8. package/dist/cjs/view/LinkUrl/index.js +1 -1
  9. package/dist/cjs/view/common/ai-icon/index.js +2 -0
  10. package/dist/es2019/utils/analytics/analytics.js +1 -1
  11. package/dist/es2019/view/BlockCard/views/unresolved-view/index.js +7 -2
  12. package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +5 -3
  13. package/dist/es2019/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +8 -4
  14. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +4 -0
  15. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +17 -1
  16. package/dist/es2019/view/LinkUrl/index.js +1 -1
  17. package/dist/es2019/view/common/ai-icon/index.js +2 -0
  18. package/dist/esm/utils/analytics/analytics.js +1 -1
  19. package/dist/esm/view/BlockCard/views/unresolved-view/index.js +7 -2
  20. package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +5 -3
  21. package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +8 -4
  22. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.compiled.css +4 -0
  23. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +18 -2
  24. package/dist/esm/view/LinkUrl/index.js +1 -1
  25. package/dist/esm/view/common/ai-icon/index.js +2 -0
  26. package/dist/types/view/BlockCard/views/unresolved-view/index.d.ts +1 -1
  27. package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
  28. package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +2 -2
  29. package/dist/types/view/common/ai-icon/index.d.ts +2 -0
  30. package/dist/types-ts4.5/view/BlockCard/views/unresolved-view/index.d.ts +1 -1
  31. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
  32. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/types.d.ts +2 -2
  33. package/dist/types-ts4.5/view/common/ai-icon/index.d.ts +2 -0
  34. package/package.json +7 -4
package/CHANGELOG.md CHANGED
@@ -1,5 +1,20 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 43.5.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [`bcfeb40aa9347`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/bcfeb40aa9347) -
8
+ Remove custom custom AI icon fallback, behind fg navx-1959-remove-custom-ai-icon
9
+ - Updated dependencies
10
+
11
+ ## 43.5.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`9465562138b8e`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/9465562138b8e) -
16
+ [ux] Display competitor link prompt for unresolved Smart Link Card.
17
+
3
18
  ## 43.4.4
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.3"
14
+ packageVersion: "0.0.0-development"
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"])
@@ -11,6 +11,7 @@ var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/h
11
11
  var _react = _interopRequireWildcard(require("react"));
12
12
  var _reactIntlNext = require("react-intl-next");
13
13
  var _atlassianIntelligence = _interopRequireDefault(require("@atlaskit/icon/core/atlassian-intelligence"));
14
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
14
15
  var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
15
16
  var _messages = require("../../../../../messages");
16
17
  var _aiIcon = _interopRequireDefault(require("../../../../common/ai-icon"));
@@ -46,12 +47,13 @@ function AISummariseAction(_ref) {
46
47
  }, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
47
48
  return /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
48
49
  content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_summary_action),
49
- icon: /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, {
50
+ icon: /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, (0, _extends2.default)({
50
51
  spacing: "spacious",
51
52
  color: "currentColor",
52
- label: "Summarise with AI",
53
+ label: "Summarise with AI"
54
+ }, (0, _platformFeatureFlags.fg)('navx-1959-remove-custom-ai-icon') ? undefined : {
53
55
  LEGACY_fallbackIcon: _aiIcon.default
54
- }),
56
+ })),
55
57
  onClick: handleActionClick,
56
58
  testId: "".concat(testId, "-summarise-action"),
57
59
  isLoading: status === 'loading',
@@ -5,10 +5,12 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.AIFooterMetadata = void 0;
8
+ var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
8
9
  var _react = _interopRequireDefault(require("react"));
9
10
  var _reactIntlNext = require("react-intl-next");
10
11
  var _reactMagneticDi = require("react-magnetic-di");
11
12
  var _atlassianIntelligence = _interopRequireDefault(require("@atlaskit/icon/core/atlassian-intelligence"));
13
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
14
  var _compiled = require("@atlaskit/primitives/compiled");
13
15
  var _tooltip = _interopRequireDefault(require("@atlaskit/tooltip"));
14
16
  var _messages = require("../../../../../../messages");
@@ -37,10 +39,12 @@ var AIFooterMetadata = exports.AIFooterMetadata = function AIFooterMetadata(_ref
37
39
  LEGACY_size: "small",
38
40
  color: "var(--ds-icon-subtle, #626F86)"
39
41
  }));
40
- }), /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, {
41
- label: "AI",
42
- LEGACY_size: "small",
42
+ }), /*#__PURE__*/_react.default.createElement(_atlassianIntelligence.default, (0, _extends2.default)({
43
+ label: "AI"
44
+ }, (0, _platformFeatureFlags.fg)('navx-1959-remove-custom-ai-icon') ? undefined : {
43
45
  LEGACY_fallbackIcon: _aiIcon.default,
46
+ LEGACY_size: 'small'
47
+ }, {
44
48
  color: "var(--ds-icon-subtle, #626F86)"
45
- }));
49
+ })));
46
50
  };
@@ -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.3",
25
+ packageVersion: "0.0.0-development",
26
26
  componentName: 'linkUrl'
27
27
  };
28
28
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -11,6 +11,8 @@ var _svg = _interopRequireDefault(require("@atlaskit/icon/svg"));
11
11
  * The bulk of this file is originally from
12
12
  * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
13
13
  * with modifications
14
+ * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
15
+ * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
14
16
  */
15
17
  var AiIcon = function AiIcon(props) {
16
18
  return (
@@ -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.3"
5
+ packageVersion: "0.0.0-development"
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"])
@@ -2,6 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useCallback } from 'react';
3
3
  import { FormattedMessage } from 'react-intl-next';
4
4
  import AiIcon from '@atlaskit/icon/core/atlassian-intelligence';
5
+ import { fg } from '@atlaskit/platform-feature-flags';
5
6
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
6
7
  import { messages } from '../../../../../messages';
7
8
  import LegacyAiIcon from '../../../../common/ai-icon';
@@ -37,12 +38,13 @@ export function AISummariseAction({
37
38
  }, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
38
39
  return /*#__PURE__*/React.createElement(Action, _extends({
39
40
  content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
40
- icon: /*#__PURE__*/React.createElement(AiIcon, {
41
+ icon: /*#__PURE__*/React.createElement(AiIcon, _extends({
41
42
  spacing: "spacious",
42
43
  color: "currentColor",
43
- label: "Summarise with AI",
44
+ label: "Summarise with AI"
45
+ }, fg('navx-1959-remove-custom-ai-icon') ? undefined : {
44
46
  LEGACY_fallbackIcon: LegacyAiIcon
45
- }),
47
+ })),
46
48
  onClick: handleActionClick,
47
49
  testId: `${testId}-summarise-action`,
48
50
  isLoading: status === 'loading',
@@ -1,7 +1,9 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React from 'react';
2
3
  import { FormattedMessage } from 'react-intl-next';
3
4
  import { di } from 'react-magnetic-di';
4
5
  import AIIcon from '@atlaskit/icon/core/atlassian-intelligence';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
5
7
  import { Box, Inline } from '@atlaskit/primitives/compiled';
6
8
  import Tooltip from '@atlaskit/tooltip';
7
9
  import { messages } from '../../../../../../messages';
@@ -32,10 +34,12 @@ export const AIFooterMetadata = ({
32
34
  label: "Information",
33
35
  LEGACY_size: "small",
34
36
  color: "var(--ds-icon-subtle, #626F86)"
35
- }))), /*#__PURE__*/React.createElement(AIIcon, {
36
- label: "AI",
37
- LEGACY_size: "small",
37
+ }))), /*#__PURE__*/React.createElement(AIIcon, _extends({
38
+ label: "AI"
39
+ }, fg('navx-1959-remove-custom-ai-icon') ? undefined : {
38
40
  LEGACY_fallbackIcon: LegacyAIIcon,
41
+ LEGACY_size: 'small'
42
+ }, {
39
43
  color: "var(--ds-icon-subtle, #626F86)"
40
- }));
44
+ })));
41
45
  };
@@ -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.3",
15
+ packageVersion: "0.0.0-development",
16
16
  componentName: 'linkUrl'
17
17
  };
18
18
  const Anchor = withLinkClickedEvent('a');
@@ -4,6 +4,8 @@ import SVG from '@atlaskit/icon/svg';
4
4
  * The bulk of this file is originally from
5
5
  * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
6
  * with modifications
7
+ * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
8
+ * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
7
9
  */
8
10
  const AiIcon = props =>
9
11
  /*#__PURE__*/
@@ -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.3"
7
+ packageVersion: "0.0.0-development"
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"])
@@ -4,6 +4,7 @@ var _excluded = ["url", "onClick", "onError", "testId", "status", "summariseUrl"
4
4
  import React, { useCallback } from 'react';
5
5
  import { FormattedMessage } from 'react-intl-next';
6
6
  import AiIcon from '@atlaskit/icon/core/atlassian-intelligence';
7
+ import { fg } from '@atlaskit/platform-feature-flags';
7
8
  import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
8
9
  import { messages } from '../../../../../messages';
9
10
  import LegacyAiIcon from '../../../../common/ai-icon';
@@ -37,12 +38,13 @@ export function AISummariseAction(_ref) {
37
38
  }, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
38
39
  return /*#__PURE__*/React.createElement(Action, _extends({
39
40
  content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
40
- icon: /*#__PURE__*/React.createElement(AiIcon, {
41
+ icon: /*#__PURE__*/React.createElement(AiIcon, _extends({
41
42
  spacing: "spacious",
42
43
  color: "currentColor",
43
- label: "Summarise with AI",
44
+ label: "Summarise with AI"
45
+ }, fg('navx-1959-remove-custom-ai-icon') ? undefined : {
44
46
  LEGACY_fallbackIcon: LegacyAiIcon
45
- }),
47
+ })),
46
48
  onClick: handleActionClick,
47
49
  testId: "".concat(testId, "-summarise-action"),
48
50
  isLoading: status === 'loading',
@@ -1,7 +1,9 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
1
2
  import React from 'react';
2
3
  import { FormattedMessage } from 'react-intl-next';
3
4
  import { di } from 'react-magnetic-di';
4
5
  import AIIcon from '@atlaskit/icon/core/atlassian-intelligence';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
5
7
  import { Box, Inline } from '@atlaskit/primitives/compiled';
6
8
  import Tooltip from '@atlaskit/tooltip';
7
9
  import { messages } from '../../../../../../messages';
@@ -30,10 +32,12 @@ export var AIFooterMetadata = function AIFooterMetadata(_ref) {
30
32
  LEGACY_size: "small",
31
33
  color: "var(--ds-icon-subtle, #626F86)"
32
34
  }));
33
- }), /*#__PURE__*/React.createElement(AIIcon, {
34
- label: "AI",
35
- LEGACY_size: "small",
35
+ }), /*#__PURE__*/React.createElement(AIIcon, _extends({
36
+ label: "AI"
37
+ }, fg('navx-1959-remove-custom-ai-icon') ? undefined : {
36
38
  LEGACY_fallbackIcon: LegacyAIIcon,
39
+ LEGACY_size: 'small'
40
+ }, {
37
41
  color: "var(--ds-icon-subtle, #626F86)"
38
- }));
42
+ })));
39
43
  };
@@ -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.3",
18
+ packageVersion: "0.0.0-development",
19
19
  componentName: 'linkUrl'
20
20
  };
21
21
  var Anchor = withLinkClickedEvent('a');
@@ -4,6 +4,8 @@ import SVG from '@atlaskit/icon/svg';
4
4
  * The bulk of this file is originally from
5
5
  * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
6
  * with modifications
7
+ * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
8
+ * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
7
9
  */
8
10
  var AiIcon = function AiIcon(props) {
9
11
  return (
@@ -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;
@@ -4,6 +4,8 @@ import type { SVGProps } from '@atlaskit/icon/types';
4
4
  * The bulk of this file is originally from
5
5
  * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
6
  * with modifications
7
+ * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
8
+ * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
7
9
  */
8
10
  declare const AiIcon: (props: SVGProps) => React.JSX.Element;
9
11
  export default AiIcon;
@@ -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;
@@ -4,6 +4,8 @@ import type { SVGProps } from '@atlaskit/icon/types';
4
4
  * The bulk of this file is originally from
5
5
  * https://bitbucket.org/atlassian/barrel/src/master/ui/platform/ui-kit/ai
6
6
  * with modifications
7
+ * @deprecated Use @atlaskit/icon/core/atlassian-intelligence instead.
8
+ * TODO: Remove on navx-1959-remove-custom-ai-icon cleanup
7
9
  */
8
10
  declare const AiIcon: (props: SVGProps) => React.JSX.Element;
9
11
  export default AiIcon;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "43.4.4",
3
+ "version": "43.5.1",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -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",
@@ -70,7 +70,7 @@
70
70
  "@atlaskit/textarea": "^8.0.0",
71
71
  "@atlaskit/textfield": "^8.0.0",
72
72
  "@atlaskit/theme": "^21.0.0",
73
- "@atlaskit/tmp-editor-statsig": "^13.22.0",
73
+ "@atlaskit/tmp-editor-statsig": "^13.23.0",
74
74
  "@atlaskit/tokens": "^7.0.0",
75
75
  "@atlaskit/tooltip": "^20.7.0",
76
76
  "@atlaskit/ufo": "^0.4.0",
@@ -100,7 +100,7 @@
100
100
  "@atlaskit/analytics-listeners": "^9.1.0",
101
101
  "@atlaskit/css-reset": "^7.3.0",
102
102
  "@atlaskit/media-test-helpers": "^39.0.0",
103
- "@atlaskit/react-ufo": "^4.13.0",
103
+ "@atlaskit/react-ufo": "^4.14.0",
104
104
  "@atlaskit/ssr": "workspace:^",
105
105
  "@atlassian/analytics-tooling": "^0.5.0",
106
106
  "@atlassian/feature-flags-test-utils": "^1.0.0",
@@ -226,6 +226,9 @@
226
226
  "expose-product-details-from-smart-card": {
227
227
  "type": "boolean"
228
228
  },
229
+ "navx-1959-remove-custom-ai-icon": {
230
+ "type": "boolean"
231
+ },
229
232
  "navx-1910-fix-hovercard-performance-metrics": {
230
233
  "type": "boolean"
231
234
  },