@atlaskit/rovo-triggers 10.15.0 → 10.16.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 +12 -0
- package/dist/cjs/main.js +6 -3
- package/dist/cjs/types.js +1 -0
- package/dist/es2019/main.js +5 -1
- package/dist/es2019/types.js +1 -0
- package/dist/esm/main.js +5 -1
- package/dist/esm/types.js +1 -0
- package/dist/types/main.d.ts +1 -0
- package/dist/types/types.d.ts +23 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @atlaskit/rovo-triggers
|
|
2
2
|
|
|
3
|
+
## 10.16.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`0c56298276361`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/0c56298276361) -
|
|
8
|
+
Add a Rovo Remix PubSub contract for editor and renderer consumers, used by the
|
|
9
|
+
cc-ce-maui-remix-menu-multivariant variant2 cohort.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
3
15
|
## 10.15.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
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
package/dist/es2019/main.js
CHANGED
|
@@ -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
|
};
|
package/dist/es2019/types.js
CHANGED
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
package/dist/types/main.d.ts
CHANGED
|
@@ -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);
|
package/dist/types/types.d.ts
CHANGED
|
@@ -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.
|
|
3
|
+
"version": "10.16.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": {
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"@atlaskit/css": "^1.0.0",
|
|
44
44
|
"@atlaskit/primitives": "^22.2.0",
|
|
45
45
|
"@atlaskit/ssr": "workspace:^",
|
|
46
|
-
"@atlassian/a11y-jest-testing": "^0.
|
|
47
|
-
"@atlassian/conversation-assistant-service-api": "^16.
|
|
46
|
+
"@atlassian/a11y-jest-testing": "^0.16.0",
|
|
47
|
+
"@atlassian/conversation-assistant-service-api": "^16.5.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",
|