Commit ed772f1
feature: v0.10: tables, custom inline content, custom styles, better copy / paste handling (#426)
* feat: Custom block serialization (#257)
* Added serialization for vanilla custom blocks
* Added serialization for React custom blocks
* Cleaned up serializer implementation - no longer uses function override
* Revert "Cleaned up serializer implementation - no longer uses function override"
This reverts commit b4f3fb6.
* Removed comment
* Added ability to set custom serialization and parse functions for custom blocks (parse still WIP)
* Fixed build and most runtime issues
* Added `react-dom` dependency
* Added PoC copy/paste handling
* Small changes & fixes
* Added serialization tests
* Changed copy/paste implementation
* Small fix
* Implemented PR feedback
* Converted styles from modules to regular CSS
* Implemented PR feedback
* Updated serialization test snapshots
* Updated serialization tests to use BlockNote API
* Commented out custom block parsing code (out of scope for this PR)
* Improved `nodeToBlock` typing
* Small fixes
* Fixed `destroy` function not getting passed to TipTap node view
* Updated comment regarding clipboard issues
* Major restructure of copy/paste code
* Reduced code duplication for HTML serializer & exporter
* Implemented PR feedback & cleaned up CSS class names
* Updated serialization unit test snapshots
* Changed `DOMOutputSpec` implementation for default blocks
* Fixed some CSS issues
* Implemented PR feedback
* Reverted `nodeToBlock` typing
* Made external HTML conversions no longer `async` and fixed Firefox clipboard reading
* Fixed image test issues and small changes
* Fixed remaining image test issues
* Updated serialization unit test snapshots
* Excluded `formatConversions` test
* Fixed HTML export for custom blocks with inline content
* Fixed duplicate `blockContainer` attributes getting added to custom blocks' `blockContent` nodes from color default props and changed `toExternalHTML` typing for React custom blocks
* Added React serialization unit tests and extra vanilla tests
* Updated image e2e snapshots
* Small e2e test fix
* Added comments
* Fixed error when copying only nested blocks
* refactor types for blocks (#412)
* refactor types for blocks
* remove unused comment
* fix test
* run tests on all branches
* fix build
* change BlockFromBlockConfig to Block
* simplify customblockconfig
* rename BlockImplementation to TiptapBlockImplementation
* fix build
* add comment
* feat: tables (#413)
* fix table types
* add tablecontent
* clean BNUpdateBlock
* add partial inline content
* add contentNodeToTableContent
* first draft of tablehandles
* implement table functions
* fix styles
* fix imports
* create separate TableExtension
* improve types
* test some types
* Fixed setting selection for table blocks
* Fixed backspace deleting table if at start of cell
* small code fixes
* Implemented PR feedback
* Improved table row/column drag & drop UX
* Fixed table menus moving around, drag indicator flakiness, menu z-index issues, and drag preview
* Implemented PR feedback
* Implemented PR feedback
* Fixed drag handles sometimes not showing
* Fixed scrolling behaviour
* Small fixes
* Fixed table handles UI
* Fixed remaining UX/UI issues
* Removed redundant state from table handles plugin
* Implemented table drag & drop logic
* Added table enter handling
* Small fix
* feat: custom styles and custom inline content (#418)
* wip custom styles
* fix
* fix tests
* simplify PartialInlineContent
* custom inline content
* clean nodeconversions test
* streamline tests
* update tests
* move schema files
* add custom style test
* inline content + tests
* misc
* clean imports
* fix react tests
* add react nodeconversions tests
* move tests and add test for ReactStyles
* fix react tests
* basis of new examples
* add react examples
* fix bug
* misc fixes
* wip
* clean
* small cleanup
* add comments
* move funcs
* fix tests
* address PR feedback
* fix inline content types
* feat: HTML paste handling (#422)
* refactor parse
* fix parse-divsc
* add test case
* add extra test (that should be fixed)
* readd markdown functions
* fix tests
* remove unused file
* remove comments
* add comment
* nested list handling
* add todos
* added comment
* use refs for blocks (#424)
* use refs for blocks
* update react htmlConversion test
* Custom inline content and styles commands/copy & paste fixes (#425)
* Fixed commands and internal copy/paste for inline content
* Fixed internal copy/paste for styles
* Small cleanup
* fix some tests
---------
Co-authored-by: yousefed <yousefdardiry@gmail.com>
---------
Co-authored-by: Matthew Lipski <50169049+matthewlipski@users.noreply.github.com>
* use processSync
---------
Co-authored-by: Matthew Lipski <50169049+matthewlipski@users.noreply.github.com>
* fix build
---------
Co-authored-by: Matthew Lipski <50169049+matthewlipski@users.noreply.github.com>
---------
Co-authored-by: Matthew Lipski <matthewlipski@gmail.com>
Co-authored-by: Matthew Lipski <50169049+matthewlipski@users.noreply.github.com>
---------
Co-authored-by: Matthew Lipski <matthewlipski@gmail.com>
Co-authored-by: Matthew Lipski <50169049+matthewlipski@users.noreply.github.com>
---------
Co-authored-by: Yousef <yousefdardiry@gmail.com>
* fix: change parse function to only return props
* fix lint
* add comment
* Made block, inline content, and style content get parsed from `contentDOM` instead of `dom`
* Small fixes
* Fixed table enter handling
* Updated unit tests
* Fixed parsing error when `dom` is same as `contentDOM` (#429)
* Fixed parsing error for styles/inline content where `dom` was the same as `contentDOM`
* Updated react snapshots
* Playground custom elements (#430)
* Added playgrounds for vanilla blocks, React blocks, and vanilla inline content
* fix renderHTML error
* clean examples
---------
Co-authored-by: yousefed <yousefdardiry@gmail.com>
* Add markdown tests (#428)
* update docs
* add markdown tests
* remove unused file
* add missing space to mention tests
* move and update playwright tests (#427)
* move and update playwright tests
* fix build
* fix test setup
* fix pw config
* fix test command
* Playwright refactor fixes (#436)
* Fixed issues with most tests
* Temporarily commented out failing unit test
* Temporarily commented out failing unit test
* Fixed remaining failing playwright tests
* Re-added test that was causing issues
* re-add tests
* add pw-report
* skip tests and edit css
* revert style
* add logs
* fix unit tests
---------
Co-authored-by: yousefed <yousefdardiry@gmail.com>
---------
Co-authored-by: Matthew Lipski <50169049+matthewlipski@users.noreply.github.com>
* Block backspace key event at start of custom editable inline content (#435)
* Fixed parsing error for styles/inline content where `dom` was the same as `contentDOM`
* Updated react snapshots
* Blocked backspace at start of custom editable inline content
* add comment
---------
Co-authored-by: yousefed <yousefdardiry@gmail.com>
* fix empty table content
* update comments
* extract transformPasted
* widen slashmenu typings
* Updated docs for custom blocks and added tables (#442)
---------
Co-authored-by: Matthew Lipski <50169049+matthewlipski@users.noreply.github.com>
Co-authored-by: Matthew Lipski <matthewlipski@gmail.com>1 parent a4e8f80 commit ed772f1
File tree
615 files changed
+16941
-5421
lines changed- .github/workflows
- examples
- editor
- examples
- basic
- collaboration
- react-custom-blocks
- react-custom-inline-content
- react-custom-styles
- vanilla-custom-blocks
- vanilla-custom-inline-content
- vanilla-custom-styles
- src
- vanilla/src
- ui
- packages
- core
- src
- api
- blockManipulation
- exporters
- html
- __snapshots__
- complex/misc
- customParagraph
- basic
- nested
- styled
- fontSize/basic
- hardbreak
- basic
- between-links
- end
- link
- multiple
- only
- start
- styles
- image
- basic
- button
- nested
- link
- adjacent
- basic
- styled
- mention/basic
- paragraph
- basic
- empty
- nested
- styled
- paste
- simpleCustomParagraph
- basic
- nested
- styled
- simpleImage
- basic
- button
- nested
- small/basic
- tag/basic
- util
- markdown
- __snapshots__
- complex/misc
- customParagraph
- basic
- nested
- styled
- fontSize/basic
- hardbreak
- basic
- between-links
- end
- link
- multiple
- only
- start
- styles
- image
- basic
- button
- nested
- link
- adjacent
- basic
- styled
- mention/basic
- paragraph
- basic
- empty
- nested
- styled
- simpleCustomParagraph
- basic
- nested
- styled
- simpleImage
- basic
- button
- nested
- small/basic
- tag/basic
- formatConversions
- __snapshots__
- nodeConversions
- __snapshots__
- parsers
- html
- __snapshots__/paste
- util
- __snapshots__
- markdown
- __snapshots__
- testUtil
- cases
- blocks
- HeadingBlockContent
- ImageBlockContent
- ListItemBlockContent
- BulletListItemBlockContent
- NumberedListItemBlockContent
- ParagraphBlockContent
- TableBlockContent
- editor
- extensions
- BackgroundColor
- Blocks
- api
- helpers
- nodes
- BlockContent
- HeadingBlockContent
- ParagraphBlockContent
- FormattingToolbar
- HyperlinkToolbar
- ImageToolbar
- NonEditableBlocks
- Placeholder
- PreviousBlockType
- SideMenu
- SlashMenu
- TableHandles
- TextAlignment
- TextColor
- UniqueID
- pm-nodes
- schema
- blocks
- inlineContent
- styles
- util
- react
- src
- SideMenu/components
- DragHandleMenu
- SlashMenu
- components
- FormattingToolbar
- DefaultButtons
- DefaultDropdowns
- HyperlinkToolbar
- EditHyperlinkMenu/components
- ImageToolbar
- SideMenu
- DefaultButtons
- DragHandleMenu
- DefaultButtons
- SlashMenu
- TableHandles
- TableHandleMenu
- DefaultButtons
- editor
- hooks
- schema
- @util
- slashMenuItems
- test
- __snapshots__
- fontSize/basic
- mention/basic
- reactCustomParagraph
- basic
- nested
- styled
- simpleReactCustomParagraph
- basic
- nested
- styled
- small/basic
- tag/basic
- testCases
- website/docs
- docs
- examples
- public/img/screenshots
- tests
- end-to-end
- images/images.test.ts-snapshots
- theming/theming.test.ts-snapshots
- playwright
- src
- component
- snapshots
- copypaste-external.spec.tsx-snapshots
- copypaste-internal.spec.tsx-snapshots
- end-to-end
- basics
- colors
- colors.test.ts-snapshots
- copypaste
- copypaste.test.ts-snapshots
- dragdrop
- dragdrop.test.ts-snapshots
- draghandle
- draghandle.test.ts-snapshots
- images
- images.test.ts-snapshots
- indentation
- indentation.test.ts-snapshots
- keyboardhandlers
- keyboardhandlers.test.ts-snapshots
- placeholder
- placeholder.test.ts-snapshots
- textalignment
- textAlignment.test.ts-snapshots
- theming
- theming.test.ts-snapshots
- setup
- types
- utils
- components
- customblocks
- utils/customblocks
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
615 files changed
+16941
-5421
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
1 | 5 | | |
2 | 6 | | |
3 | 7 | | |
| |||
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
11 | 27 | | |
12 | 28 | | |
13 | 29 | | |
| |||
22 | 38 | | |
23 | 39 | | |
24 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
25 | 56 | | |
26 | 57 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | | - | |
10 | | - | |
11 | 8 | | |
12 | 9 | | |
13 | 10 | | |
| |||
70 | 67 | | |
71 | 68 | | |
72 | 69 | | |
| 70 | + | |
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
77 | 75 | | |
78 | 76 | | |
79 | | - | |
| 77 | + | |
80 | 78 | | |
81 | 79 | | |
82 | 80 | | |
| |||
Lines changed: 4 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
| 1 | + | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
9 | | - | |
| 7 | + | |
10 | 8 | | |
11 | | - | |
12 | | - | |
13 | | - | |
14 | 9 | | |
15 | 10 | | |
16 | | - | |
| 11 | + | |
17 | 12 | | |
18 | 13 | | |
19 | 14 | | |
| |||
23 | 18 | | |
24 | 19 | | |
25 | 20 | | |
26 | | - | |
| 21 | + | |
27 | 22 | | |
28 | 23 | | |
29 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
0 commit comments