Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(extension-events): add
contextmenu
and hover
- Loading branch information
Showing
21 changed files
with
164 additions
and
56 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
--- | ||
'@remirror/extension-events': patch | ||
--- | ||
|
||
Prevent `hover` and `contextmenu` events from automatically calling `preventDefault()` when intercepted. |
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,5 @@ | ||
--- | ||
'@remirror/extension-code-block': minor | ||
--- | ||
|
||
Add support for `wrap` option. This determines whether text in the code block will wrap at the end of the line. |
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,5 @@ | ||
--- | ||
'@remirror/extension-events': minor | ||
--- | ||
|
||
Add type signatures for each of the `EventHandler` events to `EventsExtension`. |
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,5 @@ | ||
--- | ||
'@remirror/react-hooks': major | ||
--- | ||
|
||
Rename `useEvents` to `useEvent` which is a more accurate depiction of what the hook does. |
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,5 @@ | ||
--- | ||
'@remirror/react-hooks': minor | ||
--- | ||
|
||
Add `useContextMenu` and `useHover` hooks. |
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,11 +1,22 @@ | ||
export type { | ||
BlurEventHandler, | ||
ClickEventHandler, | ||
ClickHandler, | ||
ClickHandlerState, | ||
ClickMarkEventHandler, | ||
ClickMarkHandler, | ||
ClickMarkHandlerState, | ||
ContextMenuEventHandler, | ||
CreateEventHandlers, | ||
EventsOptions, | ||
FocusEventHandler, | ||
HoverEventHandler, | ||
HoverEventHandlerProps, | ||
MousedownEventHandler, | ||
MouseenterEventHandler, | ||
MouseEventHandlerProps, | ||
MouseleaveEventHandler, | ||
MouseupEventHandler, | ||
ScrollEventHandler, | ||
} from './events-extension'; | ||
export { EventsExtension } from './events-extension'; |
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,14 @@ | ||
import { ContextMenuEventHandler } from '@remirror/extension-events'; | ||
|
||
import { useEvent } from './use-event'; | ||
|
||
/** | ||
* A hook which listens to context menu events. | ||
* | ||
* In order to fully override the context menu events when they occur in the | ||
* editor make sure to call `event.preventDefault()` this will allow you to | ||
* replace the default context menu with your own version. | ||
*/ | ||
export function useContextMenu(handler: ContextMenuEventHandler): void { | ||
useEvent('contextmenu', handler); | ||
} |
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.