Skip to content

Commit bb32c03

Browse files
Refactor: clean blockcontainer (#1137)
* extract updateBlockCommand * Extracted remaining commands * extract keyboard shortcuts * move directory * remove createblockcommand * Added merge/split tests * Updated snapshots * Added update block tests and unified test setup * Added test cases for reverting props * Added additional test cases for changing content type * remove "nested" insert option * Split remaining commands & cleaned up * Added `getNearestBlockContainerPos` * Refactored `getBlockInfoFromPos` * Rewrote `splitBlockCommand` * Added text cursor position tests * Fixed lint issue * fix lint * Fixed `splitBlock` selection * Small fix * Added unit tests to check selection setting * simplify splitblocks * Fixed selection in `splitBlock` tests * wip: deprecate getBlockInfoFromPos * finish cleanup * Fixed `mergeBlocks` edge cases * fix build * clean nodeconversions * Implemented PR feedback * Finished review and remaining changes * Fixed bug in `insertOrUpdateBlock` * Removed log * Tiny changes * Fixed merge/delete behaviour on Backspace --------- Co-authored-by: matthewlipski <[email protected]> Co-authored-by: Matthew Lipski <[email protected]>
1 parent 6aec6e2 commit bb32c03

File tree

62 files changed

+28974
-3731
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+28974
-3731
lines changed

docs/pages/docs/editor-api/manipulating-blocks.mdx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ Use `insertBlocks` to insert new blocks into the document:
115115
insertBlocks(
116116
blocksToInsert: PartialBlock[],
117117
referenceBlock: BlockIdentifier,
118-
placement: "before" | "after" | "nested" = "before"
118+
placement: "before" | "after" = "before"
119119
): void;
120120

121121
// Usage
@@ -126,7 +126,7 @@ editor.insertBlocks([{type: "paragraph", content: "Hello World"}], referenceBloc
126126

127127
`referenceBlock:` An [identifier](/docs/editor-api/manipulating-blocks#block-identifiers) for an existing block, at which the new blocks should be inserted.
128128

129-
`placement:` Whether the blocks should be inserted just before, just after, or nested inside the `referenceBlock`. Inserts the blocks at the start of the existing block's children if `"nested"` is used.
129+
`placement:` Whether the blocks should be inserted just before or just after the `referenceBlock`.
130130

131131
If a block's `id` is undefined, BlockNote generates one automatically.
132132

0 commit comments

Comments
 (0)