"use client";
import { jsx } from "react/jsx-runtime";
import { createContext, useContext } from "react";
import { useLexicalComposerContext } from "@lexical/react/LexicalComposerContext";
const ToolbarActiveEditorContext = /*#__PURE__*/ createContext(null);
function ToolbarActiveEditorProvider({ editor, children }) {
    return /*#__PURE__*/ jsx(ToolbarActiveEditorContext.Provider, {
        value: editor,
        children: children
    });
}
function useToolbarActiveEditor() {
    const fromToolbar = useContext(ToolbarActiveEditorContext);
    const [composerEditor] = useLexicalComposerContext();
    return fromToolbar ?? composerEditor;
}
export { ToolbarActiveEditorProvider, useToolbarActiveEditor };
