[{"data":1,"prerenderedAt":358},["ShallowReactive",2],{"quirekit-doc:\u002Fen\u002Fplugins\u002Freference\u002Fcharacter-count":3},{"id":4,"title":5,"body":6,"description":12,"extension":346,"keywords":347,"locale":350,"meta":351,"navigation":150,"order":352,"path":353,"section":354,"seo":355,"stem":356,"__hash__":357},"docs\u002Fplugins\u002Freference\u002Fcharacter-count.en.md","CharacterCount",{"type":7,"value":8,"toc":333},"minimark",[9,13,24,29,35,85,93,97,113,121,181,188,192,195,198,202,208,212,227,233,238,241,248,253,258,262,265,270,275,279,282,286,291,295,298,301,305,316,329],[10,11,12],"p",{},"Exposes character and word counts through editor.storage.characterCount and can limit input. Customize the default string-length and space-separated counters when needed.",[10,14,15,19,20],{},[16,17,18],"code",{},"@quirekit\u002Fextensions"," · ",[21,22,23],"strong",{},"MIT",[25,26,28],"h2",{"id":27},"editor-compatibility","Editor compatibility",[10,30,31,32],{},"Layer：",[21,33,34],{},"Shared document capability",[36,37,38,54],"table",{},[39,40,41],"thead",{},[42,43,44,48,51],"tr",{},[45,46,47],"th",{},"Editor",[45,49,50],{},"Status",[45,52,53],{},"Assembly and boundaries",[55,56,57,69],"tbody",{},[42,58,59,63,66],{},[60,61,62],"td",{},"Classic",[60,64,65],{},"Requires integration",[60,67,68],{},"Connect the services, targets and lifecycle described on this page and validate the selected View and document model. Core contracts are reusable, but there is no universal product installation without host ports.",[42,70,71,74,77],{},[60,72,73],{},"Block",[60,75,76],{},"Supported",[60,78,79,84],{},[80,81,83],"a",{"href":82},"\u002Fen\u002Fplugins\u002Freference\u002Fcreate-block-editor-preset","createBlockEditorPreset"," — The default createBlockEditor preset installs this capability. Configure the corresponding preset child; graphic editing uses the preset's workspace ports, while persistence and assets remain host-owned. Avoid duplicate extensions.",[10,86,87,88,92],{},"“Supported” means the product assembly above exists; interaction, host services and file formats retain their own conditions. See ",[80,89,91],{"href":90},"\u002Fen\u002Fplugins\u002Fcompatibility","status and integration rules",". Licensing is shown separately.",[25,94,96],{"id":95},"installation","Installation",[98,99,104],"pre",{"className":100,"code":101,"language":102,"meta":103,"style":103},"language-sh shiki shiki-themes github-light github-light github-dark","pnpm add @quirekit\u002Fextensions@alpha\n","sh","",[16,105,106],{"__ignoreMap":103},[107,108,111],"span",{"class":109,"line":110},"line",1,[107,112,101],{},[10,114,115,116,120],{},"Install in Editor extensions. The host supplies a view, container and persistence; see ",[80,117,119],{"href":118},"\u002Fen\u002Fguide\u002Fquick-start","Quick start",".",[98,122,126],{"className":123,"code":124,"language":125,"meta":103,"style":103},"language-ts shiki shiki-themes github-light github-light github-dark","import { CharacterCount } from '@quirekit\u002Fextensions'\n\nconst counter = CharacterCount.configure({ limit: 5000 })\n","ts",[16,127,128,145,152],{"__ignoreMap":103},[107,129,130,134,138,141],{"class":109,"line":110},[107,131,133],{"class":132},"sDD9d","import",[107,135,137],{"class":136},"sVPnS"," { CharacterCount } ",[107,139,140],{"class":132},"from",[107,142,144],{"class":143},"s-HEn"," '@quirekit\u002Fextensions'\n",[107,146,148],{"class":109,"line":147},2,[107,149,151],{"emptyLinePlaceholder":150},true,"\n",[107,153,155,158,162,165,168,172,175,178],{"class":109,"line":154},3,[107,156,157],{"class":132},"const",[107,159,161],{"class":160},"sUNQB"," counter",[107,163,164],{"class":132}," =",[107,166,167],{"class":136}," CharacterCount.",[107,169,171],{"class":170},"sgQzM","configure",[107,173,174],{"class":136},"({ limit: ",[107,176,177],{"class":160},"5000",[107,179,180],{"class":136}," })\n",[10,182,183,184,120],{},"Use compatible versions available from your distribution source. This site uses the Alpha workspace. License labels come from package metadata; see ",[80,185,187],{"href":186},"\u002Fen\u002Fsupport","support and licensing",[25,189,191],{"id":190},"integration-by-editor","Integration by editor",[10,193,194],{},"These snippets use an existing host element named element. The host owns container sizing and persistence; call instance.destroy() on teardown. Avoid duplicating preset capabilities and supply required host ports before installation.",[196,197],"plugin-integration",{"name":5},[25,199,201],{"id":200},"configuration","Configuration",[10,203,204,205,120],{},"These are extension-level defaults. Presets can override them; they are distinct from current document attributes. See ",[80,206,200],{"href":207},"\u002Fen\u002Fplugins\u002Fconfiguration",[209,210,211],"h3",{"id":211},"limit",[10,213,214,215,218,219,222,223,226],{},"Maximum allowed character count. ",[16,216,217],{},"null",", ",[16,220,221],{},"undefined",", and ",[16,224,225],{},"0"," disable the limit.",[10,228,229,230],{},"Type：",[16,231,232],{},"number | null | undefined",[10,234,235,236],{},"Default：",[16,237,217],{},[209,239,240],{"id":240},"mode",[10,242,243,244,247],{},"Counting mode used by the ",[16,245,246],{},"characters()"," storage helper.",[10,249,229,250],{},[16,251,252],{},"\"nodeSize\" | \"textSize\"",[10,254,235,255],{},[16,256,257],{},"\"textSize\"",[209,259,261],{"id":260},"textcounter","textCounter",[10,263,264],{},"Counts text characters.",[10,266,229,267],{},[16,268,269],{},"(text: string): number",[10,271,235,272],{},[16,273,274],{},"(text: string) => text.length",[209,276,278],{"id":277},"wordcounter","wordCounter",[10,280,281],{},"Counts words.",[10,283,229,284],{},[16,285,269],{},[10,287,235,288],{},[16,289,290],{},"(text: string) => text.split(\" \").filter((word) => word !== \"\").length",[25,292,294],{"id":293},"commands-and-runtime","Commands and runtime",[10,296,297],{},"This entry declares no directly enumerable commands. Children supply bundle commands; product plugins use contributions or document services.",[10,299,300],{},"limit participates in transaction filtering and may trim initially oversized content. Inspect imported documents before enabling a limit when lossless opening is required.",[25,302,304],{"id":303},"next-steps","Next steps",[10,306,307,308,312,313,315],{},"Return to ",[80,309,311],{"href":310},"\u002Fen\u002Fplugins","all plugins",", or read ",[80,314,200],{"href":207}," to distinguish options, attributes and commands.",[10,317,318,319,323,324,328],{},"See ",[80,320,322],{"href":321},"\u002Fen\u002Fbuild\u002Fextension","extension development"," for custom capabilities and ",[80,325,327],{"href":326},"\u002Fen\u002Fbuild","Build a product"," for complete hosting.",[330,331,332],"style",{},"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);}html pre.shiki code .sDD9d, html code.shiki .sDD9d{--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583}html pre.shiki code .sVPnS, html code.shiki .sVPnS{--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8}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 .sgQzM, html code.shiki .sgQzM{--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0}",{"title":103,"searchDepth":147,"depth":147,"links":334},[335,336,337,338,344,345],{"id":27,"depth":147,"text":28},{"id":95,"depth":147,"text":96},{"id":190,"depth":147,"text":191},{"id":200,"depth":147,"text":201,"children":339},[340,341,342,343],{"id":211,"depth":154,"text":211},{"id":240,"depth":154,"text":240},{"id":260,"depth":154,"text":261},{"id":277,"depth":154,"text":278},{"id":293,"depth":147,"text":294},{"id":303,"depth":147,"text":304},"md",[5,18,348,349,211,240,261,278,5],"字数统计与上限","behavior","en",{"navigationTitle":5,"license":23},22,"\u002Fen\u002Fplugins\u002Freference\u002Fcharacter-count","Editing behavior",{"title":5,"description":12},"plugins\u002Freference\u002Fcharacter-count.en","nl1Kf1UZV1KIa6DesI5c973AQW_04GvbH_Tuu-nIMjY",1793045228044]