@wordpress/create-block-tutorial-template 1.4.0 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +10 -0
- package/README.md +8 -2
- package/{templates/src → block-templates}/edit.js.mustache +5 -6
- package/block-templates/editor.scss.mustache +13 -0
- package/{templates/src → block-templates}/index.js.mustache +0 -2
- package/{templates/src → block-templates}/save.js.mustache +0 -0
- package/{templates/src → block-templates}/style.scss.mustache +0 -0
- package/index.js +2 -2
- package/package.json +2 -2
- package/{templates → plugin-templates}/$slug.php.mustache +11 -2
- package/{templates → plugin-templates}/readme.txt.mustache +0 -0
- package/templates/src/editor.scss.mustache +0 -14
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,16 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 2.0.0 (2022-03-03)
|
|
6
|
+
|
|
7
|
+
### Breaking Change
|
|
8
|
+
|
|
9
|
+
- Bring project's template compatibility with `@wordpress/create-block` v3 ([#39049](https://github.com/WordPress/gutenberg/pull/39049)).
|
|
10
|
+
|
|
11
|
+
### Enhancement
|
|
12
|
+
|
|
13
|
+
- Update project template configuration and templates to synchronize with the updated [Create a Block Tutorial](https://developer.wordpress.org/block-editor/getting-started/create-block/) ([#39049](https://github.com/WordPress/gutenberg/pull/39049)).
|
|
14
|
+
|
|
5
15
|
## 1.4.0 (2022-01-27)
|
|
6
16
|
|
|
7
17
|
### Enhancement
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Create Block Tutorial Template
|
|
2
2
|
|
|
3
|
-
This is a template for [`@wordpress/create-block`](/packages/create-block/README.md) that is the finished version of the block in the official [WordPress Tutorial](/docs/getting-started/create-block/README.md) for the block editor.
|
|
3
|
+
This is a template for [`@wordpress/create-block`](https://github.com/WordPress/gutenberg/tree/HEAD/packages/create-block/README.md) that is the finished version of the block in the official [WordPress Tutorial](https://github.com/WordPress/gutenberg/tree/HEAD/docs/getting-started/create-block/README.md) for the block editor.
|
|
4
4
|
|
|
5
5
|
## Usage
|
|
6
6
|
|
|
@@ -10,4 +10,10 @@ This block template can be used by running the following command:
|
|
|
10
10
|
npx @wordpress/create-block --template @wordpress/create-block-tutorial-template
|
|
11
11
|
```
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
## Contributing to this package
|
|
14
|
+
|
|
15
|
+
This is an individual package that's part of the Gutenberg project. The project is organized as a monorepo. It's made up of multiple self-contained software packages, each with a specific purpose. The packages in this monorepo are published to [npm](https://www.npmjs.com/) and used by [WordPress](https://make.wordpress.org/core/) as well as other software projects.
|
|
16
|
+
|
|
17
|
+
To find out more about contributing to this package or Gutenberg as a whole, please read the project's main [contributor guide](https://github.com/WordPress/gutenberg/tree/HEAD/CONTRIBUTING.md).
|
|
18
|
+
|
|
19
|
+
<br /><br /><p align="center"><img src="https://s.w.org/style/images/codeispoetry.png?1" alt="Code is Poetry." /></p>
|
|
@@ -28,11 +28,10 @@ import { useBlockProps } from '@wordpress/block-editor';
|
|
|
28
28
|
export default function Edit( { attributes, setAttributes } ) {
|
|
29
29
|
const blockProps = useBlockProps();
|
|
30
30
|
return (
|
|
31
|
-
<
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
</div>
|
|
31
|
+
<TextControl
|
|
32
|
+
{ ...blockProps }
|
|
33
|
+
value={ attributes.message }
|
|
34
|
+
onChange={ ( val ) => setAttributes( { message: val } ) }
|
|
35
|
+
/>
|
|
37
36
|
);
|
|
38
37
|
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The following styles get applied inside the editor only.
|
|
3
|
+
*
|
|
4
|
+
* Replace them with your own styles or remove the file completely.
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
.wp-block-{{namespace}}-{{slug}} input[type='text'] {
|
|
8
|
+
font-family: Gilbert;
|
|
9
|
+
font-size: 64px;
|
|
10
|
+
color: inherit;
|
|
11
|
+
background: inherit;
|
|
12
|
+
border: 0;
|
|
13
|
+
}
|
|
File without changes
|
|
File without changes
|
package/index.js
CHANGED
|
@@ -6,7 +6,6 @@ const { join } = require( 'path' );
|
|
|
6
6
|
module.exports = {
|
|
7
7
|
defaultValues: {
|
|
8
8
|
slug: 'gutenpride',
|
|
9
|
-
namespace: 'create-block-tutorial',
|
|
10
9
|
category: 'text',
|
|
11
10
|
title: 'Gutenpride',
|
|
12
11
|
description:
|
|
@@ -23,6 +22,7 @@ module.exports = {
|
|
|
23
22
|
html: false,
|
|
24
23
|
},
|
|
25
24
|
},
|
|
26
|
-
|
|
25
|
+
pluginTemplatesPath: join( __dirname, 'plugin-templates' ),
|
|
26
|
+
blockTemplatesPath: join( __dirname, 'block-templates' ),
|
|
27
27
|
assetsPath: join( __dirname, 'assets' ),
|
|
28
28
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/create-block-tutorial-template",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Template for @wordpress/create-block used in the official WordPress tutorial.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -21,5 +21,5 @@
|
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
|
-
"gitHead": "
|
|
24
|
+
"gitHead": "bc1ccad6698ada7ea0096df8e55a188fcd3a1a26"
|
|
25
25
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
<?php
|
|
2
2
|
/**
|
|
3
3
|
* Plugin Name: {{title}}
|
|
4
|
+
{{#pluginURI}}
|
|
5
|
+
* Plugin URI: {{{pluginURI}}}
|
|
6
|
+
{{/pluginURI}}
|
|
4
7
|
{{#description}}
|
|
5
8
|
* Description: {{description}}
|
|
6
9
|
{{/description}}
|
|
10
|
+
* Version: {{version}}
|
|
7
11
|
* Requires at least: 5.8
|
|
8
12
|
* Requires PHP: 7.0
|
|
9
|
-
* Version: {{version}}
|
|
10
13
|
{{#author}}
|
|
11
14
|
* Author: {{author}}
|
|
12
15
|
{{/author}}
|
|
@@ -17,6 +20,12 @@
|
|
|
17
20
|
* License URI: {{{licenseURI}}}
|
|
18
21
|
{{/licenseURI}}
|
|
19
22
|
* Text Domain: {{textdomain}}
|
|
23
|
+
{{#domainPath}}
|
|
24
|
+
* Domain Path: {{{domainPath}}}
|
|
25
|
+
{{/domainPath}}
|
|
26
|
+
{{#updateURI}}
|
|
27
|
+
* Update URI: {{{updateURI}}}
|
|
28
|
+
{{/updateURI}}
|
|
20
29
|
*
|
|
21
30
|
* @package {{namespace}}
|
|
22
31
|
*/
|
|
@@ -29,6 +38,6 @@
|
|
|
29
38
|
* @see https://developer.wordpress.org/reference/functions/register_block_type/
|
|
30
39
|
*/
|
|
31
40
|
function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
|
|
32
|
-
register_block_type( __DIR__ );
|
|
41
|
+
register_block_type( __DIR__ . '/build' );
|
|
33
42
|
}
|
|
34
43
|
add_action( 'init', '{{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init' );
|
|
File without changes
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The following styles get applied inside the editor only.
|
|
3
|
-
*
|
|
4
|
-
* Replace them with your own styles or remove the file completely.
|
|
5
|
-
*/
|
|
6
|
-
|
|
7
|
-
.wp-block-{{namespace}}-{{slug}} {
|
|
8
|
-
border: 1px dotted #f00;
|
|
9
|
-
|
|
10
|
-
input[type="text"] {
|
|
11
|
-
font-family: Gilbert, sans-serif;
|
|
12
|
-
font-size: 64px;
|
|
13
|
-
}
|
|
14
|
-
}
|