Copy and paste as well as dragging files added
CI / build (push) Has been skipped
CI / deploy (push) Failing after 34s

This commit is contained in:
2026-03-12 18:09:45 -05:00
parent cd5fb71899
commit 55047b5d90
2 changed files with 85 additions and 2 deletions
+16 -1
View File
@@ -24,6 +24,17 @@ export const CustomImage = Image.extend({
};
},
addCommands() {
return {
setImage: (options: { src: string, alt?: string, title?: string, filename?: string }) => ({ commands }) => {
return commands.insertContent({
type: this.name,
attrs: options,
});
},
};
},
addNodeView() {
return ({ node, getPos, editor }) => {
const wrapper = document.createElement('div');
@@ -76,10 +87,14 @@ export const CustomImage = Image.extend({
},
});
import type { SetImageOptions } from "@tiptap/extension-image";
declare module '@tiptap/core' {
interface Commands<ReturnType> {
image: {
setImage: (options: { src: string, alt?: string, title?: string, filename?: string }) => ReturnType;
// @ts-ignore
setImage: (options: SetImageOptions & { filename?: string }) => ReturnType;
};
}
}
// @ts-ignore