@contentful/field-editor-rich-text 3.4.19 → 3.4.20

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.
@@ -2,7 +2,7 @@ import React__default, { createContext, useContext, useMemo, useState, useEffect
2
2
  import { MissingEntityCard, WrappedAssetCard, useEntity, useEntityLoader, WrappedEntryCard, ScheduledIconWithTooltip, EntityProvider, getScheduleTooltipContent } from '@contentful/field-editor-reference';
3
3
  import { entityHelpers, ModalDialogLauncher, FieldConnector } from '@contentful/field-editor-shared';
4
4
  import { BLOCKS, INLINES, TEXT_CONTAINERS, HEADINGS, LIST_ITEM_BLOCKS, MARKS, CONTAINERS, TOP_LEVEL_BLOCKS, VOID_BLOCKS, EMPTY_DOCUMENT } from '@contentful/rich-text-types';
5
- import { usePlateEditorRef as usePlateEditorRef$1, usePlateEditorState as usePlateEditorState$1, getPlateSelectors as getPlateSelectors$1, focusEditor as focusEditor$1, withoutNormalizing as withoutNormalizing$1, createPlateEditor as createPlateEditor$1, blurEditor as blurEditor$1, toSlatePoint, mockPlugin as mockPlugin$1, selectEditor as selectEditor$1, getNodeEntries as getNodeEntries$1, isMarkActive as isMarkActive$1, getAboveNode as getAboveNode$1, getRange as getRange$1, isText as isText$1, isElement as isElement$1, getEditorString, getBlockAbove as getBlockAbove$1, getParentNode as getParentNode$1, getLastChildPath as getLastChildPath$1, someHtmlElement as someHtmlElement$1, isCollapsed, isInline as isInline$2, isEndPoint as isEndPoint$1, getPointAfter as getPointAfter$1, isFirstChild as isFirstChild$1, getNodeEntry as getNodeEntry$1, isEditor as isEditor$1, getLastNodeByLevel as getLastNodeByLevel$1, isEditorReadOnly as isEditorReadOnly$1, isRangeAcrossBlocks as isRangeAcrossBlocks$1, getPluginType as getPluginType$1, getCommonNode as getCommonNode$1, findNode as findNode$1, isBlock, match as match$1, isAncestorEmpty as isAncestorEmpty$1, isLastChild, getPointBefore as getPointBefore$1, queryNode as queryNode$1, isNode as isNode$1, getEndPoint as getEndPoint$1, getChildren as getChildren$1, findNodePath as findNodePath$1, createPathRef as createPathRef$1, getNodeTexts as getNodeTexts$1, isSelectionAtBlockStart as isSelectionAtBlockStart$1, getNodeChildren as getNodeChildren$1, isExpanded, isSelectionAtBlockEnd as isSelectionAtBlockEnd$1, someNode as someNode$1, getStartPoint as getStartPoint$1, getMarks as getMarks$1, wrapNodes as wrapNodes$1, insertNodes as insertNodes$1, unhangRange as unhangRange$1, setSelection as setSelection$1, unsetNodes as unsetNodes$1, removeMark as removeMark$1, addMark as addMark$1, removeNodes as removeNodes$1, unwrapNodes as unwrapNodes$1, liftNodes as liftNodes$1, select as select$1, toggleMark as toggleMark$1, normalizeEditor, setNodes as setNodes$1, toggleNodeType as toggleNodeType$1, deleteText as deleteText$1, moveSelection as moveSelection$1, deleteFragment as deleteFragment$1, splitNodes as splitNodes$1, insertText as insertText$1, collapseSelection as collapseSelection$1, moveChildren as moveChildren$1, moveNodes as moveNodes$1, ELEMENT_DEFAULT as ELEMENT_DEFAULT$1, isBlockAboveEmpty, KEY_DESERIALIZE_HTML, hasSingleChild, createDeserializeHtmlPlugin, createDeserializeAstPlugin, getPlateActions, Plate } from '@udecode/plate-core';
5
+ import { usePlateEditorRef as usePlateEditorRef$1, usePlateEditorState as usePlateEditorState$1, getPlateSelectors as getPlateSelectors$1, focusEditor as focusEditor$1, withoutNormalizing as withoutNormalizing$1, createPlateEditor as createPlateEditor$1, blurEditor as blurEditor$1, toSlatePoint, mockPlugin as mockPlugin$1, selectEditor as selectEditor$1, getNodeEntries as getNodeEntries$1, isMarkActive as isMarkActive$1, getAboveNode as getAboveNode$1, getRange as getRange$1, isText as isText$1, isElement as isElement$1, getEditorString, getBlockAbove as getBlockAbove$1, getParentNode as getParentNode$1, getLastChildPath as getLastChildPath$1, someHtmlElement as someHtmlElement$1, isCollapsed, isInline as isInline$2, isEndPoint as isEndPoint$1, getPointAfter as getPointAfter$1, isFirstChild as isFirstChild$1, getNodeEntry as getNodeEntry$1, isEditor as isEditor$1, getLastNodeByLevel as getLastNodeByLevel$1, isEditorReadOnly as isEditorReadOnly$1, isRangeAcrossBlocks as isRangeAcrossBlocks$1, getPluginType as getPluginType$1, getCommonNode as getCommonNode$1, findNode as findNode$1, isBlock, match as match$1, isAncestorEmpty as isAncestorEmpty$1, isLastChild, getPointBefore as getPointBefore$1, queryNode as queryNode$1, isNode as isNode$1, getEndPoint as getEndPoint$1, getChildren as getChildren$1, findNodePath as findNodePath$1, createPathRef as createPathRef$1, getNodeTexts as getNodeTexts$1, isSelectionAtBlockStart as isSelectionAtBlockStart$1, getNodeChildren as getNodeChildren$1, isExpanded, isSelectionAtBlockEnd as isSelectionAtBlockEnd$1, someNode as someNode$1, getStartPoint as getStartPoint$1, getMarks as getMarks$1, wrapNodes as wrapNodes$1, insertNodes as insertNodes$1, unhangRange as unhangRange$1, setSelection as setSelection$1, unsetNodes as unsetNodes$1, removeMark as removeMark$1, addMark as addMark$1, removeNodes as removeNodes$1, unwrapNodes as unwrapNodes$1, select as select$1, liftNodes as liftNodes$1, toggleMark as toggleMark$1, normalizeEditor, setNodes as setNodes$1, toggleNodeType as toggleNodeType$1, deleteText as deleteText$1, moveSelection as moveSelection$1, deleteFragment as deleteFragment$1, splitNodes as splitNodes$1, insertText as insertText$1, collapseSelection as collapseSelection$1, moveChildren as moveChildren$1, moveNodes as moveNodes$1, ELEMENT_DEFAULT as ELEMENT_DEFAULT$1, isBlockAboveEmpty, KEY_DESERIALIZE_HTML, hasSingleChild, createDeserializeHtmlPlugin, createDeserializeAstPlugin, getPlateActions, Plate } from '@udecode/plate-core';
6
6
  import { css, cx } from 'emotion';
7
7
  import areEqual from 'fast-deep-equal';
8
8
  import noop from 'lodash-es/noop';
@@ -1765,6 +1765,9 @@ async function selectEntityAndInsert(nodeType, sdk, editor, logAction) {
1765
1765
  const config = { ...baseConfig,
1766
1766
  withCreate: true
1767
1767
  };
1768
+ const {
1769
+ selection
1770
+ } = editor;
1768
1771
  const rteSlide = watchCurrentSlide(sdk.navigator);
1769
1772
  const entity = await selectEntity(config);
1770
1773
 
@@ -1773,6 +1776,7 @@ async function selectEntityAndInsert(nodeType, sdk, editor, logAction) {
1773
1776
  nodeType
1774
1777
  });
1775
1778
  } else {
1779
+ select(editor, selection);
1776
1780
  insertBlock$1(editor, nodeType, entity);
1777
1781
  ensureFollowingParagraph(editor);
1778
1782
  logAction('insert', {
@@ -2156,6 +2160,9 @@ async function selectEntityAndInsert$1(editor, sdk, logAction) {
2156
2160
  const config = { ...newEntitySelectorConfigFromRichTextField(sdk.field, INLINES.EMBEDDED_ENTRY),
2157
2161
  withCreate: true
2158
2162
  };
2163
+ const {
2164
+ selection
2165
+ } = editor;
2159
2166
  const rteSlide = watchCurrentSlide(sdk.navigator);
2160
2167
  const entry = await sdk.dialogs.selectSingleEntry(config);
2161
2168
 
@@ -2164,6 +2171,7 @@ async function selectEntityAndInsert$1(editor, sdk, logAction) {
2164
2171
  nodeType: INLINES.EMBEDDED_ENTRY
2165
2172
  });
2166
2173
  } else {
2174
+ select(editor, selection);
2167
2175
  insertNodes(editor, createInlineEntryNode$1(entry.sys.id));
2168
2176
  logAction('insert', {
2169
2177
  nodeType: INLINES.EMBEDDED_ENTRY