import { Mark as e, markPasteRule as o, markInputRule as s, mergeAttributes as i } from "../../../../../@tiptap_core@2.14.0_@tiptap_pm@2.14.0/node_modules/@tiptap/core/dist/index.js";
const n = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))$/, a = /(?:^|\s)(==(?!\s+==)((?:[^=]+))==(?!\s+==))/g, l = e.create({
  name: "highlight",
  addOptions() {
    return {
      multicolor: !1,
      HTMLAttributes: {}
    };
  },
  addAttributes() {
    return this.options.multicolor ? {
      color: {
        default: null,
        parseHTML: (t) => t.getAttribute("data-color") || t.style.backgroundColor,
        renderHTML: (t) => t.color ? {
          "data-color": t.color,
          style: `background-color: ${t.color}; color: inherit`
        } : {}
      }
    } : {};
  },
  parseHTML() {
    return [
      {
        tag: "mark"
      }
    ];
  },
  renderHTML({ HTMLAttributes: t }) {
    return ["mark", i(this.options.HTMLAttributes, t), 0];
  },
  addCommands() {
    return {
      setHighlight: (t) => ({ commands: r }) => r.setMark(this.name, t),
      toggleHighlight: (t) => ({ commands: r }) => r.toggleMark(this.name, t),
      unsetHighlight: () => ({ commands: t }) => t.unsetMark(this.name)
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Shift-h": () => this.editor.commands.toggleHighlight()
    };
  },
  addInputRules() {
    return [
      s({
        find: n,
        type: this.type
      })
    ];
  },
  addPasteRules() {
    return [
      o({
        find: a,
        type: this.type
      })
    ];
  }
});
export {
  l as Highlight,
  l as default,
  n as inputRegex,
  a as pasteRegex
};
//# sourceMappingURL=index.js.map
