import { UnderlineLight } from "@wix/wix-ui-icons-common";
import { Decoration_Type } from "./../../ricos-schema/legacy/wix/rich_content/v1/index.js";
import { createShortcut } from "./../../ricos-types/index.js";
import { isAlwaysVisible } from "./../../_shared/resolvers/is-always-visible.js";
import { isNodeSelected } from "./../../_shared/resolvers/is-node-selected.js";
import { isUnderlineInText } from "./../../_shared/resolvers/is-underline-in-text.js";
import { TEXT_BUTTON_UNDERLINE } from "./data-hooks.js";
import { underline } from "./extension.js";
import { underlineConverter } from "./underline-converter.js";
const pluginUnderline = {
  type: Decoration_Type.UNDERLINE,
  config: {},
  pmMarkConverters: [underlineConverter],
  pmNodeConverters: [],
  tiptapExtensions: [underline],
  shortcuts: [
    createShortcut({
      name: Decoration_Type.UNDERLINE,
      description: "ShortcutsSheet_Formatting_Underline",
      keys: { macOs: "Meta+U", windows: "Ctrl+U" },
      command({ publicCommands, event }) {
        event?.preventDefault();
        publicCommands.toggleInlineStyle("underline");
        return "continue";
      },
      group: "ShortcutsSheet_Section_Formatting",
      enabled: true,
      showInShortcutSheet: true
    })
  ],
  textButtons: [
    {
      id: Decoration_Type.UNDERLINE,
      type: "toggle",
      presentation: {
        dataHook: TEXT_BUTTON_UNDERLINE,
        tooltip: "UnderlineButton_Tooltip",
        icon: UnderlineLight
      },
      attributes: {
        visible: isAlwaysVisible,
        active: isUnderlineInText,
        disabled: isNodeSelected
      },
      command: ({ publicCommands }) => () => {
        publicCommands.toggleInlineStyle("underline");
        return true;
      }
    }
  ]
};
export {
  pluginUnderline
};
//# sourceMappingURL=underline.js.map
