plate icon indicating copy to clipboard operation
plate copied to clipboard

Code Block Error - Single Line

Open remusris opened this issue 6 months ago • 2 comments

Description

When you have a single code block on page you get this error

Delete everything in the code block then start typing when it's empty and you'll get the error below

Error: Cannot find a descendant at path [1,1] in node: {"children":[{"id":"4jfkls","type":"p","children":[{"text":""}]},{"id":"1","type":"code_block","children":[{"text":"f"}]},{"children":[{"text":""}],"type":"p","id":"0a93l"}],"operations":[{"type":"insert_node","path":[1,1],"node":{"text":"f"}},{"type":"set_selection","properties":{"anchor":{"path":[1,0],"offset":0},"focus":{"path":[1,0],"offset":0}},"newProperties":{"anchor":{"path":[1,1],"offset":1},"focus":{"path":[1,1],"offset":1}}},{"type":"remove_node","path":[1,0],"node":{"text":"","type":"code_line"}}],"selection":{"anchor":{"path":[1,0],"offset":1},"focus":{"path":[1,0],"offset":1}},"marks":null,"id":"jwaS2VJ6MPkQjqnF5CGgk","prevSelection":{"anchor":{"path":[1,0],"offset":0},"focus":{"path":[1,0],"offset":0}},"isFallback":false,"currentKeyboardEvent":null,"plate":{"set":{}},"key":0.005925071184135211,"plugins":[{"key":"react","type":"react","options":{},"inject":{},"editor":{}},{"key":"history","type":"history","options":{},"inject":{},"editor":{}},{"key":"nodeFactory","type":"nodeFactory","options":{},"inject":{},"editor":{}},{"handlers":{},"key":"event-editor","type":"event-editor","options":{},"inject":{},"editor":{}},{"key":"inline-void","type":"inline-void","options":{},"inject":{},"editor":{}},{"key":"insertData","type":"insertData","options":{},"inject":{},"editor":{}},{"handlers":{},"key":"prevSelection","type":"prevSelection","options":{},"inject":{},"editor":{}},{"key":"deserializeHtml","editor":{"insertData":{"format":"text/html"}},"_thenReplaced":1,"type":"deserializeHtml","options":{},"inject":{}},{"editor":{"insertData":{"format":"application/x-slate-fragment"}},"key":"deserializeAst","type":"deserializeAst","options":{},"inject":{}},{"key":"editorProtocol","type":"editorProtocol","options":{},"inject":{},"editor":{}},{"deserializeHtml":{"rules":[{"validNodeName":"P"}]},"component":{},"handlers":{},"isElement":true,"key":"p","options":{"hotkey":["mod+opt+0","mod+shift+0"]},"type":"p","inject":{},"editor":{}},{"key":"heading","plugins":[{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H1"}]},"handlers":{},"isElement":true,"key":"h1","options":{"hotkey":["mod+opt+1","mod+shift+1"]},"type":"h1","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H2"}]},"handlers":{},"isElement":true,"key":"h2","options":{"hotkey":["mod+opt+2","mod+shift+2"]},"type":"h2","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H3"}]},"handlers":{},"isElement":true,"key":"h3","options":{"hotkey":["mod+opt+3","mod+shift+3"]},"type":"h3","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H4"}]},"handlers":{},"isElement":true,"key":"h4","options":{},"type":"h4","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H5"}]},"handlers":{},"isElement":true,"key":"h5","options":{},"type":"h5","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H6"}]},"handlers":{},"isElement":true,"key":"h6","options":{},"type":"h6","inject":{},"editor":{}}],"options":{"levels":[1,2,3,4,5,6]},"_thenReplaced":2,"type":"heading","inject":{},"editor":{}},{"deserializeHtml":{"rules":[{"validNodeName":"H1"}]},"component":{},"handlers":{},"isElement":true,"key":"h1","options":{"hotkey":["mod+opt+1","mod+shift+1"]},"type":"h1","inject":{},"editor":{}},{"deserializeHtml":{"rules":[{"validNodeName":"H2"}]},"component":{},"handlers":{},"isElement":true,"key":"h2","options":{"hotkey":["mod+opt+2","mod+shift+2"]},"type":"h2","inject":{},"editor":{}},{"deserializeHtml":{"rules":[{"validNodeName":"H3"}]},"component":{},"handlers":{},"isElement":true,"key":"h3","options":{"hotkey":["mod+opt+3","mod+shift+3"]},"type":"h3","inject":{},"editor":{}},{"deserializeHtml":{"rules":[{"validNodeName":"H4"}]},"component":{},"handlers":{},"isElement":true,"key":"h4","options":{},"type":"h4","inject":{},"editor":{}},{"deserializeHtml":{"rules":[{"validNodeName":"H5"}]},"component":{},"handlers":{},"isElement":true,"key":"h5","options":{},"type":"h5","inject":{},"editor":{}},{"deserializeHtml":{"rules":[{"validNodeName":"H6"}]},"component":{},"handlers":{},"isElement":true,"key":"h6","options":{},"type":"h6","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"BLOCKQUOTE"}]},"handlers":{},"isElement":true,"key":"blockquote","options":{"hotkey":"mod+shift+."},"type":"blockquote","inject":{},"editor":{}},{"component":{},"key":"code_block","inject":{"pluginsByKey":{"deserializeHtml":{"editor":{"insertData":{}}}}},"deserializeHtml":{"rules":[{"validNodeName":"PRE"},{"validNodeName":"P","validStyle":{"fontFamily":"Consolas"}}]},"handlers":{},"isElement":true,"options":{"hotkey":["mod+opt+8","mod+shift+8"],"syntax":true,"syntaxPopularFirst":false},"plugins":[{"component":{},"isElement":true,"key":"code_line","type":"code_line","options":{},"inject":{},"editor":{}},{"component":{},"isLeaf":true,"key":"code_syntax","type":"code_syntax","options":{},"inject":{},"editor":{}}],"_thenReplaced":2,"type":"code_block","editor":{}},{"component":{},"isElement":true,"key":"code_line","type":"code_line","options":{},"inject":{},"editor":{}},{"component":{},"isLeaf":true,"key":"code_syntax","type":"code_syntax","options":{},"inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"HR"}]},"isElement":true,"isVoid":true,"key":"hr","type":"hr","options":{},"inject":{},"editor":{}},{"component":{},"key":"a","deserializeHtml":{"rules":[{"validNodeName":"A"}]},"isElement":true,"isInline":true,"options":{"allowedSchemes":["http","https","mailto","tel"],"dangerouslySkipSanitization":false,"defaultLinkAttributes":{},"keepSelectedTextOnPaste":true,"rangeBeforeOptions":{"afterMatch":true,"matchString":" ","skipInvalid":true},"triggerFloatingLinkHotkeys":"meta+k, ctrl+k"},"_thenReplaced":2,"type":"a","inject":{},"editor":{}},{"editor":{"insertData":{}},"component":{},"key":"img","deserializeHtml":{"rules":[{"validNodeName":"IMG"}]},"isElement":true,"isVoid":true,"_thenReplaced":2,"type":"img","options":{},"inject":{}},{"component":{},"key":"media_embed","deserializeHtml":{"rules":[{"validNodeName":"IFRAME"}]},"isElement":true,"isVoid":true,"options":{},"_thenReplaced":2,"type":"media_embed","inject":{},"editor":{}},{"options":{"pluginKeys":["img","media_embed"]},"handlers":{},"key":"caption","type":"caption","inject":{},"editor":{}},{"component":{},"isElement":true,"isInline":true,"isMarkableVoid":true,"isVoid":true,"key":"mention","options":{"trigger":"@","triggerPreviousCharPattern":{}},"plugins":[{"component":{},"isElement":true,"isInline":true,"isVoid":true,"key":"mention_input","type":"mention_input","options":{},"inject":{},"editor":{}}],"type":"mention","inject":{},"editor":{}},{"component":{},"isElement":true,"isInline":true,"isVoid":true,"key":"mention_input","type":"mention_input","options":{},"inject":{},"editor":{}},{"component":{},"key":"table","options":{"_cellIndices":{},"enableMerging":false,"minColumnWidth":48},"deserializeHtml":{"rules":[{"validNodeName":"TABLE"}]},"handlers":{},"isElement":true,"plugins":[{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"TR"}]},"isElement":true,"key":"tr","type":"tr","options":{},"inject":{},"editor":{}},{"component":{},"isElement":true,"key":"td","_thenReplaced":3,"type":"td","options":{},"inject":{},"editor":{}},{"component":{},"isElement":true,"key":"th","_thenReplaced":3,"type":"th","options":{},"inject":{},"editor":{}}],"_thenReplaced":2,"type":"table","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"TR"}]},"isElement":true,"key":"tr","type":"tr","options":{},"inject":{},"editor":{}},{"key":"td","component":{},"deserializeHtml":{"attributeNames":["rowspan","colspan"],"rules":[{"validNodeName":"TD"}]},"isElement":true,"_thenReplaced":3,"type":"td","options":{},"inject":{},"editor":{}},{"key":"th","component":{},"deserializeHtml":{"attributeNames":["rowspan","colspan"],"rules":[{"validNodeName":"TH"}]},"isElement":true,"_thenReplaced":3,"type":"th","options":{},"inject":{},"editor":{}},{"component":{},"handlers":{},"isElement":true,"key":"action_item","options":{"hotkey":["mod+opt+4","mod+shift+4"]},"type":"action_item","inject":{},"editor":{}},{"component":{},"isElement":true,"isVoid":true,"key":"excalidraw","type":"excalidraw","options":{},"inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["STRONG","B"]},{"validStyle":{"fontWeight":["600","700","bold"]}}]},"handlers":{},"isLeaf":true,"key":"bold","options":{"hotkey":"mod+b"},"type":"bold","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["EM","I"]},{"validStyle":{"fontStyle":"italic"}}]},"handlers":{},"isLeaf":true,"key":"italic","options":{"hotkey":"mod+i"},"type":"italic","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["U"]},{"validStyle":{"textDecoration":["underline"]}}]},"handlers":{},"isLeaf":true,"key":"underline","options":{"hotkey":"mod+u"},"type":"underline","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["S","DEL","STRIKE"]},{"validStyle":{"textDecoration":"line-through"}}]},"handlers":{},"isLeaf":true,"key":"strikethrough","options":{"hotkey":"mod+shift+x"},"type":"strikethrough","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["CODE"]},{"validStyle":{"fontFamily":"Consolas"}}]},"handlers":{},"isLeaf":true,"key":"code","options":{"hotkey":"mod+e"},"type":"code","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["SUB"]},{"validStyle":{"verticalAlign":"sub"}}]},"handlers":{},"isLeaf":true,"key":"subscript","options":{"clear":"superscript","hotkey":"mod+,"},"type":"subscript","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["SUP"]},{"validStyle":{"verticalAlign":"super"}}]},"handlers":{},"isLeaf":true,"key":"superscript","options":{"clear":"subscript","hotkey":"mod+."},"type":"superscript","inject":{},"editor":{}},{"key":"color","deserializeHtml":{"isLeaf":true,"rules":[{"validStyle":{"color":"*"}}]},"inject":{"props":{"defaultNodeValue":"black","nodeKey":"color"}},"_thenReplaced":2,"type":"color","options":{},"editor":{}},{"key":"backgroundColor","deserializeHtml":{"isLeaf":true,"rules":[{"validStyle":{"backgroundColor":"*"}}]},"inject":{"props":{"nodeKey":"backgroundColor"}},"_thenReplaced":2,"type":"backgroundColor","options":{},"editor":{}},{"key":"fontSize","deserializeHtml":{"isLeaf":true,"rules":[{"validStyle":{"fontSize":"*"}}]},"inject":{"props":{"nodeKey":"fontSize"}},"_thenReplaced":2,"type":"fontSize","options":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["MARK"]}]},"handlers":{},"isLeaf":true,"key":"highlight","options":{"hotkey":"mod+shift+h"},"type":"highlight","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["KBD"]}]},"handlers":{},"isLeaf":true,"key":"kbd","type":"kbd","options":{},"inject":{},"editor":{}},{"key":"align","inject":{"props":{"validTypes":["p","h1","h2","h3"],"defaultNodeValue":"start","nodeKey":"align","styleKey":"textAlign","validNodeValues":["start","left","center","right","end","justify"]},"pluginsByKey":{"p":{"deserializeHtml":{}},"h1":{"deserializeHtml":{}},"h2":{"deserializeHtml":{}},"h3":{"deserializeHtml":{}}}},"_thenReplaced":2,"type":"align","options":{},"editor":{}},{"key":"indent","inject":{"props":{"validTypes":["p","h1","h2","h3","blockquote","code_block"],"nodeKey":"indent","styleKey":"marginLeft"}},"handlers":{},"options":{"offset":24,"unit":"px"},"_thenReplaced":2,"type":"indent","editor":{}},{"key":"listStyleType","inject":{"props":{"validTypes":["p","h1","h2","h3","blockquote","code_block"]},"pluginsByKey":{"deserializeHtml":{"editor":{"insertData":{}}}}},"deserializeHtml":{"isElement":true,"rules":[{"validNodeName":"LI"}]},"handlers":{},"options":{},"_thenReplaced":2,"type":"listStyleType","editor":{}},{"key":"lineHeight","inject":{"props":{"defaultNodeValue":1.5,"validNodeValues":[1,1.2,1.5,2,3],"validTypes":["p","h1","h2","h3"],"nodeKey":"lineHeight"},"pluginsByKey":{"p":{"deserializeHtml":{}},"h1":{"deserializeHtml":{}},"h2":{"deserializeHtml":{}},"h3":{"deserializeHtml":{}}}},"_thenReplaced":2,"type":"lineHeight","options":{},"editor":{}},{"options":{"rules":[{"mode":"block","type":"h1","match":"# "},{"mode":"block","type":"h2","match":"## "},{"mode":"block","type":"h3","match":"### "},{"mode":"block","type":"h4","match":"#### "},{"mode":"block","type":"h5","match":"##### "},{"mode":"block","type":"h6","match":"###### "},{"mode":"block","type":"blockquote","match":"> "},{"mode":"block","type":"code_block","match":"```","triggerAtBlockStart":false},{"mode":"block","type":"hr","match":["---","—-","___ "]},{"mode":"block","type":"list","match":["* ","- "]},{"mode":"block","type":"list","match":["1. ","1) "]},{"mode":"mark","type":["bold","italic"],"match":"***"},{"mode":"mark","type":["underline","italic"],"match":"__*"},{"mode":"mark","type":["underline","bold"],"match":"__**"},{"mode":"mark","type":["underline","bold","italic"],"match":"___***"},{"mode":"mark","type":"bold","match":"**"},{"mode":"mark","type":"underline","match":"__"},{"mode":"mark","type":"italic","match":"*"},{"mode":"mark","type":"italic","match":"_"},{"mode":"mark","type":"strikethrough","match":"~~"},{"mode":"mark","type":"superscript","match":"^"},{"mode":"mark","type":"subscript","match":"~"},{"mode":"mark","type":"highlight","match":"=="},{"mode":"mark","type":"highlight","match":"≡"},{"mode":"mark","type":"code","match":"`"},{"format":["“","”"],"match":"\"","mode":"text"},{"format":["‘","’"],"match":"'","mode":"text"},{"format":"—","match":"--","mode":"text"},{"format":"…","match":"...","mode":"text"},{"format":"»","match":">>","mode":"text"},{"format":"«","match":"<<","mode":"text"},{"format":"™","match":["(tm)","(TM)"],"mode":"text"},{"format":"®","match":["(r)","(R)"],"mode":"text"},{"format":"©","match":["(c)","(C)"],"mode":"text"},{"format":"™","match":"&trade;","mode":"text"},{"format":"®","match":"&reg;","mode":"text"},{"format":"©","match":"&copy;","mode":"text"},{"format":"§","match":"&sect;","mode":"text"},{"format":"→","match":"->","mode":"text"},{"format":"←","match":"<-","mode":"text"},{"format":"⇒","match":"=>","mode":"text"},{"format":"⇐","match":["<=","≤="],"mode":"text"},{"format":"≯","match":"!>","mode":"text"},{"format":"≮","match":"!<","mode":"text"},{"format":"≥","match":">=","mode":"text"},{"format":"≤","match":"<=","mode":"text"},{"format":"≱","match":"!>=","mode":"text"},{"format":"≰","match":"!<=","mode":"text"},{"format":"≠","match":"!=","mode":"text"},{"format":"≡","match":"==","mode":"text"},{"format":"≢","match":["!==","≠="],"mode":"text"},{"format":"≈","match":"~=","mode":"text"},{"format":"≉","match":"!~=","mode":"text"},{"format":"±","match":"+-","mode":"text"},{"format":"‰","match":"%%","mode":"text"},{"format":"‱","match":["%%%","‰%"],"mode":"text"},{"format":"÷","match":"//","mode":"text"},{"format":"½","match":"1/2","mode":"text"},{"format":"⅓","match":"1/3","mode":"text"},{"format":"¼","match":"1/4","mode":"text"},{"format":"⅕","match":"1/5","mode":"text"},{"format":"⅙","match":"1/6","mode":"text"},{"format":"⅐","match":"1/7","mode":"text"},{"format":"⅛","match":"1/8","mode":"text"},{"format":"⅑","match":"1/9","mode":"text"},{"format":"⅒","match":"1/10","mode":"text"},{"format":"⅔","match":"2/3","mode":"text"},{"format":"⅖","match":"2/5","mode":"text"},{"format":"¾","match":"3/4","mode":"text"},{"format":"⅗","match":"3/5","mode":"text"},{"format":"⅜","match":"3/8","mode":"text"},{"format":"⅘","match":"4/5","mode":"text"},{"format":"⅚","match":"5/6","mode":"text"},{"format":"⅝","match":"5/8","mode":"text"},{"format":"⅞","match":"7/8","mode":"text"},{"format":"°","match":"^o","mode":"text"},{"format":"⁺","match":"^+","mode":"text"},{"format":"⁻","match":"^-","mode":"text"},{"format":"₊","match":"~+","mode":"text"},{"format":"₋","match":"~-","mode":"text"},{"format":"⁰","match":"^0","mode":"text"},{"format":"¹","match":"^1","mode":"text"},{"format":"²","match":"^2","mode":"text"},{"format":"³","match":"^3","mode":"text"},{"format":"⁴","match":"^4","mode":"text"},{"format":"⁵","match":"^5","mode":"text"},{"format":"⁶","match":"^6","mode":"text"},{"format":"⁷","match":"^7","mode":"text"},{"format":"⁸","match":"^8","mode":"text"},{"format":"⁹","match":"^9","mode":"text"},{"format":"₀","match":"~0","mode":"text"},{"format":"₁","match":"~1","mode":"text"},{"format":"₂","match":"~2","mode":"text"},{"format":"₃","match":"~3","mode":"text"},{"format":"₄","match":"~4","mode":"text"},{"format":"₅","match":"~5","mode":"text"},{"format":"₆","match":"~6","mode":"text"},{"format":"₇","match":"~7","mode":"text"},{"format":"₈","match":"~8","mode":"text"},{"format":"₉","match":"~9","mode":"text"}],"enableUndoOnDelete":true},"handlers":{},"key":"autoformat","type":"autoformat","inject":{},"editor":{}},{"key":"blockSelection","options":{"sizes":{"top":0,"bottom":0,"left":4,"right":4},"query":{"maxLevel":1}},"handlers":{},"inject":{},"_thenReplaced":2,"type":"blockSelection","editor":{}},{"key":"dnd","options":{"enableScroller":true},"handlers":{},"_thenReplaced":2,"type":"dnd","inject":{},"editor":{}},{"options":{"rules":[{"hotkey":"mod+enter"},{"hotkey":"mod+shift+enter","before":true},{"hotkey":"enter","query":{"start":true,"end":true,"allow":["h1","h2","h3","h4","h5","h6"]},"relative":true,"level":1}]},"handlers":{},"key":"exitBreak","type":"exitBreak","inject":{},"editor":{}},{"key":"nodeId","options":{"filterText":true,"idKey":"id"},"type":"nodeId","inject":{},"editor":{}},{"options":{"rules":[{"types":["blockquote","action_item"],"defaultType":"p","hotkey":"Enter"},{"types":["blockquote","action_item"],"defaultType":"p","hotkey":"Backspace"},{"types":["code_block"],"defaultType":"p","hotkey":"Enter"},{"types":["code_block"],"defaultType":"p","hotkey":"Backspace"}]},"handlers":{},"key":"resetNode","type":"resetNode","inject":{},"editor":{}},{"options":{"query":{"allow":["img","hr"]},"removeNodeIfEmpty":false},"key":"selectOnBackspace","type":"selectOnBackspace","inject":{},"editor":{}},{"options":{"rules":[{"hotkey":"shift+enter"},{"hotkey":"enter","query":{"allow":["code_block","blockquote","td"]}}]},"handlers":{},"key":"softBreak","type":"softBreak","inject":{},"editor":{}},{"options":{"globalEventListener":false},"key":"tabbable","plugins":[{"key":"tabbable_element","isElement":true,"isVoid":true,"type":"tabbable_element","options":{},"inject":{},"editor":{}}],"type":"tabbable","inject":{},"editor":{}},{"key":"tabbable_element","isElement":true,"isVoid":true,"type":"tabbable_element","options":{},"inject":{},"editor":{}},{"key":"trailingBlock","options":{"type":"p","level":0},"type":"p","_thenReplaced":2,"inject":{},"editor":{}},{"key":"dragOverCursor","handlers":{},"type":"dragOverCursor","options":{},"inject":{},"editor":{}},{"isLeaf":true,"key":"comment","options":{"hotkey":["meta+shift+m","ctrl+shift+m"]},"type":"comment","inject":{},"editor":{}},{"inject":{"pluginsByKey":{"deserializeHtml":{"editor":{"insertData":{}}}}},"key":"deserializeDocx","overrideByKey":{"p":{},"h1":{},"h2":{},"h3":{},"h4":{},"h5":{},"h6":{},"img":{"editor":{"insertData":{}}}},"type":"deserializeDocx","options":{},"editor":{}},{"key":"deserializeMd","editor":{"insertData":{"format":"text/plain"}},"options":{"elementRules":{"blockquote":{},"code":{},"heading":{},"image":{},"link":{},"list":{},"listItem":{},"paragraph":{},"thematicBreak":{}},"indentList":false,"textRules":{"emphasis":{},"html":{},"inlineCode":{},"strong":{},"text":{}}},"_thenReplaced":2,"type":"deserializeMd","inject":{}},{"inject":{"pluginsByKey":{"deserializeHtml":{"editor":{"insertData":{}}}}},"key":"juice","type":"juice","options":{},"editor":{}},{"key":"slash_command","options":{"trigger":"/","triggerPreviousCharPattern":{}},"plugins":[{"component":{},"isElement":true,"isInline":true,"isVoid":true,"key":"slash_input","type":"slash_input","options":{},"inject":{},"editor":{}}],"type":"slash_command","inject":{},"editor":{}},{"component":{},"isElement":true,"isInline":true,"isVoid":true,"key":"slash_input","type":"slash_input","options":{},"inject":{},"editor":{}},{"key":"url-listener","handlers":{},"type":"url-listener","options":{},"inject":{},"editor":{}},{"key":"log_element","handlers":{},"type":"log_element","options":{},"inject":{},"editor":{}},{"component":{},"key":"url-wrapper","isElement":true,"isVoid":true,"type":"url-wrapper","options":{},"inject":{},"editor":{}},{"component":{},"key":"memorymap","isElement":true,"isVoid":true,"type":"memorymap","options":{},"inject":{},"editor":{}},{"key":"amazingButton","isElement":true,"isVoid":true,"handlers":{},"type":"amazingButton","options":{},"inject":{},"editor":{}}],"pluginsByKey":{"react":{"key":"react","type":"react","options":{},"inject":{},"editor":{}},"history":{"key":"history","type":"history","options":{},"inject":{},"editor":{}},"nodeFactory":{"key":"nodeFactory","type":"nodeFactory","options":{},"inject":{},"editor":{}},"event-editor":{"handlers":{},"key":"event-editor","type":"event-editor","options":{},"inject":{},"editor":{}},"inline-void":{"key":"inline-void","type":"inline-void","options":{},"inject":{},"editor":{}},"insertData":{"key":"insertData","type":"insertData","options":{},"inject":{},"editor":{}},"prevSelection":{"handlers":{},"key":"prevSelection","type":"prevSelection","options":{},"inject":{},"editor":{}},"deserializeHtml":{"key":"deserializeHtml","editor":{"insertData":{"format":"text/html"}},"_thenReplaced":1,"type":"deserializeHtml","options":{},"inject":{}},"deserializeAst":{"editor":{"insertData":{"format":"application/x-slate-fragment"}},"key":"deserializeAst","type":"deserializeAst","options":{},"inject":{}},"editorProtocol":{"key":"editorProtocol","type":"editorProtocol","options":{},"inject":{},"editor":{}},"p":{"deserializeHtml":{"rules":[{"validNodeName":"P"}]},"component":{},"handlers":{},"isElement":true,"key":"p","options":{"hotkey":["mod+opt+0","mod+shift+0"]},"type":"p","inject":{},"editor":{}},"heading":{"key":"heading","plugins":[{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H1"}]},"handlers":{},"isElement":true,"key":"h1","options":{"hotkey":["mod+opt+1","mod+shift+1"]},"type":"h1","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H2"}]},"handlers":{},"isElement":true,"key":"h2","options":{"hotkey":["mod+opt+2","mod+shift+2"]},"type":"h2","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H3"}]},"handlers":{},"isElement":true,"key":"h3","options":{"hotkey":["mod+opt+3","mod+shift+3"]},"type":"h3","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H4"}]},"handlers":{},"isElement":true,"key":"h4","options":{},"type":"h4","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H5"}]},"handlers":{},"isElement":true,"key":"h5","options":{},"type":"h5","inject":{},"editor":{}},{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"H6"}]},"handlers":{},"isElement":true,"key":"h6","options":{},"type":"h6","inject":{},"editor":{}}],"options":{"levels":[1,2,3,4,5,6]},"_thenReplaced":2,"type":"heading","inject":{},"editor":{}},"h1":{"deserializeHtml":{"rules":[{"validNodeName":"H1"}]},"component":{},"handlers":{},"isElement":true,"key":"h1","options":{"hotkey":["mod+opt+1","mod+shift+1"]},"type":"h1","inject":{},"editor":{}},"h2":{"deserializeHtml":{"rules":[{"validNodeName":"H2"}]},"component":{},"handlers":{},"isElement":true,"key":"h2","options":{"hotkey":["mod+opt+2","mod+shift+2"]},"type":"h2","inject":{},"editor":{}},"h3":{"deserializeHtml":{"rules":[{"validNodeName":"H3"}]},"component":{},"handlers":{},"isElement":true,"key":"h3","options":{"hotkey":["mod+opt+3","mod+shift+3"]},"type":"h3","inject":{},"editor":{}},"h4":{"deserializeHtml":{"rules":[{"validNodeName":"H4"}]},"component":{},"handlers":{},"isElement":true,"key":"h4","options":{},"type":"h4","inject":{},"editor":{}},"h5":{"deserializeHtml":{"rules":[{"validNodeName":"H5"}]},"component":{},"handlers":{},"isElement":true,"key":"h5","options":{},"type":"h5","inject":{},"editor":{}},"h6":{"deserializeHtml":{"rules":[{"validNodeName":"H6"}]},"component":{},"handlers":{},"isElement":true,"key":"h6","options":{},"type":"h6","inject":{},"editor":{}},"blockquote":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"BLOCKQUOTE"}]},"handlers":{},"isElement":true,"key":"blockquote","options":{"hotkey":"mod+shift+."},"type":"blockquote","inject":{},"editor":{}},"code_block":{"component":{},"key":"code_block","inject":{"pluginsByKey":{"deserializeHtml":{"editor":{"insertData":{}}}}},"deserializeHtml":{"rules":[{"validNodeName":"PRE"},{"validNodeName":"P","validStyle":{"fontFamily":"Consolas"}}]},"handlers":{},"isElement":true,"options":{"hotkey":["mod+opt+8","mod+shift+8"],"syntax":true,"syntaxPopularFirst":false},"plugins":[{"component":{},"isElement":true,"key":"code_line","type":"code_line","options":{},"inject":{},"editor":{}},{"component":{},"isLeaf":true,"key":"code_syntax","type":"code_syntax","options":{},"inject":{},"editor":{}}],"_thenReplaced":2,"type":"code_block","editor":{}},"code_line":{"component":{},"isElement":true,"key":"code_line","type":"code_line","options":{},"inject":{},"editor":{}},"code_syntax":{"component":{},"isLeaf":true,"key":"code_syntax","type":"code_syntax","options":{},"inject":{},"editor":{}},"hr":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"HR"}]},"isElement":true,"isVoid":true,"key":"hr","type":"hr","options":{},"inject":{},"editor":{}},"a":{"component":{},"key":"a","deserializeHtml":{"rules":[{"validNodeName":"A"}]},"isElement":true,"isInline":true,"options":{"allowedSchemes":["http","https","mailto","tel"],"dangerouslySkipSanitization":false,"defaultLinkAttributes":{},"keepSelectedTextOnPaste":true,"rangeBeforeOptions":{"afterMatch":true,"matchString":" ","skipInvalid":true},"triggerFloatingLinkHotkeys":"meta+k, ctrl+k"},"_thenReplaced":2,"type":"a","inject":{},"editor":{}},"img":{"editor":{"insertData":{}},"component":{},"key":"img","deserializeHtml":{"rules":[{"validNodeName":"IMG"}]},"isElement":true,"isVoid":true,"_thenReplaced":2,"type":"img","options":{},"inject":{}},"media_embed":{"component":{},"key":"media_embed","deserializeHtml":{"rules":[{"validNodeName":"IFRAME"}]},"isElement":true,"isVoid":true,"options":{},"_thenReplaced":2,"type":"media_embed","inject":{},"editor":{}},"caption":{"options":{"pluginKeys":["img","media_embed"]},"handlers":{},"key":"caption","type":"caption","inject":{},"editor":{}},"mention":{"component":{},"isElement":true,"isInline":true,"isMarkableVoid":true,"isVoid":true,"key":"mention","options":{"trigger":"@","triggerPreviousCharPattern":{}},"plugins":[{"component":{},"isElement":true,"isInline":true,"isVoid":true,"key":"mention_input","type":"mention_input","options":{},"inject":{},"editor":{}}],"type":"mention","inject":{},"editor":{}},"mention_input":{"component":{},"isElement":true,"isInline":true,"isVoid":true,"key":"mention_input","type":"mention_input","options":{},"inject":{},"editor":{}},"table":{"component":{},"key":"table","options":{"_cellIndices":{},"enableMerging":false,"minColumnWidth":48},"deserializeHtml":{"rules":[{"validNodeName":"TABLE"}]},"handlers":{},"isElement":true,"plugins":[{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"TR"}]},"isElement":true,"key":"tr","type":"tr","options":{},"inject":{},"editor":{}},{"component":{},"isElement":true,"key":"td","_thenReplaced":3,"type":"td","options":{},"inject":{},"editor":{}},{"component":{},"isElement":true,"key":"th","_thenReplaced":3,"type":"th","options":{},"inject":{},"editor":{}}],"_thenReplaced":2,"type":"table","inject":{},"editor":{}},"tr":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":"TR"}]},"isElement":true,"key":"tr","type":"tr","options":{},"inject":{},"editor":{}},"td":{"key":"td","component":{},"deserializeHtml":{"attributeNames":["rowspan","colspan"],"rules":[{"validNodeName":"TD"}]},"isElement":true,"_thenReplaced":3,"type":"td","options":{},"inject":{},"editor":{}},"th":{"key":"th","component":{},"deserializeHtml":{"attributeNames":["rowspan","colspan"],"rules":[{"validNodeName":"TH"}]},"isElement":true,"_thenReplaced":3,"type":"th","options":{},"inject":{},"editor":{}},"action_item":{"component":{},"handlers":{},"isElement":true,"key":"action_item","options":{"hotkey":["mod+opt+4","mod+shift+4"]},"type":"action_item","inject":{},"editor":{}},"excalidraw":{"component":{},"isElement":true,"isVoid":true,"key":"excalidraw","type":"excalidraw","options":{},"inject":{},"editor":{}},"bold":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["STRONG","B"]},{"validStyle":{"fontWeight":["600","700","bold"]}}]},"handlers":{},"isLeaf":true,"key":"bold","options":{"hotkey":"mod+b"},"type":"bold","inject":{},"editor":{}},"italic":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["EM","I"]},{"validStyle":{"fontStyle":"italic"}}]},"handlers":{},"isLeaf":true,"key":"italic","options":{"hotkey":"mod+i"},"type":"italic","inject":{},"editor":{}},"underline":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["U"]},{"validStyle":{"textDecoration":["underline"]}}]},"handlers":{},"isLeaf":true,"key":"underline","options":{"hotkey":"mod+u"},"type":"underline","inject":{},"editor":{}},"strikethrough":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["S","DEL","STRIKE"]},{"validStyle":{"textDecoration":"line-through"}}]},"handlers":{},"isLeaf":true,"key":"strikethrough","options":{"hotkey":"mod+shift+x"},"type":"strikethrough","inject":{},"editor":{}},"code":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["CODE"]},{"validStyle":{"fontFamily":"Consolas"}}]},"handlers":{},"isLeaf":true,"key":"code","options":{"hotkey":"mod+e"},"type":"code","inject":{},"editor":{}},"subscript":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["SUB"]},{"validStyle":{"verticalAlign":"sub"}}]},"handlers":{},"isLeaf":true,"key":"subscript","options":{"clear":"superscript","hotkey":"mod+,"},"type":"subscript","inject":{},"editor":{}},"superscript":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["SUP"]},{"validStyle":{"verticalAlign":"super"}}]},"handlers":{},"isLeaf":true,"key":"superscript","options":{"clear":"subscript","hotkey":"mod+."},"type":"superscript","inject":{},"editor":{}},"color":{"key":"color","deserializeHtml":{"isLeaf":true,"rules":[{"validStyle":{"color":"*"}}]},"inject":{"props":{"defaultNodeValue":"black","nodeKey":"color"}},"_thenReplaced":2,"type":"color","options":{},"editor":{}},"backgroundColor":{"key":"backgroundColor","deserializeHtml":{"isLeaf":true,"rules":[{"validStyle":{"backgroundColor":"*"}}]},"inject":{"props":{"nodeKey":"backgroundColor"}},"_thenReplaced":2,"type":"backgroundColor","options":{},"editor":{}},"fontSize":{"key":"fontSize","deserializeHtml":{"isLeaf":true,"rules":[{"validStyle":{"fontSize":"*"}}]},"inject":{"props":{"nodeKey":"fontSize"}},"_thenReplaced":2,"type":"fontSize","options":{},"editor":{}},"highlight":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["MARK"]}]},"handlers":{},"isLeaf":true,"key":"highlight","options":{"hotkey":"mod+shift+h"},"type":"highlight","inject":{},"editor":{}},"kbd":{"component":{},"deserializeHtml":{"rules":[{"validNodeName":["KBD"]}]},"handlers":{},"isLeaf":true,"key":"kbd","type":"kbd","options":{},"inject":{},"editor":{}},"align":{"key":"align","inject":{"props":{"validTypes":["p","h1","h2","h3"],"defaultNodeValue":"start","nodeKey":"align","styleKey":"textAlign","validNodeValues":["start","left","center","right","end","justify"]},"pluginsByKey":{"p":{"deserializeHtml":{}},"h1":{"deserializeHtml":{}},"h2":{"deserializeHtml":{}},"h3":{"deserializeHtml":{}}}},"_thenReplaced":2,"type":"align","options":{},"editor":{}},"indent":{"key":"indent","inject":{"props":{"validTypes":["p","h1","h2","h3","blockquote","code_block"],"nodeKey":"indent","styleKey":"marginLeft"}},"handlers":{},"options":{"offset":24,"unit":"px"},"_thenReplaced":2,"type":"indent","editor":{}},"listStyleType":{"key":"listStyleType","inject":{"props":{"validTypes":["p","h1","h2","h3","blockquote","code_block"]},"pluginsByKey":{"deserializeHtml":{"editor":{"insertData":{}}}}},"deserializeHtml":{"isElement":true,"rules":[{"validNodeName":"LI"}]},"handlers":{},"options":{},"_thenReplaced":2,"type":"listStyleType","editor":{}},"lineHeight":{"key":"lineHeight","inject":{"props":{"defaultNodeValue":1.5,"validNodeValues":[1,1.2,1.5,2,3],"validTypes":["p","h1","h2","h3"],"nodeKey":"lineHeight"},"pluginsByKey":{"p":{"deserializeHtml":{}},"h1":{"deserializeHtml":{}},"h2":{"deserializeHtml":{}},"h3":{"deserializeHtml":{}}}},"_thenReplaced":2,"type":"lineHeight","options":{},"editor":{}},"autoformat":{"options":{"rules":[{"mode":"block","type":"h1","match":"# "},{"mode":"block","type":"h2","match":"## "},{"mode":"block","type":"h3","match":"### "},{"mode":"block","type":"h4","match":"#### "},{"mode":"block","type":"h5","match":"##### "},{"mode":"block","type":"h6","match":"###### "},{"mode":"block","type":"blockquote","match":"> "},{"mode":"block","type":"code_block","match":"```","triggerAtBlockStart":false},{"mode":"block","type":"hr","match":["---","—-","___ "]},{"mode":"block","type":"list","match":["* ","- "]},{"mode":"block","type":"list","match":["1. ","1) "]},{"mode":"mark","type":["bold","italic"],"match":"***"},{"mode":"mark","type":["underline","italic"],"match":"__*"},{"mode":"mark","type":["underline","bold"],"match":"__**"},{"mode":"mark","type":["underline","bold","italic"],"match":"___***"},{"mode":"mark","type":"bold","match":"**"},{"mode":"mark","type":"underline","match":"__"},{"mode":"mark","type":"italic","match":"*"},{"mode":"mark","type":"italic","match":"_"},{"mode":"mark","type":"strikethrough","match":"~~"},{"mode":"mark","type":"superscript","match":"^"},{"mode":"mark","type":"subscript","match":"~"},{"mode":"mark","type":"highlight","match":"=="},{"mode":"mark","type":"highlight","match":"≡"},{"mode":"mark","type":"code","match":"`"},{"format":["“","”"],"match":"\"","mode":"text"},{"format":["‘","’"],"match":"'","mode":"text"},{"format":"—","match":"--","mode":"text"},{"format":"…","match":"...","mode":"text"},{"format":"»","match":">>","mode":"text"},{"format":"«","match":"<<","mode":"text"},{"format":"™","match":["(tm)","(TM)"],"mode":"text"},{"format":"®","match":["(r)","(R)"],"mode":"text"},{"format":"©","match":["(c)","(C)"],"mode":"text"},{"format":"™","match":"&trade;","mode":"text"},{"format":"®","match":"&reg;","mode":"text"},{"format":"©","match":"&copy;","mode":"text"},{"format":"§","match":"&sect;","mode":"text"},{"format":"→","match":"->","mode":"text"},{"format":"←","match":"<-","mode":"text"},{"format":"⇒","match":"=>","mode":"text"},{"format":"⇐","match":["<=","≤="],"mode":"text"},{"format":"≯","match":"!>","mode":"text"},{"format":"≮","match":"!<","mode":"text"},{"format":"≥","match":">=","mode":"text"},{"format":"≤","match":"<=","mode":"text"},{"format":"≱","match":"!>=","mode":"text"},{"format":"≰","match":"!<=","mode":"text"},{"format":"≠","match":"!=","mode":"text"},{"format":"≡","match":"==","mode":"text"},{"format":"≢","match":["!==","≠="],"mode":"text"},{"format":"≈","match":"~=","mode":"text"},{"format":"≉","match":"!~=","mode":"text"},{"format":"±","match":"+-","mode":"text"},{"format":"‰","match":"%%","mode":"text"},{"format":"‱","match":["%%%","‰%"],"mode":"text"},{"format":"÷","match":"//","mode":"text"},{"format":"½","match":"1/2","mode":"text"},{"format":"⅓","match":"1/3","mode":"text"},{"format":"¼","match":"1/4","mode":"text"},{"format":"⅕","match":"1/5","mode":"text"},{"format":"⅙","match":"1/6","mode":"text"},{"format":"⅐","match":"1/7","mode":"text"},{"format":"⅛","match":"1/8","mode":"text"},{"format":"⅑","match":"1/9","mode":"text"},{"format":"⅒","match":"1/10","mode":"text"},{"format":"⅔","match":"2/3","mode":"text"},{"format":"⅖","match":"2/5","mode":"text"},{"format":"¾","match":"3/4","mode":"text"},{"format":"⅗","match":"3/5","mode":"text"},{"format":"⅜","match":"3/8","mode":"text"},{"format":"⅘","match":"4/5","mode":"text"},{"format":"⅚","match":"5/6","mode":"text"},{"format":"⅝","match":"5/8","mode":"text"},{"format":"⅞","match":"7/8","mode":"text"},{"format":"°","match":"^o","mode":"text"},{"format":"⁺","match":"^+","mode":"text"},{"format":"⁻","match":"^-","mode":"text"},{"format":"₊","match":"~+","mode":"text"},{"format":"₋","match":"~-","mode":"text"},{"format":"⁰","match":"^0","mode":"text"},{"format":"¹","match":"^1","mode":"text"},{"format":"²","match":"^2","mode":"text"},{"format":"³","match":"^3","mode":"text"},{"format":"⁴","match":"^4","mode":"text"},{"format":"⁵","match":"^5","mode":"text"},{"format":"⁶","match":"^6","mode":"text"},{"format":"⁷","match":"^7","mode":"text"},{"format":"⁸","match":"^8","mode":"text"},{"format":"⁹","match":"^9","mode":"text"},{"format":"₀","match":"~0","mode":"text"},{"format":"₁","match":"~1","mode":"text"},{"format":"₂","match":"~2","mode":"text"},{"format":"₃","match":"~3","mode":"text"},{"format":"₄","match":"~4","mode":"text"},{"format":"₅","match":"~5","mode":"text"},{"format":"₆","match":"~6","mode":"text"},{"format":"₇","match":"~7","mode":"text"},{"format":"₈","match":"~8","mode":"text"},{"format":"₉","match":"~9","mode":"text"}],"enableUndoOnDelete":true},"handlers":{},"key":"autoformat","type":"autoformat","inject":{},"editor":{}},"blockSelection":{"key":"blockSelection","options":{"sizes":{"top":0,"bottom":0,"left":4,"right":4},"query":{"maxLevel":1}},"handlers":{},"inject":{},"_thenReplaced":2,"type":"blockSelection","editor":{}},"dnd":{"key":"dnd","options":{"enableScroller":true},"handlers":{},"_thenReplaced":2,"type":"dnd","inject":{},"editor":{}},"exitBreak":{"options":{"rules":[{"hotkey":"mod+enter"},{"hotkey":"mod+shift+enter","before":true},{"hotkey":"enter","query":{"start":true,"end":true,"allow":["h1","h2","h3","h4","h5","h6"]},"relative":true,"level":1}]},"handlers":{},"key":"exitBreak","type":"exitBreak","inject":{},"editor":{}},"nodeId":{"key":"nodeId","options":{"filterText":true,"idKey":"id"},"type":"nodeId","inject":{},"editor":{}},"resetNode":{"options":{"rules":[{"types":["blockquote","action_item"],"defaultType":"p","hotkey":"Enter"},{"types":["blockquote","action_item"],"defaultType":"p","hotkey":"Backspace"},{"types":["code_block"],"defaultType":"p","hotkey":"Enter"},{"types":["code_block"],"defaultType":"p","hotkey":"Backspace"}]},"handlers":{},"key":"resetNode","type":"resetNode","inject":{},"editor":{}},"selectOnBackspace":{"options":{"query":{"allow":["img","hr"]},"removeNodeIfEmpty":false},"key":"selectOnBackspace","type":"selectOnBackspace","inject":{},"editor":{}},"softBreak":{"options":{"rules":[{"hotkey":"shift+enter"},{"hotkey":"enter","query":{"allow":["code_block","blockquote","td"]}}]},"handlers":{},"key":"softBreak","type":"softBreak","inject":{},"editor":{}},"tabbable":{"options":{"globalEventListener":false},"key":"tabbable","plugins":[{"key":"tabbable_element","isElement":true,"isVoid":true,"type":"tabbable_element","options":{},"inject":{},"editor":{}}],"type":"tabbable","inject":{},"editor":{}},"tabbable_element":{"key":"tabbable_element","isElement":true,"isVoid":true,"type":"tabbable_element","options":{},"inject":{},"editor":{}},"trailingBlock":{"key":"trailingBlock","options":{"type":"p","level":0},"type":"p","_thenReplaced":2,"inject":{},"editor":{}},"dragOverCursor":{"key":"dragOverCursor","handlers":{},"type":"dragOverCursor","options":{},"inject":{},"editor":{}},"comment":{"isLeaf":true,"key":"comment","options":{"hotkey":["meta+shift+m","ctrl+shift+m"]},"type":"comment","inject":{},"editor":{}},"deserializeDocx":{"inject":{"pluginsByKey":{"deserializeHtml":{"editor":{"insertData":{}}}}},"key":"deserializeDocx","overrideByKey":{"p":{},"h1":{},"h2":{},"h3":{},"h4":{},"h5":{},"h6":{},"img":{"editor":{"insertData":{}}}},"type":"deserializeDocx","options":{},"editor":{}},"deserializeMd":{"key":"deserializeMd","editor":{"insertData":{"format":"text/plain"}},"options":{"elementRules":{"blockquote":{},"code":{},"heading":{},"image":{},"link":{},"list":{},"listItem":{},"paragraph":{},"thematicBreak":{}},"indentList":false,"textRules":{"emphasis":{},"html":{},"inlineCode":{},"strong":{},"text":{}}},"_thenReplaced":2,"type":"deserializeMd","inject":{}},"juice":{"inject":{"pluginsByKey":{"deserializeHtml":{"editor":{"insertData":{}}}}},"key":"juice","type":"juice","options":{},"editor":{}},"slash_command":{"key":"slash_command","options":{"trigger":"/","triggerPreviousCharPattern":{}},"plugins":[{"component":{},"isElement":true,"isInline":true,"isVoid":true,"key":"slash_input","type":"slash_input","options":{},"inject":{},"editor":{}}],"type":"slash_command","inject":{},"editor":{}},"slash_input":{"component":{},"isElement":true,"isInline":true,"isVoid":true,"key":"slash_input","type":"slash_input","options":{},"inject":{},"editor":{}},"url-listener":{"key":"url-listener","handlers":{},"type":"url-listener","options":{},"inject":{},"editor":{}},"log_element":{"key":"log_element","handlers":{},"type":"log_element","options":{},"inject":{},"editor":{}},"url-wrapper":{"component":{},"key":"url-wrapper","isElement":true,"isVoid":true,"type":"url-wrapper","options":{},"inject":{},"editor":{}},"memorymap":{"component":{},"key":"memorymap","isElement":true,"isVoid":true,"type":"memorymap","options":{},"inject":{},"editor":{}},"amazingButton":{"key":"amazingButton","isElement":true,"isVoid":true,"handlers":{},"type":"amazingButton","options":{},"inject":{},"editor":{}}},"history":{"undos":[{"operations":[{"type":"remove_text","path":[1,0],"offset":14,"text":"e"},{"type":"set_node","path":[1,0],"properties":{},"newProperties":{"type":"code_line"}},{"type":"insert_node","path":[2],"node":{"children":[{"text":""}],"type":"p","id":"0a93l"}}],"selectionBefore":{"anchor":{"path":[1,0],"offset":15},"focus":{"path":[1,0],"offset":15}}},{"operations":[{"type":"remove_text","path":[1,0],"offset":13,"text":"r"},{"type":"remove_text","path":[1,0],"offset":12,"text":"e"},{"type":"remove_text","path":[1,0],"offset":11,"text":"h"},{"type":"remove_text","path":[1,0],"offset":10,"text":" "},{"type":"remove_text","path":[1,0],"offset":9,"text":"k"},{"type":"remove_text","path":[1,0],"offset":8,"text":"c"},{"type":"remove_text","path":[1,0],"offset":7,"text":"o"},{"type":"remove_text","path":[1,0],"offset":6,"text":"l"},{"type":"remove_text","path":[1,0],"offset":5,"text":"b"},{"type":"remove_text","path":[1,0],"offset":4,"text":" "},{"type":"remove_text","path":[1,0],"offset":3,"text":"e"},{"type":"remove_text","path":[1,0],"offset":2,"text":"d"},{"type":"remove_text","path":[1,0],"offset":1,"text":"o"},{"type":"remove_text","path":[1,0],"offset":0,"text":"c"}],"selectionBefore":{"anchor":{"path":[1,0],"offset":14},"focus":{"path":[1,0],"offset":14}}},{"operations":[{"type":"insert_node","path":[1,1],"node":{"text":"f"}},{"type":"remove_node","path":[1,0],"node":{"text":"","type":"code_line"}}],"selectionBefore":{"anchor":{"path":[1,0],"offset":0},"focus":{"path":[1,0],"offset":0}}}],"redos":[]},"blockSelectionStore":{"get":{},"name":"selection","set":{},"store":{},"use":{},"useTracked":{}},"value":[{"id":"4jfkls","type":"p","children":[{"text":""}]},{"id":"1","type":"code_block","children":[{"text":"code block here"}]}]}

https://github.com/user-attachments/assets/fc689414-2314-4030-bd02-3a77ce21ebb5

Reproduction URL

No response

Reproduction steps

  1. Add a single element with a codeBlock on page
'use client';

import {
  Plate,
} from '@udecode/plate-common';
import { Editor } from '@/components/plate-ui/editor';
import {
  ELEMENT_CODE_BLOCK,
  unwrapCodeBlock,
} from '@udecode/plate-code-block';
import { FloatingToolbar } from './plate-ui/floating-toolbar';
import { FloatingToolbarButtons } from './plate-ui/floating-toolbar-buttons';
import { DndProvider } from 'react-dnd';
import { HTML5Backend } from 'react-dnd-html5-backend';
import { plugins } from "@/lib/plate/plate-plugins"
import { ELEMENT_PARAGRAPH } from '@udecode/plate-paragraph';

const initialValue = [
  {
    id: "4jfkls",
    type: ELEMENT_PARAGRAPH,
    children: [{ text: ""}]
  },
  {
    id: "1",
    type: ELEMENT_CODE_BLOCK,
    children: [{  text: "code block here"}]
  },
  /* {
    id: "fd7",
    type: KEY_URL_WRAPPER,
    children: [{ text: "" }]
  },
  {
    id: "5",
    type: KEY_MEMORYMAP,
    children: [{ text: "" }]
  }, */
];

export const PlateEditor = () => {
  return (
    <DndProvider backend={HTML5Backend}>
      <Plate plugins={plugins} initialValue={initialValue} onChange={(change) => console.log("change", change)}>
        <Editor />
        <FloatingToolbar>
          <FloatingToolbarButtons />
        </FloatingToolbar>
      </Plate>
    </DndProvider>
  );
};
  1. Delete all items in the code block
  2. start typing again
  3. See error

Plate version

36.0.0

Slate React version

0.102.0

Screenshots

No response

Logs

No response

Browsers

No response

Funding

  • You can sponsor this specific effort via a Polar.sh pledge below
  • We receive the pledge once the issue is completed & verified
Fund with Polar

remusris avatar Jul 31 '24 23:07 remusris