Compare commits
26 Commits
b31aa7550b
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 9a8df23529 | |||
| 1d3a8477ee | |||
| fc49265cb9 | |||
| 8ffec45182 | |||
| 002f33c5e1 | |||
| fd4ee11d26 | |||
| ae6eec5848 | |||
| f0d8cb2065 | |||
| d47b3fdb07 | |||
| da8097e7c3 | |||
| 917150bbe6 | |||
| b16bd77355 | |||
| 7d1beee2da | |||
| 292fc01370 | |||
| 68a42deebb | |||
| f6ba2ea71b | |||
| ab4aad0fc6 | |||
| 5558a60696 | |||
| 2ee1171474 | |||
| 046da1742e | |||
| 65bc75b56e | |||
| 8ac6583758 | |||
| b03bdc2139 | |||
| 0055a25420 | |||
| 00d0861014 | |||
| de94d0e68e |
@@ -1,28 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\ACF;
|
||||
|
||||
class CloneGroup
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
}
|
||||
public function background()
|
||||
{
|
||||
return [
|
||||
'contrast',
|
||||
'bg_type',
|
||||
'bg_colour',
|
||||
'bg_tint',
|
||||
'bg_opacity',
|
||||
'bg_image',
|
||||
'bg_video',
|
||||
'pattern',
|
||||
'pattern_top',
|
||||
'pattern_bottom',
|
||||
'padding_top',
|
||||
'padding_bottom',
|
||||
];
|
||||
}
|
||||
}
|
||||
@@ -8,13 +8,15 @@ class Dynamic
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
add_filter('acf/load_field/name=colour', [ $this, 'load_colours' ]);
|
||||
add_filter('acf/load_field/name=bg_colour', [ $this, 'load_colours' ]);
|
||||
add_filter('acf/load_field/name=tint', [ $this, 'load_tints' ]);
|
||||
add_filter('acf/load_field/name=bg_tint', [ $this, 'load_tints' ]);
|
||||
add_filter('acf/load_field/name=colour', [ $this, 'load_colours' ]);
|
||||
add_filter('acf/load_field/name=bg_colour', [ $this, 'load_colours' ]);
|
||||
add_filter('acf/load_field/name=tint', [ $this, 'load_tints' ]);
|
||||
add_filter('acf/load_field/name=bg_tint', [ $this, 'load_tints' ]);
|
||||
add_filter('acf/load_field/name=container_width', [ $this, 'container_width' ]);
|
||||
add_filter('acf/load_field/name=fontawesome_regular', [ $this, 'load_fontawesome_regular_icons' ]);
|
||||
add_filter('acf/load_field/name=fontawesome_solid', [ $this, 'load_fontawesome_solid_icons' ]);
|
||||
add_filter('acf/load_field/name=fontawesome_brands', [ $this, 'load_fontawesome_brand_icons' ]);
|
||||
add_filter('acf/load_field/name=fontawesome_solid', [ $this, 'load_fontawesome_solid_icons' ]);
|
||||
add_filter('acf/load_field/name=fontawesome_brands', [ $this, 'load_fontawesome_brand_icons' ]);
|
||||
add_action('acf/input/admin_footer', [ $this, 'colour_ui' ]);
|
||||
}
|
||||
|
||||
public function load_colours( $field )
|
||||
@@ -24,7 +26,9 @@ class Dynamic
|
||||
|
||||
$colours = $colour->values();
|
||||
|
||||
$field['choices'] = [];
|
||||
$field['choices'] = [
|
||||
'0' => __('None', 'badegg'),
|
||||
];
|
||||
|
||||
foreach($colours as $slug => $hex):
|
||||
$field['choices'][$slug] = '<i class="fas fa-circle" style="color: '. $hex .'"></i> ' . @$NameThatColour->name($hex)['name'];
|
||||
@@ -46,13 +50,27 @@ class Dynamic
|
||||
$field['choices'][$slug] = ucfirst($slug);
|
||||
|
||||
else:
|
||||
$field['choices'][0] = 'None';
|
||||
$field['choices'][0] = __('None', 'badegg');
|
||||
endif;
|
||||
endforeach;
|
||||
|
||||
return $field;
|
||||
}
|
||||
|
||||
public function container_width( $field )
|
||||
{
|
||||
$field['choices'] = [
|
||||
0 => 'Auto',
|
||||
'narrow' => __('Narrow', 'badegg'),
|
||||
'small' => __('Small', 'badegg'),
|
||||
'medium' => __('Medium', 'badegg'),
|
||||
'large' => __('Large', 'badegg'),
|
||||
'full' => __('Edge to edge', 'badegg'),
|
||||
];
|
||||
|
||||
return $field;
|
||||
}
|
||||
|
||||
public function load_fontawesome_regular_icons( $field )
|
||||
{
|
||||
$field['choices'] = [];
|
||||
@@ -98,5 +116,43 @@ class Dynamic
|
||||
|
||||
return $choices;
|
||||
}
|
||||
|
||||
public function colour_ui()
|
||||
{ ?>
|
||||
|
||||
<script type="text/javascript">
|
||||
console.log("Script loaded from sage/app/ACF/Dynamic.php");
|
||||
|
||||
(function($) {
|
||||
|
||||
function my_custom_escaping_method( original_value){
|
||||
return original_value;
|
||||
}
|
||||
|
||||
acf.add_filter('select2_escape_markup', function( escaped_value, original_value, $select, settings, field, instance ){
|
||||
console.log(field.data('name'));
|
||||
|
||||
const whitelist = [
|
||||
'colour',
|
||||
'bg_colour',
|
||||
'angle_colour',
|
||||
'fontawesome_brands',
|
||||
];
|
||||
|
||||
// do something to the original_value to override the default escaping, then return it.
|
||||
// this value should still have some kind of escaping for security, but you may wish to allow specific HTML.
|
||||
if (whitelist.includes(field.data( 'name' ))) {
|
||||
return my_custom_escaping_method( original_value );
|
||||
}
|
||||
|
||||
// return
|
||||
return escaped_value;
|
||||
});
|
||||
|
||||
})(jQuery);
|
||||
|
||||
</script>
|
||||
|
||||
<?php }
|
||||
}
|
||||
|
||||
|
||||
36
app/API/Admin.php
Normal file
36
app/API/Admin.php
Normal file
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
namespace App\API;
|
||||
|
||||
class Admin
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
add_action( 'rest_api_init', [$this, 'blocks']);
|
||||
}
|
||||
|
||||
public function blocks( )
|
||||
{
|
||||
register_rest_route('badegg/v1', '/blocks/container_width', [
|
||||
'methods' => 'GET',
|
||||
'callback' => [ $this, 'container_width'],
|
||||
'permission_callback' => function(){
|
||||
return true;
|
||||
},
|
||||
]);
|
||||
}
|
||||
|
||||
public function container_width()
|
||||
{
|
||||
$containerWidths = [
|
||||
[ 'label' => __('Auto', 'badegg'), 'value' => 0 ],
|
||||
[ 'label' => __('Narrow', 'badegg'), 'value' => 'narrow' ],
|
||||
[ 'label' => __('Small', 'badegg'), 'value' => 'small' ],
|
||||
[ 'label' => __('Medium', 'badegg'), 'value' => 'medium' ],
|
||||
[ 'label' => __('Large', 'badegg'), 'value' => 'large' ],
|
||||
[ 'label' => __('Edge to edge', 'badegg'), 'value' => 'full' ],
|
||||
];
|
||||
|
||||
return rest_ensure_response($containerWidths);
|
||||
}
|
||||
}
|
||||
@@ -1,135 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Admin;
|
||||
|
||||
class Blocks
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
add_action('allowed_block_types_all', [$this, 'blacklist'], 100, 2);
|
||||
}
|
||||
|
||||
public function blacklist()
|
||||
{
|
||||
// Reference:
|
||||
// https://www.wpexplorer.com/how-to-remove-gutenberg-blocks/
|
||||
// https://www.wpexplorer.com/wordpress-core-blocks-list/
|
||||
|
||||
// Existing blocks with Blade templates
|
||||
// https://roots.io/acorn/docs/rendering-blade-views/#existing-blocks-with-blade-templates
|
||||
|
||||
$blocks = array_keys( \WP_Block_Type_Registry::get_instance()->get_all_registered() );
|
||||
|
||||
$blacklist = [
|
||||
// Design
|
||||
'core/button',
|
||||
'core/comment-template',
|
||||
'core/home-link',
|
||||
'core/navigation-link',
|
||||
'core/navigation-submenu',
|
||||
'core/buttons',
|
||||
'core/column',
|
||||
'core/columns',
|
||||
'core/group',
|
||||
'core/more',
|
||||
'core/nextpage',
|
||||
'core/separator',
|
||||
'core/spacer',
|
||||
'core/text-columns',
|
||||
|
||||
// Embed
|
||||
'core/embed',
|
||||
|
||||
// Media
|
||||
'core/cover',
|
||||
'core/file',
|
||||
'core/gallery',
|
||||
'core/image',
|
||||
'core/media-text',
|
||||
'core/audio',
|
||||
'core/video',
|
||||
|
||||
// Reusable
|
||||
'core/block',
|
||||
|
||||
// Text
|
||||
'core/footnotes',
|
||||
'core/heading',
|
||||
'core/list',
|
||||
'core/code',
|
||||
'core/details',
|
||||
'core/freeform',
|
||||
'core/list-item',
|
||||
'core/missing',
|
||||
'core/paragraph',
|
||||
'core/preformatted',
|
||||
'core/pullquote',
|
||||
'core/quote',
|
||||
'core/table',
|
||||
'core/verse',
|
||||
|
||||
// Theme
|
||||
'core/avatar',
|
||||
'core/comment-author-name',
|
||||
'core/comment-content',
|
||||
'core/comment-date',
|
||||
'core/comment-edit-link',
|
||||
'core/comment-reply-link',
|
||||
'core/comments',
|
||||
'core/comments-pagination',
|
||||
'core/comments-pagination-next',
|
||||
'core/comments-pagination-numbers',
|
||||
'core/comments-pagination-previous',
|
||||
'core/comments-title',
|
||||
'core/loginout',
|
||||
'core/navigation',
|
||||
'core/pattern',
|
||||
'core/post-author',
|
||||
'core/post-author-biography',
|
||||
'core/post-author-name',
|
||||
'core/post-comments-form',
|
||||
'core/post-content',
|
||||
'core/post-date',
|
||||
'core/post-excerpt',
|
||||
'core/post-featured-image',
|
||||
'core/post-navigation-link',
|
||||
'core/post-template',
|
||||
'core/post-terms',
|
||||
'core/post-title',
|
||||
'core/query',
|
||||
'core/query-no-results',
|
||||
'core/query-pagination',
|
||||
'core/query-pagination-next',
|
||||
'core/query-pagination-numbers',
|
||||
'core/query-pagination-previous',
|
||||
'core/query-title',
|
||||
'core/read-more',
|
||||
'core/site-logo',
|
||||
'core/site-tagline',
|
||||
'core/site-title',
|
||||
'core/template-part',
|
||||
'core/term-description',
|
||||
'core/post-comments',
|
||||
|
||||
// Widgets
|
||||
'core/legacy-widget',
|
||||
'core/widget-group',
|
||||
'core/archives',
|
||||
'core/calendar',
|
||||
'core/categories',
|
||||
'core/latest-comments',
|
||||
'core/latest-posts',
|
||||
'core/page-list',
|
||||
'core/page-list-item',
|
||||
'core/rss',
|
||||
'core/search',
|
||||
'core/shortcode',
|
||||
'core/social-link',
|
||||
'core/tag-cloud',
|
||||
'core/html',
|
||||
'core/social-links',
|
||||
];
|
||||
|
||||
return array_values( array_diff( $blocks, $blacklist ) );
|
||||
}
|
||||
}
|
||||
@@ -1,65 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Blocks;
|
||||
use App\Utilities;
|
||||
use App\ACF;
|
||||
|
||||
class BadExample
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
add_action('acf/init', [$this, 'init']);
|
||||
}
|
||||
|
||||
public function init()
|
||||
{
|
||||
acf_register_block_type([
|
||||
'name' => 'badegg/bad-example',
|
||||
'title' => __('Bad Example'),
|
||||
'description' => __('This is an example block'),
|
||||
'render_callback' => [ $this, 'render'],
|
||||
'category' => 'layout',
|
||||
'multiple' => false,
|
||||
'icon' => [
|
||||
'src' => 'dismiss',
|
||||
],
|
||||
'supports' => [
|
||||
'align' => false,
|
||||
],
|
||||
]);
|
||||
}
|
||||
|
||||
public function render($block)
|
||||
{
|
||||
$CssClasses = new Utilities\CssClasses;
|
||||
$Colour = new Utilities\Colour;
|
||||
$CloneGroup = new ACF\CloneGroup;
|
||||
|
||||
$data = [];
|
||||
|
||||
$fields = [
|
||||
'heading',
|
||||
'blurb',
|
||||
];
|
||||
|
||||
$fields = array_merge($fields, $CloneGroup->background());
|
||||
|
||||
foreach($fields as $field):
|
||||
$data[$field] = get_field($field);
|
||||
endforeach;
|
||||
|
||||
unset($block['data']);
|
||||
$block['name'] = str_replace('acf/', '', $block['name']);
|
||||
|
||||
$data = array_merge($data, $block);
|
||||
$data['section_classes'] = $CssClasses->section($data);
|
||||
$data['block'] = $block;
|
||||
|
||||
$data['knockout'] = ($Colour->is_dark($data['bg_colour'], $data['bg_tint'], $data['contrast'])) ? null : 'knockout';
|
||||
|
||||
echo \Roots\view('blocks.bad-example', [
|
||||
'data' => $data,
|
||||
'block' => $block,
|
||||
])->render();
|
||||
}
|
||||
}
|
||||
@@ -40,7 +40,7 @@ class Colour
|
||||
endforeach;
|
||||
endif;
|
||||
|
||||
$values['0'] = '#FFFFFF';
|
||||
$values['white'] = '#FFFFFF';
|
||||
$values['black'] = '#000000';
|
||||
|
||||
return $values;
|
||||
|
||||
@@ -3,55 +3,94 @@
|
||||
namespace App\Utilities;
|
||||
|
||||
class CssClasses {
|
||||
public function section($props = [])
|
||||
public function section($props = [], $name = 'unnamed', $knockout = false)
|
||||
{
|
||||
$Colour = new Colour;
|
||||
$hex = $Colour->name2hex(@$props['bg_colour'], @$props['bg_tint']);
|
||||
$defaults = [
|
||||
'padding_top' => null,
|
||||
'padding_bottom' => null,
|
||||
'bg_colour' => null,
|
||||
'bg_tint' => null,
|
||||
'contrast' => null,
|
||||
'bg_image' => null,
|
||||
];
|
||||
|
||||
$pattern = @$props['pattern'];
|
||||
$pattern_top = @$props['pattern_top'];
|
||||
$pattern_bottom = @$props['pattern_bottom'];
|
||||
$props = wp_parse_args($props, $defaults);
|
||||
|
||||
$Colour = new Colour;
|
||||
$hex = $Colour->name2hex($props['bg_colour'], $props['bg_tint']);
|
||||
|
||||
$classes = [
|
||||
'section',
|
||||
'section-' . str_replace('acf/', '', $props['name']),
|
||||
'bg-' . $this->colourTint([
|
||||
'colour' => @$props['bg_colour'],
|
||||
'tint' => @$props['bg_tint'],
|
||||
]),
|
||||
'section-' . str_replace('/', '-', $name),
|
||||
];
|
||||
|
||||
if($Colour->is_dark($hex) && $this->is_knockout_block($props['name']))
|
||||
if($props['bg_colour'])
|
||||
$classes[] = 'bg-' . $this->colourTint([
|
||||
'colour' => $props['bg_colour'],
|
||||
'tint' => $props['bg_tint'],
|
||||
]);
|
||||
|
||||
if(($knockout && $Colour->is_dark($hex) || $props['contrast'] == 'light'))
|
||||
$classes[] = 'knockout';
|
||||
|
||||
if(@$props['padding_top'])
|
||||
if($props['padding_top'])
|
||||
$classes[] = 'section-zero-top';
|
||||
|
||||
if(@$props['padding_bottom'])
|
||||
if($props['padding_bottom'])
|
||||
$classes[] = 'section-zero-bottom';
|
||||
|
||||
if($pattern):
|
||||
if($pattern == 'both'):
|
||||
$classes[] = 'pattern-top';
|
||||
$classes[] = 'pattern-bottom';
|
||||
|
||||
else:
|
||||
$classes[] = 'pattern-' . $pattern;
|
||||
|
||||
endif;
|
||||
|
||||
if(in_array($pattern, ['top', 'both']))
|
||||
$classes[] = 'pattern-top-' . $this->colourTint($pattern_top);
|
||||
|
||||
if(in_array($pattern, ['bottom', 'both']))
|
||||
$classes[] = 'pattern-bottom-' . $this->colourTint($pattern_bottom);
|
||||
|
||||
endif;
|
||||
|
||||
if(@$props['bg_image'])
|
||||
if($props['bg_image'])
|
||||
$classes[] = "bg-watermarked";
|
||||
|
||||
if(@$props['className']) $args = array_merge($classes, explode(' ', $props['className']));
|
||||
return $classes;
|
||||
}
|
||||
|
||||
public function container($args = [], $bg_props = [])
|
||||
{
|
||||
$args = wp_parse_args($args, [
|
||||
'width' => null,
|
||||
'location' => null,
|
||||
'section' => false,
|
||||
'align' => null,
|
||||
'wysiwyg' => false,
|
||||
]);
|
||||
|
||||
$bg_props = wp_parse_args($bg_props, [
|
||||
'bg_colour' => null,
|
||||
'bg_tint' => null,
|
||||
'contrast' => null,
|
||||
]);
|
||||
|
||||
$Colour = new Colour;
|
||||
$hex = $Colour->name2hex($bg_props['bg_colour'], $bg_props['bg_tint']);
|
||||
|
||||
$classes = [
|
||||
'container',
|
||||
];
|
||||
|
||||
if($args['width'])
|
||||
$classes[] = 'container-' . $args['width'];
|
||||
|
||||
if($args['location'])
|
||||
$classes[] = $args['location'];
|
||||
|
||||
if($args['section'])
|
||||
$classes[] = 'section';
|
||||
|
||||
if(str_contains($args['location'], 'intro'))
|
||||
$classes[] = 'section-zero-top';
|
||||
|
||||
if(str_contains($args['location'], 'footer'))
|
||||
$classes[] = 'section-zero-bottom';
|
||||
|
||||
if($args['wysiwyg'])
|
||||
$classes[] = 'wysiwyg';
|
||||
|
||||
if($args['align'])
|
||||
$classes[] = 'align-' . $args['align'];
|
||||
|
||||
if(($Colour->is_dark($hex) || $bg_props['contrast'] == 'light'))
|
||||
$classes[] = 'knockout';
|
||||
|
||||
return $classes;
|
||||
}
|
||||
@@ -93,7 +132,7 @@ class CssClasses {
|
||||
public function is_knockout_block($name = null)
|
||||
{
|
||||
$blacklist = [
|
||||
'bad-example',
|
||||
'badegg/acfdemo',
|
||||
];
|
||||
|
||||
if(in_array($name, $blacklist)):
|
||||
|
||||
@@ -31,9 +31,6 @@ class App extends Composer
|
||||
'VideoSrcset' => new Utilities\VideoSrcset,
|
||||
'ImageSrcset' => new Utilities\ImageSrcset,
|
||||
'siteName' => $this->siteName(),
|
||||
'company_legal' => get_field('badegg_company_legal', 'option'),
|
||||
'company_tel' => get_field('badegg_company_tel', 'option'),
|
||||
'company_email' => get_field('badegg_company_email', 'option'),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
||||
31
app/View/Composers/Blocks.php
Normal file
31
app/View/Composers/Blocks.php
Normal file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
|
||||
namespace App\View\Composers;
|
||||
|
||||
use Roots\Acorn\View\Composer;
|
||||
use App\Utilities;
|
||||
|
||||
class Blocks extends Composer
|
||||
{
|
||||
/**
|
||||
* List of views served by this composer.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static $views = [
|
||||
'layouts.block-acf',
|
||||
'partials.block-*',
|
||||
];
|
||||
|
||||
/**
|
||||
* Data to be passed to view before rendering.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function with()
|
||||
{
|
||||
return [
|
||||
'CssClasses' => new Utilities\CssClasses,
|
||||
];
|
||||
}
|
||||
}
|
||||
192
app/blocks.php
Normal file
192
app/blocks.php
Normal file
@@ -0,0 +1,192 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Theme Blocks.
|
||||
*/
|
||||
|
||||
namespace App\Blocks;
|
||||
|
||||
add_filter('block_type_metadata', function($metadata){
|
||||
$name = $metadata['name'];
|
||||
|
||||
if (str_starts_with($name, 'core/') ) {
|
||||
unset($metadata['supports']['color']);
|
||||
unset($metadata['supports']['typography']);
|
||||
}
|
||||
|
||||
return $metadata;
|
||||
});
|
||||
|
||||
// Disable all core blocks except what we need as inner blocks
|
||||
// resources/js/editor.js handles hiding the inner blocks at the top level
|
||||
add_action('allowed_block_types_all', __NAMESPACE__ . '\\list_allowed', 100, 2);
|
||||
|
||||
// add blocks to the allowed list via filter
|
||||
add_filter('badegg_block_types_allow', function($allowed){
|
||||
return array_merge($allowed, [
|
||||
// 'core/categories',
|
||||
]);
|
||||
});
|
||||
|
||||
// Add the badegg block category
|
||||
add_filter( 'block_categories_all' , function ( $categories ) {
|
||||
|
||||
// Adding a new category.
|
||||
$categories = array_merge([
|
||||
[
|
||||
'slug' => 'badegg',
|
||||
'title' => __('Provided by Bad Egg Digital'),
|
||||
],
|
||||
], $categories);
|
||||
|
||||
return $categories;
|
||||
});
|
||||
|
||||
// Auto register WP blocks
|
||||
add_action('init', function () {
|
||||
$blocks = glob(get_theme_file_path('resources/views/blocks/*/block.json'));
|
||||
|
||||
foreach ($blocks as $block_json) {
|
||||
$json = json_decode(file_get_contents($block_json));
|
||||
$slug = basename(dirname($block_json));
|
||||
$blockPath = "resources/views/blocks/{$slug}";
|
||||
|
||||
$viewScript = "{$blockPath}/view.js";
|
||||
$script = "{$blockPath}/script.js";
|
||||
$editorCSS = "{$blockPath}/editor.scss";
|
||||
$style = "{$blockPath}/style.scss";
|
||||
|
||||
// editorStyle
|
||||
if (file_exists(get_theme_file_path($editorCSS))) {
|
||||
wp_register_style(
|
||||
"{$slug}-editor-style",
|
||||
\Vite::asset($editorCSS),
|
||||
[],
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
// script
|
||||
if(file_exists(get_theme_file_path($script))) {
|
||||
wp_register_script(
|
||||
"{$slug}-script",
|
||||
\Vite::asset($script),
|
||||
[],
|
||||
null,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
// style
|
||||
if (file_exists(get_theme_file_path($style))) {
|
||||
wp_register_style(
|
||||
"{$slug}-style",
|
||||
\Vite::asset($style),
|
||||
[],
|
||||
null
|
||||
);
|
||||
}
|
||||
|
||||
// viewScript
|
||||
if(file_exists(get_theme_file_path($viewScript))) {
|
||||
wp_register_script(
|
||||
"{$slug}-view-script",
|
||||
\Vite::asset($viewScript),
|
||||
[],
|
||||
null,
|
||||
true
|
||||
);
|
||||
}
|
||||
|
||||
$props = [
|
||||
'editor_style' => "{$slug}-editor-style",
|
||||
'style' => "{$slug}-style",
|
||||
'script' => "{$slug}-script",
|
||||
'view_script' => "{$slug}-view-script",
|
||||
];
|
||||
|
||||
if(!property_exists($json, 'acf') && \Roots\view()->exists("blocks.{$slug}.render")) {
|
||||
$props['render_callback'] = function ($attributes, $content, $block) {
|
||||
$slug = basename($block->name);
|
||||
|
||||
return \Roots\view("blocks.{$slug}.render", [
|
||||
'attributes' => $attributes,
|
||||
'content' => $content,
|
||||
'block' => $block,
|
||||
]);
|
||||
};
|
||||
}
|
||||
|
||||
register_block_type($block_json, $props);
|
||||
}
|
||||
});
|
||||
|
||||
function list_inner()
|
||||
{
|
||||
$file = file_get_contents(get_theme_file_path("resources/json/core-block-whitelist.json"));
|
||||
$json = json_decode($file);
|
||||
|
||||
return $json;
|
||||
}
|
||||
|
||||
function list_all()
|
||||
{
|
||||
$blocks = array_map(function($block) {
|
||||
$name = $block->name;
|
||||
|
||||
return $block->name;
|
||||
|
||||
}, \WP_Block_Type_Registry::get_instance()->get_all_registered());
|
||||
|
||||
return array_values($blocks);
|
||||
}
|
||||
|
||||
function list_custom()
|
||||
{
|
||||
return array_filter(list_all(), function($value){
|
||||
if (str_starts_with($value, 'acf/') || str_starts_with($value, 'badegg/')) return $value;
|
||||
});
|
||||
}
|
||||
|
||||
function list_allowed()
|
||||
{
|
||||
$add_allowed = [];
|
||||
|
||||
return array_merge(
|
||||
list_custom(),
|
||||
list_inner(),
|
||||
apply_filters('badegg_block_types_allow', $add_allowed),
|
||||
);
|
||||
}
|
||||
|
||||
function render_acf($block, $content = '', $is_preview = false, $post_id = 0, $wp_block = false, $context = false) {
|
||||
$slug = basename($block['name']);
|
||||
$block['slug'] = $slug;
|
||||
|
||||
$blade = \Roots\view(
|
||||
"blocks.{$slug}.render",
|
||||
[
|
||||
'block' => $block,
|
||||
'content' => $content,
|
||||
'is_preview' => $is_preview,
|
||||
'post_id' => $post_id,
|
||||
'wp_block' => $wp_block,
|
||||
'context' => $context,
|
||||
],
|
||||
);
|
||||
|
||||
if($blade) {
|
||||
echo $blade;
|
||||
} else {
|
||||
ob_start(); ?>
|
||||
|
||||
<section class="section bg-error knockout">
|
||||
<div class="container container-small align-centre wysiwyg">
|
||||
<h2>Missing Blade Template</h2>
|
||||
<p>(resources/views/blocks/<?= $slug ?>/render.blade.php)</p>
|
||||
</div>
|
||||
</section>
|
||||
|
||||
<?php echo ob_get_clean();
|
||||
}
|
||||
}
|
||||
@@ -57,8 +57,8 @@ autoload_psr4('PostTypes');
|
||||
autoload_psr4('ACF');
|
||||
autoload_psr4('Utilities');
|
||||
autoload_psr4('Admin');
|
||||
autoload_psr4('Blocks');
|
||||
autoload_psr4('Ajax');
|
||||
autoload_psr4('API');
|
||||
|
||||
|
||||
/*
|
||||
|--------------------------------------------------------------------------
|
||||
@@ -72,7 +72,7 @@ autoload_psr4('Ajax');
|
||||
|
|
||||
*/
|
||||
|
||||
collect(['setup', 'filters'])
|
||||
collect(['setup', 'filters', 'blocks'])
|
||||
->each(function ($file) {
|
||||
if (! locate_template($file = "app/{$file}.php", true, true)) {
|
||||
wp_die(
|
||||
|
||||
153
package-lock.json
generated
153
package-lock.json
generated
@@ -7,6 +7,7 @@
|
||||
"name": "sage",
|
||||
"devDependencies": {
|
||||
"@roots/vite-plugin": "^1.0.2",
|
||||
"fast-glob": "^3.3.3",
|
||||
"laravel-vite-plugin": "^1.2.0",
|
||||
"sass": "^1.93.2",
|
||||
"vite": "^6.2.0"
|
||||
@@ -512,6 +513,44 @@
|
||||
"@jridgewell/sourcemap-codec": "^1.4.14"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodelib/fs.scandir": {
|
||||
"version": "2.1.5",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
||||
"integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "2.0.5",
|
||||
"run-parallel": "^1.1.9"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodelib/fs.stat": {
|
||||
"version": "2.0.5",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",
|
||||
"integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@nodelib/fs.walk": {
|
||||
"version": "1.2.8",
|
||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",
|
||||
"integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.scandir": "2.1.5",
|
||||
"fastq": "^1.6.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/@parcel/watcher": {
|
||||
"version": "2.5.1",
|
||||
"resolved": "https://registry.npmjs.org/@parcel/watcher/-/watcher-2.5.1.tgz",
|
||||
@@ -1505,7 +1544,6 @@
|
||||
"integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"fill-range": "^7.1.1"
|
||||
},
|
||||
@@ -1781,6 +1819,23 @@
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/fast-glob": {
|
||||
"version": "3.3.3",
|
||||
"resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",
|
||||
"integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"@nodelib/fs.stat": "^2.0.2",
|
||||
"@nodelib/fs.walk": "^1.2.3",
|
||||
"glob-parent": "^5.1.2",
|
||||
"merge2": "^1.3.0",
|
||||
"micromatch": "^4.0.8"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=8.6.0"
|
||||
}
|
||||
},
|
||||
"node_modules/fast-uri": {
|
||||
"version": "3.1.0",
|
||||
"resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz",
|
||||
@@ -1799,6 +1854,16 @@
|
||||
"license": "BSD-3-Clause",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/fastq": {
|
||||
"version": "1.19.1",
|
||||
"resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",
|
||||
"integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"reusify": "^1.0.4"
|
||||
}
|
||||
},
|
||||
"node_modules/fdir": {
|
||||
"version": "6.5.0",
|
||||
"resolved": "https://registry.npmjs.org/fdir/-/fdir-6.5.0.tgz",
|
||||
@@ -1823,7 +1888,6 @@
|
||||
"integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"to-regex-range": "^5.0.1"
|
||||
},
|
||||
@@ -1846,6 +1910,19 @@
|
||||
"node": "^8.16.0 || ^10.6.0 || >=11.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/glob-parent": {
|
||||
"version": "5.1.2",
|
||||
"resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",
|
||||
"integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",
|
||||
"dev": true,
|
||||
"license": "ISC",
|
||||
"dependencies": {
|
||||
"is-glob": "^4.0.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/glob-to-regexp": {
|
||||
"version": "0.4.1",
|
||||
"resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
|
||||
@@ -1886,7 +1963,6 @@
|
||||
"integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
@@ -1897,7 +1973,6 @@
|
||||
"integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"is-extglob": "^2.1.1"
|
||||
},
|
||||
@@ -1911,7 +1986,6 @@
|
||||
"integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=0.12.0"
|
||||
}
|
||||
@@ -1998,13 +2072,22 @@
|
||||
"license": "MIT",
|
||||
"peer": true
|
||||
},
|
||||
"node_modules/merge2": {
|
||||
"version": "1.4.1",
|
||||
"resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",
|
||||
"integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 8"
|
||||
}
|
||||
},
|
||||
"node_modules/micromatch": {
|
||||
"version": "4.0.8",
|
||||
"resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
|
||||
"integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"braces": "^3.0.3",
|
||||
"picomatch": "^2.3.1"
|
||||
@@ -2019,7 +2102,6 @@
|
||||
"integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"engines": {
|
||||
"node": ">=8.6"
|
||||
},
|
||||
@@ -2144,6 +2226,27 @@
|
||||
"node": "^10 || ^12 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/queue-microtask": {
|
||||
"version": "1.2.3",
|
||||
"resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",
|
||||
"integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/randombytes": {
|
||||
"version": "2.1.0",
|
||||
"resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
|
||||
@@ -2180,6 +2283,17 @@
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/reusify": {
|
||||
"version": "1.1.0",
|
||||
"resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",
|
||||
"integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"iojs": ">=1.0.0",
|
||||
"node": ">=0.10.0"
|
||||
}
|
||||
},
|
||||
"node_modules/rollup": {
|
||||
"version": "4.52.5",
|
||||
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.52.5.tgz",
|
||||
@@ -2222,6 +2336,30 @@
|
||||
"fsevents": "~2.3.2"
|
||||
}
|
||||
},
|
||||
"node_modules/run-parallel": {
|
||||
"version": "1.2.0",
|
||||
"resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",
|
||||
"integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",
|
||||
"dev": true,
|
||||
"funding": [
|
||||
{
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/feross"
|
||||
},
|
||||
{
|
||||
"type": "patreon",
|
||||
"url": "https://www.patreon.com/feross"
|
||||
},
|
||||
{
|
||||
"type": "consulting",
|
||||
"url": "https://feross.org/support"
|
||||
}
|
||||
],
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"queue-microtask": "^1.2.2"
|
||||
}
|
||||
},
|
||||
"node_modules/safe-buffer": {
|
||||
"version": "5.2.1",
|
||||
"resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
|
||||
@@ -2441,7 +2579,6 @@
|
||||
"integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"optional": true,
|
||||
"dependencies": {
|
||||
"is-number": "^7.0.0"
|
||||
},
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"@roots/vite-plugin": "^1.0.2",
|
||||
"fast-glob": "^3.3.3",
|
||||
"laravel-vite-plugin": "^1.2.0",
|
||||
"sass": "^1.93.2",
|
||||
"vite": "^6.2.0"
|
||||
|
||||
131
resources/acf/group_block_acfdemo.json
Normal file
131
resources/acf/group_block_acfdemo.json
Normal file
@@ -0,0 +1,131 @@
|
||||
{
|
||||
"key": "group_block_acfdemo",
|
||||
"title": "Block: ACF Demo",
|
||||
"fields": [
|
||||
{
|
||||
"key": "field_693d7783d862a",
|
||||
"label": "Content",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "accordion",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"open": 1,
|
||||
"multi_expand": 1,
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_693d779cd862b",
|
||||
"label": "",
|
||||
"name": "content",
|
||||
"aria-label": "",
|
||||
"type": "wysiwyg",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"allow_in_bindings": 0,
|
||||
"tabs": "all",
|
||||
"toolbar": "full",
|
||||
"media_upload": 1,
|
||||
"delay": 0
|
||||
},
|
||||
{
|
||||
"key": "field_693d7764938f3",
|
||||
"label": "Introduction",
|
||||
"name": "block_intro",
|
||||
"aria-label": "",
|
||||
"type": "clone",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"clone": [
|
||||
"group_clone_block_intro"
|
||||
],
|
||||
"display": "seamless",
|
||||
"layout": "block",
|
||||
"prefix_label": 0,
|
||||
"prefix_name": 0
|
||||
},
|
||||
{
|
||||
"key": "field_6940187f74afb",
|
||||
"label": "Footer",
|
||||
"name": "block_footer",
|
||||
"aria-label": "",
|
||||
"type": "clone",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"clone": [
|
||||
"group_clone_block_footer"
|
||||
],
|
||||
"display": "seamless",
|
||||
"layout": "block",
|
||||
"prefix_label": 0,
|
||||
"prefix_name": 0
|
||||
},
|
||||
{
|
||||
"key": "field_693d776493992",
|
||||
"label": "Settings",
|
||||
"name": "block_settings",
|
||||
"aria-label": "",
|
||||
"type": "clone",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"clone": [
|
||||
"group_clone_block_settings"
|
||||
],
|
||||
"display": "seamless",
|
||||
"layout": "block",
|
||||
"prefix_label": 0,
|
||||
"prefix_name": 0
|
||||
}
|
||||
],
|
||||
"location": [
|
||||
[
|
||||
{
|
||||
"param": "block",
|
||||
"operator": "==",
|
||||
"value": "badegg\/acfdemo"
|
||||
}
|
||||
]
|
||||
],
|
||||
"menu_order": 0,
|
||||
"position": "normal",
|
||||
"style": "default",
|
||||
"label_placement": "top",
|
||||
"instruction_placement": "label",
|
||||
"hide_on_screen": "",
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"display_title": "",
|
||||
"modified": 1765814950
|
||||
}
|
||||
@@ -1,9 +1,9 @@
|
||||
{
|
||||
"key": "group_block_bad_example",
|
||||
"title": "Block: Bad Example",
|
||||
"key": "group_block_editor",
|
||||
"title": "Block: Editor",
|
||||
"fields": [
|
||||
{
|
||||
"key": "field_676599038e31d",
|
||||
"key": "field_67659ad8dc795",
|
||||
"label": "",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
@@ -16,42 +16,7 @@
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"message": "<h3><span class=\"dashicons dashicons-dismiss\"><\/span> Bad Example<\/h3>",
|
||||
"new_lines": "wpautop",
|
||||
"esc_html": 0
|
||||
},
|
||||
{
|
||||
"key": "field_67659accdc794",
|
||||
"label": "Content",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "tab",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"placement": "top",
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_67659ad8dc795",
|
||||
"label": "Example",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "message",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"message": "Place your block-specific custom fields here.",
|
||||
"message": "You can insert a variety of blocks inside of this one to build your page or post.",
|
||||
"new_lines": "wpautop",
|
||||
"esc_html": 0
|
||||
},
|
||||
@@ -127,7 +92,7 @@
|
||||
{
|
||||
"param": "block",
|
||||
"operator": "==",
|
||||
"value": "acf\/badegg-bad-example"
|
||||
"value": "acf\/badegg-editor"
|
||||
}
|
||||
]
|
||||
],
|
||||
@@ -140,5 +105,5 @@
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"modified": 1734712286
|
||||
"modified": 1763915024
|
||||
}
|
||||
@@ -1,109 +0,0 @@
|
||||
{
|
||||
"key": "group_block_footer",
|
||||
"title": "Clone: Block Footer",
|
||||
"fields": [
|
||||
{
|
||||
"key": "field_67659b49a6db2",
|
||||
"label": "Footer",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "tab",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"placement": "top",
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_67659b49a754a",
|
||||
"label": "Blurb",
|
||||
"name": "blurb_footer",
|
||||
"aria-label": "",
|
||||
"type": "textarea",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"maxlength": "",
|
||||
"rows": 3,
|
||||
"placeholder": "",
|
||||
"new_lines": ""
|
||||
},
|
||||
{
|
||||
"key": "field_67659b7502137",
|
||||
"label": "Links",
|
||||
"name": "links",
|
||||
"aria-label": "",
|
||||
"type": "repeater",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"layout": "table",
|
||||
"pagination": 0,
|
||||
"min": 0,
|
||||
"max": 2,
|
||||
"collapsed": "",
|
||||
"button_label": "Add Button",
|
||||
"rows_per_page": 20,
|
||||
"sub_fields": [
|
||||
{
|
||||
"key": "field_67659b8702138",
|
||||
"label": "Button",
|
||||
"name": "button",
|
||||
"aria-label": "",
|
||||
"type": "clone",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"clone": [
|
||||
"group_clone_button"
|
||||
],
|
||||
"display": "seamless",
|
||||
"layout": "block",
|
||||
"prefix_label": 0,
|
||||
"prefix_name": 0,
|
||||
"parent_repeater": "field_67659b7502137"
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"location": [
|
||||
[
|
||||
{
|
||||
"param": "widget",
|
||||
"operator": "==",
|
||||
"value": "rss"
|
||||
}
|
||||
]
|
||||
],
|
||||
"menu_order": 0,
|
||||
"position": "normal",
|
||||
"style": "default",
|
||||
"label_placement": "top",
|
||||
"instruction_placement": "label",
|
||||
"hide_on_screen": "",
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"modified": 1734712326
|
||||
}
|
||||
@@ -1,82 +0,0 @@
|
||||
{
|
||||
"key": "group_block_intro",
|
||||
"title": "Clone: Block Intro",
|
||||
"fields": [
|
||||
{
|
||||
"key": "field_67659970db415",
|
||||
"label": "Introduction",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "tab",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"placement": "top",
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_676599964d3cc",
|
||||
"label": "Heading",
|
||||
"name": "heading",
|
||||
"aria-label": "",
|
||||
"type": "text",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"maxlength": "",
|
||||
"placeholder": "",
|
||||
"prepend": "",
|
||||
"append": ""
|
||||
},
|
||||
{
|
||||
"key": "field_6765999d4d3cd",
|
||||
"label": "Blurb",
|
||||
"name": "blurb",
|
||||
"aria-label": "",
|
||||
"type": "textarea",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"maxlength": "",
|
||||
"rows": 3,
|
||||
"placeholder": "",
|
||||
"new_lines": ""
|
||||
}
|
||||
],
|
||||
"location": [
|
||||
[
|
||||
{
|
||||
"param": "widget",
|
||||
"operator": "==",
|
||||
"value": "rss"
|
||||
}
|
||||
]
|
||||
],
|
||||
"menu_order": 0,
|
||||
"position": "normal",
|
||||
"style": "default",
|
||||
"label_placement": "top",
|
||||
"instruction_placement": "label",
|
||||
"hide_on_screen": "",
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"modified": 1734711913
|
||||
}
|
||||
@@ -2,36 +2,9 @@
|
||||
"key": "group_clone_background_settings",
|
||||
"title": "Clone: Background Settings",
|
||||
"fields": [
|
||||
{
|
||||
"key": "field_672d3ba78bc40",
|
||||
"label": "Background Type",
|
||||
"name": "bg_type",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"0": "Solid Colour",
|
||||
"image": "Still Photo",
|
||||
"video": "Looping Video"
|
||||
},
|
||||
"default_value": 0,
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
},
|
||||
{
|
||||
"key": "field_67325dd23234e",
|
||||
"label": "Background Colour",
|
||||
"label": "Colour",
|
||||
"name": "bg_colour",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
@@ -39,38 +12,60 @@
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"width": "50",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"primary": "<i class=\"fas fa-circle\" style=\"color: #7A74A6\"><\/i> Kimberly",
|
||||
"secondary": "<i class=\"fas fa-circle\" style=\"color: #9C729E\"><\/i> Trendy Pink",
|
||||
"tertiary": "<i class=\"fas fa-circle\" style=\"color: #B8728B\"><\/i> Turkish Rose",
|
||||
"quaternary": "<i class=\"fas fa-circle\" style=\"color: #5875A0\"><\/i> Waikawa Gray",
|
||||
"quinary": "<i class=\"fas fa-circle\" style=\"color: #4298B7\"><\/i> Boston Blue",
|
||||
"black": "<i class=\"fas fa-circle\" style=\"color: #000000\"><\/i> Black",
|
||||
"0": "<i class=\"fas fa-circle\" style=\"color: #FFFFFF\"><\/i> White"
|
||||
"0": "auto",
|
||||
"primary": "<i class=\"fas fa-circle\" style=\"color: #dd3333\"><\/i> Punch",
|
||||
"white": "<i class=\"fas fa-circle\" style=\"color: #FFFFFF\"><\/i> White",
|
||||
"black": "<i class=\"fas fa-circle\" style=\"color: #000000\"><\/i> Black"
|
||||
},
|
||||
"default_value": 0,
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"allow_in_bindings": 1,
|
||||
"ui": 1,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_67325e213234f",
|
||||
"label": "Background Tint",
|
||||
"label": "Tint",
|
||||
"name": "bg_tint",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"conditional_logic": [
|
||||
[
|
||||
{
|
||||
"field": "field_67325dd23234e",
|
||||
"operator": "!=",
|
||||
"value": "0"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"field": "field_67325dd23234e",
|
||||
"operator": "!=",
|
||||
"value": "black"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"field": "field_67325dd23234e",
|
||||
"operator": "!=",
|
||||
"value": "white"
|
||||
}
|
||||
]
|
||||
],
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"width": "50",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
@@ -87,9 +82,12 @@
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"allow_in_bindings": 1,
|
||||
"ui": 1,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_67350f526abf1",
|
||||
@@ -101,7 +99,7 @@
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
@@ -116,413 +114,9 @@
|
||||
"allow_null": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
},
|
||||
{
|
||||
"key": "field_67325e3432350",
|
||||
"label": "Opacity",
|
||||
"name": "bg_opacity",
|
||||
"aria-label": "",
|
||||
"type": "range",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": [
|
||||
[
|
||||
{
|
||||
"field": "field_672d3ba78bc40",
|
||||
"operator": "!=",
|
||||
"value": "0"
|
||||
}
|
||||
]
|
||||
],
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": 30,
|
||||
"min": 5,
|
||||
"max": 100,
|
||||
"step": 5,
|
||||
"prepend": "",
|
||||
"append": "%"
|
||||
},
|
||||
{
|
||||
"key": "field_6734b234f9c47",
|
||||
"label": "Pattern Edge",
|
||||
"name": "pattern",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"0": "Disabled",
|
||||
"top": "Top",
|
||||
"bottom": "Bottom",
|
||||
"both": "Both"
|
||||
},
|
||||
"default_value": 0,
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
},
|
||||
{
|
||||
"key": "field_6734b2daf9c4b",
|
||||
"label": "Top Pattern",
|
||||
"name": "pattern_top",
|
||||
"aria-label": "",
|
||||
"type": "group",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": [
|
||||
[
|
||||
{
|
||||
"field": "field_6734b234f9c47",
|
||||
"operator": "==",
|
||||
"value": "top"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"field": "field_6734b234f9c47",
|
||||
"operator": "==",
|
||||
"value": "both"
|
||||
}
|
||||
]
|
||||
],
|
||||
"wrapper": {
|
||||
"width": "40",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"layout": "block",
|
||||
"sub_fields": [
|
||||
{
|
||||
"key": "field_673514b45e977",
|
||||
"label": "Colour",
|
||||
"name": "colour",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "50",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"primary": "<i class=\"fas fa-circle\" style=\"color: #7A74A6\"><\/i> Kimberly",
|
||||
"secondary": "<i class=\"fas fa-circle\" style=\"color: #9C729E\"><\/i> Trendy Pink",
|
||||
"tertiary": "<i class=\"fas fa-circle\" style=\"color: #B8728B\"><\/i> Turkish Rose",
|
||||
"quaternary": "<i class=\"fas fa-circle\" style=\"color: #5875A0\"><\/i> Waikawa Gray",
|
||||
"quinary": "<i class=\"fas fa-circle\" style=\"color: #4298B7\"><\/i> Boston Blue",
|
||||
"black": "<i class=\"fas fa-circle\" style=\"color: #000000\"><\/i> Black",
|
||||
"0": "<i class=\"fas fa-circle\" style=\"color: #FFFFFF\"><\/i> White"
|
||||
},
|
||||
"default_value": false,
|
||||
"return_format": "",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"ui": 1,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
},
|
||||
{
|
||||
"key": "field_673514d85e978",
|
||||
"label": "Tint",
|
||||
"name": "tint",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "50",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"lightest": "Lightest",
|
||||
"lighter": "Lighter",
|
||||
"light": "Light",
|
||||
"0": "None",
|
||||
"dark": "Dark",
|
||||
"darker": "Darker",
|
||||
"darkest": "Darkest"
|
||||
},
|
||||
"default_value": 0,
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "field_673514f15e979",
|
||||
"label": "Bottom Pattern",
|
||||
"name": "pattern_bottom",
|
||||
"aria-label": "",
|
||||
"type": "group",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "40",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"layout": "block",
|
||||
"sub_fields": [
|
||||
{
|
||||
"key": "field_673514f15e97a",
|
||||
"label": "Colour",
|
||||
"name": "colour",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "50",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"primary": "<i class=\"fas fa-circle\" style=\"color: #7A74A6\"><\/i> Kimberly",
|
||||
"secondary": "<i class=\"fas fa-circle\" style=\"color: #9C729E\"><\/i> Trendy Pink",
|
||||
"tertiary": "<i class=\"fas fa-circle\" style=\"color: #B8728B\"><\/i> Turkish Rose",
|
||||
"quaternary": "<i class=\"fas fa-circle\" style=\"color: #5875A0\"><\/i> Waikawa Gray",
|
||||
"quinary": "<i class=\"fas fa-circle\" style=\"color: #4298B7\"><\/i> Boston Blue",
|
||||
"black": "<i class=\"fas fa-circle\" style=\"color: #000000\"><\/i> Black",
|
||||
"0": "<i class=\"fas fa-circle\" style=\"color: #FFFFFF\"><\/i> White"
|
||||
},
|
||||
"default_value": false,
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"ui": 1,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
},
|
||||
{
|
||||
"key": "field_673514f15e97b",
|
||||
"label": "Tint",
|
||||
"name": "tint",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": [
|
||||
[
|
||||
{
|
||||
"field": "field_673514f15e97a",
|
||||
"operator": "!=",
|
||||
"value": "black"
|
||||
}
|
||||
],
|
||||
[
|
||||
{
|
||||
"field": "field_673514f15e97a",
|
||||
"operator": "!=",
|
||||
"value": "0"
|
||||
}
|
||||
]
|
||||
],
|
||||
"wrapper": {
|
||||
"width": "50",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"lightest": "Lightest",
|
||||
"lighter": "Lighter",
|
||||
"light": "Light",
|
||||
"0": "None",
|
||||
"dark": "Dark",
|
||||
"darker": "Darker",
|
||||
"darkest": "Darkest"
|
||||
},
|
||||
"default_value": 0,
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "field_672d3b128bc39",
|
||||
"label": "Background Image",
|
||||
"name": "bg_image",
|
||||
"aria-label": "",
|
||||
"type": "image",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": [
|
||||
[
|
||||
{
|
||||
"field": "field_672d3ba78bc40",
|
||||
"operator": "!=",
|
||||
"value": "0"
|
||||
}
|
||||
]
|
||||
],
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"return_format": "id",
|
||||
"library": "all",
|
||||
"min_width": "",
|
||||
"min_height": "",
|
||||
"min_size": "",
|
||||
"max_width": "",
|
||||
"max_height": "",
|
||||
"max_size": "",
|
||||
"mime_types": "",
|
||||
"preview_size": "medium"
|
||||
},
|
||||
{
|
||||
"key": "field_672d3b228bc3a",
|
||||
"label": "Background Video",
|
||||
"name": "bg_video",
|
||||
"aria-label": "",
|
||||
"type": "group",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": [
|
||||
[
|
||||
{
|
||||
"field": "field_672d3ba78bc40",
|
||||
"operator": "==",
|
||||
"value": "video"
|
||||
}
|
||||
]
|
||||
],
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"layout": "block",
|
||||
"sub_fields": [
|
||||
{
|
||||
"key": "field_672d3b428bc3b",
|
||||
"label": "Extra Small",
|
||||
"name": "xs",
|
||||
"aria-label": "",
|
||||
"type": "file",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"return_format": "array",
|
||||
"library": "all",
|
||||
"min_size": "",
|
||||
"max_size": "",
|
||||
"mime_types": "mp4"
|
||||
},
|
||||
{
|
||||
"key": "field_672d3b678bc3c",
|
||||
"label": "Small",
|
||||
"name": "sm",
|
||||
"aria-label": "",
|
||||
"type": "file",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"return_format": "array",
|
||||
"library": "all",
|
||||
"min_size": "",
|
||||
"max_size": "",
|
||||
"mime_types": "mp4"
|
||||
},
|
||||
{
|
||||
"key": "field_672d3b728bc3d",
|
||||
"label": "Medium",
|
||||
"name": "md",
|
||||
"aria-label": "",
|
||||
"type": "file",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"return_format": "array",
|
||||
"library": "all",
|
||||
"min_size": "",
|
||||
"max_size": "",
|
||||
"mime_types": "mp4"
|
||||
},
|
||||
{
|
||||
"key": "field_672d3b7a8bc3e",
|
||||
"label": "Large",
|
||||
"name": "lg",
|
||||
"aria-label": "",
|
||||
"type": "file",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"return_format": "array",
|
||||
"library": "all",
|
||||
"min_size": "",
|
||||
"max_size": "",
|
||||
"mime_types": "mp4"
|
||||
},
|
||||
{
|
||||
"key": "field_672d3b838bc3f",
|
||||
"label": "Extra Large",
|
||||
"name": "xl",
|
||||
"aria-label": "",
|
||||
"type": "file",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"return_format": "array",
|
||||
"library": "all",
|
||||
"min_size": "",
|
||||
"max_size": "",
|
||||
"mime_types": "mp4"
|
||||
}
|
||||
]
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
}
|
||||
],
|
||||
"location": [
|
||||
@@ -543,5 +137,5 @@
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"modified": 1733505903
|
||||
"modified": 1765746167
|
||||
}
|
||||
|
||||
210
resources/acf/group_clone_block_footer.json
Normal file
210
resources/acf/group_clone_block_footer.json
Normal file
@@ -0,0 +1,210 @@
|
||||
{
|
||||
"key": "group_clone_block_footer",
|
||||
"title": "Clone: Block Footer",
|
||||
"fields": [
|
||||
{
|
||||
"key": "field_694016b164221",
|
||||
"label": "Footer",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "accordion",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"open": 0,
|
||||
"multi_expand": 0,
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_694016b164272",
|
||||
"label": "",
|
||||
"name": "footer",
|
||||
"aria-label": "",
|
||||
"type": "group",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"layout": "block",
|
||||
"sub_fields": [
|
||||
{
|
||||
"key": "field_694016b165315",
|
||||
"label": "Blurb",
|
||||
"name": "blurb",
|
||||
"aria-label": "",
|
||||
"type": "textarea",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"maxlength": "",
|
||||
"rows": 3,
|
||||
"placeholder": "",
|
||||
"new_lines": ""
|
||||
},
|
||||
{
|
||||
"key": "field_69401a2f06555",
|
||||
"label": "Links",
|
||||
"name": "links",
|
||||
"aria-label": "",
|
||||
"type": "repeater",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"layout": "block",
|
||||
"pagination": 0,
|
||||
"min": 0,
|
||||
"max": 0,
|
||||
"collapsed": "",
|
||||
"button_label": "Add Row",
|
||||
"rows_per_page": 20,
|
||||
"sub_fields": [
|
||||
{
|
||||
"key": "field_69401a4006556",
|
||||
"label": "Link",
|
||||
"name": "link",
|
||||
"aria-label": "",
|
||||
"type": "clone",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"clone": [
|
||||
"group_clone_button"
|
||||
],
|
||||
"display": "seamless",
|
||||
"layout": "block",
|
||||
"prefix_label": 0,
|
||||
"prefix_name": 0,
|
||||
"parent_repeater": "field_69401a2f06555"
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "field_694016b165337",
|
||||
"label": "Alignment",
|
||||
"name": "align",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"left": "Left",
|
||||
"centre": "Centre",
|
||||
"right": "Right"
|
||||
},
|
||||
"default_value": "centre",
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"allow_in_bindings": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_694016b16537f",
|
||||
"label": "Container width",
|
||||
"name": "container_width",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"0": "Auto",
|
||||
"narrow": "Narrow",
|
||||
"small": "Small",
|
||||
"medium": "Medium",
|
||||
"large": "Large",
|
||||
"full": "Edge to edge"
|
||||
},
|
||||
"default_value": "narrow",
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"allow_in_bindings": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "field_694016b1642c5",
|
||||
"label": "Footer (end)",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "accordion",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"open": 0,
|
||||
"multi_expand": 0,
|
||||
"endpoint": 1
|
||||
}
|
||||
],
|
||||
"location": [
|
||||
[
|
||||
{
|
||||
"param": "widget",
|
||||
"operator": "==",
|
||||
"value": "rss"
|
||||
}
|
||||
]
|
||||
],
|
||||
"menu_order": 0,
|
||||
"position": "normal",
|
||||
"style": "default",
|
||||
"label_placement": "top",
|
||||
"instruction_placement": "label",
|
||||
"hide_on_screen": "",
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"display_title": "",
|
||||
"modified": 1765809897
|
||||
}
|
||||
184
resources/acf/group_clone_block_intro.json
Normal file
184
resources/acf/group_clone_block_intro.json
Normal file
@@ -0,0 +1,184 @@
|
||||
{
|
||||
"key": "group_clone_block_intro",
|
||||
"title": "Clone: Block Intro",
|
||||
"fields": [
|
||||
{
|
||||
"key": "field_67659970db415",
|
||||
"label": "Introduction",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "accordion",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"open": 0,
|
||||
"multi_expand": 0,
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_693f37ad7fa70",
|
||||
"label": "",
|
||||
"name": "intro",
|
||||
"aria-label": "",
|
||||
"type": "group",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"layout": "block",
|
||||
"sub_fields": [
|
||||
{
|
||||
"key": "field_676599964d3cc",
|
||||
"label": "Heading",
|
||||
"name": "heading",
|
||||
"aria-label": "",
|
||||
"type": "text",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "hfont",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"maxlength": "",
|
||||
"allow_in_bindings": 0,
|
||||
"placeholder": "",
|
||||
"prepend": "",
|
||||
"append": ""
|
||||
},
|
||||
{
|
||||
"key": "field_6765999d4d3cd",
|
||||
"label": "Blurb",
|
||||
"name": "blurb",
|
||||
"aria-label": "",
|
||||
"type": "textarea",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"maxlength": "",
|
||||
"rows": 3,
|
||||
"placeholder": "",
|
||||
"new_lines": ""
|
||||
},
|
||||
{
|
||||
"key": "field_69400cbafb964",
|
||||
"label": "Alignment",
|
||||
"name": "align",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"left": "Left",
|
||||
"centre": "Centre",
|
||||
"right": "Right"
|
||||
},
|
||||
"default_value": "centre",
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"allow_in_bindings": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_693f3a7fae85e",
|
||||
"label": "Container width",
|
||||
"name": "container_width",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"0": "Auto",
|
||||
"narrow": "Narrow",
|
||||
"small": "Small",
|
||||
"medium": "Medium",
|
||||
"large": "Large",
|
||||
"full": "Edge to edge"
|
||||
},
|
||||
"default_value": "narrow",
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"allow_in_bindings": 0,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "field_6828dae1d1bb0",
|
||||
"label": "Intro (end)",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "accordion",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"open": 0,
|
||||
"multi_expand": 0,
|
||||
"endpoint": 1
|
||||
}
|
||||
],
|
||||
"location": [
|
||||
[
|
||||
{
|
||||
"param": "widget",
|
||||
"operator": "==",
|
||||
"value": "rss"
|
||||
}
|
||||
]
|
||||
],
|
||||
"menu_order": 0,
|
||||
"position": "normal",
|
||||
"style": "default",
|
||||
"label_placement": "top",
|
||||
"instruction_placement": "label",
|
||||
"hide_on_screen": "",
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"display_title": "",
|
||||
"modified": 1765809893
|
||||
}
|
||||
@@ -3,11 +3,11 @@
|
||||
"title": "Clone: Block Settings",
|
||||
"fields": [
|
||||
{
|
||||
"key": "field_673511c31122f",
|
||||
"key": "field_69403228d2637",
|
||||
"label": "Settings",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "tab",
|
||||
"type": "accordion",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
@@ -16,62 +16,136 @@
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"placement": "top",
|
||||
"open": 0,
|
||||
"multi_expand": 1,
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_67350eb62cdf9",
|
||||
"label": "Top Padding",
|
||||
"name": "padding_top",
|
||||
"key": "field_694031b513e66",
|
||||
"label": "",
|
||||
"name": "settings",
|
||||
"aria-label": "",
|
||||
"type": "radio",
|
||||
"type": "group",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "33.33",
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": [
|
||||
"On",
|
||||
"Off"
|
||||
],
|
||||
"default_value": "",
|
||||
"return_format": "value",
|
||||
"allow_null": 0,
|
||||
"other_choice": 0,
|
||||
"layout": "horizontal",
|
||||
"save_other_choice": 0
|
||||
"layout": "block",
|
||||
"sub_fields": [
|
||||
{
|
||||
"key": "field_67350eb62cdf9",
|
||||
"label": "Top Padding",
|
||||
"name": "padding_top",
|
||||
"aria-label": "",
|
||||
"type": "radio",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "50",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": [
|
||||
"On",
|
||||
"Off"
|
||||
],
|
||||
"default_value": "",
|
||||
"return_format": "value",
|
||||
"allow_null": 0,
|
||||
"other_choice": 0,
|
||||
"layout": "horizontal",
|
||||
"save_other_choice": 0
|
||||
},
|
||||
{
|
||||
"key": "field_673510c1dc830",
|
||||
"label": "Bottom Padding",
|
||||
"name": "padding_bottom",
|
||||
"aria-label": "",
|
||||
"type": "radio",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "50",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": [
|
||||
"On",
|
||||
"Off"
|
||||
],
|
||||
"default_value": "",
|
||||
"return_format": "value",
|
||||
"allow_null": 0,
|
||||
"other_choice": 0,
|
||||
"layout": "horizontal",
|
||||
"save_other_choice": 0
|
||||
},
|
||||
{
|
||||
"key": "field_6800097e61765",
|
||||
"label": "Container Width",
|
||||
"name": "container_width",
|
||||
"aria-label": "",
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"0": "Auto",
|
||||
"narrow": "Narrow",
|
||||
"small": "Small",
|
||||
"medium": "Medium",
|
||||
"large": "Large",
|
||||
"full": "Edge to edge"
|
||||
},
|
||||
"default_value": 0,
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"allow_in_bindings": 1,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_67350aeb146ca",
|
||||
"label": "Background",
|
||||
"name": "background",
|
||||
"aria-label": "",
|
||||
"type": "clone",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"clone": [
|
||||
"group_clone_background_settings"
|
||||
],
|
||||
"display": "seamless",
|
||||
"layout": "block",
|
||||
"prefix_label": 0,
|
||||
"prefix_name": 0
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"key": "field_673510c1dc830",
|
||||
"label": "Bottom Padding",
|
||||
"name": "padding_bottom",
|
||||
"aria-label": "",
|
||||
"type": "radio",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "33.33",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": [
|
||||
"On",
|
||||
"Off"
|
||||
],
|
||||
"default_value": "",
|
||||
"return_format": "value",
|
||||
"allow_null": 0,
|
||||
"other_choice": 0,
|
||||
"layout": "horizontal",
|
||||
"save_other_choice": 0
|
||||
},
|
||||
{
|
||||
"key": "field_6735258c2d9ff",
|
||||
"label": "Background",
|
||||
"key": "field_69403239d2638",
|
||||
"label": "Settings (end)",
|
||||
"name": "",
|
||||
"aria-label": "",
|
||||
"type": "accordion",
|
||||
@@ -85,29 +159,7 @@
|
||||
},
|
||||
"open": 0,
|
||||
"multi_expand": 0,
|
||||
"endpoint": 0
|
||||
},
|
||||
{
|
||||
"key": "field_67350aeb146ca",
|
||||
"label": "Background",
|
||||
"name": "background",
|
||||
"aria-label": "",
|
||||
"type": "clone",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"clone": [
|
||||
"group_clone_background_settings"
|
||||
],
|
||||
"display": "seamless",
|
||||
"layout": "block",
|
||||
"prefix_label": 0,
|
||||
"prefix_name": 0
|
||||
"endpoint": 1
|
||||
}
|
||||
],
|
||||
"location": [
|
||||
@@ -128,5 +180,6 @@
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"modified": 1731536288
|
||||
"display_title": "",
|
||||
"modified": 1765815052
|
||||
}
|
||||
|
||||
@@ -9,14 +9,15 @@
|
||||
"aria-label": "",
|
||||
"type": "link",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"required": 1,
|
||||
"conditional_logic": 0,
|
||||
"wrapper": {
|
||||
"width": "40",
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"return_format": "array"
|
||||
"return_format": "array",
|
||||
"allow_in_bindings": 1
|
||||
},
|
||||
{
|
||||
"key": "field_673529a2a37a1",
|
||||
@@ -26,14 +27,22 @@
|
||||
"type": "text",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"conditional_logic": [
|
||||
[
|
||||
{
|
||||
"field": "field_672d3d7b2c273",
|
||||
"operator": "!=empty"
|
||||
}
|
||||
]
|
||||
],
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"default_value": "",
|
||||
"maxlength": "",
|
||||
"allow_in_bindings": 1,
|
||||
"placeholder": "",
|
||||
"prepend": "",
|
||||
"append": ""
|
||||
@@ -46,28 +55,42 @@
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"conditional_logic": [
|
||||
[
|
||||
{
|
||||
"field": "field_672d3d7b2c273",
|
||||
"operator": "!=empty"
|
||||
}
|
||||
]
|
||||
],
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
"choices": {
|
||||
"primary": "<i class=\"fas fa-circle\" style=\"color: #7A74A6\"><\/i> Kimberly",
|
||||
"secondary": "<i class=\"fas fa-circle\" style=\"color: #9C729E\"><\/i> Trendy Pink",
|
||||
"tertiary": "<i class=\"fas fa-circle\" style=\"color: #B8728B\"><\/i> Turkish Rose",
|
||||
"quaternary": "<i class=\"fas fa-circle\" style=\"color: #5875A0\"><\/i> Waikawa Gray",
|
||||
"quinary": "<i class=\"fas fa-circle\" style=\"color: #4298B7\"><\/i> Boston Blue",
|
||||
"primary": "<i class=\"fas fa-circle\" style=\"color: #002448\"><\/i> Prussian Blue",
|
||||
"secondary": "<i class=\"fas fa-circle\" style=\"color: #fc533e\"><\/i> Sunset Orange",
|
||||
"tertiary": "<i class=\"fas fa-circle\" style=\"color: #fdd400\"><\/i> Gold",
|
||||
"quaternary": "<i class=\"fas fa-circle\" style=\"color: #7d89d1\"><\/i> Moody Blue",
|
||||
"quinary": "<i class=\"fas fa-circle\" style=\"color: #ffdab4\"><\/i> Frangipani",
|
||||
"0": "<i class=\"fas fa-circle\" style=\"color: #FFFFFF\"><\/i> White",
|
||||
"black": "<i class=\"fas fa-circle\" style=\"color: #000000\"><\/i> Black",
|
||||
"0": "<i class=\"fas fa-circle\" style=\"color: #FFFFFF\"><\/i> White"
|
||||
"quaternary-white": "<i class=\"fas fa-circle text-gradient text-gradient-quaternary-white\"><\/i> Moody Blue to White",
|
||||
"quinary-white": "<i class=\"fas fa-circle text-gradient text-gradient-quinary-white\"><\/i> Frangipani to White",
|
||||
"white-quaternary": "<i class=\"fas fa-circle text-gradient text-gradient-white-quaternary\"><\/i> White to Moody Blue",
|
||||
"white-quinary": "<i class=\"fas fa-circle text-gradient text-gradient-white-quinary\"><\/i> White to Frangipani"
|
||||
},
|
||||
"default_value": 0,
|
||||
"default_value": "primary",
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"allow_in_bindings": 1,
|
||||
"ui": 1,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_672d3dc52c275",
|
||||
@@ -77,9 +100,16 @@
|
||||
"type": "select",
|
||||
"instructions": "",
|
||||
"required": 0,
|
||||
"conditional_logic": 0,
|
||||
"conditional_logic": [
|
||||
[
|
||||
{
|
||||
"field": "field_672d3d7b2c273",
|
||||
"operator": "!=empty"
|
||||
}
|
||||
]
|
||||
],
|
||||
"wrapper": {
|
||||
"width": "20",
|
||||
"width": "",
|
||||
"class": "",
|
||||
"id": ""
|
||||
},
|
||||
@@ -91,9 +121,12 @@
|
||||
"return_format": "value",
|
||||
"multiple": 0,
|
||||
"allow_null": 0,
|
||||
"allow_in_bindings": 1,
|
||||
"ui": 0,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
}
|
||||
],
|
||||
"location": [
|
||||
@@ -114,5 +147,5 @@
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"modified": 1731537485
|
||||
"modified": 1748001311
|
||||
}
|
||||
|
||||
@@ -492,7 +492,9 @@
|
||||
"allow_null": 0,
|
||||
"ui": 1,
|
||||
"ajax": 0,
|
||||
"placeholder": ""
|
||||
"placeholder": "",
|
||||
"create_options": 0,
|
||||
"save_options": 0
|
||||
},
|
||||
{
|
||||
"key": "field_664c65c653f1c",
|
||||
@@ -530,5 +532,5 @@
|
||||
"active": true,
|
||||
"description": "",
|
||||
"show_in_rest": 0,
|
||||
"modified": 1734711372
|
||||
"modified": 1764224435
|
||||
}
|
||||
|
||||
@@ -18,9 +18,6 @@
|
||||
@use "components/button";
|
||||
@use "components/card";
|
||||
|
||||
// Blocks
|
||||
@use "blocks/BadExample";
|
||||
|
||||
// Page Styles
|
||||
@use "views/page";
|
||||
|
||||
|
||||
@@ -13,13 +13,13 @@ button {
|
||||
|
||||
button,
|
||||
input[type="submit"] {
|
||||
&.button {
|
||||
&.btn {
|
||||
appearance: none;
|
||||
}
|
||||
}
|
||||
|
||||
%button,
|
||||
.button {
|
||||
.btn {
|
||||
display: inline-block;
|
||||
padding: 0.5em 1.25em;
|
||||
border: 0.125em solid colours.$black;
|
||||
@@ -102,10 +102,10 @@ input[type="submit"] {
|
||||
&.bigger { font-size: 1.5em; }
|
||||
}
|
||||
|
||||
.button-wrap {
|
||||
.btn-wrap {
|
||||
margin: 1.5em -0.25em -0.25em;
|
||||
|
||||
.button {
|
||||
.btn {
|
||||
margin: 0.25em;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,6 @@
|
||||
@use "../global/variables/breakpoints";
|
||||
@use "../global/variables/colours";
|
||||
|
||||
textarea {
|
||||
min-height: 10.375em;
|
||||
}
|
||||
|
||||
input,
|
||||
textarea {
|
||||
color: colours.$grey;
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
@use "app";
|
||||
@use "global/variables/colours";
|
||||
|
||||
.block-editor-block-list__layout .block-editor-block-list__block:not([contenteditable=true]) {
|
||||
&:hover:after {
|
||||
content: '';
|
||||
outline: 2px solid colours.$wpblue;
|
||||
position: absolute;
|
||||
inset: 0;
|
||||
}
|
||||
|
||||
&:focus:after {
|
||||
outline-style: dashed;
|
||||
}
|
||||
}
|
||||
|
||||
.editor-styles-wrapper {
|
||||
padding: 0;
|
||||
background: transparent;
|
||||
}
|
||||
|
||||
.editor-visual-editor {
|
||||
.wp-block {
|
||||
max-width: none;
|
||||
}
|
||||
|
||||
.is-root-container > .wp-block:not(.block-list-appender) {
|
||||
margin: 0;
|
||||
}
|
||||
|
||||
.block-list-appender {
|
||||
width: 350px;
|
||||
max-width: 90%;
|
||||
margin: 1em auto;
|
||||
}
|
||||
|
||||
&__post-title-wrapper {
|
||||
position: sticky;
|
||||
top: 0;
|
||||
z-index: 100;
|
||||
padding: 1rem;
|
||||
margin: 0 !important;
|
||||
background: white;
|
||||
box-shadow: 0 0.5rem 1rem rgba(black, 0.15);
|
||||
}
|
||||
|
||||
.wp-block-post-title {
|
||||
position: relative;
|
||||
padding: 0.5rem;
|
||||
border: 1px solid rgba(black, 0.3);
|
||||
margin: 0;
|
||||
|
||||
&::before {
|
||||
content: 'Page Title';
|
||||
position: absolute;
|
||||
top: -0.5rem;
|
||||
left: 0.5rem;
|
||||
color: rgba(black, 0.3);
|
||||
font-size: 0.8rem;
|
||||
display: block;
|
||||
padding: 0 0.5rem;
|
||||
margin: 0;
|
||||
background: white;
|
||||
line-height: 1;
|
||||
font-weight: 400;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -63,7 +63,7 @@ p,
|
||||
li,
|
||||
td,
|
||||
label {
|
||||
color: colours.$grey;
|
||||
color: colours.$grey-dark;
|
||||
font-family: fonts.$font;
|
||||
font-weight: 400;
|
||||
line-height: 1.5em;
|
||||
@@ -142,11 +142,7 @@ hr {
|
||||
}
|
||||
|
||||
.align {
|
||||
&-centre {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
&-right {
|
||||
text-align: right;
|
||||
}
|
||||
&-left { text-align: left; }
|
||||
&-centre, &-center { text-align: center; }
|
||||
&-right { text-align: right; }
|
||||
}
|
||||
|
||||
@@ -27,9 +27,10 @@
|
||||
}
|
||||
|
||||
.container {
|
||||
width: 90%;
|
||||
width: calc(100% - spacing.$innerMedium * 2);
|
||||
margin: auto;
|
||||
|
||||
&-full { width: auto; }
|
||||
&-large { max-width: spacing.$containerLarge; }
|
||||
&-medium { max-width: spacing.$containerMedium; }
|
||||
&-small { max-width: spacing.$containerSmall; }
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
@mixin generate_button_colors($name, $hex) {
|
||||
|
||||
$buttons: (
|
||||
".button",
|
||||
".btn",
|
||||
"button",
|
||||
"input[type=submit]",
|
||||
);
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
@use "sass:color";
|
||||
|
||||
$wpblue: #2271b1;
|
||||
|
||||
//== Status
|
||||
$success: #39b54a;
|
||||
$error: #be1e2d;
|
||||
|
||||
@@ -3,16 +3,11 @@ import.meta.glob([
|
||||
'../fonts/**',
|
||||
]);
|
||||
|
||||
import domReady from '@wordpress/dom-ready';
|
||||
import blocks from './blocks.js';
|
||||
import Header from './sections/header.js';
|
||||
// import.meta.glob('../views/blocks/**/{style.scss,script.js,view.js}', { eager: true })
|
||||
|
||||
import Header from '../views/sections/header/header.js';
|
||||
import LazyLoad from './lib/Lazy.js';
|
||||
|
||||
/**
|
||||
* Application entrypoint
|
||||
*/
|
||||
domReady(async () => {
|
||||
LazyLoad();
|
||||
blocks();
|
||||
Header();
|
||||
});
|
||||
LazyLoad();
|
||||
Header();
|
||||
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import BadExample from "./blocks/BadExample";
|
||||
|
||||
export default function()
|
||||
{
|
||||
BadExample();
|
||||
}
|
||||
@@ -1,4 +0,0 @@
|
||||
export default function BadExample()
|
||||
{
|
||||
|
||||
}
|
||||
@@ -1,5 +1,53 @@
|
||||
import domReady from '@wordpress/dom-ready';
|
||||
import blockWhitelist from '../json/core-block-whitelist.json';
|
||||
import.meta.glob('../views/blocks/**/{index.jsx,index.js}', { eager: true })
|
||||
|
||||
domReady(() => {
|
||||
//
|
||||
const TEXT_EDITOR_BLOCKS = [
|
||||
// Design
|
||||
'core/separator',
|
||||
'core/spacer',
|
||||
|
||||
// Media
|
||||
'core/cover',
|
||||
'core/file',
|
||||
'core/gallery',
|
||||
'core/image',
|
||||
'core/media-text',
|
||||
'core/audio',
|
||||
'core/video',
|
||||
|
||||
// Text
|
||||
'core/footnotes',
|
||||
'core/heading',
|
||||
'core/list',
|
||||
'core/code',
|
||||
'core/details',
|
||||
'core/list-item',
|
||||
'core/missing',
|
||||
'core/paragraph',
|
||||
'core/preformatted',
|
||||
'core/pullquote',
|
||||
'core/quote',
|
||||
'core/table',
|
||||
'core/verse',
|
||||
];
|
||||
|
||||
const restrictEditorParentBlocks = (settings, name) => {
|
||||
if (TEXT_EDITOR_BLOCKS.includes(name)) {
|
||||
settings.parent = [
|
||||
'acf/badegg-editor',
|
||||
'badegg/article',
|
||||
];
|
||||
}
|
||||
|
||||
return settings
|
||||
}
|
||||
|
||||
wp.hooks.addFilter(
|
||||
'blocks.registerBlockType',
|
||||
'your-project-name/restrict-parent-blocks',
|
||||
restrictEditorParentBlocks
|
||||
);
|
||||
|
||||
});
|
||||
|
||||
12
resources/js/lib/isInsideBlock.js
Normal file
12
resources/js/lib/isInsideBlock.js
Normal file
@@ -0,0 +1,12 @@
|
||||
export default function isInsideMyACFBlock(blockName)
|
||||
{
|
||||
const editor = wp.data.select('core/block-editor');
|
||||
const selectedId = editor.getSelectedBlockClientId();
|
||||
|
||||
if (!selectedId) return false;
|
||||
|
||||
const parents = editor.getBlockParents(selectedId);
|
||||
const parentNames = parents.map(id => editor.getBlockName(id));
|
||||
|
||||
return parentNames.includes(blockName);
|
||||
}
|
||||
26
resources/json/core-block-whitelist.json
Normal file
26
resources/json/core-block-whitelist.json
Normal file
@@ -0,0 +1,26 @@
|
||||
[
|
||||
"core/separator",
|
||||
"core/spacer",
|
||||
|
||||
"core/cover",
|
||||
"core/file",
|
||||
"core/gallery",
|
||||
"core/image",
|
||||
"core/media-text",
|
||||
"core/audio",
|
||||
"core/video",
|
||||
|
||||
"core/footnotes",
|
||||
"core/heading",
|
||||
"core/list",
|
||||
"core/code",
|
||||
"core/details",
|
||||
"core/list-item",
|
||||
"core/missing",
|
||||
"core/paragraph",
|
||||
"core/preformatted",
|
||||
"core/pullquote",
|
||||
"core/quote",
|
||||
"core/table",
|
||||
"core/verse"
|
||||
]
|
||||
28
resources/views/blocks/acfdemo/block.json
Normal file
28
resources/views/blocks/acfdemo/block.json
Normal file
@@ -0,0 +1,28 @@
|
||||
{
|
||||
"apiVersion": 3,
|
||||
"name": "badegg/acfdemo",
|
||||
"title": "ACF Demo",
|
||||
"category": "badegg",
|
||||
"icon": "media-document",
|
||||
"description": "An example block powered by ACF",
|
||||
"keywords": ["acf", "demo"],
|
||||
|
||||
"acf": {
|
||||
"mode": "preview",
|
||||
"validate": "false",
|
||||
"renderCallback": "\\App\\Blocks\\render_acf"
|
||||
},
|
||||
"supports": {
|
||||
"anchor": true,
|
||||
"align": false,
|
||||
"jsx": true
|
||||
},
|
||||
"example": {
|
||||
"attributes": {
|
||||
"mode": "preview",
|
||||
"data": {
|
||||
"inserter": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
4
resources/views/blocks/acfdemo/editor.scss
Normal file
4
resources/views/blocks/acfdemo/editor.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
// block.json's editorStyle, applied in block editor and front end
|
||||
.wp-block-acf-demo.block-editor-block-list__block {
|
||||
display: block;
|
||||
}
|
||||
1
resources/views/blocks/acfdemo/index.js
Normal file
1
resources/views/blocks/acfdemo/index.js
Normal file
@@ -0,0 +1 @@
|
||||
// block.json's editorScript, loaded only in the block editor
|
||||
10
resources/views/blocks/acfdemo/render.blade.php
Normal file
10
resources/views/blocks/acfdemo/render.blade.php
Normal file
@@ -0,0 +1,10 @@
|
||||
@extends('layouts.block-acf', [
|
||||
'block' => $block,
|
||||
'is_preview' => $is_preview,
|
||||
'context' => $context,
|
||||
'knockout' => true,
|
||||
])
|
||||
|
||||
@section('block-content')
|
||||
{!! the_field('content') !!}
|
||||
@overwrite
|
||||
1
resources/views/blocks/acfdemo/script.js
Normal file
1
resources/views/blocks/acfdemo/script.js
Normal file
@@ -0,0 +1 @@
|
||||
// block.json's script, loaded in block editor and front end
|
||||
4
resources/views/blocks/acfdemo/style.scss
Normal file
4
resources/views/blocks/acfdemo/style.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
// block.json's style, applied in block editor and front end
|
||||
.wp-block-acf-demo {
|
||||
display: block;
|
||||
}
|
||||
1
resources/views/blocks/acfdemo/view.js
Normal file
1
resources/views/blocks/acfdemo/view.js
Normal file
@@ -0,0 +1 @@
|
||||
// block.json's viewScript, applied on front end only
|
||||
35
resources/views/blocks/article/block.json
Normal file
35
resources/views/blocks/article/block.json
Normal file
@@ -0,0 +1,35 @@
|
||||
{
|
||||
"apiVersion": 3,
|
||||
"name": "badegg/article",
|
||||
"title": "Article Builder",
|
||||
"category": "badegg",
|
||||
"icon": {
|
||||
"src": "format-aside",
|
||||
"foreground": "#f58762"
|
||||
},
|
||||
"description": "A wrapper to contain core blocks",
|
||||
"attributes": {
|
||||
"container_width": {
|
||||
"type": "string",
|
||||
"default": 0
|
||||
},
|
||||
"alignment": {
|
||||
"type": "string"
|
||||
},
|
||||
"padding_top": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
},
|
||||
"padding_bottom": {
|
||||
"type": "boolean",
|
||||
"default": true
|
||||
}
|
||||
},
|
||||
"supports": {
|
||||
"html": true,
|
||||
"color": {
|
||||
"background": true,
|
||||
"text": false
|
||||
}
|
||||
}
|
||||
}
|
||||
4
resources/views/blocks/article/editor.scss
Normal file
4
resources/views/blocks/article/editor.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
// block.json's editorStyle, applied in block editor and front end
|
||||
.wp-block-badegg-article.block-editor-block-list__block {
|
||||
display: block;
|
||||
}
|
||||
115
resources/views/blocks/article/index.jsx
Normal file
115
resources/views/blocks/article/index.jsx
Normal file
@@ -0,0 +1,115 @@
|
||||
// block.json's editorScript, loaded only in the block editor
|
||||
|
||||
import { __ } from '@wordpress/i18n';
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
|
||||
import {
|
||||
useBlockProps,
|
||||
InnerBlocks,
|
||||
InspectorControls,
|
||||
BlockControls,
|
||||
AlignmentToolbar,
|
||||
} from '@wordpress/block-editor';
|
||||
|
||||
import {
|
||||
Panel,
|
||||
PanelBody,
|
||||
PanelRow,
|
||||
SelectControl,
|
||||
ToggleControl,
|
||||
} from '@wordpress/components';
|
||||
import { useState, useEffect } from '@wordpress/element';
|
||||
import apiFetch from '@wordpress/api-fetch';
|
||||
import metadata from './block.json';
|
||||
import allowedBlocks from '../../../json/core-block-whitelist.json';
|
||||
|
||||
registerBlockType(metadata.name, {
|
||||
edit({ attributes, setAttributes }) {
|
||||
const blockProps = useBlockProps();
|
||||
const [ isLoading, setIsLoading ] = useState( true );
|
||||
|
||||
const {
|
||||
container_width,
|
||||
alignment,
|
||||
padding_top,
|
||||
padding_bottom,
|
||||
} = attributes;
|
||||
|
||||
const [
|
||||
containerWidthOptions, setContainerWidthOptions,
|
||||
] = useState( [] );
|
||||
|
||||
useEffect( () => {
|
||||
apiFetch( { path: '/badegg/v1/blocks/container_width' } )
|
||||
.then( ( data ) => {
|
||||
setContainerWidthOptions( data );
|
||||
setIsLoading( false );
|
||||
} )
|
||||
.catch( () => {
|
||||
setContainerWidthOptions( [] );
|
||||
setIsLoading( false );
|
||||
} );
|
||||
}, [] );
|
||||
|
||||
console.log(attributes);
|
||||
|
||||
return (
|
||||
<div { ...blockProps }>
|
||||
<BlockControls>
|
||||
<AlignmentToolbar
|
||||
value={ alignment }
|
||||
onChange={(value) => setAttributes({alignment: value})}
|
||||
/>
|
||||
</BlockControls>
|
||||
<InspectorControls>
|
||||
<Panel>
|
||||
<PanelBody title={ __("Settings", "badegg") }>
|
||||
<SelectControl
|
||||
label={ __("Container Width", "badegg") }
|
||||
value={ container_width }
|
||||
options={ containerWidthOptions }
|
||||
onChange={ (value) => setAttributes({ container_width: value }) }
|
||||
__next40pxDefaultSize={ true }
|
||||
__nextHasNoMarginBottom={ true }
|
||||
/>
|
||||
<ToggleControl
|
||||
label={ __('Top Padding', 'badegg') }
|
||||
checked={ padding_top }
|
||||
onChange={(value) => setAttributes({ padding_top: value }) }
|
||||
__nextHasNoMarginBottom
|
||||
/>
|
||||
<ToggleControl
|
||||
label={ __('Bottom Padding', 'badegg') }
|
||||
checked={ padding_bottom }
|
||||
onChange={(value) => setAttributes({ padding_bottom: value }) }
|
||||
__nextHasNoMarginBottom
|
||||
/>
|
||||
</PanelBody>
|
||||
</Panel>
|
||||
</InspectorControls>
|
||||
<div className={`container container-${ attributes.container_width } align-${ attributes.alignment }`}>
|
||||
<InnerBlocks
|
||||
allowedBlocks={ allowedBlocks }
|
||||
defaultBlock={
|
||||
{
|
||||
name: "core/paragraph",
|
||||
attributes: {
|
||||
placeholder: "start typing",
|
||||
}
|
||||
}
|
||||
}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
},
|
||||
save({ attributes }) {
|
||||
return (
|
||||
<div { ...useBlockProps.save() }>
|
||||
<div className={`container container-${attributes.container_width} align-${ attributes.alignment }`}>
|
||||
<InnerBlocks.Content />
|
||||
</div>
|
||||
</div>
|
||||
)
|
||||
}
|
||||
});
|
||||
1
resources/views/blocks/article/script.js
Normal file
1
resources/views/blocks/article/script.js
Normal file
@@ -0,0 +1 @@
|
||||
// block.json's script, loaded in block editor and front end
|
||||
4
resources/views/blocks/article/style.scss
Normal file
4
resources/views/blocks/article/style.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
// block.json's style, applied in block editor and front end
|
||||
.wp-block-badegg-article {
|
||||
display: block;
|
||||
}
|
||||
1
resources/views/blocks/article/view.js
Normal file
1
resources/views/blocks/article/view.js
Normal file
@@ -0,0 +1 @@
|
||||
// block.json's viewScript, applied on front end only
|
||||
15
resources/views/blocks/example/block.json
Normal file
15
resources/views/blocks/example/block.json
Normal file
@@ -0,0 +1,15 @@
|
||||
{
|
||||
"apiVersion": 3,
|
||||
"name": "badegg/example",
|
||||
"title": "Example",
|
||||
"category": "badegg",
|
||||
"icon": "cover-image",
|
||||
"description": "This is an example of a custom native block",
|
||||
"editorScript": "example-editor-script",
|
||||
"editorStyle": "example-editor-style",
|
||||
"style": "example-style",
|
||||
"script": "example-script",
|
||||
"supports": {
|
||||
"html": false
|
||||
}
|
||||
}
|
||||
5
resources/views/blocks/example/editor.scss
Normal file
5
resources/views/blocks/example/editor.scss
Normal file
@@ -0,0 +1,5 @@
|
||||
// block.json's editorStyle, applied in block editor and front end
|
||||
.wp-block-badegg-example.block-editor-block-list__block {
|
||||
display: block;
|
||||
border: 2px solid red;
|
||||
}
|
||||
17
resources/views/blocks/example/index.jsx
Normal file
17
resources/views/blocks/example/index.jsx
Normal file
@@ -0,0 +1,17 @@
|
||||
// block.json's editorScript, loaded only in the block editor
|
||||
|
||||
import { registerBlockType } from '@wordpress/blocks';
|
||||
import { useBlockProps } from '@wordpress/block-editor';
|
||||
import metadata from './block.json';
|
||||
|
||||
registerBlockType(metadata.name, {
|
||||
edit() {
|
||||
const blockProps = useBlockProps();
|
||||
|
||||
return (
|
||||
<section { ...blockProps }>
|
||||
<h2>Bad Egg Block Example</h2>
|
||||
</section>
|
||||
);
|
||||
}
|
||||
});
|
||||
3
resources/views/blocks/example/render.blade.php
Normal file
3
resources/views/blocks/example/render.blade.php
Normal file
@@ -0,0 +1,3 @@
|
||||
<div class="block-badegg-example">
|
||||
<h2>Bad Egg Example Block (Blade)</h2>
|
||||
</div>
|
||||
1
resources/views/blocks/example/script.js
Normal file
1
resources/views/blocks/example/script.js
Normal file
@@ -0,0 +1 @@
|
||||
// block.json's script, loaded in block editor and front end
|
||||
4
resources/views/blocks/example/style.scss
Normal file
4
resources/views/blocks/example/style.scss
Normal file
@@ -0,0 +1,4 @@
|
||||
// block.json's style, applied in block editor and front end
|
||||
.wp-block-badegg-example {
|
||||
display: block;
|
||||
}
|
||||
1
resources/views/blocks/example/view.js
Normal file
1
resources/views/blocks/example/view.js
Normal file
@@ -0,0 +1 @@
|
||||
// block.json's viewScript, applied on front end only
|
||||
5
resources/views/components/button.blade.php
Normal file
5
resources/views/components/button.blade.php
Normal file
@@ -0,0 +1,5 @@
|
||||
@if(@$link)
|
||||
<a href="{{ @$link['url'] }}" target="{{ @$link['target'] }}" class="btn {{ @$colour ?: 'primary' }} {{ $style ?: 'solid' }} {{ @$class }}">
|
||||
<span>{{ @$link['title'] }}</span>
|
||||
</a>
|
||||
@endif
|
||||
@@ -1,15 +1,18 @@
|
||||
@php($image = wp_get_attachment_image_src(@$id, 'medium'))
|
||||
@php($image = wp_get_attachment_image_src(@$id, @$size))
|
||||
|
||||
<img
|
||||
@if(@$lazy)
|
||||
src="{{ wp_get_attachment_image_src($id, 'lazy')[0] }}"
|
||||
data-src="{{ $image[0] }}"
|
||||
class="lazy"
|
||||
@else
|
||||
src="{{ $image[0] }}"
|
||||
@endif
|
||||
@if($image)
|
||||
<img
|
||||
@if(@$lazy && !is_admin())
|
||||
src="{{ wp_get_attachment_image_src($id, 'lazy')[0] }}"
|
||||
data-src="{{ @$image[0] }}"
|
||||
class="lazy {{ @$class }}"
|
||||
@else
|
||||
src="{{ $image[0] }}"
|
||||
class="{{ @$class }}"
|
||||
@endif
|
||||
|
||||
alt="{{ get_post_meta( $id, '_wp_attachment_image_alt', true ) }}"
|
||||
width="{{ $image[1] }}"
|
||||
height="{{ $image[2] }}"
|
||||
/>
|
||||
alt="{{ get_post_meta( $id, '_wp_attachment_image_alt', true ) }}"
|
||||
width="{{ $image[1] }}"
|
||||
height="{{ $image[2] }}"
|
||||
/>
|
||||
@endif
|
||||
|
||||
@@ -17,19 +17,24 @@
|
||||
{{ __('Skip to content', 'sage') }}
|
||||
</a>
|
||||
|
||||
@include('sections.header')
|
||||
@include('sections.header.header')
|
||||
|
||||
<main id="main" class="main">
|
||||
@yield('content')
|
||||
</main>
|
||||
<div class="wrapper">
|
||||
<main id="main" class="main">
|
||||
@yield('content')
|
||||
</main>
|
||||
|
||||
@hasSection('sidebar')
|
||||
<aside class="sidebar">
|
||||
@yield('sidebar')
|
||||
</aside>
|
||||
@endif
|
||||
@hasSection('sidebar')
|
||||
<aside class="sidebar">
|
||||
@yield('sidebar')
|
||||
</aside>
|
||||
@endif
|
||||
|
||||
@include('sections.footer.footer')
|
||||
</div>
|
||||
|
||||
@include('partials.menu-off-canvas')
|
||||
|
||||
@include('sections.footer')
|
||||
</div>
|
||||
|
||||
@php(do_action('get_footer'))
|
||||
|
||||
23
resources/views/layouts/block-acf.blade.php
Normal file
23
resources/views/layouts/block-acf.blade.php
Normal file
@@ -0,0 +1,23 @@
|
||||
@php
|
||||
$settings = get_field('settings');
|
||||
|
||||
$sectionProps = [
|
||||
'class' => implode(' ', $CssClasses->section(get_field('settings'), @$block['name'], @$knockout)),
|
||||
];
|
||||
|
||||
$containerProps = [
|
||||
'width' => @$settings['container_width'],
|
||||
];
|
||||
@endphp
|
||||
|
||||
<div id="{{ @$block['anchor'] }}" @if($is_preview) class="{{ $sectionProps['class'] }}" @else {!! get_block_wrapper_attributes($sectionProps) !!} @endif>
|
||||
|
||||
@include('partials.block-acf-intro', ['props' => get_field('intro'), 'settings' => $settings])
|
||||
|
||||
<div class="{{ implode(' ', $CssClasses->container($containerProps)) }}">
|
||||
@yield('block-content')
|
||||
</div>
|
||||
|
||||
@include('partials.block-acf-footer', ['props' => get_field('footer'), 'settings' => $settings])
|
||||
|
||||
</div>
|
||||
@@ -1,34 +1,11 @@
|
||||
<section id="{{ $block['id'] }}" class="{{ implode(' ', $data['section_classes']) }} {{ @$block['className'] }}">
|
||||
@if(@$data['heading'] || @$data['blurb'])
|
||||
<div class="section-intro container container-narrow align-centre wysiwyg bg-watermarked-content {{ @$data['knockout'] }}">
|
||||
<h2>{{ @$data['heading'] }}</h2>
|
||||
@include('components.divider')
|
||||
<p>{{ @$data['blurb'] }}</p>
|
||||
</div>
|
||||
@endif
|
||||
@if(!$is_preview)
|
||||
<div {!! get_block_wrapper_attributes() !!}>
|
||||
@endif
|
||||
|
||||
<div class="section container container-large block-content bg-watermarked-content">
|
||||
<div class="wp-block-inner">
|
||||
@yield('block-content')
|
||||
</div>
|
||||
|
||||
@if(!$is_preview)
|
||||
</div>
|
||||
|
||||
@if(@$data['links'])
|
||||
<div class="section-footer container container-narrow align-centre wysiwyg bg-watermarked-content {{ @$data['knockout'] }}">
|
||||
<div class="button-wrap">
|
||||
@foreach($data['links'] as $link)
|
||||
@include('components.button', $link)
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@if(@$data['bg_image'])
|
||||
<div class="bg-watermarked-image" style="opacity: {!! (@$data['bg_opacity'] ?: 30) * 0.01 !!}">
|
||||
{!! $ImageSrcset->render([
|
||||
'image' => $data['bg_image'],
|
||||
'name' => 'hero',
|
||||
'lazy' => true,
|
||||
]) !!}
|
||||
</div>
|
||||
@endif
|
||||
|
||||
</section>
|
||||
@endif
|
||||
|
||||
30
resources/views/partials/block-acf-footer.blade.php
Normal file
30
resources/views/partials/block-acf-footer.blade.php
Normal file
@@ -0,0 +1,30 @@
|
||||
@if($props['blurb'])
|
||||
@php
|
||||
$containerProps = [
|
||||
'width' => $props['container_width'],
|
||||
'location' => 'block-footer',
|
||||
'section' => true,
|
||||
'align' => $props['align'],
|
||||
'wysiwyg' => true,
|
||||
];
|
||||
@endphp
|
||||
|
||||
<div class="{{ implode(' ', $CssClasses->container($containerProps, @$settings)) }}">
|
||||
@if($props['blurb']) <p>{{ $props['blurb'] }}</p> @endif
|
||||
|
||||
@if(@$props['links'])
|
||||
<div class="section-footer inner-top">
|
||||
<div class="container">
|
||||
<div class="btn-wrap">
|
||||
@foreach($props['links'] as $link)
|
||||
@include('components.button', $link)
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
|
||||
@endif
|
||||
|
||||
|
||||
17
resources/views/partials/block-acf-intro.blade.php
Normal file
17
resources/views/partials/block-acf-intro.blade.php
Normal file
@@ -0,0 +1,17 @@
|
||||
@if(@$props['heading'] || @$props['blurb'])
|
||||
@php
|
||||
$containerProps = [
|
||||
'width' => $props['container_width'],
|
||||
'location' => 'block-intro',
|
||||
'section' => true,
|
||||
'align' => $props['align'],
|
||||
'wysiwyg' => true,
|
||||
];
|
||||
@endphp
|
||||
|
||||
<div class="{{ implode(' ', $CssClasses->container($containerProps, @$settings)) }}">
|
||||
@if($props['heading']) <h2>{{ $props['heading'] }}</h3> @endif
|
||||
@if($props['blurb']) <p>{{ $props['blurb'] }}</p> @endif
|
||||
</div>
|
||||
|
||||
@endif
|
||||
28
resources/views/partials/menu-off-canvas.blade.php
Normal file
28
resources/views/partials/menu-off-canvas.blade.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<div class="menu-off-canvas bg-white">
|
||||
<div class="inner">
|
||||
<div class="menu-off-canvas-logo">
|
||||
<a class="brand" href="{{ home_url('/') }}">
|
||||
Site Logo
|
||||
</a>
|
||||
|
||||
<button
|
||||
class="block menu-toggle menu-close js-menu-close"
|
||||
type="button"
|
||||
command="toggle-popover"
|
||||
commandfor="menu-side"
|
||||
aria-expanded="false"
|
||||
aria-controls="menu-side"
|
||||
>
|
||||
<i></i>
|
||||
<i></i>
|
||||
<i></i>
|
||||
<span class="visually-hidden">Close Mobile Menu</span>
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@if (has_nav_menu('primary_navigation'))
|
||||
{!! wp_nav_menu(['theme_location' => 'primary_navigation', 'menu_class' => 'caret-links nolist']) !!}
|
||||
@endif
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@@ -24,6 +24,8 @@ export default function Header() {
|
||||
const position = body.offsetTop;
|
||||
const header = document.querySelector(".site-header");
|
||||
|
||||
if(!header) return;
|
||||
|
||||
if (scrolled > position + header.offsetHeight) {
|
||||
body.classList.add("scrolled");
|
||||
} else {
|
||||
0
resources/views/sections/header/header.scss
Normal file
0
resources/views/sections/header/header.scss
Normal file
@@ -1,17 +1,49 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import laravel from 'laravel-vite-plugin'
|
||||
import { wordpressPlugin, wordpressThemeJson } from '@roots/vite-plugin';
|
||||
import fg from 'fast-glob';
|
||||
import path from 'path';
|
||||
|
||||
function blockAsset(file)
|
||||
{
|
||||
const files = fg.sync('resources/views/blocks/**/' + file);
|
||||
let list = {};
|
||||
|
||||
files.forEach(file => {
|
||||
const parts = file.split(path.sep);
|
||||
const fileName = parts[parts.length - 1];
|
||||
const extension = fileName.split('.').pop();
|
||||
const blockName = parts[parts.length - 2];
|
||||
|
||||
list[`blocks/${blockName}/${fileName.replace('.' + extension, '')}`] = `resources/views/blocks/${blockName}/${fileName}`;
|
||||
});
|
||||
|
||||
return list;
|
||||
}
|
||||
|
||||
const editorStyle = blockAsset('editor.scss');
|
||||
const script = blockAsset('script.js');
|
||||
const viewScript = blockAsset('view.js');
|
||||
const style = blockAsset('style.scss');
|
||||
|
||||
export default defineConfig({
|
||||
base: '/app/themes/sage/public/build/',
|
||||
base: '/app/themes/badegg/public/build/',
|
||||
plugins: [
|
||||
laravel({
|
||||
input: [
|
||||
'resources/css/app.scss',
|
||||
'resources/js/app.js',
|
||||
'resources/css/editor.scss',
|
||||
'resources/js/editor.js',
|
||||
],
|
||||
input: {
|
||||
// 'resources/css/app.scss',
|
||||
// 'resources/js/app.js',
|
||||
// 'resources/css/editor.scss',
|
||||
// 'resources/js/editor.js',
|
||||
'css/app': 'resources/css/app.scss',
|
||||
'js/app': 'resources/js/app.js',
|
||||
'css/editor': 'resources/css/editor.scss',
|
||||
'js/editor': 'resources/js/editor.js',
|
||||
...editorStyle,
|
||||
...viewScript,
|
||||
...script,
|
||||
...style,
|
||||
},
|
||||
refresh: true,
|
||||
url: process.env.APP_URL,
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user