import { DataCollection } from "@wix/wix-ui-icons-common";
import { Node_Type } from "./../ricos-types/index.js";
import { INSERT_PLUGIN_BUTTONS, TOOLBARS } from "./../editor-common/index.js";
import { INSERT_TABLE_BUTTON, INSERT_TABLE_MODAL_ADD_BUTTON } from "./data-hooks.js";
import { InsertModal } from "./modals/insert-modal.js";
import { INSERT_TABLE_MODAL_ID } from "./types.js";
const toolbarsToAddIn = [
  TOOLBARS.FOOTER,
  TOOLBARS.SIDE,
  TOOLBARS.MOBILE
];
const getAddButtons = (_, services) => {
  const {
    modals,
    context: { isMobile }
  } = services;
  return [
    {
      id: Node_Type.TABLE,
      label: INSERT_PLUGIN_BUTTONS.TABLE,
      dataHook: INSERT_TABLE_BUTTON,
      icon: DataCollection,
      tooltip: "TablePlugin_InsertButton_Tooltip",
      toolbars: [TOOLBARS.MOBILE, TOOLBARS.FOOTER, TOOLBARS.SIDE],
      command: ({ referenceElement }) => {
        modals?.togglePluginPanel({
          id: INSERT_TABLE_MODAL_ID,
          Component: InsertModal,
          componentProps: {},
          isMobile,
          initialFocus: `[data-hook="${INSERT_TABLE_MODAL_ADD_BUTTON}"]`,
          positioning: {
            referenceElement,
            placement: "bottom"
          },
          mobileLayout: "drawer"
        });
        return true;
      },
      menuConfig: {
        tags: "Table_plugin_search_tags",
        group: "advanced"
      }
    }
  ];
};
export {
  getAddButtons,
  toolbarsToAddIn
};
//# sourceMappingURL=get-add-buttons.js.map
