()
| 31 | }, |
| 32 | |
| 33 | addCommands() { |
| 34 | return { |
| 35 | setImage: |
| 36 | (attrs) => |
| 37 | ({ commands }) => { |
| 38 | return commands.insertContent({ |
| 39 | type: this.name, |
| 40 | attrs, |
| 41 | }); |
| 42 | }, |
| 43 | |
| 44 | uploadImage: |
| 45 | () => |
| 46 | ({ editor }) => { |
| 47 | const input = document.createElement('input'); |
| 48 | input.type = 'file'; |
| 49 | input.accept = 'image/*'; |
| 50 | input.onchange = () => { |
| 51 | const file = input.files?.[0]; |
| 52 | if (file) { |
| 53 | void executeUploadFlow({ |
| 54 | editor, |
| 55 | file, |
| 56 | uploadImage: options.uploadImage, |
| 57 | }); |
| 58 | } |
| 59 | }; |
| 60 | input.click(); |
| 61 | return true; |
| 62 | }, |
| 63 | }; |
| 64 | }, |
| 65 | |
| 66 | addProseMirrorPlugins() { |
| 67 | const { editor } = this; |
nothing calls this directly
no test coverage detected