@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.
@@ -10598,11 +10598,18 @@ var ImageExtension = Menu$3.Node.create({
10598
10598
  props: {
10599
10599
  handleDOMEvents: {
10600
10600
  paste: function paste(view, event) {
10601
- var _event$clipboardData;
10601
+ var _event$clipboardData, _event$clipboardData2;
10602
10602
  var _view$state = view.state,
10603
10603
  schema = _view$state.schema,
10604
10604
  pos = _view$state.selection.$anchor.pos;
10605
- 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;
10605
+
10606
+ // Microsoft Excel and a few other products might copy content as
10607
+ // both `text/plain` and `text/html`. If `text/plain` exists,
10608
+ // an early return will ensure that it fallbacks to tiptap's
10609
+ // default paste behavior.
10610
+ var text = event === null || event === void 0 || (_event$clipboardData = event.clipboardData) === null || _event$clipboardData === void 0 ? void 0 : _event$clipboardData.getData("text/plain");
10611
+ if (text) return;
10612
+ 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;
10606
10613
  if (!hasFiles) return;
10607
10614
  var images = Array.from(event.clipboardData.files).filter(function (file) {
10608
10615
  return /image/i.test(file.type);