@atlaskit/rovo-triggers 10.17.0 → 10.19.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,25 @@
1
1
  # @atlaskit/rovo-triggers
2
2
 
3
+ ## 10.19.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`607199b1bc9a7`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/607199b1bc9a7) -
8
+ Add topic-scoped replay cleanup and use it for the Rovo Remix picker behind
9
+ cc-ce-maui-remix-menu-multivariant, so reopening does not restore an unfinished session.
10
+
11
+ ## 10.18.0
12
+
13
+ ### Minor Changes
14
+
15
+ - [`29a7878860a25`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/29a7878860a25) -
16
+ [ux] Preserve the selected infographic's current subtype in Edit bar free-text requests behind
17
+ `cc_maui_polish_changes_batch_5` by carrying Remix history through the editor context.
18
+
19
+ ### Patch Changes
20
+
21
+ - Updated dependencies
22
+
3
23
  ## 10.17.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 unsubscribe;
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(),
@@ -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 unsubscribe;
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 unsubscribe;
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(),
@@ -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, }: {
@@ -208,6 +208,7 @@ export type EditorContextPayloadData = {
208
208
  fragmentAdf?: string;
209
209
  };
210
210
  dynamicUiType?: string;
211
+ dynamicUiSubtype?: string;
211
212
  isViewMode?: boolean;
212
213
  isDraftLockedForEditing?: boolean;
213
214
  useGenericEditorSkill?: boolean;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/rovo-triggers",
3
- "version": "10.17.0",
3
+ "version": "10.19.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.3.0",
44
+ "@atlaskit/primitives": "^22.4.0",
45
45
  "@atlaskit/ssr": "workspace:^",
46
- "@atlassian/a11y-jest-testing": "^0.16.0",
47
- "@atlassian/conversation-assistant-service-api": "^16.8.0",
46
+ "@atlassian/a11y-jest-testing": "^0.17.0",
47
+ "@atlassian/conversation-assistant-service-api": "^17.0.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",