@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/lib/index.cjs +20 -19
- package/lib/index.cjs.map +1 -1
- package/lib/index.js +20 -19
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/editor/sync-machine.ts +22 -18
package/package.json
CHANGED
|
@@ -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,
|
|
430
|
+
withoutPatching(slateEditor, () => {
|
|
431
431
|
isChanged = removeExtraBlocks({
|
|
432
432
|
slateEditor,
|
|
433
433
|
slateValueFromProps,
|
|
434
434
|
})
|
|
435
435
|
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
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
|
-
|
|
452
|
-
isValid = isValid && blockValid
|
|
456
|
+
resolve()
|
|
453
457
|
}
|
|
454
458
|
|
|
455
|
-
|
|
459
|
+
processBlocks()
|
|
456
460
|
})
|
|
457
461
|
})
|
|
458
462
|
})
|