Update blocknote (#6349)
Updating blocknote providing bugfixes & new block types --------- Co-authored-by: Marie Stoppa <marie.stoppa@essec.edu>
This commit is contained in:
@ -1,7 +1,7 @@
|
||||
import { ChangeEvent, useRef } from 'react';
|
||||
import { createReactBlockSpec } from '@blocknote/react';
|
||||
import styled from '@emotion/styled';
|
||||
import { isNonEmptyString } from '@sniptt/guards';
|
||||
import { ChangeEvent, useRef } from 'react';
|
||||
|
||||
import { Button } from '@/ui/input/button/components/Button';
|
||||
import { AppThemeProvider } from '@/ui/theme/components/AppThemeProvider';
|
||||
@ -65,6 +65,10 @@ export const FileBlock = createReactBlockSpec(
|
||||
}
|
||||
const fileUrl = await editor.uploadFile?.(file);
|
||||
|
||||
if (!isNonEmptyString(fileUrl)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
editor.updateBlock(block.id, {
|
||||
props: {
|
||||
...block.props,
|
||||
|
||||
@ -5,11 +5,15 @@ import {
|
||||
IconH1,
|
||||
IconH2,
|
||||
IconH3,
|
||||
IconHeadphones,
|
||||
IconList,
|
||||
IconListCheck,
|
||||
IconListNumbers,
|
||||
IconMoodSmile,
|
||||
IconPhoto,
|
||||
IconPilcrow,
|
||||
IconTable,
|
||||
IconVideo,
|
||||
} from 'twenty-ui';
|
||||
|
||||
import { SuggestionItem } from '@/ui/input/editor/components/CustomSlashMenu';
|
||||
@ -22,9 +26,13 @@ const Icons: Record<string, IconComponent> = {
|
||||
'Heading 3': IconH3,
|
||||
'Numbered List': IconListNumbers,
|
||||
'Bullet List': IconList,
|
||||
'Check List': IconListCheck,
|
||||
Paragraph: IconPilcrow,
|
||||
Table: IconTable,
|
||||
Image: IconPhoto,
|
||||
Video: IconVideo,
|
||||
Audio: IconHeadphones,
|
||||
Emoji: IconMoodSmile,
|
||||
};
|
||||
|
||||
export const getSlashMenu = (editor: typeof blockSchema.BlockNoteEditor) => {
|
||||
|
||||
Reference in New Issue
Block a user