delete() {
    this.commitOrRemove();
    const drawingEditor = this.currentLayer?.endDrawingSession(
      /* isAborted = */ true
    );
    if (!this.hasSelection && !drawingEditor) {
      return;
    }

    const editors = drawingEditor
      ? [drawingEditor]
      : [...this.#selectedEditors];
    const cmd = () => {
      this._editorUndoBar?.show(
        undo,
        editors.length === 1 ? editors[0].editorType : editors.length
      );
      for (const editor of editors) {
        editor.remove();
      }
    };
    const undo = () => {
      for (const editor of editors) {
        this.#addEditorToLayer(editor);
      }
    };

    this.addCommands({ cmd, undo, mustExec: true });
  }
Delete the current editor or all.