Skip to content

Commit 96f0a60

Browse files
committed
fix(editor): resolve Node naming conflict in TableOfContents
1 parent cf62e72 commit 96f0a60

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/components/editor/extensions/TableOfContents.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { Node as ProseMirrorNode, mergeAttributes } from '@tiptap/core';
1+
import { Node as ProseMirrorNode, mergeAttributes, Node as TiptapNode } from '@tiptap/core';
22
import { ReactNodeViewRenderer } from '@tiptap/react';
33
import { NodeViewWrapper } from '@tiptap/react';
44
import type { Editor } from '@tiptap/react';
@@ -56,7 +56,7 @@ const TableOfContentsComponent = ({
5656
(index: number) => {
5757
let currentIndex = 0;
5858

59-
editor.state.doc.descendants((node: ProseMirrorNode, pos: number) => {
59+
editor.state.doc.descendants((node, pos) => {
6060
if (node.type.name === 'heading') {
6161
if (currentIndex === index) {
6262
editor.commands.focus();
@@ -157,7 +157,7 @@ const TableOfContentsComponent = ({
157157
);
158158
};
159159

160-
export const TableOfContents = Node.create({
160+
export const TableOfContents = TiptapNode.create({
161161
name: 'tableOfContents',
162162

163163
group: 'block',

0 commit comments

Comments
 (0)