[{"data":1,"prerenderedAt":239},["ShallowReactive",2],{"msfe-doc:\u002Fen\u002Fconcepts\u002Fsource-first":3},{"id":4,"title":5,"body":6,"description":222,"extension":223,"keywords":224,"locale":230,"meta":231,"navigation":232,"order":233,"path":234,"section":235,"seo":236,"stem":237,"__hash__":238},"docs\u002Fconcepts\u002Fsource-first.en.md","Source first",{"type":7,"value":8,"toc":212},"minimark",[9,14,18,78,82,110,118,122,139,161,165,168,172,175,178,182,204],[10,11,13],"h2",{"id":12},"one-persistent-source","One persistent source",[15,16,17],"p",{},"CodeMirror text is the authority for editor content. Parsers and extensions derive syntax ranges, fields, and presentation from that source. Read the current Markdown when saving.",[19,20,21,34],"table",{},[22,23,24],"thead",{},[25,26,27,31],"tr",{},[28,29,30],"th",{},"Layer",[28,32,33],{},"Responsibility",[35,36,37,46,54,62,70],"tbody",{},[25,38,39,43],{},[40,41,42],"td",{},"Editor core",[40,44,45],{},"Text, selection, transactions, history, modes, and lifecycle",[25,47,48,51],{},[40,49,50],{},"Syntax and fields",[40,52,53],{},"Identify current ranges, read fields, validate and encode precise changes",[25,55,56,59],{},[40,57,58],{},"Commands",[40,60,61],{},"Describe source operations and submit them in one transaction",[25,63,64,67],{},[40,65,66],{},"Components and themes",[40,68,69],{},"Display content, provide interaction, and request changes through guarded actions",[25,71,72,75],{},[40,73,74],{},"Host application",[40,76,77],{},"Files, storage, permissions, uploads, and business UI",[10,79,81],{"id":80},"from-a-component-action-back-to-source","From a component action back to source",[15,83,84,85,89,90,93,94,97,98,101,102,105,106,109],{},"For ",[86,87,88],"code",{},"[[todo]]",", syntax recognition confirms the token and ",[86,91,92],{},"read()"," derives ",[86,95,96],{},"{ value: 'todo' }",". When a component requests ",[86,99,100],{},"{ value: 'done' }",", ",[86,103,104],{},"patch()"," replaces only the field inside the brackets. The resulting source is ",[86,107,108],{},"[[done]]",".",[15,111,112,113,109],{},"This operation shares history with keyboard input, so the user can undo changes made by component buttons. See the complete ",[114,115,117],"a",{"href":116},"\u002Fen\u002Fextensions\u002Fcustom-node","custom node example",[10,119,121],{"id":120},"extend-semantics-and-ui-separately","Extend semantics and UI separately",[15,123,124,101,127,130,131,134,135,138],{},[86,125,126],{},"Node.create()",[86,128,129],{},"Mark.create()",", and ",[86,132,133],{},"Extension.create()"," provide declaration entry points. Define fields and commands first, then use ",[86,136,137],{},".extend()"," in the application to add Vue, React, or native DOM presentation.",[15,140,141,142,101,145,130,148,151,152,156,157,109],{},"These declarations are not a ProseMirror schema. APIs such as ",[86,143,144],{},"parseHTML",[86,146,147],{},"renderHTML",[86,149,150],{},"NodeViewContent"," cannot be copied directly from Tiptap examples. Consult the ",[114,153,155],{"href":154},"\u002Fen\u002Fapi\u002Feditor","API reference"," and ",[114,158,160],{"href":159},"\u002Fen\u002Fsupport","support boundaries",[10,162,164],{"id":163},"when-to-preserve-source","When to preserve source",[15,166,167],{},"Unknown, unclosed, or temporarily unrenderable structures retain their original text. Custom syntax and resource loading should define explicit fallback behavior; hiding source is not evidence of successful parsing.",[10,169,171],{"id":170},"integrating-an-ast-editor","Integrating an AST editor",[15,173,174],{},"The parse tree is a reproducible index, not the persistent authority. Converting Markdown to ProseMirror JSON and serializing it after editing changes representational and spelling policies. That is a separate content pipeline, not a transparent MSFE implementation detail.",[15,176,177],{},"Applications with both rich-text and source-first views need an explicit conversion boundary, loss policy and session authority. Avoid two independently writable representations automatically overwriting each other. These docs describe one canonical source transaction flow.",[10,179,181],{"id":180},"one-complex-extension-data-flow","One complex-extension data flow",[183,184,185,189,192,195,198,201],"ol",{},[186,187,188],"li",{},"Native input changes CodeMirror text and history.",[186,190,191],{},"Incremental parsing confirms ranges; unconfirmed text stays visible.",[186,193,194],{},"A codec derives fields, projections describe visuals and components consume props.",[186,196,197],{},"Components request precise edits through commands or field patches.",[186,199,200],{},"The editor checks intent, permission and ranges, then notifies accepted changes.",[186,202,203],{},"The host persists Markdown through its own storage protocol.",[15,205,206,207,211],{},"This applies to status tokens, nested containers and asynchronous diagrams. The difference is which ",[114,208,210],{"href":209},"\u002Fen\u002Fconcepts\u002Fextensions","extension entries"," the feature needs.",{"title":213,"searchDepth":214,"depth":214,"links":215},"",2,[216,217,218,219,220,221],{"id":12,"depth":214,"text":13},{"id":80,"depth":214,"text":81},{"id":120,"depth":214,"text":121},{"id":163,"depth":214,"text":164},{"id":170,"depth":214,"text":171},{"id":180,"depth":214,"text":181},"Understand the relationship between Markdown, derived fields, component views, and transactions.","md",[225,226,227,228,229],"architecture","JSON","AST","document model","CodeMirror","en",{},true,0,"\u002Fen\u002Fconcepts\u002Fsource-first","Core concepts",{"title":5,"description":222},"concepts\u002Fsource-first.en","GigVfY9gjkCYskJwfSV7v0pLjtmgybrhEIhDGOm0l6g",1793046311994]