@portabletext/editor 4.3.3 → 4.3.4

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/index.js CHANGED
@@ -12907,7 +12907,7 @@ function syncBlock({
12907
12907
  type: "patch",
12908
12908
  patch
12909
12909
  });
12910
- })), validation.valid || validation.resolution?.autoResolve ? (oldBlock._key === block._key ? (debug.syncValue("Updating block", oldBlock, block), Editor.withoutNormalizing(slateEditor, () => {
12910
+ })), validation.valid || validation.resolution?.autoResolve ? (oldBlock._key === block._key && oldBlock._type === block._type ? (debug.syncValue("Updating block", oldBlock, block), Editor.withoutNormalizing(slateEditor, () => {
12911
12911
  withRemoteChanges(slateEditor, () => {
12912
12912
  withoutPatching(slateEditor, () => {
12913
12913
  updateBlock({
@@ -12979,7 +12979,7 @@ function updateBlock({
12979
12979
  }), slateBlock.children.forEach((currentBlockChild, currentBlockChildIndex) => {
12980
12980
  const oldBlockChild = oldSlateBlock.children.at(currentBlockChildIndex), isChildChanged = !oldBlockChild || !isEqualChild(currentBlockChild, oldBlockChild), isTextChanged = oldBlockChild && Text.isText(oldBlockChild) && currentBlockChild.text !== oldBlockChild.text, path = [index, currentBlockChildIndex];
12981
12981
  if (isChildChanged)
12982
- if (currentBlockChild._key === oldBlockChild?._key) {
12982
+ if (currentBlockChild._key === oldBlockChild?._key && currentBlockChild._type === oldBlockChild?._type) {
12983
12983
  debug.syncValue("Updating changed child", currentBlockChild, oldBlockChild), Transforms.setNodes(slateEditor, currentBlockChild, {
12984
12984
  at: path
12985
12985
  });