@tiptap/core 2.2.3 → 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.cjs
CHANGED
|
@@ -806,8 +806,8 @@ function pasteRulesPlugin(props) {
|
|
|
806
806
|
let dragSourceElement = null;
|
|
807
807
|
let isPastedFromProseMirror = false;
|
|
808
808
|
let isDroppedFromProseMirror = false;
|
|
809
|
-
let pasteEvent = new ClipboardEvent('paste');
|
|
810
|
-
let dropEvent = new DragEvent('drop');
|
|
809
|
+
let pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
|
|
810
|
+
let dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
|
|
811
811
|
const plugins = rules.map(rule => {
|
|
812
812
|
return new state.Plugin({
|
|
813
813
|
// we register a global drag handler to track the current drag source element
|
|
@@ -874,8 +874,8 @@ function pasteRulesPlugin(props) {
|
|
|
874
874
|
if (!handler || !tr.steps.length) {
|
|
875
875
|
return;
|
|
876
876
|
}
|
|
877
|
-
dropEvent = new DragEvent('drop');
|
|
878
|
-
pasteEvent = new ClipboardEvent('paste');
|
|
877
|
+
dropEvent = typeof DragEvent !== 'undefined' ? new DragEvent('drop') : null;
|
|
878
|
+
pasteEvent = typeof ClipboardEvent !== 'undefined' ? new ClipboardEvent('paste') : null;
|
|
879
879
|
return tr;
|
|
880
880
|
},
|
|
881
881
|
});
|