Skip to content
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

added superscript and subscript buttons in playground #1945

Merged
merged 14 commits into from
May 2, 2022
Merged

added superscript and subscript buttons in playground #1945

merged 14 commits into from
May 2, 2022

Conversation

animeshk874
Copy link
Contributor

@animeshk874 animeshk874 commented Apr 24, 2022

Adds superscript and subscript buttons in the playground. This is an extension of this PR -> #1903

Screenshot 2022-04-24 at 6 14 28 PM

@facebook-github-bot
Copy link
Contributor

Hi @animeshk874!

Thank you for your pull request and welcome to our community.

Action Required

In order to merge any pull request (code, docs, etc.), we require contributors to sign our Contributor License Agreement, and we don't seem to have one on file for you.

Process

In order for us to review and merge your suggested changes, please sign at https://code.facebook.com/cla. If you are contributing on behalf of someone else (eg your employer), the individual CLA may not be sufficient and your employer may need to sign the corporate CLA.

Once the CLA is signed, our tooling will perform checks and validations. Afterwards, the pull request will be tagged with CLA signed. The tagging process may take up to 1 hour after signing. Please give it that time before contacting us about it.

If you have received this in error or have any questions, please contact us at cla@fb.com. Thanks!

@vercel
Copy link

vercel bot commented Apr 24, 2022

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated
lexical ✅ Ready (Inspect) Visit Preview May 2, 2022 at 4:13AM (UTC)
lexical-playground ✅ Ready (Inspect) Visit Preview May 2, 2022 at 4:13AM (UTC)

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Apr 24, 2022
@facebook-github-bot
Copy link
Contributor

Thank you for signing our Contributor License Agreement. We can now accept your code for this (and any) Meta Open Source project. Thanks!

Copy link
Contributor

@acywatson acywatson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a problem with this - some others might have opinions on how the toolbar real estate should be used, so will let this bake for a little while and get some other eyes on it.

@@ -71,6 +71,14 @@
.PlaygroundEditorTheme__textUnderlineStrikethrough {
text-decoration: underline line-through;
}
.PlaygroundEditorTheme__textSubscript {
font-size: 12px;
vertical-align: sub !important;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why was this necessary? I'm mostly just curious.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just in case both sub and sup buttons are clicked, this will make sure that sub gets the priority. That's how it's handled here

@trueadm
Copy link
Collaborator

trueadm commented Apr 24, 2022

Can these move into another dropdown or something? They're not common enough to use up so much space on mobile.

@animeshk874
Copy link
Contributor Author

Can these move into another dropdown or something? They're not common enough to use up so much space on mobile.

Makes sense. Will do that!

@animeshk874
Copy link
Contributor Author

I don't have a problem with this - some others might have opinions on how the toolbar real estate should be used, so will let this bake for a little while and get some other eyes on it.

Sure thing. :)

@animeshk874
Copy link
Contributor Author

Can these move into another dropdown or something? They're not common enough to use up so much space on mobile.

Makes sense. Will do that!

@trueadm Should I merge Strikethrough, Sub, Sup and Link into a new dropdown and call it More? Because creating a new dropdown just for Sub and Sup will still take the same amount of space as it is taking now

@trueadm
Copy link
Collaborator

trueadm commented Apr 24, 2022

I’d maybe keep link separate but you could collapse the others. :)

@trueadm
Copy link
Collaborator

trueadm commented Apr 25, 2022

Screenshot 2022-04-26 at 00 13 48

@animeshk874 I wonder if there is a better icon to use? The three dots don't come over as formatting things? It's a minor nit, but I think we should make the toolbar as awesome as possible! :)

@animeshk874
Copy link
Contributor Author

Screenshot 2022-04-26 at 00 13 48

@animeshk874 I wonder if there is a better icon to use? The three dots don't come over as formatting things? It's a minor nit, but I think we should make the toolbar as awesome as possible! :)

Hi @trueadm! I see the problem here. I will update the icon soon. I found this icon that I think makes more sense that the 3 dots.
Screenshot 2022-04-26 at 11 37 35 AM

The problem with this is that it's used for Case transforms (uppercase, lower case etc.), but here we don't have that option. So maybe adding this icon would mean introducing text transforms in lexical?
p.s - just in case we have plans of introducing text transform to Lexical, I would be happy to work on it

@trueadm
Copy link
Collaborator

trueadm commented Apr 26, 2022

I'd be fine with that, I think. We can always change it in the future.

@animeshk874
Copy link
Contributor Author

@animeshk874 I'm not sure why these tests are failing - maybe try rebasing onto main?

Have merged main into this branch. If the tests still fail, I will look into it.

@animeshk874
Copy link
Contributor Author

@acywatson Have fixed the failing test. It was happening because the strikethrough button was moved inside a dropdown.

@acywatson
Copy link
Contributor

@trueadm are you good with this?

@trueadm
Copy link
Collaborator

trueadm commented Apr 28, 2022

I think we can drop the "More" Text from the button, right? I mean "More" Doesn't really mean anything contextually, you could argue all the other dropdowns are also "More".

@animeshk874
Copy link
Contributor Author

animeshk874 commented Apr 29, 2022

I think we can drop the "More" Text from the button, right? I mean "More" Doesn't really mean anything contextually, you could argue all the other dropdowns are also "More".

I had kept it there for maintaining consistency as all the other dropdown buttons have a text. But if you think that would be confusing, then I can remove it.

@animeshk874
Copy link
Contributor Author

animeshk874 commented Apr 29, 2022

@trueadm have removed the More text. This is how it looks right now:

Screenshot 2022-04-29 at 10 27 48 AM

@acywatson acywatson merged commit 7e20249 into facebook:main May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants