diff --git a/resources/views/blocks/article/README.md b/resources/views/blocks/article/README.md new file mode 100644 index 0000000..178bc76 --- /dev/null +++ b/resources/views/blocks/article/README.md @@ -0,0 +1,25 @@ +# Bad Egg's Article Builder + +Designed as a full width component, Article Builder bundles core wordpress blocks commonly used in articles into a classic editor like experience. + +## Features +- Uses the `` component with a whitelist defined in `resources/json/core-block-whitelist.json` +- Provides spacing and background configuration options +- Default block attributes are defined in `resources/json/block-attributes.json` so that they are not needed in duplicate in `block.json` +- A reusable customisation UI is defined in `resources/js/blocks/components/BlockSettings.jsx` so that multiple blocks can rely on the same controls + +## Theme-level changes +- All core wordpress blocks are disabled at the top level to prevent them from being used alongside full-width blocks designed to craft page layouts +- Blocks that can use core whitelisted inner blocks are defined in `resources/json/block-parents.json` + +## Attributes +- Top Padding +- Bottom Padding +- Container width +- Background + - Colour + - Tint + - Image + - Image opacity + - Text contrast toggle + - Fixed position toggle diff --git a/resources/views/blocks/example/README.md b/resources/views/blocks/example/README.md new file mode 100644 index 0000000..8aae0fb --- /dev/null +++ b/resources/views/blocks/example/README.md @@ -0,0 +1,40 @@ +# Bad Egg's Native Wordpress Block Example + +This block serves as a placeholder that can be copied and extended to build native Wordpress blocks. + +## Features +- Automatic registration and asset building through the theme's `app/blocks.php` file and `vite.config.js` +- Automatic enqueueing of block scripts and styles if the correct files are included in the block's directory +- Supports Laravel Blade templates if the `render.blade.php` file is present, with access to the `$attributes`, `$block`, and `$content` variables. +- Default block attributes are defined in `resources/json/block-attributes.json` so that they are not needed in duplicate in `block.json` +- A reusable customisation UI is defined in `resources/js/blocks/components/BlockSettings.jsx` so that multiple blocks can rely on the same controls + +## Directory Structure +``` +app +│ ... +│ +│ blocks.php -> this is where the auto registration functions live +│ +resources +│ ... +│ +└── js +│ └── editor.js +│ +└── views + │ ... + │ + └── blocks + │ ... + │ + └── example + │ README.md -> this file + │ block.json -> (required) the block's metadata + │ index.jsx -> (required) EditorScript + │ script.js -> (optional) Editor & Front end + │ view.js -> (optional) Front end + │ editor.scss -> (optional) Editor + │ style.scss -> (optional) Editor & Front end + │ render.blade.php -> (optional) falls back to index.jsx save +```