UNPKG

hydrogen-sanity

Version:
23 lines (20 loc) 956 B
import { jsxs, Fragment, jsx } from 'react/jsx-runtime'; import { isServer } from './utils.js'; import LiveModeClient from './LiveMode.client.js'; import OverlaysClient from './Overlays.client.js'; import { useHasActiveLoaders } from './registry.js'; if (isServer()) { throw new Error( "Visual editing should only run client-side. Please check that this file is not being imported into a worker or server bundle." ); } function VisualEditingClient(props) { const { action, components, zIndex, refresh, onConnect, onDisconnect, ...stegaProps } = props; const hasActiveLoaders = useHasActiveLoaders(); return /* @__PURE__ */ jsxs(Fragment, { children: [ /* @__PURE__ */ jsx(OverlaysClient, { components, zIndex, refresh, action }), hasActiveLoaders && /* @__PURE__ */ jsx(LiveModeClient, { onConnect, onDisconnect, ...stegaProps }) ] }); } export { VisualEditingClient as default }; //# sourceMappingURL=VisualEditing.client.js.map