@portabletext/editor 1.44.9 → 1.44.11
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 +1 -1
- package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
- package/lib/_chunks-es/editor-provider.js +1 -1
- package/lib/_chunks-es/editor-provider.js.map +1 -1
- package/lib/index.cjs +20 -5
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +20 -5
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/editor/Editable.tsx +3 -2
- package/src/editor/__tests__/PortableTextEditor.test.tsx +10 -0
- package/src/editor/__tests__/PortableTextEditorTester.tsx +3 -17
- package/src/editor/__tests__/RangeDecorations.test.tsx +6 -0
- package/src/editor/__tests__/pteWarningsSelfSolving.test.tsx +12 -5
- package/src/editor/__tests__/sync-value.test.tsx +5 -0
- package/src/editor/plugins/__tests__/withEditableAPIDelete.test.tsx +8 -3
- package/src/editor/plugins/__tests__/withEditableAPIGetFragment.test.tsx +3 -0
- package/src/editor/plugins/__tests__/withEditableAPIInsert.test.tsx +20 -12
- package/src/editor/plugins/__tests__/withEditableAPISelectionsOverlapping.test.tsx +5 -0
- package/src/editor/plugins/__tests__/withPortableTextLists.test.tsx +2 -0
- package/src/editor/plugins/__tests__/withPortableTextMarkModel.test.tsx +10 -289
- package/src/editor/plugins/__tests__/withPortableTextSelections.test.tsx +2 -0
- package/src/editor/plugins/__tests__/withUndoRedo.test.tsx +3 -0
- package/src/editor/range-decorations-machine.ts +21 -3
- package/src/editor/sync-machine.ts +8 -6
- package/src/internal-utils/__tests__/valueNormalization.test.tsx +2 -0
|
@@ -2351,7 +2351,7 @@ function _updateBlock(slateEditor, currentBlock, oldBlock, currentBlockIndex) {
|
|
|
2351
2351
|
at: path
|
|
2352
2352
|
});
|
|
2353
2353
|
const isSpanNode = slate.Text.isText(currentBlockChild) && currentBlockChild._type === "span" && slate.Text.isText(oldBlockChild) && oldBlockChild._type === "span";
|
|
2354
|
-
isSpanNode && isTextChanged ? (slate.Transforms.delete(slateEditor, {
|
|
2354
|
+
isSpanNode && isTextChanged ? (oldBlockChild.text.length > 0 && slate.Transforms.delete(slateEditor, {
|
|
2355
2355
|
at: {
|
|
2356
2356
|
focus: {
|
|
2357
2357
|
path,
|