@atlaskit/rovo-triggers 10.15.0 → 10.17.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 CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/rovo-triggers
2
2
 
3
+ ## 10.17.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`12fe51b74a9a6`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/12fe51b74a9a6) -
8
+ Add a `searchPageSummarizeInChat` `ChatEntryPoint` and attach it to the chat-new event fired by
9
+ the search-page "Summarize in chat" action, so the resulting Rovo Chat is attributed to the
10
+ summarize entry point.
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+
16
+ ## 10.16.0
17
+
18
+ ### Minor Changes
19
+
20
+ - [`0c56298276361`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0c56298276361) -
21
+ Add a Rovo Remix PubSub contract for editor and renderer consumers, used by the
22
+ cc-ce-maui-remix-menu-multivariant variant2 cohort.
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 10.15.0
4
29
 
5
30
  ### Minor Changes
@@ -6,5 +6,6 @@ Object.defineProperty(exports, "__esModule", {
6
6
  exports.ChatEntryPoint = void 0;
7
7
  var ChatEntryPoint = exports.ChatEntryPoint = /*#__PURE__*/function (ChatEntryPoint) {
8
8
  ChatEntryPoint["SEARCH_PAGE_AUTO_OPEN_CHAT"] = "searchPageAutoOpenChat";
9
+ ChatEntryPoint["SEARCH_PAGE_SUMMARIZE_IN_CHAT"] = "searchPageSummarizeInChat";
9
10
  return ChatEntryPoint;
10
11
  }({});
package/dist/cjs/main.js CHANGED
@@ -4,21 +4,21 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.useSubscribeAll = exports.useSubscribe = exports.usePublish = exports.Subscriber = void 0;
7
+ exports.useSubscribeAll = exports.useSubscribe = exports.usePublish = exports.publish = exports.Subscriber = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _toArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toArray"));
10
10
  var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
11
11
  var _react = require("react");
12
12
  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; }
13
13
  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) { (0, _defineProperty2.default)(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; }
14
- function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
14
+ function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; } /* eslint-disable @atlaskit/platform/one-value-export-per-file -- command callers cannot use hooks */
15
15
  var MAX_CONSUMED_EVENT_KEYS = 5000;
16
16
  var ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-changed',
17
17
  // Internal signals that must never overwrite the publish queue — they would
18
18
  // cause `triggerLatest` subscribers (e.g. PubSubListener) to replay them
19
19
  // instead of the real action event (e.g. open-browse-agent-modal) that
20
20
  // originally opened the chat.
21
- 'smartlinks-subscription-changed', 'smartlinks-context-payload', 'set-message-context', 'jira-create-context-payload']);
21
+ 'smartlinks-subscription-changed', 'smartlinks-context-payload', 'set-message-context', 'jira-create-context-payload', 'submit-rovo-remix']);
22
22
  var isIgnoredForTriggerLatest = function isIgnoredForTriggerLatest(type) {
23
23
  return ignoredTriggerLatestEvents.has(type);
24
24
  };
@@ -164,6 +164,9 @@ var createPubSub = function createPubSub() {
164
164
  };
165
165
  };
166
166
  var pubSub = createPubSub();
167
+ var publish = exports.publish = function publish(topic, payload) {
168
+ pubSub.publish(topic, payload);
169
+ };
167
170
  var usePubSub = function usePubSub() {
168
171
  return pubSub;
169
172
  };
package/dist/cjs/types.js CHANGED
@@ -10,6 +10,7 @@ var Topics = exports.Topics = {
10
10
  AI_MATE_INSERT_URLS: 'ai-mate-chat-inserts',
11
11
  AI_MATE_CHAT_INPUT_OVERLAY: 'ai-mate-chat-input-overlay',
12
12
  AI_MATE_AIFC: 'ai-mate-aifc',
13
+ ROVO_REMIX: 'rovo-remix',
13
14
  AVP: 'avp'
14
15
  };
15
16
 
@@ -1,4 +1,5 @@
1
1
  export let ChatEntryPoint = /*#__PURE__*/function (ChatEntryPoint) {
2
2
  ChatEntryPoint["SEARCH_PAGE_AUTO_OPEN_CHAT"] = "searchPageAutoOpenChat";
3
+ ChatEntryPoint["SEARCH_PAGE_SUMMARIZE_IN_CHAT"] = "searchPageSummarizeInChat";
3
4
  return ChatEntryPoint;
4
5
  }({});
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @atlaskit/platform/one-value-export-per-file -- command callers cannot use hooks */
1
2
  import { useCallback, useEffect, useLayoutEffect, useRef } from 'react';
2
3
  const MAX_CONSUMED_EVENT_KEYS = 5000;
3
4
  const ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-changed',
@@ -5,7 +6,7 @@ const ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-cha
5
6
  // cause `triggerLatest` subscribers (e.g. PubSubListener) to replay them
6
7
  // instead of the real action event (e.g. open-browse-agent-modal) that
7
8
  // originally opened the chat.
8
- 'smartlinks-subscription-changed', 'smartlinks-context-payload', 'set-message-context', 'jira-create-context-payload']);
9
+ 'smartlinks-subscription-changed', 'smartlinks-context-payload', 'set-message-context', 'jira-create-context-payload', 'submit-rovo-remix']);
9
10
  const isIgnoredForTriggerLatest = type => ignoredTriggerLatestEvents.has(type);
10
11
  const createPubSub = () => {
11
12
  let subscribedEvents = {};
@@ -149,6 +150,9 @@ const createPubSub = () => {
149
150
  };
150
151
  };
151
152
  const pubSub = createPubSub();
153
+ export const publish = (topic, payload) => {
154
+ pubSub.publish(topic, payload);
155
+ };
152
156
  const usePubSub = () => {
153
157
  return pubSub;
154
158
  };
@@ -4,6 +4,7 @@ export const Topics = {
4
4
  AI_MATE_INSERT_URLS: 'ai-mate-chat-inserts',
5
5
  AI_MATE_CHAT_INPUT_OVERLAY: 'ai-mate-chat-input-overlay',
6
6
  AI_MATE_AIFC: 'ai-mate-aifc',
7
+ ROVO_REMIX: 'rovo-remix',
7
8
  AVP: 'avp'
8
9
  };
9
10
 
@@ -1,4 +1,5 @@
1
1
  export var ChatEntryPoint = /*#__PURE__*/function (ChatEntryPoint) {
2
2
  ChatEntryPoint["SEARCH_PAGE_AUTO_OPEN_CHAT"] = "searchPageAutoOpenChat";
3
+ ChatEntryPoint["SEARCH_PAGE_SUMMARIZE_IN_CHAT"] = "searchPageSummarizeInChat";
3
4
  return ChatEntryPoint;
4
5
  }({});
package/dist/esm/main.js CHANGED
@@ -4,6 +4,7 @@ import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
4
4
  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; }
5
5
  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; }
6
6
  function _arrayLikeToArray(r, a) { (null == a || a > r.length) && (a = r.length); for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e]; return n; }
7
+ /* eslint-disable @atlaskit/platform/one-value-export-per-file -- command callers cannot use hooks */
7
8
  import { useCallback, useEffect, useLayoutEffect, useRef } from 'react';
8
9
  var MAX_CONSUMED_EVENT_KEYS = 5000;
9
10
  var ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-changed',
@@ -11,7 +12,7 @@ var ignoredTriggerLatestEvents = new Set(['editor-context-payload', 'agent-chang
11
12
  // cause `triggerLatest` subscribers (e.g. PubSubListener) to replay them
12
13
  // instead of the real action event (e.g. open-browse-agent-modal) that
13
14
  // originally opened the chat.
14
- 'smartlinks-subscription-changed', 'smartlinks-context-payload', 'set-message-context', 'jira-create-context-payload']);
15
+ 'smartlinks-subscription-changed', 'smartlinks-context-payload', 'set-message-context', 'jira-create-context-payload', 'submit-rovo-remix']);
15
16
  var isIgnoredForTriggerLatest = function isIgnoredForTriggerLatest(type) {
16
17
  return ignoredTriggerLatestEvents.has(type);
17
18
  };
@@ -157,6 +158,9 @@ var createPubSub = function createPubSub() {
157
158
  };
158
159
  };
159
160
  var pubSub = createPubSub();
161
+ export var publish = function publish(topic, payload) {
162
+ pubSub.publish(topic, payload);
163
+ };
160
164
  var usePubSub = function usePubSub() {
161
165
  return pubSub;
162
166
  };
package/dist/esm/types.js CHANGED
@@ -4,6 +4,7 @@ export var Topics = {
4
4
  AI_MATE_INSERT_URLS: 'ai-mate-chat-inserts',
5
5
  AI_MATE_CHAT_INPUT_OVERLAY: 'ai-mate-chat-input-overlay',
6
6
  AI_MATE_AIFC: 'ai-mate-aifc',
7
+ ROVO_REMIX: 'rovo-remix',
7
8
  AVP: 'avp'
8
9
  };
9
10
 
@@ -1,3 +1,4 @@
1
1
  export declare enum ChatEntryPoint {
2
- SEARCH_PAGE_AUTO_OPEN_CHAT = "searchPageAutoOpenChat"
2
+ SEARCH_PAGE_AUTO_OPEN_CHAT = "searchPageAutoOpenChat",
3
+ SEARCH_PAGE_SUMMARIZE_IN_CHAT = "searchPageSummarizeInChat"
3
4
  }
@@ -4,6 +4,7 @@ interface SubscribeOptions {
4
4
  triggerLatest?: boolean;
5
5
  consumeOnceKey?: string;
6
6
  }
7
+ export declare const publish: (topic: Topic, payload: Payload) => void;
7
8
  export declare const useSubscribe: ({ topic, triggerLatest, consumeOnceKey }: SubscribeOptions, callback: Callback) => void;
8
9
  export declare const useSubscribeAll: (callback: Callback) => void;
9
10
  export declare const usePublish: (topic: Topic) => ((payload: Payload) => void);
@@ -11,6 +11,7 @@ export declare const Topics: {
11
11
  readonly AI_MATE_INSERT_URLS: 'ai-mate-chat-inserts';
12
12
  readonly AI_MATE_CHAT_INPUT_OVERLAY: 'ai-mate-chat-input-overlay';
13
13
  readonly AI_MATE_AIFC: 'ai-mate-aifc';
14
+ readonly ROVO_REMIX: 'rovo-remix';
14
15
  readonly AVP: 'avp';
15
16
  };
16
17
  export type Topic = (typeof Topics)[keyof typeof Topics];
@@ -293,6 +294,27 @@ export type ChatSmartLink3PPostAuthLaunchPayload = PayloadCore<'chat-smartlink-3
293
294
  }>;
294
295
  export type OpenBrowseAgentPayload = PayloadCore<'open-browse-agent-modal'>;
295
296
  export type OpenBrowseAgentSidebarPayload = PayloadCore<'open-browse-agent-sidebar'>;
297
+ export type RovoRemixConsumer = 'editor' | 'renderer';
298
+ export type RovoRemixPreset = 'selection' | 'page';
299
+ export type RovoRemixOption = 'chart' | 'diagram' | 'infographic' | 'visual-aid' | 'slides' | 'whiteboard' | 'database' | 'custom' | 'image';
300
+ export type OpenRovoRemixSidebarPayload = PayloadCore<'open-rovo-remix-sidebar', {
301
+ remixConsumer: RovoRemixConsumer;
302
+ remixPreset: RovoRemixPreset;
303
+ }>;
304
+ export type UpdateRovoRemixPresetPayload = PayloadCore<'update-rovo-remix-preset', {
305
+ remixConsumer: RovoRemixConsumer;
306
+ remixPreset: RovoRemixPreset;
307
+ }>;
308
+ export type SubmitRovoRemixPayload = PayloadCore<'submit-rovo-remix', {
309
+ remixConsumer: RovoRemixConsumer;
310
+ remixPreset: RovoRemixPreset;
311
+ remixOption: RovoRemixOption;
312
+ remixSubType?: string;
313
+ userPrompt: string;
314
+ conversationId?: string;
315
+ }> & {
316
+ consumeOnce: true;
317
+ };
296
318
  export type EditorSuggestionRichContent = {
297
319
  type: 'text/adf';
298
320
  version: 1;
@@ -617,7 +639,7 @@ export type SmartlinksSubscriptionChangedPayload = PayloadCore<'smartlinks-subsc
617
639
  * is expected to be open at a time.
618
640
  */
619
641
  export type CloseInContextAifcModalPayload = PayloadCore<'close-in-context-aifc-modal'>;
620
- export type Payload = MessageSendPayload | ChatClosePayload | CloseInContextAifcModalPayload | SmartCreationModalOpenPayload | ChatNewPayload | InsightsOpenInChatPayload | InsightsChatExitedPayload | ChatDraftPayload | ChatSmartLink3PPostAuthLaunchPayload | EditorContextPayload | ChatOpenPayload | OpenBrowseAgentPayload | SmartlinksSubscriptionChangedPayload | OpenBrowseAgentSidebarPayload | EditorSuggestionPayload | EditorAgentChangedPayload | BrowserContextPayload | WhiteboardContextPayload | JiraCreateContextPayload | JiraInlineAgentCreationAgentAssignedPayload | JiraWorkItemsCreatingPayload | JiraWorkItemsCreatedPayload | JiraWorkItemsCreateFailedPayload | DatabaseContextPayload | ForgeAppAuthSuccess | ForgeAppAuthFailure | JiraWorkflowWizardActionsPayload | InsertPromptPayload | DashboardInsightsActionsPayload | SetChatContextPayload | InsertUrlsPayload | InsertSkillPayload | SelectActionPayload | AddChartToDashboardPayload | GenericExternalActionErrorPayload | OpenChatDebugModalPayload | OpenChatFeedbackModalPayload | JsmJourneyBuilderActionsPayload | StudioAutomationBuildUpdatePayload | SolutionArchitectHandoffPayload | SolutionPlanStateUpdatePayload | SolutionDraftAgentUpdatePayload | SolutionArchitectAgentActivationPayload | SolutionArchitectAgentActivationFlowStartedPayload | SolutionArchitectAgentActivationFlowStoppedPayload | UpdateAgentConfigurationPayload | StudioLandingPageRedirectPayload | UploadAndInsertMediaPayload | SmartLinksContextPayload | SpaceSelectedPayload | SpaceDeselectedPayload | RecommendedSpacesSelectedPayload | CustomSkillUpdatePayload | TaskPlanConfirmedPayload | TaskAskQuestionRenderedPayload | TaskPlanRenderedPayload | TaskSkipAllQuestionsPayload | TaskCancelPlanPayload | TaskAskQuestionConfirmedPayload | TaskModifyPlanRequestedPayload | TaskModifyPlanSubmittedPayload | ConfluenceContentFinalizedPayload;
642
+ export type Payload = MessageSendPayload | ChatClosePayload | CloseInContextAifcModalPayload | SmartCreationModalOpenPayload | ChatNewPayload | InsightsOpenInChatPayload | InsightsChatExitedPayload | ChatDraftPayload | ChatSmartLink3PPostAuthLaunchPayload | EditorContextPayload | ChatOpenPayload | OpenBrowseAgentPayload | SmartlinksSubscriptionChangedPayload | OpenBrowseAgentSidebarPayload | OpenRovoRemixSidebarPayload | UpdateRovoRemixPresetPayload | SubmitRovoRemixPayload | EditorSuggestionPayload | EditorAgentChangedPayload | BrowserContextPayload | WhiteboardContextPayload | JiraCreateContextPayload | JiraInlineAgentCreationAgentAssignedPayload | JiraWorkItemsCreatingPayload | JiraWorkItemsCreatedPayload | JiraWorkItemsCreateFailedPayload | DatabaseContextPayload | ForgeAppAuthSuccess | ForgeAppAuthFailure | JiraWorkflowWizardActionsPayload | InsertPromptPayload | DashboardInsightsActionsPayload | SetChatContextPayload | InsertUrlsPayload | InsertSkillPayload | SelectActionPayload | AddChartToDashboardPayload | GenericExternalActionErrorPayload | OpenChatDebugModalPayload | OpenChatFeedbackModalPayload | JsmJourneyBuilderActionsPayload | StudioAutomationBuildUpdatePayload | SolutionArchitectHandoffPayload | SolutionPlanStateUpdatePayload | SolutionDraftAgentUpdatePayload | SolutionArchitectAgentActivationPayload | SolutionArchitectAgentActivationFlowStartedPayload | SolutionArchitectAgentActivationFlowStoppedPayload | UpdateAgentConfigurationPayload | StudioLandingPageRedirectPayload | UploadAndInsertMediaPayload | SmartLinksContextPayload | SpaceSelectedPayload | SpaceDeselectedPayload | RecommendedSpacesSelectedPayload | CustomSkillUpdatePayload | TaskPlanConfirmedPayload | TaskAskQuestionRenderedPayload | TaskPlanRenderedPayload | TaskSkipAllQuestionsPayload | TaskCancelPlanPayload | TaskAskQuestionConfirmedPayload | TaskModifyPlanRequestedPayload | TaskModifyPlanSubmittedPayload | ConfluenceContentFinalizedPayload;
621
643
  export type TaskPlanConfirmedPayload = PayloadCore<'task-plan-confirmed', {
622
644
  conversationId: string;
623
645
  planTitle: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-triggers",
3
- "version": "10.15.0",
3
+ "version": "10.17.0",
4
4
  "description": "Provides various trigger events to drive Rovo Chat functionality, such as a publish-subscribe and URL parameter hooks",
5
5
  "author": "Atlassian Pty Ltd",
6
6
  "publishConfig": {
@@ -41,10 +41,10 @@
41
41
  "@af/integration-testing": "workspace:^",
42
42
  "@af/visual-regression": "workspace:^",
43
43
  "@atlaskit/css": "^1.0.0",
44
- "@atlaskit/primitives": "^22.2.0",
44
+ "@atlaskit/primitives": "^22.3.0",
45
45
  "@atlaskit/ssr": "workspace:^",
46
- "@atlassian/a11y-jest-testing": "^0.15.0",
47
- "@atlassian/conversation-assistant-service-api": "^16.4.0",
46
+ "@atlassian/a11y-jest-testing": "^0.16.0",
47
+ "@atlassian/conversation-assistant-service-api": "^16.8.0",
48
48
  "@atlassian/feature-flags-test-utils": "^1.2.0",
49
49
  "@atlassian/testing-library": "^0.11.0",
50
50
  "@testing-library/react": "^16.3.0",