"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 editor_exports = {};
__export(editor_exports, {
  pluginIndent: () => pluginIndent
});
module.exports = __toCommonJS(editor_exports);
var import_wix_ui_icons_common = require("@wix/wix-ui-icons-common");
var import_ricos_content = require("./../ricos-content/index.js");
var import_ricos_types = require("./../ricos-types/index.js");
var import_is_always_visible = require("./../_shared/resolvers/is-always-visible.js");
var import_is_node_or_caption_selected = require("./../_shared/resolvers/is-node-or-caption-selected.js");
var import_data_hooks = require("./data-hooks.js");
var import_defaults = require("./defaults.js");
var import_tiptap = require("./tiptap.js");
var import_types = require("./types.js");
const pluginIndent = (config) => {
  return {
    config: { type: "indent", ...import_defaults.DEFAULTS.config, ...config },
    type: import_types.INDENT_TYPE,
    shortcuts: [
      (0, import_ricos_types.createShortcut)({
        name: `INDENT.increase`,
        description: "ShortcutsSheet_Formatting_IncreaseIndent",
        keys: { macOs: "Meta+]", windows: "Ctrl+]" },
        command({ publicCommands }) {
          publicCommands.insertDecoration(import_ricos_content.RICOS_INDENT_TYPE);
          return "continue";
        },
        group: "ShortcutsSheet_Section_Formatting",
        enabled: true,
        showInShortcutSheet: true
      }),
      (0, import_ricos_types.createShortcut)({
        name: `INDENT.decrease`,
        description: "ShortcutsSheet_Formatting_DecreaseIndent",
        keys: { macOs: "Meta+[", windows: "Ctrl+[" },
        command({ publicCommands }) {
          publicCommands.deleteDecoration(import_ricos_content.RICOS_INDENT_TYPE);
          return "continue";
        },
        group: "ShortcutsSheet_Section_Formatting",
        enabled: true,
        showInShortcutSheet: true
      })
    ],
    textButtons: [
      {
        id: `INDENT.increase`,
        type: "toggle",
        presentation: {
          dataHook: import_data_hooks.TEXT_BUTTON_INCREASE_INDENT,
          tooltip: "increaseIndentButton_Tooltip",
          icon: import_wix_ui_icons_common.IncreaseIndentLight
        },
        attributes: {
          visible: import_is_always_visible.isAlwaysVisible,
          disabled: import_is_node_or_caption_selected.isNodeOrCaptionSelected
        },
        command: ({ publicCommands }) => () => {
          publicCommands.insertDecoration(import_ricos_content.RICOS_INDENT_TYPE);
          return true;
        }
      },
      {
        id: `INDENT.decrease`,
        type: "toggle",
        presentation: {
          dataHook: import_data_hooks.TEXT_BUTTON_DECREASE_INDENT,
          tooltip: "decreaseIndentButton_Tooltip",
          icon: import_wix_ui_icons_common.DecreaseIndentLight
        },
        attributes: {
          visible: import_is_always_visible.isAlwaysVisible,
          disabled: import_is_node_or_caption_selected.isNodeOrCaptionSelected
        },
        command: ({ publicCommands }) => () => {
          publicCommands.deleteDecoration(import_ricos_content.RICOS_INDENT_TYPE);
          return true;
        }
      }
    ],
    tiptapExtensions: [import_tiptap.indent]
  };
};
//# sourceMappingURL=editor.js.map
