-
-
Notifications
You must be signed in to change notification settings - Fork 457
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Separate image, hyperlink, & table components for export (#625)
* wip * Refactored image toolbar * Refactored image toolbar, hyperlink toolbar, and table handles * Implemented PR feedback * Implemented PR feedback * Implemented PR feedback * refactor: Clean up component code (#637) * Cleaned up component code * Renamed "Link" in components to "Hyperlink" * Implemented PR feedback * alternative solution for toolbar fadeout (#645) * chore: Playwright update (#640) * Updated playwright * Small fix * dont upgrade tiptap etc * fix pw install? --------- Co-authored-by: yousefed <yousefdardiry@gmail.com> * fix `setEditable` called when not necessary (#635) * Added temp fix for shortcuts and input rules in tables (#561) --------- Co-authored-by: Yousef <yousefdardiry@gmail.com> * Renamed hyperlink toolbar -> link toolbar and small changes --------- Co-authored-by: Yousef <yousefdardiry@gmail.com>
- Loading branch information
1 parent
2b01f5e
commit 434075d
Showing
85 changed files
with
1,180 additions
and
1,116 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,37 +1,37 @@ | ||
--- | ||
title: Hyperlink Toolbar | ||
description: The Hyperlink Toolbar appears whenever you hover a link in the editor. | ||
imageTitle: Hyperlink Toolbar | ||
path: /docs/hyperlink-toolbar | ||
title: Link Toolbar | ||
description: The Link Toolbar appears whenever you hover a link in the editor. | ||
imageTitle: Link Toolbar | ||
path: /docs/link-toolbar | ||
--- | ||
|
||
import { Example } from "@/components/example"; | ||
|
||
# Hyperlink Toolbar | ||
# Link Toolbar | ||
|
||
The Hyperlink Toolbar appears whenever you hover a link in the editor. | ||
The Link Toolbar appears whenever you hover a link in the editor. | ||
|
||
TODO Image | ||
|
||
[//]: # '<img style={{maxWidth: "600px"}} src="/img/screenshots/hyperlink_toolbar.png" alt="image" />' | ||
[//]: # '<img style={{maxWidth: "600px"}} src="/img/screenshots/link_toolbar.png" alt="image" />' | ||
|
||
## Changing the Hyperlink Toolbar | ||
## Changing the Link Toolbar | ||
|
||
You can change or replace the Hyperlink Toolbar with your own React component. In the demo below, a button is added to the default Hyperlink Toolbar, which opens a browser alert. | ||
You can change or replace the Link Toolbar with your own React component. In the demo below, a button is added to the default Link Toolbar, which opens a browser alert. | ||
|
||
[//]: # (<Example name="ui-components/hyperlink-toolbar-buttons" />) | ||
[//]: # (<Example name="ui-components/link-toolbar-buttons" />) | ||
|
||
We use the `HyperlinkToolbar` component to create a custom Hyperlink Toolbar. By specifying its children, we can replace the default buttons in the toolbar with our own. | ||
We use the `LinkToolbar` component to create a custom Link Toolbar. By specifying its children, we can replace the default buttons in the toolbar with our own. | ||
|
||
This custom Hyperlink Toolbar is passed to a `HyperlinkToolbarController`, which controls its position and visibility (above or below the hovered link). | ||
This custom Link Toolbar is passed to a `LinkToolbarController`, which controls its position and visibility (above or below the hovered link). | ||
|
||
Setting `hyperlinkToolbar={false}` on `BlockNoteView` tells BlockNote not to show the default Hyperlink Toolbar. | ||
Setting `linkToolbar={false}` on `BlockNoteView` tells BlockNote not to show the default Link Toolbar. | ||
|
||
<div className="nx-mt-6 nx-leading-7 first:nx-mt-0"> | ||
<small> | ||
<strong>Tip:</strong> The children you pass to the `HyperlinkToolbar` | ||
component should be default buttons (e.g. TODO) or custom dropdowns/buttons | ||
(`ToolbarDropdown` & `ToolbarButton`). To see all the components you can | ||
use, head to the [Hyperlink Toolbar's source code](link). | ||
<strong>Tip:</strong> The children you pass to the `LinkToolbar` | ||
component should be default buttons (e.g. TODO) or custom selects/buttons | ||
(`ToolbarSelect` & `ToolbarButton`). To see all the components you can | ||
use, head to the [Link Toolbar's source code](link). | ||
</small> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
examples/02-ui-components/03-formatting-toolbar-block-type-items/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,11 @@ | ||
# Adding Block Type Dropdown Items | ||
# Adding Block Type Select Items | ||
|
||
In this example, we add an item to the Block Type Dropdown, so that it works for a custom alert block we create. | ||
In this example, we add an item to the Block Type Select, so that it works for a custom alert block we create. | ||
|
||
**Try it out:** Select some text to open the Formatting Toolbar, and click "Alert" in the Block Type Dropdown to change the selected block! | ||
**Try it out:** Select some text to open the Formatting Toolbar, and click "Alert" in the Block Type Select to change the selected block! | ||
|
||
**Relevant Docs:** | ||
|
||
- [Changing Block Type Dropdown Items](/docs/ui-components/formatting-toolbar#changing-block-type-dropdown-items) | ||
- [Changing Block Type Select Items](/docs/ui-components/formatting-toolbar#changing-block-type-select-items) | ||
- [Custom Block Types](/docs/custom-schemas/custom-blocks) | ||
- [Editor Setup](/docs/editor-basics/setup) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 0 additions & 10 deletions
10
examples/02-ui-components/hyperlink-toolbar-buttons/README.md
This file was deleted.
Oops, something went wrong.
File renamed without changes.
6 changes: 3 additions & 3 deletions
6
...hyperlink-toolbar-buttons/AlertButton.tsx → ...ents/link-toolbar-buttons/AlertButton.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
# Adding Link Toolbar Buttons | ||
|
||
In this example, we add a button to the Link Toolbar which opens a browser alert. | ||
|
||
**Try it out:** Hover the link open the Link Toolbar, and click the new "Open Alert" button! | ||
|
||
**Relevant Docs:** | ||
|
||
- [Changing the Link Toolbar](/docs/ui-components/link-toolbar#changing-the-link-toolbar) | ||
- [Editor Setup](/docs/editor-basics/setup) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
...ts/hyperlink-toolbar-buttons/package.json → ...ponents/link-toolbar-buttons/package.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.