@wordpress/e2e-test-utils-playwright 1.37.0 → 1.37.1-next.79a2f3cdd.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 (228) hide show
  1. package/LICENSE.md +1 -1
  2. package/build/admin/create-new-post.cjs +51 -0
  3. package/build/admin/create-new-post.cjs.map +7 -0
  4. package/build/admin/create-new-post.js +28 -48
  5. package/build/admin/create-new-post.js.map +1 -7
  6. package/build/admin/edit-post.cjs +40 -0
  7. package/build/admin/edit-post.cjs.map +7 -0
  8. package/build/admin/edit-post.js +17 -37
  9. package/build/admin/edit-post.js.map +1 -7
  10. package/build/admin/get-page-error.cjs +36 -0
  11. package/build/admin/get-page-error.cjs.map +7 -0
  12. package/build/admin/get-page-error.js +23 -33
  13. package/build/admin/get-page-error.js.map +1 -7
  14. package/build/admin/index.cjs +59 -0
  15. package/build/admin/index.cjs.map +7 -0
  16. package/build/admin/index.js +36 -58
  17. package/build/admin/index.js.map +1 -7
  18. package/build/admin/visit-admin-page.cjs +47 -0
  19. package/build/admin/visit-admin-page.cjs.map +7 -0
  20. package/build/admin/visit-admin-page.js +29 -44
  21. package/build/admin/visit-admin-page.js.map +1 -7
  22. package/build/admin/visit-site-editor.cjs +77 -0
  23. package/build/admin/visit-site-editor.cjs.map +7 -0
  24. package/build/admin/visit-site-editor.js +64 -73
  25. package/build/admin/visit-site-editor.js.map +1 -7
  26. package/build/config.cjs +45 -0
  27. package/build/config.cjs.map +7 -0
  28. package/build/config.js +11 -43
  29. package/build/config.js.map +1 -7
  30. package/build/editor/click-block-options-menu-item.cjs +34 -0
  31. package/build/editor/click-block-options-menu-item.cjs.map +7 -0
  32. package/build/editor/click-block-options-menu-item.js +14 -31
  33. package/build/editor/click-block-options-menu-item.js.map +1 -7
  34. package/build/editor/click-block-toolbar-button.cjs +38 -0
  35. package/build/editor/click-block-toolbar-button.cjs.map +7 -0
  36. package/build/editor/click-block-toolbar-button.js +13 -35
  37. package/build/editor/click-block-toolbar-button.js.map +1 -7
  38. package/build/editor/get-blocks.cjs +64 -0
  39. package/build/editor/get-blocks.cjs.map +7 -0
  40. package/build/editor/get-blocks.js +43 -61
  41. package/build/editor/get-blocks.js.map +1 -7
  42. package/build/editor/get-edited-post-content.cjs +36 -0
  43. package/build/editor/get-edited-post-content.cjs.map +7 -0
  44. package/build/editor/get-edited-post-content.js +12 -33
  45. package/build/editor/get-edited-post-content.js.map +1 -7
  46. package/build/editor/index.cjs +97 -0
  47. package/build/editor/index.cjs.map +7 -0
  48. package/build/editor/index.js +74 -96
  49. package/build/editor/index.js.map +1 -7
  50. package/build/editor/insert-block.cjs +55 -0
  51. package/build/editor/insert-block.cjs.map +7 -0
  52. package/build/editor/insert-block.js +21 -52
  53. package/build/editor/insert-block.js.map +1 -7
  54. package/build/editor/open-document-settings-sidebar.cjs +42 -0
  55. package/build/editor/open-document-settings-sidebar.cjs.map +7 -0
  56. package/build/editor/open-document-settings-sidebar.js +24 -39
  57. package/build/editor/open-document-settings-sidebar.js.map +1 -7
  58. package/build/editor/preview.cjs +42 -0
  59. package/build/editor/preview.cjs.map +7 -0
  60. package/build/editor/preview.js +18 -39
  61. package/build/editor/preview.js.map +1 -7
  62. package/build/editor/publish-post.cjs +47 -0
  63. package/build/editor/publish-post.cjs.map +7 -0
  64. package/build/editor/publish-post.js +42 -44
  65. package/build/editor/publish-post.js.map +1 -7
  66. package/build/editor/save-draft.cjs +34 -0
  67. package/build/editor/save-draft.cjs.map +7 -0
  68. package/build/editor/save-draft.js +15 -31
  69. package/build/editor/save-draft.js.map +1 -7
  70. package/build/editor/select-blocks.cjs +51 -0
  71. package/build/editor/select-blocks.cjs.map +7 -0
  72. package/build/editor/select-blocks.js +25 -48
  73. package/build/editor/select-blocks.js.map +1 -7
  74. package/build/editor/set-content.cjs +39 -0
  75. package/build/editor/set-content.cjs.map +7 -0
  76. package/build/editor/set-content.js +14 -36
  77. package/build/editor/set-content.js.map +1 -7
  78. package/build/editor/set-is-fixed-toolbar.cjs +36 -0
  79. package/build/editor/set-is-fixed-toolbar.cjs.map +7 -0
  80. package/build/editor/set-is-fixed-toolbar.js +15 -33
  81. package/build/editor/set-is-fixed-toolbar.js.map +1 -7
  82. package/build/editor/set-preferences.cjs +43 -0
  83. package/build/editor/set-preferences.cjs.map +7 -0
  84. package/build/editor/set-preferences.js +18 -40
  85. package/build/editor/set-preferences.js.map +1 -7
  86. package/build/editor/show-block-toolbar.cjs +35 -0
  87. package/build/editor/show-block-toolbar.cjs.map +7 -0
  88. package/build/editor/show-block-toolbar.js +16 -32
  89. package/build/editor/show-block-toolbar.js.map +1 -7
  90. package/build/editor/site-editor.cjs +51 -0
  91. package/build/editor/site-editor.cjs.map +7 -0
  92. package/build/editor/site-editor.js +41 -48
  93. package/build/editor/site-editor.js.map +1 -7
  94. package/build/editor/switch-editor-tool.cjs +47 -0
  95. package/build/editor/switch-editor-tool.cjs.map +7 -0
  96. package/build/editor/switch-editor-tool.js +30 -44
  97. package/build/editor/switch-editor-tool.js.map +1 -7
  98. package/build/editor/switch-to-legacy-canvas.cjs +39 -0
  99. package/build/editor/switch-to-legacy-canvas.cjs.map +7 -0
  100. package/build/editor/switch-to-legacy-canvas.js +14 -35
  101. package/build/editor/switch-to-legacy-canvas.js.map +1 -7
  102. package/build/editor/transform-block-to.cjs +46 -0
  103. package/build/editor/transform-block-to.cjs.map +7 -0
  104. package/build/editor/transform-block-to.js +21 -43
  105. package/build/editor/transform-block-to.js.map +1 -7
  106. package/build/index.cjs +51 -0
  107. package/build/index.cjs.map +7 -0
  108. package/build/index.js +18 -53
  109. package/build/index.js.map +1 -7
  110. package/build/lighthouse/index.cjs +96 -0
  111. package/build/lighthouse/index.cjs.map +7 -0
  112. package/build/lighthouse/index.js +55 -93
  113. package/build/lighthouse/index.js.map +1 -7
  114. package/build/metrics/index.cjs +309 -0
  115. package/build/metrics/index.cjs.map +7 -0
  116. package/build/metrics/index.js +251 -302
  117. package/build/metrics/index.js.map +1 -7
  118. package/build/page-utils/drag-files.cjs +143 -0
  119. package/build/page-utils/drag-files.cjs.map +7 -0
  120. package/build/page-utils/drag-files.js +112 -136
  121. package/build/page-utils/drag-files.js.map +1 -7
  122. package/build/page-utils/emulate-network-conditions.cjs +99 -0
  123. package/build/page-utils/emulate-network-conditions.cjs.map +7 -0
  124. package/build/page-utils/emulate-network-conditions.js +67 -95
  125. package/build/page-utils/emulate-network-conditions.js.map +1 -7
  126. package/build/page-utils/index.cjs +59 -0
  127. package/build/page-utils/index.cjs.map +7 -0
  128. package/build/page-utils/index.js +36 -58
  129. package/build/page-utils/index.js.map +1 -7
  130. package/build/page-utils/is-current-url.cjs +36 -0
  131. package/build/page-utils/is-current-url.cjs.map +7 -0
  132. package/build/page-utils/is-current-url.js +18 -33
  133. package/build/page-utils/is-current-url.js.map +1 -7
  134. package/build/page-utils/keycodes.cjs +55 -0
  135. package/build/page-utils/keycodes.cjs.map +7 -0
  136. package/build/page-utils/keycodes.js +39 -53
  137. package/build/page-utils/keycodes.js.map +1 -7
  138. package/build/page-utils/press-keys.cjs +165 -0
  139. package/build/page-utils/press-keys.cjs.map +7 -0
  140. package/build/page-utils/press-keys.js +130 -153
  141. package/build/page-utils/press-keys.js.map +1 -7
  142. package/build/page-utils/set-browser-viewport.cjs +39 -0
  143. package/build/page-utils/set-browser-viewport.cjs.map +7 -0
  144. package/build/page-utils/set-browser-viewport.js +42 -35
  145. package/build/page-utils/set-browser-viewport.js.map +1 -7
  146. package/build/request-utils/blocks.cjs +56 -0
  147. package/build/request-utils/blocks.cjs.map +7 -0
  148. package/build/request-utils/blocks.js +40 -51
  149. package/build/request-utils/blocks.js.map +1 -7
  150. package/build/request-utils/comments.cjs +66 -0
  151. package/build/request-utils/comments.cjs.map +7 -0
  152. package/build/request-utils/comments.js +45 -59
  153. package/build/request-utils/comments.js.map +1 -7
  154. package/build/request-utils/gutenberg-experiments.cjs +66 -0
  155. package/build/request-utils/gutenberg-experiments.cjs.map +7 -0
  156. package/build/request-utils/gutenberg-experiments.js +38 -63
  157. package/build/request-utils/gutenberg-experiments.js.map +1 -7
  158. package/build/request-utils/index.cjs +194 -0
  159. package/build/request-utils/index.cjs.map +7 -0
  160. package/build/request-utils/index.js +155 -191
  161. package/build/request-utils/index.js.map +1 -7
  162. package/build/request-utils/login.cjs +48 -0
  163. package/build/request-utils/login.cjs.map +7 -0
  164. package/build/request-utils/login.js +18 -45
  165. package/build/request-utils/login.js.map +1 -7
  166. package/build/request-utils/media.cjs +83 -0
  167. package/build/request-utils/media.cjs.map +7 -0
  168. package/build/request-utils/media.js +64 -74
  169. package/build/request-utils/media.js.map +1 -7
  170. package/build/request-utils/menus.cjs +132 -0
  171. package/build/request-utils/menus.cjs.map +7 -0
  172. package/build/request-utils/menus.js +109 -121
  173. package/build/request-utils/menus.js.map +1 -7
  174. package/build/request-utils/pages.cjs +71 -0
  175. package/build/request-utils/pages.cjs.map +7 -0
  176. package/build/request-utils/pages.js +50 -63
  177. package/build/request-utils/pages.js.map +1 -7
  178. package/build/request-utils/patterns.cjs +44 -0
  179. package/build/request-utils/patterns.cjs.map +7 -0
  180. package/build/request-utils/patterns.js +24 -41
  181. package/build/request-utils/patterns.js.map +1 -7
  182. package/build/request-utils/plugins.cjs +81 -0
  183. package/build/request-utils/plugins.cjs.map +7 -0
  184. package/build/request-utils/plugins.js +74 -70
  185. package/build/request-utils/plugins.js.map +1 -7
  186. package/build/request-utils/posts.cjs +61 -0
  187. package/build/request-utils/posts.cjs.map +7 -0
  188. package/build/request-utils/posts.js +41 -55
  189. package/build/request-utils/posts.js.map +1 -7
  190. package/build/request-utils/preferences.cjs +41 -0
  191. package/build/request-utils/preferences.cjs.map +7 -0
  192. package/build/request-utils/preferences.js +17 -38
  193. package/build/request-utils/preferences.js.map +1 -7
  194. package/build/request-utils/rest.cjs +174 -0
  195. package/build/request-utils/rest.cjs.map +7 -0
  196. package/build/request-utils/rest.js +129 -155
  197. package/build/request-utils/rest.js.map +1 -7
  198. package/build/request-utils/site-settings.cjs +45 -0
  199. package/build/request-utils/site-settings.cjs.map +7 -0
  200. package/build/request-utils/site-settings.js +28 -40
  201. package/build/request-utils/site-settings.js.map +1 -7
  202. package/build/request-utils/templates.cjs +68 -0
  203. package/build/request-utils/templates.cjs.map +7 -0
  204. package/build/request-utils/templates.js +46 -60
  205. package/build/request-utils/templates.js.map +1 -7
  206. package/build/request-utils/themes.cjs +89 -0
  207. package/build/request-utils/themes.cjs.map +7 -0
  208. package/build/request-utils/themes.js +53 -80
  209. package/build/request-utils/themes.js.map +1 -7
  210. package/build/request-utils/users.cjs +83 -0
  211. package/build/request-utils/users.cjs.map +7 -0
  212. package/build/request-utils/users.js +72 -74
  213. package/build/request-utils/users.js.map +1 -7
  214. package/build/request-utils/widgets.cjs +79 -0
  215. package/build/request-utils/widgets.cjs.map +7 -0
  216. package/build/request-utils/widgets.js +55 -73
  217. package/build/request-utils/widgets.js.map +1 -7
  218. package/build/test.cjs +136 -0
  219. package/build/test.cjs.map +7 -0
  220. package/build/test.js +146 -130
  221. package/build/test.js.map +1 -7
  222. package/build/types.cjs +19 -0
  223. package/build/types.cjs.map +7 -0
  224. package/build/types.js +2 -18
  225. package/build/types.js.map +1 -7
  226. package/build-types/index.d.ts +1 -1
  227. package/build-types/index.d.ts.map +1 -1
  228. package/package.json +7 -4
@@ -0,0 +1,38 @@
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
@@ -0,0 +1,7 @@
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,38 +1,16 @@
1
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);
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.clickBlockToolbarButton = clickBlockToolbarButton;
4
+ /**
5
+ * Clicks a block toolbar button.
6
+ *
7
+ * @param this
8
+ * @param label The text string of the button label.
9
+ */
26
10
  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();
11
+ await this.showBlockToolbar();
12
+ const blockToolbar = this.page.locator('role=toolbar[name="Block tools"i]');
13
+ const button = blockToolbar.locator(`role=button[name="${label}"]`);
14
+ await button.click();
33
15
  }
34
- // Annotate the CommonJS export names for ESM import in node:
35
- 0 && (module.exports = {
36
- clickBlockToolbarButton
37
- });
38
- //# sourceMappingURL=click-block-toolbar-button.js.map
16
+ //# sourceMappingURL=click-block-toolbar-button.js.map
@@ -1,7 +1 @@
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
+ {"version":3,"file":"click-block-toolbar-button.js","sourceRoot":"","sources":["../../src/editor/click-block-toolbar-button.ts"],"names":[],"mappings":";;AAWA,0DASC;AAfD;;;;;GAKG;AACI,KAAK,UAAU,uBAAuB,CAAgB,KAAa;IACzE,MAAM,IAAI,CAAC,gBAAgB,EAAE,CAAC;IAE9B,MAAM,YAAY,GAAG,IAAI,CAAC,IAAI,CAAC,OAAO,CACrC,mCAAmC,CACnC,CAAC;IACF,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAE,qBAAsB,KAAM,IAAI,CAAE,CAAC;IAExE,MAAM,MAAM,CAAC,KAAK,EAAE,CAAC;AACtB,CAAC"}
@@ -0,0 +1,64 @@
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
@@ -0,0 +1,7 @@
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 this\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;AAqBA,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,64 +1,46 @@
1
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);
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getBlocks = getBlocks;
4
+ /**
5
+ * Returns the edited blocks.
6
+ *
7
+ * @param this
8
+ * @param options
9
+ * @param options.clientId Limit the results to be only under a partial tree of the specified clientId.
10
+ * @param options.full Whether to return the full block data or just the name and attributes.
11
+ *
12
+ * @return The blocks.
13
+ */
26
14
  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
- );
15
+ await this.page.waitForFunction(() => window?.wp?.blocks && window?.wp?.data);
16
+ return await this.page.evaluate(([_full, _clientId]) => {
17
+ // Serialize serializable attributes of blocks.
18
+ function serializeAttributes(attributes) {
19
+ return Object.fromEntries(Object.entries(attributes).map(([key, value]) => {
20
+ // Serialize RichTextData to string.
21
+ if (value instanceof window.wp.richText.RichTextData) {
22
+ return [key, value.toString()];
23
+ }
24
+ return [key, value];
25
+ }));
26
+ }
27
+ // Remove other unpredictable properties like clientId from blocks for testing purposes.
28
+ function recursivelyTransformBlocks(blocks) {
29
+ return blocks.map((block) => ({
30
+ name: block.name,
31
+ attributes: serializeAttributes(block.attributes),
32
+ innerBlocks: recursivelyTransformBlocks(block.innerBlocks),
33
+ }));
34
+ }
35
+ const blocks = window.wp.data
36
+ .select('core/block-editor')
37
+ .getBlocks(_clientId);
38
+ // The editor might still contain an unmodified empty block even when it's technically "empty".
39
+ if (blocks.length === 1 &&
40
+ window.wp.blocks.isUnmodifiedDefaultBlock(blocks[0])) {
41
+ return [];
42
+ }
43
+ return _full ? blocks : recursivelyTransformBlocks(blocks);
44
+ }, [full, clientId]);
59
45
  }
60
- // Annotate the CommonJS export names for ESM import in node:
61
- 0 && (module.exports = {
62
- getBlocks
63
- });
64
- //# sourceMappingURL=get-blocks.js.map
46
+ //# sourceMappingURL=get-blocks.js.map
@@ -1,7 +1 @@
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 this\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;AAqBA,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
+ {"version":3,"file":"get-blocks.js","sourceRoot":"","sources":["../../src/editor/get-blocks.ts"],"names":[],"mappings":";;AAqBA,8BAsDC;AAhED;;;;;;;;;GASG;AACI,KAAK,UAAU,SAAS,CAE9B,EAAE,QAAQ,EAAE,IAAI,GAAG,KAAK,KAA4C,EAAE;IAEtE,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAC9B,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,MAAM,IAAI,MAAM,EAAE,EAAE,EAAE,IAAI,CAC5C,CAAC;IAEF,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAC9B,CAAE,CAAE,KAAK,EAAE,SAAS,CAAE,EAAG,EAAE;QAC1B,+CAA+C;QAC/C,SAAS,mBAAmB,CAC3B,UAAqC;YAErC,OAAO,MAAM,CAAC,WAAW,CACxB,MAAM,CAAC,OAAO,CAAE,UAAU,CAAE,CAAC,GAAG,CAAE,CAAE,CAAE,GAAG,EAAE,KAAK,CAAE,EAAG,EAAE;gBACtD,oCAAoC;gBACpC,IACC,KAAK,YAAY,MAAM,CAAC,EAAE,CAAC,QAAQ,CAAC,YAAY,EAC/C,CAAC;oBACF,OAAO,CAAE,GAAG,EAAI,KAAiB,CAAC,QAAQ,EAAE,CAAE,CAAC;gBAChD,CAAC;gBACD,OAAO,CAAE,GAAG,EAAE,KAAK,CAAE,CAAC;YACvB,CAAC,CAAE,CACH,CAAC;QACH,CAAC;QAED,wFAAwF;QACxF,SAAS,0BAA0B,CAAE,MAAe;YACnD,OAAO,MAAM,CAAC,GAAG,CAAE,CAAE,KAAK,EAAG,EAAE,CAAC,CAAE;gBACjC,IAAI,EAAE,KAAK,CAAC,IAAI;gBAChB,UAAU,EAAE,mBAAmB,CAAE,KAAK,CAAC,UAAU,CAAE;gBACnD,WAAW,EAAE,0BAA0B,CACtC,KAAK,CAAC,WAAW,CACjB;aACD,CAAE,CAAE,CAAC;QACP,CAAC;QAED,MAAM,MAAM,GAAG,MAAM,CAAC,EAAE,CAAC,IAAI;aAC3B,MAAM,CAAE,mBAAmB,CAAE;aAC7B,SAAS,CAAE,SAAS,CAAa,CAAC;QAEpC,+FAA+F;QAC/F,IACC,MAAM,CAAC,MAAM,KAAK,CAAC;YACnB,MAAM,CAAC,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAE,MAAM,CAAE,CAAC,CAAE,CAAE,EACvD,CAAC;YACF,OAAO,EAAE,CAAC;QACX,CAAC;QAED,OAAO,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,0BAA0B,CAAE,MAAM,CAAE,CAAC;IAC9D,CAAC,EACD,CAAE,IAAI,EAAE,QAAQ,CAAE,CAClB,CAAC;AACH,CAAC"}
@@ -0,0 +1,36 @@
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
@@ -0,0 +1,7 @@
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
+ }
@@ -1,36 +1,15 @@
1
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);
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.getEditedPostContent = getEditedPostContent;
4
+ /**
5
+ * Returns a promise which resolves with the edited post content (HTML string).
6
+ *
7
+ * @param this
8
+ *
9
+ * @return Promise resolving with post content markup.
10
+ */
26
11
  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
- );
12
+ await this.page.waitForFunction(() => window?.wp?.data);
13
+ return await this.page.evaluate(() => window.wp.data.select('core/editor').getEditedPostContent());
31
14
  }
32
- // Annotate the CommonJS export names for ESM import in node:
33
- 0 && (module.exports = {
34
- getEditedPostContent
35
- });
36
- //# sourceMappingURL=get-edited-post-content.js.map
15
+ //# sourceMappingURL=get-edited-post-content.js.map
@@ -1,7 +1 @@
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
- }
1
+ {"version":3,"file":"get-edited-post-content.js","sourceRoot":"","sources":["../../src/editor/get-edited-post-content.ts"],"names":[],"mappings":";;AAYA,oDAMC;AAbD;;;;;;GAMG;AACI,KAAK,UAAU,oBAAoB;IACzC,MAAM,IAAI,CAAC,IAAI,CAAC,eAAe,CAAE,GAAG,EAAE,CAAC,MAAM,EAAE,EAAE,EAAE,IAAI,CAAE,CAAC;IAE1D,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAE,GAAG,EAAE,CACrC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,MAAM,CAAE,aAAa,CAAE,CAAC,oBAAoB,EAAE,CAC7D,CAAC;AACH,CAAC"}
@@ -0,0 +1,97 @@
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/index.ts
21
+ var editor_exports = {};
22
+ __export(editor_exports, {
23
+ Editor: () => Editor
24
+ });
25
+ module.exports = __toCommonJS(editor_exports);
26
+ var import_click_block_options_menu_item = require("./click-block-options-menu-item.cjs");
27
+ var import_click_block_toolbar_button = require("./click-block-toolbar-button.cjs");
28
+ var import_get_blocks = require("./get-blocks.cjs");
29
+ var import_get_edited_post_content = require("./get-edited-post-content.cjs");
30
+ var import_insert_block = require("./insert-block.cjs");
31
+ var import_open_document_settings_sidebar = require("./open-document-settings-sidebar.cjs");
32
+ var import_preview = require("./preview.cjs");
33
+ var import_publish_post = require("./publish-post.cjs");
34
+ var import_save_draft = require("./save-draft.cjs");
35
+ var import_select_blocks = require("./select-blocks.cjs");
36
+ var import_set_content = require("./set-content.cjs");
37
+ var import_set_preferences = require("./set-preferences.cjs");
38
+ var import_show_block_toolbar = require("./show-block-toolbar.cjs");
39
+ var import_site_editor = require("./site-editor.cjs");
40
+ var import_set_is_fixed_toolbar = require("./set-is-fixed-toolbar.cjs");
41
+ var import_switch_to_legacy_canvas = require("./switch-to-legacy-canvas.cjs");
42
+ var import_transform_block_to = require("./transform-block-to.cjs");
43
+ var import_switch_editor_tool = require("./switch-editor-tool.cjs");
44
+ var Editor = class {
45
+ browser;
46
+ page;
47
+ context;
48
+ constructor({ page }) {
49
+ this.page = page;
50
+ this.context = page.context();
51
+ this.browser = this.context.browser();
52
+ }
53
+ get canvas() {
54
+ return this.page.frameLocator('[name="editor-canvas"]');
55
+ }
56
+ /** @borrows clickBlockOptionsMenuItem as this.clickBlockOptionsMenuItem */
57
+ clickBlockOptionsMenuItem = import_click_block_options_menu_item.clickBlockOptionsMenuItem.bind(this);
58
+ /** @borrows clickBlockToolbarButton as this.clickBlockToolbarButton */
59
+ clickBlockToolbarButton = import_click_block_toolbar_button.clickBlockToolbarButton.bind(this);
60
+ /** @borrows getBlocks as this.getBlocks */
61
+ getBlocks = import_get_blocks.getBlocks.bind(this);
62
+ /** @borrows getEditedPostContent as this.getEditedPostContent */
63
+ getEditedPostContent = import_get_edited_post_content.getEditedPostContent.bind(this);
64
+ /** @borrows insertBlock as this.insertBlock */
65
+ insertBlock = import_insert_block.insertBlock.bind(this);
66
+ /** @borrows openDocumentSettingsSidebar as this.openDocumentSettingsSidebar */
67
+ openDocumentSettingsSidebar = import_open_document_settings_sidebar.openDocumentSettingsSidebar.bind(this);
68
+ /** @borrows openPreviewPage as this.openPreviewPage */
69
+ openPreviewPage = import_preview.openPreviewPage.bind(this);
70
+ /** @borrows publishPost as this.publishPost */
71
+ publishPost = import_publish_post.publishPost.bind(this);
72
+ /** @borrows saveDraft as this.saveDraft */
73
+ saveDraft = import_save_draft.saveDraft.bind(this);
74
+ /** @borrows saveSiteEditorEntities as this.saveSiteEditorEntities */
75
+ saveSiteEditorEntities = import_site_editor.saveSiteEditorEntities.bind(this);
76
+ /** @borrows selectBlocks as this.selectBlocks */
77
+ selectBlocks = import_select_blocks.selectBlocks.bind(this);
78
+ /** @borrows setContent as this.setContent */
79
+ setContent = import_set_content.setContent.bind(this);
80
+ /** @borrows setPreferences as this.setPreferences */
81
+ setPreferences = import_set_preferences.setPreferences.bind(this);
82
+ /** @borrows showBlockToolbar as this.showBlockToolbar */
83
+ showBlockToolbar = import_show_block_toolbar.showBlockToolbar.bind(this);
84
+ /** @borrows setIsFixedToolbar as this.setIsFixedToolbar */
85
+ setIsFixedToolbar = import_set_is_fixed_toolbar.setIsFixedToolbar.bind(this);
86
+ /** @borrows switchEditorTool as this.switchEditorTool */
87
+ switchEditorTool = import_switch_editor_tool.switchEditorTool.bind(this);
88
+ /** @borrows switchToLegacyCanvas as this.switchToLegacyCanvas */
89
+ switchToLegacyCanvas = import_switch_to_legacy_canvas.switchToLegacyCanvas.bind(this);
90
+ /** @borrows transformBlockTo as this.transformBlockTo */
91
+ transformBlockTo = import_transform_block_to.transformBlockTo.bind(this);
92
+ };
93
+ // Annotate the CommonJS export names for ESM import in node:
94
+ 0 && (module.exports = {
95
+ Editor
96
+ });
97
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../src/editor/index.ts"],
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport type {\n\tBrowser,\n\tPage,\n\tBrowserContext,\n\tFrameLocator,\n} from '@playwright/test';\n\n/**\n * Internal dependencies\n */\nimport { clickBlockOptionsMenuItem } from './click-block-options-menu-item';\nimport { clickBlockToolbarButton } from './click-block-toolbar-button';\nimport { getBlocks } from './get-blocks';\nimport { getEditedPostContent } from './get-edited-post-content';\nimport { insertBlock } from './insert-block';\nimport { openDocumentSettingsSidebar } from './open-document-settings-sidebar';\nimport { openPreviewPage } from './preview';\nimport { publishPost } from './publish-post';\nimport { saveDraft } from './save-draft';\nimport { selectBlocks } from './select-blocks';\nimport { setContent } from './set-content';\nimport { setPreferences } from './set-preferences';\nimport { showBlockToolbar } from './show-block-toolbar';\nimport { saveSiteEditorEntities } from './site-editor';\nimport { setIsFixedToolbar } from './set-is-fixed-toolbar';\nimport { switchToLegacyCanvas } from './switch-to-legacy-canvas';\nimport { transformBlockTo } from './transform-block-to';\nimport { switchEditorTool } from './switch-editor-tool';\n\ntype EditorConstructorProps = {\n\tpage: Page;\n};\n\nexport class Editor {\n\tbrowser: Browser;\n\tpage: Page;\n\tcontext: BrowserContext;\n\n\tconstructor( { page }: EditorConstructorProps ) {\n\t\tthis.page = page;\n\t\tthis.context = page.context();\n\t\tthis.browser = this.context.browser()!;\n\t}\n\n\tget canvas(): FrameLocator {\n\t\treturn this.page.frameLocator( '[name=\"editor-canvas\"]' );\n\t}\n\n\t/** @borrows clickBlockOptionsMenuItem as this.clickBlockOptionsMenuItem */\n\tclickBlockOptionsMenuItem: typeof clickBlockOptionsMenuItem =\n\t\tclickBlockOptionsMenuItem.bind( this );\n\t/** @borrows clickBlockToolbarButton as this.clickBlockToolbarButton */\n\tclickBlockToolbarButton: typeof clickBlockToolbarButton =\n\t\tclickBlockToolbarButton.bind( this );\n\t/** @borrows getBlocks as this.getBlocks */\n\tgetBlocks: typeof getBlocks = getBlocks.bind( this );\n\t/** @borrows getEditedPostContent as this.getEditedPostContent */\n\tgetEditedPostContent: typeof getEditedPostContent =\n\t\tgetEditedPostContent.bind( this );\n\t/** @borrows insertBlock as this.insertBlock */\n\tinsertBlock: typeof insertBlock = insertBlock.bind( this );\n\t/** @borrows openDocumentSettingsSidebar as this.openDocumentSettingsSidebar */\n\topenDocumentSettingsSidebar: typeof openDocumentSettingsSidebar =\n\t\topenDocumentSettingsSidebar.bind( this );\n\t/** @borrows openPreviewPage as this.openPreviewPage */\n\topenPreviewPage: typeof openPreviewPage = openPreviewPage.bind( this );\n\t/** @borrows publishPost as this.publishPost */\n\tpublishPost: typeof publishPost = publishPost.bind( this );\n\t/** @borrows saveDraft as this.saveDraft */\n\tsaveDraft: typeof saveDraft = saveDraft.bind( this );\n\t/** @borrows saveSiteEditorEntities as this.saveSiteEditorEntities */\n\tsaveSiteEditorEntities: typeof saveSiteEditorEntities =\n\t\tsaveSiteEditorEntities.bind( this );\n\t/** @borrows selectBlocks as this.selectBlocks */\n\tselectBlocks: typeof selectBlocks = selectBlocks.bind( this );\n\t/** @borrows setContent as this.setContent */\n\tsetContent: typeof setContent = setContent.bind( this );\n\t/** @borrows setPreferences as this.setPreferences */\n\tsetPreferences: typeof setPreferences = setPreferences.bind( this );\n\t/** @borrows showBlockToolbar as this.showBlockToolbar */\n\tshowBlockToolbar: typeof showBlockToolbar = showBlockToolbar.bind( this );\n\t/** @borrows setIsFixedToolbar as this.setIsFixedToolbar */\n\tsetIsFixedToolbar: typeof setIsFixedToolbar =\n\t\tsetIsFixedToolbar.bind( this );\n\t/** @borrows switchEditorTool as this.switchEditorTool */\n\tswitchEditorTool: typeof switchEditorTool = switchEditorTool.bind( this );\n\t/** @borrows switchToLegacyCanvas as this.switchToLegacyCanvas */\n\tswitchToLegacyCanvas: typeof switchToLegacyCanvas =\n\t\tswitchToLegacyCanvas.bind( this );\n\t/** @borrows transformBlockTo as this.transformBlockTo */\n\ttransformBlockTo: typeof transformBlockTo = transformBlockTo.bind( this );\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAaA,2CAA0C;AAC1C,wCAAwC;AACxC,wBAA0B;AAC1B,qCAAqC;AACrC,0BAA4B;AAC5B,4CAA4C;AAC5C,qBAAgC;AAChC,0BAA4B;AAC5B,wBAA0B;AAC1B,2BAA6B;AAC7B,yBAA2B;AAC3B,6BAA+B;AAC/B,gCAAiC;AACjC,yBAAuC;AACvC,kCAAkC;AAClC,qCAAqC;AACrC,gCAAiC;AACjC,gCAAiC;AAM1B,IAAM,SAAN,MAAa;AAAA,EACnB;AAAA,EACA;AAAA,EACA;AAAA,EAEA,YAAa,EAAE,KAAK,GAA4B;AAC/C,SAAK,OAAO;AACZ,SAAK,UAAU,KAAK,QAAQ;AAC5B,SAAK,UAAU,KAAK,QAAQ,QAAQ;AAAA,EACrC;AAAA,EAEA,IAAI,SAAuB;AAC1B,WAAO,KAAK,KAAK,aAAc,wBAAyB;AAAA,EACzD;AAAA;AAAA,EAGA,4BACC,+DAA0B,KAAM,IAAK;AAAA;AAAA,EAEtC,0BACC,0DAAwB,KAAM,IAAK;AAAA;AAAA,EAEpC,YAA8B,4BAAU,KAAM,IAAK;AAAA;AAAA,EAEnD,uBACC,oDAAqB,KAAM,IAAK;AAAA;AAAA,EAEjC,cAAkC,gCAAY,KAAM,IAAK;AAAA;AAAA,EAEzD,8BACC,kEAA4B,KAAM,IAAK;AAAA;AAAA,EAExC,kBAA0C,+BAAgB,KAAM,IAAK;AAAA;AAAA,EAErE,cAAkC,gCAAY,KAAM,IAAK;AAAA;AAAA,EAEzD,YAA8B,4BAAU,KAAM,IAAK;AAAA;AAAA,EAEnD,yBACC,0CAAuB,KAAM,IAAK;AAAA;AAAA,EAEnC,eAAoC,kCAAa,KAAM,IAAK;AAAA;AAAA,EAE5D,aAAgC,8BAAW,KAAM,IAAK;AAAA;AAAA,EAEtD,iBAAwC,sCAAe,KAAM,IAAK;AAAA;AAAA,EAElE,mBAA4C,2CAAiB,KAAM,IAAK;AAAA;AAAA,EAExE,oBACC,8CAAkB,KAAM,IAAK;AAAA;AAAA,EAE9B,mBAA4C,2CAAiB,KAAM,IAAK;AAAA;AAAA,EAExE,uBACC,oDAAqB,KAAM,IAAK;AAAA;AAAA,EAEjC,mBAA4C,2CAAiB,KAAM,IAAK;AACzE;",
6
+ "names": []
7
+ }