(frontend) add @blocknote/code-block

To reduce the bundles size, the highlight syntax
library is not included in blocknote core anymore.
We need to add a separate dependency in order
to have the code block syntax highlight feature.
This commit is contained in:
Anthony LC
2025-04-29 17:34:25 +02:00
parent 7f2a21cdc9
commit c32fdb67ac
3 changed files with 99 additions and 1 deletions

View File

@@ -16,6 +16,7 @@
},
"dependencies": {
"@ag-media/react-pdf-table": "2.0.2",
"@blocknote/code-block": "0.29.1",
"@blocknote/core": "0.29.1",
"@blocknote/mantine": "0.29.1",
"@blocknote/react": "0.29.1",

View File

@@ -1,3 +1,4 @@
import { codeBlock } from '@blocknote/code-block';
import {
BlockNoteSchema,
defaultBlockSpecs,
@@ -61,6 +62,7 @@ export const BlockNoteEditor = ({ doc, provider }: BlockNoteEditorProps) => {
const editor = useCreateBlockNote(
{
codeBlock,
collaboration: {
provider,
fragment: provider.document.getXmlFragment('document-store'),