@wp-playground/remote 3.1.46 → 3.1.47
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.
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { SiteThumbnail } from './playground-client';
|
|
2
|
+
/**
|
|
3
|
+
* Renders the current WordPress document as a compact site thumbnail.
|
|
4
|
+
*
|
|
5
|
+
* This module is loaded inside the WordPress iframe. The remote frame cannot
|
|
6
|
+
* read that document when Document-Isolation-Policy is active, so capture must
|
|
7
|
+
* happen on this side of the frame boundary. DOM and computed-style work must
|
|
8
|
+
* remain in this event loop. The resource worker handles supported fetches,
|
|
9
|
+
* and the phase callbacks yield so other tasks can run during the remaining
|
|
10
|
+
* renderer work.
|
|
11
|
+
*/
|
|
12
|
+
export declare function captureSiteThumbnail(): Promise<SiteThumbnail>;
|
|
@@ -30,6 +30,19 @@ export interface WebClientMixin extends ProgressReceiver {
|
|
|
30
30
|
* Gets the current URL.
|
|
31
31
|
*/
|
|
32
32
|
getCurrentURL(): Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* Renders the site's front page in a disposable 1024×768 browsing context
|
|
35
|
+
* and returns a compact 320×240 image.
|
|
36
|
+
*
|
|
37
|
+
* This method does not persist the image or synchronize it with OPFS.
|
|
38
|
+
* Callers own the result's lifecycle and must discard it if the site changes
|
|
39
|
+
* while the asynchronous capture is running.
|
|
40
|
+
*
|
|
41
|
+
* DOM cloning and canvas rendering run in the captured document's event
|
|
42
|
+
* loop. A worker handles supported resource fetches, while explicit task
|
|
43
|
+
* yields keep that document responsive during cloning.
|
|
44
|
+
*/
|
|
45
|
+
captureSiteThumbnail(): Promise<SiteThumbnail>;
|
|
33
46
|
/**
|
|
34
47
|
* Sets the iframe sandbox flags.
|
|
35
48
|
* @param flags The iframe sandbox flags.
|
|
@@ -60,6 +73,12 @@ export interface WebClientMixin extends ProgressReceiver {
|
|
|
60
73
|
unmountOpfs(mountpoint: string): Promise<void>;
|
|
61
74
|
boot(options: WorkerBootOptions): Promise<void>;
|
|
62
75
|
}
|
|
76
|
+
export type SiteThumbnail = {
|
|
77
|
+
/** The encoded image's MIME type. */
|
|
78
|
+
mime: string;
|
|
79
|
+
/** The base64 payload without a data URL prefix. */
|
|
80
|
+
data: string;
|
|
81
|
+
};
|
|
63
82
|
/**
|
|
64
83
|
* The Playground Client interface.
|
|
65
84
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wp-playground/remote",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.47",
|
|
4
4
|
"description": "WordPress Playground remote host",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,5 +25,5 @@
|
|
|
25
25
|
"access": "public",
|
|
26
26
|
"directory": "../../../dist/packages/playground/remote"
|
|
27
27
|
},
|
|
28
|
-
"gitHead": "
|
|
28
|
+
"gitHead": "c7d8be823578baddc82de1bac34f8882632dab90"
|
|
29
29
|
}
|