Repository navigation
Conversation
This branch has not been deployed
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.
Hello 👋 , this is my first PR here. I haven't created an issue for this change, but if it's important for the process, please let me know, and I'll create an issue and leave this PR as a draft.
useClipboard().copyandCopyButtonvaluenow accept rich content, so formatted text and tables keep their formatting when pasted in Google Docs, Gmail or Slack, and stay clean plain text in a plain text editor.writeText, as beforehtmlis copied withclipboard.writeas bothtext/htmlandtext/plainhtml, or a browser withoutClipboardItem/clipboard.write, falls back towriteText(text)clipboard.writeis called synchronously incopy, which is required by Safaricopiedanderrorfollow the result of the write, including the reset ofcopiedon error from [@mantine/hooks] use-clipboard: Reset copied state on error #9310ClipboardValueandClipboardRichValuetypes are exported from@mantine/hooksNote:
copywas typed as(value: any) => void, it is now typed withClipboardValue. Runtime behavior for strings does not change, but TypeScript code passing a non-string value will need aString()conversion.Tests: new
use-clipboardtests (string, rich content, fallbacks, function value, errors, timeout) andCopyButtontests.Docs: "Rich content" and "Copy value on click" sections on the use-clipboard page, "Rich content" section on the CopyButton page, new demos and Storybook stories.