Merged
Conversation
JiuqingSong
reviewed
Jul 24, 2023
| applyCurrentFormat?: boolean, | ||
| pasteAsImage?: boolean | ||
| pasteAsImage?: boolean, | ||
| nativePaste?: boolean |
Collaborator
There was a problem hiding this comment.
Instead of adding new parameter here, how about put it into ClipboardData, so that we don't polute this function interface.
| applyCurrentStyle: boolean, | ||
| pasteAsImage: boolean | ||
| pasteAsImage: boolean, | ||
| nativePaste: boolean |
| /** | ||
| * If true, the event was triggered by a native paste event (keyboard or native context menu paste) | ||
| */ | ||
| readonly pasteNativeEvent: boolean; |
Collaborator
There was a problem hiding this comment.
Move to ClipboardData, then no need to change here
| false /*pasteAsText*/, | ||
| false /*applyCurrentStyle*/, | ||
| false /*pasteAsImage*/, | ||
| true /*nativePaste */ |
Collaborator
There was a problem hiding this comment.
Move to ClipboardData, then set this value when extractClipboardItems()
…u/juliaroldi/rooster-paste
d893fc6 to
50b7dce
Compare
JiuqingSong
reviewed
Jul 24, 2023
| /** | ||
| * If true, the event was triggered by a native paste event (keyboard or native context menu paste) | ||
| */ | ||
| readonly pasteNativeEvent: boolean; |
Collaborator
There was a problem hiding this comment.
Make any new property optional, to be compatible with older build
JiuqingSong
reviewed
Jul 24, 2023
| options?: ExtractClipboardEventOption, | ||
| rangeBeforePaste?: Range | ||
| rangeBeforePaste?: Range, | ||
| pasteNativeEvent: boolean = false |
Collaborator
There was a problem hiding this comment.
When there is ClipboardEvent, it must be from native paste, so no need to provide this parameter here, and always pass true
| dataTransfer: DataTransfer, | ||
| callback: (data: ClipboardData) => void, | ||
| options?: ExtractClipboardItemsForIEOptions | ||
| options?: ExtractClipboardItemsForIEOptions, |
Collaborator
There was a problem hiding this comment.
IE is deprecated. So no need to change this file any more
JiuqingSong
approved these changes
Jul 24, 2023
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The pasteNativeEvent was created in the BeforePasteEvent object, so it is possible to differentiate a paste event triggered by RoosterJS api and paste event from browser (keyboard shortcut and native context menu).

A paste button was added to ContentModel ribbon and a log was added in EventViewer Pane.
Paste control:
If the paste event was triggered by a native event:

If the event was triggered by paste control:
