@bigbinary/neeto-editor 1.39.7 → 1.39.8

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.
@@ -7903,16 +7903,51 @@ var KeyboardShortcuts = function KeyboardShortcuts(_ref) {
7903
7903
  return true;
7904
7904
  }
7905
7905
  return false;
7906
+ },
7907
+ // To fix the issue with backspace on the empty list item moving the focus to the block on top.
7908
+ // https://github.com/ueberdosis/tiptap/issues/2829#issuecomment-1511064298
7909
+ Backspace: function Backspace() {
7910
+ return _this.editor.commands.command(function (_ref2) {
7911
+ var tr = _ref2.tr;
7912
+ var selection = tr.selection,
7913
+ doc = tr.doc;
7914
+ var $cursor = selection.$cursor;
7915
+ var depth = $cursor === null || $cursor === void 0 ? void 0 : $cursor.depth;
7916
+ if ($cursor && depth >= 3 &&
7917
+ // At least the structure is doc -> orderedList/bulletList -> listItem -> paragraph
7918
+ $cursor.parent.type.name === "paragraph" &&
7919
+ // The cursor is inside a paragraph.
7920
+ $cursor.parentOffset === 0 &&
7921
+ // The cursor is at the beginning of the paragraph.
7922
+ $cursor.node(depth - 1).type.name === "listItem" &&
7923
+ // The paragraph is inside a listItem.
7924
+ $cursor.index(depth - 1) === 0 &&
7925
+ // The paragraph is at the beginning of the listItem.
7926
+ $cursor.index(depth - 2) === 0 // The listItem is at the beginning of the list.
7927
+ ) {
7928
+ var listItemNode = $cursor.node(depth - 1);
7929
+ var listItemPos = $cursor.before(depth - 1);
7930
+ var $contentBegin = doc.resolve(listItemPos + 1);
7931
+ var $contentEnd = doc.resolve(listItemPos + listItemNode.nodeSize - 1);
7932
+ var range = $contentBegin.blockRange($contentEnd);
7933
+ var target = utils.liftTarget(range);
7934
+ if (target !== null) {
7935
+ tr.lift(range, target);
7936
+ return true;
7937
+ }
7938
+ }
7939
+ return false;
7940
+ });
7906
7941
  }
7907
7942
  }, shortcuts);
7908
7943
  }
7909
7944
  });
7910
7945
  };
7911
7946
  var KeyboardShortcuts$1 = {
7912
- configure: function configure(_ref2) {
7913
- var onSubmit = _ref2.onSubmit,
7914
- shortcuts = _ref2.shortcuts,
7915
- isBlockQuoteActive = _ref2.isBlockQuoteActive;
7947
+ configure: function configure(_ref3) {
7948
+ var onSubmit = _ref3.onSubmit,
7949
+ shortcuts = _ref3.shortcuts,
7950
+ isBlockQuoteActive = _ref3.isBlockQuoteActive;
7916
7951
  return KeyboardShortcuts({
7917
7952
  onSubmit: onSubmit,
7918
7953
  shortcuts: shortcuts,