UNPKG

@sanity/visual-editing

Version:

[![npm stat](https://img.shields.io/npm/dm/@sanity/visual-editing.svg?style=flat-square)](https://npm-stat.com/charts.html?package=@sanity/visual-editing) [![npm version](https://img.shields.io/npm/v/@sanity/visual-editing.svg?style=flat-square)](https://

2 lines (1 loc) 699 B
import{jsx as e}from"react/jsx-runtime";import{StrictMode as t}from"react";import{createRoot as n}from"react-dom/client";import{VisualEditing as r}from"../react/index.js";let o=null,i=null,m=null;function l(l,{components:d,history:u,refresh:c,zIndex:a}){m&&clearTimeout(m),l.addEventListener("abort",(()=>{m=setTimeout((()=>{i&&(i.unmount(),i=null),o&&(o.parentNode.removeChild(o),o=null)}),1e3)})),o||(o=document.createElement("sanity-visual-editing"),document.body.parentNode.insertBefore(o,document.body.nextSibling)),i||(i=n(o)),i.render(e(t,{children:e(r,{components:d,history:u,refresh:c,zIndex:a,portal:!1})}))}export{l as renderVisualEditing};//# sourceMappingURL=renderVisualEditing.js.map