metanote.io
metanote.io

AI-Powered Productivity Workspaces

Loading…
Click to maximize
Click to minimize

Integrated Task, Project & Knowledge Management

Loading…
Click to maximize
Click to minimize

Dynamic Behavior, Styles, Actions and Workflows

Loading…
Click to maximize
Click to minimize

Application Templates, Themes, and Collaboration

Loading…
Click to maximize
Click to minimize
📝
` + txt; htmlContent = txt; } else if (contentObj.blob) { htmlContent = atob(contentObj.blob); } if (htmlContent) { setSrcDoc(htmlContent); setIsLoading(false); } } else { types.log("Resource found, but content was empty.", "warn"); } } catch (err) { types.log(`MCP Resource Error: ${err.message}`, "error"); console.error("MCP Resource Error:", err); setIsLoading(false); } }; fetchData(); return () => { isCancelled = true; }; }, [toolInput?.serverUrl, toolInput?.outputTemplate]); // Effect 2: Synchronize data with the iframe via postMessage useEffect(() => { const iframe = iframeRef.current; if (!iframe || !srcDoc) return; const sendDataToIframe = () => { //iframe.contentWindow.openai = chatContext; }; // Safety Check: If the iframe is already loaded (common with srcDoc), // send the data immediately. if (iframe.contentDocument?.readyState === 'complete') { sendDataToIframe(); } // Standard listener for the load event iframe.addEventListener('load', sendDataToIframe); return () => iframe.removeEventListener('load', sendDataToIframe); }, [toolInput, toolOutput, srcDoc]); return (
{isLoading && (
Loading template...
)} {!isLoading && ( )}
); }`); })();