import { ButtonPill } from "@wix/wix-ui-icons-common";
import buttonDataDefaults from "./../ricos-schema/legacy/statics/button.defaults.json.js";
import { Node_Type } from "./../ricos-types/index.js";
import { getInitialLinkData } from "./../_shared/link/get-initial-link-data.js";
import { INSERT_PLUGIN_BUTTONS, TOOLBARS } from "./../editor-common/index.js";
import { BUTTONS_TYPE_TO_TIPTAP_ATTR } from "./constants.js";
import { INSERT_BUTTON_BUTTON } from "./data-hooks.js";
const toolbarsToAddIn = [
  TOOLBARS.FOOTER,
  TOOLBARS.SIDE,
  TOOLBARS.MOBILE
];
const getAddButtons = (config, _services, type) => {
  return [
    {
      id: Node_Type.BUTTON,
      label: INSERT_PLUGIN_BUTTONS.BUTTON,
      dataHook: INSERT_BUTTON_BUTTON,
      icon: ButtonPill,
      // @ts-ignore TODO: (plugins-no-any) remove insertButtonTooltip when we make sure it's not used anymore
      tooltip: config?.insertButtonTooltip || "ButtonPlugin_InsertButton_Tooltip",
      toolbars: toolbarsToAddIn,
      command: ({ publicCommands }) => {
        const initialLinkOptions = getInitialLinkData(
          _services.editorProps.generalLinkSettings?.initialLinkOptions
        );
        publicCommands.insertBlockWithBlankLines(type, {
          ...buttonDataDefaults,
          link: initialLinkOptions,
          type: BUTTONS_TYPE_TO_TIPTAP_ATTR[type]
        });
        return true;
      },
      menuConfig: {
        tags: "Button_plugin_search_tags",
        group: "advanced"
      }
    }
  ];
};
export {
  getAddButtons,
  toolbarsToAddIn
};
//# sourceMappingURL=get-add-buttons.js.map
