import { $insertNodeToNearestRoot } from "@lexical/utils";
import { COMMAND_PRIORITY_EDITOR, createCommand, defineExtension } from "lexical";
import { $createVimeoNode, VimeoNode } from "./vimeo-node.js";
const INSERT_VIMEO_COMMAND = createCommand('INSERT_VIMEO_COMMAND');
const VimeoExtension = defineExtension({
    name: '@byline/richtext-lexical/Vimeo',
    nodes: ()=>[
            VimeoNode
        ],
    register: (editor)=>editor.registerCommand(INSERT_VIMEO_COMMAND, (payload)=>{
            const vimeoNode = $createVimeoNode(payload);
            $insertNodeToNearestRoot(vimeoNode);
            return true;
        }, COMMAND_PRIORITY_EDITOR)
});
export { INSERT_VIMEO_COMMAND, VimeoExtension };
