@portabletext/editor 1.49.1 → 1.49.2

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.
Files changed (32) hide show
  1. package/lib/_chunks-cjs/editor-provider.cjs +22 -11
  2. package/lib/_chunks-cjs/editor-provider.cjs.map +1 -1
  3. package/lib/_chunks-cjs/util.merge-text-blocks.cjs +2 -1
  4. package/lib/_chunks-cjs/util.merge-text-blocks.cjs.map +1 -1
  5. package/lib/_chunks-cjs/util.slice-blocks.cjs +26 -8
  6. package/lib/_chunks-cjs/util.slice-blocks.cjs.map +1 -1
  7. package/lib/_chunks-es/editor-provider.js +22 -11
  8. package/lib/_chunks-es/editor-provider.js.map +1 -1
  9. package/lib/_chunks-es/util.merge-text-blocks.js +2 -1
  10. package/lib/_chunks-es/util.merge-text-blocks.js.map +1 -1
  11. package/lib/_chunks-es/util.slice-blocks.js +26 -8
  12. package/lib/_chunks-es/util.slice-blocks.js.map +1 -1
  13. package/lib/index.cjs +8 -4
  14. package/lib/index.cjs.map +1 -1
  15. package/lib/index.js +8 -4
  16. package/lib/index.js.map +1 -1
  17. package/package.json +3 -3
  18. package/src/behaviors/behavior.abstract.split.ts +2 -2
  19. package/src/converters/converter.portable-text.ts +1 -0
  20. package/src/converters/converter.text-html.ts +1 -0
  21. package/src/converters/converter.text-plain.ts +1 -0
  22. package/src/editor/Editable.tsx +1 -0
  23. package/src/editor/components/render-element.tsx +3 -3
  24. package/src/internal-utils/parse-blocks.test.ts +20 -20
  25. package/src/internal-utils/parse-blocks.ts +57 -20
  26. package/src/operations/behavior.operation.annotation.add.ts +1 -1
  27. package/src/operations/behavior.operation.block.set.ts +1 -1
  28. package/src/operations/behavior.operation.block.unset.ts +2 -2
  29. package/src/operations/behavior.operation.insert-inline-object.ts +1 -1
  30. package/src/operations/behavior.operation.insert.block.ts +1 -1
  31. package/src/selectors/selector.get-trimmed-selection.test.ts +1 -0
  32. package/src/utils/util.merge-text-blocks.ts +1 -1
@@ -2244,7 +2244,8 @@ const converterJson = {
2244
2244
  * If we are dragging internally then we would like to keep the
2245
2245
  * dropped portable text as is.
2246
2246
  */
2247
- refreshKeys: !snapshot.beta.hasTag?.("dragging internally")
2247
+ refreshKeys: !snapshot.beta.hasTag?.("dragging internally"),
2248
+ validateFields: !1
2248
2249
  }
2249
2250
  });
2250
2251
  return parsedBlock ? [parsedBlock] : [];
@@ -2313,7 +2314,8 @@ function createConverterTextHtml(legacySchema) {
2313
2314
  context: snapshot.context,
2314
2315
  block,
2315
2316
  options: {
2316
- refreshKeys: !1
2317
+ refreshKeys: !1,
2318
+ validateFields: !0
2317
2319
  }
2318
2320
  });
2319
2321
  return parsedBlock ? [parsedBlock] : [];
@@ -2369,7 +2371,8 @@ function createConverterTextPlain(legacySchema) {
2369
2371
  context: snapshot.context,
2370
2372
  block,
2371
2373
  options: {
2372
- refreshKeys: !1
2374
+ refreshKeys: !1,
2375
+ validateFields: !0
2373
2376
  }
2374
2377
  });
2375
2378
  return parsedBlock ? [parsedBlock] : [];
@@ -3331,7 +3334,8 @@ const addAnnotationOperationImplementation = ({
3331
3334
  },
3332
3335
  context,
3333
3336
  options: {
3334
- refreshKeys: !1
3337
+ refreshKeys: !1,
3338
+ validateFields: !0
3335
3339
  }
3336
3340
  });
3337
3341
  if (!parsedAnnotation)
@@ -3529,7 +3533,8 @@ const blockSetOperationImplementation = ({
3529
3533
  ...filteredProps
3530
3534
  },
3531
3535
  options: {
3532
- refreshKeys: !1
3536
+ refreshKeys: !1,
3537
+ validateFields: !0
3533
3538
  }
3534
3539
  });
3535
3540
  if (!updatedBlock)
@@ -3571,7 +3576,8 @@ const blockSetOperationImplementation = ({
3571
3576
  context,
3572
3577
  block: omit__default.default(parsedBlock, propsToRemove),
3573
3578
  options: {
3574
- refreshKeys: !1
3579
+ refreshKeys: !1,
3580
+ validateFields: !0
3575
3581
  }
3576
3582
  });
3577
3583
  if (!updatedTextBlock)
@@ -3588,7 +3594,8 @@ const blockSetOperationImplementation = ({
3588
3594
  context,
3589
3595
  block: omit__default.default(parsedBlock, operation.props.filter((prop) => prop !== "_type")),
3590
3596
  options: {
3591
- refreshKeys: !1
3597
+ refreshKeys: !1,
3598
+ validateFields: !0
3592
3599
  }
3593
3600
  });
3594
3601
  if (!updatedBlockObject)
@@ -3793,7 +3800,8 @@ const blockSetOperationImplementation = ({
3793
3800
  ...operation.inlineObject.value ?? {}
3794
3801
  },
3795
3802
  options: {
3796
- refreshKeys: !1
3803
+ refreshKeys: !1,
3804
+ validateFields: !0
3797
3805
  }
3798
3806
  });
3799
3807
  if (!parsedInlineObject)
@@ -3859,7 +3867,8 @@ const blockSetOperationImplementation = ({
3859
3867
  block: operation.block,
3860
3868
  context,
3861
3869
  options: {
3862
- refreshKeys: !1
3870
+ refreshKeys: !1,
3871
+ validateFields: !0
3863
3872
  }
3864
3873
  });
3865
3874
  if (!parsedBlock)
@@ -6931,7 +6940,8 @@ const arrowDownOnLonelyBlockObject = behaviors_index.defineBehavior({
6931
6940
  }).at(0),
6932
6941
  context: snapshot.context,
6933
6942
  options: {
6934
- refreshKeys: !0
6943
+ refreshKeys: !0,
6944
+ validateFields: !0
6935
6945
  }
6936
6946
  });
6937
6947
  return !newTextBlock || !util_sliceBlocks.isTextBlock(snapshot.context, newTextBlock) ? !1 : {
@@ -6959,7 +6969,8 @@ const arrowDownOnLonelyBlockObject = behaviors_index.defineBehavior({
6959
6969
  },
6960
6970
  context: snapshot.context,
6961
6971
  options: {
6962
- refreshKeys: !0
6972
+ refreshKeys: !0,
6973
+ validateFields: !0
6963
6974
  }
6964
6975
  });
6965
6976
  return newTextBlock ? {