UNPKG

lingo3d

Version:

Lingo3D is a React/Vue 3d game development framework that ships with a complete visual editor

20 lines 811 B
import { jsx as _jsx } from "preact/jsx-runtime"; import { useEffect, useRef } from "preact/hooks"; import { runtimeIframeScriptSystem } from "../../systems/runtimeIframeScriptSystem"; import serialize from "../../api/serializer/serialize"; const Runtime = () => { const iframeRef = useRef(null); useEffect(() => { const iframe = iframeRef.current; if (!iframe) return; const script = `deserialize(${JSON.stringify(serialize())})`; runtimeIframeScriptSystem.add(iframe, { script }); return () => { runtimeIframeScriptSystem.delete(iframe); }; }, []); return (_jsx("iframe", { ref: iframeRef, style: { border: "none", flexGrow: 1 }, src: "runtime/index.html" })); }; export default Runtime; //# sourceMappingURL=index.js.map