For reference:
https://github.com/mozilla/pdf.js/issues/15571#issuecomment-1278141781
event.preventDefault();
    if (this.#activeEditor) {
      
      this.#activeEditor.commitOrRemove();
    }
    if (!this.hasSelection) {
      return;
    }
    const editors = [];
    for (const editor of this.#selectedEditors) {
      if (!editor.isEmpty()) {
        editors.push(editor.serialize());
      }
    }
    if (editors.length === 0) {
      return;
    }
    event.clipboardData.setData("application/pdfjs", JSON.stringify(editors));
  }
  /**
   * Cut callback.
   * @param {ClipboardEvent} event
   */
  cut(event) {