@portabletext/editor 1.47.7 → 1.47.9

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.
@@ -5915,15 +5915,29 @@ const EditorActorContext = React.createContext({}), abstractAnnotationBehaviors
5915
5915
  guard: ({
5916
5916
  snapshot,
5917
5917
  event
5918
- }) => !(event.placement !== "auto" || !selector_isOverlappingSelection.getFocusTextBlock(snapshot)),
5918
+ }) => {
5919
+ if (event.placement !== "auto")
5920
+ return !1;
5921
+ const focusTextBlock = selector_isOverlappingSelection.getFocusTextBlock(snapshot);
5922
+ return focusTextBlock ? {
5923
+ focusTextBlock
5924
+ } : !1;
5925
+ },
5919
5926
  actions: [({
5920
5927
  event
5928
+ }, {
5929
+ focusTextBlock
5921
5930
  }) => event.blocks.length === 1 ? [behavior_core.raise({
5922
5931
  type: "insert.block",
5923
5932
  block: event.blocks[0],
5924
5933
  placement: "auto",
5925
5934
  select: "end"
5926
- })] : event.blocks.flatMap((block, index) => index === 0 ? [behavior_core.raise({
5935
+ })] : util_sliceBlocks.isEmptyTextBlock(focusTextBlock.node) ? event.blocks.map((block, index) => behavior_core.raise({
5936
+ type: "insert.block",
5937
+ block,
5938
+ placement: index === 0 ? "auto" : "after",
5939
+ select: "end"
5940
+ })) : event.blocks.flatMap((block, index) => index === 0 ? [behavior_core.raise({
5927
5941
  type: "split.block"
5928
5942
  }), behavior_core.raise({
5929
5943
  type: "select.previous block",