diff --git a/apps/www/src/registry/default/plate-ui/indent-fire-marker-component.tsx b/apps/www/src/registry/default/plate-ui/indent-fire-marker-component.tsx index 1f828b2b8c..6924aeae9d 100644 --- a/apps/www/src/registry/default/plate-ui/indent-fire-marker-component.tsx +++ b/apps/www/src/registry/default/plate-ui/indent-fire-marker-component.tsx @@ -1,24 +1,22 @@ -import { cn } from '@udecode/cn'; +import { TIndentElement } from '@udecode/plate-indent'; +import { + LiComponentProps, + MarkerComponentProps, +} from '@udecode/plate-indent-list'; -export const FireMarker = (props: any) => { +export const FireMarker = (props: MarkerComponentProps) => { const { element } = props; return (
- {element.indent % 2 === 0 ? '🔥' : '🚀'} + {(element as TIndentElement).indent % 2 === 0 ? '🔥' : '🚀'}
); }; -export const FireLiComponent = (props: any) => { - const { element, children } = props; - return ( - - {children} - - ); +export const FireLiComponent = (props: LiComponentProps) => { + const { children } = props; + return {children}; }; diff --git a/apps/www/src/registry/default/plate-ui/indent-todo-marker-component.tsx b/apps/www/src/registry/default/plate-ui/indent-todo-marker-component.tsx index 9f0766237f..8f233b7ad8 100644 --- a/apps/www/src/registry/default/plate-ui/indent-todo-marker-component.tsx +++ b/apps/www/src/registry/default/plate-ui/indent-todo-marker-component.tsx @@ -1,10 +1,14 @@ import { cn } from '@udecode/cn'; +import { + LiComponentProps, + MarkerComponentProps, +} from '@udecode/plate-indent-list'; import { setNodes } from '@udecode/slate'; import { findNodePath } from '@udecode/slate-react'; import { Checkbox } from './checkbox'; -export const TodoMarker = (props: any) => { +export const TodoMarker = (props: MarkerComponentProps) => { const { editor, element } = props; const onChange = (v: boolean) => { @@ -16,18 +20,20 @@ export const TodoMarker = (props: any) => {
); }; -export const IndentTodoLiComponent = (props: any) => { +export const IndentTodoLiComponent = (props: LiComponentProps) => { const { element, children } = props; return ( {children} diff --git a/packages/indent-list/src/createIndentListPlugin.ts b/packages/indent-list/src/createIndentListPlugin.ts index 922215e565..073bd3a4ab 100644 --- a/packages/indent-list/src/createIndentListPlugin.ts +++ b/packages/indent-list/src/createIndentListPlugin.ts @@ -12,11 +12,7 @@ import { import { injectIndentListComponent } from './injectIndentListComponent'; import { onKeyDownIndentList } from './onKeyDownIndentList'; import { GetSiblingIndentListOptions } from './queries/getSiblingIndentList'; -import { - ILiComponentProps, - IMarkerComponentProps, - ListStyleType, -} from './types'; +import { LiComponentProps, ListStyleType, MarkerComponentProps } from './types'; import { withIndentList } from './withIndentList'; export const KEY_LIST_STYLE_TYPE = 'listStyleType'; @@ -37,8 +33,8 @@ export interface IndentListPlugin { string, { type: string; - markerComponent?: React.FC; - liComponent?: React.FC; + markerComponent?: React.FC; + liComponent?: React.FC; isNumbered?: boolean; } >; diff --git a/packages/indent-list/src/types.ts b/packages/indent-list/src/types.ts index a2761cdcd2..efcdf20253 100644 --- a/packages/indent-list/src/types.ts +++ b/packages/indent-list/src/types.ts @@ -71,12 +71,12 @@ export enum ListStyleType { Inherit = 'inherit', } -export interface ILiComponentProps { +export interface LiComponentProps { element: TElement; children: any; } -export interface IMarkerComponentProps { +export interface MarkerComponentProps { onChange?: (checked: boolean) => void; element: TElement; editor: PlateEditor;