@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.
@@ -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
  });