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

feat: added alignment tune #1272

Closed
wants to merge 2 commits into from

Conversation

semoal
Copy link

@semoal semoal commented Aug 11, 2020

Hello guys, i've introduced a starter for block aligment.

2020-08-11 17 00 19

Actually the classes are just text-align, probably this should work for 90% of cases, but for some images, probably we'll need better styles like flex, or align-self.

I'm open to criticism, first time contributing and I've been a bit lost at the start.

@gohabereg
Copy link
Member

Hi @semoal !
Thank you for your contribution! Do you think alignment should be on the core level? Isn't it related to a Tool itself?

@semoal
Copy link
Author

semoal commented Aug 13, 2020

Hi @semoal !
Thank you for your contribution! Do you think alignment should be on the core level? Isn't it related to a Tool itself?

Well actually, for me the best approach would be a tune extension that can be loaded for x tool, for ex:

I load the alignment tune to -> paragraph, text, and list tools.

But i'm not sure if the api is allowed to do that with a lot of change, that's why I tough if we implement this on the core, but customizable, like a config option:

var editor = new EditorJS({
      holder: 'editorjs',
      tunes: {
       aligment: {
           enabled: [header, paragraph, list, table, ....] // any tool that can be aligned.
         }
     },
      tools: {
        header: {
          class: Header,
          inlineToolbar: ['link'],
          config: {
            placeholder: 'Header'
          },
          shortcut: 'CMD+SHIFT+H'
        },

@neSpecc
Copy link
Member

neSpecc commented Aug 18, 2020

I think, these tools should be implemented as separate Block Tunes plugins when the Block Tunes API will be released

@neSpecc neSpecc added the viewed label Aug 18, 2020
@semoal
Copy link
Author

semoal commented Aug 18, 2020

I think, these tools should be implemented as separate Block Tunes plugins when the Block Tunes API will be released

Should i help on opening the API?

@gohabereg
Copy link
Member

Hi @semoal
Your help is welcome!
Work on Tunes API was freezed so it should be reviewed and designed considering the changes. If you are ready to contribute I'm glad to help.

I'm closing this PR as this functionality definitely should be implemented by plugins or via Tunes API

@gohabereg gohabereg closed this Aug 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants