@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,5 +1,5 @@
|
|
|
1
1
|
import _taggedTemplateLiteral from "@babel/runtime/helpers/taggedTemplateLiteral";
|
|
2
|
-
var _templateObject, _templateObject2
|
|
2
|
+
var _templateObject, _templateObject2;
|
|
3
3
|
import styled from '@emotion/styled';
|
|
4
4
|
import { fontFamily } from '@atlaskit/theme/constants';
|
|
5
5
|
import * as colors from '@atlaskit/theme/colors';
|
|
@@ -66,39 +66,63 @@ function visible(_ref7) {
|
|
|
66
66
|
var frameStyle = _ref7.frameStyle;
|
|
67
67
|
return frameStyle === 'show' ? visibleStyles : '';
|
|
68
68
|
}
|
|
69
|
+
|
|
70
|
+
// eslint-disable-next-line @atlaskit/design-system/no-styled-tagged-template-expression
|
|
69
71
|
export var LinkWrapper = styled.div(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n ", " &:hover {\n text-decoration: none;\n }\n"])), function (props) {
|
|
70
72
|
return wrapperStyles(props);
|
|
71
73
|
});
|
|
72
74
|
|
|
73
75
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
74
|
-
export var Wrapper = styled.div(
|
|
76
|
+
export var Wrapper = styled.div(function (props) {
|
|
75
77
|
return wrapperStyles(props);
|
|
78
|
+
}, {
|
|
79
|
+
marginTop: '10px'
|
|
76
80
|
});
|
|
77
81
|
export var embedHeaderHeight = 32;
|
|
78
|
-
export var Header = styled.div(
|
|
82
|
+
export var Header = styled.div({
|
|
83
|
+
height: "".concat(embedHeaderHeight, "px"),
|
|
84
|
+
position: 'absolute',
|
|
85
|
+
zIndex: 1,
|
|
86
|
+
width: '100%',
|
|
87
|
+
display: 'flex',
|
|
88
|
+
alignItems: 'center',
|
|
89
|
+
color: "var(--ds-icon, ".concat(colors.N300, ")"),
|
|
90
|
+
opacity: 0,
|
|
91
|
+
transition: '300ms opacity cubic-bezier(0.15, 1, 0.3, 1)'
|
|
92
|
+
}, function (_ref8) {
|
|
79
93
|
var frameStyle = _ref8.frameStyle;
|
|
80
94
|
return getBooleanFF('platform.editor.show-embed-card-frame-renderer') && frameStyle === 'show' ? "\n box-sizing: border-box;\n padding: 0 ".concat("var(--ds-space-100, 8px)", ";\n ") : '';
|
|
81
95
|
});
|
|
82
|
-
export var IconWrapper = styled.div(
|
|
96
|
+
export var IconWrapper = styled.div(borderRadius, csssize(16), function (_ref9) {
|
|
83
97
|
var isPlaceholder = _ref9.isPlaceholder;
|
|
84
98
|
if (isPlaceholder) {
|
|
85
99
|
return "\n background-color: ".concat("var(--ds-skeleton, ".concat(colors.N30, ")"), ";\n ");
|
|
86
100
|
} else {
|
|
87
101
|
return '';
|
|
88
102
|
}
|
|
103
|
+
}, {
|
|
104
|
+
marginRight: "var(--ds-space-050, 4px)"
|
|
89
105
|
});
|
|
90
|
-
export var TextWrapper = styled.div(
|
|
106
|
+
export var TextWrapper = styled.div(function (_ref10) {
|
|
91
107
|
var isPlaceholder = _ref10.isPlaceholder;
|
|
92
108
|
if (isPlaceholder) {
|
|
93
109
|
return "\n ".concat(borderRadius, "\n width: 125px;\n height: 12px;\n background-color: ", "var(--ds-skeleton, ".concat(colors.N30, ")"), ";\n ");
|
|
94
110
|
} else {
|
|
95
111
|
return '';
|
|
96
112
|
}
|
|
97
|
-
},
|
|
113
|
+
}, {
|
|
114
|
+
color: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
|
|
115
|
+
fontSize: '12px',
|
|
116
|
+
lineHeight: '16px'
|
|
117
|
+
}, ellipsis('none'));
|
|
118
|
+
export var TooltipWrapper = styled.div({
|
|
119
|
+
overflow: 'hidden'
|
|
120
|
+
});
|
|
98
121
|
// NB: `overflow` is kept as `hidden` since
|
|
99
122
|
// the internal contents of the `iframe` should
|
|
100
123
|
// manage scrolling behaviour.
|
|
101
|
-
|
|
124
|
+
// eslint-disable-next-line @atlaskit/design-system/no-styled-tagged-template-expression
|
|
125
|
+
export var Content = styled.div(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n ", ";\n border: 1px solid ", ";\n background-color: ", ";\n position: absolute;\n z-index: 1;\n width: 100%;\n transition: box-shadow 0.3s;\n\n > .calc-height > div > div {\n left: unset !important;\n width: unset !important;\n height: unset !important;\n position: initial !important;\n padding-bottom: unset !important;\n }\n > .embed-preview > div {\n margin: 0 auto;\n }\n\n ", "\n\n ", "\n\n ", "\n"])), contentBorderRadius, "var(--ds-border, ".concat(N40, ")"), "var(--ds-surface-raised, white)", function (_ref11) {
|
|
102
126
|
var allowScrollBar = _ref11.allowScrollBar;
|
|
103
127
|
return allowScrollBar ? 'overflow: auto;' : 'overflow: hidden;';
|
|
104
128
|
}, function (_ref12) {
|
|
@@ -108,22 +132,78 @@ export var Content = styled.div(_templateObject6 || (_templateObject6 = _taggedT
|
|
|
108
132
|
var frameStyle = _ref13.frameStyle;
|
|
109
133
|
return frameStyle === 'hide' ? 'height: 100%;' : "\n height: calc(100% - ".concat("var(--ds-space-400, 32px)", ");\n top: ", "var(--ds-space-400, 32px)", ";\n ");
|
|
110
134
|
});
|
|
111
|
-
export var Image = styled.img(
|
|
135
|
+
export var Image = styled.img(function (_ref14) {
|
|
112
136
|
var size = _ref14.size;
|
|
113
137
|
return csssize(size);
|
|
114
|
-
}, borderRadius
|
|
138
|
+
}, borderRadius, {
|
|
139
|
+
overflow: 'hidden'
|
|
140
|
+
});
|
|
115
141
|
export var maxAvatarCount = 6;
|
|
116
|
-
export var ContentWrapper = styled.div(
|
|
117
|
-
|
|
118
|
-
|
|
142
|
+
export var ContentWrapper = styled.div({
|
|
143
|
+
display: 'flex',
|
|
144
|
+
flexDirection: 'row',
|
|
145
|
+
boxSizing: 'border-box',
|
|
146
|
+
padding: "var(--ds-space-100, 8px)".concat(" ", "var(--ds-space-150, 12px)", " ", "var(--ds-space-150, 12px)", " ", "var(--ds-space-150, 12px)")
|
|
147
|
+
});
|
|
148
|
+
export var Title = styled.div({
|
|
149
|
+
color: "var(--ds-text, ".concat(colors.N900, ")"),
|
|
150
|
+
fontSize: '16px',
|
|
151
|
+
fontWeight: 500,
|
|
152
|
+
lineHeight: 20 / 16,
|
|
153
|
+
maxHeight: "".concat(20 * 4, "px"),
|
|
154
|
+
overflow: 'hidden'
|
|
155
|
+
});
|
|
156
|
+
export var Byline = styled.div({
|
|
157
|
+
marginTop: "var(--ds-space-050, 4px)",
|
|
158
|
+
color: "var(--ds-text-subtlest, ".concat(colors.N300, ")"),
|
|
159
|
+
fontSize: '12px',
|
|
160
|
+
fontWeight: 'normal',
|
|
161
|
+
lineHeight: 16 / 12
|
|
162
|
+
}, ellipsis('100%'));
|
|
119
163
|
|
|
120
164
|
// eslint-disable-next-line @atlaskit/design-system/ensure-design-token-usage
|
|
121
|
-
export var Description = styled.div(
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
165
|
+
export var Description = styled.div({
|
|
166
|
+
marginTop: '7px',
|
|
167
|
+
color: "var(--ds-text, ".concat(colors.N800, ")"),
|
|
168
|
+
fontSize: '12px',
|
|
169
|
+
fontWeight: 'normal',
|
|
170
|
+
lineHeight: 18 / 12,
|
|
171
|
+
maxHeight: "".concat(18 * 3, "px"),
|
|
172
|
+
overflow: 'hidden'
|
|
173
|
+
});
|
|
174
|
+
export var ResolvedViewIconWrapper = styled.div({
|
|
175
|
+
marginTop: "var(--ds-space-050, 4px)"
|
|
176
|
+
});
|
|
177
|
+
export var Thumbnail = styled.div(borderRadius, csssize(48), {
|
|
178
|
+
float: 'right',
|
|
179
|
+
margin: "var(--ds-space-050, 4px)".concat(" 0 ", "var(--ds-space-150, 12px)", " ", "var(--ds-space-150, 12px)"),
|
|
180
|
+
backgroundColor: "var(--ds-skeleton, ".concat(colors.N30, ")"),
|
|
181
|
+
backgroundImage: "url(".concat(function (_ref15) {
|
|
182
|
+
var src = _ref15.src;
|
|
183
|
+
return src;
|
|
184
|
+
}, ")"),
|
|
185
|
+
backgroundSize: 'cover'
|
|
186
|
+
});
|
|
187
|
+
export var UsersWrapper = styled.div({
|
|
188
|
+
marginTop: "var(--ds-space-100, 8px)"
|
|
189
|
+
});
|
|
190
|
+
export var ActionsWrapper = styled.div({
|
|
191
|
+
marginTop: "var(--ds-space-100, 8px)",
|
|
192
|
+
textAlign: 'right',
|
|
193
|
+
'> *': {
|
|
194
|
+
marginTop: "var(--ds-space-050, 4px)"
|
|
195
|
+
},
|
|
196
|
+
'> * + *': {
|
|
197
|
+
marginLeft: "var(--ds-space-050, 4px)"
|
|
198
|
+
}
|
|
126
199
|
});
|
|
127
|
-
export var
|
|
128
|
-
|
|
129
|
-
|
|
200
|
+
export var AlertWrapper = styled.div({
|
|
201
|
+
position: 'absolute',
|
|
202
|
+
top: 0,
|
|
203
|
+
right: 0,
|
|
204
|
+
bottom: 0,
|
|
205
|
+
left: 0,
|
|
206
|
+
overflow: 'hidden',
|
|
207
|
+
pointerEvents: 'none',
|
|
208
|
+
zIndex: maxAvatarCount + 1
|
|
209
|
+
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
-
import React, { useCallback, useMemo, useState } from 'react';
|
|
4
|
+
import React, { useCallback, useMemo, useRef, useState, useEffect } from 'react';
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import { Box, Inline } from '@atlaskit/primitives';
|
|
7
7
|
import { ActionName, SmartLinkDirection, SmartLinkSize, SmartLinkWidth } from '../../../../../../constants';
|
|
@@ -23,39 +23,46 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
23
23
|
actions = _props$actions === void 0 ? [] : _props$actions,
|
|
24
24
|
metadata = props.metadata,
|
|
25
25
|
onActionMenuOpenChange = props.onActionMenuOpenChange,
|
|
26
|
-
onAIActionChange = props.onAIActionChange,
|
|
27
26
|
_props$size = props.size,
|
|
28
27
|
size = _props$size === void 0 ? SmartLinkSize.Medium : _props$size,
|
|
29
|
-
testId = props.testId
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
aiState = _useState2[0],
|
|
33
|
-
setAIState = _useState2[1];
|
|
28
|
+
testId = props.testId,
|
|
29
|
+
aiSummaryMinHeight = props.aiSummaryMinHeight;
|
|
30
|
+
var metadataElements = renderElementItems(metadata);
|
|
34
31
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
35
32
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
36
|
-
var metadataElements = renderElementItems(metadata);
|
|
37
33
|
var context = useFlexibleUiContext();
|
|
38
34
|
var url = (context === null || context === void 0 ? void 0 : context.url) || '';
|
|
39
|
-
var
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
var
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
var _useAISummary = useAISummary({
|
|
36
|
+
url: url
|
|
37
|
+
}),
|
|
38
|
+
summariseUrl = _useAISummary.summariseUrl,
|
|
39
|
+
_useAISummary$state = _useAISummary.state,
|
|
40
|
+
content = _useAISummary$state.content,
|
|
41
|
+
status = _useAISummary$state.status;
|
|
42
|
+
var showAISummary = status !== 'ready' && status !== 'error';
|
|
43
|
+
var isSummarisedOnMountRef = useRef(status === 'done');
|
|
44
|
+
var isErroredOnMountRef = useRef(status === 'error');
|
|
45
|
+
var _useState = useState(false),
|
|
46
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
47
|
+
showAISummaryErrorMessage = _useState2[0],
|
|
48
|
+
setShowAISummaryErrorMessage = _useState2[1];
|
|
49
|
+
useEffect(function () {
|
|
50
|
+
if (isErroredOnMountRef.current && status === 'loading') {
|
|
51
|
+
isErroredOnMountRef.current = false;
|
|
52
|
+
setShowAISummaryErrorMessage(true);
|
|
53
|
+
} else {
|
|
54
|
+
setShowAISummaryErrorMessage(!isErroredOnMountRef.current && status === 'error');
|
|
51
55
|
}
|
|
52
|
-
}, [
|
|
56
|
+
}, [status]);
|
|
53
57
|
var combinedActions = useMemo(function () {
|
|
54
|
-
if (
|
|
58
|
+
if (status === 'ready' || status === 'error') {
|
|
55
59
|
var aiAction = {
|
|
56
60
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summarize),
|
|
57
61
|
name: ActionName.CustomAction,
|
|
58
|
-
onClick:
|
|
62
|
+
onClick: function onClick() {
|
|
63
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
64
|
+
summariseUrl();
|
|
65
|
+
},
|
|
59
66
|
testId: "".concat(testId, "-ai-summary-action"),
|
|
60
67
|
icon: /*#__PURE__*/React.createElement(AIIcon, {
|
|
61
68
|
label: "AIIcon"
|
|
@@ -64,7 +71,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
64
71
|
return [aiAction].concat(_toConsumableArray(actions));
|
|
65
72
|
}
|
|
66
73
|
return actions;
|
|
67
|
-
}, [actions,
|
|
74
|
+
}, [actions, status, testId, summariseUrl, fireEvent]);
|
|
68
75
|
var onDropdownOpenChange = useCallback(function (isOpen) {
|
|
69
76
|
if (onActionMenuOpenChange) {
|
|
70
77
|
onActionMenuOpenChange({
|
|
@@ -76,17 +83,18 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
76
83
|
direction: SmartLinkDirection.Vertical,
|
|
77
84
|
testId: "".concat(testId, "-resolved-view")
|
|
78
85
|
}), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
79
|
-
fromCache:
|
|
80
|
-
}), /*#__PURE__*/React.createElement(AISummary, {
|
|
86
|
+
fromCache: isSummarisedOnMountRef.current
|
|
87
|
+
}), showAISummary && /*#__PURE__*/React.createElement(AISummary, {
|
|
88
|
+
minHeight: aiSummaryMinHeight,
|
|
81
89
|
content: content,
|
|
82
|
-
showIcon:
|
|
90
|
+
showIcon: isSummarisedOnMountRef.current
|
|
83
91
|
}), /*#__PURE__*/React.createElement(Inline, {
|
|
84
92
|
alignBlock: "center",
|
|
85
93
|
alignInline: "end",
|
|
86
94
|
grow: "fill",
|
|
87
95
|
spread: "space-between"
|
|
88
|
-
}, /*#__PURE__*/React.createElement(Box, null, !
|
|
89
|
-
state:
|
|
96
|
+
}, /*#__PURE__*/React.createElement(Box, null, !isSummarisedOnMountRef.current && (status === 'loading' || status === 'done') ? /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
97
|
+
state: status,
|
|
90
98
|
testId: "".concat(testId, "-state-indicator")
|
|
91
99
|
}) : /*#__PURE__*/React.createElement(ElementGroup, {
|
|
92
100
|
width: SmartLinkWidth.FitToContent,
|
|
@@ -96,7 +104,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
96
104
|
items: combinedActions,
|
|
97
105
|
appearance: "default",
|
|
98
106
|
size: size
|
|
99
|
-
}))),
|
|
107
|
+
}))), showAISummaryErrorMessage && /*#__PURE__*/React.createElement(Inline, {
|
|
100
108
|
grow: "fill"
|
|
101
109
|
}, /*#__PURE__*/React.createElement(AIEventErrorViewed, null), /*#__PURE__*/React.createElement(AIStateIndicator, {
|
|
102
110
|
state: status,
|
|
@@ -155,7 +155,6 @@ var importIcon = function importIcon(importFn) {
|
|
|
155
155
|
}
|
|
156
156
|
}); // Because we're using dynamic loading here, TS will not be able to infer the type.
|
|
157
157
|
};
|
|
158
|
-
|
|
159
158
|
var AtlaskitIcon = function AtlaskitIcon(_ref3) {
|
|
160
159
|
var icon = _ref3.icon,
|
|
161
160
|
label = _ref3.label,
|
|
@@ -189,7 +188,6 @@ var AtlaskitIcon = function AtlaskitIcon(_ref3) {
|
|
|
189
188
|
iconGradientStop: B200
|
|
190
189
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
191
190
|
});
|
|
192
|
-
|
|
193
191
|
case IconType.Jira:
|
|
194
192
|
// Logo component has a different prop set from other icon components
|
|
195
193
|
return /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
@@ -201,7 +199,6 @@ var AtlaskitIcon = function AtlaskitIcon(_ref3) {
|
|
|
201
199
|
iconGradientStop: B200
|
|
202
200
|
/* eslint-enable @atlaskit/design-system/ensure-design-token-usage */
|
|
203
201
|
});
|
|
204
|
-
|
|
205
202
|
case IconType.Error:
|
|
206
203
|
case IconType.Forbidden:
|
|
207
204
|
return /*#__PURE__*/React.createElement(ImportedIcon, {
|
|
@@ -1,31 +1,57 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
3
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["children", "isAIEnabled", "
|
|
4
|
+
var _excluded = ["children", "isAIEnabled", "testId", "url"],
|
|
5
|
+
_excluded2 = ["children", "isAIEnabled", "testId", "url"];
|
|
4
6
|
/** @jsx jsx */
|
|
5
7
|
import { jsx } from '@emotion/react';
|
|
6
|
-
import React from 'react';
|
|
8
|
+
import React, { useState, useEffect } from 'react';
|
|
7
9
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
8
10
|
import { HoverCardContainer, popupContainerStyles } from '../styled';
|
|
9
11
|
import AIPrism from '../../common/ai-prism';
|
|
10
12
|
import { hoverCardClassName } from './HoverCardContent';
|
|
11
|
-
|
|
13
|
+
import { useAISummary } from '../../../state/hooks/use-ai-summary';
|
|
14
|
+
var ConnectedAIPrismContainer = function ConnectedAIPrismContainer(_ref) {
|
|
12
15
|
var children = _ref.children,
|
|
13
16
|
_ref$isAIEnabled = _ref.isAIEnabled,
|
|
14
17
|
isAIEnabled = _ref$isAIEnabled === void 0 ? false : _ref$isAIEnabled,
|
|
15
|
-
_ref$showPrism = _ref.showPrism,
|
|
16
|
-
showPrism = _ref$showPrism === void 0 ? false : _ref$showPrism,
|
|
17
18
|
testId = _ref.testId,
|
|
19
|
+
url = _ref.url,
|
|
18
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var _useAISummary = useAISummary({
|
|
22
|
+
url: url
|
|
23
|
+
}),
|
|
24
|
+
status = _useAISummary.state.status;
|
|
25
|
+
var _useState = useState(status === 'loading'),
|
|
26
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
27
|
+
showPrism = _useState2[0],
|
|
28
|
+
setShowPrism = _useState2[1];
|
|
29
|
+
useEffect(function () {
|
|
30
|
+
setShowPrism(status === 'loading');
|
|
31
|
+
}, [status]);
|
|
32
|
+
var container = jsx("div", _extends({
|
|
33
|
+
className: hoverCardClassName,
|
|
34
|
+
css: [HoverCardContainer, isAIEnabled && showPrism ? undefined : popupContainerStyles],
|
|
35
|
+
"data-testid": testId
|
|
36
|
+
}, props), children);
|
|
37
|
+
return isAIEnabled ? jsx(AIPrism, {
|
|
38
|
+
isVisible: showPrism,
|
|
39
|
+
testId: "".concat(testId, "-prism")
|
|
40
|
+
}, container) : container;
|
|
41
|
+
};
|
|
42
|
+
var ContentContainer = function ContentContainer(_ref2) {
|
|
43
|
+
var children = _ref2.children,
|
|
44
|
+
_ref2$isAIEnabled = _ref2.isAIEnabled,
|
|
45
|
+
isAIEnabled = _ref2$isAIEnabled === void 0 ? false : _ref2$isAIEnabled,
|
|
46
|
+
testId = _ref2.testId,
|
|
47
|
+
url = _ref2.url,
|
|
48
|
+
props = _objectWithoutProperties(_ref2, _excluded2);
|
|
19
49
|
if (getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries')) {
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
50
|
+
return jsx(ConnectedAIPrismContainer, _extends({
|
|
51
|
+
isAIEnabled: isAIEnabled,
|
|
52
|
+
url: url,
|
|
53
|
+
testId: testId
|
|
24
54
|
}, props), children);
|
|
25
|
-
return isAIEnabled ? jsx(AIPrism, {
|
|
26
|
-
isVisible: showPrism,
|
|
27
|
-
testId: "".concat(testId, "-prism")
|
|
28
|
-
}, container) : container;
|
|
29
55
|
}
|
|
30
56
|
return jsx("div", _extends({
|
|
31
57
|
className: hoverCardClassName,
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
1
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
2
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
4
3
|
/** @jsx jsx */
|
|
5
4
|
import { jsx } from '@emotion/react';
|
|
6
5
|
import { useAnalyticsEvents } from '@atlaskit/analytics-next';
|
|
7
6
|
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
8
|
-
import React, { useCallback, useEffect, useMemo, useRef
|
|
7
|
+
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
9
8
|
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
10
9
|
import { ActionName, CardDisplay, SmartLinkPosition, SmartLinkSize } from '../../../constants';
|
|
11
10
|
import { extractMetadata } from '../../../extractors/hover/extractMetadata';
|
|
@@ -86,10 +85,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
86
85
|
var services = getServices(linkState.details);
|
|
87
86
|
var statusRef = useRef(linkStatus);
|
|
88
87
|
var analyticsRef = useRef(analytics);
|
|
89
|
-
var _useState = useState(false),
|
|
90
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
91
|
-
showPrism = _useState2[0],
|
|
92
|
-
setShowPrism = _useState2[1];
|
|
93
88
|
useEffect(function () {
|
|
94
89
|
/**
|
|
95
90
|
* Must access current analytics object value via ref because its not stable
|
|
@@ -162,9 +157,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
162
157
|
var onClickStopPropagation = useCallback(function (e) {
|
|
163
158
|
return e.stopPropagation();
|
|
164
159
|
}, []);
|
|
165
|
-
var onAIActionChange = useCallback(function (state) {
|
|
166
|
-
setShowPrism(state === 'loading');
|
|
167
|
-
}, []);
|
|
168
160
|
var getCardView = function getCardView(cardState) {
|
|
169
161
|
if (cardState.metadataStatus === 'pending') {
|
|
170
162
|
return jsx(HoverCardLoadingView, {
|
|
@@ -197,7 +189,6 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
197
189
|
flexibleCardProps: flexibleCardProps,
|
|
198
190
|
isAISummaryEnabled: isAISummaryEnabled,
|
|
199
191
|
onActionClick: onActionClick,
|
|
200
|
-
onAIActionChange: onAIActionChange,
|
|
201
192
|
titleBlockProps: titleBlockProps
|
|
202
193
|
});
|
|
203
194
|
}
|
|
@@ -209,7 +200,7 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
209
200
|
onMouseLeave: onMouseLeave,
|
|
210
201
|
onClick: onClickStopPropagation,
|
|
211
202
|
isAIEnabled: isAISummaryEnabled,
|
|
212
|
-
|
|
203
|
+
url: url
|
|
213
204
|
}, cardView) : null;
|
|
214
205
|
};
|
|
215
206
|
export default HoverCardContent;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
3
3
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
4
|
-
import { ActionName, CardDisplay, ElementName, SmartLinkPosition, SmartLinkSize } from '../../../../../constants';
|
|
5
|
-
import { FooterBlock, MetadataBlock, RelatedUrlsBlock, SnippetBlock, TitleBlock, AISummaryBlock } from '../../../../FlexibleCard/components/blocks';
|
|
4
|
+
import { ActionName, CardDisplay, ElementName, SmartLinkPosition, SmartLinkSize, SmartLinkDirection } from '../../../../../constants';
|
|
5
|
+
import { FooterBlock, MetadataBlock, RelatedUrlsBlock, SnippetBlock, TitleBlock, AISummaryBlock, CustomBlock } from '../../../../FlexibleCard/components/blocks';
|
|
6
6
|
import { footerBlockCss, hiddenSnippetStyles, metadataBlockCss } from './styled';
|
|
7
7
|
import FlexibleCard from '../../../../FlexibleCard';
|
|
8
8
|
import { getSimulatedBetterMetadata } from '../../../utils';
|
|
@@ -12,6 +12,8 @@ import { messages } from '../../../../../messages';
|
|
|
12
12
|
import { FormattedMessage } from 'react-intl-next';
|
|
13
13
|
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
14
14
|
import { getCanBeDatasource } from '../../../../../state/helpers';
|
|
15
|
+
import { useAISummary } from '../../../../../state/hooks/use-ai-summary';
|
|
16
|
+
import { SmartLinkStatus } from '../../../../../constants';
|
|
15
17
|
export var toFooterActions = function toFooterActions(cardActions, onActionClick) {
|
|
16
18
|
var followAction = {
|
|
17
19
|
hideIcon: true,
|
|
@@ -46,19 +48,41 @@ export var toFooterActions = function toFooterActions(cardActions, onActionClick
|
|
|
46
48
|
});
|
|
47
49
|
return [followAction].concat(_toConsumableArray(actions));
|
|
48
50
|
};
|
|
49
|
-
|
|
51
|
+
|
|
52
|
+
//This component encapsulates useAISummary hook under the AI Summary FF 'platform.linking-platform.smart-card.hover-card-ai-summaries'
|
|
53
|
+
var ConnectedAIBlock = function ConnectedAIBlock(_ref) {
|
|
54
|
+
var bottomPrimary = _ref.bottomPrimary,
|
|
55
|
+
url = _ref.url,
|
|
56
|
+
imagePreview = _ref.imagePreview;
|
|
57
|
+
var aiSummary = useAISummary({
|
|
58
|
+
url: url
|
|
59
|
+
});
|
|
60
|
+
var aiStatus = aiSummary.state.status;
|
|
61
|
+
var 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
|
+
};
|
|
74
|
+
var HoverCardResolvedView = function HoverCardResolvedView(_ref2) {
|
|
50
75
|
var _cardState$details;
|
|
51
|
-
var flexibleCardProps =
|
|
52
|
-
titleBlockProps =
|
|
53
|
-
analytics =
|
|
54
|
-
cardState =
|
|
55
|
-
|
|
56
|
-
cardActions =
|
|
57
|
-
isAISummaryEnabled =
|
|
58
|
-
onActionClick =
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
url = _ref.url;
|
|
76
|
+
var flexibleCardProps = _ref2.flexibleCardProps,
|
|
77
|
+
titleBlockProps = _ref2.titleBlockProps,
|
|
78
|
+
analytics = _ref2.analytics,
|
|
79
|
+
cardState = _ref2.cardState,
|
|
80
|
+
_ref2$cardActions = _ref2.cardActions,
|
|
81
|
+
cardActions = _ref2$cardActions === void 0 ? [] : _ref2$cardActions,
|
|
82
|
+
isAISummaryEnabled = _ref2.isAISummaryEnabled,
|
|
83
|
+
onActionClick = _ref2.onActionClick,
|
|
84
|
+
extensionKey = _ref2.extensionKey,
|
|
85
|
+
url = _ref2.url;
|
|
62
86
|
var canBeDatasource = getCanBeDatasource(cardState.details);
|
|
63
87
|
useEffect(function () {
|
|
64
88
|
// Since this hover view is only rendered on resolved status,
|
|
@@ -90,6 +114,15 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
90
114
|
var _snippetBlockRef$curr, _snippetBlockRef$curr2;
|
|
91
115
|
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;
|
|
92
116
|
}, []);
|
|
117
|
+
|
|
118
|
+
// We want to maintain the height of the HoverCard while summarizing and pass this height to the AISummaryBlock.
|
|
119
|
+
// This approach will prevent any abrupt changes in the height of the HoverCard.
|
|
120
|
+
var connectedAIBlockHeight = React.useRef(0);
|
|
121
|
+
var connectedAIBlockRef = useRef(null);
|
|
122
|
+
var onConnectedAIBlockRender = useCallback(function () {
|
|
123
|
+
var _connectedAIBlockRef$, _connectedAIBlockRef$2;
|
|
124
|
+
connectedAIBlockHeight.current = (_connectedAIBlockRef$ = (_connectedAIBlockRef$2 = connectedAIBlockRef.current) === null || _connectedAIBlockRef$2 === void 0 ? void 0 : _connectedAIBlockRef$2.getBoundingClientRect().height) !== null && _connectedAIBlockRef$ !== void 0 ? _connectedAIBlockRef$ : 0;
|
|
125
|
+
}, []);
|
|
93
126
|
var imagePreview = ImagePreview({
|
|
94
127
|
data: data,
|
|
95
128
|
fallbackElementHeight: snippetHeight.current
|
|
@@ -102,16 +135,31 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
102
135
|
overrideCss: metadataBlockCss,
|
|
103
136
|
maxLines: 1,
|
|
104
137
|
size: SmartLinkSize.Medium
|
|
105
|
-
}),
|
|
138
|
+
}), isAISummaryEnabled &&
|
|
139
|
+
/*#__PURE__*/
|
|
140
|
+
// All custom elements should be contained within a CustomBlock.
|
|
141
|
+
// Flex Container components check whether the direct child is a flex blocks. It removes anything that isn't
|
|
142
|
+
React.createElement(CustomBlock, {
|
|
143
|
+
direction: SmartLinkDirection.Vertical,
|
|
144
|
+
onRender: onConnectedAIBlockRender,
|
|
145
|
+
blockRef: connectedAIBlockRef
|
|
146
|
+
}, /*#__PURE__*/React.createElement(ConnectedAIBlock, {
|
|
147
|
+
imagePreview: !!imagePreview,
|
|
148
|
+
url: url,
|
|
149
|
+
bottomPrimary: bottomPrimary
|
|
150
|
+
})), !isAISummaryEnabled && !imagePreview && /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
151
|
+
status: SmartLinkStatus.Resolved
|
|
152
|
+
}), /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
106
153
|
testId: 'hidden-snippet',
|
|
107
154
|
onRender: onSnippetRender,
|
|
108
155
|
blockRef: snippetBlockRef,
|
|
109
156
|
overrideCss: hiddenSnippetStyles
|
|
110
|
-
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
157
|
+
}), !isAISummaryEnabled && /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
111
158
|
primary: bottomPrimary,
|
|
112
159
|
size: SmartLinkSize.Large,
|
|
113
160
|
overrideCss: metadataBlockCss,
|
|
114
|
-
maxLines: 1
|
|
161
|
+
maxLines: 1,
|
|
162
|
+
status: SmartLinkStatus.Resolved
|
|
115
163
|
}), getBooleanFF('platform.linking-platform.smart-card.enable-hover-card-related-urls') && /*#__PURE__*/React.createElement(RelatedUrlsBlock, {
|
|
116
164
|
url: url,
|
|
117
165
|
size: SmartLinkSize.Small
|
|
@@ -120,7 +168,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
120
168
|
name: ElementName.Provider
|
|
121
169
|
}],
|
|
122
170
|
actions: footerActions,
|
|
123
|
-
|
|
171
|
+
aiSummaryMinHeight: connectedAIBlockHeight.current
|
|
124
172
|
}) : /*#__PURE__*/React.createElement(FooterBlock, {
|
|
125
173
|
actions: footerActions,
|
|
126
174
|
size: SmartLinkSize.Large,
|
|
@@ -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 { R300 } from '@atlaskit/theme/colors';
|
|
12
12
|
import ErrorIcon from '@atlaskit/icon/glyph/error';
|
|
@@ -7,7 +7,7 @@ import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstruct
|
|
|
7
7
|
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
8
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
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
|
import React from 'react';
|
|
12
12
|
import { R400, N500 } from '@atlaskit/theme/colors';
|
|
13
13
|
import LockIcon from '@atlaskit/icon/glyph/lock-filled';
|
|
@@ -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 ImageLoader from 'react-render-image';
|
|
12
12
|
import { Icon, Shimmer } from '../Icon';
|
|
@@ -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 { Frame } from '../Frame';
|
|
10
10
|
import Lozenge from '@atlaskit/lozenge';
|
|
@@ -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 { Frame } from '../Frame';
|
|
10
10
|
import Spinner from '@atlaskit/spinner';
|