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