@atlaskit/smart-card 26.56.4 → 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 +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/extract-follow-action.js +4 -1
- package/dist/cjs/extractors/flexible/actions/index.js +4 -2
- package/dist/cjs/extractors/flexible/index.js +3 -2
- package/dist/cjs/messages.js +50 -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/follow-action/goal-icon/index.js +29 -0
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +53 -3
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/projects-icon/index.js +29 -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/components/utils.js +14 -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/extract-follow-action.js +5 -2
- package/dist/es2019/extractors/flexible/actions/index.js +6 -3
- package/dist/es2019/extractors/flexible/index.js +3 -2
- package/dist/es2019/messages.js +50 -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/follow-action/goal-icon/index.js +18 -0
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +40 -3
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/projects-icon/index.js +18 -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/components/utils.js +7 -0
- 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/extract-follow-action.js +5 -2
- package/dist/esm/extractors/flexible/actions/index.js +5 -3
- package/dist/esm/extractors/flexible/index.js +3 -2
- package/dist/esm/messages.js +50 -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/follow-action/goal-icon/index.js +22 -0
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +46 -3
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/projects-icon/index.js +22 -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/components/utils.js +13 -0
- 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 +9 -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/follow-action/__fixtures__/follow-goal-context.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/follow-action/goal-icon/index.d.ts +3 -0
- package/dist/types/view/FlexibleCard/components/actions/follow-action/projects-icon/index.d.ts +3 -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/components/utils.d.ts +1 -0
- 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 +9 -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/follow-action/__fixtures__/follow-goal-context.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/goal-icon/index.d.ts +3 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/projects-icon/index.d.ts +3 -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/components/utils.d.ts +1 -0
- 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
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.57.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#91341](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91341) [`0d60ffae0a83`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/0d60ffae0a83) - Increases the flexible snippet block line maximum from 3 to 6
|
|
8
|
+
- [#91338](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/91338) [`e993af1f6cbb`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e993af1f6cbb) - Add AI Summary action to Flex UI action block
|
|
9
|
+
|
|
10
|
+
## 26.56.5
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- [#90940](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/90940) [`c74e41ce62aa`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/c74e41ce62aa) - [ux] Updating FollowAction to support ActionBlock
|
|
15
|
+
|
|
3
16
|
## 26.56.4
|
|
4
17
|
|
|
5
18
|
### Patch Changes
|
package/dist/cjs/constants.js
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.SmartLinkWidth = exports.SmartLinkTheme = exports.SmartLinkStatus = exports.SmartLinkSize = exports.SmartLinkPosition = exports.SmartLinkInternalTheme = exports.SmartLinkDirection = exports.SmartLinkAlignment = exports.MediaType = exports.MediaPlacement = exports.IconType = exports.ElementName = exports.CardDisplay = exports.CONTENT_URL_SECURITY_AND_PERMISSIONS = exports.CONTENT_URL_AI_TROUBLESHOOTING = exports.CONTENT_URL_AI = exports.CONTENT_URL_ACCEPTABLE_USE_POLICY = exports.CONTENT_URL_3P_ACCOUNT_AUTH = exports.ActionName = void 0;
|
|
6
|
+
exports.SmartLinkWidth = exports.SmartLinkTheme = exports.SmartLinkStatus = exports.SmartLinkSize = exports.SmartLinkPosition = exports.SmartLinkInternalTheme = exports.SmartLinkDirection = exports.SmartLinkAlignment = exports.MediaType = exports.MediaPlacement = exports.InternalActionName = exports.IconType = exports.ElementName = exports.CardDisplay = exports.CONTENT_URL_SECURITY_AND_PERMISSIONS = exports.CONTENT_URL_AI_TROUBLESHOOTING = exports.CONTENT_URL_AI = exports.CONTENT_URL_ACCEPTABLE_USE_POLICY = exports.CONTENT_URL_3P_ACCOUNT_AUTH = exports.ActionName = void 0;
|
|
7
7
|
var CONTENT_URL_SECURITY_AND_PERMISSIONS = exports.CONTENT_URL_SECURITY_AND_PERMISSIONS = 'https://support.atlassian.com/confluence-cloud/docs/insert-links-and-anchors/#Smart-links';
|
|
8
8
|
var CONTENT_URL_3P_ACCOUNT_AUTH = exports.CONTENT_URL_3P_ACCOUNT_AUTH = 'https://support.atlassian.com/confluence-cloud/docs/what-data-is-sent-and-received-when-pasting-a-smart-link/';
|
|
9
9
|
var CONTENT_URL_AI = exports.CONTENT_URL_AI = 'https://www.atlassian.com/trust/atlassian-intelligence';
|
|
@@ -153,6 +153,10 @@ var ActionName = exports.ActionName = /*#__PURE__*/function (ActionName) {
|
|
|
153
153
|
ActionName["CustomAction"] = "CustomAction";
|
|
154
154
|
return ActionName;
|
|
155
155
|
}({});
|
|
156
|
+
var InternalActionName = exports.InternalActionName = /*#__PURE__*/function (InternalActionName) {
|
|
157
|
+
InternalActionName["AISummaryAction"] = "AISummaryAction";
|
|
158
|
+
return InternalActionName;
|
|
159
|
+
}({});
|
|
156
160
|
/**
|
|
157
161
|
* Flexible UI icons - each mapped to AK icons.
|
|
158
162
|
*/
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.extractAISummaryAction = void 0;
|
|
7
|
+
var _types = require("../../../view/Card/types");
|
|
8
|
+
var _canShowAction = require("../../../utils/actions/can-show-action");
|
|
9
|
+
var _getIsAiSummaryEnabled = require("../../../utils/get-is-ai-summary-enabled");
|
|
10
|
+
var _linkExtractors = require("@atlaskit/link-extractors");
|
|
11
|
+
var extractAISummaryAction = exports.extractAISummaryAction = function extractAISummaryAction(response, url, actionOptions, aiSummaryConfig) {
|
|
12
|
+
if (!(0, _canShowAction.canShowAction)(_types.CardAction.AISummaryAction, actionOptions) || !(0, _getIsAiSummaryEnabled.getIsAISummaryEnabled)(aiSummaryConfig === null || aiSummaryConfig === void 0 ? void 0 : aiSummaryConfig.isAdminHubAIEnabled, response) || !(aiSummaryConfig !== null && aiSummaryConfig !== void 0 && aiSummaryConfig.product) || !url) {
|
|
13
|
+
return;
|
|
14
|
+
}
|
|
15
|
+
return {
|
|
16
|
+
url: url,
|
|
17
|
+
ari: (0, _linkExtractors.extractAri)(response.data),
|
|
18
|
+
product: aiSummaryConfig === null || aiSummaryConfig === void 0 ? void 0 : aiSummaryConfig.product
|
|
19
|
+
};
|
|
20
|
+
};
|
|
@@ -19,6 +19,8 @@ var extractFollowAction = function extractFollowAction(response, actionOptions,
|
|
|
19
19
|
var extensionKey = (0, _helpers.getExtensionKey)(response);
|
|
20
20
|
var data = response === null || response === void 0 ? void 0 : response.data;
|
|
21
21
|
var actions = (0, _extractServerAction.default)(data);
|
|
22
|
+
var type = (0, _linkExtractors.extractType)(data);
|
|
23
|
+
var isProject = type === null || type === void 0 ? void 0 : type.includes('atlassian:Project');
|
|
22
24
|
if (!extensionKey || actions.length === 0) {
|
|
23
25
|
return;
|
|
24
26
|
}
|
|
@@ -48,7 +50,8 @@ var extractFollowAction = function extractFollowAction(response, actionOptions,
|
|
|
48
50
|
providerKey: extensionKey,
|
|
49
51
|
reload: reload
|
|
50
52
|
},
|
|
51
|
-
value: actionType === _linkingTypes.SmartLinkActionType.FollowEntityAction
|
|
53
|
+
value: actionType === _linkingTypes.SmartLinkActionType.FollowEntityAction,
|
|
54
|
+
isProject: isProject
|
|
52
55
|
};
|
|
53
56
|
};
|
|
54
57
|
var _default = exports.default = extractFollowAction;
|
|
@@ -9,11 +9,13 @@ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/de
|
|
|
9
9
|
var _constants = require("../../../constants");
|
|
10
10
|
var _extractDownloadAction = require("./extract-download-action");
|
|
11
11
|
var _extractPreviewAction = require("./extract-preview-action");
|
|
12
|
+
var _extractAiSummaryAction = require("./extract-ai-summary-action");
|
|
12
13
|
var _extractFollowAction = _interopRequireDefault(require("./extract-follow-action"));
|
|
13
14
|
var _extractCopyLinkAction = require("./extract-copy-link-action");
|
|
14
|
-
var extractActions = function extractActions(response,
|
|
15
|
+
var extractActions = function extractActions(response, url, actionOptions, id, aiSummaryConfig) {
|
|
15
16
|
var _action;
|
|
16
|
-
var
|
|
17
|
+
var data = response.data;
|
|
18
|
+
var action = (_action = {}, (0, _defineProperty2.default)(_action, _constants.ActionName.CopyLinkAction, (0, _extractCopyLinkAction.extractCopyLinkAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.DownloadAction, (0, _extractDownloadAction.extractDownloadAction)(data, actionOptions)), (0, _defineProperty2.default)(_action, _constants.ActionName.FollowAction, (0, _extractFollowAction.default)(response, actionOptions, id)), (0, _defineProperty2.default)(_action, _constants.ActionName.PreviewAction, (0, _extractPreviewAction.extractPreviewAction)(response, actionOptions)), (0, _defineProperty2.default)(_action, _constants.InternalActionName.AISummaryAction, (0, _extractAiSummaryAction.extractAISummaryAction)(response, url, actionOptions, aiSummaryConfig)), _action);
|
|
17
19
|
return Object.values(action).some(function (value) {
|
|
18
20
|
return Boolean(value);
|
|
19
21
|
}) ? action : undefined;
|
|
@@ -22,14 +22,15 @@ var extractFlexibleUiContext = function extractFlexibleUiContext() {
|
|
|
22
22
|
id = _ref.id,
|
|
23
23
|
renderers = _ref.renderers,
|
|
24
24
|
actionOptions = _ref.actionOptions,
|
|
25
|
-
response = _ref.response
|
|
25
|
+
response = _ref.response,
|
|
26
|
+
aiSummaryConfig = _ref.aiSummaryConfig;
|
|
26
27
|
if (!response) {
|
|
27
28
|
return undefined;
|
|
28
29
|
}
|
|
29
30
|
var data = response.data;
|
|
30
31
|
var url = (0, _linkExtractors.extractLink)(data);
|
|
31
32
|
return {
|
|
32
|
-
actions: (0, _actions.default)(response,
|
|
33
|
+
actions: (0, _actions.default)(response, url, actionOptions, id, aiSummaryConfig),
|
|
33
34
|
assignedToGroup: (0, _utils.extractPersonAssignedToAsArray)(data),
|
|
34
35
|
attachmentCount: (0, _utils.extractAttachmentCount)(data),
|
|
35
36
|
authorGroup: (0, _linkExtractors.extractPersonCreatedBy)(data),
|
package/dist/cjs/messages.js
CHANGED
|
@@ -201,6 +201,16 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
201
201
|
defaultMessage: 'Download file',
|
|
202
202
|
description: 'Allow a user to download a file'
|
|
203
203
|
},
|
|
204
|
+
ai_summary_action: {
|
|
205
|
+
id: 'fabric.linking.ai_summary_action.nonfinal',
|
|
206
|
+
defaultMessage: 'Summarize with AI',
|
|
207
|
+
description: 'Allow a user to summarize a link'
|
|
208
|
+
},
|
|
209
|
+
ai_summary_action_description: {
|
|
210
|
+
id: 'fabric.linking.ai_summary_action_description.nonfinal',
|
|
211
|
+
defaultMessage: 'Summarize the content of this link using Atlassian Intelligence.',
|
|
212
|
+
description: 'Description of what the summarize link with AI action does'
|
|
213
|
+
},
|
|
204
214
|
edit: {
|
|
205
215
|
id: 'fabric.linking.edit',
|
|
206
216
|
defaultMessage: 'Edit',
|
|
@@ -211,6 +221,26 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
211
221
|
defaultMessage: 'Follow',
|
|
212
222
|
description: 'Click to follow a project.'
|
|
213
223
|
},
|
|
224
|
+
follow_project_description: {
|
|
225
|
+
id: 'fabric.linking.follow_project_description.nonfinal',
|
|
226
|
+
defaultMessage: 'Follow to get notifications on this project',
|
|
227
|
+
description: 'Description on what Follow does'
|
|
228
|
+
},
|
|
229
|
+
follow_project: {
|
|
230
|
+
id: 'fabric.linking.follow_project.nonfinal',
|
|
231
|
+
defaultMessage: 'Follow project',
|
|
232
|
+
description: 'Click to follow a project.'
|
|
233
|
+
},
|
|
234
|
+
follow_goal_description: {
|
|
235
|
+
id: 'fabric.linking.follow_goal_description.nonfinal',
|
|
236
|
+
defaultMessage: 'Follow this goal to get notifications on updates',
|
|
237
|
+
description: 'Description on what Follow does'
|
|
238
|
+
},
|
|
239
|
+
follow_goal: {
|
|
240
|
+
id: 'fabric.linking.follow_goal.nonfinal',
|
|
241
|
+
defaultMessage: 'Follow goal',
|
|
242
|
+
description: 'Click to follow a project.'
|
|
243
|
+
},
|
|
214
244
|
go_back: {
|
|
215
245
|
id: 'fabric.linking.go_back',
|
|
216
246
|
defaultMessage: 'Go back',
|
|
@@ -471,6 +501,26 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
471
501
|
defaultMessage: 'Unfollow',
|
|
472
502
|
description: 'Click to unfollow a project.'
|
|
473
503
|
},
|
|
504
|
+
unfollow_project_description: {
|
|
505
|
+
id: 'fabric.linking.unfollow_project_description.nonfinal',
|
|
506
|
+
defaultMessage: 'Unfollow to stop receiving project notifications',
|
|
507
|
+
description: 'Description on what Unfollow does'
|
|
508
|
+
},
|
|
509
|
+
unfollow_project: {
|
|
510
|
+
id: 'fabric.linking.unfollow_project.nonfinal',
|
|
511
|
+
defaultMessage: 'Unfollow project',
|
|
512
|
+
description: 'Click to unfollow a project.'
|
|
513
|
+
},
|
|
514
|
+
unfollow_goal_description: {
|
|
515
|
+
id: 'fabric.linking.unfollow_goal_description.nonfinal',
|
|
516
|
+
defaultMessage: 'Unfollow to stop receiving notifications for this goal',
|
|
517
|
+
description: 'Description on what Unfollow does'
|
|
518
|
+
},
|
|
519
|
+
unfollow_goal: {
|
|
520
|
+
id: 'fabric.linking.unfollow_goal.nonfinal',
|
|
521
|
+
defaultMessage: 'Unfollow goal',
|
|
522
|
+
description: 'Click to unfollow a project.'
|
|
523
|
+
},
|
|
474
524
|
unlink_account: {
|
|
475
525
|
id: 'fabric.linking.unlink_account',
|
|
476
526
|
defaultMessage: 'Unlink Account',
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.useAISummaryConfig = void 0;
|
|
7
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
8
|
+
var _react = require("react");
|
|
9
|
+
var useAISummaryConfig = exports.useAISummaryConfig = function useAISummaryConfig() {
|
|
10
|
+
var _useSmartLinkContext = (0, _linkProvider.useSmartLinkContext)(),
|
|
11
|
+
product = _useSmartLinkContext.product,
|
|
12
|
+
isAdminHubAIEnabled = _useSmartLinkContext.isAdminHubAIEnabled;
|
|
13
|
+
return (0, _react.useMemo)(function () {
|
|
14
|
+
return {
|
|
15
|
+
product: product,
|
|
16
|
+
isAdminHubAIEnabled: isAdminHubAIEnabled
|
|
17
|
+
};
|
|
18
|
+
}, [product, isAdminHubAIEnabled]);
|
|
19
|
+
};
|
|
@@ -22,7 +22,7 @@ var ANALYTICS_CHANNEL = exports.ANALYTICS_CHANNEL = 'media';
|
|
|
22
22
|
var context = exports.context = {
|
|
23
23
|
componentName: 'smart-cards',
|
|
24
24
|
packageName: "@atlaskit/smart-card",
|
|
25
|
-
packageVersion: "26.
|
|
25
|
+
packageVersion: "26.57.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.getIsAISummaryEnabled = void 0;
|
|
7
|
+
var _platformFeatureFlags = require("@atlaskit/platform-feature-flags");
|
|
8
|
+
var getIsAISummaryEnabled = exports.getIsAISummaryEnabled = function getIsAISummaryEnabled() {
|
|
9
|
+
var _response$meta;
|
|
10
|
+
var isAdminHubAIEnabled = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
11
|
+
var response = arguments.length > 1 ? arguments[1] : undefined;
|
|
12
|
+
return Boolean((0, _platformFeatureFlags.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')));
|
|
13
|
+
};
|
|
@@ -11,5 +11,6 @@ var CardAction = exports.CardAction = /*#__PURE__*/function (CardAction) {
|
|
|
11
11
|
CardAction["ChangeStatusAction"] = "ChangeStatusAction";
|
|
12
12
|
CardAction["FollowAction"] = "FollowAction";
|
|
13
13
|
CardAction["CopyLinkAction"] = "CopyLinkAction";
|
|
14
|
+
CardAction["AISummaryAction"] = "AISummaryAction";
|
|
14
15
|
return CardAction;
|
|
15
16
|
}({});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
|
+
Object.defineProperty(exports, "__esModule", {
|
|
6
|
+
value: true
|
|
7
|
+
});
|
|
8
|
+
exports.AISummaryActionComponent = void 0;
|
|
9
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
11
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
+
var _reactIntlNext = require("react-intl-next");
|
|
13
|
+
var _messages = require("../../../../../messages");
|
|
14
|
+
var _action = _interopRequireDefault(require("../action"));
|
|
15
|
+
var _aiIcon = _interopRequireDefault(require("../../../../common/ai-icon"));
|
|
16
|
+
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
17
|
+
var _useAiSummary = require("../../../../../state/hooks/use-ai-summary");
|
|
18
|
+
var _excluded = ["onClick", "url", "ari", "product"];
|
|
19
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
20
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
21
|
+
var AISummaryActionComponent = exports.AISummaryActionComponent = function AISummaryActionComponent(_ref) {
|
|
22
|
+
var onClickCallback = _ref.onClick,
|
|
23
|
+
_ref$url = _ref.url,
|
|
24
|
+
url = _ref$url === void 0 ? '' : _ref$url,
|
|
25
|
+
_ref$ari = _ref.ari,
|
|
26
|
+
ari = _ref$ari === void 0 ? '' : _ref$ari,
|
|
27
|
+
product = _ref.product,
|
|
28
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
29
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
30
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
31
|
+
var _useAISummary = (0, _useAiSummary.useAISummary)({
|
|
32
|
+
url: url,
|
|
33
|
+
ari: ari,
|
|
34
|
+
product: product
|
|
35
|
+
}),
|
|
36
|
+
status = _useAISummary.state.status,
|
|
37
|
+
summariseUrl = _useAISummary.summariseUrl;
|
|
38
|
+
var handleActionClick = (0, _react.useCallback)(function () {
|
|
39
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
40
|
+
fireEvent('track.aiInteraction.initiated', {
|
|
41
|
+
aiFeatureName: 'Smart Links Summary',
|
|
42
|
+
proactiveAIGenerated: 0,
|
|
43
|
+
userGeneratedAI: 1
|
|
44
|
+
});
|
|
45
|
+
summariseUrl();
|
|
46
|
+
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
47
|
+
}, [fireEvent, onClickCallback, summariseUrl]);
|
|
48
|
+
if (status === 'ready' || status === 'error') {
|
|
49
|
+
return /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
50
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_summary_action),
|
|
51
|
+
icon: /*#__PURE__*/_react.default.createElement(_aiIcon.default, {
|
|
52
|
+
label: "Summarise with AI"
|
|
53
|
+
}),
|
|
54
|
+
onClick: handleActionClick,
|
|
55
|
+
testId: "smart-action-ai-summary-action",
|
|
56
|
+
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_summary_action_description)
|
|
57
|
+
}, props));
|
|
58
|
+
}
|
|
59
|
+
return null;
|
|
60
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.default = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
10
|
+
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
11
|
+
var _constants = require("../../../../../constants");
|
|
12
|
+
var _aiSummaryActionComponent = require("./ai-summary-action-component");
|
|
13
|
+
var AISummaryAction = function AISummaryAction(props) {
|
|
14
|
+
var _context$actions;
|
|
15
|
+
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
16
|
+
var actionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[_constants.InternalActionName.AISummaryAction];
|
|
17
|
+
return actionData ? /*#__PURE__*/_react.default.createElement(_aiSummaryActionComponent.AISummaryActionComponent, (0, _extends2.default)({}, actionData, props)) : null;
|
|
18
|
+
};
|
|
19
|
+
var _default = exports.default = AISummaryAction;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.GoalIcon = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _icon = _interopRequireDefault(require("@atlaskit/icon"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var GoalGlyph = function GoalGlyph(props) {
|
|
12
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: "16",
|
|
15
|
+
height: "16",
|
|
16
|
+
viewBox: "0 0 16 16",
|
|
17
|
+
fill: "none"
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
clipRule: "evenodd",
|
|
21
|
+
d: "M12.6667 8C12.6667 10.5773 10.5773 12.6667 8 12.6667C5.42267 12.6667 3.33333 10.5773 3.33333 8C3.33333 5.42267 5.42267 3.33333 8 3.33333C10.5773 3.33333 12.6667 5.42267 12.6667 8ZM14 8C14 11.3137 11.3137 14 8 14C4.68629 14 2 11.3137 2 8C2 4.68629 4.68629 2 8 2C11.3137 2 14 4.68629 14 8ZM9.33333 8C9.33333 8.73638 8.73638 9.33333 8 9.33333C7.26362 9.33333 6.66667 8.73638 6.66667 8C6.66667 7.26362 7.26362 6.66667 8 6.66667C8.73638 6.66667 9.33333 7.26362 9.33333 8ZM10.6667 8C10.6667 9.47276 9.47276 10.6667 8 10.6667C6.52724 10.6667 5.33333 9.47276 5.33333 8C5.33333 6.52724 6.52724 5.33333 8 5.33333C9.47276 5.33333 10.6667 6.52724 10.6667 8Z",
|
|
22
|
+
fill: "#0C66E4"
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
var GoalIcon = exports.GoalIcon = function GoalIcon(props) {
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
|
|
27
|
+
glyph: GoalGlyph
|
|
28
|
+
}, props));
|
|
29
|
+
};
|
|
@@ -5,6 +5,7 @@ Object.defineProperty(exports, "__esModule", {
|
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
7
|
exports.default = void 0;
|
|
8
|
+
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
|
|
8
9
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
10
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
10
11
|
var _inviteTeam = _interopRequireDefault(require("@atlaskit/icon/glyph/invite-team"));
|
|
@@ -15,7 +16,39 @@ var _messages = require("../../../../../messages");
|
|
|
15
16
|
var _flexibleUiContext = require("../../../../../state/flexible-ui-context");
|
|
16
17
|
var _serverAction = _interopRequireDefault(require("../action/server-action"));
|
|
17
18
|
var _unfollowIcon = _interopRequireDefault(require("./unfollow-icon"));
|
|
19
|
+
var _utils = require("../../utils");
|
|
18
20
|
var _excluded = ["value"];
|
|
21
|
+
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
22
|
+
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != (0, _typeof2.default)(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
23
|
+
var importIconMapper = {
|
|
24
|
+
goal: function goal() {
|
|
25
|
+
return Promise.resolve().then(function () {
|
|
26
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "glyphGoal" */'./goal-icon'));
|
|
27
|
+
}).then(function (_ref) {
|
|
28
|
+
var GoalIcon = _ref.GoalIcon;
|
|
29
|
+
return {
|
|
30
|
+
default: GoalIcon
|
|
31
|
+
};
|
|
32
|
+
});
|
|
33
|
+
},
|
|
34
|
+
projects: function projects() {
|
|
35
|
+
return Promise.resolve().then(function () {
|
|
36
|
+
return _interopRequireWildcard(require( /* webpackChunkName: "glyphProjects" */'./projects-icon'));
|
|
37
|
+
}).then(function (_ref2) {
|
|
38
|
+
var ProjectsIcon = _ref2.ProjectsIcon;
|
|
39
|
+
return {
|
|
40
|
+
default: ProjectsIcon
|
|
41
|
+
};
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
var getIcon = function getIcon(stackIconType) {
|
|
46
|
+
var importFn = importIconMapper[stackIconType];
|
|
47
|
+
if (!importFn) {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
return (0, _utils.importIcon)(importFn);
|
|
51
|
+
};
|
|
19
52
|
var FollowAction = function FollowAction(props) {
|
|
20
53
|
var _context$actions, _context$actions2;
|
|
21
54
|
var context = (0, _flexibleUiContext.useFlexibleUiContext)();
|
|
@@ -25,17 +58,34 @@ var FollowAction = function FollowAction(props) {
|
|
|
25
58
|
var _context$actions$Acti = context === null || context === void 0 || (_context$actions2 = context.actions) === null || _context$actions2 === void 0 ? void 0 : _context$actions2[_constants.ActionName.FollowAction],
|
|
26
59
|
value = _context$actions$Acti.value,
|
|
27
60
|
data = (0, _objectWithoutProperties2.default)(_context$actions$Acti, _excluded);
|
|
61
|
+
var isStackItem = props.as === 'stack-item';
|
|
62
|
+
var isProject = data.isProject;
|
|
28
63
|
var message = value ? _messages.messages.follow : _messages.messages.unfollow;
|
|
64
|
+
var projectMessage = value ? _messages.messages.follow_project : _messages.messages.unfollow_project;
|
|
65
|
+
var goalMessage = value ? _messages.messages.follow_goal : _messages.messages.unfollow_goal;
|
|
66
|
+
var stackMessage = isProject ? projectMessage : goalMessage;
|
|
67
|
+
var label = isStackItem ? stackMessage : message;
|
|
68
|
+
var projectTooltipMessage = value ? _messages.messages.follow_project_description : _messages.messages.unfollow_project_description;
|
|
69
|
+
var goalTooltipMessage = value ? _messages.messages.follow_goal_description : _messages.messages.unfollow_goal_description;
|
|
70
|
+
var stackTooltipMessage = isProject ? projectTooltipMessage : goalTooltipMessage;
|
|
71
|
+
var tooltipMessage = isStackItem ? stackTooltipMessage : message;
|
|
29
72
|
var icon = value ? /*#__PURE__*/_react.default.createElement(_inviteTeam.default, {
|
|
30
73
|
label: "Follow"
|
|
31
74
|
}) : /*#__PURE__*/_react.default.createElement(_unfollowIcon.default, {
|
|
32
75
|
label: "Unfollow"
|
|
33
76
|
});
|
|
77
|
+
var stackIconType = isProject ? 'projects' : 'goal';
|
|
78
|
+
var ImportedIcon = getIcon(stackIconType);
|
|
79
|
+
var stackIcon = /*#__PURE__*/_react.default.createElement(ImportedIcon, {
|
|
80
|
+
label: "Follow",
|
|
81
|
+
testId: "smart-action-follow-action-".concat(stackIconType, "-icon")
|
|
82
|
+
});
|
|
83
|
+
var followIcon = isStackItem ? stackIcon : icon;
|
|
34
84
|
return /*#__PURE__*/_react.default.createElement(_serverAction.default, (0, _extends2.default)({
|
|
35
|
-
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage,
|
|
36
|
-
icon:
|
|
85
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, label),
|
|
86
|
+
icon: followIcon,
|
|
37
87
|
testId: "smart-action-follow-action",
|
|
38
|
-
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage,
|
|
88
|
+
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, tooltipMessage)
|
|
39
89
|
}, data, props));
|
|
40
90
|
};
|
|
41
91
|
var _default = exports.default = FollowAction;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
+
Object.defineProperty(exports, "__esModule", {
|
|
5
|
+
value: true
|
|
6
|
+
});
|
|
7
|
+
exports.ProjectsIcon = void 0;
|
|
8
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
9
|
+
var _icon = _interopRequireDefault(require("@atlaskit/icon"));
|
|
10
|
+
var _react = _interopRequireDefault(require("react"));
|
|
11
|
+
var ProjectsGlyph = function ProjectsGlyph(props) {
|
|
12
|
+
return /*#__PURE__*/_react.default.createElement("svg", {
|
|
13
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
14
|
+
width: "16",
|
|
15
|
+
height: "16",
|
|
16
|
+
viewBox: "0 0 16 16",
|
|
17
|
+
fill: "none"
|
|
18
|
+
}, /*#__PURE__*/_react.default.createElement("path", {
|
|
19
|
+
fillRule: "evenodd",
|
|
20
|
+
clipRule: "evenodd",
|
|
21
|
+
d: "M9.88573 4.00002C9.70892 4.00002 9.53935 4.07026 9.41433 4.19528L6.97282 6.63678L4.20525 6.94429C4.05479 6.96101 3.91451 7.02844 3.80746 7.13548L3.60959 7.33335L4.35367 8.07743C4.6791 8.40287 4.6791 8.93051 4.35367 9.25594L3.47152 10.1381C3.21117 10.3984 2.78906 10.3984 2.52871 10.1381C2.26836 9.87774 2.26836 9.45563 2.52871 9.19528L3.0573 8.66669L2.43108 8.04046C2.04055 7.64993 2.04055 7.01677 2.43108 6.62625L2.86465 6.19267C3.18578 5.87154 3.60664 5.66927 4.05801 5.61911L6.36073 5.36326L8.47152 3.25247C8.84659 2.8774 9.3553 2.66669 9.88573 2.66669H12.0001C12.7365 2.66669 13.3334 3.26364 13.3334 4.00002V6.1144C13.3334 6.64483 13.1227 7.15354 12.7477 7.52862L10.6369 9.6394L10.381 11.9421C10.3309 12.3935 10.1286 12.8143 9.80746 13.1355L9.37389 13.5691C8.98336 13.9596 8.3502 13.9596 7.95967 13.5691L7.33345 12.9428L6.80485 13.4714C6.5445 13.7318 6.12239 13.7318 5.86204 13.4714C5.60169 13.2111 5.60169 12.789 5.86204 12.5286L6.74419 11.6465C7.06963 11.321 7.59726 11.321 7.9227 11.6465L8.66678 12.3905L8.86466 12.1927C8.9717 12.0856 9.03912 11.9453 9.05584 11.7949L9.36335 9.02731L11.8049 6.58581C11.9299 6.46078 12.0001 6.29121 12.0001 6.1144V4.00002H9.88573ZM5.80486 10.1953C6.06521 10.4556 6.06521 10.8777 5.80486 11.1381L3.80486 13.1381C3.54451 13.3984 3.1224 13.3984 2.86205 13.1381C2.6017 12.8777 2.6017 12.4556 2.86205 12.1953L4.86205 10.1953C5.1224 9.93493 5.54451 9.93493 5.80486 10.1953ZM10.0001 6.66669C10.3683 6.66669 10.6668 6.36821 10.6668 6.00002C10.6668 5.63183 10.3683 5.33335 10.0001 5.33335C9.63193 5.33335 9.33346 5.63183 9.33346 6.00002C9.33346 6.36821 9.63193 6.66669 10.0001 6.66669Z",
|
|
22
|
+
fill: "#0C66E4"
|
|
23
|
+
}));
|
|
24
|
+
};
|
|
25
|
+
var ProjectsIcon = exports.ProjectsIcon = function ProjectsIcon(props) {
|
|
26
|
+
return /*#__PURE__*/_react.default.createElement(_icon.default, (0, _extends2.default)({
|
|
27
|
+
glyph: ProjectsGlyph
|
|
28
|
+
}, props));
|
|
29
|
+
};
|
|
@@ -4,6 +4,12 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
+
Object.defineProperty(exports, "AISummaryAction", {
|
|
8
|
+
enumerable: true,
|
|
9
|
+
get: function get() {
|
|
10
|
+
return _aiSummaryAction.default;
|
|
11
|
+
}
|
|
12
|
+
});
|
|
7
13
|
Object.defineProperty(exports, "CopyLinkAction", {
|
|
8
14
|
enumerable: true,
|
|
9
15
|
get: function get() {
|
|
@@ -52,4 +58,5 @@ var _editAction = _interopRequireDefault(require("./edit-action"));
|
|
|
52
58
|
var _downloadAction = _interopRequireDefault(require("./download-action"));
|
|
53
59
|
var _followAction = _interopRequireDefault(require("./follow-action"));
|
|
54
60
|
var _previewAction = _interopRequireDefault(require("./preview-action"));
|
|
55
|
-
var _copyLinkAction = _interopRequireDefault(require("./copy-link-action"));
|
|
61
|
+
var _copyLinkAction = _interopRequireDefault(require("./copy-link-action"));
|
|
62
|
+
var _aiSummaryAction = _interopRequireDefault(require("./ai-summary-action"));
|
|
@@ -19,7 +19,7 @@ var ignoreContainerPaddingStyles = (0, _primitives.xcss)({
|
|
|
19
19
|
marginLeft: 'calc(var(--container-gap-left) * -1)',
|
|
20
20
|
marginRight: 'calc(var(--container-gap-right) * -1)'
|
|
21
21
|
});
|
|
22
|
-
var DEFAULT_SORT_ORDER = [
|
|
22
|
+
var DEFAULT_SORT_ORDER = ['PreviewAction', 'CopyLinkAction', 'AISummaryAction'];
|
|
23
23
|
var sort = function sort(a, b) {
|
|
24
24
|
var idxA = DEFAULT_SORT_ORDER.indexOf(a);
|
|
25
25
|
var idxB = DEFAULT_SORT_ORDER.indexOf(b);
|
|
@@ -20,8 +20,6 @@ var _aiStateIndicator = _interopRequireDefault(require("../ai-state-indicator"))
|
|
|
20
20
|
var _utils = require("../../utils");
|
|
21
21
|
var _messages = require("../../../../../../messages");
|
|
22
22
|
var _useAiSummary = require("../../../../../../state/hooks/use-ai-summary");
|
|
23
|
-
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
24
|
-
var _linkProvider = require("@atlaskit/link-provider");
|
|
25
23
|
var _aiIcon = _interopRequireDefault(require("../../../../../common/ai-icon"));
|
|
26
24
|
var _aiSummary = _interopRequireDefault(require("../../../../../common/ai-summary"));
|
|
27
25
|
var _useAnalyticsEvents2 = require("../../../../../../common/analytics/generated/use-analytics-events");
|
|
@@ -30,6 +28,8 @@ var _aiEventErrorViewed = _interopRequireDefault(require("../ai-event-error-view
|
|
|
30
28
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
31
29
|
var _react2 = require("@emotion/react");
|
|
32
30
|
var _featureDiscovery = _interopRequireDefault(require("../feature-discovery"));
|
|
31
|
+
var _flexibleUiContext = require("../../../../../../state/flexible-ui-context");
|
|
32
|
+
var _linkProvider = require("@atlaskit/link-provider");
|
|
33
33
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
34
34
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
35
35
|
var AISummaryBlockErrorIndicator = exports.AISummaryBlockErrorIndicator = function AISummaryBlockErrorIndicator(_ref) {
|
|
@@ -14,7 +14,7 @@ var _elements = require("../../elements");
|
|
|
14
14
|
var _utils = require("../../utils");
|
|
15
15
|
var _excluded = ["maxLines", "status", "testId", "text"];
|
|
16
16
|
var DEFAULT_MAX_LINES = 3;
|
|
17
|
-
var MAXIMUM_MAX_LINES =
|
|
17
|
+
var MAXIMUM_MAX_LINES = 6;
|
|
18
18
|
var MINIMUM_MAX_LINES = 1;
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", {
|
|
5
5
|
value: true
|
|
6
6
|
});
|
|
7
|
-
exports.sizeToButtonSpacing = exports.openEmbedModalWithFlexibleUiIcon = exports.hasWhiteSpace = exports.getTruncateStyles = exports.getPrimitivesPaddingSpaceBySize = exports.getPrimitivesInlineSpaceBySize = exports.getMaxLines = exports.getMaxLineHeight = exports.getLinkSizeStyles = exports.getLinkLineHeight = exports.getIconWidth = exports.getIconSizeStyles = exports.getFormattedMessageAsString = exports.getFormattedMessage = void 0;
|
|
7
|
+
exports.sizeToButtonSpacing = exports.openEmbedModalWithFlexibleUiIcon = exports.importIcon = exports.hasWhiteSpace = exports.getTruncateStyles = exports.getPrimitivesPaddingSpaceBySize = exports.getPrimitivesInlineSpaceBySize = exports.getMaxLines = exports.getMaxLineHeight = exports.getLinkSizeStyles = exports.getLinkLineHeight = exports.getIconWidth = exports.getIconSizeStyles = exports.getFormattedMessageAsString = exports.getFormattedMessage = void 0;
|
|
8
8
|
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
9
9
|
var _taggedTemplateLiteral2 = _interopRequireDefault(require("@babel/runtime/helpers/taggedTemplateLiteral"));
|
|
10
10
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
@@ -15,6 +15,7 @@ var _reactIntlNext = require("react-intl-next");
|
|
|
15
15
|
var _constants = require("../../../constants");
|
|
16
16
|
var _icon = _interopRequireDefault(require("./elements/icon"));
|
|
17
17
|
var _utils = require("../../EmbedModal/utils");
|
|
18
|
+
var _reactLoadable = _interopRequireDefault(require("react-loadable"));
|
|
18
19
|
var _excluded = ["linkIcon"];
|
|
19
20
|
var _sizeToButtonSpacing, _templateObject;
|
|
20
21
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -63,6 +64,18 @@ var getIconWidth = exports.getIconWidth = function getIconWidth(size) {
|
|
|
63
64
|
return '.75rem';
|
|
64
65
|
}
|
|
65
66
|
};
|
|
67
|
+
var importIcon = exports.importIcon = function importIcon(importFn) {
|
|
68
|
+
return (0, _reactLoadable.default)({
|
|
69
|
+
loader: function loader() {
|
|
70
|
+
return importFn().then(function (module) {
|
|
71
|
+
return module.default;
|
|
72
|
+
});
|
|
73
|
+
},
|
|
74
|
+
loading: function loading() {
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
}); // Because we're using dynamic loading here, TS will not be able to infer the type.
|
|
78
|
+
};
|
|
66
79
|
var getLinkLineHeight = exports.getLinkLineHeight = function getLinkLineHeight(size) {
|
|
67
80
|
switch (size) {
|
|
68
81
|
case _constants.SmartLinkSize.XLarge:
|
|
@@ -13,6 +13,7 @@ var _constants = require("../../constants");
|
|
|
13
13
|
var _container = _interopRequireDefault(require("./components/container"));
|
|
14
14
|
var _flexibleUiContext = require("../../state/flexible-ui-context");
|
|
15
15
|
var _utils = require("./utils");
|
|
16
|
+
var _useAiSummaryConfig = require("../../state/hooks/use-ai-summary-config");
|
|
16
17
|
function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return null; var r = new WeakMap(), t = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
|
|
17
18
|
function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
|
|
18
19
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
@@ -42,11 +43,13 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
42
43
|
testId = _ref.testId,
|
|
43
44
|
ui = _ref.ui,
|
|
44
45
|
url = _ref.url;
|
|
46
|
+
var aiSummaryConfig = (0, _useAiSummaryConfig.useAISummaryConfig)();
|
|
45
47
|
var cardType = cardState.status,
|
|
46
48
|
details = cardState.details;
|
|
47
49
|
var status = cardType;
|
|
48
50
|
var context = (0, _react.useMemo)(function () {
|
|
49
51
|
return (0, _utils.getContextByStatus)({
|
|
52
|
+
aiSummaryConfig: aiSummaryConfig,
|
|
50
53
|
response: details,
|
|
51
54
|
id: id,
|
|
52
55
|
renderers: renderers,
|
|
@@ -54,7 +57,7 @@ var FlexibleCard = function FlexibleCard(_ref) {
|
|
|
54
57
|
status: status,
|
|
55
58
|
url: url
|
|
56
59
|
});
|
|
57
|
-
}, [details, id, renderers, actionOptions, status, url]);
|
|
60
|
+
}, [aiSummaryConfig, details, id, renderers, actionOptions, status, url]);
|
|
58
61
|
var retry = (0, _utils.getRetryOptions)(url, status, details, onAuthorize);
|
|
59
62
|
var _ref2 = context || {},
|
|
60
63
|
title = _ref2.title;
|