@atlaskit/smart-card 36.12.0 → 36.13.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 (63) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/dist/cjs/constants.js +1 -0
  3. package/dist/cjs/index.js +6 -0
  4. package/dist/cjs/utils/analytics/analytics.js +1 -1
  5. package/dist/cjs/view/FlexibleCard/components/actions/index.js +7 -0
  6. package/dist/cjs/view/FlexibleCard/components/actions/unresolved-action/index.compiled.css +3 -0
  7. package/dist/cjs/view/FlexibleCard/components/actions/unresolved-action/index.js +51 -0
  8. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.compiled.css +9 -3
  9. package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +2 -3
  10. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +15 -2
  11. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +9 -3
  12. package/dist/cjs/view/FlexibleCard/components/container/index.js +6 -7
  13. package/dist/cjs/view/FlexibleCard/external.js +4 -1
  14. package/dist/cjs/view/FlexibleCard/index.js +4 -2
  15. package/dist/cjs/view/FlexibleCard/utils.js +6 -2
  16. package/dist/cjs/view/LinkUrl/index.js +1 -1
  17. package/dist/es2019/constants.js +1 -0
  18. package/dist/es2019/index.js +1 -1
  19. package/dist/es2019/utils/analytics/analytics.js +1 -1
  20. package/dist/es2019/view/FlexibleCard/components/actions/index.js +1 -0
  21. package/dist/es2019/view/FlexibleCard/components/actions/unresolved-action/index.compiled.css +3 -0
  22. package/dist/es2019/view/FlexibleCard/components/actions/unresolved-action/index.js +46 -0
  23. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.compiled.css +7 -2
  24. package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +1 -1
  25. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +15 -2
  26. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/index.js +9 -3
  27. package/dist/es2019/view/FlexibleCard/components/container/index.js +4 -2
  28. package/dist/es2019/view/FlexibleCard/external.js +3 -2
  29. package/dist/es2019/view/FlexibleCard/index.js +4 -2
  30. package/dist/es2019/view/FlexibleCard/utils.js +8 -3
  31. package/dist/es2019/view/LinkUrl/index.js +1 -1
  32. package/dist/esm/constants.js +1 -0
  33. package/dist/esm/index.js +1 -1
  34. package/dist/esm/utils/analytics/analytics.js +1 -1
  35. package/dist/esm/view/FlexibleCard/components/actions/index.js +1 -0
  36. package/dist/esm/view/FlexibleCard/components/actions/unresolved-action/index.compiled.css +3 -0
  37. package/dist/esm/view/FlexibleCard/components/actions/unresolved-action/index.js +44 -0
  38. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.compiled.css +9 -3
  39. package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/feature-discovery/index.js +2 -3
  40. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +16 -3
  41. package/dist/esm/view/FlexibleCard/components/blocks/title-block/index.js +9 -3
  42. package/dist/esm/view/FlexibleCard/components/container/index.js +5 -4
  43. package/dist/esm/view/FlexibleCard/external.js +4 -1
  44. package/dist/esm/view/FlexibleCard/index.js +4 -2
  45. package/dist/esm/view/FlexibleCard/utils.js +7 -3
  46. package/dist/esm/view/LinkUrl/index.js +1 -1
  47. package/dist/types/constants.d.ts +1 -0
  48. package/dist/types/index.d.ts +1 -1
  49. package/dist/types/state/flexible-ui-context/types.d.ts +3 -0
  50. package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
  51. package/dist/types/view/FlexibleCard/components/actions/unresolved-action/index.d.ts +5 -0
  52. package/dist/types/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
  53. package/dist/types/view/FlexibleCard/external.d.ts +1 -0
  54. package/dist/types/view/FlexibleCard/types.d.ts +1 -1
  55. package/dist/types-ts4.5/constants.d.ts +1 -0
  56. package/dist/types-ts4.5/index.d.ts +1 -1
  57. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +3 -0
  58. package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
  59. package/dist/types-ts4.5/view/FlexibleCard/components/actions/unresolved-action/index.d.ts +5 -0
  60. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/title-block/errored/index.d.ts +1 -1
  61. package/dist/types-ts4.5/view/FlexibleCard/external.d.ts +1 -0
  62. package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +1 -1
  63. package/package.json +6 -3
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useEffect, useMemo } from 'react';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
4
5
  import { SmartLinkStatus } from '../../constants';
5
6
  import { FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
@@ -48,14 +49,15 @@ const FlexibleCard = ({
48
49
  fireEvent,
49
50
  response: details,
50
51
  id,
52
+ onAuthorize,
51
53
  origin,
52
54
  renderers,
53
55
  resolve,
54
56
  actionOptions,
55
57
  status,
56
58
  url
57
- }), [aiSummaryConfig, appearance, details, fireEvent, id, origin, renderers, actionOptions, resolve, status, url]);
58
- const retry = getRetryOptions(url, status, details, onAuthorize);
59
+ }), [aiSummaryConfig, appearance, details, fireEvent, id, onAuthorize, origin, renderers, actionOptions, resolve, status, url]);
60
+ const retry = fg('platform-linking-flexible-card-unresolved-action') ? undefined : getRetryOptions(url, status, details, onAuthorize);
59
61
  const {
60
62
  title
61
63
  } = context || {};
@@ -1,6 +1,6 @@
1
1
  import { extractProvider, extractSmartLinkProvider, isEntityPresent } from '@atlaskit/link-extractors';
2
2
  import { fg } from '@atlaskit/platform-feature-flags';
3
- import { SmartLinkStatus } from '../../constants';
3
+ import { InternalActionName, SmartLinkStatus } from '../../constants';
4
4
  import { extractRequestAccessContextImproved } from '../../extractors/common/context';
5
5
  import extractFlexibleUiContext from '../../extractors/flexible';
6
6
  import extractPreview, { extractSmartLinkPreviewImage } from '../../extractors/flexible/extract-preview';
@@ -30,6 +30,9 @@ export const getContextByStatus = params => {
30
30
  case SmartLinkStatus.Errored:
31
31
  case SmartLinkStatus.Fallback:
32
32
  default:
33
+ const actions = fg('platform-linking-flexible-card-unresolved-action') ? {
34
+ [InternalActionName.UnresolvedAction]: getRetryOptions(url, status, response, params.onAuthorize)
35
+ } : undefined;
33
36
  if (fg('smart_links_noun_support')) {
34
37
  if (isEntityPresent(response)) {
35
38
  return {
@@ -37,7 +40,8 @@ export const getContextByStatus = params => {
37
40
  title: url,
38
41
  linkIcon: extractErrorIcon(response, status),
39
42
  preview: extractSmartLinkPreviewImage(response),
40
- provider: extractSmartLinkProviderIcon(response)
43
+ provider: extractSmartLinkProviderIcon(response),
44
+ actions
41
45
  };
42
46
  }
43
47
  }
@@ -46,7 +50,8 @@ export const getContextByStatus = params => {
46
50
  title: url,
47
51
  linkIcon: extractErrorIcon(response, status),
48
52
  preview: extractPreview(response === null || response === void 0 ? void 0 : response.data),
49
- provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data)
53
+ provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data),
54
+ actions
50
55
  };
51
56
  }
52
57
  };
@@ -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: "36.12.0",
13
+ packageVersion: "36.13.0",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  const Anchor = withLinkClickedEvent('a');
@@ -160,6 +160,7 @@ export var ActionName = /*#__PURE__*/function (ActionName) {
160
160
  }({});
161
161
  export var InternalActionName = /*#__PURE__*/function (InternalActionName) {
162
162
  InternalActionName["AISummaryAction"] = "AISummaryAction";
163
+ InternalActionName["UnresolvedAction"] = "UnresolvedAction";
163
164
  InternalActionName["ViewRelatedLinksAction"] = "ViewRelatedLinksAction";
164
165
  return InternalActionName;
165
166
  }({});
package/dist/esm/index.js CHANGED
@@ -15,6 +15,6 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
15
15
  export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme } from './constants';
16
16
  export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock } from './view/FlexibleCard/components/blocks';
17
17
  export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement } from './view/FlexibleCard/external';
18
- export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction } from './view/FlexibleCard/external';
18
+ export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction } from './view/FlexibleCard/external';
19
19
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
20
20
  export { editorCardProvider, EditorCardProvider } from '@atlaskit/link-provider';
@@ -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: "36.12.0"
7
+ packageVersion: "36.13.0"
8
8
  };
9
9
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -5,6 +5,7 @@ export { default as DownloadAction } from './download-action';
5
5
  export { default as FollowAction } from './follow-action';
6
6
  export { default as PreviewAction } from './preview-action';
7
7
  export { default as CopyLinkAction } from './copy-link-action';
8
+ export { default as UnresolvedAction } from './unresolved-action';
8
9
  export { default as AISummaryAction } from './ai-summary-action';
9
10
  export { default as AutomationAction } from './automation-action';
10
11
  export { default as ViewRelatedLinksAction } from './view-related-links-action';
@@ -0,0 +1,3 @@
1
+ ._18zrze3t{padding-inline:var(--ds-space-0,0)}
2
+ ._1rjcze3t{padding-block:var(--ds-space-0,0)}
3
+ ._1e0c1bgi{display:contents}
@@ -0,0 +1,44 @@
1
+ /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
+ import _extends from "@babel/runtime/helpers/extends";
3
+ import "./index.compiled.css";
4
+ import { ax, ix } from "@compiled/react/runtime";
5
+ import React from 'react';
6
+ import { FormattedMessage } from 'react-intl-next';
7
+ import { Box, Pressable } from '@atlaskit/primitives/compiled';
8
+ import { InternalActionName } from '../../../../../constants';
9
+ import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
10
+ var styles = {
11
+ button: "_1e0c1bgi",
12
+ message: "_1rjcze3t _18zrze3t"
13
+ };
14
+ var UnresolvedAction = function UnresolvedAction(_ref) {
15
+ var _context$actions;
16
+ var _ref$testId = _ref.testId,
17
+ testId = _ref$testId === void 0 ? 'unresolved-action' : _ref$testId;
18
+ var context = useFlexibleUiContext();
19
+ var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction];
20
+ if (!data) {
21
+ return null;
22
+ }
23
+ var descriptor = data.descriptor,
24
+ onClick = data.onClick,
25
+ values = data.values;
26
+ var hasAction = onClick !== undefined;
27
+ var message = /*#__PURE__*/React.createElement(Box, {
28
+ testId: "".concat(testId, "-errored-view-message"),
29
+ tabIndex: hasAction ? 0 : undefined,
30
+ xcss: styles.message
31
+ }, /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, descriptor, {
32
+ values: values
33
+ })));
34
+ return hasAction ? /*#__PURE__*/React.createElement(Pressable, {
35
+ onClick: data.onClick,
36
+ style: {
37
+ color: "inherit",
38
+ font: "inherit",
39
+ textAlign: "inherit"
40
+ },
41
+ xcss: styles.button
42
+ }, message) : message;
43
+ };
44
+ export default UnresolvedAction;
@@ -1,4 +1,10 @@
1
1
 
2
- ._2rko1l7b{border-radius:3px}
3
- ._y44v1kew{animation:var(--_d0o24t)}._16qs10kv{box-shadow:var(--_zsb6fb)}
4
- ._1e0c116y{display:inline-flex}
2
+ ._2rko1l7b{border-radius:3px}._16qs10kv{box-shadow:var(--_zsb6fb)}
3
+ ._1e0c116y{display:inline-flex}
4
+ ._1o511hrf{animation-fill-mode:both}
5
+ ._1pgl1trn{animation-timing-function:cubic-bezier(.5,0,0,1)}
6
+ ._5sagymdr{animation-duration:2s}
7
+ ._j7hq8j16{animation-name:k1kh5krz}
8
+ ._ju251doz{animation-delay:.25s}
9
+ ._tip8cs5v{animation-iteration-count:2}
10
+ @keyframes k1kh5krz{to{box-shadow:0 0 0 7px transparent}}
@@ -51,10 +51,9 @@ var FeatureDiscovery = function FeatureDiscovery(_ref) {
51
51
  if (!discovered) {
52
52
  return /*#__PURE__*/React.createElement("span", {
53
53
  "data-testid": "".concat(testId, "-discovery"),
54
- className: ax(["_2rko1l7b _y44v1kew _1e0c116y _16qs10kv"]),
54
+ className: ax(["_2rko1l7b _1e0c116y _16qs10kv _j7hq8j16 _5sagymdr _1pgl1trn _ju251doz _1o511hrf _tip8cs5v"]),
55
55
  style: {
56
- "--_zsb6fb": ix("0 0 0 0 ".concat("var(--ds-border-discovery, #8270DB)")),
57
- "--_d0o24t": ix("".concat(pulseKeyframes, " 2s cubic-bezier(0.5, 0, 0, 1) 0.25s both 2"))
56
+ "--_zsb6fb": ix("0 0 0 0 ".concat("var(--ds-border-discovery, #8270DB)"))
58
57
  }
59
58
  }, children);
60
59
  }
@@ -1,10 +1,13 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
- var _excluded = ["actionGroup", "retry", "position", "testId", "title", "icon", "hideIcon"];
3
+ var _excluded = ["actionGroup", "hideRetry", "retry", "position", "testId", "title", "icon", "hideIcon"];
4
4
  import React from 'react';
5
5
  import { FormattedMessage } from 'react-intl-next';
6
+ import { fg } from '@atlaskit/platform-feature-flags';
6
7
  import { Box } from '@atlaskit/primitives/compiled';
7
- import { SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
8
+ import { InternalActionName, SmartLinkAlignment, SmartLinkDirection } from '../../../../../../constants';
9
+ import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
10
+ import { UnresolvedAction } from '../../../actions';
8
11
  import { LinkIcon } from '../../../elements';
9
12
  import Block from '../../block';
10
13
  import ElementGroup from '../../element-group';
@@ -16,7 +19,9 @@ import ElementGroup from '../../element-group';
16
19
  * @see TitleBlock
17
20
  */
18
21
  var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
22
+ var _context$actions;
19
23
  var actionGroup = _ref.actionGroup,
24
+ hideRetry = _ref.hideRetry,
20
25
  retry = _ref.retry,
21
26
  position = _ref.position,
22
27
  testId = _ref.testId,
@@ -29,12 +34,20 @@ var TitleBlockErroredView = function TitleBlockErroredView(_ref) {
29
34
  onClick = _ref2.onClick,
30
35
  values = _ref2.values;
31
36
  var hasAction = onClick !== undefined;
37
+ var context = fg('platform-linking-flexible-card-unresolved-action') ?
38
+ // eslint-disable-next-line react-hooks/rules-of-hooks
39
+ useFlexibleUiContext() : {};
40
+ var showRetry = fg('platform-linking-flexible-card-unresolved-action') ? !hideRetry && Boolean(context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.UnresolvedAction]) : false;
32
41
  return /*#__PURE__*/React.createElement(Block, _extends({}, blockProps, {
33
42
  testId: "".concat(testId, "-errored-view")
34
43
  }), !hideIcon && /*#__PURE__*/React.createElement(LinkIcon, {
35
44
  overrideIcon: icon,
36
45
  position: position
37
- }), title, descriptor && /*#__PURE__*/React.createElement(ElementGroup, {
46
+ }), title, showRetry && /*#__PURE__*/React.createElement(ElementGroup, {
47
+ align: SmartLinkAlignment.Right
48
+ }, /*#__PURE__*/React.createElement(UnresolvedAction, {
49
+ testId: testId
50
+ })), !fg('platform-linking-flexible-card-unresolved-action') && descriptor && /*#__PURE__*/React.createElement(ElementGroup, {
38
51
  direction: SmartLinkDirection.Horizontal,
39
52
  align: SmartLinkAlignment.Right
40
53
  }, /*#__PURE__*/React.createElement(Box, {
@@ -7,6 +7,7 @@ import "./index.compiled.css";
7
7
  import * as React from 'react';
8
8
  import { ax, ix } from "@compiled/react/runtime";
9
9
  import { useCallback, useState } from 'react';
10
+ import { fg } from '@atlaskit/platform-feature-flags';
10
11
  import { SmartLinkStatus } from '../../../../../constants';
11
12
  import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
12
13
  import { Title } from '../../elements';
@@ -66,8 +67,10 @@ var TitleBlock = function TitleBlock(_ref) {
66
67
  hideIcon = _ref$hideIcon === void 0 ? false : _ref$hideIcon,
67
68
  className = _ref.className,
68
69
  props = _objectWithoutProperties(_ref, _excluded);
69
- if (hideRetry && props.retry) {
70
- delete props.retry;
70
+ if (!fg('platform-linking-flexible-card-unresolved-action')) {
71
+ if (hideRetry && props.retry) {
72
+ delete props.retry;
73
+ }
71
74
  }
72
75
  var _useState = useState(false),
73
76
  _useState2 = _slicedToArray(_useState, 2),
@@ -107,7 +110,10 @@ var TitleBlock = function TitleBlock(_ref) {
107
110
  testId: testId,
108
111
  title: title,
109
112
  metadataPosition: metadataPosition,
110
- hideIcon: hideIcon,
113
+ hideIcon: hideIcon
114
+ }, fg('platform-linking-flexible-card-unresolved-action') ? {
115
+ hideRetry: hideRetry
116
+ } : undefined, {
111
117
  icon: icon,
112
118
  size: props.size,
113
119
  theme: theme
@@ -1,6 +1,6 @@
1
1
  /* index.tsx generated by @compiled/babel-plugin v0.36.1 */
2
- import _defineProperty from "@babel/runtime/helpers/defineProperty";
3
2
  import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
3
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
4
4
  var _excluded = ["containerSize"];
5
5
  import "./index.compiled.css";
6
6
  import { ax, ix } from "@compiled/react/runtime";
@@ -54,14 +54,15 @@ var renderChildren = function renderChildren(children, containerSize, containerT
54
54
  } else {
55
55
  var _blockSize = child.props.size;
56
56
  var _size = _blockSize || containerSize;
57
- return /*#__PURE__*/React.cloneElement(child, {
57
+ return /*#__PURE__*/React.cloneElement(child, _objectSpread({
58
58
  // @ts-expect-error
59
59
  onClick: onClick,
60
- retry: retry,
61
60
  size: _size,
62
61
  status: status,
63
62
  theme: containerTheme
64
- });
63
+ }, fg('platform-linking-flexible-card-unresolved-action') ? undefined : {
64
+ retry: retry
65
+ }));
65
66
  }
66
67
  }
67
68
  var blockSize = child.props.size;
@@ -8,7 +8,7 @@ import _extends from "@babel/runtime/helpers/extends";
8
8
  * DO NOT add a new prop to these components until we are ready to support it externally.
9
9
  */
10
10
  import React from 'react';
11
- import { CopyLinkAction as CopyLinkActionComponent, CustomAction as CustomActionComponent, DownloadAction as DownloadActionComponent, FollowAction as FollowActionComponent, PreviewAction as PreviewActionComponent } from './components/actions';
11
+ import { CopyLinkAction as CopyLinkActionComponent, CustomAction as CustomActionComponent, DownloadAction as DownloadActionComponent, FollowAction as FollowActionComponent, PreviewAction as PreviewActionComponent, UnresolvedAction as UnresolvedActionComponent } from './components/actions';
12
12
  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';
13
13
  // ---- EXPORTED METADATA COMPONENT ---- //
14
14
  export var AssignedToElement = function AssignedToElement() {
@@ -149,4 +149,7 @@ export var FollowAction = function FollowAction(props) {
149
149
  };
150
150
  export var PreviewAction = function PreviewAction(props) {
151
151
  return /*#__PURE__*/React.createElement(PreviewActionComponent, toActionProps(props));
152
+ };
153
+ export var UnresolvedAction = function UnresolvedAction() {
154
+ return /*#__PURE__*/React.createElement(UnresolvedActionComponent, null);
152
155
  };
@@ -1,5 +1,6 @@
1
1
  import _extends from "@babel/runtime/helpers/extends";
2
2
  import React, { useEffect, useMemo } from 'react';
3
+ import { fg } from '@atlaskit/platform-feature-flags';
3
4
  import { useAnalyticsEvents } from '../../common/analytics/generated/use-analytics-events';
4
5
  import { SmartLinkStatus } from '../../constants';
5
6
  import { FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
@@ -46,6 +47,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
46
47
  fireEvent: fireEvent,
47
48
  response: details,
48
49
  id: id,
50
+ onAuthorize: onAuthorize,
49
51
  origin: origin,
50
52
  renderers: renderers,
51
53
  resolve: resolve,
@@ -53,8 +55,8 @@ var FlexibleCard = function FlexibleCard(_ref) {
53
55
  status: status,
54
56
  url: url
55
57
  });
56
- }, [aiSummaryConfig, appearance, details, fireEvent, id, origin, renderers, actionOptions, resolve, status, url]);
57
- var retry = getRetryOptions(url, status, details, onAuthorize);
58
+ }, [aiSummaryConfig, appearance, details, fireEvent, id, onAuthorize, origin, renderers, actionOptions, resolve, status, url]);
59
+ var retry = fg('platform-linking-flexible-card-unresolved-action') ? undefined : getRetryOptions(url, status, details, onAuthorize);
58
60
  var _ref2 = context || {},
59
61
  title = _ref2.title;
60
62
  useEffect(function () {
@@ -1,6 +1,7 @@
1
+ import _defineProperty from "@babel/runtime/helpers/defineProperty";
1
2
  import { extractProvider, extractSmartLinkProvider, isEntityPresent } from '@atlaskit/link-extractors';
2
3
  import { fg } from '@atlaskit/platform-feature-flags';
3
- import { SmartLinkStatus } from '../../constants';
4
+ import { InternalActionName, SmartLinkStatus } from '../../constants';
4
5
  import { extractRequestAccessContextImproved } from '../../extractors/common/context';
5
6
  import extractFlexibleUiContext from '../../extractors/flexible';
6
7
  import extractPreview, { extractSmartLinkPreviewImage } from '../../extractors/flexible/extract-preview';
@@ -29,6 +30,7 @@ export var getContextByStatus = function getContextByStatus(params) {
29
30
  case SmartLinkStatus.Errored:
30
31
  case SmartLinkStatus.Fallback:
31
32
  default:
33
+ var actions = fg('platform-linking-flexible-card-unresolved-action') ? _defineProperty({}, InternalActionName.UnresolvedAction, getRetryOptions(url, status, response, params.onAuthorize)) : undefined;
32
34
  if (fg('smart_links_noun_support')) {
33
35
  if (isEntityPresent(response)) {
34
36
  return {
@@ -36,7 +38,8 @@ export var getContextByStatus = function getContextByStatus(params) {
36
38
  title: url,
37
39
  linkIcon: extractErrorIcon(response, status),
38
40
  preview: extractSmartLinkPreviewImage(response),
39
- provider: extractSmartLinkProviderIcon(response)
41
+ provider: extractSmartLinkProviderIcon(response),
42
+ actions: actions
40
43
  };
41
44
  }
42
45
  }
@@ -45,7 +48,8 @@ export var getContextByStatus = function getContextByStatus(params) {
45
48
  title: url,
46
49
  linkIcon: extractErrorIcon(response, status),
47
50
  preview: extractPreview(response === null || response === void 0 ? void 0 : response.data),
48
- provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data)
51
+ provider: extractProviderIcon(response === null || response === void 0 ? void 0 : response.data),
52
+ actions: actions
49
53
  };
50
54
  }
51
55
  };
@@ -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: "36.12.0",
16
+ packageVersion: "36.13.0",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');
@@ -139,6 +139,7 @@ export declare enum ActionName {
139
139
  }
140
140
  export declare enum InternalActionName {
141
141
  AISummaryAction = "AISummaryAction",
142
+ UnresolvedAction = "UnresolvedAction",
142
143
  ViewRelatedLinksAction = "ViewRelatedLinksAction"
143
144
  }
144
145
  export type FlexibleUiActionName = keyof typeof ActionName | keyof typeof InternalActionName;
@@ -11,7 +11,7 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
11
11
  export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, } from './constants';
12
12
  export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock, } from './view/FlexibleCard/components/blocks';
13
13
  export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement, } from './view/FlexibleCard/external';
14
- export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, } from './view/FlexibleCard/external';
14
+ export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, } from './view/FlexibleCard/external';
15
15
  export type { ActionItem, ElementItem, OnActionMenuOpenChangeOptions, } from './view/FlexibleCard/components/blocks/types';
16
16
  export type { AnalyticsAction, AnalyticsActionSubject, AnalyticsPayload, AnalyticsHandler, } from './utils/types';
17
17
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
@@ -1,6 +1,7 @@
1
1
  import { type LinkPerson } from '@atlaskit/link-extractors';
2
2
  import { type ActionName, type IconType, type InternalActionName, type MediaType } from '../../constants';
3
3
  import { type LinkLozenge } from '../../extractors/common/lozenge/types';
4
+ import { type RetryOptions } from '../../view/FlexibleCard/types';
4
5
  import { type InvokeClientActionProps } from '../hooks/use-invoke-client-action/types';
5
6
  import { type InvokeRequestWithCardDetails } from '../hooks/use-invoke/types';
6
7
  /**
@@ -257,6 +258,7 @@ export type FlexibleUiActions = {
257
258
  [ActionName.CopyLinkAction]?: CopyLinkActionData;
258
259
  [InternalActionName.AISummaryAction]?: AISummaryActionData;
259
260
  [ActionName.AutomationAction]?: AutomationActionData;
261
+ [InternalActionName.UnresolvedAction]?: UnresolvedActionData;
260
262
  [InternalActionName.ViewRelatedLinksAction]?: ViewRelatedLinksActionData;
261
263
  };
262
264
  export type PreviewActionData = {
@@ -281,6 +283,7 @@ export type AutomationActionData = {
281
283
  analyticsSource: string;
282
284
  objectName?: string;
283
285
  };
286
+ export type UnresolvedActionData = RetryOptions;
284
287
  export type ViewRelatedLinksActionData = {
285
288
  ari: string;
286
289
  };
@@ -5,6 +5,7 @@ export { default as DownloadAction } from './download-action';
5
5
  export { default as FollowAction } from './follow-action';
6
6
  export { default as PreviewAction } from './preview-action';
7
7
  export { default as CopyLinkAction } from './copy-link-action';
8
+ export { default as UnresolvedAction } from './unresolved-action';
8
9
  export { default as AISummaryAction } from './ai-summary-action';
9
10
  export { default as AutomationAction } from './automation-action';
10
11
  export { default as ViewRelatedLinksAction } from './view-related-links-action';
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const UnresolvedAction: ({ testId }: {
3
+ testId?: string | undefined;
4
+ }) => React.JSX.Element | null;
5
+ export default UnresolvedAction;
@@ -7,5 +7,5 @@ import { type TitleBlockViewProps } from '../types';
7
7
  * or the backend response was errored or malformed.
8
8
  * @see TitleBlock
9
9
  */
10
- declare const TitleBlockErroredView: ({ actionGroup, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
10
+ declare const TitleBlockErroredView: ({ actionGroup, hideRetry, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
11
11
  export default TitleBlockErroredView;
@@ -67,4 +67,5 @@ export type FollowActionProps = BaseActionProps;
67
67
  export declare const FollowAction: (props: FollowActionProps) => React.JSX.Element;
68
68
  export type PreviewActionProps = BaseActionProps;
69
69
  export declare const PreviewAction: (props: PreviewActionProps) => React.JSX.Element;
70
+ export declare const UnresolvedAction: () => React.JSX.Element;
70
71
  export {};
@@ -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' | 'renderers' | 'url'> & {
151
+ export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'onAuthorize' | 'renderers' | 'url'> & {
152
152
  fireEvent?: FireEventFunction;
153
153
  status?: SmartLinkStatus;
154
154
  response?: SmartLinkResponse;
@@ -139,6 +139,7 @@ export declare enum ActionName {
139
139
  }
140
140
  export declare enum InternalActionName {
141
141
  AISummaryAction = "AISummaryAction",
142
+ UnresolvedAction = "UnresolvedAction",
142
143
  ViewRelatedLinksAction = "ViewRelatedLinksAction"
143
144
  }
144
145
  export type FlexibleUiActionName = keyof typeof ActionName | keyof typeof InternalActionName;
@@ -11,7 +11,7 @@ export { loadingPlaceholderClassName } from './view/CardWithUrl/component-lazy/L
11
11
  export { ActionName, ElementName, MediaPlacement, SmartLinkDirection, SmartLinkPosition, SmartLinkSize, SmartLinkTheme, } from './constants';
12
12
  export { MetadataBlock, PreviewBlock, SnippetBlock, TitleBlock, FooterBlock, CustomBlock, } from './view/FlexibleCard/components/blocks';
13
13
  export { AssignedToElement, AssignedToGroupElement, AttachmentCountElement, AuthorGroupElement, ChecklistProgressElement, CollaboratorGroupElement, CommentCountElement, CreatedOnElement, CreatedByElement, DueOnElement, LatestCommitElement, LinkIconElement, LocationElement, ModifiedByElement, ModifiedOnElement, OwnedByElement, OwnedByGroupElement, PreviewElement, PriorityElement, ProgrammingLanguageElement, ProviderElement, ReactCountElement, ReadTimeElement, SentOnElement, SnippetElement, SourceBranchElement, StateElement, StoryPointsElement, SubscriberCountElement, SubTasksProgressElement, TargetBranchElement, TitleElement, ViewCountElement, VoteCountElement, } from './view/FlexibleCard/external';
14
- export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, } from './view/FlexibleCard/external';
14
+ export { CopyLinkAction, CustomAction, DownloadAction, FollowAction, PreviewAction, UnresolvedAction, } from './view/FlexibleCard/external';
15
15
  export type { ActionItem, ElementItem, OnActionMenuOpenChangeOptions, } from './view/FlexibleCard/components/blocks/types';
16
16
  export type { AnalyticsAction, AnalyticsActionSubject, AnalyticsPayload, AnalyticsHandler, } from './utils/types';
17
17
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-661 Internal documentation for deprecation (no external access)} */
@@ -1,6 +1,7 @@
1
1
  import { type LinkPerson } from '@atlaskit/link-extractors';
2
2
  import { type ActionName, type IconType, type InternalActionName, type MediaType } from '../../constants';
3
3
  import { type LinkLozenge } from '../../extractors/common/lozenge/types';
4
+ import { type RetryOptions } from '../../view/FlexibleCard/types';
4
5
  import { type InvokeClientActionProps } from '../hooks/use-invoke-client-action/types';
5
6
  import { type InvokeRequestWithCardDetails } from '../hooks/use-invoke/types';
6
7
  /**
@@ -257,6 +258,7 @@ export type FlexibleUiActions = {
257
258
  [ActionName.CopyLinkAction]?: CopyLinkActionData;
258
259
  [InternalActionName.AISummaryAction]?: AISummaryActionData;
259
260
  [ActionName.AutomationAction]?: AutomationActionData;
261
+ [InternalActionName.UnresolvedAction]?: UnresolvedActionData;
260
262
  [InternalActionName.ViewRelatedLinksAction]?: ViewRelatedLinksActionData;
261
263
  };
262
264
  export type PreviewActionData = {
@@ -281,6 +283,7 @@ export type AutomationActionData = {
281
283
  analyticsSource: string;
282
284
  objectName?: string;
283
285
  };
286
+ export type UnresolvedActionData = RetryOptions;
284
287
  export type ViewRelatedLinksActionData = {
285
288
  ari: string;
286
289
  };
@@ -5,6 +5,7 @@ export { default as DownloadAction } from './download-action';
5
5
  export { default as FollowAction } from './follow-action';
6
6
  export { default as PreviewAction } from './preview-action';
7
7
  export { default as CopyLinkAction } from './copy-link-action';
8
+ export { default as UnresolvedAction } from './unresolved-action';
8
9
  export { default as AISummaryAction } from './ai-summary-action';
9
10
  export { default as AutomationAction } from './automation-action';
10
11
  export { default as ViewRelatedLinksAction } from './view-related-links-action';
@@ -0,0 +1,5 @@
1
+ import React from 'react';
2
+ declare const UnresolvedAction: ({ testId }: {
3
+ testId?: string | undefined;
4
+ }) => React.JSX.Element | null;
5
+ export default UnresolvedAction;
@@ -7,5 +7,5 @@ import { type TitleBlockViewProps } from '../types';
7
7
  * or the backend response was errored or malformed.
8
8
  * @see TitleBlock
9
9
  */
10
- declare const TitleBlockErroredView: ({ actionGroup, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
10
+ declare const TitleBlockErroredView: ({ actionGroup, hideRetry, retry, position, testId, title, icon, hideIcon, ...blockProps }: TitleBlockViewProps) => React.JSX.Element;
11
11
  export default TitleBlockErroredView;
@@ -67,4 +67,5 @@ export type FollowActionProps = BaseActionProps;
67
67
  export declare const FollowAction: (props: FollowActionProps) => React.JSX.Element;
68
68
  export type PreviewActionProps = BaseActionProps;
69
69
  export declare const PreviewAction: (props: PreviewActionProps) => React.JSX.Element;
70
+ export declare const UnresolvedAction: () => React.JSX.Element;
70
71
  export {};
@@ -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' | 'renderers' | 'url'> & {
151
+ export type ExtractFlexibleUiDataContextParams = Pick<FlexibleCardProps, 'appearance' | 'id' | 'actionOptions' | 'origin' | 'onAuthorize' | 'renderers' | 'url'> & {
152
152
  fireEvent?: FireEventFunction;
153
153
  status?: SmartLinkStatus;
154
154
  response?: SmartLinkResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "36.12.0",
3
+ "version": "36.13.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -55,12 +55,12 @@
55
55
  "@atlaskit/linking-types": "^9.10.0",
56
56
  "@atlaskit/logo": "^16.0.0",
57
57
  "@atlaskit/lozenge": "^12.2.0",
58
- "@atlaskit/menu": "^4.0.0",
58
+ "@atlaskit/menu": "^5.0.0",
59
59
  "@atlaskit/modal-dialog": "^14.1.0",
60
60
  "@atlaskit/outbound-auth-flow-client": "^3.4.0",
61
61
  "@atlaskit/platform-feature-flags": "^1.1.0",
62
62
  "@atlaskit/popup": "^4.1.0",
63
- "@atlaskit/primitives": "^14.4.0",
63
+ "@atlaskit/primitives": "^14.6.0",
64
64
  "@atlaskit/section-message": "^8.2.0",
65
65
  "@atlaskit/select": "^20.4.0",
66
66
  "@atlaskit/spinner": "^18.0.0",
@@ -224,6 +224,9 @@
224
224
  "platform-linking-flexible-card-openness": {
225
225
  "type": "boolean"
226
226
  },
227
+ "platform-linking-flexible-card-unresolved-action": {
228
+ "type": "boolean"
229
+ },
227
230
  "smart_links_noun_support": {
228
231
  "type": "boolean"
229
232
  },