import { Code, CodeSmall } from "@wix/wix-ui-icons-common";
import { Node_Type, createShortcut, quickActionsModalSections } from "./../ricos-types/index.js";
import { codeBlockConverter } from "./code-block-converter.js";
import { DEFAULTS } from "./defaults.js";
import { getAddButtons } from "./get-add-buttons.js";
import { getTextButtons } from "./get-text-buttons.js";
import { tiptapExtensions } from "./tiptap.js";
import { CODE_BLOCK_TYPE } from "./types.js";
const pluginCodeBlock = (config) => {
  const pluginConfig = { type: "codeBlock", ...DEFAULTS.config, ...config };
  return {
    config: pluginConfig,
    type: CODE_BLOCK_TYPE,
    pmMarkConverters: [],
    pmNodeConverters: [codeBlockConverter],
    shortcuts: [
      createShortcut({
        name: Node_Type.CODE_BLOCK,
        description: "ShortcutsSheet_Formatting_CodeBlock",
        keys: { macOs: "Meta+Shift+C", windows: "Ctrl+Shift+C" },
        command({ publicCommands }) {
          publicCommands.setBlockType(CODE_BLOCK_TYPE);
          return "continue";
        },
        group: "ShortcutsSheet_Section_Formatting",
        enabled: true,
        showInShortcutSheet: true
      })
    ],
    getAddButtons: (config2, services) => getAddButtons(config2, services),
    tiptapExtensions,
    textButtons: getTextButtons(),
    getQuickActions: ({ pluginServices }) => [
      {
        id: Node_Type.CODE_BLOCK,
        title: "QuickActionsPlugin_ActionTitle_CodeSnippet",
        icon: pluginServices?.context.isMobile ? Code : CodeSmall,
        section: quickActionsModalSections.FormatLayout,
        tags: ["programming", "code block", "script", "developer", "code section", "syntax"],
        command: ({ publicCommands }) => publicCommands.setBlockType(CODE_BLOCK_TYPE)
      }
    ]
  };
};
export {
  pluginCodeBlock
};
//# sourceMappingURL=editor.js.map
