@venuecms/sdk-next
Version:
This is a work in progress and is heavily in flux until we launch 1.0 in February.
4 lines (3 loc) • 503 B
JavaScript
"use client";
import{useEffect as s}from"react";var i=!1,f=r=>{let e=r.data;if(!e||typeof e!="object"||e.method!=="resize")return;let t=Number(e.height);if(!Number.isFinite(t)||t<=0)return;let o=document.querySelectorAll("iframe");for(let n of Array.from(o))if(n.contentWindow===r.source){n.style.height=`${Math.round(t)}px`;break}},u=()=>{s(()=>{i||typeof window>"u"||(i=!0,window.addEventListener("message",f))},[])},d=()=>(u(),null);export{u as a,d as b};
//# sourceMappingURL=chunk-SRGIKZIK.mjs.map