@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.
package/CHANGELOG.md CHANGED
@@ -3,6 +3,12 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## [3.4.20](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@3.4.19...@contentful/field-editor-rich-text@3.4.20) (2023-04-21)
7
+
8
+ ### Bug Fixes
9
+
10
+ - [RTE] embed entries in correct place when using hotkeys ([#1400](https://github.com/contentful/field-editors/issues/1400)) ([e9712b5](https://github.com/contentful/field-editors/commit/e9712b5892c6b3cacb50127082df146ed39149e8))
11
+
6
12
  ## [3.4.19](https://github.com/contentful/field-editors/compare/@contentful/field-editor-rich-text@3.4.18...@contentful/field-editor-rich-text@3.4.19) (2023-04-19)
7
13
 
8
14
  **Note:** Version bump only for package @contentful/field-editor-rich-text
@@ -1772,6 +1772,9 @@ async function selectEntityAndInsert(nodeType, sdk, editor, logAction) {
1772
1772
  const config = { ...baseConfig,
1773
1773
  withCreate: true
1774
1774
  };
1775
+ const {
1776
+ selection
1777
+ } = editor;
1775
1778
  const rteSlide = watchCurrentSlide(sdk.navigator);
1776
1779
  const entity = await selectEntity(config);
1777
1780
 
@@ -1780,6 +1783,7 @@ async function selectEntityAndInsert(nodeType, sdk, editor, logAction) {
1780
1783
  nodeType
1781
1784
  });
1782
1785
  } else {
1786
+ select(editor, selection);
1783
1787
  insertBlock$1(editor, nodeType, entity);
1784
1788
  ensureFollowingParagraph(editor);
1785
1789
  logAction('insert', {
@@ -2163,6 +2167,9 @@ async function selectEntityAndInsert$1(editor, sdk, logAction) {
2163
2167
  const config = { ...newEntitySelectorConfigFromRichTextField(sdk.field, Contentful.INLINES.EMBEDDED_ENTRY),
2164
2168
  withCreate: true
2165
2169
  };
2170
+ const {
2171
+ selection
2172
+ } = editor;
2166
2173
  const rteSlide = watchCurrentSlide(sdk.navigator);
2167
2174
  const entry = await sdk.dialogs.selectSingleEntry(config);
2168
2175
 
@@ -2171,6 +2178,7 @@ async function selectEntityAndInsert$1(editor, sdk, logAction) {
2171
2178
  nodeType: Contentful.INLINES.EMBEDDED_ENTRY
2172
2179
  });
2173
2180
  } else {
2181
+ select(editor, selection);
2174
2182
  insertNodes(editor, createInlineEntryNode$1(entry.sys.id));
2175
2183
  logAction('insert', {
2176
2184
  nodeType: Contentful.INLINES.EMBEDDED_ENTRY