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

Blocks converter #704

Closed
5 tasks done
neSpecc opened this issue Apr 9, 2019 · 8 comments
Closed
5 tasks done

Blocks converter #704

neSpecc opened this issue Apr 9, 2019 · 8 comments
Assignees

Comments

@neSpecc
Copy link
Member

neSpecc commented Apr 9, 2019

Need to provide ability of convertation one block into another.

  • Add new Tools API (static?) getter convertationConfig that will specify 2 properties: export and import.

export — value of what field should be used to covert this tool to other
import — in which field of tool's data we should put a content exported from original block.

class Header {
  constructor(){
    this.data = {
       text: '',
       level: 2
    }
  }

  get convertationConfig(){
    return {
       export: 'text'
       import: 'text',
    }
  }
}
  • Some tools may have complex data structure, for example List, so maybe export and import can be a function, in addition to string tokens. In this case, the function accepts saved data and return a string-value to export.

  • If current block's Tool has an export value, add the converter dropdown to the inline toolbar

  • At the converter dropdown, place all tools that specified import value

  • By clicking on converter tool, save original block, extract an export field and switch this block with the new one passing extracted value through the import field

@rtpHarry
Copy link

im new here so not sure if convertation is a quirky concept or a mistranslation.

I would expect it to be "conversion".

@neSpecc
Copy link
Member Author

neSpecc commented Apr 23, 2019

UI is ready.

Mechanics

There is no dropdowns at the Inline Toolbar (unlike Notion). Also, there is no Block tools at the Inline Toolbar (unlike Medium and Paper) because they affects the whole Block, not a selected fragment.

  • Need to create the new Block Converter Toolbar that looks like Toolbox but without Plus Button and with background/border etc like Inline Toolbar.
  • Block Converter Toolbar should be shown when user selects the whole Block by CMD+A
  • Block Converter Toolbar should be shown when user selects more that 95% of blocks content.
  • Current Block's type is highlighted
  • Paragraph tool should be added to the Toolbar (icon required)

@neSpecc neSpecc assigned khaydarov and unassigned gohabereg May 24, 2019
@neSpecc
Copy link
Member Author

neSpecc commented May 30, 2019

Related #687

@aponski
Copy link

aponski commented Jun 27, 2019

Hi, any estimates on 2.15 release dates? Waiting for conversion tool :)

@neSpecc
Copy link
Member Author

neSpecc commented Jun 27, 2019

@aponski will be released next week.

@gohabereg
Copy link
Member

Resolved by #826

@alexey13
Copy link

alexey13 commented Aug 7, 2019

Here is the use case when we have problems with 95%: only one line in a paragraph with marker inline component for example. Its impossible to implement because if we select that line we will see only block tools but we want to make a one-line marker in a paragraph. Why we need a paragraph? Its perfect for aligning content left-center-right-justify.
23123
3123123

@neSpecc
Copy link
Member Author

neSpecc commented Aug 8, 2019

@alexey13 can you create an issue based on this case? We will think about it.

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

No branches or pull requests

6 participants