import { Attachment, AttachmentSmall } from "@wix/wix-ui-icons-common";
import {
  Node_Type,
  RicosPluginToolbarNames,
  quickActionsModalSections
} from "./../ricos-types/index.js";
import { DEFAULTS } from "./defaults.js";
import { fileUploadConverter } from "./file-upload-converter.js";
import { getAddButtons } from "./get-add-buttons.js";
import { getToolbarButtons } from "./get-toolbar-buttons.js";
import { handleFileUpload } from "./handle-file-upload.js";
import { tiptapExtensions } from "./tiptap/tiptap.js";
import { FILE_UPLOAD_TYPE } from "./types.js";
const pluginFileUpload = (config) => {
  const pluginConfig = {
    type: "file",
    ...DEFAULTS.config,
    ...config
  };
  return {
    config: pluginConfig,
    pmMarkConverters: [],
    pmNodeConverters: [fileUploadConverter],
    type: FILE_UPLOAD_TYPE,
    tiptapExtensions,
    toolbar: {
      names: [RicosPluginToolbarNames.FILE],
      getButtons: (config2, services) => getToolbarButtons(config2, services)
    },
    getAddButtons: (config2, services) => getAddButtons(config2, services),
    getQuickActions: ({ pluginServices, config: config2 }) => [
      {
        id: Node_Type.FILE,
        title: "QuickActionsPlugin_ActionTitle_File",
        icon: pluginServices?.context.isMobile ? Attachment : AttachmentSmall,
        section: quickActionsModalSections.Media,
        tags: ["document", "attachment", "upload", "download", "resource"],
        command: ({ publicCommands }) => {
          handleFileUpload({ services: pluginServices, config: config2, publicCommands });
        }
      }
    ]
  };
};
export {
  pluginFileUpload
};
//# sourceMappingURL=editor.js.map

import { injectCss } from "./viewer-styles-inject.js";
injectCss();
