'use client';


import { MessageKey } from "./editor/dist/esm/messagesKeys.mjs";
import { useCrossFrameMessageListener } from "./useCrossFrameMessageListener.mjs";
import { useEffect } from "react";

//#region ../react-intlayer/dist/esm/@intlayer/editor-react/dist/esm/useIframeClickInterceptor.mjs
const useIframeClickInterceptor = () => {
	const postMessage = useCrossFrameMessageListener(MessageKey.INTLAYER_IFRAME_CLICKED);
	const handlePostMessageEvent = () => {
		postMessage();
	};
	useEffect(() => {
		window.addEventListener("mousedown", handlePostMessageEvent);
		return () => window.removeEventListener("mousedown", handlePostMessageEvent);
	}, [postMessage]);
};

//#endregion
export { useIframeClickInterceptor };
//# sourceMappingURL=useIframeClickInterceptor.mjs.map