[{"data":1,"prerenderedAt":207},["ShallowReactive",2],{"example:\u002Fen\u002Fexamples\u002Fstorage":3},{"id":4,"title":5,"body":6,"description":198,"extension":199,"meta":200,"navigation":202,"path":203,"seo":204,"stem":205,"__hash__":206},"examples_en\u002Fen\u002Fexamples\u002Fstorage.md","Save and restore",{"type":7,"value":8,"toc":193},"minimark",[9,14,29,33,36,172,176,189],[10,11,13],"h2",{"id":12},"local-setup","Local setup",[15,16,17,18,23,24,28],"p",{},"Script integration is available through the ",[19,20,22],"a",{"href":21},"\u002Fen\u002Fdocs\u002Finstallation\u002Fscript","browser archive",". For ESM, use ",[25,26,27],"code",{},"npm install @vitext-ru\u002Feditor@beta",". The live example above runs in an isolated browser document; no document data is sent to a server.",[10,30,32],{"id":31},"workflow","Workflow",[15,34,35],{},"Click Save snapshot to explicitly store current applied JSON and CSS in this browser. Change the text, then click Restore snapshot to return to that saved version. The two actions are separate so the difference is visible. A reload keeps the snapshot; another browser\u002Fdevice does not have it. Delete snapshot clears the stored copy. This is a localStorage example, not server persistence. In source mode, return to visual editing before saving or restoring.",[37,38,43],"pre",{"className":39,"code":40,"language":41,"meta":42,"style":42},"language-ts shiki shiki-themes github-dark","localStorage.setItem('vitext-example-snapshot', JSON.stringify({\n  version: 1, json: editor.getJSON(), css: editor.getCSS(), savedAt: Date.now()\n}));\nconst saved = JSON.parse(localStorage.getItem('vitext-example-snapshot')!);\nawait editor.setContent(saved.json, { css: saved.css });\n","ts","",[25,44,45,81,111,117,157],{"__ignoreMap":42},[46,47,50,54,58,61,65,68,72,75,78],"span",{"class":48,"line":49},"line",1,[46,51,53],{"class":52},"s95oV","localStorage.",[46,55,57],{"class":56},"svObZ","setItem",[46,59,60],{"class":52},"(",[46,62,64],{"class":63},"sU2Wk","'vitext-example-snapshot'",[46,66,67],{"class":52},", ",[46,69,71],{"class":70},"sDLfK","JSON",[46,73,74],{"class":52},".",[46,76,77],{"class":56},"stringify",[46,79,80],{"class":52},"({\n",[46,82,84,87,90,93,96,99,102,105,108],{"class":48,"line":83},2,[46,85,86],{"class":52},"  version: ",[46,88,89],{"class":70},"1",[46,91,92],{"class":52},", json: editor.",[46,94,95],{"class":56},"getJSON",[46,97,98],{"class":52},"(), css: editor.",[46,100,101],{"class":56},"getCSS",[46,103,104],{"class":52},"(), savedAt: Date.",[46,106,107],{"class":56},"now",[46,109,110],{"class":52},"()\n",[46,112,114],{"class":48,"line":113},3,[46,115,116],{"class":52},"}));\n",[46,118,120,124,127,130,133,135,138,141,144,146,148,151,154],{"class":48,"line":119},4,[46,121,123],{"class":122},"snl16","const",[46,125,126],{"class":70}," saved",[46,128,129],{"class":122}," =",[46,131,132],{"class":70}," JSON",[46,134,74],{"class":52},[46,136,137],{"class":56},"parse",[46,139,140],{"class":52},"(localStorage.",[46,142,143],{"class":56},"getItem",[46,145,60],{"class":52},[46,147,64],{"class":63},[46,149,150],{"class":52},")",[46,152,153],{"class":122},"!",[46,155,156],{"class":52},");\n",[46,158,160,163,166,169],{"class":48,"line":159},5,[46,161,162],{"class":122},"await",[46,164,165],{"class":52}," editor.",[46,167,168],{"class":56},"setContent",[46,170,171],{"class":52},"(saved.json, { css: saved.css });\n",[10,173,175],{"id":174},"integration-and-cleanup","Integration and cleanup",[15,177,178,179,183,184,188],{},"Destroy the instance before unmounting, and await asynchronous imports\u002Fstyles. Your application owns storage, authentication and uploads. ",[19,180,182],{"href":181},"\u002Fen\u002Fdocs\u002Fgetting-started","Integration guide",". ",[19,185,187],{"href":186},"\u002Fexamples-live\u002Fstorage\u002Findex.html?lang=en","Open separately",". The browser archive includes a standalone script example.",[190,191,192],"style",{},"html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}html pre.shiki code .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .sU2Wk, html code.shiki .sU2Wk{--shiki-default:#9ECBFF}html pre.shiki code .sDLfK, html code.shiki .sDLfK{--shiki-default:#79B8FF}html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}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);}",{"title":42,"searchDepth":83,"depth":83,"links":194},[195,196,197],{"id":12,"depth":83,"text":13},{"id":31,"depth":83,"text":32},{"id":174,"depth":83,"text":175},"A JSON + CSS snapshot in this browser, with separate actions.","md",{"group":201,"order":159},"Document",true,"\u002Fen\u002Fexamples\u002Fstorage",{"title":5,"description":198},"en\u002Fexamples\u002Fstorage","uQGz4ZJGrhrPKhe5j8Qpm1aogiKzbyIZ2Tz2A2aLIj0",1792670389634]