@wordpress/create-block-interactive-template 1.10.0 → 1.11.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,15 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 1.11.0 (2023-12-13)
6
+
7
+ - Add all files to the generated plugin zip. [#56943](https://github.com/WordPress/gutenberg/pull/56943)
8
+ - Prevent crash when Gutenberg plugin is not installed. [#56941](https://github.com/WordPress/gutenberg/pull/56941)
9
+
10
+ ## 1.10.1 (2023-12-07)
11
+
12
+ - Update template to use modules instead of scripts. [#56694](https://github.com/WordPress/gutenberg/pull/56694)
13
+
5
14
  ## 1.10.0 (2023-11-29)
6
15
 
7
16
  ### Enhancement
@@ -11,7 +11,13 @@
11
11
  * @see https://github.com/WordPress/gutenberg/blob/trunk/docs/reference-guides/block-api/block-metadata.md#render
12
12
  */
13
13
 
14
+ // Generate unique id for aria-controls.
14
15
  $unique_id = wp_unique_id( 'p-' );
16
+
17
+ // Enqueue the view file.
18
+ if (function_exists('gutenberg_enqueue_module')) {
19
+ gutenberg_enqueue_module( '{{namespace}}-view' );
20
+ }
15
21
  ?>
16
22
 
17
23
  <div
package/index.js CHANGED
@@ -10,11 +10,11 @@ module.exports = {
10
10
  description: 'An interactive block with the Interactivity API',
11
11
  dashicon: 'media-interactive',
12
12
  npmDependencies: [ '@wordpress/interactivity' ],
13
+ customPackageJSON: { files: [ '[^.]*' ] },
13
14
  supports: {
14
15
  interactivity: true,
15
16
  },
16
17
  render: 'file:./render.php',
17
- viewScript: 'file:./view.js',
18
18
  example: {},
19
19
  },
20
20
  variants: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/create-block-interactive-template",
3
- "version": "1.10.0",
3
+ "version": "1.11.0",
4
4
  "description": "Template for @wordpress/create-block to create interactive blocks with the Interactivity API.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -22,5 +22,5 @@
22
22
  "publishConfig": {
23
23
  "access": "public"
24
24
  },
25
- "gitHead": "d98dff8ea96f29cfea045bf964269f46f040d539"
25
+ "gitHead": "fcf61b4beff747222c2c81d09d757ca1a0abd925"
26
26
  }
@@ -43,5 +43,14 @@ if ( ! defined( 'ABSPATH' ) ) {
43
43
  */
44
44
  function {{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init() {
45
45
  register_block_type( __DIR__ . '/build' );
46
+
47
+ if (function_exists('gutenberg_register_module')) {
48
+ gutenberg_register_module(
49
+ '{{namespace}}-view',
50
+ plugin_dir_url( __FILE__ ) . 'src/view.js',
51
+ array( '@wordpress/interactivity' ),
52
+ '{{version}}'
53
+ );
54
+ }
46
55
  }
47
56
  add_action( 'init', '{{namespaceSnakeCase}}_{{slugSnakeCase}}_block_init' );