facebook / lexical

Lexical is an extensible text editor framework that provides excellent reliability, accessibility and performance.
https://lexical.dev
MIT License
17.5k stars 1.45k forks source link

added superscript and subscript buttons in playground #1945

Closed animeshk874 closed 2 years ago

animeshk874 commented 2 years ago

Adds superscript and subscript buttons in the playground. This is an extension of this PR -> https://github.com/facebook/lexical/pull/1903

Screenshot 2022-04-24 at 6 14 28 PM
facebook-github-bot commented 2 years ago

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[bot] commented 2 years ago

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 commented 2 years ago

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

trueadm commented 2 years ago

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

animeshk874 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

trueadm commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

acywatson commented 2 years ago

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

animeshk874 commented 2 years ago

@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 commented 2 years ago

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

acywatson commented 2 years ago

@trueadm are you good with this?

trueadm commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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

Screenshot 2022-04-29 at 10 27 48 AM