Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@wordpress/interactivity

Package Overview
Dependencies
Maintainers
25
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@wordpress/interactivity - npm Package Compare versions

Comparing version 3.0.1 to 3.1.0

2

CHANGELOG.md

@@ -5,2 +5,4 @@ <!-- Learn how to maintain this file at https://github.com/WordPress/gutenberg/tree/HEAD/packages#maintaining-changelogs. -->

## 3.1.0 (2023-12-13)
## 3.0.0 (2023-11-29)

@@ -7,0 +9,0 @@

38

docs/1-getting-started.md

@@ -9,3 +9,3 @@ # Getting started with the Interactivity API

- [1. Scaffold an interactive block](#1-scaffold-an-interactive-block)
- [2. Generate the build](#2-generate-the-build)
- [2. Generate the build](#2-generate-the-build)
- [3. Use it in your WordPress installation ](#3-use-it-in-your-wordpress-installation)

@@ -16,3 +16,3 @@ - [Requirements of the Interactivity API](#requirements-of-the-interactivity-aPI)

- [Node.js](#nodejs)
- [Code requirements](#code-requirements)
- [Code requirements](#code-requirements)
- [Add `interactivity` support to `block.json`](#add-interactivity-support-to-blockjson)

@@ -28,9 +28,21 @@ - [Add `wp-interactive` directive to a DOM element](#add-wp-interactive-directive-to-a-dom-element)

```
npx @wordpress/create-block my-first-interactive-block --template @wordpress/create-block-interactive-template
npx @wordpress/create-block@latest my-first-interactive-block --template @wordpress/create-block-interactive-template
```
#### 2. Generate the build
> **Note**
> The Interactivity API recently switched from [using modules instead of scripts in the frontend](https://github.com/WordPress/gutenberg/pull/56143). Therefore, in order to test this scaffolded block, you will need to add the following line to the `package.json` file of the generated plugin:
When the plugin folder is generated, we should launch the build process to get the final version of the interactive block that can be used from WordPress.
```json
"files": [
"src/view.js"
]
```
> This should be updated in the [scripts package](https://developer.wordpress.org/block-editor/reference-guides/packages/packages-scripts/) soon.
#### 2. Generate the build
When the plugin folder is generated, we should launch the build process to get the final version of the interactive block that can be used from WordPress.
```

@@ -40,3 +52,3 @@ cd my-first-interactive-block && npm start

#### 3. Use it in your WordPress installation
#### 3. Use it in your WordPress installation

@@ -46,6 +58,6 @@ If you have a local WordPress installation already running, you can launch the commands above inside the `plugins` folder of that installation. If not, you can use [`wp-now`](https://github.com/WordPress/playground-tools/tree/trunk/packages/wp-now) to launch a WordPress site with the plugin installed by executing from the generated folder (and from a different terminal window or tab) the following command

```
npx @wp-now/wp-now start
npx @wp-now/wp-now start
```
At this point you should be able to insert the "My First Interactive Block" block into any post, and see how it behaves in the frontend when published.
At this point you should be able to insert the "My First Interactive Block" block into any post, and see how it behaves in the frontend when published.

@@ -61,9 +73,9 @@ > **Note**

You can use [the tools to set your local WordPress environment](https://developer.wordpress.org/block-editor/getting-started/devenv/#wordpress-development-site) you feel more comfortable with.
You can use [the tools to set your local WordPress environment](https://developer.wordpress.org/block-editor/getting-started/devenv/#wordpress-development-site) you feel more comfortable with.
To get quickly started, [`wp-now`](https://www.npmjs.com/package/@wp-now/wp-now) is the easiest way to get a WordPress site up and running locally.
To get quickly started, [`wp-now`](https://www.npmjs.com/package/@wp-now/wp-now) is the easiest way to get a WordPress site up and running locally.
#### Latest vesion of Gutenberg
The Interactivity API is currently only available as an experimental feature from Gutenberg 16.2, so you'll need to have Gutenberg 16.2 or higher version installed and activated in your WordPress installation.
The Interactivity API is currently only available as an experimental feature from Gutenberg 17.2, so you'll need to have Gutenberg 17.2 or higher version installed and activated in your WordPress installation.

@@ -74,3 +86,3 @@ #### Node.js

#### Code requirements
#### Code requirements

@@ -96,2 +108,2 @@ ##### Add `interactivity` support to `block.json`

</div>
```
```
{
"name": "@wordpress/interactivity",
"version": "3.0.1",
"version": "3.1.0",
"description": "Package that provides a standard and simple way to handle the frontend interactivity of Gutenberg blocks.",

@@ -36,3 +36,3 @@ "author": "The WordPress Contributors",

},
"gitHead": "12b897d7feff1cb00ddbf9016b62c1177d9c0081"
"gitHead": "fcf61b4beff747222c2c81d09d757ca1a0abd925"
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc