"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
  for (var name in all)
    __defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
  if (from && typeof from === "object" || typeof from === "function") {
    for (let key of __getOwnPropNames(from))
      if (!__hasOwnProp.call(to, key) && key !== except)
        __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
  }
  return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var strikethrough_exports = {};
__export(strikethrough_exports, {
  pluginStrikethrough: () => pluginStrikethrough
});
module.exports = __toCommonJS(strikethrough_exports);
var import_wix_ui_icons_common = require("@wix/wix-ui-icons-common");
var import_v1 = require("./../../ricos-schema/legacy/wix/rich_content/v1/index.js");
var import_ricos_types = require("./../../ricos-types/index.js");
var import_is_strikethrough_blocked_by_checkbox_list_selection = require("./../../_shared/list-checkbox/is-strikethrough-blocked-by-checkbox-list-selection.js");
var import_is_always_visible = require("./../../_shared/resolvers/is-always-visible.js");
var import_is_node_selected = require("./../../_shared/resolvers/is-node-selected.js");
var import_is_striketrough_in_text = require("./../../_shared/resolvers/is-striketrough-in-text.js");
var import_data_hooks = require("./data-hooks.js");
var import_extension = require("./extension.js");
var import_strikethrough_converter = require("./strikethrough-converter.js");
const pluginStrikethrough = {
  type: import_v1.Decoration_Type.STRIKETHROUGH,
  config: {},
  pmMarkConverters: [import_strikethrough_converter.strikethroughConverter],
  pmNodeConverters: [],
  tiptapExtensions: [import_extension.strikethrough],
  shortcuts: [
    (0, import_ricos_types.createShortcut)({
      name: import_v1.Decoration_Type.STRIKETHROUGH,
      description: "ShortcutsSheet_Formatting_Strikethrough",
      keys: { macOs: "Meta+Shift+X", windows: "Ctrl+Shift+X" },
      command({ publicCommands }) {
        publicCommands.toggleInlineStyle("strikethrough");
        return "continue";
      },
      group: "ShortcutsSheet_Section_Formatting",
      enabled: true,
      showInShortcutSheet: true
    })
  ],
  textButtons: [
    {
      id: import_v1.Decoration_Type.STRIKETHROUGH,
      type: "toggle",
      presentation: {
        dataHook: import_data_hooks.TEXT_BUTTON_STRIKETHROUGH,
        tooltip: "StrikethroughButton_Tooltip",
        icon: import_wix_ui_icons_common.StrikethroughLight
      },
      attributes: {
        visible: import_is_always_visible.isAlwaysVisible,
        active: import_is_striketrough_in_text.isStrikethroughInText,
        disabled: (content, services, editor) => (0, import_is_node_selected.isNodeSelected)(content, services, editor) || (editor?.state ? (0, import_is_strikethrough_blocked_by_checkbox_list_selection.isStrikethroughBlockedByCheckboxListSelection)(editor.state) : false)
      },
      command: ({ publicCommands }) => () => {
        publicCommands.toggleInlineStyle("strikethrough");
        return true;
      }
    }
  ]
};
//# sourceMappingURL=strikethrough.js.map
