@atlaskit/smart-card 32.7.3 → 32.7.4

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 (129) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/extractors/common/context/extractAccessContext.js +1 -1
  3. package/dist/cjs/utils/analytics/analytics.js +1 -1
  4. package/dist/cjs/view/BlockCard/actions/{flexible/AuthorizeAction.js → AuthorizeAction.js} +2 -2
  5. package/dist/cjs/view/BlockCard/actions/ForbiddenAction.js +16 -13
  6. package/dist/cjs/view/BlockCard/actions/{flexible/RetryAction.js → RetryAction.js} +2 -2
  7. package/dist/cjs/view/BlockCard/index.js +14 -14
  8. package/dist/cjs/view/BlockCard/views/{flexible/FlexibleErroredView.js → ErroredView.js} +5 -5
  9. package/dist/cjs/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js} +9 -9
  10. package/dist/cjs/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js} +4 -4
  11. package/dist/cjs/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js} +5 -5
  12. package/dist/cjs/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js} +7 -7
  13. package/dist/cjs/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js +2 -2
  14. package/dist/cjs/view/BlockCard/views/{flexible/utils → utils}/index.js +3 -3
  15. package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +2 -2
  16. package/dist/cjs/view/EmbedCard/index.js +8 -8
  17. package/dist/cjs/view/EmbedCard/views/ErroredView.js +2 -2
  18. package/dist/cjs/view/LinkUrl/index.js +1 -1
  19. package/dist/cjs/view/common/access/ForbiddenAction.js +28 -0
  20. package/dist/cjs/view/common/utils.js +9 -2
  21. package/dist/es2019/extractors/common/context/extractAccessContext.js +1 -1
  22. package/dist/es2019/utils/analytics/analytics.js +1 -1
  23. package/dist/es2019/view/BlockCard/actions/{flexible/AuthorizeAction.js → AuthorizeAction.js} +2 -2
  24. package/dist/es2019/view/BlockCard/actions/ForbiddenAction.js +16 -6
  25. package/dist/es2019/view/BlockCard/actions/{flexible/RetryAction.js → RetryAction.js} +2 -2
  26. package/dist/es2019/view/BlockCard/index.js +13 -13
  27. package/dist/es2019/view/BlockCard/views/{flexible/FlexibleErroredView.js → ErroredView.js} +5 -5
  28. package/dist/es2019/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js} +9 -9
  29. package/dist/es2019/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js} +4 -4
  30. package/dist/es2019/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js} +5 -5
  31. package/dist/es2019/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js} +7 -7
  32. package/dist/es2019/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js +2 -2
  33. package/dist/es2019/view/BlockCard/views/{flexible/utils → utils}/index.js +3 -3
  34. package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +1 -1
  35. package/dist/es2019/view/EmbedCard/index.js +3 -3
  36. package/dist/es2019/view/EmbedCard/views/ErroredView.js +1 -1
  37. package/dist/es2019/view/LinkUrl/index.js +1 -1
  38. package/dist/es2019/view/common/access/ForbiddenAction.js +12 -0
  39. package/dist/es2019/view/common/utils.js +8 -1
  40. package/dist/esm/extractors/common/context/extractAccessContext.js +1 -1
  41. package/dist/esm/utils/analytics/analytics.js +1 -1
  42. package/dist/esm/view/BlockCard/actions/{flexible/AuthorizeAction.js → AuthorizeAction.js} +2 -2
  43. package/dist/esm/view/BlockCard/actions/ForbiddenAction.js +16 -13
  44. package/dist/esm/view/BlockCard/actions/{flexible/RetryAction.js → RetryAction.js} +2 -2
  45. package/dist/esm/view/BlockCard/index.js +13 -13
  46. package/dist/esm/view/BlockCard/views/{flexible/FlexibleErroredView.js → ErroredView.js} +5 -5
  47. package/dist/esm/view/BlockCard/views/{flexible/FlexibleForbiddenView.js → ForbiddenView.js} +9 -9
  48. package/dist/esm/view/BlockCard/views/{flexible/FlexibleNotFoundView.js → NotFoundView.js} +4 -4
  49. package/dist/esm/view/BlockCard/views/{flexible/FlexibleResolvedView.js → ResolvedView.js} +5 -5
  50. package/dist/esm/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.js → UnauthorisedView.js} +7 -7
  51. package/dist/esm/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.js +2 -2
  52. package/dist/esm/view/BlockCard/views/{flexible/utils → utils}/index.js +3 -3
  53. package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +1 -1
  54. package/dist/esm/view/EmbedCard/index.js +3 -3
  55. package/dist/esm/view/EmbedCard/views/ErroredView.js +1 -1
  56. package/dist/esm/view/LinkUrl/index.js +1 -1
  57. package/dist/esm/view/common/access/ForbiddenAction.js +21 -0
  58. package/dist/esm/view/common/utils.js +8 -1
  59. package/dist/types/types.d.ts +3 -11
  60. package/dist/{types-ts4.5/view/BlockCard/actions/flexible → types/view/BlockCard/actions}/AuthorizeAction.d.ts +1 -1
  61. package/dist/types/view/BlockCard/actions/ForbiddenAction.d.ts +12 -2
  62. package/dist/types/view/BlockCard/actions/{flexible/RetryAction.d.ts → RetryAction.d.ts} +1 -1
  63. package/dist/types/view/BlockCard/views/{flexible/types.d.ts → types.d.ts} +1 -1
  64. package/dist/{types-ts4.5/view/BlockCard/views/flexible → types/view/BlockCard/views}/unresolved-view/types.d.ts +2 -2
  65. package/dist/{types-ts4.5/view/BlockCard/views/flexible → types/view/BlockCard/views}/utils/index.d.ts +5 -5
  66. package/dist/types/view/EmbedCard/types.d.ts +1 -2
  67. package/dist/types/view/common/access/ForbiddenAction.d.ts +2 -0
  68. package/dist/types/view/common/utils.d.ts +2 -0
  69. package/dist/types/view/types.d.ts +8 -6
  70. package/dist/types-ts4.5/types.d.ts +3 -11
  71. package/dist/{types/view/BlockCard/actions/flexible → types-ts4.5/view/BlockCard/actions}/AuthorizeAction.d.ts +1 -1
  72. package/dist/types-ts4.5/view/BlockCard/actions/ForbiddenAction.d.ts +12 -2
  73. package/dist/types-ts4.5/view/BlockCard/actions/{flexible/RetryAction.d.ts → RetryAction.d.ts} +1 -1
  74. package/dist/types-ts4.5/view/BlockCard/views/{flexible/types.d.ts → types.d.ts} +1 -1
  75. package/dist/{types/view/BlockCard/views/flexible → types-ts4.5/view/BlockCard/views}/unresolved-view/types.d.ts +2 -2
  76. package/dist/{types/view/BlockCard/views/flexible → types-ts4.5/view/BlockCard/views}/utils/index.d.ts +5 -5
  77. package/dist/types-ts4.5/view/EmbedCard/types.d.ts +1 -2
  78. package/dist/types-ts4.5/view/common/access/ForbiddenAction.d.ts +2 -0
  79. package/dist/types-ts4.5/view/common/utils.d.ts +2 -0
  80. package/dist/types-ts4.5/view/types.d.ts +8 -6
  81. package/package.json +1 -1
  82. package/dist/cjs/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -31
  83. package/dist/cjs/view/BlockCard/components/Action.js +0 -5
  84. package/dist/cjs/view/BlockCard/utils/handlers.js +0 -13
  85. package/dist/es2019/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -22
  86. package/dist/es2019/view/BlockCard/components/Action.js +0 -1
  87. package/dist/es2019/view/BlockCard/utils/handlers.js +0 -7
  88. package/dist/esm/view/BlockCard/actions/flexible/ForbiddenAction.js +0 -24
  89. package/dist/esm/view/BlockCard/components/Action.js +0 -1
  90. package/dist/esm/view/BlockCard/utils/handlers.js +0 -7
  91. package/dist/types/view/BlockCard/actions/flexible/ForbiddenAction.d.ts +0 -12
  92. package/dist/types/view/BlockCard/components/Action.d.ts +0 -8
  93. package/dist/types/view/BlockCard/utils/handlers.d.ts +0 -2
  94. package/dist/types-ts4.5/view/BlockCard/actions/flexible/ForbiddenAction.d.ts +0 -12
  95. package/dist/types-ts4.5/view/BlockCard/components/Action.d.ts +0 -8
  96. package/dist/types-ts4.5/view/BlockCard/utils/handlers.d.ts +0 -2
  97. /package/dist/cjs/view/BlockCard/views/{flexible/styled.js → styled.js} +0 -0
  98. /package/dist/cjs/view/BlockCard/views/{flexible/types.js → types.js} +0 -0
  99. /package/dist/cjs/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/types.js +0 -0
  100. /package/dist/cjs/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.js +0 -0
  101. /package/dist/cjs/view/{BlockCard/components/Frame.js → EmbedCard/components/ErrorFrame.js} +0 -0
  102. /package/dist/es2019/view/BlockCard/views/{flexible/styled.js → styled.js} +0 -0
  103. /package/dist/es2019/view/BlockCard/views/{flexible/types.js → types.js} +0 -0
  104. /package/dist/es2019/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/types.js +0 -0
  105. /package/dist/es2019/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.js +0 -0
  106. /package/dist/es2019/view/{BlockCard/components/Frame.js → EmbedCard/components/ErrorFrame.js} +0 -0
  107. /package/dist/esm/view/BlockCard/views/{flexible/styled.js → styled.js} +0 -0
  108. /package/dist/esm/view/BlockCard/views/{flexible/types.js → types.js} +0 -0
  109. /package/dist/esm/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/types.js +0 -0
  110. /package/dist/esm/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.js +0 -0
  111. /package/dist/esm/view/{BlockCard/components/Frame.js → EmbedCard/components/ErrorFrame.js} +0 -0
  112. /package/dist/types/view/BlockCard/views/{flexible/FlexibleErroredView.d.ts → ErroredView.d.ts} +0 -0
  113. /package/dist/types/view/BlockCard/views/{flexible/FlexibleForbiddenView.d.ts → ForbiddenView.d.ts} +0 -0
  114. /package/dist/types/view/BlockCard/views/{flexible/FlexibleNotFoundView.d.ts → NotFoundView.d.ts} +0 -0
  115. /package/dist/types/view/BlockCard/views/{flexible/FlexibleResolvedView.d.ts → ResolvedView.d.ts} +0 -0
  116. /package/dist/types/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.d.ts → UnauthorisedView.d.ts} +0 -0
  117. /package/dist/types/view/BlockCard/views/{flexible/styled.d.ts → styled.d.ts} +0 -0
  118. /package/dist/types/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.d.ts +0 -0
  119. /package/dist/types/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.d.ts +0 -0
  120. /package/dist/types/view/{BlockCard/components/Frame.d.ts → EmbedCard/components/ErrorFrame.d.ts} +0 -0
  121. /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleErroredView.d.ts → ErroredView.d.ts} +0 -0
  122. /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleForbiddenView.d.ts → ForbiddenView.d.ts} +0 -0
  123. /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleNotFoundView.d.ts → NotFoundView.d.ts} +0 -0
  124. /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleResolvedView.d.ts → ResolvedView.d.ts} +0 -0
  125. /package/dist/types-ts4.5/view/BlockCard/views/{flexible/FlexibleUnauthorisedView.d.ts → UnauthorisedView.d.ts} +0 -0
  126. /package/dist/types-ts4.5/view/BlockCard/views/{flexible/styled.d.ts → styled.d.ts} +0 -0
  127. /package/dist/types-ts4.5/view/BlockCard/views/{flexible/unresolved-view → unresolved-view}/index.d.ts +0 -0
  128. /package/dist/types-ts4.5/view/BlockCard/views/{flexible/utils → utils}/withFlexibleUIBlockCardStyle.d.ts +0 -0
  129. /package/dist/types-ts4.5/view/{BlockCard/components/Frame.d.ts → EmbedCard/components/ErrorFrame.d.ts} +0 -0
@@ -3,8 +3,8 @@ import React from 'react';
3
3
 
4
4
  // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
5
5
  import { css } from '@emotion/react';
6
- import FlexibleCard from '../../../../FlexibleCard';
7
- import { CustomBlock, InternalFooterBlock, PreviewBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
6
+ import FlexibleCard from '../../../FlexibleCard';
7
+ import { CustomBlock, InternalFooterBlock, PreviewBlock, TitleBlock } from '../../../FlexibleCard/components/blocks';
8
8
  import { FlexibleCardUiOptions, FooterBlockOptions, PreviewBlockOptions, titleBlockOptions } from '../utils';
9
9
  var customBlockStyles = css({
10
10
  alignItems: 'flex-start'
@@ -1,7 +1,7 @@
1
1
  import { fg } from '@atlaskit/platform-feature-flags';
2
- import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
3
- import { extractOwnedBy } from '../../../../../extractors/flexible/utils';
4
- import { getExtensionKey } from '../../../../../state/helpers';
2
+ import { ElementName, MediaPlacement, SmartLinkPosition, SmartLinkSize } from '../../../../constants';
3
+ import { extractOwnedBy } from '../../../../extractors/flexible/utils';
4
+ import { getExtensionKey } from '../../../../state/helpers';
5
5
  import { footerBlockCss, titleBlockCss } from '../styled';
6
6
  var baseTopMetadata = [{
7
7
  name: ElementName.ModifiedOn
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import Tooltip from '@atlaskit/tooltip';
3
3
  import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
4
- import { handleClickCommon } from '../../BlockCard/utils/handlers';
4
+ import { handleClickCommon } from '../../common/utils';
5
5
  import { className, Content, Header, IconWrapper, LinkWrapper, TextWrapper, TooltipWrapper, Wrapper } from './styled';
6
6
  export var ExpandedFrame = function ExpandedFrame(_ref) {
7
7
  var _ref$isPlaceholder = _ref.isPlaceholder,
@@ -6,7 +6,7 @@ import { extractEmbedProps } from '../../extractors/embed';
6
6
  import { extractInlineProps } from '../../extractors/inline';
7
7
  import { getExtensionKey, hasAuthScopeOverrides } from '../../state/helpers';
8
8
  import { getEmptyJsonLd, getForbiddenJsonLd } from '../../utils/jsonld';
9
- import FlexibleResolvedView from '../BlockCard/views/flexible/FlexibleResolvedView';
9
+ import BlockCardResolvedView from '../BlockCard/views/ResolvedView';
10
10
  import { InlineCardResolvedView } from '../InlineCard/ResolvedView';
11
11
  import { EmbedCardErroredView } from './views/ErroredView';
12
12
  import ForbiddenView from './views/forbidden-view';
@@ -44,7 +44,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
44
44
  switch (status) {
45
45
  case 'pending':
46
46
  case 'resolving':
47
- return /*#__PURE__*/React.createElement(FlexibleResolvedView, {
47
+ return /*#__PURE__*/React.createElement(BlockCardResolvedView, {
48
48
  url: url,
49
49
  cardState: cardState,
50
50
  onClick: handleFrameClick,
@@ -85,7 +85,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
85
85
  onClick: handleFrameClick
86
86
  }));
87
87
  }
88
- return /*#__PURE__*/React.createElement(FlexibleResolvedView, {
88
+ return /*#__PURE__*/React.createElement(BlockCardResolvedView, {
89
89
  url: url,
90
90
  cardState: cardState,
91
91
  onClick: handleFrameClick,
@@ -10,8 +10,8 @@ import ErrorIcon from '@atlaskit/icon/core/migration/error';
10
10
  import { Box, Inline, xcss } from '@atlaskit/primitives';
11
11
  import { R300 } from '@atlaskit/theme/colors';
12
12
  import { messages } from '../../../messages';
13
- import { Frame } from '../../BlockCard/components/Frame';
14
13
  import { gs } from '../../common/utils';
14
+ import { Frame } from '../components/ErrorFrame';
15
15
  var messageStyles = css({
16
16
  font: "var(--ds-font-heading-xsmall, normal 600 14px/16px ui-sans-serif, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Ubuntu, system-ui, \"Helvetica Neue\", sans-serif)",
17
17
  fontWeight: "var(--ds-font-weight-regular, 400)",
@@ -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: "32.7.3",
16
+ packageVersion: "32.7.4",
17
17
  componentName: 'linkUrl'
18
18
  };
19
19
  var Anchor = withLinkClickedEvent('a');
@@ -0,0 +1,21 @@
1
+ import _extends from "@babel/runtime/helpers/extends";
2
+ import React from 'react';
3
+ import { FormattedMessage } from 'react-intl-next';
4
+ import { messages } from '../../../messages';
5
+ export var ForbiddenAction = function ForbiddenAction(handler) {
6
+ var id = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'connect-other-account';
7
+ var message = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : messages.try_another_account;
8
+ var values = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
9
+ return {
10
+ id: id,
11
+ text: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, message, {
12
+ values: values
13
+ })),
14
+ promise: function promise() {
15
+ return new Promise(function (resolve) {
16
+ return resolve(handler());
17
+ });
18
+ },
19
+ buttonAppearance: 'default'
20
+ };
21
+ };
@@ -11,4 +11,11 @@ var br = function br() {
11
11
  return "".concat(3 * times, "px");
12
12
  };
13
13
  var mq = facepaint(['@media(min-width: 576px)']);
14
- export { gs, br, mq };
14
+ export { gs, br, mq };
15
+ export var handleClickCommon = function handleClickCommon(event, onClick) {
16
+ if (onClick) {
17
+ event.preventDefault();
18
+ event.stopPropagation();
19
+ onClick(event);
20
+ }
21
+ };
@@ -1,18 +1,10 @@
1
1
  import { type JsonLd } from 'json-ld-types';
2
- export type { CardContext } from '@atlaskit/link-provider';
2
+ export { type CardContext } from '@atlaskit/link-provider';
3
3
  import { type LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
4
- import { type RequestAccessMessageKey } from './messages';
5
- import { type ActionProps } from './view/BlockCard/components/Action';
6
- import { type AccessContext } from './view/types';
7
4
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
8
5
  export type ResolveResponse = JsonLd.Response;
9
- export type { ProviderProps, CardType } from './state';
10
- export type { CardProps, CardAppearance, CardPlatform } from './view/Card/types';
11
- export interface RequestAccessContextProps extends AccessContext {
12
- action?: ActionProps;
13
- callToActionMessageKey?: RequestAccessMessageKey;
14
- descriptiveMessageKey?: RequestAccessMessageKey;
15
- }
6
+ export { type ProviderProps, type CardType } from './state';
7
+ export { type CardProps, type CardAppearance, type CardPlatform } from './view/Card/types';
16
8
  export type InlinePreloaderStyle = 'on-left-with-skeleton' | 'on-right-without-skeleton';
17
9
  export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
18
10
  export interface LozengeProps {
@@ -1,4 +1,4 @@
1
- import { type CustomActionItem } from '../../../FlexibleCard/components/blocks/types';
1
+ import { type CustomActionItem } from '../../FlexibleCard/components/blocks/types';
2
2
  /**
3
3
  * Returns a CustomActionItem with a "Connect to <providerName>" message
4
4
  *
@@ -1,2 +1,12 @@
1
- import { type ActionProps } from '../components/Action';
2
- export declare const ForbiddenAction: (handler: () => void, id?: string, message?: import("react-intl-next").MessageDescriptor, values?: {}) => ActionProps;
1
+ import { type ReactNode } from 'react';
2
+ import { type MessageKey, type RequestAccessMessageKey } from '../../../messages';
3
+ import { type CustomActionItem } from '../../FlexibleCard/components/blocks/types';
4
+ /**
5
+ * Returns a CustomActionItem with a "Try Another Account" default message
6
+ *
7
+ * @see CustomActionItem
8
+ * @param onClick a function that will be called on the click of the button
9
+ * @param content is a message key for a message to be displayed in the action
10
+ * @param context is a variable for a message in case a message contains a placeholder
11
+ */
12
+ export declare const ForbiddenAction: (onClick: () => void, content: RequestAccessMessageKey | MessageKey, context?: Record<string, ReactNode>, isDisabled?: boolean) => CustomActionItem;
@@ -1,4 +1,4 @@
1
- import { type CustomActionItem } from '../../../FlexibleCard/components/blocks/types';
1
+ import { type CustomActionItem } from '../../FlexibleCard/components/blocks/types';
2
2
  /**
3
3
  * Returns a CustomActionItem with a "Retry" default message
4
4
  *
@@ -1,2 +1,2 @@
1
- import { type FlexibleCardProps } from '../../../FlexibleCard/types';
1
+ import { type FlexibleCardProps } from '../../FlexibleCard/types';
2
2
  export type FlexibleBlockCardProps = Pick<FlexibleCardProps, 'analytics' | 'cardState' | 'id' | 'onAuthorize' | 'onClick' | 'onError' | 'onResolve' | 'renderers' | 'actionOptions' | 'testId' | 'url'>;
@@ -1,6 +1,6 @@
1
1
  import { type PropsWithChildren } from 'react';
2
- import type { ActionItem } from '../../../../FlexibleCard/components/blocks/types';
3
- import type { FlexibleBlockCardProps } from '../types';
2
+ import { type ActionItem } from '../../../FlexibleCard/components/blocks/types';
3
+ import { type FlexibleBlockCardProps } from '../types';
4
4
  export type UnresolvedViewProps = PropsWithChildren<FlexibleBlockCardProps & {
5
5
  actions?: ActionItem[];
6
6
  showPreview?: boolean;
@@ -1,9 +1,9 @@
1
1
  import type { JsonLd } from 'json-ld-types';
2
- import type { FooterBlockProps } from '../../../../FlexibleCard/components/blocks/footer-block/types';
3
- import type { PreviewBlockProps } from '../../../../FlexibleCard/components/blocks/preview-block/types';
4
- import type { TitleBlockProps } from '../../../../FlexibleCard/components/blocks/title-block/types';
5
- import type { ElementItem } from '../../../../FlexibleCard/components/blocks/types';
6
- import type { FlexibleUiOptions } from '../../../../FlexibleCard/types';
2
+ import type { FooterBlockProps } from '../../../FlexibleCard/components/blocks/footer-block/types';
3
+ import type { PreviewBlockProps } from '../../../FlexibleCard/components/blocks/preview-block/types';
4
+ import type { TitleBlockProps } from '../../../FlexibleCard/components/blocks/title-block/types';
5
+ import type { ElementItem } from '../../../FlexibleCard/components/blocks/types';
6
+ import type { FlexibleUiOptions } from '../../../FlexibleCard/types';
7
7
  export declare const getSimulatedBetterMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
8
8
  type SimulatedMetadata = {
9
9
  titleMetadata: ElementItem[];
@@ -4,9 +4,8 @@ import { type RequestAccessMessageKey } from '../../messages';
4
4
  import { type InvokeHandler } from '../../model/invoke-handler';
5
5
  import { type AnalyticsFacade } from '../../state/analytics';
6
6
  import { type CardState } from '../../state/types';
7
- import { type ActionProps } from '../BlockCard/components/Action';
8
7
  import type { CardActionOptions, CardPlatform, EmbedIframeUrlType, OnResolveCallback } from '../Card/types';
9
- import { type OnErrorCallback } from '../types';
8
+ import { type ActionProps, type OnErrorCallback } from '../types';
10
9
  export type EmbedCardProps = {
11
10
  url: string;
12
11
  cardState: CardState;
@@ -0,0 +1,2 @@
1
+ import { type ActionProps } from '../../types';
2
+ export declare const ForbiddenAction: (handler: () => void, id?: string, message?: import("react-intl-next").MessageDescriptor, values?: {}) => ActionProps;
@@ -1,5 +1,7 @@
1
+ import type React from 'react';
1
2
  import facepaint from 'facepaint';
2
3
  declare const gs: (times: number) => string;
3
4
  declare const br: (times?: number) => string;
4
5
  declare const mq: facepaint.DynamicStyleFunction;
5
6
  export { gs, br, mq };
7
+ export declare const handleClickCommon: (event: React.MouseEvent, onClick?: React.MouseEventHandler) => void;
@@ -1,14 +1,10 @@
1
- import { type ReactNode } from 'react';
1
+ /// <reference types="react" />
2
+ import { type Appearance } from '@atlaskit/button';
2
3
  import { type CardType } from '@atlaskit/linking-common';
3
4
  import { type RequestAccessMessageKey } from '../messages';
4
- import { type ActionProps } from './BlockCard/components/Action';
5
5
  export interface WithShowControlMethodProp {
6
6
  showControls?: () => void;
7
7
  }
8
- export interface ContextViewModel {
9
- icon?: ReactNode;
10
- text: string;
11
- }
12
8
  export type AccessTypes = 'REQUEST_ACCESS' | 'PENDING_REQUEST_EXISTS' | 'FORBIDDEN' | 'DIRECT_ACCESS' | 'DENIED_REQUEST_EXISTS' | 'APPROVED_REQUEST_EXISTS' | 'ACCESS_EXISTS';
13
9
  export interface AccessContext {
14
10
  accessType?: AccessTypes;
@@ -16,6 +12,12 @@ export interface AccessContext {
16
12
  url?: string;
17
13
  smartLinksAccessMetadataExperimentCohort?: 'experiment' | 'control' | 'not-enrolled';
18
14
  }
15
+ export interface ActionProps {
16
+ id: string;
17
+ text: React.ReactNode;
18
+ promise: () => Promise<any>;
19
+ buttonAppearance?: Appearance;
20
+ }
19
21
  export interface RequestAccessContextProps extends AccessContext {
20
22
  action?: ActionProps;
21
23
  callToActionMessageKey?: RequestAccessMessageKey;
@@ -1,18 +1,10 @@
1
1
  import { type JsonLd } from 'json-ld-types';
2
- export type { CardContext } from '@atlaskit/link-provider';
2
+ export { type CardContext } from '@atlaskit/link-provider';
3
3
  import { type LozengeProps as AtlaskitLozengeProps } from '@atlaskit/lozenge';
4
- import { type RequestAccessMessageKey } from './messages';
5
- import { type ActionProps } from './view/BlockCard/components/Action';
6
- import { type AccessContext } from './view/types';
7
4
  /** @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-15961 Internal documentation for deprecation (no external access)} */
8
5
  export type ResolveResponse = JsonLd.Response;
9
- export type { ProviderProps, CardType } from './state';
10
- export type { CardProps, CardAppearance, CardPlatform } from './view/Card/types';
11
- export interface RequestAccessContextProps extends AccessContext {
12
- action?: ActionProps;
13
- callToActionMessageKey?: RequestAccessMessageKey;
14
- descriptiveMessageKey?: RequestAccessMessageKey;
15
- }
6
+ export { type ProviderProps, type CardType } from './state';
7
+ export { type CardProps, type CardAppearance, type CardPlatform } from './view/Card/types';
16
8
  export type InlinePreloaderStyle = 'on-left-with-skeleton' | 'on-right-without-skeleton';
17
9
  export type LozengeColor = 'default' | 'success' | 'removed' | 'inprogress' | 'new' | 'moved';
18
10
  export interface LozengeProps {
@@ -1,4 +1,4 @@
1
- import { type CustomActionItem } from '../../../FlexibleCard/components/blocks/types';
1
+ import { type CustomActionItem } from '../../FlexibleCard/components/blocks/types';
2
2
  /**
3
3
  * Returns a CustomActionItem with a "Connect to <providerName>" message
4
4
  *
@@ -1,2 +1,12 @@
1
- import { type ActionProps } from '../components/Action';
2
- export declare const ForbiddenAction: (handler: () => void, id?: string, message?: import("react-intl-next").MessageDescriptor, values?: {}) => ActionProps;
1
+ import { type ReactNode } from 'react';
2
+ import { type MessageKey, type RequestAccessMessageKey } from '../../../messages';
3
+ import { type CustomActionItem } from '../../FlexibleCard/components/blocks/types';
4
+ /**
5
+ * Returns a CustomActionItem with a "Try Another Account" default message
6
+ *
7
+ * @see CustomActionItem
8
+ * @param onClick a function that will be called on the click of the button
9
+ * @param content is a message key for a message to be displayed in the action
10
+ * @param context is a variable for a message in case a message contains a placeholder
11
+ */
12
+ export declare const ForbiddenAction: (onClick: () => void, content: RequestAccessMessageKey | MessageKey, context?: Record<string, ReactNode>, isDisabled?: boolean) => CustomActionItem;
@@ -1,4 +1,4 @@
1
- import { type CustomActionItem } from '../../../FlexibleCard/components/blocks/types';
1
+ import { type CustomActionItem } from '../../FlexibleCard/components/blocks/types';
2
2
  /**
3
3
  * Returns a CustomActionItem with a "Retry" default message
4
4
  *
@@ -1,2 +1,2 @@
1
- import { type FlexibleCardProps } from '../../../FlexibleCard/types';
1
+ import { type FlexibleCardProps } from '../../FlexibleCard/types';
2
2
  export type FlexibleBlockCardProps = Pick<FlexibleCardProps, 'analytics' | 'cardState' | 'id' | 'onAuthorize' | 'onClick' | 'onError' | 'onResolve' | 'renderers' | 'actionOptions' | 'testId' | 'url'>;
@@ -1,6 +1,6 @@
1
1
  import { type PropsWithChildren } from 'react';
2
- import type { ActionItem } from '../../../../FlexibleCard/components/blocks/types';
3
- import type { FlexibleBlockCardProps } from '../types';
2
+ import { type ActionItem } from '../../../FlexibleCard/components/blocks/types';
3
+ import { type FlexibleBlockCardProps } from '../types';
4
4
  export type UnresolvedViewProps = PropsWithChildren<FlexibleBlockCardProps & {
5
5
  actions?: ActionItem[];
6
6
  showPreview?: boolean;
@@ -1,9 +1,9 @@
1
1
  import type { JsonLd } from 'json-ld-types';
2
- import type { FooterBlockProps } from '../../../../FlexibleCard/components/blocks/footer-block/types';
3
- import type { PreviewBlockProps } from '../../../../FlexibleCard/components/blocks/preview-block/types';
4
- import type { TitleBlockProps } from '../../../../FlexibleCard/components/blocks/title-block/types';
5
- import type { ElementItem } from '../../../../FlexibleCard/components/blocks/types';
6
- import type { FlexibleUiOptions } from '../../../../FlexibleCard/types';
2
+ import type { FooterBlockProps } from '../../../FlexibleCard/components/blocks/footer-block/types';
3
+ import type { PreviewBlockProps } from '../../../FlexibleCard/components/blocks/preview-block/types';
4
+ import type { TitleBlockProps } from '../../../FlexibleCard/components/blocks/title-block/types';
5
+ import type { ElementItem } from '../../../FlexibleCard/components/blocks/types';
6
+ import type { FlexibleUiOptions } from '../../../FlexibleCard/types';
7
7
  export declare const getSimulatedBetterMetadata: (cardDetails?: JsonLd.Response) => SimulatedMetadata;
8
8
  type SimulatedMetadata = {
9
9
  titleMetadata: ElementItem[];
@@ -4,9 +4,8 @@ import { type RequestAccessMessageKey } from '../../messages';
4
4
  import { type InvokeHandler } from '../../model/invoke-handler';
5
5
  import { type AnalyticsFacade } from '../../state/analytics';
6
6
  import { type CardState } from '../../state/types';
7
- import { type ActionProps } from '../BlockCard/components/Action';
8
7
  import type { CardActionOptions, CardPlatform, EmbedIframeUrlType, OnResolveCallback } from '../Card/types';
9
- import { type OnErrorCallback } from '../types';
8
+ import { type ActionProps, type OnErrorCallback } from '../types';
10
9
  export type EmbedCardProps = {
11
10
  url: string;
12
11
  cardState: CardState;
@@ -0,0 +1,2 @@
1
+ import { type ActionProps } from '../../types';
2
+ export declare const ForbiddenAction: (handler: () => void, id?: string, message?: import("react-intl-next").MessageDescriptor, values?: {}) => ActionProps;
@@ -1,5 +1,7 @@
1
+ import type React from 'react';
1
2
  import facepaint from 'facepaint';
2
3
  declare const gs: (times: number) => string;
3
4
  declare const br: (times?: number) => string;
4
5
  declare const mq: facepaint.DynamicStyleFunction;
5
6
  export { gs, br, mq };
7
+ export declare const handleClickCommon: (event: React.MouseEvent, onClick?: React.MouseEventHandler) => void;
@@ -1,14 +1,10 @@
1
- import { type ReactNode } from 'react';
1
+ /// <reference types="react" />
2
+ import { type Appearance } from '@atlaskit/button';
2
3
  import { type CardType } from '@atlaskit/linking-common';
3
4
  import { type RequestAccessMessageKey } from '../messages';
4
- import { type ActionProps } from './BlockCard/components/Action';
5
5
  export interface WithShowControlMethodProp {
6
6
  showControls?: () => void;
7
7
  }
8
- export interface ContextViewModel {
9
- icon?: ReactNode;
10
- text: string;
11
- }
12
8
  export type AccessTypes = 'REQUEST_ACCESS' | 'PENDING_REQUEST_EXISTS' | 'FORBIDDEN' | 'DIRECT_ACCESS' | 'DENIED_REQUEST_EXISTS' | 'APPROVED_REQUEST_EXISTS' | 'ACCESS_EXISTS';
13
9
  export interface AccessContext {
14
10
  accessType?: AccessTypes;
@@ -16,6 +12,12 @@ export interface AccessContext {
16
12
  url?: string;
17
13
  smartLinksAccessMetadataExperimentCohort?: 'experiment' | 'control' | 'not-enrolled';
18
14
  }
15
+ export interface ActionProps {
16
+ id: string;
17
+ text: React.ReactNode;
18
+ promise: () => Promise<any>;
19
+ buttonAppearance?: Appearance;
20
+ }
19
21
  export interface RequestAccessContextProps extends AccessContext {
20
22
  action?: ActionProps;
21
23
  callToActionMessageKey?: RequestAccessMessageKey;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "32.7.3",
3
+ "version": "32.7.4",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -1,31 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
- Object.defineProperty(exports, "__esModule", {
5
- value: true
6
- });
7
- exports.ForbiddenAction = void 0;
8
- var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
9
- var _react = _interopRequireDefault(require("react"));
10
- var _reactIntlNext = require("react-intl-next");
11
- var _constants = require("../../../../constants");
12
- var _messages = require("../../../../messages");
13
- /**
14
- * Returns a CustomActionItem with a "Try Another Account" default message
15
- *
16
- * @see CustomActionItem
17
- * @param onClick a function that will be called on the click of the button
18
- * @param content is a message key for a message to be displayed in the action
19
- * @param context is a variable for a message in case a message contains a placeholder
20
- */
21
- var ForbiddenAction = exports.ForbiddenAction = function ForbiddenAction(onClick, content, context, isDisabled) {
22
- return {
23
- name: _constants.ActionName.CustomAction,
24
- content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, (0, _extends2.default)({}, _messages.messages[content], {
25
- values: context
26
- })),
27
- onClick: onClick,
28
- testId: 'smart-action-connect-other-account',
29
- isDisabled: isDisabled
30
- };
31
- };
@@ -1,5 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
@@ -1,13 +0,0 @@
1
- "use strict";
2
-
3
- Object.defineProperty(exports, "__esModule", {
4
- value: true
5
- });
6
- exports.handleClickCommon = void 0;
7
- var handleClickCommon = exports.handleClickCommon = function handleClickCommon(event, onClick) {
8
- if (onClick) {
9
- event.preventDefault();
10
- event.stopPropagation();
11
- onClick(event);
12
- }
13
- };
@@ -1,22 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { FormattedMessage } from 'react-intl-next';
4
- import { ActionName } from '../../../../constants';
5
- import { messages } from '../../../../messages';
6
- /**
7
- * Returns a CustomActionItem with a "Try Another Account" default message
8
- *
9
- * @see CustomActionItem
10
- * @param onClick a function that will be called on the click of the button
11
- * @param content is a message key for a message to be displayed in the action
12
- * @param context is a variable for a message in case a message contains a placeholder
13
- */
14
- export const ForbiddenAction = (onClick, content, context, isDisabled) => ({
15
- name: ActionName.CustomAction,
16
- content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[content], {
17
- values: context
18
- })),
19
- onClick,
20
- testId: 'smart-action-connect-other-account',
21
- isDisabled
22
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- export const handleClickCommon = (event, onClick) => {
2
- if (onClick) {
3
- event.preventDefault();
4
- event.stopPropagation();
5
- onClick(event);
6
- }
7
- };
@@ -1,24 +0,0 @@
1
- import _extends from "@babel/runtime/helpers/extends";
2
- import React from 'react';
3
- import { FormattedMessage } from 'react-intl-next';
4
- import { ActionName } from '../../../../constants';
5
- import { messages } from '../../../../messages';
6
- /**
7
- * Returns a CustomActionItem with a "Try Another Account" default message
8
- *
9
- * @see CustomActionItem
10
- * @param onClick a function that will be called on the click of the button
11
- * @param content is a message key for a message to be displayed in the action
12
- * @param context is a variable for a message in case a message contains a placeholder
13
- */
14
- export var ForbiddenAction = function ForbiddenAction(onClick, content, context, isDisabled) {
15
- return {
16
- name: ActionName.CustomAction,
17
- content: /*#__PURE__*/React.createElement(FormattedMessage, _extends({}, messages[content], {
18
- values: context
19
- })),
20
- onClick: onClick,
21
- testId: 'smart-action-connect-other-account',
22
- isDisabled: isDisabled
23
- };
24
- };
@@ -1 +0,0 @@
1
- export {};
@@ -1,7 +0,0 @@
1
- export var handleClickCommon = function handleClickCommon(event, onClick) {
2
- if (onClick) {
3
- event.preventDefault();
4
- event.stopPropagation();
5
- onClick(event);
6
- }
7
- };
@@ -1,12 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import { type MessageKey, type RequestAccessMessageKey } from '../../../../messages';
3
- import { type CustomActionItem } from '../../../FlexibleCard/components/blocks/types';
4
- /**
5
- * Returns a CustomActionItem with a "Try Another Account" default message
6
- *
7
- * @see CustomActionItem
8
- * @param onClick a function that will be called on the click of the button
9
- * @param content is a message key for a message to be displayed in the action
10
- * @param context is a variable for a message in case a message contains a placeholder
11
- */
12
- export declare const ForbiddenAction: (onClick: () => void, content: RequestAccessMessageKey | MessageKey, context?: Record<string, ReactNode>, isDisabled?: boolean) => CustomActionItem;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { type Appearance } from '@atlaskit/button/types';
3
- export interface ActionProps {
4
- id: string;
5
- text: React.ReactNode;
6
- promise: () => Promise<any>;
7
- buttonAppearance?: Appearance;
8
- }
@@ -1,2 +0,0 @@
1
- import type React from 'react';
2
- export declare const handleClickCommon: (event: React.MouseEvent, onClick?: React.MouseEventHandler) => void;
@@ -1,12 +0,0 @@
1
- import { type ReactNode } from 'react';
2
- import { type MessageKey, type RequestAccessMessageKey } from '../../../../messages';
3
- import { type CustomActionItem } from '../../../FlexibleCard/components/blocks/types';
4
- /**
5
- * Returns a CustomActionItem with a "Try Another Account" default message
6
- *
7
- * @see CustomActionItem
8
- * @param onClick a function that will be called on the click of the button
9
- * @param content is a message key for a message to be displayed in the action
10
- * @param context is a variable for a message in case a message contains a placeholder
11
- */
12
- export declare const ForbiddenAction: (onClick: () => void, content: RequestAccessMessageKey | MessageKey, context?: Record<string, ReactNode>, isDisabled?: boolean) => CustomActionItem;
@@ -1,8 +0,0 @@
1
- /// <reference types="react" />
2
- import { type Appearance } from '@atlaskit/button/types';
3
- export interface ActionProps {
4
- id: string;
5
- text: React.ReactNode;
6
- promise: () => Promise<any>;
7
- buttonAppearance?: Appearance;
8
- }
@@ -1,2 +0,0 @@
1
- import type React from 'react';
2
- export declare const handleClickCommon: (event: React.MouseEvent, onClick?: React.MouseEventHandler) => void;