From 5889c53667d2fdc92b38b159eecaf9e9b415c576 Mon Sep 17 00:00:00 2001 From: Ivan Voskoboinyk Date: Wed, 15 Jan 2025 13:14:31 +0100 Subject: [PATCH] [DEV-19138] Fix incompatible `onDOMBeforeInput` definitions --- packages/slate-commons/src/types/OnDOMBeforeInput.ts | 3 --- packages/slate-commons/src/types/index.ts | 1 - .../src/modules/editable/EditableWithExtensions.tsx | 3 +-- 3 files changed, 1 insertion(+), 6 deletions(-) delete mode 100644 packages/slate-commons/src/types/OnDOMBeforeInput.ts diff --git a/packages/slate-commons/src/types/OnDOMBeforeInput.ts b/packages/slate-commons/src/types/OnDOMBeforeInput.ts deleted file mode 100644 index 33ec9cd28..000000000 --- a/packages/slate-commons/src/types/OnDOMBeforeInput.ts +++ /dev/null @@ -1,3 +0,0 @@ -import type { SlateEditor } from '@udecode/plate-common'; - -export type OnDOMBeforeInput = (event: Event, editor: SlateEditor) => void; diff --git a/packages/slate-commons/src/types/index.ts b/packages/slate-commons/src/types/index.ts index 2926f589c..17fdde833 100644 --- a/packages/slate-commons/src/types/index.ts +++ b/packages/slate-commons/src/types/index.ts @@ -3,7 +3,6 @@ export type { DecorateFactory } from './DecorateFactory'; export type { DeserializeHtml, DeserializeElement, DeserializeMarks } from './DeserializeHtml'; export type { Extension } from './Extension'; export type { Normalize } from './Normalize'; -export type { OnDOMBeforeInput } from './OnDOMBeforeInput'; export type { OnKeyDown } from './OnKeyDown'; export type { RenderElement } from './RenderElement'; export type { RenderLeaf } from './RenderLeaf'; diff --git a/packages/slate-editor/src/modules/editable/EditableWithExtensions.tsx b/packages/slate-editor/src/modules/editable/EditableWithExtensions.tsx index 1aa0b1689..e77438549 100644 --- a/packages/slate-editor/src/modules/editable/EditableWithExtensions.tsx +++ b/packages/slate-editor/src/modules/editable/EditableWithExtensions.tsx @@ -2,7 +2,6 @@ import type { Decorate, Extension, - OnDOMBeforeInput, OnKeyDown, RenderElement, RenderLeaf, @@ -36,7 +35,7 @@ export interface Props { */ extensions?: Extension[]; onCut?: (event: React.ClipboardEvent) => void; - onDOMBeforeInput?: OnDOMBeforeInput; + onDOMBeforeInput?: (event: InputEvent) => void; /** * Handlers when we press a key */