How to get block id on block add & edit form? Blocks are plugin in Drupal-8, I need to add a form element in the block add form &amp; all the block edit forms. 
I am able to add the new form element in the form by form alter. But i need to get the block id on submit(custom submit handler). For block add forms block id has to be new block created &amp; for block edit form, the existing block id.

How can i get the block id?
Have a lookt at Extend Block Class and my answer there about the block_class module.

It does exactly the same to add configurable CSS classes to blocks.