Skip to content
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

Prepare for adding the Widgets block editor to Core #32136

Merged
merged 4 commits into from
May 24, 2021
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/block-library/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

## Unreleased

### New Features

- Marks the `core/legacy-widget` block as stable.

## 3.1.0 (2021-05-20)

## 3.0.0 (2021-05-14)
Expand Down
6 changes: 2 additions & 4 deletions packages/block-library/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export const __experimentalGetCoreBlocks = () => [
mediaText,
latestComments,
latestPosts,
legacyWidget,
missing,
more,
nextpage,
Expand Down Expand Up @@ -229,15 +230,12 @@ export const registerCoreBlocks = (
*/
export const __experimentalRegisterExperimentalCoreBlocks =
process.env.GUTENBERG_PHASE === 2
? ( { enableLegacyWidgetBlock, enableFSEBlocks } = {} ) => {
? ( { enableFSEBlocks } = {} ) => {
[
navigation,
navigationLink,
homeLink,

// Register Legacy Widget block.
...( enableLegacyWidgetBlock ? [ legacyWidget ] : [] ),

// Register Full Site Editing Blocks.
...( enableFSEBlocks
? [
Expand Down
1 change: 0 additions & 1 deletion packages/customize-widgets/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "@wordpress/customize-widgets",
"private": true,
"version": "1.0.0-prerelease",
"description": "Widgets blocks in Customizer Module for WordPress.",
"author": "The WordPress Contributors",
Expand Down
7 changes: 0 additions & 7 deletions packages/customize-widgets/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import { render } from '@wordpress/element';
import {
registerCoreBlocks,
__experimentalGetCoreBlocks,
__experimentalRegisterExperimentalCoreBlocks,
} from '@wordpress/block-library';
import { registerLegacyWidgetVariations } from '@wordpress/widgets';

Expand All @@ -31,12 +30,6 @@ export function initialize( editorName, blockEditorSettings ) {
);
registerCoreBlocks( coreBlocks );

if ( process.env.GUTENBERG_PHASE === 2 ) {
__experimentalRegisterExperimentalCoreBlocks( {
enableLegacyWidgetBlock: true,
} );
}
noisysocks marked this conversation as resolved.
Show resolved Hide resolved

registerLegacyWidgetVariations( blockEditorSettings );

const SidebarControl = getSidebarControl( blockEditorSettings );
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:legacy-widget {"idBase":"search","instance":{"encoded":"YTowOnt9","hash":"b9b82f721929717273108125217fbcd9","raw":{}}} /-->
18 changes: 18 additions & 0 deletions packages/e2e-tests/fixtures/blocks/core__legacy-widget.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[
{
"clientId": "_clientId_0",
"name": "core/legacy-widget",
"isValid": true,
"attributes": {
"id": null,
"idBase": "search",
"instance": {
"encoded": "YTowOnt9",
"hash": "b9b82f721929717273108125217fbcd9",
"raw": {}
}
},
"innerBlocks": [],
"originalContent": ""
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
[
{
"blockName": "core/legacy-widget",
"attrs": {
"idBase": "search",
"instance": {
"encoded": "YTowOnt9",
"hash": "b9b82f721929717273108125217fbcd9",
"raw": {}
}
},
"innerBlocks": [],
"innerHTML": "",
"innerContent": []
}
]
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
<!-- wp:legacy-widget {"idBase":"search","instance":{"encoded":"YTowOnt9","hash":"b9b82f721929717273108125217fbcd9","raw":{}}} /-->
6 changes: 0 additions & 6 deletions packages/edit-widgets/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import { render } from '@wordpress/element';
import {
registerCoreBlocks,
__experimentalGetCoreBlocks,
__experimentalRegisterExperimentalCoreBlocks,
} from '@wordpress/block-library';
import { __experimentalFetchLinkSuggestions as fetchLinkSuggestions } from '@wordpress/core-data';
import { registerLegacyWidgetVariations } from '@wordpress/widgets';
Expand All @@ -33,11 +32,6 @@ export function initialize( id, settings ) {
( block ) => ! [ 'core/more' ].includes( block.name )
);
registerCoreBlocks( coreBlocks );
if ( process.env.GUTENBERG_PHASE === 2 ) {
__experimentalRegisterExperimentalCoreBlocks( {
enableLegacyWidgetBlock: true,
} );
}
registerLegacyWidgetVariations( settings );
registerBlock( widgetArea );
settings.__experimentalFetchLinkSuggestions = ( search, searchOptions ) =>
Expand Down