@seafile/sdoc-editor 0.3.15 → 0.3.16

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.
@@ -218,14 +218,17 @@ export const getAboveBlockNode = (editor, options) => {
218
218
  }));
219
219
  };
220
220
  export const getPrevNode = editor => {
221
- const [lowerNode, lowerPath] = getAboveNode(editor, {
221
+ const lowerNodeEntry = getAboveNode(editor, {
222
222
  mode: 'lowest',
223
223
  match: n => Element.isElement(n) && Editor.isBlock(editor, n)
224
224
  });
225
- const [heightNode, heightPath] = getAboveNode(editor, {
225
+ const highNodeEntry = getAboveNode(editor, {
226
226
  mode: 'highest',
227
227
  match: n => Element.isElement(n) && Editor.isBlock(editor, n)
228
228
  });
229
+ if (!lowerNodeEntry || !highNodeEntry) return null;
230
+ const [heightNode, heightPath] = highNodeEntry;
231
+ const [lowerNode, lowerPath] = lowerNodeEntry;
229
232
  let prevNode = null;
230
233
  try {
231
234
  prevNode = Editor.previous(editor, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@seafile/sdoc-editor",
3
- "version": "0.3.15",
3
+ "version": "0.3.16",
4
4
  "private": false,
5
5
  "description": "This is a sdoc editor",
6
6
  "main": "dist/index.js",