Depends upon #10. We should track the key commands and put the text in the keyboard. In an ideal world it'd probably work like this:
User selects a block (or blocks).
User triggers a copy event (Cmd + C, for example).
The actual code text is copied to the clipboard (can be used to paste into other contexts!).
If the user pastes code into the editor then we check:
We attempt to parse the pasted text and convert it into a block, giving an error if it doesn't work.
If there is a current selection we insert the block after the current selection. (Or maybe replace it?)
If there is no selection then we append the new blocks to the end of the editor.
It seems as if the best way to achieve this will be to have some sort of hidden textarea that is auto-focused and selected. Not sure how feasible this is.
Also, it's not clear how this interaction would work on a mobile device! We'd need some bit of UI to trigger this interaction.
Depends upon #10. We should track the key commands and put the text in the keyboard. In an ideal world it'd probably work like this:
It seems as if the best way to achieve this will be to have some sort of hidden textarea that is auto-focused and selected. Not sure how feasible this is.
Also, it's not clear how this interaction would work on a mobile device! We'd need some bit of UI to trigger this interaction.