@atlaskit/smart-card 26.56.5 → 26.57.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 +7 -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/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/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/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/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/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/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/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/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
|
@@ -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.0",
|
|
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.0"
|
|
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
|
}({});
|
|
@@ -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';
|
|
@@ -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.0",
|
|
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;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { JsonLd } from 'json-ld-types';
|
|
2
|
+
import { type CardActionOptions } from '../../../view/Card/types';
|
|
3
|
+
import { AISummaryActionData } from '../../../state/flexible-ui-context/types';
|
|
4
|
+
import { AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
5
|
+
export declare const extractAISummaryAction: (response: JsonLd.Response, url?: string, actionOptions?: CardActionOptions, aiSummaryConfig?: AISummaryConfig) => AISummaryActionData | undefined;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { FlexibleUiActions } from '../../../state/flexible-ui-context/types';
|
|
3
|
+
import { AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
3
4
|
import type { CardActionOptions } from '../../../view/Card/types';
|
|
4
|
-
declare const extractActions: (response: JsonLd.Response, actionOptions?: CardActionOptions, id?: string) => FlexibleUiActions | undefined;
|
|
5
|
+
declare const extractActions: (response: JsonLd.Response, url?: string, actionOptions?: CardActionOptions, id?: string, aiSummaryConfig?: AISummaryConfig) => FlexibleUiActions | undefined;
|
|
5
6
|
export default extractActions;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { FlexibleUiDataContext } from '../../state/flexible-ui-context/types';
|
|
2
2
|
import { ExtractFlexibleUiDataContextParams } from '../../view/FlexibleCard/types';
|
|
3
|
-
declare const extractFlexibleUiContext: ({ id, renderers, actionOptions, response, }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
3
|
+
declare const extractFlexibleUiContext: ({ id, renderers, actionOptions, response, aiSummaryConfig, }?: Partial<ExtractFlexibleUiDataContextParams>) => FlexibleUiDataContext | undefined;
|
|
4
4
|
export default extractFlexibleUiContext;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { MessageDescriptor } from 'react-intl-next';
|
|
2
2
|
export type RequestAccessMessageKey = 'click_to_join' | 'click_to_join_description' | 'forbidden_description' | 'request_access' | 'request_access_description' | 'request_access_pending' | 'request_access_pending_title' | 'request_access_pending_description' | 'request_denied_description' | 'default_no_access_title' | 'direct_access_title' | 'direct_access_description' | 'direct_access' | 'access_exists_description' | 'not_found_description' | 'not_found_title';
|
|
3
|
-
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'beta' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'follow_project_description' | 'follow_project' | 'follow_goal' | 'follow_goal_description' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_description' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'unfollow_project_description' | 'unfollow_project' | 'unfollow_goal' | 'unfollow_goal_description' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'ai_summary_action' | 'ai_summary_action_description' | 'beta' | 'cannot_find_link' | 'connect_link_account_card' | 'connect_link_account_card_name' | 'connect_link_account_card_description' | 'connect_unauthorised_account_action' | 'connect_unauthorised_account_description' | 'connect_unauthorised_account_description_no_provider' | 'continue' | 'copy_url_to_clipboard' | 'copied_url_to_clipboard' | 'could_not_load_link' | 'download' | 'download_description' | 'download_file' | 'follow' | 'follow_project_description' | 'follow_project' | 'follow_goal' | 'follow_goal_description' | 'go_back' | 'invalid_permissions' | 'invalid_permissions_description' | 'join_to_view' | 'connect_link_account' | 'created_by' | 'created_on_relative' | 'created_on_absolute' | 'check_this_link' | 'delete' | 'edit' | 'learn_more_about_smart_links' | 'learn_more_about_connecting_account' | 'loading' | 'link_safety_warning_message' | 'modified_by' | 'modified_on_relative' | 'modified_on_absolute' | 'more_actions' | 'not_found_title' | 'not_found_description' | 'open_issue_in_jira' | 'open_link_in_a_new_tab' | 'owned_by' | 'preview_description' | 'preview_improved' | 'preview_close' | 'preview_max_size' | 'preview_min_size' | 'priority_blocker' | 'priority_critical' | 'priority_high' | 'priority_highest' | 'priority_low' | 'priority_lowest' | 'priority_major' | 'priority_medium' | 'priority_minor' | 'priority_trivial' | 'priority_undefined' | 'forbidden_access' | 'pending_request' | 'read_time' | 'restricted_link' | 'request_access_to_view' | 'request_denied' | 'sent_on_relative' | 'sent_on_absolute' | 'status_change_load_error' | 'status_change_permission_error' | 'status_change_update_error' | 'try_again' | 'try_another_account' | 'unauthorised_account_description' | 'unauthorised_account_description_no_provider' | 'unauthorised_account_name' | 'unauthorised_account_name_no_provider' | 'unassigned' | 'unfollow' | 'unfollow_project_description' | 'unfollow_project' | 'unfollow_goal' | 'unfollow_goal_description' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related_work_items_not_found' | 'last_mentioned_in' | 'related' | 'generic_error_message';
|
|
4
4
|
type Messages = {
|
|
5
5
|
[K in MessageKey]: MessageDescriptor;
|
|
6
6
|
};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { LinkLozenge } from '../../extractors/common/lozenge/types';
|
|
2
2
|
import { LinkPerson } from '@atlaskit/link-extractors';
|
|
3
|
-
import { ActionName, IconType, MediaType } from '../../constants';
|
|
3
|
+
import { ActionName, IconType, InternalActionName, MediaType } from '../../constants';
|
|
4
4
|
import { InvokeRequestWithCardDetails } from '../hooks/use-invoke/types';
|
|
5
5
|
import type { CardInnerAppearance } from '../../view/Card/types';
|
|
6
6
|
import type { AnalyticsFacade } from '../analytics';
|
|
7
|
+
import type { ProductType } from '@atlaskit/linking-common';
|
|
7
8
|
/**
|
|
8
9
|
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
9
10
|
* underlying elements.
|
|
@@ -245,6 +246,7 @@ export type FlexibleUiActions = {
|
|
|
245
246
|
[ActionName.DownloadAction]?: DownloadActionData;
|
|
246
247
|
[ActionName.FollowAction]?: ServerActionProp<boolean>;
|
|
247
248
|
[ActionName.CopyLinkAction]?: CopyLinkActionData;
|
|
249
|
+
[InternalActionName.AISummaryAction]?: AISummaryActionData;
|
|
248
250
|
};
|
|
249
251
|
export type PreviewActionData = {
|
|
250
252
|
downloadUrl?: string;
|
|
@@ -264,6 +266,11 @@ export type DownloadActionData = {
|
|
|
264
266
|
export type CopyLinkActionData = {
|
|
265
267
|
url: string;
|
|
266
268
|
};
|
|
269
|
+
export type AISummaryActionData = {
|
|
270
|
+
ari?: string;
|
|
271
|
+
product: ProductType;
|
|
272
|
+
url: string;
|
|
273
|
+
};
|
|
267
274
|
export type FlexibleAnalyticsContextType = AnalyticsFacade & {
|
|
268
275
|
display?: CardInnerAppearance;
|
|
269
276
|
extensionKey?: string;
|
|
@@ -20,7 +20,8 @@ export declare enum CardAction {
|
|
|
20
20
|
ViewAction = "ViewAction",
|
|
21
21
|
ChangeStatusAction = "ChangeStatusAction",
|
|
22
22
|
FollowAction = "FollowAction",
|
|
23
|
-
CopyLinkAction = "CopyLinkAction"
|
|
23
|
+
CopyLinkAction = "CopyLinkAction",
|
|
24
|
+
AISummaryAction = "AISummaryAction"
|
|
24
25
|
}
|
|
25
26
|
export type CardActionOptions = {
|
|
26
27
|
hide: true;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
|
|
3
|
+
import { AISummaryActionProps } from './types';
|
|
4
|
+
export declare const AISummaryActionComponent: ({ onClick: onClickCallback, url, ari, product, ...props }: AISummaryActionProps & AISummaryActionData) => JSX.Element | null;
|
|
@@ -5,3 +5,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
7
|
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
|
+
export { default as AISummaryAction } from './ai-summary-action';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
2
|
import { ActionBlockProps } from './types';
|
|
3
|
-
declare const ActionBlock:
|
|
3
|
+
declare const ActionBlock: ({ blockRef, onClick: onClickCallback, size, spaceInline, testId, }: ActionBlockProps) => JSX.Element | null;
|
|
4
4
|
export default ActionBlock;
|