@atlaskit/smart-card 43.26.3 → 43.26.5
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 +19 -0
- package/analytics.spec.yaml +9 -0
- package/dist/cjs/extractors/flexible/actions/extract-rovo-chat-action.js +17 -1
- package/dist/cjs/extractors/flexible/actions/index.js +8 -1
- package/dist/cjs/messages.js +15 -10
- package/dist/cjs/state/hooks/use-invoke-client-action/index.js +4 -3
- package/dist/cjs/utils/analytics/analytics.js +1 -1
- package/dist/cjs/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -1
- package/dist/cjs/view/FlexibleCard/components/actions/preview-action/index.js +3 -2
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/html-to-adf.js +180 -0
- package/dist/cjs/view/FlexibleCard/components/actions/rovo-chat-action/index.js +56 -19
- package/dist/cjs/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +2 -1
- package/dist/cjs/view/HoverCard/components/views/resolved/index.js +5 -1
- package/dist/cjs/view/LinkUrl/index.js +1 -1
- package/dist/es2019/extractors/flexible/actions/extract-rovo-chat-action.js +19 -2
- package/dist/es2019/extractors/flexible/actions/index.js +8 -1
- package/dist/es2019/messages.js +15 -10
- package/dist/es2019/state/hooks/use-invoke-client-action/index.js +3 -1
- package/dist/es2019/utils/analytics/analytics.js +1 -1
- package/dist/es2019/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -1
- package/dist/es2019/view/FlexibleCard/components/actions/preview-action/index.js +3 -2
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/html-to-adf.js +161 -0
- package/dist/es2019/view/FlexibleCard/components/actions/rovo-chat-action/index.js +34 -37
- package/dist/es2019/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +2 -1
- package/dist/es2019/view/HoverCard/components/views/resolved/index.js +5 -1
- package/dist/es2019/view/LinkUrl/index.js +1 -1
- package/dist/esm/extractors/flexible/actions/extract-rovo-chat-action.js +18 -2
- package/dist/esm/extractors/flexible/actions/index.js +8 -1
- package/dist/esm/messages.js +15 -10
- package/dist/esm/state/hooks/use-invoke-client-action/index.js +4 -3
- package/dist/esm/utils/analytics/analytics.js +1 -1
- package/dist/esm/view/FlexibleCard/components/actions/copy-link-action/index.js +2 -1
- package/dist/esm/view/FlexibleCard/components/actions/preview-action/index.js +3 -2
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/html-to-adf.js +172 -0
- package/dist/esm/view/FlexibleCard/components/actions/rovo-chat-action/index.js +56 -19
- package/dist/esm/view/FlexibleCard/components/actions/view-related-links-action/related-links-action-icon/index.js +2 -1
- package/dist/esm/view/HoverCard/components/views/resolved/index.js +5 -1
- package/dist/esm/view/LinkUrl/index.js +1 -1
- package/dist/types/common/analytics/generated/analytics.types.d.ts +12 -1
- package/dist/types/extractors/flexible/actions/extract-rovo-chat-action.d.ts +10 -1
- package/dist/types/messages.d.ts +1 -1
- package/dist/types/state/flexible-ui-context/types.d.ts +1 -0
- package/dist/types/state/hooks/use-invoke-client-action/types.d.ts +6 -2
- package/dist/types/view/FlexibleCard/components/actions/rovo-chat-action/html-to-adf.d.ts +8 -0
- package/dist/types-ts4.5/common/analytics/generated/analytics.types.d.ts +12 -1
- package/dist/types-ts4.5/extractors/flexible/actions/extract-rovo-chat-action.d.ts +10 -1
- package/dist/types-ts4.5/messages.d.ts +1 -1
- package/dist/types-ts4.5/state/flexible-ui-context/types.d.ts +1 -0
- package/dist/types-ts4.5/state/hooks/use-invoke-client-action/types.d.ts +6 -2
- package/dist/types-ts4.5/view/FlexibleCard/components/actions/rovo-chat-action/html-to-adf.d.ts +8 -0
- package/package.json +9 -5
package/dist/esm/messages.js
CHANGED
|
@@ -860,11 +860,6 @@ export var messages = defineMessages({
|
|
|
860
860
|
defaultMessage: 'Confluence page',
|
|
861
861
|
description: 'The Confluence page the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
862
862
|
},
|
|
863
|
-
rovo_prompt_context_confluence_page_plural: {
|
|
864
|
-
id: 'fabric.linking.rovo_prompt_context_confluence_page_plural.non-final',
|
|
865
|
-
defaultMessage: 'Confluence pages',
|
|
866
|
-
description: 'The Confluence page the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
867
|
-
},
|
|
868
863
|
rovo_prompt_context_confluence_page_short: {
|
|
869
864
|
id: 'fabric.linking.rovo_prompt_context_confluence_page_short.non-final',
|
|
870
865
|
defaultMessage: 'page',
|
|
@@ -875,11 +870,6 @@ export var messages = defineMessages({
|
|
|
875
870
|
defaultMessage: 'Jira work item',
|
|
876
871
|
description: 'The Jira work item the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
877
872
|
},
|
|
878
|
-
rovo_prompt_context_jira_work_item_plural: {
|
|
879
|
-
id: 'fabric.linking.rovo_prompt_context_jira_work_item_plural.non-final',
|
|
880
|
-
defaultMessage: 'Jira work items',
|
|
881
|
-
description: 'The Jira work item the user see Smart Link in, to be used as the {context} for Rovo prompt message'
|
|
882
|
-
},
|
|
883
873
|
rovo_prompt_context_jira_work_item_short: {
|
|
884
874
|
id: 'fabric.linking.rovo_prompt_context_jira_work_item_short.non-final',
|
|
885
875
|
defaultMessage: 'work item',
|
|
@@ -890,14 +880,29 @@ export var messages = defineMessages({
|
|
|
890
880
|
defaultMessage: 'Recommend other sources',
|
|
891
881
|
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
892
882
|
},
|
|
883
|
+
rovo_prompt_message_recommend_other_sources: {
|
|
884
|
+
id: 'fabric.linking.rovo_prompt_message_recommend_other_sources.non-final',
|
|
885
|
+
defaultMessage: '<p>From this <a>{url}</a> and the {context} I’m viewing now as context:</p><ul><li><p>Search across all sources I can access for items that discuss <b>similar concepts, themes, or problems</b>, or that <b>reference similar or closely related sources</b> (including links to the same or related pages, issues, or docs).</p></li><li><p>Return the results as a list or table with columns: <code>Item</code>, <code>Type</code>, <code>Short summary</code>, and <code>Why it’s similar</code>.</p></li><li><p>For each result, give a one‑sentence <b>Short summary</b> of what the item is about.</p></li><li><p>In <b>Why it’s similar</b>, briefly explain (in a phrase or short sentence) what makes it related to this Smart Link and/or the item I’m viewing (for example: same project, similar decision, shared requirements, overlapping stakeholders, similar metrics, or referencing related docs).</p></li><li><p>Order the list from <b>most to least relevant</b> based on Rovo’s assessment of semantic similarity to both the Smart Link target and the current item. Prioritize items that I do not own or have not contributed to.</p></li><li><p>If there are more than 5 results, show the <b>5 most relevant</b> and state how many additional items you found.</p></li></ul>',
|
|
886
|
+
description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
887
|
+
},
|
|
893
888
|
rovo_prompt_button_show_other_mentions: {
|
|
894
889
|
id: 'fabric.linking.rovo_prompt_button_show_other_mentions.non-final',
|
|
895
890
|
defaultMessage: 'Show other mentions',
|
|
896
891
|
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
897
892
|
},
|
|
893
|
+
rovo_prompt_message_show_other_mentions: {
|
|
894
|
+
id: 'fabric.linking.rovo_prompt_message_show_other_mentions.non-final',
|
|
895
|
+
defaultMessage: '<p>From <a>{url}</a> and the {context} I’m viewing now:</p><ul><li><p>Search across all Confluence pages and Jira work items I can access for other items that contain this exact Smart Link (same underlying URL/resource).</p></li><li><p>List all matching items in a table with columns: <code>Item</code>, <code>Type</code>, <code>Short summary</code>, <code>How this item uses the link</code>, and <code>Relevance to current item</code>.</p></li><li><p>For <code>Short summary</code>, give a one‑sentence description of what the {context} is about.</p></li><li><p>For <code>How this item uses the link</code>, briefly explain the role this link plays there (e.g., decision doc, background context, implementation details, status update).</p></li><li><p>For <code>Relevance to current item</code>, compare each item to the {context} I’m viewing now and label it <code>High</code>, <code>Medium</code>, or <code>Low</code> relevance, with a short reason (a phrase or single clause).</p></li><li><p>If there are more than 15 matches, show the 15 most relevant and tell me how many additional matches exist.</p></li></ul>',
|
|
896
|
+
description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
897
|
+
},
|
|
898
898
|
rovo_prompt_button_suggest_improvement: {
|
|
899
899
|
id: 'fabric.linking.rovo_prompt_button_suggest_improvement.non-final',
|
|
900
900
|
defaultMessage: 'Suggest {context} improvement',
|
|
901
901
|
description: 'The name of the action to send prompt message to Rovo Chat in relation to current Smart Link'
|
|
902
|
+
},
|
|
903
|
+
rovo_prompt_message_suggest_improvement: {
|
|
904
|
+
id: 'fabric.linking.rovo_prompt_message_suggest_improvement.non-final',
|
|
905
|
+
defaultMessage: '<p>Using the {context} I’m viewing now, plus all files and links referenced in it (including <a>{url}</a>):</p><ul><li><p>Identify unclear reasoning, missing context, or contradictions between the item and its linked files.</p></li><li><p>Call out any places where assumptions are not backed up by data or prior docs.</p></li><li><p>Stay concise: summarize your findings in <b>no more than three short paragraphs of content listed as bullets</b> of no more than a couple of sentences long focused only on the two points above.</p></li><li><p>After presenting that summary, <b>ask me explicitly</b> if I want you to go deeper. Only if I say yes, then:</p><ul><li><p>Suggest concrete rewrites (bullets or short paragraphs) to make the argument clearer, more concise, and better aligned with the supporting files.</p></li><li><p>Propose 3–5 follow‑up edits or additions that would make this item and its linked docs “share‑ready” for stakeholders.</p></li></ul></li></ul>',
|
|
906
|
+
description: 'The prompt message to send to Rovo Chat. {context} refers to the content the user triggered from, e.g. Confluence page or Jira work item. {url} refers to Smart Link that the user triggers this action from. (Please make sure all html tags remain the same.)'
|
|
902
907
|
}
|
|
903
908
|
});
|
|
@@ -19,11 +19,11 @@ var useInvokeClientAction = function useInvokeClientAction(_ref) {
|
|
|
19
19
|
var fireEvent = fireEventProp !== null && fireEventProp !== void 0 ? fireEventProp : defaultFireEvent;
|
|
20
20
|
return useCallback( /*#__PURE__*/function () {
|
|
21
21
|
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee(_ref2) {
|
|
22
|
-
var actionSubjectId, actionType, actionFn, _ref2$definitionId, definitionId, extensionKey, display, id, _ref2$resourceType, resourceType, experienceId, markName, _measure$getMeasure$d, _measure$getMeasure, result, _measure$getMeasure$d2, _measure$getMeasure2, reason;
|
|
22
|
+
var actionSubjectId, actionType, actionFn, _ref2$definitionId, definitionId, extensionKey, display, id, prompt, _ref2$resourceType, resourceType, experienceId, markName, _measure$getMeasure$d, _measure$getMeasure, result, _measure$getMeasure$d2, _measure$getMeasure2, reason;
|
|
23
23
|
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
24
24
|
while (1) switch (_context.prev = _context.next) {
|
|
25
25
|
case 0:
|
|
26
|
-
actionSubjectId = _ref2.actionSubjectId, actionType = _ref2.actionType, actionFn = _ref2.actionFn, _ref2$definitionId = _ref2.definitionId, definitionId = _ref2$definitionId === void 0 ? null : _ref2$definitionId, extensionKey = _ref2.extensionKey, display = _ref2.display, id = _ref2.id, _ref2$resourceType = _ref2.resourceType, resourceType = _ref2$resourceType === void 0 ? null : _ref2$resourceType;
|
|
26
|
+
actionSubjectId = _ref2.actionSubjectId, actionType = _ref2.actionType, actionFn = _ref2.actionFn, _ref2$definitionId = _ref2.definitionId, definitionId = _ref2$definitionId === void 0 ? null : _ref2$definitionId, extensionKey = _ref2.extensionKey, display = _ref2.display, id = _ref2.id, prompt = _ref2.prompt, _ref2$resourceType = _ref2.resourceType, resourceType = _ref2$resourceType === void 0 ? null : _ref2$resourceType;
|
|
27
27
|
// eslint-disable-next-line @atlaskit/platform/prefer-crypto-random-uuid -- Use crypto.randomUUID instead
|
|
28
28
|
experienceId = uuid(); // Begin performance instrumentation.
|
|
29
29
|
markName = "".concat(experienceId, "-").concat(actionType);
|
|
@@ -44,7 +44,8 @@ var useInvokeClientAction = function useInvokeClientAction(_ref) {
|
|
|
44
44
|
definitionId: definitionId,
|
|
45
45
|
display: display !== null && display !== void 0 ? display : null,
|
|
46
46
|
id: id !== null && id !== void 0 ? id : experienceId,
|
|
47
|
-
resourceType: resourceType
|
|
47
|
+
resourceType: resourceType,
|
|
48
|
+
prompt: prompt
|
|
48
49
|
});
|
|
49
50
|
}
|
|
50
51
|
// Invoke action
|
|
@@ -4,7 +4,7 @@ export var ANALYTICS_CHANNEL = 'media';
|
|
|
4
4
|
export var context = {
|
|
5
5
|
componentName: 'smart-cards',
|
|
6
6
|
packageName: "@atlaskit/smart-card",
|
|
7
|
-
packageVersion: "
|
|
7
|
+
packageVersion: "0.0.0-development"
|
|
8
8
|
};
|
|
9
9
|
export var TrackQuickActionType = /*#__PURE__*/function (TrackQuickActionType) {
|
|
10
10
|
TrackQuickActionType["StatusUpdate"] = "StatusUpdate";
|
|
@@ -10,6 +10,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
|
|
|
10
10
|
import React, { useCallback, useState } from 'react';
|
|
11
11
|
import { FormattedMessage } from 'react-intl-next';
|
|
12
12
|
import LinkIcon from '@atlaskit/icon/core/link';
|
|
13
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
13
14
|
import { ActionName } from '../../../../../constants';
|
|
14
15
|
import { messages } from '../../../../../messages';
|
|
15
16
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
@@ -58,7 +59,7 @@ var CopyLinkAction = function CopyLinkAction(_ref) {
|
|
|
58
59
|
content: /*#__PURE__*/React.createElement(FormattedMessage, messages.copy_url_to_clipboard),
|
|
59
60
|
icon: /*#__PURE__*/React.createElement(LinkIcon, {
|
|
60
61
|
color: "currentColor",
|
|
61
|
-
label:
|
|
62
|
+
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'copy url',
|
|
62
63
|
spacing: "spacious"
|
|
63
64
|
}),
|
|
64
65
|
onClick: onClick,
|
|
@@ -5,6 +5,7 @@ import React, { useCallback } from 'react';
|
|
|
5
5
|
import { FormattedMessage } from 'react-intl-next';
|
|
6
6
|
import MediaServicesActualSizeIcon from '@atlaskit/icon/core/grow-diagonal';
|
|
7
7
|
import PanelRightIcon from '@atlaskit/icon/core/panel-right';
|
|
8
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
8
9
|
import { expValEquals } from '@atlaskit/tmp-editor-statsig/exp-val-equals';
|
|
9
10
|
import { ActionName } from '../../../../../constants';
|
|
10
11
|
import { messages } from '../../../../../messages';
|
|
@@ -33,13 +34,13 @@ var PreviewAction = function PreviewAction(_ref) {
|
|
|
33
34
|
return /*#__PURE__*/React.createElement(PanelRightIcon, {
|
|
34
35
|
color: "currentColor",
|
|
35
36
|
spacing: "spacious",
|
|
36
|
-
label:
|
|
37
|
+
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview panel'
|
|
37
38
|
});
|
|
38
39
|
}
|
|
39
40
|
return /*#__PURE__*/React.createElement(MediaServicesActualSizeIcon, {
|
|
40
41
|
color: "currentColor",
|
|
41
42
|
spacing: "spacious",
|
|
42
|
-
label:
|
|
43
|
+
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'Open preview'
|
|
43
44
|
});
|
|
44
45
|
}, [hasPreviewPanel]);
|
|
45
46
|
var actionLabel = useCallback(function () {
|
|
@@ -0,0 +1,172 @@
|
|
|
1
|
+
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
2
|
+
/**
|
|
3
|
+
* This is a simplified version of html to adf conversion,
|
|
4
|
+
* used specifically for SL RovoChatAction prompt message,
|
|
5
|
+
* and does not support all ADF offered via @atlaskit/adf-utils
|
|
6
|
+
*
|
|
7
|
+
* Support: p, ul, li, text, b, strong, code, inlineCard (replace a hyperlink)
|
|
8
|
+
*/
|
|
9
|
+
import { code, doc, inlineCard, p, b, ul, li, text } from '@atlaskit/adf-utils/builders';
|
|
10
|
+
var INLINE_TAG_NAMES = ['b', 'strong', 'code', 'a', 'inlineCard'];
|
|
11
|
+
var BLOCK_TAG_NAMES = ['p', 'ul', 'ol', 'li'];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Group Captures Example
|
|
15
|
+
* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
|
|
16
|
+
* match[1] Self-closing tag name br from <br/> or <img src="x"/>
|
|
17
|
+
* match[2] Opening tag name div from <div> or <div class="x">
|
|
18
|
+
* match[3] Closing tag name div from </div>
|
|
19
|
+
* match[4] Text content Hello world
|
|
20
|
+
*/
|
|
21
|
+
var htmlRegex = /<\s*(\w+)[^>]*?\s*\/\s*>|<\s*(\w+)[^>]*>|<\s*\/\s*(\w+)\s*>|([^<]+)/g;
|
|
22
|
+
var decodeHtmlEntities = function decodeHtmlEntities() {
|
|
23
|
+
var text = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
24
|
+
return text.replace(/ /g, ' ').replace(/</g, '<').replace(/>/g, '>').replace(/&/g, '&').replace(/"/g, '"').replace(/'/g, "'");
|
|
25
|
+
};
|
|
26
|
+
var tokenizeHtml = function tokenizeHtml(html) {
|
|
27
|
+
var tokens = [];
|
|
28
|
+
var match;
|
|
29
|
+
while ((match = htmlRegex.exec(html)) !== null) {
|
|
30
|
+
var selfClosingTag = match[1];
|
|
31
|
+
var openingTag = match[2];
|
|
32
|
+
var closingTag = match[3];
|
|
33
|
+
var textContent = match[4];
|
|
34
|
+
if (selfClosingTag) {
|
|
35
|
+
tokens.push({
|
|
36
|
+
type: 'selfClosing',
|
|
37
|
+
tagName: selfClosingTag.toLowerCase()
|
|
38
|
+
});
|
|
39
|
+
} else if (openingTag) {
|
|
40
|
+
tokens.push({
|
|
41
|
+
type: 'open',
|
|
42
|
+
tagName: openingTag.toLowerCase()
|
|
43
|
+
});
|
|
44
|
+
} else if (closingTag) {
|
|
45
|
+
tokens.push({
|
|
46
|
+
type: 'close',
|
|
47
|
+
tagName: closingTag.toLowerCase()
|
|
48
|
+
});
|
|
49
|
+
} else if (textContent) {
|
|
50
|
+
if (textContent !== null && textContent !== void 0 && textContent.trim()) {
|
|
51
|
+
tokens.push({
|
|
52
|
+
type: 'text',
|
|
53
|
+
content: decodeHtmlEntities(textContent)
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return tokens;
|
|
59
|
+
};
|
|
60
|
+
var buildListItem = function buildListItem() {
|
|
61
|
+
var content = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : [];
|
|
62
|
+
// Check if content has only text/inline elements
|
|
63
|
+
var hasOnlyInlineContent = content.every(function (node) {
|
|
64
|
+
return node.type === 'text' || node.type === 'hardBreak' || !node.type;
|
|
65
|
+
});
|
|
66
|
+
if (hasOnlyInlineContent) {
|
|
67
|
+
// Wrap text content in a paragraph
|
|
68
|
+
return li([p.apply(void 0, _toConsumableArray(content))]);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// Content has block elements (like nested lists), use as-is
|
|
72
|
+
return li(content);
|
|
73
|
+
};
|
|
74
|
+
var blockToAdf = function blockToAdf(tagName) {
|
|
75
|
+
var content = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : [];
|
|
76
|
+
switch (tagName) {
|
|
77
|
+
case 'p':
|
|
78
|
+
return p.apply(void 0, _toConsumableArray(content));
|
|
79
|
+
case 'ul':
|
|
80
|
+
return ul.apply(void 0, _toConsumableArray(content));
|
|
81
|
+
case 'li':
|
|
82
|
+
return buildListItem(content);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
var inlineToAdf = function inlineToAdf(tagName, content) {
|
|
86
|
+
switch (tagName) {
|
|
87
|
+
case 'b':
|
|
88
|
+
case 'strong':
|
|
89
|
+
return b(content);
|
|
90
|
+
case 'code':
|
|
91
|
+
return code(content);
|
|
92
|
+
case 'a':
|
|
93
|
+
case 'inlineCard':
|
|
94
|
+
return inlineCard({
|
|
95
|
+
url: content
|
|
96
|
+
});
|
|
97
|
+
default:
|
|
98
|
+
return text(content);
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
var parseTokensToAdf = function parseTokensToAdf(tokens) {
|
|
102
|
+
var stack = [{
|
|
103
|
+
type: 'root',
|
|
104
|
+
content: []
|
|
105
|
+
}];
|
|
106
|
+
var currentMarks = [];
|
|
107
|
+
var _loop = function _loop() {
|
|
108
|
+
var token = tokens[i];
|
|
109
|
+
var current = stack[stack.length - 1];
|
|
110
|
+
switch (token.type) {
|
|
111
|
+
case 'text':
|
|
112
|
+
if (token.content) {
|
|
113
|
+
var _currentMarks;
|
|
114
|
+
var inlineAdfNode = inlineToAdf((_currentMarks = currentMarks) === null || _currentMarks === void 0 || (_currentMarks = _currentMarks[0]) === null || _currentMarks === void 0 ? void 0 : _currentMarks.type, token.content);
|
|
115
|
+
current.content.push(inlineAdfNode);
|
|
116
|
+
}
|
|
117
|
+
break;
|
|
118
|
+
case 'open':
|
|
119
|
+
if (INLINE_TAG_NAMES.includes(token.tagName)) {
|
|
120
|
+
currentMarks.push({
|
|
121
|
+
type: token.tagName
|
|
122
|
+
});
|
|
123
|
+
} else if (BLOCK_TAG_NAMES.includes(token.tagName)) {
|
|
124
|
+
stack.push({
|
|
125
|
+
type: token.tagName,
|
|
126
|
+
content: []
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
break;
|
|
130
|
+
case 'close':
|
|
131
|
+
// Inline formatting
|
|
132
|
+
if (token.tagName && INLINE_TAG_NAMES.includes(token.tagName)) {
|
|
133
|
+
currentMarks = currentMarks.filter(function (m) {
|
|
134
|
+
return m.type !== token.tagName;
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
// Block elements
|
|
138
|
+
else if (stack.length > 1) {
|
|
139
|
+
var closed = stack.pop();
|
|
140
|
+
var parent = stack[stack.length - 1];
|
|
141
|
+
var adfNode = blockToAdf(closed === null || closed === void 0 ? void 0 : closed.type, closed === null || closed === void 0 ? void 0 : closed.content);
|
|
142
|
+
if (adfNode) {
|
|
143
|
+
parent.content.push(adfNode);
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
break;
|
|
147
|
+
}
|
|
148
|
+
};
|
|
149
|
+
for (var i = 0; i < tokens.length; i++) {
|
|
150
|
+
_loop();
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
// Return root content
|
|
154
|
+
return stack[0].content;
|
|
155
|
+
};
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Convert HTML string to ADF format
|
|
159
|
+
*
|
|
160
|
+
* This is a simplified version specific for RovoChatAction prompt message
|
|
161
|
+
* and does not support all ADF offered via @atlaskit/adf-utils
|
|
162
|
+
*/
|
|
163
|
+
var htmlToAdf = function htmlToAdf(html) {
|
|
164
|
+
try {
|
|
165
|
+
var tokens = tokenizeHtml(html);
|
|
166
|
+
var adfContent = parseTokensToAdf(tokens);
|
|
167
|
+
return doc.apply(void 0, _toConsumableArray(adfContent));
|
|
168
|
+
} catch (_unused) {
|
|
169
|
+
return html;
|
|
170
|
+
}
|
|
171
|
+
};
|
|
172
|
+
export default htmlToAdf;
|
|
@@ -1,16 +1,23 @@
|
|
|
1
1
|
import _extends from "@babel/runtime/helpers/extends";
|
|
2
|
+
import _asyncToGenerator from "@babel/runtime/helpers/asyncToGenerator";
|
|
3
|
+
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
2
4
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
3
5
|
var _excluded = ["onClick", "prompts", "testId"];
|
|
6
|
+
import _regeneratorRuntime from "@babel/runtime/regenerator";
|
|
7
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
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; }
|
|
4
9
|
import React, { useCallback, useMemo } from 'react';
|
|
5
10
|
import { useIntl } from 'react-intl-next';
|
|
6
11
|
import { InternalActionName } from '../../../../../constants';
|
|
7
12
|
import { messages } from '../../../../../messages';
|
|
8
13
|
import { useFlexibleUiContext } from '../../../../../state/flexible-ui-context';
|
|
14
|
+
import useInvokeClientAction from '../../../../../state/hooks/use-invoke-client-action';
|
|
9
15
|
import useRovoChat from '../../../../../state/hooks/use-rovo-chat';
|
|
10
16
|
import AiChapterIcon from '../../../assets/ai-chapter-icon';
|
|
11
17
|
import AIEditIcon from '../../../assets/ai-edit-icon';
|
|
12
18
|
import AISearchIcon from '../../../assets/ai-search-icon';
|
|
13
19
|
import Action from '../action';
|
|
20
|
+
import htmlToAdf from './html-to-adf';
|
|
14
21
|
export var RovoChatPromptKey = /*#__PURE__*/function (RovoChatPromptKey) {
|
|
15
22
|
RovoChatPromptKey["RECOMMEND_OTHER_SOURCES"] = "recommend-other-sources";
|
|
16
23
|
RovoChatPromptKey["SHOW_OTHER_MENTIONS"] = "show-other-mentions";
|
|
@@ -23,7 +30,6 @@ var getContext = function getContext(intl, product) {
|
|
|
23
30
|
case 'CONFLUENCE':
|
|
24
31
|
return {
|
|
25
32
|
contextLong: intl.formatMessage(messages.rovo_prompt_context_confluence_page),
|
|
26
|
-
contextLongPlural: intl.formatMessage(messages.rovo_prompt_context_confluence_page_plural),
|
|
27
33
|
contextShort: intl.formatMessage(messages.rovo_prompt_context_confluence_page_short)
|
|
28
34
|
};
|
|
29
35
|
case 'JSW':
|
|
@@ -32,24 +38,29 @@ var getContext = function getContext(intl, product) {
|
|
|
32
38
|
case 'JPD':
|
|
33
39
|
return {
|
|
34
40
|
contextLong: intl.formatMessage(messages.rovo_prompt_context_jira_work_item),
|
|
35
|
-
contextLongPlural: intl.formatMessage(messages.rovo_prompt_context_jira_work_item_plural),
|
|
36
41
|
contextShort: intl.formatMessage(messages.rovo_prompt_context_jira_work_item_short)
|
|
37
42
|
};
|
|
38
43
|
}
|
|
39
44
|
};
|
|
40
|
-
var getPromptAction = function getPromptAction(promptKey, intl
|
|
45
|
+
var getPromptAction = function getPromptAction(promptKey, intl) {
|
|
41
46
|
var _getContext;
|
|
47
|
+
var url = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
48
|
+
var product = arguments.length > 3 ? arguments[3] : undefined;
|
|
42
49
|
var _ref = (_getContext = getContext(intl, product)) !== null && _getContext !== void 0 ? _getContext : {
|
|
43
50
|
contextLong: intl.formatMessage(messages.rovo_prompt_context_generic),
|
|
44
|
-
contextLongPlural: intl.formatMessage(messages.rovo_prompt_context_generic_plural),
|
|
45
51
|
contextShort: intl.formatMessage(messages.rovo_prompt_context_generic)
|
|
46
52
|
},
|
|
47
53
|
contextLong = _ref.contextLong,
|
|
48
|
-
contextLongPlural = _ref.contextLongPlural,
|
|
49
54
|
contextShort = _ref.contextShort;
|
|
50
55
|
switch (promptKey) {
|
|
51
56
|
case RovoChatPromptKey.RECOMMEND_OTHER_SOURCES:
|
|
52
57
|
var label_recommend = intl.formatMessage(messages.rovo_prompt_button_recommend_other_sources);
|
|
58
|
+
var html_recommend = intl.formatMessage(messages.rovo_prompt_message_recommend_other_sources, {
|
|
59
|
+
context: contextLong,
|
|
60
|
+
url: url
|
|
61
|
+
}, {
|
|
62
|
+
ignoreTag: true
|
|
63
|
+
});
|
|
53
64
|
return {
|
|
54
65
|
icon: /*#__PURE__*/React.createElement(AIEditIcon, null),
|
|
55
66
|
content: label_recommend,
|
|
@@ -57,12 +68,17 @@ var getPromptAction = function getPromptAction(promptKey, intl, url, product) {
|
|
|
57
68
|
data: {
|
|
58
69
|
name: label_recommend,
|
|
59
70
|
dialogues: [],
|
|
60
|
-
|
|
61
|
-
prompt: "From this ".concat(url, " and the ").concat(contextLong, " I\u2019m viewing now as context:\n- Search across all sources I can access for items that discuss similar concepts, themes, or problems, or that reference similar or closely related sources (including links to the same or related pages, issues, or docs).\n- Return the results as a list or table with columns: Item, Type, Short summary, and Why it\u2019s similar.\n- For each result, give a one\u2011sentence Short summary of what the item is about.\n- In Why it\u2019s similar, briefly explain (in a phrase or short sentence) what makes it related to this Smart Link and/or the item I\u2019m viewing (for example: same project, similar decision, shared requirements, overlapping stakeholders, similar metrics, or referencing related docs).\n- Order the list from most to least relevant based on Rovo\u2019s assessment of semantic similarity to both the Smart Link target and the current item. Prioritize items that I do not own or have not contributed to.\n- If there are more than 5 results, show the 5 most relevant and state how many additional items you found.")
|
|
71
|
+
prompt: htmlToAdf(html_recommend)
|
|
62
72
|
}
|
|
63
73
|
};
|
|
64
74
|
case RovoChatPromptKey.SHOW_OTHER_MENTIONS:
|
|
65
75
|
var label_other_mentions = intl.formatMessage(messages.rovo_prompt_button_show_other_mentions);
|
|
76
|
+
var html_other_mentions = intl.formatMessage(messages.rovo_prompt_message_show_other_mentions, {
|
|
77
|
+
context: contextLong,
|
|
78
|
+
url: url
|
|
79
|
+
}, {
|
|
80
|
+
ignoreTag: true
|
|
81
|
+
});
|
|
66
82
|
return {
|
|
67
83
|
icon: /*#__PURE__*/React.createElement(AiChapterIcon, null),
|
|
68
84
|
content: label_other_mentions,
|
|
@@ -70,14 +86,19 @@ var getPromptAction = function getPromptAction(promptKey, intl, url, product) {
|
|
|
70
86
|
data: {
|
|
71
87
|
name: label_other_mentions,
|
|
72
88
|
dialogues: [],
|
|
73
|
-
|
|
74
|
-
prompt: "From this ".concat(url, " and the ").concat(contextLong, " I\u2019m viewing now:\n- Search across all ").concat(contextLongPlural, " I can access for other items that contain this exact Smart Link (same underlying URL/resource).\n- List all matching items in a table with columns: Item, Type, Short summary, How this item uses the link, and Relevance to current item.\n- For Short summary, give a one\u2011sentence description of what the page/issue is about.\n- For How this item uses the link, briefly explain the role this link plays there (e.g., decision doc, background context, implementation details, status update).\n- For Relevance to current item, compare each item to the page/issue I\u2019m viewing now and label it High, Medium, or Low relevance, with a short reason (a phrase or single clause).\n- If there are more than 15 matches, show the 15 most relevant and tell me how many additional matches exist.")
|
|
89
|
+
prompt: htmlToAdf(html_other_mentions)
|
|
75
90
|
}
|
|
76
91
|
};
|
|
77
92
|
case RovoChatPromptKey.SUGGEST_IMPROVEMENT:
|
|
78
93
|
var label_improvement = intl.formatMessage(messages.rovo_prompt_button_suggest_improvement, {
|
|
79
94
|
context: contextShort
|
|
80
95
|
});
|
|
96
|
+
var html_improvement = intl.formatMessage(messages.rovo_prompt_message_suggest_improvement, {
|
|
97
|
+
context: contextLong,
|
|
98
|
+
url: url
|
|
99
|
+
}, {
|
|
100
|
+
ignoreTag: true
|
|
101
|
+
});
|
|
81
102
|
return {
|
|
82
103
|
icon: /*#__PURE__*/React.createElement(AISearchIcon, null),
|
|
83
104
|
content: label_improvement,
|
|
@@ -85,8 +106,7 @@ var getPromptAction = function getPromptAction(promptKey, intl, url, product) {
|
|
|
85
106
|
data: {
|
|
86
107
|
name: label_improvement,
|
|
87
108
|
dialogues: [],
|
|
88
|
-
|
|
89
|
-
prompt: "Using the ".concat(contextLong, " I\u2019m viewing now, plus all files and links referenced in it (including this ").concat(url, "):\n- Identify unclear reasoning, missing context, or contradictions between the item and its linked files.\n- Call out any places where assumptions are not backed up by data or prior docs.\n- Stay concise: summarize your findings in no more than three short paragraphs of content listed as bullets of no more than a couple of sentences long focused only on the two points above.\n- After presenting that summary, ask me explicitly if I want you to go deeper. Only if I say yes, then:\n- Suggest concrete rewrites (bullets or short paragraphs) to make the argument clearer, more concise, and better aligned with the supporting files.\n- Propose 3\u20135 follow\u2011up edits or additions that would make this item and its linked docs \u201Cshare\u2011ready\u201D for stakeholders.")
|
|
109
|
+
prompt: htmlToAdf(html_improvement)
|
|
90
110
|
}
|
|
91
111
|
};
|
|
92
112
|
}
|
|
@@ -105,15 +125,32 @@ var RovoChatAction = function RovoChatAction(_ref2) {
|
|
|
105
125
|
sendPromptMessage = _useRovoChat.sendPromptMessage;
|
|
106
126
|
var context = useFlexibleUiContext();
|
|
107
127
|
var data = context === null || context === void 0 || (_context$actions = context.actions) === null || _context$actions === void 0 ? void 0 : _context$actions[InternalActionName.RovoChatAction];
|
|
108
|
-
var
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
128
|
+
var invoke = useInvokeClientAction({});
|
|
129
|
+
var _onClick = useCallback(function (promptData, promptKey) {
|
|
130
|
+
if (promptData && data !== null && data !== void 0 && data.invokeAction) {
|
|
131
|
+
invoke(_objectSpread(_objectSpread({}, data === null || data === void 0 ? void 0 : data.invokeAction), {}, {
|
|
132
|
+
actionFn: function () {
|
|
133
|
+
var _actionFn = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
|
|
134
|
+
return _regeneratorRuntime.wrap(function _callee$(_context) {
|
|
135
|
+
while (1) switch (_context.prev = _context.next) {
|
|
136
|
+
case 0:
|
|
137
|
+
return _context.abrupt("return", sendPromptMessage(promptData));
|
|
138
|
+
case 1:
|
|
139
|
+
case "end":
|
|
140
|
+
return _context.stop();
|
|
141
|
+
}
|
|
142
|
+
}, _callee);
|
|
143
|
+
}));
|
|
144
|
+
function actionFn() {
|
|
145
|
+
return _actionFn.apply(this, arguments);
|
|
146
|
+
}
|
|
147
|
+
return actionFn;
|
|
148
|
+
}(),
|
|
149
|
+
prompt: promptKey
|
|
150
|
+
}));
|
|
114
151
|
onClickCallback === null || onClickCallback === void 0 || onClickCallback();
|
|
115
152
|
}
|
|
116
|
-
}, [onClickCallback, sendPromptMessage]);
|
|
153
|
+
}, [data === null || data === void 0 ? void 0 : data.invokeAction, invoke, onClickCallback, sendPromptMessage]);
|
|
117
154
|
var promptActions = useMemo(function () {
|
|
118
155
|
return prompts.map(function (promptKey, idx) {
|
|
119
156
|
var _ref3 = getPromptAction(promptKey, intl, data === null || data === void 0 ? void 0 : data.url, data === null || data === void 0 ? void 0 : data.product) || {},
|
|
@@ -126,7 +163,7 @@ var RovoChatAction = function RovoChatAction(_ref2) {
|
|
|
126
163
|
icon: icon,
|
|
127
164
|
key: promptKey,
|
|
128
165
|
onClick: function onClick() {
|
|
129
|
-
return _onClick(promptData);
|
|
166
|
+
return _onClick(promptData, promptKey);
|
|
130
167
|
},
|
|
131
168
|
testId: "".concat(testId, "-").concat(idx + 1),
|
|
132
169
|
tooltipMessage: tooltipMessage
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ClockIcon from '@atlaskit/icon/core/clock';
|
|
3
|
+
import { fg } from '@atlaskit/platform-feature-flags';
|
|
3
4
|
var RelatedLinksActionIcon = function RelatedLinksActionIcon() {
|
|
4
5
|
return /*#__PURE__*/React.createElement(ClockIcon, {
|
|
5
6
|
color: "currentColor",
|
|
6
7
|
spacing: "spacious",
|
|
7
|
-
label:
|
|
8
|
+
label: fg('navx-3698-flexible-card-a11y-fix') ? '' : 'View related links...'
|
|
8
9
|
});
|
|
9
10
|
};
|
|
10
11
|
export default RelatedLinksActionIcon;
|
|
@@ -39,7 +39,11 @@ var HoverCardResolvedView = function HoverCardResolvedView(_ref) {
|
|
|
39
39
|
var isRovoSummaryEnabled = fg('platform_sl_3p_auth_rovo_action_kill_switch') ?
|
|
40
40
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
41
41
|
useMemo(function () {
|
|
42
|
-
return (cardState === null || cardState === void 0 ? void 0 : cardState.details) && extractRovoChatAction(
|
|
42
|
+
return (cardState === null || cardState === void 0 ? void 0 : cardState.details) && extractRovoChatAction({
|
|
43
|
+
response: cardState.details,
|
|
44
|
+
rovoConfig: rovoConfig,
|
|
45
|
+
actionOptions: actionOptions
|
|
46
|
+
}) !== undefined;
|
|
43
47
|
}, [actionOptions, cardState === null || cardState === void 0 ? void 0 : cardState.details, rovoConfig]) : false;
|
|
44
48
|
useEffect(function () {
|
|
45
49
|
// Since this hover view is only rendered on resolved status,
|
|
@@ -15,7 +15,7 @@ import LinkWarningModal from './LinkWarningModal';
|
|
|
15
15
|
import { useLinkWarningModal } from './LinkWarningModal/hooks/use-link-warning-modal';
|
|
16
16
|
var PACKAGE_DATA = {
|
|
17
17
|
packageName: "@atlaskit/smart-card",
|
|
18
|
-
packageVersion: "
|
|
18
|
+
packageVersion: "0.0.0-development",
|
|
19
19
|
componentName: 'linkUrl'
|
|
20
20
|
};
|
|
21
21
|
var Anchor = 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::ba09a8b50ef409ef59594023566396c8>>
|
|
7
7
|
* @codegenCommand yarn workspace @atlassian/analytics-tooling run analytics:codegen smart-card
|
|
8
8
|
*/
|
|
9
9
|
export type PackageMetaDataContextType = {
|
|
@@ -69,6 +69,14 @@ export type ButtonClickedIssueStatusUpdateAttributesType = {
|
|
|
69
69
|
resourceType: string | null;
|
|
70
70
|
};
|
|
71
71
|
export type ButtonClickedAiSummaryAttributesType = {};
|
|
72
|
+
export type ButtonClickedRovoChatPromptAttributesType = {
|
|
73
|
+
actionType: string | null;
|
|
74
|
+
id: string | null;
|
|
75
|
+
definitionId: string | null;
|
|
76
|
+
display: 'inline' | 'block' | 'embed' | 'embedPreview' | 'flexible' | 'hoverCardPreview' | 'url' | null;
|
|
77
|
+
resourceType: string | null;
|
|
78
|
+
prompt: string | null;
|
|
79
|
+
};
|
|
72
80
|
export type ButtonClickedCopySummaryAttributesType = {};
|
|
73
81
|
export type SummaryViewedAttributesType = {
|
|
74
82
|
fromCache: boolean | null;
|
|
@@ -274,6 +282,9 @@ export type AnalyticsEventAttributes = {
|
|
|
274
282
|
/**
|
|
275
283
|
* fired when an ai summary is clicked */
|
|
276
284
|
'ui.button.clicked.aiSummary': ButtonClickedAiSummaryAttributesType;
|
|
285
|
+
/**
|
|
286
|
+
* Fired when sending prompt to RovoChat via click */
|
|
287
|
+
'ui.button.clicked.rovoChatPrompt': ButtonClickedRovoChatPromptAttributesType;
|
|
277
288
|
/**
|
|
278
289
|
* fired when the copy ai summary button is clicked */
|
|
279
290
|
'ui.button.clicked.copySummary': ButtonClickedCopySummaryAttributesType;
|
|
@@ -3,5 +3,14 @@ import type { ProductType } from '@atlaskit/linking-common';
|
|
|
3
3
|
import type { RovoChatActionData } from '../../../state/flexible-ui-context/types';
|
|
4
4
|
import type { RovoConfig } from '../../../state/hooks/use-rovo-config';
|
|
5
5
|
import { type InternalCardActionOptions as CardActionOptions } from '../../../view/Card/types';
|
|
6
|
-
|
|
6
|
+
import type { FlexibleCardProps } from '../../../view/FlexibleCard/types';
|
|
7
|
+
type ExtractInvokeRovoChatActionParam = {
|
|
8
|
+
actionOptions?: CardActionOptions;
|
|
9
|
+
appearance?: FlexibleCardProps['appearance'];
|
|
10
|
+
id?: string;
|
|
11
|
+
product?: ProductType;
|
|
12
|
+
response: JsonLd.Response;
|
|
13
|
+
rovoConfig?: RovoConfig;
|
|
14
|
+
};
|
|
15
|
+
declare const extractRovoChatAction: ({ actionOptions, appearance, id, product, response, rovoConfig, }: ExtractInvokeRovoChatActionParam) => RovoChatActionData | undefined;
|
|
7
16
|
export default extractRovoChatAction;
|
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 RovoChatActionMessageKey = 'rovo_prompt_context_generic' | 'rovo_prompt_context_generic_plural' | 'rovo_prompt_context_confluence_page' | '
|
|
3
|
+
export type RovoChatActionMessageKey = 'rovo_prompt_context_generic' | 'rovo_prompt_context_generic_plural' | 'rovo_prompt_context_confluence_page' | 'rovo_prompt_context_confluence_page_short' | 'rovo_prompt_context_jira_work_item' | 'rovo_prompt_context_jira_work_item_short' | 'rovo_prompt_button_recommend_other_sources' | 'rovo_prompt_message_recommend_other_sources' | 'rovo_prompt_button_show_other_mentions' | 'rovo_prompt_message_show_other_mentions' | 'rovo_prompt_button_suggest_improvement' | 'rovo_prompt_message_suggest_improvement';
|
|
4
4
|
export type MessageKey = 'assigned_to' | 'ai_summarize' | 'change_status' | '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' | 'compass_applied_components_count' | '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_descriptionGalaxia' | 'follow_project' | 'follow_goal' | 'follow_goal_description' | 'follow_project_error' | 'follow_project_errorGalaxia' | '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' | 'owned_by_override' | 'preview_description' | 'preview_improved' | 'preview_modal' | 'preview_panel' | '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_descriptionGalaxia' | 'unfollow_project' | 'unfollow_project_error' | 'unfollow_project_errorGalaxia' | 'unfollow_goal' | 'unfollow_goal_description' | 'unfollow_goal_error' | 'user_attributes' | 'view' | 'viewIn' | 'viewOriginal' | 'actions' | 'add_account' | 'cancel' | 'close' | 'connect_to' | 'connect_account_description' | 'retry' | 'save' | 'unlink_account' | RequestAccessMessageKey | 'related' | 'generic_error_message' | 'related_links_modal_error_title' | 'related_links_modal_error_description' | 'related_links_modal_unavailable_title' | 'related_links_modal_unavailable_description' | 'related_links_modal_title' | 'related_links_view_related_urls' | 'related_links_view_related_links' | 'related_links_found_in' | 'related_links_includes_links_to' | 'related_links_not_found' | 'join_to_viewIssueTermRefresh' | 'open_issue_in_jiraIssueTermRefresh' | 'request_access_to_viewIssueTermRefresh' | 'team_members_count' | 'status_change_permission_errorIssueTermRefresh' | 'connect_unauthorised_account_description_appify' | 'connect_unauthorised_account_description_no_provider_appify' | 'learn_more_about_connecting_account_experiment_shorter' | 'learn_more_about_connecting_account_appify' | 'rovo_summary_loading' | 'ai_disclaimer' | RovoChatActionMessageKey;
|
|
5
5
|
type Messages = {
|
|
6
6
|
[K in MessageKey]: MessageDescriptor;
|
|
@@ -6,7 +6,10 @@ export type UseInvokeClientActionProps = {
|
|
|
6
6
|
*/
|
|
7
7
|
fireEvent?: FireEventFunction;
|
|
8
8
|
};
|
|
9
|
-
export type InvokeClientActionSubjectId = 'copyLink' | 'downloadDocument' | 'invokePreviewScreen' | 'shortcutGoToLink';
|
|
9
|
+
export type InvokeClientActionSubjectId = 'copyLink' | 'downloadDocument' | 'invokePreviewScreen' | 'rovoChatPrompt' | 'shortcutGoToLink';
|
|
10
|
+
type InvokeRovoChatClientActionProps = {
|
|
11
|
+
prompt?: string;
|
|
12
|
+
};
|
|
10
13
|
export type InvokeClientActionProps = {
|
|
11
14
|
/**
|
|
12
15
|
* Invoke action to execute.
|
|
@@ -43,5 +46,6 @@ export type InvokeClientActionProps = {
|
|
|
43
46
|
* Resource type for analytics purposes.
|
|
44
47
|
*/
|
|
45
48
|
resourceType?: string;
|
|
46
|
-
};
|
|
49
|
+
} & InvokeRovoChatClientActionProps;
|
|
47
50
|
export type InvokeClientActionHandler = (opts: InvokeClientActionProps) => Promise<void>;
|
|
51
|
+
export {};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Convert HTML string to ADF format
|
|
3
|
+
*
|
|
4
|
+
* This is a simplified version specific for RovoChatAction prompt message
|
|
5
|
+
* and does not support all ADF offered via @atlaskit/adf-utils
|
|
6
|
+
*/
|
|
7
|
+
declare const htmlToAdf: (html: string) => string | import("packages/editor/adf-schema/dist/types").DocNode;
|
|
8
|
+
export default htmlToAdf;
|