Full Site Editing - Version 3.7328

Version Description

Download this release

Release Info

Developer ramonopoly
Plugin Icon wp plugin Full Site Editing
Version 3.7328
Comparing to
See all releases

Code changes from version 3.7286 to 3.7328

block-patterns/class-block-patterns-from-api.php CHANGED
@@ -133,6 +133,7 @@ class Block_Patterns_From_API {
133
  $viewport_width = isset( $pattern['pattern_meta']['viewport_width'] ) ? intval( $pattern['pattern_meta']['viewport_width'] ) : 1280;
134
  $viewport_width = $viewport_width < 320 ? 320 : $viewport_width;
135
  $pattern_name = self::PATTERN_NAMESPACE . $pattern['name'];
 
136
 
137
  $results[ $pattern_name ] = register_block_pattern(
138
  $pattern_name,
@@ -145,6 +146,7 @@ class Block_Patterns_From_API {
145
  $pattern['categories']
146
  ),
147
  'isPremium' => $is_premium,
 
148
  )
149
  );
150
  }
133
  $viewport_width = isset( $pattern['pattern_meta']['viewport_width'] ) ? intval( $pattern['pattern_meta']['viewport_width'] ) : 1280;
134
  $viewport_width = $viewport_width < 320 ? 320 : $viewport_width;
135
  $pattern_name = self::PATTERN_NAMESPACE . $pattern['name'];
136
+ $block_types = $this->utils->maybe_get_pattern_block_types_from_pattern_meta( $pattern );
137
 
138
  $results[ $pattern_name ] = register_block_pattern(
139
  $pattern_name,
146
  $pattern['categories']
147
  ),
148
  'isPremium' => $is_premium,
149
+ 'blockTypes' => $block_types,
150
  )
151
  );
152
  }
block-patterns/class-block-patterns-utils.php CHANGED
@@ -86,4 +86,33 @@ class Block_Patterns_Utils {
86
  $language = function_exists( 'get_blog_lang_code' ) ? get_blog_lang_code() : get_locale();
87
  return \A8C\FSE\Common\get_iso_639_locale( $language );
88
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
89
  }
86
  $language = function_exists( 'get_blog_lang_code' ) ? get_blog_lang_code() : get_locale();
87
  return \A8C\FSE\Common\get_iso_639_locale( $language );
88
  }
89
+
90
+ /**
91
+ * Check for block type values in the pattern_meta tag.
92
+ * When tags have a prefix of `block_type_`, we expect the remaining suffix to be a blockType value.
93
+ * We'll add these values to the `(array) blockType` options property when registering the pattern
94
+ * via `register_block_pattern`.
95
+ *
96
+ * @param array $pattern A pattern with a 'pattern_meta' array.
97
+ *
98
+ * @return array An array of block types defined in pattern meta.
99
+ */
100
+ public function maybe_get_pattern_block_types_from_pattern_meta( $pattern ) {
101
+ $block_types = array();
102
+
103
+ if ( ! isset( $pattern['pattern_meta'] ) || empty( $pattern['pattern_meta'] ) ) {
104
+ return $block_types;
105
+ }
106
+
107
+ foreach ( $pattern['pattern_meta'] as $pattern_meta => $value ) {
108
+ // Match against tags starting with `block_type_`.
109
+ $split_slug = preg_split( '/^block_type_/', $pattern_meta );
110
+
111
+ if ( isset( $split_slug[1] ) ) {
112
+ $block_types[] = $split_slug[1];
113
+ }
114
+ }
115
+
116
+ return $block_types;
117
+ }
118
  }
block-patterns/test/class-block-patterns-from-api-test.php CHANGED
@@ -1,7 +1,9 @@
1
  <?php
2
  /**
3
- * Coming Soon Tests File
4
- * Run: yarn run test:php --testsuite block-patterns
 
 
5
  *
6
  * @package full-site-editing-plugin
7
  */
@@ -19,14 +21,14 @@ class Block_Patterns_From_Api_Test extends TestCase {
19
  /**
20
  * PHPUnit_Framework_MockObject_MockObject.
21
  *
22
- * @var string
23
  */
24
  protected $utils_mock;
25
 
26
  /**
27
  * Representation of a Pattern as returned by the API.
28
  *
29
- * @var string
30
  */
31
  protected $pattern_mock_object;
32
 
1
  <?php
2
  /**
3
+ * Block patterns API tests
4
+ * Run:
5
+ * cd apps/editing-toolkit
6
+ * yarn run test:php --testsuite block-patterns
7
  *
8
  * @package full-site-editing-plugin
9
  */
21
  /**
22
  * PHPUnit_Framework_MockObject_MockObject.
23
  *
24
+ * @var object
25
  */
26
  protected $utils_mock;
27
 
28
  /**
29
  * Representation of a Pattern as returned by the API.
30
  *
31
+ * @var array
32
  */
33
  protected $pattern_mock_object;
34
 
block-patterns/test/class-block-patterns-utils-test.php ADDED
@@ -0,0 +1,90 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Block patterns Utils tests
4
+ * Run:
5
+ * cd apps/editing-toolkit
6
+ * yarn run test:php --testsuite block-patterns
7
+ *
8
+ * @package full-site-editing-plugin
9
+ */
10
+
11
+ namespace A8C\FSE;
12
+
13
+ use PHPUnit\Framework\TestCase;
14
+
15
+ require_once __DIR__ . '/../class-block-patterns-utils.php';
16
+
17
+ /**
18
+ * Class Coming_Soon_Test
19
+ */
20
+ class Block_Patterns_Utils_Test extends TestCase {
21
+ /**
22
+ * Block_Patterns_Utils
23
+ *
24
+ * @var object
25
+ */
26
+ protected $utils;
27
+
28
+ /**
29
+ * Pre-test setup.
30
+ */
31
+ public function setUp() {
32
+ parent::setUp();
33
+ $this->utils = new Block_Patterns_Utils();
34
+ }
35
+
36
+ /**
37
+ * Tests that we receive an empty block_types array where there are no block types in pattern_meta
38
+ */
39
+ public function test_should_return_empty_array_from_block_types_check() {
40
+ $test_pattern = $this->get_test_pattern();
41
+ $block_types = $this->utils->maybe_get_pattern_block_types_from_pattern_meta( $test_pattern );
42
+
43
+ $this->assertEmpty( $block_types );
44
+ }
45
+
46
+ /**
47
+ * Tests that we can parse block types from pattern_meta.
48
+ */
49
+ public function test_should_return_block_types_from_patterns_meta() {
50
+ $test_pattern = $this->get_test_pattern(
51
+ array(
52
+ 'pattern_meta' => array(
53
+ 'block_type_core/template-part/footer' => true,
54
+ ),
55
+ )
56
+ );
57
+ $block_types = $this->utils->maybe_get_pattern_block_types_from_pattern_meta( $test_pattern );
58
+
59
+ $this->assertEquals( array( 'core/template-part/footer' ), $block_types );
60
+ }
61
+
62
+ /**
63
+ * Util function from grabbing a test pattern.
64
+ *
65
+ * @param array $new_pattern_values Values to merge into the default array.
66
+ * @return array A test pattern.
67
+ */
68
+ private function get_test_pattern( $new_pattern_values = array() ) {
69
+ $default_pattern = array(
70
+ 'ID' => '1',
71
+ 'site_id' => '2',
72
+ 'title' => 'test title',
73
+ 'name' => 'test pattern name',
74
+ 'description' => 'test description',
75
+ 'html' => '<p>test</p>',
76
+ 'source_url' => 'http;//test',
77
+ 'modified_date' => 'dd:mm:YY',
78
+ 'categories' => array(
79
+ array(
80
+ 'title' => 'test-category',
81
+ ),
82
+ ),
83
+ 'pattern_meta' => array(
84
+ 'is_web' => true,
85
+ ),
86
+ );
87
+
88
+ return array_merge( $default_pattern, $new_pattern_values );
89
+ }
90
+ }
common/hide-plugin-buttons-mobile.scss CHANGED
@@ -1,6 +1,6 @@
1
- @import '~@wordpress/base-styles/mixins';
2
- @import '~@wordpress/base-styles/variables';
3
- @import '~@wordpress/base-styles/breakpoints';
4
 
5
  .interface-pinned-items > button:not( :first-child ) {
6
  @media ( max-width: $break-medium ) {
1
+ @import '@wordpress/base-styles/mixins';
2
+ @import '@wordpress/base-styles/variables';
3
+ @import '@wordpress/base-styles/breakpoints';
4
 
5
  .interface-pinned-items > button:not( :first-child ) {
6
  @media ( max-width: $break-medium ) {
editor-site-launch/src/launch-menu/styles.scss CHANGED
@@ -1,4 +1,4 @@
1
- @import '~@automattic/onboarding/styles/mixins';
2
 
3
  .nux-launch-menu {
4
  h4 {
1
+ @import '@automattic/onboarding/styles/mixins';
2
 
3
  .nux-launch-menu {
4
  h4 {
editor-site-launch/src/launch-modal/styles.scss CHANGED
@@ -1,10 +1,10 @@
1
- @import '~@wordpress/base-styles/mixins';
2
- @import '~@wordpress/base-styles/variables';
3
- @import '~@wordpress/base-styles/breakpoints';
4
- @import '~@wordpress/base-styles/z-index';
5
- @import '~@automattic/typography/styles/variables';
6
- @import '~@automattic/onboarding/styles/variables';
7
- @import '~@automattic/onboarding/styles/mixins';
8
 
9
  body.has-nux-launch-modal {
10
  overflow: hidden;
1
+ @import '@wordpress/base-styles/mixins';
2
+ @import '@wordpress/base-styles/variables';
3
+ @import '@wordpress/base-styles/breakpoints';
4
+ @import '@wordpress/base-styles/z-index';
5
+ @import '@automattic/typography/styles/variables';
6
+ @import '@automattic/onboarding/styles/variables';
7
+ @import '@automattic/onboarding/styles/mixins';
8
 
9
  body.has-nux-launch-modal {
10
  overflow: hidden;
editor-site-launch/src/launch-sidebar/styles.scss CHANGED
@@ -1,5 +1,5 @@
1
- @import '~@wordpress/base-styles/breakpoints';
2
- @import '~@automattic/onboarding/styles/mixins';
3
 
4
  .nux-launch-sidebar {
5
  @include onboarding-block-margin;
1
+ @import '@wordpress/base-styles/breakpoints';
2
+ @import '@automattic/onboarding/styles/mixins';
3
 
4
  .nux-launch-sidebar {
5
  @include onboarding-block-margin;
editor-site-launch/src/launch-step/styles.scss CHANGED
@@ -1,7 +1,7 @@
1
- @import '~@wordpress/base-styles/variables';
2
- @import '~@wordpress/base-styles/breakpoints';
3
- @import '~@automattic/typography/styles/fonts';
4
- @import '~@automattic/onboarding/styles/mixins';
5
 
6
  .nux-launch-step__header {
7
  @include onboarding-heading-padding;
1
+ @import '@wordpress/base-styles/variables';
2
+ @import '@wordpress/base-styles/breakpoints';
3
+ @import '@automattic/typography/styles/fonts';
4
+ @import '@automattic/onboarding/styles/mixins';
5
 
6
  .nux-launch-step__header {
7
  @include onboarding-heading-padding;
editor-site-launch/src/launch-steps/final-step/styles.scss CHANGED
@@ -1,5 +1,5 @@
1
- @import '~@automattic/typography/styles/variables';
2
- @import '~@automattic/onboarding/styles/mixins';
3
 
4
  // TODO: This is former dark-gray-500 from @wordpress/base-styles.
5
  // Replace with a color from the standard palette.
1
+ @import '@automattic/typography/styles/variables';
2
+ @import '@automattic/onboarding/styles/mixins';
3
 
4
  // TODO: This is former dark-gray-500 from @wordpress/base-styles.
5
  // Replace with a color from the standard palette.
editor-site-launch/src/launch-steps/name-step/styles.scss CHANGED
@@ -1,4 +1,4 @@
1
- @import '~@automattic/onboarding/styles/variables';
2
 
3
  .nux-launch-step__input {
4
  position: relative;
1
+ @import '@automattic/onboarding/styles/variables';
2
 
3
  .nux-launch-step__input {
4
  position: relative;
editor-site-launch/src/launch-steps/plan-step/styles.scss CHANGED
@@ -1,5 +1,5 @@
1
- @import '~@automattic/onboarding/styles/mixins';
2
- @import '~@automattic/plans-grid/src/variables';
3
 
4
  .nux-launch-modal.step-plan {
5
  // Remove extraneous whitespace after plans details.
1
+ @import '@automattic/onboarding/styles/mixins';
2
+ @import '@automattic/plans-grid/src/variables';
3
 
4
  .nux-launch-modal.step-plan {
5
  // Remove extraneous whitespace after plans details.
full-site-editing-plugin.php CHANGED
@@ -2,7 +2,7 @@
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
- * Version: 3.7286
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
@@ -42,7 +42,7 @@ namespace A8C\FSE;
42
  *
43
  * @var string
44
  */
45
- define( 'A8C_ETK_PLUGIN_VERSION', '3.7286' );
46
 
47
  // Always include these helper files for dotcom FSE.
48
  require_once __DIR__ . '/dotcom-fse/helpers.php';
2
  /**
3
  * Plugin Name: WordPress.com Editing Toolkit
4
  * Description: Enhances your page creation workflow within the Block Editor.
5
+ * Version: 3.7328
6
  * Author: Automattic
7
  * Author URI: https://automattic.com/wordpress-plugins/
8
  * License: GPLv2 or later
42
  *
43
  * @var string
44
  */
45
+ define( 'A8C_ETK_PLUGIN_VERSION', '3.7328' );
46
 
47
  // Always include these helper files for dotcom FSE.
48
  require_once __DIR__ . '/dotcom-fse/helpers.php';
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: automattic
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.5
5
  Tested up to: 5.6
6
- Stable tag: 3.7286
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
3
  Tags: block, blocks, editor, gutenberg, page
4
  Requires at least: 5.5
5
  Tested up to: 5.6
6
+ Stable tag: 3.7328
7
  Requires PHP: 5.6.20
8
  License: GPLv2 or later
9
  License URI: https://www.gnu.org/licenses/gpl-2.0.html
starter-page-templates/index.scss CHANGED
@@ -1,4 +1,4 @@
1
- @import '~@automattic/page-pattern-modal/src/styles/page-pattern-modal';
2
 
3
  .sidebar-modal-opener {
4
  display: flex;
1
+ @import '@automattic/page-pattern-modal/src/styles/page-pattern-modal';
2
 
3
  .sidebar-modal-opener {
4
  display: flex;
wpcom-block-editor-nav-sidebar/src/components/create-page/style.scss CHANGED
@@ -1,4 +1,4 @@
1
- @import '~@wordpress/base-styles/colors';
2
 
3
  // TODO: This is former light-gray-900 from @wordpress/base-styles.
4
  // Replace with a color from the standard palette.
1
+ @import '@wordpress/base-styles/colors';
2
 
3
  // TODO: This is former light-gray-900 from @wordpress/base-styles.
4
  // Replace with a color from the standard palette.
wpcom-block-editor-nav-sidebar/src/components/nav-item/style.scss CHANGED
@@ -1,5 +1,5 @@
1
- @import '~@wordpress/base-styles/colors';
2
- @import '~@wordpress/base-styles/variables';
3
 
4
  // TODO: These colors used to be in @wordpress/base-styles.
5
  // Replace them with colors from the updated standard palette.
1
+ @import '@wordpress/base-styles/colors';
2
+ @import '@wordpress/base-styles/variables';
3
 
4
  // TODO: These colors used to be in @wordpress/base-styles.
5
  // Replace them with colors from the updated standard palette.
wpcom-block-editor-nav-sidebar/src/components/nav-sidebar/style.scss CHANGED
@@ -1,7 +1,7 @@
1
- @import '~@wordpress/base-styles/colors';
2
- @import '~@wordpress/base-styles/mixins';
3
- @import '~@wordpress/base-styles/variables';
4
- @import '~@wordpress/base-styles/z-index';
5
 
6
  $sidebar-width: 272px;
7
  $sidebar-transition-period: 100ms;
1
+ @import '@wordpress/base-styles/colors';
2
+ @import '@wordpress/base-styles/mixins';
3
+ @import '@wordpress/base-styles/variables';
4
+ @import '@wordpress/base-styles/z-index';
5
 
6
  $sidebar-width: 272px;
7
  $sidebar-transition-period: 100ms;
wpcom-block-editor-nav-sidebar/src/components/toggle-sidebar-button/style.scss CHANGED
@@ -1,5 +1,5 @@
1
- @import '~@wordpress/base-styles/variables';
2
- @import '~@wordpress/base-styles/mixins';
3
  @import '../nav-sidebar/style.scss';
4
 
5
  .wpcom-block-editor-nav-sidebar-toggle-sidebar-button__button {
1
+ @import '@wordpress/base-styles/variables';
2
+ @import '@wordpress/base-styles/mixins';
3
  @import '../nav-sidebar/style.scss';
4
 
5
  .wpcom-block-editor-nav-sidebar-toggle-sidebar-button__button {
wpcom-block-editor-nux/src/welcome-modal/style.scss CHANGED
@@ -1,8 +1,8 @@
1
  // @TODO: remove the ignore rule and replace font sizes accordingly
2
  /* stylelint-disable scales/font-size */
3
 
4
- @import '~@automattic/typography/styles/fonts';
5
- @import '~@automattic/onboarding/styles/mixins';
6
 
7
  $wpcom-modal-breakpoint: 660px;
8
 
1
  // @TODO: remove the ignore rule and replace font sizes accordingly
2
  /* stylelint-disable scales/font-size */
3
 
4
+ @import '@automattic/typography/styles/fonts';
5
+ @import '@automattic/onboarding/styles/mixins';
6
 
7
  $wpcom-modal-breakpoint: 660px;
8
 
wpcom-block-editor-nux/src/welcome-tour/style-tour.scss CHANGED
@@ -1,7 +1,7 @@
1
- @import '~@wordpress/base-styles/colors';
2
- @import '~@wordpress/base-styles/mixins';
3
- @import '~@wordpress/base-styles/variables';
4
- @import '~@wordpress/base-styles/z-index';
5
 
6
  $welcome-tour-button-background-color: #32373c; // former $dark-gray-700. TODO: replace with standard color
7
 
1
+ @import '@wordpress/base-styles/colors';
2
+ @import '@wordpress/base-styles/mixins';
3
+ @import '@wordpress/base-styles/variables';
4
+ @import '@wordpress/base-styles/z-index';
5
 
6
  $welcome-tour-button-background-color: #32373c; // former $dark-gray-700. TODO: replace with standard color
7