@wp-playground/client 0.1.8 → 0.1.10

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.
Files changed (2) hide show
  1. package/README.md +20 -0
  2. package/package.json +2 -2
package/README.md ADDED
@@ -0,0 +1,20 @@
1
+ # Playground Client
2
+
3
+ Provides a WordPress Playground client you can bind to a Playground iframe
4
+ to control the embedded WordPress site. Here's how to use it:
5
+
6
+ ```ts
7
+ import { connectPlayground } from '@wp-playground/client';
8
+
9
+ const client = await connectPlayground(
10
+ // An iframe pointing to https://playground.wordpress.net/remote.html
11
+ document.getElementById('wp')! as HTMLIFrameElement
12
+ );
13
+ await client.isReady();
14
+ await client.goTo('/wp-admin/');
15
+
16
+ const result = await client.run({
17
+ code: '<?php echo "Hi!"; ',
18
+ });
19
+ console.log(new TextDecoder().decode(result.body));
20
+ ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wp-playground/client",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
4
4
  "description": "WordPress Playground client",
5
5
  "repository": {
6
6
  "type": "git",
@@ -29,5 +29,5 @@
29
29
  "type": "module",
30
30
  "main": "index.js",
31
31
  "types": "index.d.ts",
32
- "gitHead": "fdb446ff6c4190fa1e09fe72e40109e84c0fe59c"
32
+ "gitHead": "14306190cd56668b951d2d4732f85963b729ef68"
33
33
  }