@wordpress/e2e-test-utils-playwright 1.45.1-next.v.202605131032.0 → 1.47.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.
Files changed (138) hide show
  1. package/build/admin/index.js +3 -0
  2. package/build/admin/index.js.map +1 -1
  3. package/build/admin/visit-site-editor.js +1 -29
  4. package/build/admin/visit-site-editor.js.map +1 -1
  5. package/build/admin/wait-for-site-editor.js +41 -0
  6. package/build/admin/wait-for-site-editor.js.map +1 -0
  7. package/build/metrics/index.js +59 -3
  8. package/build/metrics/index.js.map +1 -1
  9. package/build/request-utils/index.js +2 -0
  10. package/build/request-utils/index.js.map +1 -1
  11. package/build/request-utils/preferences.js +34 -0
  12. package/build/request-utils/preferences.js.map +1 -1
  13. package/build-types/admin/index.d.ts +3 -0
  14. package/build-types/admin/index.d.ts.map +1 -1
  15. package/build-types/admin/visit-site-editor.d.ts.map +1 -1
  16. package/build-types/admin/wait-for-site-editor.d.ts +12 -0
  17. package/build-types/admin/wait-for-site-editor.d.ts.map +1 -0
  18. package/build-types/metrics/index.d.ts +22 -5
  19. package/build-types/metrics/index.d.ts.map +1 -1
  20. package/build-types/request-utils/index.d.ts +3 -1
  21. package/build-types/request-utils/index.d.ts.map +1 -1
  22. package/build-types/request-utils/preferences.d.ts +11 -0
  23. package/build-types/request-utils/preferences.d.ts.map +1 -1
  24. package/package.json +3 -4
  25. package/build/admin/create-new-post.cjs +0 -51
  26. package/build/admin/create-new-post.cjs.map +0 -7
  27. package/build/admin/edit-post.cjs +0 -40
  28. package/build/admin/edit-post.cjs.map +0 -7
  29. package/build/admin/get-page-error.cjs +0 -36
  30. package/build/admin/get-page-error.cjs.map +0 -7
  31. package/build/admin/index.cjs +0 -59
  32. package/build/admin/index.cjs.map +0 -7
  33. package/build/admin/visit-admin-page.cjs +0 -47
  34. package/build/admin/visit-admin-page.cjs.map +0 -7
  35. package/build/admin/visit-site-editor.cjs +0 -90
  36. package/build/admin/visit-site-editor.cjs.map +0 -7
  37. package/build/config.cjs +0 -45
  38. package/build/config.cjs.map +0 -7
  39. package/build/editor/click-block-options-menu-item.cjs +0 -34
  40. package/build/editor/click-block-options-menu-item.cjs.map +0 -7
  41. package/build/editor/click-block-toolbar-button.cjs +0 -38
  42. package/build/editor/click-block-toolbar-button.cjs.map +0 -7
  43. package/build/editor/get-blocks.cjs +0 -64
  44. package/build/editor/get-blocks.cjs.map +0 -7
  45. package/build/editor/get-edited-post-content.cjs +0 -36
  46. package/build/editor/get-edited-post-content.cjs.map +0 -7
  47. package/build/editor/index.cjs +0 -97
  48. package/build/editor/index.cjs.map +0 -7
  49. package/build/editor/insert-block.cjs +0 -55
  50. package/build/editor/insert-block.cjs.map +0 -7
  51. package/build/editor/open-document-settings-sidebar.cjs +0 -42
  52. package/build/editor/open-document-settings-sidebar.cjs.map +0 -7
  53. package/build/editor/preview.cjs +0 -42
  54. package/build/editor/preview.cjs.map +0 -7
  55. package/build/editor/publish-post.cjs +0 -47
  56. package/build/editor/publish-post.cjs.map +0 -7
  57. package/build/editor/save-draft.cjs +0 -34
  58. package/build/editor/save-draft.cjs.map +0 -7
  59. package/build/editor/select-blocks.cjs +0 -51
  60. package/build/editor/select-blocks.cjs.map +0 -7
  61. package/build/editor/set-content.cjs +0 -39
  62. package/build/editor/set-content.cjs.map +0 -7
  63. package/build/editor/set-is-fixed-toolbar.cjs +0 -36
  64. package/build/editor/set-is-fixed-toolbar.cjs.map +0 -7
  65. package/build/editor/set-preferences.cjs +0 -43
  66. package/build/editor/set-preferences.cjs.map +0 -7
  67. package/build/editor/show-block-toolbar.cjs +0 -35
  68. package/build/editor/show-block-toolbar.cjs.map +0 -7
  69. package/build/editor/site-editor.cjs +0 -51
  70. package/build/editor/site-editor.cjs.map +0 -7
  71. package/build/editor/switch-editor-tool.cjs +0 -47
  72. package/build/editor/switch-editor-tool.cjs.map +0 -7
  73. package/build/editor/switch-to-legacy-canvas.cjs +0 -39
  74. package/build/editor/switch-to-legacy-canvas.cjs.map +0 -7
  75. package/build/editor/transform-block-to.cjs +0 -46
  76. package/build/editor/transform-block-to.cjs.map +0 -7
  77. package/build/index.cjs +0 -51
  78. package/build/index.cjs.map +0 -7
  79. package/build/lighthouse/index.cjs +0 -96
  80. package/build/lighthouse/index.cjs.map +0 -7
  81. package/build/metrics/index.cjs +0 -309
  82. package/build/metrics/index.cjs.map +0 -7
  83. package/build/page-utils/drag-files.cjs +0 -143
  84. package/build/page-utils/drag-files.cjs.map +0 -7
  85. package/build/page-utils/emulate-network-conditions.cjs +0 -99
  86. package/build/page-utils/emulate-network-conditions.cjs.map +0 -7
  87. package/build/page-utils/index.cjs +0 -59
  88. package/build/page-utils/index.cjs.map +0 -7
  89. package/build/page-utils/is-current-url.cjs +0 -36
  90. package/build/page-utils/is-current-url.cjs.map +0 -7
  91. package/build/page-utils/keycodes.cjs +0 -55
  92. package/build/page-utils/keycodes.cjs.map +0 -7
  93. package/build/page-utils/press-keys.cjs +0 -165
  94. package/build/page-utils/press-keys.cjs.map +0 -7
  95. package/build/page-utils/set-browser-viewport.cjs +0 -39
  96. package/build/page-utils/set-browser-viewport.cjs.map +0 -7
  97. package/build/request-utils/blocks.cjs +0 -51
  98. package/build/request-utils/blocks.cjs.map +0 -7
  99. package/build/request-utils/comments.cjs +0 -66
  100. package/build/request-utils/comments.cjs.map +0 -7
  101. package/build/request-utils/gutenberg-experiments.cjs +0 -56
  102. package/build/request-utils/gutenberg-experiments.cjs.map +0 -7
  103. package/build/request-utils/index.cjs +0 -199
  104. package/build/request-utils/index.cjs.map +0 -7
  105. package/build/request-utils/login.cjs +0 -48
  106. package/build/request-utils/login.cjs.map +0 -7
  107. package/build/request-utils/media.cjs +0 -83
  108. package/build/request-utils/media.cjs.map +0 -7
  109. package/build/request-utils/menus.cjs +0 -128
  110. package/build/request-utils/menus.cjs.map +0 -7
  111. package/build/request-utils/pages.cjs +0 -66
  112. package/build/request-utils/pages.cjs.map +0 -7
  113. package/build/request-utils/patterns.cjs +0 -44
  114. package/build/request-utils/patterns.cjs.map +0 -7
  115. package/build/request-utils/plugins.cjs +0 -81
  116. package/build/request-utils/plugins.cjs.map +0 -7
  117. package/build/request-utils/posts.cjs +0 -56
  118. package/build/request-utils/posts.cjs.map +0 -7
  119. package/build/request-utils/preferences.cjs +0 -41
  120. package/build/request-utils/preferences.cjs.map +0 -7
  121. package/build/request-utils/records.cjs +0 -37
  122. package/build/request-utils/records.cjs.map +0 -7
  123. package/build/request-utils/rest.cjs +0 -174
  124. package/build/request-utils/rest.cjs.map +0 -7
  125. package/build/request-utils/site-settings.cjs +0 -45
  126. package/build/request-utils/site-settings.cjs.map +0 -7
  127. package/build/request-utils/templates.cjs +0 -68
  128. package/build/request-utils/templates.cjs.map +0 -7
  129. package/build/request-utils/themes.cjs +0 -92
  130. package/build/request-utils/themes.cjs.map +0 -7
  131. package/build/request-utils/users.cjs +0 -83
  132. package/build/request-utils/users.cjs.map +0 -7
  133. package/build/request-utils/widgets.cjs +0 -79
  134. package/build/request-utils/widgets.cjs.map +0 -7
  135. package/build/test.cjs +0 -136
  136. package/build/test.cjs.map +0 -7
  137. package/build/types.cjs +0 -19
  138. package/build/types.cjs.map +0 -7
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/admin/edit-post.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Admin } from '.';\n\n/**\n * Open the post with given ID in the editor.\n *\n * @param this\n * @param postId Post ID to visit.\n */\nexport async function editPost( this: Admin, postId: string | number ) {\n\tconst query = new URLSearchParams();\n\n\tquery.set( 'post', String( postId ) );\n\tquery.set( 'action', 'edit' );\n\n\tawait this.visitAdminPage( 'post.php', query.toString() );\n\n\tawait this.editor.setPreferences( 'core/edit-post', {\n\t\twelcomeGuide: false,\n\t\tfullscreenMode: false,\n\t} );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,SAAuB,QAA0B;AACtE,QAAM,QAAQ,IAAI,gBAAgB;AAElC,QAAM,IAAK,QAAQ,OAAQ,MAAO,CAAE;AACpC,QAAM,IAAK,UAAU,MAAO;AAE5B,QAAM,KAAK,eAAgB,YAAY,MAAM,SAAS,CAAE;AAExD,QAAM,KAAK,OAAO,eAAgB,kBAAkB;AAAA,IACnD,cAAc;AAAA,IACd,gBAAgB;AAAA,EACjB,CAAE;AACH;",
6
- "names": []
7
- }
@@ -1,36 +0,0 @@
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/admin/get-page-error.ts
21
- var get_page_error_exports = {};
22
- __export(get_page_error_exports, {
23
- getPageError: () => getPageError
24
- });
25
- module.exports = __toCommonJS(get_page_error_exports);
26
- var REGEXP_PHP_ERROR = /(<b>)?(Fatal error|Recoverable fatal error|Warning|Parse error|Notice|Strict Standards|Deprecated|Unknown error)(<\/b>)?: (.*?) in (.*?) on line (<b>)?\d+(<\/b>)?/;
27
- async function getPageError() {
28
- const content = await this.page.content();
29
- const match = content.match(REGEXP_PHP_ERROR);
30
- return match ? match[0] : null;
31
- }
32
- // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- getPageError
35
- });
36
- //# sourceMappingURL=get-page-error.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/admin/get-page-error.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Admin } from './';\n\n/**\n * Regular expression matching a displayed PHP error within a markup string.\n *\n * @see https://github.com/php/php-src/blob/598175e/main/main.c#L1257-L1297\n */\nconst REGEXP_PHP_ERROR =\n\t/(<b>)?(Fatal error|Recoverable fatal error|Warning|Parse error|Notice|Strict Standards|Deprecated|Unknown error)(<\\/b>)?: (.*?) in (.*?) on line (<b>)?\\d+(<\\/b>)?/;\n\n/**\n * Returns a promise resolving to one of either a string or null. A string will\n * be resolved if an error message is present in the contents of the page. If no\n * error is present, a null value will be resolved instead. This requires the\n * environment be configured to display errors.\n *\n * @see http://php.net/manual/en/function.error-reporting.php\n *\n * @param this\n * @return Promise resolving to a string or null, depending whether a page error is present.\n */\nexport async function getPageError( this: Admin ) {\n\tconst content = await this.page.content();\n\tconst match = content.match( REGEXP_PHP_ERROR );\n\treturn match ? match[ 0 ] : null;\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAUA,IAAM,mBACL;AAaD,eAAsB,eAA4B;AACjD,QAAM,UAAU,MAAM,KAAK,KAAK,QAAQ;AACxC,QAAM,QAAQ,QAAQ,MAAO,gBAAiB;AAC9C,SAAO,QAAQ,MAAO,CAAE,IAAI;AAC7B;",
6
- "names": []
7
- }
@@ -1,59 +0,0 @@
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/admin/index.ts
21
- var admin_exports = {};
22
- __export(admin_exports, {
23
- Admin: () => Admin
24
- });
25
- module.exports = __toCommonJS(admin_exports);
26
- var import_create_new_post = require("./create-new-post.cjs");
27
- var import_get_page_error = require("./get-page-error.cjs");
28
- var import_visit_admin_page = require("./visit-admin-page.cjs");
29
- var import_edit_post = require("./edit-post.cjs");
30
- var import_visit_site_editor = require("./visit-site-editor.cjs");
31
- var Admin = class {
32
- page;
33
- context;
34
- browser;
35
- pageUtils;
36
- editor;
37
- constructor({ page, pageUtils, editor }) {
38
- this.page = page;
39
- this.context = page.context();
40
- this.browser = this.context.browser();
41
- this.pageUtils = pageUtils;
42
- this.editor = editor;
43
- }
44
- /** @borrows createNewPost as this.createNewPost */
45
- createNewPost = import_create_new_post.createNewPost.bind(this);
46
- /** @borrows editPost as this.editPost */
47
- editPost = import_edit_post.editPost.bind(this);
48
- /** @borrows getPageError as this.getPageError */
49
- getPageError = import_get_page_error.getPageError.bind(this);
50
- /** @borrows visitAdminPage as this.visitAdminPage */
51
- visitAdminPage = import_visit_admin_page.visitAdminPage.bind(this);
52
- /** @borrows visitSiteEditor as this.visitSiteEditor */
53
- visitSiteEditor = import_visit_site_editor.visitSiteEditor.bind(this);
54
- };
55
- // Annotate the CommonJS export names for ESM import in node:
56
- 0 && (module.exports = {
57
- Admin
58
- });
59
- //# sourceMappingURL=index.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/admin/index.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport type { Browser, Page, BrowserContext } from '@playwright/test';\n\n/**\n * Internal dependencies\n */\nimport { createNewPost } from './create-new-post';\nimport { getPageError } from './get-page-error';\nimport { visitAdminPage } from './visit-admin-page';\nimport { editPost } from './edit-post';\nimport { visitSiteEditor } from './visit-site-editor';\nimport type { PageUtils } from '../page-utils';\nimport type { Editor } from '../editor';\n\ntype AdminConstructorProps = {\n\tpage: Page;\n\tpageUtils: PageUtils;\n\teditor: Editor;\n};\n\nexport class Admin {\n\tpage: Page;\n\tcontext: BrowserContext;\n\tbrowser: Browser;\n\tpageUtils: PageUtils;\n\teditor: Editor;\n\n\tconstructor( { page, pageUtils, editor }: AdminConstructorProps ) {\n\t\tthis.page = page;\n\t\tthis.context = page.context();\n\t\tthis.browser = this.context.browser()!;\n\t\tthis.pageUtils = pageUtils;\n\t\tthis.editor = editor;\n\t}\n\n\t/** @borrows createNewPost as this.createNewPost */\n\tcreateNewPost: typeof createNewPost = createNewPost.bind( this );\n\t/** @borrows editPost as this.editPost */\n\teditPost: typeof editPost = editPost.bind( this );\n\t/** @borrows getPageError as this.getPageError */\n\tgetPageError: typeof getPageError = getPageError.bind( this );\n\t/** @borrows visitAdminPage as this.visitAdminPage */\n\tvisitAdminPage: typeof visitAdminPage = visitAdminPage.bind( this );\n\t/** @borrows visitSiteEditor as this.visitSiteEditor */\n\tvisitSiteEditor: typeof visitSiteEditor = visitSiteEditor.bind( this );\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAQA,6BAA8B;AAC9B,4BAA6B;AAC7B,8BAA+B;AAC/B,uBAAyB;AACzB,+BAAgC;AAUzB,IAAM,QAAN,MAAY;AAAA,EAClB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAa,EAAE,MAAM,WAAW,OAAO,GAA2B;AACjE,SAAK,OAAO;AACZ,SAAK,UAAU,KAAK,QAAQ;AAC5B,SAAK,UAAU,KAAK,QAAQ,QAAQ;AACpC,SAAK,YAAY;AACjB,SAAK,SAAS;AAAA,EACf;AAAA;AAAA,EAGA,gBAAsC,qCAAc,KAAM,IAAK;AAAA;AAAA,EAE/D,WAA4B,0BAAS,KAAM,IAAK;AAAA;AAAA,EAEhD,eAAoC,mCAAa,KAAM,IAAK;AAAA;AAAA,EAE5D,iBAAwC,uCAAe,KAAM,IAAK;AAAA;AAAA,EAElE,kBAA0C,yCAAgB,KAAM,IAAK;AACtE;",
6
- "names": []
7
- }
@@ -1,47 +0,0 @@
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/admin/visit-admin-page.ts
21
- var visit_admin_page_exports = {};
22
- __export(visit_admin_page_exports, {
23
- visitAdminPage: () => visitAdminPage
24
- });
25
- module.exports = __toCommonJS(visit_admin_page_exports);
26
- var import_path = require("path");
27
- async function visitAdminPage(adminPath, query) {
28
- await this.page.goto(
29
- (0, import_path.join)("wp-admin", adminPath) + (query ? `?${query}` : "")
30
- );
31
- if (this.pageUtils.isCurrentURL("wp-admin/upgrade.php")) {
32
- await this.page.click(".button.button-large.button-primary");
33
- await this.page.click(".button.button-large");
34
- }
35
- if (this.pageUtils.isCurrentURL("wp-login.php")) {
36
- throw new Error("Not logged in");
37
- }
38
- const error = await this.getPageError();
39
- if (error) {
40
- throw new Error("Unexpected error in page content: " + error);
41
- }
42
- }
43
- // Annotate the CommonJS export names for ESM import in node:
44
- 0 && (module.exports = {
45
- visitAdminPage
46
- });
47
- //# sourceMappingURL=visit-admin-page.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/admin/visit-admin-page.ts"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport { join } from 'path';\n\n/**\n * Internal dependencies\n */\nimport type { Admin } from './';\n\n/**\n * Visits admin page and handle errors.\n *\n * @param this\n * @param adminPath String to be serialized as pathname.\n * @param query String to be serialized as query portion of URL.\n */\nexport async function visitAdminPage(\n\tthis: Admin,\n\tadminPath: string,\n\tquery?: string\n) {\n\tawait this.page.goto(\n\t\tjoin( 'wp-admin', adminPath ) + ( query ? `?${ query }` : '' )\n\t);\n\n\t// Handle upgrade required screen\n\tif ( this.pageUtils.isCurrentURL( 'wp-admin/upgrade.php' ) ) {\n\t\t// Click update\n\t\tawait this.page.click( '.button.button-large.button-primary' );\n\t\t// Click continue\n\t\tawait this.page.click( '.button.button-large' );\n\t}\n\n\tif ( this.pageUtils.isCurrentURL( 'wp-login.php' ) ) {\n\t\tthrow new Error( 'Not logged in' );\n\t}\n\n\tconst error = await this.getPageError();\n\tif ( error ) {\n\t\tthrow new Error( 'Unexpected error in page content: ' + error );\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAGA,kBAAqB;AAcrB,eAAsB,eAErB,WACA,OACC;AACD,QAAM,KAAK,KAAK;AAAA,QACf,kBAAM,YAAY,SAAU,KAAM,QAAQ,IAAK,KAAM,KAAK;AAAA,EAC3D;AAGA,MAAK,KAAK,UAAU,aAAc,sBAAuB,GAAI;AAE5D,UAAM,KAAK,KAAK,MAAO,qCAAsC;AAE7D,UAAM,KAAK,KAAK,MAAO,sBAAuB;AAAA,EAC/C;AAEA,MAAK,KAAK,UAAU,aAAc,cAAe,GAAI;AACpD,UAAM,IAAI,MAAO,eAAgB;AAAA,EAClC;AAEA,QAAM,QAAQ,MAAM,KAAK,aAAa;AACtC,MAAK,OAAQ;AACZ,UAAM,IAAI,MAAO,uCAAuC,KAAM;AAAA,EAC/D;AACD;",
6
- "names": []
7
- }
@@ -1,90 +0,0 @@
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/admin/visit-site-editor.ts
21
- var visit_site_editor_exports = {};
22
- __export(visit_site_editor_exports, {
23
- visitSiteEditor: () => visitSiteEditor
24
- });
25
- module.exports = __toCommonJS(visit_site_editor_exports);
26
- async function visitSiteEditor(options = {}) {
27
- const { postId, postType, path, canvas, activeView } = options;
28
- const query = new URLSearchParams();
29
- if (postId) {
30
- query.set("postId", String(postId));
31
- }
32
- if (postType) {
33
- query.set("postType", postType);
34
- }
35
- if (path) {
36
- query.set("path", path);
37
- }
38
- if (canvas) {
39
- query.set("canvas", canvas);
40
- }
41
- if (activeView) {
42
- query.set("activeView", activeView);
43
- }
44
- await this.visitAdminPage("site-editor.php", query.toString());
45
- if (!options.showWelcomeGuide) {
46
- await this.editor.setPreferences("core/edit-site", {
47
- welcomeGuide: false,
48
- welcomeGuideStyles: false,
49
- welcomeGuidePage: false,
50
- welcomeGuideTemplate: false
51
- });
52
- }
53
- if (!query.size || postId || canvas === "edit") {
54
- await this.page.evaluate(() => {
55
- const MAX_LOADING_TIME = 1e4;
56
- const MAX_PAUSE_TIME = 100;
57
- return new Promise((resolve) => {
58
- let pauseTimeout;
59
- function finish() {
60
- unsubscribe();
61
- clearTimeout(pauseTimeout);
62
- clearTimeout(maxTimeout);
63
- resolve();
64
- }
65
- const maxTimeout = setTimeout(finish, MAX_LOADING_TIME);
66
- function checkResolving() {
67
- const isResolving = window.wp.data.select("core").hasResolvingSelectors();
68
- if (isResolving) {
69
- clearTimeout(pauseTimeout);
70
- pauseTimeout = void 0;
71
- return;
72
- }
73
- if (!pauseTimeout) {
74
- pauseTimeout = setTimeout(finish, MAX_PAUSE_TIME);
75
- }
76
- }
77
- const unsubscribe = window.wp.data.subscribe(
78
- checkResolving,
79
- "core"
80
- );
81
- checkResolving();
82
- });
83
- });
84
- }
85
- }
86
- // Annotate the CommonJS export names for ESM import in node:
87
- 0 && (module.exports = {
88
- visitSiteEditor
89
- });
90
- //# sourceMappingURL=visit-site-editor.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/admin/visit-site-editor.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Admin } from './';\n\ninterface SiteEditorOptions {\n\tpostId?: string | number;\n\tpostType?: string;\n\tpath?: string;\n\tcanvas?: string;\n\tactiveView?: string;\n\tshowWelcomeGuide?: boolean;\n}\n\n/**\n * Visits the Site Editor main page.\n *\n * @param this\n * @param options Options to visit the site editor.\n */\nexport async function visitSiteEditor(\n\tthis: Admin,\n\toptions: SiteEditorOptions = {}\n) {\n\tconst { postId, postType, path, canvas, activeView } = options;\n\tconst query = new URLSearchParams();\n\n\tif ( postId ) {\n\t\tquery.set( 'postId', String( postId ) );\n\t}\n\tif ( postType ) {\n\t\tquery.set( 'postType', postType );\n\t}\n\tif ( path ) {\n\t\tquery.set( 'path', path );\n\t}\n\tif ( canvas ) {\n\t\tquery.set( 'canvas', canvas );\n\t}\n\tif ( activeView ) {\n\t\tquery.set( 'activeView', activeView );\n\t}\n\n\tawait this.visitAdminPage( 'site-editor.php', query.toString() );\n\n\tif ( ! options.showWelcomeGuide ) {\n\t\tawait this.editor.setPreferences( 'core/edit-site', {\n\t\t\twelcomeGuide: false,\n\t\t\twelcomeGuideStyles: false,\n\t\t\twelcomeGuidePage: false,\n\t\t\twelcomeGuideTemplate: false,\n\t\t} );\n\t}\n\n\t/**\n\t * Wait until the editor is loaded. The logic is a copy of the\n\t * `waitWhileSiteEditorLoading` function in the `edit-site` package.\n\t */\n\tif ( ! query.size || postId || canvas === 'edit' ) {\n\t\tawait this.page.evaluate( () => {\n\t\t\tconst MAX_LOADING_TIME = 10000;\n\t\t\tconst MAX_PAUSE_TIME = 100;\n\n\t\t\treturn new Promise< void >( ( resolve ) => {\n\t\t\t\tlet pauseTimeout: ReturnType< typeof setTimeout > | undefined;\n\n\t\t\t\tfunction finish() {\n\t\t\t\t\tunsubscribe();\n\t\t\t\t\tclearTimeout( pauseTimeout );\n\t\t\t\t\tclearTimeout( maxTimeout );\n\t\t\t\t\tresolve();\n\t\t\t\t}\n\n\t\t\t\tconst maxTimeout = setTimeout( finish, MAX_LOADING_TIME );\n\n\t\t\t\tfunction checkResolving() {\n\t\t\t\t\tconst isResolving = window.wp.data\n\t\t\t\t\t\t.select( 'core' )\n\t\t\t\t\t\t.hasResolvingSelectors();\n\n\t\t\t\t\tif ( isResolving ) {\n\t\t\t\t\t\tclearTimeout( pauseTimeout );\n\t\t\t\t\t\tpauseTimeout = undefined;\n\t\t\t\t\t\treturn;\n\t\t\t\t\t}\n\n\t\t\t\t\tif ( ! pauseTimeout ) {\n\t\t\t\t\t\tpauseTimeout = setTimeout( finish, MAX_PAUSE_TIME );\n\t\t\t\t\t}\n\t\t\t\t}\n\n\t\t\t\tconst unsubscribe = window.wp.data.subscribe(\n\t\t\t\t\tcheckResolving,\n\t\t\t\t\t'core'\n\t\t\t\t);\n\t\t\t\tcheckResolving();\n\t\t\t} );\n\t\t} );\n\t}\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBA,eAAsB,gBAErB,UAA6B,CAAC,GAC7B;AACD,QAAM,EAAE,QAAQ,UAAU,MAAM,QAAQ,WAAW,IAAI;AACvD,QAAM,QAAQ,IAAI,gBAAgB;AAElC,MAAK,QAAS;AACb,UAAM,IAAK,UAAU,OAAQ,MAAO,CAAE;AAAA,EACvC;AACA,MAAK,UAAW;AACf,UAAM,IAAK,YAAY,QAAS;AAAA,EACjC;AACA,MAAK,MAAO;AACX,UAAM,IAAK,QAAQ,IAAK;AAAA,EACzB;AACA,MAAK,QAAS;AACb,UAAM,IAAK,UAAU,MAAO;AAAA,EAC7B;AACA,MAAK,YAAa;AACjB,UAAM,IAAK,cAAc,UAAW;AAAA,EACrC;AAEA,QAAM,KAAK,eAAgB,mBAAmB,MAAM,SAAS,CAAE;AAE/D,MAAK,CAAE,QAAQ,kBAAmB;AACjC,UAAM,KAAK,OAAO,eAAgB,kBAAkB;AAAA,MACnD,cAAc;AAAA,MACd,oBAAoB;AAAA,MACpB,kBAAkB;AAAA,MAClB,sBAAsB;AAAA,IACvB,CAAE;AAAA,EACH;AAMA,MAAK,CAAE,MAAM,QAAQ,UAAU,WAAW,QAAS;AAClD,UAAM,KAAK,KAAK,SAAU,MAAM;AAC/B,YAAM,mBAAmB;AACzB,YAAM,iBAAiB;AAEvB,aAAO,IAAI,QAAiB,CAAE,YAAa;AAC1C,YAAI;AAEJ,iBAAS,SAAS;AACjB,sBAAY;AACZ,uBAAc,YAAa;AAC3B,uBAAc,UAAW;AACzB,kBAAQ;AAAA,QACT;AAEA,cAAM,aAAa,WAAY,QAAQ,gBAAiB;AAExD,iBAAS,iBAAiB;AACzB,gBAAM,cAAc,OAAO,GAAG,KAC5B,OAAQ,MAAO,EACf,sBAAsB;AAExB,cAAK,aAAc;AAClB,yBAAc,YAAa;AAC3B,2BAAe;AACf;AAAA,UACD;AAEA,cAAK,CAAE,cAAe;AACrB,2BAAe,WAAY,QAAQ,cAAe;AAAA,UACnD;AAAA,QACD;AAEA,cAAM,cAAc,OAAO,GAAG,KAAK;AAAA,UAClC;AAAA,UACA;AAAA,QACD;AACA,uBAAe;AAAA,MAChB,CAAE;AAAA,IACH,CAAE;AAAA,EACH;AACD;",
6
- "names": []
7
- }
package/build/config.cjs DELETED
@@ -1,45 +0,0 @@
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/config.ts
21
- var config_exports = {};
22
- __export(config_exports, {
23
- WP_ADMIN_USER: () => WP_ADMIN_USER,
24
- WP_BASE_URL: () => WP_BASE_URL,
25
- WP_PASSWORD: () => WP_PASSWORD,
26
- WP_USERNAME: () => WP_USERNAME
27
- });
28
- module.exports = __toCommonJS(config_exports);
29
- var {
30
- WP_USERNAME = "admin",
31
- WP_PASSWORD = "password",
32
- WP_BASE_URL = "http://localhost:8889"
33
- } = process.env;
34
- var WP_ADMIN_USER = {
35
- username: WP_USERNAME,
36
- password: WP_PASSWORD
37
- };
38
- // Annotate the CommonJS export names for ESM import in node:
39
- 0 && (module.exports = {
40
- WP_ADMIN_USER,
41
- WP_BASE_URL,
42
- WP_PASSWORD,
43
- WP_USERNAME
44
- });
45
- //# sourceMappingURL=config.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../src/config.ts"],
4
- "sourcesContent": ["const {\n\tWP_USERNAME = 'admin',\n\tWP_PASSWORD = 'password',\n\tWP_BASE_URL = 'http://localhost:8889',\n} = process.env;\n\nconst WP_ADMIN_USER = {\n\tusername: WP_USERNAME,\n\tpassword: WP_PASSWORD,\n} as const;\n\nexport { WP_ADMIN_USER, WP_USERNAME, WP_PASSWORD, WP_BASE_URL };\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAAM;AAAA,EACL,cAAc;AAAA,EACd,cAAc;AAAA,EACd,cAAc;AACf,IAAI,QAAQ;AAEZ,IAAM,gBAAgB;AAAA,EACrB,UAAU;AAAA,EACV,UAAU;AACX;",
6
- "names": []
7
- }
@@ -1,34 +0,0 @@
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/click-block-options-menu-item.ts
21
- var click_block_options_menu_item_exports = {};
22
- __export(click_block_options_menu_item_exports, {
23
- clickBlockOptionsMenuItem: () => clickBlockOptionsMenuItem
24
- });
25
- module.exports = __toCommonJS(click_block_options_menu_item_exports);
26
- async function clickBlockOptionsMenuItem(label) {
27
- await this.clickBlockToolbarButton("Options");
28
- await this.page.getByRole("menu", { name: "Options" }).getByRole("menuitem", { name: label }).click();
29
- }
30
- // Annotate the CommonJS export names for ESM import in node:
31
- 0 && (module.exports = {
32
- clickBlockOptionsMenuItem
33
- });
34
- //# sourceMappingURL=click-block-options-menu-item.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/editor/click-block-options-menu-item.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Clicks a block toolbar button.\n *\n * @param this\n * @param label The text string of the button label.\n */\nexport async function clickBlockOptionsMenuItem( this: Editor, label: string ) {\n\tawait this.clickBlockToolbarButton( 'Options' );\n\tawait this.page\n\t\t.getByRole( 'menu', { name: 'Options' } )\n\t\t.getByRole( 'menuitem', { name: label } )\n\t\t.click();\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,0BAAyC,OAAgB;AAC9E,QAAM,KAAK,wBAAyB,SAAU;AAC9C,QAAM,KAAK,KACT,UAAW,QAAQ,EAAE,MAAM,UAAU,CAAE,EACvC,UAAW,YAAY,EAAE,MAAM,MAAM,CAAE,EACvC,MAAM;AACT;",
6
- "names": []
7
- }
@@ -1,38 +0,0 @@
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/click-block-toolbar-button.ts
21
- var click_block_toolbar_button_exports = {};
22
- __export(click_block_toolbar_button_exports, {
23
- clickBlockToolbarButton: () => clickBlockToolbarButton
24
- });
25
- module.exports = __toCommonJS(click_block_toolbar_button_exports);
26
- async function clickBlockToolbarButton(label) {
27
- await this.showBlockToolbar();
28
- const blockToolbar = this.page.locator(
29
- 'role=toolbar[name="Block tools"i]'
30
- );
31
- const button = blockToolbar.locator(`role=button[name="${label}"]`);
32
- await button.click();
33
- }
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- clickBlockToolbarButton
37
- });
38
- //# sourceMappingURL=click-block-toolbar-button.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/editor/click-block-toolbar-button.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Clicks a block toolbar button.\n *\n * @param this\n * @param label The text string of the button label.\n */\nexport async function clickBlockToolbarButton( this: Editor, label: string ) {\n\tawait this.showBlockToolbar();\n\n\tconst blockToolbar = this.page.locator(\n\t\t'role=toolbar[name=\"Block tools\"i]'\n\t);\n\tconst button = blockToolbar.locator( `role=button[name=\"${ label }\"]` );\n\n\tawait button.click();\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAWA,eAAsB,wBAAuC,OAAgB;AAC5E,QAAM,KAAK,iBAAiB;AAE5B,QAAM,eAAe,KAAK,KAAK;AAAA,IAC9B;AAAA,EACD;AACA,QAAM,SAAS,aAAa,QAAS,qBAAsB,KAAM,IAAK;AAEtE,QAAM,OAAO,MAAM;AACpB;",
6
- "names": []
7
- }
@@ -1,64 +0,0 @@
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/get-blocks.ts
21
- var get_blocks_exports = {};
22
- __export(get_blocks_exports, {
23
- getBlocks: () => getBlocks
24
- });
25
- module.exports = __toCommonJS(get_blocks_exports);
26
- async function getBlocks({ clientId, full = false } = {}) {
27
- await this.page.waitForFunction(
28
- () => window?.wp?.blocks && window?.wp?.data
29
- );
30
- return await this.page.evaluate(
31
- ([_full, _clientId]) => {
32
- function serializeAttributes(attributes) {
33
- return Object.fromEntries(
34
- Object.entries(attributes).map(([key, value]) => {
35
- if (value instanceof window.wp.richText.RichTextData) {
36
- return [key, value.toString()];
37
- }
38
- return [key, value];
39
- })
40
- );
41
- }
42
- function recursivelyTransformBlocks(blocks2) {
43
- return blocks2.map((block) => ({
44
- name: block.name,
45
- attributes: serializeAttributes(block.attributes),
46
- innerBlocks: recursivelyTransformBlocks(
47
- block.innerBlocks
48
- )
49
- }));
50
- }
51
- const blocks = window.wp.data.select("core/block-editor").getBlocks(_clientId);
52
- if (blocks.length === 1 && window.wp.blocks.isUnmodifiedDefaultBlock(blocks[0])) {
53
- return [];
54
- }
55
- return _full ? blocks : recursivelyTransformBlocks(blocks);
56
- },
57
- [full, clientId]
58
- );
59
- }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- getBlocks
63
- });
64
- //# sourceMappingURL=get-blocks.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/editor/get-blocks.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\ntype Block = {\n\tname: string;\n\tattributes: Record< string, unknown >;\n\tinnerBlocks: Block[];\n};\n\n/**\n * Returns the edited blocks.\n *\n * @param options\n * @param options.clientId Limit the results to be only under a partial tree of the specified clientId.\n * @param options.full Whether to return the full block data or just the name and attributes.\n *\n * @return The blocks.\n */\nexport async function getBlocks(\n\tthis: Editor,\n\t{ clientId, full = false }: { clientId?: string; full?: boolean } = {}\n) {\n\tawait this.page.waitForFunction(\n\t\t() => window?.wp?.blocks && window?.wp?.data\n\t);\n\n\treturn await this.page.evaluate(\n\t\t( [ _full, _clientId ] ) => {\n\t\t\t// Serialize serializable attributes of blocks.\n\t\t\tfunction serializeAttributes(\n\t\t\t\tattributes: Record< string, unknown >\n\t\t\t) {\n\t\t\t\treturn Object.fromEntries(\n\t\t\t\t\tObject.entries( attributes ).map( ( [ key, value ] ) => {\n\t\t\t\t\t\t// Serialize RichTextData to string.\n\t\t\t\t\t\tif (\n\t\t\t\t\t\t\tvalue instanceof window.wp.richText.RichTextData\n\t\t\t\t\t\t) {\n\t\t\t\t\t\t\treturn [ key, ( value as string ).toString() ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn [ key, value ];\n\t\t\t\t\t} )\n\t\t\t\t);\n\t\t\t}\n\n\t\t\t// Remove other unpredictable properties like clientId from blocks for testing purposes.\n\t\t\tfunction recursivelyTransformBlocks( blocks: Block[] ): Block[] {\n\t\t\t\treturn blocks.map( ( block ) => ( {\n\t\t\t\t\tname: block.name,\n\t\t\t\t\tattributes: serializeAttributes( block.attributes ),\n\t\t\t\t\tinnerBlocks: recursivelyTransformBlocks(\n\t\t\t\t\t\tblock.innerBlocks\n\t\t\t\t\t),\n\t\t\t\t} ) );\n\t\t\t}\n\n\t\t\tconst blocks = window.wp.data\n\t\t\t\t.select( 'core/block-editor' )\n\t\t\t\t.getBlocks( _clientId ) as Block[];\n\n\t\t\t// The editor might still contain an unmodified empty block even when it's technically \"empty\".\n\t\t\tif (\n\t\t\t\tblocks.length === 1 &&\n\t\t\t\twindow.wp.blocks.isUnmodifiedDefaultBlock( blocks[ 0 ] )\n\t\t\t) {\n\t\t\t\treturn [];\n\t\t\t}\n\n\t\t\treturn _full ? blocks : recursivelyTransformBlocks( blocks );\n\t\t},\n\t\t[ full, clientId ]\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAoBA,eAAsB,UAErB,EAAE,UAAU,OAAO,MAAM,IAA2C,CAAC,GACpE;AACD,QAAM,KAAK,KAAK;AAAA,IACf,MAAM,QAAQ,IAAI,UAAU,QAAQ,IAAI;AAAA,EACzC;AAEA,SAAO,MAAM,KAAK,KAAK;AAAA,IACtB,CAAE,CAAE,OAAO,SAAU,MAAO;AAE3B,eAAS,oBACR,YACC;AACD,eAAO,OAAO;AAAA,UACb,OAAO,QAAS,UAAW,EAAE,IAAK,CAAE,CAAE,KAAK,KAAM,MAAO;AAEvD,gBACC,iBAAiB,OAAO,GAAG,SAAS,cACnC;AACD,qBAAO,CAAE,KAAO,MAAkB,SAAS,CAAE;AAAA,YAC9C;AACA,mBAAO,CAAE,KAAK,KAAM;AAAA,UACrB,CAAE;AAAA,QACH;AAAA,MACD;AAGA,eAAS,2BAA4BA,SAA2B;AAC/D,eAAOA,QAAO,IAAK,CAAE,WAAa;AAAA,UACjC,MAAM,MAAM;AAAA,UACZ,YAAY,oBAAqB,MAAM,UAAW;AAAA,UAClD,aAAa;AAAA,YACZ,MAAM;AAAA,UACP;AAAA,QACD,EAAI;AAAA,MACL;AAEA,YAAM,SAAS,OAAO,GAAG,KACvB,OAAQ,mBAAoB,EAC5B,UAAW,SAAU;AAGvB,UACC,OAAO,WAAW,KAClB,OAAO,GAAG,OAAO,yBAA0B,OAAQ,CAAE,CAAE,GACtD;AACD,eAAO,CAAC;AAAA,MACT;AAEA,aAAO,QAAQ,SAAS,2BAA4B,MAAO;AAAA,IAC5D;AAAA,IACA,CAAE,MAAM,QAAS;AAAA,EAClB;AACD;",
6
- "names": ["blocks"]
7
- }
@@ -1,36 +0,0 @@
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/get-edited-post-content.ts
21
- var get_edited_post_content_exports = {};
22
- __export(get_edited_post_content_exports, {
23
- getEditedPostContent: () => getEditedPostContent
24
- });
25
- module.exports = __toCommonJS(get_edited_post_content_exports);
26
- async function getEditedPostContent() {
27
- await this.page.waitForFunction(() => window?.wp?.data);
28
- return await this.page.evaluate(
29
- () => window.wp.data.select("core/editor").getEditedPostContent()
30
- );
31
- }
32
- // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- getEditedPostContent
35
- });
36
- //# sourceMappingURL=get-edited-post-content.cjs.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../src/editor/get-edited-post-content.ts"],
4
- "sourcesContent": ["/**\n * Internal dependencies\n */\nimport type { Editor } from './index';\n\n/**\n * Returns a promise which resolves with the edited post content (HTML string).\n *\n * @param this\n *\n * @return Promise resolving with post content markup.\n */\nexport async function getEditedPostContent( this: Editor ) {\n\tawait this.page.waitForFunction( () => window?.wp?.data );\n\n\treturn await this.page.evaluate( () =>\n\t\twindow.wp.data.select( 'core/editor' ).getEditedPostContent()\n\t);\n}\n"],
5
- "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAYA,eAAsB,uBAAqC;AAC1D,QAAM,KAAK,KAAK,gBAAiB,MAAM,QAAQ,IAAI,IAAK;AAExD,SAAO,MAAM,KAAK,KAAK;AAAA,IAAU,MAChC,OAAO,GAAG,KAAK,OAAQ,aAAc,EAAE,qBAAqB;AAAA,EAC7D;AACD;",
6
- "names": []
7
- }