[{"data":1,"prerenderedAt":474},["ShallowReactive",2],{"msfe-doc:\u002Fen\u002Fapi\u002Frendering":3},{"id":4,"title":5,"body":6,"description":462,"extension":463,"keywords":464,"locale":465,"meta":466,"navigation":467,"order":468,"path":469,"section":470,"seo":471,"stem":472,"__hash__":473},"docs\u002Fapi\u002Frendering.en.md","Rendering and host API",{"type":7,"value":8,"toc":445},"minimark",[9,13,18,65,116,122,136,158,162,180,216,230,245,249,256,260,264,267,270,274,277,280,284,287,290,294,297,300,304,312,315,319,322,325,329,332,335,357,360,364,386,392,395,398,401,404,408,411,414,418,421,424,427,430,433,436,439,442],[10,11,12],"p",{},"Signatures come from public package exports. Descriptions are checked against current JSDoc; identifiers retain their original names.",[14,15,17],"h2",{"id":16},"source-reveal","Source reveal",[10,19,20,24,25,28,29,28,32,28,35,38,39,42,43,46,47,49,50,52,53,56,57,60,61,64],{},[21,22,23],"code",{},"readSourcePresentation(state)"," returns ",[21,26,27],{},"mode",", ",[21,30,31],{},"selection",[21,33,34],{},"reveal",[21,36,37],{},"composing"," and ",[21,40,41],{},"selecting",".\nThe presentation selection stays stable during a pointer gesture and can differ from live\n",[21,44,45],{},"state.selection",". ",[21,48,34],{}," is ",[21,51,31],{}," (the ordinary MSFE default) or ",[21,54,55],{},"hidden",", which keeps\nrecognized syntax projected while editing. Built-in ",[21,58,59],{},"ProjectionContext.active"," already accounts\nfor this policy. Prefer ",[21,62,63],{},"active"," in extensions instead of revealing syntax from the live caret.\nSource mode always displays the original text.",[10,66,67,70,71,74,75,78,79,82,83,46,86,89,90,93,94,97,98,101,102,105,106,109,110,115],{},[21,68,69],{},"sourceRevealSetting"," is a public ",[21,72,73],{},"PresentationSetting\u003CSourceRevealPolicy>",". Install\n",[21,76,77],{},"sourceRevealSetting.extension(() => 'hidden')"," through ",[21,80,81],{},"addCodeMirrorExtensions()",", then call\n",[21,84,85],{},"sourceRevealSetting.set(editor, 'selection')",[21,87,88],{},"read(state)"," returns the applied value and\n",[21,91,92],{},"requested(state)"," returns the latest request; both return ",[21,95,96],{},"undefined"," when uninstalled.\nThe setter returns ",[21,99,100],{},"MsfeResult",": ",[21,103,104],{},"not-installed"," for a missing setting, ",[21,107,108],{},"invalid-change"," for an\ninvalid value, and rejection for destroyed or unmounted instances. Requests do not change source\nor permission and defer during pointer selection and composition. Product consumers should use\n",[111,112,114],"a",{"href":113},"\u002Fen\u002Fguide\u002Fmd-editor#four-views","MD Editor's view",".",[10,117,118,119,121],{},"Replacement ranges participate in atomic navigation under ",[21,120,55],{},", preventing caret stops inside\ninvisible syntax. Unknown or incomplete input must remain source text; do not hide unsupported\ntext with CSS.",[10,123,124,127,128,131,132,135],{},[21,125,126],{},"sourceRevealResolver.of(resolveOwner)"," installs an optional CodeMirror facet for the host.\n",[21,129,130],{},"resolveOwner(state, range)"," returns the canonical source range containing the original fragment,\nso inline syntax can share a paragraph, list-item or cell owner. Bounds must be integer document\npositions; invalid ownership throws ",[21,133,134],{},"invalid-source-reveal-owner",". Without a resolver, each node\nretains its own reveal range. Query only local syntax ancestry; do not serialize the document,\nchange selection or dispatch. MD Editor installs this policy for custom nodes, normalized\nreplacements and measured component geometry alike.",[10,137,138,139,141,142,145,146,149,150,153,154,157],{},"Built-in projections keep using ",[21,140,59],{},". Independent CodeMirror plugins can\ncall ",[21,143,144],{},"isSourceRevealed(state, { from, to })"," to apply the same mode, hidden preference and stable\npointer selection. ",[21,147,148],{},"isSourceActive(selection, from, to)"," only tests intersection. A replacement's\n",[21,151,152],{},"revealRange"," identifies its complete fragment before host ownership is resolved;\n",[21,155,156],{},"interaction: 'atomic'"," retains its explicit atomic behavior.",[14,159,161],{"id":160},"optional-input-proxy","Optional input proxy",[10,163,164,167,168,171,172,175,176,179],{},[21,165,166],{},"sourceInputProxy({ mediaQuery, modes?, revealMargin?, onSelectionTap? })"," returns an installable CodeMirror extension, enabled\nby default only in live mode when the owner-window media condition matches. MD Editor already\ninstalls it for narrow touch devices; hosts must not install a second copy. It reuses ",[21,169,170],{},"@quirekit\u002Fime","\nand mounts a textarea in the current Document\u002FShadowRoot input layer, outside rendered content.\nThe document, logical selection, source rules and history remain in the original CM state.\nCancellation preserves the selected source; confirmation commits once. Permission loss,\ndocument replacement and disposal release the native host.\nOptional ",[21,173,174],{},"onSelectionTap(view, point)"," returns true when the host handled a tap in an existing\nselection; the proxy neither moves the caret nor focuses again. Touch end and its compatibility\nclick are accepted once. MD Editor uses this to toggle selection actions. Native Selection may not\nown noneditable source while the proxy is active; independent embedded controls retain their ranges.\n",[21,177,178],{},"revealMargin"," reserves additional client CSS space when revealing the caret, defaulting to 8px.\nMD Editor uses 32px for the painted grip and its touch target. It changes neither source position nor document layout.",[10,181,182,185,186,28,189,38,192,195,196,199,200,203,204,207,208,211,212,215],{},[21,183,184],{},"editor.focus()"," selects the current input owner. Custom CM controls should use\n",[21,187,188],{},"focusSourceView(view)",[21,190,191],{},"sourceInputHasFocus(view)",[21,193,194],{},"sourceInputElement(view)"," rather than\nassuming ",[21,197,198],{},"view.hasFocus"," or ",[21,201,202],{},"contentDOM"," represents mobile keyboard focus.\n",[21,205,206],{},"sourceInputFocusChanged(update)"," reports native and proxy logical focus changes.\nDuring measurement, ",[21,209,210],{},"sourceInputCaret(view)"," returns a preedit tail rectangle in client CSS\ncoordinates, or null without preedit, when callers can use ",[21,213,214],{},"coordsAtPos",". Do not focus or clear input every frame.",[10,217,218,221,222,225,226,229],{},[21,219,220],{},"sourceInputPosition(view, { x, y })"," accepts a client CSS hit, skips atomic interiors and zero-height\nsource rows, and snaps a gap to one of its nearest visible source boundaries. It returns null when\nno mounted caret can be proven; retain the previous endpoint instead of accepting a hidden ",[21,223,224],{},"posAtCoords"," hit.\n",[21,227,228],{},"sourceCaretRect(view, pos, side?)"," returns only a mounted caret with a real line box. It tries the\nother association when the preferred fence\u002Fheading boundary is invisible, with one ordinary read\nor at most two boundary reads, returning null when geometry cannot be proven.",[10,231,232,233,236,237,240,241,244],{},"During measurement, ",[21,234,235],{},"sourceViewport(view)"," intersects VisualViewport offsets, clipping ancestors and\nCM scrollMargins without counting the keyboard and dock twice. ",[21,238,239],{},"sourceScrollStep(view, delta)"," measures\none vertical step in the nearest scrollable ancestor, handing off to the page at its limit;\n",[21,242,243],{},"applySourceScrollStep(step)"," performs that measured write without changing source or selection.\nConsumers own a single drag frame and re-hit the latest endpoint, stopping on release, cancellation,\npermission\u002Fmode changes and disposal. Accepted proxy taps, actual input and viewport resize reveal\nthe caret through the same bounds; manual scrolling and programmatic focus restoration retain no navigation anchor.\nMounted nearest-caret scroll delegates to the same reveal owner to avoid competing writes; visible input\nperforms no scroll write. Keyboard changes can await pending document-tail layout for at most eight measurements,\nstopping as soon as the endpoint is visible. New user scroll intent still cancels immediately.",[14,246,248],{"id":247},"projection-declarations","Projection declarations",[10,250,251,252,115],{},"Use block layers for multiline previews; see ",[111,253,255],{"href":254},"\u002Fen\u002Fextensions\u002Fdiagrams","Diagrams",[257,258],"msfe-api",{"name":259},"ProjectionLayer",[14,261,263],{"id":262},"canonical-inputs","Canonical inputs",[10,265,266],{},"Query bounded semantics; never dispatch while building.",[257,268],{"name":269},"ProjectionInput",[14,271,273],{"id":272},"view-descriptions","View descriptions",[10,275,276],{},"Stable renderers and immutable props form retained view descriptions.",[257,278],{"name":279},"componentView",[14,281,283],{"id":282},"mount-context","Mount context",[10,285,286],{},"Scope belongs to the current view; request measurement after geometry changes.",[257,288],{"name":289},"ComponentViewMount",[14,291,293],{"id":292},"update-and-teardown","Update and teardown",[10,295,296],{},"Update the retained entry and release host-owned resources during teardown.",[257,298],{"name":299},"ComponentViewHandle",[14,301,303],{"id":302},"code-languages","Code languages",[10,305,306,307,311],{},"See ",[111,308,310],{"href":309},"\u002Fen\u002Fextensions\u002Fcode-blocks","Code blocks"," for a complete lazy registry.",[257,313],{"name":314},"CodeLanguage",[14,316,318],{"id":317},"search-panel","Search panel",[10,320,321],{},"Components use view; replacement respects permission and composition.",[257,323],{"name":324},"SearchPanelProps",[14,326,328],{"id":327},"preview-configuration","Preview configuration",[10,330,331],{},"Math, Mermaid and TextDiagrams expose host action controls through this option.",[257,333],{"name":334},"PreviewOptions",[10,336,337,340,341,344,345,348,349,352,353,115],{},[21,338,339],{},"edit"," delegates preview editing to host UI such as the shared formula panel. The request has\npassed target and permission validation. For an asynchronous draft, independently call\n",[21,342,343],{},"captureAnchor(range)",", check ",[21,346,347],{},"anchor.target()"," on confirmation and release it on close.\nReturn ",[21,350,351],{},"true"," after taking ownership; omitting the callback retains source reveal.\nSee ",[111,354,356],{"href":355},"\u002Fen\u002Fguide\u002Fmd-editor","MD Editor",[257,358],{"name":359},"PreviewEditRequest",[14,361,363],{"id":362},"preview-actions","Preview actions",[10,365,366,367,370,371,373,374,377,378,381,382,385],{},"Install ",[21,368,369],{},"TextDiagrams"," for PlantUML\u002FDOT with the same ",[21,372,334],{},", edit callback and cancellation lifecycle. The neutral ",[21,375,376],{},"renderTextDiagram(language, source, options)"," API from ",[21,379,380],{},"@quirekit\u002Ftext-diagram\u002Fbrowser"," returns a sanitized SVG snapshot tied to the exact language and source. ",[21,383,384],{},"rasterizeTextDiagram(snapshot, ownerDocument, signal)"," produces PNG from that snapshot. MD Editor previews, the shared source workspace and Word image export use this path for all three languages.",[10,387,388,391],{},[21,389,390],{},"renderMermaidSvg()"," renders sanitized static SVG from source in a browser, sharing the preview's\nserialized Mermaid queue and security configuration. Pass a cancellation signal and typography;\nhosts can rasterize the result for file export. It does not read editor DOM, register SVG events,\nor permit external image\u002Fstyle resources.",[257,393],{"name":394},"renderMermaidSvg",[257,396],{"name":397},"PreviewTypography",[10,399,400],{},"Handle loading, errors, retry and source reveal.",[257,402],{"name":403},"PreviewControlProps",[14,405,407],{"id":406},"image-resources","Image resources",[10,409,410],{},"Source destinations pass field validation before host resolution.",[257,412],{"name":413},"ImageOptions",[14,415,417],{"id":416},"block-controls","Block controls",[10,419,420],{},"The core owns native hit testing, pointer lifecycle and guarded transactions; hosts own component rendering. Child flows are opt-in. Pointer updates inspect only local ancestor paths, and commands run only on release or explicit menu actions.",[257,422],{"name":423},"SourceBlockScopeResolver",[257,425],{"name":426},"sourceBlockScopes",[257,428],{"name":429},"createSourceBlockControls",[257,431],{"name":432},"SourceBlockControlsOptions",[257,434],{"name":435},"SourceBlockControls",[257,437],{"name":438},"SourceInsertionControls",[257,440],{"name":441},"SourceBlockRect",[257,443],{"name":444},"SourceBlockDrop",{"title":446,"searchDepth":447,"depth":447,"links":448},"",2,[449,450,451,452,453,454,455,456,457,458,459,460,461],{"id":16,"depth":447,"text":17},{"id":160,"depth":447,"text":161},{"id":247,"depth":447,"text":248},{"id":262,"depth":447,"text":263},{"id":272,"depth":447,"text":273},{"id":282,"depth":447,"text":283},{"id":292,"depth":447,"text":293},{"id":302,"depth":447,"text":303},{"id":317,"depth":447,"text":318},{"id":327,"depth":447,"text":328},{"id":362,"depth":447,"text":363},{"id":406,"depth":447,"text":407},{"id":416,"depth":447,"text":417},"Projection layers, component mounting, languages, search and preview controls.","md",[259,269,279,289,299,314,324,334,403,413],"en",{},true,5,"\u002Fen\u002Fapi\u002Frendering","API reference",{"title":5,"description":462},"api\u002Frendering.en","PeqKYmFo2tK6HyrZUFqQ8yftAysiDxAG6s-nAlPbE5Q",1793046312838]