import { Plugin } from 'prosemirror-state';
import { reactNodeViewFactory } from "../../../../../react-utils/index.js";
import { imageNodeName, imageRendererKey } from "../../const.js";
import { ImageNodeView, cnImgSizeNodeView } from "./NodeView.js";
export const imgSizeNodeViewPlugin = (opts = {}) => (deps) => new Plugin({
    key: imageRendererKey,
    state: {
        init: () => undefined,
        apply: (tr) => {
            return tr.getMeta(imageRendererKey);
        },
    },
    props: {
        nodeViews: {
            [imageNodeName]: reactNodeViewFactory(ImageNodeView, {
                isInline: true,
                reactNodeWrapperCn: cnImgSizeNodeView('wrapper'),
                extensionOptions: opts,
            })(deps),
        },
    },
});
//# sourceMappingURL=index.js.map
