@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.
@@ -3730,11 +3730,27 @@ const decoratorAddActionImplementation = ({
3730
3730
  };
3731
3731
  }
3732
3732
  }, deleteActionImplementation = ({
3733
+ context,
3733
3734
  action
3734
3735
  }) => {
3735
3736
  const range = toSlateRange(action.at, action.editor);
3736
3737
  if (!range)
3737
3738
  throw new Error(`Failed to get Slate Range for selection ${JSON.stringify(action.at)}`);
3739
+ if (Range.isCollapsed(range)) {
3740
+ const [focusBlock] = getFocusBlock({
3741
+ editor: {
3742
+ ...action.editor,
3743
+ selection: range
3744
+ }
3745
+ }), [focusChild] = getFocusChild({
3746
+ editor: {
3747
+ ...action.editor,
3748
+ selection: range
3749
+ }
3750
+ });
3751
+ if (focusBlock && focusBlock._type === context.schema.block.name && focusChild && focusChild._type === context.schema.span.name)
3752
+ return;
3753
+ }
3738
3754
  action.editor.delete({
3739
3755
  at: range
3740
3756
  });