@tiptap/core 3.0.9 → 3.2.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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tiptap/core",
3
3
  "description": "headless rich text editor",
4
- "version": "3.0.9",
4
+ "version": "3.2.0",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -52,10 +52,10 @@
52
52
  "jsx-dev-runtime"
53
53
  ],
54
54
  "devDependencies": {
55
- "@tiptap/pm": "^3.0.9"
55
+ "@tiptap/pm": "^3.2.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "@tiptap/pm": "^3.0.9"
58
+ "@tiptap/pm": "^3.2.0"
59
59
  },
60
60
  "repository": {
61
61
  "type": "git",
package/src/Editor.ts CHANGED
@@ -182,7 +182,20 @@ export class Editor extends EventEmitter<EditorEvents> {
182
182
  }
183
183
  this.editorView = null
184
184
  this.isInitialized = false
185
- this.css?.remove()
185
+
186
+ // Safely remove CSS element with fallback for test environments
187
+ if (this.css) {
188
+ try {
189
+ if (typeof this.css.remove === 'function') {
190
+ this.css.remove()
191
+ } else if (this.css.parentNode) {
192
+ this.css.parentNode.removeChild(this.css)
193
+ }
194
+ } catch (error) {
195
+ // Silently handle any unexpected DOM removal errors in test environments
196
+ console.warn('Failed to remove CSS element:', error)
197
+ }
198
+ }
186
199
  this.css = null
187
200
  }
188
201