@portabletext/editor 6.6.5 → 6.6.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/index.js CHANGED
@@ -3842,10 +3842,8 @@ const RestoreDOM = IS_ANDROID ? RestoreDOMComponent : ({
3842
3842
  const domSelection = getSelection(root2);
3843
3843
  if (activeElement === el2)
3844
3844
  state.latestElement = activeElement, editor.focused = !0;
3845
- else {
3846
- editor.focused = !1;
3845
+ else if (editor.focused = !1, !readOnly)
3847
3846
  return;
3848
- }
3849
3847
  if (!domSelection)
3850
3848
  return deselect(editor);
3851
3849
  const {
@@ -18410,17 +18408,14 @@ function updateBlock({
18410
18408
  if (isChildChanged)
18411
18409
  if (currentBlockChild._key === oldBlockChild?._key && currentBlockChild._type === oldBlockChild?._type) {
18412
18410
  debug$1.syncValue("Updating changed child", currentBlockChild, oldBlockChild);
18413
- const {
18414
- text: _text,
18415
- ...childProps
18416
- } = currentBlockChild;
18417
- applySetNode(slateEditor, childProps, path2);
18418
18411
  const isSpanNode2 = isSpan({
18419
18412
  schema: context.schema
18420
18413
  }, currentBlockChild) && isSpan({
18421
18414
  schema: context.schema
18422
- }, oldBlockChild);
18423
- isSpanNode2 && isTextChanged ? (oldBlockChild.text.length > 0 && deleteText(slateEditor, {
18415
+ }, oldBlockChild), childProps = {
18416
+ ...currentBlockChild
18417
+ };
18418
+ isSpanNode2 && delete childProps.text, applySetNode(slateEditor, childProps, path2), isSpanNode2 && isTextChanged ? (oldBlockChild.text.length > 0 && deleteText(slateEditor, {
18424
18419
  at: {
18425
18420
  focus: {
18426
18421
  path: path2,