@contentful/field-editor-rich-text 3.16.7 → 3.16.8
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.
|
@@ -20,9 +20,10 @@ const onKeyDownTable = (editor, plugin)=>{
|
|
|
20
20
|
// This fixes `Cannot resolve a Slate point from DOM point:
|
|
21
21
|
// [object HTMLDivElement]` when typing while the cursor is before table
|
|
22
22
|
const windowSelection = window.getSelection();
|
|
23
|
-
|
|
23
|
+
// @ts-expect-error
|
|
24
|
+
// this attribute comes from `plugins/Table/components/Table.tsx`
|
|
25
|
+
if (windowSelection?.anchorNode?.attributes) {
|
|
24
26
|
// @ts-expect-error
|
|
25
|
-
// this attribute comes from `plugins/Table/components/Table.tsx`
|
|
26
27
|
const blockType = windowSelection.anchorNode.attributes?.['data-block-type']?.value;
|
|
27
28
|
const isBeforeTable = blockType === _richtexttypes.BLOCKS.TABLE;
|
|
28
29
|
if (isBeforeTable) {
|
|
@@ -10,9 +10,10 @@ export const onKeyDownTable = (editor, plugin)=>{
|
|
|
10
10
|
// This fixes `Cannot resolve a Slate point from DOM point:
|
|
11
11
|
// [object HTMLDivElement]` when typing while the cursor is before table
|
|
12
12
|
const windowSelection = window.getSelection();
|
|
13
|
-
|
|
13
|
+
// @ts-expect-error
|
|
14
|
+
// this attribute comes from `plugins/Table/components/Table.tsx`
|
|
15
|
+
if (windowSelection?.anchorNode?.attributes) {
|
|
14
16
|
// @ts-expect-error
|
|
15
|
-
// this attribute comes from `plugins/Table/components/Table.tsx`
|
|
16
17
|
const blockType = windowSelection.anchorNode.attributes?.['data-block-type']?.value;
|
|
17
18
|
const isBeforeTable = blockType === BLOCKS.TABLE;
|
|
18
19
|
if (isBeforeTable) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contentful/field-editor-rich-text",
|
|
3
|
-
"version": "3.16.
|
|
3
|
+
"version": "3.16.8",
|
|
4
4
|
"source": "./src/index.tsx",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"prism-react-renderer": "2.0.5",
|
|
84
84
|
"react": ">=16.14.0"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "d29915303ea8b42cde8c60b8e1df50686d4768ae"
|
|
87
87
|
}
|