@wordpress/e2e-test-utils-playwright 1.36.1-next.8b30e05b0.0 → 1.36.1-next.8fd3f8831.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.cjs +51 -0
- package/build/admin/create-new-post.cjs.map +7 -0
- package/build/admin/create-new-post.js +28 -48
- package/build/admin/create-new-post.js.map +1 -7
- package/build/admin/edit-post.cjs +40 -0
- package/build/admin/edit-post.cjs.map +7 -0
- package/build/admin/edit-post.js +17 -37
- package/build/admin/edit-post.js.map +1 -7
- package/build/admin/get-page-error.cjs +36 -0
- package/build/admin/get-page-error.cjs.map +7 -0
- package/build/admin/get-page-error.js +23 -33
- package/build/admin/get-page-error.js.map +1 -7
- package/build/admin/index.cjs +59 -0
- package/build/admin/index.cjs.map +7 -0
- package/build/admin/index.js +36 -58
- package/build/admin/index.js.map +1 -7
- package/build/admin/visit-admin-page.cjs +47 -0
- package/build/admin/visit-admin-page.cjs.map +7 -0
- package/build/admin/visit-admin-page.js +29 -44
- package/build/admin/visit-admin-page.js.map +1 -7
- package/build/admin/visit-site-editor.cjs +77 -0
- package/build/admin/visit-site-editor.cjs.map +7 -0
- package/build/admin/visit-site-editor.js +64 -73
- package/build/admin/visit-site-editor.js.map +1 -7
- package/build/config.cjs +45 -0
- package/build/config.cjs.map +7 -0
- package/build/config.js +11 -43
- package/build/config.js.map +1 -7
- package/build/editor/click-block-options-menu-item.cjs +34 -0
- package/build/editor/click-block-options-menu-item.cjs.map +7 -0
- package/build/editor/click-block-options-menu-item.js +14 -31
- package/build/editor/click-block-options-menu-item.js.map +1 -7
- package/build/editor/click-block-toolbar-button.cjs +38 -0
- package/build/editor/click-block-toolbar-button.cjs.map +7 -0
- package/build/editor/click-block-toolbar-button.js +13 -35
- package/build/editor/click-block-toolbar-button.js.map +1 -7
- package/build/editor/get-blocks.cjs +64 -0
- package/build/editor/get-blocks.cjs.map +7 -0
- package/build/editor/get-blocks.js +43 -61
- package/build/editor/get-blocks.js.map +1 -7
- package/build/editor/get-edited-post-content.cjs +36 -0
- package/build/editor/get-edited-post-content.cjs.map +7 -0
- package/build/editor/get-edited-post-content.js +12 -33
- package/build/editor/get-edited-post-content.js.map +1 -7
- package/build/editor/index.cjs +97 -0
- package/build/editor/index.cjs.map +7 -0
- package/build/editor/index.js +74 -96
- package/build/editor/index.js.map +1 -7
- package/build/editor/insert-block.cjs +55 -0
- package/build/editor/insert-block.cjs.map +7 -0
- package/build/editor/insert-block.js +21 -52
- package/build/editor/insert-block.js.map +1 -7
- package/build/editor/open-document-settings-sidebar.cjs +42 -0
- package/build/editor/open-document-settings-sidebar.cjs.map +7 -0
- package/build/editor/open-document-settings-sidebar.js +24 -39
- package/build/editor/open-document-settings-sidebar.js.map +1 -7
- package/build/editor/preview.cjs +42 -0
- package/build/editor/preview.cjs.map +7 -0
- package/build/editor/preview.js +18 -39
- package/build/editor/preview.js.map +1 -7
- package/build/editor/publish-post.cjs +47 -0
- package/build/editor/publish-post.cjs.map +7 -0
- package/build/editor/publish-post.js +42 -44
- package/build/editor/publish-post.js.map +1 -7
- package/build/editor/save-draft.cjs +34 -0
- package/build/editor/save-draft.cjs.map +7 -0
- package/build/editor/save-draft.js +15 -31
- package/build/editor/save-draft.js.map +1 -7
- package/build/editor/select-blocks.cjs +51 -0
- package/build/editor/select-blocks.cjs.map +7 -0
- package/build/editor/select-blocks.js +25 -48
- package/build/editor/select-blocks.js.map +1 -7
- package/build/editor/set-content.cjs +39 -0
- package/build/editor/set-content.cjs.map +7 -0
- package/build/editor/set-content.js +14 -36
- package/build/editor/set-content.js.map +1 -7
- package/build/editor/set-is-fixed-toolbar.cjs +36 -0
- package/build/editor/set-is-fixed-toolbar.cjs.map +7 -0
- package/build/editor/set-is-fixed-toolbar.js +15 -33
- package/build/editor/set-is-fixed-toolbar.js.map +1 -7
- package/build/editor/set-preferences.cjs +43 -0
- package/build/editor/set-preferences.cjs.map +7 -0
- package/build/editor/set-preferences.js +18 -40
- package/build/editor/set-preferences.js.map +1 -7
- package/build/editor/show-block-toolbar.cjs +35 -0
- package/build/editor/show-block-toolbar.cjs.map +7 -0
- package/build/editor/show-block-toolbar.js +16 -32
- package/build/editor/show-block-toolbar.js.map +1 -7
- package/build/editor/site-editor.cjs +51 -0
- package/build/editor/site-editor.cjs.map +7 -0
- package/build/editor/site-editor.js +41 -48
- package/build/editor/site-editor.js.map +1 -7
- package/build/editor/switch-editor-tool.cjs +47 -0
- package/build/editor/switch-editor-tool.cjs.map +7 -0
- package/build/editor/switch-editor-tool.js +30 -44
- package/build/editor/switch-editor-tool.js.map +1 -7
- package/build/editor/switch-to-legacy-canvas.cjs +39 -0
- package/build/editor/switch-to-legacy-canvas.cjs.map +7 -0
- package/build/editor/switch-to-legacy-canvas.js +14 -35
- package/build/editor/switch-to-legacy-canvas.js.map +1 -7
- package/build/editor/transform-block-to.cjs +46 -0
- package/build/editor/transform-block-to.cjs.map +7 -0
- package/build/editor/transform-block-to.js +21 -43
- package/build/editor/transform-block-to.js.map +1 -7
- package/build/index.cjs +51 -0
- package/build/index.cjs.map +7 -0
- package/build/index.js +18 -53
- package/build/index.js.map +1 -7
- package/build/lighthouse/index.cjs +96 -0
- package/build/lighthouse/index.cjs.map +7 -0
- package/build/lighthouse/index.js +55 -93
- package/build/lighthouse/index.js.map +1 -7
- package/build/metrics/index.cjs +309 -0
- package/build/metrics/index.cjs.map +7 -0
- package/build/metrics/index.js +251 -302
- package/build/metrics/index.js.map +1 -7
- package/build/page-utils/drag-files.cjs +143 -0
- package/build/page-utils/drag-files.cjs.map +7 -0
- package/build/page-utils/drag-files.js +112 -136
- package/build/page-utils/drag-files.js.map +1 -7
- package/build/page-utils/emulate-network-conditions.cjs +99 -0
- package/build/page-utils/emulate-network-conditions.cjs.map +7 -0
- package/build/page-utils/emulate-network-conditions.js +67 -95
- package/build/page-utils/emulate-network-conditions.js.map +1 -7
- package/build/page-utils/index.cjs +59 -0
- package/build/page-utils/index.cjs.map +7 -0
- package/build/page-utils/index.js +36 -58
- package/build/page-utils/index.js.map +1 -7
- package/build/page-utils/is-current-url.cjs +36 -0
- package/build/page-utils/is-current-url.cjs.map +7 -0
- package/build/page-utils/is-current-url.js +18 -33
- package/build/page-utils/is-current-url.js.map +1 -7
- package/build/page-utils/keycodes.cjs +55 -0
- package/build/page-utils/keycodes.cjs.map +7 -0
- package/build/page-utils/keycodes.js +39 -53
- package/build/page-utils/keycodes.js.map +1 -7
- package/build/page-utils/press-keys.cjs +165 -0
- package/build/page-utils/press-keys.cjs.map +7 -0
- package/build/page-utils/press-keys.js +130 -153
- package/build/page-utils/press-keys.js.map +1 -7
- package/build/page-utils/set-browser-viewport.cjs +39 -0
- package/build/page-utils/set-browser-viewport.cjs.map +7 -0
- package/build/page-utils/set-browser-viewport.js +42 -35
- package/build/page-utils/set-browser-viewport.js.map +1 -7
- package/build/request-utils/blocks.cjs +56 -0
- package/build/request-utils/blocks.cjs.map +7 -0
- package/build/request-utils/blocks.js +40 -51
- package/build/request-utils/blocks.js.map +1 -7
- package/build/request-utils/comments.cjs +66 -0
- package/build/request-utils/comments.cjs.map +7 -0
- package/build/request-utils/comments.js +45 -59
- package/build/request-utils/comments.js.map +1 -7
- package/build/request-utils/gutenberg-experiments.cjs +66 -0
- package/build/request-utils/gutenberg-experiments.cjs.map +7 -0
- package/build/request-utils/gutenberg-experiments.js +38 -63
- package/build/request-utils/gutenberg-experiments.js.map +1 -7
- package/build/request-utils/index.cjs +194 -0
- package/build/request-utils/index.cjs.map +7 -0
- package/build/request-utils/index.js +155 -191
- package/build/request-utils/index.js.map +1 -7
- package/build/request-utils/login.cjs +48 -0
- package/build/request-utils/login.cjs.map +7 -0
- package/build/request-utils/login.js +18 -45
- package/build/request-utils/login.js.map +1 -7
- package/build/request-utils/media.cjs +83 -0
- package/build/request-utils/media.cjs.map +7 -0
- package/build/request-utils/media.js +64 -74
- package/build/request-utils/media.js.map +1 -7
- package/build/request-utils/menus.cjs +132 -0
- package/build/request-utils/menus.cjs.map +7 -0
- package/build/request-utils/menus.js +109 -121
- package/build/request-utils/menus.js.map +1 -7
- package/build/request-utils/pages.cjs +71 -0
- package/build/request-utils/pages.cjs.map +7 -0
- package/build/request-utils/pages.js +50 -63
- package/build/request-utils/pages.js.map +1 -7
- package/build/request-utils/patterns.cjs +44 -0
- package/build/request-utils/patterns.cjs.map +7 -0
- package/build/request-utils/patterns.js +24 -41
- package/build/request-utils/patterns.js.map +1 -7
- package/build/request-utils/plugins.cjs +81 -0
- package/build/request-utils/plugins.cjs.map +7 -0
- package/build/request-utils/plugins.js +74 -70
- package/build/request-utils/plugins.js.map +1 -7
- package/build/request-utils/posts.cjs +61 -0
- package/build/request-utils/posts.cjs.map +7 -0
- package/build/request-utils/posts.js +41 -55
- package/build/request-utils/posts.js.map +1 -7
- package/build/request-utils/preferences.cjs +41 -0
- package/build/request-utils/preferences.cjs.map +7 -0
- package/build/request-utils/preferences.js +17 -38
- package/build/request-utils/preferences.js.map +1 -7
- package/build/request-utils/rest.cjs +174 -0
- package/build/request-utils/rest.cjs.map +7 -0
- package/build/request-utils/rest.js +129 -155
- package/build/request-utils/rest.js.map +1 -7
- package/build/request-utils/site-settings.cjs +45 -0
- package/build/request-utils/site-settings.cjs.map +7 -0
- package/build/request-utils/site-settings.js +28 -40
- package/build/request-utils/site-settings.js.map +1 -7
- package/build/request-utils/templates.cjs +68 -0
- package/build/request-utils/templates.cjs.map +7 -0
- package/build/request-utils/templates.js +46 -60
- package/build/request-utils/templates.js.map +1 -7
- package/build/request-utils/themes.cjs +89 -0
- package/build/request-utils/themes.cjs.map +7 -0
- package/build/request-utils/themes.js +53 -80
- package/build/request-utils/themes.js.map +1 -7
- package/build/request-utils/users.cjs +83 -0
- package/build/request-utils/users.cjs.map +7 -0
- package/build/request-utils/users.js +72 -74
- package/build/request-utils/users.js.map +1 -7
- package/build/request-utils/widgets.cjs +79 -0
- package/build/request-utils/widgets.cjs.map +7 -0
- package/build/request-utils/widgets.js +55 -73
- package/build/request-utils/widgets.js.map +1 -7
- package/build/test.cjs +136 -0
- package/build/test.cjs.map +7 -0
- package/build/test.js +146 -130
- package/build/test.js.map +1 -7
- package/build/types.cjs +19 -0
- package/build/types.cjs.map +7 -0
- package/build/types.js +2 -18
- package/build/types.js.map +1 -7
- package/build-types/index.d.ts +1 -1
- package/build-types/index.d.ts.map +1 -1
- package/package.json +2 -2
|
@@ -1,36 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/set-is-fixed-toolbar.ts
|
|
21
|
-
var set_is_fixed_toolbar_exports = {};
|
|
22
|
-
__export(set_is_fixed_toolbar_exports, {
|
|
23
|
-
setIsFixedToolbar: () => setIsFixedToolbar
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(set_is_fixed_toolbar_exports);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setIsFixedToolbar = setIsFixedToolbar;
|
|
4
|
+
/**
|
|
5
|
+
* Toggles the fixed toolbar option.
|
|
6
|
+
*
|
|
7
|
+
* @param this
|
|
8
|
+
* @param isFixed Boolean value true/false for on/off.
|
|
9
|
+
*/
|
|
26
10
|
async function setIsFixedToolbar(isFixed) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
11
|
+
await this.page.waitForFunction(() => window?.wp?.data);
|
|
12
|
+
await this.page.evaluate((_isFixed) => {
|
|
13
|
+
window.wp.data
|
|
14
|
+
.dispatch('core/preferences')
|
|
15
|
+
.set('core', 'fixedToolbar', _isFixed);
|
|
16
|
+
}, isFixed);
|
|
31
17
|
}
|
|
32
|
-
|
|
33
|
-
0 && (module.exports = {
|
|
34
|
-
setIsFixedToolbar
|
|
35
|
-
});
|
|
36
|
-
//# sourceMappingURL=set-is-fixed-toolbar.js.map
|
|
18
|
+
//# sourceMappingURL=set-is-fixed-toolbar.js.map
|
|
@@ -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
|
-
}
|
|
1
|
+
{"version":3,"file":"set-is-fixed-toolbar.js","sourceRoot":"","sources":["../../src/editor/set-is-fixed-toolbar.ts"],"names":[],"mappings":";;AAWA,8CAQC;AAdD;;;;;GAKG;AACI,KAAK,UAAU,iBAAiB,CAAgB,OAAgB;IACtE,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAE,CAAC;IAE1D,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,CAAE,QAAQ,EAAG,EAAE;QACxC,MAAM,CAAC,EAAE,CAAC,IAAI;aACZ,QAAQ,CAAE,kBAAkB,CAAE;aAC9B,GAAG,CAAE,MAAM,EAAE,cAAc,EAAE,QAAQ,CAAE,CAAC;IAC3C,CAAC,EAAE,OAAO,CAAE,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
|
|
20
|
+
// packages/e2e-test-utils-playwright/src/editor/set-preferences.ts
|
|
21
|
+
var set_preferences_exports = {};
|
|
22
|
+
__export(set_preferences_exports, {
|
|
23
|
+
setPreferences: () => setPreferences
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(set_preferences_exports);
|
|
26
|
+
async function setPreferences(context, preferences) {
|
|
27
|
+
await this.page.waitForFunction(() => window?.wp?.data);
|
|
28
|
+
await this.page.evaluate(
|
|
29
|
+
async (props) => {
|
|
30
|
+
for (const [key, value] of Object.entries(
|
|
31
|
+
props.preferences
|
|
32
|
+
)) {
|
|
33
|
+
await window.wp.data.dispatch("core/preferences").set(props.context, key, value);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
{ context, preferences }
|
|
37
|
+
);
|
|
38
|
+
}
|
|
39
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
40
|
+
0 && (module.exports = {
|
|
41
|
+
setPreferences
|
|
42
|
+
});
|
|
43
|
+
//# sourceMappingURL=set-preferences.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/set-preferences.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\ntype PreferencesContext =\n\t| 'core/edit-post'\n\t| 'core/edit-site'\n\t| 'core/customize-widgets';\n\n/**\n * Set the preferences of the editor.\n *\n * @param this\n * @param context Context to set preferences for.\n * @param preferences Preferences to set.\n */\nexport async function setPreferences(\n\tthis: Editor,\n\tcontext: PreferencesContext,\n\tpreferences: Record< string, any >\n) {\n\tawait this.page.waitForFunction( () => window?.wp?.data );\n\n\tawait this.page.evaluate(\n\t\tasync ( props ) => {\n\t\t\tfor ( const [ key, value ] of Object.entries(\n\t\t\t\tprops.preferences\n\t\t\t) ) {\n\t\t\t\tawait window.wp.data\n\t\t\t\t\t.dispatch( 'core/preferences' )\n\t\t\t\t\t.set( props.context, key, value );\n\t\t\t}\n\t\t},\n\t\t{ context, preferences }\n\t);\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA,eAAsB,eAErB,SACA,aACC;AACD,QAAM,KAAK,KAAK,gBAAiB,MAAM,QAAQ,IAAI,IAAK;AAExD,QAAM,KAAK,KAAK;AAAA,IACf,OAAQ,UAAW;AAClB,iBAAY,CAAE,KAAK,KAAM,KAAK,OAAO;AAAA,QACpC,MAAM;AAAA,MACP,GAAI;AACH,cAAM,OAAO,GAAG,KACd,SAAU,kBAAmB,EAC7B,IAAK,MAAM,SAAS,KAAK,KAAM;AAAA,MAClC;AAAA,IACD;AAAA,IACA,EAAE,SAAS,YAAY;AAAA,EACxB;AACD;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,43 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
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
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/set-preferences.ts
|
|
21
|
-
var set_preferences_exports = {};
|
|
22
|
-
__export(set_preferences_exports, {
|
|
23
|
-
setPreferences: () => setPreferences
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(set_preferences_exports);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.setPreferences = setPreferences;
|
|
4
|
+
/**
|
|
5
|
+
* Set the preferences of the editor.
|
|
6
|
+
*
|
|
7
|
+
* @param this
|
|
8
|
+
* @param context Context to set preferences for.
|
|
9
|
+
* @param preferences Preferences to set.
|
|
10
|
+
*/
|
|
26
11
|
async function setPreferences(context, preferences) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
},
|
|
36
|
-
{ context, preferences }
|
|
37
|
-
);
|
|
12
|
+
await this.page.waitForFunction(() => window?.wp?.data);
|
|
13
|
+
await this.page.evaluate(async (props) => {
|
|
14
|
+
for (const [key, value] of Object.entries(props.preferences)) {
|
|
15
|
+
await window.wp.data
|
|
16
|
+
.dispatch('core/preferences')
|
|
17
|
+
.set(props.context, key, value);
|
|
18
|
+
}
|
|
19
|
+
}, { context, preferences });
|
|
38
20
|
}
|
|
39
|
-
|
|
40
|
-
0 && (module.exports = {
|
|
41
|
-
setPreferences
|
|
42
|
-
});
|
|
43
|
-
//# sourceMappingURL=set-preferences.js.map
|
|
21
|
+
//# sourceMappingURL=set-preferences.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/set-preferences.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\ntype PreferencesContext =\n\t| 'core/edit-post'\n\t| 'core/edit-site'\n\t| 'core/customize-widgets';\n\n/**\n * Set the preferences of the editor.\n *\n * @param this\n * @param context Context to set preferences for.\n * @param preferences Preferences to set.\n */\nexport async function setPreferences(\n\tthis: Editor,\n\tcontext: PreferencesContext,\n\tpreferences: Record< string, any >\n) {\n\tawait this.page.waitForFunction( () => window?.wp?.data );\n\n\tawait this.page.evaluate(\n\t\tasync ( props ) => {\n\t\t\tfor ( const [ key, value ] of Object.entries(\n\t\t\t\tprops.preferences\n\t\t\t) ) {\n\t\t\t\tawait window.wp.data\n\t\t\t\t\t.dispatch( 'core/preferences' )\n\t\t\t\t\t.set( props.context, key, value );\n\t\t\t}\n\t\t},\n\t\t{ context, preferences }\n\t);\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAiBA,eAAsB,eAErB,SACA,aACC;AACD,QAAM,KAAK,KAAK,gBAAiB,MAAM,QAAQ,IAAI,IAAK;AAExD,QAAM,KAAK,KAAK;AAAA,IACf,OAAQ,UAAW;AAClB,iBAAY,CAAE,KAAK,KAAM,KAAK,OAAO;AAAA,QACpC,MAAM;AAAA,MACP,GAAI;AACH,cAAM,OAAO,GAAG,KACd,SAAU,kBAAmB,EAC7B,IAAK,MAAM,SAAS,KAAK,KAAM;AAAA,MAClC;AAAA,IACD;AAAA,IACA,EAAE,SAAS,YAAY;AAAA,EACxB;AACD;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"set-preferences.js","sourceRoot":"","sources":["../../src/editor/set-preferences.ts"],"names":[],"mappings":";;AAiBA,wCAmBC;AA1BD;;;;;;GAMG;AACI,KAAK,UAAU,cAAc,CAEnC,OAA2B,EAC3B,WAAkC;IAElC,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAE,CAAC;IAE1D,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CACvB,KAAK,EAAG,KAAK,EAAG,EAAE;QACjB,KAAM,MAAM,CAAE,GAAG,EAAE,KAAK,CAAE,IAAI,MAAM,CAAC,OAAO,CAC3C,KAAK,CAAC,WAAW,CACjB,EAAG,CAAC;YACJ,MAAM,MAAM,CAAC,EAAE,CAAC,IAAI;iBAClB,QAAQ,CAAE,kBAAkB,CAAE;iBAC9B,GAAG,CAAE,KAAK,CAAC,OAAO,EAAE,GAAG,EAAE,KAAK,CAAE,CAAC;QACpC,CAAC;IACF,CAAC,EACD,EAAE,OAAO,EAAE,WAAW,EAAE,CACxB,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
|
|
20
|
+
// packages/e2e-test-utils-playwright/src/editor/show-block-toolbar.ts
|
|
21
|
+
var show_block_toolbar_exports = {};
|
|
22
|
+
__export(show_block_toolbar_exports, {
|
|
23
|
+
showBlockToolbar: () => showBlockToolbar
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(show_block_toolbar_exports);
|
|
26
|
+
async function showBlockToolbar() {
|
|
27
|
+
await this.page.mouse.move(50, 50);
|
|
28
|
+
await this.page.mouse.move(75, 75);
|
|
29
|
+
await this.page.mouse.move(100, 100);
|
|
30
|
+
}
|
|
31
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
32
|
+
0 && (module.exports = {
|
|
33
|
+
showBlockToolbar
|
|
34
|
+
});
|
|
35
|
+
//# sourceMappingURL=show-block-toolbar.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/show-block-toolbar.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * The block toolbar is not always visible while typing.\n * Call this function to reveal it.\n *\n * @param this\n */\nexport async function showBlockToolbar( this: Editor ) {\n\t// Move the mouse to disable the isTyping mode. We need at least three\n\t// mousemove events for it to work across windows (iframe). With three\n\t// moves, it's a guarantee that at least two will be in the same window.\n\t// Two events are required for the flag to be unset.\n\tawait this.page.mouse.move( 50, 50 );\n\tawait this.page.mouse.move( 75, 75 );\n\tawait this.page.mouse.move( 100, 100 );\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,mBAAiC;AAKtD,QAAM,KAAK,KAAK,MAAM,KAAM,IAAI,EAAG;AACnC,QAAM,KAAK,KAAK,MAAM,KAAM,IAAI,EAAG;AACnC,QAAM,KAAK,KAAK,MAAM,KAAM,KAAK,GAAI;AACtC;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,35 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/show-block-toolbar.ts
|
|
21
|
-
var show_block_toolbar_exports = {};
|
|
22
|
-
__export(show_block_toolbar_exports, {
|
|
23
|
-
showBlockToolbar: () => showBlockToolbar
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(show_block_toolbar_exports);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.showBlockToolbar = showBlockToolbar;
|
|
4
|
+
/**
|
|
5
|
+
* The block toolbar is not always visible while typing.
|
|
6
|
+
* Call this function to reveal it.
|
|
7
|
+
*
|
|
8
|
+
* @param this
|
|
9
|
+
*/
|
|
26
10
|
async function showBlockToolbar() {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
11
|
+
// Move the mouse to disable the isTyping mode. We need at least three
|
|
12
|
+
// mousemove events for it to work across windows (iframe). With three
|
|
13
|
+
// moves, it's a guarantee that at least two will be in the same window.
|
|
14
|
+
// Two events are required for the flag to be unset.
|
|
15
|
+
await this.page.mouse.move(50, 50);
|
|
16
|
+
await this.page.mouse.move(75, 75);
|
|
17
|
+
await this.page.mouse.move(100, 100);
|
|
30
18
|
}
|
|
31
|
-
|
|
32
|
-
0 && (module.exports = {
|
|
33
|
-
showBlockToolbar
|
|
34
|
-
});
|
|
35
|
-
//# sourceMappingURL=show-block-toolbar.js.map
|
|
19
|
+
//# sourceMappingURL=show-block-toolbar.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/show-block-toolbar.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * The block toolbar is not always visible while typing.\n * Call this function to reveal it.\n *\n * @param this\n */\nexport async function showBlockToolbar( this: Editor ) {\n\t// Move the mouse to disable the isTyping mode. We need at least three\n\t// mousemove events for it to work across windows (iframe). With three\n\t// moves, it's a guarantee that at least two will be in the same window.\n\t// Two events are required for the flag to be unset.\n\tawait this.page.mouse.move( 50, 50 );\n\tawait this.page.mouse.move( 75, 75 );\n\tawait this.page.mouse.move( 100, 100 );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,mBAAiC;AAKtD,QAAM,KAAK,KAAK,MAAM,KAAM,IAAI,EAAG;AACnC,QAAM,KAAK,KAAK,MAAM,KAAM,IAAI,EAAG;AACnC,QAAM,KAAK,KAAK,MAAM,KAAM,KAAK,GAAI;AACtC;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"show-block-toolbar.js","sourceRoot":"","sources":["../../src/editor/show-block-toolbar.ts"],"names":[],"mappings":";;AAWA,4CAQC;AAdD;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB;IACrC,sEAAsE;IACtE,sEAAsE;IACtE,wEAAwE;IACxE,oDAAoD;IACpD,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAE,EAAE,EAAE,EAAE,CAAE,CAAC;IACrC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAE,EAAE,EAAE,EAAE,CAAE,CAAC;IACrC,MAAM,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAE,GAAG,EAAE,GAAG,CAAE,CAAC;AACxC,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
|
|
20
|
+
// packages/e2e-test-utils-playwright/src/editor/site-editor.ts
|
|
21
|
+
var site_editor_exports = {};
|
|
22
|
+
__export(site_editor_exports, {
|
|
23
|
+
saveSiteEditorEntities: () => saveSiteEditorEntities
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(site_editor_exports);
|
|
26
|
+
async function saveSiteEditorEntities(options = {}) {
|
|
27
|
+
const editorTopBar = this.page.getByRole("region", {
|
|
28
|
+
name: "Editor top bar"
|
|
29
|
+
});
|
|
30
|
+
const saveButton = editorTopBar.getByRole("button", {
|
|
31
|
+
name: "Save",
|
|
32
|
+
exact: true
|
|
33
|
+
});
|
|
34
|
+
const publishButton = editorTopBar.getByRole("button", {
|
|
35
|
+
name: "Publish"
|
|
36
|
+
});
|
|
37
|
+
const publishButtonIsVisible = !await saveButton.isVisible();
|
|
38
|
+
const buttonToClick = publishButtonIsVisible ? publishButton : saveButton;
|
|
39
|
+
await buttonToClick.click();
|
|
40
|
+
if (!options.isOnlyCurrentEntityDirty) {
|
|
41
|
+
await this.page.getByRole("region", {
|
|
42
|
+
name: /(Editor publish|Save panel)/
|
|
43
|
+
}).getByRole("button", { name: "Save", exact: true }).click();
|
|
44
|
+
}
|
|
45
|
+
await this.page.getByRole("button", { name: "Dismiss this notice" }).getByText(/(updated|published)\./).first().waitFor();
|
|
46
|
+
}
|
|
47
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
48
|
+
0 && (module.exports = {
|
|
49
|
+
saveSiteEditorEntities
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=site-editor.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/site-editor.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\ninterface Options {\n\t// If the only dirty entity is the current one, skip opening the save panel.\n\tisOnlyCurrentEntityDirty?: boolean;\n}\n\n/**\n * Save entities in the site editor. Assumes the editor is in a dirty state.\n *\n * @param this\n * @param options\n */\nexport async function saveSiteEditorEntities(\n\tthis: Editor,\n\toptions: Options = {}\n) {\n\tconst editorTopBar = this.page.getByRole( 'region', {\n\t\tname: 'Editor top bar',\n\t} );\n\n\t// If we have changes in a single entity which can be published the label is `Publish`.\n\tconst saveButton = editorTopBar.getByRole( 'button', {\n\t\tname: 'Save',\n\t\texact: true,\n\t} );\n\tconst publishButton = editorTopBar.getByRole( 'button', {\n\t\tname: 'Publish',\n\t} );\n\tconst publishButtonIsVisible = ! ( await saveButton.isVisible() );\n\t// First Save button in the top bar.\n\tconst buttonToClick = publishButtonIsVisible ? publishButton : saveButton;\n\tawait buttonToClick.click();\n\n\tif ( ! options.isOnlyCurrentEntityDirty ) {\n\t\t// Second Save button in the entities panel.\n\t\tawait this.page\n\t\t\t.getByRole( 'region', {\n\t\t\t\tname: /(Editor publish|Save panel)/,\n\t\t\t} )\n\t\t\t.getByRole( 'button', { name: 'Save', exact: true } )\n\t\t\t.click();\n\t}\n\t// The text in the notice can be different based on the edited entity, whether\n\t// we are saving multiple entities and whether we publish or update. So for now,\n\t// we locate it based on the last part.\n\tawait this.page\n\t\t.getByRole( 'button', { name: 'Dismiss this notice' } )\n\t\t.getByText( /(updated|published)\\./ )\n\t\t.first()\n\t\t.waitFor();\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,eAAsB,uBAErB,UAAmB,CAAC,GACnB;AACD,QAAM,eAAe,KAAK,KAAK,UAAW,UAAU;AAAA,IACnD,MAAM;AAAA,EACP,CAAE;AAGF,QAAM,aAAa,aAAa,UAAW,UAAU;AAAA,IACpD,MAAM;AAAA,IACN,OAAO;AAAA,EACR,CAAE;AACF,QAAM,gBAAgB,aAAa,UAAW,UAAU;AAAA,IACvD,MAAM;AAAA,EACP,CAAE;AACF,QAAM,yBAAyB,CAAI,MAAM,WAAW,UAAU;AAE9D,QAAM,gBAAgB,yBAAyB,gBAAgB;AAC/D,QAAM,cAAc,MAAM;AAE1B,MAAK,CAAE,QAAQ,0BAA2B;AAEzC,UAAM,KAAK,KACT,UAAW,UAAU;AAAA,MACrB,MAAM;AAAA,IACP,CAAE,EACD,UAAW,UAAU,EAAE,MAAM,QAAQ,OAAO,KAAK,CAAE,EACnD,MAAM;AAAA,EACT;AAIA,QAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,sBAAsB,CAAE,EACrD,UAAW,uBAAwB,EACnC,MAAM,EACN,QAAQ;AACX;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,51 +1,44 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/site-editor.ts
|
|
21
|
-
var site_editor_exports = {};
|
|
22
|
-
__export(site_editor_exports, {
|
|
23
|
-
saveSiteEditorEntities: () => saveSiteEditorEntities
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(site_editor_exports);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.saveSiteEditorEntities = saveSiteEditorEntities;
|
|
4
|
+
/**
|
|
5
|
+
* Save entities in the site editor. Assumes the editor is in a dirty state.
|
|
6
|
+
*
|
|
7
|
+
* @param this
|
|
8
|
+
* @param options
|
|
9
|
+
*/
|
|
26
10
|
async function saveSiteEditorEntities(options = {}) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
await
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
11
|
+
const editorTopBar = this.page.getByRole('region', {
|
|
12
|
+
name: 'Editor top bar',
|
|
13
|
+
});
|
|
14
|
+
// If we have changes in a single entity which can be published the label is `Publish`.
|
|
15
|
+
const saveButton = editorTopBar.getByRole('button', {
|
|
16
|
+
name: 'Save',
|
|
17
|
+
exact: true,
|
|
18
|
+
});
|
|
19
|
+
const publishButton = editorTopBar.getByRole('button', {
|
|
20
|
+
name: 'Publish',
|
|
21
|
+
});
|
|
22
|
+
const publishButtonIsVisible = !(await saveButton.isVisible());
|
|
23
|
+
// First Save button in the top bar.
|
|
24
|
+
const buttonToClick = publishButtonIsVisible ? publishButton : saveButton;
|
|
25
|
+
await buttonToClick.click();
|
|
26
|
+
if (!options.isOnlyCurrentEntityDirty) {
|
|
27
|
+
// Second Save button in the entities panel.
|
|
28
|
+
await this.page
|
|
29
|
+
.getByRole('region', {
|
|
30
|
+
name: /(Editor publish|Save panel)/,
|
|
31
|
+
})
|
|
32
|
+
.getByRole('button', { name: 'Save', exact: true })
|
|
33
|
+
.click();
|
|
34
|
+
}
|
|
35
|
+
// The text in the notice can be different based on the edited entity, whether
|
|
36
|
+
// we are saving multiple entities and whether we publish or update. So for now,
|
|
37
|
+
// we locate it based on the last part.
|
|
38
|
+
await this.page
|
|
39
|
+
.getByRole('button', { name: 'Dismiss this notice' })
|
|
40
|
+
.getByText(/(updated|published)\./)
|
|
41
|
+
.first()
|
|
42
|
+
.waitFor();
|
|
46
43
|
}
|
|
47
|
-
|
|
48
|
-
0 && (module.exports = {
|
|
49
|
-
saveSiteEditorEntities
|
|
50
|
-
});
|
|
51
|
-
//# sourceMappingURL=site-editor.js.map
|
|
44
|
+
//# sourceMappingURL=site-editor.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/site-editor.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\ninterface Options {\n\t// If the only dirty entity is the current one, skip opening the save panel.\n\tisOnlyCurrentEntityDirty?: boolean;\n}\n\n/**\n * Save entities in the site editor. Assumes the editor is in a dirty state.\n *\n * @param this\n * @param options\n */\nexport async function saveSiteEditorEntities(\n\tthis: Editor,\n\toptions: Options = {}\n) {\n\tconst editorTopBar = this.page.getByRole( 'region', {\n\t\tname: 'Editor top bar',\n\t} );\n\n\t// If we have changes in a single entity which can be published the label is `Publish`.\n\tconst saveButton = editorTopBar.getByRole( 'button', {\n\t\tname: 'Save',\n\t\texact: true,\n\t} );\n\tconst publishButton = editorTopBar.getByRole( 'button', {\n\t\tname: 'Publish',\n\t} );\n\tconst publishButtonIsVisible = ! ( await saveButton.isVisible() );\n\t// First Save button in the top bar.\n\tconst buttonToClick = publishButtonIsVisible ? publishButton : saveButton;\n\tawait buttonToClick.click();\n\n\tif ( ! options.isOnlyCurrentEntityDirty ) {\n\t\t// Second Save button in the entities panel.\n\t\tawait this.page\n\t\t\t.getByRole( 'region', {\n\t\t\t\tname: /(Editor publish|Save panel)/,\n\t\t\t} )\n\t\t\t.getByRole( 'button', { name: 'Save', exact: true } )\n\t\t\t.click();\n\t}\n\t// The text in the notice can be different based on the edited entity, whether\n\t// we are saving multiple entities and whether we publish or update. So for now,\n\t// we locate it based on the last part.\n\tawait this.page\n\t\t.getByRole( 'button', { name: 'Dismiss this notice' } )\n\t\t.getByText( /(updated|published)\\./ )\n\t\t.first()\n\t\t.waitFor();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAgBA,eAAsB,uBAErB,UAAmB,CAAC,GACnB;AACD,QAAM,eAAe,KAAK,KAAK,UAAW,UAAU;AAAA,IACnD,MAAM;AAAA,EACP,CAAE;AAGF,QAAM,aAAa,aAAa,UAAW,UAAU;AAAA,IACpD,MAAM;AAAA,IACN,OAAO;AAAA,EACR,CAAE;AACF,QAAM,gBAAgB,aAAa,UAAW,UAAU;AAAA,IACvD,MAAM;AAAA,EACP,CAAE;AACF,QAAM,yBAAyB,CAAI,MAAM,WAAW,UAAU;AAE9D,QAAM,gBAAgB,yBAAyB,gBAAgB;AAC/D,QAAM,cAAc,MAAM;AAE1B,MAAK,CAAE,QAAQ,0BAA2B;AAEzC,UAAM,KAAK,KACT,UAAW,UAAU;AAAA,MACrB,MAAM;AAAA,IACP,CAAE,EACD,UAAW,UAAU,EAAE,MAAM,QAAQ,OAAO,KAAK,CAAE,EACnD,MAAM;AAAA,EACT;AAIA,QAAM,KAAK,KACT,UAAW,UAAU,EAAE,MAAM,sBAAsB,CAAE,EACrD,UAAW,uBAAwB,EACnC,MAAM,EACN,QAAQ;AACX;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"site-editor.js","sourceRoot":"","sources":["../../src/editor/site-editor.ts"],"names":[],"mappings":";;AAgBA,wDAsCC;AA5CD;;;;;GAKG;AACI,KAAK,UAAU,sBAAsB,CAE3C,UAAmB,EAAE;IAErB,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAE,QAAQ,EAAE;QACnD,IAAI,EAAE,gBAAgB;KACtB,CAAE,CAAC;IAEJ,uFAAuF;IACvF,MAAM,UAAU,GAAG,YAAY,CAAC,SAAS,CAAE,QAAQ,EAAE;QACpD,IAAI,EAAE,MAAM;QACZ,KAAK,EAAE,IAAI;KACX,CAAE,CAAC;IACJ,MAAM,aAAa,GAAG,YAAY,CAAC,SAAS,CAAE,QAAQ,EAAE;QACvD,IAAI,EAAE,SAAS;KACf,CAAE,CAAC;IACJ,MAAM,sBAAsB,GAAG,CAAE,CAAE,MAAM,UAAU,CAAC,SAAS,EAAE,CAAE,CAAC;IAClE,oCAAoC;IACpC,MAAM,aAAa,GAAG,sBAAsB,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,UAAU,CAAC;IAC1E,MAAM,aAAa,CAAC,KAAK,EAAE,CAAC;IAE5B,IAAK,CAAE,OAAO,CAAC,wBAAwB,EAAG,CAAC;QAC1C,4CAA4C;QAC5C,MAAM,IAAI,CAAC,IAAI;aACb,SAAS,CAAE,QAAQ,EAAE;YACrB,IAAI,EAAE,6BAA6B;SACnC,CAAE;aACF,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,IAAI,EAAE,CAAE;aACpD,KAAK,EAAE,CAAC;IACX,CAAC;IACD,8EAA8E;IAC9E,gFAAgF;IAChF,uCAAuC;IACvC,MAAM,IAAI,CAAC,IAAI;SACb,SAAS,CAAE,QAAQ,EAAE,EAAE,IAAI,EAAE,qBAAqB,EAAE,CAAE;SACtD,SAAS,CAAE,uBAAuB,CAAE;SACpC,KAAK,EAAE;SACP,OAAO,EAAE,CAAC;AACb,CAAC"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
|
|
20
|
+
// packages/e2e-test-utils-playwright/src/editor/switch-editor-tool.ts
|
|
21
|
+
var switch_editor_tool_exports = {};
|
|
22
|
+
__export(switch_editor_tool_exports, {
|
|
23
|
+
switchEditorTool: () => switchEditorTool
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(switch_editor_tool_exports);
|
|
26
|
+
async function switchEditorTool(label) {
|
|
27
|
+
const toolsToolbar = this.page.getByRole("toolbar", {
|
|
28
|
+
name: "Document tools"
|
|
29
|
+
});
|
|
30
|
+
await toolsToolbar.getByRole("button", {
|
|
31
|
+
name: "Tools"
|
|
32
|
+
}).click();
|
|
33
|
+
const menu = this.page.getByRole("menu", {
|
|
34
|
+
name: "Tools"
|
|
35
|
+
});
|
|
36
|
+
await menu.getByRole("menuitemradio", {
|
|
37
|
+
name: label
|
|
38
|
+
}).click();
|
|
39
|
+
await toolsToolbar.getByRole("button", {
|
|
40
|
+
name: "Tools"
|
|
41
|
+
}).click();
|
|
42
|
+
}
|
|
43
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
44
|
+
0 && (module.exports = {
|
|
45
|
+
switchEditorTool
|
|
46
|
+
});
|
|
47
|
+
//# sourceMappingURL=switch-editor-tool.cjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../src/editor/switch-editor-tool.ts"],
|
|
4
|
+
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Switch the editor tool being used.\n *\n * @param this\n * @param label The text string of the button label.\n */\nexport async function switchEditorTool( this: Editor, label: string ) {\n\tconst toolsToolbar = this.page.getByRole( 'toolbar', {\n\t\tname: 'Document tools',\n\t} );\n\tawait toolsToolbar\n\t\t.getByRole( 'button', {\n\t\t\tname: 'Tools',\n\t\t} )\n\t\t.click();\n\tconst menu = this.page.getByRole( 'menu', {\n\t\tname: 'Tools',\n\t} );\n\tawait menu\n\t\t.getByRole( 'menuitemradio', {\n\t\t\tname: label,\n\t\t} )\n\t\t.click();\n\tawait toolsToolbar\n\t\t.getByRole( 'button', {\n\t\t\tname: 'Tools',\n\t\t} )\n\t\t.click();\n}\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,iBAAgC,OAAgB;AACrE,QAAM,eAAe,KAAK,KAAK,UAAW,WAAW;AAAA,IACpD,MAAM;AAAA,EACP,CAAE;AACF,QAAM,aACJ,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,EACP,CAAE,EACD,MAAM;AACR,QAAM,OAAO,KAAK,KAAK,UAAW,QAAQ;AAAA,IACzC,MAAM;AAAA,EACP,CAAE;AACF,QAAM,KACJ,UAAW,iBAAiB;AAAA,IAC5B,MAAM;AAAA,EACP,CAAE,EACD,MAAM;AACR,QAAM,aACJ,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,EACP,CAAE,EACD,MAAM;AACT;",
|
|
6
|
+
"names": []
|
|
7
|
+
}
|
|
@@ -1,47 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
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
|
-
|
|
20
|
-
// packages/e2e-test-utils-playwright/src/editor/switch-editor-tool.ts
|
|
21
|
-
var switch_editor_tool_exports = {};
|
|
22
|
-
__export(switch_editor_tool_exports, {
|
|
23
|
-
switchEditorTool: () => switchEditorTool
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(switch_editor_tool_exports);
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.switchEditorTool = switchEditorTool;
|
|
4
|
+
/**
|
|
5
|
+
* Switch the editor tool being used.
|
|
6
|
+
*
|
|
7
|
+
* @param this
|
|
8
|
+
* @param label The text string of the button label.
|
|
9
|
+
*/
|
|
26
10
|
async function switchEditorTool(label) {
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
11
|
+
const toolsToolbar = this.page.getByRole('toolbar', {
|
|
12
|
+
name: 'Document tools',
|
|
13
|
+
});
|
|
14
|
+
await toolsToolbar
|
|
15
|
+
.getByRole('button', {
|
|
16
|
+
name: 'Tools',
|
|
17
|
+
})
|
|
18
|
+
.click();
|
|
19
|
+
const menu = this.page.getByRole('menu', {
|
|
20
|
+
name: 'Tools',
|
|
21
|
+
});
|
|
22
|
+
await menu
|
|
23
|
+
.getByRole('menuitemradio', {
|
|
24
|
+
name: label,
|
|
25
|
+
})
|
|
26
|
+
.click();
|
|
27
|
+
await toolsToolbar
|
|
28
|
+
.getByRole('button', {
|
|
29
|
+
name: 'Tools',
|
|
30
|
+
})
|
|
31
|
+
.click();
|
|
42
32
|
}
|
|
43
|
-
|
|
44
|
-
0 && (module.exports = {
|
|
45
|
-
switchEditorTool
|
|
46
|
-
});
|
|
47
|
-
//# sourceMappingURL=switch-editor-tool.js.map
|
|
33
|
+
//# sourceMappingURL=switch-editor-tool.js.map
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../src/editor/switch-editor-tool.ts"],
|
|
4
|
-
"sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Switch the editor tool being used.\n *\n * @param this\n * @param label The text string of the button label.\n */\nexport async function switchEditorTool( this: Editor, label: string ) {\n\tconst toolsToolbar = this.page.getByRole( 'toolbar', {\n\t\tname: 'Document tools',\n\t} );\n\tawait toolsToolbar\n\t\t.getByRole( 'button', {\n\t\t\tname: 'Tools',\n\t\t} )\n\t\t.click();\n\tconst menu = this.page.getByRole( 'menu', {\n\t\tname: 'Tools',\n\t} );\n\tawait menu\n\t\t.getByRole( 'menuitemradio', {\n\t\t\tname: label,\n\t\t} )\n\t\t.click();\n\tawait toolsToolbar\n\t\t.getByRole( 'button', {\n\t\t\tname: 'Tools',\n\t\t} )\n\t\t.click();\n}\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,iBAAgC,OAAgB;AACrE,QAAM,eAAe,KAAK,KAAK,UAAW,WAAW;AAAA,IACpD,MAAM;AAAA,EACP,CAAE;AACF,QAAM,aACJ,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,EACP,CAAE,EACD,MAAM;AACR,QAAM,OAAO,KAAK,KAAK,UAAW,QAAQ;AAAA,IACzC,MAAM;AAAA,EACP,CAAE;AACF,QAAM,KACJ,UAAW,iBAAiB;AAAA,IAC5B,MAAM;AAAA,EACP,CAAE,EACD,MAAM;AACR,QAAM,aACJ,UAAW,UAAU;AAAA,IACrB,MAAM;AAAA,EACP,CAAE,EACD,MAAM;AACT;",
|
|
6
|
-
"names": []
|
|
7
|
-
}
|
|
1
|
+
{"version":3,"file":"switch-editor-tool.js","sourceRoot":"","sources":["../../src/editor/switch-editor-tool.ts"],"names":[],"mappings":";;AAWA,4CAsBC;AA5BD;;;;;GAKG;AACI,KAAK,UAAU,gBAAgB,CAAgB,KAAa;IAClE,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAE,SAAS,EAAE;QACpD,IAAI,EAAE,gBAAgB;KACtB,CAAE,CAAC;IACJ,MAAM,YAAY;SAChB,SAAS,CAAE,QAAQ,EAAE;QACrB,IAAI,EAAE,OAAO;KACb,CAAE;SACF,KAAK,EAAE,CAAC;IACV,MAAM,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC,SAAS,CAAE,MAAM,EAAE;QACzC,IAAI,EAAE,OAAO;KACb,CAAE,CAAC;IACJ,MAAM,IAAI;SACR,SAAS,CAAE,eAAe,EAAE;QAC5B,IAAI,EAAE,KAAK;KACX,CAAE;SACF,KAAK,EAAE,CAAC;IACV,MAAM,YAAY;SAChB,SAAS,CAAE,QAAQ,EAAE;QACrB,IAAI,EAAE,OAAO;KACb,CAAE;SACF,KAAK,EAAE,CAAC;AACX,CAAC"}
|