@atlaskit/smart-card 26.61.0 → 26.62.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 +14 -0
- package/analytics.spec.yaml +6 -0
- package/dist/cjs/messages.js +15 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-icon/index.js +4 -3
- package/dist/cjs/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/action/index.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +59 -0
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +20 -51
- package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +62 -0
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/messages.js +15 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-icon/index.js +4 -3
- package/dist/es2019/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/action/index.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +49 -0
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +19 -45
- package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +36 -0
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/messages.js +15 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/action-icon/index.js +4 -3
- package/dist/esm/view/FlexibleCard/components/actions/action/action-stack-item/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/action/index.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js +49 -0
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.js +20 -48
- package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js +52 -0
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +5 -1
- package/dist/types/messages.d.ts +2 -2
- package/dist/types/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/action/action-stack-item/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/action/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.d.ts +8 -0
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.d.ts +3 -3
- package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.d.ts +6 -0
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +5 -1
- package/dist/types-ts4.5/messages.d.ts +2 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-icon/types.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/action-stack-item/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.d.ts +8 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/ai-summary-action-component.d.ts +3 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.d.ts +6 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @atlaskit/smart-card
|
|
2
2
|
|
|
3
|
+
## 26.62.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [#97986](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/97986)
|
|
8
|
+
[`add59fc2532d`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/add59fc2532d) -
|
|
9
|
+
[ux] AI summary button to change to copy summary button when summary generation is complete
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [#98122](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/98122)
|
|
14
|
+
[`97965a03cc96`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/97965a03cc96) -
|
|
15
|
+
Hover preview redesign: Update action icon size
|
|
16
|
+
|
|
3
17
|
## 26.61.0
|
|
4
18
|
|
|
5
19
|
### Minor Changes
|
package/analytics.spec.yaml
CHANGED
|
@@ -91,6 +91,12 @@ events:
|
|
|
91
91
|
attributes:
|
|
92
92
|
<<: [*PackageMetaDataContext, *ResolvedAttributes]
|
|
93
93
|
|
|
94
|
+
- button clicked (copySummary):
|
|
95
|
+
type: ui
|
|
96
|
+
description: fired when the copy ai summary button is clicked
|
|
97
|
+
attributes:
|
|
98
|
+
<<: [*PackageMetaDataContext, *ResolvedAttributes]
|
|
99
|
+
|
|
94
100
|
- summary viewed:
|
|
95
101
|
type: ui
|
|
96
102
|
description: fired when a summary is viewed
|
package/dist/cjs/messages.js
CHANGED
|
@@ -211,6 +211,21 @@ var messages = exports.messages = (0, _reactIntlNext.defineMessages)({
|
|
|
211
211
|
defaultMessage: 'Summarize the content of this link using Atlassian Intelligence.',
|
|
212
212
|
description: 'Description of what the summarize link with AI action does'
|
|
213
213
|
},
|
|
214
|
+
copy_summary_action: {
|
|
215
|
+
id: 'fabric.linking.copy_summary_action.nonfinal',
|
|
216
|
+
defaultMessage: 'Copy summary',
|
|
217
|
+
description: 'Allow a user to copy a generated summary'
|
|
218
|
+
},
|
|
219
|
+
copy_summary_action_description: {
|
|
220
|
+
id: 'fabric.linking.copy_summary_action.nonfinal',
|
|
221
|
+
defaultMessage: 'Copy summary',
|
|
222
|
+
description: 'Description of what the copy summary AI action does'
|
|
223
|
+
},
|
|
224
|
+
copied_summary_action_description: {
|
|
225
|
+
id: 'fabric.linking.copied_summary_action_description.nonfinal',
|
|
226
|
+
defaultMessage: 'Copied summary to clipboard',
|
|
227
|
+
description: 'Confirmation to the user that the summry has been copied'
|
|
228
|
+
},
|
|
214
229
|
edit: {
|
|
215
230
|
id: 'fabric.linking.edit',
|
|
216
231
|
defaultMessage: 'Edit',
|
|
@@ -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.62.0"
|
|
26
26
|
};
|
|
27
27
|
var TrackQuickActionType = exports.TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
28
28
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -27,7 +27,8 @@ var getIconStyles = function getIconStyles(isDisabled) {
|
|
|
27
27
|
color: isDisabled ? "var(--ds-text-disabled, #6B778C)" : "var(--ds-icon, #44546F)"
|
|
28
28
|
});
|
|
29
29
|
};
|
|
30
|
-
var
|
|
30
|
+
var stackItemIconSizeStyles = (0, _utils.getIconSizeStyles)('20px');
|
|
31
|
+
var stackItemIconStyles = (0, _react2.css)(stackItemIconSizeStyles, {
|
|
31
32
|
display: 'inline-block',
|
|
32
33
|
lineHeight: 0,
|
|
33
34
|
padding: "var(--ds-space-025, 2px)",
|
|
@@ -40,9 +41,9 @@ var ActionIcon = function ActionIcon(_ref) {
|
|
|
40
41
|
testId = _ref.testId,
|
|
41
42
|
icon = _ref.icon,
|
|
42
43
|
isDisabled = _ref.isDisabled,
|
|
43
|
-
|
|
44
|
+
asStackItemIcon = _ref.asStackItemIcon;
|
|
44
45
|
return (0, _react2.jsx)("span", {
|
|
45
|
-
css: [getIconStyles(isDisabled), (0, _utils.getIconSizeStyles)(getIconWidth(size))
|
|
46
|
+
css: [getIconStyles(isDisabled), asStackItemIcon ? stackItemIconStyles : (0, _utils.getIconSizeStyles)(getIconWidth(size))],
|
|
46
47
|
"data-testid": "".concat(testId, "-icon")
|
|
47
48
|
}, icon);
|
|
48
49
|
};
|
|
@@ -66,10 +66,10 @@ var ActionStackItem = function ActionStackItem(_ref) {
|
|
|
66
66
|
}
|
|
67
67
|
}, [isDisabled, isLoading, onClickCallback]);
|
|
68
68
|
var icon = iconOption && isLoading ? /*#__PURE__*/_react.default.createElement(_actionIcon.default, {
|
|
69
|
+
asStackItemIcon: true,
|
|
69
70
|
icon: /*#__PURE__*/_react.default.createElement(_spinner.default, {
|
|
70
71
|
testId: "".concat(testId, "-loading")
|
|
71
72
|
}),
|
|
72
|
-
showBackground: true,
|
|
73
73
|
size: size
|
|
74
74
|
}) : iconOption;
|
|
75
75
|
|
|
@@ -50,10 +50,10 @@ var Action = function Action(_ref) {
|
|
|
50
50
|
var isStackItem = as === 'stack-item';
|
|
51
51
|
var isDropdownItem = as === 'dropdown-item' || asDropDownItem;
|
|
52
52
|
var actionIcon = icon && (0, _react.jsx)(_actionIcon.default, {
|
|
53
|
+
asStackItemIcon: isStackItem,
|
|
53
54
|
isDisabled: isDisabled,
|
|
54
55
|
icon: icon,
|
|
55
56
|
size: size,
|
|
56
|
-
showBackground: isStackItem,
|
|
57
57
|
testId: testId
|
|
58
58
|
});
|
|
59
59
|
var iconBefore = icon && iconPosition === 'before' ? actionIcon : undefined;
|
package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
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.AISummariseAction = AISummariseAction;
|
|
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 _action = _interopRequireDefault(require("../action"));
|
|
14
|
+
var _aiIcon = _interopRequireDefault(require("../../../../common/ai-icon"));
|
|
15
|
+
var _messages = require("../../../../../messages");
|
|
16
|
+
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
17
|
+
var _utils = require("./utils");
|
|
18
|
+
var _excluded = ["url", "ari", "product", "onClick", "onError", "testId", "status", "summariseUrl"];
|
|
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
|
+
function AISummariseAction(_ref) {
|
|
22
|
+
var url = _ref.url,
|
|
23
|
+
ari = _ref.ari,
|
|
24
|
+
product = _ref.product,
|
|
25
|
+
onClickCallback = _ref.onClick,
|
|
26
|
+
onErrorCallback = _ref.onError,
|
|
27
|
+
testId = _ref.testId,
|
|
28
|
+
status = _ref.status,
|
|
29
|
+
summariseUrl = _ref.summariseUrl,
|
|
30
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
31
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
32
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
33
|
+
var onCompleted = (0, _react.useCallback)(function (state) {
|
|
34
|
+
if ((state === null || state === void 0 ? void 0 : state.status) === 'error') {
|
|
35
|
+
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback((0, _utils.getErrorMessage)(state.error));
|
|
36
|
+
}
|
|
37
|
+
}, [onErrorCallback]);
|
|
38
|
+
var handleActionClick = (0, _react.useCallback)(function () {
|
|
39
|
+
var _summariseUrl;
|
|
40
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
41
|
+
fireEvent('track.aiInteraction.initiated', {
|
|
42
|
+
aiFeatureName: 'Smart Links Summary',
|
|
43
|
+
proactiveAIGenerated: 0,
|
|
44
|
+
userGeneratedAI: 1
|
|
45
|
+
});
|
|
46
|
+
(_summariseUrl = summariseUrl()) === null || _summariseUrl === void 0 || _summariseUrl.then(onCompleted, onCompleted);
|
|
47
|
+
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
48
|
+
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
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: "".concat(testId, "-summarise-action"),
|
|
56
|
+
isLoading: status === 'loading',
|
|
57
|
+
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_summary_action_description)
|
|
58
|
+
}, props));
|
|
59
|
+
}
|
|
@@ -1,68 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
|
|
4
|
-
var _typeof = require("@babel/runtime/helpers/typeof");
|
|
5
4
|
Object.defineProperty(exports, "__esModule", {
|
|
6
5
|
value: true
|
|
7
6
|
});
|
|
8
7
|
exports.AISummaryActionComponent = void 0;
|
|
9
8
|
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
10
|
-
var
|
|
11
|
-
var _react = _interopRequireWildcard(require("react"));
|
|
12
|
-
var _reactIntlNext = require("react-intl-next");
|
|
9
|
+
var _react = _interopRequireDefault(require("react"));
|
|
13
10
|
var _reactMagneticDi = require("react-magnetic-di");
|
|
14
|
-
var _messages = require("../../../../../messages");
|
|
15
|
-
var _action = _interopRequireDefault(require("../action"));
|
|
16
|
-
var _aiIcon = _interopRequireDefault(require("../../../../common/ai-icon"));
|
|
17
|
-
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
18
11
|
var _useAiSummary = require("../../../../../state/hooks/use-ai-summary");
|
|
19
|
-
var
|
|
20
|
-
var
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
url = _ref$url === void 0 ? '' : _ref$url,
|
|
28
|
-
_ref$ari = _ref.ari,
|
|
29
|
-
ari = _ref$ari === void 0 ? '' : _ref$ari,
|
|
30
|
-
product = _ref.product,
|
|
31
|
-
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
32
|
-
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
33
|
-
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
12
|
+
var _copySummaryAction = require("./copy-summary-action");
|
|
13
|
+
var _aiSummariseAction = require("./ai-summarise-action");
|
|
14
|
+
var AISummaryActionComponent = exports.AISummaryActionComponent = function AISummaryActionComponent(props) {
|
|
15
|
+
var url = props.url,
|
|
16
|
+
ari = props.ari,
|
|
17
|
+
product = props.product,
|
|
18
|
+
_props$testId = props.testId,
|
|
19
|
+
testId = _props$testId === void 0 ? 'smart-action-ai-summary-action' : _props$testId;
|
|
34
20
|
var _useAISummary = (0, _useAiSummary.useAISummary)({
|
|
35
21
|
url: url,
|
|
36
22
|
ari: ari,
|
|
37
23
|
product: product
|
|
38
24
|
}),
|
|
39
|
-
|
|
25
|
+
_useAISummary$state = _useAISummary.state,
|
|
26
|
+
status = _useAISummary$state.status,
|
|
27
|
+
content = _useAISummary$state.content,
|
|
40
28
|
summariseUrl = _useAISummary.summariseUrl;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
fireEvent('track.aiInteraction.initiated', {
|
|
50
|
-
aiFeatureName: 'Smart Links Summary',
|
|
51
|
-
proactiveAIGenerated: 0,
|
|
52
|
-
userGeneratedAI: 1
|
|
53
|
-
});
|
|
54
|
-
(_summariseUrl = summariseUrl()) === null || _summariseUrl === void 0 || _summariseUrl.then(onCompleted, onCompleted);
|
|
55
|
-
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
56
|
-
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
57
|
-
return /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
58
|
-
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_summary_action),
|
|
59
|
-
icon: /*#__PURE__*/_react.default.createElement(_aiIcon.default, {
|
|
60
|
-
label: "Summarise with AI"
|
|
61
|
-
}),
|
|
62
|
-
isLoading: status === 'loading',
|
|
63
|
-
onClick: handleActionClick,
|
|
64
|
-
testId: "smart-action-ai-summary-action",
|
|
65
|
-
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.ai_summary_action_description)
|
|
66
|
-
}, props));
|
|
67
|
-
return null;
|
|
29
|
+
return status === 'done' ? /*#__PURE__*/_react.default.createElement(_copySummaryAction.CopySummaryAction, (0, _extends2.default)({}, props, {
|
|
30
|
+
testId: testId,
|
|
31
|
+
content: content
|
|
32
|
+
})) : /*#__PURE__*/_react.default.createElement(_aiSummariseAction.AISummariseAction, (0, _extends2.default)({}, props, {
|
|
33
|
+
testId: testId,
|
|
34
|
+
summariseUrl: summariseUrl,
|
|
35
|
+
status: status
|
|
36
|
+
}));
|
|
68
37
|
};
|
package/dist/cjs/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
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.CopySummaryAction = CopySummaryAction;
|
|
9
|
+
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
|
|
10
|
+
var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
|
|
11
|
+
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
|
|
12
|
+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
|
|
13
|
+
var _objectWithoutProperties2 = _interopRequireDefault(require("@babel/runtime/helpers/objectWithoutProperties"));
|
|
14
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
15
|
+
var _copy = _interopRequireDefault(require("@atlaskit/icon/glyph/copy"));
|
|
16
|
+
var _reactIntlNext = require("react-intl-next");
|
|
17
|
+
var _action = _interopRequireDefault(require("../action"));
|
|
18
|
+
var _messages = require("../../../../../messages");
|
|
19
|
+
var _useAnalyticsEvents2 = require("../../../../../common/analytics/generated/use-analytics-events");
|
|
20
|
+
var _excluded = ["url", "ari", "product", "onClick", "testId", "content"];
|
|
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" != _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; }
|
|
23
|
+
function CopySummaryAction(_ref) {
|
|
24
|
+
var url = _ref.url,
|
|
25
|
+
ari = _ref.ari,
|
|
26
|
+
product = _ref.product,
|
|
27
|
+
onClickCallback = _ref.onClick,
|
|
28
|
+
testId = _ref.testId,
|
|
29
|
+
content = _ref.content,
|
|
30
|
+
props = (0, _objectWithoutProperties2.default)(_ref, _excluded);
|
|
31
|
+
var _useAnalyticsEvents = (0, _useAnalyticsEvents2.useAnalyticsEvents)(),
|
|
32
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
33
|
+
var _useState = (0, _react.useState)(_messages.messages.copy_summary_action),
|
|
34
|
+
_useState2 = (0, _slicedToArray2.default)(_useState, 2),
|
|
35
|
+
tooltipMessage = _useState2[0],
|
|
36
|
+
setTooltipMessage = _useState2[1];
|
|
37
|
+
var handleCopySummaryClick = (0, _react.useCallback)( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
38
|
+
return _regenerator.default.wrap(function _callee$(_context) {
|
|
39
|
+
while (1) switch (_context.prev = _context.next) {
|
|
40
|
+
case 0:
|
|
41
|
+
fireEvent('ui.button.clicked.copySummary', {});
|
|
42
|
+
_context.next = 3;
|
|
43
|
+
return navigator.clipboard.writeText(content !== null && content !== void 0 ? content : '');
|
|
44
|
+
case 3:
|
|
45
|
+
setTooltipMessage(_messages.messages.copied_summary_action_description);
|
|
46
|
+
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
47
|
+
case 5:
|
|
48
|
+
case "end":
|
|
49
|
+
return _context.stop();
|
|
50
|
+
}
|
|
51
|
+
}, _callee);
|
|
52
|
+
})), [fireEvent, onClickCallback, content]);
|
|
53
|
+
return /*#__PURE__*/_react.default.createElement(_action.default, (0, _extends2.default)({
|
|
54
|
+
content: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, _messages.messages.copy_summary_action),
|
|
55
|
+
icon: /*#__PURE__*/_react.default.createElement(_copy.default, {
|
|
56
|
+
label: "Copy Summary"
|
|
57
|
+
}),
|
|
58
|
+
onClick: handleCopySummaryClick,
|
|
59
|
+
testId: "".concat(testId, "-copy-summary-action"),
|
|
60
|
+
tooltipMessage: /*#__PURE__*/_react.default.createElement(_reactIntlNext.FormattedMessage, tooltipMessage)
|
|
61
|
+
}, props));
|
|
62
|
+
}
|
|
@@ -17,7 +17,7 @@ var _excluded = ["href", "children", "checkSafety", "onClick", "testId"],
|
|
|
17
17
|
_excluded2 = ["isLinkSafe", "showSafetyWarningModal"];
|
|
18
18
|
var PACKAGE_DATA = {
|
|
19
19
|
packageName: "@atlaskit/smart-card",
|
|
20
|
-
packageVersion: "26.
|
|
20
|
+
packageVersion: "26.62.0",
|
|
21
21
|
componentName: 'linkUrl'
|
|
22
22
|
};
|
|
23
23
|
var Link = (0, _click.withLinkClickedEvent)('a');
|
package/dist/es2019/messages.js
CHANGED
|
@@ -205,6 +205,21 @@ export const messages = defineMessages({
|
|
|
205
205
|
defaultMessage: 'Summarize the content of this link using Atlassian Intelligence.',
|
|
206
206
|
description: 'Description of what the summarize link with AI action does'
|
|
207
207
|
},
|
|
208
|
+
copy_summary_action: {
|
|
209
|
+
id: 'fabric.linking.copy_summary_action.nonfinal',
|
|
210
|
+
defaultMessage: 'Copy summary',
|
|
211
|
+
description: 'Allow a user to copy a generated summary'
|
|
212
|
+
},
|
|
213
|
+
copy_summary_action_description: {
|
|
214
|
+
id: 'fabric.linking.copy_summary_action.nonfinal',
|
|
215
|
+
defaultMessage: 'Copy summary',
|
|
216
|
+
description: 'Description of what the copy summary AI action does'
|
|
217
|
+
},
|
|
218
|
+
copied_summary_action_description: {
|
|
219
|
+
id: 'fabric.linking.copied_summary_action_description.nonfinal',
|
|
220
|
+
defaultMessage: 'Copied summary to clipboard',
|
|
221
|
+
description: 'Confirmation to the user that the summry has been copied'
|
|
222
|
+
},
|
|
208
223
|
edit: {
|
|
209
224
|
id: 'fabric.linking.edit',
|
|
210
225
|
defaultMessage: 'Edit',
|
|
@@ -4,7 +4,7 @@ export const ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export const context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "26.
|
|
7
|
+
packageVersion: "26.62.0"
|
|
8
8
|
};
|
|
9
9
|
export let TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -17,7 +17,8 @@ const getIconWidth = size => {
|
|
|
17
17
|
const getIconStyles = isDisabled => css({
|
|
18
18
|
color: isDisabled ? "var(--ds-text-disabled, #6B778C)" : "var(--ds-icon, #44546F)"
|
|
19
19
|
});
|
|
20
|
-
const
|
|
20
|
+
const stackItemIconSizeStyles = getIconSizeStyles('20px');
|
|
21
|
+
const stackItemIconStyles = css(stackItemIconSizeStyles, {
|
|
21
22
|
display: 'inline-block',
|
|
22
23
|
lineHeight: 0,
|
|
23
24
|
padding: "var(--ds-space-025, 2px)",
|
|
@@ -30,9 +31,9 @@ const ActionIcon = ({
|
|
|
30
31
|
testId,
|
|
31
32
|
icon,
|
|
32
33
|
isDisabled,
|
|
33
|
-
|
|
34
|
+
asStackItemIcon
|
|
34
35
|
}) => jsx("span", {
|
|
35
|
-
css: [getIconStyles(isDisabled), getIconSizeStyles(getIconWidth(size))
|
|
36
|
+
css: [getIconStyles(isDisabled), asStackItemIcon ? stackItemIconStyles : getIconSizeStyles(getIconWidth(size))],
|
|
36
37
|
"data-testid": `${testId}-icon`
|
|
37
38
|
}, icon);
|
|
38
39
|
export default ActionIcon;
|
|
@@ -57,10 +57,10 @@ const ActionStackItem = ({
|
|
|
57
57
|
}
|
|
58
58
|
}, [isDisabled, isLoading, onClickCallback]);
|
|
59
59
|
const icon = iconOption && isLoading ? /*#__PURE__*/React.createElement(ActionIcon, {
|
|
60
|
+
asStackItemIcon: true,
|
|
60
61
|
icon: /*#__PURE__*/React.createElement(Spinner, {
|
|
61
62
|
testId: `${testId}-loading`
|
|
62
63
|
}),
|
|
63
|
-
showBackground: true,
|
|
64
64
|
size: size
|
|
65
65
|
}) : iconOption;
|
|
66
66
|
|
|
@@ -40,10 +40,10 @@ const Action = ({
|
|
|
40
40
|
const isStackItem = as === 'stack-item';
|
|
41
41
|
const isDropdownItem = as === 'dropdown-item' || asDropDownItem;
|
|
42
42
|
const actionIcon = icon && jsx(ActionIcon, {
|
|
43
|
+
asStackItemIcon: isStackItem,
|
|
43
44
|
isDisabled: isDisabled,
|
|
44
45
|
icon: icon,
|
|
45
46
|
size: size,
|
|
46
|
-
showBackground: isStackItem,
|
|
47
47
|
testId: testId
|
|
48
48
|
});
|
|
49
49
|
const iconBefore = icon && iconPosition === 'before' ? actionIcon : undefined;
|
package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useCallback } from 'react';
|
|
3
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
4
|
+
import Action from '../action';
|
|
5
|
+
import AiIcon from '../../../../common/ai-icon';
|
|
6
|
+
import { messages } from '../../../../../messages';
|
|
7
|
+
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
8
|
+
import { getErrorMessage } from './utils';
|
|
9
|
+
export function AISummariseAction({
|
|
10
|
+
url,
|
|
11
|
+
ari,
|
|
12
|
+
product,
|
|
13
|
+
onClick: onClickCallback,
|
|
14
|
+
onError: onErrorCallback,
|
|
15
|
+
testId,
|
|
16
|
+
status,
|
|
17
|
+
summariseUrl,
|
|
18
|
+
...props
|
|
19
|
+
}) {
|
|
20
|
+
const {
|
|
21
|
+
fireEvent
|
|
22
|
+
} = useAnalyticsEvents();
|
|
23
|
+
const onCompleted = useCallback(state => {
|
|
24
|
+
if ((state === null || state === void 0 ? void 0 : state.status) === 'error') {
|
|
25
|
+
onErrorCallback === null || onErrorCallback === void 0 ? void 0 : onErrorCallback(getErrorMessage(state.error));
|
|
26
|
+
}
|
|
27
|
+
}, [onErrorCallback]);
|
|
28
|
+
const handleActionClick = useCallback(() => {
|
|
29
|
+
var _summariseUrl;
|
|
30
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
31
|
+
fireEvent('track.aiInteraction.initiated', {
|
|
32
|
+
aiFeatureName: 'Smart Links Summary',
|
|
33
|
+
proactiveAIGenerated: 0,
|
|
34
|
+
userGeneratedAI: 1
|
|
35
|
+
});
|
|
36
|
+
(_summariseUrl = summariseUrl()) === null || _summariseUrl === void 0 ? void 0 : _summariseUrl.then(onCompleted, onCompleted);
|
|
37
|
+
onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback();
|
|
38
|
+
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
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: `${testId}-summarise-action`,
|
|
46
|
+
isLoading: status === 'loading',
|
|
47
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action_description)
|
|
48
|
+
}, props));
|
|
49
|
+
}
|
|
@@ -1,27 +1,20 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import React
|
|
3
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
2
|
+
import React from 'react';
|
|
4
3
|
import { di } from 'react-magnetic-di';
|
|
5
|
-
import { messages } from '../../../../../messages';
|
|
6
|
-
import Action from '../action';
|
|
7
|
-
import AiIcon from '../../../../common/ai-icon';
|
|
8
|
-
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
9
4
|
import { useAISummary } from '../../../../../state/hooks/use-ai-summary';
|
|
10
|
-
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
onError: onErrorCallback,
|
|
14
|
-
url = '',
|
|
15
|
-
ari = '',
|
|
16
|
-
product,
|
|
17
|
-
...props
|
|
18
|
-
}) => {
|
|
5
|
+
import { CopySummaryAction } from './copy-summary-action';
|
|
6
|
+
import { AISummariseAction } from './ai-summarise-action';
|
|
7
|
+
export const AISummaryActionComponent = props => {
|
|
19
8
|
const {
|
|
20
|
-
|
|
21
|
-
|
|
9
|
+
url,
|
|
10
|
+
ari,
|
|
11
|
+
product,
|
|
12
|
+
testId = 'smart-action-ai-summary-action'
|
|
13
|
+
} = props;
|
|
22
14
|
const {
|
|
23
15
|
state: {
|
|
24
|
-
status
|
|
16
|
+
status,
|
|
17
|
+
content
|
|
25
18
|
},
|
|
26
19
|
summariseUrl
|
|
27
20
|
} = useAISummary({
|
|
@@ -29,31 +22,12 @@ export const AISummaryActionComponent = ({
|
|
|
29
22
|
ari,
|
|
30
23
|
product
|
|
31
24
|
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
fireEvent('track.aiInteraction.initiated', {
|
|
41
|
-
aiFeatureName: 'Smart Links Summary',
|
|
42
|
-
proactiveAIGenerated: 0,
|
|
43
|
-
userGeneratedAI: 1
|
|
44
|
-
});
|
|
45
|
-
(_summariseUrl = summariseUrl()) === null || _summariseUrl === void 0 ? void 0 : _summariseUrl.then(onCompleted, onCompleted);
|
|
46
|
-
onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback();
|
|
47
|
-
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
48
|
-
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
49
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
|
|
50
|
-
icon: /*#__PURE__*/React.createElement(AiIcon, {
|
|
51
|
-
label: "Summarise with AI"
|
|
52
|
-
}),
|
|
53
|
-
isLoading: status === 'loading',
|
|
54
|
-
onClick: handleActionClick,
|
|
55
|
-
testId: "smart-action-ai-summary-action",
|
|
56
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action_description)
|
|
57
|
-
}, props));
|
|
58
|
-
return null;
|
|
25
|
+
return status === 'done' ? /*#__PURE__*/React.createElement(CopySummaryAction, _extends({}, props, {
|
|
26
|
+
testId: testId,
|
|
27
|
+
content: content
|
|
28
|
+
})) : /*#__PURE__*/React.createElement(AISummariseAction, _extends({}, props, {
|
|
29
|
+
testId: testId,
|
|
30
|
+
summariseUrl: summariseUrl,
|
|
31
|
+
status: status
|
|
32
|
+
}));
|
|
59
33
|
};
|
package/dist/es2019/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import React, { useCallback, useState } from 'react';
|
|
3
|
+
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
4
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
5
|
+
import Action from '../action';
|
|
6
|
+
import { messages } from '../../../../../messages';
|
|
7
|
+
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
8
|
+
export function CopySummaryAction({
|
|
9
|
+
url,
|
|
10
|
+
ari,
|
|
11
|
+
product,
|
|
12
|
+
onClick: onClickCallback,
|
|
13
|
+
testId,
|
|
14
|
+
content,
|
|
15
|
+
...props
|
|
16
|
+
}) {
|
|
17
|
+
const {
|
|
18
|
+
fireEvent
|
|
19
|
+
} = useAnalyticsEvents();
|
|
20
|
+
const [tooltipMessage, setTooltipMessage] = useState(messages.copy_summary_action);
|
|
21
|
+
const handleCopySummaryClick = useCallback(async () => {
|
|
22
|
+
fireEvent('ui.button.clicked.copySummary', {});
|
|
23
|
+
await navigator.clipboard.writeText(content !== null && content !== void 0 ? content : '');
|
|
24
|
+
setTooltipMessage(messages.copied_summary_action_description);
|
|
25
|
+
onClickCallback === null || onClickCallback === void 0 ? void 0 : onClickCallback();
|
|
26
|
+
}, [fireEvent, onClickCallback, content]);
|
|
27
|
+
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
28
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_summary_action),
|
|
29
|
+
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
30
|
+
label: "Copy Summary"
|
|
31
|
+
}),
|
|
32
|
+
onClick: handleCopySummaryClick,
|
|
33
|
+
testId: `${testId}-copy-summary-action`,
|
|
34
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
35
|
+
}, props));
|
|
36
|
+
}
|
|
@@ -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.62.0",
|
|
11
11
|
componentName: 'linkUrl'
|
|
12
12
|
};
|
|
13
13
|
const Link = withLinkClickedEvent('a');
|
package/dist/esm/messages.js
CHANGED
|
@@ -205,6 +205,21 @@ export var messages = defineMessages({
|
|
|
205
205
|
defaultMessage: 'Summarize the content of this link using Atlassian Intelligence.',
|
|
206
206
|
description: 'Description of what the summarize link with AI action does'
|
|
207
207
|
},
|
|
208
|
+
copy_summary_action: {
|
|
209
|
+
id: 'fabric.linking.copy_summary_action.nonfinal',
|
|
210
|
+
defaultMessage: 'Copy summary',
|
|
211
|
+
description: 'Allow a user to copy a generated summary'
|
|
212
|
+
},
|
|
213
|
+
copy_summary_action_description: {
|
|
214
|
+
id: 'fabric.linking.copy_summary_action.nonfinal',
|
|
215
|
+
defaultMessage: 'Copy summary',
|
|
216
|
+
description: 'Description of what the copy summary AI action does'
|
|
217
|
+
},
|
|
218
|
+
copied_summary_action_description: {
|
|
219
|
+
id: 'fabric.linking.copied_summary_action_description.nonfinal',
|
|
220
|
+
defaultMessage: 'Copied summary to clipboard',
|
|
221
|
+
description: 'Confirmation to the user that the summry has been copied'
|
|
222
|
+
},
|
|
208
223
|
edit: {
|
|
209
224
|
id: 'fabric.linking.edit',
|
|
210
225
|
defaultMessage: 'Edit',
|
|
@@ -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.62.0"
|
|
19
19
|
};
|
|
20
20
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
21
21
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -19,7 +19,8 @@ var getIconStyles = function getIconStyles(isDisabled) {
|
|
|
19
19
|
color: isDisabled ? "var(--ds-text-disabled, #6B778C)" : "var(--ds-icon, #44546F)"
|
|
20
20
|
});
|
|
21
21
|
};
|
|
22
|
-
var
|
|
22
|
+
var stackItemIconSizeStyles = getIconSizeStyles('20px');
|
|
23
|
+
var stackItemIconStyles = css(stackItemIconSizeStyles, {
|
|
23
24
|
display: 'inline-block',
|
|
24
25
|
lineHeight: 0,
|
|
25
26
|
padding: "var(--ds-space-025, 2px)",
|
|
@@ -32,9 +33,9 @@ var ActionIcon = function ActionIcon(_ref) {
|
|
|
32
33
|
testId = _ref.testId,
|
|
33
34
|
icon = _ref.icon,
|
|
34
35
|
isDisabled = _ref.isDisabled,
|
|
35
|
-
|
|
36
|
+
asStackItemIcon = _ref.asStackItemIcon;
|
|
36
37
|
return jsx("span", {
|
|
37
|
-
css: [getIconStyles(isDisabled), getIconSizeStyles(getIconWidth(size))
|
|
38
|
+
css: [getIconStyles(isDisabled), asStackItemIcon ? stackItemIconStyles : getIconSizeStyles(getIconWidth(size))],
|
|
38
39
|
"data-testid": "".concat(testId, "-icon")
|
|
39
40
|
}, icon);
|
|
40
41
|
};
|
|
@@ -56,10 +56,10 @@ var ActionStackItem = function ActionStackItem(_ref) {
|
|
|
56
56
|
}
|
|
57
57
|
}, [isDisabled, isLoading, onClickCallback]);
|
|
58
58
|
var icon = iconOption && isLoading ? /*#__PURE__*/React.createElement(ActionIcon, {
|
|
59
|
+
asStackItemIcon: true,
|
|
59
60
|
icon: /*#__PURE__*/React.createElement(Spinner, {
|
|
60
61
|
testId: "".concat(testId, "-loading")
|
|
61
62
|
}),
|
|
62
|
-
showBackground: true,
|
|
63
63
|
size: size
|
|
64
64
|
}) : iconOption;
|
|
65
65
|
|
|
@@ -44,10 +44,10 @@ var Action = function Action(_ref) {
|
|
|
44
44
|
var isStackItem = as === 'stack-item';
|
|
45
45
|
var isDropdownItem = as === 'dropdown-item' || asDropDownItem;
|
|
46
46
|
var actionIcon = icon && jsx(ActionIcon, {
|
|
47
|
+
asStackItemIcon: isStackItem,
|
|
47
48
|
isDisabled: isDisabled,
|
|
48
49
|
icon: icon,
|
|
49
50
|
size: size,
|
|
50
|
-
showBackground: isStackItem,
|
|
51
51
|
testId: testId
|
|
52
52
|
});
|
|
53
53
|
var iconBefore = icon && iconPosition === 'before' ? actionIcon : undefined;
|
package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.js
ADDED
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
+
var _excluded = ["url", "ari", "product", "onClick", "onError", "testId", "status", "summariseUrl"];
|
|
4
|
+
import React, { useCallback } from 'react';
|
|
5
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
6
|
+
import Action from '../action';
|
|
7
|
+
import AiIcon from '../../../../common/ai-icon';
|
|
8
|
+
import { messages } from '../../../../../messages';
|
|
9
|
+
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
10
|
+
import { getErrorMessage } from './utils';
|
|
11
|
+
export function AISummariseAction(_ref) {
|
|
12
|
+
var url = _ref.url,
|
|
13
|
+
ari = _ref.ari,
|
|
14
|
+
product = _ref.product,
|
|
15
|
+
onClickCallback = _ref.onClick,
|
|
16
|
+
onErrorCallback = _ref.onError,
|
|
17
|
+
testId = _ref.testId,
|
|
18
|
+
status = _ref.status,
|
|
19
|
+
summariseUrl = _ref.summariseUrl,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
22
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
23
|
+
var onCompleted = useCallback(function (state) {
|
|
24
|
+
if ((state === null || state === void 0 ? void 0 : state.status) === 'error') {
|
|
25
|
+
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback(getErrorMessage(state.error));
|
|
26
|
+
}
|
|
27
|
+
}, [onErrorCallback]);
|
|
28
|
+
var handleActionClick = useCallback(function () {
|
|
29
|
+
var _summariseUrl;
|
|
30
|
+
fireEvent('ui.button.clicked.aiSummary', {});
|
|
31
|
+
fireEvent('track.aiInteraction.initiated', {
|
|
32
|
+
aiFeatureName: 'Smart Links Summary',
|
|
33
|
+
proactiveAIGenerated: 0,
|
|
34
|
+
userGeneratedAI: 1
|
|
35
|
+
});
|
|
36
|
+
(_summariseUrl = summariseUrl()) === null || _summariseUrl === void 0 || _summariseUrl.then(onCompleted, onCompleted);
|
|
37
|
+
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
38
|
+
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
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: "".concat(testId, "-summarise-action"),
|
|
46
|
+
isLoading: status === 'loading',
|
|
47
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action_description)
|
|
48
|
+
}, props));
|
|
49
|
+
}
|
|
@@ -1,58 +1,30 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
-
import
|
|
3
|
-
var _excluded = ["onClick", "onError", "url", "ari", "product"];
|
|
4
|
-
import React, { useCallback } from 'react';
|
|
5
|
-
import { FormattedMessage } from 'react-intl-next';
|
|
2
|
+
import React from 'react';
|
|
6
3
|
import { di } from 'react-magnetic-di';
|
|
7
|
-
import { messages } from '../../../../../messages';
|
|
8
|
-
import Action from '../action';
|
|
9
|
-
import AiIcon from '../../../../common/ai-icon';
|
|
10
|
-
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
11
4
|
import { useAISummary } from '../../../../../state/hooks/use-ai-summary';
|
|
12
|
-
import {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
product = _ref.product,
|
|
21
|
-
props = _objectWithoutProperties(_ref, _excluded);
|
|
22
|
-
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
23
|
-
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
5
|
+
import { CopySummaryAction } from './copy-summary-action';
|
|
6
|
+
import { AISummariseAction } from './ai-summarise-action';
|
|
7
|
+
export var AISummaryActionComponent = function AISummaryActionComponent(props) {
|
|
8
|
+
var url = props.url,
|
|
9
|
+
ari = props.ari,
|
|
10
|
+
product = props.product,
|
|
11
|
+
_props$testId = props.testId,
|
|
12
|
+
testId = _props$testId === void 0 ? 'smart-action-ai-summary-action' : _props$testId;
|
|
24
13
|
var _useAISummary = useAISummary({
|
|
25
14
|
url: url,
|
|
26
15
|
ari: ari,
|
|
27
16
|
product: product
|
|
28
17
|
}),
|
|
29
|
-
|
|
18
|
+
_useAISummary$state = _useAISummary.state,
|
|
19
|
+
status = _useAISummary$state.status,
|
|
20
|
+
content = _useAISummary$state.content,
|
|
30
21
|
summariseUrl = _useAISummary.summariseUrl;
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
fireEvent('track.aiInteraction.initiated', {
|
|
40
|
-
aiFeatureName: 'Smart Links Summary',
|
|
41
|
-
proactiveAIGenerated: 0,
|
|
42
|
-
userGeneratedAI: 1
|
|
43
|
-
});
|
|
44
|
-
(_summariseUrl = summariseUrl()) === null || _summariseUrl === void 0 || _summariseUrl.then(onCompleted, onCompleted);
|
|
45
|
-
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
46
|
-
}, [fireEvent, onClickCallback, onCompleted, summariseUrl]);
|
|
47
|
-
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
48
|
-
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action),
|
|
49
|
-
icon: /*#__PURE__*/React.createElement(AiIcon, {
|
|
50
|
-
label: "Summarise with AI"
|
|
51
|
-
}),
|
|
52
|
-
isLoading: status === 'loading',
|
|
53
|
-
onClick: handleActionClick,
|
|
54
|
-
testId: "smart-action-ai-summary-action",
|
|
55
|
-
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, messages.ai_summary_action_description)
|
|
56
|
-
}, props));
|
|
57
|
-
return null;
|
|
22
|
+
return status === 'done' ? /*#__PURE__*/React.createElement(CopySummaryAction, _extends({}, props, {
|
|
23
|
+
testId: testId,
|
|
24
|
+
content: content
|
|
25
|
+
})) : /*#__PURE__*/React.createElement(AISummariseAction, _extends({}, props, {
|
|
26
|
+
testId: testId,
|
|
27
|
+
summariseUrl: summariseUrl,
|
|
28
|
+
status: status
|
|
29
|
+
}));
|
|
58
30
|
};
|
package/dist/esm/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.js
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
|
+
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
+
var _excluded = ["url", "ari", "product", "onClick", "testId", "content"];
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
import React, { useCallback, useState } from 'react';
|
|
8
|
+
import CopyIcon from '@atlaskit/icon/glyph/copy';
|
|
9
|
+
import { FormattedMessage } from 'react-intl-next';
|
|
10
|
+
import Action from '../action';
|
|
11
|
+
import { messages } from '../../../../../messages';
|
|
12
|
+
import { useAnalyticsEvents } from '../../../../../common/analytics/generated/use-analytics-events';
|
|
13
|
+
export function CopySummaryAction(_ref) {
|
|
14
|
+
var url = _ref.url,
|
|
15
|
+
ari = _ref.ari,
|
|
16
|
+
product = _ref.product,
|
|
17
|
+
onClickCallback = _ref.onClick,
|
|
18
|
+
testId = _ref.testId,
|
|
19
|
+
content = _ref.content,
|
|
20
|
+
props = _objectWithoutProperties(_ref, _excluded);
|
|
21
|
+
var _useAnalyticsEvents = useAnalyticsEvents(),
|
|
22
|
+
fireEvent = _useAnalyticsEvents.fireEvent;
|
|
23
|
+
var _useState = useState(messages.copy_summary_action),
|
|
24
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
25
|
+
tooltipMessage = _useState2[0],
|
|
26
|
+
setTooltipMessage = _useState2[1];
|
|
27
|
+
var handleCopySummaryClick = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
28
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
29
|
+
while (1) switch (_context.prev = _context.next) {
|
|
30
|
+
case 0:
|
|
31
|
+
fireEvent('ui.button.clicked.copySummary', {});
|
|
32
|
+
_context.next = 3;
|
|
33
|
+
return navigator.clipboard.writeText(content !== null && content !== void 0 ? content : '');
|
|
34
|
+
case 3:
|
|
35
|
+
setTooltipMessage(messages.copied_summary_action_description);
|
|
36
|
+
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
37
|
+
case 5:
|
|
38
|
+
case "end":
|
|
39
|
+
return _context.stop();
|
|
40
|
+
}
|
|
41
|
+
}, _callee);
|
|
42
|
+
})), [fireEvent, onClickCallback, content]);
|
|
43
|
+
return /*#__PURE__*/React.createElement(Action, _extends({
|
|
44
|
+
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_summary_action),
|
|
45
|
+
icon: /*#__PURE__*/React.createElement(CopyIcon, {
|
|
46
|
+
label: "Copy Summary"
|
|
47
|
+
}),
|
|
48
|
+
onClick: handleCopySummaryClick,
|
|
49
|
+
testId: "".concat(testId, "-copy-summary-action"),
|
|
50
|
+
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
51
|
+
}, props));
|
|
52
|
+
}
|
|
@@ -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.62.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::334c6c6965226785c649b8d6b292227c>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataType = {
|
|
@@ -25,6 +25,7 @@ export type ResolvedAttributesType = {
|
|
|
25
25
|
canBeDatasource: boolean | null;
|
|
26
26
|
};
|
|
27
27
|
export type ButtonClickedAiSummaryAttributesType = {};
|
|
28
|
+
export type ButtonClickedCopySummaryAttributesType = {};
|
|
28
29
|
export type SummaryViewedAttributesType = {
|
|
29
30
|
fromCache: boolean | null;
|
|
30
31
|
};
|
|
@@ -42,6 +43,9 @@ export type AnalyticsEventAttributes = {
|
|
|
42
43
|
/**
|
|
43
44
|
* fired when an ai summary is clicked */
|
|
44
45
|
'ui.button.clicked.aiSummary': ButtonClickedAiSummaryAttributesType;
|
|
46
|
+
/**
|
|
47
|
+
* fired when the copy ai summary button is clicked */
|
|
48
|
+
'ui.button.clicked.copySummary': ButtonClickedCopySummaryAttributesType;
|
|
45
49
|
/**
|
|
46
50
|
* fired when a summary is viewed */
|
|
47
51
|
'ui.summary.viewed': SummaryViewedAttributesType;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MessageDescriptor } from 'react-intl-next';
|
|
1
|
+
import { type 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' | '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';
|
|
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' | 'copy_summary_action' | 'copy_summary_action_description' | 'copied_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,9 @@
|
|
|
1
1
|
import type { ReactChild } from 'react';
|
|
2
2
|
import type { SmartLinkSize } from '../../../../../../constants';
|
|
3
3
|
export type ActionIconProps = {
|
|
4
|
+
asStackItemIcon?: boolean;
|
|
4
5
|
size?: SmartLinkSize;
|
|
5
6
|
icon?: ReactChild;
|
|
6
7
|
isDisabled?: boolean;
|
|
7
|
-
showBackground?: boolean;
|
|
8
8
|
testId?: string;
|
|
9
9
|
};
|
package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/ai-summarise-action.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { AISummaryState, AISummaryStatus } from '../../../../../state/hooks/use-ai-summary/ai-summary-service/types';
|
|
3
|
+
import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
|
|
4
|
+
import type { AISummaryActionProps } from './types';
|
|
5
|
+
export declare function AISummariseAction({ url, ari, product, onClick: onClickCallback, onError: onErrorCallback, testId, status, summariseUrl, ...props }: AISummaryActionProps & AISummaryActionData & {
|
|
6
|
+
status: AISummaryStatus;
|
|
7
|
+
summariseUrl: () => Promise<AISummaryState> | undefined;
|
|
8
|
+
}): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export declare const AISummaryActionComponent: (
|
|
2
|
+
import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
|
|
3
|
+
import type { AISummaryActionProps } from './types';
|
|
4
|
+
export declare const AISummaryActionComponent: (props: AISummaryActionProps & AISummaryActionData) => JSX.Element;
|
package/dist/types/view/FlexibleCard/components/actions/ai-summary-action/copy-summary-action.d.ts
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
|
|
3
|
+
import type { AISummaryActionProps } from './types';
|
|
4
|
+
export declare function CopySummaryAction({ url, ari, product, onClick: onClickCallback, testId, content, ...props }: AISummaryActionProps & AISummaryActionData & {
|
|
5
|
+
content: string;
|
|
6
|
+
}): JSX.Element;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Generates Typescript types for analytics events from analytics.spec.yaml
|
|
5
5
|
*
|
|
6
|
-
* @codegen <<SignedSource::
|
|
6
|
+
* @codegen <<SignedSource::334c6c6965226785c649b8d6b292227c>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataType = {
|
|
@@ -25,6 +25,7 @@ export type ResolvedAttributesType = {
|
|
|
25
25
|
canBeDatasource: boolean | null;
|
|
26
26
|
};
|
|
27
27
|
export type ButtonClickedAiSummaryAttributesType = {};
|
|
28
|
+
export type ButtonClickedCopySummaryAttributesType = {};
|
|
28
29
|
export type SummaryViewedAttributesType = {
|
|
29
30
|
fromCache: boolean | null;
|
|
30
31
|
};
|
|
@@ -42,6 +43,9 @@ export type AnalyticsEventAttributes = {
|
|
|
42
43
|
/**
|
|
43
44
|
* fired when an ai summary is clicked */
|
|
44
45
|
'ui.button.clicked.aiSummary': ButtonClickedAiSummaryAttributesType;
|
|
46
|
+
/**
|
|
47
|
+
* fired when the copy ai summary button is clicked */
|
|
48
|
+
'ui.button.clicked.copySummary': ButtonClickedCopySummaryAttributesType;
|
|
45
49
|
/**
|
|
46
50
|
* fired when a summary is viewed */
|
|
47
51
|
'ui.summary.viewed': SummaryViewedAttributesType;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { MessageDescriptor } from 'react-intl-next';
|
|
1
|
+
import { type 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' | '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';
|
|
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' | 'copy_summary_action' | 'copy_summary_action_description' | 'copied_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,9 @@
|
|
|
1
1
|
import type { ReactChild } from 'react';
|
|
2
2
|
import type { SmartLinkSize } from '../../../../../../constants';
|
|
3
3
|
export type ActionIconProps = {
|
|
4
|
+
asStackItemIcon?: boolean;
|
|
4
5
|
size?: SmartLinkSize;
|
|
5
6
|
icon?: ReactChild;
|
|
6
7
|
isDisabled?: boolean;
|
|
7
|
-
showBackground?: boolean;
|
|
8
8
|
testId?: string;
|
|
9
9
|
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { AISummaryState, AISummaryStatus } from '../../../../../state/hooks/use-ai-summary/ai-summary-service/types';
|
|
3
|
+
import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
|
|
4
|
+
import type { AISummaryActionProps } from './types';
|
|
5
|
+
export declare function AISummariseAction({ url, ari, product, onClick: onClickCallback, onError: onErrorCallback, testId, status, summariseUrl, ...props }: AISummaryActionProps & AISummaryActionData & {
|
|
6
|
+
status: AISummaryStatus;
|
|
7
|
+
summariseUrl: () => Promise<AISummaryState> | undefined;
|
|
8
|
+
}): JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export declare const AISummaryActionComponent: (
|
|
2
|
+
import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
|
|
3
|
+
import type { AISummaryActionProps } from './types';
|
|
4
|
+
export declare const AISummaryActionComponent: (props: AISummaryActionProps & AISummaryActionData) => JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { AISummaryActionData } from '../../../../../state/flexible-ui-context/types';
|
|
3
|
+
import type { AISummaryActionProps } from './types';
|
|
4
|
+
export declare function CopySummaryAction({ url, ari, product, onClick: onClickCallback, testId, content, ...props }: AISummaryActionProps & AISummaryActionData & {
|
|
5
|
+
content: string;
|
|
6
|
+
}): JSX.Element;
|