@wordpress/edit-post 7.32.0 → 7.33.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 (261) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +4 -196
  3. package/build/components/browser-url/index.js.map +1 -1
  4. package/build/components/editor-initialization/index.js +0 -1
  5. package/build/components/editor-initialization/index.js.map +1 -1
  6. package/build/components/editor-initialization/listener-hooks.js +1 -38
  7. package/build/components/editor-initialization/listener-hooks.js.map +1 -1
  8. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  9. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  10. package/build/components/header/index.js +4 -4
  11. package/build/components/header/index.js.map +1 -1
  12. package/build/components/header/index.native.js +1 -1
  13. package/build/components/header/index.native.js.map +1 -1
  14. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  15. package/build/components/header/more-menu/index.js +7 -6
  16. package/build/components/header/more-menu/index.js.map +1 -1
  17. package/build/components/header/post-publish-button-or-toggle.js +9 -6
  18. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  19. package/build/components/header/preferences-menu-item/index.js +12 -4
  20. package/build/components/header/preferences-menu-item/index.js.map +1 -1
  21. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  22. package/build/components/header/writing-menu/index.js.map +1 -1
  23. package/build/components/init-pattern-modal/index.js.map +1 -1
  24. package/build/components/keyboard-shortcuts/index.js +1 -36
  25. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  26. package/build/components/layout/actions-panel.js.map +1 -1
  27. package/build/components/layout/index.js +12 -20
  28. package/build/components/layout/index.js.map +1 -1
  29. package/build/components/layout/index.native.js.map +1 -1
  30. package/build/components/meta-boxes/index.js.map +1 -1
  31. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  32. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  33. package/build/components/preferences-modal/enable-custom-fields.js.map +1 -1
  34. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  35. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  36. package/build/components/preferences-modal/index.js +1 -21
  37. package/build/components/preferences-modal/index.js.map +1 -1
  38. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  39. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  40. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  41. package/build/components/sidebar/post-format/index.js.map +1 -1
  42. package/build/components/sidebar/post-pending-status/index.js.map +1 -1
  43. package/build/components/sidebar/post-slug/index.js.map +1 -1
  44. package/build/components/sidebar/post-status/index.js +9 -9
  45. package/build/components/sidebar/post-status/index.js.map +1 -1
  46. package/build/components/sidebar/post-sticky/index.js.map +1 -1
  47. package/build/components/sidebar/post-trash/index.js.map +1 -1
  48. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  49. package/build/components/sidebar/settings-header/index.js.map +1 -1
  50. package/build/components/sidebar/settings-sidebar/index.js +37 -40
  51. package/build/components/sidebar/settings-sidebar/index.js.map +1 -1
  52. package/build/components/text-editor/index.js.map +1 -1
  53. package/build/components/visual-editor/block-inspector-button.js +1 -1
  54. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  55. package/build/components/visual-editor/header.native.js.map +1 -1
  56. package/build/components/visual-editor/index.js +4 -1
  57. package/build/components/visual-editor/index.js.map +1 -1
  58. package/build/components/visual-editor/index.native.js.map +1 -1
  59. package/build/components/visual-editor/use-padding-appender.js +62 -0
  60. package/build/components/visual-editor/use-padding-appender.js.map +1 -0
  61. package/build/components/welcome-guide/default.js.map +1 -1
  62. package/build/components/welcome-guide/image.js.map +1 -1
  63. package/build/components/welcome-guide/index.js.map +1 -1
  64. package/build/components/welcome-guide/template.js.map +1 -1
  65. package/build/editor.js +2 -2
  66. package/build/editor.js.map +1 -1
  67. package/build/editor.native.js.map +1 -1
  68. package/build/hooks/commands/use-common-commands.js +5 -22
  69. package/build/hooks/commands/use-common-commands.js.map +1 -1
  70. package/build/hooks/components/index.js.map +1 -1
  71. package/build/hooks/index.js.map +1 -1
  72. package/build/hooks/use-navigate-to-entity-record.js.map +1 -1
  73. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  74. package/build/index.js +4 -8
  75. package/build/index.js.map +1 -1
  76. package/build/index.native.js.map +1 -1
  77. package/build/lock-unlock.js.map +1 -1
  78. package/build/plugins/copy-content-menu-item/index.js.map +1 -1
  79. package/build/plugins/index.js.map +1 -1
  80. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +7 -4
  81. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  82. package/build/plugins/welcome-guide-menu-item/index.js.map +1 -1
  83. package/build/store/actions.js +10 -8
  84. package/build/store/actions.js.map +1 -1
  85. package/build/store/constants.js.map +1 -1
  86. package/build/store/index.js +1 -1
  87. package/build/store/index.js.map +1 -1
  88. package/build/store/reducer.js.map +1 -1
  89. package/build/store/selectors.js +34 -19
  90. package/build/store/selectors.js.map +1 -1
  91. package/build/utils/meta-boxes.js.map +1 -1
  92. package/build-module/components/browser-url/index.js.map +1 -1
  93. package/build-module/components/editor-initialization/index.js +1 -2
  94. package/build-module/components/editor-initialization/index.js.map +1 -1
  95. package/build-module/components/editor-initialization/listener-hooks.js +2 -38
  96. package/build-module/components/editor-initialization/listener-hooks.js.map +1 -1
  97. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  98. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  99. package/build-module/components/header/index.js +3 -3
  100. package/build-module/components/header/index.js.map +1 -1
  101. package/build-module/components/header/index.native.js +1 -1
  102. package/build-module/components/header/index.native.js.map +1 -1
  103. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  104. package/build-module/components/header/more-menu/index.js +5 -4
  105. package/build-module/components/header/more-menu/index.js.map +1 -1
  106. package/build-module/components/header/post-publish-button-or-toggle.js +9 -6
  107. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  108. package/build-module/components/header/preferences-menu-item/index.js +11 -3
  109. package/build-module/components/header/preferences-menu-item/index.js.map +1 -1
  110. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  111. package/build-module/components/header/writing-menu/index.js.map +1 -1
  112. package/build-module/components/init-pattern-modal/index.js.map +1 -1
  113. package/build-module/components/keyboard-shortcuts/index.js +1 -36
  114. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  115. package/build-module/components/layout/actions-panel.js.map +1 -1
  116. package/build-module/components/layout/index.js +11 -19
  117. package/build-module/components/layout/index.js.map +1 -1
  118. package/build-module/components/layout/index.native.js.map +1 -1
  119. package/build-module/components/meta-boxes/index.js.map +1 -1
  120. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  121. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  122. package/build-module/components/preferences-modal/enable-custom-fields.js.map +1 -1
  123. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  124. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  125. package/build-module/components/preferences-modal/index.js +1 -20
  126. package/build-module/components/preferences-modal/index.js.map +1 -1
  127. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  128. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  129. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  130. package/build-module/components/sidebar/post-format/index.js.map +1 -1
  131. package/build-module/components/sidebar/post-pending-status/index.js.map +1 -1
  132. package/build-module/components/sidebar/post-slug/index.js.map +1 -1
  133. package/build-module/components/sidebar/post-status/index.js +9 -10
  134. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  135. package/build-module/components/sidebar/post-sticky/index.js.map +1 -1
  136. package/build-module/components/sidebar/post-trash/index.js.map +1 -1
  137. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  138. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  139. package/build-module/components/sidebar/settings-sidebar/index.js +38 -41
  140. package/build-module/components/sidebar/settings-sidebar/index.js.map +1 -1
  141. package/build-module/components/text-editor/index.js.map +1 -1
  142. package/build-module/components/visual-editor/block-inspector-button.js +1 -1
  143. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  144. package/build-module/components/visual-editor/header.native.js.map +1 -1
  145. package/build-module/components/visual-editor/index.js +4 -1
  146. package/build-module/components/visual-editor/index.js.map +1 -1
  147. package/build-module/components/visual-editor/index.native.js.map +1 -1
  148. package/build-module/components/visual-editor/use-padding-appender.js +55 -0
  149. package/build-module/components/visual-editor/use-padding-appender.js.map +1 -0
  150. package/build-module/components/welcome-guide/default.js.map +1 -1
  151. package/build-module/components/welcome-guide/image.js.map +1 -1
  152. package/build-module/components/welcome-guide/index.js.map +1 -1
  153. package/build-module/components/welcome-guide/template.js.map +1 -1
  154. package/build-module/editor.js +2 -2
  155. package/build-module/editor.js.map +1 -1
  156. package/build-module/editor.native.js.map +1 -1
  157. package/build-module/hooks/commands/use-common-commands.js +7 -24
  158. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  159. package/build-module/hooks/components/index.js.map +1 -1
  160. package/build-module/hooks/index.js.map +1 -1
  161. package/build-module/hooks/use-navigate-to-entity-record.js.map +1 -1
  162. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  163. package/build-module/index.js +5 -5
  164. package/build-module/index.js.map +1 -1
  165. package/build-module/index.native.js.map +1 -1
  166. package/build-module/lock-unlock.js.map +1 -1
  167. package/build-module/plugins/copy-content-menu-item/index.js.map +1 -1
  168. package/build-module/plugins/index.js.map +1 -1
  169. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +6 -3
  170. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  171. package/build-module/plugins/welcome-guide-menu-item/index.js.map +1 -1
  172. package/build-module/store/actions.js +8 -7
  173. package/build-module/store/actions.js.map +1 -1
  174. package/build-module/store/constants.js.map +1 -1
  175. package/build-module/store/index.js.map +1 -1
  176. package/build-module/store/reducer.js.map +1 -1
  177. package/build-module/store/selectors.js +33 -18
  178. package/build-module/store/selectors.js.map +1 -1
  179. package/build-module/utils/meta-boxes.js.map +1 -1
  180. package/build-style/classic-rtl.css +2 -2
  181. package/build-style/classic.css +2 -2
  182. package/build-style/style-rtl.css +12 -448
  183. package/build-style/style.css +12 -448
  184. package/package.json +32 -34
  185. package/src/classic.scss +1 -1
  186. package/src/components/editor-initialization/index.js +1 -5
  187. package/src/components/editor-initialization/listener-hooks.js +1 -40
  188. package/src/components/editor-initialization/test/listener-hooks.js +1 -96
  189. package/src/components/header/index.js +2 -3
  190. package/src/components/header/index.native.js +1 -1
  191. package/src/components/header/more-menu/index.js +3 -4
  192. package/src/components/header/post-publish-button-or-toggle.js +8 -3
  193. package/src/components/header/preferences-menu-item/index.js +9 -3
  194. package/src/components/header/style.scss +5 -3
  195. package/src/components/header/test/index.js +13 -1
  196. package/src/components/keyboard-shortcuts/index.js +3 -44
  197. package/src/components/layout/index.js +14 -41
  198. package/src/components/preferences-modal/index.js +1 -24
  199. package/src/components/sidebar/post-status/index.js +6 -9
  200. package/src/components/sidebar/settings-sidebar/index.js +62 -58
  201. package/src/components/visual-editor/block-inspector-button.js +1 -1
  202. package/src/components/visual-editor/index.js +4 -0
  203. package/src/components/visual-editor/use-padding-appender.js +66 -0
  204. package/src/editor.js +2 -2
  205. package/src/hooks/commands/use-common-commands.js +11 -26
  206. package/src/index.js +8 -4
  207. package/src/plugins/keyboard-shortcuts-help-menu-item/index.js +5 -3
  208. package/src/store/actions.js +10 -12
  209. package/src/store/selectors.js +41 -33
  210. package/src/store/test/actions.js +11 -10
  211. package/src/style.scss +1 -19
  212. package/build/components/header/plugin-more-menu-item/index.js +0 -78
  213. package/build/components/header/plugin-more-menu-item/index.js.map +0 -1
  214. package/build/components/header/plugin-sidebar-more-menu-item/index.js +0 -71
  215. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  216. package/build/components/keyboard-shortcut-help-modal/config.js +0 -78
  217. package/build/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  218. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -49
  219. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  220. package/build/components/keyboard-shortcut-help-modal/index.js +0 -132
  221. package/build/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  222. package/build/components/keyboard-shortcut-help-modal/shortcut.js +0 -55
  223. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  224. package/build/components/sidebar/plugin-post-status-info/index.js +0 -73
  225. package/build/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  226. package/build/components/sidebar/plugin-sidebar/index.js +0 -104
  227. package/build/components/sidebar/plugin-sidebar/index.js.map +0 -1
  228. package/build/components/start-page-options/index.js +0 -107
  229. package/build/components/start-page-options/index.js.map +0 -1
  230. package/build-module/components/header/plugin-more-menu-item/index.js +0 -73
  231. package/build-module/components/header/plugin-more-menu-item/index.js.map +0 -1
  232. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +0 -65
  233. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +0 -1
  234. package/build-module/components/keyboard-shortcut-help-modal/config.js +0 -71
  235. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +0 -1
  236. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -41
  237. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +0 -1
  238. package/build-module/components/keyboard-shortcut-help-modal/index.js +0 -122
  239. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +0 -1
  240. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +0 -48
  241. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +0 -1
  242. package/build-module/components/sidebar/plugin-post-status-info/index.js +0 -66
  243. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +0 -1
  244. package/build-module/components/sidebar/plugin-sidebar/index.js +0 -98
  245. package/build-module/components/sidebar/plugin-sidebar/index.js.map +0 -1
  246. package/build-module/components/start-page-options/index.js +0 -100
  247. package/build-module/components/start-page-options/index.js.map +0 -1
  248. package/src/components/header/plugin-more-menu-item/index.js +0 -73
  249. package/src/components/header/plugin-sidebar-more-menu-item/index.js +0 -64
  250. package/src/components/keyboard-shortcut-help-modal/config.js +0 -53
  251. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +0 -43
  252. package/src/components/keyboard-shortcut-help-modal/index.js +0 -163
  253. package/src/components/keyboard-shortcut-help-modal/shortcut.js +0 -67
  254. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -61
  255. package/src/components/keyboard-shortcut-help-modal/test/index.js +0 -36
  256. package/src/components/sidebar/plugin-post-status-info/index.js +0 -63
  257. package/src/components/sidebar/plugin-post-status-info/test/__snapshots__/index.js.snap +0 -11
  258. package/src/components/sidebar/plugin-post-status-info/test/index.js +0 -29
  259. package/src/components/sidebar/plugin-sidebar/index.js +0 -94
  260. package/src/components/start-page-options/index.js +0 -108
  261. package/src/components/start-page-options/style.scss +0 -26
@@ -1 +1 @@
1
- {"version":3,"names":["_editor","require","PostTrash","_react","createElement","PostTrashCheck"],"sources":["@wordpress/edit-post/src/components/sidebar/post-trash/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';\n\nexport default function PostTrash() {\n\treturn (\n\t\t<PostTrashCheck>\n\t\t\t<PostTrashLink />\n\t\t</PostTrashCheck>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,SAASA,CAAA,EAAG;EACnC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,OAAA,CAAAK,cAAc,QACd,IAAAF,MAAA,CAAAC,aAAA,EAACJ,OAAA,CAAAE,SAAa,MAAE,CACD,CAAC;AAEnB"}
1
+ {"version":3,"names":["_editor","require","PostTrash","_react","createElement","PostTrashCheck"],"sources":["@wordpress/edit-post/src/components/sidebar/post-trash/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { PostTrash as PostTrashLink, PostTrashCheck } from '@wordpress/editor';\n\nexport default function PostTrash() {\n\treturn (\n\t\t<PostTrashCheck>\n\t\t\t<PostTrashLink />\n\t\t</PostTrashCheck>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGe,SAASC,SAASA,CAAA,EAAG;EACnC,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACJ,OAAA,CAAAK,cAAc,QACd,IAAAF,MAAA,CAAAC,aAAA,EAACJ,OAAA,CAAAE,SAAa,MAAE,CACD,CAAC;AAEnB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_editor","_element","_lockUnlock","PostPanelRow","unlock","editorPrivateApis","PostVisibility","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","_react","createElement","PostVisibilityCheck","render","canEdit","label","__","ref","PostVisibilityLabel","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostVisibilityToggle","onClick","renderContent","onClose","usePostVisibilityLabel","Button","__next40pxDefaultSize","className","variant","sprintf","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport {\n\tPostVisibility as PostVisibilityForm,\n\tPostVisibilityLabel,\n\tPostVisibilityCheck,\n\tusePostVisibilityLabel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostVisibility() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostVisibilityCheck\n\t\t\trender={ ( { canEdit } ) => (\n\t\t\t\t<PostPanelRow\n\t\t\t\t\tlabel={ __( 'Visibility' ) }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t>\n\t\t\t\t\t{ ! canEdit && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canEdit && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tcontentClassName=\"edit-post-post-visibility__dialog\"\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityToggle\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityForm onClose={ onClose } />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PostPanelRow>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction PostVisibilityToggle( { isOpen, onClick } ) {\n\tconst label = usePostVisibilityLabel();\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"edit-post-post-visibility__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post visibility.\n\t\t\taria-label={ sprintf( __( 'Select visibility: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default PostVisibility;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,MAAM;EAAEK;AAAa,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE7C,SAASC,cAAcA,CAAA,EAAG;EAChC;EACA;EACA,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAC5D;EACA,MAAMC,YAAY,GAAG,IAAAC,gBAAO,EAC3B,OAAQ;IACP;IACA;IACAC,MAAM,EAAEL,aAAa;IACrBM,SAAS,EAAE;EACZ,CAAC,CAAE,EACH,CAAEN,aAAa,CAChB,CAAC;EAED,OACC,IAAAO,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAgB,mBAAmB;IACnBC,MAAM,EAAGA,CAAE;MAAEC;IAAQ,CAAC,KACrB,IAAAJ,MAAA,CAAAC,aAAA,EAACZ,YAAY;MACZgB,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa,CAAG;MAC5BC,GAAG,EAAGb;IAAkB,GAEtB,CAAEU,OAAO,IACV,IAAAJ,MAAA,CAAAC,aAAA,gBACC,IAAAD,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAsB,mBAAmB,MAAE,CACjB,CACN,EACCJ,OAAO,IACR,IAAAJ,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAwB,QAAQ;MACRC,gBAAgB,EAAC,mCAAmC;MACpDd,YAAY,EAAGA,YAAc;MAC7Be,YAAY;MACZC,YAAY,EAAGA,CAAE;QAAEC,MAAM;QAAEC;MAAS,CAAC,KACpC,IAAAd,MAAA,CAAAC,aAAA,EAACc,oBAAoB;QACpBF,MAAM,EAAGA,MAAQ;QACjBG,OAAO,EAAGF;MAAU,CACpB,CACC;MACHG,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,KAC5B,IAAAlB,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAM,cAAkB;QAAC0B,OAAO,EAAGA;MAAS,CAAE;IACvC,CACH,CAEW;EACZ,CACH,CAAC;AAEJ;AAEA,SAASH,oBAAoBA,CAAE;EAAEF,MAAM;EAAEG;AAAQ,CAAC,EAAG;EACpD,MAAMX,KAAK,GAAG,IAAAc,8BAAsB,EAAC,CAAC;EACtC,OACC,IAAAnB,MAAA,CAAAC,aAAA,EAAChB,WAAA,CAAAmC,MAAM;IACNC,qBAAqB;IACrBC,SAAS,EAAC,mCAAmC;IAC7CC,OAAO,EAAC,UAAU;IAClB,iBAAgBV;IAChB;IAAA;IACA,cAAa,IAAAW,aAAO,EAAE,IAAAlB,QAAE,EAAE,uBAAwB,CAAC,EAAED,KAAM,CAAG;IAC9DW,OAAO,EAAGA;EAAS,GAEjBX,KACK,CAAC;AAEX;AAAC,IAAAoB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnC,cAAc"}
1
+ {"version":3,"names":["_i18n","require","_components","_editor","_element","_lockUnlock","PostPanelRow","unlock","editorPrivateApis","PostVisibility","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","_react","createElement","PostVisibilityCheck","render","canEdit","label","__","ref","PostVisibilityLabel","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","PostVisibilityToggle","onClick","renderContent","onClose","usePostVisibilityLabel","Button","__next40pxDefaultSize","className","variant","sprintf","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport {\n\tPostVisibility as PostVisibilityForm,\n\tPostVisibilityLabel,\n\tPostVisibilityCheck,\n\tusePostVisibilityLabel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostPanelRow } = unlock( editorPrivateApis );\n\nexport function PostVisibility() {\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'bottom-end',\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostVisibilityCheck\n\t\t\trender={ ( { canEdit } ) => (\n\t\t\t\t<PostPanelRow\n\t\t\t\t\tlabel={ __( 'Visibility' ) }\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t>\n\t\t\t\t\t{ ! canEdit && (\n\t\t\t\t\t\t<span>\n\t\t\t\t\t\t\t<PostVisibilityLabel />\n\t\t\t\t\t\t</span>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canEdit && (\n\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\tcontentClassName=\"edit-post-post-visibility__dialog\"\n\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\tfocusOnMount\n\t\t\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityToggle\n\t\t\t\t\t\t\t\t\tisOpen={ isOpen }\n\t\t\t\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t\t\t<PostVisibilityForm onClose={ onClose } />\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PostPanelRow>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nfunction PostVisibilityToggle( { isOpen, onClick } ) {\n\tconst label = usePostVisibilityLabel();\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\tclassName=\"edit-post-post-visibility__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post visibility.\n\t\t\taria-label={ sprintf( __( 'Select visibility: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n\nexport default PostVisibility;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AAOA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,WAAA,GAAAJ,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,MAAM;EAAEK;AAAa,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAE7C,SAASC,cAAcA,CAAA,EAAG;EAChC;EACA;EACA,MAAM,CAAEC,aAAa,EAAEC,gBAAgB,CAAE,GAAG,IAAAC,iBAAQ,EAAE,IAAK,CAAC;EAC5D;EACA,MAAMC,YAAY,GAAG,IAAAC,gBAAO,EAC3B,OAAQ;IACP;IACA;IACAC,MAAM,EAAEL,aAAa;IACrBM,SAAS,EAAE;EACZ,CAAC,CAAE,EACH,CAAEN,aAAa,CAChB,CAAC;EAED,OACC,IAAAO,MAAA,CAAAC,aAAA,EAACf,OAAA,CAAAgB,m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IAAAoB,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcnC,cAAc","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_components","require","_i18n","_data","_element","_editor","_lockUnlock","_settingsSidebar","Tabs","unlock","componentsPrivateApis","SettingsHeader","_","ref","documentLabel","useSelect","select","getPostTypeLabel","editorStore","_x","_react","createElement","TabList","Tab","tabId","sidebars","document","block","__","_default","exports","default","forwardRef"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport { sidebars } from '../settings-sidebar';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SettingsHeader = ( _, ref ) => {\n\tconst { documentLabel } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList ref={ ref }>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.document }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.document }\n\t\t\t>\n\t\t\t\t{ documentLabel }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.block }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.block }\n\t\t\t>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t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mBAAU,EAAErB,cAAe,CAAC"}
1
+ {"version":3,"names":["_components","require","_i18n","_data","_element","_editor","_lockUnlock","_settingsSidebar","Tabs","unlock","componentsPrivateApis","SettingsHeader","_","ref","documentLabel","useSelect","select","getPostTypeLabel","editorStore","_x","_react","createElement","TabList","Tab","tabId","sidebars","document","block","__","_default","exports","default","forwardRef"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { __, _x } from '@wordpress/i18n';\nimport { useSelect } from '@wordpress/data';\nimport { forwardRef } from '@wordpress/element';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../../lock-unlock';\nimport { sidebars } from '../settings-sidebar';\n\nconst { Tabs } = unlock( componentsPrivateApis );\n\nconst SettingsHeader = ( _, ref ) => {\n\tconst { documentLabel } = useSelect( ( select ) => {\n\t\tconst { getPostTypeLabel } = select( editorStore );\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: getPostTypeLabel() || _x( 'Document', 'noun' ),\n\t\t};\n\t}, [] );\n\n\treturn (\n\t\t<Tabs.TabList ref={ ref }>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.document }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.document }\n\t\t\t>\n\t\t\t\t{ documentLabel }\n\t\t\t</Tabs.Tab>\n\t\t\t<Tabs.Tab\n\t\t\t\ttabId={ sidebars.block }\n\t\t\t\t// Used for focus management in the SettingsSidebar component.\n\t\t\t\tdata-tab-id={ sidebars.block }\n\t\t\t>\n\t\t\t\t{ /* translators: Text label for the Block Settings Sidebar tab. */ }\n\t\t\t\t{ __( 'Block' ) }\n\t\t\t</Tabs.Tab>\n\t\t</Tabs.TabList>\n\t);\n};\n\nexport default forwardRef( SettingsHeader );\n"],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12 @@ var _data = require("@wordpress/data");
11
11
  var _element = require("@wordpress/element");
12
12
  var _i18n = require("@wordpress/i18n");
13
13
  var _icons = require("@wordpress/icons");
14
- var _interface = require("@wordpress/interface");
15
14
  var _keyboardShortcuts = require("@wordpress/keyboard-shortcuts");
16
15
  var _editor = require("@wordpress/editor");
16
+ var _url = require("@wordpress/url");
17
17
  var _settingsHeader = _interopRequireDefault(require("../settings-header"));
18
18
  var _postStatus = _interopRequireDefault(require("../post-status"));
19
19
  var _metaBoxes = _interopRequireDefault(require("../../meta-boxes"));
20
- var _pluginSidebar = _interopRequireDefault(require("../plugin-sidebar"));
21
20
  var _store = require("../../../store");
22
21
  var _components = require("@wordpress/components");
23
22
  var _lockUnlock = require("../../../lock-unlock");
@@ -30,13 +29,16 @@ var _lockUnlock = require("../../../lock-unlock");
30
29
  */
31
30
 
32
31
  const {
33
- PostCardPanel
32
+ PostCardPanel,
33
+ PostActions,
34
+ interfaceStore
34
35
  } = (0, _lockUnlock.unlock)(_editor.privateApis);
35
36
  const {
36
37
  Tabs
37
38
  } = (0, _lockUnlock.unlock)(_components.privateApis);
38
39
  const {
39
- PatternOverridesPanel
40
+ PatternOverridesPanel,
41
+ useAutoSwitchEditorSidebars
40
42
  } = (0, _lockUnlock.unlock)(_editor.privateApis);
41
43
  const SIDEBAR_ACTIVE_BY_DEFAULT = _element.Platform.select({
42
44
  web: true,
@@ -46,13 +48,21 @@ const sidebars = exports.sidebars = {
46
48
  document: 'edit-post/document',
47
49
  block: 'edit-post/block'
48
50
  };
51
+ function onActionPerformed(actionId, items) {
52
+ if (actionId === 'move-to-trash') {
53
+ const postType = items[0].type;
54
+ document.location.href = (0, _url.addQueryArgs)('edit.php', {
55
+ post_type: postType
56
+ });
57
+ }
58
+ }
49
59
  const SidebarContent = ({
50
- sidebarName,
60
+ tabName,
51
61
  keyboardShortcut,
52
62
  isEditingTemplate
53
63
  }) => {
54
64
  const tabListRef = (0, _element.useRef)(null);
55
- // Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we
65
+ // Because `PluginSidebar` renders a `ComplementaryArea`, we
56
66
  // need to forward the `Tabs` context so it can be passed through the
57
67
  // underlying slot/fill.
58
68
  const tabsContextValue = (0, _element.useContext)(Tabs.Context);
@@ -67,7 +77,7 @@ const SidebarContent = ({
67
77
  // We are purposefully using a custom `data-tab-id` attribute here
68
78
  // because we don't want rely on any assumptions about `Tabs`
69
79
  // component internals.
70
- element => element.getAttribute('data-tab-id') === sidebarName);
80
+ element => element.getAttribute('data-tab-id') === tabName);
71
81
  const activeElement = selectedTabElement?.ownerDocument.activeElement;
72
82
  const tabsHasFocus = tabsElements.some(element => {
73
83
  return activeElement && activeElement.id === element.id;
@@ -75,9 +85,9 @@ const SidebarContent = ({
75
85
  if (tabsHasFocus && selectedTabElement && selectedTabElement.id !== activeElement?.id) {
76
86
  selectedTabElement?.focus();
77
87
  }
78
- }, [sidebarName]);
79
- return (0, _react.createElement)(_pluginSidebar.default, {
80
- identifier: sidebarName,
88
+ }, [tabName]);
89
+ return (0, _react.createElement)(_editor.PluginSidebar, {
90
+ identifier: tabName,
81
91
  header: (0, _react.createElement)(Tabs.Context.Provider, {
82
92
  value: tabsContextValue
83
93
  }, (0, _react.createElement)(_settingsHeader.default, {
@@ -100,7 +110,11 @@ const SidebarContent = ({
100
110
  }, (0, _react.createElement)(Tabs.TabPanel, {
101
111
  tabId: sidebars.document,
102
112
  focusable: false
103
- }, (0, _react.createElement)(PostCardPanel, null), !isEditingTemplate && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_postStatus.default, null), (0, _react.createElement)(_editor.PluginDocumentSettingPanel.Slot, null), (0, _react.createElement)(_editor.PostLastRevisionPanel, null), (0, _react.createElement)(_editor.PostTaxonomiesPanel, null), (0, _react.createElement)(_editor.PostExcerptPanel, null), (0, _react.createElement)(_editor.PostDiscussionPanel, null), (0, _react.createElement)(_editor.PageAttributesPanel, null), (0, _react.createElement)(PatternOverridesPanel, null), (0, _react.createElement)(_metaBoxes.default, {
113
+ }, (0, _react.createElement)(PostCardPanel, {
114
+ actions: (0, _react.createElement)(PostActions, {
115
+ onActionPerformed: onActionPerformed
116
+ })
117
+ }), !isEditingTemplate && (0, _react.createElement)(_react.Fragment, null, (0, _react.createElement)(_postStatus.default, null), (0, _react.createElement)(_editor.PluginDocumentSettingPanel.Slot, null), (0, _react.createElement)(_editor.PostLastRevisionPanel, null), (0, _react.createElement)(_editor.PostTaxonomiesPanel, null), (0, _react.createElement)(_editor.PostExcerptPanel, null), (0, _react.createElement)(_editor.PostDiscussionPanel, null), (0, _react.createElement)(_editor.PageAttributesPanel, null), (0, _react.createElement)(PatternOverridesPanel, null), (0, _react.createElement)(_metaBoxes.default, {
104
118
  location: "side"
105
119
  }))), (0, _react.createElement)(Tabs.TabPanel, {
106
120
  tabId: sidebars.block,
@@ -108,32 +122,21 @@ const SidebarContent = ({
108
122
  }, (0, _react.createElement)(_blockEditor.BlockInspector, null))));
109
123
  };
110
124
  const SettingsSidebar = () => {
125
+ useAutoSwitchEditorSidebars();
111
126
  const {
112
- sidebarName,
113
- isSettingsSidebarActive,
127
+ tabName,
114
128
  keyboardShortcut,
115
129
  isEditingTemplate
116
130
  } = (0, _data.useSelect)(select => {
117
- // The settings sidebar is used by the edit-post/document and edit-post/block sidebars.
118
- // sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.
119
- // If one of the two sidebars is active the component will contain the content of that sidebar.
120
- // When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost
121
- // component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName
122
- // should contain the sidebar that will be active when the toggle button is pressed. If a block
123
- // is selected, that should be edit-post/block otherwise it's edit-post/document.
124
- let sidebar = select(_interface.store).getActiveComplementaryArea(_store.store.name);
125
- let isSettingsSidebar = true;
126
- if (![sidebars.document, sidebars.block].includes(sidebar)) {
127
- isSettingsSidebar = false;
128
- if (select(_blockEditor.store).getBlockSelectionStart()) {
129
- sidebar = sidebars.block;
130
- }
131
- sidebar = sidebars.document;
131
+ const shortcut = select(_keyboardShortcuts.store).getShortcutRepresentation('core/editor/toggle-sidebar');
132
+ const sidebar = select(interfaceStore).getActiveComplementaryArea('core');
133
+ const _isEditorSidebarOpened = [sidebars.block, sidebars.document].includes(sidebar);
134
+ let _tabName = sidebar;
135
+ if (!_isEditorSidebarOpened) {
136
+ _tabName = !!select(_blockEditor.store).getBlockSelectionStart() ? sidebars.block : sidebars.document;
132
137
  }
133
- const shortcut = select(_keyboardShortcuts.store).getShortcutRepresentation('core/edit-post/toggle-sidebar');
134
138
  return {
135
- sidebarName: sidebar,
136
- isSettingsSidebarActive: isSettingsSidebar,
139
+ tabName: _tabName,
137
140
  keyboardShortcut: shortcut,
138
141
  isEditingTemplate: select(_editor.store).getCurrentPostType() === 'wp_template'
139
142
  };
@@ -146,18 +149,12 @@ const SettingsSidebar = () => {
146
149
  openGeneralSidebar(newSelectedTabId);
147
150
  }
148
151
  }, [openGeneralSidebar]);
149
- return (0, _react.createElement)(Tabs
150
- // Due to how this component is controlled (via a value from the
151
- // `interfaceStore`), when the sidebar closes the currently selected
152
- // tab can't be found. This causes the component to continuously reset
153
- // the selection to `null` in an infinite loop.Proactively setting
154
- // the selected tab to `null` avoids that.
155
- , {
156
- selectedTabId: isSettingsSidebarActive ? sidebarName : null,
152
+ return (0, _react.createElement)(Tabs, {
153
+ selectedTabId: tabName,
157
154
  onSelect: onTabSelect,
158
155
  selectOnMove: false
159
156
  }, (0, _react.createElement)(SidebarContent, {
160
- sidebarName: sidebarName,
157
+ tabName: tabName,
161
158
  keyboardShortcut: keyboardShortcut,
162
159
  isEditingTemplate: isEditingTemplate
163
160
  }));
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_data","_element","_i18n","_icons","_interface","_keyboardShortcuts","_editor","_settingsHeader","_interopRequireDefault","_postStatus","_metaBoxes","_pluginSidebar","_store","_components","_lockUnlock","PostCardPanel","unlock","editorPrivateApis","Tabs","componentsPrivateApis","PatternOverridesPanel","SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","sidebars","exports","document","block","SidebarContent","sidebarName","keyboardShortcut","isEditingTemplate","tabListRef","useRef","tabsContextValue","useContext","Context","useEffect","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","_react","createElement","default","identifier","header","Provider","value","ref","closeLabel","__","className","headerClassName","title","toggleShortcut","icon","isRTL","drawerLeft","drawerRight","isActiveByDefault","TabPanel","tabId","focusable","Fragment","PluginDocumentSettingPanel","Slot","PostLastRevisionPanel","PostTaxonomiesPanel","PostExcerptPanel","PostDiscussionPanel","PageAttributesPanel","location","BlockInspector","SettingsSidebar","isSettingsSidebarActive","useSelect","sidebar","interfaceStore","getActiveComplementaryArea","editPostStore","name","isSettingsSidebar","includes","blockEditorStore","getBlockSelectionStart","shortcut","keyboardShortcutsStore","getShortcutRepresentation","editorStore","getCurrentPostType","openGeneralSidebar","useDispatch","onTabSelect","useCallback","newSelectedTabId","selectedTabId","onSelect","selectOnMove","_default"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as interfaceStore } from '@wordpress/interface';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tstore as editorStore,\n\tPageAttributesPanel,\n\tPluginDocumentSettingPanel,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport MetaBoxes from '../../meta-boxes';\nimport PluginSidebarEditPost from '../plugin-sidebar';\nimport { store as editPostStore } from '../../../store';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostCardPanel } = unlock( editorPrivateApis );\n\nconst { Tabs } = unlock( componentsPrivateApis );\nconst { PatternOverridesPanel } = unlock( editorPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\nexport const sidebars = {\n\tdocument: 'edit-post/document',\n\tblock: 'edit-post/block',\n};\n\nconst SidebarContent = ( {\n\tsidebarName,\n\tkeyboardShortcut,\n\tisEditingTemplate,\n} ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebarEditPost` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === sidebarName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ sidebarName ] );\n\n\treturn (\n\t\t<PluginSidebarEditPost\n\t\t\tidentifier={ sidebarName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SettingsHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"edit-post-sidebar__panel\"\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<PostCardPanel />\n\t\t\t\t\t{ ! isEditingTemplate && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostStatus />\n\t\t\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t\t\t<PostLastRevisionPanel />\n\t\t\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t\t\t<MetaBoxes location=\"side\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebarEditPost>\n\t);\n};\n\nconst SettingsSidebar = () => {\n\tconst {\n\t\tsidebarName,\n\t\tisSettingsSidebarActive,\n\t\tkeyboardShortcut,\n\t\tisEditingTemplate,\n\t} = useSelect( ( select ) => {\n\t\t// The settings sidebar is used by the edit-post/document and edit-post/block sidebars.\n\t\t// sidebarName represents the sidebar that is active or that should be active when the SettingsSidebar toggle button is pressed.\n\t\t// If one of the two sidebars is active the component will contain the content of that sidebar.\n\t\t// When neither of the two sidebars is active we can not simply return null, because the PluginSidebarEditPost\n\t\t// component, besides being used to render the sidebar, also renders the toggle button. In that case sidebarName\n\t\t// should contain the sidebar that will be active when the toggle button is pressed. If a block\n\t\t// is selected, that should be edit-post/block otherwise it's edit-post/document.\n\t\tlet sidebar = select( interfaceStore ).getActiveComplementaryArea(\n\t\t\teditPostStore.name\n\t\t);\n\t\tlet isSettingsSidebar = true;\n\t\tif ( ! [ sidebars.document, sidebars.block ].includes( sidebar ) ) {\n\t\t\tisSettingsSidebar = false;\n\t\t\tif ( select( blockEditorStore ).getBlockSelectionStart() ) {\n\t\t\t\tsidebar = sidebars.block;\n\t\t\t}\n\t\t\tsidebar = sidebars.document;\n\t\t}\n\t\tconst shortcut = select(\n\t\t\tkeyboardShortcutsStore\n\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' );\n\t\treturn {\n\t\t\tsidebarName: sidebar,\n\t\t\tisSettingsSidebarActive: isSettingsSidebar,\n\t\t\tkeyboardShortcut: shortcut,\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t};\n\t}, [] );\n\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\topenGeneralSidebar( newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ openGeneralSidebar ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\t// Due to how this component is controlled (via a value from the\n\t\t\t// `interfaceStore`), when the sidebar closes the currently selected\n\t\t\t// tab can't be found. This causes the component to continuously reset\n\t\t\t// the selection to `null` in an infinite loop.Proactively setting\n\t\t\t// the selected tab to `null` avoids that.\n\t\t\tselectedTabId={ isSettingsSidebarActive ? sidebarName : null }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\tsidebarName={ sidebarName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tisEditingTemplate={ isEditingTemplate }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,UAAA,GAAAL,OAAA;AACA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,OAAA,GAAAP,OAAA;AAcA,IAAAQ,eAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,WAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,UAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,cAAA,GAAAH,sBAAA,CAAAT,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AACA,IAAAe,WAAA,GAAAf,OAAA;AAvCA;AACA;AACA;;AA4BA;AACA;AACA;;AASA,MAAM;EAAEgB;AAAc,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAErD,MAAM;EAAEC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element","_i18n","_icons","_keyboardShortcuts","_editor","_url","_settingsHeader","_interopRequireDefault","_postStatus","_metaBoxes","_store","_components","_lockUnlock","PostCardPanel","PostActions","interfaceStore","unlock","editorPrivateApis","Tabs","componentsPrivateApis","PatternOverridesPanel","useAutoSwitchEditorSidebars","SIDEBAR_ACTIVE_BY_DEFAULT","Platform","select","web","native","sidebars","exports","document","block","onActionPerformed","actionId","items","postType","type","location","href","addQueryArgs","post_type","SidebarContent","tabName","keyboardShortcut","isEditingTemplate","tabListRef","useRef","tabsContextValue","useContext","Context","useEffect","tabsElements","Array","from","current","querySelectorAll","selectedTabElement","find","element","getAttribute","activeElement","ownerDocument","tabsHasFocus","some","id","focus","_react","createElement","PluginSidebar","identifier","header","Provider","value","default","ref","closeLabel","__","className","headerClassName","title","toggleShortcut","icon","isRTL","drawerLeft","drawerRight","isActiveByDefault","TabPanel","tabId","focusable","actions","Fragment","PluginDocumentSettingPanel","Slot","PostLastRevisionPanel","PostTaxonomiesPanel","PostExcerptPanel","PostDiscussionPanel","PageAttributesPanel","BlockInspector","SettingsSidebar","useSelect","shortcut","keyboardShortcutsStore","getShortcutRepresentation","sidebar","getActiveComplementaryArea","_isEditorSidebarOpened","includes","_tabName","blockEditorStore","getBlockSelectionStart","editorStore","getCurrentPostType","openGeneralSidebar","useDispatch","editPostStore","onTabSelect","useCallback","newSelectedTabId","selectedTabId","onSelect","selectOnMove","_default"],"sources":["@wordpress/edit-post/src/components/sidebar/settings-sidebar/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockInspector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPlatform,\n\tuseCallback,\n\tuseContext,\n\tuseEffect,\n\tuseRef,\n} from '@wordpress/element';\nimport { isRTL, __ } from '@wordpress/i18n';\nimport { drawerLeft, drawerRight } from '@wordpress/icons';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport {\n\tstore as editorStore,\n\tPageAttributesPanel,\n\tPluginDocumentSettingPanel,\n\tPluginSidebar,\n\tPostDiscussionPanel,\n\tPostExcerptPanel,\n\tPostLastRevisionPanel,\n\tPostTaxonomiesPanel,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport SettingsHeader from '../settings-header';\nimport PostStatus from '../post-status';\nimport MetaBoxes from '../../meta-boxes';\nimport { store as editPostStore } from '../../../store';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\nimport { unlock } from '../../../lock-unlock';\n\nconst { PostCardPanel, PostActions, interfaceStore } =\n\tunlock( editorPrivateApis );\nconst { Tabs } = unlock( componentsPrivateApis );\nconst { PatternOverridesPanel, useAutoSwitchEditorSidebars } =\n\tunlock( editorPrivateApis );\n\nconst SIDEBAR_ACTIVE_BY_DEFAULT = Platform.select( {\n\tweb: true,\n\tnative: false,\n} );\nexport const sidebars = {\n\tdocument: 'edit-post/document',\n\tblock: 'edit-post/block',\n};\n\nfunction onActionPerformed( actionId, items ) {\n\tif ( actionId === 'move-to-trash' ) {\n\t\tconst postType = items[ 0 ].type;\n\t\tdocument.location.href = addQueryArgs( 'edit.php', {\n\t\t\tpost_type: postType,\n\t\t} );\n\t}\n}\n\nconst SidebarContent = ( { tabName, keyboardShortcut, isEditingTemplate } ) => {\n\tconst tabListRef = useRef( null );\n\t// Because `PluginSidebar` renders a `ComplementaryArea`, we\n\t// need to forward the `Tabs` context so it can be passed through the\n\t// underlying slot/fill.\n\tconst tabsContextValue = useContext( Tabs.Context );\n\n\t// This effect addresses a race condition caused by tabbing from the last\n\t// block in the editor into the settings sidebar. Without this effect, the\n\t// selected tab and browser focus can become separated in an unexpected way\n\t// (e.g the \"block\" tab is focused, but the \"post\" tab is selected).\n\tuseEffect( () => {\n\t\tconst tabsElements = Array.from(\n\t\t\ttabListRef.current?.querySelectorAll( '[role=\"tab\"]' ) || []\n\t\t);\n\t\tconst selectedTabElement = tabsElements.find(\n\t\t\t// We are purposefully using a custom `data-tab-id` attribute here\n\t\t\t// because we don't want rely on any assumptions about `Tabs`\n\t\t\t// component internals.\n\t\t\t( element ) => element.getAttribute( 'data-tab-id' ) === tabName\n\t\t);\n\t\tconst activeElement = selectedTabElement?.ownerDocument.activeElement;\n\t\tconst tabsHasFocus = tabsElements.some( ( element ) => {\n\t\t\treturn activeElement && activeElement.id === element.id;\n\t\t} );\n\t\tif (\n\t\t\ttabsHasFocus &&\n\t\t\tselectedTabElement &&\n\t\t\tselectedTabElement.id !== activeElement?.id\n\t\t) {\n\t\t\tselectedTabElement?.focus();\n\t\t}\n\t}, [ tabName ] );\n\n\treturn (\n\t\t<PluginSidebar\n\t\t\tidentifier={ tabName }\n\t\t\theader={\n\t\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t\t<SettingsHeader ref={ tabListRef } />\n\t\t\t\t</Tabs.Context.Provider>\n\t\t\t}\n\t\t\tcloseLabel={ __( 'Close Settings' ) }\n\t\t\t// This classname is added so we can apply a corrective negative\n\t\t\t// margin to the panel.\n\t\t\t// see https://github.com/WordPress/gutenberg/pull/55360#pullrequestreview-1737671049\n\t\t\tclassName=\"edit-post-sidebar__panel\"\n\t\t\theaderClassName=\"edit-post-sidebar__panel-tabs\"\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\ttitle={ __( 'Settings' ) }\n\t\t\ttoggleShortcut={ keyboardShortcut }\n\t\t\ticon={ isRTL() ? drawerLeft : drawerRight }\n\t\t\tisActiveByDefault={ SIDEBAR_ACTIVE_BY_DEFAULT }\n\t\t>\n\t\t\t<Tabs.Context.Provider value={ tabsContextValue }>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.document } focusable={ false }>\n\t\t\t\t\t<PostCardPanel\n\t\t\t\t\t\tactions={\n\t\t\t\t\t\t\t<PostActions\n\t\t\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ ! isEditingTemplate && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<PostStatus />\n\t\t\t\t\t\t\t<PluginDocumentSettingPanel.Slot />\n\t\t\t\t\t\t\t<PostLastRevisionPanel />\n\t\t\t\t\t\t\t<PostTaxonomiesPanel />\n\t\t\t\t\t\t\t<PostExcerptPanel />\n\t\t\t\t\t\t\t<PostDiscussionPanel />\n\t\t\t\t\t\t\t<PageAttributesPanel />\n\t\t\t\t\t\t\t<PatternOverridesPanel />\n\t\t\t\t\t\t\t<MetaBoxes location=\"side\" />\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t<Tabs.TabPanel tabId={ sidebars.block } focusable={ false }>\n\t\t\t\t\t<BlockInspector />\n\t\t\t\t</Tabs.TabPanel>\n\t\t\t</Tabs.Context.Provider>\n\t\t</PluginSidebar>\n\t);\n};\n\nconst SettingsSidebar = () => {\n\tuseAutoSwitchEditorSidebars();\n\tconst { tabName, keyboardShortcut, isEditingTemplate } = useSelect(\n\t\t( select ) => {\n\t\t\tconst shortcut = select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' );\n\n\t\t\tconst sidebar =\n\t\t\t\tselect( interfaceStore ).getActiveComplementaryArea( 'core' );\n\t\t\tconst _isEditorSidebarOpened = [\n\t\t\t\tsidebars.block,\n\t\t\t\tsidebars.document,\n\t\t\t].includes( sidebar );\n\t\t\tlet _tabName = sidebar;\n\t\t\tif ( ! _isEditorSidebarOpened ) {\n\t\t\t\t_tabName = !! select(\n\t\t\t\t\tblockEditorStore\n\t\t\t\t).getBlockSelectionStart()\n\t\t\t\t\t? sidebars.block\n\t\t\t\t\t: sidebars.document;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\ttabName: _tabName,\n\t\t\t\tkeyboardShortcut: shortcut,\n\t\t\t\tisEditingTemplate:\n\t\t\t\t\tselect( editorStore ).getCurrentPostType() ===\n\t\t\t\t\t'wp_template',\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\n\tconst onTabSelect = useCallback(\n\t\t( newSelectedTabId ) => {\n\t\t\tif ( !! newSelectedTabId ) {\n\t\t\t\topenGeneralSidebar( newSelectedTabId );\n\t\t\t}\n\t\t},\n\t\t[ openGeneralSidebar ]\n\t);\n\n\treturn (\n\t\t<Tabs\n\t\t\tselectedTabId={ tabName }\n\t\t\tonSelect={ onTabSelect }\n\t\t\tselectOnMove={ false }\n\t\t>\n\t\t\t<SidebarContent\n\t\t\t\ttabName={ tabName }\n\t\t\t\tkeyboardShortcut={ keyboardShortcut }\n\t\t\t\tisEditingTemplate={ isEditingTemplate }\n\t\t\t/>\n\t\t</Tabs>\n\t);\n};\n\nexport default SettingsSidebar;\n"],"mappings":";;;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,QAAA,GAAAF,OAAA;AAOA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,kBAAA,GAAAL,OAAA;AACA,IAAAM,OAAA,GAAAN,OAAA;AAWA,IAAAO,IAAA,GAAAP,OAAA;AAKA,IAAAQ,eAAA,GAAAC,sBAAA,CAAAT,OAAA;AACA,IAAAU,WAAA,GAAAD,sBAAA,CAAAT,OAAA;AACA,IAAAW,UAAA,GAAAF,sBAAA,CAAAT,OAAA;AACA,IAAAY,MAAA,GAAAZ,OAAA;AACA,IAAAa,WAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAvCA;AACA;AACA;;AA6BA;AACA;AACA;;AAQA,MAAM;EAAEe,aAAa;EAAEC,WAAW;EAAEC;AAAe,CAAC,GACnD,IAAAC,kBAAM,EAAEC,mBAAkB,CAA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GJ,WAAa;IACxBK,YAAY,EAAG;EAAO,GAEtB,IAAAvD,MAAA,CAAAC,aAAA,EAAC1B,cAAc;IACdC,OAAO,EAAGA,OAAS;IACnBC,gBAAgB,EAAGA,gBAAkB;IACrCC,iBAAiB,EAAGA;EAAmB,CACvC,CACI,CAAC;AAET,CAAC;AAAC,IAAA8E,QAAA,GAAA7F,OAAA,CAAA4C,OAAA,GAEa0B,eAAe","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_editor","require","_components","_data","_i18n","_keycodes","_element","_store","TextEditor","isRichEditingEnabled","useSelect","select","editorStore","getEditorSettings","richEditingEnabled","switchEditorMode","useDispatch","isWelcomeGuideVisible","isFeatureActive","editPostStore","titleRef","useRef","useEffect","current","focus","_react","createElement","className","__","Button","variant","onClick","shortcut","displayShortcut","secondary","PostTitleRaw","ref","PostTextEditor"],"sources":["@wordpress/edit-post/src/components/text-editor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostTextEditor,\n\tPostTitleRaw,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function TextEditor() {\n\tconst isRichEditingEnabled = useSelect( ( select ) => {\n\t\treturn select( editorStore ).getEditorSettings().richEditingEnabled;\n\t}, [] );\n\tconst { switchEditorMode } = useDispatch( editorStore );\n\n\tconst { isWelcomeGuideVisible } = useSelect( ( select ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn {\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t};\n\t}, [] );\n\n\tconst titleRef = useRef();\n\n\tuseEffect( () => {\n\t\tif ( isWelcomeGuideVisible ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ isWelcomeGuideVisible ] );\n\n\treturn (\n\t\t<div className=\"edit-post-text-editor\">\n\t\t\t{ isRichEditingEnabled && (\n\t\t\t\t<div className=\"edit-post-text-editor__toolbar\">\n\t\t\t\t\t<h2>{ __( 'Editing code' ) }</h2>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => switchEditorMode( 'visual' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'm' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Exit code editor' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"edit-post-text-editor__body\">\n\t\t\t\t<PostTitleRaw ref={ titleRef } />\n\t\t\t\t<PostTextEditor />\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAKA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,SAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAjBA;AACA;AACA;;AAYA;AACA;AACA;;AAGe,SAASO,UAAUA,CAAA,EAAG;EACpC,MAAMC,oBAAoB,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACrD,OAAOA,MAAM,CAAEC,aAAY,CAAC,CAACC,iBAAiB,CAAC,CAAC,CAACC,kBAAkB;EACpE,CAAC,EAAE,EAAG,CAAC;EACP,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEJ,aAAY,CAAC;EAEvD,MAAM;IAAEK;EAAsB,CAAC,GAAG,IAAAP,eAAS,EAAIC,MAAM,IAAM;IAC1D,MAAM;MAAEO;IAAgB,CAAC,GAAGP,MAAM,CAAEQ,YAAc,CAAC;IAEnD,OAAO;MACNF,qBAAqB,EAAEC,eAAe,CAAE,cAAe;IACxD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAME,QAAQ,GAAG,IAAAC,eAAM,EAAC,CAAC;EAEzB,IAAAC,kBAAS,EAAE,MAAM;IAChB,IAAKL,qBAAqB,EAAG;MAC5B;IACD;IACAG,QAAQ,EAAEG,OAAO,EAAEC,KAAK,CAAC,CAAC;EAC3B,CAAC,EAAE,CAAEP,qBAAqB,CAAG,CAAC;EAE9B,OACC,IAAAQ,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAAuB,GACnClB,oBAAoB,IACrB,IAAAgB,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAAgC,GAC9C,IAAAF,MAAA,CAAAC,aAAA,cAAM,IAAAE,QAAE,EAAE,cAAe,CAAO,CAAC,EACjC,IAAAH,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAA2B,MAAM;IACNC,OAAO,EAAC,UAAU;IAClBC,OAAO,EAAGA,CAAA,KAAMhB,gBAAgB,CAAE,QAAS,CAAG;IAC9CiB,QAAQ,EAAGC,yBAAe,CAACC,SAAS,CAAE,GAAI;EAAG,GAE3C,IAAAN,QAAE,EAAE,kBAAmB,CAClB,CACJ,CACL,EACD,IAAAH,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA6B,GAC3C,IAAAF,MAAA,CAAAC,aAAA,EAAC1B,OAAA,CAAAmC,YAAY;IAACC,GAAG,EAAGhB;EAAU,CAAE,CAAC,EACjC,IAAAK,MAAA,CAAAC,aAAA,EAAC1B,OAAA,CAAAqC,cAAc,MAAE,CACb,CACD,CAAC;AAER"}
1
+ {"version":3,"names":["_editor","require","_components","_data","_i18n","_keycodes","_element","_store","TextEditor","isRichEditingEnabled","useSelect","select","editorStore","getEditorSettings","richEditingEnabled","switchEditorMode","useDispatch","isWelcomeGuideVisible","isFeatureActive","editPostStore","titleRef","useRef","useEffect","current","focus","_react","createElement","className","__","Button","variant","onClick","shortcut","displayShortcut","secondary","PostTitleRaw","ref","PostTextEditor"],"sources":["@wordpress/edit-post/src/components/text-editor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tPostTextEditor,\n\tPostTitleRaw,\n\tstore as editorStore,\n} from '@wordpress/editor';\nimport { Button } from '@wordpress/components';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { useEffect, useRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport default function TextEditor() {\n\tconst isRichEditingEnabled = useSelect( ( select ) => {\n\t\treturn select( editorStore ).getEditorSettings().richEditingEnabled;\n\t}, [] );\n\tconst { switchEditorMode } = useDispatch( editorStore );\n\n\tconst { isWelcomeGuideVisible } = useSelect( ( select ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\n\t\treturn {\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t};\n\t}, [] );\n\n\tconst titleRef = useRef();\n\n\tuseEffect( () => {\n\t\tif ( isWelcomeGuideVisible ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ isWelcomeGuideVisible ] );\n\n\treturn (\n\t\t<div className=\"edit-post-text-editor\">\n\t\t\t{ isRichEditingEnabled && (\n\t\t\t\t<div className=\"edit-post-text-editor__toolbar\">\n\t\t\t\t\t<h2>{ __( 'Editing code' ) }</h2>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\tonClick={ () => switchEditorMode( 'visual' ) }\n\t\t\t\t\t\tshortcut={ displayShortcut.secondary( 'm' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Exit code editor' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<div className=\"edit-post-text-edit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,EAAC;EAAgC,GAC9C,IAAAF,MAAA,CAAAC,aAAA,cAAM,IAAAE,QAAE,EAAE,cAAe,CAAO,CAAC,EACjC,IAAAH,MAAA,CAAAC,aAAA,EAACxB,WAAA,CAAA2B,MAAM;IACNC,OAAO,EAAC,UAAU;IAClBC,OAAO,EAAGA,CAAA,KAAMhB,gBAAgB,CAAE,QAAS,CAAG;IAC9CiB,QAAQ,EAAGC,yBAAe,CAACC,SAAS,CAAE,GAAI;EAAG,GAE3C,IAAAN,QAAE,EAAE,kBAAmB,CAClB,CACJ,CACL,EACD,IAAAH,MAAA,CAAAC,aAAA;IAAKC,SAAS,EAAC;EAA6B,GAC3C,IAAAF,MAAA,CAAAC,aAAA,EAAC1B,OAAA,CAAAmC,YAAY;IAACC,GAAG,EAAGhB;EAAU,CAAE,CAAC,EACjC,IAAAK,MAAA,CAAAC,aAAA,EAAC1B,OAAA,CAAAqC,cAAc,MAAE,CACb,CACD,CAAC;AAER","ignoreList":[]}
@@ -29,7 +29,7 @@ function BlockInspectorButton({
29
29
  shortcut,
30
30
  areAdvancedSettingsOpened
31
31
  } = (0, _data.useSelect)(select => ({
32
- shortcut: select(_keyboardShortcuts.store).getShortcutRepresentation('core/edit-post/toggle-sidebar'),
32
+ shortcut: select(_keyboardShortcuts.store).getShortcutRepresentation('core/editor/toggle-sidebar'),
33
33
  areAdvancedSettingsOpened: select(_store.store).getActiveGeneralSidebarName() === 'edit-post/block'
34
34
  }), []);
35
35
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_a11y","_keyboardShortcuts","_store","noop","BlockInspectorButton","onClick","small","shortcut","areAdvancedSettingsOpened","useSelect","select","keyboardShortcutsStore","getShortcutRepresentation","editPostStore","getActiveGeneralSidebarName","openGeneralSidebar","closeGeneralSidebar","useDispatch","label","__","_react","createElement","MenuItem","speak","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/visual-editor/block-inspector-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { speak } from '@wordpress/a11y';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst noop = () => {};\n\nexport function BlockInspectorButton( { onClick = noop, small = false } ) {\n\tconst { shortcut, areAdvancedSettingsOpened } = useSelect(\n\t\t( select ) => ( {\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/edit-post/toggle-sidebar' ),\n\t\t\tareAdvancedSettingsOpened:\n\t\t\t\tselect( editPostStore ).getActiveGeneralSidebarName() ===\n\t\t\t\t'edit-post/block',\n\t\t} ),\n\t\t[]\n\t);\n\tconst { openGeneralSidebar, closeGeneralSidebar } =\n\t\tuseDispatch( editPostStore );\n\n\tconst label = areAdvancedSettingsOpened\n\t\t? __( 'Hide more settings' )\n\t\t: __( 'Show more settings' );\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\tif ( areAdvancedSettingsOpened ) {\n\t\t\t\t\tcloseGeneralSidebar();\n\t\t\t\t\tspeak( __( 'Block settings closed' ) );\n\t\t\t\t} else {\n\t\t\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t\t\t\tspeak(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Additional settings are now available in the Editor block settings sidebar'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tshortcut={ shortcut }\n\t\t>\n\t\t\t{ ! small && label }\n\t\t</MenuItem>\n\t);\n}\n\nexport default BlockInspectorButton;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA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AAA,GAEctB,oBAAoB"}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_a11y","_keyboardShortcuts","_store","noop","BlockInspectorButton","onClick","small","shortcut","areAdvancedSettingsOpened","useSelect","select","keyboardShortcutsStore","getShortcutRepresentation","editPostStore","getActiveGeneralSidebarName","openGeneralSidebar","closeGeneralSidebar","useDispatch","label","__","_react","createElement","MenuItem","speak","_default","exports","default"],"sources":["@wordpress/edit-post/src/components/visual-editor/block-inspector-button.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { speak } from '@wordpress/a11y';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nconst noop = () => {};\n\nexport function BlockInspectorButton( { onClick = noop, small = false } ) {\n\tconst { shortcut, areAdvancedSettingsOpened } = useSelect(\n\t\t( select ) => ( {\n\t\t\tshortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getShortcutRepresentation( 'core/editor/toggle-sidebar' ),\n\t\t\tareAdvancedSettingsOpened:\n\t\t\t\tselect( editPostStore ).getActiveGeneralSidebarName() ===\n\t\t\t\t'edit-post/block',\n\t\t} ),\n\t\t[]\n\t);\n\tconst { openGeneralSidebar, closeGeneralSidebar } =\n\t\tuseDispatch( editPostStore );\n\n\tconst label = areAdvancedSettingsOpened\n\t\t? __( 'Hide more settings' )\n\t\t: __( 'Show more settings' );\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\tif ( areAdvancedSettingsOpened ) {\n\t\t\t\t\tcloseGeneralSidebar();\n\t\t\t\t\tspeak( __( 'Block settings closed' ) );\n\t\t\t\t} else {\n\t\t\t\t\topenGeneralSidebar( 'edit-post/block' );\n\t\t\t\t\tspeak(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Additional settings are now available in the Editor block settings sidebar'\n\t\t\t\t\t\t)\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t\tonClick();\n\t\t\t} }\n\t\t\tshortcut={ shortcut }\n\t\t>\n\t\t\t{ ! small && label }\n\t\t</MenuItem>\n\t);\n}\n\nexport default BlockInspectorButton;\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,kBAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AAZA;AACA;AACA;;AAOA;AACA;AACA;;AAGA,MAAMM,IAAI,GAAGA,CAAA,KAAM,CAAC,CAAC;AAEd,SAASC,oBAAoBA,CAAE;EAAEC,OAAO,GAAGF,IAAI;EAAEG,KAAK,GAAG;AAAM,CAAC,EAAG;EACzE,MAAM;IAAEC,QAAQ;IAAEC;EAA0B,CAAC,GAAG,IAAAC,eAAS,EACtDC,MAAM,KAAQ;IACfH,QAAQ,EAAEG,MAAM,CACfC,wBACD,CAAC,CAACC,yBAAyB,CAAE,4BAA6B,CAAC;IAC3DJ,yBAAyB,EACxBE,MAAM,CAAEG,YAAc,CAAC,CAACC,2BAA2B,CAAC,CAAC,KACrD;EACF,CAAC,CAAE,EACH,EACD,CAAC;EACD,MAAM;IAAEC,kBAAkB;IAAEC;EAAoB,CAAC,GAChD,IAAAC,iBAAW,EAAEJ,YAAc,CAAC;EAE7B,MAAMK,KAAK,GAAGV,yBAAyB,GACpC,IAAAW,QAAE,EAAE,oBAAqB,CAAC,GAC1B,IAAAA,QAAE,EAAE,oBAAqB,CAAC;EAE7B,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACvB,WAAA,CAAAwB,QAAQ;IACRjB,OAAO,EAAGA,CAAA,KAAM;MACf,IAAKG,yBAAyB,EAAG;QAChCQ,mBAAmB,CAAC,CAAC;QACrB,IAAAO,WAAK,EAAE,IAAAJ,QAAE,EAAE,uBAAwB,CAAE,CAAC;MACvC,CAAC,MAAM;QACNJ,kBAAkB,CAAE,iBAAkB,CAAC;QACvC,IAAAQ,WAAK,EACJ,IAAAJ,QAAE,EACD,4EACD,CACD,CAAC;MACF;MACAd,OAAO,CAAC,CAAC;IACV,CAAG;IACHE,QAAQ,EAAGA;EAAU,GAEnB,CAAED,KAAK,IAAIY,KACJ,CAAC;AAEb;AAAC,IAAAM,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctB,oBAAoB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_reactNative","require","_element","_i18n","_data","_compose","_editor","_blockEditor","Header","memo","EditorHeader","editTitle","setTitleRef","title","wrapperStyles","useEditorWrapperStyles","_react","createElement","View","style","PostTitle","innerRef","onUpdate","placeholder","__","accessibilityLabel","prevProps","nextProps","_default","exports","default","compose","withSelect","select","getEditedPostAttribute","withDispatch","dispatch","editPost","clearSelectedBlock","blockEditorStore","withPreferredColorScheme"],"sources":["@wordpress/edit-post/src/components/visual-editor/header.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { PostTitle } from '@wordpress/editor';\nimport {\n\tstore as blockEditorStore,\n\tuseEditorWrapperStyles,\n} from '@wordpress/block-editor';\n\nconst Header = memo(\n\tfunction EditorHeader( { editTitle, setTitleRef, title } ) {\n\t\tconst [ wrapperStyles ] = useEditorWrapperStyles();\n\t\treturn (\n\t\t\t<View style={ wrapperStyles }>\n\t\t\t\t<PostTitle\n\t\t\t\t\tinnerRef={ setTitleRef }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tonUpdate={ editTitle }\n\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\taccessibilityLabel=\"post-title\"\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t},\n\t( prevProps, nextProps ) => prevProps.title === nextProps.title\n);\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( 'core/editor' );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost } = dispatch( 'core/editor' );\n\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Header );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAWA,MAAMO,MAAM,GAAG,IAAAC,aAAI,EAClB,SAASC,YAAYA,CAAE;EAAEC,SAAS;EAAEC,WAAW;EAAEC;AAAM,CAAC,EAAG;EAC1D,MAAM,CAAEC,aAAa,CAAE,GAAG,IAAAC,mCAAsB,EAAC,CAAC;EAClD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACjB,YAAA,CAAAkB,IAAI;IAACC,KAAK,EAAGL;EAAe,GAC5B,IAAAE,MAAA,CAAAC,aAAA,EAACX,OAAA,CAAAc,SAAS;IACTC,QAAQ,EAAGT,WAAa;IACxBC,KAAK,EAAGA,KAAO;IACfS,QAAQ,EAAGX,SAAW;IACtBY,WAAW,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IACjCC,kBAAkB,EAAC;EAAY,CAC/B,CACI,CAAC;AAET,CAAC,EACD,CAAEC,SAAS,EAAEC,SAAS,KAAMD,SAAS,CAACb,KAAK,KAAKc,SAAS,CAACd,KAC3D,CAAC;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAuB,CAAC,GAAGD,MAAM,CAAE,aAAc,CAAC;EAE1D,OAAO;IACNpB,KAAK,EAAEqB,sBAAsB,CAAE,OAAQ;EACxC,CAAC;AACF,CAAE,CAAC,EACH,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC;EAAS,CAAC,GAAGD,QAAQ,CAAE,aAAc,CAAC;EAE9C,MAAM;IAAEE;EAAmB,CAAC,GAAGF,QAAQ,CAAEG,kBAAiB,CAAC;EAE3D,OAAO;IACND,kBAAkB;IAClB3B,SAASA,CAAEE,KAAK,EAAG;MAClBwB,QAAQ,CAAE;QAAExB;MAAM,CAAE,CAAC;IACtB;EACD,CAAC;AACF,CAAE,CAAC,EACH2B,iCAAwB,CACvB,CAAC,CAAEhC,MAAO,CAAC"}
1
+ {"version":3,"names":["_reactNative","require","_element","_i18n","_data","_compose","_editor","_blockEditor","Header","memo","EditorHeader","editTitle","setTitleRef","title","wrapperStyles","useEditorWrapperStyles","_react","createElement","View","style","PostTitle","innerRef","onUpdate","placeholder","__","accessibilityLabel","prevProps","nextProps","_default","exports","default","compose","withSelect","select","getEditedPostAttribute","withDispatch","dispatch","editPost","clearSelectedBlock","blockEditorStore","withPreferredColorScheme"],"sources":["@wordpress/edit-post/src/components/visual-editor/header.native.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { memo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose, withPreferredColorScheme } from '@wordpress/compose';\nimport { PostTitle } from '@wordpress/editor';\nimport {\n\tstore as blockEditorStore,\n\tuseEditorWrapperStyles,\n} from '@wordpress/block-editor';\n\nconst Header = memo(\n\tfunction EditorHeader( { editTitle, setTitleRef, title } ) {\n\t\tconst [ wrapperStyles ] = useEditorWrapperStyles();\n\t\treturn (\n\t\t\t<View style={ wrapperStyles }>\n\t\t\t\t<PostTitle\n\t\t\t\t\tinnerRef={ setTitleRef }\n\t\t\t\t\ttitle={ title }\n\t\t\t\t\tonUpdate={ editTitle }\n\t\t\t\t\tplaceholder={ __( 'Add title' ) }\n\t\t\t\t\taccessibilityLabel=\"post-title\"\n\t\t\t\t/>\n\t\t\t</View>\n\t\t);\n\t},\n\t( prevProps, nextProps ) => prevProps.title === nextProps.title\n);\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst { getEditedPostAttribute } = select( 'core/editor' );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { editPost } = dispatch( 'core/editor' );\n\n\t\tconst { clearSelectedBlock } = dispatch( blockEditorStore );\n\n\t\treturn {\n\t\t\tclearSelectedBlock,\n\t\t\teditTitle( title ) {\n\t\t\t\teditPost( { title } );\n\t\t\t},\n\t\t};\n\t} ),\n\twithPreferredColorScheme,\n] )( Header );\n"],"mappings":";;;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,OAAA,GAAAL,OAAA;AACA,IAAAM,YAAA,GAAAN,OAAA;AAbA;AACA;AACA;;AAGA;AACA;AACA;;AAWA,MAAMO,MAAM,GAAG,IAAAC,aAAI,EAClB,SAASC,YAAYA,CAAE;EAAEC,SAAS;EAAEC,WAAW;EAAEC;AAAM,CAAC,EAAG;EAC1D,MAAM,CAAEC,aAAa,CAAE,GAAG,IAAAC,mCAAsB,EAAC,CAAC;EAClD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACjB,YAAA,CAAAkB,IAAI;IAACC,KAAK,EAAGL;EAAe,GAC5B,IAAAE,MAAA,CAAAC,aAAA,EAACX,OAAA,CAAAc,SAAS;IACTC,QAAQ,EAAGT,WAAa;IACxBC,KAAK,EAAGA,KAAO;IACfS,QAAQ,EAAGX,SAAW;IACtBY,WAAW,EAAG,IAAAC,QAAE,EAAE,WAAY,CAAG;IACjCC,kBAAkB,EAAC;EAAY,CAC/B,CACI,CAAC;AAET,CAAC,EACD,CAAEC,SAAS,EAAEC,SAAS,KAAMD,SAAS,CAACb,KAAK,KAAKc,SAAS,CAACd,KAC3D,CAAC;AAAC,IAAAe,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEa,IAAAC,gBAAO,EAAE,CACvB,IAAAC,gBAAU,EAAIC,MAAM,IAAM;EACzB,MAAM;IAAEC;EAAuB,CAAC,GAAGD,MAAM,CAAE,aAAc,CAAC;EAE1D,OAAO;IACNpB,KAAK,EAAEqB,sBAAsB,CAAE,OAAQ;EACxC,CAAC;AACF,CAAE,CAAC,EACH,IAAAC,kBAAY,EAAIC,QAAQ,IAAM;EAC7B,MAAM;IAAEC;EAAS,CAAC,GAAGD,QAAQ,CAAE,aAAc,CAAC;EAE9C,MAAM;IAAEE;EAAmB,CAAC,GAAGF,QAAQ,CAAEG,kBAAiB,CAAC;EAE3D,OAAO;IACND,kBAAkB;IAClB3B,SAASA,CAAEE,KAAK,EAAG;MAClBwB,QAAQ,CAAE;QAAExB;MAAM,CAAE,CAAC;IACtB;EACD,CAAC;AACF,CAAE,CAAC,EACH2B,iCAAwB,CACvB,CAAC,CAAEhC,MAAO,CAAC","ignoreList":[]}
@@ -13,6 +13,7 @@ var _data = require("@wordpress/data");
13
13
  var _blocks = require("@wordpress/blocks");
14
14
  var _store = require("../../store");
15
15
  var _lockUnlock = require("../../lock-unlock");
16
+ var _usePaddingAppender = require("./use-padding-appender");
16
17
  /**
17
18
  * External dependencies
18
19
  */
@@ -61,6 +62,7 @@ function VisualEditor({
61
62
  };
62
63
  }, []);
63
64
  const hasMetaBoxes = (0, _data.useSelect)(select => select(_store.store).hasMetaBoxes(), []);
65
+ const paddingAppenderRef = (0, _usePaddingAppender.usePaddingAppender)();
64
66
  let paddingBottom;
65
67
 
66
68
  // Add a constant padding for the typewritter effect. When typing at the
@@ -83,7 +85,8 @@ function VisualEditor({
83
85
  // We should auto-focus the canvas (title) on load.
84
86
  // eslint-disable-next-line jsx-a11y/no-autofocus
85
87
  ,
86
- autoFocus: !isWelcomeGuideVisible
88
+ autoFocus: !isWelcomeGuideVisible,
89
+ contentRef: paddingAppenderRef
87
90
  }));
88
91
  }
89
92
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_classnames","_interopRequireDefault","require","_editor","_element","_data","_blocks","_store","_lockUnlock","EditorCanvas","unlock","editorPrivateApis","isGutenbergPlugin","process","env","IS_GUTENBERG_PLUGIN","VisualEditor","styles","isWelcomeGuideVisible","renderingMode","isBlockBasedTheme","hasV3BlocksOnly","isEditingTemplate","useSelect","select","isFeatureActive","editPostStore","getEditorSettings","getRenderingMode","editorStore","getBlockTypes","blocksStore","editorSettings","__unstableIsBlockBasedTheme","every","type","apiVersion","getCurrentPostType","hasMetaBoxes","paddingBottom","useMemo","css","isToBeIframed","_react","createElement","className","classnames","disableIframe","autoFocus"],"sources":["@wordpress/edit-post/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst { EditorCanvas } = unlock( editorPrivateApis );\n\nconst isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false;\n\nexport default function VisualEditor( { styles } ) {\n\tconst {\n\t\tisWelcomeGuideVisible,\n\t\trenderingMode,\n\t\tisBlockBasedTheme,\n\t\thasV3BlocksOnly,\n\t\tisEditingTemplate,\n\t} = useSelect( ( select ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\tconst { getEditorSettings, getRenderingMode } = select( editorStore );\n\t\tconst { getBlockTypes } = select( blocksStore );\n\t\tconst editorSettings = getEditorSettings();\n\n\t\treturn {\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tisBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,\n\t\t\thasV3BlocksOnly: getBlockTypes().every( ( type ) => {\n\t\t\t\treturn type.apiVersion >= 3;\n\t\t\t} ),\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t};\n\t}, [] );\n\tconst hasMetaBoxes = useSelect(\n\t\t( select ) => select( editPostStore ).hasMetaBoxes(),\n\t\t[]\n\t);\n\n\tlet paddingBottom;\n\n\t// Add a constant padding for the typewritter effect. When typing at the\n\t// bottom, there needs to be room to scroll up.\n\tif ( ! hasMetaBoxes && renderingMode === 'post-only' ) {\n\t\tpaddingBottom = '40vh';\n\t}\n\n\tstyles = useMemo(\n\t\t() => [\n\t\t\t...styles,\n\t\t\t{\n\t\t\t\t// We should move this in to future to the body.\n\t\t\t\tcss: paddingBottom\n\t\t\t\t\t? `body{padding-bottom:${ paddingBottom }}`\n\t\t\t\t\t: '',\n\t\t\t},\n\t\t],\n\t\t[ styles, paddingBottom ]\n\t);\n\n\tconst isToBeIframed =\n\t\t( ( hasV3BlocksOnly || ( isGutenbergPlugin && isBlockBasedTheme ) ) &&\n\t\t\t! hasMetaBoxes ) ||\n\t\tisEditingTemplate;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-post-visual-editor', {\n\t\t\t\t'has-inline-canvas': ! isToBeIframed,\n\t\t\t} ) }\n\t\t>\n\t\t\t<EditorCanvas\n\t\t\t\tdisableIframe={ ! isToBeIframed }\n\t\t\t\tstyles={ styles }\n\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t/>\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,WAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,OAAA,GAAAD,OAAA;AAIA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,OAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AASA;AACA;AACA;;AAIA,MAAM;EAAEO;AAAa,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;AAEpD,MAAMC,iBAAiB,GAAGC,OAAO,CAACC,GAAG,CAACC,mBAAmB,GAAG,IAAI,GAAG,KAAK;AAEzD,SAASC,YAAYA,CAAE;EAAEC;AAAO,CAAC,EAAG;EAClD,MAAM;IACLC,qBAAqB;IACrBC,aAAa;IACbC,iBAAiB;IACjBC,eAAe;IACfC;EACD,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAC5B,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,YAAc,CAAC;IACnD,MAAM;MAAEC,iBAAiB;MAAEC;IAAiB,CAAC,GAAGJ,MAAM,CAAEK,aAAY,CAAC;IACrE,MAAM;MAAEC;IAAc,CAAC,GAAGN,MAAM,CAAEO,aAAY,CAAC;IAC/C,MAAMC,cAAc,GAAG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,EAAG,CAAE9B;EAAuB,CACrC,CACG,CAAC;AAER"}
1
+ {"version":3,"names":["_classnames","_interopRequireDefault","require","_editor","_element","_data","_blocks","_store","_lockUnlock","_usePaddingAppender","EditorCanvas","unlock","editorPrivateApis","isGutenbergPlugin","process","env","IS_GUTENBERG_PLUGIN","VisualEditor","styles","isWelcomeGuideVisible","renderingMode","isBlockBasedTheme","hasV3BlocksOnly","isEditingTemplate","useSelect","select","isFeatureActive","editPostStore","getEditorSettings","getRenderingMode","editorStore","getBlockTypes","blocksStore","editorSettings","__unstableIsBlockBasedTheme","every","type","apiVersion","getCurrentPostType","hasMetaBoxes","paddingAppenderRef","usePaddingAppender","paddingBottom","useMemo","css","isToBeIframed","_react","createElement","className","classnames","disableIframe","autoFocus","contentRef"],"sources":["@wordpress/edit-post/src/components/visual-editor/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as blocksStore } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport { usePaddingAppender } from './use-padding-appender';\n\nconst { EditorCanvas } = unlock( editorPrivateApis );\n\nconst isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false;\n\nexport default function VisualEditor( { styles } ) {\n\tconst {\n\t\tisWelcomeGuideVisible,\n\t\trenderingMode,\n\t\tisBlockBasedTheme,\n\t\thasV3BlocksOnly,\n\t\tisEditingTemplate,\n\t} = useSelect( ( select ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\tconst { getEditorSettings, getRenderingMode } = select( editorStore );\n\t\tconst { getBlockTypes } = select( blocksStore );\n\t\tconst editorSettings = getEditorSettings();\n\n\t\treturn {\n\t\t\tisWelcomeGuideVisible: isFeatureActive( 'welcomeGuide' ),\n\t\t\trenderingMode: getRenderingMode(),\n\t\t\tisBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,\n\t\t\thasV3BlocksOnly: getBlockTypes().every( ( type ) => {\n\t\t\t\treturn type.apiVersion >= 3;\n\t\t\t} ),\n\t\t\tisEditingTemplate:\n\t\t\t\tselect( editorStore ).getCurrentPostType() === 'wp_template',\n\t\t};\n\t}, [] );\n\tconst hasMetaBoxes = useSelect(\n\t\t( select ) => select( editPostStore ).hasMetaBoxes(),\n\t\t[]\n\t);\n\n\tconst paddingAppenderRef = usePaddingAppender();\n\n\tlet paddingBottom;\n\n\t// Add a constant padding for the typewritter effect. When typing at the\n\t// bottom, there needs to be room to scroll up.\n\tif ( ! hasMetaBoxes && renderingMode === 'post-only' ) {\n\t\tpaddingBottom = '40vh';\n\t}\n\n\tstyles = useMemo(\n\t\t() => [\n\t\t\t...styles,\n\t\t\t{\n\t\t\t\t// We should move this in to future to the body.\n\t\t\t\tcss: paddingBottom\n\t\t\t\t\t? `body{padding-bottom:${ paddingBottom }}`\n\t\t\t\t\t: '',\n\t\t\t},\n\t\t],\n\t\t[ styles, paddingBottom ]\n\t);\n\n\tconst isToBeIframed =\n\t\t( ( hasV3BlocksOnly || ( isGutenbergPlugin && isBlockBasedTheme ) ) &&\n\t\t\t! hasMetaBoxes ) ||\n\t\tisEditingTemplate;\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'edit-post-visual-editor', {\n\t\t\t\t'has-inline-canvas': ! isToBeIframed,\n\t\t\t} ) }\n\t\t>\n\t\t\t<EditorCanvas\n\t\t\t\tdisableIframe={ ! isToBeIframed }\n\t\t\t\tstyles={ styles }\n\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\tautoFocus={ ! isWelcomeGuideVisible }\n\t\t\t\tcontentRef={ paddingAppenderRef }\n\t\t\t/>\n\t\t</div>\n\t);\n}\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,MAAM,CAAEK,aAAY,CAAC,CAACQ,kBAAkB,CAAC,CAAC,KAAK;IACjD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAMC,YAAY,GAAG,IAAAf,eAAS,EAC3BC,MAAM,IAAMA,MAAM,CAAEE,YAAc,CAAC,CAACY,YAAY,CAAC,CAAC,EACpD,EACD,CAAC;EAED,MAAMC,kBAAkB,GAAG,IAAAC,sCAAkB,EAAC,CAAC;EAE/C,IAAIC,aAAa;;EAEjB;EACA;EACA,IAAK,CAAEH,YAAY,IAAInB,aAAa,KAAK,WAAW,EAAG;IACtDsB,aAAa,GAAG,MAAM;EACvB;EAEAxB,MAAM,GAAG,IAAAyB,gBAAO,EACf,MAAM,CACL,GAAGzB,MAAM,EACT;IACC;IACA0B,GAAG,EAAEF,aAAa,GACd,uBAAuBA,aAAe,GAAE,GACzC;EACJ,CAAC,CACD,EACD,CAAExB,MAAM,EAAEwB,aAAa,CACxB,CAAC;EAED,MAAMG,aAAa,GAChB,CAAEvB,eAAe,IAAMT,iBAAiB,IAAIQ,iBAAmB,KAChE,CAAEkB,YAAY,IACfhB,iBAAiB;EAElB,OACC,IAAAuB,MAAA,CAAAC,aAAA;IACCC,SAAS,EAAG,IAAAC,mBAAU,EAAE,yBAAyB,EAAE;MAClD,mBAAmB,EAAE,CAAEJ;IACxB,CAAE;EAAG,GAEL,IAAAC,MAAA,CAAAC,aAAA,EAACrC,YAAY;IACZwC,aAAa,EAAG,CAAEL,aAAe;IACjC3B,MAAM,EAAGA;IACT;IACA;IAAA;IACAiC,SAAS,EAAG,CAAEhC,qBAAuB;IACrCiC,UAAU,EAAGZ;EAAoB,CACjC,CACG,CAAC;AAER","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_element","require","_blockEditor","_header","_interopRequireDefault","VisualEditor","Component","constructor","props","renderHeader","bind","setTitleRef","_react","createElement","default","render","safeAreaBottomInset","BlockList","header","exports"],"sources":["@wordpress/edit-post/src/components/visual-editor/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { BlockList } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Header from './header';\n\nexport default class VisualEditor extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.renderHeader = this.renderHeader.bind( this );\n\t}\n\n\trenderHeader() {\n\t\tconst { setTitleRef } = this.props;\n\t\treturn <Header setTitleRef={ setTitleRef } />;\n\t}\n\n\trender() {\n\t\tconst { safeAreaBottomInset } = this.props;\n\n\t\treturn (\n\t\t\t<BlockList\n\t\t\t\theader={ this.renderHeader }\n\t\t\t\tsafeAreaBottomInset={ safeAreaBottomInset }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,MAAMI,YAAY,SAASC,kBAAS,CAAC;EACnDC,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,YAAY,GAAG,IAAI,CAACA,YAAY,CAACC,IAAI,CAAE,IAAK,CAAC;EACnD;EAEAD,YAAYA,CAAA,EAAG;IACd,MAAM;MAAEE;IAAY,CAAC,GAAG,IAAI,CAACH,KAAK;IAClC,OAAO,IAAAI,MAAA,CAAAC,aAAA,EAACV,OAAA,CAAAW,OAAM;MAACH,WAAW,EAAGA;IAAa,CAAE,CAAC;EAC9C;EAEAI,MAAMA,CAAA,EAAG;IACR,MAAM;MAAEC;IAAoB,CAAC,GAAG,IAAI,CAACR,KAAK;IAE1C,OACC,IAAAI,MAAA,CAAAC,aAAA,EAACX,YAAA,CAAAe,SAAS;MACTC,MAAM,EAAG,IAAI,CAACT,YAAc;MAC5BO,mBAAmB,EAAGA;IAAqB,CAC3C,CAAC;EAEJ;AACD;AAACG,OAAA,CAAAL,OAAA,GAAAT,YAAA"}
1
+ {"version":3,"names":["_element","require","_blockEditor","_header","_interopRequireDefault","VisualEditor","Component","constructor","props","renderHeader","bind","setTitleRef","_react","createElement","default","render","safeAreaBottomInset","BlockList","header","exports"],"sources":["@wordpress/edit-post/src/components/visual-editor/index.native.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { BlockList } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport Header from './header';\n\nexport default class VisualEditor extends Component {\n\tconstructor( props ) {\n\t\tsuper( props );\n\t\tthis.renderHeader = this.renderHeader.bind( this );\n\t}\n\n\trenderHeader() {\n\t\tconst { setTitleRef } = this.props;\n\t\treturn <Header setTitleRef={ setTitleRef } />;\n\t}\n\n\trender() {\n\t\tconst { safeAreaBottomInset } = this.props;\n\n\t\treturn (\n\t\t\t<BlockList\n\t\t\t\theader={ this.renderHeader }\n\t\t\t\tsafeAreaBottomInset={ safeAreaBottomInset }\n\t\t\t/>\n\t\t);\n\t}\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,QAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,OAAA,GAAAC,sBAAA,CAAAH,OAAA;AATA;AACA;AACA;;AAIA;AACA;AACA;;AAGe,MAAMI,YAAY,SAASC,kBAAS,CAAC;EACnDC,WAAWA,CAAEC,KAAK,EAAG;IACpB,KAAK,CAAEA,KAAM,CAAC;IACd,IAAI,CAACC,YAAY,GAAG,IAAI,CAACA,YAAY,CAACC,IAAI,CAAE,IAAK,CAAC;EACnD;EAEAD,YAAYA,CAAA,EAAG;IACd,MAAM;MAAEE;IAAY,CAAC,GAAG,IAAI,CAACH,KAAK;IAClC,OAAO,IAAAI,MAAA,CAAAC,aAAA,EAACV,OAAA,CAAAW,OAAM;MAACH,WAAW,EAAGA;IAAa,CAAE,CAAC;EAC9C;EAEAI,MAAMA,CAAA,EAAG;IACR,MAAM;MAAEC;IAAoB,CAAC,GAAG,IAAI,CAACR,KAAK;IAE1C,OACC,IAAAI,MAAA,CAAAC,aAAA,EAACX,YAAA,CAAAe,SAAS;MACTC,MAAM,EAAG,IAAI,CAACT,YAAc;MAC5BO,mBAAmB,EAAGA;IAAqB,CAC3C,CAAC;EAEJ;AACD;AAACG,OAAA,CAAAL,OAAA,GAAAT,YAAA","ignoreList":[]}
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.usePaddingAppender = usePaddingAppender;
7
+ var _data = require("@wordpress/data");
8
+ var _compose = require("@wordpress/compose");
9
+ var _blockEditor = require("@wordpress/block-editor");
10
+ var _blocks = require("@wordpress/blocks");
11
+ /**
12
+ * WordPress dependencies
13
+ */
14
+
15
+ function usePaddingAppender() {
16
+ const registry = (0, _data.useRegistry)();
17
+ return (0, _compose.useRefEffect)(node => {
18
+ function onMouseDown(event) {
19
+ if (event.target !== node) {
20
+ return;
21
+ }
22
+ const {
23
+ ownerDocument
24
+ } = node;
25
+ const {
26
+ defaultView
27
+ } = ownerDocument;
28
+ const paddingBottom = defaultView.parseInt(defaultView.getComputedStyle(node).paddingBottom, 10);
29
+ if (!paddingBottom) {
30
+ return;
31
+ }
32
+
33
+ // only handle clicks under the last child
34
+ const lastChild = node.lastElementChild;
35
+ if (!lastChild) {
36
+ return;
37
+ }
38
+ const lastChildRect = lastChild.getBoundingClientRect();
39
+ if (event.clientY < lastChildRect.bottom) {
40
+ return;
41
+ }
42
+ event.preventDefault();
43
+ const blockOrder = registry.select(_blockEditor.store).getBlockOrder('');
44
+ const lastBlockClientId = blockOrder[blockOrder.length - 1];
45
+ const lastBlock = registry.select(_blockEditor.store).getBlock(lastBlockClientId);
46
+ const {
47
+ selectBlock,
48
+ insertDefaultBlock
49
+ } = registry.dispatch(_blockEditor.store);
50
+ if ((0, _blocks.isUnmodifiedDefaultBlock)(lastBlock)) {
51
+ selectBlock(lastBlockClientId);
52
+ } else {
53
+ insertDefaultBlock();
54
+ }
55
+ }
56
+ node.addEventListener('mousedown', onMouseDown);
57
+ return () => {
58
+ node.removeEventListener('mousedown', onMouseDown);
59
+ };
60
+ }, [registry]);
61
+ }
62
+ //# sourceMappingURL=use-padding-appender.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_data","require","_compose","_blockEditor","_blocks","usePaddingAppender","registry","useRegistry","useRefEffect","node","onMouseDown","event","target","ownerDocument","defaultView","paddingBottom","parseInt","getComputedStyle","lastChild","lastElementChild","lastChildRect","getBoundingClientRect","clientY","bottom","preventDefault","blockOrder","select","blockEditorStore","getBlockOrder","lastBlockClientId","length","lastBlock","getBlock","selectBlock","insertDefaultBlock","dispatch","isUnmodifiedDefaultBlock","addEventListener","removeEventListener"],"sources":["@wordpress/edit-post/src/components/visual-editor/use-padding-appender.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRegistry } from '@wordpress/data';\nimport { useRefEffect } from '@wordpress/compose';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\n\nexport function usePaddingAppender() {\n\tconst registry = useRegistry();\n\treturn useRefEffect(\n\t\t( node ) => {\n\t\t\tfunction onMouseDown( event ) {\n\t\t\t\tif ( event.target !== node ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst { ownerDocument } = node;\n\t\t\t\tconst { defaultView } = ownerDocument;\n\n\t\t\t\tconst paddingBottom = defaultView.parseInt(\n\t\t\t\t\tdefaultView.getComputedStyle( node ).paddingBottom,\n\t\t\t\t\t10\n\t\t\t\t);\n\n\t\t\t\tif ( ! paddingBottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\t// only handle clicks under the last child\n\t\t\t\tconst lastChild = node.lastElementChild;\n\t\t\t\tif ( ! lastChild ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tconst lastChildRect = lastChild.getBoundingClientRect();\n\t\t\t\tif ( event.clientY < lastChildRect.bottom ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\n\t\t\t\tevent.preventDefault();\n\n\t\t\t\tconst blockOrder = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlockOrder( '' );\n\t\t\t\tconst lastBlockClientId = blockOrder[ blockOrder.length - 1 ];\n\t\t\t\tconst lastBlock = registry\n\t\t\t\t\t.select( blockEditorStore )\n\t\t\t\t\t.getBlock( lastBlockClientId );\n\t\t\t\tconst { selectBlock, insertDefaultBlock } =\n\t\t\t\t\tregistry.dispatch( blockEditorStore );\n\n\t\t\t\tif ( isUnmodifiedDefaultBlock( lastBlock ) ) {\n\t\t\t\t\tselectBlock( lastBlockClientId );\n\t\t\t\t} else {\n\t\t\t\t\tinsertDefaultBlock();\n\t\t\t\t}\n\t\t\t}\n\t\t\tnode.addEventListener( 'mousedown', onMouseDown );\n\t\t\treturn () => {\n\t\t\t\tnode.removeEventListener( 'mousedown', onMouseDown );\n\t\t\t};\n\t\t},\n\t\t[ registry ]\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,YAAA,GAAAF,OAAA;AACA,IAAAG,OAAA,GAAAH,OAAA;AANA;AACA;AACA;;AAMO,SAASI,kBAAkBA,CAAA,EAAG;EACpC,MAAMC,QAAQ,GAAG,IAAAC,iBAAW,EAAC,CAAC;EAC9B,OAAO,IAAAC,qBAAY,EAChBC,IAAI,IAAM;IACX,SAASC,WAAWA,CAAEC,KAAK,EAAG;MAC7B,IAAKA,KAAK,CAACC,MAAM,KAAKH,IAAI,EAAG;QAC5B;MACD;MAEA,MAAM;QAAEI;MAAc,CAAC,GAAGJ,IAAI;MAC9B,MAAM;QAAEK;MAAY,CAAC,GAAGD,aAAa;MAErC,MAAME,aAAa,GAAGD,WAAW,CAACE,QAAQ,CACzCF,WAAW,CAACG,gBAAgB,CAAER,IAAK,CAAC,CAACM,aAAa,EAClD,EACD,CAAC;MAED,IAAK,CAAEA,aAAa,EAAG;QACtB;MACD;;MAEA;MACA,MAAMG,SAAS,GAAGT,IAAI,CAACU,gBAAgB;MACvC,IAAK,CAAED,SAAS,EAAG;QAClB;MACD;MAEA,MAAME,aAAa,GAAGF,SAAS,CAACG,qBAAqB,CAAC,CAAC;MACvD,IAAKV,KAAK,CAACW,OAAO,GAAGF,aAAa,CAACG,MAAM,EAAG;QAC3C;MACD;MAEAZ,KAAK,CAACa,cAAc,CAAC,CAAC;MAEtB,MAAMC,UAAU,GAAGnB,QAAQ,CACzBoB,MAAM,CAAEC,kBAAiB,CAAC,CAC1BC,aAAa,CAAE,EAAG,CAAC;MACrB,MAAMC,iBAAiB,GAAGJ,UAAU,CAAEA,UAAU,CAACK,MAAM,GAAG,CAAC,CAAE;MAC7D,MAAMC,SAAS,GAAGzB,QAAQ,CACxBoB,MAAM,CAAEC,kBAAiB,CAAC,CAC1BK,QAAQ,CAAEH,iBAAkB,CAAC;MAC/B,MAAM;QAAEI,WAAW;QAAEC;MAAmB,CAAC,GACxC5B,QAAQ,CAAC6B,QAAQ,CAAER,kBAAiB,CAAC;MAEtC,IAAK,IAAAS,gCAAwB,EAAEL,SAAU,CAAC,EAAG;QAC5CE,WAAW,CAAEJ,iBAAkB,CAAC;MACjC,CAAC,MAAM;QACNK,kBAAkB,CAAC,CAAC;MACrB;IACD;IACAzB,IAAI,CAAC4B,gBAAgB,CAAE,WAAW,EAAE3B,WAAY,CAAC;IACjD,OAAO,MAAM;MACZD,IAAI,CAAC6B,mBAAmB,CAAE,WAAW,EAAE5B,WAAY,CAAC;IACrD,CAAC;EACF,CAAC,EACD,CAAEJ,QAAQ,CACX,CAAC;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_element","_image","_interopRequireDefault","_store","WelcomeGuideDefault","toggleFeature","useDispatch","editPostStore","_react","createElement","Guide","className","contentLabel","__","finishButtonText","onFinish","pages","image","default","nonAnimatedSrc","animatedSrc","content","Fragment","createInterpolateElement","InserterIconImage","alt","src","ExternalLink","href"],"sources":["@wordpress/edit-post/src/components/welcome-guide/default.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideDefault() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-post-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the block editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Make each block your own' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Get to know the block library' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn how to use the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to the block editor? Want to learn more about using it? '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{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,QAAA,QACC,IAAAd,MAAA,CAAAC,aAAA;QAAIE,SAAS,EAAC;MAAkC,GAC7C,IAAAE,QAAE,EAAE,mCAAoC,CACvC,CAAC,EACL,IAAAL,MAAA,CAAAC,aAAA;QAAGE,SAAS,EAAC;MAA+B,GACzC,IAAAE,QAAE,EACH,8DACD,CAAC,EACD,IAAAL,MAAA,CAAAC,aAAA,EAACX,WAAA,CAAA6B,YAAY;QACZC,IAAI,EAAG,IAAAf,QAAE,EACR,qEACD;MAAG,GAED,IAAAA,QAAE,EAAE,0BAA2B,CACpB,CACZ,CACF;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ"}
1
+ {"version":3,"names":["_data","require","_components","_i18n","_element","_image","_interopRequireDefault","_store","WelcomeGuideDefault","toggleFeature","useDispatch","editPostStore","_react","createElement","Guide","className","contentLabel","__","finishButtonText","onFinish","pages","image","default","nonAnimatedSrc","animatedSrc","content","Fragment","createInterpolateElement","InserterIconImage","alt","src","ExternalLink","href"],"sources":["@wordpress/edit-post/src/components/welcome-guide/default.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { ExternalLink, Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideDefault() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-post-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the block editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuide' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-canvas.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'In the WordPress editor, each paragraph, image, or video is presented as a distinct “block” of content.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Make each block your own' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Each block comes with its own set of controls for changing things like color, width, and alignment. These will show and hide automatically when you have a block selected.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-library.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Get to know the block library' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ createInterpolateElement(\n\t\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t\t'All of the blocks available to you live in the block library. You’ll find it wherever you see the <InserterIconImage /> icon.'\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tInserterIconImage: (\n\t\t\t\t\t\t\t\t\t\t\t<img\n\t\t\t\t\t\t\t\t\t\t\t\talt={ __( 'inserter' ) }\n\t\t\t\t\t\t\t\t\t\t\t\tsrc=\"data:image/svg+xml,%3Csvg width='18' height='18' viewBox='0 0 18 18' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='18' height='18' rx='2' fill='%231E1E1E'/%3E%3Cpath d='M9.22727 4V14M4 8.77273H14' stroke='white' stroke-width='1.5'/%3E%3C/svg%3E%0A\"\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-documentation.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Learn how to use the block editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'New to the block editor? Want to learn more about using it? '\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t{ __( \"Here's a detailed guide.\" ) }\n\t\t\t\t\t\t\t\t</ExternalLink>\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,QAAA,GAAAH,OAAA;AAKA,IAAAI,MAAA,GAAAC,sBAAA,CAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AAZA;AACA;AACA;;AAMA;AACA;AACA;;AAIe,SAASO,mBAAmBA,CAAA,EAAG;EAC7C,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAc,CAAC;EAEtD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACX,WAAA,CAAAY,KAAK;IACLC,SAAS,EAAC,yBAAyB;IACnCC,YAAY,EAAG,IAAAC,QAAE,EAAE,6BAA8B,CAAG;IACpDC,gBAAgB,EAAG,IAAAD,QAAE,EAAE,aAAc,CAAG;IACxCE,QAAQ,E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C,EACL,IAAAL,MAAA,CAAAC,aAAA;QAAGE,SAAS,EAAC;MAA+B,GACzC,IAAAY,iCAAwB,EACzB,IAAAV,QAAE,EACD,+HACD,CAAC,EACD;QACCW,iBAAiB,EAChB,IAAAhB,MAAA,CAAAC,aAAA;UACCgB,GAAG,EAAG,IAAAZ,QAAE,EAAE,UAAW,CAAG;UACxBa,GAAG,EAAC;QAA2Q,CAC/Q;MAEH,CACD,CACE,CACF;IAEJ,CAAC,EACD;MACCT,KAAK,EACJ,IAAAT,MAAA,CAAAC,aAAA,EAACR,MAAA,CAAAiB,OAAiB;QACjBC,cAAc,EAAC,+DAA+D;QAC9EC,WAAW,EAAC;MAA+D,CAC3E,CACD;MACDC,OAAO,EACN,IAAAb,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAc,QAAA,QACC,IAAAd,MAAA,CAAAC,aAAA;QAAIE,SAAS,EAAC;MAAkC,GAC7C,IAAAE,QAAE,EAAE,mCAAoC,CACvC,CAAC,EACL,IAAAL,MAAA,CAAAC,aAAA;QAAGE,SAAS,EAAC;MAA+B,GACzC,IAAAE,QAAE,EACH,8DACD,CAAC,EACD,IAAAL,MAAA,CAAAC,aAAA,EAACX,WAAA,CAAA6B,YAAY;QACZC,IAAI,EAAG,IAAAf,QAAE,EACR,qEACD;MAAG,GAED,IAAAA,QAAE,EAAE,0BAA2B,CACpB,CACZ,CACF;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["WelcomeGuideImage","nonAnimatedSrc","animatedSrc","_react","createElement","className","srcSet","media","src","width","height","alt"],"sources":["@wordpress/edit-post/src/components/welcome-guide/image.js"],"sourcesContent":["export default function WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-post-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":";;;;;;;AAAe,SAASA,iBAAiBA,CAAE;EAAEC,cAAc;EAAEC;AAAY,CAAC,EAAG;EAC5E,OACC,IAAAC,MAAA,CAAAC,aAAA;IAASC,SAAS,EAAC;EAAgC,GAClD,IAAAF,MAAA,CAAAC,aAAA;IACCE,MAAM,EAAGL,cAAgB;IACzBM,KAAK,EAAC;EAAkC,CACxC,CAAC,EACF,IAAAJ,MAAA,CAAAC,aAAA;IAAKI,GAAG,EAAGN,WAAa;IAACO,KAAK,EAAC,KAAK;IAACC,MAAM,EAAC,KAAK;IAACC,GAAG,EAAC;EAAE,CAAE,CAClD,CAAC;AAEZ"}
1
+ {"version":3,"names":["WelcomeGuideImage","nonAnimatedSrc","animatedSrc","_react","createElement","className","srcSet","media","src","width","height","alt"],"sources":["@wordpress/edit-post/src/components/welcome-guide/image.js"],"sourcesContent":["export default function WelcomeGuideImage( { nonAnimatedSrc, animatedSrc } ) {\n\treturn (\n\t\t<picture className=\"edit-post-welcome-guide__image\">\n\t\t\t<source\n\t\t\t\tsrcSet={ nonAnimatedSrc }\n\t\t\t\tmedia=\"(prefers-reduced-motion: reduce)\"\n\t\t\t/>\n\t\t\t<img src={ animatedSrc } width=\"312\" height=\"240\" alt=\"\" />\n\t\t</picture>\n\t);\n}\n"],"mappings":";;;;;;;AAAe,SAASA,iBAAiBA,CAAE;EAAEC,cAAc;EAAEC;AAAY,CAAC,EAAG;EAC5E,OACC,IAAAC,MAAA,CAAAC,aAAA;IAASC,SAAS,EAAC;EAAgC,GAClD,IAAAF,MAAA,CAAAC,aAAA;IACCE,MAAM,EAAGL,cAAgB;IACzBM,KAAK,EAAC;EAAkC,CACxC,CAAC,EACF,IAAAJ,MAAA,CAAAC,aAAA;IAAKI,GAAG,EAAGN,WAAa;IAACO,KAAK,EAAC,KAAK;IAACC,MAAM,EAAC,KAAK;IAACC,GAAG,EAAC;EAAE,CAAE,CAClD,CAAC;AAEZ","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_editor","_default","_interopRequireDefault","_template","_store","WelcomeGuide","isActive","isEditingTemplate","useSelect","select","isFeatureActive","editPostStore","getCurrentPostType","editorStore","_isEditingTemplate","feature","_react","createElement","default"],"sources":["@wordpress/edit-post/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideDefault from './default';\nimport WelcomeGuideTemplate from './template';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuide() {\n\tconst { isActive, isEditingTemplate } = useSelect( ( select ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\tconst _isEditingTemplate = getCurrentPostType() === 'wp_template';\n\n\t\tconst feature = _isEditingTemplate\n\t\t\t? 'welcomeGuideTemplate'\n\t\t\t: 'welcomeGuide';\n\n\t\treturn {\n\t\t\tisActive: isFeatureActive( feature ),\n\t\t\tisEditingTemplate: _isEditingTemplate,\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn isEditingTemplate ? (\n\t\t<WelcomeGuideTemplate />\n\t) : (\n\t\t<WelcomeGuideDefault />\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAIA;AACA;AACA;;AAKe,SAASM,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC,QAAQ;IAAEC;EAAkB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAChE,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,YAAc,CAAC;IACnD,MAAM;MAAEC;IAAmB,CAAC,GAAGH,MAAM,CAAEI,aAAY,CAAC;IACpD,MAAMC,kBAAkB,GAAGF,kBAAkB,CAAC,CAAC,KAAK,aAAa;IAEjE,MAAMG,OAAO,GAAGD,kBAAkB,GAC/B,sBAAsB,GACtB,cAAc;IAEjB,OAAO;MACNR,QAAQ,EAAEI,eAAe,CAAEK,OAAQ,CAAC;MACpCR,iBAAiB,EAAEO;IACpB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAER,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OAAOC,iBAAiB,GACvB,IAAAS,MAAA,CAAAC,aAAA,EAACd,SAAA,CAAAe,OAAoB,MAAE,CAAC,GAExB,IAAAF,MAAA,CAAAC,aAAA,EAAChB,QAAA,CAAAiB,OAAmB,MAAE,CACtB;AACF"}
1
+ {"version":3,"names":["_data","require","_editor","_default","_interopRequireDefault","_template","_store","WelcomeGuide","isActive","isEditingTemplate","useSelect","select","isFeatureActive","editPostStore","getCurrentPostType","editorStore","_isEditingTemplate","feature","_react","createElement","default"],"sources":["@wordpress/edit-post/src/components/welcome-guide/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideDefault from './default';\nimport WelcomeGuideTemplate from './template';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuide() {\n\tconst { isActive, isEditingTemplate } = useSelect( ( select ) => {\n\t\tconst { isFeatureActive } = select( editPostStore );\n\t\tconst { getCurrentPostType } = select( editorStore );\n\t\tconst _isEditingTemplate = getCurrentPostType() === 'wp_template';\n\n\t\tconst feature = _isEditingTemplate\n\t\t\t? 'welcomeGuideTemplate'\n\t\t\t: 'welcomeGuide';\n\n\t\treturn {\n\t\t\tisActive: isFeatureActive( feature ),\n\t\t\tisEditingTemplate: _isEditingTemplate,\n\t\t};\n\t}, [] );\n\n\tif ( ! isActive ) {\n\t\treturn null;\n\t}\n\n\treturn isEditingTemplate ? (\n\t\t<WelcomeGuideTemplate />\n\t) : (\n\t\t<WelcomeGuideDefault />\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAIA;AACA;AACA;;AAKe,SAASM,YAAYA,CAAA,EAAG;EACtC,MAAM;IAAEC,QAAQ;IAAEC;EAAkB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IAChE,MAAM;MAAEC;IAAgB,CAAC,GAAGD,MAAM,CAAEE,YAAc,CAAC;IACnD,MAAM;MAAEC;IAAmB,CAAC,GAAGH,MAAM,CAAEI,aAAY,CAAC;IACpD,MAAMC,kBAAkB,GAAGF,kBAAkB,CAAC,CAAC,KAAK,aAAa;IAEjE,MAAMG,OAAO,GAAGD,kBAAkB,GAC/B,sBAAsB,GACtB,cAAc;IAEjB,OAAO;MACNR,QAAQ,EAAEI,eAAe,CAAEK,OAAQ,CAAC;MACpCR,iBAAiB,EAAEO;IACpB,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,IAAK,CAAER,QAAQ,EAAG;IACjB,OAAO,IAAI;EACZ;EAEA,OAAOC,iBAAiB,GACvB,IAAAS,MAAA,CAAAC,aAAA,EAACd,SAAA,CAAAe,OAAoB,MAAE,CAAC,GAExB,IAAAF,MAAA,CAAAC,aAAA,EAAChB,QAAA,CAAAiB,OAAmB,MAAE,CACtB;AACF","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_components","_i18n","_image","_interopRequireDefault","_store","WelcomeGuideTemplate","toggleFeature","useDispatch","editPostStore","_react","createElement","Guide","className","contentLabel","__","finishButtonText","onFinish","pages","image","default","nonAnimatedSrc","animatedSrc","content","Fragment"],"sources":["@wordpress/edit-post/src/components/welcome-guide/template.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-template-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the template editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuideTemplate' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the template editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIe,SAASM,oBAAoBA,CAAA,EAAG;EAC9C,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAc,CAAC;EAEtD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAW,KAAK;IACLC,SAAS,EAAC,6BAA6B;IACvCC,YAAY,EAAG,IAAAC,QAAE,EAAE,gCAAiC,CAAG;IACvDC,gBAAgB,EAAG,IAAAD,QAAE,EAAE,aAAc,CAAG;IACxCE,QAAQ,EAAGA,CAAA,KAAMV,aAAa,CAAE,sBAAuB,CAAG;IAC1DW,KAAK,EAAG,CACP;MACCC,KAAK,EACJ,IAAAT,MAAA,CAAAC,aAAA,EAACR,MAAA,CAAAiB,OAAiB;QACjBC,cAAc,EAAC,iEAAiE;QAChFC,WAAW,EAAC;MAAiE,CAC7E,CACD;MACDC,OAAO,EACN,IAAAb,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAc,QAAA,QACC,IAAAd,MAAA,CAAAC,aAAA;QAAIE,SAAS,EAAC;MAAkC,GAC7C,IAAAE,QAAE,EAAE,gCAAiC,CACpC,CAAC,EACL,IAAAL,MAAA,CAAAC,aAAA;QAAGE,SAAS,EAAC;MAA+B,GACzC,IAAAE,QAAE,EACH,+IACD,CACE,CACF;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ"}
1
+ {"version":3,"names":["_data","require","_components","_i18n","_image","_interopRequireDefault","_store","WelcomeGuideTemplate","toggleFeature","useDispatch","editPostStore","_react","createElement","Guide","className","contentLabel","__","finishButtonText","onFinish","pages","image","default","nonAnimatedSrc","animatedSrc","content","Fragment"],"sources":["@wordpress/edit-post/src/components/welcome-guide/template.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useDispatch } from '@wordpress/data';\nimport { Guide } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport WelcomeGuideImage from './image';\nimport { store as editPostStore } from '../../store';\n\nexport default function WelcomeGuideTemplate() {\n\tconst { toggleFeature } = useDispatch( editPostStore );\n\n\treturn (\n\t\t<Guide\n\t\t\tclassName=\"edit-template-welcome-guide\"\n\t\t\tcontentLabel={ __( 'Welcome to the template editor' ) }\n\t\t\tfinishButtonText={ __( 'Get started' ) }\n\t\t\tonFinish={ () => toggleFeature( 'welcomeGuideTemplate' ) }\n\t\t\tpages={ [\n\t\t\t\t{\n\t\t\t\t\timage: (\n\t\t\t\t\t\t<WelcomeGuideImage\n\t\t\t\t\t\t\tnonAnimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.svg\"\n\t\t\t\t\t\t\tanimatedSrc=\"https://s.w.org/images/block-editor/welcome-template-editor.gif\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t),\n\t\t\t\t\tcontent: (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<h1 className=\"edit-post-welcome-guide__heading\">\n\t\t\t\t\t\t\t\t{ __( 'Welcome to the template editor' ) }\n\t\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t\t<p className=\"edit-post-welcome-guide__text\">\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Templates help define the layout of the site. You can customize all aspects of your posts and pages using blocks and patterns in this editor.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</p>\n\t\t\t\t\t\t</>\n\t\t\t\t\t),\n\t\t\t\t},\n\t\t\t] }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AAKA,IAAAG,MAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AAXA;AACA;AACA;;AAKA;AACA;AACA;;AAIe,SAASM,oBAAoBA,CAAA,EAAG;EAC9C,MAAM;IAAEC;EAAc,CAAC,GAAG,IAAAC,iBAAW,EAAEC,YAAc,CAAC;EAEtD,OACC,IAAAC,MAAA,CAAAC,aAAA,EAACV,WAAA,CAAAW,KAAK;IACLC,SAAS,EAAC,6BAA6B;IACvCC,YAAY,EAAG,IAAAC,QAAE,EAAE,gCAAiC,CAAG;IACvDC,gBAAgB,EAAG,IAAAD,QAAE,EAAE,aAAc,CAAG;IACxCE,QAAQ,EAAGA,CAAA,KAAMV,aAAa,CAAE,sBAAuB,CAAG;IAC1DW,KAAK,EAAG,CACP;MACCC,KAAK,EACJ,IAAAT,MAAA,CAAAC,aAAA,EAACR,MAAA,CAAAiB,OAAiB;QACjBC,cAAc,EAAC,iEAAiE;QAChFC,WAAW,EAAC;MAAiE,CAC7E,CACD;MACDC,OAAO,EACN,IAAAb,MAAA,CAAAC,aAAA,EAAAD,MAAA,CAAAc,QAAA,QACC,IAAAd,MAAA,CAAAC,aAAA;QAAIE,SAAS,EAAC;MAAkC,GAC7C,IAAAE,QAAE,EAAE,gCAAiC,CACpC,CAAC,EACL,IAAAL,MAAA,CAAAC,aAAA;QAAGE,SAAS,EAAC;MAA+B,GACzC,IAAAE,QAAE,EACH,+IACD,CACE,CACF;IAEJ,CAAC;EACC,CACH,CAAC;AAEJ","ignoreList":[]}