"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var editor_exports = {};
__export(editor_exports, {
  pluginCodeBlock: () => pluginCodeBlock
});
module.exports = __toCommonJS(editor_exports);
var import_wix_ui_icons_common = require("@wix/wix-ui-icons-common");
var import_ricos_types = require("./../ricos-types/index.js");
var import_code_block_converter = require("./code-block-converter.js");
var import_defaults = require("./defaults.js");
var import_get_add_buttons = require("./get-add-buttons.js");
var import_get_text_buttons = require("./get-text-buttons.js");
var import_tiptap = require("./tiptap.js");
var import_types = require("./types.js");
const pluginCodeBlock = (config) => {
  const pluginConfig = { type: "codeBlock", ...import_defaults.DEFAULTS.config, ...config };
  return {
    config: pluginConfig,
    type: import_types.CODE_BLOCK_TYPE,
    pmMarkConverters: [],
    pmNodeConverters: [import_code_block_converter.codeBlockConverter],
    shortcuts: [
      (0, import_ricos_types.createShortcut)({
        name: import_ricos_types.Node_Type.CODE_BLOCK,
        description: "ShortcutsSheet_Formatting_CodeBlock",
        keys: { macOs: "Meta+Shift+C", windows: "Ctrl+Shift+C" },
        command({ publicCommands }) {
          publicCommands.setBlockType(import_types.CODE_BLOCK_TYPE);
          return "continue";
        },
        group: "ShortcutsSheet_Section_Formatting",
        enabled: true,
        showInShortcutSheet: true
      })
    ],
    getAddButtons: (config2, services) => (0, import_get_add_buttons.getAddButtons)(config2, services),
    tiptapExtensions: import_tiptap.tiptapExtensions,
    textButtons: (0, import_get_text_buttons.getTextButtons)(),
    getQuickActions: ({ pluginServices }) => [
      {
        id: import_ricos_types.Node_Type.CODE_BLOCK,
        title: "QuickActionsPlugin_ActionTitle_CodeSnippet",
        icon: pluginServices?.context.isMobile ? import_wix_ui_icons_common.Code : import_wix_ui_icons_common.CodeSmall,
        section: import_ricos_types.quickActionsModalSections.FormatLayout,
        tags: ["programming", "code block", "script", "developer", "code section", "syntax"],
        command: ({ publicCommands }) => publicCommands.setBlockType(import_types.CODE_BLOCK_TYPE)
      }
    ]
  };
};
//# sourceMappingURL=editor.js.map
