"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const jsx_runtime_1 = require("react/jsx-runtime");
const LexicalOnChangePlugin_1 = require("@lexical/react/LexicalOnChangePlugin");
const html_1 = require("@lexical/html");
const OnChangePlugin = (props) => {
    // PROPS
    const { onChange } = props;
    const handleChange = (editorState, editor) => {
        editorState.read(() => {
            const htmlString = (0, html_1.$generateHtmlFromNodes)(editor);
            onChange(htmlString);
        });
    };
    return (0, jsx_runtime_1.jsx)(LexicalOnChangePlugin_1.OnChangePlugin, { onChange: handleChange });
};
exports.default = OnChangePlugin;
