@tiptap/core 3.8.0 → 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.d.cts CHANGED
@@ -3237,6 +3237,7 @@ declare class Editor extends EventEmitter<EditorEvents> {
3237
3237
  private commandManager;
3238
3238
  extensionManager: ExtensionManager;
3239
3239
  private css;
3240
+ private className;
3240
3241
  schema: Schema;
3241
3242
  private editorView;
3242
3243
  isFocused: boolean;
package/dist/index.d.ts CHANGED
@@ -3237,6 +3237,7 @@ declare class Editor extends EventEmitter<EditorEvents> {
3237
3237
  private commandManager;
3238
3238
  extensionManager: ExtensionManager;
3239
3239
  private css;
3240
+ private className;
3240
3241
  schema: Schema;
3241
3242
  private editorView;
3242
3243
  isFocused: boolean;
package/dist/index.js CHANGED
@@ -4296,6 +4296,7 @@ var Editor = class extends EventEmitter {
4296
4296
  constructor(options = {}) {
4297
4297
  super();
4298
4298
  this.css = null;
4299
+ this.className = "tiptap";
4299
4300
  this.editorView = null;
4300
4301
  this.isFocused = false;
4301
4302
  /**
@@ -4408,7 +4409,7 @@ var Editor = class extends EventEmitter {
4408
4409
  }
4409
4410
  this.editorView = null;
4410
4411
  this.isInitialized = false;
4411
- if (this.css) {
4412
+ if (this.css && !document.querySelectorAll(`.${this.className}`).length) {
4412
4413
  try {
4413
4414
  if (typeof this.css.remove === "function") {
4414
4415
  this.css.remove();
@@ -4689,7 +4690,7 @@ var Editor = class extends EventEmitter {
4689
4690
  * Prepend class name to element.
4690
4691
  */
4691
4692
  prependClass() {
4692
- this.view.dom.className = `tiptap ${this.view.dom.className}`;
4693
+ this.view.dom.className = `${this.className} ${this.view.dom.className}`;
4693
4694
  }
4694
4695
  captureTransaction(fn) {
4695
4696
  this.isCapturingTransaction = true;