@portabletext/editor 1.48.6 → 1.48.7
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/_chunks-cjs/editor-provider.cjs +16 -0
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
- package/lib/_chunks-es/editor-provider.js +16 -0
- package/lib/_chunks-es/editor-provider.js.map +1 -1
- package/lib/plugins/index.cjs.map +1 -1
- package/lib/plugins/index.d.cts +5 -0
- package/lib/plugins/index.d.ts +5 -0
- package/lib/plugins/index.js.map +1 -1
- package/package.json +1 -1
- package/src/behavior-actions/behavior.action.delete.ts +21 -1
- package/src/plugins/plugin.decorator-shortcut.ts +1 -0
- package/src/plugins/plugin.markdown.tsx +2 -0
- package/src/plugins/plugin.one-line.tsx +2 -0
|
@@ -3703,11 +3703,27 @@ const decoratorAddActionImplementation = ({
|
|
|
3703
3703
|
};
|
|
3704
3704
|
}
|
|
3705
3705
|
}, deleteActionImplementation = ({
|
|
3706
|
+
context,
|
|
3706
3707
|
action
|
|
3707
3708
|
}) => {
|
|
3708
3709
|
const range = toSlateRange(action.at, action.editor);
|
|
3709
3710
|
if (!range)
|
|
3710
3711
|
throw new Error(`Failed to get Slate Range for selection ${JSON.stringify(action.at)}`);
|
|
3712
|
+
if (slate.Range.isCollapsed(range)) {
|
|
3713
|
+
const [focusBlock] = getFocusBlock({
|
|
3714
|
+
editor: {
|
|
3715
|
+
...action.editor,
|
|
3716
|
+
selection: range
|
|
3717
|
+
}
|
|
3718
|
+
}), [focusChild] = getFocusChild({
|
|
3719
|
+
editor: {
|
|
3720
|
+
...action.editor,
|
|
3721
|
+
selection: range
|
|
3722
|
+
}
|
|
3723
|
+
});
|
|
3724
|
+
if (focusBlock && focusBlock._type === context.schema.block.name && focusChild && focusChild._type === context.schema.span.name)
|
|
3725
|
+
return;
|
|
3726
|
+
}
|
|
3711
3727
|
action.editor.delete({
|
|
3712
3728
|
at: range
|
|
3713
3729
|
});
|