@portabletext/editor 1.49.5 → 1.49.6

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@portabletext/editor",
3
- "version": "1.49.5",
3
+ "version": "1.49.6",
4
4
  "description": "Portable Text Editor made in React",
5
5
  "keywords": [
6
6
  "sanity",
@@ -427,32 +427,36 @@ async function updateValue({
427
427
  await new Promise<void>((resolve) => {
428
428
  Editor.withoutNormalizing(slateEditor, () => {
429
429
  withRemoteChanges(slateEditor, () => {
430
- withoutPatching(slateEditor, async () => {
430
+ withoutPatching(slateEditor, () => {
431
431
  isChanged = removeExtraBlocks({
432
432
  slateEditor,
433
433
  slateValueFromProps,
434
434
  })
435
435
 
436
- for await (const [
437
- currentBlock,
438
- currentBlockIndex,
439
- ] of getStreamedBlocks({
440
- slateValue: slateValueFromProps,
441
- })) {
442
- const {blockChanged, blockValid} = syncBlock({
443
- context,
444
- sendBack,
445
- block: currentBlock,
446
- index: currentBlockIndex,
447
- slateEditor,
448
- value,
449
- })
436
+ const processBlocks = async () => {
437
+ for await (const [
438
+ currentBlock,
439
+ currentBlockIndex,
440
+ ] of getStreamedBlocks({
441
+ slateValue: slateValueFromProps,
442
+ })) {
443
+ const {blockChanged, blockValid} = syncBlock({
444
+ context,
445
+ sendBack,
446
+ block: currentBlock,
447
+ index: currentBlockIndex,
448
+ slateEditor,
449
+ value,
450
+ })
451
+
452
+ isChanged = blockChanged || isChanged
453
+ isValid = isValid && blockValid
454
+ }
450
455
 
451
- isChanged = blockChanged || isChanged
452
- isValid = isValid && blockValid
456
+ resolve()
453
457
  }
454
458
 
455
- resolve()
459
+ processBlocks()
456
460
  })
457
461
  })
458
462
  })