forked from github/plane
d470adf262
* added image-resizing support * link form removed * updated image upload logic and 35% default width on upload * removed shadow, added alert if not saved and ts errors * prevent enter key on Link selector to trigger modal submit * added workspace slug to all tiptap instances * added delete plugin with loading indicator * added better syncing of "Saved" state of editor and Image uploads * removed redundant description_html check
23 lines
501 B
TypeScript
23 lines
501 B
TypeScript
import Image from "@tiptap/extension-image";
|
|
import TrackImageDeletionPlugin from "../plugins/delete-image";
|
|
import UploadImagesPlugin from "../plugins/upload-image";
|
|
|
|
const UpdatedImage = Image.extend({
|
|
addProseMirrorPlugins() {
|
|
return [UploadImagesPlugin(), TrackImageDeletionPlugin()];
|
|
},
|
|
addAttributes() {
|
|
return {
|
|
...this.parent?.(),
|
|
width: {
|
|
default: '35%',
|
|
},
|
|
height: {
|
|
default: null,
|
|
},
|
|
};
|
|
},
|
|
});
|
|
|
|
export default UpdatedImage;
|