Skip to content

Commit

Permalink
Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
natamox committed Jun 12, 2024
1 parent da5276b commit 3d99560
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/heading/src/toc/hooks/useTocElement.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ import {
useEditorSelector,
} from '@udecode/plate-common';

import type { HeadingList } from '../types';
import type { Heading } from '../types';

import { getHeadingList, heightToTop } from '../../utils';

Expand Down Expand Up @@ -70,7 +70,7 @@ export const useTocElement = ({
props: {
onClick: (
e: React.MouseEvent<HTMLElement, globalThis.MouseEvent>,
item: HeadingList,
item: Heading,
behavior: ScrollBehavior
) => {
e.preventDefault();
Expand Down
8 changes: 4 additions & 4 deletions packages/heading/src/toc/tocSideBar/useTocSideBarState.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
useEditorSelector,
} from '@udecode/plate-common';

import type { HeadingList, TocSideBarProps } from '../types';
import type { Heading, TocSideBarProps } from '../types';

import { useContentController, useTocController } from '.';
import { checkIn, getHeadingList } from '../../utils';
Expand Down Expand Up @@ -78,10 +78,10 @@ export const useTocSideBar = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [mouseInToc]);

const onConentClick = React.useCallback(
const onContentClick = React.useCallback(
(
e: React.MouseEvent<HTMLElement, globalThis.MouseEvent>,
item: HeadingList,
item: Heading,
behavior?: ScrollBehavior
) => {
e.preventDefault();
Expand Down Expand Up @@ -115,6 +115,6 @@ export const useTocSideBar = ({
},
ref: tocRef,
},
onConentClick,
onContentClick,
};
};
4 changes: 2 additions & 2 deletions packages/heading/src/toc/types.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import type { Path } from 'slate';

export interface HeadingList {
export interface Heading {
depth: number;
id: string;
path: Path;
title: string;
type: string;
depth?: number;
}

export interface TocSideBarProps {
Expand Down
4 changes: 2 additions & 2 deletions packages/heading/src/utils/getHeadingList.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import {
getNodeString,
} from '@udecode/plate-common';

import type { HeadingList } from '../toc';
import type { Heading } from '../toc';

import {
ELEMENT_H1,
Expand All @@ -27,7 +27,7 @@ const headingDepth: Record<string, number> = {
};

export const getHeadingList = (editor: PlateEditor) => {
const headingList: HeadingList[] = [];
const headingList: Heading[] = [];

const values = getNodeEntries(editor, {
at: [],
Expand Down

0 comments on commit 3d99560

Please sign in to comment.