Commit ed2c337
feat: Major Extensions & UI Refactor (#2143)
* refactor(extensions): rewrite to use new extension system
* chore: minor fixes
* Refactored almost all formatting toolbar components to use `useEditorState`
* Refactored remaining uses of hooks with `useEditorState` where possible (excl. `BlockTypeSelect`)
* feat: virtual element hooks
* Refactored formatting toolbar, file panel, and suggestion menu controllers
* Fixed popover position reference not updating when it should & fixed formatting toolbar items
* Cleaned up hooks
* - Cleaned up refactored UI plugins
- Fixed `useDismiss` not working on mouse click outside
- Cleaned up `LinkToolbarController`
- Made `BlockPopover` use actual block element as reference instead of virtual element
- Added more configuration props to `GenericPopover`
- Made `GenericPopover` set element reference when a real element, or virtual element with `contextElement`, is passed
- Added editor DOM element as `contextElement` in `PositionPopover`
* Refactored side menu & fixed issue with `GenericPopover` memoized `innerHTML` not getting updated
* Comment edit
* Fixed core build
* Misc fixes
* Small fix
* Refactored table handles
* Fixed various build & UI issues
* Fixed various UI issues
* Fixed link creation/editing throwing error
* Refactored comments
* chore: update prosemirror versions
* fix: y-prosemirror plugin ordering
* Updated comments to fully use new components APIs
* chore: fix build
* build: get multi-column building again
* refactor: rewrite the AI extension to use the new plugin API
* fix: make mounting and unmounting extensions actually work properly
* Fixed z-index clipping issues
* refactor: normalize extension naming no longer plugins
* refactor: always turn a DOMRect into JSON for easy comparisons
* refactor: change imports of extensions to be found at `@blocknote/core/extensions`
* fix: use an abort signal instead of sending an abortcontroller
* chore: fix circular import
* chore: use any blocknote editor
* refactor: less derived state
* refactor: rename `usePlugin` -> `useExtension`
* refactor: remove class member
* refactor: rename `plugins` -> `prosemirrorPlugins` and `init` -> `mount`
* Fixed suggestion menus closing when clicking scroll bar
* fix: always pull the latest extensions in React
* Fixed table handle issues
* add comments
* Fixed most remaining table handle issues
* fix: formatting toolbar, comments + cleanup
* refactor: filepanel unsubs it's listeners
* Fixed build
* refactor: rewrite how extensions work
* chore: fix lint
* Fixed formatting & link toolbar issues
* Small fix
* refactor: PR comments
* Small fix
* fix: handle collaboration again
* refactor: remove resolveUsers from editor
* refactor: cleanup some more off the editor
* remove zustand dep
* refactor: move comments to their sub-package
* refactor: rename extensions to have `Extension` suffix
* refactor: delete some un-used hooks
* fix: remove comments options from the editor instance
* Fixed suggestion menu issues
* Misc changes/fixes
* Small fix
* fix: put back menu handling
* Removed logs
* refactor(comments): make extension use store exclusively
* fix: break circular import
* fix: remove `onCreate` event since it is not needed with current system
* Formatting toolbar and file panel fixes
* test: add some checks for tests
* fix: use correct key
* Fixed tests
* Fixed collab tests
* test: fixes for test running
* test: get all unit tests passing again
* chore: fix lint
* build: lint depends on nothing
* Refactored/tested/fixed AI menu and other misc changes
* fix: use a single prosemirror plugin instance for all inputRules
* Fixed block keyboard shortcuts not getting registered and local unit test errors
* Updated e2e snaps
* Fixed e2e tests
* Updated e2e screenshot
* Fixed create link button not showing editor selection
* Fixed `SideMenu`/`BlockPositioner` updating bug
* Minor changes
* Fixed issues when editor is not editable
* Added comment
* small fix to aimenu
* Misc fixes after review
* Fixed build
* Updated docs
* Changed file panel extension state from object with block ID string to just block ID string
* Moved all `DOMRect` caching logic to `GenericPopover`
---------
Co-authored-by: Matthew Lipski <matthewlipski@gmail.com>
Co-authored-by: yousefed <yousefdardiry@gmail.com>1 parent 4a34907 commit ed2c337
File tree
337 files changed
+7248
-7849
lines changed- docs
- content/docs
- features
- ai
- reference/editor
- examples
- 01-basic/03-multi-column/src
- 03-ui-components
- 02-formatting-toolbar-buttons/src
- 11-uppy-file-panel/src
- 13-custom-ui/src
- 16-link-toolbar-buttons/src
- 05-interoperability
- 05-converting-blocks-to-pdf/src
- 06-converting-blocks-to-docx
- src
- 07-converting-blocks-to-odt/src
- 08-converting-blocks-to-react-email/src
- 06-custom-schema
- 04-pdf-file-block/src
- 05-alert-block-full-ux/src
- 07-collaboration
- 05-comments/src
- 06-comments-with-sidebar/src
- 08-forking/src
- 09-ai
- 01-minimal
- src
- 02-playground
- src
- 04-with-collaboration
- src
- 05-manual-execution
- src
- 06-client-side-transport
- src
- 07-server-promptbuilder
- src
- packages
- ariakit/src/popover
- core
- src
- api/nodeConversions
- blocks
- Code
- Divider
- File/helpers/render
- Heading
- ListItem
- BulletListItem
- CheckListItem
- NumberedListItem
- ToggleListItem
- PageBreak
- Paragraph
- Quote
- Table
- ToggleWrapper
- comments
- models
- userstore
- editor
- managers
- ExtensionManager
- extensions
- BlockChange
- Collaboration
- schemaMigration
- Comments
- DropCursor
- FilePanel
- FormattingToolbar
- History
- LinkToolbar
- NodeSelectionKeyboard
- Placeholder
- PreviousBlockType
- ShowSelection
- SideMenu
- SuggestionMenu
- TableHandles
- TrailingNode
- tiptap-extensions
- BackgroundColor
- HardBreak
- KeyboardShortcuts
- Suggestions
- TextAlignment
- TextColor
- UniqueID
- schema
- blocks
- util
- mantine/src/popover
- react
- src
- blocks
- File/helpers/render
- ToggleWrapper
- components
- Comments
- FilePanel
- DefaultTabs
- FormattingToolbar
- DefaultButtons
- DefaultSelects
- LinkToolbar
- DefaultButtons
- Popovers
- SideMenu
- DefaultButtons
- DragHandleMenu
- DefaultItems
- SuggestionMenu
- GridSuggestionMenu
- TableHandles
- ExtendButton
- TableCellMenu
- DefaultButtons
- TableHandleMenu
- DefaultButtons
- editor
- hooks
- schema
- server-util/src/context
- shadcn/src/popover
- xl-ai
- src
- api/formats
- json/tools
- tests
- components
- AIMenu
- FormattingToolbar
- SuggestionMenu
- prosemirror
- testUtil/cases
- editors
- xl-docx-exporter
- xl-multi-column/src/extensions
- ColumnResize
- SuggestionMenu
- xl-odt-exporter
- xl-pdf-exporter
- playground
- src
- tests
- src
- end-to-end
- 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
- unit/core/schema/__snapshots__
- utils
- components
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
337 files changed
+7248
-7849
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| 29 | + | |
29 | 30 | | |
30 | | - | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
| 43 | + | |
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | 55 | | |
64 | 56 | | |
65 | 57 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
17 | | - | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
| 20 | + | |
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
| |||
35 | 35 | | |
36 | 36 | | |
37 | 37 | | |
38 | | - | |
| 38 | + | |
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
44 | | - | |
45 | | - | |
46 | | - | |
| 44 | + | |
47 | 45 | | |
48 | 46 | | |
49 | | - | |
| 47 | + | |
50 | 48 | | |
51 | 49 | | |
52 | 50 | | |
| |||
68 | 66 | | |
69 | 67 | | |
70 | 68 | | |
71 | | - | |
| 69 | + | |
72 | 70 | | |
73 | 71 | | |
74 | 72 | | |
75 | 73 | | |
76 | 74 | | |
77 | | - | |
| 75 | + | |
78 | 76 | | |
79 | 77 | | |
80 | 78 | | |
81 | 79 | | |
82 | 80 | | |
83 | 81 | | |
84 | | - | |
| 82 | + | |
85 | 83 | | |
86 | 84 | | |
87 | 85 | | |
| |||
95 | 93 | | |
96 | 94 | | |
97 | 95 | | |
98 | | - | |
| 96 | + | |
99 | 97 | | |
100 | 98 | | |
101 | 99 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | 19 | | |
31 | 20 | | |
32 | 21 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | | - | |
| 80 | + | |
81 | 81 | | |
82 | 82 | | |
83 | 83 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
Lines changed: 6 additions & 13 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | | - | |
9 | 8 | | |
10 | 9 | | |
11 | 10 | | |
| |||
14 | 13 | | |
15 | 14 | | |
16 | 15 | | |
17 | | - | |
18 | | - | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
25 | 19 | | |
26 | | - | |
27 | | - | |
28 | | - | |
| 20 | + | |
| 21 | + | |
29 | 22 | | |
30 | 23 | | |
31 | 24 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
42 | | - | |
| 42 | + | |
43 | 43 | | |
44 | 44 | | |
45 | 45 | | |
| |||
Lines changed: 13 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
1 | 3 | | |
2 | | - | |
3 | 4 | | |
4 | 5 | | |
| 6 | + | |
5 | 7 | | |
6 | 8 | | |
7 | 9 | | |
8 | 10 | | |
9 | | - | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
14 | 24 | | |
15 | 25 | | |
16 | 26 | | |
17 | 27 | | |
18 | 28 | | |
19 | 29 | | |
20 | 30 | | |
21 | | - | |
| 31 | + | |
22 | 32 | | |
23 | 33 | | |
24 | 34 | | |
| |||
Lines changed: 5 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
7 | | - | |
8 | 7 | | |
9 | 8 | | |
10 | 9 | | |
| |||
16 | 15 | | |
17 | 16 | | |
18 | 17 | | |
19 | | - | |
20 | | - | |
21 | | - | |
22 | | - | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
23 | 22 | | |
24 | | - | |
| 23 | + | |
25 | 24 | | |
26 | 25 | | |
27 | 26 | | |
| |||
0 commit comments