New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Copy to clipboard all text nodes as text #5013
Conversation
Fausto95
commented
Apr 5, 2022
•
edited
edited
This pull request is being automatically deployed with Vercel (learn more). excalidraw – ./🔍 Inspect: https://vercel.com/excalidraw/excalidraw/8pVQvPsV7mqTxtGEdKHxa6M1cCXm excalidraw-package-example – ./src/packages/excalidraw🔍 Inspect: https://vercel.com/excalidraw/excalidraw-package-example/EpP6u8L3CN8hxWq7QwrVgMpwyyu6 |
src/components/App.tsx
Outdated
if (probablySupportsClipboardWriteText && elements.length > 0) { | ||
options.push(copyAllTextNodesAsText); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
we should show this option only for text elements
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd show for any selection that contains at least 1 text element.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe that is better to show it only when all the elements are text nodes
src/locales/en.json
Outdated
@@ -9,6 +9,7 @@ | |||
"copy": "Copy", | |||
"copyAsPng": "Copy to clipboard as PNG", | |||
"copyAsSvg": "Copy to clipboard as SVG", | |||
"copyAllTextNodesAsText": "Copy to clipboard all nodes as text", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"copyAllTextNodesAsText": "Copy to clipboard all nodes as text", | |
"copyAllTextNodesAsText": "Copy to clipboard as a single text element", |
better renaming?
353fa0c
to
0fd42c9
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good, thanks @Fausto95 ❤️
Actually, this isn't working quite right.
Haven't reviewed the code itself. |
I'd also put |
Oh yea, you're right. I'll make a follow up PR |