[{"data":1,"prerenderedAt":228},["ShallowReactive",2],{"docs:\u002Fen\u002Fdocs\u002Fplugins\u002Fdirty-state":3},{"id":4,"title":5,"body":6,"description":218,"extension":219,"meta":220,"navigation":223,"path":224,"seo":225,"stem":226,"__hash__":227},"docs_en\u002Fen\u002Fdocs\u002Fplugins\u002Fdirty-state.md","Dirty-state indicator",{"type":7,"value":8,"toc":213},"minimark",[9,14,27,31,34,38,52,164,209],[10,11,13],"h2",{"id":12},"installation","Installation",[15,16,17,18,22,23,26],"p",{},"Factory: ",[19,20,21],"code",{},"createDirtyStatePlugin(onUpdate)",", id ",[19,24,25],{},"dirty-state",". Requires preset pro and enabled features.plugins. Use a constructor plugins array or usePlugin on an existing editor; do not install the same id twice. In the script build the factory belongs to the ViText namespace; workspace ESM imports are shown below.",[10,28,30],{"id":29},"behavior-and-limitations","Behavior and limitations",[15,32,33],{},"Reports changes to the application relative to the initial document. It does not write or mark an external database as saved. Treat it as a notification signal and implement your own persistence workflow.",[10,35,37],{"id":36},"removal-and-ownership","Removal and ownership",[15,39,40,41,46,47,51],{},"usePlugin returns a disposer; removePlugin('dirty-state') removes the same plugin. Destroy automatically revokes its managed commands, subscriptions and UI. The document stays intact. Application-owned requests still need application cleanup. ",[42,43,45],"a",{"href":44},"\u002Fen\u002Fdocs\u002Fplugins\u002Foverview","Plugin contract",", ",[42,48,50],{"href":49},"\u002Fen\u002Fdocs\u002Freference\u002Fmethods","methods",".",[53,54,59],"pre",{"className":55,"code":56,"language":57,"meta":58,"style":58},"language-ts shiki shiki-themes github-dark","import { ViText, createDirtyStatePlugin } from '@vitext-ru\u002Feditor';\nconst editor = new ViText('#editor', {\n  preset: 'pro', language: 'en',\n  plugins: [createDirtyStatePlugin(dirty => console.log(dirty))]\n});\n","ts","",[19,60,61,84,113,131,158],{"__ignoreMap":58},[62,63,66,70,74,77,81],"span",{"class":64,"line":65},"line",1,[62,67,69],{"class":68},"snl16","import",[62,71,73],{"class":72},"s95oV"," { ViText, createDirtyStatePlugin } ",[62,75,76],{"class":68},"from",[62,78,80],{"class":79},"sU2Wk"," '@vitext-ru\u002Feditor'",[62,82,83],{"class":72},";\n",[62,85,87,90,94,97,100,104,107,110],{"class":64,"line":86},2,[62,88,89],{"class":68},"const",[62,91,93],{"class":92},"sDLfK"," editor",[62,95,96],{"class":68}," =",[62,98,99],{"class":68}," new",[62,101,103],{"class":102},"svObZ"," ViText",[62,105,106],{"class":72},"(",[62,108,109],{"class":79},"'#editor'",[62,111,112],{"class":72},", {\n",[62,114,116,119,122,125,128],{"class":64,"line":115},3,[62,117,118],{"class":72},"  preset: ",[62,120,121],{"class":79},"'pro'",[62,123,124],{"class":72},", language: ",[62,126,127],{"class":79},"'en'",[62,129,130],{"class":72},",\n",[62,132,134,137,140,142,146,149,152,155],{"class":64,"line":133},4,[62,135,136],{"class":72},"  plugins: [",[62,138,139],{"class":102},"createDirtyStatePlugin",[62,141,106],{"class":72},[62,143,145],{"class":144},"s9osk","dirty",[62,147,148],{"class":68}," =>",[62,150,151],{"class":72}," console.",[62,153,154],{"class":102},"log",[62,156,157],{"class":72},"(dirty))]\n",[62,159,161],{"class":64,"line":160},5,[62,162,163],{"class":72},"});\n",[53,165,167],{"className":55,"code":166,"language":57,"meta":58,"style":58},"const remove = editor.usePlugin(createDirtyStatePlugin(dirty => console.log(dirty)));\nremove();\n",[19,168,169,201],{"__ignoreMap":58},[62,170,171,173,176,178,181,184,186,188,190,192,194,196,198],{"class":64,"line":65},[62,172,89],{"class":68},[62,174,175],{"class":92}," remove",[62,177,96],{"class":68},[62,179,180],{"class":72}," editor.",[62,182,183],{"class":102},"usePlugin",[62,185,106],{"class":72},[62,187,139],{"class":102},[62,189,106],{"class":72},[62,191,145],{"class":144},[62,193,148],{"class":68},[62,195,151],{"class":72},[62,197,154],{"class":102},[62,199,200],{"class":72},"(dirty)));\n",[62,202,203,206],{"class":64,"line":86},[62,204,205],{"class":102},"remove",[62,207,208],{"class":72},"();\n",[210,211,212],"style",{},"html pre.shiki code .snl16, html code.shiki .snl16{--shiki-default:#F97583}html pre.shiki code .s95oV, html code.shiki .s95oV{--shiki-default:#E1E4E8}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 .svObZ, html code.shiki .svObZ{--shiki-default:#B392F0}html pre.shiki code .s9osk, html code.shiki .s9osk{--shiki-default:#FFAB70}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":58,"searchDepth":86,"depth":86,"links":214},[215,216,217],{"id":12,"depth":86,"text":13},{"id":29,"depth":86,"text":30},{"id":36,"depth":86,"text":37},"Installation, behavior and limitations of the dirty-state indicator plugin.","md",{"group":221,"order":222},"Plugins",32,true,"\u002Fen\u002Fdocs\u002Fplugins\u002Fdirty-state",{"title":5,"description":218},"en\u002Fdocs\u002Fplugins\u002Fdirty-state","uGW1dRYnj5OM1qL5lbZaiCI7PW5vHPhPtZHyAp1wZxM",1792670389541]