Skip to content

Custom blocks docs #217

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
May 30, 2023
Merged

Custom blocks docs #217

merged 7 commits into from
May 30, 2023

Conversation

matthewlipski
Copy link
Collaborator

@matthewlipski matthewlipski commented May 30, 2023

This PR adds documentation for custom blocks and fixes a few smaller issues with them. There are still a few things that need changing:

  • Automatically setting contentEditable="false" on all elements except the contentDOM/InlineContent and its ancestors (https://discuss.prosemirror.net/t/contenteditable-islands-prevents-selection/3938).
  • Finalize naming for types & functions.
  • Make it so you don't have to call createBlockSpec manually? Not sure if this is something we want since we probably want to keep the ability to create BlockSpecs from scratch and add them to the schema.

@vercel
Copy link

vercel bot commented May 30, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
blocknote-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 30, 2023 0:01am

@YousefED YousefED merged commit 1d46994 into custom-blocks-example May 30, 2023
YousefED added a commit that referenced this pull request May 31, 2023
* simplify formattingtoolbar

* Fixed React component types and added customizable formatting toolbar factory

* Finished formatting toolbar customization with old props

* Changed formatting toolbar props to use BlockNoteEditor

* Fixed text alignment with basic selection object

* Fixed block nesting tests

* Removed multiple block shorthand for updateBlock

* Added comments

* Added basic mouse cursor position

* Added drag handle menu customization API

* Copied changes from PR and minor improvements

* Table block test

* wip: custom blocks typing and API

* add comments

* fix nodeConversions, add schema

* comments

* Implemented renderHTML and parseHTML for createCustomBlock

* Temp changes

* Mostly implemented stricter typing for custom blocks

* Cleanup & fixed build issues

* Fixed useBlockNote and improved some typing

* Implemented PR feedback

* Minor changes

* Made custom blocks use node views

* Created custom example and setup component testing

* Changed custom block `renderHTML` implementation

* Changed custom block `renderHTML` implementation

* Changed custom block testing setup and added custom block examples

* Slightly changed `blockConfig.render` type

* Fixed merge issues

* custom blocks react poc

* Added internal custom block copy/paste tests

* Small fix

* Added external custom block copy/paste tests

* Added expected serialized HTML for example custom blocks

* Updated playwright scripts

* Updated component tests and added serializer extension

* Updated React custom block API

* Reverted `App.tsx`

* Fixed `test:updateSnaps` script

* Added external copypaste snapshots

* Fixed failing tests

* Copy/paste tests are now skipped for WebKit

* Removed old `console.log`s

* Small change to `test-ct` script

* Removed image block from `defaultBlocks.ts`

* Updated component tests & snapshots

* General cleanup

* Updated firefox colors snapshot

* remove unnecessary generics for slash menu items

* fix types

* hack around TextAlignButton types

* Custom blocks example typing improvements (#202)

* improve typings

* add tests for types

---------

Co-authored-by: Matthew Lipski <[email protected]>

* Implemented most PR feedback

* Implemented most PR feedback

* Minor fixes to custom blocks

* Custom blocks docs (#217)

* Fixed custom block placeholders, formatting toolbar, and sizing

* Small styling changes

* Made text align button not show up when selected block/s doesn't/don't support the prop

* Updated docs

* Finished 1st draft custom block docs and demo

* Added type arguments in custom block docs & minor changes

* Implemented PR feedback

* Updated unit tests

* simplify docs

* package lock update

* add comment

* retreat, fallback slash command to "any"

* update packages incl prosemirror-view (#223)

* update packages incl prosemirror-view

* fix build

* fix ReactAlert + add logs

---------

Co-authored-by: yousefed <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants