@atlaskit/smart-card 38.5.1 → 38.5.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (114) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/cjs/extractors/flexible/extract-link-title.js +23 -0
  3. package/dist/cjs/extractors/flexible/index.js +13 -5
  4. package/dist/cjs/state/helpers.js +4 -1
  5. package/dist/cjs/state/hooks/useSmartLink.js +6 -2
  6. package/dist/cjs/utils/analytics/analytics.js +1 -1
  7. package/dist/cjs/view/BlockCard/views/ResolvedView.js +24 -15
  8. package/dist/cjs/view/BlockCard/views/unresolved-view/index.js +15 -10
  9. package/dist/cjs/view/BlockCard/views/utils/index.js +10 -2
  10. package/dist/cjs/view/CardWithUrl/component.js +29 -8
  11. package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +2 -2
  12. package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/index.js +17 -3
  13. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/index.js +16 -4
  14. package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +11 -4
  15. package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/index.js +17 -3
  16. package/dist/cjs/view/FlexibleCard/components/blocks/metadata-block/index.js +64 -17
  17. package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/index.js +9 -1
  18. package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +19 -5
  19. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +18 -6
  20. package/dist/cjs/view/FlexibleCard/components/container/index.js +12 -2
  21. package/dist/cjs/view/FlexibleCard/components/elements/title-element/index.js +2 -1
  22. package/dist/cjs/view/FlexibleCard/components/elements/utils.js +3 -0
  23. package/dist/cjs/view/FlexibleCard/index.js +5 -2
  24. package/dist/cjs/view/FlexibleCard/utils.js +11 -18
  25. package/dist/cjs/view/HoverCard/components/HoverCardContent.js +2 -1
  26. package/dist/cjs/view/HoverCard/components/views/forbidden/index.js +21 -14
  27. package/dist/cjs/view/HoverCard/components/views/resolved/index.js +22 -14
  28. package/dist/cjs/view/HoverCard/styled.js +13 -1
  29. package/dist/cjs/view/LinkUrl/index.js +1 -1
  30. package/dist/es2019/extractors/flexible/extract-link-title.js +17 -0
  31. package/dist/es2019/extractors/flexible/index.js +9 -1
  32. package/dist/es2019/state/helpers.js +1 -0
  33. package/dist/es2019/state/hooks/useSmartLink.js +6 -2
  34. package/dist/es2019/utils/analytics/analytics.js +1 -1
  35. package/dist/es2019/view/BlockCard/views/ResolvedView.js +25 -16
  36. package/dist/es2019/view/BlockCard/views/unresolved-view/index.js +16 -11
  37. package/dist/es2019/view/BlockCard/views/utils/index.js +9 -1
  38. package/dist/es2019/view/CardWithUrl/component.js +30 -9
  39. package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +2 -2
  40. package/dist/es2019/view/FlexibleCard/components/blocks/ai-footer-block/index.js +17 -3
  41. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/index.js +17 -5
  42. package/dist/es2019/view/FlexibleCard/components/blocks/block/index.js +11 -4
  43. package/dist/es2019/view/FlexibleCard/components/blocks/footer-block/index.js +17 -3
  44. package/dist/es2019/view/FlexibleCard/components/blocks/metadata-block/index.js +48 -5
  45. package/dist/es2019/view/FlexibleCard/components/blocks/preview-block/index.js +9 -1
  46. package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +20 -6
  47. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +19 -7
  48. package/dist/es2019/view/FlexibleCard/components/container/index.js +10 -2
  49. package/dist/es2019/view/FlexibleCard/components/elements/title-element/index.js +2 -1
  50. package/dist/es2019/view/FlexibleCard/components/elements/utils.js +3 -0
  51. package/dist/es2019/view/FlexibleCard/index.js +5 -2
  52. package/dist/es2019/view/FlexibleCard/utils.js +14 -21
  53. package/dist/es2019/view/HoverCard/components/HoverCardContent.js +3 -2
  54. package/dist/es2019/view/HoverCard/components/views/forbidden/index.js +21 -14
  55. package/dist/es2019/view/HoverCard/components/views/resolved/index.js +22 -14
  56. package/dist/es2019/view/HoverCard/styled.js +12 -0
  57. package/dist/es2019/view/LinkUrl/index.js +1 -1
  58. package/dist/esm/extractors/flexible/extract-link-title.js +17 -0
  59. package/dist/esm/extractors/flexible/index.js +13 -5
  60. package/dist/esm/state/helpers.js +3 -0
  61. package/dist/esm/state/hooks/useSmartLink.js +6 -2
  62. package/dist/esm/utils/analytics/analytics.js +1 -1
  63. package/dist/esm/view/BlockCard/views/ResolvedView.js +25 -16
  64. package/dist/esm/view/BlockCard/views/unresolved-view/index.js +16 -11
  65. package/dist/esm/view/BlockCard/views/utils/index.js +9 -1
  66. package/dist/esm/view/CardWithUrl/component.js +30 -9
  67. package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +2 -2
  68. package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/index.js +17 -3
  69. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/index.js +17 -5
  70. package/dist/esm/view/FlexibleCard/components/blocks/block/index.js +11 -4
  71. package/dist/esm/view/FlexibleCard/components/blocks/footer-block/index.js +17 -3
  72. package/dist/esm/view/FlexibleCard/components/blocks/metadata-block/index.js +64 -17
  73. package/dist/esm/view/FlexibleCard/components/blocks/preview-block/index.js +9 -1
  74. package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +20 -6
  75. package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +18 -6
  76. package/dist/esm/view/FlexibleCard/components/container/index.js +12 -2
  77. package/dist/esm/view/FlexibleCard/components/elements/title-element/index.js +2 -1
  78. package/dist/esm/view/FlexibleCard/components/elements/utils.js +3 -0
  79. package/dist/esm/view/FlexibleCard/index.js +5 -2
  80. package/dist/esm/view/FlexibleCard/utils.js +12 -19
  81. package/dist/esm/view/HoverCard/components/HoverCardContent.js +3 -2
  82. package/dist/esm/view/HoverCard/components/views/forbidden/index.js +21 -14
  83. package/dist/esm/view/HoverCard/components/views/resolved/index.js +22 -14
  84. package/dist/esm/view/HoverCard/styled.js +12 -0
  85. package/dist/esm/view/LinkUrl/index.js +1 -1
  86. package/dist/types/extractors/flexible/extract-link-title.d.ts +4 -0
  87. package/dist/types/extractors/flexible/index.d.ts +1 -1
  88. package/dist/types/state/flexible-ui-context/types.d.ts +11 -0
  89. package/dist/types/state/helpers.d.ts +1 -0
  90. package/dist/types/state/hooks/useSmartLink.d.ts +2 -0
  91. package/dist/types/utils/analytics/types.d.ts +1 -1
  92. package/dist/types/view/BlockCard/views/utils/index.d.ts +4 -0
  93. package/dist/types/view/FlexibleCard/components/blocks/block/index.d.ts +1 -1
  94. package/dist/types/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
  95. package/dist/types/view/FlexibleCard/components/blocks/title-block/types.d.ts +6 -0
  96. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +5 -0
  97. package/dist/types/view/FlexibleCard/components/elements/common/base-icon-element/index.d.ts +1 -1
  98. package/dist/types/view/FlexibleCard/types.d.ts +1 -1
  99. package/dist/types/view/HoverCard/styled.d.ts +4 -0
  100. package/dist/types-ts4.5/extractors/flexible/extract-link-title.d.ts +4 -0
  101. package/dist/types-ts4.5/extractors/flexible/index.d.ts +1 -1
  102. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +11 -0
  103. package/dist/types-ts4.5/state/helpers.d.ts +1 -0
  104. package/dist/types-ts4.5/state/hooks/useSmartLink.d.ts +2 -0
  105. package/dist/types-ts4.5/utils/analytics/types.d.ts +1 -1
  106. package/dist/types-ts4.5/view/BlockCard/views/utils/index.d.ts +4 -0
  107. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/block/index.d.ts +1 -1
  108. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/index.d.ts +1 -1
  109. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/types.d.ts +6 -0
  110. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +5 -0
  111. package/dist/types-ts4.5/view/FlexibleCard/components/elements/common/base-icon-element/index.d.ts +1 -1
  112. package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +1 -1
  113. package/dist/types-ts4.5/view/HoverCard/styled.d.ts +4 -0
  114. package/package.json +10 -4
@@ -1,9 +1,10 @@
1
1
  import _defineProperty from "@babel/runtime/helpers/defineProperty";
2
- import { extractProvider, extractSmartLinkProvider, isEntityPresent } from '@atlaskit/link-extractors';
2
+ import { extractProvider, extractSmartLinkProvider } from '@atlaskit/link-extractors';
3
3
  import { fg } from '@atlaskit/platform-feature-flags';
4
4
  import { InternalActionName, SmartLinkStatus } from '../../constants';
5
5
  import { extractRequestAccessContextImproved } from '../../extractors/common/context';
6
6
  import extractFlexibleUiContext from '../../extractors/flexible';
7
+ import extractLinkTitle from '../../extractors/flexible/extract-link-title';
7
8
  import extractPreview, { extractSmartLinkPreviewImage } from '../../extractors/flexible/extract-preview';
8
9
  import { extractErrorIcon } from '../../extractors/flexible/icon';
9
10
  import extractProviderIcon, { extractSmartLinkProviderIcon } from '../../extractors/flexible/icon/extract-provider-icon';
@@ -12,13 +13,17 @@ import { handleOnClick } from '../../utils';
12
13
  import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
13
14
  export var getContextByStatus = function getContextByStatus(params) {
14
15
  var _ref = params !== null && params !== void 0 ? params : {},
16
+ onClick = _ref.onClick,
15
17
  response = _ref.response,
16
18
  status = _ref.status,
17
19
  url = _ref.url;
18
20
  switch (status) {
19
21
  case SmartLinkStatus.Pending:
20
22
  case SmartLinkStatus.Resolving:
21
- return {
23
+ return fg('platform-linking-flexible-card-context') ? {
24
+ linkTitle: extractLinkTitle(status, url, response, onClick),
25
+ url: url
26
+ } : {
22
27
  title: url,
23
28
  url: url
24
29
  };
@@ -30,26 +35,14 @@ export var getContextByStatus = function getContextByStatus(params) {
30
35
  case SmartLinkStatus.Errored:
31
36
  case SmartLinkStatus.Fallback:
32
37
  default:
33
- var actions = fg('platform-linking-flexible-card-unresolved-action') ? _defineProperty({}, InternalActionName.UnresolvedAction, getRetryOptions(url, status, response, params.onAuthorize)) : undefined;
34
- if (fg('smart_links_noun_support')) {
35
- if (isEntityPresent(response)) {
36
- return {
37
- url: url,
38
- title: url,
39
- linkIcon: extractErrorIcon(response, status),
40
- preview: extractSmartLinkPreviewImage(response),
41
- provider: extractSmartLinkProviderIcon(response),
42
- actions: actions
43
- };
44
- }
45
- }
46
38
  return {
47
39
  url: url,
48
- title: url,
40
+ title: fg('platform-linking-flexible-card-context') ? undefined : url,
49
41
  linkIcon: extractErrorIcon(response, status),
50
- preview: extractPreview(response === null || response === void 0 ? void 0 : response.data),
51
- provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data),
52
- actions: actions
42
+ linkTitle: fg('platform-linking-flexible-card-context') ? extractLinkTitle(status, url, response, onClick) : undefined,
43
+ preview: fg('smart_links_noun_support') ? extractSmartLinkPreviewImage(response) : extractPreview(response === null || response === void 0 ? void 0 : response.data),
44
+ provider: fg('smart_links_noun_support') ? extractSmartLinkProviderIcon(response) : extractProviderIcon(response === null || response === void 0 ? void 0 : response.data),
45
+ actions: fg('platform-linking-flexible-card-unresolved-action') ? _defineProperty({}, InternalActionName.UnresolvedAction, getRetryOptions(url, status, response, params.onAuthorize)) : undefined
53
46
  };
54
47
  }
55
48
  };
@@ -1,6 +1,7 @@
1
1
  import React, { useCallback, useEffect, useMemo, useRef } from 'react';
2
2
  import { useAnalyticsEvents as useAnalyticsEventsNext } from '@atlaskit/analytics-next';
3
3
  import { useSmartLinkContext } from '@atlaskit/link-provider';
4
+ import { fg } from '@atlaskit/platform-feature-flags';
4
5
  import { useAnalyticsEvents } from '../../../common/analytics/generated/use-analytics-events';
5
6
  import { CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
6
7
  import { getDefinitionId, getExtensionKey, getServices } from '../../../state/helpers';
@@ -8,7 +9,7 @@ import { useSmartCardState } from '../../../state/store';
8
9
  import { isSpecialEvent } from '../../../utils';
9
10
  import { getIsAISummaryEnabled } from '../../../utils/ai-summary';
10
11
  import { fireLinkClickedEvent } from '../../../utils/analytics/click';
11
- import { flexibleUiOptions } from '../styled';
12
+ import { flexibleUiOptions, flexibleUiOptionsOld } from '../styled';
12
13
  import { getMetadata } from '../utils';
13
14
  import ContentContainer from './ContentContainer';
14
15
  import HoverCardForbiddenView from './views/forbidden';
@@ -112,7 +113,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
112
113
  origin: 'smartLinkPreviewHoverCard',
113
114
  renderers: renderers,
114
115
  actionOptions: actionOptions,
115
- ui: flexibleUiOptions,
116
+ ui: fg('platform-linking-flexible-card-context') ? flexibleUiOptions : flexibleUiOptionsOld,
116
117
  url: url,
117
118
  children: null
118
119
  };
@@ -52,32 +52,39 @@ var HoverCardForbiddenView = function HoverCardForbiddenView(_ref) {
52
52
  var ButtonComponent = fg('platform-smart-card-remove-legacy-button') ? Button : ButtonOld;
53
53
  return /*#__PURE__*/React.createElement(FlexibleCard, _extends({}, flexibleCardProps, {
54
54
  testId: testId
55
- }), /*#__PURE__*/React.createElement(PreviewBlock, {
55
+ }), /*#__PURE__*/React.createElement(PreviewBlock, _extends({
56
56
  ignoreContainerPadding: true,
57
- testId: testId,
58
- status: SmartLinkStatus.Forbidden,
57
+ testId: testId
58
+ }, fg('platform-linking-flexible-card-context') ? undefined : {
59
+ status: SmartLinkStatus.Forbidden
60
+ }, {
59
61
  className: ax([fg('platform-linking-visual-refresh-v1') ? "_13lipd34 _qrwqpd34 _otyru2gc" : "_13lipd34 _qrwqpd34 _otyrcxkx"])
60
- }), /*#__PURE__*/React.createElement(CustomBlock, {
61
- testId: "".concat(testId, "-title"),
62
- status: SmartLinkStatus.Forbidden,
62
+ })), /*#__PURE__*/React.createElement(CustomBlock, _extends({
63
+ testId: "".concat(testId, "-title")
64
+ }, fg('platform-linking-flexible-card-context') ? undefined : {
65
+ status: SmartLinkStatus.Forbidden
66
+ }, {
63
67
  className: ax([fg('platform-linking-visual-refresh-v1') ? "_1bah1h6o _k48p1pd9 _19pku2gc" : "_1bah1h6o _k48p1pd9 _19pku2gc"])
64
- }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[titleMessageKey], {
68
+ }), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[titleMessageKey], {
65
69
  values: {
66
70
  product: product
67
71
  }
68
- }))), /*#__PURE__*/React.createElement(CustomBlock, {
69
- testId: "".concat(testId, "-content"),
70
- status: SmartLinkStatus.Forbidden,
72
+ }))), /*#__PURE__*/React.createElement(CustomBlock, _extends({
73
+ testId: "".concat(testId, "-content")
74
+ }, fg('platform-linking-flexible-card-context') ? undefined : {
75
+ status: SmartLinkStatus.Forbidden
76
+ }, {
71
77
  className: ax([fg('platform-linking-visual-refresh-v1') ? "_11c8dcr7 _1e0c1nu9 _1bah1h6o _19pkze3t _y3gn1h6o" : "_11c8dcr7 _1e0c1nu9 _1bah1h6o _19pkze3t _y3gn1h6o"])
72
- }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
78
+ }), /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[descriptiveMessageKey], {
73
79
  values: {
74
80
  product: product,
75
81
  hostname: hostname
76
82
  }
77
- }))), action && /*#__PURE__*/React.createElement(CustomBlock, {
78
- status: SmartLinkStatus.Forbidden,
83
+ }))), action && /*#__PURE__*/React.createElement(CustomBlock, _extends({}, fg('platform-linking-flexible-card-context') ? undefined : {
84
+ status: SmartLinkStatus.Forbidden
85
+ }, {
79
86
  className: ax([fg('platform-linking-visual-refresh-v1') ? "_1bah1h6o _19pku2gc" : "_1bah1h6o _19pku2gc"])
80
- }, /*#__PURE__*/React.createElement(ButtonComponent, {
87
+ }), /*#__PURE__*/React.createElement(ButtonComponent, {
81
88
  testId: "".concat(testId, "-button"),
82
89
  onClick: action === null || action === void 0 ? void 0 : action.promise,
83
90
  appearance: "primary",
@@ -64,33 +64,41 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
64
64
  fallbackElementHeight: snippetHeight.current,
65
65
  response: cardState.details
66
66
  });
67
- var snippet = imagePreview ? null : /*#__PURE__*/React.createElement(SnippetBlock, {
68
- status: SmartLinkStatus.Resolved,
67
+ var snippet = imagePreview ? null : /*#__PURE__*/React.createElement(SnippetBlock, _extends({}, fg('platform-linking-flexible-card-context') ? undefined : {
68
+ status: SmartLinkStatus.Resolved
69
+ }, {
69
70
  className: ax([fg('platform-linking-visual-refresh-v1') && "_ca0q1b66"])
70
- });
71
+ }));
71
72
  var aiSummaryMinHeight = snippet ? snippetHeight.current : 0;
72
73
  return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
73
- metadataPosition: SmartLinkPosition.Top,
74
- status: SmartLinkStatus.Resolved,
74
+ metadataPosition: SmartLinkPosition.Top
75
+ }, fg('platform-linking-flexible-card-context') ? undefined : {
76
+ status: SmartLinkStatus.Resolved
77
+ }, {
75
78
  className: ax([fg('platform-linking-visual-refresh-v1') ? "_zulpu2gc _quenze3t _oebj1txw _13mh1pd9" : "_zulpu2gc _quenui7n _oebj1txw _x7z0u2gc _1ljqu2gc _13mh1pd9"])
76
- })), /*#__PURE__*/React.createElement(MetadataBlock, {
79
+ })), /*#__PURE__*/React.createElement(MetadataBlock, _extends({
77
80
  primary: primary,
78
81
  secondary: secondary,
79
82
  maxLines: 1,
80
- size: SmartLinkSize.Medium,
81
- status: SmartLinkStatus.Resolved,
83
+ size: SmartLinkSize.Medium
84
+ }, fg('platform-linking-flexible-card-context') ? undefined : {
85
+ status: SmartLinkStatus.Resolved
86
+ }, {
82
87
  className: ax([!fg('platform-linking-visual-refresh-v1') && "_zulpidpf _2aco1o8v _fmt31ohn _yklxcxkx _w3mucxkx _ia0l11wp _3tmpcxkx"])
83
- }), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
88
+ })), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, _extends({
84
89
  aiSummaryMinHeight: aiSummaryMinHeight,
85
- placeholder: snippet,
90
+ placeholder: snippet
91
+ }, fg('platform-linking-flexible-card-context') ? undefined : {
86
92
  status: SmartLinkStatus.Resolved
87
- }) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
93
+ })) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, _extends({
88
94
  testId: "hidden-snippet",
89
95
  onRender: onSnippetRender,
90
- blockRef: snippetBlockRef,
91
- status: SmartLinkStatus.Resolved,
96
+ blockRef: snippetBlockRef
97
+ }, fg('platform-linking-flexible-card-context') ? undefined : {
98
+ status: SmartLinkStatus.Resolved
99
+ }, {
92
100
  className: ax(["_3um015vq _kqswstnw"])
93
- }), /*#__PURE__*/React.createElement(ActionBlock, {
101
+ })), /*#__PURE__*/React.createElement(ActionBlock, {
94
102
  onClick: onActionClick,
95
103
  spaceInline: "space.100",
96
104
  className: ax([fg('platform-linking-visual-refresh-v1') && "_n3td1b66"])
@@ -2,10 +2,22 @@ import { layers } from '@atlaskit/theme/constants';
2
2
  import { SmartLinkSize } from '../../constants';
3
3
  // Temporary fix for Confluence inline comment on editor mod has z-index of 500, Jira issue view has z-index of 510
4
4
  export var HOVER_CARD_Z_INDEX = layers.modal();
5
+
6
+ /**
7
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
8
+ */
9
+ export var flexibleUiOptionsOld = {
10
+ hideBackground: true,
11
+ hideElevation: true,
12
+ hideLegacyButton: true,
13
+ size: SmartLinkSize.Medium,
14
+ zIndex: HOVER_CARD_Z_INDEX + 1
15
+ };
5
16
  export var flexibleUiOptions = {
6
17
  hideBackground: true,
7
18
  hideElevation: true,
8
19
  hideLegacyButton: true,
20
+ removeBlockRestriction: true,
9
21
  size: SmartLinkSize.Medium,
10
22
  zIndex: HOVER_CARD_Z_INDEX + 1
11
23
  };
@@ -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.5.1",
16
+ packageVersion: "38.5.3",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');
@@ -0,0 +1,4 @@
1
+ import { type SmartLinkResponse } from '@atlaskit/linking-types';
2
+ import { LinkTitle } from '../../state/flexible-ui-context/types';
3
+ declare const extractLinkTitle: (status?: string, propUrl?: string, response?: SmartLinkResponse, onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>) => LinkTitle | undefined;
4
+ export default extractLinkTitle;
@@ -1,4 +1,4 @@
1
1
  import { type FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
2
2
  import { type ExtractFlexibleUiDataContextParams } from '../../view/FlexibleCard/types';
3
- declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, origin, renderers, resolve, actionOptions, response, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
3
+ declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, onClick, origin, renderers, resolve, actionOptions, response, status, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
4
4
  export default extractFlexibleUiContext;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type LinkPerson } from '@atlaskit/link-extractors';
2
3
  import { type ActionName, type IconType, type InternalActionName, type MediaType } from '../../constants';
3
4
  import { type LinkLozenge } from '../../extractors/common/lozenge/types';
@@ -122,6 +123,10 @@ export type FlexibleUiDataContext = {
122
123
  * @see LinkIcon
123
124
  */
124
125
  linkIcon?: Icon;
126
+ /**
127
+ * Contains the link text and url
128
+ */
129
+ linkTitle?: LinkTitle;
125
130
  /**
126
131
  * Contains the name of the entity that last modified the resource.
127
132
  * @type string
@@ -212,6 +217,7 @@ export type FlexibleUiDataContext = {
212
217
  * Contains the Title of the linked resource.
213
218
  * @type string
214
219
  * @see Title
220
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
215
221
  */
216
222
  title?: string;
217
223
  /**
@@ -246,6 +252,11 @@ export type FlexibleUiDataContext = {
246
252
  tenantId?: string;
247
253
  };
248
254
  };
255
+ export type LinkTitle = {
256
+ onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
257
+ text?: string;
258
+ url?: string;
259
+ };
249
260
  export type Icon = {
250
261
  icon?: IconType;
251
262
  label?: string;
@@ -6,6 +6,7 @@ export declare const getByDefinitionId: (definitionId: string | undefined, store
6
6
  export declare const getClickUrl: (url: string, jsonLd?: JsonLd.Response) => string;
7
7
  export declare const getDefinitionId: (details?: JsonLd.Response) => string | undefined;
8
8
  export declare const getExtensionKey: (details?: JsonLd.Response) => string | undefined;
9
+ export declare const getObjectAri: (details?: JsonLd.Response) => string | undefined;
9
10
  export declare const getResourceType: (details?: JsonLd.Response) => string | undefined;
10
11
  export declare const getProduct: (details?: JsonLd.Response) => DestinationProduct | string | undefined;
11
12
  export declare const getSubproduct: (details?: JsonLd.Response) => DestinationSubproduct | string | undefined;
@@ -10,4 +10,6 @@ export declare function useSmartLink(id: string, url: string): {
10
10
  config: import("@atlaskit/link-provider").CardAuthFlowOpts | undefined;
11
11
  renderers: import("@atlaskit/link-provider").CardProviderRenderers | undefined;
12
12
  error: Error | null;
13
+ isGlancePanelAvailable: ((props: import("packages/linking-platform/link-provider/dist/types/state/context/types").GlancePanelProps) => boolean) | undefined;
14
+ openGlancePanel: ((props: import("packages/linking-platform/link-provider/dist/types/state/context/types").GlancePanelProps) => void) | undefined;
13
15
  };
@@ -1,7 +1,7 @@
1
1
  export type DestinationProduct = 'jira' | 'confluence' | 'bitbucket' | 'trello';
2
2
  export type DestinationSubproduct = 'core' | 'software' | 'servicedesk';
3
3
  export type ClickType = 'left' | 'middle' | 'right' | 'keyboard' | 'none';
4
- export type ClickOutcome = 'prevented' | 'clickThrough' | 'clickThroughNewTabOrWindow' | 'contextMenu' | 'alt' | 'contentEditable' | 'unknown';
4
+ export type ClickOutcome = 'prevented' | 'clickThrough' | 'clickThroughNewTabOrWindow' | 'contextMenu' | 'alt' | 'contentEditable' | 'glancePanel' | 'unknown';
5
5
  export type UiLinkClickedEventProps = {
6
6
  /**
7
7
  * Whether the click occurred with the left, middle or right mouse button
@@ -9,6 +9,10 @@ type SimulatedMetadata = {
9
9
  topMetadata: ElementItem[];
10
10
  bottomMetadata?: ElementItem[];
11
11
  };
12
+ /**
13
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
14
+ */
15
+ export declare const FlexibleCardUiOptionsOld: InternalFlexibleUiOptions;
12
16
  export declare const FlexibleCardUiOptions: InternalFlexibleUiOptions;
13
17
  export declare const titleBlockOptions: Partial<TitleBlockProps>;
14
18
  export declare const PreviewBlockOptions: Partial<PreviewBlockProps>;
@@ -7,5 +7,5 @@ import { type BlockProps } from '../types';
7
7
  * @param {ActionGroupProps} ActionGroupProps
8
8
  * @see Action
9
9
  */
10
- declare const Block: ({ children, direction, size, testId, className, blockRef, onRender, onTransitionEnd, style, }: BlockProps) => JSX.Element;
10
+ declare const Block: ({ children, direction, size, testId, className, blockRef, onRender, onTransitionEnd, style, placeholderId, }: BlockProps) => JSX.Element;
11
11
  export default Block;
@@ -12,5 +12,5 @@ import { type TitleBlockProps } from './types';
12
12
  * @see TitleBlockResolvedViewNew
13
13
  * @see TitleBlockErroredViewNew
14
14
  */
15
- declare const TitleBlock: ({ actions, anchorTarget, hideTitleTooltip, maxLines, onActionMenuOpenChange, onClick, status, showActionOnHover, testId, text, icon, theme, hideRetry, metadataPosition, hideIcon, className, anchorRef, ...props }: TitleBlockProps) => JSX.Element;
15
+ declare const TitleBlock: ({ actions, anchorTarget, hideTitleTooltip, maxLines, onActionMenuOpenChange, onClick, status: statusProp, showActionOnHover, testId, text, icon, theme, hideRetry, metadataPosition, hideIcon, className, anchorRef, ...props }: TitleBlockProps) => JSX.Element;
16
16
  export default TitleBlock;
@@ -48,6 +48,7 @@ export type TitleBlockProps = {
48
48
  /**
49
49
  * Determines the onClick behaviour of the Link. By default used for analytics.
50
50
  * @internal
51
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
51
52
  */
52
53
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
53
54
  /**
@@ -88,6 +89,7 @@ export type TitleBlockProps = {
88
89
  /**
89
90
  * The theme of the link text. Can be Black or Link (default URL blue)
90
91
  * @internal
92
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
91
93
  */
92
94
  theme?: SmartLinkTheme;
93
95
  /**
@@ -103,6 +105,10 @@ export type TitleBlockProps = {
103
105
  * Ref passed into the link <a> element
104
106
  */
105
107
  anchorRef?: React.Ref<HTMLAnchorElement>;
108
+ /**
109
+ * A unique identifier for the placeholder loading state, which is constant across all loading states of the same item.
110
+ */
111
+ placeholderId?: string;
106
112
  } & BlockProps;
107
113
  export type TitleBlockViewProps = TitleBlockProps & {
108
114
  actionGroup?: React.ReactNode;
@@ -29,6 +29,7 @@ export type BlockProps = {
29
29
  * The status of the Smart Link. Used to conditionally render different blocks
30
30
  * when Smart Link is in different states.
31
31
  * @internal
32
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
32
33
  */
33
34
  status?: SmartLinkStatus;
34
35
  /**
@@ -51,6 +52,10 @@ export type BlockProps = {
51
52
  * @internal
52
53
  */
53
54
  onTransitionEnd?: () => void;
55
+ /**
56
+ * A unique identifier for the placeholder loading state, which is constant across all loading states of the same item.
57
+ */
58
+ placeholderId?: string;
54
59
  };
55
60
  /**
56
61
  * Used to represent a metadata element to be rendered.
@@ -43,7 +43,7 @@ export type BaseIconElementProps = ElementProps & {
43
43
  */
44
44
  declare const IconElement: ({ icon, overrideIcon, label, name, position, className, render, size, testId, url, appearance, }: BaseIconElementProps) => JSX.Element;
45
45
  export default IconElement;
46
- export declare const toLinkIconProps: (data: FlexibleUiDataContext[keyof FlexibleUiDataContext] | undefined, type: FlexibleUiDataContext['type']) => string[] | import("../../../../../../state/flexible-ui-context/types").LinkLocation | import("../../../../../../state/flexible-ui-context/types").Media | import("../../../../../../state/flexible-ui-context/types").FlexibleUiActions | import("../../../../../../state/flexible-ui-context/types").PreviewActionData | import("../../../../../../extractors/common/lozenge/types").LinkLozenge | import("@atlaskit/link-extractors").LinkPerson[] | {
46
+ export declare const toLinkIconProps: (data: FlexibleUiDataContext[keyof FlexibleUiDataContext] | undefined, type: FlexibleUiDataContext['type']) => string[] | import("../../../../../../state/flexible-ui-context/types").LinkTitle | import("../../../../../../state/flexible-ui-context/types").LinkLocation | import("../../../../../../state/flexible-ui-context/types").Media | import("../../../../../../state/flexible-ui-context/types").FlexibleUiActions | import("../../../../../../state/flexible-ui-context/types").PreviewActionData | import("../../../../../../extractors/common/lozenge/types").LinkLozenge | import("@atlaskit/link-extractors").LinkPerson[] | {
47
47
  objectId?: string | undefined;
48
48
  resourceType?: string | undefined;
49
49
  tenantId?: string | undefined;
@@ -148,7 +148,7 @@ export type RetryOptions = {
148
148
  */
149
149
  values?: Record<string, string>;
150
150
  };
151
- export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'onAuthorize' | 'renderers' | 'url'> & {
151
+ export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'onAuthorize' | 'onClick' | 'renderers' | 'url'> & {
152
152
  fireEvent?: FireEventFunction;
153
153
  status?: SmartLinkStatus;
154
154
  response?: SmartLinkResponse;
@@ -1,5 +1,9 @@
1
1
  import { type InternalFlexibleUiOptions } from '../FlexibleCard/types';
2
2
  export declare const HOVER_CARD_Z_INDEX: 510;
3
+ /**
4
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
5
+ */
6
+ export declare const flexibleUiOptionsOld: InternalFlexibleUiOptions;
3
7
  export declare const flexibleUiOptions: InternalFlexibleUiOptions;
4
8
  export declare const CARD_WIDTH_REM = 24;
5
9
  export declare const CARD_GAP_PX = 10;
@@ -0,0 +1,4 @@
1
+ import { type SmartLinkResponse } from '@atlaskit/linking-types';
2
+ import { LinkTitle } from '../../state/flexible-ui-context/types';
3
+ declare const extractLinkTitle: (status?: string, propUrl?: string, response?: SmartLinkResponse, onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>) => LinkTitle | undefined;
4
+ export default extractLinkTitle;
@@ -1,4 +1,4 @@
1
1
  import { type FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
2
2
  import { type ExtractFlexibleUiDataContextParams } from '../../view/FlexibleCard/types';
3
- declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, origin, renderers, resolve, actionOptions, response, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
3
+ declare const extractFlexibleUiContext: ({ appearance, fireEvent, id, onClick, origin, renderers, resolve, actionOptions, response, status, aiSummaryConfig, ...props }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
4
4
  export default extractFlexibleUiContext;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { type LinkPerson } from '@atlaskit/link-extractors';
2
3
  import { type ActionName, type IconType, type InternalActionName, type MediaType } from '../../constants';
3
4
  import { type LinkLozenge } from '../../extractors/common/lozenge/types';
@@ -122,6 +123,10 @@ export type FlexibleUiDataContext = {
122
123
  * @see LinkIcon
123
124
  */
124
125
  linkIcon?: Icon;
126
+ /**
127
+ * Contains the link text and url
128
+ */
129
+ linkTitle?: LinkTitle;
125
130
  /**
126
131
  * Contains the name of the entity that last modified the resource.
127
132
  * @type string
@@ -212,6 +217,7 @@ export type FlexibleUiDataContext = {
212
217
  * Contains the Title of the linked resource.
213
218
  * @type string
214
219
  * @see Title
220
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
215
221
  */
216
222
  title?: string;
217
223
  /**
@@ -246,6 +252,11 @@ export type FlexibleUiDataContext = {
246
252
  tenantId?: string;
247
253
  };
248
254
  };
255
+ export type LinkTitle = {
256
+ onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
257
+ text?: string;
258
+ url?: string;
259
+ };
249
260
  export type Icon = {
250
261
  icon?: IconType;
251
262
  label?: string;
@@ -6,6 +6,7 @@ export declare const getByDefinitionId: (definitionId: string | undefined, store
6
6
  export declare const getClickUrl: (url: string, jsonLd?: JsonLd.Response) => string;
7
7
  export declare const getDefinitionId: (details?: JsonLd.Response) => string | undefined;
8
8
  export declare const getExtensionKey: (details?: JsonLd.Response) => string | undefined;
9
+ export declare const getObjectAri: (details?: JsonLd.Response) => string | undefined;
9
10
  export declare const getResourceType: (details?: JsonLd.Response) => string | undefined;
10
11
  export declare const getProduct: (details?: JsonLd.Response) => DestinationProduct | string | undefined;
11
12
  export declare const getSubproduct: (details?: JsonLd.Response) => DestinationSubproduct | string | undefined;
@@ -10,4 +10,6 @@ export declare function useSmartLink(id: string, url: string): {
10
10
  config: import("@atlaskit/link-provider").CardAuthFlowOpts | undefined;
11
11
  renderers: import("@atlaskit/link-provider").CardProviderRenderers | undefined;
12
12
  error: Error | null;
13
+ isGlancePanelAvailable: ((props: import("packages/linking-platform/link-provider/dist/types/state/context/types").GlancePanelProps) => boolean) | undefined;
14
+ openGlancePanel: ((props: import("packages/linking-platform/link-provider/dist/types/state/context/types").GlancePanelProps) => void) | undefined;
13
15
  };
@@ -1,7 +1,7 @@
1
1
  export type DestinationProduct = 'jira' | 'confluence' | 'bitbucket' | 'trello';
2
2
  export type DestinationSubproduct = 'core' | 'software' | 'servicedesk';
3
3
  export type ClickType = 'left' | 'middle' | 'right' | 'keyboard' | 'none';
4
- export type ClickOutcome = 'prevented' | 'clickThrough' | 'clickThroughNewTabOrWindow' | 'contextMenu' | 'alt' | 'contentEditable' | 'unknown';
4
+ export type ClickOutcome = 'prevented' | 'clickThrough' | 'clickThroughNewTabOrWindow' | 'contextMenu' | 'alt' | 'contentEditable' | 'glancePanel' | 'unknown';
5
5
  export type UiLinkClickedEventProps = {
6
6
  /**
7
7
  * Whether the click occurred with the left, middle or right mouse button
@@ -9,6 +9,10 @@ type SimulatedMetadata = {
9
9
  topMetadata: ElementItem[];
10
10
  bottomMetadata?: ElementItem[];
11
11
  };
12
+ /**
13
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
14
+ */
15
+ export declare const FlexibleCardUiOptionsOld: InternalFlexibleUiOptions;
12
16
  export declare const FlexibleCardUiOptions: InternalFlexibleUiOptions;
13
17
  export declare const titleBlockOptions: Partial<TitleBlockProps>;
14
18
  export declare const PreviewBlockOptions: Partial<PreviewBlockProps>;
@@ -7,5 +7,5 @@ import { type BlockProps } from '../types';
7
7
  * @param {ActionGroupProps} ActionGroupProps
8
8
  * @see Action
9
9
  */
10
- declare const Block: ({ children, direction, size, testId, className, blockRef, onRender, onTransitionEnd, style, }: BlockProps) => JSX.Element;
10
+ declare const Block: ({ children, direction, size, testId, className, blockRef, onRender, onTransitionEnd, style, placeholderId, }: BlockProps) => JSX.Element;
11
11
  export default Block;
@@ -12,5 +12,5 @@ import { type TitleBlockProps } from './types';
12
12
  * @see TitleBlockResolvedViewNew
13
13
  * @see TitleBlockErroredViewNew
14
14
  */
15
- declare const TitleBlock: ({ actions, anchorTarget, hideTitleTooltip, maxLines, onActionMenuOpenChange, onClick, status, showActionOnHover, testId, text, icon, theme, hideRetry, metadataPosition, hideIcon, className, anchorRef, ...props }: TitleBlockProps) => JSX.Element;
15
+ declare const TitleBlock: ({ actions, anchorTarget, hideTitleTooltip, maxLines, onActionMenuOpenChange, onClick, status: statusProp, showActionOnHover, testId, text, icon, theme, hideRetry, metadataPosition, hideIcon, className, anchorRef, ...props }: TitleBlockProps) => JSX.Element;
16
16
  export default TitleBlock;
@@ -48,6 +48,7 @@ export type TitleBlockProps = {
48
48
  /**
49
49
  * Determines the onClick behaviour of the Link. By default used for analytics.
50
50
  * @internal
51
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
51
52
  */
52
53
  onClick?: React.EventHandler<React.MouseEvent | React.KeyboardEvent>;
53
54
  /**
@@ -88,6 +89,7 @@ export type TitleBlockProps = {
88
89
  /**
89
90
  * The theme of the link text. Can be Black or Link (default URL blue)
90
91
  * @internal
92
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
91
93
  */
92
94
  theme?: SmartLinkTheme;
93
95
  /**
@@ -103,6 +105,10 @@ export type TitleBlockProps = {
103
105
  * Ref passed into the link <a> element
104
106
  */
105
107
  anchorRef?: React.Ref<HTMLAnchorElement>;
108
+ /**
109
+ * A unique identifier for the placeholder loading state, which is constant across all loading states of the same item.
110
+ */
111
+ placeholderId?: string;
106
112
  } & BlockProps;
107
113
  export type TitleBlockViewProps = TitleBlockProps & {
108
114
  actionGroup?: React.ReactNode;
@@ -29,6 +29,7 @@ export type BlockProps = {
29
29
  * The status of the Smart Link. Used to conditionally render different blocks
30
30
  * when Smart Link is in different states.
31
31
  * @internal
32
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
32
33
  */
33
34
  status?: SmartLinkStatus;
34
35
  /**
@@ -51,6 +52,10 @@ export type BlockProps = {
51
52
  * @internal
52
53
  */
53
54
  onTransitionEnd?: () => void;
55
+ /**
56
+ * A unique identifier for the placeholder loading state, which is constant across all loading states of the same item.
57
+ */
58
+ placeholderId?: string;
54
59
  };
55
60
  /**
56
61
  * Used to represent a metadata element to be rendered.
@@ -43,7 +43,7 @@ export type BaseIconElementProps = ElementProps & {
43
43
  */
44
44
  declare const IconElement: ({ icon, overrideIcon, label, name, position, className, render, size, testId, url, appearance, }: BaseIconElementProps) => JSX.Element;
45
45
  export default IconElement;
46
- export declare const toLinkIconProps: (data: FlexibleUiDataContext[keyof FlexibleUiDataContext] | undefined, type: FlexibleUiDataContext['type']) => string[] | import("../../../../../../state/flexible-ui-context/types").LinkLocation | import("../../../../../../state/flexible-ui-context/types").Media | import("../../../../../../state/flexible-ui-context/types").FlexibleUiActions | import("../../../../../../state/flexible-ui-context/types").PreviewActionData | import("../../../../../../extractors/common/lozenge/types").LinkLozenge | import("@atlaskit/link-extractors").LinkPerson[] | {
46
+ export declare const toLinkIconProps: (data: FlexibleUiDataContext[keyof FlexibleUiDataContext] | undefined, type: FlexibleUiDataContext['type']) => string[] | import("../../../../../../state/flexible-ui-context/types").LinkTitle | import("../../../../../../state/flexible-ui-context/types").LinkLocation | import("../../../../../../state/flexible-ui-context/types").Media | import("../../../../../../state/flexible-ui-context/types").FlexibleUiActions | import("../../../../../../state/flexible-ui-context/types").PreviewActionData | import("../../../../../../extractors/common/lozenge/types").LinkLozenge | import("@atlaskit/link-extractors").LinkPerson[] | {
47
47
  objectId?: string | undefined;
48
48
  resourceType?: string | undefined;
49
49
  tenantId?: string | undefined;
@@ -148,7 +148,7 @@ export type RetryOptions = {
148
148
  */
149
149
  values?: Record<string, string>;
150
150
  };
151
- export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'onAuthorize' | 'renderers' | 'url'> & {
151
+ export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'onAuthorize' | 'onClick' | 'renderers' | 'url'> & {
152
152
  fireEvent?: FireEventFunction;
153
153
  status?: SmartLinkStatus;
154
154
  response?: SmartLinkResponse;
@@ -1,5 +1,9 @@
1
1
  import { type InternalFlexibleUiOptions } from '../FlexibleCard/types';
2
2
  export declare const HOVER_CARD_Z_INDEX: 510;
3
+ /**
4
+ * @deprecated Remove on platform-linking-flexible-card-context cleanup
5
+ */
6
+ export declare const flexibleUiOptionsOld: InternalFlexibleUiOptions;
3
7
  export declare const flexibleUiOptions: InternalFlexibleUiOptions;
4
8
  export declare const CARD_WIDTH_REM = 24;
5
9
  export declare const CARD_GAP_PX = 10;