@wordpress/create-block 4.21.0 → 4.23.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/lib/init-block.js CHANGED
@@ -30,7 +30,9 @@ async function initBlockJSON( {
30
30
  editorStyle,
31
31
  style,
32
32
  render,
33
+ viewScript,
33
34
  customBlockJSON,
35
+ example,
34
36
  } ) {
35
37
  info( '' );
36
38
  info( 'Creating a "block.json" file.' );
@@ -52,6 +54,7 @@ async function initBlockJSON( {
52
54
  category,
53
55
  icon: dashicon,
54
56
  description,
57
+ example,
55
58
  attributes,
56
59
  supports,
57
60
  textdomain,
@@ -59,6 +62,7 @@ async function initBlockJSON( {
59
62
  editorStyle,
60
63
  style,
61
64
  render,
65
+ viewScript,
62
66
  ...customBlockJSON,
63
67
  } ).filter( ( [ , value ] ) => !! value )
64
68
  ),
package/lib/scaffold.js CHANGED
@@ -44,9 +44,11 @@ module.exports = async (
44
44
  editorStyle,
45
45
  style,
46
46
  render,
47
+ viewScript,
47
48
  variantVars,
48
49
  customPackageJSON,
49
50
  customBlockJSON,
51
+ example,
50
52
  }
51
53
  ) => {
52
54
  slug = slug.toLowerCase();
@@ -103,8 +105,10 @@ module.exports = async (
103
105
  editorStyle,
104
106
  style,
105
107
  render,
108
+ viewScript,
106
109
  customPackageJSON,
107
110
  customBlockJSON,
111
+ example,
108
112
  ...variantVars,
109
113
  };
110
114
 
@@ -0,0 +1,3 @@
1
+ /* eslint-disable no-console */
2
+ console.log("Hello World! (from {{namespace}}-{{slug}} block)");
3
+ /* eslint-enable no-console */
package/lib/templates.js CHANGED
@@ -33,6 +33,8 @@ const predefinedPluginTemplates = {
33
33
  editorScript: null,
34
34
  editorStyle: null,
35
35
  style: null,
36
+ viewScript: 'file:./view.js',
37
+ example: {},
36
38
  },
37
39
  templatesPath: join( __dirname, 'templates', 'es5' ),
38
40
  variants: {
@@ -53,6 +55,8 @@ const predefinedPluginTemplates = {
53
55
  supports: {
54
56
  html: false,
55
57
  },
58
+ viewScript: 'file:./view.js',
59
+ example: {},
56
60
  },
57
61
  variants: {
58
62
  static: {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/create-block",
3
- "version": "4.21.0",
3
+ "version": "4.23.0",
4
4
  "description": "Generates PHP, JS and CSS code for registering a block for a WordPress plugin.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,7 +31,7 @@
31
31
  "wp-create-block": "./index.js"
32
32
  },
33
33
  "dependencies": {
34
- "@wordpress/lazy-import": "^1.24.0",
34
+ "@wordpress/lazy-import": "^1.26.0",
35
35
  "chalk": "^4.0.0",
36
36
  "change-case": "^4.1.2",
37
37
  "check-node-version": "^4.1.0",
@@ -48,5 +48,5 @@
48
48
  "publishConfig": {
49
49
  "access": "public"
50
50
  },
51
- "gitHead": "bcd13d59b22553b3c9dc5869077bff1e864cf9f5"
51
+ "gitHead": "b898cf1dc8e70841d1647ea0994ac6278acc18a7"
52
52
  }