@atlaskit/smart-card 26.48.8 → 26.49.1
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.
- package/CHANGELOG.md +13 -0
- package/dist/cjs/__tests_external__/page-objects/BaseCard.js +1 -1
- package/dist/cjs/__tests_external__/page-objects/BlockCard.js +1 -1
- package/dist/cjs/__tests_external__/page-objects/EmbedCard.js +1 -1
- package/dist/cjs/__tests_external__/page-objects/InlineCard.js +1 -1
- package/dist/cjs/ssr.js +2 -2
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/index.js +39 -27
- package/dist/cjs/state/hooks/use-ai-summary/index.js +16 -38
- package/dist/cjs/state/hooks/use-invoke-client-action/index.js +2 -2
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/flexible.js +2 -2
- package/dist/cjs/utils/index.js +2 -2
- package/dist/cjs/utils/mocks.js +1 -1
- package/dist/cjs/view/BlockCard/components/ActionList.js +2 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleErroredView.js +2 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleForbiddenView.js +2 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleNotFoundView.js +2 -2
- package/dist/cjs/view/BlockCard/views/flexible/FlexibleResolvedView.js +2 -2
- package/dist/cjs/view/Card/index.js +1 -1
- package/dist/cjs/view/CardWithData/component.js +1 -1
- package/dist/cjs/view/CardWithData/loader.js +3 -3
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyIntersectionObserverCard.js +2 -2
- package/dist/cjs/view/CardWithUrl/component-lazy/LazyLazilyRenderCard.js +2 -2
- package/dist/cjs/view/CardWithUrl/component.js +2 -2
- package/dist/cjs/view/CardWithUrl/loader.js +2 -2
- package/dist/cjs/view/EmbedCard/EmbedResizeMessageListener.js +1 -1
- package/dist/cjs/view/EmbedCard/components/ExpandedFrame.js +22 -3
- package/dist/cjs/view/EmbedCard/components/Frame.js +2 -2
- package/dist/cjs/view/EmbedCard/components/styled.js +103 -23
- package/dist/cjs/view/EmbedCard/views/forbidden-view/index.js +2 -2
- package/dist/cjs/view/EmbedCard/views/not-found-view/index.js +2 -2
- package/dist/cjs/view/EmbedCard/views/unauthorized-view/index.js +2 -2
- package/dist/cjs/view/EmbedCard/views/unresolved-view/index.js +2 -2
- package/dist/cjs/view/EmbedModal/components/analytics/index.js +2 -2
- package/dist/cjs/view/EmbedModal/components/error-boundary/index.js +2 -2
- package/dist/cjs/view/EmbedModal/components/link-info/index.js +2 -2
- package/dist/cjs/view/EmbedModal/index.js +2 -2
- package/dist/cjs/view/EmbedModal/utils.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-button/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/actions/utils.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/action-group/action-group-item/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/ai-indicator-tooltip.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +39 -31
- package/dist/cjs/view/FlexibleCard/components/blocks/block/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/footer-block/resolved/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/preview-block/resolved/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/related-url-item/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/related-urls-block/resolved/related-url-list/resolved-result-stack/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/title-block/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/utils.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/common/atlaskit-icon/index.js +2 -5
- package/dist/cjs/view/FlexibleCard/components/container/hover-card-control/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/container/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/avatar-group/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/icon/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/link/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/error-boundary/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/lozenge/lozenge-action/lozenge-action-item/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/preview/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/snippet-element/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/elements/utils.js +2 -2
- package/dist/cjs/view/FlexibleCard/index.js +2 -2
- package/dist/cjs/view/HoverCard/components/ContentContainer.js +42 -13
- package/dist/cjs/view/HoverCard/components/HoverCardComponent.js +2 -2
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +3 -12
- package/dist/cjs/view/HoverCard/components/ImagePreview.js +2 -2
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +65 -18
- package/dist/cjs/view/HoverCard/components/views/unauthorised/index.js +2 -2
- package/dist/cjs/view/InlineCard/ErroredView/index.js +1 -1
- package/dist/cjs/view/InlineCard/ForbiddenView/index.js +1 -1
- package/dist/cjs/view/InlineCard/Frame/index.js +2 -2
- package/dist/cjs/view/InlineCard/IconAndTitleLayout/index.js +1 -1
- package/dist/cjs/view/InlineCard/ResolvedView/index.js +1 -1
- package/dist/cjs/view/InlineCard/ResolvingView/index.js +1 -1
- package/dist/cjs/view/InlineCard/UnauthorisedView/index.js +1 -1
- package/dist/cjs/view/InlineCard/index.js +2 -2
- package/dist/cjs/view/LinkUrl/LinkWarningModal/index.js +2 -2
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/cjs/view/LinkView/index.js +1 -1
- package/dist/cjs/view/common/UnauthorisedViewContent.js +2 -2
- package/dist/cjs/view/common/ai-prism/ai-glowing-border/animated-svg-container.js +2 -2
- package/dist/cjs/view/common/ai-summary/index.js +9 -3
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/index.js +14 -5
- package/dist/es2019/state/hooks/use-ai-summary/index.js +17 -35
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/EmbedCard/components/ExpandedFrame.js +21 -4
- package/dist/es2019/view/EmbedCard/components/styled.js +99 -111
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +33 -26
- package/dist/es2019/view/FlexibleCard/components/common/atlaskit-icon/index.js +0 -3
- package/dist/es2019/view/HoverCard/components/ContentContainer.js +35 -10
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +2 -7
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +56 -7
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/es2019/view/common/ai-summary/index.js +7 -3
- package/dist/esm/__tests_external__/page-objects/BaseCard.js +1 -1
- package/dist/esm/__tests_external__/page-objects/BlockCard.js +1 -1
- package/dist/esm/__tests_external__/page-objects/EmbedCard.js +1 -1
- package/dist/esm/__tests_external__/page-objects/InlineCard.js +1 -1
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/index.js +39 -27
- package/dist/esm/state/hooks/use-ai-summary/index.js +17 -39
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/mocks.js +1 -1
- package/dist/esm/view/Card/index.js +1 -1
- package/dist/esm/view/CardWithData/component.js +1 -1
- package/dist/esm/view/CardWithData/loader.js +1 -1
- package/dist/esm/view/EmbedCard/EmbedResizeMessageListener.js +1 -1
- package/dist/esm/view/EmbedCard/components/ExpandedFrame.js +23 -4
- package/dist/esm/view/EmbedCard/components/styled.js +100 -20
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +38 -30
- package/dist/esm/view/FlexibleCard/components/common/atlaskit-icon/index.js +0 -3
- package/dist/esm/view/HoverCard/components/ContentContainer.js +39 -13
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +2 -11
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +66 -18
- package/dist/esm/view/InlineCard/ErroredView/index.js +1 -1
- package/dist/esm/view/InlineCard/ForbiddenView/index.js +1 -1
- package/dist/esm/view/InlineCard/IconAndTitleLayout/index.js +1 -1
- package/dist/esm/view/InlineCard/ResolvedView/index.js +1 -1
- package/dist/esm/view/InlineCard/ResolvingView/index.js +1 -1
- package/dist/esm/view/InlineCard/UnauthorisedView/index.js +1 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/esm/view/LinkView/index.js +1 -1
- package/dist/esm/view/common/ai-summary/index.js +9 -3
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +3 -1
- package/dist/types/state/hooks/use-ai-summary/index.d.ts +0 -1
- package/dist/types/view/EmbedCard/components/styled.d.ts +5 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -3
- package/dist/types/view/HoverCard/components/views/resolved/types.d.ts +0 -2
- package/dist/types/view/HoverCard/types.d.ts +1 -1
- package/dist/types/view/common/ai-summary/index.d.ts +4 -0
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +3 -1
- package/dist/types-ts4.5/state/hooks/use-ai-summary/index.d.ts +0 -1
- package/dist/types-ts4.5/view/EmbedCard/components/styled.d.ts +5 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/ai-state-indicator/types.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +2 -3
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/types.d.ts +0 -2
- package/dist/types-ts4.5/view/HoverCard/types.d.ts +1 -1
- package/dist/types-ts4.5/view/common/ai-summary/index.d.ts +4 -0
- package/package.json +5 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
-
import { ActionName, CardDisplay, ElementName, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
4
|
-
import { FooterBlock, MetadataBlock, RelatedUrlsBlock, SnippetBlock, TitleBlock, AISummaryBlock } from '../../../../FlexibleCard/components/blocks';
|
|
3
|
+
import { ActionName, CardDisplay, ElementName, SmartLinkPosition, SmartLinkSize, SmartLinkDirection } from '../../../../../constants';
|
|
4
|
+
import { FooterBlock, MetadataBlock, RelatedUrlsBlock, SnippetBlock, TitleBlock, AISummaryBlock, CustomBlock } from '../../../../FlexibleCard/components/blocks';
|
|
5
5
|
import { footerBlockCss, hiddenSnippetStyles, metadataBlockCss } from './styled';
|
|
6
6
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
7
7
|
import { getSimulatedBetterMetadata } from '../../../utils';
|
|
@@ -11,6 +11,8 @@ import { messages } from '../../../../../messages';
|
|
|
11
11
|
import { FormattedMessage } from 'react-intl-next';
|
|
12
12
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
13
13
|
import { getCanBeDatasource } from '../../../../../state/helpers';
|
|
14
|
+
import { useAISummary } from '../../../../../state/hooks/use-ai-summary';
|
|
15
|
+
import { SmartLinkStatus } from '../../../../../constants';
|
|
14
16
|
export const toFooterActions = (cardActions, onActionClick) => {
|
|
15
17
|
const followAction = {
|
|
16
18
|
hideIcon: true,
|
|
@@ -45,6 +47,30 @@ export const toFooterActions = (cardActions, onActionClick) => {
|
|
|
45
47
|
});
|
|
46
48
|
return [followAction, ...actions];
|
|
47
49
|
};
|
|
50
|
+
|
|
51
|
+
//This component encapsulates useAISummary hook under the AI Summary FF 'platform.linking-platform.smart-card.hover-card-ai-summaries'
|
|
52
|
+
const ConnectedAIBlock = ({
|
|
53
|
+
bottomPrimary,
|
|
54
|
+
url,
|
|
55
|
+
imagePreview
|
|
56
|
+
}) => {
|
|
57
|
+
const aiSummary = useAISummary({
|
|
58
|
+
url
|
|
59
|
+
});
|
|
60
|
+
const aiStatus = aiSummary.state.status;
|
|
61
|
+
const showData = aiStatus === 'ready' || aiStatus === 'error';
|
|
62
|
+
return showData ? /*#__PURE__*/React.createElement(CustomBlock, {
|
|
63
|
+
direction: SmartLinkDirection.Vertical
|
|
64
|
+
}, !imagePreview && /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
65
|
+
status: SmartLinkStatus.Resolved
|
|
66
|
+
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
67
|
+
primary: bottomPrimary,
|
|
68
|
+
size: SmartLinkSize.Large,
|
|
69
|
+
overrideCss: metadataBlockCss,
|
|
70
|
+
maxLines: 1,
|
|
71
|
+
status: SmartLinkStatus.Resolved
|
|
72
|
+
})) : null;
|
|
73
|
+
};
|
|
48
74
|
const HoverCardResolvedView = ({
|
|
49
75
|
flexibleCardProps,
|
|
50
76
|
titleBlockProps,
|
|
@@ -53,7 +79,6 @@ const HoverCardResolvedView = ({
|
|
|
53
79
|
cardActions = [],
|
|
54
80
|
isAISummaryEnabled,
|
|
55
81
|
onActionClick,
|
|
56
|
-
onAIActionChange,
|
|
57
82
|
extensionKey,
|
|
58
83
|
url
|
|
59
84
|
}) => {
|
|
@@ -88,6 +113,15 @@ const HoverCardResolvedView = ({
|
|
|
88
113
|
var _snippetBlockRef$curr, _snippetBlockRef$curr2;
|
|
89
114
|
snippetHeight.current = (_snippetBlockRef$curr = (_snippetBlockRef$curr2 = snippetBlockRef.current) === null || _snippetBlockRef$curr2 === void 0 ? void 0 : _snippetBlockRef$curr2.getBoundingClientRect().height) !== null && _snippetBlockRef$curr !== void 0 ? _snippetBlockRef$curr : 0;
|
|
90
115
|
}, []);
|
|
116
|
+
|
|
117
|
+
// We want to maintain the height of the HoverCard while summarizing and pass this height to the AISummaryBlock.
|
|
118
|
+
// This approach will prevent any abrupt changes in the height of the HoverCard.
|
|
119
|
+
const connectedAIBlockHeight = React.useRef(0);
|
|
120
|
+
const connectedAIBlockRef = useRef(null);
|
|
121
|
+
const onConnectedAIBlockRender = useCallback(() => {
|
|
122
|
+
var _connectedAIBlockRef$, _connectedAIBlockRef$2;
|
|
123
|
+
connectedAIBlockHeight.current = (_connectedAIBlockRef$ = (_connectedAIBlockRef$2 = connectedAIBlockRef.current) === null || _connectedAIBlockRef$2 === void 0 ? void 0 : _connectedAIBlockRef$2.getBoundingClientRect().height) !== null && _connectedAIBlockRef$ !== void 0 ? _connectedAIBlockRef$ : 0;
|
|
124
|
+
}, []);
|
|
91
125
|
const imagePreview = ImagePreview({
|
|
92
126
|
data: data,
|
|
93
127
|
fallbackElementHeight: snippetHeight.current
|
|
@@ -100,16 +134,31 @@ const HoverCardResolvedView = ({
|
|
|
100
134
|
overrideCss: metadataBlockCss,
|
|
101
135
|
maxLines: 1,
|
|
102
136
|
size: SmartLinkSize.Medium
|
|
103
|
-
}),
|
|
137
|
+
}), isAISummaryEnabled &&
|
|
138
|
+
/*#__PURE__*/
|
|
139
|
+
// All custom elements should be contained within a CustomBlock.
|
|
140
|
+
// Flex Container components check whether the direct child is a flex blocks. It removes anything that isn't
|
|
141
|
+
React.createElement(CustomBlock, {
|
|
142
|
+
direction: SmartLinkDirection.Vertical,
|
|
143
|
+
onRender: onConnectedAIBlockRender,
|
|
144
|
+
blockRef: connectedAIBlockRef
|
|
145
|
+
}, /*#__PURE__*/React.createElement(ConnectedAIBlock, {
|
|
146
|
+
imagePreview: !!imagePreview,
|
|
147
|
+
url: url,
|
|
148
|
+
bottomPrimary: bottomPrimary
|
|
149
|
+
})), !isAISummaryEnabled && !imagePreview && /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
150
|
+
status: SmartLinkStatus.Resolved
|
|
151
|
+
}), /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
104
152
|
testId: 'hidden-snippet',
|
|
105
153
|
onRender: onSnippetRender,
|
|
106
154
|
blockRef: snippetBlockRef,
|
|
107
155
|
overrideCss: hiddenSnippetStyles
|
|
108
|
-
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
156
|
+
}), !isAISummaryEnabled && /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
109
157
|
primary: bottomPrimary,
|
|
110
158
|
size: SmartLinkSize.Large,
|
|
111
159
|
overrideCss: metadataBlockCss,
|
|
112
|
-
maxLines: 1
|
|
160
|
+
maxLines: 1,
|
|
161
|
+
status: SmartLinkStatus.Resolved
|
|
113
162
|
}), getBooleanFF('platform.linking-platform.smart-card.enable-hover-card-related-urls') && /*#__PURE__*/React.createElement(RelatedUrlsBlock, {
|
|
114
163
|
url: url,
|
|
115
164
|
size: SmartLinkSize.Small
|
|
@@ -118,7 +167,7 @@ const HoverCardResolvedView = ({
|
|
|
118
167
|
name: ElementName.Provider
|
|
119
168
|
}],
|
|
120
169
|
actions: footerActions,
|
|
121
|
-
|
|
170
|
+
aiSummaryMinHeight: connectedAIBlockHeight.current
|
|
122
171
|
}) : /*#__PURE__*/React.createElement(FooterBlock, {
|
|
123
172
|
actions: footerActions,
|
|
124
173
|
size: SmartLinkSize.Large,
|
|
@@ -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.
|
|
10
|
+
packageVersion: "26.49.1",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
|
@@ -21,13 +21,14 @@ const AISummaryCSS = css({
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
const AISummary = ({
|
|
24
|
-
content,
|
|
24
|
+
content = '',
|
|
25
25
|
showIcon = false,
|
|
26
26
|
iconComponent,
|
|
27
27
|
overrideCss,
|
|
28
|
-
testId = 'ai-summary'
|
|
28
|
+
testId = 'ai-summary',
|
|
29
|
+
minHeight = 0
|
|
29
30
|
}) => {
|
|
30
|
-
if (!content) {
|
|
31
|
+
if (!content && minHeight === 0) {
|
|
31
32
|
return null;
|
|
32
33
|
}
|
|
33
34
|
return jsx(Markdown, {
|
|
@@ -39,6 +40,9 @@ const AISummary = ({
|
|
|
39
40
|
overrides: {
|
|
40
41
|
Icon: iconComponent !== null && iconComponent !== void 0 ? iconComponent : AITooltipIcon
|
|
41
42
|
}
|
|
43
|
+
},
|
|
44
|
+
style: {
|
|
45
|
+
minHeight: minHeight
|
|
42
46
|
}
|
|
43
47
|
});
|
|
44
48
|
};
|
|
@@ -5,7 +5,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
function _isNativeReflectConstruct() {
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import { InProductTestPageObject } from '@atlaskit/in-product-testing';
|
|
10
10
|
export var BaseCardPageObject = /*#__PURE__*/function (_InProductTestPageObj) {
|
|
11
11
|
_inherits(BaseCardPageObject, _InProductTestPageObj);
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
|
-
function _isNativeReflectConstruct() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { BaseCardPageObject } from './BaseCard';
|
|
9
9
|
export var BlockCardPageObject = /*#__PURE__*/function (_BaseCardPageObject) {
|
|
10
10
|
_inherits(BlockCardPageObject, _BaseCardPageObject);
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
|
-
function _isNativeReflectConstruct() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { BaseCardPageObject } from './BaseCard';
|
|
9
9
|
export var EmbedCardPageObject = /*#__PURE__*/function (_BaseCardPageObject) {
|
|
10
10
|
_inherits(EmbedCardPageObject, _BaseCardPageObject);
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
|
-
function _isNativeReflectConstruct() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import { BaseCardPageObject } from './BaseCard';
|
|
9
9
|
export var InlineCardPageObject = /*#__PURE__*/function (_BaseCardPageObject) {
|
|
10
10
|
_inherits(InlineCardPageObject, _BaseCardPageObject);
|
|
@@ -44,8 +44,14 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
44
44
|
return fetch(requestUrl, options);
|
|
45
45
|
case 6:
|
|
46
46
|
response = _context.sent;
|
|
47
|
+
if (!(!response.ok || response.status >= 400)) {
|
|
48
|
+
_context.next = 11;
|
|
49
|
+
break;
|
|
50
|
+
}
|
|
51
|
+
throw new Error("Status: ".concat(response.status, "\n URL: ").concat(_this.url, "\n StatusText ").concat(response.statusText));
|
|
52
|
+
case 11:
|
|
47
53
|
return _context.abrupt("return", readStream(response));
|
|
48
|
-
case
|
|
54
|
+
case 12:
|
|
49
55
|
case "end":
|
|
50
56
|
return _context.stop();
|
|
51
57
|
}
|
|
@@ -96,10 +102,11 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
96
102
|
return _regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
97
103
|
while (1) switch (_context2.prev = _context2.next) {
|
|
98
104
|
case 0:
|
|
99
|
-
summaryStyle = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : '
|
|
100
|
-
this.state =
|
|
101
|
-
status: 'loading'
|
|
102
|
-
|
|
105
|
+
summaryStyle = _args2.length > 0 && _args2[0] !== undefined ? _args2[0] : 'medium';
|
|
106
|
+
this.state = {
|
|
107
|
+
status: 'loading',
|
|
108
|
+
content: ''
|
|
109
|
+
};
|
|
103
110
|
_iterator2 = _createForOfIteratorHelper(this.subscribedStateSetters);
|
|
104
111
|
try {
|
|
105
112
|
for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
|
|
@@ -126,7 +133,7 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
126
133
|
return _iterator.next();
|
|
127
134
|
case 15:
|
|
128
135
|
if (!(_iteratorAbruptCompletion = !(_step = _context2.sent).done)) {
|
|
129
|
-
_context2.next =
|
|
136
|
+
_context2.next = 22;
|
|
130
137
|
break;
|
|
131
138
|
}
|
|
132
139
|
chunk = _step.value;
|
|
@@ -146,53 +153,58 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
146
153
|
_iterator3.f();
|
|
147
154
|
}
|
|
148
155
|
}
|
|
149
|
-
|
|
156
|
+
|
|
157
|
+
//if AI Mate service returns cached summary we get the summary text in one piece as the last message
|
|
158
|
+
if (chunk.type === 'FINAL_RESPONSE') {
|
|
159
|
+
bufferContent = chunk.message.message.content;
|
|
160
|
+
}
|
|
161
|
+
case 19:
|
|
150
162
|
_iteratorAbruptCompletion = false;
|
|
151
163
|
_context2.next = 13;
|
|
152
164
|
break;
|
|
153
|
-
case
|
|
154
|
-
_context2.next =
|
|
165
|
+
case 22:
|
|
166
|
+
_context2.next = 28;
|
|
155
167
|
break;
|
|
156
|
-
case
|
|
157
|
-
_context2.prev =
|
|
168
|
+
case 24:
|
|
169
|
+
_context2.prev = 24;
|
|
158
170
|
_context2.t0 = _context2["catch"](11);
|
|
159
171
|
_didIteratorError = true;
|
|
160
172
|
_iteratorError = _context2.t0;
|
|
161
|
-
case
|
|
162
|
-
_context2.prev = 27;
|
|
173
|
+
case 28:
|
|
163
174
|
_context2.prev = 28;
|
|
175
|
+
_context2.prev = 29;
|
|
164
176
|
if (!(_iteratorAbruptCompletion && _iterator.return != null)) {
|
|
165
|
-
_context2.next =
|
|
177
|
+
_context2.next = 33;
|
|
166
178
|
break;
|
|
167
179
|
}
|
|
168
|
-
_context2.next =
|
|
180
|
+
_context2.next = 33;
|
|
169
181
|
return _iterator.return();
|
|
170
|
-
case
|
|
171
|
-
_context2.prev =
|
|
182
|
+
case 33:
|
|
183
|
+
_context2.prev = 33;
|
|
172
184
|
if (!_didIteratorError) {
|
|
173
|
-
_context2.next =
|
|
185
|
+
_context2.next = 36;
|
|
174
186
|
break;
|
|
175
187
|
}
|
|
176
188
|
throw _iteratorError;
|
|
177
|
-
case 35:
|
|
178
|
-
return _context2.finish(32);
|
|
179
189
|
case 36:
|
|
180
|
-
return _context2.finish(
|
|
190
|
+
return _context2.finish(33);
|
|
181
191
|
case 37:
|
|
192
|
+
return _context2.finish(28);
|
|
193
|
+
case 38:
|
|
182
194
|
this.state = {
|
|
183
195
|
status: 'done',
|
|
184
196
|
content: bufferContent
|
|
185
197
|
};
|
|
186
|
-
_context2.next =
|
|
198
|
+
_context2.next = 44;
|
|
187
199
|
break;
|
|
188
|
-
case
|
|
189
|
-
_context2.prev =
|
|
200
|
+
case 41:
|
|
201
|
+
_context2.prev = 41;
|
|
190
202
|
_context2.t1 = _context2["catch"](4);
|
|
191
203
|
this.state = {
|
|
192
204
|
status: 'error',
|
|
193
205
|
content: ''
|
|
194
206
|
};
|
|
195
|
-
case
|
|
207
|
+
case 44:
|
|
196
208
|
_iterator4 = _createForOfIteratorHelper(this.subscribedStateSetters);
|
|
197
209
|
try {
|
|
198
210
|
for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
|
|
@@ -204,11 +216,11 @@ export var AISummaryService = /*#__PURE__*/function () {
|
|
|
204
216
|
} finally {
|
|
205
217
|
_iterator4.f();
|
|
206
218
|
}
|
|
207
|
-
case
|
|
219
|
+
case 46:
|
|
208
220
|
case "end":
|
|
209
221
|
return _context2.stop();
|
|
210
222
|
}
|
|
211
|
-
}, _callee2, this, [[4,
|
|
223
|
+
}, _callee2, this, [[4, 41], [11, 24, 28, 38], [29,, 33, 37]]);
|
|
212
224
|
}));
|
|
213
225
|
function summariseUrl() {
|
|
214
226
|
return _summariseUrl.apply(this, arguments);
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import { useState, useEffect
|
|
2
|
+
import { useState, useEffect } from 'react';
|
|
3
3
|
import { AISummariesStore } from './ai-summary-service/store';
|
|
4
4
|
import { AISummaryService } from './ai-summary-service';
|
|
5
5
|
export var useAISummary = function useAISummary(props) {
|
|
6
6
|
var _AISummariesStore$get;
|
|
7
7
|
var url = props.url,
|
|
8
8
|
baseUrl = props.baseUrl,
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
headers = props.headers,
|
|
10
|
+
product = props.product;
|
|
11
11
|
var _useState = useState(((_AISummariesStore$get = AISummariesStore.get(url)) === null || _AISummariesStore$get === void 0 ? void 0 : _AISummariesStore$get.state) || {
|
|
12
12
|
status: 'ready',
|
|
13
13
|
content: ''
|
|
@@ -15,47 +15,25 @@ export var useAISummary = function useAISummary(props) {
|
|
|
15
15
|
_useState2 = _slicedToArray(_useState, 2),
|
|
16
16
|
state = _useState2[0],
|
|
17
17
|
setState = _useState2[1];
|
|
18
|
-
|
|
19
|
-
// Can be used to know the summary status upon mounting a component (HoverCard UI state for example).
|
|
20
|
-
// For other scenarios, opt for dynamic status updates via state.status.
|
|
21
|
-
var isSummarisedOnMount = useMemo(function () {
|
|
22
|
-
var _AISummariesStore$get2;
|
|
23
|
-
return ((_AISummariesStore$get2 = AISummariesStore.get(url)) === null || _AISummariesStore$get2 === void 0 ? void 0 : _AISummariesStore$get2.state.status) === 'done';
|
|
24
|
-
}, [url]);
|
|
25
18
|
useEffect(function () {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return function () {
|
|
35
|
-
return unsubscribe();
|
|
36
|
-
};
|
|
37
|
-
} else {
|
|
38
|
-
var _AISummariesStore$get3;
|
|
39
|
-
//if we want to create a new AI service and wish to subscribe for updates
|
|
40
|
-
AISummariesStore.set(url, new AISummaryService({
|
|
41
|
-
url: url,
|
|
42
|
-
baseUrl: baseUrl,
|
|
43
|
-
product: product,
|
|
44
|
-
headers: headers
|
|
45
|
-
}));
|
|
46
|
-
var _unsubscribe = (_AISummariesStore$get3 = AISummariesStore.get(url)) === null || _AISummariesStore$get3 === void 0 ? void 0 : _AISummariesStore$get3.subscribe(setState);
|
|
47
|
-
return function () {
|
|
48
|
-
return _unsubscribe && _unsubscribe();
|
|
49
|
-
};
|
|
50
|
-
}
|
|
19
|
+
var _AISummariesStore$get2;
|
|
20
|
+
if (!AISummariesStore.get(url)) {
|
|
21
|
+
AISummariesStore.set(url, new AISummaryService({
|
|
22
|
+
url: url,
|
|
23
|
+
baseUrl: baseUrl,
|
|
24
|
+
headers: headers,
|
|
25
|
+
product: product
|
|
26
|
+
}));
|
|
51
27
|
}
|
|
52
|
-
|
|
28
|
+
|
|
29
|
+
//returns function that calls unsubscribe method
|
|
30
|
+
return (_AISummariesStore$get2 = AISummariesStore.get(url)) === null || _AISummariesStore$get2 === void 0 ? void 0 : _AISummariesStore$get2.subscribe(setState);
|
|
31
|
+
}, [url, baseUrl, headers, product]);
|
|
53
32
|
var summariseUrl = function summariseUrl() {
|
|
54
|
-
var _AISummariesStore$
|
|
55
|
-
return (_AISummariesStore$
|
|
33
|
+
var _AISummariesStore$get3;
|
|
34
|
+
return (_AISummariesStore$get3 = AISummariesStore.get(url)) === null || _AISummariesStore$get3 === void 0 ? void 0 : _AISummariesStore$get3.summariseUrl();
|
|
56
35
|
};
|
|
57
36
|
return {
|
|
58
|
-
isSummarisedOnMount: isSummarisedOnMount,
|
|
59
37
|
summariseUrl: summariseUrl,
|
|
60
38
|
state: state
|
|
61
39
|
};
|
|
@@ -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.
|
|
18
|
+
packageVersion: "26.49.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/utils/mocks.js
CHANGED
|
@@ -7,7 +7,7 @@ import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
9
9
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
function _isNativeReflectConstruct() {
|
|
10
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11
11
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
12
12
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
13
13
|
import { CardClient } from '@atlaskit/link-provider';
|
|
@@ -4,7 +4,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
4
4
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
7
|
-
function _isNativeReflectConstruct() {
|
|
7
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
8
8
|
import React from 'react';
|
|
9
9
|
import { withAnalyticsContext, withAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
10
10
|
import { CardWithDataRenderer } from '../CardWithData/loader';
|
|
@@ -5,7 +5,7 @@ import _inherits from "@babel/runtime/helpers/inherits";
|
|
|
5
5
|
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
function _isNativeReflectConstruct() {
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React from 'react';
|
|
10
10
|
import { getEmptyJsonLd } from '../../utils/jsonld';
|
|
11
11
|
import { extractInlineProps } from '../../extractors/inline';
|
|
@@ -5,7 +5,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
5
5
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
6
6
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
7
7
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
function _isNativeReflectConstruct() {
|
|
8
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
9
9
|
import React from 'react';
|
|
10
10
|
export var CardWithDataRenderer = /*#__PURE__*/function (_React$PureComponent) {
|
|
11
11
|
_inherits(CardWithDataRenderer, _React$PureComponent);
|
|
@@ -6,7 +6,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
6
6
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
7
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
8
8
|
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
9
|
-
function _isNativeReflectConstruct() {
|
|
9
|
+
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10
10
|
import React from 'react';
|
|
11
11
|
import { embedHeaderHeight } from './components/styled';
|
|
12
12
|
export var EmbedResizeMessageListener = /*#__PURE__*/function (_React$Component) {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import { className, LinkWrapper, Wrapper, Header, IconWrapper, TextWrapper, Content } from './styled';
|
|
2
|
+
import { className, LinkWrapper, Wrapper, Header, IconWrapper, TextWrapper, TooltipWrapper, Content } from './styled';
|
|
3
3
|
import { handleClickCommon } from '../../BlockCard/utils/handlers';
|
|
4
4
|
import { useMouseDownEvent } from '../../../state/analytics/useLinkClicked';
|
|
5
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
6
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
7
|
export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
6
8
|
var _ref$isPlaceholder = _ref.isPlaceholder,
|
|
7
9
|
isPlaceholder = _ref$isPlaceholder === void 0 ? false : _ref$isPlaceholder,
|
|
@@ -27,7 +29,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
27
29
|
return handleClickCommon(event, onClick);
|
|
28
30
|
};
|
|
29
31
|
var handleMouseDown = useMouseDownEvent();
|
|
30
|
-
var
|
|
32
|
+
var renderHeaderOld = function renderHeaderOld() {
|
|
31
33
|
return /*#__PURE__*/React.createElement(Header, {
|
|
32
34
|
className: "embed-header",
|
|
33
35
|
frameStyle: frameStyle
|
|
@@ -41,6 +43,23 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
41
43
|
onMouseDown: handleMouseDown
|
|
42
44
|
}, text)));
|
|
43
45
|
};
|
|
46
|
+
var renderHeader = function renderHeader() {
|
|
47
|
+
return /*#__PURE__*/React.createElement(Header, {
|
|
48
|
+
className: "embed-header",
|
|
49
|
+
frameStyle: frameStyle
|
|
50
|
+
}, /*#__PURE__*/React.createElement(IconWrapper, {
|
|
51
|
+
isPlaceholder: isPlaceholder
|
|
52
|
+
}, !isPlaceholder && icon), /*#__PURE__*/React.createElement(TooltipWrapper, null, /*#__PURE__*/React.createElement(Tooltip, {
|
|
53
|
+
content: text,
|
|
54
|
+
hideTooltipOnMouseDown: true
|
|
55
|
+
}, /*#__PURE__*/React.createElement(TextWrapper, {
|
|
56
|
+
isPlaceholder: isPlaceholder
|
|
57
|
+
}, !isPlaceholder && /*#__PURE__*/React.createElement("a", {
|
|
58
|
+
href: href,
|
|
59
|
+
onClick: handleClick,
|
|
60
|
+
onMouseDown: handleMouseDown
|
|
61
|
+
}, text)))));
|
|
62
|
+
};
|
|
44
63
|
var renderContent = function renderContent() {
|
|
45
64
|
return /*#__PURE__*/React.createElement(Content, {
|
|
46
65
|
"data-testid": "embed-content-wrapper",
|
|
@@ -63,7 +82,7 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
63
82
|
,
|
|
64
83
|
"data-is-selected": isSelected,
|
|
65
84
|
inheritDimensions: inheritDimensions
|
|
66
|
-
}, renderHeader(), renderContent());
|
|
85
|
+
}, getBooleanFF('platform.linking-platform.smart-card.embed-card-header-tooltip') ? renderHeader() : renderHeaderOld(), renderContent());
|
|
67
86
|
} else {
|
|
68
87
|
return /*#__PURE__*/React.createElement(Wrapper, {
|
|
69
88
|
className: className,
|
|
@@ -77,6 +96,6 @@ export var ExpandedFrame = function ExpandedFrame(_ref) {
|
|
|
77
96
|
"data-is-selected": isSelected,
|
|
78
97
|
"data-wrapper-type": "default",
|
|
79
98
|
"data-is-interactive": isInteractive()
|
|
80
|
-
}, renderHeader(), renderContent());
|
|
99
|
+
}, getBooleanFF('platform.linking-platform.smart-card.embed-card-header-tooltip') ? renderHeader() : renderHeaderOld(), renderContent());
|
|
81
100
|
}
|
|
82
101
|
};
|