import { jsx as _jsx } from "react/jsx-runtime";
import { insertFiles } from "../../../markup/commands/index.js";
import { ToolbarFilePopup } from "../custom/ToolbarFilePopup.js";
import { useMarkupToolbarContext } from "./context.js";
export const MToolbarFilePopup = ({ focus, onClick, hide, anchorElement, editor, className, }) => {
    const { uploadHandler } = useMarkupToolbarContext();
    return (_jsx(ToolbarFilePopup, { hide: hide, focus: focus, onClick: onClick, anchorElement: anchorElement, className: className, onSubmit: (fileParams) => insertFiles([fileParams])(editor.cm), uploadHandler: uploadHandler, onSuccessUpload: (res) => {
            insertFiles(res.success.map(({ result, file }) => ({
                src: result.url,
                name: result.name ?? file.name,
                type: result.type ?? file.type,
            })))(editor.cm);
        } }));
};
//# sourceMappingURL=MToolbarFilePopup.js.map
