@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/dist/index.js CHANGED
@@ -3075,7 +3075,12 @@ const Keymap = Extension.create({
3075
3075
  const { selection, doc } = tr;
3076
3076
  const { empty, $anchor } = selection;
3077
3077
  const { pos, parent } = $anchor;
3078
- const isAtStart = Selection.atStart(doc).from === pos;
3078
+ const $parentPos = $anchor.parent.isTextblock ? tr.doc.resolve(pos - 1) : $anchor;
3079
+ const parentIsIsolating = $parentPos.parent.type.spec.isolating;
3080
+ const parentPos = $anchor.pos - $anchor.parentOffset;
3081
+ const isAtStart = (parentIsIsolating && $parentPos.parent.childCount === 1)
3082
+ ? parentPos === $anchor.pos
3083
+ : Selection.atStart(doc).from === pos;
3079
3084
  if (!empty || !isAtStart || !parent.type.isTextblock || parent.textContent.length) {
3080
3085
  return false;
3081
3086
  }