@atlaskit/smart-card 26.48.2 → 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 (88) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +79 -33
  3. package/dist/cjs/state/hooks/use-ai-summary/index.js +41 -16
  4. package/dist/cjs/utils/analytics/analytics.js +1 -1
  5. package/dist/cjs/utils/index.js +15 -2
  6. package/dist/cjs/view/CardWithUrl/component.js +2 -2
  7. package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +6 -11
  8. package/dist/cjs/view/EmbedCard/index.js +4 -3
  9. package/dist/cjs/view/EmbedCard/views/ResolvedView.js +0 -2
  10. package/dist/cjs/view/EmbedCard/views/unresolved-view/index.js +10 -2
  11. package/dist/cjs/view/FlexibleCard/components/actions/action/preview-action/index.js +1 -4
  12. package/dist/cjs/view/FlexibleCard/components/blocks/title-block/errored/index.js +2 -3
  13. package/dist/cjs/view/FlexibleCard/components/container/index.js +1 -2
  14. package/dist/cjs/view/FlexibleCard/components/elements/badge/index.js +2 -3
  15. package/dist/cjs/view/FlexibleCard/components/elements/date-time/index.js +1 -2
  16. package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +2 -3
  17. package/dist/cjs/view/FlexibleCard/components/elements/text/index.js +1 -2
  18. package/dist/cjs/view/HoverCard/utils.js +1 -1
  19. package/dist/cjs/view/LinkUrl/index.js +1 -1
  20. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +17 -8
  21. package/dist/es2019/state/hooks/use-ai-summary/index.js +38 -17
  22. package/dist/es2019/utils/analytics/analytics.js +1 -1
  23. package/dist/es2019/utils/index.js +13 -0
  24. package/dist/es2019/view/CardWithUrl/component.js +3 -3
  25. package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +4 -6
  26. package/dist/es2019/view/EmbedCard/index.js +4 -3
  27. package/dist/es2019/view/EmbedCard/views/ResolvedView.js +0 -2
  28. package/dist/es2019/view/EmbedCard/views/unresolved-view/index.js +10 -2
  29. package/dist/es2019/view/FlexibleCard/components/actions/action/preview-action/index.js +1 -4
  30. package/dist/es2019/view/FlexibleCard/components/blocks/title-block/errored/index.js +3 -4
  31. package/dist/es2019/view/FlexibleCard/components/container/index.js +1 -2
  32. package/dist/es2019/view/FlexibleCard/components/elements/badge/index.js +2 -3
  33. package/dist/es2019/view/FlexibleCard/components/elements/date-time/index.js +1 -2
  34. package/dist/es2019/view/FlexibleCard/components/elements/link/index.js +6 -7
  35. package/dist/es2019/view/FlexibleCard/components/elements/text/index.js +1 -2
  36. package/dist/es2019/view/HoverCard/utils.js +1 -1
  37. package/dist/es2019/view/LinkUrl/index.js +1 -1
  38. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +79 -33
  39. package/dist/esm/state/hooks/use-ai-summary/index.js +42 -17
  40. package/dist/esm/utils/analytics/analytics.js +1 -1
  41. package/dist/esm/utils/index.js +14 -1
  42. package/dist/esm/view/CardWithUrl/component.js +3 -3
  43. package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +5 -8
  44. package/dist/esm/view/EmbedCard/index.js +4 -3
  45. package/dist/esm/view/EmbedCard/views/ResolvedView.js +0 -2
  46. package/dist/esm/view/EmbedCard/views/unresolved-view/index.js +10 -2
  47. package/dist/esm/view/FlexibleCard/components/actions/action/preview-action/index.js +1 -4
  48. package/dist/esm/view/FlexibleCard/components/blocks/title-block/errored/index.js +2 -3
  49. package/dist/esm/view/FlexibleCard/components/container/index.js +1 -2
  50. package/dist/esm/view/FlexibleCard/components/elements/badge/index.js +2 -3
  51. package/dist/esm/view/FlexibleCard/components/elements/date-time/index.js +1 -2
  52. package/dist/esm/view/FlexibleCard/components/elements/link/index.js +2 -3
  53. package/dist/esm/view/FlexibleCard/components/elements/text/index.js +1 -2
  54. package/dist/esm/view/HoverCard/utils.js +1 -1
  55. package/dist/esm/view/LinkUrl/index.js +1 -1
  56. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +2 -2
  57. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +1 -1
  58. package/dist/types/state/hooks/use-ai-summary/index.d.ts +1 -1
  59. package/dist/types/utils/index.d.ts +7 -1
  60. package/dist/types/view/EmbedCard/components/ExpandedFrame.d.ts +0 -2
  61. package/dist/types/view/EmbedCard/types.d.ts +0 -1
  62. package/dist/types/view/EmbedCard/views/ResolvedView.d.ts +0 -2
  63. package/dist/types/view/EmbedCard/views/forbidden-view/types.d.ts +4 -4
  64. package/dist/types/view/EmbedCard/views/not-found-view/types.d.ts +4 -4
  65. package/dist/types/view/EmbedCard/views/unauthorized-view/types.d.ts +3 -3
  66. package/dist/types/view/EmbedCard/views/unresolved-view/types.d.ts +5 -12
  67. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/index.d.ts +2 -2
  68. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +1 -1
  69. package/dist/types-ts4.5/state/hooks/use-ai-summary/index.d.ts +1 -1
  70. package/dist/types-ts4.5/utils/index.d.ts +7 -1
  71. package/dist/types-ts4.5/view/EmbedCard/components/ExpandedFrame.d.ts +0 -2
  72. package/dist/types-ts4.5/view/EmbedCard/types.d.ts +0 -1
  73. package/dist/types-ts4.5/view/EmbedCard/views/ResolvedView.d.ts +0 -2
  74. package/dist/types-ts4.5/view/EmbedCard/views/forbidden-view/types.d.ts +4 -4
  75. package/dist/types-ts4.5/view/EmbedCard/views/not-found-view/types.d.ts +4 -4
  76. package/dist/types-ts4.5/view/EmbedCard/views/unauthorized-view/types.d.ts +3 -3
  77. package/dist/types-ts4.5/view/EmbedCard/views/unresolved-view/types.d.ts +5 -12
  78. package/package.json +2 -2
  79. package/dist/cjs/utils/token.js +0 -27
  80. package/dist/cjs/view/EmbedCard/views/UnresolvedView.js +0 -82
  81. package/dist/es2019/utils/token.js +0 -21
  82. package/dist/es2019/view/EmbedCard/views/UnresolvedView.js +0 -75
  83. package/dist/esm/utils/token.js +0 -21
  84. package/dist/esm/view/EmbedCard/views/UnresolvedView.js +0 -74
  85. package/dist/types/utils/token.d.ts +0 -21
  86. package/dist/types/view/EmbedCard/views/UnresolvedView.d.ts +0 -22
  87. package/dist/types-ts4.5/utils/token.d.ts +0 -21
  88. package/dist/types-ts4.5/view/EmbedCard/views/UnresolvedView.d.ts +0 -22
@@ -9,11 +9,10 @@ var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/hel
9
9
  var _react = _interopRequireDefault(require("react"));
10
10
  var _react2 = require("@emotion/react");
11
11
  var _utils = require("../../utils");
12
- var _token = require("../../../../../utils/token");
13
12
  var _templateObject;
14
13
  /** @jsx jsx */
15
14
  var getStyles = function getStyles(maxLines) {
16
- return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n white-space: normal;\n ", "\n"])), _token.tokens.text, (0, _utils.getTruncateStyles)(maxLines));
15
+ return (0, _react2.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n color: ", ";\n font-size: 0.75rem;\n line-height: 1rem;\n white-space: normal;\n ", "\n"])), "var(--ds-text-subtlest, #626F86)", (0, _utils.getTruncateStyles)(maxLines));
17
16
  };
18
17
 
19
18
  /**
@@ -210,5 +210,5 @@ var getIsAISummaryEnabled = exports.getIsAISummaryEnabled = function getIsAISumm
210
210
  var _response$meta;
211
211
  var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
212
212
  var response = arguments.length > 1 ? arguments[1] : undefined;
213
- return Boolean((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeatures) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('AISummary')));
213
+ return Boolean((0, _platformFeatureFlags.getBooleanFF)('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('AISummary')));
214
214
  };
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
17
17
  _excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
18
18
  var PACKAGE_DATA = {
19
19
  packageName: "@atlaskit/smart-card",
20
- packageVersion: "26.48.2",
20
+ packageVersion: "26.48.4",
21
21
  componentName: 'linkUrl'
22
22
  };
23
23
  var Link = (0, _click.withLinkClickedEvent)('a');
@@ -6,7 +6,7 @@ export class AISummaryService {
6
6
  content: '',
7
7
  status: 'ready'
8
8
  });
9
- _defineProperty(this, "subscribedStateSetter", state => {});
9
+ _defineProperty(this, "subscribedStateSetters", new Set());
10
10
  _defineProperty(this, "fetchStream", async summaryStyle => {
11
11
  const payload = {
12
12
  recipient_agent_named_id: 'summary_agent',
@@ -47,25 +47,34 @@ export class AISummaryService {
47
47
  ...this.state,
48
48
  status: 'loading'
49
49
  };
50
- this.subscribedStateSetter(this.state);
50
+ for (const subscriber of this.subscribedStateSetters) {
51
+ subscriber(this.state);
52
+ }
51
53
  const stream = await this.fetchStream(summaryStyle);
52
54
  let bufferContent = '';
53
55
  for await (const chunk of stream) {
54
56
  if (chunk.type === 'ANSWER_PART') {
55
57
  bufferContent += chunk.message.content;
56
- this.subscribedStateSetter({
57
- ...this.state,
58
- content: bufferContent
59
- });
58
+ for (const subscriber of this.subscribedStateSetters) {
59
+ subscriber({
60
+ ...this.state,
61
+ content: bufferContent
62
+ });
63
+ }
60
64
  }
61
65
  }
62
66
  this.state = {
63
67
  status: 'done',
64
68
  content: bufferContent
65
69
  };
66
- this.subscribedStateSetter(this.state);
70
+ for (const subscriber of this.subscribedStateSetters) {
71
+ subscriber(this.state);
72
+ }
67
73
  }
68
74
  subscribe(stateSetter) {
69
- this.subscribedStateSetter = stateSetter;
75
+ this.subscribedStateSetters.add(stateSetter);
76
+ return () => {
77
+ this.subscribedStateSetters.delete(stateSetter);
78
+ };
70
79
  }
71
80
  }
@@ -1,34 +1,55 @@
1
- import { useState, useEffect } from 'react';
1
+ import { useState, useEffect, useMemo } from 'react';
2
2
  import { AISummariesStore } from './ai-summary-service/store';
3
3
  import { AISummaryService } from './ai-summary-service';
4
4
  export const useAISummary = props => {
5
+ var _AISummariesStore$get;
5
6
  const {
6
- url
7
+ url,
8
+ baseUrl,
9
+ product,
10
+ headers
7
11
  } = props;
8
- const aISummaryService = AISummariesStore.get(url);
9
- const isAISummaryServiceInitiated = !!aISummaryService;
10
- const [state, setState] = useState(isAISummaryServiceInitiated ? aISummaryService.state : {
12
+ const [state, setState] = useState(((_AISummariesStore$get = AISummariesStore.get(url)) === null || _AISummariesStore$get === void 0 ? void 0 : _AISummariesStore$get.state) || {
11
13
  status: 'ready',
12
14
  content: ''
13
15
  });
14
- const isSummarised = isAISummaryServiceInitiated && state.status === 'done';
16
+
17
+ // Can be used to know the summary status upon mounting a component (HoverCard UI state for example).
18
+ // For other scenarios, opt for dynamic status updates via state.status.
19
+ const isSummarisedOnMount = useMemo(() => {
20
+ var _AISummariesStore$get2;
21
+ return ((_AISummariesStore$get2 = AISummariesStore.get(url)) === null || _AISummariesStore$get2 === void 0 ? void 0 : _AISummariesStore$get2.state.status) === 'done';
22
+ }, [url]);
15
23
  useEffect(() => {
16
- if (!isSummarised) {
17
- var _AISummariesStore$get;
18
- if (!isAISummaryServiceInitiated) {
19
- AISummariesStore.set(url, new AISummaryService(props));
24
+ // Create or subscribe to an AI service only if a summary has not been previously generated.
25
+ // Otherwise, use the data from the current state synchronized with a cache (AISummariesStore).
26
+ if (!isSummarisedOnMount) {
27
+ const aISummaryService = AISummariesStore.get(url);
28
+ const isAISummaryServiceInitiated = !!aISummaryService;
29
+ if (isAISummaryServiceInitiated) {
30
+ //if we want to subscribe to updates from an existing AI service that has not yet provided a summary or is currently in progress.
31
+ const unsubscribe = aISummaryService.subscribe(setState);
32
+ return () => unsubscribe();
33
+ } else {
34
+ var _AISummariesStore$get3;
35
+ //if we want to create a new AI service and wish to subscribe for updates
36
+ AISummariesStore.set(url, new AISummaryService({
37
+ url,
38
+ baseUrl,
39
+ product,
40
+ headers
41
+ }));
42
+ const unsubscribe = (_AISummariesStore$get3 = AISummariesStore.get(url)) === null || _AISummariesStore$get3 === void 0 ? void 0 : _AISummariesStore$get3.subscribe(setState);
43
+ return () => unsubscribe && unsubscribe();
20
44
  }
21
- return (_AISummariesStore$get = AISummariesStore.get(url)) === null || _AISummariesStore$get === void 0 ? void 0 : _AISummariesStore$get.subscribe(setState);
22
45
  }
23
- }, [isSummarised, isAISummaryServiceInitiated, url, props]);
46
+ }, [isSummarisedOnMount, url, baseUrl, product, headers]);
24
47
  const summariseUrl = () => {
25
- if (isAISummaryServiceInitiated) {
26
- return aISummaryService.summariseUrl();
27
- }
28
- return;
48
+ var _AISummariesStore$get4;
49
+ return (_AISummariesStore$get4 = AISummariesStore.get(url)) === null || _AISummariesStore$get4 === void 0 ? void 0 : _AISummariesStore$get4.summariseUrl();
29
50
  };
30
51
  return {
31
- isSummarised,
52
+ isSummarisedOnMount,
32
53
  summariseUrl,
33
54
  state
34
55
  };
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
4
4
  export const context = {
5
5
  componentName: 'smart-cards',
6
6
  packageName: "@atlaskit/smart-card",
7
- packageVersion: "26.48.2"
7
+ packageVersion: "26.48.4"
8
8
  };
9
9
  export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
10
10
  TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
@@ -154,4 +154,17 @@ export const openUrl = async url => {
154
154
  return;
155
155
  }
156
156
  window.open(url, '_blank', 'noopener=yes');
157
+ };
158
+
159
+ /**
160
+ * Migrate internal usages of the deprecated isFrameVisible to frameStyle
161
+ * This function is to be removed on deprecation of isFrameVisible.
162
+ */
163
+ export const combineFrameStyle = (frameStyle, isFrameVisible) => {
164
+ if (frameStyle !== undefined) {
165
+ return frameStyle;
166
+ }
167
+ if (isFrameVisible) {
168
+ return 'show';
169
+ }
157
170
  };
@@ -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({
20
20
  isSelected,
21
21
  isHovered,
22
22
  isFrameVisible,
23
- frameStyle,
23
+ frameStyle: frameStyleProp,
24
24
  platform,
25
25
  onClick,
26
26
  appearance,
@@ -66,6 +66,7 @@ function Component({
66
66
  let isFlexibleUi = useMemo(() => isFlexibleUiCard(children), [children]);
67
67
  const enableFlexibleBlockCardFlag = Boolean(useFeatureFlag('enableFlexibleBlockCard'));
68
68
  const actionOptions = combineActionOptions(actionOptionsProp, showServerActions, showActions, platform);
69
+ const frameStyle = combineFrameStyle(frameStyleProp, isFrameVisible);
69
70
 
70
71
  // Setup UI handlers.
71
72
  const handleClickWrapper = useCallback(event => {
@@ -248,7 +249,6 @@ function Component({
248
249
  handleInvoke: handleInvoke,
249
250
  analytics: analytics,
250
251
  isSelected: isSelected,
251
- isFrameVisible: isFrameVisible,
252
252
  frameStyle: frameStyle,
253
253
  platform: platform,
254
254
  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';
@@ -9,8 +9,7 @@ export const ExpandedFrame = ({
9
9
  icon,
10
10
  text,
11
11
  isSelected,
12
- isFrameVisible,
13
- frameStyle,
12
+ frameStyle = 'showOnHover',
14
13
  href,
15
14
  minWidth,
16
15
  maxWidth,
@@ -21,7 +20,6 @@ export const ExpandedFrame = ({
21
20
  const isInteractive = () => !isPlaceholder && (Boolean(href) || Boolean(onClick));
22
21
  const handleClick = event => handleClickCommon(event, onClick);
23
22
  const handleMouseDown = useMouseDownEvent();
24
- const calculatedFrameStyle = useMemo(() => frameStyle !== undefined ? frameStyle : isFrameVisible ? 'show' : 'showOnHover', [frameStyle, isFrameVisible]);
25
23
  const renderHeader = () => /*#__PURE__*/React.createElement(Header, {
26
24
  className: "embed-header",
27
25
  frameStyle: frameStyle
@@ -45,7 +43,7 @@ export const ExpandedFrame = ({
45
43
  className: className,
46
44
  isInteractive: isInteractive(),
47
45
  isSelected: isSelected,
48
- frameStyle: calculatedFrameStyle,
46
+ frameStyle: frameStyle,
49
47
  minWidth: minWidth,
50
48
  maxWidth: maxWidth,
51
49
  "data-testid": testId,
@@ -61,7 +59,7 @@ export const ExpandedFrame = ({
61
59
  isInteractive: isInteractive(),
62
60
  isSelected: isSelected,
63
61
  minWidth: minWidth,
64
- frameStyle: calculatedFrameStyle,
62
+ frameStyle: frameStyle,
65
63
  maxWidth: maxWidth,
66
64
  "data-testid": testId,
67
65
  "data-trello-do-not-use-override": testId,
@@ -26,7 +26,6 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
26
26
  analytics,
27
27
  handleInvoke,
28
28
  isSelected,
29
- isFrameVisible,
30
29
  frameStyle,
31
30
  platform,
32
31
  onResolve,
@@ -67,7 +66,6 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
67
66
  if (resolvedViewProps.preview) {
68
67
  return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, resolvedViewProps, {
69
68
  isSelected: isSelected,
70
- isFrameVisible: isFrameVisible,
71
69
  frameStyle: frameStyle,
72
70
  inheritDimensions: inheritDimensions,
73
71
  onClick: handleFrameClick,
@@ -110,6 +108,7 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
110
108
  analytics: analytics,
111
109
  context: unauthorisedViewProps.context,
112
110
  extensionKey: extensionKey,
111
+ frameStyle: frameStyle,
113
112
  isProductIntegrationSupported: isProductIntegrationSupported,
114
113
  inheritDimensions: inheritDimensions,
115
114
  isSelected: isSelected,
@@ -130,8 +129,8 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
130
129
  if (forbiddenViewProps.preview) {
131
130
  return /*#__PURE__*/React.createElement(EmbedCardResolvedView, _extends({}, forbiddenViewProps, {
132
131
  title: forbiddenViewProps.link,
132
+ frameStyle: frameStyle,
133
133
  isSelected: isSelected,
134
- isFrameVisible: isFrameVisible,
135
134
  inheritDimensions: inheritDimensions,
136
135
  onClick: handleFrameClick,
137
136
  ref: iframeRef
@@ -145,6 +144,7 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
145
144
  });
146
145
  return /*#__PURE__*/React.createElement(ForbiddenView, {
147
146
  context: forbiddenViewProps.context,
147
+ frameStyle: frameStyle,
148
148
  inheritDimensions: inheritDimensions,
149
149
  isSelected: isSelected,
150
150
  onAuthorize: handleAuthorize,
@@ -168,6 +168,7 @@ export const EmbedCard = /*#__PURE__*/React.forwardRef(({
168
168
  }) : undefined;
169
169
  return /*#__PURE__*/React.createElement(NotFoundView, {
170
170
  context: notFoundViewProps.context,
171
+ frameStyle: frameStyle,
171
172
  inheritDimensions: inheritDimensions,
172
173
  isSelected: isSelected,
173
174
  onClick: handleFrameClick,
@@ -11,7 +11,6 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
11
11
  context,
12
12
  onClick,
13
13
  isSelected,
14
- isFrameVisible,
15
14
  frameStyle,
16
15
  preview,
17
16
  title,
@@ -48,7 +47,6 @@ export const EmbedCardResolvedView = /*#__PURE__*/React.forwardRef(({
48
47
  }
49
48
  return jsx(ExpandedFrame, {
50
49
  isSelected: isSelected,
51
- isFrameVisible: isFrameVisible,
52
50
  frameStyle: frameStyle,
53
51
  href: link,
54
52
  testId: testId,
@@ -8,6 +8,7 @@ import { containerStyles, contentStyles, descriptionStyles, imageStyles, titleSt
8
8
  const UnresolvedView = ({
9
9
  button,
10
10
  description,
11
+ frameStyle,
11
12
  icon: iconUrlOrElement,
12
13
  image,
13
14
  inheritDimensions,
@@ -32,8 +33,15 @@ const UnresolvedView = ({
32
33
  });
33
34
  }, [iconUrlOrElement]);
34
35
  return jsx(ExpandedFrame, {
35
- allowScrollBar: true,
36
- frameStyle: "show",
36
+ allowScrollBar: true
37
+ // EDM-9259: Fix embed frame showing on unresolved views when frameStyle is set to hide.
38
+ // Set fallback to 'show' here to maintain the current behaviour when platform.editor.show-embed-card-frame-renderer is OFF.
39
+ // Remove 'show' on platform.editor.show-embed-card-frame-renderer cleanup as frameStyle will be set to 'show' both in renderer and editor.
40
+ // We want all views to be consistent and respect frameStyle instead of
41
+ // having resolved view default to showOnHover and unresolved view default to show.
42
+ // Default frameStyle is set inside <ExpandedFrame />
43
+ ,
44
+ frameStyle: frameStyle !== null && frameStyle !== void 0 ? frameStyle : 'show',
37
45
  href: url,
38
46
  icon: icon,
39
47
  inheritDimensions: inheritDimensions,
@@ -2,8 +2,6 @@ import _extends from "@babel/runtime/helpers/extends";
2
2
  import React from 'react';
3
3
  import Action from '../index';
4
4
  import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-ui-context';
5
- import { FormattedMessage } from 'react-intl-next';
6
- import { messages } from '../../../../../../messages';
7
5
  import { openEmbedModalWithFlexibleUiIcon } from '../../../utils';
8
6
  import useInvokeClientAction from '../../../../../../state/hooks/use-invoke-client-action';
9
7
  import { ActionName } from '../../../../../../constants';
@@ -51,8 +49,7 @@ const PreviewAction = props => {
51
49
  if (onClick) {
52
50
  onClick();
53
51
  }
54
- },
55
- content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_improved)
52
+ }
56
53
  };
57
54
  return /*#__PURE__*/React.createElement(Action, _extends({}, action, {
58
55
  appearance: appearance,
@@ -8,11 +8,10 @@ import Block from '../../block';
8
8
  import { SmartLinkAlignment, SmartLinkDirection, SmartLinkSize } from '../../../../../../constants';
9
9
  import { getLinkLineHeight, getLinkSizeStyles, getTruncateStyles } from '../../../utils';
10
10
  import ElementGroup from '../../element-group';
11
- import { tokens } from '../../../../../../utils/token';
12
11
  const actionStyles = css`
13
12
  cursor: pointer;
14
13
  :hover {
15
- color: ${tokens.errorMessageHover};
14
+ color: ${"var(--ds-text-subtle, #8993A4)"};
16
15
  text-decoration: underline;
17
16
  }
18
17
  `;
@@ -24,9 +23,9 @@ const getMessageStyles = (size, hasAction) => {
24
23
  ${hasAction ? actionStyles : ''}
25
24
  ${sizeStyles}
26
25
  ${getTruncateStyles(1, getLinkLineHeight(size))}
27
- color: ${tokens.errorMessage};
26
+ color: ${"var(--ds-text-disabled, #6B778C)"};
28
27
  :focus {
29
- outline: ${tokens.focus} solid 2px;
28
+ outline: ${"var(--ds-border-focused, #388BFF)"} solid 2px;
30
29
  }
31
30
  `;
32
31
  };
@@ -3,7 +3,6 @@ import React, { useContext } from 'react';
3
3
  import { css, jsx } from '@emotion/react';
4
4
  import { MediaPlacement, SmartLinkSize, SmartLinkTheme } from '../../../../constants';
5
5
  import { isFlexibleUiBlock, isFlexibleUiPreviewBlock, isFlexibleUiTitleBlock } from '../../../../utils/flexible';
6
- import { tokens } from '../../../../utils/token';
7
6
  import { FlexibleUiContext } from '../../../../state/flexible-ui-context';
8
7
  import LayeredLink from './layered-link';
9
8
  import HoverCardControl from './hover-card-control';
@@ -99,7 +98,7 @@ export const getContainerStyles = (size, hideBackground, hideElevation, hidePadd
99
98
  min-width: 0;
100
99
  overflow-x: hidden;
101
100
  position: relative;
102
- ${hideBackground ? '' : `background-color: ${tokens.background};`}
101
+ ${hideBackground ? '' : `background-color: ${"var(--ds-surface-raised, #FFFFFF)"};`}
103
102
  ${paddingCss}
104
103
  ${hideElevation ? '' : elevationStyles}
105
104
  ${clickableContainer ? clickableContainerStyles : ''}
@@ -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;
@@ -204,5 +204,5 @@ export const getSimulatedBetterMetadata = (extensionKey = '', data) => {
204
204
  };
205
205
  export const getIsAISummaryEnabled = (isAdminHubAIEnabled = false, response) => {
206
206
  var _response$meta, _response$meta$suppor;
207
- return Boolean(getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 ? void 0 : (_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : (_response$meta$suppor = _response$meta.supportedFeatures) === null || _response$meta$suppor === void 0 ? void 0 : _response$meta$suppor.includes('AISummary')));
207
+ return Boolean(getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 ? void 0 : (_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : (_response$meta$suppor = _response$meta.supportedFeature) === null || _response$meta$suppor === void 0 ? void 0 : _response$meta$suppor.includes('AISummary')));
208
208
  };
@@ -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.2",
10
+ packageVersion: "26.48.4",
11
11
  componentName: 'linkUrl'
12
12
  };
13
13
  const Link = withLinkClickedEvent('a');