@atlaskit/smart-card 26.56.5 → 26.57.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/constants.js +5 -1
- package/dist/cjs/extractors/flexible/actions/extract-ai-summary-action.js +20 -0
- package/dist/cjs/extractors/flexible/actions/index.js +3 -2
- package/dist/cjs/extractors/flexible/index.js +3 -2
- package/dist/cjs/messages.js +10 -0
- package/dist/cjs/state/hooks/use-ai-summary-config/index.js +19 -0
- package/dist/cjs/state/hooks/use-ai-summary-config/types.js +5 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/utils/get-is-ai-summary-enabled.js +13 -0
- package/dist/cjs/view/Card/types.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +3 -1
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +60 -0
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/index.js +19 -0
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/types.js +5 -0
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -1
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/action-block/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +2 -2
- package/dist/cjs/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/index.js +4 -1
- package/dist/cjs/view/HoverCard/components/HoverCardContent.js +2 -1
- package/dist/cjs/view/HoverCard/utils.js +1 -7
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/constants.js +4 -1
- package/dist/es2019/extractors/flexible/actions/extract-ai-summary-action.js +14 -0
- package/dist/es2019/extractors/flexible/actions/index.js +5 -3
- package/dist/es2019/extractors/flexible/index.js +3 -2
- package/dist/es2019/messages.js +10 -0
- package/dist/es2019/state/flexible-ui-context/types.js +1 -1
- package/dist/es2019/state/hooks/use-ai-summary-config/index.js +12 -0
- package/dist/es2019/state/hooks/use-ai-summary-config/types.js +1 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/utils/get-is-ai-summary-enabled.js +5 -0
- package/dist/es2019/view/Card/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +51 -0
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/index.js +12 -0
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/blocks/action-block/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +2 -2
- package/dist/es2019/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/index.js +4 -1
- package/dist/es2019/view/HoverCard/components/HoverCardContent.js +2 -1
- package/dist/es2019/view/HoverCard/utils.js +0 -4
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/constants.js +4 -1
- package/dist/esm/extractors/flexible/actions/extract-ai-summary-action.js +14 -0
- package/dist/esm/extractors/flexible/actions/index.js +4 -3
- package/dist/esm/extractors/flexible/index.js +3 -2
- package/dist/esm/messages.js +10 -0
- package/dist/esm/state/flexible-ui-context/types.js +1 -1
- package/dist/esm/state/hooks/use-ai-summary-config/index.js +13 -0
- package/dist/esm/state/hooks/use-ai-summary-config/types.js +1 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/utils/get-is-ai-summary-enabled.js +7 -0
- package/dist/esm/view/Card/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +3 -1
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +50 -0
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/index.js +12 -0
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/blocks/action-block/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.js +2 -2
- package/dist/esm/view/FlexibleCard/components/blocks/snippet-block/index.js +1 -1
- package/dist/esm/view/FlexibleCard/index.js +4 -1
- package/dist/esm/view/HoverCard/components/HoverCardContent.js +2 -1
- package/dist/esm/view/HoverCard/utils.js +0 -6
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/constants.d.ts +4 -0
- package/dist/types/extractors/common/__mocks__/jsonld.d.ts +2 -0
- package/dist/types/extractors/flexible/actions/extract-ai-summary-action.d.ts +5 -0
- package/dist/types/extractors/flexible/actions/index.d.ts +2 -1
- package/dist/types/extractors/flexible/index.d.ts +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +8 -1
- package/dist/types/state/hooks/use-ai-summary-config/index.d.ts +2 -0
- package/dist/types/state/hooks/use-ai-summary-config/types.d.ts +5 -0
- package/dist/types/utils/get-is-ai-summary-enabled.d.ts +2 -0
- package/dist/types/view/Card/types.d.ts +2 -1
- package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/actions/action/types.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/types.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/action-block/index.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/blocks/action-block/types.d.ts +2 -2
- package/dist/types/view/FlexibleCard/types.d.ts +2 -0
- package/dist/types/view/HoverCard/utils.d.ts +0 -1
- package/dist/types-ts4.5/constants.d.ts +4 -0
- package/dist/types-ts4.5/extractors/common/__mocks__/jsonld.d.ts +2 -0
- package/dist/types-ts4.5/extractors/flexible/actions/extract-ai-summary-action.d.ts +5 -0
- package/dist/types-ts4.5/extractors/flexible/actions/index.d.ts +2 -1
- package/dist/types-ts4.5/extractors/flexible/index.d.ts +1 -1
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +8 -1
- package/dist/types-ts4.5/state/hooks/use-ai-summary-config/index.d.ts +2 -0
- package/dist/types-ts4.5/state/hooks/use-ai-summary-config/types.d.ts +5 -0
- package/dist/types-ts4.5/utils/get-is-ai-summary-enabled.d.ts +2 -0
- package/dist/types-ts4.5/view/Card/types.d.ts +2 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/types.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/types.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/types.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/index.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/action-block/types.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/types.d.ts +2 -0
- package/dist/types-ts4.5/view/HoverCard/utils.d.ts +0 -1
- package/package.json +1 -1
|
@@ -25,6 +25,7 @@ const Action = ({
|
|
|
25
25
|
spaceInline,
|
|
26
26
|
tooltipMessage,
|
|
27
27
|
tooltipOnHide,
|
|
28
|
+
hideTooltipOnMouseDown,
|
|
28
29
|
xcss,
|
|
29
30
|
asDropDownItem,
|
|
30
31
|
overrideCss,
|
|
@@ -59,7 +60,8 @@ const Action = ({
|
|
|
59
60
|
testId: testId,
|
|
60
61
|
tooltipMessage: tooltipMessage || content,
|
|
61
62
|
xcss: xcss,
|
|
62
|
-
tooltipOnHide: tooltipOnHide
|
|
63
|
+
tooltipOnHide: tooltipOnHide,
|
|
64
|
+
hideTooltipOnMouseDown: hideTooltipOnMouseDown
|
|
63
65
|
});
|
|
64
66
|
}
|
|
65
67
|
if (isDropdownItem) {
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
+
import { messages } from '../../../../../messages';
|
|
5
|
+
import Action from '../action';
|
|
6
|
+
import AiIcon from '../../../../common/ai-icon';
|
|
7
|
+
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
8
|
+
import { useAISummary } from '../../../../../state/hooks/use-ai-summary';
|
|
9
|
+
export const AISummaryActionComponent = ({
|
|
10
|
+
onClick: onClickCallback,
|
|
11
|
+
url = '',
|
|
12
|
+
ari = '',
|
|
13
|
+
product,
|
|
14
|
+
...props
|
|
15
|
+
}) => {
|
|
16
|
+
const {
|
|
17
|
+
fireEvent
|
|
18
|
+
} = useAnalyticsEvents();
|
|
19
|
+
const {
|
|
20
|
+
state: {
|
|
21
|
+
status
|
|
22
|
+
},
|
|
23
|
+
summariseUrl
|
|
24
|
+
} = useAISummary({
|
|
25
|
+
url,
|
|
26
|
+
ari,
|
|
27
|
+
product
|
|
28
|
+
});
|
|
29
|
+
const handleActionClick = useCallback(() => {
|
|
30
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
31
|
+
fireEvent('track.aiInteraction.initiated', {
|
|
32
|
+
aiFeatureName: 'Smart Links Summary',
|
|
33
|
+
proactiveAIGenerated: 0,
|
|
34
|
+
userGeneratedAI: 1
|
|
35
|
+
});
|
|
36
|
+
summariseUrl();
|
|
37
|
+
onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback();
|
|
38
|
+
}, [fireEvent, onClickCallback, summariseUrl]);
|
|
39
|
+
if (status === 'ready' || status === 'error') {
|
|
40
|
+
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
41
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
|
|
42
|
+
icon: /*#__PURE__*/React.createElement(AiIcon, {
|
|
43
|
+
label: "Summarise with AI"
|
|
44
|
+
}),
|
|
45
|
+
onClick: handleActionClick,
|
|
46
|
+
testId: "smart-action-ai-summary-action",
|
|
47
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action_description)
|
|
48
|
+
}, props));
|
|
49
|
+
}
|
|
50
|
+
return null;
|
|
51
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
4
|
+
import { InternalActionName } from '../../../../../constants';
|
|
5
|
+
import { AISummaryActionComponent } from './ai-summary-action-component';
|
|
6
|
+
const AISummaryAction = props => {
|
|
7
|
+
var _context$actions;
|
|
8
|
+
const context = useFlexibleUiContext();
|
|
9
|
+
const actionData = context === null || context === void 0 ? void 0 : (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.AISummaryAction];
|
|
10
|
+
return actionData ? /*#__PURE__*/React.createElement(AISummaryActionComponent, _extends({}, actionData, props)) : null;
|
|
11
|
+
};
|
|
12
|
+
export default AISummaryAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,4 +4,5 @@ export { default as EditAction } from './edit-action';
|
|
|
4
4
|
export { default as DownloadAction } from './download-action';
|
|
5
5
|
export { default as FollowAction } from './follow-action';
|
|
6
6
|
export { default as PreviewAction } from './preview-action';
|
|
7
|
-
export { default as CopyLinkAction } from './copy-link-action';
|
|
7
|
+
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
|
+
export { default as AISummaryAction } from './ai-summary-action';
|
|
@@ -50,7 +50,8 @@ const PreviewAction = ({
|
|
|
50
50
|
}),
|
|
51
51
|
onClick: onClick,
|
|
52
52
|
testId: "smart-action-preview-action",
|
|
53
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
53
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
|
|
54
|
+
hideTooltipOnMouseDown: true
|
|
54
55
|
}, data, props)) : null;
|
|
55
56
|
};
|
|
56
57
|
export default PreviewAction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Stack, xcss } from '@atlaskit/primitives';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { SmartLinkSize } from '../../../../../constants';
|
|
4
4
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
5
5
|
import * as Actions from '../../actions';
|
|
6
6
|
import { getPrimitivesPaddingSpaceBySize } from '../../utils';
|
|
@@ -10,7 +10,7 @@ const ignoreContainerPaddingStyles = xcss({
|
|
|
10
10
|
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
11
11
|
marginRight: 'calc(var(--container-gap-right) * -1)'
|
|
12
12
|
});
|
|
13
|
-
const DEFAULT_SORT_ORDER = [
|
|
13
|
+
const DEFAULT_SORT_ORDER = ['PreviewAction', 'CopyLinkAction', 'AISummaryAction'];
|
|
14
14
|
const sort = (a, b) => {
|
|
15
15
|
let idxA = DEFAULT_SORT_ORDER.indexOf(a);
|
|
16
16
|
let idxB = DEFAULT_SORT_ORDER.indexOf(b);
|
|
@@ -11,8 +11,6 @@ import AIStateIndicator from '../ai-state-indicator';
|
|
|
11
11
|
import { renderElementItems } from '../../utils';
|
|
12
12
|
import { messages } from '../../../../../../messages';
|
|
13
13
|
import { useAISummary } from '../../../../../../state/hooks/use-ai-summary';
|
|
14
|
-
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
15
|
-
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
16
14
|
import AIIcon from '../../../../../common/ai-icon';
|
|
17
15
|
import AISummary from '../../../../../common/ai-summary';
|
|
18
16
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
@@ -21,6 +19,8 @@ import AIEventErrorViewed from '../ai-event-error-viewed';
|
|
|
21
19
|
import { di } from 'react-magnetic-di';
|
|
22
20
|
import { css } from '@emotion/react';
|
|
23
21
|
import FeatureDiscovery from '../feature-discovery';
|
|
22
|
+
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
23
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
24
24
|
export const AISummaryBlockErrorIndicator = ({
|
|
25
25
|
showErrorIndicator,
|
|
26
26
|
error,
|
|
@@ -5,7 +5,7 @@ import { SmartLinkStatus } from '../../../../../constants';
|
|
|
5
5
|
import { Snippet } from '../../elements';
|
|
6
6
|
import { getMaxLines } from '../../utils';
|
|
7
7
|
const DEFAULT_MAX_LINES = 3;
|
|
8
|
-
const MAXIMUM_MAX_LINES =
|
|
8
|
+
const MAXIMUM_MAX_LINES = 6;
|
|
9
9
|
const MINIMUM_MAX_LINES = 1;
|
|
10
10
|
|
|
11
11
|
/**
|
|
@@ -4,6 +4,7 @@ import { SmartLinkStatus } from '../../constants';
|
|
|
4
4
|
import Container from './components/container';
|
|
5
5
|
import { FlexibleUiAnalyticsContext, FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
|
|
6
6
|
import { getContextByStatus, getRetryOptions } from './utils';
|
|
7
|
+
import { useAISummaryConfig } from '../../state/hooks/use-ai-summary-config';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* This represents a Flexible Card: a link represented by a card with metadata.
|
|
@@ -30,19 +31,21 @@ const FlexibleCard = ({
|
|
|
30
31
|
url
|
|
31
32
|
}) => {
|
|
32
33
|
var _details$meta2;
|
|
34
|
+
const aiSummaryConfig = useAISummaryConfig();
|
|
33
35
|
const {
|
|
34
36
|
status: cardType,
|
|
35
37
|
details
|
|
36
38
|
} = cardState;
|
|
37
39
|
const status = cardType;
|
|
38
40
|
const context = useMemo(() => getContextByStatus({
|
|
41
|
+
aiSummaryConfig,
|
|
39
42
|
response: details,
|
|
40
43
|
id,
|
|
41
44
|
renderers,
|
|
42
45
|
actionOptions,
|
|
43
46
|
status,
|
|
44
47
|
url
|
|
45
|
-
}), [details, id, renderers, actionOptions, status, url]);
|
|
48
|
+
}), [aiSummaryConfig, details, id, renderers, actionOptions, status, url]);
|
|
46
49
|
const retry = getRetryOptions(url, status, details, onAuthorize);
|
|
47
50
|
const {
|
|
48
51
|
title
|
|
@@ -11,7 +11,7 @@ import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
|
11
11
|
import { getExtensionKey, getServices } from '../../../state/helpers';
|
|
12
12
|
import { isSpecialEvent } from '../../../utils';
|
|
13
13
|
import { flexibleUiOptions, titleBlockCss } from '../styled';
|
|
14
|
-
import { getSimulatedMetadata
|
|
14
|
+
import { getSimulatedMetadata } from '../utils';
|
|
15
15
|
import HoverCardLoadingView from './views/resolving';
|
|
16
16
|
import HoverCardUnauthorisedView from './views/unauthorised';
|
|
17
17
|
import HoverCardResolvedView from './views/resolved';
|
|
@@ -21,6 +21,7 @@ import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
|
21
21
|
import { useSmartCardState } from '../../../state/store';
|
|
22
22
|
import HoverCardForbiddenView from './views/forbidden';
|
|
23
23
|
import ContentContainer from './ContentContainer';
|
|
24
|
+
import { getIsAISummaryEnabled } from '../../../utils/get-is-ai-summary-enabled';
|
|
24
25
|
export const hoverCardClassName = 'smart-links-hover-preview';
|
|
25
26
|
export const getCopyAction = url => ({
|
|
26
27
|
name: ActionName.CustomAction,
|
|
@@ -201,8 +201,4 @@ export const getSimulatedBetterMetadata = (extensionKey = '', data) => {
|
|
|
201
201
|
default:
|
|
202
202
|
return defaultMetadata;
|
|
203
203
|
}
|
|
204
|
-
};
|
|
205
|
-
export const getIsAISummaryEnabled = (isAdminHubAIEnabled = false, response) => {
|
|
206
|
-
var _response$meta, _response$meta$suppor;
|
|
207
|
-
return Boolean(getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 ? void 0 : (_response$meta = response.meta) === null || _response$meta === void 0 ? void 0 : (_response$meta$suppor = _response$meta.supportedFeature) === null || _response$meta$suppor === void 0 ? void 0 : _response$meta$suppor.includes('AISummary')));
|
|
208
204
|
};
|
|
@@ -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.57.1",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
package/dist/esm/constants.js
CHANGED
|
@@ -155,7 +155,10 @@ export var ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
155
155
|
ActionName["CustomAction"] = "CustomAction";
|
|
156
156
|
return ActionName;
|
|
157
157
|
}({});
|
|
158
|
-
|
|
158
|
+
export var InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
159
|
+
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
160
|
+
return InternalActionName;
|
|
161
|
+
}({});
|
|
159
162
|
/**
|
|
160
163
|
* Flexible UI icons - each mapped to AK icons.
|
|
161
164
|
*/
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { CardAction } from '../../../view/Card/types';
|
|
2
|
+
import { canShowAction } from '../../../utils/actions/can-show-action';
|
|
3
|
+
import { getIsAISummaryEnabled } from '../../../utils/get-is-ai-summary-enabled';
|
|
4
|
+
import { extractAri } from '@atlaskit/link-extractors';
|
|
5
|
+
export var extractAISummaryAction = function extractAISummaryAction(response, url, actionOptions, aiSummaryConfig) {
|
|
6
|
+
if (!canShowAction(CardAction.AISummaryAction, actionOptions) || !getIsAISummaryEnabled(aiSummaryConfig === null || aiSummaryConfig === void 0 ? void 0 : aiSummaryConfig.isAdminHubAIEnabled, response) || !(aiSummaryConfig !== null && aiSummaryConfig !== void 0 && aiSummaryConfig.product) || !url) {
|
|
7
|
+
return;
|
|
8
|
+
}
|
|
9
|
+
return {
|
|
10
|
+
url: url,
|
|
11
|
+
ari: extractAri(response.data),
|
|
12
|
+
product: aiSummaryConfig === null || aiSummaryConfig === void 0 ? void 0 : aiSummaryConfig.product
|
|
13
|
+
};
|
|
14
|
+
};
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
|
-
import { ActionName } from '../../../constants';
|
|
2
|
+
import { ActionName, InternalActionName } from '../../../constants';
|
|
3
3
|
import { extractDownloadAction } from './extract-download-action';
|
|
4
4
|
import { extractPreviewAction } from './extract-preview-action';
|
|
5
|
+
import { extractAISummaryAction } from './extract-ai-summary-action';
|
|
5
6
|
import extractFollowAction from './extract-follow-action';
|
|
6
7
|
import { extractCopyLinkAction } from './extract-copy-link-action';
|
|
7
|
-
var extractActions = function extractActions(response, actionOptions, id) {
|
|
8
|
+
var extractActions = function extractActions(response, url, actionOptions, id, aiSummaryConfig) {
|
|
8
9
|
var _action;
|
|
9
10
|
var data = response.data;
|
|
10
|
-
var action = (_action = {}, _defineProperty(_action, ActionName.CopyLinkAction, extractCopyLinkAction(data, actionOptions)), _defineProperty(_action, ActionName.DownloadAction, extractDownloadAction(data, actionOptions)), _defineProperty(_action, ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), _defineProperty(_action, ActionName.PreviewAction, extractPreviewAction(response, actionOptions)), _action);
|
|
11
|
+
var action = (_action = {}, _defineProperty(_action, ActionName.CopyLinkAction, extractCopyLinkAction(data, actionOptions)), _defineProperty(_action, ActionName.DownloadAction, extractDownloadAction(data, actionOptions)), _defineProperty(_action, ActionName.FollowAction, extractFollowAction(response, actionOptions, id)), _defineProperty(_action, ActionName.PreviewAction, extractPreviewAction(response, actionOptions)), _defineProperty(_action, InternalActionName.AISummaryAction, extractAISummaryAction(response, url, actionOptions, aiSummaryConfig)), _action);
|
|
11
12
|
return Object.values(action).some(function (value) {
|
|
12
13
|
return Boolean(value);
|
|
13
14
|
}) ? action : undefined;
|
|
@@ -15,14 +15,15 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
15
15
|
id = _ref.id,
|
|
16
16
|
renderers = _ref.renderers,
|
|
17
17
|
actionOptions = _ref.actionOptions,
|
|
18
|
-
response = _ref.response
|
|
18
|
+
response = _ref.response,
|
|
19
|
+
aiSummaryConfig = _ref.aiSummaryConfig;
|
|
19
20
|
if (!response) {
|
|
20
21
|
return undefined;
|
|
21
22
|
}
|
|
22
23
|
var data = response.data;
|
|
23
24
|
var url = extractLink(data);
|
|
24
25
|
return {
|
|
25
|
-
actions: extractActions(response, actionOptions, id),
|
|
26
|
+
actions: extractActions(response, url, actionOptions, id, aiSummaryConfig),
|
|
26
27
|
assignedToGroup: extractPersonAssignedToAsArray(data),
|
|
27
28
|
attachmentCount: extractAttachmentCount(data),
|
|
28
29
|
authorGroup: extractPersonCreatedBy(data),
|
package/dist/esm/messages.js
CHANGED
|
@@ -195,6 +195,16 @@ export var messages = defineMessages({
|
|
|
195
195
|
defaultMessage: 'Download file',
|
|
196
196
|
description: 'Allow a user to download a file'
|
|
197
197
|
},
|
|
198
|
+
ai_summary_action: {
|
|
199
|
+
id: 'fabric.linking.ai_summary_action.nonfinal',
|
|
200
|
+
defaultMessage: 'Summarize with AI',
|
|
201
|
+
description: 'Allow a user to summarize a link'
|
|
202
|
+
},
|
|
203
|
+
ai_summary_action_description: {
|
|
204
|
+
id: 'fabric.linking.ai_summary_action_description.nonfinal',
|
|
205
|
+
defaultMessage: 'Summarize the content of this link using Atlassian Intelligence.',
|
|
206
|
+
description: 'Description of what the summarize link with AI action does'
|
|
207
|
+
},
|
|
198
208
|
edit: {
|
|
199
209
|
id: 'fabric.linking.edit',
|
|
200
210
|
defaultMessage: 'Edit',
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
2
|
+
import { useMemo } from 'react';
|
|
3
|
+
export var useAISummaryConfig = function useAISummaryConfig() {
|
|
4
|
+
var _useSmartLinkContext = useSmartLinkContext(),
|
|
5
|
+
product = _useSmartLinkContext.product,
|
|
6
|
+
isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled;
|
|
7
|
+
return useMemo(function () {
|
|
8
|
+
return {
|
|
9
|
+
product: product,
|
|
10
|
+
isAdminHubAIEnabled: isAdminHubAIEnabled
|
|
11
|
+
};
|
|
12
|
+
}, [product, isAdminHubAIEnabled]);
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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.57.1"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
2
|
+
export var getIsAISummaryEnabled = function getIsAISummaryEnabled() {
|
|
3
|
+
var _response$meta;
|
|
4
|
+
var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
5
|
+
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
6
|
+
return Boolean(getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('AISummary')));
|
|
7
|
+
};
|
|
@@ -5,5 +5,6 @@ export var CardAction = /*#__PURE__*/function (CardAction) {
|
|
|
5
5
|
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
6
6
|
CardAction["FollowAction"] = "FollowAction";
|
|
7
7
|
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
8
|
+
CardAction["AISummaryAction"] = "AISummaryAction";
|
|
8
9
|
return CardAction;
|
|
9
10
|
}({});
|
|
@@ -47,7 +47,8 @@ var ActionStackItem = function ActionStackItem(_ref) {
|
|
|
47
47
|
testId = _ref.testId,
|
|
48
48
|
tooltipMessage = _ref.tooltipMessage,
|
|
49
49
|
xcss = _ref.xcss,
|
|
50
|
-
tooltipOnHide = _ref.tooltipOnHide
|
|
50
|
+
tooltipOnHide = _ref.tooltipOnHide,
|
|
51
|
+
hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown;
|
|
51
52
|
var space = spaceOption !== null && spaceOption !== void 0 ? spaceOption : getPrimitivesInlineSpaceBySize(size);
|
|
52
53
|
var onClick = useCallback(function () {
|
|
53
54
|
if (!isDisabled && !isLoading && onClickCallback) {
|
|
@@ -66,7 +67,7 @@ var ActionStackItem = function ActionStackItem(_ref) {
|
|
|
66
67
|
return /*#__PURE__*/React.createElement(Tooltip, {
|
|
67
68
|
content: tooltipMessage || content,
|
|
68
69
|
onHide: tooltipOnHide,
|
|
69
|
-
hideTooltipOnMouseDown:
|
|
70
|
+
hideTooltipOnMouseDown: hideTooltipOnMouseDown
|
|
70
71
|
}, function (tooltipProps) {
|
|
71
72
|
return /*#__PURE__*/React.createElement(Box, _extends({
|
|
72
73
|
as: "button",
|
|
@@ -30,6 +30,7 @@ var Action = function Action(_ref) {
|
|
|
30
30
|
spaceInline = _ref.spaceInline,
|
|
31
31
|
tooltipMessage = _ref.tooltipMessage,
|
|
32
32
|
tooltipOnHide = _ref.tooltipOnHide,
|
|
33
|
+
hideTooltipOnMouseDown = _ref.hideTooltipOnMouseDown,
|
|
33
34
|
xcss = _ref.xcss,
|
|
34
35
|
asDropDownItem = _ref.asDropDownItem,
|
|
35
36
|
overrideCss = _ref.overrideCss,
|
|
@@ -63,7 +64,8 @@ var Action = function Action(_ref) {
|
|
|
63
64
|
testId: testId,
|
|
64
65
|
tooltipMessage: tooltipMessage || content,
|
|
65
66
|
xcss: xcss,
|
|
66
|
-
tooltipOnHide: tooltipOnHide
|
|
67
|
+
tooltipOnHide: tooltipOnHide,
|
|
68
|
+
hideTooltipOnMouseDown: hideTooltipOnMouseDown
|
|
67
69
|
});
|
|
68
70
|
}
|
|
69
71
|
if (isDropdownItem) {
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["onClick", "url", "ari", "product"];
|
|
4
|
+
import React, { useCallback } from 'react';
|
|
5
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import { messages } from '../../../../../messages';
|
|
7
|
+
import Action from '../action';
|
|
8
|
+
import AiIcon from '../../../../common/ai-icon';
|
|
9
|
+
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
10
|
+
import { useAISummary } from '../../../../../state/hooks/use-ai-summary';
|
|
11
|
+
export var AISummaryActionComponent = function AISummaryActionComponent(_ref) {
|
|
12
|
+
var onClickCallback = _ref.onClick,
|
|
13
|
+
_ref$url = _ref.url,
|
|
14
|
+
url = _ref$url === void 0 ? '' : _ref$url,
|
|
15
|
+
_ref$ari = _ref.ari,
|
|
16
|
+
ari = _ref$ari === void 0 ? '' : _ref$ari,
|
|
17
|
+
product = _ref.product,
|
|
18
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
19
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
20
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
21
|
+
var _useAISummary = useAISummary({
|
|
22
|
+
url: url,
|
|
23
|
+
ari: ari,
|
|
24
|
+
product: product
|
|
25
|
+
}),
|
|
26
|
+
status = _useAISummary.state.status,
|
|
27
|
+
summariseUrl = _useAISummary.summariseUrl;
|
|
28
|
+
var handleActionClick = useCallback(function () {
|
|
29
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
30
|
+
fireEvent('track.aiInteraction.initiated', {
|
|
31
|
+
aiFeatureName: 'Smart Links Summary',
|
|
32
|
+
proactiveAIGenerated: 0,
|
|
33
|
+
userGeneratedAI: 1
|
|
34
|
+
});
|
|
35
|
+
summariseUrl();
|
|
36
|
+
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
37
|
+
}, [fireEvent, onClickCallback, summariseUrl]);
|
|
38
|
+
if (status === 'ready' || status === 'error') {
|
|
39
|
+
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
40
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
|
|
41
|
+
icon: /*#__PURE__*/React.createElement(AiIcon, {
|
|
42
|
+
label: "Summarise with AI"
|
|
43
|
+
}),
|
|
44
|
+
onClick: handleActionClick,
|
|
45
|
+
testId: "smart-action-ai-summary-action",
|
|
46
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action_description)
|
|
47
|
+
}, props));
|
|
48
|
+
}
|
|
49
|
+
return null;
|
|
50
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
4
|
+
import { InternalActionName } from '../../../../../constants';
|
|
5
|
+
import { AISummaryActionComponent } from './ai-summary-action-component';
|
|
6
|
+
var AISummaryAction = function AISummaryAction(props) {
|
|
7
|
+
var _context$actions;
|
|
8
|
+
var context = useFlexibleUiContext();
|
|
9
|
+
var actionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.AISummaryAction];
|
|
10
|
+
return actionData ? /*#__PURE__*/React.createElement(AISummaryActionComponent, _extends({}, actionData, props)) : null;
|
|
11
|
+
};
|
|
12
|
+
export default AISummaryAction;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -4,4 +4,5 @@ export { default as EditAction } from './edit-action';
|
|
|
4
4
|
export { default as DownloadAction } from './download-action';
|
|
5
5
|
export { default as FollowAction } from './follow-action';
|
|
6
6
|
export { default as PreviewAction } from './preview-action';
|
|
7
|
-
export { default as CopyLinkAction } from './copy-link-action';
|
|
7
|
+
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
|
+
export { default as AISummaryAction } from './ai-summary-action';
|
|
@@ -71,7 +71,8 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
71
71
|
}),
|
|
72
72
|
onClick: onClick,
|
|
73
73
|
testId: "smart-action-preview-action",
|
|
74
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
74
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage),
|
|
75
|
+
hideTooltipOnMouseDown: true
|
|
75
76
|
}, data, props)) : null;
|
|
76
77
|
};
|
|
77
78
|
export default PreviewAction;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Stack, xcss } from '@atlaskit/primitives';
|
|
2
2
|
import React, { useMemo } from 'react';
|
|
3
|
-
import {
|
|
3
|
+
import { SmartLinkSize } from '../../../../../constants';
|
|
4
4
|
import { useFlexibleUiContext, useFlexibleUiOptionContext } from '../../../../../state/flexible-ui-context';
|
|
5
5
|
import * as Actions from '../../actions';
|
|
6
6
|
import { getPrimitivesPaddingSpaceBySize } from '../../utils';
|
|
@@ -10,7 +10,7 @@ var ignoreContainerPaddingStyles = xcss({
|
|
|
10
10
|
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
11
11
|
marginRight: 'calc(var(--container-gap-right) * -1)'
|
|
12
12
|
});
|
|
13
|
-
var DEFAULT_SORT_ORDER = [
|
|
13
|
+
var DEFAULT_SORT_ORDER = ['PreviewAction', 'CopyLinkAction', 'AISummaryAction'];
|
|
14
14
|
var sort = function sort(a, b) {
|
|
15
15
|
var idxA = DEFAULT_SORT_ORDER.indexOf(a);
|
|
16
16
|
var idxB = DEFAULT_SORT_ORDER.indexOf(b);
|
|
@@ -12,8 +12,6 @@ import AIStateIndicator from '../ai-state-indicator';
|
|
|
12
12
|
import { renderElementItems } from '../../utils';
|
|
13
13
|
import { messages } from '../../../../../../messages';
|
|
14
14
|
import { useAISummary } from '../../../../../../state/hooks/use-ai-summary';
|
|
15
|
-
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
16
|
-
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
17
15
|
import AIIcon from '../../../../../common/ai-icon';
|
|
18
16
|
import AISummary from '../../../../../common/ai-summary';
|
|
19
17
|
import { useAnalyticsEvents } from '../../../../../../common/analytics/generated/use-analytics-events';
|
|
@@ -22,6 +20,8 @@ import AIEventErrorViewed from '../ai-event-error-viewed';
|
|
|
22
20
|
import { di } from 'react-magnetic-di';
|
|
23
21
|
import { css } from '@emotion/react';
|
|
24
22
|
import FeatureDiscovery from '../feature-discovery';
|
|
23
|
+
import { useFlexibleUiContext } from '../../../../../../state/flexible-ui-context';
|
|
24
|
+
import { useSmartLinkContext } from '@atlaskit/link-provider';
|
|
25
25
|
export var AISummaryBlockErrorIndicator = function AISummaryBlockErrorIndicator(_ref) {
|
|
26
26
|
var showErrorIndicator = _ref.showErrorIndicator,
|
|
27
27
|
error = _ref.error,
|
|
@@ -7,7 +7,7 @@ import { SmartLinkStatus } from '../../../../../constants';
|
|
|
7
7
|
import { Snippet } from '../../elements';
|
|
8
8
|
import { getMaxLines } from '../../utils';
|
|
9
9
|
var DEFAULT_MAX_LINES = 3;
|
|
10
|
-
var MAXIMUM_MAX_LINES =
|
|
10
|
+
var MAXIMUM_MAX_LINES = 6;
|
|
11
11
|
var MINIMUM_MAX_LINES = 1;
|
|
12
12
|
|
|
13
13
|
/**
|
|
@@ -7,6 +7,7 @@ import { SmartLinkStatus } from '../../constants';
|
|
|
7
7
|
import Container from './components/container';
|
|
8
8
|
import { FlexibleUiAnalyticsContext, FlexibleUiContext, FlexibleUiOptionContext } from '../../state/flexible-ui-context';
|
|
9
9
|
import { getContextByStatus, getRetryOptions } from './utils';
|
|
10
|
+
import { useAISummaryConfig } from '../../state/hooks/use-ai-summary-config';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* This represents a Flexible Card: a link represented by a card with metadata.
|
|
@@ -33,11 +34,13 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
33
34
|
testId = _ref.testId,
|
|
34
35
|
ui = _ref.ui,
|
|
35
36
|
url = _ref.url;
|
|
37
|
+
var aiSummaryConfig = useAISummaryConfig();
|
|
36
38
|
var cardType = cardState.status,
|
|
37
39
|
details = cardState.details;
|
|
38
40
|
var status = cardType;
|
|
39
41
|
var context = useMemo(function () {
|
|
40
42
|
return getContextByStatus({
|
|
43
|
+
aiSummaryConfig: aiSummaryConfig,
|
|
41
44
|
response: details,
|
|
42
45
|
id: id,
|
|
43
46
|
renderers: renderers,
|
|
@@ -45,7 +48,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
45
48
|
status: status,
|
|
46
49
|
url: url
|
|
47
50
|
});
|
|
48
|
-
}, [details, id, renderers, actionOptions, status, url]);
|
|
51
|
+
}, [aiSummaryConfig, details, id, renderers, actionOptions, status, url]);
|
|
49
52
|
var retry = getRetryOptions(url, status, details, onAuthorize);
|
|
50
53
|
var _ref2 = context || {},
|
|
51
54
|
title = _ref2.title;
|
|
@@ -13,7 +13,7 @@ import { useSmartLinkAnalytics } from '../../../state/analytics';
|
|
|
13
13
|
import { getExtensionKey, getServices } from '../../../state/helpers';
|
|
14
14
|
import { isSpecialEvent } from '../../../utils';
|
|
15
15
|
import { flexibleUiOptions, titleBlockCss } from '../styled';
|
|
16
|
-
import { getSimulatedMetadata
|
|
16
|
+
import { getSimulatedMetadata } from '../utils';
|
|
17
17
|
import HoverCardLoadingView from './views/resolving';
|
|
18
18
|
import HoverCardUnauthorisedView from './views/unauthorised';
|
|
19
19
|
import HoverCardResolvedView from './views/resolved';
|
|
@@ -23,6 +23,7 @@ import { fireLinkClickedEvent } from '../../../utils/analytics/click';
|
|
|
23
23
|
import { useSmartCardState } from '../../../state/store';
|
|
24
24
|
import HoverCardForbiddenView from './views/forbidden';
|
|
25
25
|
import ContentContainer from './ContentContainer';
|
|
26
|
+
import { getIsAISummaryEnabled } from '../../../utils/get-is-ai-summary-enabled';
|
|
26
27
|
export var hoverCardClassName = 'smart-links-hover-preview';
|
|
27
28
|
export var getCopyAction = function getCopyAction(url) {
|
|
28
29
|
return {
|
|
@@ -198,10 +198,4 @@ export var getSimulatedBetterMetadata = function getSimulatedBetterMetadata() {
|
|
|
198
198
|
default:
|
|
199
199
|
return defaultMetadata;
|
|
200
200
|
}
|
|
201
|
-
};
|
|
202
|
-
export var getIsAISummaryEnabled = function getIsAISummaryEnabled() {
|
|
203
|
-
var _response$meta;
|
|
204
|
-
var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
205
|
-
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
206
|
-
return Boolean(getBooleanFF('platform.linking-platform.smart-card.hover-card-ai-summaries') && isAdminHubAIEnabled && (response === null || response === void 0 || (_response$meta = response.meta) === null || _response$meta === void 0 || (_response$meta = _response$meta.supportedFeature) === null || _response$meta === void 0 ? void 0 : _response$meta.includes('AISummary')));
|
|
207
201
|
};
|
|
@@ -10,7 +10,7 @@ import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-m
|
|
|
10
10
|
import LinkWarningModal from './LinkWarningModal';
|
|
11
11
|
var PACKAGE_DATA = {
|
|
12
12
|
packageName: "@atlaskit/smart-card",
|
|
13
|
-
packageVersion: "26.
|
|
13
|
+
packageVersion: "26.57.1",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -139,6 +139,10 @@ export declare enum ActionName {
|
|
|
139
139
|
DownloadAction = "DownloadAction",
|
|
140
140
|
CustomAction = "CustomAction"
|
|
141
141
|
}
|
|
142
|
+
export declare enum InternalActionName {
|
|
143
|
+
AISummaryAction = "AISummaryAction"
|
|
144
|
+
}
|
|
145
|
+
export type FlexibleUiActionName = keyof typeof ActionName | keyof typeof InternalActionName;
|
|
142
146
|
/**
|
|
143
147
|
* Flexible UI icons - each mapped to AK icons.
|
|
144
148
|
*/
|
|
@@ -22,7 +22,9 @@ export declare const TEST_PULL_REQUEST: JsonLd.Data.SourceCodePullRequest;
|
|
|
22
22
|
export declare const TEST_TASK: JsonLd.Data.Task;
|
|
23
23
|
export declare const TEST_META_DATA: JsonLd.Meta.BaseMeta;
|
|
24
24
|
export declare const TEST_RESOLVED_META_DATA: JsonLd.Meta.BaseMeta;
|
|
25
|
+
export declare const TEST_RESOLVED_META_DATA_WITH_AI_SUMMARY: JsonLd.Meta.BaseMeta;
|
|
25
26
|
export declare const TEST_DOCUMENT: JsonLd.Data.Document;
|
|
27
|
+
export declare const TEST_DOCUMENT_WITH_ARI: JsonLd.Data.Document;
|
|
26
28
|
export declare const TEST_CURRENT_DOCUMENT: JsonLd.Data.Document;
|
|
27
29
|
export declare const TEST_DOWNLOAD_ACTION: JsonLd.Data.BaseData['schema:potentialAction'];
|
|
28
30
|
export declare const TEST_UNDEFINED_LINK: JsonLd.Data.UndefinedLinkDocument;
|