@wordpress/e2e-test-utils-playwright 1.31.1-next.f56bd8138.0 → 1.32.1-next.47f435fc9.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/build/admin/create-new-post.js +46 -28
- package/build/admin/create-new-post.js.map +7 -1
- package/build/admin/edit-post.js +35 -17
- package/build/admin/edit-post.js.map +7 -1
- package/build/admin/get-page-error.js +30 -22
- package/build/admin/get-page-error.js.map +7 -1
- package/build/admin/index.js +54 -34
- package/build/admin/index.js.map +7 -1
- package/build/admin/visit-admin-page.js +42 -29
- package/build/admin/visit-admin-page.js.map +7 -1
- package/build/admin/visit-site-editor.js +71 -64
- package/build/admin/visit-site-editor.js.map +7 -1
- package/build/config.js +40 -10
- package/build/config.js.map +7 -1
- package/build/editor/click-block-options-menu-item.js +29 -14
- package/build/editor/click-block-options-menu-item.js.map +7 -1
- package/build/editor/click-block-toolbar-button.js +33 -13
- package/build/editor/click-block-toolbar-button.js.map +7 -1
- package/build/editor/get-blocks.js +59 -43
- package/build/editor/get-blocks.js.map +7 -1
- package/build/editor/get-edited-post-content.js +31 -12
- package/build/editor/get-edited-post-content.js.map +7 -1
- package/build/editor/index.js +92 -72
- package/build/editor/index.js.map +7 -1
- package/build/editor/insert-block.js +50 -21
- package/build/editor/insert-block.js.map +7 -1
- package/build/editor/open-document-settings-sidebar.js +37 -24
- package/build/editor/open-document-settings-sidebar.js.map +7 -1
- package/build/editor/preview.js +37 -18
- package/build/editor/preview.js.map +7 -1
- package/build/editor/publish-post.js +42 -42
- package/build/editor/publish-post.js.map +7 -1
- package/build/editor/save-draft.js +29 -15
- package/build/editor/save-draft.js.map +7 -1
- package/build/editor/select-blocks.js +46 -25
- package/build/editor/select-blocks.js.map +7 -1
- package/build/editor/set-content.js +34 -14
- package/build/editor/set-content.js.map +7 -1
- package/build/editor/set-is-fixed-toolbar.js +31 -15
- package/build/editor/set-is-fixed-toolbar.js.map +7 -1
- package/build/editor/set-preferences.js +38 -18
- package/build/editor/set-preferences.js.map +7 -1
- package/build/editor/show-block-toolbar.js +30 -16
- package/build/editor/show-block-toolbar.js.map +7 -1
- package/build/editor/site-editor.js +46 -41
- package/build/editor/site-editor.js.map +7 -1
- package/build/editor/switch-editor-tool.js +42 -30
- package/build/editor/switch-editor-tool.js.map +7 -1
- package/build/editor/switch-to-legacy-canvas.js +33 -14
- package/build/editor/switch-to-legacy-canvas.js.map +7 -1
- package/build/editor/transform-block-to.js +41 -21
- package/build/editor/transform-block-to.js.map +7 -1
- package/build/index.js +50 -32
- package/build/index.js.map +7 -1
- package/build/lighthouse/index.js +89 -53
- package/build/lighthouse/index.js.map +7 -1
- package/build/metrics/index.js +298 -249
- package/build/metrics/index.js.map +7 -1
- package/build/page-utils/drag-files.js +134 -112
- package/build/page-utils/drag-files.js.map +7 -1
- package/build/page-utils/emulate-network-conditions.js +92 -66
- package/build/page-utils/emulate-network-conditions.js.map +7 -1
- package/build/page-utils/index.js +54 -34
- package/build/page-utils/index.js.map +7 -1
- package/build/page-utils/is-current-url.js +31 -18
- package/build/page-utils/is-current-url.js.map +7 -1
- package/build/page-utils/keycodes.js +51 -39
- package/build/page-utils/keycodes.js.map +7 -1
- package/build/page-utils/press-keys.js +148 -127
- package/build/page-utils/press-keys.js.map +7 -1
- package/build/page-utils/set-browser-viewport.js +32 -41
- package/build/page-utils/set-browser-viewport.js.map +7 -1
- package/build/request-utils/blocks.js +49 -40
- package/build/request-utils/blocks.js.map +7 -1
- package/build/request-utils/comments.js +58 -45
- package/build/request-utils/comments.js.map +7 -1
- package/build/request-utils/gutenberg-experiments.js +48 -26
- package/build/request-utils/gutenberg-experiments.js.map +7 -1
- package/build/request-utils/index.js +187 -153
- package/build/request-utils/index.js.map +7 -1
- package/build/request-utils/login.js +43 -18
- package/build/request-utils/login.js.map +7 -1
- package/build/request-utils/media.js +72 -64
- package/build/request-utils/media.js.map +7 -1
- package/build/request-utils/menus.js +119 -109
- package/build/request-utils/menus.js.map +7 -1
- package/build/request-utils/pages.js +60 -49
- package/build/request-utils/pages.js.map +7 -1
- package/build/request-utils/patterns.js +39 -24
- package/build/request-utils/patterns.js.map +7 -1
- package/build/request-utils/plugins.js +68 -74
- package/build/request-utils/plugins.js.map +7 -1
- package/build/request-utils/posts.js +52 -39
- package/build/request-utils/posts.js.map +7 -1
- package/build/request-utils/preferences.js +36 -17
- package/build/request-utils/preferences.js.map +7 -1
- package/build/request-utils/rest.js +153 -129
- package/build/request-utils/rest.js.map +7 -1
- package/build/request-utils/site-settings.js +38 -28
- package/build/request-utils/site-settings.js.map +7 -1
- package/build/request-utils/templates.js +57 -45
- package/build/request-utils/templates.js.map +7 -1
- package/build/request-utils/themes.js +78 -53
- package/build/request-utils/themes.js.map +7 -1
- package/build/request-utils/users.js +72 -72
- package/build/request-utils/users.js.map +7 -1
- package/build/request-utils/widgets.js +71 -55
- package/build/request-utils/widgets.js.map +7 -1
- package/build/test.js +128 -146
- package/build/test.js.map +7 -1
- package/build/types.js +16 -2
- package/build/types.js.map +7 -1
- package/build-types/request-utils/comments.d.ts +2 -1
- package/build-types/request-utils/comments.d.ts.map +1 -1
- package/package.json +6 -2
|
@@ -1,24 +1,53 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var insert_block_exports = {};
|
|
20
|
+
__export(insert_block_exports, {
|
|
21
|
+
insertBlock: () => insertBlock
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(insert_block_exports);
|
|
12
24
|
async function insertBlock(blockRepresentation, { clientId } = {}) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
25
|
+
await this.page.waitForFunction(
|
|
26
|
+
() => window?.wp?.blocks && window?.wp?.data
|
|
27
|
+
);
|
|
28
|
+
await this.page.evaluate(
|
|
29
|
+
([_blockRepresentation, _clientId]) => {
|
|
30
|
+
function recursiveCreateBlock({
|
|
31
|
+
name,
|
|
32
|
+
attributes = {},
|
|
33
|
+
innerBlocks = []
|
|
34
|
+
}) {
|
|
35
|
+
return window.wp.blocks.createBlock(
|
|
36
|
+
name,
|
|
37
|
+
attributes,
|
|
38
|
+
innerBlocks.map(
|
|
39
|
+
(innerBlock) => recursiveCreateBlock(innerBlock)
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
const block = recursiveCreateBlock(_blockRepresentation);
|
|
44
|
+
window.wp.data.dispatch("core/block-editor").insertBlock(block, void 0, _clientId);
|
|
45
|
+
},
|
|
46
|
+
[blockRepresentation, clientId]
|
|
47
|
+
);
|
|
23
48
|
}
|
|
24
|
-
|
|
49
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
50
|
+
0 && (module.exports = {
|
|
51
|
+
insertBlock
|
|
52
|
+
});
|
|
53
|
+
//# sourceMappingURL=insert-block.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/insert-block.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\ninterface BlockRepresentation {\n\tname: string;\n\tattributes?: Object;\n\tinnerBlocks?: BlockRepresentation[];\n}\n\n/**\n * Insert a block.\n *\n * @param this\n * @param blockRepresentation Inserted block representation.\n * @param options\n * @param options.clientId Client ID of the parent block to insert into.\n */\nasync function insertBlock(\n\tthis: Editor,\n\tblockRepresentation: BlockRepresentation,\n\t{ clientId }: { clientId?: string } = {}\n) {\n\tawait this.page.waitForFunction(\n\t\t() => window?.wp?.blocks && window?.wp?.data\n\t);\n\n\tawait this.page.evaluate(\n\t\t( [ _blockRepresentation, _clientId ] ) => {\n\t\t\tfunction recursiveCreateBlock( {\n\t\t\t\tname,\n\t\t\t\tattributes = {},\n\t\t\t\tinnerBlocks = [],\n\t\t\t}: BlockRepresentation ): Object {\n\t\t\t\treturn window.wp.blocks.createBlock(\n\t\t\t\t\tname,\n\t\t\t\t\tattributes,\n\t\t\t\t\tinnerBlocks.map( ( innerBlock ) =>\n\t\t\t\t\t\trecursiveCreateBlock( innerBlock )\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t}\n\t\t\tconst block = recursiveCreateBlock( _blockRepresentation );\n\n\t\t\twindow.wp.data\n\t\t\t\t.dispatch( 'core/block-editor' )\n\t\t\t\t.insertBlock( block, undefined, _clientId );\n\t\t},\n\t\t[ blockRepresentation, clientId ] as const\n\t);\n}\n\nexport type { BlockRepresentation };\nexport { insertBlock };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAmBA,eAAe,YAEd,qBACA,EAAE,SAAS,IAA2B,CAAC,GACtC;AACD,QAAM,KAAK,KAAK;AAAA,IACf,MAAM,QAAQ,IAAI,UAAU,QAAQ,IAAI;AAAA,EACzC;AAEA,QAAM,KAAK,KAAK;AAAA,IACf,CAAE,CAAE,sBAAsB,SAAU,MAAO;AAC1C,eAAS,qBAAsB;AAAA,QAC9B;AAAA,QACA,aAAa,CAAC;AAAA,QACd,cAAc,CAAC;AAAA,MAChB,GAAiC;AAChC,eAAO,OAAO,GAAG,OAAO;AAAA,UACvB;AAAA,UACA;AAAA,UACA,YAAY;AAAA,YAAK,CAAE,eAClB,qBAAsB,UAAW;AAAA,UAClC;AAAA,QACD;AAAA,MACD;AACA,YAAM,QAAQ,qBAAsB,oBAAqB;AAEzD,aAAO,GAAG,KACR,SAAU,mBAAoB,EAC9B,YAAa,OAAO,QAAW,SAAU;AAAA,IAC5C;AAAA,IACA,CAAE,qBAAqB,QAAS;AAAA,EACjC;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,27 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var open_document_settings_sidebar_exports = {};
|
|
20
|
+
__export(open_document_settings_sidebar_exports, {
|
|
21
|
+
openDocumentSettingsSidebar: () => openDocumentSettingsSidebar
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(open_document_settings_sidebar_exports);
|
|
10
24
|
async function openDocumentSettingsSidebar() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
await this.page
|
|
22
|
-
.getByRole('region', { name: 'Editor settings' })
|
|
23
|
-
.getByRole('button', { name: 'Close Settings' })
|
|
24
|
-
.waitFor();
|
|
25
|
-
}
|
|
25
|
+
const toggleButton = this.page.getByRole("region", { name: "Editor top bar" }).getByRole("button", {
|
|
26
|
+
name: "Settings",
|
|
27
|
+
exact: true,
|
|
28
|
+
disabled: false
|
|
29
|
+
});
|
|
30
|
+
const isClosed = await toggleButton.getAttribute("aria-expanded") === "false";
|
|
31
|
+
if (isClosed) {
|
|
32
|
+
await toggleButton.click();
|
|
33
|
+
await this.page.getByRole("region", { name: "Editor settings" }).getByRole("button", { name: "Close Settings" }).waitFor();
|
|
34
|
+
}
|
|
26
35
|
}
|
|
27
|
-
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
openDocumentSettingsSidebar
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=open-document-settings-sidebar.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/open-document-settings-sidebar.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Clicks on the button in the header which opens Document Settings sidebar when\n * it is closed.\n *\n * @param this\n */\nexport async function openDocumentSettingsSidebar( this: Editor ) {\n\tconst toggleButton = this.page\n\t\t.getByRole( 'region', { name: 'Editor top bar' } )\n\t\t.getByRole( 'button', {\n\t\t\tname: 'Settings',\n\t\t\texact: true,\n\t\t\tdisabled: false,\n\t\t} );\n\n\tconst isClosed =\n\t\t( await toggleButton.getAttribute( 'aria-expanded' ) ) === 'false';\n\n\tif ( isClosed ) {\n\t\tawait toggleButton.click();\n\t\tawait this.page\n\t\t\t.getByRole( 'region', { name: 'Editor settings' } )\n\t\t\t.getByRole( 'button', { name: 'Close Settings' } )\n\t\t\t.waitFor();\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,8BAA4C;AACjE,QAAM,eAAe,KAAK,KACxB,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,IACN,OAAO;AAAA,IACP,UAAU;AAAA,EACX,CAAE;AAEH,QAAM,WACH,MAAM,aAAa,aAAc,eAAgB,MAAQ;AAE5D,MAAK,UAAW;AACf,UAAM,aAAa,MAAM;AACzB,UAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,kBAAkB,CAAE,EACjD,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,QAAQ;AAAA,EACX;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
package/build/editor/preview.js
CHANGED
|
@@ -1,21 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var preview_exports = {};
|
|
20
|
+
__export(preview_exports, {
|
|
21
|
+
openPreviewPage: () => openPreviewPage
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(preview_exports);
|
|
11
24
|
async function openPreviewPage() {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
25
|
+
const editorTopBar = this.page.locator(
|
|
26
|
+
'role=region[name="Editor top bar"i]'
|
|
27
|
+
);
|
|
28
|
+
const previewButton = editorTopBar.locator('role=button[name="View"i]');
|
|
29
|
+
await previewButton.click();
|
|
30
|
+
const [previewPage] = await Promise.all([
|
|
31
|
+
this.context.waitForEvent("page"),
|
|
32
|
+
this.page.click('role=menuitem[name="Preview in new tab"i]')
|
|
33
|
+
]);
|
|
34
|
+
return previewPage;
|
|
20
35
|
}
|
|
21
|
-
|
|
36
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
37
|
+
0 && (module.exports = {
|
|
38
|
+
openPreviewPage
|
|
39
|
+
});
|
|
40
|
+
//# sourceMappingURL=preview.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/preview.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { Page } from '@playwright/test';\n\n/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Opens the preview page of an edited post.\n *\n * @param this\n *\n * @return preview page.\n */\nexport async function openPreviewPage( this: Editor ): Promise< Page > {\n\tconst editorTopBar = this.page.locator(\n\t\t'role=region[name=\"Editor top bar\"i]'\n\t);\n\tconst previewButton = editorTopBar.locator( 'role=button[name=\"View\"i]' );\n\n\tawait previewButton.click();\n\n\tconst [ previewPage ] = await Promise.all( [\n\t\tthis.context.waitForEvent( 'page' ),\n\t\tthis.page.click( 'role=menuitem[name=\"Preview in new tab\"i]' ),\n\t] );\n\n\treturn previewPage;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA,eAAsB,kBAAiD;AACtE,QAAM,eAAe,KAAK,KAAK;AAAA,IAC9B;AAAA,EACD;AACA,QAAM,gBAAgB,aAAa,QAAS,2BAA4B;AAExE,QAAM,cAAc,MAAM;AAE1B,QAAM,CAAE,WAAY,IAAI,MAAM,QAAQ,IAAK;AAAA,IAC1C,KAAK,QAAQ,aAAc,MAAO;AAAA,IAClC,KAAK,KAAK,MAAO,2CAA4C;AAAA,EAC9D,CAAE;AAEF,SAAO;AACR;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,45 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var publish_post_exports = {};
|
|
20
|
+
__export(publish_post_exports, {
|
|
21
|
+
publishPost: () => publishPost
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(publish_post_exports);
|
|
10
24
|
async function publishPost() {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
// Save any entities.
|
|
27
|
-
if (isEntitiesSavePanelVisible) {
|
|
28
|
-
// Handle saving entities.
|
|
29
|
-
await entitiesSaveButton.click();
|
|
30
|
-
}
|
|
31
|
-
// Handle saving just the post.
|
|
32
|
-
await this.page
|
|
33
|
-
.getByRole('region', {
|
|
34
|
-
name: 'Editor publish',
|
|
35
|
-
})
|
|
36
|
-
.getByRole('button', { name: 'Publish', exact: true })
|
|
37
|
-
.click();
|
|
38
|
-
await this.page
|
|
39
|
-
.getByRole('button', { name: 'Dismiss this notice' })
|
|
40
|
-
.filter({ hasText: 'published' })
|
|
41
|
-
.waitFor();
|
|
42
|
-
const postId = new URL(this.page.url()).searchParams.get('post');
|
|
43
|
-
return typeof postId === 'string' ? parseInt(postId, 10) : null;
|
|
25
|
+
const saveButton = this.page.getByRole("region", { name: "Editor top bar" }).getByRole("button", { name: "Save", exact: true });
|
|
26
|
+
const publishButton = this.page.getByRole("region", { name: "Editor top bar" }).getByRole("button", { name: "Publish", exact: true });
|
|
27
|
+
const buttonToClick = await saveButton.isVisible() ? saveButton : publishButton;
|
|
28
|
+
await buttonToClick.click();
|
|
29
|
+
const entitiesSaveButton = this.page.getByRole("region", { name: "Editor publish" }).getByRole("button", { name: "Save", exact: true });
|
|
30
|
+
const isEntitiesSavePanelVisible = await entitiesSaveButton.isVisible();
|
|
31
|
+
if (isEntitiesSavePanelVisible) {
|
|
32
|
+
await entitiesSaveButton.click();
|
|
33
|
+
}
|
|
34
|
+
await this.page.getByRole("region", {
|
|
35
|
+
name: "Editor publish"
|
|
36
|
+
}).getByRole("button", { name: "Publish", exact: true }).click();
|
|
37
|
+
await this.page.getByRole("button", { name: "Dismiss this notice" }).filter({ hasText: "published" }).waitFor();
|
|
38
|
+
const postId = new URL(this.page.url()).searchParams.get("post");
|
|
39
|
+
return typeof postId === "string" ? parseInt(postId, 10) : null;
|
|
44
40
|
}
|
|
45
|
-
|
|
41
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
42
|
+
0 && (module.exports = {
|
|
43
|
+
publishPost
|
|
44
|
+
});
|
|
45
|
+
//# sourceMappingURL=publish-post.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/publish-post.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Publishes the post, resolving once the request is complete (once a notice\n * is displayed).\n *\n * @param this\n */\nexport async function publishPost( this: Editor ) {\n\t// If we have changes in other entities, the label is `Save` instead of `Publish`.\n\tconst saveButton = this.page\n\t\t.getByRole( 'region', { name: 'Editor top bar' } )\n\t\t.getByRole( 'button', { name: 'Save', exact: true } );\n\tconst publishButton = this.page\n\t\t.getByRole( 'region', { name: 'Editor top bar' } )\n\t\t.getByRole( 'button', { name: 'Publish', exact: true } );\n\tconst buttonToClick = ( await saveButton.isVisible() )\n\t\t? saveButton\n\t\t: publishButton;\n\tawait buttonToClick.click();\n\n\tconst entitiesSaveButton = this.page\n\t\t.getByRole( 'region', { name: 'Editor publish' } )\n\t\t.getByRole( 'button', { name: 'Save', exact: true } );\n\tconst isEntitiesSavePanelVisible = await entitiesSaveButton.isVisible();\n\n\t// Save any entities.\n\tif ( isEntitiesSavePanelVisible ) {\n\t\t// Handle saving entities.\n\t\tawait entitiesSaveButton.click();\n\t}\n\n\t// Handle saving just the post.\n\tawait this.page\n\t\t.getByRole( 'region', {\n\t\t\tname: 'Editor publish',\n\t\t} )\n\t\t.getByRole( 'button', { name: 'Publish', exact: true } )\n\t\t.click();\n\n\tawait this.page\n\t\t.getByRole( 'button', { name: 'Dismiss this notice' } )\n\t\t.filter( { hasText: 'published' } )\n\t\t.waitFor();\n\tconst postId = new URL( this.page.url() ).searchParams.get( 'post' );\n\n\treturn typeof postId === 'string' ? parseInt( postId, 10 ) : null;\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,cAA4B;AAEjD,QAAM,aAAa,KAAK,KACtB,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU,EAAE,MAAM,QAAQ,OAAO,KAAK,CAAE;AACrD,QAAM,gBAAgB,KAAK,KACzB,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU,EAAE,MAAM,WAAW,OAAO,KAAK,CAAE;AACxD,QAAM,gBAAkB,MAAM,WAAW,UAAU,IAChD,aACA;AACH,QAAM,cAAc,MAAM;AAE1B,QAAM,qBAAqB,KAAK,KAC9B,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU,EAAE,MAAM,QAAQ,OAAO,KAAK,CAAE;AACrD,QAAM,6BAA6B,MAAM,mBAAmB,UAAU;AAGtE,MAAK,4BAA6B;AAEjC,UAAM,mBAAmB,MAAM;AAAA,EAChC;AAGA,QAAM,KAAK,KACT,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,EACP,CAAE,EACD,UAAW,UAAU,EAAE,MAAM,WAAW,OAAO,KAAK,CAAE,EACtD,MAAM;AAER,QAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,sBAAsB,CAAE,EACrD,OAAQ,EAAE,SAAS,YAAY,CAAE,EACjC,QAAQ;AACV,QAAM,SAAS,IAAI,IAAK,KAAK,KAAK,IAAI,CAAE,EAAE,aAAa,IAAK,MAAO;AAEnE,SAAO,OAAO,WAAW,WAAW,SAAU,QAAQ,EAAG,IAAI;AAC9D;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,18 +1,32 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var save_draft_exports = {};
|
|
20
|
+
__export(save_draft_exports, {
|
|
21
|
+
saveDraft: () => saveDraft
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(save_draft_exports);
|
|
8
24
|
async function saveDraft() {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
.getByRole('button', { name: 'Save draft' })
|
|
12
|
-
.click();
|
|
13
|
-
await this.page
|
|
14
|
-
.getByRole('button', { name: 'Dismiss this notice' })
|
|
15
|
-
.filter({ hasText: 'Draft saved' })
|
|
16
|
-
.waitFor();
|
|
25
|
+
await this.page.getByRole("region", { name: "Editor top bar" }).getByRole("button", { name: "Save draft" }).click();
|
|
26
|
+
await this.page.getByRole("button", { name: "Dismiss this notice" }).filter({ hasText: "Draft saved" }).waitFor();
|
|
17
27
|
}
|
|
18
|
-
|
|
28
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
29
|
+
0 && (module.exports = {
|
|
30
|
+
saveDraft
|
|
31
|
+
});
|
|
32
|
+
//# sourceMappingURL=save-draft.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/save-draft.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Saves the post as a draft, resolving once the request is complete (once a notice\n * is displayed).\n */\nexport async function saveDraft( this: Editor ) {\n\tawait this.page\n\t\t.getByRole( 'region', { name: 'Editor top bar' } )\n\t\t.getByRole( 'button', { name: 'Save draft' } )\n\t\t.click();\n\n\tawait this.page\n\t\t.getByRole( 'button', { name: 'Dismiss this notice' } )\n\t\t.filter( { hasText: 'Draft saved' } )\n\t\t.waitFor();\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,eAAsB,YAA0B;AAC/C,QAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,iBAAiB,CAAE,EAChD,UAAW,UAAU,EAAE,MAAM,aAAa,CAAE,EAC5C,MAAM;AAER,QAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,sBAAsB,CAAE,EACrD,OAAQ,EAAE,SAAS,cAAc,CAAE,EACnC,QAAQ;AACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,28 +1,49 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var select_blocks_exports = {};
|
|
20
|
+
__export(select_blocks_exports, {
|
|
21
|
+
selectBlocks: () => selectBlocks
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(select_blocks_exports);
|
|
4
24
|
async function selectBlocks(startSelectorOrLocator, endSelectorOrLocator) {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
wp.data.dispatch('core/block-editor').selectBlock(clientId);
|
|
25
|
-
}, [startClientId]);
|
|
26
|
-
}
|
|
25
|
+
const startBlock = typeof startSelectorOrLocator === "string" ? this.canvas.locator(startSelectorOrLocator) : startSelectorOrLocator;
|
|
26
|
+
const endBlock = typeof endSelectorOrLocator === "string" ? this.canvas.locator(endSelectorOrLocator) : endSelectorOrLocator;
|
|
27
|
+
const startClientId = await startBlock.getAttribute("data-block");
|
|
28
|
+
const endClientId = await endBlock?.getAttribute("data-block");
|
|
29
|
+
if (endClientId) {
|
|
30
|
+
await this.page.evaluate(
|
|
31
|
+
([startId, endId]) => {
|
|
32
|
+
wp.data.dispatch("core/block-editor").multiSelect(startId, endId);
|
|
33
|
+
},
|
|
34
|
+
[startClientId, endClientId]
|
|
35
|
+
);
|
|
36
|
+
} else {
|
|
37
|
+
await this.page.evaluate(
|
|
38
|
+
([clientId]) => {
|
|
39
|
+
wp.data.dispatch("core/block-editor").selectBlock(clientId);
|
|
40
|
+
},
|
|
41
|
+
[startClientId]
|
|
42
|
+
);
|
|
43
|
+
}
|
|
27
44
|
}
|
|
28
|
-
|
|
45
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
46
|
+
0 && (module.exports = {
|
|
47
|
+
selectBlocks
|
|
48
|
+
});
|
|
49
|
+
//# sourceMappingURL=select-blocks.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/select-blocks.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * External dependencies\n */\nimport type { Locator } from '@playwright/test';\n\n/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\nexport async function selectBlocks(\n\tthis: Editor,\n\tstartSelectorOrLocator: string | Locator,\n\tendSelectorOrLocator?: string | Locator\n) {\n\tconst startBlock =\n\t\ttypeof startSelectorOrLocator === 'string'\n\t\t\t? this.canvas.locator( startSelectorOrLocator )\n\t\t\t: startSelectorOrLocator;\n\n\tconst endBlock =\n\t\ttypeof endSelectorOrLocator === 'string'\n\t\t\t? this.canvas.locator( endSelectorOrLocator )\n\t\t\t: endSelectorOrLocator;\n\n\tconst startClientId = await startBlock.getAttribute( 'data-block' );\n\tconst endClientId = await endBlock?.getAttribute( 'data-block' );\n\n\tif ( endClientId ) {\n\t\tawait this.page.evaluate(\n\t\t\t( [ startId, endId ] ) => {\n\t\t\t\t// @ts-ignore\n\t\t\t\twp.data\n\t\t\t\t\t.dispatch( 'core/block-editor' )\n\t\t\t\t\t.multiSelect( startId, endId );\n\t\t\t},\n\t\t\t[ startClientId, endClientId ]\n\t\t);\n\t} else {\n\t\tawait this.page.evaluate(\n\t\t\t( [ clientId ] ) => {\n\t\t\t\t// @ts-ignore\n\t\t\t\twp.data.dispatch( 'core/block-editor' ).selectBlock( clientId );\n\t\t\t},\n\t\t\t[ startClientId ]\n\t\t);\n\t}\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,eAAsB,aAErB,wBACA,sBACC;AACD,QAAM,aACL,OAAO,2BAA2B,WAC/B,KAAK,OAAO,QAAS,sBAAuB,IAC5C;AAEJ,QAAM,WACL,OAAO,yBAAyB,WAC7B,KAAK,OAAO,QAAS,oBAAqB,IAC1C;AAEJ,QAAM,gBAAgB,MAAM,WAAW,aAAc,YAAa;AAClE,QAAM,cAAc,MAAM,UAAU,aAAc,YAAa;AAE/D,MAAK,aAAc;AAClB,UAAM,KAAK,KAAK;AAAA,MACf,CAAE,CAAE,SAAS,KAAM,MAAO;AAEzB,WAAG,KACD,SAAU,mBAAoB,EAC9B,YAAa,SAAS,KAAM;AAAA,MAC/B;AAAA,MACA,CAAE,eAAe,WAAY;AAAA,IAC9B;AAAA,EACD,OAAO;AACN,UAAM,KAAK,KAAK;AAAA,MACf,CAAE,CAAE,QAAS,MAAO;AAEnB,WAAG,KAAK,SAAU,mBAAoB,EAAE,YAAa,QAAS;AAAA,MAC/D;AAAA,MACA,CAAE,aAAc;AAAA,IACjB;AAAA,EACD;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,17 +1,37 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var set_content_exports = {};
|
|
20
|
+
__export(set_content_exports, {
|
|
21
|
+
setContent: () => setContent
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(set_content_exports);
|
|
10
24
|
async function setContent(html) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
await this.page.waitForFunction(
|
|
26
|
+
() => window?.wp?.blocks && window?.wp?.data
|
|
27
|
+
);
|
|
28
|
+
await this.page.evaluate((_html) => {
|
|
29
|
+
const blocks = window.wp.blocks.parse(_html);
|
|
30
|
+
window.wp.data.dispatch("core/block-editor").resetBlocks(blocks);
|
|
31
|
+
}, html);
|
|
16
32
|
}
|
|
17
|
-
|
|
33
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
34
|
+
0 && (module.exports = {
|
|
35
|
+
setContent
|
|
36
|
+
});
|
|
37
|
+
//# sourceMappingURL=set-content.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/set-content.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Set the content of the editor.\n *\n * @param this\n * @param html Serialized block HTML.\n */\nasync function setContent( this: Editor, html: string ) {\n\tawait this.page.waitForFunction(\n\t\t() => window?.wp?.blocks && window?.wp?.data\n\t);\n\n\tawait this.page.evaluate( ( _html ) => {\n\t\tconst blocks = window.wp.blocks.parse( _html );\n\n\t\twindow.wp.data.dispatch( 'core/block-editor' ).resetBlocks( blocks );\n\t}, html );\n}\n\nexport { setContent };\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAe,WAA0B,MAAe;AACvD,QAAM,KAAK,KAAK;AAAA,IACf,MAAM,QAAQ,IAAI,UAAU,QAAQ,IAAI;AAAA,EACzC;AAEA,QAAM,KAAK,KAAK,SAAU,CAAE,UAAW;AACtC,UAAM,SAAS,OAAO,GAAG,OAAO,MAAO,KAAM;AAE7C,WAAO,GAAG,KAAK,SAAU,mBAAoB,EAAE,YAAa,MAAO;AAAA,EACpE,GAAG,IAAK;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,18 +1,34 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var set_is_fixed_toolbar_exports = {};
|
|
20
|
+
__export(set_is_fixed_toolbar_exports, {
|
|
21
|
+
setIsFixedToolbar: () => setIsFixedToolbar
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(set_is_fixed_toolbar_exports);
|
|
10
24
|
async function setIsFixedToolbar(isFixed) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
.set('core', 'fixedToolbar', _isFixed);
|
|
16
|
-
}, isFixed);
|
|
25
|
+
await this.page.waitForFunction(() => window?.wp?.data);
|
|
26
|
+
await this.page.evaluate((_isFixed) => {
|
|
27
|
+
window.wp.data.dispatch("core/preferences").set("core", "fixedToolbar", _isFixed);
|
|
28
|
+
}, isFixed);
|
|
17
29
|
}
|
|
18
|
-
|
|
30
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
31
|
+
0 && (module.exports = {
|
|
32
|
+
setIsFixedToolbar
|
|
33
|
+
});
|
|
34
|
+
//# sourceMappingURL=set-is-fixed-toolbar.js.map
|
|
@@ -1 +1,7 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/set-is-fixed-toolbar.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Toggles the fixed toolbar option.\n *\n * @param this\n * @param isFixed Boolean value true/false for on/off.\n */\nexport async function setIsFixedToolbar( this: Editor, isFixed: boolean ) {\n\tawait this.page.waitForFunction( () => window?.wp?.data );\n\n\tawait this.page.evaluate( ( _isFixed ) => {\n\t\twindow.wp.data\n\t\t\t.dispatch( 'core/preferences' )\n\t\t\t.set( 'core', 'fixedToolbar', _isFixed );\n\t}, isFixed );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,kBAAiC,SAAmB;AACzE,QAAM,KAAK,KAAK,gBAAiB,MAAM,QAAQ,IAAI,IAAK;AAExD,QAAM,KAAK,KAAK,SAAU,CAAE,aAAc;AACzC,WAAO,GAAG,KACR,SAAU,kBAAmB,EAC7B,IAAK,QAAQ,gBAAgB,QAAS;AAAA,EACzC,GAAG,OAAQ;AACZ;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|