@portabletext/editor 2.1.2 → 2.1.3
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/lib/index.cjs +5 -4
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +5 -4
- package/lib/index.js.map +1 -1
- package/lib/plugins/index.d.ts +3 -3
- package/lib/utils/index.d.cts +2 -2
- package/package.json +7 -7
- package/src/behaviors/behavior.abstract.list-item.ts +10 -2
package/lib/index.js
CHANGED
|
@@ -6787,10 +6787,11 @@ const MAX_LIST_LEVEL = 10, clearListOnBackspace = defineBehavior({
|
|
|
6787
6787
|
], abstractListItemBehaviors = [defineBehavior({
|
|
6788
6788
|
on: "list item.add",
|
|
6789
6789
|
guard: ({
|
|
6790
|
-
snapshot
|
|
6791
|
-
|
|
6790
|
+
snapshot,
|
|
6791
|
+
event
|
|
6792
|
+
}) => snapshot.context.schema.lists.some((list) => list.name === event.listItem) ? {
|
|
6792
6793
|
selectedTextBlocks: getSelectedTextBlocks(snapshot)
|
|
6793
|
-
}
|
|
6794
|
+
} : !1,
|
|
6794
6795
|
actions: [({
|
|
6795
6796
|
event
|
|
6796
6797
|
}, {
|
|
@@ -6799,7 +6800,7 @@ const MAX_LIST_LEVEL = 10, clearListOnBackspace = defineBehavior({
|
|
|
6799
6800
|
type: "block.set",
|
|
6800
6801
|
at: block.path,
|
|
6801
6802
|
props: {
|
|
6802
|
-
level: 1,
|
|
6803
|
+
level: block.node.level ?? 1,
|
|
6803
6804
|
listItem: event.listItem
|
|
6804
6805
|
}
|
|
6805
6806
|
}))]
|