-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bootstrap the widgets page playground (#13912)
- Loading branch information
1 parent
f4b65e6
commit e3e3b53
Showing
16 changed files
with
202 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Validating CODEOWNERS rules …
This file contains 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 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 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 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 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 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 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 |
---|---|---|
@@ -0,0 +1,35 @@ | ||
<?php | ||
/** | ||
* Bootstraping the Gutenberg widgets page. | ||
* | ||
* @package gutenberg | ||
*/ | ||
|
||
/** | ||
* The main entry point for the Gutenberg widgets page. | ||
* | ||
* @since 5.2.0 | ||
*/ | ||
function the_gutenberg_widgets() { | ||
?> | ||
<div class="blocks-widgets-container"> | ||
</div> | ||
<?php | ||
} | ||
|
||
/** | ||
* Initialize the Gutenberg widgets page. | ||
* | ||
* @since 5.2.0 | ||
* | ||
* @param string $hook Page. | ||
*/ | ||
function gutenberg_widgets_init( $hook ) { | ||
if ( 'gutenberg_page_gutenberg-widgets' !== $hook ) { | ||
return; | ||
} | ||
|
||
wp_enqueue_script( 'wp-edit-widgets' ); | ||
wp_enqueue_style( 'wp-edit-widgets' ); | ||
} | ||
add_action( 'admin_enqueue_scripts', 'gutenberg_widgets_init' ); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
This file contains 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 |
---|---|---|
@@ -0,0 +1,5 @@ | ||
## 1.0.0 (Unreleased) | ||
|
||
### New Features | ||
|
||
- Initial version of the module. |
This file contains 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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Edit Widgets | ||
|
||
Widgets Page Module for WordPress. | ||
|
||
> This package is meant to be used only with WordPress core. Feel free to use it in your own project but please keep in mind that it might never get fully documented. | ||
## Installation | ||
|
||
Install the module | ||
|
||
```bash | ||
npm install @wordpress/edit-widgets | ||
``` | ||
|
||
_This package assumes that your code will run in an **ES2015+** environment. If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using [core-js](https://github.com/zloirock/core-js) or [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill) will add support for these methods. Learn more about it in [Babel docs](https://babeljs.io/docs/en/next/caveats)._ | ||
|
||
<br/><br/><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p> |
This file contains 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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
{ | ||
"name": "@wordpress/edit-widgets", | ||
"version": "0.0.1-alpha.0", | ||
"private": true, | ||
"description": "Widgets Page module for WordPress..", | ||
"author": "The WordPress Contributors", | ||
"license": "GPL-2.0-or-later", | ||
"keywords": [ | ||
"wordpress" | ||
], | ||
"homepage": "https://github.com/WordPress/gutenberg/tree/master/packages/edit-widgets/README.md", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/WordPress/gutenberg.git" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/WordPress/gutenberg/issues" | ||
}, | ||
"main": "build/index.js", | ||
"module": "build-module/index.js", | ||
"react-native": "src/index", | ||
"dependencies": { | ||
"@babel/runtime": "^7.0.0", | ||
"@wordpress/element": "file:../element" | ||
}, | ||
"publishConfig": { | ||
"access": "public" | ||
} | ||
} |
This file contains 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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/** | ||
* WordPress dependencies | ||
*/ | ||
import { render } from '@wordpress/element'; | ||
|
||
render( | ||
<h1>Widgets (beta)</h1>, | ||
document.querySelector( '.blocks-widgets-container' ) | ||
); |
This file contains 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 |
---|---|---|
@@ -0,0 +1,64 @@ | ||
|
||
// In order to use mix-blend-mode, this element needs to have an explicitly set background-color | ||
// We scope it to .wp-toolbar to be wp-admin only, to prevent bleed into other implementations | ||
html.wp-toolbar { | ||
background: $white; | ||
} | ||
|
||
body.gutenberg_page_gutenberg-widgets { | ||
background: $white; | ||
|
||
#wpcontent { | ||
padding-left: 0; | ||
} | ||
|
||
#wpbody-content { | ||
padding-bottom: 0; | ||
} | ||
|
||
/* We hide legacy notices in Gutenberg, because they were not designed in a way that scaled well. | ||
Plugins can use Gutenberg notices if they need to pass on information to the user when they are editing. */ | ||
#wpbody-content > div:not(.blocks-widgets-container):not(#screen-meta) { | ||
display: none; | ||
} | ||
|
||
#wpfooter { | ||
display: none; | ||
} | ||
|
||
.a11y-speak-region { | ||
left: -1px; | ||
top: -1px; | ||
} | ||
|
||
ul#adminmenu a.wp-has-current-submenu::after, | ||
ul#adminmenu > li.current > a.current::after { | ||
border-right-color: $white; | ||
} | ||
|
||
.media-frame select.attachment-filters:last-of-type { | ||
width: auto; | ||
max-width: 100%; | ||
} | ||
} | ||
|
||
.blocks-widgets-container, | ||
// The modals are shown outside the .blocks-widgets-container wrapper, they need these styles | ||
.components-modal__frame { | ||
box-sizing: border-box; | ||
|
||
*, | ||
*::before, | ||
*::after { | ||
box-sizing: inherit; | ||
} | ||
|
||
select { | ||
font-size: $default-font-size; | ||
color: $dark-gray-500; | ||
} | ||
} | ||
|
||
.blocks-widgets-container { | ||
padding: 0 10px; | ||
} |