@use-kona/editor 0.1.7 → 0.1.8-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.
@@ -51,7 +51,7 @@ class ListsPlugin {
51
51
  const prevListItemPath = Editor.before(editor, path, {
52
52
  unit: 'block'
53
53
  });
54
- const prevList = Editor.above(editor, {
54
+ const prevList = prevListItemPath && Editor.above(editor, {
55
55
  at: prevListItemPath,
56
56
  match: (n)=>this.isList(editor, n)
57
57
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@use-kona/editor",
3
- "version": "0.1.7",
3
+ "version": "0.1.8-rc.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": "./src/index.ts"
@@ -93,10 +93,12 @@ export class ListsPlugin implements IPlugin {
93
93
  unit: 'block',
94
94
  });
95
95
 
96
- const prevList = Editor.above(editor, {
97
- at: prevListItemPath,
98
- match: (n) => this.isList(editor, n as CustomElement),
99
- });
96
+ const prevList =
97
+ prevListItemPath &&
98
+ Editor.above(editor, {
99
+ at: prevListItemPath,
100
+ match: (n) => this.isList(editor, n as CustomElement),
101
+ });
100
102
 
101
103
  if (prevList) {
102
104
  const currentDepth = this.getListDepth(editor, path);