@atlaskit/editor-common 114.26.1 → 114.28.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.
Files changed (34) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/cjs/ai-messages/ai-suggestions.js +5 -0
  3. package/dist/cjs/messages/insert-block.js +5 -0
  4. package/dist/cjs/monitoring/error.js +1 -1
  5. package/dist/cjs/preset/plugin-injection-api.js +47 -0
  6. package/dist/cjs/type-ahead/messages.js +5 -0
  7. package/dist/cjs/ui/DropList/index.js +1 -1
  8. package/dist/es2019/ai-messages/ai-suggestions.js +5 -0
  9. package/dist/es2019/messages/insert-block.js +5 -0
  10. package/dist/es2019/monitoring/error.js +1 -1
  11. package/dist/es2019/preset/plugin-injection-api.js +33 -0
  12. package/dist/es2019/type-ahead/messages.js +5 -0
  13. package/dist/es2019/ui/DropList/index.js +1 -1
  14. package/dist/esm/ai-messages/ai-suggestions.js +5 -0
  15. package/dist/esm/messages/insert-block.js +5 -0
  16. package/dist/esm/monitoring/error.js +1 -1
  17. package/dist/esm/preset/plugin-injection-api.js +47 -0
  18. package/dist/esm/type-ahead/messages.js +5 -0
  19. package/dist/esm/ui/DropList/index.js +1 -1
  20. package/dist/types/ai-messages/ai-suggestions.d.ts +5 -0
  21. package/dist/types/messages/insert-block.d.ts +5 -0
  22. package/dist/types/preset/plugin-injection-api.d.ts +3 -0
  23. package/dist/types/type-ahead/messages.d.ts +41 -36
  24. package/dist/types/types/index.d.ts +1 -1
  25. package/dist/types/types/type-ahead.d.ts +7 -0
  26. package/dist/types/types/ui-components.d.ts +12 -0
  27. package/dist/types-ts4.5/ai-messages/ai-suggestions.d.ts +5 -0
  28. package/dist/types-ts4.5/messages/insert-block.d.ts +5 -0
  29. package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +3 -0
  30. package/dist/types-ts4.5/type-ahead/messages.d.ts +41 -36
  31. package/dist/types-ts4.5/types/index.d.ts +1 -1
  32. package/dist/types-ts4.5/types/type-ahead.d.ts +7 -0
  33. package/dist/types-ts4.5/types/ui-components.d.ts +12 -0
  34. package/package.json +2 -2
package/CHANGELOG.md CHANGED
@@ -1,5 +1,31 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 114.28.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`4091c5936145d`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/4091c5936145d) -
8
+ EDITOR-6737-sticky-situation
9
+
10
+ ## 114.27.0
11
+
12
+ ### Minor Changes
13
+
14
+ - [`80e6f41ddfce4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/80e6f41ddfce4) -
15
+ Reconcile editor plugin set on reconfigureState across preset switches: drop plugins whose schema
16
+ nodes/marks aren't in the current schema, and evict plugins from the injection API that aren't
17
+ part of the new preset. Behind feature gate `platform_editor_reconfigure_filter_plugins`.
18
+
19
+ Adds the `NamedReactHookFactory` type to `@atlaskit/editor-common/types` and annotates each
20
+ plugin's `usePluginHook` with its plugin name in `processPluginsList` so `MountPluginHooks` can
21
+ key React fibers stably per plugin. The shape of `EditorConfig.pluginHooks` is unchanged
22
+ (`ReactHookFactory[]`); the annotation is a non-breaking additive property on the function value
23
+ that falls back to the array index when absent.
24
+
25
+ ### Patch Changes
26
+
27
+ - Updated dependencies
28
+
3
29
  ## 114.26.1
4
30
 
5
31
  ### Patch Changes
@@ -155,5 +155,10 @@ var aiSuggestionsMessages = exports.aiSuggestionsMessages = (0, _reactIntl.defin
155
155
  id: 'fabric.editor.ai.suggestions.card.compareWithOriginalOptionLabel.non-final',
156
156
  defaultMessage: 'Compare with original',
157
157
  description: 'Label for the dropdown action to compare suggestion with original content'
158
+ },
159
+ cardScrollBackToSuggestionLabel: {
160
+ id: 'fabric.editor.ai.suggestions.card.scrollBackToSuggestionLabel.non-final',
161
+ defaultMessage: 'Back to suggestion',
162
+ description: 'Label for the scroll back to suggestion button on the AI suggestions card'
158
163
  }
159
164
  });
@@ -211,6 +211,11 @@ var toolbarInsertBlockMessages = exports.toolbarInsertBlockMessages = (0, _react
211
211
  defaultMessage: 'Add a custom status label',
212
212
  description: 'Menu description shown in the quick insert menu. Explains that users can add custom status labels.'
213
213
  },
214
+ askRovo: {
215
+ id: 'fabric.editor.askRovo',
216
+ defaultMessage: 'Ask Rovo',
217
+ description: 'Button label shown in the quick insert empty results state. Allows users to ask Rovo AI for help.'
218
+ },
214
219
  viewMore: {
215
220
  id: 'fabric.editor.viewMore',
216
221
  defaultMessage: 'View more',
@@ -19,7 +19,7 @@ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t =
19
19
  function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
20
20
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
21
21
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
22
- var packageVersion = "114.26.0";
22
+ var packageVersion = "114.27.0";
23
23
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
24
24
  // Remove URL as it has UGC
25
25
  // Ignored via go/ees007
@@ -234,6 +234,17 @@ var SharedStateAPI = exports.SharedStateAPI = /*#__PURE__*/function () {
234
234
  value: function cleanupSubscription(pluginName, sub) {
235
235
  (this.listeners.get(pluginName) || new Set()).delete(sub);
236
236
  }
237
+
238
+ // Drop every listener and pending update for a plugin that is no longer
239
+ // registered. Without this, callbacks (and their captured closures) for
240
+ // evicted plugins would linger in `listeners` until destroy(), and every
241
+ // transaction would still walk their keys via filterPluginsWithListeners.
242
+ }, {
243
+ key: "removePluginListeners",
244
+ value: function removePluginListeners(pluginName) {
245
+ this.listeners.delete(pluginName);
246
+ this.updatesToNotifyQueue.delete(pluginName);
247
+ }
237
248
  }, {
238
249
  key: "notifyListeners",
239
250
  value: function notifyListeners(_ref5) {
@@ -303,6 +314,42 @@ var EditorPluginInjectionAPI = exports.EditorPluginInjectionAPI = /*#__PURE__*/f
303
314
  (0, _defineProperty2.default)(this, "onEditorPluginInitialized", function (plugin) {
304
315
  _this2.addPlugin(plugin);
305
316
  });
317
+ // Internal cleanup helper used by ReactEditorView's reconfigureState to
318
+ // reconcile the registered plugin set with the current preset. Removes
319
+ // every registered plugin not in `keptPluginNames`; `core` is always
320
+ // preserved. Returns the names that were removed. Intentionally not on
321
+ // PluginInjectionAPIDefinition: this is an editor-internal control, not
322
+ // part of the injection-API contract that plugins or external consumers
323
+ // depend on.
324
+ (0, _defineProperty2.default)(this, "retainPlugins", function (keptPluginNames) {
325
+ var evicted = [];
326
+ var _iterator4 = _createForOfIteratorHelper(_this2.plugins.keys()),
327
+ _step4;
328
+ try {
329
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
330
+ var _name = _step4.value;
331
+ if (_name !== 'core' && !keptPluginNames.has(_name)) {
332
+ evicted.push(_name);
333
+ }
334
+ }
335
+ } catch (err) {
336
+ _iterator4.e(err);
337
+ } finally {
338
+ _iterator4.f();
339
+ }
340
+ for (var _i = 0, _evicted = evicted; _i < _evicted.length; _i++) {
341
+ var name = _evicted[_i];
342
+ _this2.plugins.delete(name);
343
+ _this2.sharedStateAPI.removePluginListeners(name);
344
+ }
345
+ return evicted;
346
+ });
347
+ // Internal: snapshot the names of currently-registered plugins. Used by
348
+ // reconfigureState to capture the previous plugin set before the new
349
+ // preset registers its own plugins via onEditorPluginInitialized.
350
+ (0, _defineProperty2.default)(this, "getRegisteredPluginNames", function () {
351
+ return Array.from(_this2.plugins.keys());
352
+ });
306
353
  (0, _defineProperty2.default)(this, "addPlugin", function (plugin) {
307
354
  // Plugins other than `core` are checked by the preset itself
308
355
  // For some reason in some tests we have duplicates that are missed.
@@ -105,5 +105,10 @@ var typeAheadListMessages = exports.typeAheadListMessages = (0, _reactIntl.defin
105
105
  id: 'fabric.editor.emptySearchResultsSuggestion',
106
106
  defaultMessage: 'Select {buttonName} to browse inserts.',
107
107
  description: 'a prompt to suggest user to click a button to browse inserts when there are no search results'
108
+ },
109
+ emptySearchResultsSuggestionNew: {
110
+ id: 'fabric.editor.emptySearchResultsSuggestionNew',
111
+ defaultMessage: 'Select {askRovoName} for help, or {buttonName} to browse inserts.',
112
+ description: 'a prompt to suggest user to click a button to browse inserts or ask Rovo for help when there are no search results'
108
113
  }
109
114
  });
@@ -24,7 +24,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
24
24
  * @jsx jsx
25
25
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
26
26
  var packageName = "@atlaskit/editor-common";
27
- var packageVersion = "114.26.0";
27
+ var packageVersion = "114.27.0";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -149,5 +149,10 @@ export const aiSuggestionsMessages = defineMessages({
149
149
  id: 'fabric.editor.ai.suggestions.card.compareWithOriginalOptionLabel.non-final',
150
150
  defaultMessage: 'Compare with original',
151
151
  description: 'Label for the dropdown action to compare suggestion with original content'
152
+ },
153
+ cardScrollBackToSuggestionLabel: {
154
+ id: 'fabric.editor.ai.suggestions.card.scrollBackToSuggestionLabel.non-final',
155
+ defaultMessage: 'Back to suggestion',
156
+ description: 'Label for the scroll back to suggestion button on the AI suggestions card'
152
157
  }
153
158
  });
@@ -205,6 +205,11 @@ export const toolbarInsertBlockMessages = defineMessages({
205
205
  defaultMessage: 'Add a custom status label',
206
206
  description: 'Menu description shown in the quick insert menu. Explains that users can add custom status labels.'
207
207
  },
208
+ askRovo: {
209
+ id: 'fabric.editor.askRovo',
210
+ defaultMessage: 'Ask Rovo',
211
+ description: 'Button label shown in the quick insert empty results state. Allows users to ask Rovo AI for help.'
212
+ },
208
213
  viewMore: {
209
214
  id: 'fabric.editor.viewMore',
210
215
  defaultMessage: 'View more',
@@ -4,7 +4,7 @@ import { isFedRamp } from './environment';
4
4
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
5
5
  const SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
6
6
  const packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
7
- const packageVersion = "114.26.0";
7
+ const packageVersion = "114.27.0";
8
8
  const sanitiseSentryEvents = (data, _hint) => {
9
9
  // Remove URL as it has UGC
10
10
  // Ignored via go/ees007
@@ -171,6 +171,15 @@ export class SharedStateAPI {
171
171
  cleanupSubscription(pluginName, sub) {
172
172
  (this.listeners.get(pluginName) || new Set()).delete(sub);
173
173
  }
174
+
175
+ // Drop every listener and pending update for a plugin that is no longer
176
+ // registered. Without this, callbacks (and their captured closures) for
177
+ // evicted plugins would linger in `listeners` until destroy(), and every
178
+ // transaction would still walk their keys via filterPluginsWithListeners.
179
+ removePluginListeners(pluginName) {
180
+ this.listeners.delete(pluginName);
181
+ this.updatesToNotifyQueue.delete(pluginName);
182
+ }
174
183
  notifyListeners({
175
184
  newEditorState,
176
185
  oldEditorState,
@@ -227,6 +236,30 @@ export class EditorPluginInjectionAPI {
227
236
  _defineProperty(this, "onEditorPluginInitialized", plugin => {
228
237
  this.addPlugin(plugin);
229
238
  });
239
+ // Internal cleanup helper used by ReactEditorView's reconfigureState to
240
+ // reconcile the registered plugin set with the current preset. Removes
241
+ // every registered plugin not in `keptPluginNames`; `core` is always
242
+ // preserved. Returns the names that were removed. Intentionally not on
243
+ // PluginInjectionAPIDefinition: this is an editor-internal control, not
244
+ // part of the injection-API contract that plugins or external consumers
245
+ // depend on.
246
+ _defineProperty(this, "retainPlugins", keptPluginNames => {
247
+ const evicted = [];
248
+ for (const name of this.plugins.keys()) {
249
+ if (name !== 'core' && !keptPluginNames.has(name)) {
250
+ evicted.push(name);
251
+ }
252
+ }
253
+ for (const name of evicted) {
254
+ this.plugins.delete(name);
255
+ this.sharedStateAPI.removePluginListeners(name);
256
+ }
257
+ return evicted;
258
+ });
259
+ // Internal: snapshot the names of currently-registered plugins. Used by
260
+ // reconfigureState to capture the previous plugin set before the new
261
+ // preset registers its own plugins via onEditorPluginInitialized.
262
+ _defineProperty(this, "getRegisteredPluginNames", () => Array.from(this.plugins.keys()));
230
263
  _defineProperty(this, "addPlugin", plugin => {
231
264
  // Plugins other than `core` are checked by the preset itself
232
265
  // For some reason in some tests we have duplicates that are missed.
@@ -99,5 +99,10 @@ export const typeAheadListMessages = defineMessages({
99
99
  id: 'fabric.editor.emptySearchResultsSuggestion',
100
100
  defaultMessage: 'Select {buttonName} to browse inserts.',
101
101
  description: 'a prompt to suggest user to click a button to browse inserts when there are no search results'
102
+ },
103
+ emptySearchResultsSuggestionNew: {
104
+ id: 'fabric.editor.emptySearchResultsSuggestionNew',
105
+ defaultMessage: 'Select {askRovoName} for help, or {buttonName} to browse inserts.',
106
+ description: 'a prompt to suggest user to click a button to browse inserts or ask Rovo for help when there are no search results'
102
107
  }
103
108
  });
@@ -14,7 +14,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
14
14
  import { fg } from '@atlaskit/platform-feature-flags';
15
15
  import Layer from '../Layer';
16
16
  const packageName = "@atlaskit/editor-common";
17
- const packageVersion = "114.26.0";
17
+ const packageVersion = "114.27.0";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -149,5 +149,10 @@ export var aiSuggestionsMessages = defineMessages({
149
149
  id: 'fabric.editor.ai.suggestions.card.compareWithOriginalOptionLabel.non-final',
150
150
  defaultMessage: 'Compare with original',
151
151
  description: 'Label for the dropdown action to compare suggestion with original content'
152
+ },
153
+ cardScrollBackToSuggestionLabel: {
154
+ id: 'fabric.editor.ai.suggestions.card.scrollBackToSuggestionLabel.non-final',
155
+ defaultMessage: 'Back to suggestion',
156
+ description: 'Label for the scroll back to suggestion button on the AI suggestions card'
152
157
  }
153
158
  });
@@ -205,6 +205,11 @@ export var toolbarInsertBlockMessages = defineMessages({
205
205
  defaultMessage: 'Add a custom status label',
206
206
  description: 'Menu description shown in the quick insert menu. Explains that users can add custom status labels.'
207
207
  },
208
+ askRovo: {
209
+ id: 'fabric.editor.askRovo',
210
+ defaultMessage: 'Ask Rovo',
211
+ description: 'Button label shown in the quick insert empty results state. Allows users to ask Rovo AI for help.'
212
+ },
208
213
  viewMore: {
209
214
  id: 'fabric.editor.viewMore',
210
215
  defaultMessage: 'View more',
@@ -10,7 +10,7 @@ import { isFedRamp } from './environment';
10
10
  import { normaliseSentryBreadcrumbs, SERIALIZABLE_ATTRIBUTES } from './normalise-sentry-breadcrumbs';
11
11
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
12
12
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
13
- var packageVersion = "114.26.0";
13
+ var packageVersion = "114.27.0";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007
@@ -228,6 +228,17 @@ export var SharedStateAPI = /*#__PURE__*/function () {
228
228
  value: function cleanupSubscription(pluginName, sub) {
229
229
  (this.listeners.get(pluginName) || new Set()).delete(sub);
230
230
  }
231
+
232
+ // Drop every listener and pending update for a plugin that is no longer
233
+ // registered. Without this, callbacks (and their captured closures) for
234
+ // evicted plugins would linger in `listeners` until destroy(), and every
235
+ // transaction would still walk their keys via filterPluginsWithListeners.
236
+ }, {
237
+ key: "removePluginListeners",
238
+ value: function removePluginListeners(pluginName) {
239
+ this.listeners.delete(pluginName);
240
+ this.updatesToNotifyQueue.delete(pluginName);
241
+ }
231
242
  }, {
232
243
  key: "notifyListeners",
233
244
  value: function notifyListeners(_ref5) {
@@ -297,6 +308,42 @@ export var EditorPluginInjectionAPI = /*#__PURE__*/function () {
297
308
  _defineProperty(this, "onEditorPluginInitialized", function (plugin) {
298
309
  _this2.addPlugin(plugin);
299
310
  });
311
+ // Internal cleanup helper used by ReactEditorView's reconfigureState to
312
+ // reconcile the registered plugin set with the current preset. Removes
313
+ // every registered plugin not in `keptPluginNames`; `core` is always
314
+ // preserved. Returns the names that were removed. Intentionally not on
315
+ // PluginInjectionAPIDefinition: this is an editor-internal control, not
316
+ // part of the injection-API contract that plugins or external consumers
317
+ // depend on.
318
+ _defineProperty(this, "retainPlugins", function (keptPluginNames) {
319
+ var evicted = [];
320
+ var _iterator4 = _createForOfIteratorHelper(_this2.plugins.keys()),
321
+ _step4;
322
+ try {
323
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
324
+ var _name = _step4.value;
325
+ if (_name !== 'core' && !keptPluginNames.has(_name)) {
326
+ evicted.push(_name);
327
+ }
328
+ }
329
+ } catch (err) {
330
+ _iterator4.e(err);
331
+ } finally {
332
+ _iterator4.f();
333
+ }
334
+ for (var _i = 0, _evicted = evicted; _i < _evicted.length; _i++) {
335
+ var name = _evicted[_i];
336
+ _this2.plugins.delete(name);
337
+ _this2.sharedStateAPI.removePluginListeners(name);
338
+ }
339
+ return evicted;
340
+ });
341
+ // Internal: snapshot the names of currently-registered plugins. Used by
342
+ // reconfigureState to capture the previous plugin set before the new
343
+ // preset registers its own plugins via onEditorPluginInitialized.
344
+ _defineProperty(this, "getRegisteredPluginNames", function () {
345
+ return Array.from(_this2.plugins.keys());
346
+ });
300
347
  _defineProperty(this, "addPlugin", function (plugin) {
301
348
  // Plugins other than `core` are checked by the preset itself
302
349
  // For some reason in some tests we have duplicates that are missed.
@@ -99,5 +99,10 @@ export var typeAheadListMessages = defineMessages({
99
99
  id: 'fabric.editor.emptySearchResultsSuggestion',
100
100
  defaultMessage: 'Select {buttonName} to browse inserts.',
101
101
  description: 'a prompt to suggest user to click a button to browse inserts when there are no search results'
102
+ },
103
+ emptySearchResultsSuggestionNew: {
104
+ id: 'fabric.editor.emptySearchResultsSuggestionNew',
105
+ defaultMessage: 'Select {askRovoName} for help, or {buttonName} to browse inserts.',
106
+ description: 'a prompt to suggest user to click a button to browse inserts or ask Rovo for help when there are no search results'
102
107
  }
103
108
  });
@@ -21,7 +21,7 @@ import withAnalyticsEvents from '@atlaskit/analytics-next/withAnalyticsEvents';
21
21
  import { fg } from '@atlaskit/platform-feature-flags';
22
22
  import Layer from '../Layer';
23
23
  var packageName = "@atlaskit/editor-common";
24
- var packageVersion = "114.26.0";
24
+ var packageVersion = "114.27.0";
25
25
  var halfFocusRing = 1;
26
26
  var dropOffset = '0, 8';
27
27
  var fadeIn = keyframes({
@@ -59,6 +59,11 @@ export declare const aiSuggestionsMessages: {
59
59
  description: string;
60
60
  id: string;
61
61
  };
62
+ cardScrollBackToSuggestionLabel: {
63
+ defaultMessage: string;
64
+ description: string;
65
+ id: string;
66
+ };
62
67
  cardShowSidebarButtonLabel: {
63
68
  defaultMessage: string;
64
69
  description: string;
@@ -39,6 +39,11 @@ export declare const toolbarInsertBlockMessages: {
39
39
  description: string;
40
40
  id: string;
41
41
  };
42
+ askRovo: {
43
+ defaultMessage: string;
44
+ description: string;
45
+ id: string;
46
+ };
42
47
  closeInsertRightRail: {
43
48
  defaultMessage: string;
44
49
  description: string;
@@ -24,6 +24,7 @@ export declare class SharedStateAPI {
24
24
  constructor({ getEditorState }: SharedStateAPIProps);
25
25
  createAPI(plugin: NextEditorPluginInitializedType | undefined): PluginDependenciesAPI<NextEditorPlugin<any, any>>['sharedState'];
26
26
  private cleanupSubscription;
27
+ removePluginListeners(pluginName: string): void;
27
28
  private updatesToNotifyQueue;
28
29
  notifyListeners({ newEditorState, oldEditorState, plugins, }: EditorStateDiff & Record<'plugins', Map<string, NextEditorPluginInitializedType>>): void;
29
30
  destroy(): void;
@@ -61,6 +62,8 @@ export declare class EditorPluginInjectionAPI implements PluginInjectionAPIDefin
61
62
  api(): GenericAPIWithCore;
62
63
  onEditorViewUpdated: ({ newEditorState, oldEditorState }: EditorStateDiff) => void;
63
64
  onEditorPluginInitialized: (plugin: NextEditorPluginInitializedType) => void;
65
+ retainPlugins: (keptPluginNames: ReadonlySet<string>) => string[];
66
+ getRegisteredPluginNames: () => string[];
64
67
  private addPlugin;
65
68
  private getPluginByName;
66
69
  }
@@ -1,102 +1,107 @@
1
1
  export declare const typeAheadListMessages: {
2
- typeAheadPopupLabel: {
3
- id: string;
2
+ descriptionLabel: {
4
3
  defaultMessage: string;
5
4
  description: string;
6
- };
7
- quickInsertPopupLabel: {
8
5
  id: string;
9
- defaultMessage: string;
10
- description: string;
11
6
  };
12
- quickInsertInputLabel: {
13
- id: string;
7
+ emojiInputLabel: {
14
8
  defaultMessage: string;
15
9
  description: string;
16
- };
17
- quickInsertInputPlaceholderLabel: {
18
10
  id: string;
11
+ };
12
+ emojiListItemLabel: {
19
13
  defaultMessage: string;
20
14
  description: string;
15
+ id: string;
21
16
  };
22
17
  emojiPopupLabel: {
23
- id: string;
24
18
  defaultMessage: string;
25
19
  description: string;
20
+ id: string;
26
21
  };
27
- emojiInputLabel: {
22
+ emptySearchResults: {
23
+ defaultMessage: string;
24
+ description: string;
28
25
  id: string;
26
+ };
27
+ emptySearchResultsSuggestion: {
29
28
  defaultMessage: string;
30
29
  description: string;
30
+ id: string;
31
31
  };
32
- mentionPopupLabel: {
32
+ emptySearchResultsSuggestionNew: {
33
+ defaultMessage: string;
34
+ description: string;
33
35
  id: string;
36
+ };
37
+ inputQueryAssistiveLabel: {
34
38
  defaultMessage: string;
35
39
  description: string;
40
+ id: string;
36
41
  };
37
42
  mentionInputLabel: {
43
+ defaultMessage: string;
44
+ description: string;
38
45
  id: string;
46
+ };
47
+ mentionPopupLabel: {
39
48
  defaultMessage: string;
40
49
  description: string;
50
+ id: string;
41
51
  };
42
52
  metionListItemLabel: {
43
- id: string;
44
53
  defaultMessage: string;
45
54
  description: string;
46
- };
47
- emojiListItemLabel: {
48
55
  id: string;
56
+ };
57
+ noSearchResultsLabel: {
49
58
  defaultMessage: string;
50
59
  description: string;
51
- };
52
- inputQueryAssistiveLabel: {
53
60
  id: string;
61
+ };
62
+ quickInsertInputLabel: {
54
63
  defaultMessage: string;
55
64
  description: string;
56
- };
57
- searchResultsLabel: {
58
65
  id: string;
66
+ };
67
+ quickInsertInputPlaceholderLabel: {
59
68
  defaultMessage: string;
60
69
  description: string;
61
- };
62
- noSearchResultsLabel: {
63
70
  id: string;
71
+ };
72
+ quickInsertPopupLabel: {
64
73
  defaultMessage: string;
65
74
  description: string;
66
- };
67
- descriptionLabel: {
68
75
  id: string;
76
+ };
77
+ searchResultsLabel: {
69
78
  defaultMessage: string;
70
79
  description: string;
80
+ id: string;
71
81
  };
72
82
  shortcutLabel: {
73
- id: string;
74
83
  defaultMessage: string;
75
84
  description: string;
76
- };
77
- typeAheadErrorFallbackHeading: {
78
85
  id: string;
79
- defaultMessage: string;
80
- description: string;
81
86
  };
82
87
  typeAheadErrorFallbackDesc: {
83
- id: string;
84
88
  defaultMessage: string;
85
89
  description: string;
86
- };
87
- viewAllInserts: {
88
90
  id: string;
91
+ };
92
+ typeAheadErrorFallbackHeading: {
89
93
  defaultMessage: string;
90
94
  description: string;
91
- };
92
- emptySearchResults: {
93
95
  id: string;
96
+ };
97
+ typeAheadPopupLabel: {
94
98
  defaultMessage: string;
95
99
  description: string;
96
- };
97
- emptySearchResultsSuggestion: {
98
100
  id: string;
101
+ };
102
+ viewAllInserts: {
99
103
  defaultMessage: string;
100
104
  description: string;
105
+ id: string;
101
106
  };
102
107
  };
@@ -19,7 +19,7 @@ export type { ContextPanelHandler } from './context-panel';
19
19
  export type { EditorAppearance, EditorContentMode } from './editor-appearance';
20
20
  export type { ToolbarUiComponentFactoryParams, ToolbarUIComponentFactory } from './toolbar';
21
21
  export { ToolbarSize, ToolbarWidths, ToolbarWidthsNext, ToolbarWidthsFullPage, ToolbarWidthsFullPageNext, } from './toolbar';
22
- export type { UiComponentFactoryParams, UIComponentFactory, ReactHookFactory, } from './ui-components';
22
+ export type { UiComponentFactoryParams, UIComponentFactory, ReactHookFactory, NamedReactHookFactory, } from './ui-components';
23
23
  export type { EditorReactContext } from './editor-react-context';
24
24
  export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin } from './plugin-factory';
25
25
  export type { NodeConfig, MarkConfig, NodeViewConfig } from './prosemirror-config';
@@ -65,6 +65,13 @@ export type TypeAheadHandler = {
65
65
  }) => void;
66
66
  /** Handler returns typeahead item based on query. Used to find which item to insert. */
67
67
  forceSelect?: TypeAheadForceSelect;
68
+ /**
69
+ * Optional handler that returns an item (Ask Rovo) to display in the typeahead's
70
+ * empty-results state.
71
+ */
72
+ getEmptyItem?: (props: {
73
+ editorState: EditorState;
74
+ }) => TypeAheadItem | undefined;
68
75
  getHighlight?: (state: EditorState) => JSX.Element | null;
69
76
  /** Handler returns an array of TypeAheadItem based on query to be displayed in the TypeAhead */
70
77
  getItems: (props: {
@@ -22,4 +22,16 @@ export type UiComponentFactoryParams = {
22
22
  export type UIComponentFactory = (params: UiComponentFactoryParams) => React.ReactElement<any> | null;
23
23
  export type ReactHookFactory = (params: Pick<UiComponentFactoryParams, 'editorView' | 'containerElement'> & {
24
24
  editorView: EditorView;
25
+ pluginName?: string;
25
26
  }) => void;
27
+ /**
28
+ * A `ReactHookFactory` annotated with the name of the plugin that owns it.
29
+ * `processPluginsList` wraps each plugin's `usePluginHook` with `.bind(null)`
30
+ * and assigns `pluginName`, so the original plugin function reference is
31
+ * never mutated. `MountPluginHooks` reads `pluginName` to derive a stable
32
+ * React `key` per plugin instead of relying on array index, which would
33
+ * violate the Rules of Hooks across reconfigures that change the plugin set.
34
+ */
35
+ export type NamedReactHookFactory = ReactHookFactory & {
36
+ pluginName?: string;
37
+ };
@@ -59,6 +59,11 @@ export declare const aiSuggestionsMessages: {
59
59
  description: string;
60
60
  id: string;
61
61
  };
62
+ cardScrollBackToSuggestionLabel: {
63
+ defaultMessage: string;
64
+ description: string;
65
+ id: string;
66
+ };
62
67
  cardShowSidebarButtonLabel: {
63
68
  defaultMessage: string;
64
69
  description: string;
@@ -39,6 +39,11 @@ export declare const toolbarInsertBlockMessages: {
39
39
  description: string;
40
40
  id: string;
41
41
  };
42
+ askRovo: {
43
+ defaultMessage: string;
44
+ description: string;
45
+ id: string;
46
+ };
42
47
  closeInsertRightRail: {
43
48
  defaultMessage: string;
44
49
  description: string;
@@ -24,6 +24,7 @@ export declare class SharedStateAPI {
24
24
  constructor({ getEditorState }: SharedStateAPIProps);
25
25
  createAPI(plugin: NextEditorPluginInitializedType | undefined): PluginDependenciesAPI<NextEditorPlugin<any, any>>['sharedState'];
26
26
  private cleanupSubscription;
27
+ removePluginListeners(pluginName: string): void;
27
28
  private updatesToNotifyQueue;
28
29
  notifyListeners({ newEditorState, oldEditorState, plugins, }: EditorStateDiff & Record<'plugins', Map<string, NextEditorPluginInitializedType>>): void;
29
30
  destroy(): void;
@@ -61,6 +62,8 @@ export declare class EditorPluginInjectionAPI implements PluginInjectionAPIDefin
61
62
  api(): GenericAPIWithCore;
62
63
  onEditorViewUpdated: ({ newEditorState, oldEditorState }: EditorStateDiff) => void;
63
64
  onEditorPluginInitialized: (plugin: NextEditorPluginInitializedType) => void;
65
+ retainPlugins: (keptPluginNames: ReadonlySet<string>) => string[];
66
+ getRegisteredPluginNames: () => string[];
64
67
  private addPlugin;
65
68
  private getPluginByName;
66
69
  }
@@ -1,102 +1,107 @@
1
1
  export declare const typeAheadListMessages: {
2
- typeAheadPopupLabel: {
3
- id: string;
2
+ descriptionLabel: {
4
3
  defaultMessage: string;
5
4
  description: string;
6
- };
7
- quickInsertPopupLabel: {
8
5
  id: string;
9
- defaultMessage: string;
10
- description: string;
11
6
  };
12
- quickInsertInputLabel: {
13
- id: string;
7
+ emojiInputLabel: {
14
8
  defaultMessage: string;
15
9
  description: string;
16
- };
17
- quickInsertInputPlaceholderLabel: {
18
10
  id: string;
11
+ };
12
+ emojiListItemLabel: {
19
13
  defaultMessage: string;
20
14
  description: string;
15
+ id: string;
21
16
  };
22
17
  emojiPopupLabel: {
23
- id: string;
24
18
  defaultMessage: string;
25
19
  description: string;
20
+ id: string;
26
21
  };
27
- emojiInputLabel: {
22
+ emptySearchResults: {
23
+ defaultMessage: string;
24
+ description: string;
28
25
  id: string;
26
+ };
27
+ emptySearchResultsSuggestion: {
29
28
  defaultMessage: string;
30
29
  description: string;
30
+ id: string;
31
31
  };
32
- mentionPopupLabel: {
32
+ emptySearchResultsSuggestionNew: {
33
+ defaultMessage: string;
34
+ description: string;
33
35
  id: string;
36
+ };
37
+ inputQueryAssistiveLabel: {
34
38
  defaultMessage: string;
35
39
  description: string;
40
+ id: string;
36
41
  };
37
42
  mentionInputLabel: {
43
+ defaultMessage: string;
44
+ description: string;
38
45
  id: string;
46
+ };
47
+ mentionPopupLabel: {
39
48
  defaultMessage: string;
40
49
  description: string;
50
+ id: string;
41
51
  };
42
52
  metionListItemLabel: {
43
- id: string;
44
53
  defaultMessage: string;
45
54
  description: string;
46
- };
47
- emojiListItemLabel: {
48
55
  id: string;
56
+ };
57
+ noSearchResultsLabel: {
49
58
  defaultMessage: string;
50
59
  description: string;
51
- };
52
- inputQueryAssistiveLabel: {
53
60
  id: string;
61
+ };
62
+ quickInsertInputLabel: {
54
63
  defaultMessage: string;
55
64
  description: string;
56
- };
57
- searchResultsLabel: {
58
65
  id: string;
66
+ };
67
+ quickInsertInputPlaceholderLabel: {
59
68
  defaultMessage: string;
60
69
  description: string;
61
- };
62
- noSearchResultsLabel: {
63
70
  id: string;
71
+ };
72
+ quickInsertPopupLabel: {
64
73
  defaultMessage: string;
65
74
  description: string;
66
- };
67
- descriptionLabel: {
68
75
  id: string;
76
+ };
77
+ searchResultsLabel: {
69
78
  defaultMessage: string;
70
79
  description: string;
80
+ id: string;
71
81
  };
72
82
  shortcutLabel: {
73
- id: string;
74
83
  defaultMessage: string;
75
84
  description: string;
76
- };
77
- typeAheadErrorFallbackHeading: {
78
85
  id: string;
79
- defaultMessage: string;
80
- description: string;
81
86
  };
82
87
  typeAheadErrorFallbackDesc: {
83
- id: string;
84
88
  defaultMessage: string;
85
89
  description: string;
86
- };
87
- viewAllInserts: {
88
90
  id: string;
91
+ };
92
+ typeAheadErrorFallbackHeading: {
89
93
  defaultMessage: string;
90
94
  description: string;
91
- };
92
- emptySearchResults: {
93
95
  id: string;
96
+ };
97
+ typeAheadPopupLabel: {
94
98
  defaultMessage: string;
95
99
  description: string;
96
- };
97
- emptySearchResultsSuggestion: {
98
100
  id: string;
101
+ };
102
+ viewAllInserts: {
99
103
  defaultMessage: string;
100
104
  description: string;
105
+ id: string;
101
106
  };
102
107
  };
@@ -19,7 +19,7 @@ export type { ContextPanelHandler } from './context-panel';
19
19
  export type { EditorAppearance, EditorContentMode } from './editor-appearance';
20
20
  export type { ToolbarUiComponentFactoryParams, ToolbarUIComponentFactory } from './toolbar';
21
21
  export { ToolbarSize, ToolbarWidths, ToolbarWidthsNext, ToolbarWidthsFullPage, ToolbarWidthsFullPageNext, } from './toolbar';
22
- export type { UiComponentFactoryParams, UIComponentFactory, ReactHookFactory, } from './ui-components';
22
+ export type { UiComponentFactoryParams, UIComponentFactory, ReactHookFactory, NamedReactHookFactory, } from './ui-components';
23
23
  export type { EditorReactContext } from './editor-react-context';
24
24
  export type { PMPluginFactoryParams, PMPluginFactory, PMPlugin } from './plugin-factory';
25
25
  export type { NodeConfig, MarkConfig, NodeViewConfig } from './prosemirror-config';
@@ -65,6 +65,13 @@ export type TypeAheadHandler = {
65
65
  }) => void;
66
66
  /** Handler returns typeahead item based on query. Used to find which item to insert. */
67
67
  forceSelect?: TypeAheadForceSelect;
68
+ /**
69
+ * Optional handler that returns an item (Ask Rovo) to display in the typeahead's
70
+ * empty-results state.
71
+ */
72
+ getEmptyItem?: (props: {
73
+ editorState: EditorState;
74
+ }) => TypeAheadItem | undefined;
68
75
  getHighlight?: (state: EditorState) => JSX.Element | null;
69
76
  /** Handler returns an array of TypeAheadItem based on query to be displayed in the TypeAhead */
70
77
  getItems: (props: {
@@ -22,4 +22,16 @@ export type UiComponentFactoryParams = {
22
22
  export type UIComponentFactory = (params: UiComponentFactoryParams) => React.ReactElement<any> | null;
23
23
  export type ReactHookFactory = (params: Pick<UiComponentFactoryParams, 'editorView' | 'containerElement'> & {
24
24
  editorView: EditorView;
25
+ pluginName?: string;
25
26
  }) => void;
27
+ /**
28
+ * A `ReactHookFactory` annotated with the name of the plugin that owns it.
29
+ * `processPluginsList` wraps each plugin's `usePluginHook` with `.bind(null)`
30
+ * and assigns `pluginName`, so the original plugin function reference is
31
+ * never mutated. `MountPluginHooks` reads `pluginName` to derive a stable
32
+ * React `key` per plugin instead of relying on array index, which would
33
+ * violate the Rules of Hooks across reconfigures that change the plugin set.
34
+ */
35
+ export type NamedReactHookFactory = ReactHookFactory & {
36
+ pluginName?: string;
37
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlaskit/editor-common",
3
- "version": "114.26.1",
3
+ "version": "114.28.0",
4
4
  "description": "A package that contains common classes and components for editor and renderer",
5
5
  "publishConfig": {
6
6
  "registry": "https://registry.npmjs.org/"
@@ -57,7 +57,7 @@
57
57
  "@atlaskit/editor-tables": "^2.9.0",
58
58
  "@atlaskit/editor-toolbar": "^1.0.0",
59
59
  "@atlaskit/editor-toolbar-model": "^0.4.0",
60
- "@atlaskit/emoji": "^70.4.0",
60
+ "@atlaskit/emoji": "^70.5.0",
61
61
  "@atlaskit/icon": "^34.5.0",
62
62
  "@atlaskit/link": "^3.4.0",
63
63
  "@atlaskit/link-datasource": "^5.2.0",