@tiptap/core 3.7.2 → 3.9.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -4422,6 +4422,7 @@ var Editor = class extends EventEmitter {
4422
4422
  constructor(options = {}) {
4423
4423
  super();
4424
4424
  this.css = null;
4425
+ this.className = "tiptap";
4425
4426
  this.editorView = null;
4426
4427
  this.isFocused = false;
4427
4428
  /**
@@ -4534,7 +4535,7 @@ var Editor = class extends EventEmitter {
4534
4535
  }
4535
4536
  this.editorView = null;
4536
4537
  this.isInitialized = false;
4537
- if (this.css) {
4538
+ if (this.css && !document.querySelectorAll(`.${this.className}`).length) {
4538
4539
  try {
4539
4540
  if (typeof this.css.remove === "function") {
4540
4541
  this.css.remove();
@@ -4815,7 +4816,7 @@ var Editor = class extends EventEmitter {
4815
4816
  * Prepend class name to element.
4816
4817
  */
4817
4818
  prependClass() {
4818
- this.view.dom.className = `tiptap ${this.view.dom.className}`;
4819
+ this.view.dom.className = `${this.className} ${this.view.dom.className}`;
4819
4820
  }
4820
4821
  captureTransaction(fn) {
4821
4822
  this.isCapturingTransaction = true;