webiny-js icon indicating copy to clipboard operation
webiny-js copied to clipboard

feat: add Block Editor integration

Open neatbyte-vnobis opened this issue 2 years ago • 1 comments

Changes

Add Block Editor page integration

How Has This Been Tested?

Manual

Documentation

None

neatbyte-vnobis avatar Aug 08 '22 12:08 neatbyte-vnobis

Add a message saying that there are no block categories, and a link to "Create a new category", like we have on the Pages view: CleanShot 2022-08-10 at 10 08 45

CleanShot 2022-08-10 at 10 07 59

Add some padding to create block dialog, same as in the pages view. Feel free to use identical styles that are present in the Pages view, and render category title and a slug underneath: CleanShot 2022-08-10 at 10 10 24

Change the blockCategory property to category, the block prefix is redundant: CleanShot 2022-08-10 at 10 14 38

In Page Builder blocks list, it would be nice if categories could have icons and descriptions. For that we need to expand the Block Categories module to have an icon and a description. There already is an Icon Picker component, see here: packages/app-headless-cms/src/admin/views/contentModelGroups/IconPicker.tsx. You can just C/P the component, and we'll worry about reusability later. For a visual example, see http://localhost:3001/cms/content-model-groups?new=true

CleanShot 2022-08-10 at 12 20 02

For blockCategories, which you load and generate plugins in the Editor.tsx, you really don't need to complicate things with those plugins; you can simply have a Recoil Atom for that. It will be a lot easier to use that data anywhere you need, especially if you create a useBlockCategories hook. CleanShot 2022-08-10 at 12 25 39@2x

Regarding the dotted element outline on the block preview img, don't worry about that for now. It's not related to element highlight, that's just how we styled elements in the editor. it's not vital at this point so don't bother with that.

Pavel910 avatar Aug 10 '22 10:08 Pavel910

@SvenAlHamad Please confirm part about "categories could have icons and descriptions" it requires API changes (2 new fields), so we need to extend scope for these changes. (or we can create an "improvement" task about it)

neatbyte-vnobis avatar Aug 11 '22 11:08 neatbyte-vnobis

Hey @neatbyte-vnobis happy for your to invest the extra time to add the two fields. Please just confirm the estimate for this so I can update the milestone on upwork.

SvenAlHamad avatar Aug 15 '22 17:08 SvenAlHamad