@atlaskit/smart-card 38.10.1 → 38.11.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 (38) hide show
  1. package/CHANGELOG.md +21 -0
  2. package/dist/cjs/extractors/action/extract-invoke-copy-link-action.js +2 -1
  3. package/dist/cjs/extractors/action/extract-invoke-download-action.js +3 -1
  4. package/dist/cjs/extractors/action/extract-invoke-preview-action.js +6 -5
  5. package/dist/cjs/extractors/common/primitives/extractSummary.js +16 -1
  6. package/dist/cjs/extractors/flexible/actions/extract-view-related-links-action.js +2 -1
  7. package/dist/cjs/extractors/flexible/index.js +3 -3
  8. package/dist/cjs/utils/analytics/analytics.js +1 -1
  9. package/dist/cjs/utils/mocks.js +1 -0
  10. package/dist/cjs/view/FlexibleCard/external.js +5 -5
  11. package/dist/cjs/view/LinkUrl/index.js +1 -1
  12. package/dist/es2019/extractors/action/extract-invoke-copy-link-action.js +3 -2
  13. package/dist/es2019/extractors/action/extract-invoke-download-action.js +3 -1
  14. package/dist/es2019/extractors/action/extract-invoke-preview-action.js +7 -6
  15. package/dist/es2019/extractors/common/primitives/extractSummary.js +16 -0
  16. package/dist/es2019/extractors/flexible/actions/extract-view-related-links-action.js +3 -2
  17. package/dist/es2019/extractors/flexible/index.js +4 -4
  18. package/dist/es2019/utils/analytics/analytics.js +1 -1
  19. package/dist/es2019/utils/mocks.js +1 -0
  20. package/dist/es2019/view/FlexibleCard/external.js +6 -5
  21. package/dist/es2019/view/LinkUrl/index.js +1 -1
  22. package/dist/esm/extractors/action/extract-invoke-copy-link-action.js +3 -2
  23. package/dist/esm/extractors/action/extract-invoke-download-action.js +3 -1
  24. package/dist/esm/extractors/action/extract-invoke-preview-action.js +7 -6
  25. package/dist/esm/extractors/common/primitives/extractSummary.js +16 -0
  26. package/dist/esm/extractors/flexible/actions/extract-view-related-links-action.js +3 -2
  27. package/dist/esm/extractors/flexible/index.js +4 -4
  28. package/dist/esm/utils/analytics/analytics.js +1 -1
  29. package/dist/esm/utils/mocks.js +1 -0
  30. package/dist/esm/view/FlexibleCard/external.js +6 -5
  31. package/dist/esm/view/LinkUrl/index.js +1 -1
  32. package/dist/types/__fixtures__/document-entity.d.ts +3 -0
  33. package/dist/types/extractors/common/primitives/extractSummary.d.ts +5 -0
  34. package/dist/types/view/FlexibleCard/external.d.ts +20 -19
  35. package/dist/types-ts4.5/__fixtures__/document-entity.d.ts +3 -0
  36. package/dist/types-ts4.5/extractors/common/primitives/extractSummary.d.ts +5 -0
  37. package/dist/types-ts4.5/view/FlexibleCard/external.d.ts +20 -19
  38. package/package.json +8 -8
package/CHANGELOG.md CHANGED
@@ -1,5 +1,26 @@
1
1
  # @atlaskit/smart-card
2
2
 
3
+ ## 38.11.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#172309](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172309)
8
+ [`2277073f3598c`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/2277073f3598c) -
9
+ EDM-12975 use entity data to render google document links
10
+
11
+ ### Patch Changes
12
+
13
+ - Updated dependencies
14
+
15
+ ## 38.10.2
16
+
17
+ ### Patch Changes
18
+
19
+ - [#172989](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/pull-requests/172989)
20
+ [`41bb7602f58e3`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/41bb7602f58e3) -
21
+ Refactor and clean up types for external elements
22
+ - Updated dependencies
23
+
3
24
  ## 38.10.1
4
25
 
5
26
  ### Patch Changes
@@ -8,6 +8,7 @@ exports.extractInvokeCopyLinkAction = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _linkExtractors = require("@atlaskit/link-extractors");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _index = require("../../index");
12
13
  var _helpers = require("../../state/helpers");
13
14
  var _canShowAction = require("../../utils/actions/can-show-action");
@@ -20,7 +21,7 @@ var extractInvokeCopyLinkAction = exports.extractInvokeCopyLinkAction = function
20
21
  return;
21
22
  }
22
23
  var data = response.data;
23
- var url = (0, _linkExtractors.extractLink)(data);
24
+ var url = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkUrl)(response) : (0, _linkExtractors.extractLink)(data);
24
25
  if (!url) {
25
26
  return;
26
27
  }
@@ -7,6 +7,8 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.extractInvokeDownloadAction = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
+ var _linkExtractors = require("@atlaskit/link-extractors");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
10
12
  var _index = require("../../index");
11
13
  var _helpers = require("../../state/helpers");
12
14
  var _utils = require("../../utils");
@@ -26,7 +28,7 @@ var extractInvokeDownloadAction = exports.extractInvokeDownloadAction = function
26
28
  return action['@type'] === 'DownloadAction';
27
29
  });
28
30
  if (downloadActionExists) {
29
- var downloadUrl = (0, _extractDownloadUrl.extractDownloadUrl)(data);
31
+ var downloadUrl = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkDownloadUrl)(response) : (0, _extractDownloadUrl.extractDownloadUrl)(data);
30
32
  return {
31
33
  actionFn: function () {
32
34
  var _actionFn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
@@ -8,6 +8,7 @@ exports.extractInvokePreviewAction = void 0;
8
8
  var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
9
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
10
10
  var _linkExtractors = require("@atlaskit/link-extractors");
11
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
11
12
  var _index = require("../../index");
12
13
  var _helpers = require("../../state/helpers");
13
14
  var _canShowAction = require("../../utils/actions/can-show-action");
@@ -38,7 +39,7 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
38
39
  return {
39
40
  actionFn: function () {
40
41
  var _actionFn = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
41
- var _extractProvider;
42
+ var _extractSmartLinkProv, _extractProvider, _extractSmartLinkEmbe;
42
43
  return _regenerator.default.wrap(function _callee$(_context) {
43
44
  while (1) switch (_context.prev = _context.next) {
44
45
  case 0:
@@ -51,12 +52,12 @@ var extractInvokePreviewAction = exports.extractInvokePreviewAction = function e
51
52
  isSupportTheming: (0, _extractIsSupportTheming.extractIsSupportTheming)(meta),
52
53
  isTrusted: (0, _extractIsTrusted.extractIsTrusted)(meta),
53
54
  linkIcon: (0, _icon.extractLinkIcon)(response),
54
- providerName: (_extractProvider = (0, _linkExtractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
55
+ providerName: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (_extractSmartLinkProv = (0, _linkExtractors.extractSmartLinkProvider)(response)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text : (_extractProvider = (0, _linkExtractors.extractProvider)(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
55
56
  onClose: onClose,
56
57
  origin: origin,
57
- src: src,
58
- title: (0, _linkExtractors.extractTitle)(data),
59
- url: url
58
+ src: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (_extractSmartLinkEmbe = (0, _linkExtractors.extractSmartLinkEmbed)(response)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : src,
59
+ title: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkTitle)(response) : (0, _linkExtractors.extractTitle)(data),
60
+ url: (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkUrl)(response) : url
60
61
  }));
61
62
  case 1:
62
63
  case "end":
@@ -3,7 +3,9 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.extractSummary = void 0;
6
+ exports.extractSummary = exports.extractSmartLinkSummary = void 0;
7
+ var _linkExtractors = require("@atlaskit/link-extractors");
8
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
7
9
  /**
8
10
  * Return link summary
9
11
  */
@@ -12,4 +14,17 @@ var extractSummary = exports.extractSummary = function extractSummary(jsonLd) {
12
14
  var summary = jsonLd.summary.trim();
13
15
  return Boolean(summary) ? summary : undefined;
14
16
  }
17
+ };
18
+
19
+ /**
20
+ * Return link summary
21
+ */
22
+ var extractSmartLinkSummary = exports.extractSmartLinkSummary = function extractSmartLinkSummary(response) {
23
+ if ((0, _platformFeatureFlags.fg)('smart_links_noun_support')) {
24
+ if ((0, _linkExtractors.isEntityPresent)(response)) {
25
+ var _extractEntity;
26
+ return (_extractEntity = (0, _linkExtractors.extractEntity)(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
27
+ }
28
+ }
29
+ return (response === null || response === void 0 ? void 0 : response.data) && extractSummary(response.data);
15
30
  };
@@ -5,12 +5,13 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.extractViewRelatedLinksAction = void 0;
7
7
  var _linkExtractors = require("@atlaskit/link-extractors");
8
+ var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
8
9
  var extractViewRelatedLinksAction = exports.extractViewRelatedLinksAction = function extractViewRelatedLinksAction(response) {
9
10
  var _response$meta;
10
11
  if (!(response !== null && response !== void 0 && (_response$meta = response.meta) !== null && _response$meta !== void 0 && (_response$meta = _response$meta.supportedFeature) !== null && _response$meta !== void 0 && _response$meta.includes('RelatedLinks'))) {
11
12
  return;
12
13
  }
13
- var ari = (0, _linkExtractors.extractAri)(response.data);
14
+ var ari = (0, _platformFeatureFlags.fg)('smart_links_noun_support') ? (0, _linkExtractors.extractSmartLinkAri)(response) : (0, _linkExtractors.extractAri)(response.data);
14
15
  if (!ari) {
15
16
  return;
16
17
  }
@@ -9,7 +9,7 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
9
9
  var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
10
10
  var _linkExtractors = require("@atlaskit/link-extractors");
11
11
  var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
12
- var _primitives = require("../common/primitives");
12
+ var _extractSummary = require("../common/primitives/extractSummary");
13
13
  var _actions = require("./actions");
14
14
  var _collaboratorGroup = require("./collaboratorGroup");
15
15
  var _extractLinkTitle = _interopRequireDefault(require("./extract-link-title"));
@@ -57,7 +57,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
57
57
  appliedToComponentsCount: (0, _utils.extractAppliedToComponentsCount)(data),
58
58
  assignedToGroup: (0, _utils.extractPersonAssignedToAsArray)(data),
59
59
  attachmentCount: (0, _utils.extractAttachmentCount)(data),
60
- authorGroup: (0, _linkExtractors.extractPersonCreatedBy)(data),
60
+ authorGroup: (0, _linkExtractors.extractSmartLinkAuthorGroup)(response),
61
61
  ownedByGroup: (0, _linkExtractors.extractPersonOwnedBy)(data),
62
62
  collaboratorGroup: (0, _collaboratorGroup.extractPersonsUpdatedBy)(data),
63
63
  commentCount: (0, _utils.extractCommentCount)(data),
@@ -84,7 +84,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
84
84
  programmingLanguage: (0, _utils.extractProgrammingLanguage)(data),
85
85
  readTime: (0, _utils.extractReadTime)(data),
86
86
  sentOn: (0, _utils.extractSentOn)(data),
87
- snippet: (0, _primitives.extractSummary)(data) || undefined,
87
+ snippet: (0, _extractSummary.extractSmartLinkSummary)(response) || undefined,
88
88
  // Explicitly set here to remove an empty string
89
89
  sourceBranch: (0, _utils.extractSourceBranch)(data),
90
90
  state: (0, _extractState.default)(response, actionOptions, id, appearance, origin, fireEvent, resolve),
@@ -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: "38.10.1"
14
+ packageVersion: "38.10.2"
15
15
  };
16
16
  var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
17
17
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -104,6 +104,7 @@ var entityDataResponse = {
104
104
  entityData: {
105
105
  id: 'I love cheese',
106
106
  displayName: 'I love cheese',
107
+ description: 'Here is your serving of cheese: 🧀',
107
108
  url: 'https://some.url',
108
109
  lastUpdatedAt: '2025-01-08T22:26:52.501Z',
109
110
  thumbnail: {
@@ -20,7 +20,7 @@ var _elements = require("./components/elements");
20
20
  * DO NOT add a new prop to these components until we are ready to support it externally.
21
21
  */
22
22
 
23
- // ---- EXPORTED METADATA COMPONENT ---- //
23
+ // ---- EXPORTED METADATA COMPONENTS ---- //
24
24
  var AssignedToElement = exports.AssignedToElement = function AssignedToElement() {
25
25
  return /*#__PURE__*/_react.default.createElement(_elements.AssignedTo, null);
26
26
  };
@@ -128,8 +128,8 @@ var SentOnElement = exports.SentOnElement = function SentOnElement() {
128
128
  };
129
129
  var SnippetElement = exports.SnippetElement = function SnippetElement(props) {
130
130
  return /*#__PURE__*/_react.default.createElement(_elements.Snippet, {
131
- maxLines: props.maxLines,
132
- content: props.text
131
+ maxLines: props === null || props === void 0 ? void 0 : props.maxLines,
132
+ content: props === null || props === void 0 ? void 0 : props.text
133
133
  });
134
134
  };
135
135
  var SourceBranchElement = exports.SourceBranchElement = function SourceBranchElement() {
@@ -180,8 +180,8 @@ var CopyLinkAction = exports.CopyLinkAction = function CopyLinkAction(props) {
180
180
  };
181
181
  var CustomAction = exports.CustomAction = function CustomAction(props) {
182
182
  return /*#__PURE__*/_react.default.createElement(_actions.CustomAction, (0, _extends2.default)({}, toActionProps(props), {
183
- content: props === null || props === void 0 ? void 0 : props.children,
184
- onClick: props === null || props === void 0 ? void 0 : props.onClick
183
+ content: props.children,
184
+ onClick: props.onClick
185
185
  }));
186
186
  };
187
187
  var DownloadAction = exports.DownloadAction = function DownloadAction(props) {
@@ -20,7 +20,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId", "isLink
20
20
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
21
21
  var PACKAGE_DATA = {
22
22
  packageName: "@atlaskit/smart-card",
23
- packageVersion: "38.10.1",
23
+ packageVersion: "38.10.2",
24
24
  componentName: 'linkUrl'
25
25
  };
26
26
  var Anchor = (0, _click.withLinkClickedEvent)('a');
@@ -1,4 +1,5 @@
1
- import { extractLink } from '@atlaskit/link-extractors';
1
+ import { extractLink, extractSmartLinkUrl } from '@atlaskit/link-extractors';
2
+ import { fg } from "@atlaskit/platform-feature-flags";
2
3
  import { ActionName, CardAction } from '../../index';
3
4
  import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
4
5
  import { canShowAction } from '../../utils/actions/can-show-action';
@@ -12,7 +13,7 @@ export const extractInvokeCopyLinkAction = ({
12
13
  return;
13
14
  }
14
15
  const data = response.data;
15
- const url = extractLink(data);
16
+ const url = fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : extractLink(data);
16
17
  if (!url) {
17
18
  return;
18
19
  }
@@ -1,3 +1,5 @@
1
+ import { extractSmartLinkDownloadUrl } from "@atlaskit/link-extractors";
2
+ import { fg } from "@atlaskit/platform-feature-flags";
1
3
  import { ActionName, CardAction } from '../../index';
2
4
  import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
3
5
  import { downloadUrl as download } from '../../utils';
@@ -16,7 +18,7 @@ export const extractInvokeDownloadAction = ({
16
18
  const data = response.data;
17
19
  const downloadActionExists = getActionsFromJsonLd(data).find(action => action['@type'] === 'DownloadAction');
18
20
  if (downloadActionExists) {
19
- const downloadUrl = extractDownloadUrl(data);
21
+ const downloadUrl = fg('smart_links_noun_support') ? extractSmartLinkDownloadUrl(response) : extractDownloadUrl(data);
20
22
  return {
21
23
  actionFn: async () => download(downloadUrl),
22
24
  actionSubjectId: 'downloadDocument',
@@ -1,4 +1,5 @@
1
- import { extractLink, extractPreview as extractPreviewData, extractProvider, extractTitle } from '@atlaskit/link-extractors';
1
+ import { extractLink, extractPreview as extractPreviewData, extractProvider, extractSmartLinkEmbed, extractSmartLinkProvider, extractSmartLinkTitle, extractSmartLinkUrl, extractTitle } from '@atlaskit/link-extractors';
2
+ import { fg } from "@atlaskit/platform-feature-flags";
2
3
  import { ActionName, CardAction } from '../../index';
3
4
  import { getExtensionKey } from '../../state/helpers';
4
5
  import { canShowAction } from '../../utils/actions/can-show-action';
@@ -30,7 +31,7 @@ export const extractInvokePreviewAction = param => {
30
31
  const extensionKey = getExtensionKey(response);
31
32
  return {
32
33
  actionFn: async () => {
33
- var _extractProvider;
34
+ var _extractSmartLinkProv, _extractProvider, _extractSmartLinkEmbe;
34
35
  return openEmbedModal({
35
36
  fireEvent,
36
37
  extensionKey,
@@ -40,12 +41,12 @@ export const extractInvokePreviewAction = param => {
40
41
  isSupportTheming: extractIsSupportTheming(meta),
41
42
  isTrusted: extractIsTrusted(meta),
42
43
  linkIcon: extractLinkIcon(response),
43
- providerName: (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
44
+ providerName: fg('smart_links_noun_support') ? (_extractSmartLinkProv = extractSmartLinkProvider(response)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text : (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
44
45
  onClose,
45
46
  origin,
46
- src,
47
- title: extractTitle(data),
48
- url
47
+ src: fg('smart_links_noun_support') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(response)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : src,
48
+ title: fg('smart_links_noun_support') ? extractSmartLinkTitle(response) : extractTitle(data),
49
+ url: fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : url
49
50
  });
50
51
  },
51
52
  actionSubjectId: 'invokePreviewScreen',
@@ -1,3 +1,6 @@
1
+ import { extractEntity, isEntityPresent } from "@atlaskit/link-extractors";
2
+ import { fg } from "@atlaskit/platform-feature-flags";
3
+
1
4
  /**
2
5
  * Return link summary
3
6
  */
@@ -6,4 +9,17 @@ export const extractSummary = jsonLd => {
6
9
  const summary = jsonLd.summary.trim();
7
10
  return Boolean(summary) ? summary : undefined;
8
11
  }
12
+ };
13
+
14
+ /**
15
+ * Return link summary
16
+ */
17
+ export const extractSmartLinkSummary = response => {
18
+ if (fg('smart_links_noun_support')) {
19
+ if (isEntityPresent(response)) {
20
+ var _extractEntity;
21
+ return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
22
+ }
23
+ }
24
+ return (response === null || response === void 0 ? void 0 : response.data) && extractSummary(response.data);
9
25
  };
@@ -1,10 +1,11 @@
1
- import { extractAri } from '@atlaskit/link-extractors';
1
+ import { extractAri, extractSmartLinkAri } from '@atlaskit/link-extractors';
2
+ import { fg } from "@atlaskit/platform-feature-flags";
2
3
  export const extractViewRelatedLinksAction = response => {
3
4
  var _response$meta, _response$meta$suppor;
4
5
  if (!(response !== null && response !== void 0 && (_response$meta = response.meta) !== null && _response$meta !== void 0 && (_response$meta$suppor = _response$meta.supportedFeature) !== null && _response$meta$suppor !== void 0 && _response$meta$suppor.includes('RelatedLinks'))) {
5
6
  return;
6
7
  }
7
- const ari = extractAri(response.data);
8
+ const ari = fg('smart_links_noun_support') ? extractSmartLinkAri(response) : extractAri(response.data);
8
9
  if (!ari) {
9
10
  return;
10
11
  }
@@ -1,6 +1,6 @@
1
- import { extractPersonCreatedBy, extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn, extractSmartLinkTitle, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
1
+ import { extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkAuthorGroup, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn, extractSmartLinkTitle, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
- import { extractSummary } from '../common/primitives';
3
+ import { extractSmartLinkSummary } from "../common/primitives/extractSummary";
4
4
  import { extractFlexibleCardActions } from './actions';
5
5
  import { extractPersonsUpdatedBy } from './collaboratorGroup';
6
6
  import extractLinkTitle from './extract-link-title';
@@ -45,7 +45,7 @@ const extractFlexibleUiContext = ({
45
45
  appliedToComponentsCount: extractAppliedToComponentsCount(data),
46
46
  assignedToGroup: extractPersonAssignedToAsArray(data),
47
47
  attachmentCount: extractAttachmentCount(data),
48
- authorGroup: extractPersonCreatedBy(data),
48
+ authorGroup: extractSmartLinkAuthorGroup(response),
49
49
  ownedByGroup: extractPersonOwnedBy(data),
50
50
  collaboratorGroup: extractPersonsUpdatedBy(data),
51
51
  commentCount: extractCommentCount(data),
@@ -72,7 +72,7 @@ const extractFlexibleUiContext = ({
72
72
  programmingLanguage: extractProgrammingLanguage(data),
73
73
  readTime: extractReadTime(data),
74
74
  sentOn: extractSentOn(data),
75
- snippet: extractSummary(data) || undefined,
75
+ snippet: extractSmartLinkSummary(response) || undefined,
76
76
  // Explicitly set here to remove an empty string
77
77
  sourceBranch: extractSourceBranch(data),
78
78
  state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve),
@@ -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: "38.10.1"
5
+ packageVersion: "38.10.2"
6
6
  };
7
7
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
8
8
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -86,6 +86,7 @@ const entityDataResponse = {
86
86
  entityData: {
87
87
  id: 'I love cheese',
88
88
  displayName: 'I love cheese',
89
+ description: 'Here is your serving of cheese: 🧀',
89
90
  url: 'https://some.url',
90
91
  lastUpdatedAt: '2025-01-08T22:26:52.501Z',
91
92
  thumbnail: {
@@ -12,7 +12,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { SmartLinkSize } from '../../constants';
13
13
  import { CopyLinkAction as CopyLinkActionComponent, CustomAction as CustomActionComponent, DownloadAction as DownloadActionComponent, FollowAction as FollowActionComponent, PreviewAction as PreviewActionComponent, UnresolvedAction as UnresolvedActionComponent } from './components/actions';
14
14
  import { AssignedTo, AssignedToGroup, AttachmentCount, AuthorGroup, ChecklistProgress, CollaboratorGroup, CommentCount, CreatedBy, CreatedOn, DueOn, LatestCommit, LinkIcon, Location, ModifiedBy, ModifiedOn, OwnedBy, OwnedByGroup, Preview, Priority, ProgrammingLanguage, Provider, ReactCount, ReadTime, SentOn, Snippet, SourceBranch, State, StoryPoints, SubscriberCount, SubTasksProgress, TargetBranch, Title, ViewCount, VoteCount } from './components/elements';
15
- // ---- EXPORTED METADATA COMPONENT ---- //
15
+
16
+ // ---- EXPORTED METADATA COMPONENTS ---- //
16
17
  export const AssignedToElement = () => /*#__PURE__*/React.createElement(AssignedTo, null);
17
18
  export const AssignedToGroupElement = () => /*#__PURE__*/React.createElement(AssignedToGroup, null);
18
19
  export const AttachmentCountElement = () => /*#__PURE__*/React.createElement(AttachmentCount, null);
@@ -83,8 +84,8 @@ export const ReactCountElement = props => {
83
84
  export const ReadTimeElement = () => /*#__PURE__*/React.createElement(ReadTime, null);
84
85
  export const SentOnElement = () => /*#__PURE__*/React.createElement(SentOn, null);
85
86
  export const SnippetElement = props => /*#__PURE__*/React.createElement(Snippet, {
86
- maxLines: props.maxLines,
87
- content: props.text
87
+ maxLines: props === null || props === void 0 ? void 0 : props.maxLines,
88
+ content: props === null || props === void 0 ? void 0 : props.text
88
89
  });
89
90
  export const SourceBranchElement = () => /*#__PURE__*/React.createElement(SourceBranch, null);
90
91
  export const StateElement = () => /*#__PURE__*/React.createElement(State, null);
@@ -113,8 +114,8 @@ export const toActionProps = props => {
113
114
  };
114
115
  export const CopyLinkAction = props => /*#__PURE__*/React.createElement(CopyLinkActionComponent, toActionProps(props));
115
116
  export const CustomAction = props => /*#__PURE__*/React.createElement(CustomActionComponent, _extends({}, toActionProps(props), {
116
- content: props === null || props === void 0 ? void 0 : props.children,
117
- onClick: props === null || props === void 0 ? void 0 : props.onClick
117
+ content: props.children,
118
+ onClick: props.onClick
118
119
  }));
119
120
  export const DownloadAction = props => /*#__PURE__*/React.createElement(DownloadActionComponent, toActionProps(props));
120
121
  export const FollowAction = props => /*#__PURE__*/React.createElement(FollowActionComponent, toActionProps(props));
@@ -10,7 +10,7 @@ import LinkWarningModal from './LinkWarningModal';
10
10
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
11
11
  const PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "38.10.1",
13
+ packageVersion: "38.10.2",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
@@ -1,6 +1,7 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { extractLink } from '@atlaskit/link-extractors';
3
+ import { extractLink, extractSmartLinkUrl } from '@atlaskit/link-extractors';
4
+ import { fg } from "@atlaskit/platform-feature-flags";
4
5
  import { ActionName, CardAction } from '../../index';
5
6
  import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
6
7
  import { canShowAction } from '../../utils/actions/can-show-action';
@@ -13,7 +14,7 @@ export var extractInvokeCopyLinkAction = function extractInvokeCopyLinkAction(_r
13
14
  return;
14
15
  }
15
16
  var data = response.data;
16
- var url = extractLink(data);
17
+ var url = fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : extractLink(data);
17
18
  if (!url) {
18
19
  return;
19
20
  }
@@ -1,5 +1,7 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
+ import { extractSmartLinkDownloadUrl } from "@atlaskit/link-extractors";
4
+ import { fg } from "@atlaskit/platform-feature-flags";
3
5
  import { ActionName, CardAction } from '../../index';
4
6
  import { getDefinitionId, getExtensionKey, getResourceType } from '../../state/helpers';
5
7
  import { downloadUrl as download } from '../../utils';
@@ -19,7 +21,7 @@ export var extractInvokeDownloadAction = function extractInvokeDownloadAction(_r
19
21
  return action['@type'] === 'DownloadAction';
20
22
  });
21
23
  if (downloadActionExists) {
22
- var downloadUrl = extractDownloadUrl(data);
24
+ var downloadUrl = fg('smart_links_noun_support') ? extractSmartLinkDownloadUrl(response) : extractDownloadUrl(data);
23
25
  return {
24
26
  actionFn: function () {
25
27
  var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
@@ -1,6 +1,7 @@
1
1
  import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
2
2
  import _regeneratorRuntime from "@babel/runtime/regenerator";
3
- import { extractLink, extractPreview as extractPreviewData, extractProvider, extractTitle } from '@atlaskit/link-extractors';
3
+ import { extractLink, extractPreview as extractPreviewData, extractProvider, extractSmartLinkEmbed, extractSmartLinkProvider, extractSmartLinkTitle, extractSmartLinkUrl, extractTitle } from '@atlaskit/link-extractors';
4
+ import { fg } from "@atlaskit/platform-feature-flags";
4
5
  import { ActionName, CardAction } from '../../index';
5
6
  import { getExtensionKey } from '../../state/helpers';
6
7
  import { canShowAction } from '../../utils/actions/can-show-action';
@@ -31,7 +32,7 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
31
32
  return {
32
33
  actionFn: function () {
33
34
  var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
34
- var _extractProvider;
35
+ var _extractSmartLinkProv, _extractProvider, _extractSmartLinkEmbe;
35
36
  return _regeneratorRuntime.wrap(function _callee$(_context) {
36
37
  while (1) switch (_context.prev = _context.next) {
37
38
  case 0:
@@ -44,12 +45,12 @@ export var extractInvokePreviewAction = function extractInvokePreviewAction(para
44
45
  isSupportTheming: extractIsSupportTheming(meta),
45
46
  isTrusted: extractIsTrusted(meta),
46
47
  linkIcon: extractLinkIcon(response),
47
- providerName: (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
48
+ providerName: fg('smart_links_noun_support') ? (_extractSmartLinkProv = extractSmartLinkProvider(response)) === null || _extractSmartLinkProv === void 0 ? void 0 : _extractSmartLinkProv.text : (_extractProvider = extractProvider(data)) === null || _extractProvider === void 0 ? void 0 : _extractProvider.text,
48
49
  onClose: onClose,
49
50
  origin: origin,
50
- src: src,
51
- title: extractTitle(data),
52
- url: url
51
+ src: fg('smart_links_noun_support') ? (_extractSmartLinkEmbe = extractSmartLinkEmbed(response)) === null || _extractSmartLinkEmbe === void 0 ? void 0 : _extractSmartLinkEmbe.src : src,
52
+ title: fg('smart_links_noun_support') ? extractSmartLinkTitle(response) : extractTitle(data),
53
+ url: fg('smart_links_noun_support') ? extractSmartLinkUrl(response) : url
53
54
  }));
54
55
  case 1:
55
56
  case "end":
@@ -1,3 +1,6 @@
1
+ import { extractEntity, isEntityPresent } from "@atlaskit/link-extractors";
2
+ import { fg } from "@atlaskit/platform-feature-flags";
3
+
1
4
  /**
2
5
  * Return link summary
3
6
  */
@@ -6,4 +9,17 @@ export var extractSummary = function extractSummary(jsonLd) {
6
9
  var summary = jsonLd.summary.trim();
7
10
  return Boolean(summary) ? summary : undefined;
8
11
  }
12
+ };
13
+
14
+ /**
15
+ * Return link summary
16
+ */
17
+ export var extractSmartLinkSummary = function extractSmartLinkSummary(response) {
18
+ if (fg('smart_links_noun_support')) {
19
+ if (isEntityPresent(response)) {
20
+ var _extractEntity;
21
+ return (_extractEntity = extractEntity(response)) === null || _extractEntity === void 0 ? void 0 : _extractEntity.description;
22
+ }
23
+ }
24
+ return (response === null || response === void 0 ? void 0 : response.data) && extractSummary(response.data);
9
25
  };
@@ -1,10 +1,11 @@
1
- import { extractAri } from '@atlaskit/link-extractors';
1
+ import { extractAri, extractSmartLinkAri } from '@atlaskit/link-extractors';
2
+ import { fg } from "@atlaskit/platform-feature-flags";
2
3
  export var extractViewRelatedLinksAction = function extractViewRelatedLinksAction(response) {
3
4
  var _response$meta;
4
5
  if (!(response !== null && response !== void 0 && (_response$meta = response.meta) !== null && _response$meta !== void 0 && (_response$meta = _response$meta.supportedFeature) !== null && _response$meta !== void 0 && _response$meta.includes('RelatedLinks'))) {
5
6
  return;
6
7
  }
7
- var ari = extractAri(response.data);
8
+ var ari = fg('smart_links_noun_support') ? extractSmartLinkAri(response) : extractAri(response.data);
8
9
  if (!ari) {
9
10
  return;
10
11
  }
@@ -3,9 +3,9 @@ import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProper
3
3
  var _excluded = ["appearance", "fireEvent", "id", "onClick", "origin", "renderers", "resolve", "actionOptions", "response", "status", "aiSummaryConfig"];
4
4
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
5
5
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
6
- import { extractPersonCreatedBy, extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn, extractSmartLinkTitle, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
6
+ import { extractPersonOwnedBy, extractSmartLinkAri, extractSmartLinkAuthorGroup, extractSmartLinkCreatedBy, extractSmartLinkCreatedOn, extractSmartLinkModifiedBy, extractSmartLinkModifiedOn, extractSmartLinkTitle, extractSmartLinkUrl, extractType } from '@atlaskit/link-extractors';
7
7
  import { fg } from '@atlaskit/platform-feature-flags';
8
- import { extractSummary } from '../common/primitives';
8
+ import { extractSmartLinkSummary } from "../common/primitives/extractSummary";
9
9
  import { extractFlexibleCardActions } from './actions';
10
10
  import { extractPersonsUpdatedBy } from './collaboratorGroup';
11
11
  import extractLinkTitle from './extract-link-title';
@@ -50,7 +50,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
50
50
  appliedToComponentsCount: extractAppliedToComponentsCount(data),
51
51
  assignedToGroup: extractPersonAssignedToAsArray(data),
52
52
  attachmentCount: extractAttachmentCount(data),
53
- authorGroup: extractPersonCreatedBy(data),
53
+ authorGroup: extractSmartLinkAuthorGroup(response),
54
54
  ownedByGroup: extractPersonOwnedBy(data),
55
55
  collaboratorGroup: extractPersonsUpdatedBy(data),
56
56
  commentCount: extractCommentCount(data),
@@ -77,7 +77,7 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
77
77
  programmingLanguage: extractProgrammingLanguage(data),
78
78
  readTime: extractReadTime(data),
79
79
  sentOn: extractSentOn(data),
80
- snippet: extractSummary(data) || undefined,
80
+ snippet: extractSmartLinkSummary(response) || undefined,
81
81
  // Explicitly set here to remove an empty string
82
82
  sourceBranch: extractSourceBranch(data),
83
83
  state: extractState(response, actionOptions, id, appearance, origin, fireEvent, resolve),
@@ -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: "38.10.1"
7
+ packageVersion: "38.10.2"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -97,6 +97,7 @@ var entityDataResponse = {
97
97
  entityData: {
98
98
  id: 'I love cheese',
99
99
  displayName: 'I love cheese',
100
+ description: 'Here is your serving of cheese: 🧀',
100
101
  url: 'https://some.url',
101
102
  lastUpdatedAt: '2025-01-08T22:26:52.501Z',
102
103
  thumbnail: {
@@ -12,7 +12,8 @@ import { fg } from '@atlaskit/platform-feature-flags';
12
12
  import { SmartLinkSize } from '../../constants';
13
13
  import { CopyLinkAction as CopyLinkActionComponent, CustomAction as CustomActionComponent, DownloadAction as DownloadActionComponent, FollowAction as FollowActionComponent, PreviewAction as PreviewActionComponent, UnresolvedAction as UnresolvedActionComponent } from './components/actions';
14
14
  import { AssignedTo, AssignedToGroup, AttachmentCount, AuthorGroup, ChecklistProgress, CollaboratorGroup, CommentCount, CreatedBy, CreatedOn, DueOn, LatestCommit, LinkIcon, Location, ModifiedBy, ModifiedOn, OwnedBy, OwnedByGroup, Preview, Priority, ProgrammingLanguage, Provider, ReactCount, ReadTime, SentOn, Snippet, SourceBranch, State, StoryPoints, SubscriberCount, SubTasksProgress, TargetBranch, Title, ViewCount, VoteCount } from './components/elements';
15
- // ---- EXPORTED METADATA COMPONENT ---- //
15
+
16
+ // ---- EXPORTED METADATA COMPONENTS ---- //
16
17
  export var AssignedToElement = function AssignedToElement() {
17
18
  return /*#__PURE__*/React.createElement(AssignedTo, null);
18
19
  };
@@ -120,8 +121,8 @@ export var SentOnElement = function SentOnElement() {
120
121
  };
121
122
  export var SnippetElement = function SnippetElement(props) {
122
123
  return /*#__PURE__*/React.createElement(Snippet, {
123
- maxLines: props.maxLines,
124
- content: props.text
124
+ maxLines: props === null || props === void 0 ? void 0 : props.maxLines,
125
+ content: props === null || props === void 0 ? void 0 : props.text
125
126
  });
126
127
  };
127
128
  export var SourceBranchElement = function SourceBranchElement() {
@@ -172,8 +173,8 @@ export var CopyLinkAction = function CopyLinkAction(props) {
172
173
  };
173
174
  export var CustomAction = function CustomAction(props) {
174
175
  return /*#__PURE__*/React.createElement(CustomActionComponent, _extends({}, toActionProps(props), {
175
- content: props === null || props === void 0 ? void 0 : props.children,
176
- onClick: props === null || props === void 0 ? void 0 : props.onClick
176
+ content: props.children,
177
+ onClick: props.onClick
177
178
  }));
178
179
  };
179
180
  export var DownloadAction = function DownloadAction(props) {
@@ -13,7 +13,7 @@ import LinkWarningModal from './LinkWarningModal';
13
13
  import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
14
14
  var PACKAGE_DATA = {
15
15
  packageName: "@atlaskit/smart-card",
16
- packageVersion: "38.10.1",
16
+ packageVersion: "38.10.2",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');
@@ -0,0 +1,3 @@
1
+ import { SmartLinkResponse } from "@atlaskit/linking-types";
2
+ declare const _default: SmartLinkResponse;
3
+ export default _default;
@@ -1,5 +1,10 @@
1
1
  import { type JsonLd } from '@atlaskit/json-ld-types';
2
+ import type { SmartLinkResponse } from "@atlaskit/linking-types";
2
3
  /**
3
4
  * Return link summary
4
5
  */
5
6
  export declare const extractSummary: (jsonLd: JsonLd.Data.BaseData) => string | undefined;
7
+ /**
8
+ * Return link summary
9
+ */
10
+ export declare const extractSmartLinkSummary: (response?: SmartLinkResponse) => string | undefined;
@@ -7,53 +7,54 @@
7
7
  * DO NOT add a new prop to these components until we are ready to support it externally.
8
8
  */
9
9
  import React from 'react';
10
- import type { BaseBadgeElementProps, BaseDateTimeElementProps, BaseIconElementProps, BaseLinkElementProps, BaseTextElementProps } from './components/elements/common';
11
- import type { PreviewElementProps } from './components/elements/preview-element';
10
+ import { Prettify } from '@atlaskit/linking-common';
11
+ import { CommentCount, LinkIcon, ModifiedOn, OwnedBy, Preview, ReactCount, Snippet, Title } from './components/elements';
12
12
  export declare const AssignedToElement: () => React.JSX.Element;
13
13
  export declare const AssignedToGroupElement: () => React.JSX.Element;
14
14
  export declare const AttachmentCountElement: () => React.JSX.Element;
15
15
  export declare const AuthorGroupElement: () => React.JSX.Element;
16
16
  export declare const ChecklistProgressElement: () => React.JSX.Element;
17
17
  export declare const CollaboratorGroupElement: () => React.JSX.Element;
18
- type CommentCountElementProps = Pick<BaseBadgeElementProps, 'color'>;
18
+ type CommentCountElementProps = Pick<React.ComponentProps<typeof CommentCount>, 'color'>;
19
19
  export declare const CommentCountElement: (props?: CommentCountElementProps) => React.JSX.Element;
20
20
  export declare const CreatedOnElement: () => React.JSX.Element;
21
21
  export declare const CreatedByElement: () => React.JSX.Element;
22
22
  export declare const DueOnElement: () => React.JSX.Element;
23
23
  export declare const LatestCommitElement: () => React.JSX.Element;
24
- type LinkIconElementProps = Pick<BaseIconElementProps, 'render'> & {
24
+ type LinkIconElementProps = Prettify<Pick<React.ComponentProps<typeof LinkIcon>, 'render'> & {
25
25
  iconTileSize?: 16 | 24;
26
- };
26
+ }>;
27
27
  export declare const LinkIconElement: (props?: LinkIconElementProps) => React.JSX.Element;
28
28
  export declare const LocationElement: () => React.JSX.Element;
29
29
  export declare const ModifiedByElement: () => React.JSX.Element;
30
- type ModifiedOnElementProps = Pick<BaseDateTimeElementProps, 'hideDatePrefix' | 'color'>;
30
+ type ModifiedOnElementProps = Pick<React.ComponentProps<typeof ModifiedOn>, 'hideDatePrefix' | 'color'>;
31
31
  export declare const ModifiedOnElement: (props?: ModifiedOnElementProps) => React.JSX.Element;
32
- type OwnedByElementProps = Pick<BaseTextElementProps, 'hideFormat' | 'color'>;
32
+ type OwnedByElementProps = Pick<React.ComponentProps<typeof OwnedBy>, 'hideFormat' | 'color'>;
33
33
  export declare const OwnedByElement: (props?: OwnedByElementProps) => React.JSX.Element;
34
34
  export declare const OwnedByGroupElement: () => React.JSX.Element;
35
- export declare const PreviewElement: (props: Omit<PreviewElementProps, 'overrideUrl'> & {
36
- url?: PreviewElementProps['overrideUrl'];
37
- }) => React.JSX.Element;
35
+ type PreviewElementProps = {
36
+ url?: React.ComponentProps<typeof Preview>['overrideUrl'];
37
+ };
38
+ export declare const PreviewElement: (props?: PreviewElementProps) => React.JSX.Element;
38
39
  export declare const PriorityElement: () => React.JSX.Element;
39
40
  export declare const ProgrammingLanguageElement: () => React.JSX.Element;
40
41
  export declare const ProviderElement: () => React.JSX.Element;
41
- type ReactCountElementProps = Pick<BaseBadgeElementProps, 'color'>;
42
+ type ReactCountElementProps = Pick<React.ComponentProps<typeof ReactCount>, 'color'>;
42
43
  export declare const ReactCountElement: (props?: ReactCountElementProps) => React.JSX.Element;
43
44
  export declare const ReadTimeElement: () => React.JSX.Element;
44
45
  export declare const SentOnElement: () => React.JSX.Element;
45
- export type SnippetElementProps = Pick<BaseTextElementProps, 'maxLines'> & {
46
- text?: BaseTextElementProps['content'];
47
- };
48
- export declare const SnippetElement: (props: SnippetElementProps) => React.JSX.Element;
46
+ export type SnippetElementProps = Prettify<Pick<React.ComponentProps<typeof Snippet>, 'maxLines'> & {
47
+ text?: React.ComponentProps<typeof Snippet>['content'];
48
+ }>;
49
+ export declare const SnippetElement: (props?: SnippetElementProps) => React.JSX.Element;
49
50
  export declare const SourceBranchElement: () => React.JSX.Element;
50
51
  export declare const StateElement: () => React.JSX.Element;
51
52
  export declare const StoryPointsElement: () => React.JSX.Element;
52
53
  export declare const SubscriberCountElement: () => React.JSX.Element;
53
54
  export declare const SubTasksProgressElement: () => React.JSX.Element;
54
55
  export declare const TargetBranchElement: () => React.JSX.Element;
55
- export type TitleElementProps = Pick<BaseLinkElementProps, 'hideTooltip' | 'maxLines' | 'target' | 'text'>;
56
- export declare const TitleElement: (props: TitleElementProps) => React.JSX.Element;
56
+ export type TitleElementProps = Pick<React.ComponentProps<typeof Title>, 'hideTooltip' | 'maxLines' | 'target' | 'text'>;
57
+ export declare const TitleElement: (props?: TitleElementProps) => React.JSX.Element;
57
58
  export declare const ViewCountElement: () => React.JSX.Element;
58
59
  export declare const VoteCountElement: () => React.JSX.Element;
59
60
  type BaseActionProps = {
@@ -65,10 +66,10 @@ export declare const toActionProps: (props?: BaseActionProps) => {
65
66
  };
66
67
  export type CopyLinkActionProps = BaseActionProps;
67
68
  export declare const CopyLinkAction: (props: CopyLinkActionProps) => React.JSX.Element;
68
- export type CustomActionProps = BaseActionProps & {
69
+ export type CustomActionProps = Prettify<BaseActionProps & {
69
70
  children: React.ReactNode;
70
71
  onClick: () => void;
71
- };
72
+ }>;
72
73
  export declare const CustomAction: (props: CustomActionProps) => React.JSX.Element;
73
74
  export type DownloadActionProps = BaseActionProps;
74
75
  export declare const DownloadAction: (props: DownloadActionProps) => React.JSX.Element;
@@ -0,0 +1,3 @@
1
+ import { SmartLinkResponse } from "@atlaskit/linking-types";
2
+ declare const _default: SmartLinkResponse;
3
+ export default _default;
@@ -1,5 +1,10 @@
1
1
  import { type JsonLd } from '@atlaskit/json-ld-types';
2
+ import type { SmartLinkResponse } from "@atlaskit/linking-types";
2
3
  /**
3
4
  * Return link summary
4
5
  */
5
6
  export declare const extractSummary: (jsonLd: JsonLd.Data.BaseData) => string | undefined;
7
+ /**
8
+ * Return link summary
9
+ */
10
+ export declare const extractSmartLinkSummary: (response?: SmartLinkResponse) => string | undefined;
@@ -7,53 +7,54 @@
7
7
  * DO NOT add a new prop to these components until we are ready to support it externally.
8
8
  */
9
9
  import React from 'react';
10
- import type { BaseBadgeElementProps, BaseDateTimeElementProps, BaseIconElementProps, BaseLinkElementProps, BaseTextElementProps } from './components/elements/common';
11
- import type { PreviewElementProps } from './components/elements/preview-element';
10
+ import { Prettify } from '@atlaskit/linking-common';
11
+ import { CommentCount, LinkIcon, ModifiedOn, OwnedBy, Preview, ReactCount, Snippet, Title } from './components/elements';
12
12
  export declare const AssignedToElement: () => React.JSX.Element;
13
13
  export declare const AssignedToGroupElement: () => React.JSX.Element;
14
14
  export declare const AttachmentCountElement: () => React.JSX.Element;
15
15
  export declare const AuthorGroupElement: () => React.JSX.Element;
16
16
  export declare const ChecklistProgressElement: () => React.JSX.Element;
17
17
  export declare const CollaboratorGroupElement: () => React.JSX.Element;
18
- type CommentCountElementProps = Pick<BaseBadgeElementProps, 'color'>;
18
+ type CommentCountElementProps = Pick<React.ComponentProps<typeof CommentCount>, 'color'>;
19
19
  export declare const CommentCountElement: (props?: CommentCountElementProps) => React.JSX.Element;
20
20
  export declare const CreatedOnElement: () => React.JSX.Element;
21
21
  export declare const CreatedByElement: () => React.JSX.Element;
22
22
  export declare const DueOnElement: () => React.JSX.Element;
23
23
  export declare const LatestCommitElement: () => React.JSX.Element;
24
- type LinkIconElementProps = Pick<BaseIconElementProps, 'render'> & {
24
+ type LinkIconElementProps = Prettify<Pick<React.ComponentProps<typeof LinkIcon>, 'render'> & {
25
25
  iconTileSize?: 16 | 24;
26
- };
26
+ }>;
27
27
  export declare const LinkIconElement: (props?: LinkIconElementProps) => React.JSX.Element;
28
28
  export declare const LocationElement: () => React.JSX.Element;
29
29
  export declare const ModifiedByElement: () => React.JSX.Element;
30
- type ModifiedOnElementProps = Pick<BaseDateTimeElementProps, 'hideDatePrefix' | 'color'>;
30
+ type ModifiedOnElementProps = Pick<React.ComponentProps<typeof ModifiedOn>, 'hideDatePrefix' | 'color'>;
31
31
  export declare const ModifiedOnElement: (props?: ModifiedOnElementProps) => React.JSX.Element;
32
- type OwnedByElementProps = Pick<BaseTextElementProps, 'hideFormat' | 'color'>;
32
+ type OwnedByElementProps = Pick<React.ComponentProps<typeof OwnedBy>, 'hideFormat' | 'color'>;
33
33
  export declare const OwnedByElement: (props?: OwnedByElementProps) => React.JSX.Element;
34
34
  export declare const OwnedByGroupElement: () => React.JSX.Element;
35
- export declare const PreviewElement: (props: Omit<PreviewElementProps, 'overrideUrl'> & {
36
- url?: PreviewElementProps['overrideUrl'];
37
- }) => React.JSX.Element;
35
+ type PreviewElementProps = {
36
+ url?: React.ComponentProps<typeof Preview>['overrideUrl'];
37
+ };
38
+ export declare const PreviewElement: (props?: PreviewElementProps) => React.JSX.Element;
38
39
  export declare const PriorityElement: () => React.JSX.Element;
39
40
  export declare const ProgrammingLanguageElement: () => React.JSX.Element;
40
41
  export declare const ProviderElement: () => React.JSX.Element;
41
- type ReactCountElementProps = Pick<BaseBadgeElementProps, 'color'>;
42
+ type ReactCountElementProps = Pick<React.ComponentProps<typeof ReactCount>, 'color'>;
42
43
  export declare const ReactCountElement: (props?: ReactCountElementProps) => React.JSX.Element;
43
44
  export declare const ReadTimeElement: () => React.JSX.Element;
44
45
  export declare const SentOnElement: () => React.JSX.Element;
45
- export type SnippetElementProps = Pick<BaseTextElementProps, 'maxLines'> & {
46
- text?: BaseTextElementProps['content'];
47
- };
48
- export declare const SnippetElement: (props: SnippetElementProps) => React.JSX.Element;
46
+ export type SnippetElementProps = Prettify<Pick<React.ComponentProps<typeof Snippet>, 'maxLines'> & {
47
+ text?: React.ComponentProps<typeof Snippet>['content'];
48
+ }>;
49
+ export declare const SnippetElement: (props?: SnippetElementProps) => React.JSX.Element;
49
50
  export declare const SourceBranchElement: () => React.JSX.Element;
50
51
  export declare const StateElement: () => React.JSX.Element;
51
52
  export declare const StoryPointsElement: () => React.JSX.Element;
52
53
  export declare const SubscriberCountElement: () => React.JSX.Element;
53
54
  export declare const SubTasksProgressElement: () => React.JSX.Element;
54
55
  export declare const TargetBranchElement: () => React.JSX.Element;
55
- export type TitleElementProps = Pick<BaseLinkElementProps, 'hideTooltip' | 'maxLines' | 'target' | 'text'>;
56
- export declare const TitleElement: (props: TitleElementProps) => React.JSX.Element;
56
+ export type TitleElementProps = Pick<React.ComponentProps<typeof Title>, 'hideTooltip' | 'maxLines' | 'target' | 'text'>;
57
+ export declare const TitleElement: (props?: TitleElementProps) => React.JSX.Element;
57
58
  export declare const ViewCountElement: () => React.JSX.Element;
58
59
  export declare const VoteCountElement: () => React.JSX.Element;
59
60
  type BaseActionProps = {
@@ -65,10 +66,10 @@ export declare const toActionProps: (props?: BaseActionProps) => {
65
66
  };
66
67
  export type CopyLinkActionProps = BaseActionProps;
67
68
  export declare const CopyLinkAction: (props: CopyLinkActionProps) => React.JSX.Element;
68
- export type CustomActionProps = BaseActionProps & {
69
+ export type CustomActionProps = Prettify<BaseActionProps & {
69
70
  children: React.ReactNode;
70
71
  onClick: () => void;
71
- };
72
+ }>;
72
73
  export declare const CustomAction: (props: CustomActionProps) => React.JSX.Element;
73
74
  export type DownloadActionProps = BaseActionProps;
74
75
  export declare const DownloadAction: (props: DownloadActionProps) => React.JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "38.10.1",
3
+ "version": "38.11.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -34,7 +34,7 @@
34
34
  "@atlaskit/badge": "^18.1.0",
35
35
  "@atlaskit/button": "^23.2.0",
36
36
  "@atlaskit/checkbox": "^17.1.0",
37
- "@atlaskit/css": "^0.10.0",
37
+ "@atlaskit/css": "^0.11.0",
38
38
  "@atlaskit/dropdown-menu": "^16.1.0",
39
39
  "@atlaskit/form": "^12.0.0",
40
40
  "@atlaskit/frontend-utilities": "^3.0.0",
@@ -50,9 +50,9 @@
50
50
  "@atlaskit/link": "^3.2.0",
51
51
  "@atlaskit/link-analytics": "^10.0.0",
52
52
  "@atlaskit/link-client-extension": "^5.0.0",
53
- "@atlaskit/link-extractors": "^2.3.0",
54
- "@atlaskit/linking-common": "^9.0.0",
55
- "@atlaskit/linking-types": "^12.0.0",
53
+ "@atlaskit/link-extractors": "^2.4.0",
54
+ "@atlaskit/linking-common": "^9.1.0",
55
+ "@atlaskit/linking-types": "^12.1.0",
56
56
  "@atlaskit/logo": "^19.1.0",
57
57
  "@atlaskit/lozenge": "^13.0.0",
58
58
  "@atlaskit/menu": "^8.0.0",
@@ -60,14 +60,14 @@
60
60
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
61
61
  "@atlaskit/platform-feature-flags": "^1.1.0",
62
62
  "@atlaskit/popup": "^4.3.0",
63
- "@atlaskit/primitives": "^14.8.0",
63
+ "@atlaskit/primitives": "^14.9.0",
64
64
  "@atlaskit/section-message": "^8.2.0",
65
65
  "@atlaskit/select": "^20.7.0",
66
66
  "@atlaskit/spinner": "^18.0.0",
67
67
  "@atlaskit/textarea": "^8.0.0",
68
68
  "@atlaskit/textfield": "^8.0.0",
69
69
  "@atlaskit/theme": "^18.0.0",
70
- "@atlaskit/tokens": "^5.2.0",
70
+ "@atlaskit/tokens": "^5.3.0",
71
71
  "@atlaskit/tooltip": "^20.3.0",
72
72
  "@atlaskit/ufo": "^0.4.0",
73
73
  "@babel/runtime": "^7.0.0",
@@ -96,7 +96,7 @@
96
96
  "@atlaskit/analytics-listeners": "^9.0.0",
97
97
  "@atlaskit/css-reset": "^7.3.0",
98
98
  "@atlaskit/link-test-helpers": "^8.0.0",
99
- "@atlaskit/media-test-helpers": "^36.1.0",
99
+ "@atlaskit/media-test-helpers": "^37.0.0",
100
100
  "@atlaskit/react-ufo": "^3.13.0",
101
101
  "@atlaskit/ssr": "workspace:^",
102
102
  "@atlaskit/visual-regression": "workspace:^",