diff --git a/lib/plate-contember.tsx b/lib/plate-contember.tsx index 2bfb5fe..30d9b16 100644 --- a/lib/plate-contember.tsx +++ b/lib/plate-contember.tsx @@ -10,14 +10,13 @@ import { type SugarableRelativeSingleField, useField, } from '@contember/interface' -import { - replaceNodeChildren, -} from '@udecode/plate-common' +import { replaceNodeChildren } from '@udecode/plate-common' import { useEffect } from 'react' import { isJsonContent, isJsonObject } from './contember/utils' import { ContemberImageToolBarButton } from './contember/contember-image-toolbar-button' import { useEditorRef } from '@udecode/plate-common/react' +import type { Value } from '@udecode/plate-common' export type PlateEditorForContemberProps = { field: string | SugarableRelativeSingleField @@ -29,7 +28,7 @@ const PlateEditorForContember = Component( const contentField = useField(field) - const handleEditorOnChange = (value: any) => { + const handleEditorOnChange = (value: Value) => { const contentJson = isJsonObject(value) ? { children: value } : null if ( @@ -52,7 +51,7 @@ const PlateEditorForContember = Component( ? contentField?.value?.children : undefined } - onChange={handleEditorOnChange} + onChange={(options) => handleEditorOnChange(options.value)} shouldNormalizeEditor additionalToolbarButtons={ <>