var i=globalThis.__LEPTOS_TIPTAP_BRIDGE__;if(i==null||i.modules==null)throw new Error("leptos-tiptap bridge bindings are unavailable");var e=i.modules["@tiptap/core"];if(e==null)throw new Error('leptos-tiptap bridge module "@tiptap/core" is unavailable');var R=e.CommandManager,P=e.Editor,C=e.Extension,T=e.InputRule,S=e.Mark,a=e.Node,A=e.NodePos,B=e.NodeView,w=e.PasteRule,N=e.Tracker,O=e.callOrReturn,M=e.canInsertNode,v=e.combineTransactionSteps,I=e.createChainableState,F=e.createDocument,D=e.createNodeFromContent,j=e.createStyleTag,H=e.defaultBlockAt,L=e.deleteProps,K=e.elementFromString,q=e.escapeForRegEx,G=e.extensions,z=e.findChildren,J=e.findChildrenInRange,$=e.findDuplicates,U=e.findParentNode,V=e.findParentNodeClosestToPos,Y=e.fromString,Q=e.generateHTML,W=e.generateJSON,X=e.generateText,Z=e.getAttributes,ee=e.getAttributesFromExtensions,te=e.getChangedRanges,ne=e.getDebugJSON,oe=e.getExtensionField,re=e.getHTMLFromFragment,ie=e.getMarkAttributes,se=e.getMarkRange,ae=e.getMarkType,le=e.getMarksBetween,de=e.getNodeAtPosition,pe=e.getNodeAttributes,ce=e.getNodeType,ue=e.getRenderedAttributes,ge=e.getSchema,_e=e.getSchemaByResolvedExtensions,me=e.getSchemaTypeByName,xe=e.getSchemaTypeNameByName,ke=e.getSplittedAttributes,be=e.getText,ye=e.getTextBetween,he=e.getTextContentFromNodes,fe=e.getTextSerializersFromSchema,Ee=e.injectExtensionAttributesToParseRule,Re=e.inputRulesPlugin,Pe=e.isActive,Ce=e.isAtEndOfNode,Te=e.isAtStartOfNode,Se=e.isEmptyObject,Ae=e.isExtensionRulesEnabled,Be=e.isFunction,we=e.isList,Ne=e.isMacOS,Oe=e.isMarkActive,Me=e.isNodeActive,ve=e.isNodeEmpty,Ie=e.isNodeSelection,Fe=e.isNumber,De=e.isPlainObject,je=e.isRegExp,He=e.isSafari,Le=e.isString,Ke=e.isTextSelection,qe=e.isiOS,Ge=e.markInputRule,ze=e.markPasteRule,l=e.mergeAttributes,Je=e.mergeDeep,$e=e.minMax,Ue=e.nodeInputRule,Ve=e.nodePasteRule,Ye=e.objectIncludes,Qe=e.pasteRulesPlugin,We=e.posToDOMRect,Xe=e.removeDuplicates,Ze=e.resolveFocusPosition,et=e.rewriteUnknownContent,tt=e.selectionToInsertionEnd,nt=e.splitExtensions,ot=e.textInputRule,rt=e.textPasteRule,it=e.textblockTypeInputRule,st=e.wrappingInputRule;var d=a.create({name:"hardBreak",addOptions(){return{keepMarks:!0,HTMLAttributes:{}}},inline:!0,group:"inline",selectable:!1,linebreakReplacement:!0,parseHTML(){return[{tag:"br"}]},renderHTML({HTMLAttributes:t}){return["br",l(this.options.HTMLAttributes,t)]},renderText(){return`
`},addCommands(){return{setHardBreak:()=>({commands:t,chain:n,state:o,editor:g})=>t.first([()=>t.exitCode(),()=>t.command(()=>{let{selection:r,storedMarks:_}=o;if(r.$from.parent.type.spec.isolating)return!1;let{keepMarks:m}=this.options,{splittableMarks:x}=g.extensionManager,s=_||r.$to.parentOffset&&r.$from.marks();return n().insertContent({type:this.name}).command(({tr:k,dispatch:b})=>{if(b&&s&&m){let y=s.filter(h=>x.includes(h.type.name));k.ensureMarks(y)}return!0}).run()})])}},addKeyboardShortcuts(){return{"Mod-Enter":()=>this.editor.commands.setHardBreak(),"Shift-Enter":()=>this.editor.commands.setHardBreak()}}});var p="__LEPTOS_TIPTAP_BRIDGE__";function f(){let t=globalThis,n=t[p];if(n!=null)return n;let o={modules:{},registerExtension:()=>{throw new Error("leptos-tiptap bridge runtime is not initialized")}};return t[p]=o,o}function c(){return f()}function u(t){c().registerExtension(t)}var E={name:"hard_break",create:()=>d,commands:{set_hard_break:t=>t.chain().focus().setHardBreak().run()}};function mt(){u(E)}export{mt as register_hard_break};
