-
-
Notifications
You must be signed in to change notification settings - Fork 370
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* suggestion * Fixed block type dropdown API and small refactor --------- Co-authored-by: Matthew Lipski <matthewlipski@gmail.com>
- Loading branch information
1 parent
e00fe19
commit b155874
Showing
41 changed files
with
136 additions
and
143 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
10 changes: 7 additions & 3 deletions
10
examples/02-ui-components/side-menu-buttons/CustomSideMenu.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,17 @@ | ||
import { DragHandle, SideMenuProps, SideMenuWrapper } from "@blocknote/react"; | ||
import { | ||
DragHandle, | ||
SideMenu, | ||
SideMenuProps, | ||
} from "@blocknote/react"; | ||
import "@blocknote/react/style.css"; | ||
|
||
import { CustomButton } from "./CustomButton"; | ||
|
||
export function CustomSideMenu(props: SideMenuProps) { | ||
return ( | ||
<SideMenuWrapper> | ||
<SideMenu {...props}> | ||
<CustomButton {...props} /> | ||
<DragHandle {...props} /> | ||
</SideMenuWrapper> | ||
</SideMenu> | ||
); | ||
} |
6 changes: 3 additions & 3 deletions
6
examples/02-ui-components/side-menu-drag-handle-items/CustomDragHandleMenu.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,21 @@ | ||
import { | ||
BlockColorsButton, | ||
DragHandleMenu, | ||
DragHandleMenuItem, | ||
DragHandleMenuProps, | ||
DragHandleMenuWrapper, | ||
RemoveBlockButton, | ||
} from "@blocknote/react"; | ||
import "@blocknote/react/style.css"; | ||
|
||
export function CustomDragHandleMenu(props: DragHandleMenuProps) { | ||
return ( | ||
<DragHandleMenuWrapper {...props}> | ||
<DragHandleMenu {...props}> | ||
<RemoveBlockButton {...props}>Delete</RemoveBlockButton> | ||
<BlockColorsButton {...props}>Colors</BlockColorsButton> | ||
{/*Custom item which opens an alert when clicked.*/} | ||
<DragHandleMenuItem onClick={() => window.alert("Button Pressed!")}> | ||
Open Alert | ||
</DragHandleMenuItem> | ||
</DragHandleMenuWrapper> | ||
</DragHandleMenu> | ||
); | ||
} |
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 was deleted.
Oops, something went wrong.
4 changes: 3 additions & 1 deletion
4
packages/react/src/components/FormattingToolbar/FormattingToolbarProps.ts
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,3 +1,5 @@ | ||
import { BlockTypeDropdownItem } from "./mantine/DefaultDropdowns/BlockTypeDropdown"; | ||
|
||
export type FormattingToolbarProps = { | ||
items?: JSX.Element[]; | ||
blockTypeDropdownItems?: BlockTypeDropdownItem[]; | ||
}; |
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
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
Oops, something went wrong.