wordpress-mobile / gutenberg-mobile

Mobile version of Gutenberg - native iOS and Android
GNU General Public License v2.0
257 stars 58 forks source link

Add Support to create Reusable Blocks #2574

Open maxme opened 4 years ago

maxme commented 4 years ago

Description

On the web version of Gutenberg, a user can pick one or more blocks and create a new "Reusable block" from it.

UI to create a reusable block:

Screenshot 2020-08-26 at 16 01 53

UI to name it:

Screenshot 2020-08-26 at 16 03 54

User documentation on wordpress.com https://wordpress.com/support/wordpress-editor/blocks/reusable-block/#create-reusable-block


This task can be separated into two parts:

  1. Create a reusable block from a single block
  2. Create a reusable block from multiple blocks

Implementation

1 - Create a reusable block from a single block

The user flow would be:

  1. Tap on a block
  2. Tap on ... button
  3. Tap on "Add to Reusable blocks" button
  4. A popup will be displayed asking the user to introduce a name for the reusable block (if no value is introduced, the default value "Untitled reusable block" will be used)
  5. The reusable block is created with the selected block as its content
  6. The block is replaced with the reusable block

2 - Create a reusable block from multiple blocks

For creating a reusable block from multiple blocks, we would require first to implement the feature of selecting multiple blocks which is not currently available. Until this feature is implemented we should put this part on hold.

fluiddot commented 3 years ago

For creating a reusable block from multiple blocks, we would require first to implement the feature of selecting multiple blocks which is not currently available and probably would be quite complex.

My idea for this task is to split it into two parts:

  1. Create a reusable block from a single block
  2. Create a reusable block from multiple blocks

Since there are no blockers for the first part, we could start implementing it and put on hold the second one until the mentioned feature is implemented.

NOTE: I'm going to update the description of the issue with this information.

guarani commented 3 years ago

For creating a reusable block from multiple blocks, we would require first to implement the feature of selecting multiple blocks which is not currently available and probably would be quite complex.

I think the option to select multiple blocks would be very useful, since we can't "select all" and select all blocks at once, deleting multiple blocks is tedious at the moment. (Of course here it would be useful for reusable blocks like you mention.)

fluiddot commented 3 years ago

For creating a reusable block from multiple blocks, we would require first to implement the feature of selecting multiple blocks which is not currently available and probably would be quite complex.

I think the option to select multiple blocks would be very useful, since we can't "select all" and select all blocks at once, deleting multiple blocks is tedious at the moment. (Of course here it would be useful for reusable blocks like you mention.)

I totally agree, the multi-selection feature would be an awesome improvement. I'm going to check if we already have an issue for this topic, if not I'll create it because I have some ideas that would be interesting to discuss 😊 .