import React from "react";
import { Node_Type } from "./../../ricos-schema/legacy/wix/rich_content/v1/index.js";
import { getHeadingInSelection } from "./../../_shared/resolvers/get-heading-in-selection.js";
import { isAlwaysVisible } from "./../../_shared/resolvers/is-always-visible.js";
import { isHeaderTwoOrThreeSelected } from "./../../_shared/resolvers/is-header-two-or-three-selected.js";
import { isNodeOrCaptionSelected } from "./../../_shared/resolvers/is-node-or-caption-selected.js";
import { TitleButton } from "./../../toolbars-v3/components/buttons/TitleButton/title-button.js";
import { TEXT_BUTTON_TITLE } from "./data-hooks.js";
import { heading } from "./extension.js";
import { headingConverter } from "./heading-converter.js";
import { getTitleIcon, getTitleOnClick } from "./title-button-utils.js";
const pluginTitle = {
  type: `${Node_Type.HEADING}.title`,
  pmMarkConverters: [],
  pmNodeConverters: [headingConverter],
  textButtons: [
    {
      id: `${Node_Type.HEADING}.title`,
      type: "toggle",
      presentation: {
        dataHook: TEXT_BUTTON_TITLE,
        tooltip: "TitleButton_Tooltip",
        getIcon: getTitleIcon,
        renderer: (toolbarItem) => /* @__PURE__ */ React.createElement(TitleButton, { toolbarItem })
      },
      attributes: {
        visible: isAlwaysVisible,
        selectedHeading: getHeadingInSelection,
        disabled: isNodeOrCaptionSelected,
        active: isHeaderTwoOrThreeSelected
      },
      command: ({ publicCommands }) => () => {
        const onClick = getTitleOnClick(publicCommands);
        onClick();
        return true;
      }
    }
  ],
  config: {},
  tiptapExtensions: [heading]
};
export {
  pluginTitle
};
//# sourceMappingURL=title.js.map
