Update Blocknote (#2872)

* - update blocknote
- fix line break in notes

* - fixed parsing body error on image block

* add feature flag
This commit is contained in:
brendanlaschke
2023-12-09 10:40:54 +01:00
committed by GitHub
parent 3913e1b6a0
commit 130e4c8313
7 changed files with 300 additions and 106 deletions

View File

@ -1,5 +1,6 @@
import { BlockNoteEditor } from '@blocknote/core';
import { BlockNoteView } from '@blocknote/react';
import { useTheme } from '@emotion/react';
import styled from '@emotion/styled';
interface BlockEditorProps {
@ -18,13 +19,14 @@ const StyledEditor = styled.div`
color: ${({ theme }) => theme.font.color.tertiary};
font-style: normal !important;
}
.tippy-box:has(.mantine-Toolbar-root) {
transform: translateX(-13%);
}
`;
export const BlockEditor = ({ editor }: BlockEditorProps) => (
<StyledEditor>
<BlockNoteView editor={editor} />
</StyledEditor>
);
export const BlockEditor = ({ editor }: BlockEditorProps) => {
const theme = useTheme();
const blockNoteTheme = theme.name == 'light' ? 'light' : 'dark';
return (
<StyledEditor>
<BlockNoteView editor={editor} theme={blockNoteTheme} />
</StyledEditor>
);
};