@atlaskit/smart-card 26.67.0 → 26.69.0
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 +28 -0
- package/dist/cjs/messages.js +22 -22
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +5 -2
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +5 -4
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +7 -7
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +8 -3
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +13 -0
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +3 -7
- package/dist/cjs/view/HoverCard/components/views/resolved/redesign.js +81 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/messages.js +22 -22
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +7 -7
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +8 -3
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +13 -0
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +4 -8
- package/dist/es2019/view/HoverCard/components/views/resolved/redesign.js +73 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/messages.js +22 -22
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +5 -2
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +5 -4
- package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js +7 -7
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +8 -3
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +13 -0
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +4 -8
- package/dist/esm/view/HoverCard/components/views/resolved/redesign.js +71 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/__fixtures__/flexible-ui-data-context.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +7 -2
- package/dist/types/view/HoverCard/components/views/resolved/redesign.d.ts +4 -0
- package/dist/types-ts4.5/__fixtures__/flexible-ui-data-context.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/types.d.ts +7 -2
- package/dist/types-ts4.5/view/HoverCard/components/views/resolved/redesign.d.ts +4 -0
- package/package.json +3 -3
package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js
CHANGED
|
@@ -17,7 +17,7 @@ export function CopySummaryAction({
|
|
|
17
17
|
const {
|
|
18
18
|
fireEvent
|
|
19
19
|
} = useAnalyticsEvents();
|
|
20
|
-
const [tooltipMessage, setTooltipMessage] = useState(messages.
|
|
20
|
+
const [tooltipMessage, setTooltipMessage] = useState(messages.copy_summary_action_description);
|
|
21
21
|
const handleCopySummaryClick = useCallback(async () => {
|
|
22
22
|
fireEvent('ui.button.clicked.copySummary', {});
|
|
23
23
|
await navigator.clipboard.writeText(content !== null && content !== void 0 ? content : '');
|
|
@@ -31,6 +31,7 @@ export function CopySummaryAction({
|
|
|
31
31
|
}),
|
|
32
32
|
onClick: handleCopySummaryClick,
|
|
33
33
|
testId: `${testId}-copy-summary-action`,
|
|
34
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
34
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
|
|
35
|
+
tooltipOnHide: () => setTooltipMessage(messages.copy_summary_action_description)
|
|
35
36
|
}, props));
|
|
36
37
|
}
|
|
@@ -28,14 +28,15 @@ const AutomationAction = props => {
|
|
|
28
28
|
const automationActionTitle = /*#__PURE__*/React.createElement(FormattedMessage, messages.automation_action_title);
|
|
29
29
|
const automationActionTooltip = /*#__PURE__*/React.createElement(FormattedMessage, messages.automation_action_tooltip);
|
|
30
30
|
const automationActionIconLabel = formatMessage(messages.automation_action_icon_label);
|
|
31
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Action, _extends({
|
|
31
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Action, _extends({
|
|
32
32
|
content: automationActionTitle,
|
|
33
33
|
icon: /*#__PURE__*/React.createElement(AutomationManualTriggersGlyph, {
|
|
34
34
|
label: automationActionIconLabel
|
|
35
35
|
}),
|
|
36
|
-
onClick: () => handleAutomateActionClick(setIsModalOpen),
|
|
37
36
|
testId: "smart-action-automation-action",
|
|
38
37
|
tooltipMessage: automationActionTooltip
|
|
38
|
+
}, data, props, {
|
|
39
|
+
onClick: () => handleAutomateActionClick(setIsModalOpen)
|
|
39
40
|
})));
|
|
40
41
|
};
|
|
41
42
|
export default AutomationAction;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
2
3
|
import { di } from 'react-magnetic-di';
|
|
3
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
5
5
|
import { Box, Inline } from '@atlaskit/primitives';
|
|
6
|
-
import
|
|
6
|
+
import AIIcon from '../../../../../common/ai-icon';
|
|
7
7
|
import { InfoIcon } from '../icons/info';
|
|
8
8
|
import { messages } from '../../../../../../messages';
|
|
9
9
|
import { useAISummary } from '../../../../../../state/hooks/use-ai-summary';
|
|
@@ -32,14 +32,14 @@ export const AIFooterMetadata = ({
|
|
|
32
32
|
grow: "fill"
|
|
33
33
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
34
34
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summarized_info_short),
|
|
35
|
-
position: "
|
|
35
|
+
position: "bottom"
|
|
36
36
|
}, tooltipProps => /*#__PURE__*/React.createElement(Box, tooltipProps, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
37
37
|
label: "Information",
|
|
38
38
|
size: "small",
|
|
39
39
|
primaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
40
|
-
}))), /*#__PURE__*/React.createElement(
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
}))), /*#__PURE__*/React.createElement(AIIcon, {
|
|
41
|
+
label: "AI",
|
|
42
|
+
size: "small",
|
|
43
|
+
primaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
44
44
|
}));
|
|
45
45
|
};
|
|
@@ -60,7 +60,8 @@ const AISummaryBlockResolvedView = props => {
|
|
|
60
60
|
size = SmartLinkSize.Medium,
|
|
61
61
|
testId,
|
|
62
62
|
aiSummaryMinHeight = 0,
|
|
63
|
-
metadata
|
|
63
|
+
metadata,
|
|
64
|
+
placeholder
|
|
64
65
|
} = props;
|
|
65
66
|
const {
|
|
66
67
|
fireEvent
|
|
@@ -91,6 +92,7 @@ const AISummaryBlockResolvedView = props => {
|
|
|
91
92
|
status === 'loading' && !!content;
|
|
92
93
|
const isSummarisedOnMountRef = useRef(status === 'done');
|
|
93
94
|
const isErroredOnMountRef = useRef(status === 'error');
|
|
95
|
+
const minHeight = getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && isSummarisedOnMountRef.current ? 0 : aiSummaryMinHeight;
|
|
94
96
|
useEffect(() => {
|
|
95
97
|
// if the error was apparent on mount and the status is changed to loading we can
|
|
96
98
|
// clear the initial error on mount state
|
|
@@ -133,6 +135,9 @@ const AISummaryBlockResolvedView = props => {
|
|
|
133
135
|
});
|
|
134
136
|
}
|
|
135
137
|
}, [onActionMenuOpenChange]);
|
|
138
|
+
if (!showAISummary && getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign')) {
|
|
139
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, placeholder);
|
|
140
|
+
}
|
|
136
141
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
137
142
|
direction: SmartLinkDirection.Vertical,
|
|
138
143
|
testId: `${testId}-resolved-view`
|
|
@@ -146,12 +151,12 @@ const AISummaryBlockResolvedView = props => {
|
|
|
146
151
|
}), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
147
152
|
fromCache: isSummarisedOnMountRef.current
|
|
148
153
|
}), /*#__PURE__*/React.createElement(MotionWrapper, {
|
|
149
|
-
minHeight:
|
|
154
|
+
minHeight: minHeight,
|
|
150
155
|
show: showAISummary,
|
|
151
156
|
showTransition: !isSummarisedOnMountRef.current
|
|
152
157
|
}, /*#__PURE__*/React.createElement(AISummary, {
|
|
153
158
|
testId: `${testId}-ai-summary`,
|
|
154
|
-
minHeight:
|
|
159
|
+
minHeight: minHeight,
|
|
155
160
|
content: content,
|
|
156
161
|
showIcon: !getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && isSummarisedOnMountRef.current
|
|
157
162
|
})), !getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Inline, {
|
|
@@ -14,6 +14,7 @@ import { getMetadata } from '../utils';
|
|
|
14
14
|
import HoverCardLoadingView from './views/resolving';
|
|
15
15
|
import HoverCardUnauthorisedView from './views/unauthorised';
|
|
16
16
|
import HoverCardResolvedView from './views/resolved';
|
|
17
|
+
import HoverCardRedesignedResolvedView from './views/resolved/redesign';
|
|
17
18
|
import { FormattedMessage } from 'react-intl-next';
|
|
18
19
|
import { messages } from '../../../messages';
|
|
19
20
|
import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
@@ -153,6 +154,18 @@ const HoverCardContent = ({
|
|
|
153
154
|
});
|
|
154
155
|
}
|
|
155
156
|
if (cardState.status === 'resolved') {
|
|
157
|
+
if (getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign')) {
|
|
158
|
+
return jsx(HoverCardRedesignedResolvedView, {
|
|
159
|
+
analytics: analytics,
|
|
160
|
+
cardState: cardState,
|
|
161
|
+
extensionKey: extensionKey,
|
|
162
|
+
flexibleCardProps: flexibleCardProps,
|
|
163
|
+
isAISummaryEnabled: isAISummaryEnabled,
|
|
164
|
+
onActionClick: onActionClick,
|
|
165
|
+
titleBlockProps: titleBlockProps,
|
|
166
|
+
url: url
|
|
167
|
+
});
|
|
168
|
+
}
|
|
156
169
|
return jsx(HoverCardResolvedView, {
|
|
157
170
|
id: id,
|
|
158
171
|
url: url,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
3
|
import { ActionName, CardDisplay, ElementName, SmartLinkPosition, SmartLinkSize, SmartLinkDirection } from '../../../../../constants';
|
|
4
|
-
import { FooterBlock, MetadataBlock, RelatedUrlsBlock, SnippetBlock, TitleBlock, AISummaryBlock, CustomBlock
|
|
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 { getMetadata } from '../../../utils';
|
|
@@ -80,7 +80,7 @@ const ConnectedAIBlock = ({
|
|
|
80
80
|
return showData ? /*#__PURE__*/React.createElement(React.Fragment, null, !imagePreview && /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
81
81
|
testId: 'connected-AI',
|
|
82
82
|
status: SmartLinkStatus.Resolved
|
|
83
|
-
}),
|
|
83
|
+
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
84
84
|
primary: bottomPrimary,
|
|
85
85
|
size: SmartLinkSize.Large,
|
|
86
86
|
overrideCss: metadataBlockCss,
|
|
@@ -138,7 +138,6 @@ const HoverCardResolvedView = ({
|
|
|
138
138
|
data: data,
|
|
139
139
|
fallbackElementHeight: snippetHeight.current
|
|
140
140
|
});
|
|
141
|
-
const isActionBlockEnabled = getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') ? true : false;
|
|
142
141
|
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
|
|
143
142
|
metadataPosition: SmartLinkPosition.Top
|
|
144
143
|
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
@@ -166,7 +165,7 @@ const HoverCardResolvedView = ({
|
|
|
166
165
|
onRender: onSnippetRender,
|
|
167
166
|
blockRef: snippetBlockRef,
|
|
168
167
|
overrideCss: hiddenSnippetStyles
|
|
169
|
-
}), !isAISummaryEnabled &&
|
|
168
|
+
}), !isAISummaryEnabled && /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
170
169
|
primary: tertiary,
|
|
171
170
|
size: SmartLinkSize.Large,
|
|
172
171
|
overrideCss: metadataBlockCss,
|
|
@@ -181,10 +180,7 @@ const HoverCardResolvedView = ({
|
|
|
181
180
|
}],
|
|
182
181
|
actions: footerActions,
|
|
183
182
|
aiSummaryMinHeight: connectedAIBlockHeight.current
|
|
184
|
-
}),
|
|
185
|
-
onClick: onActionClick,
|
|
186
|
-
spaceInline: "space.100"
|
|
187
|
-
}), isActionBlockEnabled && /*#__PURE__*/React.createElement(AIFooterBlock, null), !isAISummaryEnabled && !isActionBlockEnabled && /*#__PURE__*/React.createElement(FooterBlock, {
|
|
183
|
+
}), !isAISummaryEnabled && /*#__PURE__*/React.createElement(FooterBlock, {
|
|
188
184
|
actions: footerActions,
|
|
189
185
|
size: SmartLinkSize.Large,
|
|
190
186
|
overrideCss: footerBlockCss
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useCallback, useEffect, useMemo, useRef } from 'react';
|
|
3
|
+
import { CardDisplay, SmartLinkPosition, SmartLinkSize, SmartLinkStatus } from '../../../../../constants';
|
|
4
|
+
import { getCanBeDatasource } from '../../../../../state/helpers';
|
|
5
|
+
import FlexibleCard from '../../../../FlexibleCard';
|
|
6
|
+
import { ActionBlock, AIFooterBlock, AISummaryBlock, MetadataBlock, SnippetBlock, TitleBlock } from '../../../../FlexibleCard/components/blocks';
|
|
7
|
+
import { getMetadata } from '../../../utils';
|
|
8
|
+
import ImagePreview from '../../ImagePreview';
|
|
9
|
+
import { hiddenSnippetStyles, metadataBlockCss } from './styled';
|
|
10
|
+
const HoverCardResolvedView = ({
|
|
11
|
+
analytics,
|
|
12
|
+
cardState,
|
|
13
|
+
extensionKey,
|
|
14
|
+
flexibleCardProps,
|
|
15
|
+
isAISummaryEnabled,
|
|
16
|
+
onActionClick,
|
|
17
|
+
titleBlockProps
|
|
18
|
+
}) => {
|
|
19
|
+
var _cardState$details;
|
|
20
|
+
const canBeDatasource = getCanBeDatasource(cardState.details);
|
|
21
|
+
useEffect(() => {
|
|
22
|
+
// Since this hover view is only rendered on resolved status,
|
|
23
|
+
// there is no need to check for statuses.
|
|
24
|
+
analytics.ui.renderSuccessEvent({
|
|
25
|
+
display: CardDisplay.HoverCardPreview,
|
|
26
|
+
status: cardState.status,
|
|
27
|
+
canBeDatasource
|
|
28
|
+
});
|
|
29
|
+
}, [analytics.ui, cardState.status, canBeDatasource]);
|
|
30
|
+
const data = (_cardState$details = cardState.details) === null || _cardState$details === void 0 ? void 0 : _cardState$details.data;
|
|
31
|
+
const {
|
|
32
|
+
primary,
|
|
33
|
+
secondary
|
|
34
|
+
} = useMemo(() => {
|
|
35
|
+
return getMetadata(extensionKey, data);
|
|
36
|
+
}, [data, extensionKey]);
|
|
37
|
+
const snippetHeight = React.useRef(0);
|
|
38
|
+
const snippetBlockRef = useRef(null);
|
|
39
|
+
const onSnippetRender = useCallback(() => {
|
|
40
|
+
var _snippetBlockRef$curr, _snippetBlockRef$curr2;
|
|
41
|
+
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;
|
|
42
|
+
}, []);
|
|
43
|
+
const imagePreview = ImagePreview({
|
|
44
|
+
data: data,
|
|
45
|
+
fallbackElementHeight: snippetHeight.current
|
|
46
|
+
});
|
|
47
|
+
const snippet = imagePreview ? null : /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
48
|
+
status: SmartLinkStatus.Resolved
|
|
49
|
+
});
|
|
50
|
+
const aiSummaryMinHeight = snippet ? snippetHeight.current : 0;
|
|
51
|
+
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
|
|
52
|
+
metadataPosition: SmartLinkPosition.Top
|
|
53
|
+
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
54
|
+
primary: primary,
|
|
55
|
+
secondary: secondary,
|
|
56
|
+
overrideCss: metadataBlockCss,
|
|
57
|
+
maxLines: 1,
|
|
58
|
+
size: SmartLinkSize.Medium
|
|
59
|
+
}), isAISummaryEnabled ? /*#__PURE__*/React.createElement(AISummaryBlock, {
|
|
60
|
+
aiSummaryMinHeight: aiSummaryMinHeight,
|
|
61
|
+
placeholder: snippet,
|
|
62
|
+
status: SmartLinkStatus.Resolved
|
|
63
|
+
}) : snippet, /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
64
|
+
testId: "hidden-snippet",
|
|
65
|
+
onRender: onSnippetRender,
|
|
66
|
+
blockRef: snippetBlockRef,
|
|
67
|
+
overrideCss: hiddenSnippetStyles
|
|
68
|
+
}), /*#__PURE__*/React.createElement(ActionBlock, {
|
|
69
|
+
onClick: onActionClick,
|
|
70
|
+
spaceInline: "space.100"
|
|
71
|
+
}), /*#__PURE__*/React.createElement(AIFooterBlock, null));
|
|
72
|
+
};
|
|
73
|
+
export default HoverCardResolvedView;
|
|
@@ -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.69.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
package/dist/esm/messages.js
CHANGED
|
@@ -31,7 +31,7 @@ export var messages = defineMessages({
|
|
|
31
31
|
description: 'Additional info about the content summarised by AI.'
|
|
32
32
|
},
|
|
33
33
|
ai_summarized_info_short: {
|
|
34
|
-
id: 'fabric.linking.ai_summarized_info_short
|
|
34
|
+
id: 'fabric.linking.ai_summarized_info_short',
|
|
35
35
|
defaultMessage: 'Content quality may vary',
|
|
36
36
|
description: 'Additional info about the content summarised by AI.'
|
|
37
37
|
},
|
|
@@ -186,7 +186,7 @@ export var messages = defineMessages({
|
|
|
186
186
|
description: ''
|
|
187
187
|
},
|
|
188
188
|
copied_url_to_clipboard: {
|
|
189
|
-
id: 'fabric.linking.copied_url_to_clipboard
|
|
189
|
+
id: 'fabric.linking.copied_url_to_clipboard',
|
|
190
190
|
defaultMessage: 'Copied!',
|
|
191
191
|
description: 'Url has been copied to the clipboard'
|
|
192
192
|
},
|
|
@@ -221,37 +221,37 @@ export var messages = defineMessages({
|
|
|
221
221
|
description: ''
|
|
222
222
|
},
|
|
223
223
|
download_description: {
|
|
224
|
-
id: 'fabric.linking.download_description
|
|
224
|
+
id: 'fabric.linking.download_description',
|
|
225
225
|
defaultMessage: 'Download this file into your local storage',
|
|
226
226
|
description: 'Description on what Download does'
|
|
227
227
|
},
|
|
228
228
|
download_file: {
|
|
229
|
-
id: 'fabric.linking.download_file
|
|
229
|
+
id: 'fabric.linking.download_file',
|
|
230
230
|
defaultMessage: 'Download file',
|
|
231
231
|
description: 'Allow a user to download a file'
|
|
232
232
|
},
|
|
233
233
|
ai_summary_action: {
|
|
234
|
-
id: 'fabric.linking.ai_summary_action
|
|
234
|
+
id: 'fabric.linking.ai_summary_action',
|
|
235
235
|
defaultMessage: 'Summarize with AI',
|
|
236
236
|
description: 'Allow a user to summarize a link'
|
|
237
237
|
},
|
|
238
238
|
ai_summary_action_description: {
|
|
239
|
-
id: 'fabric.linking.ai_summary_action_description
|
|
239
|
+
id: 'fabric.linking.ai_summary_action_description',
|
|
240
240
|
defaultMessage: 'Summarize the content of this link using Atlassian Intelligence.',
|
|
241
241
|
description: 'Description of what the summarize link with AI action does'
|
|
242
242
|
},
|
|
243
243
|
copy_summary_action: {
|
|
244
|
-
id: 'fabric.linking.copy_summary_action
|
|
244
|
+
id: 'fabric.linking.copy_summary_action',
|
|
245
245
|
defaultMessage: 'Copy summary',
|
|
246
246
|
description: 'Allow a user to copy a generated summary'
|
|
247
247
|
},
|
|
248
248
|
copy_summary_action_description: {
|
|
249
|
-
id: 'fabric.linking.
|
|
249
|
+
id: 'fabric.linking.copy_summary_action_description',
|
|
250
250
|
defaultMessage: 'Copy summary',
|
|
251
251
|
description: 'Description of what the copy summary AI action does'
|
|
252
252
|
},
|
|
253
253
|
copied_summary_action_description: {
|
|
254
|
-
id: 'fabric.linking.copied_summary_action_description
|
|
254
|
+
id: 'fabric.linking.copied_summary_action_description',
|
|
255
255
|
defaultMessage: 'Copied summary to clipboard',
|
|
256
256
|
description: 'Confirmation to the user that the summry has been copied'
|
|
257
257
|
},
|
|
@@ -266,32 +266,32 @@ export var messages = defineMessages({
|
|
|
266
266
|
description: 'Click to follow a project.'
|
|
267
267
|
},
|
|
268
268
|
follow_project_description: {
|
|
269
|
-
id: 'fabric.linking.follow_project_description
|
|
269
|
+
id: 'fabric.linking.follow_project_description',
|
|
270
270
|
defaultMessage: 'Follow to get notifications on this project',
|
|
271
271
|
description: 'Description on what Follow does'
|
|
272
272
|
},
|
|
273
273
|
follow_project: {
|
|
274
|
-
id: 'fabric.linking.follow_project
|
|
274
|
+
id: 'fabric.linking.follow_project',
|
|
275
275
|
defaultMessage: 'Follow project',
|
|
276
276
|
description: 'Click to follow a project.'
|
|
277
277
|
},
|
|
278
278
|
follow_project_error: {
|
|
279
|
-
id: 'fabric.linking.follow_project_error
|
|
279
|
+
id: 'fabric.linking.follow_project_error',
|
|
280
280
|
defaultMessage: 'We encountered an error while trying to follow the project. Check your connection or refresh the page and try again.',
|
|
281
281
|
description: 'Shown when an unknown error occurs when following an Atlas project'
|
|
282
282
|
},
|
|
283
283
|
follow_goal_description: {
|
|
284
|
-
id: 'fabric.linking.follow_goal_description
|
|
284
|
+
id: 'fabric.linking.follow_goal_description',
|
|
285
285
|
defaultMessage: 'Follow this goal to get notifications on updates',
|
|
286
286
|
description: 'Description on what Follow does'
|
|
287
287
|
},
|
|
288
288
|
follow_goal: {
|
|
289
|
-
id: 'fabric.linking.follow_goal
|
|
289
|
+
id: 'fabric.linking.follow_goal',
|
|
290
290
|
defaultMessage: 'Follow goal',
|
|
291
291
|
description: 'Click to follow a project.'
|
|
292
292
|
},
|
|
293
293
|
follow_goal_error: {
|
|
294
|
-
id: 'fabric.linking.follow_goal_error
|
|
294
|
+
id: 'fabric.linking.follow_goal_error',
|
|
295
295
|
defaultMessage: 'We encountered an error while trying to follow the goal. Check your connection or refresh the page and try again.',
|
|
296
296
|
description: 'Shown when an unknown error occurs when following an Atlas goal'
|
|
297
297
|
},
|
|
@@ -366,7 +366,7 @@ export var messages = defineMessages({
|
|
|
366
366
|
description: 'Indicates the person or entity that owns or maintains the resource.'
|
|
367
367
|
},
|
|
368
368
|
preview_description: {
|
|
369
|
-
id: 'fabric.linking.preview_description
|
|
369
|
+
id: 'fabric.linking.preview_description',
|
|
370
370
|
defaultMessage: 'Open a full screen preview of this link',
|
|
371
371
|
description: 'Description on what Preview does'
|
|
372
372
|
},
|
|
@@ -556,32 +556,32 @@ export var messages = defineMessages({
|
|
|
556
556
|
description: 'Click to unfollow a project.'
|
|
557
557
|
},
|
|
558
558
|
unfollow_project_description: {
|
|
559
|
-
id: 'fabric.linking.unfollow_project_description
|
|
559
|
+
id: 'fabric.linking.unfollow_project_description',
|
|
560
560
|
defaultMessage: 'Unfollow to stop receiving project notifications',
|
|
561
561
|
description: 'Description on what Unfollow does'
|
|
562
562
|
},
|
|
563
563
|
unfollow_project: {
|
|
564
|
-
id: 'fabric.linking.unfollow_project
|
|
564
|
+
id: 'fabric.linking.unfollow_project',
|
|
565
565
|
defaultMessage: 'Unfollow project',
|
|
566
566
|
description: 'Click to unfollow a project.'
|
|
567
567
|
},
|
|
568
568
|
unfollow_project_error: {
|
|
569
|
-
id: 'fabric.linking.unfollow_project_error
|
|
569
|
+
id: 'fabric.linking.unfollow_project_error',
|
|
570
570
|
defaultMessage: 'We encountered an error while trying to unfollow the project. Check your connection or refresh the page and try again.',
|
|
571
571
|
description: 'Shown when an unknown error occurs when unfollowing an Atlas project'
|
|
572
572
|
},
|
|
573
573
|
unfollow_goal_description: {
|
|
574
|
-
id: 'fabric.linking.unfollow_goal_description
|
|
574
|
+
id: 'fabric.linking.unfollow_goal_description',
|
|
575
575
|
defaultMessage: 'Unfollow to stop receiving notifications for this goal',
|
|
576
576
|
description: 'Description on what Unfollow does'
|
|
577
577
|
},
|
|
578
578
|
unfollow_goal: {
|
|
579
|
-
id: 'fabric.linking.unfollow_goal
|
|
579
|
+
id: 'fabric.linking.unfollow_goal',
|
|
580
580
|
defaultMessage: 'Unfollow goal',
|
|
581
581
|
description: 'Click to unfollow a project.'
|
|
582
582
|
},
|
|
583
583
|
unfollow_goal_error: {
|
|
584
|
-
id: 'fabric.linking.unfollow_goal_error
|
|
584
|
+
id: 'fabric.linking.unfollow_goal_error',
|
|
585
585
|
defaultMessage: 'We encountered an error while trying to unfollow the goal. Check your connection or refresh the page and try again.',
|
|
586
586
|
description: 'Shown when an unknown error occurs when unfollowing an Atlas goal'
|
|
587
587
|
},
|
|
@@ -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.69.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js
CHANGED
|
@@ -20,7 +20,7 @@ export function CopySummaryAction(_ref) {
|
|
|
20
20
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
21
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
22
22
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
23
|
-
var _useState = useState(messages.
|
|
23
|
+
var _useState = useState(messages.copy_summary_action_description),
|
|
24
24
|
_useState2 = _slicedToArray(_useState, 2),
|
|
25
25
|
tooltipMessage = _useState2[0],
|
|
26
26
|
setTooltipMessage = _useState2[1];
|
|
@@ -47,6 +47,9 @@ export function CopySummaryAction(_ref) {
|
|
|
47
47
|
}),
|
|
48
48
|
onClick: handleCopySummaryClick,
|
|
49
49
|
testId: "".concat(testId, "-copy-summary-action"),
|
|
50
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
50
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
|
|
51
|
+
tooltipOnHide: function tooltipOnHide() {
|
|
52
|
+
return setTooltipMessage(messages.copy_summary_action_description);
|
|
53
|
+
}
|
|
51
54
|
}, props));
|
|
52
55
|
}
|
|
@@ -31,16 +31,17 @@ var AutomationAction = function AutomationAction(props) {
|
|
|
31
31
|
var automationActionTitle = /*#__PURE__*/React.createElement(FormattedMessage, messages.automation_action_title);
|
|
32
32
|
var automationActionTooltip = /*#__PURE__*/React.createElement(FormattedMessage, messages.automation_action_tooltip);
|
|
33
33
|
var automationActionIconLabel = formatMessage(messages.automation_action_icon_label);
|
|
34
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Action, _extends({
|
|
34
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Action, _extends({
|
|
35
35
|
content: automationActionTitle,
|
|
36
36
|
icon: /*#__PURE__*/React.createElement(AutomationManualTriggersGlyph, {
|
|
37
37
|
label: automationActionIconLabel
|
|
38
38
|
}),
|
|
39
|
-
onClick: function onClick() {
|
|
40
|
-
return handleAutomateActionClick(setIsModalOpen);
|
|
41
|
-
},
|
|
42
39
|
testId: "smart-action-automation-action",
|
|
43
40
|
tooltipMessage: automationActionTooltip
|
|
41
|
+
}, data, props, {
|
|
42
|
+
onClick: function onClick() {
|
|
43
|
+
return handleAutomateActionClick(setIsModalOpen);
|
|
44
|
+
}
|
|
44
45
|
})));
|
|
45
46
|
};
|
|
46
47
|
export default AutomationAction;
|
package/dist/esm/view/FlexibleCard/components/blocks/ai-footer-block/resolved/ai-footer-metadata.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import Tooltip from '@atlaskit/tooltip';
|
|
2
3
|
import { di } from 'react-magnetic-di';
|
|
3
4
|
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
-
import Tooltip from '@atlaskit/tooltip';
|
|
5
5
|
import { Box, Inline } from '@atlaskit/primitives';
|
|
6
|
-
import
|
|
6
|
+
import AIIcon from '../../../../../common/ai-icon';
|
|
7
7
|
import { InfoIcon } from '../icons/info';
|
|
8
8
|
import { messages } from '../../../../../../messages';
|
|
9
9
|
import { useAISummary } from '../../../../../../state/hooks/use-ai-summary';
|
|
@@ -28,16 +28,16 @@ export var AIFooterMetadata = function AIFooterMetadata(_ref) {
|
|
|
28
28
|
grow: "fill"
|
|
29
29
|
}, /*#__PURE__*/React.createElement(Tooltip, {
|
|
30
30
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summarized_info_short),
|
|
31
|
-
position: "
|
|
31
|
+
position: "bottom"
|
|
32
32
|
}, function (tooltipProps) {
|
|
33
33
|
return /*#__PURE__*/React.createElement(Box, tooltipProps, /*#__PURE__*/React.createElement(InfoIcon, {
|
|
34
34
|
label: "Information",
|
|
35
35
|
size: "small",
|
|
36
36
|
primaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
37
37
|
}));
|
|
38
|
-
}), /*#__PURE__*/React.createElement(
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
38
|
+
}), /*#__PURE__*/React.createElement(AIIcon, {
|
|
39
|
+
label: "AI",
|
|
40
|
+
size: "small",
|
|
41
|
+
primaryColor: "var(--ds-icon-subtle, #626F86)"
|
|
42
42
|
}));
|
|
43
43
|
};
|
|
@@ -63,7 +63,8 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
63
63
|
testId = props.testId,
|
|
64
64
|
_props$aiSummaryMinHe = props.aiSummaryMinHeight,
|
|
65
65
|
aiSummaryMinHeight = _props$aiSummaryMinHe === void 0 ? 0 : _props$aiSummaryMinHe,
|
|
66
|
-
metadata = props.metadata
|
|
66
|
+
metadata = props.metadata,
|
|
67
|
+
placeholder = props.placeholder;
|
|
67
68
|
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
68
69
|
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
69
70
|
var context = useFlexibleUiContext();
|
|
@@ -89,6 +90,7 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
89
90
|
status === 'loading' && !!content;
|
|
90
91
|
var isSummarisedOnMountRef = useRef(status === 'done');
|
|
91
92
|
var isErroredOnMountRef = useRef(status === 'error');
|
|
93
|
+
var minHeight = getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && isSummarisedOnMountRef.current ? 0 : aiSummaryMinHeight;
|
|
92
94
|
useEffect(function () {
|
|
93
95
|
// if the error was apparent on mount and the status is changed to loading we can
|
|
94
96
|
// clear the initial error on mount state
|
|
@@ -131,6 +133,9 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
131
133
|
});
|
|
132
134
|
}
|
|
133
135
|
}, [onActionMenuOpenChange]);
|
|
136
|
+
if (!showAISummary && getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign')) {
|
|
137
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, placeholder);
|
|
138
|
+
}
|
|
134
139
|
return /*#__PURE__*/React.createElement(Block, _extends({}, props, {
|
|
135
140
|
direction: SmartLinkDirection.Vertical,
|
|
136
141
|
testId: "".concat(testId, "-resolved-view")
|
|
@@ -144,12 +149,12 @@ var AISummaryBlockResolvedView = function AISummaryBlockResolvedView(props) {
|
|
|
144
149
|
}), status === 'done' && /*#__PURE__*/React.createElement(AIEventSummaryViewed, {
|
|
145
150
|
fromCache: isSummarisedOnMountRef.current
|
|
146
151
|
}), /*#__PURE__*/React.createElement(MotionWrapper, {
|
|
147
|
-
minHeight:
|
|
152
|
+
minHeight: minHeight,
|
|
148
153
|
show: showAISummary,
|
|
149
154
|
showTransition: !isSummarisedOnMountRef.current
|
|
150
155
|
}, /*#__PURE__*/React.createElement(AISummary, {
|
|
151
156
|
testId: "".concat(testId, "-ai-summary"),
|
|
152
|
-
minHeight:
|
|
157
|
+
minHeight: minHeight,
|
|
153
158
|
content: content,
|
|
154
159
|
showIcon: !getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && isSummarisedOnMountRef.current
|
|
155
160
|
})), !getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Inline, {
|
|
@@ -16,6 +16,7 @@ import { getMetadata } from '../utils';
|
|
|
16
16
|
import HoverCardLoadingView from './views/resolving';
|
|
17
17
|
import HoverCardUnauthorisedView from './views/unauthorised';
|
|
18
18
|
import HoverCardResolvedView from './views/resolved';
|
|
19
|
+
import HoverCardRedesignedResolvedView from './views/resolved/redesign';
|
|
19
20
|
import { FormattedMessage } from 'react-intl-next';
|
|
20
21
|
import { messages } from '../../../messages';
|
|
21
22
|
import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
@@ -180,6 +181,18 @@ var HoverCardContent = function HoverCardContent(_ref) {
|
|
|
180
181
|
});
|
|
181
182
|
}
|
|
182
183
|
if (cardState.status === 'resolved') {
|
|
184
|
+
if (getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign')) {
|
|
185
|
+
return jsx(HoverCardRedesignedResolvedView, {
|
|
186
|
+
analytics: analytics,
|
|
187
|
+
cardState: cardState,
|
|
188
|
+
extensionKey: extensionKey,
|
|
189
|
+
flexibleCardProps: flexibleCardProps,
|
|
190
|
+
isAISummaryEnabled: isAISummaryEnabled,
|
|
191
|
+
onActionClick: onActionClick,
|
|
192
|
+
titleBlockProps: titleBlockProps,
|
|
193
|
+
url: url
|
|
194
|
+
});
|
|
195
|
+
}
|
|
183
196
|
return jsx(HoverCardResolvedView, {
|
|
184
197
|
id: id,
|
|
185
198
|
url: url,
|
|
@@ -2,7 +2,7 @@ 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
4
|
import { ActionName, CardDisplay, ElementName, SmartLinkPosition, SmartLinkSize, SmartLinkDirection } from '../../../../../constants';
|
|
5
|
-
import { FooterBlock, MetadataBlock, RelatedUrlsBlock, SnippetBlock, TitleBlock, AISummaryBlock, CustomBlock
|
|
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 { getMetadata } from '../../../utils';
|
|
@@ -77,7 +77,7 @@ var ConnectedAIBlock = function ConnectedAIBlock(_ref) {
|
|
|
77
77
|
return showData ? /*#__PURE__*/React.createElement(React.Fragment, null, !imagePreview && /*#__PURE__*/React.createElement(SnippetBlock, {
|
|
78
78
|
testId: 'connected-AI',
|
|
79
79
|
status: SmartLinkStatus.Resolved
|
|
80
|
-
}),
|
|
80
|
+
}), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
81
81
|
primary: bottomPrimary,
|
|
82
82
|
size: SmartLinkSize.Large,
|
|
83
83
|
overrideCss: metadataBlockCss,
|
|
@@ -136,7 +136,6 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref2) {
|
|
|
136
136
|
data: data,
|
|
137
137
|
fallbackElementHeight: snippetHeight.current
|
|
138
138
|
});
|
|
139
|
-
var isActionBlockEnabled = getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign') ? true : false;
|
|
140
139
|
return /*#__PURE__*/React.createElement(FlexibleCard, flexibleCardProps, imagePreview, /*#__PURE__*/React.createElement(TitleBlock, _extends({}, titleBlockProps, {
|
|
141
140
|
metadataPosition: SmartLinkPosition.Top
|
|
142
141
|
})), /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
@@ -164,7 +163,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref2) {
|
|
|
164
163
|
onRender: onSnippetRender,
|
|
165
164
|
blockRef: snippetBlockRef,
|
|
166
165
|
overrideCss: hiddenSnippetStyles
|
|
167
|
-
}), !isAISummaryEnabled &&
|
|
166
|
+
}), !isAISummaryEnabled && /*#__PURE__*/React.createElement(MetadataBlock, {
|
|
168
167
|
primary: tertiary,
|
|
169
168
|
size: SmartLinkSize.Large,
|
|
170
169
|
overrideCss: metadataBlockCss,
|
|
@@ -179,10 +178,7 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref2) {
|
|
|
179
178
|
}],
|
|
180
179
|
actions: footerActions,
|
|
181
180
|
aiSummaryMinHeight: connectedAIBlockHeight.current
|
|
182
|
-
}),
|
|
183
|
-
onClick: onActionClick,
|
|
184
|
-
spaceInline: "space.100"
|
|
185
|
-
}), isActionBlockEnabled && /*#__PURE__*/React.createElement(AIFooterBlock, null), !isAISummaryEnabled && !isActionBlockEnabled && /*#__PURE__*/React.createElement(FooterBlock, {
|
|
181
|
+
}), !isAISummaryEnabled && /*#__PURE__*/React.createElement(FooterBlock, {
|
|
186
182
|
actions: footerActions,
|
|
187
183
|
size: SmartLinkSize.Large,
|
|
188
184
|
overrideCss: footerBlockCss
|