"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const LexicalComposerContext_1 = require("@lexical/react/LexicalComposerContext");
const react_1 = require("react");
const lexical_1 = require("lexical");
const OnBlurPlugin = ({ onBlur }) => {
    const [editor] = (0, LexicalComposerContext_1.useLexicalComposerContext)();
    (0, react_1.useEffect)(() => {
        return editor.registerCommand(lexical_1.BLUR_COMMAND, (event) => {
            onBlur && onBlur(event);
            return true;
        }, lexical_1.COMMAND_PRIORITY_EDITOR);
    }, []);
    return null;
};
exports.default = OnBlurPlugin;
