import { Node as l, mergeAttributes as c } from "../../../../../@tiptap_core@2.14.0_@tiptap_pm@2.14.0/node_modules/@tiptap/core/dist/index.js";
const M = l.create({
  name: "hardBreak",
  addOptions() {
    return {
      keepMarks: !0,
      HTMLAttributes: {}
    };
  },
  inline: !0,
  group: "inline",
  selectable: !1,
  linebreakReplacement: !0,
  parseHTML() {
    return [
      { tag: "br" }
    ];
  },
  renderHTML({ HTMLAttributes: e }) {
    return ["br", c(this.options.HTMLAttributes, e)];
  },
  renderText() {
    return `
`;
  },
  addCommands() {
    return {
      setHardBreak: () => ({ commands: e, chain: n, state: s, editor: a }) => e.first([
        () => e.exitCode(),
        () => e.command(() => {
          const { selection: r, storedMarks: i } = s;
          if (r.$from.parent.type.spec.isolating)
            return !1;
          const { keepMarks: o } = this.options, { splittableMarks: d } = a.extensionManager, t = i || r.$to.parentOffset && r.$from.marks();
          return n().insertContent({ type: this.name }).command(({ tr: u, dispatch: m }) => {
            if (m && t && o) {
              const p = t.filter((k) => d.includes(k.type.name));
              u.ensureMarks(p);
            }
            return !0;
          }).run();
        })
      ])
    };
  },
  addKeyboardShortcuts() {
    return {
      "Mod-Enter": () => this.editor.commands.setHardBreak(),
      "Shift-Enter": () => this.editor.commands.setHardBreak()
    };
  }
});
export {
  M as HardBreak,
  M as default
};
//# sourceMappingURL=index.js.map
