@tiptap/core 2.0.1 → 2.1.0-rc.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": "2.0.1",
4
+ "version": "2.1.0-rc.0",
5
5
  "homepage": "https://tiptap.dev",
6
6
  "keywords": [
7
7
  "tiptap",
@@ -32,7 +32,7 @@
32
32
  "dist"
33
33
  ],
34
34
  "devDependencies": {
35
- "@tiptap/pm": "^2.0.1"
35
+ "@tiptap/pm": "^2.1.0-rc.0"
36
36
  },
37
37
  "peerDependencies": {
38
38
  "@tiptap/pm": "^2.0.0"
@@ -17,7 +17,14 @@ export const Keymap = Extension.create({
17
17
  const { selection, doc } = tr
18
18
  const { empty, $anchor } = selection
19
19
  const { pos, parent } = $anchor
20
- const isAtStart = Selection.atStart(doc).from === pos
20
+ const $parentPos = $anchor.parent.isTextblock ? tr.doc.resolve(pos - 1) : $anchor
21
+ const parentIsIsolating = $parentPos.parent.type.spec.isolating
22
+
23
+ const parentPos = $anchor.pos - $anchor.parentOffset
24
+
25
+ const isAtStart = (parentIsIsolating && $parentPos.parent.childCount === 1)
26
+ ? parentPos === $anchor.pos
27
+ : Selection.atStart(doc).from === pos
21
28
 
22
29
  if (!empty || !isAtStart || !parent.type.isTextblock || parent.textContent.length) {
23
30
  return false