[{"data":1,"prerenderedAt":270},["ShallowReactive",2],{"msfe-doc:\u002Fen\u002Fguide\u002Fmodes":3},{"id":4,"title":5,"body":6,"description":258,"extension":259,"keywords":260,"locale":263,"meta":264,"navigation":136,"order":133,"path":265,"section":266,"seo":267,"stem":268,"__hash__":269},"docs\u002Fguide\u002Fmodes.en.md","Modes and read-only access",{"type":7,"value":8,"toc":251},"minimark",[9,14,65,69,73,77,83,159,163,170,174,228,231,235,238,247],[10,11,13],"h2",{"id":12},"three-modes","Three modes",[15,16,17,30],"table",{},[18,19,20],"thead",{},[21,22,23,27],"tr",{},[24,25,26],"th",{},"Mode",[24,28,29],{},"Use case",[31,32,33,45,55],"tbody",{},[21,34,35,42],{},[36,37,38],"td",{},[39,40,41],"code",{},"source",[36,43,44],{},"Show all Markdown with a code-editor input experience",[21,46,47,52],{},[36,48,49],{},[39,50,51],{},"live",[36,53,54],{},"Display a reading presentation over source, revealing syntax when entering the relevant range",[21,56,57,62],{},[36,58,59],{},[39,60,61],{},"locked",[36,63,64],{},"Read, select, and copy with document editing disabled",[66,67,68],"p",{},"Change some text, switch modes, and return to Live to undo. All modes share the same document.",[70,71],"msfe-demo",{"name":72},"basic\u002Feditor",[10,74,76],{"id":75},"independent-read-only-access","Independent read-only access",[66,78,79,82],{},[39,80,81],{},"setReadOnly(true)"," makes Source or Live read-only. Editing permission is independent of presentation: you can keep the complete source visible while preventing edits.",[84,85,90],"pre",{"className":86,"code":87,"language":88,"meta":89,"style":89},"language-ts shiki shiki-themes github-light github-light github-dark","editor.setMode('source')\neditor.setReadOnly(true)\n\n\u002F\u002F Restore editing in Source mode.\neditor.setReadOnly(false)\n","ts","",[39,91,92,115,131,138,145],{"__ignoreMap":89},[93,94,97,101,105,108,112],"span",{"class":95,"line":96},"line",1,[93,98,100],{"class":99},"sVPnS","editor.",[93,102,104],{"class":103},"sgQzM","setMode",[93,106,107],{"class":99},"(",[93,109,111],{"class":110},"s-HEn","'source'",[93,113,114],{"class":99},")\n",[93,116,118,120,123,125,129],{"class":95,"line":117},2,[93,119,100],{"class":99},[93,121,122],{"class":103},"setReadOnly",[93,124,107],{"class":99},[93,126,128],{"class":127},"sUNQB","true",[93,130,114],{"class":99},[93,132,134],{"class":95,"line":133},3,[93,135,137],{"emptyLinePlaceholder":136},true,"\n",[93,139,141],{"class":95,"line":140},4,[93,142,144],{"class":143},"sqmzS","\u002F\u002F Restore editing in Source mode.\n",[93,146,148,150,152,154,157],{"class":95,"line":147},5,[93,149,100],{"class":99},[93,151,122],{"class":103},[93,153,107],{"class":99},[93,155,156],{"class":127},"false",[93,158,114],{"class":99},[10,160,162],{"id":161},"input-and-focus","Input and focus",[66,164,165,166,169],{},"Changing mode does not recreate the instance or take focus away from toolbar controls. Presentation changes are deferred during composition to avoid interrupting input methods. The host can explicitly call ",[39,167,168],{},"focus()"," when the user should resume typing.",[10,171,173],{"id":172},"presentation-and-permission-are-separate-axes","Presentation and permission are separate axes",[15,175,176,188],{},[18,177,178],{},[21,179,180,182,185],{},[24,181,26],{},[24,183,184],{},"readOnly",[24,186,187],{},"Behavior",[31,189,190,199,208,218],{},[21,191,192,194,196],{},[36,193,41],{},[36,195,156],{},[36,197,198],{},"Edit raw syntax",[21,200,201,203,205],{},[36,202,51],{},[36,204,156],{},[36,206,207],{},"Native editing with inactive previews",[21,209,210,213,215],{},[36,211,212],{},"source \u002F live",[36,214,128],{},[36,216,217],{},"Retain presentation and prohibit writes",[21,219,220,222,225],{},[36,221,61],{},[36,223,224],{},"Either",[36,226,227],{},"Reading and copying without writes",[66,229,230],{},"Returning from locked to live retains the explicit host readonly setting. Theme changes affect neither axis. Mode changes may defer during composition; editor.mode reports the actual mode, not simply the latest request.",[10,232,234],{"id":233},"custom-controls","Custom controls",[66,236,237],{},"NodeView and preview readOnly props describe effective permission. Folding, finding and copying can remain available. Language, field, replacement and deletion actions must respect writing permission. Commands perform the final check; disabled UI alone is insufficient.",[66,239,240,241,246],{},"Custom projections default to live\u002Flocked. Source mode should reveal original syntax. Additional host mode UI must reflect actual state and handle composition-delayed changes. See ",[242,243,245],"a",{"href":244},"\u002Fen\u002Fextensions\u002Fprojections","Projection layers",".",[248,249,250],"style",{},"html pre.shiki code .sVPnS, html code.shiki .sVPnS{--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sgQzM, html code.shiki .sgQzM{--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0}html pre.shiki code .s-HEn, html code.shiki .s-HEn{--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF}html pre.shiki code .sUNQB, html code.shiki .sUNQB{--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sqmzS, html code.shiki .sqmzS{--shiki-default:#6A737D;--shiki-light:#6A737D;--shiki-dark:#6A737D}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":89,"searchDepth":117,"depth":117,"links":252},[253,254,255,256,257],{"id":12,"depth":117,"text":13},{"id":75,"depth":117,"text":76},{"id":161,"depth":117,"text":162},{"id":172,"depth":117,"text":173},{"id":233,"depth":117,"text":234},"Switch between source and reading presentations in one instance, preserving content and history.","md",[41,51,61,261,262],"readonly","modes","en",{},"\u002Fen\u002Fguide\u002Fmodes","Integration",{"title":5,"description":258},"guide\u002Fmodes.en","HU4_c7yh2DQGGlRVlHnzeGOj6ZGLFfs-9lpde3aDcGs",1793046311993]