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

Update Example: Editable (ESNext) block. #156

Merged
merged 5 commits into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 1 addition & 1 deletion 01-basic-esnext/index.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ function gutenberg_examples_01_esnext_load_textdomain() {
function gutenberg_examples_01_esnext_register_block() {

// Register the block by passing the location of block.json to register_block_type.
register_block_type( __DIR__);
register_block_type( __DIR__ );

if ( function_exists( 'wp_set_script_translations' ) ) {
/**
Expand Down
4 changes: 2 additions & 2 deletions 01-basic-esnext/src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export const blockStyle = {
const { name, ...settings } = json;

// Register the block
registerBlockType( name, {
registerBlockType(name, {
...settings,
edit, // Object shorthand property - same as writing: edit: edit,
save, // Object shorthand property - same as writing: save: save,
} );
});
3 changes: 3 additions & 0 deletions 03-editable-esnext/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": [ "plugin:@wordpress/eslint-plugin/recommended" ]
}
23 changes: 23 additions & 0 deletions 03-editable-esnext/block.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"apiVersion": 2,
"name": "gutenberg-examples/example-03-editable-esnext",
"title":"Example: Editable (ESNext)",
"textdomain": "gutenberg-examples",
"icon": "universal-access-alt",
"category": "layout",
"attributes": {
"content": {
"type": "array",
"source": "children",
"selector": "p"
}
},
"example": {
"attributes": {
"content": "Hello world"
}
},
"editorScript": "file:./build/index.js",
"editorStyle": "file:./build/index.css",
"style": "file:./build/style-index.css"
}
2 changes: 1 addition & 1 deletion 03-editable-esnext/build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-i18n' ), 'version' => 'ebd43150f92e5b16ea18cc759afffddc');
<?php return array('dependencies' => array('wp-block-editor', 'wp-blocks', 'wp-element', 'wp-polyfill'), 'version' => 'ddbe81c5cfe900696403a32e869fef44');
16 changes: 16 additions & 0 deletions 03-editable-esnext/build/index.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions 03-editable-esnext/build/index.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading