Skip to content

Commit

Permalink
update patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
ntsekouras committed Apr 7, 2021
1 parent 49b4c3b commit 617f547
Showing 1 changed file with 12 additions and 144 deletions.
156 changes: 12 additions & 144 deletions lib/test-block-patterns.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,25 +12,19 @@
register_block_pattern(
'paragraph/v1',
array(
'title' => __( 'Paragraph version 1', 'gutenberg' ),
'scope' => array(
'inserter' => false,
'transform' => array( 'core/paragraph' ),
),
'content' => '<!-- wp:paragraph {"dropCap":true,"backgroundColor":"orange"} -->
'title' => __( 'Paragraph version 1', 'gutenberg' ),
'blockTypes' => array( 'core/paragraph' ),
'content' => '<!-- wp:paragraph {"dropCap":true,"backgroundColor":"orange"} -->
<p class="has-drop-cap has-orange-background-color has-background">Hello my paragraph!</p>
<!-- /wp:paragraph -->',
)
);
register_block_pattern(
'paragraph/v2',
array(
'title' => __( 'Paragraph version 2', 'gutenberg' ),
'scope' => array(
'inserter' => false,
'transform' => array( 'core/paragraph' ),
),
'content' => '<!-- wp:paragraph {"align":"center","backgroundColor":"gray","textColor":"green","fontSize":"extra-large"} -->
'title' => __( 'Paragraph version 2', 'gutenberg' ),
'blockTypes' => array( 'core/paragraph' ),
'content' => '<!-- wp:paragraph {"align":"center","backgroundColor":"gray","textColor":"green","fontSize":"extra-large"} -->
<p class="has-text-align-center has-green-color has-gray-background-color has-text-color has-background has-extra-large-font-size">Hello my paragraph!</p>
<!-- /wp:paragraph -->',
)
Expand All @@ -40,12 +34,9 @@
register_block_pattern(
'multi/v2',
array(
'title' => __( 'Multi blocks v2 - deep nesting', 'gutenberg' ),
'scope' => array(
'inserter' => false,
'transform' => array( 'core/paragraph', 'core/heading' ),
),
'content' => '<!-- wp:group -->
'title' => __( 'Multi blocks v2 - deep nesting', 'gutenberg' ),
'blockTypes' => array( 'core/paragraph', 'core/heading' ),
'content' => '<!-- wp:group -->
<div class="wp-block-group"><div class="wp-block-group__inner-container">
<!-- wp:heading {"fontSize":"large"} -->
<h2 class="has-large-font-size"><span style="color:#ba0c49" class="has-inline-color"><strong>2</strong>.</span>Which treats of the first sally the ingenious Don Quixote made from home</h2>
Expand All @@ -67,12 +58,9 @@
register_block_pattern(
'multi/v1',
array(
'title' => __( 'Multi blocks v1', 'gutenberg' ),
'scope' => array(
'inserter' => false,
'transform' => array( 'core/paragraph', 'core/heading' ),
),
'content' => '<!-- wp:group -->
'title' => __( 'Multi blocks v1', 'gutenberg' ),
'blockTypes' => array( 'core/paragraph', 'core/heading' ),
'content' => '<!-- wp:group -->
<div class="wp-block-group"><div class="wp-block-group__inner-container"><!-- wp:heading {"fontSize":"large"} -->
<h2 class="has-large-font-size"><span style="color:#ba0c49" class="has-inline-color"><strong>2</strong>.</span>Which treats of the first sally the ingenious Don Quixote made from home</h2>
<!-- /wp:heading -->
Expand All @@ -82,123 +70,3 @@
<!-- /wp:group -->',
)
);

// Template Parts Patterns.
// Headers.
register_block_pattern(
'header/v1',
array(
'title' => __( 'Header v1', 'gutenberg' ),
'scope' => array(
'inserter' => false,
'transform' => array( 'core/template-part/header' ),
),
'content' => '
<!-- wp:navigation {"orientation":"horizontal","itemsJustification":"center"} -->
<!-- wp:page-list /-->
<!-- /wp:navigation -->
<!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide">
<!-- wp:column -->
<div class="wp-block-column"><!-- wp:site-title /--></div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column"><!-- wp:site-tagline /--></div>
<!-- /wp:column -->
</div>
<!-- /wp:columns -->',
)
);
register_block_pattern(
'header/v2',
array(
'title' => __( 'Header v2', 'gutenberg' ),
'scope' => array(
'inserter' => false,
'transform' => array( 'core/template-part/header' ),
),
'content' => '
<!-- wp:heading {"textAlign":"center","backgroundColor":"gray","textColor":"yellow"} -->
<h2 class="has-text-align-center has-yellow-color has-gray-background-color has-text-color has-background">This is the Header</h2>
<!-- /wp:heading -->
<!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:site-title /--></div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column">
<!-- wp:site-tagline /-->
</div>
<!-- /wp:column --></div>
<!-- /wp:columns -->',
)
);
register_block_pattern(
'footer/v1',
array(
'title' => __( 'Footer v1', 'gutenberg' ),
'scope' => array(
'inserter' => false,
'transform' => array( 'core/template-part/footer' ),
),
'content' => '
<!-- wp:heading {"textAlign":"center","backgroundColor":"gray","textColor":"yellow"} -->
<h2 class="has-text-align-center has-yellow-color has-gray-background-color has-text-color has-background">This is a Footer</h2>
<!-- /wp:heading -->
<!-- wp:columns {"align":"wide"} -->
<div class="wp-block-columns alignwide"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:paragraph -->
<p><a href="mailto:#">[email protected]<br></a>T. +00 (0)1 22 33 44 55</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column"><!-- wp:paragraph {"align":"center"} -->
<p class="has-text-align-center">2, Rue Losuis-Boilly<br>Paris, France</p>
<!-- /wp:paragraph --></div>
<!-- /wp:column -->
<!-- wp:column {"verticalAlignment":"center"} -->
<div class="wp-block-column is-vertically-aligned-center"><!-- wp:social-links {"align":"right","className":"is-style-twentytwentyone-social-icons-color"} -->
<ul class="wp-block-social-links alignright is-style-twentytwentyone-social-icons-color"><!-- wp:social-link {"url":"https://wordpress.org","service":"wordpress"} /-->
<!-- wp:social-link {"url":"https://www.facebook.com/WordPress/","service":"facebook"} /-->
<!-- wp:social-link {"url":"https://twitter.com/WordPress","service":"twitter"} /-->
<!-- wp:social-link {"url":"https://www.youtube.com/wordpress","service":"youtube"} /--></ul>
<!-- /wp:social-links --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->',
)
);


// Tests with InnerBlocks like Buttons.
register_block_pattern(
'buttons/rigas',
array(
'title' => __( 'Buttons v1', 'gutenberg' ),
'scope' => array(
'inserter' => false,
'transform' => array( 'core/buttons' ),
),
'content' => '<!-- wp:columns -->
<div class="wp-block-columns"><!-- wp:column -->
<div class="wp-block-column"><!-- wp:buttons {"contentJustification":"center","orientation":"vertical"} -->
<div class="wp-block-buttons is-content-justification-center is-vertical"><!-- wp:button -->
<div class="wp-block-button"><a class="wp-block-button__link">Hello</a></div>
<!-- /wp:button -->
<!-- wp:button {"style":{"color":{"background":"#4acbc3"}}} -->
<div class="wp-block-button"><a class="wp-block-button__link has-background" style="background-color:#4acbc3">Buttons</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:column -->
<!-- wp:column -->
<div class="wp-block-column"><!-- wp:buttons {"contentJustification":"center","orientation":"vertical"} -->
<div class="wp-block-buttons is-content-justification-center is-vertical"><!-- wp:button {"style":{"color":{"background":"#229fd5"}}} -->
<div class="wp-block-button"><a class="wp-block-button__link has-background" style="background-color:#229fd5">Scoped</a></div>
<!-- /wp:button -->
<!-- wp:button {"style":{"color":{"background":"#ce9ddf"}}} -->
<div class="wp-block-button"><a class="wp-block-button__link has-background" style="background-color:#ce9ddf">Pattern</a></div>
<!-- /wp:button --></div>
<!-- /wp:buttons --></div>
<!-- /wp:column --></div>
<!-- /wp:columns -->',
)
);

0 comments on commit 617f547

Please sign in to comment.