Repository navigation
feat(renderer-blade): compile WP block-supports into wrapper attributes #457
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
ViewFromTheBox
merged 5 commits into
release/1.0
from
feature/keystone-50-block-supports
May 16, 2026
Merged
Changes from 3 commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
ef22aad
feat(renderer-blade): compile WP block-supports into wrapper attributes
ViewFromTheBox 2469fa9
feat(renderer-blade): emit layout rules so alignwide/alignfull take e…
ViewFromTheBox f262d6e
feat(renderer-blade): emit post-content layout rules so default align…
ViewFromTheBox 848c9af
Address CodeRabbit on PR #457
ViewFromTheBox e5f395e
Address CodeRabbit on PR #457 — side-only border style fallback
ViewFromTheBox File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 8 additions & 10 deletions
18
packages/visual-editor-renderer-blade/resources/views/blocks/core/buttons.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,14 @@ | ||
| @php | ||
| $classes = [ 'wp-block-buttons', 'is-layout-flex' ]; | ||
| use ArtisanPackUI\VisualEditorRendererBlade\Support\BlockSupports; | ||
|
|
||
| $justify = $attributes['layout']['justifyContent'] ?? ''; | ||
| $justify = (string) ( $attributes['layout']['justifyContent'] ?? '' ); | ||
|
|
||
| $classes[] = '' !== $justify | ||
| ? 'is-content-justification-' . $justify | ||
| : 'is-content-justification-left'; | ||
|
|
||
| if ( ! empty( $attributes['className'] ) ) { | ||
| $classes[] = $attributes['className']; | ||
| } | ||
| $baseClasses = [ | ||
| 'wp-block-buttons', | ||
| 'is-layout-flex', | ||
| '' !== $justify ? 'is-content-justification-' . $justify : 'is-content-justification-left', | ||
| ]; | ||
| @endphp | ||
| <div class="{{ implode( ' ', array_map( 'trim', $classes ) ) }}"> | ||
| <div{!! BlockSupports::wrapperAttrs( $attributes, $baseClasses ) !!}> | ||
| {!! $innerBlocksHtml !!} | ||
| </div> | ||
4 changes: 3 additions & 1 deletion
4
packages/visual-editor-renderer-blade/resources/views/blocks/core/code.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,4 +1,6 @@ | ||
| @php | ||
| use ArtisanPackUI\VisualEditorRendererBlade\Support\BlockSupports; | ||
|
|
||
| $content = (string) ( $attributes['content'] ?? '' ); | ||
| @endphp | ||
| <pre class="wp-block-code"><code>{!! $content !!}</code></pre> | ||
| <pre{!! BlockSupports::wrapperAttrs( $attributes, [ 'wp-block-code' ] ) !!}><code>{!! $content !!}</code></pre> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
packages/visual-editor-renderer-blade/resources/views/blocks/core/columns.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,18 +1,16 @@ | ||
| @php | ||
| $classes = [ 'wp-block-columns' ]; | ||
| use ArtisanPackUI\VisualEditorRendererBlade\Support\BlockSupports; | ||
|
|
||
| $baseClasses = [ 'wp-block-columns' ]; | ||
|
|
||
| if ( ! empty( $attributes['isStackedOnMobile'] ) || ! isset( $attributes['isStackedOnMobile'] ) ) { | ||
| $classes[] = 'is-stacked-on-mobile'; | ||
| $baseClasses[] = 'is-stacked-on-mobile'; | ||
| } | ||
|
|
||
| if ( ! empty( $attributes['verticalAlignment'] ) ) { | ||
| $classes[] = 'are-vertically-aligned-' . $attributes['verticalAlignment']; | ||
| } | ||
|
|
||
| if ( ! empty( $attributes['className'] ) ) { | ||
| $classes[] = $attributes['className']; | ||
| $baseClasses[] = 'are-vertically-aligned-' . $attributes['verticalAlignment']; | ||
| } | ||
| @endphp | ||
| <div class="{{ implode( ' ', array_map( 'trim', $classes ) ) }}"> | ||
| <div{!! BlockSupports::wrapperAttrs( $attributes, $baseClasses ) !!}> | ||
| {!! $innerBlocksHtml !!} | ||
| </div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
10 changes: 3 additions & 7 deletions
10
packages/visual-editor-renderer-blade/resources/views/blocks/core/details.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,16 +1,12 @@ | ||
| @php | ||
| use ArtisanPackUI\VisualEditorRendererBlade\Support\BlockSupports; | ||
|
|
||
| $summary = (string) ( $attributes['summary'] ?? '' ); | ||
| $showContent = ! empty( $attributes['showContent'] ); | ||
|
|
||
| $classes = [ 'wp-block-details' ]; | ||
|
|
||
| if ( ! empty( $attributes['className'] ) ) { | ||
| $classes[] = $attributes['className']; | ||
| } | ||
|
|
||
| $openAttr = $showContent ? ' open' : ''; | ||
| @endphp | ||
| <details class="{{ implode( ' ', array_map( 'trim', $classes ) ) }}"{!! $openAttr !!}> | ||
| <details{!! BlockSupports::wrapperAttrs( $attributes, [ 'wp-block-details' ] ) !!}{!! $openAttr !!}> | ||
| <summary>{!! $summary !!}</summary> | ||
| {!! $innerBlocksHtml !!} | ||
| </details> |
16 changes: 9 additions & 7 deletions
16
packages/visual-editor-renderer-blade/resources/views/blocks/core/embed.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 6 additions & 8 deletions
14
packages/visual-editor-renderer-blade/resources/views/blocks/core/gallery.blade.php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.