@tiptap/core 3.17.1 → 3.19.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.17.1",
4
+ "version": "3.19.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.17.1"
55
+ "@tiptap/pm": "^3.19.0"
56
56
  },
57
57
  "peerDependencies": {
58
- "@tiptap/pm": "^3.17.1"
58
+ "@tiptap/pm": "^3.19.0"
59
59
  },
60
60
  "repository": {
61
61
  "type": "git",
@@ -69,8 +69,14 @@ export const focus: RawCommands['focus'] =
69
69
  })
70
70
  }
71
71
 
72
- if ((view.hasFocus() && position === null) || position === false) {
73
- return true
72
+ try {
73
+ if ((view.hasFocus() && position === null) || position === false) {
74
+ return true
75
+ }
76
+ } catch {
77
+ // if view.hasFocus fails (view not mounted yet)
78
+ // we will return false because there's nothing to focus
79
+ return false
74
80
  }
75
81
 
76
82
  // we don’t try to resolve a NodeSelection or CellSelection