@bigbinary/neeto-editor 1.45.7 → 1.45.8-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/Editor.js CHANGED
@@ -10578,11 +10578,18 @@ var ImageExtension = Node.create({
10578
10578
  props: {
10579
10579
  handleDOMEvents: {
10580
10580
  paste: function paste(view, event) {
10581
- var _event$clipboardData;
10581
+ var _event$clipboardData, _event$clipboardData2;
10582
10582
  var _view$state = view.state,
10583
10583
  schema = _view$state.schema,
10584
10584
  pos = _view$state.selection.$anchor.pos;
10585
- var hasFiles = (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 || (_event$clipboardData = _event$clipboardData.files) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.length;
10585
+
10586
+ // Microsoft Excel and a few other products might copy content as
10587
+ // both `text/plain` and `text/html`. If `text/plain` exists,
10588
+ // an early return will ensure that it fallbacks to tiptap's
10589
+ // default paste behavior.
10590
+ var text = event === null || event === void 0 || (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.getData("text/plain");
10591
+ if (text) return;
10592
+ var hasFiles = (_event$clipboardData2 = event.clipboardData) === null || _event$clipboardData2 === void 0 || (_event$clipboardData2 = _event$clipboardData2.files) === null || _event$clipboardData2 === void 0 ? void 0 : _event$clipboardData2.length;
10586
10593
  if (!hasFiles) return;
10587
10594
  var images = Array.from(event.clipboardData.files).filter(function (file) {
10588
10595
  return /image/i.test(file.type);