@atlaskit/editor-common 87.5.1 → 87.6.1

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 (65) hide show
  1. package/CHANGELOG.md +45 -0
  2. package/dist/cjs/analytics/types/enums.js +4 -0
  3. package/dist/cjs/analytics/types/upload-media-events.js +5 -0
  4. package/dist/cjs/keymaps/index.js +7 -4
  5. package/dist/cjs/lazy-node-view/index.js +10 -3
  6. package/dist/cjs/lazy-node-view/node-view.js +32 -20
  7. package/dist/cjs/lazy-node-view/replace-node-views.js +93 -15
  8. package/dist/cjs/messages/index.js +7 -0
  9. package/dist/cjs/messages/media-insert.js +44 -0
  10. package/dist/cjs/monitoring/error.js +1 -1
  11. package/dist/cjs/styles/shared/code-block.js +3 -4
  12. package/dist/cjs/ui/DropList/index.js +1 -1
  13. package/dist/es2019/analytics/types/enums.js +4 -0
  14. package/dist/es2019/analytics/types/upload-media-events.js +1 -0
  15. package/dist/es2019/keymaps/index.js +2 -1
  16. package/dist/es2019/lazy-node-view/index.js +10 -3
  17. package/dist/es2019/lazy-node-view/node-view.js +6 -1
  18. package/dist/es2019/lazy-node-view/replace-node-views.js +93 -18
  19. package/dist/es2019/messages/index.js +1 -0
  20. package/dist/es2019/messages/media-insert.js +38 -0
  21. package/dist/es2019/monitoring/error.js +1 -1
  22. package/dist/es2019/styles/shared/code-block.js +15 -3
  23. package/dist/es2019/ui/DropList/index.js +1 -1
  24. package/dist/esm/analytics/types/enums.js +4 -0
  25. package/dist/esm/analytics/types/upload-media-events.js +1 -0
  26. package/dist/esm/keymaps/index.js +2 -1
  27. package/dist/esm/lazy-node-view/index.js +10 -3
  28. package/dist/esm/lazy-node-view/node-view.js +32 -20
  29. package/dist/esm/lazy-node-view/replace-node-views.js +93 -15
  30. package/dist/esm/messages/index.js +1 -0
  31. package/dist/esm/messages/media-insert.js +38 -0
  32. package/dist/esm/monitoring/error.js +1 -1
  33. package/dist/esm/styles/shared/code-block.js +3 -4
  34. package/dist/esm/ui/DropList/index.js +1 -1
  35. package/dist/types/analytics/types/enums.d.ts +5 -1
  36. package/dist/types/analytics/types/events.d.ts +2 -1
  37. package/dist/types/analytics/types/format-events.d.ts +2 -2
  38. package/dist/types/analytics/types/general-events.d.ts +2 -1
  39. package/dist/types/analytics/types/index.d.ts +1 -0
  40. package/dist/types/analytics/types/insert-events.d.ts +1 -1
  41. package/dist/types/analytics/types/upload-media-events.d.ts +10 -0
  42. package/dist/types/keymaps/index.d.ts +2 -0
  43. package/dist/types/lazy-node-view/index.d.ts +5 -2
  44. package/dist/types/lazy-node-view/node-view.d.ts +6 -1
  45. package/dist/types/lazy-node-view/replace-node-views.d.ts +15 -25
  46. package/dist/types/lazy-node-view/types.d.ts +7 -0
  47. package/dist/types/messages/index.d.ts +1 -0
  48. package/dist/types/messages/media-insert.d.ts +37 -0
  49. package/dist/types/styles/shared/code-block.d.ts +1 -0
  50. package/dist/types-ts4.5/analytics/types/enums.d.ts +5 -1
  51. package/dist/types-ts4.5/analytics/types/events.d.ts +2 -1
  52. package/dist/types-ts4.5/analytics/types/format-events.d.ts +2 -2
  53. package/dist/types-ts4.5/analytics/types/general-events.d.ts +2 -1
  54. package/dist/types-ts4.5/analytics/types/index.d.ts +1 -0
  55. package/dist/types-ts4.5/analytics/types/insert-events.d.ts +1 -1
  56. package/dist/types-ts4.5/analytics/types/upload-media-events.d.ts +10 -0
  57. package/dist/types-ts4.5/keymaps/index.d.ts +2 -0
  58. package/dist/types-ts4.5/lazy-node-view/index.d.ts +5 -2
  59. package/dist/types-ts4.5/lazy-node-view/node-view.d.ts +6 -1
  60. package/dist/types-ts4.5/lazy-node-view/replace-node-views.d.ts +15 -25
  61. package/dist/types-ts4.5/lazy-node-view/types.d.ts +7 -0
  62. package/dist/types-ts4.5/messages/index.d.ts +1 -0
  63. package/dist/types-ts4.5/messages/media-insert.d.ts +37 -0
  64. package/dist/types-ts4.5/styles/shared/code-block.d.ts +1 -0
  65. package/package.json +9 -9
package/CHANGELOG.md CHANGED
@@ -1,5 +1,50 @@
1
1
  # @atlaskit/editor-common
2
2
 
3
+ ## 87.6.1
4
+
5
+ ### Patch Changes
6
+
7
+ - [#128180](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128180)
8
+ [`51b4ef21250bf`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/51b4ef21250bf) -
9
+ [ux] [EDF-1228](https://product-fabric.atlassian.net/browse/EDF-1228) - add shortcut to the
10
+ `Continue in Chat` button in the Rovo Agent modal
11
+ - [#128458](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128458)
12
+ [`26e17a7d801e4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/26e17a7d801e4) -
13
+ ED-24514 Added ignoreMutationDelegate to lazyNodeView
14
+ - [#128180](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128180)
15
+ [`d6c81622b7636`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/d6c81622b7636) -
16
+ [ED-24553] Fix Lazy NodeView race conditions when multiple Editors are running at the same time
17
+ - [#127940](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/127940)
18
+ [`7f340ec35b8a4`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/7f340ec35b8a4) -
19
+ [ux] ED-24320 Hook up decorators for toggled on and toggled off wrapping states in floating
20
+ toolbar
21
+ - Updated dependencies
22
+
23
+ ## 87.6.0
24
+
25
+ ### Minor Changes
26
+
27
+ - [#128347](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128347)
28
+ [`e33566cebd5d1`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e33566cebd5d1) -
29
+ [ED-24175] bump @atlaskit/adf-schema to 40.8.1 and @atlassian/adf-schema-json to 1.22.0 to
30
+ promotecodeblocks & media in quotes, and nested expands in expands to full schema, and allow
31
+ quotes in panels and decisions in lists in stage0 schema, and a validator spec change
32
+ - [#128527](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128527)
33
+ [`e9e003a733b63`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/e9e003a733b63) -
34
+ Add media upload from URL and associated i18n, analytics and test packages
35
+ - [#128333](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128333)
36
+ [`4ad86751ab1d7`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/4ad86751ab1d7) -
37
+ [ED-24505] Implement onClick handler for Turn into dropdown options and update relevant insertion
38
+ analytics with inputMethod: floatingToolbar when an element is inserted via the dropdown
39
+
40
+ ### Patch Changes
41
+
42
+ - [#128105](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/pull-requests/128105)
43
+ [`b55614e1ea801`](https://stash.atlassian.com/projects/CONFCLOUD/repos/confluence-frontend/commits/b55614e1ea801) -
44
+ added a timeout to the requestIdleCallback inside the LazyNode replacement debounce to ensure it
45
+ is called eventually, limiting potential issues with infinite re-rendering
46
+ - Updated dependencies
47
+
3
48
  ## 87.5.1
4
49
 
5
50
  ### Patch Changes
@@ -145,6 +145,9 @@ var ACTION = exports.ACTION = /*#__PURE__*/function (ACTION) {
145
145
  ACTION["UPDATE_PARAMETERS"] = "updateParameters";
146
146
  ACTION["GET_CHILDERN"] = "getChildern";
147
147
  ACTION["MOVED"] = "moved";
148
+ ACTION["UPLOAD_COMMENCED"] = "uploadCommenced";
149
+ ACTION["UPLOAD_SUCCEEDED"] = "uploadSucceeded";
150
+ ACTION["UPLOAD_FAILED"] = "uploadFailed";
148
151
  ACTION["TOGGLE_CODE_BLOCK_WRAP"] = "toggleCodeBlockWrap";
149
152
  return ACTION;
150
153
  }({});
@@ -377,6 +380,7 @@ var ACTION_SUBJECT_ID = exports.ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTIO
377
380
  ACTION_SUBJECT_ID["ON_UNSUPPORTED_INLINE"] = "onUnsupportedInline";
378
381
  ACTION_SUBJECT_ID["ON_UNSUPPORTED_BLOCK"] = "onUnsupportedBlock";
379
382
  ACTION_SUBJECT_ID["MULTI_BODIED_EXTENSION"] = "multiBodiedExtension";
383
+ ACTION_SUBJECT_ID["UPLOAD_MEDIA_FROM_URL"] = "uploadMediaFromUrl";
380
384
  return ACTION_SUBJECT_ID;
381
385
  }({});
382
386
  var FLOATING_CONTROLS_TITLE = exports.FLOATING_CONTROLS_TITLE = /*#__PURE__*/function (FLOATING_CONTROLS_TITLE) {
@@ -0,0 +1,5 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
@@ -82,12 +82,14 @@ exports.backspace = exports.altPaste = exports.alignRight = exports.alignLeft =
82
82
  exports.bindKeymapArrayWithCommand = bindKeymapArrayWithCommand;
83
83
  exports.bindKeymapWithCommand = bindKeymapWithCommand;
84
84
  exports.bindKeymapWithEditorCommand = bindKeymapWithEditorCommand;
85
- exports.find = exports.escape = exports.enter = exports.dragToMoveUp = exports.dragToMoveDown = exports.deleteRow = exports.deleteKey = exports.deleteColumn = exports.decreaseMediaSize = exports.cut = exports.ctrlBackSpace = exports.copy = exports.clearFormatting = void 0;
85
+ exports.find = exports.escape = exports.enter = exports.dragToMoveUp = exports.dragToMoveDown = exports.deleteRow = exports.deleteKey = exports.deleteColumn = exports.decreaseMediaSize = exports.cut = exports.ctrlBackSpace = exports.copy = exports.continueInRovoChat = exports.clearFormatting = void 0;
86
86
  exports.findKeyMapForBrowser = findKeyMapForBrowser;
87
87
  exports.findKeymapByDescription = findKeymapByDescription;
88
88
  exports.findShortcutByDescription = findShortcutByDescription;
89
89
  exports.findShortcutByKeymap = findShortcutByKeymap;
90
- exports.forwardDelete = exports.focusToContextMenuTrigger = exports.focusTableResizer = void 0;
90
+ exports.focusToContextMenuTrigger = exports.focusTableResizer = void 0;
91
+ exports.formatShortcut = formatShortcut;
92
+ exports.forwardDelete = void 0;
91
93
  exports.getAriaKeyshortcuts = getAriaKeyshortcuts;
92
94
  exports.insertRule = exports.insertNewLine = exports.indentList = exports.indent = exports.increaseMediaSize = void 0;
93
95
  exports.isCapsLockOnAndModifyKeyboardEvent = isCapsLockOnAndModifyKeyboardEvent;
@@ -100,8 +102,8 @@ Object.defineProperty(exports, "keymap", {
100
102
  exports.makeKeyMapArrayWithCommon = makeKeyMapArrayWithCommon;
101
103
  exports.makeKeyMapWithCommon = makeKeyMapWithCommon;
102
104
  exports.makeKeymap = makeKeymap;
103
- exports.toggleBold = exports.toggleBlockQuote = exports.tab = exports.submit = exports.startColumnResizing = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.showElementDragHandle = exports.shiftTab = exports.shiftEnter = exports.shiftBackspace = exports.shiftArrowUp = exports.setNormalText = exports.selectTable = exports.selectRow = exports.selectColumn = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.navToFloatingToolbar = exports.navToEditorToolbar = exports.moveUp = exports.moveRowUp = exports.moveRowDown = exports.moveRight = exports.moveLeft = exports.moveDown = exports.moveColumnRight = exports.moveColumnLeft = void 0;
104
- exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = void 0;
105
+ exports.tab = exports.submit = exports.startColumnResizing = exports.splitListItem = exports.splitCodeBlock = exports.space = exports.showElementDragHandle = exports.shiftTab = exports.shiftEnter = exports.shiftBackspace = exports.shiftArrowUp = exports.setNormalText = exports.selectTable = exports.selectRow = exports.selectColumn = exports.redo = exports.previousCell = exports.pastePlainText = exports.paste = exports.outdentList = exports.outdent = exports.openHelp = exports.nextCell = exports.navToFloatingToolbar = exports.navToEditorToolbar = exports.moveUp = exports.moveRowUp = exports.moveRowDown = exports.moveRight = exports.moveLeft = exports.moveDown = exports.moveColumnRight = exports.moveColumnLeft = void 0;
106
+ exports.toggleUnderline = exports.toggleTaskItemCheckbox = exports.toggleTable = exports.toggleSuperscript = exports.toggleSubscript = exports.toggleStrikethrough = exports.toggleOrderedList = exports.toggleItalic = exports.toggleHighlightPalette = exports.toggleHeading6 = exports.toggleHeading5 = exports.toggleHeading4 = exports.toggleHeading3 = exports.toggleHeading2 = exports.toggleHeading1 = exports.toggleCode = exports.toggleBulletList = exports.toggleBold = exports.toggleBlockQuote = void 0;
105
107
  exports.tooltip = tooltip;
106
108
  exports.undo = void 0;
107
109
  var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof"));
@@ -214,6 +216,7 @@ var focusToContextMenuTrigger = exports.focusToContextMenuTrigger = makeKeyMapWi
214
216
  var dragToMoveUp = exports.dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Shift-ArrowUp');
215
217
  var dragToMoveDown = exports.dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Shift-ArrowDown');
216
218
  var showElementDragHandle = exports.showElementDragHandle = makeKeyMapWithCommon('Show drag handle for editor element', 'Ctrl-Shift-h');
219
+ var continueInRovoChat = exports.continueInRovoChat = makeKeyMapWithCommon('Continue in Rovo chat', 'Alt-Enter');
217
220
  var arrowKeysMap = {
218
221
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
219
222
  ARROWLEFT: "\u2190",
@@ -76,7 +76,10 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
76
76
  var nodeName = _ref.nodeName,
77
77
  loader = _ref.loader,
78
78
  getNodeViewOptions = _ref.getNodeViewOptions,
79
- dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent;
79
+ dispatchAnalyticsEvent = _ref.dispatchAnalyticsEvent,
80
+ _ref$lazyNodeViewOpti = _ref.lazyNodeViewOptions,
81
+ _ref$lazyNodeViewOpti2 = _ref$lazyNodeViewOpti === void 0 ? {} : _ref$lazyNodeViewOpti,
82
+ ignoreMutationDelegate = _ref$lazyNodeViewOpti2.ignoreMutationDelegate;
80
83
  var createLazyNodeView = function createLazyNodeView(node, view, getPos, decorations) {
81
84
  var _node$type;
82
85
  var requestedNodes = requestedNodesPerEditorView.get(view);
@@ -85,7 +88,9 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
85
88
  }
86
89
  var wasAlreadyRequested = requestedNodes.has(nodeName);
87
90
  if (wasAlreadyRequested) {
88
- return new _nodeView.LazyNodeView(node, view, getPos);
91
+ return new _nodeView.LazyNodeView(node, view, getPos, {
92
+ ignoreMutationDelegate: ignoreMutationDelegate
93
+ });
89
94
  }
90
95
  requestedNodes.add(nodeName);
91
96
  loader().then(function (nodeViewFuncModule) {
@@ -109,7 +114,9 @@ var withLazyLoading = exports.withLazyLoading = function withLazyLoading(_ref) {
109
114
  // },
110
115
  // });
111
116
  }
112
- return new _nodeView.LazyNodeView(node, view, getPos);
117
+ return new _nodeView.LazyNodeView(node, view, getPos, {
118
+ ignoreMutationDelegate: ignoreMutationDelegate
119
+ });
113
120
  };
114
121
  return createLazyNodeView;
115
122
  };
@@ -5,31 +5,43 @@ Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
7
  exports.LazyNodeView = void 0;
8
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
9
8
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
9
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
10
10
  var _model = require("@atlaskit/editor-prosemirror/model");
11
11
  /**
12
12
  * 🧱 Internal: Editor FE Platform
13
13
  *
14
14
  * A NodeView that serves as a placeholder until the actual NodeView is loaded.
15
15
  */
16
- var LazyNodeView = exports.LazyNodeView = /*#__PURE__*/(0, _createClass2.default)(function LazyNodeView(node, view, getPos) {
17
- var _node$type;
18
- (0, _classCallCheck2.default)(this, LazyNodeView);
19
- if (typeof ((_node$type = node.type) === null || _node$type === void 0 || (_node$type = _node$type.spec) === null || _node$type === void 0 ? void 0 : _node$type.toDOM) !== 'function') {
20
- this.dom = document.createElement('div');
21
- return;
22
- }
23
- var fallback = _model.DOMSerializer.renderSpec(document, node.type.spec.toDOM(node));
24
- this.dom = fallback.dom;
25
- this.contentDOM = fallback.contentDOM;
26
- if (this.dom instanceof HTMLElement) {
27
- // This attribute is mostly used for debugging purposed
28
- // It will help us to found out when the node was replaced
29
- this.dom.setAttribute('data-lazy-node-view', node.type.name);
30
- // This is used on Libra tests
31
- // We are using this to make sure all lazy noded were replaced
32
- // before the test started
33
- this.dom.setAttribute('data-lazy-node-view-fallback', 'true');
16
+ var LazyNodeView = exports.LazyNodeView = /*#__PURE__*/function () {
17
+ function LazyNodeView(node, view, getPos) {
18
+ var _node$type;
19
+ var options = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
20
+ (0, _classCallCheck2.default)(this, LazyNodeView);
21
+ this.ignoreMutationDelegate = options === null || options === void 0 ? void 0 : options.ignoreMutationDelegate;
22
+ if (typeof ((_node$type = node.type) === null || _node$type === void 0 || (_node$type = _node$type.spec) === null || _node$type === void 0 ? void 0 : _node$type.toDOM) !== 'function') {
23
+ this.dom = document.createElement('div');
24
+ return;
25
+ }
26
+ var fallback = _model.DOMSerializer.renderSpec(document, node.type.spec.toDOM(node));
27
+ this.dom = fallback.dom;
28
+ this.contentDOM = fallback.contentDOM;
29
+ if (this.dom instanceof HTMLElement) {
30
+ // This attribute is mostly used for debugging purposed
31
+ // It will help us to found out when the node was replaced
32
+ this.dom.setAttribute('data-lazy-node-view', node.type.name);
33
+ // This is used on Libra tests
34
+ // We are using this to make sure all lazy noded were replaced
35
+ // before the test started
36
+ this.dom.setAttribute('data-lazy-node-view-fallback', 'true');
37
+ }
34
38
  }
35
- });
39
+ (0, _createClass2.default)(LazyNodeView, [{
40
+ key: "ignoreMutation",
41
+ value: function ignoreMutation(mutation) {
42
+ var _this$ignoreMutationD;
43
+ return !!((_this$ignoreMutationD = this.ignoreMutationDelegate) !== null && _this$ignoreMutationD !== void 0 && _this$ignoreMutationD.call(this, mutation));
44
+ }
45
+ }]);
46
+ return LazyNodeView;
47
+ }();
@@ -7,6 +7,7 @@ Object.defineProperty(exports, "__esModule", {
7
7
  exports.queueReplaceNodeViews = exports.debouncedReplaceNodeviews = void 0;
8
8
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
9
9
  var _debounce = _interopRequireDefault(require("lodash/debounce"));
10
+ var _memoize = _interopRequireDefault(require("lodash/memoize"));
10
11
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
11
12
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
12
13
  /**
@@ -17,11 +18,10 @@ var isFirefox = /gecko\/\d/i.test(navigator.userAgent);
17
18
  /**
18
19
  * 🧱 Internal: Editor FE Platform
19
20
  *
20
- * Debounces and replaces the node views in a ProseMirror editor with lazy-loaded node views.
21
+ * Replaces the node views in a ProseMirror editor with lazy-loaded node views.
21
22
  *
22
23
  * This function is used to update the `nodeViews` property of the `EditorView` after lazy-loaded
23
- * node views have been loaded. It uses a debounced approach to ensure that the replacement does
24
- * not happen too frequently, which can be performance-intensive.
24
+ * node views have been loaded.
25
25
  *
26
26
  * The function checks if there are any loaded node views in the cache associated with the given
27
27
  * `EditorView`. If there are, it replaces the current `nodeViews` in the `EditorView` with the
@@ -45,9 +45,9 @@ var isFirefox = /gecko\/\d/i.test(navigator.userAgent);
45
45
  * 'tableCell': TableCellViewConstructor,
46
46
  * });
47
47
  *
48
- * debouncedReplaceNodeviews(cache, view);
48
+ * replaceNodeViews(cache, view);
49
49
  */
50
- var debouncedReplaceNodeviews = exports.debouncedReplaceNodeviews = (0, _debounce.default)(function (cache, view) {
50
+ var replaceNodeViews = function replaceNodeViews(cache, view) {
51
51
  var loadedNodeviews = cache.get(view);
52
52
  if (!loadedNodeviews || Object.keys(loadedNodeviews).length === 0) {
53
53
  return;
@@ -57,7 +57,13 @@ var debouncedReplaceNodeviews = exports.debouncedReplaceNodeviews = (0, _debounc
57
57
  // Make sure the cache is cleaned
58
58
  // From here, we will access the loaded node views by lexical scope
59
59
  cache.set(view, {});
60
-
60
+ var callback = function callback() {
61
+ var currentNodeViews = view.props.nodeViews;
62
+ var nextNodeViews = _objectSpread(_objectSpread({}, currentNodeViews), nodeViewsToReplace);
63
+ view.setProps({
64
+ nodeViews: nextNodeViews
65
+ });
66
+ };
61
67
  // eslint-disable-next-line compat/compat
62
68
  var idle = window.requestIdleCallback;
63
69
 
@@ -65,23 +71,95 @@ var debouncedReplaceNodeviews = exports.debouncedReplaceNodeviews = (0, _debounc
65
71
  * For reasons that goes beyond my knowledge
66
72
  * some Firefox versions aren't calling the requestIdleCallback.
67
73
  *
68
- * So, we need this check to make sure we use the requestAnimationFrame instead
74
+ * So, we need this check to make sure we are using the requestAnimationFrame for Firefox
69
75
  */
70
- var later = isFirefox || typeof idle !== 'function' ? window.requestAnimationFrame : idle;
71
- later(function () {
72
- var currentNodeViews = view.props.nodeViews;
73
- var nextNodeViews = _objectSpread(_objectSpread({}, currentNodeViews), nodeViewsToReplace);
74
- view.setProps({
75
- nodeViews: nextNodeViews
76
+ if (isFirefox || typeof idle !== 'function') {
77
+ window.requestAnimationFrame(callback);
78
+ } else {
79
+ idle(callback, {
80
+ timeout: 2000
76
81
  });
77
- });
78
- });
82
+ }
83
+ };
79
84
 
80
85
  /**
81
86
  * 🧱 Internal: Editor FE Platform
82
87
  */
83
88
  var loadedPerEditorView = new WeakMap();
84
89
 
90
+ /**
91
+ * 🧱 Internal: Editor FE Platform
92
+ * Based on https://github.com/lodash/lodash/issues/2403#issuecomment-1706130395
93
+ *
94
+ * Creates a debounced function that delays invoking the provided function until after a specified
95
+ * wait time has elapsed since the last time the debounced function was invoked. Additionally, the
96
+ * debounced function is memoized so that the same function instance is used for each unique set
97
+ * of arguments based on the resolver.
98
+ *
99
+ * This is particularly useful in scenarios where you want to debounce function calls while ensuring
100
+ * that each unique input combination receives its own debounced function instance. It's a combination
101
+ * of lodash's `debounce` and `memoize`.
102
+ *
103
+ * @template T
104
+ * @param {T} func - The function to debounce.
105
+ * @param {number} [wait=0] - The number of milliseconds to delay.
106
+ * @param {Object} [options] - The options object to pass to `debounce`.
107
+ * @param {Function} [resolver] - The function to resolve the cache key for memoization.
108
+ * @returns {Function} A new debounced and memoized function.
109
+ *
110
+ * @example
111
+ * const debouncedFunction = memoizeDebounce(myFunction, 300, { leading: true }, myResolver);
112
+ * debouncedFunction(arg1, arg2);
113
+ */
114
+ function memoizeDebounce(func) {
115
+ var wait = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
116
+ var options = arguments.length > 2 ? arguments[2] : undefined;
117
+ var resolver = arguments.length > 3 ? arguments[3] : undefined;
118
+ var mem = (0, _memoize.default)(function () {
119
+ return (0, _debounce.default)(func, wait, options);
120
+ }, resolver);
121
+ return function () {
122
+ return mem.apply(void 0, arguments).apply(void 0, arguments);
123
+ };
124
+ }
125
+
126
+ /**
127
+ * 🧱 Internal: Editor FE Platform
128
+ *
129
+ * Debounced and memoized version of `replaceNodeViews`.
130
+ *
131
+ * This function is designed to update the `nodeViews` property of an `EditorView` after a
132
+ * period of inactivity (debounce), ensuring that multiple rapid updates do not occur in quick
133
+ * succession. It uses lodash's `debounce` to handle the debouncing.
134
+ *
135
+ * Memoization is crucial here to ensure that each `EditorView` instance has its own opportunity
136
+ * to update the node views. Without memoization, if you have multiple `EditorView` instances on
137
+ * the same page, only one instance would potentially call `view.setProps`, which could lead to
138
+ * incorrect or missing updates in other `EditorView` instances. By memoizing the debounced function,
139
+ * we ensure that each `EditorView` maintains its own debounced update logic.
140
+ *
141
+ * @param {CacheLoadedReactNodeViews} cache - A WeakMap that stores the loaded node views for each
142
+ * `EditorView`. The key is the `EditorView`, and the value is a record of node type names
143
+ * to their corresponding `NodeViewConstructor`.
144
+ * @param {EditorView} view - The ProseMirror `EditorView` instance whose `nodeViews` property
145
+ * needs to be updated.
146
+ *
147
+ * This function is typically not called directly. Instead, it is invoked through `queueReplaceNodeViews`,
148
+ * which handles adding node views to the cache and triggering this debounced update.
149
+ */
150
+ var debouncedReplaceNodeviews = exports.debouncedReplaceNodeviews = memoizeDebounce(replaceNodeViews, 0,
151
+ /**
152
+ * Use the default debounce options:
153
+ * {leading: false, trailing: true}
154
+ */
155
+ undefined, function (cache, view) {
156
+ /**
157
+ * EditorView is a singleton.
158
+ * There is only one instance per Editor.
159
+ */
160
+ return view;
161
+ });
162
+
85
163
  /**
86
164
  * 🧱 Internal: Editor FE Platform
87
165
  */
@@ -118,6 +118,12 @@ Object.defineProperty(exports, "mediaAndEmbedToolbarMessages", {
118
118
  return _mediaAndEmbedToolbar.toolbarMessages;
119
119
  }
120
120
  });
121
+ Object.defineProperty(exports, "mediaInsertMessages", {
122
+ enumerable: true,
123
+ get: function get() {
124
+ return _mediaInsert.mediaInsertMessages;
125
+ }
126
+ });
121
127
  Object.defineProperty(exports, "mentionMessages", {
122
128
  enumerable: true,
123
129
  get: function get() {
@@ -222,6 +228,7 @@ var _mentions = require("./mentions");
222
228
  var _helpDialog = require("./help-dialog");
223
229
  var _highlight = require("./highlight");
224
230
  var _blockControls = require("./block-controls");
231
+ var _mediaInsert = require("./media-insert");
225
232
  var _default = exports.default = (0, _reactIntlNext.defineMessages)({
226
233
  layoutFixedWidth: {
227
234
  id: 'fabric.editor.layoutFixedWidth',
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.mediaInsertMessages = void 0;
7
+ var _reactIntlNext = require("react-intl-next");
8
+ var mediaInsertMessages = exports.mediaInsertMessages = (0, _reactIntlNext.defineMessages)({
9
+ loadPreview: {
10
+ id: 'fabric.editor.media.insert.loadPreview',
11
+ defaultMessage: 'Load preview',
12
+ description: 'Text on a button that loads a preview of a media file that has been linked to from a URL'
13
+ },
14
+ insert: {
15
+ id: 'fabric.editor.media.insert.insert',
16
+ defaultMessage: 'Insert',
17
+ description: 'Text on the modal action button that inserts the linked media file into the editor document'
18
+ },
19
+ pasteLinkToUpload: {
20
+ id: 'fabric.editor.media.insert.pasteLinkToUpload',
21
+ defaultMessage: 'Paste link to upload',
22
+ description: 'Placeholder text for the input field where a user can paste (as in copy-paste) a URL to upload a media file'
23
+ },
24
+ cancel: {
25
+ id: 'fabric.editor.media.insert.cancel',
26
+ defaultMessage: 'Cancel',
27
+ description: 'Text on the modal action button that cancels the media file insertion and closes the modal'
28
+ },
29
+ errorMessage: {
30
+ id: 'fabric.editor.media.insert.errorMessage',
31
+ defaultMessage: 'Unfortunately, we can’t add this image link. Download the image, then drag and drop onto the page.',
32
+ description: 'Error message displayed when a user tries to insert an image from a URL that cannot be loaded. This may be because the URL is invalid, there is a network error or any other reason the preview upload does not succeed. When this occurs the suggestion is to attempt downloading the linked file manually and using a local upload instead.'
33
+ },
34
+ warning: {
35
+ id: 'fabric.editor.media.insert.warning',
36
+ defaultMessage: 'This image might not be visible to others due to source restrictions. Consider uploading the file instead.',
37
+ description: 'Warning message displayed when a user tries to insert an image from a URL that may not be visible to others due to source restrictions such as not having permissions/authentication to load the image. The suggestion is to upload the file instead.'
38
+ },
39
+ mediaAlt: {
40
+ id: 'fabric.editor.media.insert.mediaAlt',
41
+ defaultMessage: 'Preview for uploaded image or video file',
42
+ description: 'Alt text describing a preview of an image uploaded.'
43
+ }
44
+ });
@@ -17,7 +17,7 @@ function _getRequireWildcardCache(e) { if ("function" != typeof WeakMap) return
17
17
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? Object.getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? Object.defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
18
18
  var SENTRY_DSN = 'https://0b10c8e02fb44d8796c047b102c9bee8@o55978.ingest.sentry.io/4505129224110080';
19
19
  var packageName = 'editor-common'; // Sentry doesn't accept '/' in its releases https://docs.sentry.io/platforms/javascript/configuration/releases/
20
- var packageVersion = "87.5.1";
20
+ var packageVersion = "87.6.1";
21
21
  var sanitiseSentryEvents = function sanitiseSentryEvents(data, _hint) {
22
22
  // Remove URL as it has UGC
23
23
  // TODO: Sanitise the URL instead of just removing it
@@ -23,12 +23,11 @@ var CodeBlockSharedCssClassName = exports.CodeBlockSharedCssClassName = {
23
23
  DS_CODEBLOCK: '[data-ds--code--code-block]',
24
24
  CODEBLOCK_LINE_NUMBER_GUTTER_FG_WRAP: 'line-number-gutter--fg-wrap',
25
25
  CODEBLOCK_CONTENT_WRAPPED: 'code-content--wrapped',
26
- CODEBLOCK_CONTAINER_LINE_NUMBER_WRAPPED: 'code-content__line-number--wrapped'
26
+ CODEBLOCK_CONTAINER_LINE_NUMBER_WRAPPED: 'code-content__line-number--wrapped',
27
+ CODEBLOCK_WRAPPED: 'code-block--wrapped'
27
28
  };
28
-
29
- // TODO: ED-24222 Remove flex styling and hardcoded word
30
29
  var codeBlockSharedStyles = exports.codeBlockSharedStyles = function codeBlockSharedStyles() {
31
- return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\n\t\t--ds--code--bg-color: transparent;\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\tflex-shrink: 0;\n\t\t\ttext-align: right;\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\n\t\t\tspan {\n\t\t\t\tdisplay: block;\n\t\t\t\tline-height: 0;\n\t\t\t\tfont-size: 0;\n\n\t\t\t\t::before {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\tcontent: counter(line);\n\t\t\t\t\tcounter-increment: line;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t\tline-height: 1.5rem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: 1rem;\n\t\t}\n\n\t\t.", " {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\n\t\t\tcode {\n\t\t\t\tflex-grow: 1;\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\twhite-space: pre;\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\tcounter-reset: line var(--line-num, 0);\n\t\t\t\tword-break: break-word;\n\t\t\t\twhite-space: pre-wrap;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcounter-increment: line;\n\t\t\tline-height: 1rem;\n\t\t\tpointer-events: none;\n\n\t\t\t::before {\n\t\t\t\ttext-align: right;\n\t\t\t\tmin-width: 1.5rem;\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 1rem;\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding-right: ", ";\n\t\t\t\tpadding-left: ", ";\n\t\t\t\tmargin-top: ", ";\n\t\t\t\tmargin-right: ", ";\n\t\t\t\tleft: -0.5rem;\n\t\t\t\tcolor: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tcontent: counter(line);\n\t\t\t}\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, transparent)", "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, ".concat(_colors.N20, ")"), "var(--ds-border-radius, 3px)", (0, _editorSharedStyles.overflowShadow)({
30
+ return (0, _react.css)(_templateObject || (_templateObject = (0, _taggedTemplateLiteral2.default)(["\n\t.", "\n\t\t> .", "\n\t\t> .", "\n\t\tcode {\n\t\tword-break: break-word;\n\t\twhite-space: pre-wrap;\n\t}\n\n\t.", " {\n\t\tposition: relative;\n\t\tbackground-color: ", ";\n\t\tborder-radius: ", ";\n\t\tmargin: ", " 0 0 0;\n\t\tfont-family: ", ";\n\t\tmin-width: ", "px;\n\t\tcursor: pointer;\n\n\t\t--ds--code--bg-color: transparent;\n\n\t\t/* This is necessary to allow for arrow key navigation in/out of code blocks in Firefox. */\n\t\twhite-space: normal;\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\ttop: 0px;\n\t\t\tleft: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tposition: absolute;\n\t\t\tvisibility: hidden;\n\t\t\theight: 1.5rem;\n\t\t\tbottom: 0px;\n\t\t\tright: 0px;\n\t\t}\n\n\t\t.", " {\n\t\t\tword-break: break-word;\n\t\t\twhite-space: pre-wrap;\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tdisplay: flex;\n\t\t\tborder-radius: ", ";\n\t\t\twidth: 100%;\n\t\t\tcounter-reset: line;\n\t\t\toverflow-x: auto;\n\n\t\t\tbackground-image: ", ";\n\n\t\t\tbackground-repeat: no-repeat;\n\t\t\tbackground-attachment: local, local, local, local, scroll, scroll, scroll, scroll;\n\t\t\tbackground-size:\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%,\n\t\t\t\t", " 100%,\n\t\t\t\t1px 100%;\n\t\t\tbackground-position:\n\t\t\t\t0 0,\n\t\t\t\t0 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t100% 0,\n\t\t\t\t0 0,\n\t\t\t\t0 0;\n\n\t\t\t/* Be careful if refactoring this; it is needed to keep arrow key navigation in Firefox consistent with other browsers. */\n\t\t\toverflow-y: hidden;\n\t\t}\n\n\t\t.", " {\n\t\t\tflex-shrink: 0;\n\t\t\ttext-align: right;\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\n\t\t\tspan {\n\t\t\t\tdisplay: block;\n\t\t\t\tline-height: 0;\n\t\t\t\tfont-size: 0;\n\n\t\t\t\t::before {\n\t\t\t\t\tdisplay: inline-block;\n\t\t\t\t\tcontent: counter(line);\n\t\t\t\t\tcounter-increment: line;\n\t\t\t\t\tcolor: ", ";\n\t\t\t\t\tfont-size: ", ";\n\t\t\t\t\tline-height: 1.5rem;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tbackground-color: ", ";\n\t\t\tpadding: ", ";\n\t\t\tposition: relative;\n\t\t\twidth: 1rem;\n\t\t}\n\n\t\t.", " {\n\t\t\tdisplay: flex;\n\t\t\tflex: 1;\n\n\t\t\tcode {\n\t\t\t\tflex-grow: 1;\n\t\t\t\ttab-size: 4;\n\t\t\t\tcursor: text;\n\t\t\t\tcolor: ", ";\n\t\t\t\tborder-radius: ", ";\n\t\t\t\tmargin: ", ";\n\t\t\t\twhite-space: pre;\n\t\t\t\tfont-size: ", ";\n\t\t\t\tline-height: 1.5rem;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcode {\n\t\t\t\tcounter-reset: line var(--line-num, 0);\n\t\t\t\tword-break: break-word;\n\t\t\t\twhite-space: pre-wrap;\n\t\t\t}\n\t\t}\n\n\t\t.", " {\n\t\t\tcounter-increment: line;\n\t\t\tline-height: 1rem;\n\t\t\tpointer-events: none;\n\n\t\t\t::before {\n\t\t\t\ttext-align: right;\n\t\t\t\tmin-width: 1.5rem;\n\t\t\t\tdisplay: block;\n\t\t\t\theight: 1rem;\n\t\t\t\tposition: absolute;\n\t\t\t\tpadding-right: ", ";\n\t\t\t\tpadding-left: ", ";\n\t\t\t\tmargin-top: ", ";\n\t\t\t\tmargin-right: ", ";\n\t\t\t\tleft: -0.5rem;\n\t\t\t\tcolor: ", ";\n\t\t\t\tfont-size: ", ";\n\t\t\t\tcontent: counter(line);\n\t\t\t}\n\t\t}\n\t}\n"])), CodeBlockSharedCssClassName.CODEBLOCK_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER, "var(--ds-surface-raised, transparent)", "var(--ds-border-radius, 3px)", _editorSharedStyles.blockNodesVerticalMargin, _editorSharedStyles.akEditorCodeFontFamily, _editorSharedStyles.akEditorTableCellMinWidth, CodeBlockSharedCssClassName.CODEBLOCK_START, CodeBlockSharedCssClassName.CODEBLOCK_END, CodeBlockSharedCssClassName.CODEBLOCK_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPER, "var(--ds-background-neutral, ".concat(_colors.N20, ")"), "var(--ds-border-radius, 3px)", (0, _editorSharedStyles.overflowShadow)({
32
31
  leftCoverWidth: "var(--ds-space-300, 24px)"
33
32
  }), "var(--ds-space-300, 24px)", "var(--ds-space-300, 24px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER, "var(--ds-background-neutral, ".concat(_colors.N30, ")"), "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_LINE_NUMBER_GUTTER_FG_WRAP, "var(--ds-background-neutral, ".concat(_colors.N30, ")"), "var(--ds-space-100, 8px)", CodeBlockSharedCssClassName.CODEBLOCK_CONTENT, "var(--ds-text, ".concat(_colors.N800, ")"), "var(--ds-border-radius, 3px)", "var(--ds-space-100, 8px)", (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()), CodeBlockSharedCssClassName.CODEBLOCK_CONTENT_WRAPPED, CodeBlockSharedCssClassName.CODEBLOCK_CONTAINER_LINE_NUMBER_WRAPPED, "var(--ds-space-100, 8px)", "var(--ds-space-100, 8px)", "var(--ds-space-050, 4px)", "var(--ds-space-100, 8px)", "var(--ds-text-subtlest, ".concat(_colors.N400, ")"), (0, _editorSharedStyles.relativeFontSizeToBase16)((0, _constants.fontSize)()));
34
33
  };
@@ -23,7 +23,7 @@ function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.
23
23
  * @jsx jsx
24
24
  */ // eslint-disable-next-line @atlaskit/ui-styling-standard/use-compiled -- Ignored via go/DSP-18766
25
25
  var packageName = "@atlaskit/editor-common";
26
- var packageVersion = "87.5.1";
26
+ var packageVersion = "87.6.1";
27
27
  var halfFocusRing = 1;
28
28
  var dropOffset = '0, 8';
29
29
  var DropList = /*#__PURE__*/function (_Component) {
@@ -139,6 +139,9 @@ export let ACTION = /*#__PURE__*/function (ACTION) {
139
139
  ACTION["UPDATE_PARAMETERS"] = "updateParameters";
140
140
  ACTION["GET_CHILDERN"] = "getChildern";
141
141
  ACTION["MOVED"] = "moved";
142
+ ACTION["UPLOAD_COMMENCED"] = "uploadCommenced";
143
+ ACTION["UPLOAD_SUCCEEDED"] = "uploadSucceeded";
144
+ ACTION["UPLOAD_FAILED"] = "uploadFailed";
142
145
  ACTION["TOGGLE_CODE_BLOCK_WRAP"] = "toggleCodeBlockWrap";
143
146
  return ACTION;
144
147
  }({});
@@ -371,6 +374,7 @@ export let ACTION_SUBJECT_ID = /*#__PURE__*/function (ACTION_SUBJECT_ID) {
371
374
  ACTION_SUBJECT_ID["ON_UNSUPPORTED_INLINE"] = "onUnsupportedInline";
372
375
  ACTION_SUBJECT_ID["ON_UNSUPPORTED_BLOCK"] = "onUnsupportedBlock";
373
376
  ACTION_SUBJECT_ID["MULTI_BODIED_EXTENSION"] = "multiBodiedExtension";
377
+ ACTION_SUBJECT_ID["UPLOAD_MEDIA_FROM_URL"] = "uploadMediaFromUrl";
374
378
  return ACTION_SUBJECT_ID;
375
379
  }({});
376
380
  export let FLOATING_CONTROLS_TITLE = /*#__PURE__*/function (FLOATING_CONTROLS_TITLE) {
@@ -0,0 +1 @@
1
+ export {};
@@ -102,6 +102,7 @@ export const focusToContextMenuTrigger = makeKeyMapWithCommon('Focus table conte
102
102
  export const dragToMoveUp = makeKeyMapWithCommon('Move node up in the document', 'Ctrl-Shift-ArrowUp');
103
103
  export const dragToMoveDown = makeKeyMapWithCommon('Move node down in the document', 'Ctrl-Shift-ArrowDown');
104
104
  export const showElementDragHandle = makeKeyMapWithCommon('Show drag handle for editor element', 'Ctrl-Shift-h');
105
+ export const continueInRovoChat = makeKeyMapWithCommon('Continue in Rovo chat', 'Alt-Enter');
105
106
  const arrowKeysMap = {
106
107
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
107
108
  ARROWLEFT: '\u2190',
@@ -116,7 +117,7 @@ const tooltipShortcutStyle = css({
116
117
  // NOTE: This might not actually do anything: https://atlassian.slack.com/archives/CFG3PSQ9E/p1647395052443259?thread_ts=1647394572.556029&cid=CFG3PSQ9E
117
118
  label: 'tooltip-shortcut'
118
119
  });
119
- function formatShortcut(keymap) {
120
+ export function formatShortcut(keymap) {
120
121
  let shortcut;
121
122
  if (browser.mac) {
122
123
  // for reference: https://wincent.com/wiki/Unicode_representations_of_modifier_keys
@@ -65,7 +65,10 @@ export const withLazyLoading = ({
65
65
  nodeName,
66
66
  loader,
67
67
  getNodeViewOptions,
68
- dispatchAnalyticsEvent
68
+ dispatchAnalyticsEvent,
69
+ lazyNodeViewOptions: {
70
+ ignoreMutationDelegate
71
+ } = {}
69
72
  }) => {
70
73
  const createLazyNodeView = (node, view, getPos, decorations) => {
71
74
  var _node$type, _node$type$spec;
@@ -75,7 +78,9 @@ export const withLazyLoading = ({
75
78
  }
76
79
  const wasAlreadyRequested = requestedNodes.has(nodeName);
77
80
  if (wasAlreadyRequested) {
78
- return new LazyNodeView(node, view, getPos);
81
+ return new LazyNodeView(node, view, getPos, {
82
+ ignoreMutationDelegate
83
+ });
79
84
  }
80
85
  requestedNodes.add(nodeName);
81
86
  loader().then(nodeViewFuncModule => {
@@ -99,7 +104,9 @@ export const withLazyLoading = ({
99
104
  // },
100
105
  // });
101
106
  }
102
- return new LazyNodeView(node, view, getPos);
107
+ return new LazyNodeView(node, view, getPos, {
108
+ ignoreMutationDelegate
109
+ });
103
110
  };
104
111
  return createLazyNodeView;
105
112
  };
@@ -5,8 +5,9 @@ import { DOMSerializer } from '@atlaskit/editor-prosemirror/model';
5
5
  * A NodeView that serves as a placeholder until the actual NodeView is loaded.
6
6
  */
7
7
  export class LazyNodeView {
8
- constructor(node, view, getPos) {
8
+ constructor(node, view, getPos, options = {}) {
9
9
  var _node$type, _node$type$spec;
10
+ this.ignoreMutationDelegate = options === null || options === void 0 ? void 0 : options.ignoreMutationDelegate;
10
11
  if (typeof ((_node$type = node.type) === null || _node$type === void 0 ? void 0 : (_node$type$spec = _node$type.spec) === null || _node$type$spec === void 0 ? void 0 : _node$type$spec.toDOM) !== 'function') {
11
12
  this.dom = document.createElement('div');
12
13
  return;
@@ -24,4 +25,8 @@ export class LazyNodeView {
24
25
  this.dom.setAttribute('data-lazy-node-view-fallback', 'true');
25
26
  }
26
27
  }
28
+ ignoreMutation(mutation) {
29
+ var _this$ignoreMutationD;
30
+ return !!((_this$ignoreMutationD = this.ignoreMutationDelegate) !== null && _this$ignoreMutationD !== void 0 && _this$ignoreMutationD.call(this, mutation));
31
+ }
27
32
  }