@wordpress/create-block-tutorial-template 1.4.1 → 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 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
@@ -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
- <div { ...blockProps }>
32
- <TextControl
33
- value={ attributes.message }
34
- onChange={ ( val ) => setAttributes( { message: val } ) }
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
+ }
@@ -36,12 +36,10 @@ registerBlockType( '{{namespace}}/{{slug}}', {
36
36
  message: '{{title}}',
37
37
  },
38
38
  },
39
-
40
39
  /**
41
40
  * @see ./edit.js
42
41
  */
43
42
  edit: Edit,
44
-
45
43
  /**
46
44
  * @see ./save.js
47
45
  */
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
- templatesPath: join( __dirname, 'templates' ),
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": "1.4.1",
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": "2e4922861e49f5a090f9dc52056165092cfba163"
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' );
@@ -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
- }