Releases: TypeCellOS/BlockNote
0.11.1
What's Changed
- v0.11.0 by @matthewlipski in #504
- fix: Docs home page demo styling fix by @matthewlipski in #507
- fix: Code styles by @matthewlipski in #517
- fix: Add block button behaviour on blocks with different content by @matthewlipski in #526
- Fix: Minor CSS by @matthewlipski in #527
- fix: List item shortcuts by @matthewlipski in #528
- docs: Formatting toolbar code toggle button example by @matthewlipski in #531
- fix: Errors when hovering image block while editor is uneditable by @matthewlipski in #533
- fix: Formatting toolbar not hiding while dragging blocks by @matthewlipski in #529
- chore: Mantine 7.4.2 by @matthewlipski in #535
- chore: Update
package-lock.json
by @matthewlipski in #536
Full Changelog: v0.11.0...v0.11.1
0.11.0
What's Changed
- v0.10.1 by @matthewlipski in #469
- fix: Add block button incorrect cursor position by @matthewlipski in #484
- fix: Delete handler error when cursor in last block by @matthewlipski in #485
- fix: Bug in
replaceBlocks
by @matthewlipski in #487 - feat: Return values for block manipulation methods by @matthewlipski in #458
- fix: Image block DOM clutter, keyboard handling, and copy/paste by @matthewlipski in #456
- fix: Multiline list indentation by @i-am-chitti in #491
- fix: Remove console logs while pasting by @i-am-chitti in #489
- chore: Mantine update by @matthewlipski in #479
- docs: Mantine update by @matthewlipski in #502
New Contributors
- @i-am-chitti made their first contribution in #491
Full Changelog: v0.10.1...v0.11.0
Breaking Changes
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.
0.10.1
What's Changed
- v0.10.0 by @matthewlipski in #450
- fix: React custom blocks re-mount on update by @matthewlipski in #466
- fix: Missing exports for image formatting toolbar buttons and table handles by @matthewlipski in #459
- fix:
BlockNoteView
types export by @matthewlipski in #457 - fix: NextJS tables CSS error by @matthewlipski in #467
Full Changelog: v0.10.0...v0.10.1
0.10.0
Features
Some nice new stuff now possible with BlockNote!
Tables
Closes #194
Custom Inline Content and Custom Styles
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 #267
Better copy paste handling
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
Breaking changes:
Custom Block API
If you're using Custom Blocks (createReactBlockSpec
), there are 3 major changes:
- The "schema" of your block and the "implementation" are now separated
- The
<InlineContent />
element has been removed in favor ofcontentRef
- Use
content: "inline" | "none"
instead ofcontainsInlineContent: 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
}
});
Naming of export / parse functions
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
Vanilla (non-react) constructor usage
Instead of new BlockNoteEditor(...)
, now use BlockNoteEditor.create(...)
Changelog
- v0.9.6 by @matthewlipski in #402
- fix: block id null when using collaboration by @YousefED in #419
- Chore/upgrade partykit by @YousefED in #445
- chore: setup relative ci by @YousefED in #446
- feature: v0.10: tables, custom inline content, custom styles, better copy / paste handling by @YousefED in #426
Full Changelog: v0.9.6...v0.10.0
0.9.6
What's Changed
- v0.9.5 by @matthewlipski in #373
- docs: Example for changing editor font by @matthewlipski in #399
- fix: Side menu not appearing after clicking add block button by @matthewlipski in #395
- fix: Custom blocks with inline content overflow by @matthewlipski in #392
- fix: Removed warning when node attribute does not correspond to a prop by @matthewlipski in #391
- fix: Image blocks resizable when editor isn't editable by @matthewlipski in #390
- docs: Minor fixes by @matthewlipski in #379
- fix: saving-loading meta info by @danlgz in #376
- fix:
_tiptapOptions
typing and fields getting overridden by @matthewlipski in #398
New Contributors
Full Changelog: v0.9.5...v0.9.6
0.9.5
What's Changed
- v0.9.4 by @matthewlipski in #357
- v0.9.4 by @matthewlipski in #358
- chore: Add twenty to sponsors section in docs website by @matthewlipski in #364
- fix: Block type dropdown not being visible for heading blocks by @matthewlipski in #367
- fix: Made block type dropdown items apply type to all selected blocks by @matthewlipski in #369
- fix: Enter preserves block type when text cursor is at the start of a block by @matthewlipski in #370
- fix: Slash menu error when hitting enter with no items by @matthewlipski in #368
- feat: Delete key handling by @matthewlipski in #372
- feat: Add Drag Handle Menu item
closeMenuOnClick
prop by @matthewlipski in #363 - fix: Boolean/number props not getting parsed correctly by @matthewlipski in #362
Full Changelog: v0.9.4...v0.9.5
0.9.4
What's Changed
- v0.9.3 by @matthewlipski in #347
- chore: upgrade github actions by @YousefED in #354
- chore: Playwright update by @matthewlipski in #355
- fix: Error when custom blocks are in
initialContent
by @matthewlipski in #348 - feat: Default image blocks by @matthewlipski in #331
Full Changelog: v0.9.3...v0.9.4
0.9.3
What's Changed
- v0.9.2 by @matthewlipski in #325
- docs: Examples tab by @matthewlipski in #322
- fix: Menu overflows by @matthewlipski in #340
Full Changelog: v0.9.2...v0.9.3
0.9.2
What's Changed
- v0.9.0 by @matthewlipski in #309
- more lint rules by @YousefED in #302
- fix: don't call window if not defined for nextjs by @YousefED in #303
- fix: Homepage dark theme by @matthewlipski in #318
- fix: make collab provider optional and change output of code blocks by @YousefED in #321
- feat: Improved block type dropdown customization by @matthewlipski in #324
- fix: Custom blocks without inline content by @matthewlipski in #312
Full Changelog: v0.9.0...v0.9.1
0.9.0
What's Changed
- 0.8.5 by @matthewlipski in #299
- docs: fix nextjs docs by @YousefED in #304
- feat: Color scheme customization by @matthewlipski in #305
Full Changelog: v0.8.5...v0.9.0