[{"data":1,"prerenderedAt":214},["ShallowReactive",2],{"docs:\u002Fen\u002Fdocs\u002Fplugins\u002Fcharacter-limit":3},{"id":4,"title":5,"body":6,"description":204,"extension":205,"meta":206,"navigation":209,"path":210,"seo":211,"stem":212,"__hash__":213},"docs_en\u002Fen\u002Fdocs\u002Fplugins\u002Fcharacter-limit.md","Character limit",{"type":7,"value":8,"toc":199},"minimark",[9,14,27,31,34,38,52,155,195],[10,11,13],"h2",{"id":12},"installation","Installation",[15,16,17,18,22,23,26],"p",{},"Factory: ",[19,20,21],"code",{},"createCharacterLimitPlugin({ limit: 5000 })",", id ",[19,24,25],{},"character-limit",". 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],{},"The positive safe-integer limit defaults to 5000. Remaining\u002Fexceeded characters appear in status; warnings do not block typing or paste. The count is getText().trim().length: UTF-16 units including block boundaries, without HTML\u002FCSS. Undo\u002Fimport update it. Enforce hard limits in the application\u002Fserver.",[10,35,37],{"id":36},"removal-and-ownership","Removal and ownership",[15,39,40,41,46,47,51],{},"usePlugin returns a disposer; removePlugin('character-limit') 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, createCharacterLimitPlugin } from '@vitext-ru\u002Feditor';\nconst editor = new ViText('#editor', {\n  preset: 'pro', language: 'en',\n  plugins: [createCharacterLimitPlugin({ limit: 5000 })]\n});\n","ts","",[19,60,61,84,113,131,149],{"__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, createCharacterLimitPlugin } ",[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,143,146],{"class":64,"line":133},4,[62,135,136],{"class":72},"  plugins: [",[62,138,139],{"class":102},"createCharacterLimitPlugin",[62,141,142],{"class":72},"({ limit: ",[62,144,145],{"class":92},"5000",[62,147,148],{"class":72}," })]\n",[62,150,152],{"class":64,"line":151},5,[62,153,154],{"class":72},"});\n",[53,156,158],{"className":55,"code":157,"language":57,"meta":58,"style":58},"const remove = editor.usePlugin(createCharacterLimitPlugin({ limit: 300 }));\nremove();\n",[19,159,160,187],{"__ignoreMap":58},[62,161,162,164,167,169,172,175,177,179,181,184],{"class":64,"line":65},[62,163,89],{"class":68},[62,165,166],{"class":92}," remove",[62,168,96],{"class":68},[62,170,171],{"class":72}," editor.",[62,173,174],{"class":102},"usePlugin",[62,176,106],{"class":72},[62,178,139],{"class":102},[62,180,142],{"class":72},[62,182,183],{"class":92},"300",[62,185,186],{"class":72}," }));\n",[62,188,189,192],{"class":64,"line":86},[62,190,191],{"class":102},"remove",[62,193,194],{"class":72},"();\n",[196,197,198],"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 .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":200},[201,202,203],{"id":12,"depth":86,"text":13},{"id":29,"depth":86,"text":30},{"id":36,"depth":86,"text":37},"Installation, behavior and limitations of the character limit plugin.","md",{"group":207,"order":208},"Plugins",37,true,"\u002Fen\u002Fdocs\u002Fplugins\u002Fcharacter-limit",{"title":5,"description":204},"en\u002Fdocs\u002Fplugins\u002Fcharacter-limit","VpkBj7Ag86wkpl_YvyCwGwNsR70NosDTjGt6jlhDfEQ",1792670389530]