A React Rich Text Editor that's block-based (Notion style) and extensible. Built on top of Prosemirror and Tiptap.
MPL-2.0 License
Bot releases are hidden (Show)
Published by matthewlipski 9 months ago
replaceBlocks
by @matthewlipski in https://github.com/TypeCellOS/BlockNote/pull/487
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.10.1...v0.11.0
Change import "@blocknote/core/style.css";
to import "@blocknote/react/style.css";
if you're using @blocknote/react
This update changes how themes and styles are applied to the editor. This means if you were previously overriding CSS using the componentStyles
field in a Theme
object, you should convert those styles to CSS rules. See the new theming and styling documentation here.
Published by matthewlipski 11 months ago
BlockNoteView
types export by @matthewlipski in https://github.com/TypeCellOS/BlockNote/pull/457
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.10.0...v0.10.1
Published by matthewlipski 11 months ago
Some nice new stuff now possible with BlockNote!
Closes https://github.com/TypeCellOS/BlockNote/issues/194
Until now, it was only possible to create your own custom Blocks. Now, you can also create custom Styles and Inline Content. Styles are markup that can be enabled on text (think bold, italic, etc.). Custom Inline Content can be used for "inline blocks", for example for Mentions.
Closes https://github.com/TypeCellOS/BlockNote/issues/267
The copy / paste and Blocks to / from Markdown / HTML system has been overhauled and should be more robust. Copying and pasting of custom blocks is now also supported!
Closes #221 #69 #361 #381 #282 #226 #249
If you're using Custom Blocks (createReactBlockSpec
), there are 3 major changes:
<InlineContent />
element has been removed in favor of contentRef
content: "inline" | "none"
instead of containsInlineContent: boolean
Old (deprecated) code example:
const ImageBlock = createReactBlockSpec({
type: "image",
propSchema: {
src: {
default: "https://via.placeholder.com/1000",
},
},
containsInlineContent: true,
render: ({ block }) => (
<div
style={{
display: "flex",
flexDirection: "column",
}}>
<img
style={{
width: "100%",
}}
src={block.props.src}
alt={"Image"}
contentEditable={false}
/>
<InlineContent />
</div>
),
});
New version:
const ImageBlock = createReactBlockSpec({
type: "image",
propSchema: {
src: {
default: "https://via.placeholder.com/1000",
},
},
content: "inline"
}, {
render: ({ block, contentRef }) => (
<div
style={{
display: "flex",
flexDirection: "column",
}}>
<img
style={{
width: "100%",
}}
src={block.props.src}
alt={"Image"}
contentEditable={false}
/>
<span ref={contentRef} />
</div>
),
});
Additionally, blockSchema
s are now blockSpecs
, so to pass in the blocks that you want the editor to use:
const editor = useBlockNote({
blockSpecs: {
...defaultBlockSpecs,
image: ImageBlock
}
});
In functions that still require a BlockSchema
type, you can use the getBlockSchemaFromSpecs
function, e.g. for getDefaultReactSlashMenuItems
:
const blockSpecs = {
...defaultBlockSpecs,
image: ImageBlock
}
const blockSchema = getBlockSchemaFromSpecs(blockSpecs);
const editor = useBlockNote({
blockSpecs: blockSpecs,
slashMenuItems: {
...getDefaultReactSlashMenuItems(blockSchema),
insertImageBlock
}
});
To better indicate the conversion to / from Markdown and HTML is lossy, the following functions have been renamed:
editor.blocksToHTML
-> editor.blocksToHTMLLossy
editor.HTMLToBlocks
-> editor.tryParseHTMLToBlocks
editor.blocksToMarkdown
-> editor.blocksToMarkdownLossy
editor.markdownToBlocks
-> editor.tryParseMarkdownToBlocks
Instead of new BlockNoteEditor(...)
, now use BlockNoteEditor.create(...)
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.9.6...v0.10.0
Published by matthewlipski 12 months ago
_tiptapOptions
typing and fields getting overridden by @matthewlipski in https://github.com/TypeCellOS/BlockNote/pull/398
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.9.5...v0.9.6
Published by matthewlipski about 1 year ago
closeMenuOnClick
prop by @matthewlipski in https://github.com/TypeCellOS/BlockNote/pull/363
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.9.4...v0.9.5
Published by matthewlipski about 1 year ago
initialContent
by @matthewlipski in https://github.com/TypeCellOS/BlockNote/pull/348
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.9.3...v0.9.4
Published by matthewlipski about 1 year ago
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.9.2...v0.9.3
Published by matthewlipski about 1 year ago
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.9.0...v0.9.1
Published by matthewlipski about 1 year ago
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.8.5...v0.9.0
Published by matthewlipski about 1 year ago
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.8.4...v0.8.5
Published by matthewlipski about 1 year ago
getBlockInfoFromPos
no longer returns undefined
by @matthewlipski in https://github.com/TypeCellOS/BlockNote/pull/293
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.8.3...v0.8.4
Published by matthewlipski about 1 year ago
This release includes an overhaul for customizing and rendering UI elements in BlockNote. Everything is now rendered under a single root. Includes breaking changes:
slashCommands
editor option has been renamed to slashMenuItems
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.8.2...v0.8.3
Published by matthewlipski over 1 year ago
InlineContent
component by @matthewlipski in https://github.com/TypeCellOS/BlockNote/pull/245
onEditorContentChange
and onTextCursorPositionChange
firing before editor is initialized by @matthewlipski in https://github.com/TypeCellOS/BlockNote/pull/265
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.8.1...v0.8.2
Published by matthewlipski over 1 year ago
hardBreak
nodes by @matthewlipski in https://github.com/TypeCellOS/BlockNote/pull/229
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.8.0...v0.8.1
Published by YousefED over 1 year ago
Custom blocks enable users to add their own custom blocks to BlockNote!
https://www.blocknotejs.org/docs/block-types#custom-block-types
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.7.0...v0.8.0
Published by YousefED over 1 year ago
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.7.0...v0.7.1
Published by YousefED over 1 year ago
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.6.2...v0.7.0
Published by matthewlipski over 1 year ago
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.6.1...v0.6.2
Published by matthewlipski over 1 year ago
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.5.0...v0.6.1
Published by YousefED over 1 year ago
Full Changelog: https://github.com/TypeCellOS/BlockNote/compare/v0.5.0...v0.5.1