Skip to content

Commit

Permalink
Add experimental flag
Browse files Browse the repository at this point in the history
  • Loading branch information
noisysocks committed Feb 20, 2024
1 parent a036614 commit df65b36
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 3 additions & 0 deletions lib/experimental/editor-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ function gutenberg_enable_experiments() {
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-color-randomizer', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableColorRandomizer = true', 'before' );
}
if ( $gutenberg_experiments && array_key_exists( 'gutenberg-grid-interactivity', $gutenberg_experiments ) ) {
wp_add_inline_script( 'wp-block-editor', 'window.__experimentalEnableGridInteractivity = true', 'before' );
}
if ( gutenberg_is_experiment_enabled( 'gutenberg-no-tinymce' ) ) {
wp_add_inline_script( 'wp-block-library', 'window.__experimentalDisableTinymce = true', 'before' );
}
Expand Down
14 changes: 14 additions & 0 deletions lib/experiments-page.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ function gutenberg_initialize_experiments_settings() {
'id' => 'gutenberg-color-randomizer',
)
);

add_settings_field(
'gutenberg-form-blocks',
__( 'Form and input blocks ', 'gutenberg' ),
Expand All @@ -101,6 +102,19 @@ function gutenberg_initialize_experiments_settings() {
'id' => 'gutenberg-form-blocks',
)
);

add_settings_field(
'gutenberg-grid-interactivity',

Check failure on line 107 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
__( 'Grid interactivty ', 'gutenberg' ),

Check failure on line 108 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
'gutenberg_display_experiment_field',

Check failure on line 109 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
'gutenberg-experiments',

Check failure on line 110 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
'gutenberg_experiments_section',

Check failure on line 111 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
array(

Check failure on line 112 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
'label' => __( 'Test enhancements to the Grid block that let you move and resize items in the editor canvas.', 'gutenberg' ),

Check failure on line 113 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
'id' => 'gutenberg-grid-interactivity',

Check failure on line 114 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
)

Check failure on line 115 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed
);

Check failure on line 116 in lib/experiments-page.php

View workflow job for this annotation

GitHub Actions / PHP coding standards

Tabs must be used to indent lines; spaces are not allowed

add_settings_field(
'gutenberg-no-tinymce',
__( 'Disable TinyMCE and Classic block', 'gutenberg' ),
Expand Down
3 changes: 3 additions & 0 deletions packages/block-editor/src/hooks/layout-child.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ function ChildLayoutControlsPure( { clientId, style, setAttributes } ) {
if ( parentLayout.type !== 'grid' ) {
return null;
}
if ( ! window.__experimentalEnableGridInteractivity ) {
return null;
}
return (
<>
<GridVisualizer clientId={ rootClientId } />
Expand Down
4 changes: 3 additions & 1 deletion packages/block-editor/src/layouts/grid.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,9 @@ export default {
onChange={ onChange }
/>
) }
<GridVisualizer clientId={ clientId } />
{ window.__experimentalEnableGridInteractivity && (
<GridVisualizer clientId={ clientId } />
) }
</>
);
},
Expand Down

0 comments on commit df65b36

Please sign in to comment.