diff --git a/components/editor/editor/index.tsx b/components/editor/editor/index.tsx index efee735c..0bab16e9 100644 --- a/components/editor/editor/index.tsx +++ b/components/editor/editor/index.tsx @@ -1,12 +1,15 @@ "use client"; -import { useEditor, EditorContent } from "@tiptap/react"; +import Highlight from '@tiptap/extension-highlight' +import Typography from '@tiptap/extension-typography' +import { EditorContent, useEditor } from '@tiptap/react' +import StarterKit from '@tiptap/starter-kit' import { TiptapEditorProps } from "./props"; import { CustomCodeBlockEdit, TiptapExtensions } from "./extensions"; import { EditorBubbleMenu } from "./components/bubble-menu"; import { MediaResizer } from "./components/image-resizer"; import Toolbar from "./components/Toolbar/Toolbar"; - + interface EditorProps { initialValue: string; onChange: (value: string) => void; @@ -14,7 +17,10 @@ interface EditorProps { export default function Editor({ onChange, initialValue }: EditorProps) { const editor = useEditor({ - extensions: [...TiptapExtensions, CustomCodeBlockEdit], + extensions: [ + StarterKit, + Highlight, + Typography], editorProps: TiptapEditorProps, content: JSON.parse(initialValue), onUpdate: (e) => { diff --git a/package-lock.json b/package-lock.json index eab69fa3..532ce9c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -43,6 +43,7 @@ "@tiptap/extension-table-row": "^2.6.6", "@tiptap/extension-text-align": "^2.6.6", "@tiptap/extension-text-style": "^2.3.1", + "@tiptap/extension-typography": "^2.8.0", "@tiptap/extension-underline": "^2.6.6", "@tiptap/extension-youtube": "^2.6.6", "@tiptap/pm": "^2.5.1", @@ -10104,6 +10105,19 @@ "@tiptap/core": "^2.6.6" } }, + "node_modules/@tiptap/extension-typography": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-typography/-/extension-typography-2.8.0.tgz", + "integrity": "sha512-g+tbUba6cHbz62rLlmAdXw3GqBfZBVnYXtRqnQzTTPgb8a00+vEoUWA3sNyloq8FhfKFYcMWQDiqaVDqmity+w==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^2.7.0" + } + }, "node_modules/@tiptap/extension-underline": { "version": "2.6.6", "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-2.6.6.tgz", diff --git a/package.json b/package.json index 8a55adfd..dca5f475 100644 --- a/package.json +++ b/package.json @@ -59,6 +59,7 @@ "@tiptap/extension-table-row": "^2.6.6", "@tiptap/extension-text-align": "^2.6.6", "@tiptap/extension-text-style": "^2.3.1", + "@tiptap/extension-typography": "^2.8.0", "@tiptap/extension-underline": "^2.6.6", "@tiptap/extension-youtube": "^2.6.6", "@tiptap/pm": "^2.5.1",