UNPKG

@edifice.io/tiptap-extensions

Version:
3 lines (2 loc) 883 B
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const core=require("@tiptap/core"),InformationPane=core.Node.create({name:"information-pane",group:"block",content:"block+",defining:!0,marks:"",addAttributes(){return{type:{default:"info",parseHTML:element=>element.getAttribute("data-type")||"info",renderHTML:attributes=>({"data-type":attributes.type})}}},parseHTML(){return[{tag:"div[data-information-pane]"}]},renderHTML({node,HTMLAttributes}){const type=node.attrs.type;return["div",core.mergeAttributes(HTMLAttributes,{"data-information-pane":"",class:`information-pane information-pane-${type}`}),0]},addCommands(){return{setInformationPane:(type="info")=>({commands})=>commands.insertContent([{type:this.name,attrs:{type},content:[{type:"paragraph"}]}])}}});exports.InformationPane=InformationPane; //# sourceMappingURL=information-pane.cjs.map