[{"data":1,"prerenderedAt":1075},["ShallowReactive",2],{"quirekit-doc:\u002Fen\u002Fguide\u002Fbehavior":3,"quirekit-source:core\u002Fbehavior\u002Fgreeting.ts":296,"mdc--8uaz3e-key":297},{"id":4,"title":5,"body":6,"description":284,"extension":285,"keywords":286,"locale":287,"meta":288,"navigation":289,"order":290,"path":291,"section":292,"seo":293,"stem":294,"__hash__":295},"docs\u002Fguide\u002Fbehavior.en.md","Write a behavior extension",{"type":7,"value":8,"toc":276},"minimark",[9,24,29,92,95,99,117,121,136,140,176,187,197,201,215,222,226,235,254,272],[10,11,12,13,17,18,23],"p",{},"Suppose your product needs an “Insert greeting” button. It inserts ordinary text without introducing document structure, so use ",[14,15,16],"code",{},"Extension",". Start with an Editor containing StarterKit; complete the ",[19,20,22],"a",{"href":21},"\u002Fen\u002Fguide\u002Fquick-start","quick start"," first if needed.",[25,26,28],"h2",{"id":27},"_1-separate-configuration-runtime-state-and-content","1. Separate configuration, runtime state and content",[30,31,32,48],"table",{},[33,34,35],"thead",{},[36,37,38,42,45],"tr",{},[39,40,41],"th",{},"Data",[39,43,44],{},"Owner",[39,46,47],{},"Saved in JSON?",[49,50,51,69,81],"tbody",{},[36,52,53,57,66],{},[54,55,56],"td",{},"Greeting to insert",[54,58,59,62,63],{},[14,60,61],{},"addOptions()",", overridden through ",[14,64,65],{},".configure()",[54,67,68],{},"No",[36,70,71,74,79],{},[54,72,73],{},"Content update count for this session",[54,75,76],{},[14,77,78],{},"addStorage()",[54,80,68],{},[36,82,83,86,89],{},[54,84,85],{},"Inserted text",[54,87,88],{},"Document produced by the command",[54,90,91],{},"Yes",[10,93,94],{},"Persistent business data belongs in node or mark attributes, rather than storage. An extension object caches its storage. Create a fresh extension for each Editor to avoid sharing mutable state between editors.",[25,96,98],{"id":97},"_2-define-a-typed-command","2. Define a typed command",[10,100,101,104,105,108,109,112,113,116],{},[14,102,103],{},"createGreeting()"," defines ",[14,106,107],{},"insertGreeting()",". It delegates to ",[14,110,111],{},"insertContent()"," with a text node, so even ",[14,114,115],{},"\u003Cb>Hello\u003C\u002Fb>"," is literal text rather than interpreted HTML.",[118,119],"docs-recipe",{"name":120},"core\u002Fbehavior\u002Fgreeting",[10,122,123,124,127,128,131,132,135],{},"The module augmentation adds the same command type to ",[14,125,126],{},"editor.commands",", ",[14,129,130],{},"chain()"," and ",[14,133,134],{},"can()",". Types alone do not install behavior: the extension must be present at runtime.",[25,137,139],{"id":138},"_3-install-and-call-it","3. Install and call it",[141,142,148],"pre",{"className":143,"code":144,"filename":145,"language":146,"meta":147,"style":147},"language-ts shiki shiki-themes github-light github-light github-dark","extensions: [StarterKit, createGreeting('Hello!')]\n","Add to the Editor's extensions","ts","",[14,149,150],{"__ignoreMap":147},[151,152,155,159,163,166,169,173],"span",{"class":153,"line":154},"line",1,[151,156,158],{"class":157},"sgQzM","extensions",[151,160,162],{"class":161},"sVPnS",": [StarterKit, ",[151,164,165],{"class":157},"createGreeting",[151,167,168],{"class":161},"(",[151,170,172],{"class":171},"s-HEn","'Hello!'",[151,174,175],{"class":161},")]\n",[10,177,178,179,182,183,186],{},"On a button click, call ",[14,180,181],{},"editor.chain().focus().insertGreeting().run()",". Query availability with ",[14,184,185],{},"editor.can().insertGreeting()",". Focus does not establish permission; the application still checks whether the user may edit.",[10,188,189,190,192,193,196],{},"Commands must support ",[14,191,134],{}," without requests, storage mutations or DOM effects. This recipe delegates insertion to an existing command and counts accepted updates in ",[14,194,195],{},"onUpdate",". Availability queries do not increase the counter.",[25,198,200],{"id":199},"_4-configuration-and-inheritance","4. Configuration and inheritance",[10,202,203,206,207,210,211,214],{},[14,204,205],{},".configure({ text: 'Welcome' })"," changes public options. ",[14,208,209],{},".extend({ ... })"," changes the definition, for example a keyboard binding. When overriding a hook that still needs its inherited behavior, call that hook's ",[14,212,213],{},"this.parent?.()",".",[10,216,217,218,221],{},"Install only the final extension. Installing both the original and a same-name extended version causes name, Schema or command conflicts. Higher ",[14,219,220],{},"priority"," runs earlier; do not use ordering to conceal competing owners of one feature.",[25,223,225],{"id":224},"_5-verify-the-result","5. Verify the result",[10,227,228,229,231,232,234],{},"After ",[14,230,134],{},", both content and storage should be unchanged. Executing the command inserts text; undo removes it. Two Editors with separate ",[14,233,103],{}," results keep separate counters. The counter never appears in downloaded JSON.",[10,236,237,238,127,240,131,243,246,247,249,250,214],{},"Compose complex commands through their supplied ",[14,239,36],{},[14,241,242],{},"commands",[14,244,245],{},"chain",", without starting a separate ",[14,248,126],{}," transaction inside them. A later false result does not roll back earlier writes; see ",[19,251,253],{"href":252},"\u002Fen\u002Fconcepts\u002Fcommands","commands and transactions",[10,255,256,257,261,262,266,267,271],{},"Continue with ",[19,258,260],{"href":259},"\u002Fen\u002Fguide\u002Frules","input rules and state plugins",", or add persistent ",[19,263,265],{"href":264},"\u002Fen\u002Fbuild\u002Fextension","nodes and layout",". Consult the ",[19,268,270],{"href":269},"\u002Fen\u002Fapi\u002Fextensions","extension API"," for complete hooks.",[273,274,275],"style",{},"html pre.shiki code .sgQzM, html code.shiki .sgQzM{--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0}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 .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);}",{"title":147,"searchDepth":277,"depth":277,"links":278},2,[279,280,281,282,283],{"id":27,"depth":277,"text":28},{"id":97,"depth":277,"text":98},{"id":138,"depth":277,"text":139},{"id":199,"depth":277,"text":200},{"id":224,"depth":277,"text":225},"Learn options, storage, commands and lifecycle through a small greeting command.","md",null,"en",{},true,0,"\u002Fen\u002Fguide\u002Fbehavior","Extension development",{"title":5,"description":284},"guide\u002Fbehavior.en","TxwMUdTozlFFFmzPexKH-bjYh_byQEUSmHk6I7ZtUVQ","import { Extension } from \"@quirekit\u002Fcore\";\nimport type { GreetingOptions, GreetingStorage } from \".\u002Ftypes\";\n\ndeclare module \"@quirekit\u002Fcore\" {\n  \u002F** Application commands installed by the greeting extension. *\u002F\n  interface Commands\u003CReturnType> {\n    \u002F** Greeting behavior. *\u002F\n    greeting: {\n      \u002F** @returns Whether insertion can run or was accepted. *\u002F\n      insertGreeting: () => ReturnType;\n    };\n  }\n}\n\n\u002F**\n * Creates fresh options\u002Fstorage for each editor instead of sharing a mutable extension.\n * @param text - Literal greeting, never interpreted as HTML.\n * @returns One installable, configured behavior.\n *\u002F\nexport function createGreeting(text = \"Hello!\") {\n  return Extension.create\u003CGreetingOptions, GreetingStorage>({\n    name: \"greeting\",\n    \u002F** @returns Application defaults. *\u002F\n    addOptions() { return { text: \"Hello!\" }; },\n    \u002F** @returns Session-local state; it is not document JSON. *\u002F\n    addStorage() { return { updates: 0 }; },\n    \u002F** @returns The same command for direct, chain and can modes. *\u002F\n    addCommands() {\n      return {\n        insertGreeting: () => ({ commands }) => this.options.text.length > 0\n          && commands.insertContent({ type: \"text\", text: this.options.text }),\n      };\n    },\n    \u002F** Counts accepted document updates; querying can() does not run this hook. *\u002F\n    onUpdate() { this.storage.updates += 1; },\n  }).configure({ text });\n}\n",{"data":298,"body":299},{},{"type":300,"children":301},"root",[302,1070],{"type":303,"tag":141,"props":304,"children":306},"element",{"className":143,"code":305,"language":146,"meta":147,"style":147},"import { Extension } from \"@quirekit\u002Fcore\";\nimport type { GreetingOptions, GreetingStorage } from \".\u002Ftypes\";\n\ndeclare module \"@quirekit\u002Fcore\" {\n  \u002F** Application commands installed by the greeting extension. *\u002F\n  interface Commands\u003CReturnType> {\n    \u002F** Greeting behavior. *\u002F\n    greeting: {\n      \u002F** @returns Whether insertion can run or was accepted. *\u002F\n      insertGreeting: () => ReturnType;\n    };\n  }\n}\n\n\u002F**\n * Creates fresh options\u002Fstorage for each editor instead of sharing a mutable extension.\n * @param text - Literal greeting, never interpreted as HTML.\n * @returns One installable, configured behavior.\n *\u002F\nexport function createGreeting(text = \"Hello!\") {\n  return Extension.create\u003CGreetingOptions, GreetingStorage>({\n    name: \"greeting\",\n    \u002F** @returns Application defaults. *\u002F\n    addOptions() { return { text: \"Hello!\" }; },\n    \u002F** @returns Session-local state; it is not document JSON. *\u002F\n    addStorage() { return { updates: 0 }; },\n    \u002F** @returns The same command for direct, chain and can modes. *\u002F\n    addCommands() {\n      return {\n        insertGreeting: () => ({ commands }) => this.options.text.length > 0\n          && commands.insertContent({ type: \"text\", text: this.options.text }),\n      };\n    },\n    \u002F** Counts accepted document updates; querying can() does not run this hook. *\u002F\n    onUpdate() { this.storage.updates += 1; },\n  }).configure({ text });\n}\n\n",[307],{"type":303,"tag":14,"props":308,"children":309},{"__ignoreMap":147},[310,342,372,381,404,414,444,453,472,491,523,532,541,550,558,567,576,600,617,626,668,710,729,747,781,798,830,847,861,874,935,979,988,997,1006,1043,1062],{"type":303,"tag":151,"props":311,"children":312},{"class":153,"line":154},[313,320,326,331,337],{"type":303,"tag":151,"props":314,"children":316},{"style":315},"--shiki-default:#D73A49;--shiki-light:#D73A49;--shiki-dark:#F97583",[317],{"type":318,"value":319},"text","import",{"type":303,"tag":151,"props":321,"children":323},{"style":322},"--shiki-default:#24292E;--shiki-light:#24292E;--shiki-dark:#E1E4E8",[324],{"type":318,"value":325}," { Extension } ",{"type":303,"tag":151,"props":327,"children":328},{"style":315},[329],{"type":318,"value":330},"from",{"type":303,"tag":151,"props":332,"children":334},{"style":333},"--shiki-default:#032F62;--shiki-light:#032F62;--shiki-dark:#9ECBFF",[335],{"type":318,"value":336}," \"@quirekit\u002Fcore\"",{"type":303,"tag":151,"props":338,"children":339},{"style":322},[340],{"type":318,"value":341},";\n",{"type":303,"tag":151,"props":343,"children":344},{"class":153,"line":277},[345,349,354,359,363,368],{"type":303,"tag":151,"props":346,"children":347},{"style":315},[348],{"type":318,"value":319},{"type":303,"tag":151,"props":350,"children":351},{"style":315},[352],{"type":318,"value":353}," type",{"type":303,"tag":151,"props":355,"children":356},{"style":322},[357],{"type":318,"value":358}," { GreetingOptions, GreetingStorage } ",{"type":303,"tag":151,"props":360,"children":361},{"style":315},[362],{"type":318,"value":330},{"type":303,"tag":151,"props":364,"children":365},{"style":333},[366],{"type":318,"value":367}," \".\u002Ftypes\"",{"type":303,"tag":151,"props":369,"children":370},{"style":322},[371],{"type":318,"value":341},{"type":303,"tag":151,"props":373,"children":375},{"class":153,"line":374},3,[376],{"type":303,"tag":151,"props":377,"children":378},{"emptyLinePlaceholder":289},[379],{"type":318,"value":380},"\n",{"type":303,"tag":151,"props":382,"children":384},{"class":153,"line":383},4,[385,390,395,399],{"type":303,"tag":151,"props":386,"children":387},{"style":315},[388],{"type":318,"value":389},"declare",{"type":303,"tag":151,"props":391,"children":392},{"style":315},[393],{"type":318,"value":394}," module",{"type":303,"tag":151,"props":396,"children":397},{"style":333},[398],{"type":318,"value":336},{"type":303,"tag":151,"props":400,"children":401},{"style":322},[402],{"type":318,"value":403}," {\n",{"type":303,"tag":151,"props":405,"children":407},{"class":153,"line":406},5,[408],{"type":303,"tag":151,"props":409,"children":411},{"style":410},"--shiki-default:#6A737D;--shiki-light:#6A737D;--shiki-dark:#6A737D",[412],{"type":318,"value":413},"  \u002F** Application commands installed by the greeting extension. *\u002F\n",{"type":303,"tag":151,"props":415,"children":417},{"class":153,"line":416},6,[418,423,429,434,439],{"type":303,"tag":151,"props":419,"children":420},{"style":315},[421],{"type":318,"value":422},"  interface",{"type":303,"tag":151,"props":424,"children":426},{"style":425},"--shiki-default:#6F42C1;--shiki-light:#6F42C1;--shiki-dark:#B392F0",[427],{"type":318,"value":428}," Commands",{"type":303,"tag":151,"props":430,"children":431},{"style":322},[432],{"type":318,"value":433},"\u003C",{"type":303,"tag":151,"props":435,"children":436},{"style":425},[437],{"type":318,"value":438},"ReturnType",{"type":303,"tag":151,"props":440,"children":441},{"style":322},[442],{"type":318,"value":443},"> {\n",{"type":303,"tag":151,"props":445,"children":447},{"class":153,"line":446},7,[448],{"type":303,"tag":151,"props":449,"children":450},{"style":410},[451],{"type":318,"value":452},"    \u002F** Greeting behavior. *\u002F\n",{"type":303,"tag":151,"props":454,"children":456},{"class":153,"line":455},8,[457,463,468],{"type":303,"tag":151,"props":458,"children":460},{"style":459},"--shiki-default:#E36209;--shiki-light:#E36209;--shiki-dark:#FFAB70",[461],{"type":318,"value":462},"    greeting",{"type":303,"tag":151,"props":464,"children":465},{"style":315},[466],{"type":318,"value":467},":",{"type":303,"tag":151,"props":469,"children":470},{"style":322},[471],{"type":318,"value":403},{"type":303,"tag":151,"props":473,"children":475},{"class":153,"line":474},9,[476,481,486],{"type":303,"tag":151,"props":477,"children":478},{"style":410},[479],{"type":318,"value":480},"      \u002F** ",{"type":303,"tag":151,"props":482,"children":483},{"style":315},[484],{"type":318,"value":485},"@returns",{"type":303,"tag":151,"props":487,"children":488},{"style":410},[489],{"type":318,"value":490}," Whether insertion can run or was accepted. *\u002F\n",{"type":303,"tag":151,"props":492,"children":494},{"class":153,"line":493},10,[495,500,504,509,514,519],{"type":303,"tag":151,"props":496,"children":497},{"style":425},[498],{"type":318,"value":499},"      insertGreeting",{"type":303,"tag":151,"props":501,"children":502},{"style":315},[503],{"type":318,"value":467},{"type":303,"tag":151,"props":505,"children":506},{"style":322},[507],{"type":318,"value":508}," () ",{"type":303,"tag":151,"props":510,"children":511},{"style":315},[512],{"type":318,"value":513},"=>",{"type":303,"tag":151,"props":515,"children":516},{"style":425},[517],{"type":318,"value":518}," ReturnType",{"type":303,"tag":151,"props":520,"children":521},{"style":322},[522],{"type":318,"value":341},{"type":303,"tag":151,"props":524,"children":526},{"class":153,"line":525},11,[527],{"type":303,"tag":151,"props":528,"children":529},{"style":322},[530],{"type":318,"value":531},"    };\n",{"type":303,"tag":151,"props":533,"children":535},{"class":153,"line":534},12,[536],{"type":303,"tag":151,"props":537,"children":538},{"style":322},[539],{"type":318,"value":540},"  }\n",{"type":303,"tag":151,"props":542,"children":544},{"class":153,"line":543},13,[545],{"type":303,"tag":151,"props":546,"children":547},{"style":322},[548],{"type":318,"value":549},"}\n",{"type":303,"tag":151,"props":551,"children":553},{"class":153,"line":552},14,[554],{"type":303,"tag":151,"props":555,"children":556},{"emptyLinePlaceholder":289},[557],{"type":318,"value":380},{"type":303,"tag":151,"props":559,"children":561},{"class":153,"line":560},15,[562],{"type":303,"tag":151,"props":563,"children":564},{"style":410},[565],{"type":318,"value":566},"\u002F**\n",{"type":303,"tag":151,"props":568,"children":570},{"class":153,"line":569},16,[571],{"type":303,"tag":151,"props":572,"children":573},{"style":410},[574],{"type":318,"value":575}," * Creates fresh options\u002Fstorage for each editor instead of sharing a mutable extension.\n",{"type":303,"tag":151,"props":577,"children":579},{"class":153,"line":578},17,[580,585,590,595],{"type":303,"tag":151,"props":581,"children":582},{"style":410},[583],{"type":318,"value":584}," * ",{"type":303,"tag":151,"props":586,"children":587},{"style":315},[588],{"type":318,"value":589},"@param",{"type":303,"tag":151,"props":591,"children":592},{"style":322},[593],{"type":318,"value":594}," text",{"type":303,"tag":151,"props":596,"children":597},{"style":410},[598],{"type":318,"value":599}," - Literal greeting, never interpreted as HTML.\n",{"type":303,"tag":151,"props":601,"children":603},{"class":153,"line":602},18,[604,608,612],{"type":303,"tag":151,"props":605,"children":606},{"style":410},[607],{"type":318,"value":584},{"type":303,"tag":151,"props":609,"children":610},{"style":315},[611],{"type":318,"value":485},{"type":303,"tag":151,"props":613,"children":614},{"style":410},[615],{"type":318,"value":616}," One installable, configured behavior.\n",{"type":303,"tag":151,"props":618,"children":620},{"class":153,"line":619},19,[621],{"type":303,"tag":151,"props":622,"children":623},{"style":410},[624],{"type":318,"value":625}," *\u002F\n",{"type":303,"tag":151,"props":627,"children":629},{"class":153,"line":628},20,[630,635,640,645,649,653,658,663],{"type":303,"tag":151,"props":631,"children":632},{"style":315},[633],{"type":318,"value":634},"export",{"type":303,"tag":151,"props":636,"children":637},{"style":315},[638],{"type":318,"value":639}," function",{"type":303,"tag":151,"props":641,"children":642},{"style":425},[643],{"type":318,"value":644}," createGreeting",{"type":303,"tag":151,"props":646,"children":647},{"style":322},[648],{"type":318,"value":168},{"type":303,"tag":151,"props":650,"children":651},{"style":459},[652],{"type":318,"value":318},{"type":303,"tag":151,"props":654,"children":655},{"style":315},[656],{"type":318,"value":657}," =",{"type":303,"tag":151,"props":659,"children":660},{"style":333},[661],{"type":318,"value":662}," \"Hello!\"",{"type":303,"tag":151,"props":664,"children":665},{"style":322},[666],{"type":318,"value":667},") {\n",{"type":303,"tag":151,"props":669,"children":671},{"class":153,"line":670},21,[672,677,682,687,691,696,700,705],{"type":303,"tag":151,"props":673,"children":674},{"style":315},[675],{"type":318,"value":676},"  return",{"type":303,"tag":151,"props":678,"children":679},{"style":322},[680],{"type":318,"value":681}," Extension.",{"type":303,"tag":151,"props":683,"children":684},{"style":425},[685],{"type":318,"value":686},"create",{"type":303,"tag":151,"props":688,"children":689},{"style":322},[690],{"type":318,"value":433},{"type":303,"tag":151,"props":692,"children":693},{"style":425},[694],{"type":318,"value":695},"GreetingOptions",{"type":303,"tag":151,"props":697,"children":698},{"style":322},[699],{"type":318,"value":127},{"type":303,"tag":151,"props":701,"children":702},{"style":425},[703],{"type":318,"value":704},"GreetingStorage",{"type":303,"tag":151,"props":706,"children":707},{"style":322},[708],{"type":318,"value":709},">({\n",{"type":303,"tag":151,"props":711,"children":713},{"class":153,"line":712},22,[714,719,724],{"type":303,"tag":151,"props":715,"children":716},{"style":322},[717],{"type":318,"value":718},"    name: ",{"type":303,"tag":151,"props":720,"children":721},{"style":333},[722],{"type":318,"value":723},"\"greeting\"",{"type":303,"tag":151,"props":725,"children":726},{"style":322},[727],{"type":318,"value":728},",\n",{"type":303,"tag":151,"props":730,"children":732},{"class":153,"line":731},23,[733,738,742],{"type":303,"tag":151,"props":734,"children":735},{"style":410},[736],{"type":318,"value":737},"    \u002F** ",{"type":303,"tag":151,"props":739,"children":740},{"style":315},[741],{"type":318,"value":485},{"type":303,"tag":151,"props":743,"children":744},{"style":410},[745],{"type":318,"value":746}," Application defaults. *\u002F\n",{"type":303,"tag":151,"props":748,"children":750},{"class":153,"line":749},24,[751,756,761,766,771,776],{"type":303,"tag":151,"props":752,"children":753},{"style":425},[754],{"type":318,"value":755},"    addOptions",{"type":303,"tag":151,"props":757,"children":758},{"style":322},[759],{"type":318,"value":760},"() { ",{"type":303,"tag":151,"props":762,"children":763},{"style":315},[764],{"type":318,"value":765},"return",{"type":303,"tag":151,"props":767,"children":768},{"style":322},[769],{"type":318,"value":770}," { text: ",{"type":303,"tag":151,"props":772,"children":773},{"style":333},[774],{"type":318,"value":775},"\"Hello!\"",{"type":303,"tag":151,"props":777,"children":778},{"style":322},[779],{"type":318,"value":780}," }; },\n",{"type":303,"tag":151,"props":782,"children":784},{"class":153,"line":783},25,[785,789,793],{"type":303,"tag":151,"props":786,"children":787},{"style":410},[788],{"type":318,"value":737},{"type":303,"tag":151,"props":790,"children":791},{"style":315},[792],{"type":318,"value":485},{"type":303,"tag":151,"props":794,"children":795},{"style":410},[796],{"type":318,"value":797}," Session-local state; it is not document JSON. *\u002F\n",{"type":303,"tag":151,"props":799,"children":801},{"class":153,"line":800},26,[802,807,811,815,820,826],{"type":303,"tag":151,"props":803,"children":804},{"style":425},[805],{"type":318,"value":806},"    addStorage",{"type":303,"tag":151,"props":808,"children":809},{"style":322},[810],{"type":318,"value":760},{"type":303,"tag":151,"props":812,"children":813},{"style":315},[814],{"type":318,"value":765},{"type":303,"tag":151,"props":816,"children":817},{"style":322},[818],{"type":318,"value":819}," { updates: ",{"type":303,"tag":151,"props":821,"children":823},{"style":822},"--shiki-default:#005CC5;--shiki-light:#005CC5;--shiki-dark:#79B8FF",[824],{"type":318,"value":825},"0",{"type":303,"tag":151,"props":827,"children":828},{"style":322},[829],{"type":318,"value":780},{"type":303,"tag":151,"props":831,"children":833},{"class":153,"line":832},27,[834,838,842],{"type":303,"tag":151,"props":835,"children":836},{"style":410},[837],{"type":318,"value":737},{"type":303,"tag":151,"props":839,"children":840},{"style":315},[841],{"type":318,"value":485},{"type":303,"tag":151,"props":843,"children":844},{"style":410},[845],{"type":318,"value":846}," The same command for direct, chain and can modes. *\u002F\n",{"type":303,"tag":151,"props":848,"children":850},{"class":153,"line":849},28,[851,856],{"type":303,"tag":151,"props":852,"children":853},{"style":425},[854],{"type":318,"value":855},"    addCommands",{"type":303,"tag":151,"props":857,"children":858},{"style":322},[859],{"type":318,"value":860},"() {\n",{"type":303,"tag":151,"props":862,"children":864},{"class":153,"line":863},29,[865,870],{"type":303,"tag":151,"props":866,"children":867},{"style":315},[868],{"type":318,"value":869},"      return",{"type":303,"tag":151,"props":871,"children":872},{"style":322},[873],{"type":318,"value":403},{"type":303,"tag":151,"props":875,"children":877},{"class":153,"line":876},30,[878,883,888,892,897,901,906,910,915,920,925,930],{"type":303,"tag":151,"props":879,"children":880},{"style":425},[881],{"type":318,"value":882},"        insertGreeting",{"type":303,"tag":151,"props":884,"children":885},{"style":322},[886],{"type":318,"value":887},": () ",{"type":303,"tag":151,"props":889,"children":890},{"style":315},[891],{"type":318,"value":513},{"type":303,"tag":151,"props":893,"children":894},{"style":322},[895],{"type":318,"value":896}," ({ ",{"type":303,"tag":151,"props":898,"children":899},{"style":459},[900],{"type":318,"value":242},{"type":303,"tag":151,"props":902,"children":903},{"style":322},[904],{"type":318,"value":905}," }) ",{"type":303,"tag":151,"props":907,"children":908},{"style":315},[909],{"type":318,"value":513},{"type":303,"tag":151,"props":911,"children":912},{"style":822},[913],{"type":318,"value":914}," this",{"type":303,"tag":151,"props":916,"children":917},{"style":322},[918],{"type":318,"value":919},".options.text.",{"type":303,"tag":151,"props":921,"children":922},{"style":822},[923],{"type":318,"value":924},"length",{"type":303,"tag":151,"props":926,"children":927},{"style":315},[928],{"type":318,"value":929}," >",{"type":303,"tag":151,"props":931,"children":932},{"style":822},[933],{"type":318,"value":934}," 0\n",{"type":303,"tag":151,"props":936,"children":938},{"class":153,"line":937},31,[939,944,949,954,959,964,969,974],{"type":303,"tag":151,"props":940,"children":941},{"style":315},[942],{"type":318,"value":943},"          &&",{"type":303,"tag":151,"props":945,"children":946},{"style":322},[947],{"type":318,"value":948}," commands.",{"type":303,"tag":151,"props":950,"children":951},{"style":425},[952],{"type":318,"value":953},"insertContent",{"type":303,"tag":151,"props":955,"children":956},{"style":322},[957],{"type":318,"value":958},"({ type: ",{"type":303,"tag":151,"props":960,"children":961},{"style":333},[962],{"type":318,"value":963},"\"text\"",{"type":303,"tag":151,"props":965,"children":966},{"style":322},[967],{"type":318,"value":968},", text: ",{"type":303,"tag":151,"props":970,"children":971},{"style":822},[972],{"type":318,"value":973},"this",{"type":303,"tag":151,"props":975,"children":976},{"style":322},[977],{"type":318,"value":978},".options.text }),\n",{"type":303,"tag":151,"props":980,"children":982},{"class":153,"line":981},32,[983],{"type":303,"tag":151,"props":984,"children":985},{"style":322},[986],{"type":318,"value":987},"      };\n",{"type":303,"tag":151,"props":989,"children":991},{"class":153,"line":990},33,[992],{"type":303,"tag":151,"props":993,"children":994},{"style":322},[995],{"type":318,"value":996},"    },\n",{"type":303,"tag":151,"props":998,"children":1000},{"class":153,"line":999},34,[1001],{"type":303,"tag":151,"props":1002,"children":1003},{"style":410},[1004],{"type":318,"value":1005},"    \u002F** Counts accepted document updates; querying can() does not run this hook. *\u002F\n",{"type":303,"tag":151,"props":1007,"children":1009},{"class":153,"line":1008},35,[1010,1015,1019,1023,1028,1033,1038],{"type":303,"tag":151,"props":1011,"children":1012},{"style":425},[1013],{"type":318,"value":1014},"    onUpdate",{"type":303,"tag":151,"props":1016,"children":1017},{"style":322},[1018],{"type":318,"value":760},{"type":303,"tag":151,"props":1020,"children":1021},{"style":822},[1022],{"type":318,"value":973},{"type":303,"tag":151,"props":1024,"children":1025},{"style":322},[1026],{"type":318,"value":1027},".storage.updates ",{"type":303,"tag":151,"props":1029,"children":1030},{"style":315},[1031],{"type":318,"value":1032},"+=",{"type":303,"tag":151,"props":1034,"children":1035},{"style":822},[1036],{"type":318,"value":1037}," 1",{"type":303,"tag":151,"props":1039,"children":1040},{"style":322},[1041],{"type":318,"value":1042},"; },\n",{"type":303,"tag":151,"props":1044,"children":1046},{"class":153,"line":1045},36,[1047,1052,1057],{"type":303,"tag":151,"props":1048,"children":1049},{"style":322},[1050],{"type":318,"value":1051},"  }).",{"type":303,"tag":151,"props":1053,"children":1054},{"style":425},[1055],{"type":318,"value":1056},"configure",{"type":303,"tag":151,"props":1058,"children":1059},{"style":322},[1060],{"type":318,"value":1061},"({ text });\n",{"type":303,"tag":151,"props":1063,"children":1065},{"class":153,"line":1064},37,[1066],{"type":303,"tag":151,"props":1067,"children":1068},{"style":322},[1069],{"type":318,"value":549},{"type":303,"tag":273,"props":1071,"children":1072},{},[1073],{"type":318,"value":1074},"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);}",1793045210524]