@atlaskit/smart-card 26.65.0 → 26.67.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 +23 -0
- package/CONTRIBUTING.md +3 -0
- package/dist/cjs/constants.js +1 -0
- package/dist/cjs/extractors/flexible/actions/extract-automation-action.js +53 -0
- package/dist/cjs/extractors/flexible/actions/index.js +2 -1
- package/dist/cjs/messages.js +50 -0
- package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
- package/dist/cjs/state/hooks/use-ai-summary/index.js +3 -2
- package/dist/cjs/utils/ai-summary.js +4 -0
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/Card/types.js +1 -0
- package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +7 -5
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +56 -0
- package/dist/cjs/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.js +31 -0
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +29 -9
- package/dist/cjs/view/FlexibleCard/components/actions/follow-action/utils.js +24 -0
- package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -1
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +10 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/constants.js +1 -0
- package/dist/es2019/extractors/flexible/actions/extract-automation-action.js +48 -0
- package/dist/es2019/extractors/flexible/actions/index.js +2 -0
- package/dist/es2019/messages.js +50 -0
- package/dist/es2019/state/flexible-ui-context/types.js +3 -1
- package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
- package/dist/es2019/state/hooks/use-ai-summary/index.js +3 -2
- package/dist/es2019/utils/ai-summary.js +4 -0
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/Card/types.js +1 -0
- package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +3 -1
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +41 -0
- package/dist/es2019/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.js +23 -0
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +29 -6
- package/dist/es2019/view/FlexibleCard/components/actions/follow-action/utils.js +16 -0
- package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +10 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/constants.js +1 -0
- package/dist/esm/extractors/flexible/actions/extract-automation-action.js +46 -0
- package/dist/esm/extractors/flexible/actions/index.js +2 -1
- package/dist/esm/messages.js +50 -0
- package/dist/esm/state/flexible-ui-context/types.js +3 -1
- package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
- package/dist/esm/state/hooks/use-ai-summary/index.js +3 -2
- package/dist/esm/utils/ai-summary.js +4 -0
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/Card/types.js +1 -0
- package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +7 -5
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +46 -0
- package/dist/esm/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.js +24 -0
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +29 -9
- package/dist/esm/view/FlexibleCard/components/actions/follow-action/utils.js +18 -0
- package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +10 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/constants.d.ts +1 -0
- package/dist/types/extractors/flexible/actions/extract-automation-action.d.ts +3 -0
- package/dist/types/extractors/flexible/actions/index.d.ts +1 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +12 -0
- package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +1 -1
- package/dist/types/view/Card/types.d.ts +2 -1
- package/dist/types/view/FlexibleCard/components/actions/action/server-action/index.d.ts +3 -3
- package/dist/types/view/FlexibleCard/components/actions/action/server-action/types.d.ts +4 -3
- package/dist/types/view/FlexibleCard/components/actions/automation-action/index.d.ts +4 -0
- package/dist/types/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.d.ts +5 -0
- package/dist/types/view/FlexibleCard/components/actions/follow-action/index.d.ts +3 -3
- package/dist/types/view/FlexibleCard/components/actions/follow-action/utils.d.ts +2 -0
- package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -1
- package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +5 -5
- package/dist/types-ts4.5/constants.d.ts +1 -0
- package/dist/types-ts4.5/extractors/flexible/actions/extract-automation-action.d.ts +3 -0
- package/dist/types-ts4.5/extractors/flexible/actions/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 +12 -0
- package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +2 -1
- package/dist/types-ts4.5/view/Card/types.d.ts +2 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/server-action/index.d.ts +3 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/server-action/types.d.ts +4 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/index.d.ts +4 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.d.ts +5 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/index.d.ts +3 -3
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/utils.d.ts +2 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -1
- package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +5 -5
- package/package.json +9 -3
|
@@ -2,7 +2,7 @@ import _extends from "@babel/runtime/helpers/extends";
|
|
|
2
2
|
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
3
|
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
4
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
5
|
-
var _excluded = ["action", "onClick"];
|
|
5
|
+
var _excluded = ["action", "onClick", "onError"];
|
|
6
6
|
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
7
|
import React, { useCallback, useState } from 'react';
|
|
8
8
|
import useInvoke from '../../../../../../state/hooks/use-invoke';
|
|
@@ -14,6 +14,7 @@ import { useFlexibleUiAnalyticsContext } from '../../../../../../state/flexible-
|
|
|
14
14
|
var ServerAction = function ServerAction(_ref) {
|
|
15
15
|
var action = _ref.action,
|
|
16
16
|
onClick = _ref.onClick,
|
|
17
|
+
onErrorCallback = _ref.onError,
|
|
17
18
|
props = _objectWithoutProperties(_ref, _excluded);
|
|
18
19
|
var _useState = useState(false),
|
|
19
20
|
_useState2 = _slicedToArray(_useState, 2),
|
|
@@ -28,7 +29,7 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
28
29
|
while (1) switch (_context.prev = _context.next) {
|
|
29
30
|
case 0:
|
|
30
31
|
if (!action) {
|
|
31
|
-
_context.next =
|
|
32
|
+
_context.next = 22;
|
|
32
33
|
break;
|
|
33
34
|
}
|
|
34
35
|
smartLinkActionType = (_action$action = action.action) === null || _action$action === void 0 ? void 0 : _action$action.actionType;
|
|
@@ -58,7 +59,7 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
58
59
|
if (onClick) {
|
|
59
60
|
onClick();
|
|
60
61
|
}
|
|
61
|
-
_context.next =
|
|
62
|
+
_context.next = 22;
|
|
62
63
|
break;
|
|
63
64
|
case 17:
|
|
64
65
|
_context.prev = 17;
|
|
@@ -68,12 +69,13 @@ var ServerAction = function ServerAction(_ref) {
|
|
|
68
69
|
smartLinkActionType: smartLinkActionType,
|
|
69
70
|
reason: getInvokeFailureReason(_context.t0)
|
|
70
71
|
});
|
|
71
|
-
|
|
72
|
+
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback();
|
|
73
|
+
case 22:
|
|
72
74
|
case "end":
|
|
73
75
|
return _context.stop();
|
|
74
76
|
}
|
|
75
77
|
}, _callee, null, [[2, 17]]);
|
|
76
|
-
})), [action, analytics === null || analytics === void 0 ? void 0 : analytics.track, analytics === null || analytics === void 0 ? void 0 : analytics.ui, invoke, onClick, reload]);
|
|
78
|
+
})), [action, analytics === null || analytics === void 0 ? void 0 : analytics.track, analytics === null || analytics === void 0 ? void 0 : analytics.ui, invoke, onClick, onErrorCallback, reload]);
|
|
77
79
|
return /*#__PURE__*/React.createElement(Action, _extends({}, props, {
|
|
78
80
|
isLoading: isLoading,
|
|
79
81
|
onClick: handleClick
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
3
|
+
import React, { useState } from 'react';
|
|
4
|
+
import { FormattedMessage, useIntl } from 'react-intl-next';
|
|
5
|
+
import AutomationManualTriggersGlyph from './manaul-triggers-icon';
|
|
6
|
+
import Action from '../action';
|
|
7
|
+
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
8
|
+
import { ActionName } from '../../../../../constants';
|
|
9
|
+
import { messages } from '../../../../../messages';
|
|
10
|
+
// import { useSmartLinkContext } from '../../../../../../../link-provider/src';
|
|
11
|
+
|
|
12
|
+
var handleAutomateActionClick = function handleAutomateActionClick(setIsModalOpen) {
|
|
13
|
+
setIsModalOpen(true);
|
|
14
|
+
};
|
|
15
|
+
var AutomationAction = function AutomationAction(props) {
|
|
16
|
+
var _context$actions;
|
|
17
|
+
var _useState = useState(false),
|
|
18
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
19
|
+
_isModalOpen = _useState2[0],
|
|
20
|
+
setIsModalOpen = _useState2[1];
|
|
21
|
+
var _useIntl = useIntl(),
|
|
22
|
+
formatMessage = _useIntl.formatMessage;
|
|
23
|
+
// const { connections } = useSmartLinkContext();
|
|
24
|
+
|
|
25
|
+
// const env = connections.client.envKey ?? 'prod';
|
|
26
|
+
var context = useFlexibleUiContext();
|
|
27
|
+
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.AutomationAction];
|
|
28
|
+
if (!data) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
var automationActionTitle = /*#__PURE__*/React.createElement(FormattedMessage, messages.automation_action_title);
|
|
32
|
+
var automationActionTooltip = /*#__PURE__*/React.createElement(FormattedMessage, messages.automation_action_tooltip);
|
|
33
|
+
var automationActionIconLabel = formatMessage(messages.automation_action_icon_label);
|
|
34
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Action, _extends({}, data, props, {
|
|
35
|
+
content: automationActionTitle,
|
|
36
|
+
icon: /*#__PURE__*/React.createElement(AutomationManualTriggersGlyph, {
|
|
37
|
+
label: automationActionIconLabel
|
|
38
|
+
}),
|
|
39
|
+
onClick: function onClick() {
|
|
40
|
+
return handleAutomateActionClick(setIsModalOpen);
|
|
41
|
+
},
|
|
42
|
+
testId: "smart-action-automation-action",
|
|
43
|
+
tooltipMessage: automationActionTooltip
|
|
44
|
+
})));
|
|
45
|
+
};
|
|
46
|
+
export default AutomationAction;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
var AutomationManualTriggersGlyph = function AutomationManualTriggersGlyph(_ref) {
|
|
3
|
+
var label = _ref.label;
|
|
4
|
+
return /*#__PURE__*/React.createElement("svg", {
|
|
5
|
+
"aria-label": label,
|
|
6
|
+
width: "24",
|
|
7
|
+
height: "24",
|
|
8
|
+
viewBox: "0 0 24 24",
|
|
9
|
+
fill: "none",
|
|
10
|
+
xmlns: "http://www.w3.org/2000/svg"
|
|
11
|
+
}, /*#__PURE__*/React.createElement("path", {
|
|
12
|
+
d: "M14 5L10 19",
|
|
13
|
+
stroke: "currentColor",
|
|
14
|
+
strokeWidth: "2",
|
|
15
|
+
strokeLinecap: "round"
|
|
16
|
+
}), /*#__PURE__*/React.createElement("path", {
|
|
17
|
+
d: "M14 5L7 12H17L10 19",
|
|
18
|
+
stroke: "currentColor",
|
|
19
|
+
strokeWidth: "2",
|
|
20
|
+
strokeLinecap: "round",
|
|
21
|
+
strokeLinejoin: "round"
|
|
22
|
+
}));
|
|
23
|
+
};
|
|
24
|
+
export default AutomationManualTriggersGlyph;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
2
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
|
-
var _excluded = ["value"];
|
|
3
|
+
var _excluded = ["value", "isProject"];
|
|
4
4
|
import InviteTeamIcon from '@atlaskit/icon/glyph/invite-team';
|
|
5
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
5
6
|
import React from 'react';
|
|
6
7
|
import { FormattedMessage } from 'react-intl-next';
|
|
7
8
|
import { ActionName } from '../../../../../constants';
|
|
@@ -10,6 +11,7 @@ import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
|
10
11
|
import ServerAction from '../action/server-action';
|
|
11
12
|
import UnfollowIcon from './unfollow-icon';
|
|
12
13
|
import { importIcon } from '../../utils';
|
|
14
|
+
import { getFollowActionErrorMessage } from './utils';
|
|
13
15
|
var importIconMapper = {
|
|
14
16
|
goal: function goal() {
|
|
15
17
|
return import( /* webpackChunkName: "glyphGoal" */'./goal-icon').then(function (_ref) {
|
|
@@ -35,17 +37,25 @@ var getIcon = function getIcon(stackIconType) {
|
|
|
35
37
|
}
|
|
36
38
|
return importIcon(importFn);
|
|
37
39
|
};
|
|
40
|
+
var getIconFF = function getIconFF(iconFFEnabled, defaultIcon) {
|
|
41
|
+
if (getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign')) {
|
|
42
|
+
if (getBooleanFF('platform.linking-platform.smart-card.action-icon-redesign')) {
|
|
43
|
+
return iconFFEnabled;
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return defaultIcon;
|
|
47
|
+
};
|
|
38
48
|
var FollowAction = function FollowAction(props) {
|
|
39
|
-
var _context$actions
|
|
49
|
+
var _context$actions;
|
|
40
50
|
var context = useFlexibleUiContext();
|
|
41
|
-
|
|
51
|
+
var actionData = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[ActionName.FollowAction];
|
|
52
|
+
if (!context || !actionData) {
|
|
42
53
|
return null;
|
|
43
54
|
}
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
data = _objectWithoutProperties(
|
|
55
|
+
var value = actionData.value,
|
|
56
|
+
isProject = actionData.isProject,
|
|
57
|
+
data = _objectWithoutProperties(actionData, _excluded);
|
|
47
58
|
var isStackItem = props.as === 'stack-item';
|
|
48
|
-
var isProject = data.isProject;
|
|
49
59
|
var message = value ? messages.follow : messages.unfollow;
|
|
50
60
|
var projectMessage = value ? messages.follow_project : messages.unfollow_project;
|
|
51
61
|
var goalMessage = value ? messages.follow_goal : messages.unfollow_goal;
|
|
@@ -66,12 +76,22 @@ var FollowAction = function FollowAction(props) {
|
|
|
66
76
|
label: "Follow",
|
|
67
77
|
testId: "smart-action-follow-action-".concat(stackIconType, "-icon")
|
|
68
78
|
});
|
|
69
|
-
var followIcon = isStackItem ? stackIcon : icon;
|
|
79
|
+
var followIcon = isStackItem ? stackIcon : getIconFF(stackIcon, icon);
|
|
80
|
+
var handleError = function handleError() {
|
|
81
|
+
var onErrorCallback = props.onError;
|
|
82
|
+
var errorMessage = getFollowActionErrorMessage(isProject, value);
|
|
83
|
+
onErrorCallback === null || onErrorCallback === void 0 || onErrorCallback({
|
|
84
|
+
title: /*#__PURE__*/React.createElement(FormattedMessage, errorMessage),
|
|
85
|
+
appearance: 'error'
|
|
86
|
+
});
|
|
87
|
+
};
|
|
70
88
|
return /*#__PURE__*/React.createElement(ServerAction, _extends({
|
|
71
89
|
content: /*#__PURE__*/React.createElement(FormattedMessage, label),
|
|
72
90
|
icon: followIcon,
|
|
73
91
|
testId: "smart-action-follow-action",
|
|
74
92
|
tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
|
|
75
|
-
}, data, props
|
|
93
|
+
}, data, props, {
|
|
94
|
+
onError: handleError
|
|
95
|
+
}));
|
|
76
96
|
};
|
|
77
97
|
export default FollowAction;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { messages } from '../../../../../messages';
|
|
2
|
+
export var getFollowActionErrorMessage = function getFollowActionErrorMessage() {
|
|
3
|
+
var isProject = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
|
|
4
|
+
var isFollow = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
5
|
+
if (isProject && isFollow) {
|
|
6
|
+
return messages.follow_project_error;
|
|
7
|
+
}
|
|
8
|
+
if (isProject && !isFollow) {
|
|
9
|
+
return messages.unfollow_project_error;
|
|
10
|
+
}
|
|
11
|
+
if (!isProject && isFollow) {
|
|
12
|
+
return messages.follow_goal_error;
|
|
13
|
+
}
|
|
14
|
+
if (!isProject && !isFollow) {
|
|
15
|
+
return messages.unfollow_goal_error;
|
|
16
|
+
}
|
|
17
|
+
return messages.generic_error_message;
|
|
18
|
+
};
|
|
@@ -5,4 +5,5 @@ export { default as DownloadAction } from './download-action';
|
|
|
5
5
|
export { default as FollowAction } from './follow-action';
|
|
6
6
|
export { default as PreviewAction } from './preview-action';
|
|
7
7
|
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
|
-
export { default as AISummaryAction } from './ai-summary-action';
|
|
8
|
+
export { default as AISummaryAction } from './ai-summary-action';
|
|
9
|
+
export { default as AutomationAction } from './automation-action';
|
|
@@ -8,6 +8,7 @@ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbol
|
|
|
8
8
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9
9
|
import VidFullScreenOnIcon from '@atlaskit/icon/glyph/vid-full-screen-on';
|
|
10
10
|
import MediaServicesActualSizeIcon from '@atlaskit/icon/glyph/media-services/actual-size';
|
|
11
|
+
import { getBooleanFF } from '@atlaskit/platform-feature-flags';
|
|
11
12
|
import React, { useCallback } from 'react';
|
|
12
13
|
import { FormattedMessage } from 'react-intl-next';
|
|
13
14
|
import { ActionName } from '../../../../../constants';
|
|
@@ -16,6 +17,14 @@ import { useFlexibleUiAnalyticsContext, useFlexibleUiContext } from '../../../..
|
|
|
16
17
|
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
17
18
|
import { openEmbedModalWithFlexibleUiIcon } from '../../utils';
|
|
18
19
|
import Action from '../action';
|
|
20
|
+
var getIconFF = function getIconFF() {
|
|
21
|
+
if (getBooleanFF('platform.linking-platform.smart-card.hover-card-action-redesign')) {
|
|
22
|
+
if (getBooleanFF('platform.linking-platform.smart-card.action-icon-redesign')) {
|
|
23
|
+
return MediaServicesActualSizeIcon;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
return VidFullScreenOnIcon;
|
|
27
|
+
};
|
|
19
28
|
var PreviewAction = function PreviewAction(_ref) {
|
|
20
29
|
var _context$actions;
|
|
21
30
|
var onClickCallback = _ref.onClick,
|
|
@@ -62,7 +71,7 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
62
71
|
}
|
|
63
72
|
}, [analytics, data, invoke, onClickCallback]);
|
|
64
73
|
var isStackItem = props.as === 'stack-item';
|
|
65
|
-
var Icon = isStackItem ? MediaServicesActualSizeIcon :
|
|
74
|
+
var Icon = isStackItem ? MediaServicesActualSizeIcon : getIconFF();
|
|
66
75
|
var tooltipMessage = isStackItem ? messages.preview_description : messages.preview_improved;
|
|
67
76
|
return data ? /*#__PURE__*/React.createElement(Action, _extends({
|
|
68
77
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.preview_improved),
|
|
@@ -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.67.0",
|
|
14
14
|
componentName: 'linkUrl'
|
|
15
15
|
};
|
|
16
16
|
var Link = withLinkClickedEvent('a');
|
|
@@ -132,6 +132,7 @@ export declare enum ActionName {
|
|
|
132
132
|
EditAction = "EditAction",
|
|
133
133
|
FollowAction = "FollowAction",
|
|
134
134
|
PreviewAction = "PreviewAction",
|
|
135
|
+
AutomationAction = "AutomationAction",
|
|
135
136
|
/**
|
|
136
137
|
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-8954 Internal documentation for deprecation (no external access)}
|
|
137
138
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { FlexibleUiActions } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
import { AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
3
|
+
import type { AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
4
4
|
import type { CardActionOptions } from '../../../view/Card/types';
|
|
5
5
|
declare const extractActions: (response: JsonLd.Response, url?: string, actionOptions?: CardActionOptions, id?: string, aiSummaryConfig?: AISummaryConfig) => FlexibleUiActions | undefined;
|
|
6
6
|
export default extractActions;
|
package/dist/types/messages.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
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_summarized_info_short' | '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';
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarized_info_short' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'ai_summary_error_exceeding_context_length_error' | 'ai_summary_action' | 'ai_summary_action_description' | 'automation_action_title' | 'automation_action_tooltip' | 'automation_action_icon_label' | 'automation_action_confluence_page_modal_title' | 'automation_action_confluence_page_modal_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' | 'follow_project_error' | 'follow_goal_error' | '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_project_error' | 'unfollow_goal' | 'unfollow_goal_description' | 'unfollow_goal_error' | '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
|
};
|
|
@@ -5,6 +5,7 @@ import { InvokeRequestWithCardDetails } from '../hooks/use-invoke/types';
|
|
|
5
5
|
import type { CardInnerAppearance } from '../../view/Card/types';
|
|
6
6
|
import type { AnalyticsFacade } from '../analytics';
|
|
7
7
|
import type { ProductType } from '@atlaskit/linking-common';
|
|
8
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
8
9
|
/**
|
|
9
10
|
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
10
11
|
* underlying elements.
|
|
@@ -247,6 +248,7 @@ export type FlexibleUiActions = {
|
|
|
247
248
|
[ActionName.FollowAction]?: ServerActionProp<boolean>;
|
|
248
249
|
[ActionName.CopyLinkAction]?: CopyLinkActionData;
|
|
249
250
|
[InternalActionName.AISummaryAction]?: AISummaryActionData;
|
|
251
|
+
[ActionName.AutomationAction]?: AutomationActionData;
|
|
250
252
|
};
|
|
251
253
|
export type PreviewActionData = {
|
|
252
254
|
downloadUrl?: string;
|
|
@@ -271,6 +273,16 @@ export type AISummaryActionData = {
|
|
|
271
273
|
product: ProductType;
|
|
272
274
|
url: string;
|
|
273
275
|
};
|
|
276
|
+
export type AutomationActionData = {
|
|
277
|
+
baseAutomationUrl: string;
|
|
278
|
+
objectAri: any;
|
|
279
|
+
siteAri: any;
|
|
280
|
+
canManageAutomation: boolean;
|
|
281
|
+
analyticsSource: string;
|
|
282
|
+
objectName?: string;
|
|
283
|
+
modalTitle: MessageDescriptor;
|
|
284
|
+
modalDescription: MessageDescriptor;
|
|
285
|
+
};
|
|
274
286
|
export type FlexibleAnalyticsContextType = AnalyticsFacade & {
|
|
275
287
|
display?: CardInnerAppearance;
|
|
276
288
|
extensionKey?: string;
|
|
@@ -37,7 +37,7 @@ export type AgentInputContext = {
|
|
|
37
37
|
};
|
|
38
38
|
export type PromptId = 'smart_links';
|
|
39
39
|
export type SummaryOutputMimeType = 'text/adf' | 'text/markdown' | 'text/json';
|
|
40
|
-
export declare const errorMessages: readonly ["NETWORK_ERROR", "NO_ANSWER", "RATE_LIMIT", "NO_AGENT", "PLUGIN_ERRORED", "OPENAI_RATE_LIMIT_USER_ABUSE", "ACCEPTABLE_USE_VIOLATIONS", "AI_DISABLED", "UNEXPECTED", "HIPAA_CONTENT_DETECTED"];
|
|
40
|
+
export declare const errorMessages: readonly ["NETWORK_ERROR", "NO_ANSWER", "RATE_LIMIT", "NO_AGENT", "PLUGIN_ERRORED", "OPENAI_RATE_LIMIT_USER_ABUSE", "ACCEPTABLE_USE_VIOLATIONS", "AI_DISABLED", "UNEXPECTED", "HIPAA_CONTENT_DETECTED", "EXCEEDING_CONTEXT_LENGTH_ERROR"];
|
|
41
41
|
export type ErrorMessage = (typeof errorMessages)[number];
|
|
42
42
|
export type AISummaryState = {
|
|
43
43
|
content: string;
|
|
@@ -21,7 +21,8 @@ export declare enum CardAction {
|
|
|
21
21
|
ChangeStatusAction = "ChangeStatusAction",
|
|
22
22
|
FollowAction = "FollowAction",
|
|
23
23
|
CopyLinkAction = "CopyLinkAction",
|
|
24
|
-
AISummaryAction = "AISummaryAction"
|
|
24
|
+
AISummaryAction = "AISummaryAction",
|
|
25
|
+
AutomationAction = "AutomationAction"
|
|
25
26
|
}
|
|
26
27
|
export type CardActionOptions = {
|
|
27
28
|
hide: true;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { ServerActionProps } from './types';
|
|
3
|
-
declare const ServerAction:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ServerActionProps } from './types';
|
|
3
|
+
declare const ServerAction: ({ action, onClick, onError: onErrorCallback, ...props }: ServerActionProps) => JSX.Element;
|
|
4
4
|
export default ServerAction;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ActionProps } from '../types';
|
|
2
|
-
import { InvokeRequestWithCardDetails } from '../../../../../../state/hooks/use-invoke/types';
|
|
3
|
-
export type ServerActionProps = Omit<ActionProps, 'onClick'> & {
|
|
1
|
+
import type { ActionProps } from '../types';
|
|
2
|
+
import type { InvokeRequestWithCardDetails } from '../../../../../../state/hooks/use-invoke/types';
|
|
3
|
+
export type ServerActionProps = Omit<ActionProps, 'onClick' | 'onError'> & {
|
|
4
4
|
action?: InvokeRequestWithCardDetails;
|
|
5
5
|
onClick?: ActionProps['onClick'];
|
|
6
|
+
onError?: () => void;
|
|
6
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { FollowActionProps } from './types';
|
|
3
|
-
declare const FollowAction:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type FollowActionProps } from './types';
|
|
3
|
+
declare const FollowAction: (props: FollowActionProps) => JSX.Element | null;
|
|
4
4
|
export default FollowAction;
|
|
@@ -6,3 +6,4 @@ export { default as FollowAction } from './follow-action';
|
|
|
6
6
|
export { default as PreviewAction } from './preview-action';
|
|
7
7
|
export { default as CopyLinkAction } from './copy-link-action';
|
|
8
8
|
export { default as AISummaryAction } from './ai-summary-action';
|
|
9
|
+
export { default as AutomationAction } from './automation-action';
|
|
@@ -3,7 +3,7 @@ import type { AISummaryBlockProps } from '../types';
|
|
|
3
3
|
import type { AISummaryStatus, ErrorMessage } from '../../../../../../state/hooks/use-ai-summary/ai-summary-service/types';
|
|
4
4
|
export declare const AISummaryBlockErrorIndicator: ({ showErrorIndicator, error, showTransition, testId, }: {
|
|
5
5
|
showErrorIndicator: boolean;
|
|
6
|
-
error?: "NETWORK_ERROR" | "NO_ANSWER" | "RATE_LIMIT" | "NO_AGENT" | "PLUGIN_ERRORED" | "OPENAI_RATE_LIMIT_USER_ABUSE" | "ACCEPTABLE_USE_VIOLATIONS" | "AI_DISABLED" | "UNEXPECTED" | "HIPAA_CONTENT_DETECTED" | undefined;
|
|
6
|
+
error?: "NETWORK_ERROR" | "NO_ANSWER" | "RATE_LIMIT" | "NO_AGENT" | "PLUGIN_ERRORED" | "OPENAI_RATE_LIMIT_USER_ABUSE" | "ACCEPTABLE_USE_VIOLATIONS" | "AI_DISABLED" | "UNEXPECTED" | "HIPAA_CONTENT_DETECTED" | "EXCEEDING_CONTEXT_LENGTH_ERROR" | undefined;
|
|
7
7
|
showTransition: boolean;
|
|
8
8
|
} & Pick<AISummaryBlockProps, "testId">) => JSX.Element;
|
|
9
9
|
export declare const AISummaryBlockStatusIndicator: ({ showStatusIndicator, metadata, status, testId, }: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ActionName, ElementName, SmartLinkDirection, SmartLinkSize, SmartLinkStatus } from '../../../../constants';
|
|
2
|
-
import { SerializedStyles } from '@emotion/react';
|
|
3
|
-
import { ActionProps } from '../actions/action/types';
|
|
4
|
-
import { PropsWithChildren, Ref } from 'react';
|
|
1
|
+
import { type ActionName, type ElementName, type SmartLinkDirection, type SmartLinkSize, type SmartLinkStatus } from '../../../../constants';
|
|
2
|
+
import { type SerializedStyles } from '@emotion/react';
|
|
3
|
+
import { type ActionProps } from '../actions/action/types';
|
|
4
|
+
import { type PropsWithChildren, type Ref } from 'react';
|
|
5
5
|
export type BlockProps = PropsWithChildren<{
|
|
6
6
|
/**
|
|
7
7
|
* The direction that the block should arrange it's elements. Can be vertical
|
|
@@ -161,7 +161,7 @@ export type BaseDataActionItem = {
|
|
|
161
161
|
* renders a preview modal when clicked.
|
|
162
162
|
*/
|
|
163
163
|
export type NamedDataActionItem = BaseDataActionItem & {
|
|
164
|
-
name: ActionName.FollowAction | ActionName.PreviewAction | ActionName.DownloadAction
|
|
164
|
+
name: ActionName.FollowAction | ActionName.PreviewAction | ActionName.DownloadAction | ActionName.AutomationAction
|
|
165
165
|
/**
|
|
166
166
|
* To be removed once ActionName.ViewAction is retired
|
|
167
167
|
* Currently left in to maintain backwards compatibility with public API
|
|
@@ -132,6 +132,7 @@ export declare enum ActionName {
|
|
|
132
132
|
EditAction = "EditAction",
|
|
133
133
|
FollowAction = "FollowAction",
|
|
134
134
|
PreviewAction = "PreviewAction",
|
|
135
|
+
AutomationAction = "AutomationAction",
|
|
135
136
|
/**
|
|
136
137
|
* @deprecated {@link https://hello.atlassian.net/browse/ENGHEALTH-8954 Internal documentation for deprecation (no external access)}
|
|
137
138
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { JsonLd } from 'json-ld-types';
|
|
2
2
|
import type { FlexibleUiActions } from '../../../state/flexible-ui-context/types';
|
|
3
|
-
import { AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
3
|
+
import type { AISummaryConfig } from '../../../state/hooks/use-ai-summary-config/types';
|
|
4
4
|
import type { CardActionOptions } from '../../../view/Card/types';
|
|
5
5
|
declare const extractActions: (response: JsonLd.Response, url?: string, actionOptions?: CardActionOptions, id?: string, aiSummaryConfig?: AISummaryConfig) => FlexibleUiActions | undefined;
|
|
6
6
|
export default extractActions;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
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_summarized_info_short' | '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';
|
|
3
|
+
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'ai_summarized' | 'ai_summarized_abbreviation' | 'ai_summarized_info' | 'ai_summarized_info_short' | 'ai_summarizing' | 'ai_summary_error_generic' | 'ai_summary_error_acceptable_use_violation' | 'ai_summary_error_hipaa_content_detected' | 'ai_summary_error_exceeding_context_length_error' | 'ai_summary_action' | 'ai_summary_action_description' | 'automation_action_title' | 'automation_action_tooltip' | 'automation_action_icon_label' | 'automation_action_confluence_page_modal_title' | 'automation_action_confluence_page_modal_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' | 'follow_project_error' | 'follow_goal_error' | '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_project_error' | 'unfollow_goal' | 'unfollow_goal_description' | 'unfollow_goal_error' | '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
|
};
|
|
@@ -5,6 +5,7 @@ import { InvokeRequestWithCardDetails } from '../hooks/use-invoke/types';
|
|
|
5
5
|
import type { CardInnerAppearance } from '../../view/Card/types';
|
|
6
6
|
import type { AnalyticsFacade } from '../analytics';
|
|
7
7
|
import type { ProductType } from '@atlaskit/linking-common';
|
|
8
|
+
import { MessageDescriptor } from 'react-intl-next';
|
|
8
9
|
/**
|
|
9
10
|
* This provides the data that will be used by Smart Links Flexible UI to populate it's
|
|
10
11
|
* underlying elements.
|
|
@@ -247,6 +248,7 @@ export type FlexibleUiActions = {
|
|
|
247
248
|
[ActionName.FollowAction]?: ServerActionProp<boolean>;
|
|
248
249
|
[ActionName.CopyLinkAction]?: CopyLinkActionData;
|
|
249
250
|
[InternalActionName.AISummaryAction]?: AISummaryActionData;
|
|
251
|
+
[ActionName.AutomationAction]?: AutomationActionData;
|
|
250
252
|
};
|
|
251
253
|
export type PreviewActionData = {
|
|
252
254
|
downloadUrl?: string;
|
|
@@ -271,6 +273,16 @@ export type AISummaryActionData = {
|
|
|
271
273
|
product: ProductType;
|
|
272
274
|
url: string;
|
|
273
275
|
};
|
|
276
|
+
export type AutomationActionData = {
|
|
277
|
+
baseAutomationUrl: string;
|
|
278
|
+
objectAri: any;
|
|
279
|
+
siteAri: any;
|
|
280
|
+
canManageAutomation: boolean;
|
|
281
|
+
analyticsSource: string;
|
|
282
|
+
objectName?: string;
|
|
283
|
+
modalTitle: MessageDescriptor;
|
|
284
|
+
modalDescription: MessageDescriptor;
|
|
285
|
+
};
|
|
274
286
|
export type FlexibleAnalyticsContextType = AnalyticsFacade & {
|
|
275
287
|
display?: CardInnerAppearance;
|
|
276
288
|
extensionKey?: string;
|
|
@@ -47,7 +47,8 @@ export declare const errorMessages: readonly [
|
|
|
47
47
|
"ACCEPTABLE_USE_VIOLATIONS",
|
|
48
48
|
"AI_DISABLED",
|
|
49
49
|
"UNEXPECTED",
|
|
50
|
-
"HIPAA_CONTENT_DETECTED"
|
|
50
|
+
"HIPAA_CONTENT_DETECTED",
|
|
51
|
+
"EXCEEDING_CONTEXT_LENGTH_ERROR"
|
|
51
52
|
];
|
|
52
53
|
export type ErrorMessage = (typeof errorMessages)[number];
|
|
53
54
|
export type AISummaryState = {
|
|
@@ -21,7 +21,8 @@ export declare enum CardAction {
|
|
|
21
21
|
ChangeStatusAction = "ChangeStatusAction",
|
|
22
22
|
FollowAction = "FollowAction",
|
|
23
23
|
CopyLinkAction = "CopyLinkAction",
|
|
24
|
-
AISummaryAction = "AISummaryAction"
|
|
24
|
+
AISummaryAction = "AISummaryAction",
|
|
25
|
+
AutomationAction = "AutomationAction"
|
|
25
26
|
}
|
|
26
27
|
export type CardActionOptions = {
|
|
27
28
|
hide: true;
|
package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/server-action/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { ServerActionProps } from './types';
|
|
3
|
-
declare const ServerAction:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import type { ServerActionProps } from './types';
|
|
3
|
+
declare const ServerAction: ({ action, onClick, onError: onErrorCallback, ...props }: ServerActionProps) => JSX.Element;
|
|
4
4
|
export default ServerAction;
|
package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/server-action/types.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { ActionProps } from '../types';
|
|
2
|
-
import { InvokeRequestWithCardDetails } from '../../../../../../state/hooks/use-invoke/types';
|
|
3
|
-
export type ServerActionProps = Omit<ActionProps, 'onClick'> & {
|
|
1
|
+
import type { ActionProps } from '../types';
|
|
2
|
+
import type { InvokeRequestWithCardDetails } from '../../../../../../state/hooks/use-invoke/types';
|
|
3
|
+
export type ServerActionProps = Omit<ActionProps, 'onClick' | 'onError'> & {
|
|
4
4
|
action?: InvokeRequestWithCardDetails;
|
|
5
5
|
onClick?: ActionProps['onClick'];
|
|
6
|
+
onError?: () => void;
|
|
6
7
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { FollowActionProps } from './types';
|
|
3
|
-
declare const FollowAction:
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { type FollowActionProps } from './types';
|
|
3
|
+
declare const FollowAction: (props: FollowActionProps) => JSX.Element | null;
|
|
4
4
|
export default FollowAction;
|