import { Redo, Undo } from "@wix/wix-ui-icons-common";
import { isAlwaysVisible } from "./../../_shared/resolvers/is-always-visible.js";
import { isRedoStackEmpty } from "./../../_shared/resolvers/is-redo-stack-empty.js";
import { isUndoStackEmpty } from "./../../_shared/resolvers/is-undo-stack-empty.js";
import { TEXT_BUTTON_REDO, TEXT_BUTTON_UNDO } from "./data-hooks.js";
import { undoRedo } from "./history.js";
const pluginUndoRedo = {
  config: {},
  type: "undo-redo",
  tiptapExtensions: [undoRedo],
  textButtons: [
    {
      id: "UNDO",
      type: "toggle",
      presentation: {
        dataHook: TEXT_BUTTON_UNDO,
        tooltip: "UndoButton_Tooltip",
        icon: Undo
      },
      attributes: {
        visible: isAlwaysVisible,
        disabled: isUndoStackEmpty
      },
      command: ({ publicCommands }) => () => {
        publicCommands.undo();
        return true;
      }
    },
    {
      id: "REDO",
      type: "toggle",
      presentation: {
        dataHook: TEXT_BUTTON_REDO,
        tooltip: "RedoButton_Tooltip",
        icon: Redo
      },
      attributes: {
        visible: isAlwaysVisible,
        disabled: isRedoStackEmpty
      },
      command: ({ publicCommands }) => () => {
        publicCommands.redo();
        return true;
      }
    }
  ]
};
export {
  pluginUndoRedo
};
//# sourceMappingURL=undo-redo.js.map
