"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, {
  pluginToc: () => pluginToc
});
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_defaults = require("./defaults.js");
var import_get_add_buttons = require("./get-add-buttons.js");
var import_get_toolbar_buttons = require("./get-toolbar-buttons.js");
var import_tiptap = require("./tiptap/tiptap.js");
var import_toc_converter = require("./toc-converter.js");
var import_types = require("./types.js");
const pluginToc = (config = {}) => {
  return {
    config: { ...config, type: "toc" },
    type: import_types.TOC_TYPE,
    pmMarkConverters: [],
    pmNodeConverters: [import_toc_converter.tocConverter],
    tiptapExtensions: import_tiptap.tiptapExtensions,
    getAddButtons: import_get_add_buttons.getAddButtons,
    toolbar: {
      names: [import_ricos_types.RicosPluginToolbarNames.TOC],
      getButtons: import_get_toolbar_buttons.getToolbarButtons
    },
    getQuickActions: ({ pluginServices }) => [
      {
        id: import_types.TOC_TYPE,
        title: "TocPlugin_InsertButton",
        icon: pluginServices?.context.isMobile ? import_wix_ui_icons_common.ListSmall : import_wix_ui_icons_common.List,
        section: import_ricos_types.quickActionsModalSections.FormatLayout,
        tags: ["table of contents", "toc", "outline", "headings", "navigation"],
        command: ({ publicCommands }) => {
          publicCommands.insertBlockWithBlankLines(import_types.TOC_TYPE, import_defaults.TOC_DEFAULTS);
        }
      }
    ]
  };
};
//# sourceMappingURL=editor.js.map
