[{"data":1,"prerenderedAt":806},["ShallowReactive",2],{"navigation_docs":3,"-getting-started-visual-editing":71,"-getting-started-visual-editing-surround":801},[4,34,58],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":6},"Getting Started",false,"\u002Fgetting-started","1.getting-started",[10,14,18,22,26,30],{"title":11,"path":12,"stem":13},"Installation","\u002Fgetting-started\u002Finstallation","1.getting-started\u002F2.installation",{"title":15,"path":16,"stem":17},"Configuration","\u002Fgetting-started\u002Fconfiguration","1.getting-started\u002F3.configuration",{"title":19,"path":20,"stem":21},"Usage","\u002Fgetting-started\u002Fusage","1.getting-started\u002F4.usage",{"title":23,"path":24,"stem":25},"Visual Editing","\u002Fgetting-started\u002Fvisual-editing","1.getting-started\u002F5.visual-editing",{"title":27,"path":28,"stem":29},"Live Content","\u002Fgetting-started\u002Flive-content","1.getting-started\u002F6.live-content",{"title":31,"path":32,"stem":33},"Typegen","\u002Fgetting-started\u002Ftypegen","1.getting-started\u002F7.typegen",{"title":35,"icon":6,"path":36,"stem":37,"children":38,"page":6},"Helpers","\u002Fhelpers","2.helpers",[39,43,47,51,55],{"title":40,"path":41,"stem":42},"Portable Text","\u002Fhelpers\u002Fportable-text","2.helpers\u002F1.portable-text",{"title":44,"path":45,"stem":46},"Images","\u002Fhelpers\u002Fimages","2.helpers\u002F2.images",{"title":48,"path":49,"stem":50},"Files","\u002Fhelpers\u002Ffiles","2.helpers\u002F3.files",{"title":52,"path":53,"stem":54},"Groq","\u002Fhelpers\u002Fgroq","2.helpers\u002F4.groq",{"title":23,"path":56,"stem":57},"\u002Fhelpers\u002Fvisual-editing","2.helpers\u002F5.visual-editing",{"title":59,"icon":6,"path":60,"stem":61,"children":62,"page":6},"Community","\u002Fcommunity","3.community",[63,67],{"title":64,"path":65,"stem":66},"Credits","\u002Fcommunity\u002Fcredits","3.community\u002F1.credits",{"title":68,"path":69,"stem":70},"Changelog","\u002Fcommunity\u002Fchangelog","3.community\u002F2.changelog",{"id":72,"title":23,"body":73,"description":120,"extension":795,"links":796,"meta":797,"navigation":798,"path":24,"seo":799,"stem":25,"__hash__":800},"docs\u002F1.getting-started\u002F5.visual-editing.md",{"type":74,"value":75,"toc":789},"minimark",[76,81,103,110,157,165,168,175,182,198,201,206,216,219,224,238,241,282,288,304,307,327,332,342,349,355,366,372,378,385,412,592,614,618,624,633,639,653,656,661,668,785],[77,78,80],"h2",{"id":79},"overview","Overview",[82,83,84,88,89,96,97,102],"p",{},[85,86,87],"code",{},"@nuxtjs\u002Fsanity"," provides a simple method of integrating ",[90,91,95],"a",{"href":92,"rel":93},"https:\u002F\u002Fwww.sanity.io\u002Fdocs\u002Fvisual-editing",[94],"nofollow","visual editing"," in your Nuxt application. Before enabling this feature, make sure you have ",[90,98,101],{"href":99,"rel":100},"https:\u002F\u002Fwww.sanity.io\u002Fdocs\u002Fpresentation",[94],"Presentation"," installed in your studio.",[82,104,105,106,109],{},"You will also need to install ",[85,107,108],{},"@sanity\u002Fclient",":",[111,112,113,138],"code-group",{},[114,115,121],"pre",{"className":116,"code":117,"filename":118,"language":119,"meta":120,"style":120},"language-bash shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","pnpm install @sanity\u002Fclient\n","pnpm","bash","",[85,122,123],{"__ignoreMap":120},[124,125,128,131,135],"span",{"class":126,"line":127},"line",1,[124,129,118],{"class":130},"sBMFI",[124,132,134],{"class":133},"sfazB"," install",[124,136,137],{"class":133}," @sanity\u002Fclient\n",[114,139,142],{"className":116,"code":140,"filename":141,"language":119,"meta":120,"style":120},"npm install @sanity\u002Fclient --save\n","NPM",[85,143,144],{"__ignoreMap":120},[124,145,146,149,151,154],{"class":126,"line":127},[124,147,148],{"class":130},"npm",[124,150,134],{"class":133},[124,152,153],{"class":133}," @sanity\u002Fclient",[124,155,156],{"class":133}," --save\n",[158,159,160,161,164],"warning",{},"The ",[85,162,163],{},"minimal"," client must not be enabled.",[77,166,15],{"id":167},"configuration",[82,169,170,171,174],{},"You can configure visual editing via the ",[85,172,173],{},"sanity.visualEditing"," key in your Nuxt config. The following options are available:",[176,177,179],"h4",{"id":178},"studiourl",[85,180,181],{},"studioUrl",[183,184,185,192],"ul",{},[186,187,188],"li",{},[189,190,191],"strong",{},"Required",[186,193,194,195],{},"Type: ",[189,196,197],{},"string",[82,199,200],{},"The URL of the Sanity Studio with Presentation installed.",[176,202,204],{"id":203},"token",[85,205,203],{},[183,207,208,212],{},[186,209,210],{},[189,211,191],{},[186,213,194,214],{},[189,215,197],{},[82,217,218],{},"A Sanity read token used for server side queries. This is required in order to fetch draft content. This value will not be exposed to the client.",[176,220,222],{"id":221},"mode",[85,223,221],{},[183,225,226,230],{},[186,227,194,228],{},[189,229,197],{},[186,231,232,233],{},"Default: ",[189,234,235],{},[85,236,237],{},"'live-visual-editing'",[82,239,240],{},"Accepts one of the following options:",[183,242,243,254,266],{},[186,244,245,249,250,253],{},[189,246,247],{},[85,248,237],{}," - Default behaviour. Lets the module handle setup to provide fully featured visual editing with live updates. Queries should be executed using ",[85,251,252],{},"useSanityQuery",".",[186,255,256,261,262,265],{},[189,257,258],{},[85,259,260],{},"'visual-editing'"," - Used to enable visual editing without live updates, for example if fetching data using the Sanity client directly. Passing a custom ",[85,263,264],{},"refresh"," handler is recommended, as by default the entire app will refresh to display updates.",[186,267,268,273,274,277,278,281],{},[189,269,270],{},[85,271,272],{},"'custom'"," - The module will not handle any setup, instead the ",[85,275,276],{},"useSanityVisualEditing"," and\u002For ",[85,279,280],{},"useSanityLiveMode"," composables will need to be called manually.",[176,283,285],{"id":284},"previewmode",[85,286,287],{},"previewMode",[183,289,290,299],{},[186,291,194,292,295,296],{},[189,293,294],{},"boolean",", ",[189,297,298],{},"object",[186,300,232,301],{},[189,302,303],{},"true",[82,305,306],{},"To enable preview mode with defaults, or optionally configure the endpoints used to enable and disable preview mode. If passing an object, the options that can be provided are:",[183,308,309,318],{},[186,310,311,314,315],{},[85,312,313],{},"enable"," - the path of the enable endpoint, defaults to ",[85,316,317],{},"\u002Fpreview\u002Fenable",[186,319,320,323,324],{},[85,321,322],{},"disable"," - the path of the disable endpoint, defaults to ",[85,325,326],{},"\u002Fpreview\u002Fdisable",[176,328,330],{"id":329},"stega",[85,331,329],{},[183,333,334,338],{},[186,335,194,336],{},[189,337,294],{},[186,339,232,340],{},[189,341,303],{},[82,343,344,345,253],{},"Used to enable or disable ",[90,346,329],{"href":347,"rel":348},"https:\u002F\u002Fwww.sanity.io\u002Fdocs\u002Floaders-and-overlays#1dbcc04a7093",[94],[176,350,352],{"id":351},"keepstegaoncopy",[85,353,354],{},"keepStegaOnCopy",[183,356,357,361],{},[186,358,194,359],{},[189,360,294],{},[186,362,232,363],{},[189,364,365],{},"false",[82,367,368,369,371],{},"While visual editing is enabled, stega-encoded metadata (invisible characters) is automatically stripped from clipboard data when content is copied from the page, so copied text can be pasted into other tools without the hidden characters tagging along. Set this option to ",[85,370,303],{}," to opt out and keep stega in copied content.",[176,373,375],{"id":374},"onsuspiciousstega",[85,376,377],{},"onSuspiciousStega",[183,379,380],{},[186,381,194,382],{},[189,383,384],{},"function",[82,386,387,388,295,391,295,394,295,397,400,401,295,404,407,408,411],{},"An optional callback that reports stega payloads found in places where they always cause bugs or bloat, such as ",[85,389,390],{},"class",[85,392,393],{},"href",[85,395,396],{},"src",[85,398,399],{},"id"," and other attributes, inside ",[85,402,403],{},"\u003Chead>",[85,405,406],{},"\u003Cscript>"," or ",[85,409,410],{},"\u003Cstyle>"," contents, form values, or the page URL. Providing the callback opts in to the detection logic — when it isn't provided, no scanning runs.",[114,413,418],{"className":414,"code":415,"filename":416,"language":417,"meta":120,"style":120},"language-ts shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","export default defineNuxtConfig({\n  sanity: {\n    visualEditing: {\n      \u002F\u002F ... Visual editing config\n      onSuspiciousStega: (reports) => {\n        for (const report of reports) {\n          console.warn(`Stega found in ${report.kind}`, report)\n        }\n      },\n    }\n  },\n})\n","nuxt.config.ts","ts",[85,419,420,441,453,463,470,494,519,560,566,572,578,584],{"__ignoreMap":120},[124,421,422,426,429,433,437],{"class":126,"line":127},[124,423,425],{"class":424},"s7zQu","export",[124,427,428],{"class":424}," default",[124,430,432],{"class":431},"s2Zo4"," defineNuxtConfig",[124,434,436],{"class":435},"sTEyZ","(",[124,438,440],{"class":439},"sMK4o","{\n",[124,442,444,448,450],{"class":126,"line":443},2,[124,445,447],{"class":446},"swJcz","  sanity",[124,449,109],{"class":439},[124,451,452],{"class":439}," {\n",[124,454,456,459,461],{"class":126,"line":455},3,[124,457,458],{"class":446},"    visualEditing",[124,460,109],{"class":439},[124,462,452],{"class":439},[124,464,466],{"class":126,"line":465},4,[124,467,469],{"class":468},"sHwdD","      \u002F\u002F ... Visual editing config\n",[124,471,473,476,478,481,485,488,492],{"class":126,"line":472},5,[124,474,475],{"class":431},"      onSuspiciousStega",[124,477,109],{"class":439},[124,479,480],{"class":439}," (",[124,482,484],{"class":483},"sHdIc","reports",[124,486,487],{"class":439},")",[124,489,491],{"class":490},"spNyl"," =>",[124,493,452],{"class":439},[124,495,497,500,502,505,508,511,514,517],{"class":126,"line":496},6,[124,498,499],{"class":424},"        for",[124,501,480],{"class":446},[124,503,504],{"class":490},"const",[124,506,507],{"class":435}," report",[124,509,510],{"class":439}," of",[124,512,513],{"class":435}," reports",[124,515,516],{"class":446},") ",[124,518,440],{"class":439},[124,520,522,525,527,530,532,535,538,541,544,546,549,552,555,557],{"class":126,"line":521},7,[124,523,524],{"class":435},"          console",[124,526,253],{"class":439},[124,528,529],{"class":431},"warn",[124,531,436],{"class":446},[124,533,534],{"class":439},"`",[124,536,537],{"class":133},"Stega found in ",[124,539,540],{"class":439},"${",[124,542,543],{"class":435},"report",[124,545,253],{"class":439},[124,547,548],{"class":435},"kind",[124,550,551],{"class":439},"}`",[124,553,554],{"class":439},",",[124,556,507],{"class":435},[124,558,559],{"class":446},")\n",[124,561,563],{"class":126,"line":562},8,[124,564,565],{"class":439},"        }\n",[124,567,569],{"class":126,"line":568},9,[124,570,571],{"class":439},"      },\n",[124,573,575],{"class":126,"line":574},10,[124,576,577],{"class":439},"    }\n",[124,579,581],{"class":126,"line":580},11,[124,582,583],{"class":439},"  },\n",[124,585,587,590],{"class":126,"line":586},12,[124,588,589],{"class":439},"}",[124,591,559],{"class":435},[82,593,594,595,598,599,602,603,598,606,609,610,613],{},"Each report includes the offending ",[85,596,597],{},"element",", the ",[85,600,601],{},"attribute"," name (when applicable), the raw ",[85,604,605],{},"value",[85,607,608],{},"cleaned"," value it should have been, and the decoded ",[85,611,612],{},"sanity"," edit info when available — pointing at the exact document and field that produced the value.",[176,615,616],{"id":264},[85,617,264],{},[183,619,620],{},[186,621,194,622],{},[189,623,384],{},[82,625,626,627,629,630,253],{},"An optional function for overriding the default handling of refresh events received from the studio. This is generally not need needed if the ",[85,628,221],{}," option is set to ",[85,631,632],{},"live-visual-editing",[176,634,636],{"id":635},"zindex",[85,637,638],{},"zIndex",[183,640,641,648],{},[186,642,194,643,295,646],{},[189,644,645],{},"number",[189,647,197],{},[186,649,232,650],{},[189,651,652],{},"9999999",[82,654,655],{},"The CSS z-index on the root node that renders overlays.",[657,658,660],"h3",{"id":659},"recommended-configuration","Recommended Configuration",[82,662,663,664,667],{},"For most use cases, the following minimum ",[85,665,666],{},"visualEditing"," configuration will suffice:",[114,669,671],{"className":414,"code":670,"filename":416,"language":417,"meta":120,"style":120},"export default defineNuxtConfig({\n  modules: ['@nuxtjs\u002Fsanity'],\n  sanity: {\n    \u002F\u002F ... Sanity config\n    visualEditing: {\n      token: process.env.NUXT_SANITY_VISUAL_EDITING_TOKEN,\n      studioUrl: process.env.NUXT_SANITY_VISUAL_EDITING_STUDIO_URL,\n    }\n  },\n})\n",[85,672,673,685,708,716,721,729,751,771,775,779],{"__ignoreMap":120},[124,674,675,677,679,681,683],{"class":126,"line":127},[124,676,425],{"class":424},[124,678,428],{"class":424},[124,680,432],{"class":431},[124,682,436],{"class":435},[124,684,440],{"class":439},[124,686,687,690,692,695,698,700,702,705],{"class":126,"line":443},[124,688,689],{"class":446},"  modules",[124,691,109],{"class":439},[124,693,694],{"class":435}," [",[124,696,697],{"class":439},"'",[124,699,87],{"class":133},[124,701,697],{"class":439},[124,703,704],{"class":435},"]",[124,706,707],{"class":439},",\n",[124,709,710,712,714],{"class":126,"line":455},[124,711,447],{"class":446},[124,713,109],{"class":439},[124,715,452],{"class":439},[124,717,718],{"class":126,"line":465},[124,719,720],{"class":468},"    \u002F\u002F ... Sanity config\n",[124,722,723,725,727],{"class":126,"line":472},[124,724,458],{"class":446},[124,726,109],{"class":439},[124,728,452],{"class":439},[124,730,731,734,736,739,741,744,746,749],{"class":126,"line":496},[124,732,733],{"class":446},"      token",[124,735,109],{"class":439},[124,737,738],{"class":435}," process",[124,740,253],{"class":439},[124,742,743],{"class":435},"env",[124,745,253],{"class":439},[124,747,748],{"class":435},"NUXT_SANITY_VISUAL_EDITING_TOKEN",[124,750,707],{"class":439},[124,752,753,756,758,760,762,764,766,769],{"class":126,"line":521},[124,754,755],{"class":446},"      studioUrl",[124,757,109],{"class":439},[124,759,738],{"class":435},[124,761,253],{"class":439},[124,763,743],{"class":435},[124,765,253],{"class":439},[124,767,768],{"class":435},"NUXT_SANITY_VISUAL_EDITING_STUDIO_URL",[124,770,707],{"class":439},[124,772,773],{"class":126,"line":562},[124,774,577],{"class":439},[124,776,777],{"class":126,"line":568},[124,778,583],{"class":439},[124,780,781,783],{"class":126,"line":574},[124,782,589],{"class":439},[124,784,559],{"class":435},[786,787,788],"style",{},"html pre.shiki code .sBMFI, html code.shiki .sBMFI{--shiki-light:#E2931D;--shiki-default:#FFCB6B;--shiki-dark:#FFCB6B}html pre.shiki code .sfazB, html code.shiki .sfazB{--shiki-light:#91B859;--shiki-default:#C3E88D;--shiki-dark:#C3E88D}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 .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 .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 .s7zQu, html code.shiki .s7zQu{--shiki-light:#39ADB5;--shiki-light-font-style:italic;--shiki-default:#89DDFF;--shiki-default-font-style:italic;--shiki-dark:#89DDFF;--shiki-dark-font-style:italic}html pre.shiki code .s2Zo4, html code.shiki .s2Zo4{--shiki-light:#6182B8;--shiki-default:#82AAFF;--shiki-dark:#82AAFF}html pre.shiki code .sTEyZ, html code.shiki .sTEyZ{--shiki-light:#90A4AE;--shiki-default:#EEFFFF;--shiki-dark:#BABED8}html pre.shiki code .sMK4o, html code.shiki .sMK4o{--shiki-light:#39ADB5;--shiki-default:#89DDFF;--shiki-dark:#89DDFF}html pre.shiki code .swJcz, html code.shiki .swJcz{--shiki-light:#E53935;--shiki-default:#F07178;--shiki-dark:#F07178}html pre.shiki code .sHwdD, html code.shiki .sHwdD{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#546E7A;--shiki-default-font-style:italic;--shiki-dark:#676E95;--shiki-dark-font-style:italic}html pre.shiki code .sHdIc, html code.shiki .sHdIc{--shiki-light:#90A4AE;--shiki-light-font-style:italic;--shiki-default:#EEFFFF;--shiki-default-font-style:italic;--shiki-dark:#BABED8;--shiki-dark-font-style:italic}html pre.shiki code .spNyl, html code.shiki .spNyl{--shiki-light:#9C3EDA;--shiki-default:#C792EA;--shiki-dark:#C792EA}",{"title":120,"searchDepth":443,"depth":443,"links":790},[791,792],{"id":79,"depth":443,"text":80},{"id":167,"depth":443,"text":15,"children":793},[794],{"id":659,"depth":455,"text":660},"md",null,{},true,{"description":120},"McUp-Hj-jTsgG54wQvER9pB5clcXQf4zOu4t-mXjsiY",[802,804],{"title":19,"path":20,"stem":21,"description":803,"children":-1},"@nuxtjs\u002Fsanity provides key composables to interact with data from your Sanity project.",{"title":27,"path":28,"stem":29,"description":805,"children":-1},"The Live Content API allows your app to subscribe to changes in your Sanity dataset and receive updates whenever documents are created, updated, or deleted.",1786217843758]