feat: init and add video extension to editor/canva

This commit is contained in:
swve 2022-12-14 17:49:21 +01:00
parent 8d0efdb93e
commit 9f916449c5
9 changed files with 163 additions and 10 deletions

View file

@ -4,23 +4,28 @@ import { ReactNodeViewRenderer } from "@tiptap/react";
import VideoBlockComponent from "./VideoBlockComponent";
export default Node.create({
name: "calloutWarning",
name: "blockVideo",
group: "block",
draggable: true,
content: "inline*",
// TODO : multi line support
atom: true,
addAttributes() {
return {
fileObject: {
default: null,
},
};
},
parseHTML() {
return [
{
tag: "callout-warning",
tag: "block-video",
},
];
},
renderHTML({ HTMLAttributes }) {
return ["callout-info", mergeAttributes(HTMLAttributes), 0];
return ["block-video", mergeAttributes(HTMLAttributes), 0];
},
addNodeView() {