From 0069ae2265bfd62614a70755737fdc278d36883c Mon Sep 17 00:00:00 2001 From: Tom Willmot Date: Fri, 30 Oct 2026 09:47:18 +0100 Subject: [PATCH 1/2] Fix process navigation, completion focus and authored colours --- src/process/render.php | 38 +++++++++++++++++++++++++++++++-- src/process/style.scss | 10 +++++++++ src/process/view.js | 48 +++++++++++++++++++++++++++++++++++------- src/step/render.php | 2 ++ 4 files changed, 88 insertions(+), 10 deletions(-) diff --git a/src/process/render.php b/src/process/render.php index e026881..4845528 100644 --- a/src/process/render.php +++ b/src/process/render.php @@ -79,20 +79,50 @@ class="wp-block-process-blocks-process__item" $attributes['anchor'] ?? $process['id'], 'data-wp-interactive' => Process_Blocks\STORE_NAMESPACE, 'data-wp-context' => wp_json_encode( $context, JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_QUOT | JSON_HEX_AMP ), 'data-wp-init' => 'callbacks.load', 'data-wp-watch' => 'callbacks.save', 'data-wp-class--is-all-complete' => 'state.isAllComplete', -] ); +]; + +// Completion icons need both authored colours, including when their number is +// made transparent. Resolve presets through the native block colour style engine. +$background = isset( $attributes['backgroundColor'] ) + ? 'var:preset|color|' . $attributes['backgroundColor'] + : ( $attributes['style']['color']['background'] ?? null ); +$text = isset( $attributes['textColor'] ) + ? 'var:preset|color|' . $attributes['textColor'] + : ( $attributes['style']['color']['text'] ?? null ); +if ( $background || $text ) { + $styles = wp_style_engine_get_styles( [ + 'color' => [ + 'background' => $background, + 'text' => $text, + ], + ] ); + $colours = []; + if ( ! empty( $styles['declarations']['background-color'] ) ) { + $colours[] = '--process-blocks--surface:' . $styles['declarations']['background-color']; + } + if ( ! empty( $styles['declarations']['color'] ) ) { + $colours[] = '--process-blocks--accent:' . $styles['declarations']['color']; + } + $wrapper_options['style'] = implode( ';', $colours ); +} +$wrapper_attributes = get_block_wrapper_attributes( $wrapper_options ); ?>
> +