@wordpress/e2e-test-utils-playwright 0.1.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/LICENSE.md +788 -0
- package/README.md +89 -0
- package/build/admin/create-new-post.js +49 -0
- package/build/admin/create-new-post.js.map +1 -0
- package/build/admin/get-page-error.js +27 -0
- package/build/admin/get-page-error.js.map +1 -0
- package/build/admin/index.js +32 -0
- package/build/admin/index.js.map +1 -0
- package/build/admin/visit-admin-page.js +33 -0
- package/build/admin/visit-admin-page.js.map +1 -0
- package/build/admin/visit-site-editor.js +42 -0
- package/build/admin/visit-site-editor.js.map +1 -0
- package/build/config.js +13 -0
- package/build/config.js.map +1 -0
- package/build/editor/click-block-options-menu-item.js +17 -0
- package/build/editor/click-block-options-menu-item.js.map +1 -0
- package/build/editor/click-block-toolbar-button.js +17 -0
- package/build/editor/click-block-toolbar-button.js.map +1 -0
- package/build/editor/get-blocks.js +23 -0
- package/build/editor/get-blocks.js.map +1 -0
- package/build/editor/get-edited-post-content.js +15 -0
- package/build/editor/get-edited-post-content.js.map +1 -0
- package/build/editor/index.js +63 -0
- package/build/editor/index.js.map +1 -0
- package/build/editor/insert-block.js +20 -0
- package/build/editor/insert-block.js.map +1 -0
- package/build/editor/open-document-settings-sidebar.js +27 -0
- package/build/editor/open-document-settings-sidebar.js.map +1 -0
- package/build/editor/preview.js +22 -0
- package/build/editor/preview.js.map +1 -0
- package/build/editor/publish-post.js +30 -0
- package/build/editor/publish-post.js.map +1 -0
- package/build/editor/select-blocks.js +29 -0
- package/build/editor/select-blocks.js.map +1 -0
- package/build/editor/set-content.js +17 -0
- package/build/editor/set-content.js.map +1 -0
- package/build/editor/set-is-fixed-toolbar.js +20 -0
- package/build/editor/set-is-fixed-toolbar.js.map +1 -0
- package/build/editor/show-block-toolbar.js +20 -0
- package/build/editor/show-block-toolbar.js.map +1 -0
- package/build/editor/site-editor.js +19 -0
- package/build/editor/site-editor.js.map +1 -0
- package/build/editor/transform-block-to.js +24 -0
- package/build/editor/transform-block-to.js.map +1 -0
- package/build/index.js +30 -0
- package/build/index.js.map +1 -0
- package/build/page-utils/drag-files.js +115 -0
- package/build/page-utils/drag-files.js.map +1 -0
- package/build/page-utils/index.js +32 -0
- package/build/page-utils/index.js.map +1 -0
- package/build/page-utils/is-current-url.js +22 -0
- package/build/page-utils/is-current-url.js.map +1 -0
- package/build/page-utils/press-keys.js +123 -0
- package/build/page-utils/press-keys.js.map +1 -0
- package/build/page-utils/set-browser-viewport.js +47 -0
- package/build/page-utils/set-browser-viewport.js.map +1 -0
- package/build/request-utils/blocks.js +30 -0
- package/build/request-utils/blocks.js.map +1 -0
- package/build/request-utils/comments.js +52 -0
- package/build/request-utils/comments.js.map +1 -0
- package/build/request-utils/index.js +148 -0
- package/build/request-utils/index.js.map +1 -0
- package/build/request-utils/login.js +22 -0
- package/build/request-utils/login.js.map +1 -0
- package/build/request-utils/media.js +74 -0
- package/build/request-utils/media.js.map +1 -0
- package/build/request-utils/menus.js +121 -0
- package/build/request-utils/menus.js.map +1 -0
- package/build/request-utils/pages.js +59 -0
- package/build/request-utils/pages.js.map +1 -0
- package/build/request-utils/plugins.js +69 -0
- package/build/request-utils/plugins.js.map +1 -0
- package/build/request-utils/posts.js +47 -0
- package/build/request-utils/posts.js.map +1 -0
- package/build/request-utils/preferences.js +21 -0
- package/build/request-utils/preferences.js.map +1 -0
- package/build/request-utils/rest.js +130 -0
- package/build/request-utils/rest.js.map +1 -0
- package/build/request-utils/site-settings.js +34 -0
- package/build/request-utils/site-settings.js.map +1 -0
- package/build/request-utils/templates.js +39 -0
- package/build/request-utils/templates.js.map +1 -0
- package/build/request-utils/themes.js +56 -0
- package/build/request-utils/themes.js.map +1 -0
- package/build/request-utils/users.js +82 -0
- package/build/request-utils/users.js.map +1 -0
- package/build/request-utils/widgets.js +62 -0
- package/build/request-utils/widgets.js.map +1 -0
- package/build/test.js +122 -0
- package/build/test.js.map +1 -0
- package/build/types.js +3 -0
- package/build/types.js.map +1 -0
- package/build-types/admin/create-new-post.d.ts +19 -0
- package/build-types/admin/create-new-post.d.ts.map +1 -0
- package/build-types/admin/get-page-error.d.ts +17 -0
- package/build-types/admin/get-page-error.d.ts.map +1 -0
- package/build-types/admin/index.d.ts +33 -0
- package/build-types/admin/index.d.ts.map +1 -0
- package/build-types/admin/visit-admin-page.d.ts +13 -0
- package/build-types/admin/visit-admin-page.d.ts.map +1 -0
- package/build-types/admin/visit-site-editor.d.ts +19 -0
- package/build-types/admin/visit-site-editor.d.ts.map +1 -0
- package/build-types/config.d.ts +7 -0
- package/build-types/config.d.ts.map +1 -0
- package/build-types/editor/click-block-options-menu-item.d.ts +12 -0
- package/build-types/editor/click-block-options-menu-item.d.ts.map +1 -0
- package/build-types/editor/click-block-toolbar-button.d.ts +12 -0
- package/build-types/editor/click-block-toolbar-button.d.ts.map +1 -0
- package/build-types/editor/get-blocks.d.ts +13 -0
- package/build-types/editor/get-blocks.d.ts.map +1 -0
- package/build-types/editor/get-edited-post-content.d.ts +13 -0
- package/build-types/editor/get-edited-post-content.d.ts.map +1 -0
- package/build-types/editor/index.d.ts +61 -0
- package/build-types/editor/index.d.ts.map +1 -0
- package/build-types/editor/insert-block.d.ts +19 -0
- package/build-types/editor/insert-block.d.ts.map +1 -0
- package/build-types/editor/open-document-settings-sidebar.d.ts +12 -0
- package/build-types/editor/open-document-settings-sidebar.d.ts.map +1 -0
- package/build-types/editor/preview.d.ts +17 -0
- package/build-types/editor/preview.d.ts.map +1 -0
- package/build-types/editor/publish-post.d.ts +12 -0
- package/build-types/editor/publish-post.d.ts.map +1 -0
- package/build-types/editor/select-blocks.d.ts +10 -0
- package/build-types/editor/select-blocks.d.ts.map +1 -0
- package/build-types/editor/set-content.d.ts +13 -0
- package/build-types/editor/set-content.d.ts.map +1 -0
- package/build-types/editor/set-is-fixed-toolbar.d.ts +12 -0
- package/build-types/editor/set-is-fixed-toolbar.d.ts.map +1 -0
- package/build-types/editor/show-block-toolbar.d.ts +12 -0
- package/build-types/editor/show-block-toolbar.d.ts.map +1 -0
- package/build-types/editor/site-editor.d.ts +11 -0
- package/build-types/editor/site-editor.d.ts.map +1 -0
- package/build-types/editor/transform-block-to.d.ts +12 -0
- package/build-types/editor/transform-block-to.d.ts.map +1 -0
- package/build-types/index.d.ts +7 -0
- package/build-types/index.d.ts.map +1 -0
- package/build-types/page-utils/drag-files.d.ts +40 -0
- package/build-types/page-utils/drag-files.d.ts.map +1 -0
- package/build-types/page-utils/index.d.ts +32 -0
- package/build-types/page-utils/index.d.ts.map +1 -0
- package/build-types/page-utils/is-current-url.d.ts +11 -0
- package/build-types/page-utils/is-current-url.d.ts.map +1 -0
- package/build-types/page-utils/press-keys.d.ts +25 -0
- package/build-types/page-utils/press-keys.d.ts.map +1 -0
- package/build-types/page-utils/set-browser-viewport.d.ts +34 -0
- package/build-types/page-utils/set-browser-viewport.d.ts.map +1 -0
- package/build-types/request-utils/blocks.d.ts +8 -0
- package/build-types/request-utils/blocks.d.ts.map +1 -0
- package/build-types/request-utils/comments.d.ts +31 -0
- package/build-types/request-utils/comments.d.ts.map +1 -0
- package/build-types/request-utils/index.d.ts +111 -0
- package/build-types/request-utils/index.d.ts.map +1 -0
- package/build-types/request-utils/login.d.ts +11 -0
- package/build-types/request-utils/login.d.ts.map +1 -0
- package/build-types/request-utils/media.d.ts +54 -0
- package/build-types/request-utils/media.d.ts.map +1 -0
- package/build-types/request-utils/menus.d.ts +43 -0
- package/build-types/request-utils/menus.d.ts.map +1 -0
- package/build-types/request-utils/pages.d.ts +32 -0
- package/build-types/request-utils/pages.d.ts.map +1 -0
- package/build-types/request-utils/plugins.d.ts +28 -0
- package/build-types/request-utils/plugins.d.ts.map +1 -0
- package/build-types/request-utils/posts.d.ts +30 -0
- package/build-types/request-utils/posts.d.ts.map +1 -0
- package/build-types/request-utils/preferences.d.ts +11 -0
- package/build-types/request-utils/preferences.d.ts.map +1 -0
- package/build-types/request-utils/rest.d.ts +24 -0
- package/build-types/request-utils/rest.d.ts.map +1 -0
- package/build-types/request-utils/site-settings.d.ts +40 -0
- package/build-types/request-utils/site-settings.d.ts.map +1 -0
- package/build-types/request-utils/templates.d.ts +14 -0
- package/build-types/request-utils/templates.d.ts.map +1 -0
- package/build-types/request-utils/themes.d.ts +15 -0
- package/build-types/request-utils/themes.d.ts.map +1 -0
- package/build-types/request-utils/users.d.ts +40 -0
- package/build-types/request-utils/users.d.ts.map +1 -0
- package/build-types/request-utils/widgets.d.ts +15 -0
- package/build-types/request-utils/widgets.d.ts.map +1 -0
- package/build-types/test.d.ts +15 -0
- package/build-types/test.d.ts.map +1 -0
- package/build-types/types.d.ts +7 -0
- package/build-types/types.d.ts.map +1 -0
- package/package.json +47 -0
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Admin } from './';
|
|
5
|
+
/**
|
|
6
|
+
* Visits admin page and handle errors.
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
* @param adminPath String to be serialized as pathname.
|
|
10
|
+
* @param query String to be serialized as query portion of URL.
|
|
11
|
+
*/
|
|
12
|
+
export declare function visitAdminPage(this: Admin, adminPath: string, query: string): Promise<void>;
|
|
13
|
+
//# sourceMappingURL=visit-admin-page.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visit-admin-page.d.ts","sourceRoot":"","sources":["../../src/admin/visit-admin-page.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAEhC;;;;;;GAMG;AACH,wBAAsB,cAAc,CACnC,IAAI,EAAE,KAAK,EACX,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,iBAsBb"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Admin } from './';
|
|
5
|
+
export interface SiteEditorQueryParams {
|
|
6
|
+
postId: string | number;
|
|
7
|
+
postType: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Visits the Site Editor main page
|
|
11
|
+
*
|
|
12
|
+
* By default, it also skips the welcome guide. The option can be disabled if need be.
|
|
13
|
+
*
|
|
14
|
+
* @param this
|
|
15
|
+
* @param query Query params to be serialized as query portion of URL.
|
|
16
|
+
* @param skipWelcomeGuide Whether to skip the welcome guide as part of the navigation.
|
|
17
|
+
*/
|
|
18
|
+
export declare function visitSiteEditor(this: Admin, query: SiteEditorQueryParams, skipWelcomeGuide?: boolean): Promise<void>;
|
|
19
|
+
//# sourceMappingURL=visit-site-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"visit-site-editor.d.ts","sourceRoot":"","sources":["../../src/admin/visit-site-editor.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,IAAI,CAAC;AAEhC,MAAM,WAAW,qBAAqB;IACrC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAC;IACxB,QAAQ,EAAE,MAAM,CAAC;CACjB;AAID;;;;;;;;GAQG;AACH,wBAAsB,eAAe,CACpC,IAAI,EAAE,KAAK,EACX,KAAK,EAAE,qBAAqB,EAC5B,gBAAgB,UAAO,iBA2BvB"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const WP_ADMIN_USER: {
|
|
2
|
+
readonly username: "admin";
|
|
3
|
+
readonly password: "password";
|
|
4
|
+
};
|
|
5
|
+
declare const WP_USERNAME: string, WP_PASSWORD: string, WP_BASE_URL: string;
|
|
6
|
+
export { WP_ADMIN_USER, WP_USERNAME, WP_PASSWORD, WP_BASE_URL };
|
|
7
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,QAAA,MAAM,aAAa;;;CAGT,CAAC;AAEX,QAAA,MACC,WAAW,UACX,WAAW,UACX,WAAW,QACG,CAAC;AAEhB,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Clicks a block toolbar button.
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
* @param label The text string of the button label.
|
|
10
|
+
*/
|
|
11
|
+
export declare function clickBlockOptionsMenuItem(this: Editor, label: string): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=click-block-options-menu-item.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-block-options-menu-item.d.ts","sourceRoot":"","sources":["../../src/editor/click-block-options-menu-item.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,iBAO3E"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Clicks a block toolbar button.
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
* @param label The text string of the button label.
|
|
10
|
+
*/
|
|
11
|
+
export declare function clickBlockToolbarButton(this: Editor, label: string): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=click-block-toolbar-button.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"click-block-toolbar-button.d.ts","sourceRoot":"","sources":["../../src/editor/click-block-toolbar-button.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,iBASzE"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Returns the edited blocks.
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
*
|
|
10
|
+
* @return The blocks.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getBlocks(this: Editor): Promise<any>;
|
|
13
|
+
//# sourceMappingURL=get-blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-blocks.d.ts","sourceRoot":"","sources":["../../src/editor/get-blocks.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAsB,SAAS,CAAE,IAAI,EAAE,MAAM,gBAc5C"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Returns a promise which resolves with the edited post content (HTML string).
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
*
|
|
10
|
+
* @return Promise resolving with post content markup.
|
|
11
|
+
*/
|
|
12
|
+
export declare function getEditedPostContent(this: Editor): Promise<any>;
|
|
13
|
+
//# sourceMappingURL=get-edited-post-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-edited-post-content.d.ts","sourceRoot":"","sources":["../../src/editor/get-edited-post-content.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAsB,oBAAoB,CAAE,IAAI,EAAE,MAAM,gBAIvD"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Browser, Page, BrowserContext, Frame } from '@playwright/test';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import { clickBlockOptionsMenuItem } from './click-block-options-menu-item';
|
|
9
|
+
import { clickBlockToolbarButton } from './click-block-toolbar-button';
|
|
10
|
+
import { getBlocks } from './get-blocks';
|
|
11
|
+
import { getEditedPostContent } from './get-edited-post-content';
|
|
12
|
+
import { insertBlock } from './insert-block';
|
|
13
|
+
import { openDocumentSettingsSidebar } from './open-document-settings-sidebar';
|
|
14
|
+
import { openPreviewPage } from './preview';
|
|
15
|
+
import { publishPost } from './publish-post';
|
|
16
|
+
import { selectBlocks } from './select-blocks';
|
|
17
|
+
import { setContent } from './set-content';
|
|
18
|
+
import { showBlockToolbar } from './show-block-toolbar';
|
|
19
|
+
import { saveSiteEditorEntities } from './site-editor';
|
|
20
|
+
import { setIsFixedToolbar } from './set-is-fixed-toolbar';
|
|
21
|
+
import { transformBlockTo } from './transform-block-to';
|
|
22
|
+
type EditorConstructorProps = {
|
|
23
|
+
page: Page;
|
|
24
|
+
};
|
|
25
|
+
export declare class Editor {
|
|
26
|
+
browser: Browser;
|
|
27
|
+
page: Page;
|
|
28
|
+
context: BrowserContext;
|
|
29
|
+
constructor({ page }: EditorConstructorProps);
|
|
30
|
+
get canvas(): Frame | Page;
|
|
31
|
+
/** @borrows clickBlockOptionsMenuItem as this.clickBlockOptionsMenuItem */
|
|
32
|
+
clickBlockOptionsMenuItem: typeof clickBlockOptionsMenuItem;
|
|
33
|
+
/** @borrows clickBlockToolbarButton as this.clickBlockToolbarButton */
|
|
34
|
+
clickBlockToolbarButton: typeof clickBlockToolbarButton;
|
|
35
|
+
/** @borrows getBlocks as this.getBlocks */
|
|
36
|
+
getBlocks: typeof getBlocks;
|
|
37
|
+
/** @borrows getEditedPostContent as this.getEditedPostContent */
|
|
38
|
+
getEditedPostContent: typeof getEditedPostContent;
|
|
39
|
+
/** @borrows insertBlock as this.insertBlock */
|
|
40
|
+
insertBlock: typeof insertBlock;
|
|
41
|
+
/** @borrows openDocumentSettingsSidebar as this.openDocumentSettingsSidebar */
|
|
42
|
+
openDocumentSettingsSidebar: typeof openDocumentSettingsSidebar;
|
|
43
|
+
/** @borrows openPreviewPage as this.openPreviewPage */
|
|
44
|
+
openPreviewPage: typeof openPreviewPage;
|
|
45
|
+
/** @borrows publishPost as this.publishPost */
|
|
46
|
+
publishPost: typeof publishPost;
|
|
47
|
+
/** @borrows saveSiteEditorEntities as this.saveSiteEditorEntities */
|
|
48
|
+
saveSiteEditorEntities: typeof saveSiteEditorEntities;
|
|
49
|
+
/** @borrows selectBlocks as this.selectBlocks */
|
|
50
|
+
selectBlocks: typeof selectBlocks;
|
|
51
|
+
/** @borrows setContent as this.setContent */
|
|
52
|
+
setContent: typeof setContent;
|
|
53
|
+
/** @borrows showBlockToolbar as this.showBlockToolbar */
|
|
54
|
+
showBlockToolbar: typeof showBlockToolbar;
|
|
55
|
+
/** @borrows setIsFixedToolbar as this.setIsFixedToolbar */
|
|
56
|
+
setIsFixedToolbar: typeof setIsFixedToolbar;
|
|
57
|
+
/** @borrows transformBlockTo as this.transformBlockTo */
|
|
58
|
+
transformBlockTo: typeof transformBlockTo;
|
|
59
|
+
}
|
|
60
|
+
export {};
|
|
61
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/editor/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAE7E;;GAEG;AACH,OAAO,EAAE,yBAAyB,EAAE,MAAM,iCAAiC,CAAC;AAC5E,OAAO,EAAE,uBAAuB,EAAE,MAAM,8BAA8B,CAAC;AACvE,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AACjE,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,2BAA2B,EAAE,MAAM,kCAAkC,CAAC;AAC/E,OAAO,EAAE,eAAe,EAAE,MAAM,WAAW,CAAC;AAC5C,OAAO,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAC7C,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AACxD,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AACvD,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,sBAAsB,CAAC;AAExD,KAAK,sBAAsB,GAAG;IAC7B,IAAI,EAAE,IAAI,CAAC;CACX,CAAC;AAEF,qBAAa,MAAM;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,cAAc,CAAC;gBAEX,EAAE,IAAI,EAAE,EAAE,sBAAsB;IAM7C,IAAI,MAAM,IAAI,KAAK,GAAG,IAAI,CAEzB;IAED,2EAA2E;IAC3E,yBAAyB,EAAE,OAAO,yBAAyB,CACnB;IACxC,uEAAuE;IACvE,uBAAuB,EAAE,OAAO,uBAAuB,CACjB;IACtC,2CAA2C;IAC3C,SAAS,EAAE,OAAO,SAAS,CAA0B;IACrD,iEAAiE;IACjE,oBAAoB,EAAE,OAAO,oBAAoB,CACd;IACnC,+CAA+C;IAC/C,WAAW,EAAE,OAAO,WAAW,CAA4B;IAC3D,+EAA+E;IAC/E,2BAA2B,EAAE,OAAO,2BAA2B,CACrB;IAC1C,uDAAuD;IACvD,eAAe,EAAE,OAAO,eAAe,CAAgC;IACvE,+CAA+C;IAC/C,WAAW,EAAE,OAAO,WAAW,CAA4B;IAC3D,qEAAqE;IACrE,sBAAsB,EAAE,OAAO,sBAAsB,CAChB;IACrC,iDAAiD;IACjD,YAAY,EAAE,OAAO,YAAY,CAA6B;IAC9D,6CAA6C;IAC7C,UAAU,EAAE,OAAO,UAAU,CAA2B;IACxD,yDAAyD;IACzD,gBAAgB,EAAE,OAAO,gBAAgB,CAAiC;IAC1E,2DAA2D;IAC3D,iBAAiB,EAAE,OAAO,iBAAiB,CACX;IAChC,yDAAyD;IACzD,gBAAgB,EAAE,OAAO,gBAAgB,CAAiC;CAC1E"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
interface BlockRepresentation {
|
|
6
|
+
name: string;
|
|
7
|
+
attributes?: Object;
|
|
8
|
+
innerBlocks?: BlockRepresentation[];
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Insert a block.
|
|
12
|
+
*
|
|
13
|
+
* @param this
|
|
14
|
+
* @param blockRepresentation Inserted block representation.
|
|
15
|
+
*/
|
|
16
|
+
declare function insertBlock(this: Editor, blockRepresentation: BlockRepresentation): Promise<void>;
|
|
17
|
+
export type { BlockRepresentation };
|
|
18
|
+
export { insertBlock };
|
|
19
|
+
//# sourceMappingURL=insert-block.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"insert-block.d.ts","sourceRoot":"","sources":["../../src/editor/insert-block.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,UAAU,mBAAmB;IAC5B,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,mBAAmB,EAAE,CAAC;CACpC;AAED;;;;;GAKG;AACH,iBAAe,WAAW,CACzB,IAAI,EAAE,MAAM,EACZ,mBAAmB,EAAE,mBAAmB,iBAoBxC;AAED,YAAY,EAAE,mBAAmB,EAAE,CAAC;AACpC,OAAO,EAAE,WAAW,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Clicks on the button in the header which opens Document Settings sidebar when
|
|
7
|
+
* it is closed.
|
|
8
|
+
*
|
|
9
|
+
* @param this
|
|
10
|
+
*/
|
|
11
|
+
export declare function openDocumentSettingsSidebar(this: Editor): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=open-document-settings-sidebar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open-document-settings-sidebar.d.ts","sourceRoot":"","sources":["../../src/editor/open-document-settings-sidebar.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,wBAAsB,2BAA2B,CAAE,IAAI,EAAE,MAAM,iBAkB9D"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Page } from '@playwright/test';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import type { Editor } from './index';
|
|
9
|
+
/**
|
|
10
|
+
* Opens the preview page of an edited post.
|
|
11
|
+
*
|
|
12
|
+
* @param this
|
|
13
|
+
*
|
|
14
|
+
* @return preview page.
|
|
15
|
+
*/
|
|
16
|
+
export declare function openPreviewPage(this: Editor): Promise<Page>;
|
|
17
|
+
//# sourceMappingURL=preview.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"preview.d.ts","sourceRoot":"","sources":["../../src/editor/preview.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,kBAAkB,CAAC;AAE7C;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;;GAMG;AACH,wBAAsB,eAAe,CAAE,IAAI,EAAE,MAAM,GAAI,OAAO,CAAE,IAAI,CAAE,CAgBrE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Publishes the post, resolving once the request is complete (once a notice
|
|
7
|
+
* is displayed).
|
|
8
|
+
*
|
|
9
|
+
* @param this
|
|
10
|
+
*/
|
|
11
|
+
export declare function publishPost(this: Editor): Promise<number | null>;
|
|
12
|
+
//# sourceMappingURL=publish-post.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"publish-post.d.ts","sourceRoot":"","sources":["../../src/editor/publish-post.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,wBAAsB,WAAW,CAAE,IAAI,EAAE,MAAM,0BA2B9C"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Locator } from '@playwright/test';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import type { Editor } from './index';
|
|
9
|
+
export declare function selectBlocks(this: Editor, startSelectorOrLocator: string | Locator, endSelectorOrLocator?: string | Locator): Promise<void>;
|
|
10
|
+
//# sourceMappingURL=select-blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"select-blocks.d.ts","sourceRoot":"","sources":["../../src/editor/select-blocks.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC,wBAAsB,YAAY,CACjC,IAAI,EAAE,MAAM,EACZ,sBAAsB,EAAE,MAAM,GAAG,OAAO,EACxC,oBAAoB,CAAC,EAAE,MAAM,GAAG,OAAO,iBAkCvC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Set the content of the editor.
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
* @param html Serialized block HTML.
|
|
10
|
+
*/
|
|
11
|
+
declare function setContent(this: Editor, html: string): Promise<void>;
|
|
12
|
+
export { setContent };
|
|
13
|
+
//# sourceMappingURL=set-content.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-content.d.ts","sourceRoot":"","sources":["../../src/editor/set-content.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,iBAAe,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAMpD;AAED,OAAO,EAAE,UAAU,EAAE,CAAC"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Toggles the fixed toolbar option.
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
* @param isFixed Boolean value true/false for on/off.
|
|
10
|
+
*/
|
|
11
|
+
export declare function setIsFixedToolbar(this: Editor, isFixed: boolean): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=set-is-fixed-toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-is-fixed-toolbar.d.ts","sourceRoot":"","sources":["../../src/editor/set-is-fixed-toolbar.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,wBAAsB,iBAAiB,CAAE,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,iBAStE"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* The block toolbar is not always visible while typing.
|
|
7
|
+
* Call this function to reveal it.
|
|
8
|
+
*
|
|
9
|
+
* @param this
|
|
10
|
+
*/
|
|
11
|
+
export declare function showBlockToolbar(this: Editor): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=show-block-toolbar.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"show-block-toolbar.d.ts","sourceRoot":"","sources":["../../src/editor/show-block-toolbar.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAE,IAAI,EAAE,MAAM,iBAQnD"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Save entities in the site editor. Assumes the editor is in a dirty state.
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
*/
|
|
10
|
+
export declare function saveSiteEditorEntities(this: Editor): Promise<void>;
|
|
11
|
+
//# sourceMappingURL=site-editor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"site-editor.d.ts","sourceRoot":"","sources":["../../src/editor/site-editor.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;GAIG;AACH,wBAAsB,sBAAsB,CAAE,IAAI,EAAE,MAAM,iBAYzD"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Editor } from './index';
|
|
5
|
+
/**
|
|
6
|
+
* Clicks the default block appender.
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
* @param name Block name.
|
|
10
|
+
*/
|
|
11
|
+
export declare function transformBlockTo(this: Editor, name: string): Promise<void>;
|
|
12
|
+
//# sourceMappingURL=transform-block-to.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transform-block-to.d.ts","sourceRoot":"","sources":["../../src/editor/transform-block-to.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,iBAkBjE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export * from './types';
|
|
2
|
+
export { Admin } from './admin';
|
|
3
|
+
export { Editor } from './editor';
|
|
4
|
+
export { PageUtils } from './page-utils';
|
|
5
|
+
export { RequestUtils } from './request-utils';
|
|
6
|
+
export { test, expect } from './test';
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,SAAS,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAChC,OAAO,EAAE,MAAM,EAAE,MAAM,UAAU,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
/**
|
|
3
|
+
* Internal dependencies
|
|
4
|
+
*/
|
|
5
|
+
import type { PageUtils } from './index';
|
|
6
|
+
import type { Locator } from '@playwright/test';
|
|
7
|
+
type FileObject = {
|
|
8
|
+
name: string;
|
|
9
|
+
mimeType?: string;
|
|
10
|
+
buffer: Buffer;
|
|
11
|
+
};
|
|
12
|
+
type Options = {
|
|
13
|
+
position?: {
|
|
14
|
+
x: number;
|
|
15
|
+
y: number;
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
/**
|
|
19
|
+
* Simulate dragging files from outside the current page.
|
|
20
|
+
*
|
|
21
|
+
* @param this
|
|
22
|
+
* @param files The files to be dragged.
|
|
23
|
+
* @return The methods of the drag operation.
|
|
24
|
+
*/
|
|
25
|
+
declare function dragFiles(this: PageUtils, files: string | string[] | FileObject | FileObject[]): Promise<{
|
|
26
|
+
/**
|
|
27
|
+
* Drag the files over an element (fires `dragenter` and `dragover` events).
|
|
28
|
+
*
|
|
29
|
+
* @param selectorOrLocator A selector or a locator to search for an element.
|
|
30
|
+
* @param options The optional options.
|
|
31
|
+
* @param options.position A point to use relative to the top-left corner of element padding box. If not specified, uses some visible point of the element.
|
|
32
|
+
*/
|
|
33
|
+
dragOver: (selectorOrLocator: string | Locator, options?: Options) => Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Drop the files at the current position.
|
|
36
|
+
*/
|
|
37
|
+
drop: () => Promise<void>;
|
|
38
|
+
}>;
|
|
39
|
+
export { dragFiles };
|
|
40
|
+
//# sourceMappingURL=drag-files.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drag-files.d.ts","sourceRoot":"","sources":["../../src/page-utils/drag-files.ts"],"names":[],"mappings":";AAOA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AACzC,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAEhD,KAAK,UAAU,GAAG;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,KAAK,OAAO,GAAG;IACd,QAAQ,CAAC,EAAE;QAAE,CAAC,EAAE,MAAM,CAAC;QAAC,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpC,CAAC;AAEF;;;;;;GAMG;AACH,iBAAe,SAAS,CACvB,IAAI,EAAE,SAAS,EACf,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,GAAG,UAAU,EAAE;IAmEnD;;;;;;OAMG;kCAEiB,MAAM,GAAG,OAAO,YAC1B,OAAO;IAiCjB;;OAEG;;GAmBJ;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { Browser, Page, BrowserContext } from '@playwright/test';
|
|
5
|
+
/**
|
|
6
|
+
* Internal dependencies
|
|
7
|
+
*/
|
|
8
|
+
import { dragFiles } from './drag-files';
|
|
9
|
+
import { isCurrentURL } from './is-current-url';
|
|
10
|
+
import { setClipboardData, pressKeys } from './press-keys';
|
|
11
|
+
import { setBrowserViewport } from './set-browser-viewport';
|
|
12
|
+
type PageUtilConstructorParams = {
|
|
13
|
+
page: Page;
|
|
14
|
+
};
|
|
15
|
+
declare class PageUtils {
|
|
16
|
+
browser: Browser;
|
|
17
|
+
page: Page;
|
|
18
|
+
context: BrowserContext;
|
|
19
|
+
constructor({ page }: PageUtilConstructorParams);
|
|
20
|
+
/** @borrows dragFiles as this.dragFiles */
|
|
21
|
+
dragFiles: typeof dragFiles;
|
|
22
|
+
/** @borrows isCurrentURL as this.isCurrentURL */
|
|
23
|
+
isCurrentURL: typeof isCurrentURL;
|
|
24
|
+
/** @borrows pressKeys as this.pressKeys */
|
|
25
|
+
pressKeys: typeof pressKeys;
|
|
26
|
+
/** @borrows setBrowserViewport as this.setBrowserViewport */
|
|
27
|
+
setBrowserViewport: typeof setBrowserViewport;
|
|
28
|
+
/** @borrows setClipboardData as this.setClipboardData */
|
|
29
|
+
setClipboardData: typeof setClipboardData;
|
|
30
|
+
}
|
|
31
|
+
export { PageUtils };
|
|
32
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/page-utils/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAEtE;;GAEG;AACH,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAChD,OAAO,EAAE,gBAAgB,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC3D,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D,KAAK,yBAAyB,GAAG;IAChC,IAAI,EAAE,IAAI,CAAC;CACX,CAAC;AAEF,cAAM,SAAS;IACd,OAAO,EAAE,OAAO,CAAC;IACjB,IAAI,EAAE,IAAI,CAAC;IACX,OAAO,EAAE,cAAc,CAAC;gBAEX,EAAE,IAAI,EAAE,EAAE,yBAAyB;IAMhD,2CAA2C;IAC3C,SAAS,EAAE,OAAO,SAAS,CAA0B;IACrD,iDAAiD;IACjD,YAAY,EAAE,OAAO,YAAY,CAA6B;IAC9D,2CAA2C;IAC3C,SAAS,EAAE,OAAO,SAAS,CAA0B;IACrD,6DAA6D;IAC7D,kBAAkB,EAAE,OAAO,kBAAkB,CACZ;IACjC,yDAAyD;IACzD,gBAAgB,EAAE,OAAO,gBAAgB,CAAiC;CAC1E;AAED,OAAO,EAAE,SAAS,EAAE,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { PageUtils } from './';
|
|
2
|
+
/**
|
|
3
|
+
* Checks if current path of the URL matches the provided path.
|
|
4
|
+
*
|
|
5
|
+
* @param this
|
|
6
|
+
* @param path String to be serialized as pathname.
|
|
7
|
+
*
|
|
8
|
+
* @return Boolean represents whether current URL is or not a WordPress path.
|
|
9
|
+
*/
|
|
10
|
+
export declare function isCurrentURL(this: PageUtils, path: string): boolean;
|
|
11
|
+
//# sourceMappingURL=is-current-url.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"is-current-url.d.ts","sourceRoot":"","sources":["../../src/page-utils/is-current-url.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAEpC;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAE,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,MAAM,WAK1D"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { PageUtils } from './';
|
|
5
|
+
declare let clipboardDataHolder: {
|
|
6
|
+
plainText: string;
|
|
7
|
+
html: string;
|
|
8
|
+
};
|
|
9
|
+
/**
|
|
10
|
+
* Sets the clipboard data that can be pasted with
|
|
11
|
+
* `pressKeys( 'primary+v' )`.
|
|
12
|
+
*
|
|
13
|
+
* @param this
|
|
14
|
+
* @param clipboardData
|
|
15
|
+
* @param clipboardData.plainText
|
|
16
|
+
* @param clipboardData.html
|
|
17
|
+
*/
|
|
18
|
+
export declare function setClipboardData(this: PageUtils, { plainText, html }: typeof clipboardDataHolder): void;
|
|
19
|
+
type Options = {
|
|
20
|
+
times?: number;
|
|
21
|
+
delay?: number;
|
|
22
|
+
};
|
|
23
|
+
export declare function pressKeys(this: PageUtils, key: string, { times, ...pressOptions }?: Options): Promise<void>;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=press-keys.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"press-keys.d.ts","sourceRoot":"","sources":["../../src/page-utils/press-keys.ts"],"names":[],"mappings":"AAMA;;GAEG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAYpC,QAAA,IAAI,mBAAmB,EAAE;IACxB,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;CAIb,CAAC;AAEF;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAC/B,IAAI,EAAE,SAAS,EACf,EAAE,SAAc,EAAE,IAAS,EAAE,EAAE,OAAO,mBAAmB,QAMzD;AA4ED,KAAK,OAAO,GAAG;IACd,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAQF,wBAAsB,SAAS,CAC9B,IAAI,EAAE,SAAS,EACf,GAAG,EAAE,MAAM,EACX,EAAE,KAAK,EAAE,GAAG,YAAY,EAAE,GAAE,OAAY,iBAuCxC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Valid argument argument type from which to derive viewport dimensions.
|
|
3
|
+
*
|
|
4
|
+
* @typedef {WPDimensionsName|WPViewportDimensions} WPViewport
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Sets browser viewport to specified type.
|
|
8
|
+
*
|
|
9
|
+
* @this {import('./').PageUtils}
|
|
10
|
+
* @param {WPViewport} viewport Viewport name or dimensions object to assign.
|
|
11
|
+
*/
|
|
12
|
+
export function setBrowserViewport(this: import("./").PageUtils, viewport: WPViewport): Promise<void>;
|
|
13
|
+
/**
|
|
14
|
+
* Valid argument argument type from which to derive viewport dimensions.
|
|
15
|
+
*/
|
|
16
|
+
export type WPViewport = WPDimensionsName | WPViewportDimensions;
|
|
17
|
+
/**
|
|
18
|
+
* Named viewport options.
|
|
19
|
+
*/
|
|
20
|
+
export type WPDimensionsName = "large" | "medium" | "small";
|
|
21
|
+
/**
|
|
22
|
+
* Viewport dimensions object.
|
|
23
|
+
*/
|
|
24
|
+
export type WPViewportDimensions = {
|
|
25
|
+
/**
|
|
26
|
+
* Width, in pixels.
|
|
27
|
+
*/
|
|
28
|
+
width: number;
|
|
29
|
+
/**
|
|
30
|
+
* Height, in pixels.
|
|
31
|
+
*/
|
|
32
|
+
height: number;
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=set-browser-viewport.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-browser-viewport.d.ts","sourceRoot":"","sources":["../../src/page-utils/set-browser-viewport.js"],"names":[],"mappings":"AA4BA;;;;GAIG;AAEH;;;;;GAKG;AACH,2EAFW,UAAU,iBASpB;;;;yBAhBY,gBAAgB,GAAC,oBAAoB;;;;+BA5BrC,OAAO,GAAC,QAAQ,GAAC,OAAO;;;;;;;;WAQvB,MAAM;;;;YACN,MAAM"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Delete all blocks using REST API.
|
|
3
|
+
*
|
|
4
|
+
* @see https://developer.wordpress.org/rest-api/reference/blocks/#list-editor-blocks
|
|
5
|
+
* @this {import('./index').RequestUtils}
|
|
6
|
+
*/
|
|
7
|
+
export function deleteAllBlocks(this: import("./index").RequestUtils): Promise<void>;
|
|
8
|
+
//# sourceMappingURL=blocks.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"blocks.d.ts","sourceRoot":"","sources":["../../src/request-utils/blocks.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,qFAqBC"}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internal dependencies
|
|
3
|
+
*/
|
|
4
|
+
import type { RequestUtils } from './index';
|
|
5
|
+
export interface Comment {
|
|
6
|
+
id: number;
|
|
7
|
+
author: number;
|
|
8
|
+
content: string;
|
|
9
|
+
post: number;
|
|
10
|
+
}
|
|
11
|
+
export interface CreateCommentPayload {
|
|
12
|
+
content: string;
|
|
13
|
+
post: number;
|
|
14
|
+
}
|
|
15
|
+
export interface User {
|
|
16
|
+
id: number;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Create new comment using the REST API.
|
|
20
|
+
*
|
|
21
|
+
* @param this
|
|
22
|
+
* @param payload
|
|
23
|
+
*/
|
|
24
|
+
export declare function createComment(this: RequestUtils, payload: CreateCommentPayload): Promise<Comment>;
|
|
25
|
+
/**
|
|
26
|
+
* Delete all comments using the REST API.
|
|
27
|
+
*
|
|
28
|
+
* @param this
|
|
29
|
+
*/
|
|
30
|
+
export declare function deleteAllComments(this: RequestUtils): Promise<void>;
|
|
31
|
+
//# sourceMappingURL=comments.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.d.ts","sourceRoot":"","sources":["../../src/request-utils/comments.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAE5C,MAAM,WAAW,OAAO;IACvB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,oBAAoB;IACpC,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,IAAI;IACpB,EAAE,EAAE,MAAM,CAAC;CACX;AAED;;;;;GAKG;AACH,wBAAsB,aAAa,CAClC,IAAI,EAAE,YAAY,EAClB,OAAO,EAAE,oBAAoB,oBAgB7B;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAE,IAAI,EAAE,YAAY,iBA0B1D"}
|