@atlaskit/smart-card 26.48.3 → 26.48.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 (73) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/dist/cjs/utils/analytics/analytics.js +1 -1
  3. package/dist/cjs/utils/index.js +15 -2
  4. package/dist/cjs/view/CardWithUrl/component.js +2 -2
  5. package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +6 -11
  6. package/dist/cjs/view/EmbedCard/index.js +4 -3
  7. package/dist/cjs/view/EmbedCard/views/ResolvedView.js +0 -2
  8. package/dist/cjs/view/EmbedCard/views/unresolved-view/index.js +10 -2
  9. package/dist/cjs/view/FlexibleCard/components/actions/action/preview-action/index.js +1 -4
  10. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +2 -3
  11. package/dist/cjs/view/FlexibleCard/components/container/index.js +1 -2
  12. package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +2 -3
  13. package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +1 -2
  14. package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +2 -3
  15. package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +1 -2
  16. package/dist/cjs/view/LinkUrl/index.js +1 -1
  17. package/dist/es2019/utils/analytics/analytics.js +1 -1
  18. package/dist/es2019/utils/index.js +13 -0
  19. package/dist/es2019/view/CardWithUrl/component.js +3 -3
  20. package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +4 -6
  21. package/dist/es2019/view/EmbedCard/index.js +4 -3
  22. package/dist/es2019/view/EmbedCard/views/ResolvedView.js +0 -2
  23. package/dist/es2019/view/EmbedCard/views/unresolved-view/index.js +10 -2
  24. package/dist/es2019/view/FlexibleCard/components/actions/action/preview-action/index.js +1 -4
  25. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +3 -4
  26. package/dist/es2019/view/FlexibleCard/components/container/index.js +1 -2
  27. package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +2 -3
  28. package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +1 -2
  29. package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +6 -7
  30. package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +1 -2
  31. package/dist/es2019/view/LinkUrl/index.js +1 -1
  32. package/dist/esm/utils/analytics/analytics.js +1 -1
  33. package/dist/esm/utils/index.js +14 -1
  34. package/dist/esm/view/CardWithUrl/component.js +3 -3
  35. package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +5 -8
  36. package/dist/esm/view/EmbedCard/index.js +4 -3
  37. package/dist/esm/view/EmbedCard/views/ResolvedView.js +0 -2
  38. package/dist/esm/view/EmbedCard/views/unresolved-view/index.js +10 -2
  39. package/dist/esm/view/FlexibleCard/components/actions/action/preview-action/index.js +1 -4
  40. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +2 -3
  41. package/dist/esm/view/FlexibleCard/components/container/index.js +1 -2
  42. package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +2 -3
  43. package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +1 -2
  44. package/dist/esm/view/FlexibleCard/components/elements/link/index.js +2 -3
  45. package/dist/esm/view/FlexibleCard/components/elements/text/index.js +1 -2
  46. package/dist/esm/view/LinkUrl/index.js +1 -1
  47. package/dist/types/utils/index.d.ts +7 -1
  48. package/dist/types/view/EmbedCard/components/ExpandedFrame.d.ts +0 -2
  49. package/dist/types/view/EmbedCard/types.d.ts +0 -1
  50. package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +0 -2
  51. package/dist/types/view/EmbedCard/views/forbidden-view/types.d.ts +4 -4
  52. package/dist/types/view/EmbedCard/views/not-found-view/types.d.ts +4 -4
  53. package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +3 -3
  54. package/dist/types/view/EmbedCard/views/unresolved-view/types.d.ts +5 -12
  55. package/dist/types-ts4.5/utils/index.d.ts +7 -1
  56. package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrame.d.ts +0 -2
  57. package/dist/types-ts4.5/view/EmbedCard/types.d.ts +0 -1
  58. package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +0 -2
  59. package/dist/types-ts4.5/view/EmbedCard/views/forbidden-view/types.d.ts +4 -4
  60. package/dist/types-ts4.5/view/EmbedCard/views/not-found-view/types.d.ts +4 -4
  61. package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/types.d.ts +3 -3
  62. package/dist/types-ts4.5/view/EmbedCard/views/unresolved-view/types.d.ts +5 -12
  63. package/package.json +1 -1
  64. package/dist/cjs/utils/token.js +0 -27
  65. package/dist/cjs/view/EmbedCard/views/UnresolvedView.js +0 -82
  66. package/dist/es2019/utils/token.js +0 -21
  67. package/dist/es2019/view/EmbedCard/views/UnresolvedView.js +0 -75
  68. package/dist/esm/utils/token.js +0 -21
  69. package/dist/esm/view/EmbedCard/views/UnresolvedView.js +0 -74
  70. package/dist/types/utils/token.d.ts +0 -21
  71. package/dist/types/view/EmbedCard/views/UnresolvedView.d.ts +0 -22
  72. package/dist/types-ts4.5/utils/token.d.ts +0 -21
  73. package/dist/types-ts4.5/view/EmbedCard/views/UnresolvedView.d.ts +0 -22
@@ -1,7 +1,6 @@
1
1
  /** @jsx jsx */
2
2
  import React from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
- import { tokens } from '../../../../../utils/token';
5
4
  import { getFormattedMessage, getIconSizeStyles } from '../../utils';
6
5
  import { IconType } from '../../../../../constants';
7
6
  import { messages } from '../../../../../messages';
@@ -13,7 +12,7 @@ const badgeStyles = css`
13
12
  min-width: fit-content;
14
13
  `;
15
14
  const iconStyles = css`
16
- color: ${tokens.badgeIcon};
15
+ color: ${"var(--ds-icon-subtle, #626F86)"};
17
16
  line-height: 0;
18
17
  vertical-align: middle;
19
18
  ${getIconSizeStyles('1rem')}
@@ -25,7 +24,7 @@ const iconStyles = css`
25
24
  }
26
25
  `;
27
26
  const labelStyles = css`
28
- color: ${tokens.badgeText};
27
+ color: ${"var(--ds-text-subtlest, #626F86)"};
29
28
  font-size: 0.75rem;
30
29
  line-height: 1rem;
31
30
  padding-left: 0.125rem;
@@ -4,11 +4,10 @@ import React from 'react';
4
4
  import { useIntl, FormattedMessage } from 'react-intl-next';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import { getTruncateStyles } from '../../utils';
7
- import { tokens } from '../../../../../utils/token';
8
7
  import { selectUnit } from '@formatjs/intl-utils';
9
8
  import { messages } from '../../../../../messages';
10
9
  const styles = css`
11
- color: ${tokens.text};
10
+ color: ${"var(--ds-text-subtlest, #626F86)"};
12
11
  font-size: 0.75rem;
13
12
  line-height: 1rem;
14
13
  ${getTruncateStyles(1)}
@@ -5,7 +5,6 @@ import { css, jsx } from '@emotion/react';
5
5
  import Tooltip from '@atlaskit/tooltip';
6
6
  import { SmartLinkInternalTheme, SmartLinkSize, SmartLinkTheme } from '../../../../../constants';
7
7
  import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles, hasWhiteSpace } from '../../utils';
8
- import { tokens } from '../../../../../utils/token';
9
8
  import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
10
9
  const DEFAULT_MAX_LINES = 2;
11
10
  const MAXIMUM_MAX_LINES = 2;
@@ -34,24 +33,24 @@ const getThemeStyles = theme => {
34
33
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
35
34
  case SmartLinkTheme.Black:
36
35
  return css`
37
- color: ${tokens.blackLink};
36
+ color: ${"var(--ds-text-subtle, #44546F)"};
38
37
  :active {
39
- color: ${tokens.blackLinkPressed};
38
+ color: ${"var(--ds-text, #172B4D)"};
40
39
  }
41
40
  :hover {
42
- color: ${tokens.blackLink};
41
+ color: ${"var(--ds-text-subtle, #44546F)"};
43
42
  text-decoration: underline;
44
43
  }
45
44
  `;
46
45
  case SmartLinkTheme.Link:
47
46
  default:
48
47
  return css`
49
- color: ${tokens.blueLink};
48
+ color: ${"var(--ds-link, #0C66E4)"};
50
49
  :active {
51
- color: ${tokens.blueLinkPressed};
50
+ color: ${"var(--ds-link-pressed, #0055CC)"};
52
51
  }
53
52
  :hover {
54
- color: ${tokens.blueLink};
53
+ color: ${"var(--ds-link, #0C66E4)"};
55
54
  text-decoration: underline;
56
55
  }
57
56
  `;
@@ -2,9 +2,8 @@
2
2
  import React from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { getFormattedMessage, getTruncateStyles } from '../../utils';
5
- import { tokens } from '../../../../../utils/token';
6
5
  const getStyles = maxLines => css`
7
- color: ${tokens.text};
6
+ color: ${"var(--ds-text-subtlest, #626F86)"};
8
7
  font-size: 0.75rem;
9
8
  line-height: 1rem;
10
9
  white-space: normal;
@@ -7,7 +7,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
7
7
  import LinkWarningModal from './LinkWarningModal';
8
8
  const PACKAGE_DATA = {
9
9
  packageName: "@atlaskit/smart-card",
10
- packageVersion: "26.48.3",
10
+ packageVersion: "26.48.4",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');
@@ -15,7 +15,7 @@ export var ANALYTICS_CHANNEL = 'media';
15
15
  export var context = {
16
16
  componentName: 'smart-cards',
17
17
  packageName: "@atlaskit/smart-card",
18
- packageVersion: "26.48.3"
18
+ packageVersion: "26.48.4"
19
19
  };
20
20
  export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
21
21
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -341,4 +341,17 @@ export var openUrl = /*#__PURE__*/function () {
341
341
  return function openUrl(_x3) {
342
342
  return _ref3.apply(this, arguments);
343
343
  };
344
- }();
344
+ }();
345
+
346
+ /**
347
+ * Migrate internal usages of the deprecated isFrameVisible to frameStyle
348
+ * This function is to be removed on deprecation of isFrameVisible.
349
+ */
350
+ export var combineFrameStyle = function combineFrameStyle(frameStyle, isFrameVisible) {
351
+ if (frameStyle !== undefined) {
352
+ return frameStyle;
353
+ }
354
+ if (isFrameVisible) {
355
+ return 'show';
356
+ }
357
+ };
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useCallback, useMemo } from 'react';
2
2
  import { useAnalyticsEvents } from '@atlaskit/analytics-next';
3
3
  import { useFeatureFlag } from '@atlaskit/link-provider';
4
- import { isSpecialEvent } from '../../utils';
4
+ import { combineFrameStyle, isSpecialEvent } from '../../utils';
5
5
  import * as measure from '../../utils/performance';
6
6
  import { getDefinitionId, getServices, isFinalState, getClickUrl, getResourceType, getExtensionKey, getSubproduct, getProduct, getCanBeDatasource } from '../../state/helpers';
7
7
  import { useSmartLink } from '../../state';
@@ -20,7 +20,7 @@ function Component(_ref) {
20
20
  isSelected = _ref.isSelected,
21
21
  isHovered = _ref.isHovered,
22
22
  isFrameVisible = _ref.isFrameVisible,
23
- frameStyle = _ref.frameStyle,
23
+ frameStyleProp = _ref.frameStyle,
24
24
  platform = _ref.platform,
25
25
  onClick = _ref.onClick,
26
26
  appearance = _ref.appearance,
@@ -65,6 +65,7 @@ function Component(_ref) {
65
65
  }, [children]);
66
66
  var enableFlexibleBlockCardFlag = Boolean(useFeatureFlag('enableFlexibleBlockCard'));
67
67
  var actionOptions = combineActionOptions(actionOptionsProp, showServerActions, showActions, platform);
68
+ var frameStyle = combineFrameStyle(frameStyleProp, isFrameVisible);
68
69
 
69
70
  // Setup UI handlers.
70
71
  var handleClickWrapper = useCallback(function (event) {
@@ -251,7 +252,6 @@ function Component(_ref) {
251
252
  handleInvoke: handleInvoke,
252
253
  analytics: analytics,
253
254
  isSelected: isSelected,
254
- isFrameVisible: isFrameVisible,
255
255
  frameStyle: frameStyle,
256
256
  platform: platform,
257
257
  onResolve: onResolve,
@@ -1,4 +1,4 @@
1
- import React, { useMemo } from 'react';
1
+ import React from 'react';
2
2
  import { className, LinkWrapper, Wrapper, Header, IconWrapper, TextWrapper, Content } from './styled';
3
3
  import { handleClickCommon } from '../../BlockCard/utils/handlers';
4
4
  import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
@@ -10,8 +10,8 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
10
10
  icon = _ref.icon,
11
11
  text = _ref.text,
12
12
  isSelected = _ref.isSelected,
13
- isFrameVisible = _ref.isFrameVisible,
14
- frameStyle = _ref.frameStyle,
13
+ _ref$frameStyle = _ref.frameStyle,
14
+ frameStyle = _ref$frameStyle === void 0 ? 'showOnHover' : _ref$frameStyle,
15
15
  href = _ref.href,
16
16
  minWidth = _ref.minWidth,
17
17
  maxWidth = _ref.maxWidth,
@@ -27,9 +27,6 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
27
27
  return handleClickCommon(event, onClick);
28
28
  };
29
29
  var handleMouseDown = useMouseDownEvent();
30
- var calculatedFrameStyle = useMemo(function () {
31
- return frameStyle !== undefined ? frameStyle : isFrameVisible ? 'show' : 'showOnHover';
32
- }, [frameStyle, isFrameVisible]);
33
30
  var renderHeader = function renderHeader() {
34
31
  return /*#__PURE__*/React.createElement(Header, {
35
32
  className: "embed-header",
@@ -57,7 +54,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
57
54
  className: className,
58
55
  isInteractive: isInteractive(),
59
56
  isSelected: isSelected,
60
- frameStyle: calculatedFrameStyle,
57
+ frameStyle: frameStyle,
61
58
  minWidth: minWidth,
62
59
  maxWidth: maxWidth,
63
60
  "data-testid": testId,
@@ -73,7 +70,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
73
70
  isInteractive: isInteractive(),
74
71
  isSelected: isSelected,
75
72
  minWidth: minWidth,
76
- frameStyle: calculatedFrameStyle,
73
+ frameStyle: frameStyle,
77
74
  maxWidth: maxWidth,
78
75
  "data-testid": testId,
79
76
  "data-trello-do-not-use-override": testId,
@@ -26,7 +26,6 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
26
26
  analytics = _ref.analytics,
27
27
  handleInvoke = _ref.handleInvoke,
28
28
  isSelected = _ref.isSelected,
29
- isFrameVisible = _ref.isFrameVisible,
30
29
  frameStyle = _ref.frameStyle,
31
30
  platform = _ref.platform,
32
31
  onResolve = _ref.onResolve,
@@ -64,7 +63,6 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
64
63
  if (resolvedViewProps.preview) {
65
64
  return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
66
65
  isSelected: isSelected,
67
- isFrameVisible: isFrameVisible,
68
66
  frameStyle: frameStyle,
69
67
  inheritDimensions: inheritDimensions,
70
68
  onClick: handleFrameClick,
@@ -107,6 +105,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
107
105
  analytics: analytics,
108
106
  context: unauthorisedViewProps.context,
109
107
  extensionKey: extensionKey,
108
+ frameStyle: frameStyle,
110
109
  isProductIntegrationSupported: isProductIntegrationSupported,
111
110
  inheritDimensions: inheritDimensions,
112
111
  isSelected: isSelected,
@@ -127,8 +126,8 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
127
126
  if (forbiddenViewProps.preview) {
128
127
  return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, forbiddenViewProps, {
129
128
  title: forbiddenViewProps.link,
129
+ frameStyle: frameStyle,
130
130
  isSelected: isSelected,
131
- isFrameVisible: isFrameVisible,
132
131
  inheritDimensions: inheritDimensions,
133
132
  onClick: handleFrameClick,
134
133
  ref: iframeRef
@@ -142,6 +141,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
142
141
  });
143
142
  return /*#__PURE__*/React.createElement(ForbiddenView, {
144
143
  context: forbiddenViewProps.context,
144
+ frameStyle: frameStyle,
145
145
  inheritDimensions: inheritDimensions,
146
146
  isSelected: isSelected,
147
147
  onAuthorize: handleAuthorize,
@@ -165,6 +165,7 @@ export var EmbedCard = /*#__PURE__*/React.forwardRef(function (_ref, iframeRef)
165
165
  }) : undefined;
166
166
  return /*#__PURE__*/React.createElement(NotFoundView, {
167
167
  context: notFoundViewProps.context,
168
+ frameStyle: frameStyle,
168
169
  inheritDimensions: inheritDimensions,
169
170
  isSelected: isSelected,
170
171
  onClick: handleFrameClick,
@@ -11,7 +11,6 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
11
11
  context = _ref.context,
12
12
  onClick = _ref.onClick,
13
13
  isSelected = _ref.isSelected,
14
- isFrameVisible = _ref.isFrameVisible,
15
14
  frameStyle = _ref.frameStyle,
16
15
  preview = _ref.preview,
17
16
  title = _ref.title,
@@ -49,7 +48,6 @@ export var EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(function (_ref,
49
48
  }
50
49
  return jsx(ExpandedFrame, {
51
50
  isSelected: isSelected,
52
- isFrameVisible: isFrameVisible,
53
51
  frameStyle: frameStyle,
54
52
  href: link,
55
53
  testId: testId,
@@ -8,6 +8,7 @@ import { containerStyles, contentStyles, descriptionStyles, imageStyles, titleSt
8
8
  var UnresolvedView = function UnresolvedView(_ref) {
9
9
  var button = _ref.button,
10
10
  description = _ref.description,
11
+ frameStyle = _ref.frameStyle,
11
12
  iconUrlOrElement = _ref.icon,
12
13
  image = _ref.image,
13
14
  inheritDimensions = _ref.inheritDimensions,
@@ -31,8 +32,15 @@ var UnresolvedView = function UnresolvedView(_ref) {
31
32
  });
32
33
  }, [iconUrlOrElement]);
33
34
  return jsx(ExpandedFrame, {
34
- allowScrollBar: true,
35
- frameStyle: "show",
35
+ allowScrollBar: true
36
+ // EDM-9259: Fix embed frame showing on unresolved views when frameStyle is set to hide.
37
+ // Set fallback to 'show' here to maintain the current behaviour when platform.editor.show-embed-card-frame-renderer is OFF.
38
+ // Remove 'show' on platform.editor.show-embed-card-frame-renderer cleanup as frameStyle will be set to 'show' both in renderer and editor.
39
+ // We want all views to be consistent and respect frameStyle instead of
40
+ // having resolved view default to showOnHover and unresolved view default to show.
41
+ // Default frameStyle is set inside <ExpandedFrame />
42
+ ,
43
+ frameStyle: frameStyle !== null && frameStyle !== void 0 ? frameStyle : 'show',
36
44
  href: url,
37
45
  icon: icon,
38
46
  inheritDimensions: inheritDimensions,
@@ -7,8 +7,6 @@ import _regeneratorRuntime from "@babel/runtime/regenerator";
7
7
  import React from 'react';
8
8
  import Action from '../index';
9
9
  import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
10
- import { FormattedMessage } from 'react-intl-next';
11
- import { messages } from '../../../../../../messages';
12
10
  import { openEmbedModalWithFlexibleUiIcon } from '../../../utils';
13
11
  import useInvokeClientAction from '../../../../../../state/hooks/use-invoke-client-action';
14
12
  import { ActionName } from '../../../../../../constants';
@@ -68,8 +66,7 @@ var PreviewAction = function PreviewAction(props) {
68
66
  if (_onClick) {
69
67
  _onClick();
70
68
  }
71
- },
72
- content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_improved)
69
+ }
73
70
  });
74
71
  return /*#__PURE__*/React.createElement(Action, _extends({}, action, {
75
72
  appearance: appearance,
@@ -12,11 +12,10 @@ import Block from '../../block';
12
12
  import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize } from '../../../../../../constants';
13
13
  import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles } from '../../../utils';
14
14
  import ElementGroup from '../../element-group';
15
- import { tokens } from '../../../../../../utils/token';
16
- var actionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n"])), tokens.errorMessageHover);
15
+ var actionStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n cursor: pointer;\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n"])), "var(--ds-text-subtle, #8993A4)");
17
16
  var getMessageStyles = function getMessageStyles(size, hasAction) {
18
17
  var sizeStyles = getLinkSizeStyles(size);
19
- return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n justify-content: flex-end;\n ", "\n ", "\n ", "\n color: ", ";\n :focus {\n outline: ", " solid 2px;\n }\n "])), hasAction ? actionStyles : '', sizeStyles, getTruncateStyles(1, getLinkLineHeight(size)), tokens.errorMessage, tokens.focus);
18
+ return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n flex: 1 1 auto;\n justify-content: flex-end;\n ", "\n ", "\n ", "\n color: ", ";\n :focus {\n outline: ", " solid 2px;\n }\n "])), hasAction ? actionStyles : '', sizeStyles, getTruncateStyles(1, getLinkLineHeight(size)), "var(--ds-text-disabled, #6B778C)", "var(--ds-border-focused, #388BFF)");
20
19
  };
21
20
 
22
21
  /**
@@ -5,7 +5,6 @@ import React, { useContext } from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import { MediaPlacement, SmartLinkSize, SmartLinkTheme } from '../../../../constants';
7
7
  import { isFlexibleUiBlock, isFlexibleUiPreviewBlock, isFlexibleUiTitleBlock } from '../../../../utils/flexible';
8
- import { tokens } from '../../../../utils/token';
9
8
  import { FlexibleUiContext } from '../../../../state/flexible-ui-context';
10
9
  import LayeredLink from './layered-link';
11
10
  import HoverCardControl from './hover-card-control';
@@ -68,7 +67,7 @@ var getChildrenOptions = function getChildrenOptions(children, context) {
68
67
  };
69
68
  export var getContainerStyles = function getContainerStyles(size, hideBackground, hideElevation, hidePadding, clickableContainer, childrenOptions) {
70
69
  var paddingCss = getContainerPaddingStyles(size, hidePadding, childrenOptions);
71
- return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n gap: ", " 0;\n flex-direction: column;\n min-width: 0;\n overflow-x: hidden;\n position: relative;\n ", "\n ", "\n ", "\n ", "\n &:hover ~ .actions-button-group {\n opacity: 1;\n }\n a:focus,\n .has-action:focus {\n outline-offset: -2px;\n }\n "])), getGap(size), hideBackground ? '' : "background-color: ".concat(tokens.background, ";"), paddingCss, hideElevation ? '' : elevationStyles, clickableContainer ? clickableContainerStyles : '');
70
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n display: flex;\n gap: ", " 0;\n flex-direction: column;\n min-width: 0;\n overflow-x: hidden;\n position: relative;\n ", "\n ", "\n ", "\n ", "\n &:hover ~ .actions-button-group {\n opacity: 1;\n }\n a:focus,\n .has-action:focus {\n outline-offset: -2px;\n }\n "])), getGap(size), hideBackground ? '' : "background-color: ".concat("var(--ds-surface-raised, #FFFFFF)", ";"), paddingCss, hideElevation ? '' : elevationStyles, clickableContainer ? clickableContainerStyles : '');
72
71
  };
73
72
  var renderChildren = function renderChildren(children, containerSize, containerTheme, status, retry, onClick) {
74
73
  return React.Children.map(children, function (child) {
@@ -4,15 +4,14 @@ var _templateObject, _templateObject2, _templateObject3, _messageMapper;
4
4
  /** @jsx jsx */
5
5
  import React from 'react';
6
6
  import { css, jsx } from '@emotion/react';
7
- import { tokens } from '../../../../../utils/token';
8
7
  import { getFormattedMessage, getIconSizeStyles } from '../../utils';
9
8
  import { IconType } from '../../../../../constants';
10
9
  import { messages } from '../../../../../messages';
11
10
  import ImageIcon from '../../common/image-icon';
12
11
  import AtlaskitIcon from '../../common/atlaskit-icon';
13
12
  var badgeStyles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n align-items: center;\n display: inline-flex;\n min-width: fit-content;\n"])));
14
- var iconStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n line-height: 0;\n vertical-align: middle;\n ", "\n img,\n span,\n svg {\n line-height: 0;\n vertical-align: middle;\n }\n"])), tokens.badgeIcon, getIconSizeStyles('1rem'));
15
- var labelStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n padding-left: 0.125rem;\n vertical-align: middle;\n"])), tokens.badgeText);
13
+ var iconStyles = css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n color: ", ";\n line-height: 0;\n vertical-align: middle;\n ", "\n img,\n span,\n svg {\n line-height: 0;\n vertical-align: middle;\n }\n"])), "var(--ds-icon-subtle, #626F86)", getIconSizeStyles('1rem'));
14
+ var labelStyles = css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n padding-left: 0.125rem;\n vertical-align: middle;\n"])), "var(--ds-text-subtlest, #626F86)");
16
15
  var messageMapper = (_messageMapper = {}, _defineProperty(_messageMapper, IconType.PriorityBlocker, messages.priority_blocker), _defineProperty(_messageMapper, IconType.PriorityCritical, messages.priority_critical), _defineProperty(_messageMapper, IconType.PriorityHigh, messages.priority_high), _defineProperty(_messageMapper, IconType.PriorityHighest, messages.priority_highest), _defineProperty(_messageMapper, IconType.PriorityLow, messages.priority_low), _defineProperty(_messageMapper, IconType.PriorityLowest, messages.priority_lowest), _defineProperty(_messageMapper, IconType.PriorityMajor, messages.priority_major), _defineProperty(_messageMapper, IconType.PriorityMedium, messages.priority_medium), _defineProperty(_messageMapper, IconType.PriorityMinor, messages.priority_minor), _defineProperty(_messageMapper, IconType.PriorityTrivial, messages.priority_trivial), _defineProperty(_messageMapper, IconType.PriorityUndefined, messages.priority_undefined), _messageMapper);
17
16
  var getFormattedMessageFromIcon = function getFormattedMessageFromIcon(icon) {
18
17
  if (icon) {
@@ -6,10 +6,9 @@ import React from 'react';
6
6
  import { useIntl, FormattedMessage } from 'react-intl-next';
7
7
  import { css, jsx } from '@emotion/react';
8
8
  import { getTruncateStyles } from '../../utils';
9
- import { tokens } from '../../../../../utils/token';
10
9
  import { selectUnit } from '@formatjs/intl-utils';
11
10
  import { messages } from '../../../../../messages';
12
- var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n ", "\n"])), tokens.text, getTruncateStyles(1));
11
+ var styles = css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n ", "\n"])), "var(--ds-text-subtlest, #626F86)", getTruncateStyles(1));
13
12
  var typeToDescriptorMap = {
14
13
  created: {
15
14
  relative: messages.created_on_relative,
@@ -7,7 +7,6 @@ import { css, jsx } from '@emotion/react';
7
7
  import Tooltip from '@atlaskit/tooltip';
8
8
  import { SmartLinkInternalTheme, SmartLinkSize, SmartLinkTheme } from '../../../../../constants';
9
9
  import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles, hasWhiteSpace } from '../../utils';
10
- import { tokens } from '../../../../../utils/token';
11
10
  import { useMouseDownEvent } from '../../../../../state/analytics/useLinkClicked';
12
11
  var DEFAULT_MAX_LINES = 2;
13
12
  var MAXIMUM_MAX_LINES = 2;
@@ -21,10 +20,10 @@ var getThemeStyles = function getThemeStyles(theme) {
21
20
  return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n a& {\n color: ", ";\n &:active,\n &:visited,\n &:focus,\n &:hover {\n color: ", ";\n text-decoration: underline;\n }\n font-size: 12px;\n }\n "])), "var(--ds-text-subtlest, #626F86)", "var(--ds-text-subtlest, #626F86)");
22
21
  // eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
23
22
  case SmartLinkTheme.Black:
24
- return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])), tokens.blackLink, tokens.blackLinkPressed, tokens.blackLink);
23
+ return css(_templateObject3 || (_templateObject3 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])), "var(--ds-text-subtle, #44546F)", "var(--ds-text, #172B4D)", "var(--ds-text-subtle, #44546F)");
25
24
  case SmartLinkTheme.Link:
26
25
  default:
27
- return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])), tokens.blueLink, tokens.blueLinkPressed, tokens.blueLink);
26
+ return css(_templateObject4 || (_templateObject4 = _taggedTemplateLiteral(["\n color: ", ";\n :active {\n color: ", ";\n }\n :hover {\n color: ", ";\n text-decoration: underline;\n }\n "])), "var(--ds-link, #0C66E4)", "var(--ds-link-pressed, #0055CC)", "var(--ds-link, #0C66E4)");
28
27
  }
29
28
  };
30
29
  var getAnchorStyles = function getAnchorStyles(size, theme, maxLines, hasSpace) {
@@ -4,9 +4,8 @@ var _templateObject;
4
4
  import React from 'react';
5
5
  import { css, jsx } from '@emotion/react';
6
6
  import { getFormattedMessage, getTruncateStyles } from '../../utils';
7
- import { tokens } from '../../../../../utils/token';
8
7
  var getStyles = function getStyles(maxLines) {
9
- return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n white-space: normal;\n ", "\n"])), tokens.text, getTruncateStyles(maxLines));
8
+ return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n white-space: normal;\n ", "\n"])), "var(--ds-text-subtlest, #626F86)", getTruncateStyles(maxLines));
10
9
  };
11
10
 
12
11
  /**
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
10
10
  import LinkWarningModal from './LinkWarningModal';
11
11
  var PACKAGE_DATA = {
12
12
  packageName: "@atlaskit/smart-card",
13
- packageVersion: "26.48.3",
13
+ packageVersion: "26.48.4",
14
14
  componentName: 'linkUrl'
15
15
  };
16
16
  var Link = withLinkClickedEvent('a');
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { CardProps } from '../view/Card';
2
+ import type { CardProps } from '../view/Card';
3
+ import { FrameStyle } from '../view/EmbedCard/types';
3
4
  export declare const isCardWithData: (props: CardProps) => boolean;
4
5
  export declare const isSpecialEvent: (evt: React.MouseEvent | React.KeyboardEvent) => boolean;
5
6
  export declare const isIframe: () => boolean;
@@ -23,3 +24,8 @@ export declare const sleep: (ms: number) => Promise<void>;
23
24
  export declare const importWithRetry: <T>(importFn: () => Promise<T>, retries?: number, interval?: number) => Promise<T>;
24
25
  export declare const downloadUrl: (url?: string) => Promise<void>;
25
26
  export declare const openUrl: (url?: string) => Promise<void>;
27
+ /**
28
+ * Migrate internal usages of the deprecated isFrameVisible to frameStyle
29
+ * This function is to be removed on deprecation of isFrameVisible.
30
+ */
31
+ export declare const combineFrameStyle: (frameStyle?: CardProps['frameStyle'], isFrameVisible?: CardProps['isFrameVisible']) => FrameStyle | undefined;
@@ -10,8 +10,6 @@ export interface ExpandedFrameProps {
10
10
  children?: React.ReactNode;
11
11
  /** A flag that determines whether the card is selected in edit mode. */
12
12
  isSelected?: boolean;
13
- /** @deprecated use frameStyle prop */
14
- isFrameVisible?: boolean;
15
13
  /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
16
14
  frameStyle?: FrameStyle;
17
15
  /** The optional click handler */
@@ -16,7 +16,6 @@ export type EmbedCardProps = {
16
16
  handleInvoke: InvokeHandler;
17
17
  id?: string;
18
18
  isSelected?: boolean;
19
- isFrameVisible?: boolean;
20
19
  frameStyle?: FrameStyle;
21
20
  platform?: CardPlatform;
22
21
  onResolve?: OnResolveCallback;
@@ -9,8 +9,6 @@ export interface EmbedCardResolvedViewProps {
9
9
  link: string;
10
10
  /** A flag that determines whether the card is selected in edit mode. */
11
11
  isSelected?: boolean;
12
- /** will show the frame regardless of user interaction */
13
- isFrameVisible?: boolean;
14
12
  /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
15
13
  frameStyle?: FrameStyle;
16
14
  /** The src to be used for the `iframe` */
@@ -1,7 +1,7 @@
1
- import { RequestAccessContextProps } from '../../../types';
2
- import { ContextViewModel } from '../../types';
3
- import { UnresolvedViewProps } from '../unresolved-view/types';
4
- export type ForbiddenViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
1
+ import type { RequestAccessContextProps } from '../../../types';
2
+ import type { ContextViewModel } from '../../types';
3
+ import type { UnresolvedViewCardProps } from '../unresolved-view/types';
4
+ export type ForbiddenViewProps = UnresolvedViewCardProps & {
5
5
  context?: ContextViewModel;
6
6
  onAuthorize?: () => void;
7
7
  accessContext: RequestAccessContextProps;
@@ -1,7 +1,7 @@
1
- import { RequestAccessContextProps } from '../../../types';
2
- import { ContextViewModel } from '../../types';
3
- import { UnresolvedViewProps } from '../unresolved-view/types';
4
- export type NotFoundViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
1
+ import type { RequestAccessContextProps } from '../../../types';
2
+ import type { ContextViewModel } from '../../types';
3
+ import type { UnresolvedViewCardProps } from '../unresolved-view/types';
4
+ export type NotFoundViewProps = UnresolvedViewCardProps & {
5
5
  context?: ContextViewModel;
6
6
  accessContext?: RequestAccessContextProps;
7
7
  };
@@ -1,7 +1,7 @@
1
1
  import type { AnalyticsFacade } from '../../../../state/analytics';
2
- import { ContextViewModel } from '../../types';
3
- import { UnresolvedViewProps } from '../unresolved-view/types';
4
- export type UnauthorizedViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
2
+ import type { ContextViewModel } from '../../types';
3
+ import type { UnresolvedViewCardProps } from '../unresolved-view/types';
4
+ export type UnauthorizedViewProps = UnresolvedViewCardProps & {
5
5
  analytics: AnalyticsFacade;
6
6
  context?: ContextViewModel;
7
7
  extensionKey?: string;
@@ -1,5 +1,8 @@
1
- import type { MouseEvent, ReactNode } from 'react';
2
- export type UnresolvedViewProps = {
1
+ import type { ReactNode } from 'react';
2
+ import type { CardProps } from '../../../Card/types';
3
+ /** Props derived from <Card /> for base embed functionalities */
4
+ export type UnresolvedViewCardProps = Pick<CardProps, 'frameStyle' | 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'>;
5
+ export type UnresolvedViewProps = UnresolvedViewCardProps & {
3
6
  /** An action button */
4
7
  button?: ReactNode;
5
8
  /** A detail and instruction of the unresolved link */
@@ -8,18 +11,8 @@ export type UnresolvedViewProps = {
8
11
  icon: string | ReactNode;
9
12
  /** A provider or visual aids for the unresolved link */
10
13
  image: string;
11
- /** A flag whether the embed frame should inherit parent dimension */
12
- inheritDimensions?: boolean;
13
- /** A flag whether the embed frame is selected */
14
- isSelected?: boolean;
15
- /** An action when a link text is clicked */
16
- onClick?: (evt: MouseEvent) => void;
17
14
  /** A link text displayed on embed frame */
18
15
  text?: string;
19
- /** A `testId` prop is provided for specified elements, which is a unique string that appears as a data attribute `data-testid` in the rendered code, serving as a hook for automated tests */
20
- testId?: string;
21
16
  /** A title for the unresolved link */
22
17
  title: ReactNode;
23
- /** A link url */
24
- url: string;
25
18
  };
@@ -1,5 +1,6 @@
1
1
  import React from 'react';
2
- import { CardProps } from '../view/Card';
2
+ import type { CardProps } from '../view/Card';
3
+ import { FrameStyle } from '../view/EmbedCard/types';
3
4
  export declare const isCardWithData: (props: CardProps) => boolean;
4
5
  export declare const isSpecialEvent: (evt: React.MouseEvent | React.KeyboardEvent) => boolean;
5
6
  export declare const isIframe: () => boolean;
@@ -23,3 +24,8 @@ export declare const sleep: (ms: number) => Promise<void>;
23
24
  export declare const importWithRetry: <T>(importFn: () => Promise<T>, retries?: number, interval?: number) => Promise<T>;
24
25
  export declare const downloadUrl: (url?: string) => Promise<void>;
25
26
  export declare const openUrl: (url?: string) => Promise<void>;
27
+ /**
28
+ * Migrate internal usages of the deprecated isFrameVisible to frameStyle
29
+ * This function is to be removed on deprecation of isFrameVisible.
30
+ */
31
+ export declare const combineFrameStyle: (frameStyle?: CardProps['frameStyle'], isFrameVisible?: CardProps['isFrameVisible']) => FrameStyle | undefined;
@@ -10,8 +10,6 @@ export interface ExpandedFrameProps {
10
10
  children?: React.ReactNode;
11
11
  /** A flag that determines whether the card is selected in edit mode. */
12
12
  isSelected?: boolean;
13
- /** @deprecated use frameStyle prop */
14
- isFrameVisible?: boolean;
15
13
  /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
16
14
  frameStyle?: FrameStyle;
17
15
  /** The optional click handler */
@@ -16,7 +16,6 @@ export type EmbedCardProps = {
16
16
  handleInvoke: InvokeHandler;
17
17
  id?: string;
18
18
  isSelected?: boolean;
19
- isFrameVisible?: boolean;
20
19
  frameStyle?: FrameStyle;
21
20
  platform?: CardPlatform;
22
21
  onResolve?: OnResolveCallback;
@@ -9,8 +9,6 @@ export interface EmbedCardResolvedViewProps {
9
9
  link: string;
10
10
  /** A flag that determines whether the card is selected in edit mode. */
11
11
  isSelected?: boolean;
12
- /** will show the frame regardless of user interaction */
13
- isFrameVisible?: boolean;
14
12
  /** A prop that determines the style of a frame: whether to show it, hide it or only show it when a user hovers over embed */
15
13
  frameStyle?: FrameStyle;
16
14
  /** The src to be used for the `iframe` */
@@ -1,7 +1,7 @@
1
- import { RequestAccessContextProps } from '../../../types';
2
- import { ContextViewModel } from '../../types';
3
- import { UnresolvedViewProps } from '../unresolved-view/types';
4
- export type ForbiddenViewProps = Pick<UnresolvedViewProps, 'inheritDimensions' | 'isSelected' | 'onClick' | 'testId' | 'url'> & {
1
+ import type { RequestAccessContextProps } from '../../../types';
2
+ import type { ContextViewModel } from '../../types';
3
+ import type { UnresolvedViewCardProps } from '../unresolved-view/types';
4
+ export type ForbiddenViewProps = UnresolvedViewCardProps & {
5
5
  context?: ContextViewModel;
6
6
  onAuthorize?: () => void;
7
7
  accessContext: RequestAccessContextProps;