@atlaskit/rovo-triggers 10.18.0 → 10.20.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 +20 -0
- package/dist/cjs/main.js +15 -4
- package/dist/es2019/main.js +15 -4
- package/dist/esm/main.js +15 -4
- package/dist/types/main.d.ts +2 -1
- package/dist/types/types.d.ts +2 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @atlaskit/rovo-triggers
|
|
2
2
|
|
|
3
|
+
## 10.20.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- [`7f9a57c426d38`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/7f9a57c426d38) -
|
|
8
|
+
Add recommended Rovo spaces onboarding video modals for the existing "See how it works" button and
|
|
9
|
+
first-time recommended spaces flow.
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- Updated dependencies
|
|
14
|
+
|
|
15
|
+
## 10.19.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [`607199b1bc9a7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/607199b1bc9a7) -
|
|
20
|
+
Add topic-scoped replay cleanup and use it for the Rovo Remix picker behind
|
|
21
|
+
cc-ce-maui-remix-menu-multivariant, so reopening does not restore an unfinished session.
|
|
22
|
+
|
|
3
23
|
## 10.18.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
package/dist/cjs/main.js
CHANGED
|
@@ -156,11 +156,15 @@ var createPubSub = function createPubSub() {
|
|
|
156
156
|
var flushQueue = function flushQueue() {
|
|
157
157
|
publishQueue = {};
|
|
158
158
|
};
|
|
159
|
+
var clearLatest = function clearLatest(topic) {
|
|
160
|
+
delete publishQueue[topic];
|
|
161
|
+
};
|
|
159
162
|
return {
|
|
160
163
|
subscribe: subscribe,
|
|
161
164
|
subscribeAll: subscribeAll,
|
|
162
165
|
publish: publish,
|
|
163
|
-
flushQueue: flushQueue
|
|
166
|
+
flushQueue: flushQueue,
|
|
167
|
+
clearLatest: clearLatest
|
|
164
168
|
};
|
|
165
169
|
};
|
|
166
170
|
var pubSub = createPubSub();
|
|
@@ -173,9 +177,11 @@ var usePubSub = function usePubSub() {
|
|
|
173
177
|
var useSubscribe = exports.useSubscribe = function useSubscribe(_ref8, callback) {
|
|
174
178
|
var topic = _ref8.topic,
|
|
175
179
|
triggerLatest = _ref8.triggerLatest,
|
|
180
|
+
clearLatestOnUnmount = _ref8.clearLatestOnUnmount,
|
|
176
181
|
consumeOnceKey = _ref8.consumeOnceKey;
|
|
177
182
|
var _usePubSub = usePubSub(),
|
|
178
|
-
subscribe = _usePubSub.subscribe
|
|
183
|
+
subscribe = _usePubSub.subscribe,
|
|
184
|
+
clearLatest = _usePubSub.clearLatest;
|
|
179
185
|
var callbackRef = (0, _react.useRef)(callback);
|
|
180
186
|
callbackRef.current = callback;
|
|
181
187
|
(0, _react.useEffect)(function () {
|
|
@@ -186,10 +192,15 @@ var useSubscribe = exports.useSubscribe = function useSubscribe(_ref8, callback)
|
|
|
186
192
|
}, function () {
|
|
187
193
|
return callbackRef.current.apply(callbackRef, arguments);
|
|
188
194
|
});
|
|
189
|
-
return
|
|
195
|
+
return function () {
|
|
196
|
+
unsubscribe();
|
|
197
|
+
if (clearLatestOnUnmount) {
|
|
198
|
+
clearLatest(topic);
|
|
199
|
+
}
|
|
200
|
+
};
|
|
190
201
|
},
|
|
191
202
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
192
|
-
[topic, consumeOnceKey]);
|
|
203
|
+
[topic, clearLatestOnUnmount, consumeOnceKey]);
|
|
193
204
|
};
|
|
194
205
|
var useSubscribeAll = exports.useSubscribeAll = function useSubscribeAll(callback) {
|
|
195
206
|
var _usePubSub2 = usePubSub(),
|
package/dist/es2019/main.js
CHANGED
|
@@ -142,11 +142,15 @@ const createPubSub = () => {
|
|
|
142
142
|
const flushQueue = () => {
|
|
143
143
|
publishQueue = {};
|
|
144
144
|
};
|
|
145
|
+
const clearLatest = topic => {
|
|
146
|
+
delete publishQueue[topic];
|
|
147
|
+
};
|
|
145
148
|
return {
|
|
146
149
|
subscribe,
|
|
147
150
|
subscribeAll,
|
|
148
151
|
publish,
|
|
149
|
-
flushQueue
|
|
152
|
+
flushQueue,
|
|
153
|
+
clearLatest
|
|
150
154
|
};
|
|
151
155
|
};
|
|
152
156
|
const pubSub = createPubSub();
|
|
@@ -159,10 +163,12 @@ const usePubSub = () => {
|
|
|
159
163
|
export const useSubscribe = ({
|
|
160
164
|
topic,
|
|
161
165
|
triggerLatest,
|
|
166
|
+
clearLatestOnUnmount,
|
|
162
167
|
consumeOnceKey
|
|
163
168
|
}, callback) => {
|
|
164
169
|
const {
|
|
165
|
-
subscribe
|
|
170
|
+
subscribe,
|
|
171
|
+
clearLatest
|
|
166
172
|
} = usePubSub();
|
|
167
173
|
const callbackRef = useRef(callback);
|
|
168
174
|
callbackRef.current = callback;
|
|
@@ -172,10 +178,15 @@ export const useSubscribe = ({
|
|
|
172
178
|
triggerLatest,
|
|
173
179
|
consumeOnceKey
|
|
174
180
|
}, (...args) => callbackRef.current(...args));
|
|
175
|
-
return
|
|
181
|
+
return () => {
|
|
182
|
+
unsubscribe();
|
|
183
|
+
if (clearLatestOnUnmount) {
|
|
184
|
+
clearLatest(topic);
|
|
185
|
+
}
|
|
186
|
+
};
|
|
176
187
|
},
|
|
177
188
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
178
|
-
[topic, consumeOnceKey]);
|
|
189
|
+
[topic, clearLatestOnUnmount, consumeOnceKey]);
|
|
179
190
|
};
|
|
180
191
|
export const useSubscribeAll = callback => {
|
|
181
192
|
const {
|
package/dist/esm/main.js
CHANGED
|
@@ -150,11 +150,15 @@ var createPubSub = function createPubSub() {
|
|
|
150
150
|
var flushQueue = function flushQueue() {
|
|
151
151
|
publishQueue = {};
|
|
152
152
|
};
|
|
153
|
+
var clearLatest = function clearLatest(topic) {
|
|
154
|
+
delete publishQueue[topic];
|
|
155
|
+
};
|
|
153
156
|
return {
|
|
154
157
|
subscribe: subscribe,
|
|
155
158
|
subscribeAll: subscribeAll,
|
|
156
159
|
publish: publish,
|
|
157
|
-
flushQueue: flushQueue
|
|
160
|
+
flushQueue: flushQueue,
|
|
161
|
+
clearLatest: clearLatest
|
|
158
162
|
};
|
|
159
163
|
};
|
|
160
164
|
var pubSub = createPubSub();
|
|
@@ -167,9 +171,11 @@ var usePubSub = function usePubSub() {
|
|
|
167
171
|
export var useSubscribe = function useSubscribe(_ref8, callback) {
|
|
168
172
|
var topic = _ref8.topic,
|
|
169
173
|
triggerLatest = _ref8.triggerLatest,
|
|
174
|
+
clearLatestOnUnmount = _ref8.clearLatestOnUnmount,
|
|
170
175
|
consumeOnceKey = _ref8.consumeOnceKey;
|
|
171
176
|
var _usePubSub = usePubSub(),
|
|
172
|
-
subscribe = _usePubSub.subscribe
|
|
177
|
+
subscribe = _usePubSub.subscribe,
|
|
178
|
+
clearLatest = _usePubSub.clearLatest;
|
|
173
179
|
var callbackRef = useRef(callback);
|
|
174
180
|
callbackRef.current = callback;
|
|
175
181
|
useEffect(function () {
|
|
@@ -180,10 +186,15 @@ export var useSubscribe = function useSubscribe(_ref8, callback) {
|
|
|
180
186
|
}, function () {
|
|
181
187
|
return callbackRef.current.apply(callbackRef, arguments);
|
|
182
188
|
});
|
|
183
|
-
return
|
|
189
|
+
return function () {
|
|
190
|
+
unsubscribe();
|
|
191
|
+
if (clearLatestOnUnmount) {
|
|
192
|
+
clearLatest(topic);
|
|
193
|
+
}
|
|
194
|
+
};
|
|
184
195
|
},
|
|
185
196
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
186
|
-
[topic, consumeOnceKey]);
|
|
197
|
+
[topic, clearLatestOnUnmount, consumeOnceKey]);
|
|
187
198
|
};
|
|
188
199
|
export var useSubscribeAll = function useSubscribeAll(callback) {
|
|
189
200
|
var _usePubSub2 = usePubSub(),
|
package/dist/types/main.d.ts
CHANGED
|
@@ -2,10 +2,11 @@ import type { Callback, Payload, Topic } from './types';
|
|
|
2
2
|
interface SubscribeOptions {
|
|
3
3
|
topic: Topic;
|
|
4
4
|
triggerLatest?: boolean;
|
|
5
|
+
clearLatestOnUnmount?: boolean;
|
|
5
6
|
consumeOnceKey?: string;
|
|
6
7
|
}
|
|
7
8
|
export declare const publish: (topic: Topic, payload: Payload) => void;
|
|
8
|
-
export declare const useSubscribe: ({ topic, triggerLatest, consumeOnceKey }: SubscribeOptions, callback: Callback) => void;
|
|
9
|
+
export declare const useSubscribe: ({ topic, triggerLatest, clearLatestOnUnmount, consumeOnceKey }: SubscribeOptions, callback: Callback) => void;
|
|
9
10
|
export declare const useSubscribeAll: (callback: Callback) => void;
|
|
10
11
|
export declare const usePublish: (topic: Topic) => ((payload: Payload) => void);
|
|
11
12
|
export declare const Subscriber: ({ topic, triggerLatest, onEvent, flushQueueOnUnmount, consumeOnceKey, }: {
|
package/dist/types/types.d.ts
CHANGED
|
@@ -628,6 +628,7 @@ export type CustomSkillUpdatePayload = PayloadCore<'custom-skill-update', {
|
|
|
628
628
|
}[];
|
|
629
629
|
}>;
|
|
630
630
|
export type RecommendedSpacesSelectedPayload = PayloadCore<'recommended-spaces-selected'>;
|
|
631
|
+
export type RecommendedSpacesFirstTimeSelectedPayload = PayloadCore<'recommended-spaces-first-time-selected'>;
|
|
631
632
|
export type SmartlinksSubscriptionChangedPayload = PayloadCore<'smartlinks-subscription-changed'> & {
|
|
632
633
|
/** Never opens chat — internal signal only. */
|
|
633
634
|
openChat: false;
|
|
@@ -640,7 +641,7 @@ export type SmartlinksSubscriptionChangedPayload = PayloadCore<'smartlinks-subsc
|
|
|
640
641
|
* is expected to be open at a time.
|
|
641
642
|
*/
|
|
642
643
|
export type CloseInContextAifcModalPayload = PayloadCore<'close-in-context-aifc-modal'>;
|
|
643
|
-
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;
|
|
644
|
+
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 | RecommendedSpacesFirstTimeSelectedPayload | CustomSkillUpdatePayload | TaskPlanConfirmedPayload | TaskAskQuestionRenderedPayload | TaskPlanRenderedPayload | TaskSkipAllQuestionsPayload | TaskCancelPlanPayload | TaskAskQuestionConfirmedPayload | TaskModifyPlanRequestedPayload | TaskModifyPlanSubmittedPayload | ConfluenceContentFinalizedPayload;
|
|
644
645
|
export type TaskPlanConfirmedPayload = PayloadCore<'task-plan-confirmed', {
|
|
645
646
|
conversationId: string;
|
|
646
647
|
planTitle: string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@atlaskit/rovo-triggers",
|
|
3
|
-
"version": "10.
|
|
3
|
+
"version": "10.20.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": {
|
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
],
|
|
29
29
|
"atlaskit:src": "src/index.ts",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@atlaskit/adf-schema": "^57.
|
|
31
|
+
"@atlaskit/adf-schema": "^57.1.0",
|
|
32
32
|
"@atlaskit/platform-feature-flags": "^2.1.0",
|
|
33
33
|
"@atlaskit/react-compiler-gating": "^0.2.0",
|
|
34
34
|
"@babel/runtime": "^7.0.0",
|