@atlaskit/smart-card 26.66.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.
Files changed (85) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/CONTRIBUTING.md +3 -0
  3. package/dist/cjs/constants.js +1 -0
  4. package/dist/cjs/extractors/flexible/actions/extract-automation-action.js +53 -0
  5. package/dist/cjs/extractors/flexible/actions/index.js +2 -1
  6. package/dist/cjs/messages.js +50 -0
  7. package/dist/cjs/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
  8. package/dist/cjs/state/hooks/use-ai-summary/index.js +3 -2
  9. package/dist/cjs/utils/ai-summary.js +4 -0
  10. package/dist/cjs/utils/analytics/analytics.js +1 -1
  11. package/dist/cjs/view/Card/types.js +1 -0
  12. package/dist/cjs/view/FlexibleCard/components/actions/action/server-action/index.js +7 -5
  13. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/index.js +56 -0
  14. package/dist/cjs/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.js +31 -0
  15. package/dist/cjs/view/FlexibleCard/components/actions/follow-action/index.js +19 -8
  16. package/dist/cjs/view/FlexibleCard/components/actions/follow-action/utils.js +24 -0
  17. package/dist/cjs/view/FlexibleCard/components/actions/index.js +8 -1
  18. package/dist/cjs/view/LinkUrl/index.js +1 -1
  19. package/dist/es2019/constants.js +1 -0
  20. package/dist/es2019/extractors/flexible/actions/extract-automation-action.js +48 -0
  21. package/dist/es2019/extractors/flexible/actions/index.js +2 -0
  22. package/dist/es2019/messages.js +50 -0
  23. package/dist/es2019/state/flexible-ui-context/types.js +3 -1
  24. package/dist/es2019/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
  25. package/dist/es2019/state/hooks/use-ai-summary/index.js +3 -2
  26. package/dist/es2019/utils/ai-summary.js +4 -0
  27. package/dist/es2019/utils/analytics/analytics.js +1 -1
  28. package/dist/es2019/view/Card/types.js +1 -0
  29. package/dist/es2019/view/FlexibleCard/components/actions/action/server-action/index.js +3 -1
  30. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/index.js +41 -0
  31. package/dist/es2019/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.js +23 -0
  32. package/dist/es2019/view/FlexibleCard/components/actions/follow-action/index.js +19 -5
  33. package/dist/es2019/view/FlexibleCard/components/actions/follow-action/utils.js +16 -0
  34. package/dist/es2019/view/FlexibleCard/components/actions/index.js +2 -1
  35. package/dist/es2019/view/LinkUrl/index.js +1 -1
  36. package/dist/esm/constants.js +1 -0
  37. package/dist/esm/extractors/flexible/actions/extract-automation-action.js +46 -0
  38. package/dist/esm/extractors/flexible/actions/index.js +2 -1
  39. package/dist/esm/messages.js +50 -0
  40. package/dist/esm/state/flexible-ui-context/types.js +3 -1
  41. package/dist/esm/state/hooks/use-ai-summary/ai-summary-service/types.js +1 -1
  42. package/dist/esm/state/hooks/use-ai-summary/index.js +3 -2
  43. package/dist/esm/utils/ai-summary.js +4 -0
  44. package/dist/esm/utils/analytics/analytics.js +1 -1
  45. package/dist/esm/view/Card/types.js +1 -0
  46. package/dist/esm/view/FlexibleCard/components/actions/action/server-action/index.js +7 -5
  47. package/dist/esm/view/FlexibleCard/components/actions/automation-action/index.js +46 -0
  48. package/dist/esm/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.js +24 -0
  49. package/dist/esm/view/FlexibleCard/components/actions/follow-action/index.js +19 -8
  50. package/dist/esm/view/FlexibleCard/components/actions/follow-action/utils.js +18 -0
  51. package/dist/esm/view/FlexibleCard/components/actions/index.js +2 -1
  52. package/dist/esm/view/LinkUrl/index.js +1 -1
  53. package/dist/types/constants.d.ts +1 -0
  54. package/dist/types/extractors/flexible/actions/extract-automation-action.d.ts +3 -0
  55. package/dist/types/extractors/flexible/actions/index.d.ts +1 -1
  56. package/dist/types/messages.d.ts +1 -1
  57. package/dist/types/state/flexible-ui-context/types.d.ts +12 -0
  58. package/dist/types/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +1 -1
  59. package/dist/types/view/Card/types.d.ts +2 -1
  60. package/dist/types/view/FlexibleCard/components/actions/action/server-action/index.d.ts +3 -3
  61. package/dist/types/view/FlexibleCard/components/actions/action/server-action/types.d.ts +4 -3
  62. package/dist/types/view/FlexibleCard/components/actions/automation-action/index.d.ts +4 -0
  63. package/dist/types/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.d.ts +5 -0
  64. package/dist/types/view/FlexibleCard/components/actions/follow-action/index.d.ts +2 -2
  65. package/dist/types/view/FlexibleCard/components/actions/follow-action/utils.d.ts +2 -0
  66. package/dist/types/view/FlexibleCard/components/actions/index.d.ts +1 -0
  67. package/dist/types/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -1
  68. package/dist/types/view/FlexibleCard/components/blocks/types.d.ts +5 -5
  69. package/dist/types-ts4.5/constants.d.ts +1 -0
  70. package/dist/types-ts4.5/extractors/flexible/actions/extract-automation-action.d.ts +3 -0
  71. package/dist/types-ts4.5/extractors/flexible/actions/index.d.ts +1 -1
  72. package/dist/types-ts4.5/messages.d.ts +1 -1
  73. package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +12 -0
  74. package/dist/types-ts4.5/state/hooks/use-ai-summary/ai-summary-service/types.d.ts +2 -1
  75. package/dist/types-ts4.5/view/Card/types.d.ts +2 -1
  76. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/server-action/index.d.ts +3 -3
  77. package/dist/types-ts4.5/view/FlexibleCard/components/actions/action/server-action/types.d.ts +4 -3
  78. package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/index.d.ts +4 -0
  79. package/dist/types-ts4.5/view/FlexibleCard/components/actions/automation-action/manaul-triggers-icon/index.d.ts +5 -0
  80. package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/index.d.ts +2 -2
  81. package/dist/types-ts4.5/view/FlexibleCard/components/actions/follow-action/utils.d.ts +2 -0
  82. package/dist/types-ts4.5/view/FlexibleCard/components/actions/index.d.ts +1 -0
  83. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/ai-summary-block/resolved/index.d.ts +1 -1
  84. package/dist/types-ts4.5/view/FlexibleCard/components/blocks/types.d.ts +5 -5
  85. package/package.json +6 -3
@@ -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,6 +1,6 @@
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
5
  import { getBooleanFF } from '@atlaskit/platform-feature-flags';
6
6
  import React from 'react';
@@ -11,6 +11,7 @@ import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
11
11
  import ServerAction from '../action/server-action';
12
12
  import UnfollowIcon from './unfollow-icon';
13
13
  import { importIcon } from '../../utils';
14
+ import { getFollowActionErrorMessage } from './utils';
14
15
  var importIconMapper = {
15
16
  goal: function goal() {
16
17
  return import( /* webpackChunkName: "glyphGoal" */'./goal-icon').then(function (_ref) {
@@ -45,16 +46,16 @@ var getIconFF = function getIconFF(iconFFEnabled, defaultIcon) {
45
46
  return defaultIcon;
46
47
  };
47
48
  var FollowAction = function FollowAction(props) {
48
- var _context$actions, _context$actions2;
49
+ var _context$actions;
49
50
  var context = useFlexibleUiContext();
50
- if (!context || !(context !== null && context !== void 0 && (_context$actions = context.actions) !== null && _context$actions !== void 0 && _context$actions[ActionName.FollowAction])) {
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) {
51
53
  return null;
52
54
  }
53
- var _context$actions$Acti = context === null || context === void 0 || (_context$actions2 = context.actions) === null || _context$actions2 === void 0 ? void 0 : _context$actions2[ActionName.FollowAction],
54
- value = _context$actions$Acti.value,
55
- data = _objectWithoutProperties(_context$actions$Acti, _excluded);
55
+ var value = actionData.value,
56
+ isProject = actionData.isProject,
57
+ data = _objectWithoutProperties(actionData, _excluded);
56
58
  var isStackItem = props.as === 'stack-item';
57
- var isProject = data.isProject;
58
59
  var message = value ? messages.follow : messages.unfollow;
59
60
  var projectMessage = value ? messages.follow_project : messages.unfollow_project;
60
61
  var goalMessage = value ? messages.follow_goal : messages.unfollow_goal;
@@ -76,11 +77,21 @@ var FollowAction = function FollowAction(props) {
76
77
  testId: "smart-action-follow-action-".concat(stackIconType, "-icon")
77
78
  });
78
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
+ };
79
88
  return /*#__PURE__*/React.createElement(ServerAction, _extends({
80
89
  content: /*#__PURE__*/React.createElement(FormattedMessage, label),
81
90
  icon: followIcon,
82
91
  testId: "smart-action-follow-action",
83
92
  tooltipMessage: /*#__PURE__*/React.createElement(FormattedMessage, tooltipMessage)
84
- }, data, props));
93
+ }, data, props, {
94
+ onError: handleError
95
+ }));
85
96
  };
86
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';
@@ -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.66.0",
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
  */
@@ -0,0 +1,3 @@
1
+ import type { JsonLd } from "json-ld-types";
2
+ import { type AutomationActionData } from "../../../state/flexible-ui-context/types";
3
+ export declare const extractAutomationAction: (response: JsonLd.Response) => AutomationActionData | undefined;
@@ -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;
@@ -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
- import React from 'react';
2
- import { ServerActionProps } from './types';
3
- declare const ServerAction: React.FC<ServerActionProps>;
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
  };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type LinkActionProps } from '../types';
3
+ declare const AutomationAction: (props: LinkActionProps) => JSX.Element | null;
4
+ export default AutomationAction;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const AutomationManualTriggersGlyph: ({ label }: {
3
+ label: string;
4
+ }) => JSX.Element;
5
+ export default AutomationManualTriggersGlyph;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { type FollowActionProps } from './types';
3
- declare const FollowAction: React.FC<FollowActionProps>;
3
+ declare const FollowAction: (props: FollowActionProps) => JSX.Element | null;
4
4
  export default FollowAction;
@@ -0,0 +1,2 @@
1
+ import type { MessageDescriptor } from 'react-intl-next';
2
+ export declare const getFollowActionErrorMessage: (isProject?: boolean, isFollow?: boolean) => MessageDescriptor;
@@ -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
  */
@@ -0,0 +1,3 @@
1
+ import type { JsonLd } from "json-ld-types";
2
+ import { type AutomationActionData } from "../../../state/flexible-ui-context/types";
3
+ export declare const extractAutomationAction: (response: JsonLd.Response) => AutomationActionData | undefined;
@@ -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;
@@ -1,4 +1,4 @@
1
- import React from 'react';
2
- import { ServerActionProps } from './types';
3
- declare const ServerAction: React.FC<ServerActionProps>;
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
  };
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { type LinkActionProps } from '../types';
3
+ declare const AutomationAction: (props: LinkActionProps) => JSX.Element | null;
4
+ export default AutomationAction;
@@ -0,0 +1,5 @@
1
+ /// <reference types="react" />
2
+ declare const AutomationManualTriggersGlyph: ({ label }: {
3
+ label: string;
4
+ }) => JSX.Element;
5
+ export default AutomationManualTriggersGlyph;
@@ -1,4 +1,4 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  import { type FollowActionProps } from './types';
3
- declare const FollowAction: React.FC<FollowActionProps>;
3
+ declare const FollowAction: (props: FollowActionProps) => JSX.Element | null;
4
4
  export default FollowAction;
@@ -0,0 +1,2 @@
1
+ import type { MessageDescriptor } from 'react-intl-next';
2
+ export declare const getFollowActionErrorMessage: (isProject?: boolean, isFollow?: boolean) => MessageDescriptor;
@@ -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
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/smart-card",
3
- "version": "26.66.0",
3
+ "version": "26.67.0",
4
4
  "description": "Smart card component",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -36,7 +36,7 @@
36
36
  "@atlaskit/button": "^17.14.0",
37
37
  "@atlaskit/dropdown-menu": "^12.10.0",
38
38
  "@atlaskit/frontend-utilities": "^2.7.0",
39
- "@atlaskit/icon": "^22.1.0",
39
+ "@atlaskit/icon": "^22.2.0",
40
40
  "@atlaskit/icon-file-type": "^6.4.0",
41
41
  "@atlaskit/icon-object": "^6.4.0",
42
42
  "@atlaskit/icon-priority": "^6.3.0",
@@ -56,7 +56,7 @@
56
56
  "@atlaskit/spinner": "^16.1.0",
57
57
  "@atlaskit/theme": "^12.8.0",
58
58
  "@atlaskit/tokens": "^1.48.0",
59
- "@atlaskit/tooltip": "^18.3.0",
59
+ "@atlaskit/tooltip": "^18.4.0",
60
60
  "@atlaskit/ufo": "^0.2.0",
61
61
  "@babel/runtime": "^7.0.0",
62
62
  "@emotion/react": "^11.7.1",
@@ -182,6 +182,9 @@
182
182
  },
183
183
  "platform.linking-platform.smart-card.action-icon-redesign": {
184
184
  "type": "boolean"
185
+ },
186
+ "platform.linking-platfom.smart-card.confluence.page.automation-action": {
187
+ "type": "boolean"
185
188
  }
186
189
  },
187
190
  "prettier": "@atlassian/atlassian-frontend-prettier-config-1.0.1"