@atlaskit/editor-common 114.26.0 → 114.27.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 (45) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/dist/cjs/messages/insert-block.js +5 -0
  3. package/dist/cjs/messages/markdown-mode.js +100 -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/styles/shared/table-cell-background-for-compiled.js +15 -0
  7. package/dist/cjs/styles/shared/tableCell.js +2 -2
  8. package/dist/cjs/type-ahead/messages.js +5 -0
  9. package/dist/cjs/ui/DropList/index.js +1 -1
  10. package/dist/es2019/messages/insert-block.js +5 -0
  11. package/dist/es2019/messages/markdown-mode.js +100 -0
  12. package/dist/es2019/monitoring/error.js +1 -1
  13. package/dist/es2019/preset/plugin-injection-api.js +33 -0
  14. package/dist/es2019/styles/shared/table-cell-background-for-compiled.js +10 -0
  15. package/dist/es2019/styles/shared/tableCell.js +1 -1
  16. package/dist/es2019/type-ahead/messages.js +5 -0
  17. package/dist/es2019/ui/DropList/index.js +1 -1
  18. package/dist/esm/messages/insert-block.js +5 -0
  19. package/dist/esm/messages/markdown-mode.js +100 -0
  20. package/dist/esm/monitoring/error.js +1 -1
  21. package/dist/esm/preset/plugin-injection-api.js +47 -0
  22. package/dist/esm/styles/shared/table-cell-background-for-compiled.js +10 -0
  23. package/dist/esm/styles/shared/tableCell.js +1 -1
  24. package/dist/esm/type-ahead/messages.js +5 -0
  25. package/dist/esm/ui/DropList/index.js +1 -1
  26. package/dist/types/messages/insert-block.d.ts +5 -0
  27. package/dist/types/messages/markdown-mode.d.ts +100 -0
  28. package/dist/types/preset/plugin-injection-api.d.ts +3 -0
  29. package/dist/types/styles/shared/table-cell-background-for-compiled.d.ts +8 -0
  30. package/dist/types/styles/shared/tableCell.d.ts +1 -0
  31. package/dist/types/type-ahead/messages.d.ts +41 -36
  32. package/dist/types/types/index.d.ts +1 -1
  33. package/dist/types/types/type-ahead.d.ts +7 -0
  34. package/dist/types/types/ui-components.d.ts +12 -0
  35. package/dist/types-ts4.5/messages/insert-block.d.ts +5 -0
  36. package/dist/types-ts4.5/messages/markdown-mode.d.ts +100 -0
  37. package/dist/types-ts4.5/preset/plugin-injection-api.d.ts +3 -0
  38. package/dist/types-ts4.5/styles/shared/table-cell-background-for-compiled.d.ts +8 -0
  39. package/dist/types-ts4.5/styles/shared/tableCell.d.ts +1 -0
  40. package/dist/types-ts4.5/type-ahead/messages.d.ts +41 -36
  41. package/dist/types-ts4.5/types/index.d.ts +1 -1
  42. package/dist/types-ts4.5/types/type-ahead.d.ts +7 -0
  43. package/dist/types-ts4.5/types/ui-components.d.ts +12 -0
  44. package/package.json +7 -7
  45. package/table-cell-background-for-compiled/package.json +17 -0
package/CHANGELOG.md CHANGED
@@ -1,5 +1,30 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 114.27.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [`80e6f41ddfce4`](https://bitbucket.org/atlassian/atlassian-frontend-monorepo/commits/80e6f41ddfce4) -
8
+ Reconcile editor plugin set on reconfigureState across preset switches: drop plugins whose schema
9
+ nodes/marks aren't in the current schema, and evict plugins from the injection API that aren't
10
+ part of the new preset. Behind feature gate `platform_editor_reconfigure_filter_plugins`.
11
+
12
+ Adds the `NamedReactHookFactory` type to `@atlaskit/editor-common/types` and annotates each
13
+ plugin's `usePluginHook` with its plugin name in `processPluginsList` so `MountPluginHooks` can
14
+ key React fibers stably per plugin. The shape of `EditorConfig.pluginHooks` is unchanged
15
+ (`ReactHookFactory[]`); the annotation is a non-breaking additive property on the function value
16
+ that falls back to the array index when absent.
17
+
18
+ ### Patch Changes
19
+
20
+ - Updated dependencies
21
+
22
+ ## 114.26.1
23
+
24
+ ### Patch Changes
25
+
26
+ - Updated dependencies
27
+
3
28
  ## 114.26.0
4
29
 
5
30
  ### Minor Changes
@@ -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',
@@ -39,5 +39,105 @@ var markdownModeMessages = exports.markdownModeMessages = (0, _reactIntl.defineM
39
39
  id: 'fabric.editor.markdownMode.sourceView.ariaLabel',
40
40
  defaultMessage: 'Markdown source',
41
41
  description: 'Accessible label for the markdown source editor.'
42
+ },
43
+ confirmDialogTitleToMarkdown: {
44
+ id: 'fabric.editor.markdownMode.confirmDialog.title.toMarkdown',
45
+ defaultMessage: 'Convert to markdown?',
46
+ description: 'Title of the confirmation dialog shown when the user is about to convert a Live Doc from rich text into markdown mode.'
47
+ },
48
+ confirmDialogTitleToMarkdownLossy: {
49
+ id: 'fabric.editor.markdownMode.confirmDialog.title.toMarkdownLossy',
50
+ defaultMessage: 'Convert to Markdown?',
51
+ description: 'Title of the warning dialog shown when the user is about to convert a Live Doc whose rich-text content cannot fully round-trip through markdown (lossy conversion).'
52
+ },
53
+ confirmDialogTitleToRichText: {
54
+ id: 'fabric.editor.markdownMode.confirmDialog.title.toRichText',
55
+ defaultMessage: 'Convert to rich text?',
56
+ description: 'Title of the confirmation dialog shown when the user is about to convert a Live Doc from markdown back to rich text mode.'
57
+ },
58
+ confirmDialogToMarkdownToolsRemoved: {
59
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdown.toolsRemoved',
60
+ defaultMessage: 'Standard rich text tools will be removed.',
61
+ description: 'Body row inside the convert-to-markdown confirmation dialog; explains that the rich-text editor toolbar disappears once the document is in markdown mode.'
62
+ },
63
+ confirmDialogToMarkdownToggle: {
64
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdown.toggle',
65
+ defaultMessage: 'Toggle between syntax and WYSIWYG editing as you work.',
66
+ description: 'Body row inside the convert-to-markdown confirmation dialog; explains that the user can still flip between markdown source view and WYSIWYG view after the conversion.'
67
+ },
68
+ confirmDialogToMarkdownVersionHistory: {
69
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdown.versionHistory',
70
+ defaultMessage: 'Revert to the previous version via version history at any time.',
71
+ description: 'Body row inside the convert-to-markdown confirmation dialog; reassures the user that the pre-conversion version is preserved and recoverable from version history.'
72
+ },
73
+ confirmDialogToMarkdownLossyRichContent: {
74
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdownLossy.richContent',
75
+ defaultMessage: 'Your content has rich text formatting that may be unsupported in markdown.',
76
+ description: 'Body row in the lossy convert-to-markdown warning dialog; explains that rich-text formatting may not survive the conversion.'
77
+ },
78
+ confirmDialogToMarkdownLossyVersionHistory: {
79
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdownLossy.versionHistory',
80
+ defaultMessage: 'Converting may result in data loss, although you can always revert to this previous version in version history.',
81
+ description: 'Body row in the lossy convert-to-markdown warning dialog; reassures the user that the pre-conversion version is recoverable from version history.'
82
+ },
83
+ confirmDialogToMarkdownLossyCta: {
84
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdownLossy.cta',
85
+ defaultMessage: 'Convert to Markdown',
86
+ description: 'Primary (warning-styled) action button label in the lossy convert-to-markdown warning dialog.'
87
+ },
88
+ confirmDialogToRichTextStandardTools: {
89
+ id: 'fabric.editor.markdownMode.confirmDialog.toRichText.standardTools',
90
+ defaultMessage: 'Standard rich text tools will be available again.',
91
+ description: 'Body row inside the convert-to-rich-text confirmation dialog; explains that the full rich-text toolbar comes back after the conversion.'
92
+ },
93
+ confirmDialogToRichTextInstantEdits: {
94
+ id: 'fabric.editor.markdownMode.confirmDialog.toRichText.instantEdits',
95
+ defaultMessage: 'Edits will continue to happen instantly without the need to publish.',
96
+ description: 'Body row inside the convert-to-rich-text confirmation dialog; reassures the user that live-edit semantics are preserved when leaving markdown mode.'
97
+ },
98
+ confirmDialogToRichTextVersionHistory: {
99
+ id: 'fabric.editor.markdownMode.confirmDialog.toRichText.versionHistory',
100
+ defaultMessage: 'Revert to the previous version via version history at any time.',
101
+ description: 'Body row inside the convert-to-rich-text confirmation dialog; reassures the user that the pre-conversion version is preserved and recoverable from version history.'
102
+ },
103
+ confirmDialogCancel: {
104
+ id: 'fabric.editor.markdownMode.confirmDialog.cancel',
105
+ defaultMessage: 'Cancel',
106
+ description: 'Cancel button label in the convert-markdown-mode confirmation dialog (used for both directions).'
107
+ },
108
+ confirmDialogConfirm: {
109
+ id: 'fabric.editor.markdownMode.confirmDialog.confirm',
110
+ defaultMessage: 'Confirm',
111
+ description: 'Primary confirm button label in the convert-markdown-mode confirmation dialog (used for both directions).'
112
+ },
113
+ confirmDialogError: {
114
+ id: 'fabric.editor.markdownMode.confirmDialog.error',
115
+ defaultMessage: 'Something went wrong while converting this page. Please try again.',
116
+ description: 'Inline error message shown inside the convert-markdown-mode confirmation dialog when the conversion request fails.'
117
+ },
118
+ unlinkSyncedBlocksTitle: {
119
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.title',
120
+ defaultMessage: 'Unlink synced blocks to convert',
121
+ description: 'Title of the modal shown when the user tries to convert a page to markdown but the page contains synced blocks. The dialog asks them to unlink (unsync) the blocks first.'
122
+ },
123
+ unlinkSyncedBlocksBody: {
124
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.body',
125
+ defaultMessage: '{count, plural, one {This content contains 1 synced block syncing to multiple locations. Converting to markdown will detach the synced block and result in it being removed from multiple synced locations, where it will appear as an "Unsynced block". Unsync it to continue.} other {This content contains {count} synced blocks syncing to multiple locations. Converting to markdown will detach the synced blocks and result in them being removed from multiple synced locations, where they will appear as "Unsynced blocks". Unsync them to continue.}}',
126
+ description: 'Body copy of the unlink-synced-blocks dialog. {count} is the number of synced blocks in the document (always >= 1 in practice; 0 takes the plural branch defensively).'
127
+ },
128
+ unlinkSyncedBlocksLearnMore: {
129
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.learnMore',
130
+ defaultMessage: 'Learn more',
131
+ description: 'Footer link in the unlink-synced-blocks dialog that opens external documentation about managing synced blocks.'
132
+ },
133
+ unlinkSyncedBlocksUnderstood: {
134
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.understood',
135
+ defaultMessage: 'Understood',
136
+ description: 'Primary acknowledgement button label in the unlink-synced-blocks dialog. Dismisses the dialog — there is no "convert anyway" action.'
137
+ },
138
+ labsLozenge: {
139
+ id: 'fabric.editor.markdownMode.labsLozenge',
140
+ defaultMessage: 'LABS',
141
+ description: 'Lozenge label displayed next to the modal title to indicate the markdown mode feature is experimental (Labs).'
42
142
  }
43
143
  });
@@ -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 = "0.0.0-development";
22
+ var packageVersion = "114.26.1";
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.
@@ -0,0 +1,15 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.tableCellBackgroundStyleOverrideForCompiled = void 0;
7
+ var _tableCell = require("./tableCell");
8
+ /**
9
+ * Pre-built CSS string with `background-color` rules for every named table cell
10
+ * color (e.g. `td[colorname='red' i]`, `th[colorname='red' i]`).
11
+ *
12
+ * Intended for Compiled CSS consumers — render inside a `<style>` tag, since
13
+ * these rules are dynamically derived and cannot be expressed in a `cssMap`.
14
+ */
15
+ var tableCellBackgroundStyleOverrideForCompiled = exports.tableCellBackgroundStyleOverrideForCompiled = (0, _tableCell.mapBackgroundColors)();
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.tableCellBackgroundStyleOverride = void 0;
6
+ exports.tableCellBackgroundStyleOverride = exports.mapBackgroundColors = void 0;
7
7
  var _react = require("@emotion/react");
8
8
  var _adfSchema = require("@atlaskit/adf-schema");
9
9
  var _editorPalette = require("@atlaskit/editor-palette");
@@ -16,7 +16,7 @@ var _editorPalette = require("@atlaskit/editor-palette");
16
16
  // it is not possible to use tokens there without polluting ADF.
17
17
  // As table cell backgrounds are set inline, this should not break mobile as
18
18
  // hexToEditorBackgroundPaletteColor() outputs a css variable with fallback hex.
19
- var mapBackgroundColors = function mapBackgroundColors() {
19
+ var mapBackgroundColors = exports.mapBackgroundColors = function mapBackgroundColors() {
20
20
  var cssString = '';
21
21
  _adfSchema.tableBackgroundColorNames.forEach(function (value, key) {
22
22
  var paletteColorValue = (0, _editorPalette.hexToEditorBackgroundPaletteColor)(value);
@@ -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 = "0.0.0-development";
27
+ var packageVersion = "114.26.1";
28
28
  var halfFocusRing = 1;
29
29
  var dropOffset = '0, 8';
30
30
  var fadeIn = (0, _react2.keyframes)({
@@ -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',
@@ -34,5 +34,105 @@ export const markdownModeMessages = defineMessages({
34
34
  id: 'fabric.editor.markdownMode.sourceView.ariaLabel',
35
35
  defaultMessage: 'Markdown source',
36
36
  description: 'Accessible label for the markdown source editor.'
37
+ },
38
+ confirmDialogTitleToMarkdown: {
39
+ id: 'fabric.editor.markdownMode.confirmDialog.title.toMarkdown',
40
+ defaultMessage: 'Convert to markdown?',
41
+ description: 'Title of the confirmation dialog shown when the user is about to convert a Live Doc from rich text into markdown mode.'
42
+ },
43
+ confirmDialogTitleToMarkdownLossy: {
44
+ id: 'fabric.editor.markdownMode.confirmDialog.title.toMarkdownLossy',
45
+ defaultMessage: 'Convert to Markdown?',
46
+ description: 'Title of the warning dialog shown when the user is about to convert a Live Doc whose rich-text content cannot fully round-trip through markdown (lossy conversion).'
47
+ },
48
+ confirmDialogTitleToRichText: {
49
+ id: 'fabric.editor.markdownMode.confirmDialog.title.toRichText',
50
+ defaultMessage: 'Convert to rich text?',
51
+ description: 'Title of the confirmation dialog shown when the user is about to convert a Live Doc from markdown back to rich text mode.'
52
+ },
53
+ confirmDialogToMarkdownToolsRemoved: {
54
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdown.toolsRemoved',
55
+ defaultMessage: 'Standard rich text tools will be removed.',
56
+ description: 'Body row inside the convert-to-markdown confirmation dialog; explains that the rich-text editor toolbar disappears once the document is in markdown mode.'
57
+ },
58
+ confirmDialogToMarkdownToggle: {
59
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdown.toggle',
60
+ defaultMessage: 'Toggle between syntax and WYSIWYG editing as you work.',
61
+ description: 'Body row inside the convert-to-markdown confirmation dialog; explains that the user can still flip between markdown source view and WYSIWYG view after the conversion.'
62
+ },
63
+ confirmDialogToMarkdownVersionHistory: {
64
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdown.versionHistory',
65
+ defaultMessage: 'Revert to the previous version via version history at any time.',
66
+ description: 'Body row inside the convert-to-markdown confirmation dialog; reassures the user that the pre-conversion version is preserved and recoverable from version history.'
67
+ },
68
+ confirmDialogToMarkdownLossyRichContent: {
69
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdownLossy.richContent',
70
+ defaultMessage: 'Your content has rich text formatting that may be unsupported in markdown.',
71
+ description: 'Body row in the lossy convert-to-markdown warning dialog; explains that rich-text formatting may not survive the conversion.'
72
+ },
73
+ confirmDialogToMarkdownLossyVersionHistory: {
74
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdownLossy.versionHistory',
75
+ defaultMessage: 'Converting may result in data loss, although you can always revert to this previous version in version history.',
76
+ description: 'Body row in the lossy convert-to-markdown warning dialog; reassures the user that the pre-conversion version is recoverable from version history.'
77
+ },
78
+ confirmDialogToMarkdownLossyCta: {
79
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdownLossy.cta',
80
+ defaultMessage: 'Convert to Markdown',
81
+ description: 'Primary (warning-styled) action button label in the lossy convert-to-markdown warning dialog.'
82
+ },
83
+ confirmDialogToRichTextStandardTools: {
84
+ id: 'fabric.editor.markdownMode.confirmDialog.toRichText.standardTools',
85
+ defaultMessage: 'Standard rich text tools will be available again.',
86
+ description: 'Body row inside the convert-to-rich-text confirmation dialog; explains that the full rich-text toolbar comes back after the conversion.'
87
+ },
88
+ confirmDialogToRichTextInstantEdits: {
89
+ id: 'fabric.editor.markdownMode.confirmDialog.toRichText.instantEdits',
90
+ defaultMessage: 'Edits will continue to happen instantly without the need to publish.',
91
+ description: 'Body row inside the convert-to-rich-text confirmation dialog; reassures the user that live-edit semantics are preserved when leaving markdown mode.'
92
+ },
93
+ confirmDialogToRichTextVersionHistory: {
94
+ id: 'fabric.editor.markdownMode.confirmDialog.toRichText.versionHistory',
95
+ defaultMessage: 'Revert to the previous version via version history at any time.',
96
+ description: 'Body row inside the convert-to-rich-text confirmation dialog; reassures the user that the pre-conversion version is preserved and recoverable from version history.'
97
+ },
98
+ confirmDialogCancel: {
99
+ id: 'fabric.editor.markdownMode.confirmDialog.cancel',
100
+ defaultMessage: 'Cancel',
101
+ description: 'Cancel button label in the convert-markdown-mode confirmation dialog (used for both directions).'
102
+ },
103
+ confirmDialogConfirm: {
104
+ id: 'fabric.editor.markdownMode.confirmDialog.confirm',
105
+ defaultMessage: 'Confirm',
106
+ description: 'Primary confirm button label in the convert-markdown-mode confirmation dialog (used for both directions).'
107
+ },
108
+ confirmDialogError: {
109
+ id: 'fabric.editor.markdownMode.confirmDialog.error',
110
+ defaultMessage: 'Something went wrong while converting this page. Please try again.',
111
+ description: 'Inline error message shown inside the convert-markdown-mode confirmation dialog when the conversion request fails.'
112
+ },
113
+ unlinkSyncedBlocksTitle: {
114
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.title',
115
+ defaultMessage: 'Unlink synced blocks to convert',
116
+ description: 'Title of the modal shown when the user tries to convert a page to markdown but the page contains synced blocks. The dialog asks them to unlink (unsync) the blocks first.'
117
+ },
118
+ unlinkSyncedBlocksBody: {
119
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.body',
120
+ defaultMessage: '{count, plural, one {This content contains 1 synced block syncing to multiple locations. Converting to markdown will detach the synced block and result in it being removed from multiple synced locations, where it will appear as an "Unsynced block". Unsync it to continue.} other {This content contains {count} synced blocks syncing to multiple locations. Converting to markdown will detach the synced blocks and result in them being removed from multiple synced locations, where they will appear as "Unsynced blocks". Unsync them to continue.}}',
121
+ description: 'Body copy of the unlink-synced-blocks dialog. {count} is the number of synced blocks in the document (always >= 1 in practice; 0 takes the plural branch defensively).'
122
+ },
123
+ unlinkSyncedBlocksLearnMore: {
124
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.learnMore',
125
+ defaultMessage: 'Learn more',
126
+ description: 'Footer link in the unlink-synced-blocks dialog that opens external documentation about managing synced blocks.'
127
+ },
128
+ unlinkSyncedBlocksUnderstood: {
129
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.understood',
130
+ defaultMessage: 'Understood',
131
+ description: 'Primary acknowledgement button label in the unlink-synced-blocks dialog. Dismisses the dialog — there is no "convert anyway" action.'
132
+ },
133
+ labsLozenge: {
134
+ id: 'fabric.editor.markdownMode.labsLozenge',
135
+ defaultMessage: 'LABS',
136
+ description: 'Lozenge label displayed next to the modal title to indicate the markdown mode feature is experimental (Labs).'
37
137
  }
38
138
  });
@@ -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 = "0.0.0-development";
7
+ const packageVersion = "114.26.1";
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.
@@ -0,0 +1,10 @@
1
+ import { mapBackgroundColors } from './tableCell';
2
+
3
+ /**
4
+ * Pre-built CSS string with `background-color` rules for every named table cell
5
+ * color (e.g. `td[colorname='red' i]`, `th[colorname='red' i]`).
6
+ *
7
+ * Intended for Compiled CSS consumers — render inside a `<style>` tag, since
8
+ * these rules are dynamically derived and cannot be expressed in a `cssMap`.
9
+ */
10
+ export const tableCellBackgroundStyleOverrideForCompiled = mapBackgroundColors();
@@ -9,7 +9,7 @@ import { hexToEditorBackgroundPaletteColor } from '@atlaskit/editor-palette';
9
9
  // it is not possible to use tokens there without polluting ADF.
10
10
  // As table cell backgrounds are set inline, this should not break mobile as
11
11
  // hexToEditorBackgroundPaletteColor() outputs a css variable with fallback hex.
12
- const mapBackgroundColors = () => {
12
+ export const mapBackgroundColors = () => {
13
13
  let cssString = '';
14
14
  tableBackgroundColorNames.forEach((value, key) => {
15
15
  const paletteColorValue = hexToEditorBackgroundPaletteColor(value);
@@ -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 = "0.0.0-development";
17
+ const packageVersion = "114.26.1";
18
18
  const halfFocusRing = 1;
19
19
  const dropOffset = '0, 8';
20
20
  const fadeIn = keyframes({
@@ -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',
@@ -34,5 +34,105 @@ export var markdownModeMessages = defineMessages({
34
34
  id: 'fabric.editor.markdownMode.sourceView.ariaLabel',
35
35
  defaultMessage: 'Markdown source',
36
36
  description: 'Accessible label for the markdown source editor.'
37
+ },
38
+ confirmDialogTitleToMarkdown: {
39
+ id: 'fabric.editor.markdownMode.confirmDialog.title.toMarkdown',
40
+ defaultMessage: 'Convert to markdown?',
41
+ description: 'Title of the confirmation dialog shown when the user is about to convert a Live Doc from rich text into markdown mode.'
42
+ },
43
+ confirmDialogTitleToMarkdownLossy: {
44
+ id: 'fabric.editor.markdownMode.confirmDialog.title.toMarkdownLossy',
45
+ defaultMessage: 'Convert to Markdown?',
46
+ description: 'Title of the warning dialog shown when the user is about to convert a Live Doc whose rich-text content cannot fully round-trip through markdown (lossy conversion).'
47
+ },
48
+ confirmDialogTitleToRichText: {
49
+ id: 'fabric.editor.markdownMode.confirmDialog.title.toRichText',
50
+ defaultMessage: 'Convert to rich text?',
51
+ description: 'Title of the confirmation dialog shown when the user is about to convert a Live Doc from markdown back to rich text mode.'
52
+ },
53
+ confirmDialogToMarkdownToolsRemoved: {
54
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdown.toolsRemoved',
55
+ defaultMessage: 'Standard rich text tools will be removed.',
56
+ description: 'Body row inside the convert-to-markdown confirmation dialog; explains that the rich-text editor toolbar disappears once the document is in markdown mode.'
57
+ },
58
+ confirmDialogToMarkdownToggle: {
59
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdown.toggle',
60
+ defaultMessage: 'Toggle between syntax and WYSIWYG editing as you work.',
61
+ description: 'Body row inside the convert-to-markdown confirmation dialog; explains that the user can still flip between markdown source view and WYSIWYG view after the conversion.'
62
+ },
63
+ confirmDialogToMarkdownVersionHistory: {
64
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdown.versionHistory',
65
+ defaultMessage: 'Revert to the previous version via version history at any time.',
66
+ description: 'Body row inside the convert-to-markdown confirmation dialog; reassures the user that the pre-conversion version is preserved and recoverable from version history.'
67
+ },
68
+ confirmDialogToMarkdownLossyRichContent: {
69
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdownLossy.richContent',
70
+ defaultMessage: 'Your content has rich text formatting that may be unsupported in markdown.',
71
+ description: 'Body row in the lossy convert-to-markdown warning dialog; explains that rich-text formatting may not survive the conversion.'
72
+ },
73
+ confirmDialogToMarkdownLossyVersionHistory: {
74
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdownLossy.versionHistory',
75
+ defaultMessage: 'Converting may result in data loss, although you can always revert to this previous version in version history.',
76
+ description: 'Body row in the lossy convert-to-markdown warning dialog; reassures the user that the pre-conversion version is recoverable from version history.'
77
+ },
78
+ confirmDialogToMarkdownLossyCta: {
79
+ id: 'fabric.editor.markdownMode.confirmDialog.toMarkdownLossy.cta',
80
+ defaultMessage: 'Convert to Markdown',
81
+ description: 'Primary (warning-styled) action button label in the lossy convert-to-markdown warning dialog.'
82
+ },
83
+ confirmDialogToRichTextStandardTools: {
84
+ id: 'fabric.editor.markdownMode.confirmDialog.toRichText.standardTools',
85
+ defaultMessage: 'Standard rich text tools will be available again.',
86
+ description: 'Body row inside the convert-to-rich-text confirmation dialog; explains that the full rich-text toolbar comes back after the conversion.'
87
+ },
88
+ confirmDialogToRichTextInstantEdits: {
89
+ id: 'fabric.editor.markdownMode.confirmDialog.toRichText.instantEdits',
90
+ defaultMessage: 'Edits will continue to happen instantly without the need to publish.',
91
+ description: 'Body row inside the convert-to-rich-text confirmation dialog; reassures the user that live-edit semantics are preserved when leaving markdown mode.'
92
+ },
93
+ confirmDialogToRichTextVersionHistory: {
94
+ id: 'fabric.editor.markdownMode.confirmDialog.toRichText.versionHistory',
95
+ defaultMessage: 'Revert to the previous version via version history at any time.',
96
+ description: 'Body row inside the convert-to-rich-text confirmation dialog; reassures the user that the pre-conversion version is preserved and recoverable from version history.'
97
+ },
98
+ confirmDialogCancel: {
99
+ id: 'fabric.editor.markdownMode.confirmDialog.cancel',
100
+ defaultMessage: 'Cancel',
101
+ description: 'Cancel button label in the convert-markdown-mode confirmation dialog (used for both directions).'
102
+ },
103
+ confirmDialogConfirm: {
104
+ id: 'fabric.editor.markdownMode.confirmDialog.confirm',
105
+ defaultMessage: 'Confirm',
106
+ description: 'Primary confirm button label in the convert-markdown-mode confirmation dialog (used for both directions).'
107
+ },
108
+ confirmDialogError: {
109
+ id: 'fabric.editor.markdownMode.confirmDialog.error',
110
+ defaultMessage: 'Something went wrong while converting this page. Please try again.',
111
+ description: 'Inline error message shown inside the convert-markdown-mode confirmation dialog when the conversion request fails.'
112
+ },
113
+ unlinkSyncedBlocksTitle: {
114
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.title',
115
+ defaultMessage: 'Unlink synced blocks to convert',
116
+ description: 'Title of the modal shown when the user tries to convert a page to markdown but the page contains synced blocks. The dialog asks them to unlink (unsync) the blocks first.'
117
+ },
118
+ unlinkSyncedBlocksBody: {
119
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.body',
120
+ defaultMessage: '{count, plural, one {This content contains 1 synced block syncing to multiple locations. Converting to markdown will detach the synced block and result in it being removed from multiple synced locations, where it will appear as an "Unsynced block". Unsync it to continue.} other {This content contains {count} synced blocks syncing to multiple locations. Converting to markdown will detach the synced blocks and result in them being removed from multiple synced locations, where they will appear as "Unsynced blocks". Unsync them to continue.}}',
121
+ description: 'Body copy of the unlink-synced-blocks dialog. {count} is the number of synced blocks in the document (always >= 1 in practice; 0 takes the plural branch defensively).'
122
+ },
123
+ unlinkSyncedBlocksLearnMore: {
124
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.learnMore',
125
+ defaultMessage: 'Learn more',
126
+ description: 'Footer link in the unlink-synced-blocks dialog that opens external documentation about managing synced blocks.'
127
+ },
128
+ unlinkSyncedBlocksUnderstood: {
129
+ id: 'fabric.editor.markdownMode.unlinkSyncedBlocks.understood',
130
+ defaultMessage: 'Understood',
131
+ description: 'Primary acknowledgement button label in the unlink-synced-blocks dialog. Dismisses the dialog — there is no "convert anyway" action.'
132
+ },
133
+ labsLozenge: {
134
+ id: 'fabric.editor.markdownMode.labsLozenge',
135
+ defaultMessage: 'LABS',
136
+ description: 'Lozenge label displayed next to the modal title to indicate the markdown mode feature is experimental (Labs).'
37
137
  }
38
138
  });
@@ -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 = "0.0.0-development";
13
+ var packageVersion = "114.26.1";
14
14
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
15
15
  // Remove URL as it has UGC
16
16
  // Ignored via go/ees007