Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 3051f93
Showing
11 changed files
with
5,634 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"presets": [ "@babel/preset-env", "@babel/preset-react" ] | ||
} |
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,10 @@ | ||
> 1% | ||
ie >= 11 | ||
last 1 Android versions | ||
last 1 ChromeAndroid versions | ||
last 2 Chrome versions | ||
last 2 Firefox versions | ||
last 2 Safari versions | ||
last 2 iOS versions | ||
last 2 Edge versions | ||
last 2 Opera versions |
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,2 @@ | ||
.vscode | ||
node_modules |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
const { registerBlockType } = wp.blocks; | ||
|
||
registerBlockType('gwg/esnext-starter', { | ||
title: 'Get With Gutenberg - ESNext Starter', | ||
category: 'common', | ||
|
||
edit(props) { | ||
return <p className={props.className}>Hello editor.</p>; | ||
}, | ||
|
||
save(props) { | ||
return <p className={props.className}>Hello saved content.</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,4 @@ | ||
|
||
.wp-block-gwg-esnext-starter { | ||
background-color: green; | ||
} |
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,47 @@ | ||
<?php | ||
/** | ||
* Plugin Name: ESNext Starter - Get With Gutenberg | ||
* Plugin URI: https://github.com/Wordpress | ||
* Description: Demonstrate how to start building a Gutenberg block in ESNext. | ||
* Version: 1.0.0 | ||
* Author: Get With Gutenberg | ||
* Author URI: https://getwithgutenberg.com | ||
* Text Domain: gwg | ||
* Domain Path: languages | ||
* License: GPL2+ | ||
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt | ||
*/ | ||
|
||
defined( 'ABSPATH' ) || exit; | ||
|
||
define( 'GWG_ESNEXT_VERSION', '1.0.0' ); | ||
define( 'GWG_ESNEXT_PLUGIN_DIR', dirname( __FILE__ ) ); | ||
define( 'GWG_ESNEXT_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); | ||
|
||
function gwg_block_assets() { | ||
wp_enqueue_style( | ||
'gwg-style-css', | ||
GWG_ESNEXT_PLUGIN_URL . 'style.css', | ||
[], | ||
GWG_ESNEXT_VERSION | ||
); | ||
} | ||
add_action( 'enqueue_block_assets', 'gwg_block_assets' ); | ||
|
||
function gwg_editor_assets() { | ||
wp_enqueue_script( | ||
'gwg-block-js', | ||
GWG_ESNEXT_PLUGIN_URL . 'block.build.js', | ||
[], | ||
GWG_ESNEXT_VERSION, | ||
true // Enqueue script in the footer. | ||
); | ||
|
||
wp_enqueue_style( | ||
'gwg-editor-css', | ||
GWG_ESNEXT_PLUGIN_URL . 'editor.css', | ||
[], | ||
GWG_ESNEXT_VERSION | ||
); | ||
} | ||
add_action( 'enqueue_block_editor_assets', 'gwg_editor_assets' ); |
Oops, something went wrong.