import { inlineImageVisitor } from "./field/extensions/inline-image/populate.js";
import { linkVisitor } from "./field/extensions/link/populate.js";
import { runLexicalPopulate } from "./field/lexical-populate-shared.js";
import { lexicalToMarkdown } from "./field/markdown/lexical-to-markdown.js";
import { lexicalToText } from "./field/lexical-to-text.js";
function lexicalEditorPopulateServer(options) {
    const visitors = options.visitors ?? [
        inlineImageVisitor,
        linkVisitor
    ];
    return async (ctx)=>{
        await runLexicalPopulate({
            client: options.getClient(),
            readContext: ctx.readContext,
            visitors,
            values: [
                ctx.value
            ]
        });
    };
}
function lexicalEditorToMarkdownServer(options = {}) {
    return (ctx)=>lexicalToMarkdown(ctx.value, options).markdown;
}
function lexicalEditorToTextServer() {
    return (ctx)=>lexicalToText(ctx.value);
}
function lexicalEditorEmbedServer(options) {
    const visitors = options.visitors ?? [
        inlineImageVisitor,
        linkVisitor
    ];
    return async (ctx)=>{
        await runLexicalPopulate({
            client: options.getClient(),
            readContext: ctx.readContext,
            visitors,
            values: [
                ctx.value
            ]
        });
    };
}
export { defaultEditorConfig } from "./field/config/default.js";
export { inlineImageVisitor, lexicalEditorEmbedServer, lexicalEditorPopulateServer, lexicalEditorToMarkdownServer, lexicalEditorToTextServer, lexicalToMarkdown, lexicalToText, linkVisitor };
