@tiptap/core 2.2.2 → 2.2.4
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/index.cjs +4 -4
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +4 -4
- package/dist/index.js.map +1 -1
- package/dist/index.umd.js +4 -4
- package/dist/index.umd.js.map +1 -1
- package/dist/packages/core/src/PasteRule.d.ts +5 -5
- package/package.json +2 -2
- package/src/PasteRule.ts +12 -12
package/dist/index.js
CHANGED
|
@@ -802,8 +802,8 @@ function pasteRulesPlugin(props) {
|
|
|
802
802
|
let dragSourceElement = null;
|
|
803
803
|
let isPastedFromProseMirror = false;
|
|
804
804
|
let isDroppedFromProseMirror = false;
|
|
805
|
-
let pasteEvent = new ClipboardEvent('paste');
|
|
806
|
-
let dropEvent = new DragEvent('drop');
|
|
805
|
+
let pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
|
|
806
|
+
let dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
|
|
807
807
|
const plugins = rules.map(rule => {
|
|
808
808
|
return new Plugin({
|
|
809
809
|
// we register a global drag handler to track the current drag source element
|
|
@@ -870,8 +870,8 @@ function pasteRulesPlugin(props) {
|
|
|
870
870
|
if (!handler || !tr.steps.length) {
|
|
871
871
|
return;
|
|
872
872
|
}
|
|
873
|
-
dropEvent = new DragEvent('drop');
|
|
874
|
-
pasteEvent = new ClipboardEvent('paste');
|
|
873
|
+
dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
|
|
874
|
+
pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
|
|
875
875
|
return tr;
|
|
876
876
|
},
|
|
877
877
|
});
|