@wordpress/edit-post 7.11.0 → 7.12.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 (283) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-manager/category.js +14 -22
  3. package/build/components/block-manager/category.js.map +1 -1
  4. package/build/components/block-manager/checklist.js +6 -13
  5. package/build/components/block-manager/checklist.js.map +1 -1
  6. package/build/components/block-manager/index.js +10 -14
  7. package/build/components/block-manager/index.js.map +1 -1
  8. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  9. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  10. package/build/components/device-preview/index.js +1 -1
  11. package/build/components/device-preview/index.js.map +1 -1
  12. package/build/components/editor-initialization/index.js +3 -4
  13. package/build/components/editor-initialization/index.js.map +1 -1
  14. package/build/components/header/document-title/index.js +103 -0
  15. package/build/components/header/document-title/index.js.map +1 -0
  16. package/build/components/header/fullscreen-mode-close/index.js +8 -9
  17. package/build/components/header/fullscreen-mode-close/index.js.map +1 -1
  18. package/build/components/header/header-toolbar/index.native.js +12 -13
  19. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  20. package/build/components/header/index.js +7 -6
  21. package/build/components/header/index.js.map +1 -1
  22. package/build/components/header/main-dashboard-button/index.js +3 -4
  23. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  24. package/build/components/header/more-menu/index.js +19 -23
  25. package/build/components/header/more-menu/index.js.map +1 -1
  26. package/build/components/header/post-publish-button-or-toggle.js +15 -16
  27. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  28. package/build/components/header/tools-more-menu-group/index.js +7 -10
  29. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  30. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  31. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  32. package/build/components/keyboard-shortcut-help-modal/index.js +44 -54
  33. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  34. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  35. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  36. package/build/components/layout/actions-panel.js +5 -6
  37. package/build/components/layout/actions-panel.js.map +1 -1
  38. package/build/components/layout/index.js +3 -4
  39. package/build/components/layout/index.js.map +1 -1
  40. package/build/components/layout/index.native.js +3 -7
  41. package/build/components/layout/index.native.js.map +1 -1
  42. package/build/components/meta-boxes/index.js +9 -13
  43. package/build/components/meta-boxes/index.js.map +1 -1
  44. package/build/components/meta-boxes/meta-box-visibility.js +5 -8
  45. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  46. package/build/components/meta-boxes/meta-boxes-area/index.js +3 -4
  47. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  48. package/build/components/preferences-modal/meta-boxes-section.js +16 -23
  49. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  50. package/build/components/preferences-modal/options/enable-custom-fields.js +7 -9
  51. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  52. package/build/components/preferences-modal/options/enable-feature.js +12 -16
  53. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  54. package/build/components/preferences-modal/options/enable-panel.js +10 -17
  55. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  56. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  57. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  58. package/build/components/secondary-sidebar/list-view-sidebar.js +58 -44
  59. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  60. package/build/components/sidebar/discussion-panel/index.js +5 -7
  61. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  62. package/build/components/sidebar/featured-image/index.js +9 -17
  63. package/build/components/sidebar/featured-image/index.js.map +1 -1
  64. package/build/components/sidebar/page-attributes/index.js +3 -9
  65. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  66. package/build/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  67. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  68. package/build/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  69. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  70. package/build/components/sidebar/plugin-post-status-info/index.js +6 -9
  71. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  72. package/build/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  73. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  74. package/build/components/sidebar/plugin-sidebar/index.js +4 -5
  75. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  76. package/build/components/sidebar/post-excerpt/index.js +5 -7
  77. package/build/components/sidebar/post-excerpt/index.js.map +1 -1
  78. package/build/components/sidebar/post-schedule/index.js +16 -23
  79. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  80. package/build/components/sidebar/post-status/index.js +7 -11
  81. package/build/components/sidebar/post-status/index.js.map +1 -1
  82. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  83. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  84. package/build/components/sidebar/post-template/create-modal.js +3 -4
  85. package/build/components/sidebar/post-template/create-modal.js.map +1 -1
  86. package/build/components/sidebar/post-template/form.js +13 -20
  87. package/build/components/sidebar/post-template/form.js.map +1 -1
  88. package/build/components/sidebar/post-template/index.js +18 -25
  89. package/build/components/sidebar/post-template/index.js.map +1 -1
  90. package/build/components/sidebar/post-url/index.js +16 -23
  91. package/build/components/sidebar/post-url/index.js.map +1 -1
  92. package/build/components/sidebar/post-visibility/index.js +26 -36
  93. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  94. package/build/components/sidebar/settings-header/index.js +3 -4
  95. package/build/components/sidebar/settings-header/index.js.map +1 -1
  96. package/build/components/sidebar/template-summary/index.js +1 -1
  97. package/build/components/sidebar/template-summary/index.js.map +1 -1
  98. package/build/components/start-page-options/index.js +3 -4
  99. package/build/components/start-page-options/index.js.map +1 -1
  100. package/build/components/view-link/index.js +1 -1
  101. package/build/components/view-link/index.js.map +1 -1
  102. package/build/components/visual-editor/block-inspector-button.js +4 -5
  103. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  104. package/build/components/visual-editor/header.native.js +6 -7
  105. package/build/components/visual-editor/header.native.js.map +1 -1
  106. package/build/components/visual-editor/index.js +32 -48
  107. package/build/components/visual-editor/index.js.map +1 -1
  108. package/build/components/welcome-guide/image.js +4 -5
  109. package/build/components/welcome-guide/image.js.map +1 -1
  110. package/build/editor.js +14 -20
  111. package/build/editor.js.map +1 -1
  112. package/build/editor.native.js +3 -6
  113. package/build/editor.native.js.map +1 -1
  114. package/build/hooks/validate-multiple-use/index.js +18 -29
  115. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  116. package/build/plugins/index.js +20 -23
  117. package/build/plugins/index.js.map +1 -1
  118. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  119. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  120. package/build/store/actions.js +60 -88
  121. package/build/store/actions.js.map +1 -1
  122. package/build/store/reducer.js +11 -43
  123. package/build/store/reducer.js.map +1 -1
  124. package/build/store/selectors.js +11 -16
  125. package/build/store/selectors.js.map +1 -1
  126. package/build-module/components/block-manager/category.js +14 -22
  127. package/build-module/components/block-manager/category.js.map +1 -1
  128. package/build-module/components/block-manager/checklist.js +6 -13
  129. package/build-module/components/block-manager/checklist.js.map +1 -1
  130. package/build-module/components/block-manager/index.js +10 -14
  131. package/build-module/components/block-manager/index.js.map +1 -1
  132. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  133. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  134. package/build-module/components/device-preview/index.js +1 -1
  135. package/build-module/components/device-preview/index.js.map +1 -1
  136. package/build-module/components/editor-initialization/index.js +3 -4
  137. package/build-module/components/editor-initialization/index.js.map +1 -1
  138. package/build-module/components/header/document-title/index.js +88 -0
  139. package/build-module/components/header/document-title/index.js.map +1 -0
  140. package/build-module/components/header/fullscreen-mode-close/index.js +7 -8
  141. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  142. package/build-module/components/header/header-toolbar/index.native.js +12 -13
  143. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  144. package/build-module/components/header/index.js +7 -6
  145. package/build-module/components/header/index.js.map +1 -1
  146. package/build-module/components/header/main-dashboard-button/index.js +3 -4
  147. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  148. package/build-module/components/header/more-menu/index.js +19 -23
  149. package/build-module/components/header/more-menu/index.js.map +1 -1
  150. package/build-module/components/header/post-publish-button-or-toggle.js +15 -16
  151. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  152. package/build-module/components/header/tools-more-menu-group/index.js +7 -10
  153. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  154. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  155. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  156. package/build-module/components/keyboard-shortcut-help-modal/index.js +42 -52
  157. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  158. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  159. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  160. package/build-module/components/layout/actions-panel.js +5 -6
  161. package/build-module/components/layout/actions-panel.js.map +1 -1
  162. package/build-module/components/layout/index.js +3 -4
  163. package/build-module/components/layout/index.js.map +1 -1
  164. package/build-module/components/layout/index.native.js +3 -7
  165. package/build-module/components/layout/index.native.js.map +1 -1
  166. package/build-module/components/meta-boxes/index.js +9 -13
  167. package/build-module/components/meta-boxes/index.js.map +1 -1
  168. package/build-module/components/meta-boxes/meta-box-visibility.js +5 -8
  169. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  170. package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -4
  171. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  172. package/build-module/components/preferences-modal/meta-boxes-section.js +16 -23
  173. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  174. package/build-module/components/preferences-modal/options/enable-custom-fields.js +7 -9
  175. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  176. package/build-module/components/preferences-modal/options/enable-feature.js +12 -16
  177. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  178. package/build-module/components/preferences-modal/options/enable-panel.js +10 -17
  179. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  180. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  181. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  182. package/build-module/components/secondary-sidebar/list-view-sidebar.js +58 -44
  183. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  184. package/build-module/components/sidebar/discussion-panel/index.js +5 -7
  185. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  186. package/build-module/components/sidebar/featured-image/index.js +9 -17
  187. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  188. package/build-module/components/sidebar/page-attributes/index.js +3 -9
  189. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  190. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  191. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  192. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  193. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  194. package/build-module/components/sidebar/plugin-post-status-info/index.js +6 -9
  195. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  196. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  197. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  198. package/build-module/components/sidebar/plugin-sidebar/index.js +4 -5
  199. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  200. package/build-module/components/sidebar/post-excerpt/index.js +5 -7
  201. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  202. package/build-module/components/sidebar/post-schedule/index.js +16 -23
  203. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  204. package/build-module/components/sidebar/post-status/index.js +7 -11
  205. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  206. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  207. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  208. package/build-module/components/sidebar/post-template/create-modal.js +3 -4
  209. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
  210. package/build-module/components/sidebar/post-template/form.js +13 -20
  211. package/build-module/components/sidebar/post-template/form.js.map +1 -1
  212. package/build-module/components/sidebar/post-template/index.js +18 -25
  213. package/build-module/components/sidebar/post-template/index.js.map +1 -1
  214. package/build-module/components/sidebar/post-url/index.js +16 -23
  215. package/build-module/components/sidebar/post-url/index.js.map +1 -1
  216. package/build-module/components/sidebar/post-visibility/index.js +26 -36
  217. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  218. package/build-module/components/sidebar/settings-header/index.js +3 -4
  219. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  220. package/build-module/components/sidebar/template-summary/index.js +1 -1
  221. package/build-module/components/sidebar/template-summary/index.js.map +1 -1
  222. package/build-module/components/start-page-options/index.js +3 -4
  223. package/build-module/components/start-page-options/index.js.map +1 -1
  224. package/build-module/components/view-link/index.js +1 -1
  225. package/build-module/components/view-link/index.js.map +1 -1
  226. package/build-module/components/visual-editor/block-inspector-button.js +4 -5
  227. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  228. package/build-module/components/visual-editor/header.native.js +6 -7
  229. package/build-module/components/visual-editor/header.native.js.map +1 -1
  230. package/build-module/components/visual-editor/index.js +35 -49
  231. package/build-module/components/visual-editor/index.js.map +1 -1
  232. package/build-module/components/welcome-guide/image.js +4 -5
  233. package/build-module/components/welcome-guide/image.js.map +1 -1
  234. package/build-module/editor.js +14 -20
  235. package/build-module/editor.js.map +1 -1
  236. package/build-module/editor.native.js +3 -6
  237. package/build-module/editor.native.js.map +1 -1
  238. package/build-module/hooks/validate-multiple-use/index.js +18 -29
  239. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  240. package/build-module/plugins/index.js +20 -23
  241. package/build-module/plugins/index.js.map +1 -1
  242. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  243. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  244. package/build-module/store/actions.js +60 -88
  245. package/build-module/store/actions.js.map +1 -1
  246. package/build-module/store/reducer.js +11 -43
  247. package/build-module/store/reducer.js.map +1 -1
  248. package/build-module/store/selectors.js +11 -16
  249. package/build-module/store/selectors.js.map +1 -1
  250. package/build-style/style-rtl.css +63 -101
  251. package/build-style/style.css +63 -101
  252. package/package.json +32 -32
  253. package/src/components/header/document-title/index.js +86 -0
  254. package/src/components/header/document-title/style.scss +61 -0
  255. package/src/components/header/header-toolbar/style.scss +0 -1
  256. package/src/components/header/index.js +4 -2
  257. package/src/components/header/style.scss +6 -0
  258. package/src/components/secondary-sidebar/list-view-sidebar.js +68 -66
  259. package/src/components/secondary-sidebar/style.scss +28 -31
  260. package/src/components/visual-editor/index.js +10 -21
  261. package/src/components/visual-editor/style.scss +0 -13
  262. package/src/style.scss +1 -1
  263. package/build/components/header/template-title/delete-template.js +0 -117
  264. package/build/components/header/template-title/delete-template.js.map +0 -1
  265. package/build/components/header/template-title/edit-template-title.js +0 -95
  266. package/build/components/header/template-title/edit-template-title.js.map +0 -1
  267. package/build/components/header/template-title/index.js +0 -124
  268. package/build/components/header/template-title/index.js.map +0 -1
  269. package/build/components/header/template-title/template-description.js +0 -55
  270. package/build/components/header/template-title/template-description.js.map +0 -1
  271. package/build-module/components/header/template-title/delete-template.js +0 -104
  272. package/build-module/components/header/template-title/delete-template.js.map +0 -1
  273. package/build-module/components/header/template-title/edit-template-title.js +0 -83
  274. package/build-module/components/header/template-title/edit-template-title.js.map +0 -1
  275. package/build-module/components/header/template-title/index.js +0 -105
  276. package/build-module/components/header/template-title/index.js.map +0 -1
  277. package/build-module/components/header/template-title/template-description.js +0 -45
  278. package/build-module/components/header/template-title/template-description.js.map +0 -1
  279. package/src/components/header/template-title/delete-template.js +0 -106
  280. package/src/components/header/template-title/edit-template-title.js +0 -78
  281. package/src/components/header/template-title/index.js +0 -115
  282. package/src/components/header/template-title/style.scss +0 -94
  283. package/src/components/header/template-title/template-description.js +0 -42
@@ -33,32 +33,25 @@ function PostURL() {
33
33
  className: "edit-post-post-url__dropdown",
34
34
  contentClassName: "edit-post-post-url__dialog",
35
35
  focusOnMount: true,
36
- renderToggle: _ref => {
37
- let {
38
- isOpen,
39
- onToggle
40
- } = _ref;
41
- return (0, _element.createElement)(PostURLToggle, {
42
- isOpen: isOpen,
43
- onClick: onToggle
44
- });
45
- },
46
- renderContent: _ref2 => {
47
- let {
48
- onClose
49
- } = _ref2;
50
- return (0, _element.createElement)(_editor.PostURL, {
51
- onClose: onClose
52
- });
53
- }
36
+ renderToggle: ({
37
+ isOpen,
38
+ onToggle
39
+ }) => (0, _element.createElement)(PostURLToggle, {
40
+ isOpen: isOpen,
41
+ onClick: onToggle
42
+ }),
43
+ renderContent: ({
44
+ onClose
45
+ }) => (0, _element.createElement)(_editor.PostURL, {
46
+ onClose: onClose
47
+ })
54
48
  })));
55
49
  }
56
50
 
57
- function PostURLToggle(_ref3) {
58
- let {
59
- isOpen,
60
- onClick
61
- } = _ref3;
51
+ function PostURLToggle({
52
+ isOpen,
53
+ onClick
54
+ }) {
62
55
  const label = (0, _editor.usePostURLLabel)();
63
56
  return (0, _element.createElement)(_components.Button, {
64
57
  className: "edit-post-post-url__toggle",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-url/index.js"],"names":["PostURL","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","isOpen","onToggle","onClose","PostURLToggle","onClick","label"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAUe,SAASA,OAAT,GAAmB;AACjC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHiC,CAIjC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AAAEC,IAAAA,MAAM,EAAEH,aAAV;AAAyBI,IAAAA,SAAS,EAAE;AAApC,GAAR,CADoB,EAEpB,CAAEJ,aAAF,CAFoB,CAArB;AAKA,SACC,4BAAC,oBAAD,QACC,4BAAC,oBAAD;AAAU,IAAA,SAAS,EAAC,oBAApB;AAAyC,IAAA,GAAG,EAAGC;AAA/C,KACC,0CAAQ,cAAI,KAAJ,CAAR,CADD,EAEC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAGC,YADhB;AAEC,IAAA,SAAS,EAAC,8BAFX;AAGC,IAAA,gBAAgB,EAAC,4BAHlB;AAIC,IAAA,YAAY,MAJb;AAKC,IAAA,YAAY,EAAG;AAAA,UAAE;AAAEG,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF;AAAA,aACd,4BAAC,aAAD;AAAe,QAAA,MAAM,EAAGD,MAAxB;AAAiC,QAAA,OAAO,EAAGC;AAA3C,QADc;AAAA,KALhB;AAQC,IAAA,aAAa,EAAG;AAAA,UAAE;AAAEC,QAAAA;AAAF,OAAF;AAAA,aACf,4BAAC,eAAD;AAAa,QAAA,OAAO,EAAGA;AAAvB,QADe;AAAA;AARjB,IAFD,CADD,CADD;AAmBA;;AAED,SAASC,aAAT,QAA8C;AAAA,MAAtB;AAAEH,IAAAA,MAAF;AAAUI,IAAAA;AAAV,GAAsB;AAC7C,QAAMC,KAAK,GAAG,8BAAd;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,qBAAgBL,MAHjB,CAIC;AAJD;AAKC,kBAAa,mBAAS,cAAI,gBAAJ,CAAT,EAAiCK,KAAjC,CALd;AAMC,IAAA,OAAO,EAAGD;AANX,KAQGC,KARH,CADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tPostURLCheck,\n\tPostURL as PostURLForm,\n\tusePostURLLabel,\n} from '@wordpress/editor';\n\nexport default function PostURL() {\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() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PanelRow className=\"edit-post-post-url\" ref={ setPopoverAnchor }>\n\t\t\t\t<span>{ __( 'URL' ) }</span>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"edit-post-post-url__dropdown\"\n\t\t\t\t\tcontentClassName=\"edit-post-post-url__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostURLToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostURLForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst label = usePostURLLabel();\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-url__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post URL.\n\t\t\taria-label={ sprintf( __( 'Change URL: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-url/index.js"],"names":["PostURL","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","isOpen","onToggle","onClose","PostURLToggle","onClick","label"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAUe,SAASA,OAAT,GAAmB;AACjC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHiC,CAIjC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AAAEC,IAAAA,MAAM,EAAEH,aAAV;AAAyBI,IAAAA,SAAS,EAAE;AAApC,GAAR,CADoB,EAEpB,CAAEJ,aAAF,CAFoB,CAArB;AAKA,SACC,4BAAC,oBAAD,QACC,4BAAC,oBAAD;AAAU,IAAA,SAAS,EAAC,oBAApB;AAAyC,IAAA,GAAG,EAAGC;AAA/C,KACC,0CAAQ,cAAI,KAAJ,CAAR,CADD,EAEC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAGC,YADhB;AAEC,IAAA,SAAS,EAAC,8BAFX;AAGC,IAAA,gBAAgB,EAAC,4BAHlB;AAIC,IAAA,YAAY,MAJb;AAKC,IAAA,YAAY,EAAG,CAAE;AAAEG,MAAAA,MAAF;AAAUC,MAAAA;AAAV,KAAF,KACd,4BAAC,aAAD;AAAe,MAAA,MAAM,EAAGD,MAAxB;AAAiC,MAAA,OAAO,EAAGC;AAA3C,MANF;AAQC,IAAA,aAAa,EAAG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACf,4BAAC,eAAD;AAAa,MAAA,OAAO,EAAGA;AAAvB;AATF,IAFD,CADD,CADD;AAmBA;;AAED,SAASC,aAAT,CAAwB;AAAEH,EAAAA,MAAF;AAAUI,EAAAA;AAAV,CAAxB,EAA8C;AAC7C,QAAMC,KAAK,GAAG,8BAAd;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,4BADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,qBAAgBL,MAHjB,CAIC;AAJD;AAKC,kBAAa,mBAAS,cAAI,gBAAJ,CAAT,EAAiCK,KAAjC,CALd;AAMC,IAAA,OAAO,EAAGD;AANX,KAQGC,KARH,CADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, useState } from '@wordpress/element';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tPostURLCheck,\n\tPostURL as PostURLForm,\n\tusePostURLLabel,\n} from '@wordpress/editor';\n\nexport default function PostURL() {\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() => ( { anchor: popoverAnchor, placement: 'bottom-end' } ),\n\t\t[ popoverAnchor ]\n\t);\n\n\treturn (\n\t\t<PostURLCheck>\n\t\t\t<PanelRow className=\"edit-post-post-url\" ref={ setPopoverAnchor }>\n\t\t\t\t<span>{ __( 'URL' ) }</span>\n\t\t\t\t<Dropdown\n\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\tclassName=\"edit-post-post-url__dropdown\"\n\t\t\t\t\tcontentClassName=\"edit-post-post-url__dialog\"\n\t\t\t\t\tfocusOnMount\n\t\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t\t<PostURLToggle isOpen={ isOpen } onClick={ onToggle } />\n\t\t\t\t\t) }\n\t\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t\t<PostURLForm onClose={ onClose } />\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</PanelRow>\n\t\t</PostURLCheck>\n\t);\n}\n\nfunction PostURLToggle( { isOpen, onClick } ) {\n\tconst label = usePostURLLabel();\n\treturn (\n\t\t<Button\n\t\t\tclassName=\"edit-post-post-url__toggle\"\n\t\t\tvariant=\"tertiary\"\n\t\t\taria-expanded={ isOpen }\n\t\t\t// translators: %s: Current post URL.\n\t\t\taria-label={ sprintf( __( 'Change URL: %s' ), label ) }\n\t\t\tonClick={ onClick }\n\t\t>\n\t\t\t{ label }\n\t\t</Button>\n\t);\n}\n"]}
@@ -29,45 +29,35 @@ function PostVisibility() {
29
29
  placement: 'bottom-end'
30
30
  }), [popoverAnchor]);
31
31
  return (0, _element.createElement)(_editor.PostVisibilityCheck, {
32
- render: _ref => {
33
- let {
34
- canEdit
35
- } = _ref;
36
- return (0, _element.createElement)(_components.PanelRow, {
37
- ref: setPopoverAnchor,
38
- className: "edit-post-post-visibility"
39
- }, (0, _element.createElement)("span", null, (0, _i18n.__)('Visibility')), !canEdit && (0, _element.createElement)("span", null, (0, _element.createElement)(_editor.PostVisibilityLabel, null)), canEdit && (0, _element.createElement)(_components.Dropdown, {
40
- contentClassName: "edit-post-post-visibility__dialog",
41
- popoverProps: popoverProps,
42
- focusOnMount: true,
43
- renderToggle: _ref2 => {
44
- let {
45
- isOpen,
46
- onToggle
47
- } = _ref2;
48
- return (0, _element.createElement)(PostVisibilityToggle, {
49
- isOpen: isOpen,
50
- onClick: onToggle
51
- });
52
- },
53
- renderContent: _ref3 => {
54
- let {
55
- onClose
56
- } = _ref3;
57
- return (0, _element.createElement)(_editor.PostVisibility, {
58
- onClose: onClose
59
- });
60
- }
61
- }));
62
- }
32
+ render: ({
33
+ canEdit
34
+ }) => (0, _element.createElement)(_components.PanelRow, {
35
+ ref: setPopoverAnchor,
36
+ className: "edit-post-post-visibility"
37
+ }, (0, _element.createElement)("span", null, (0, _i18n.__)('Visibility')), !canEdit && (0, _element.createElement)("span", null, (0, _element.createElement)(_editor.PostVisibilityLabel, null)), canEdit && (0, _element.createElement)(_components.Dropdown, {
38
+ contentClassName: "edit-post-post-visibility__dialog",
39
+ popoverProps: popoverProps,
40
+ focusOnMount: true,
41
+ renderToggle: ({
42
+ isOpen,
43
+ onToggle
44
+ }) => (0, _element.createElement)(PostVisibilityToggle, {
45
+ isOpen: isOpen,
46
+ onClick: onToggle
47
+ }),
48
+ renderContent: ({
49
+ onClose
50
+ }) => (0, _element.createElement)(_editor.PostVisibility, {
51
+ onClose: onClose
52
+ })
53
+ }))
63
54
  });
64
55
  }
65
56
 
66
- function PostVisibilityToggle(_ref4) {
67
- let {
68
- isOpen,
69
- onClick
70
- } = _ref4;
57
+ function PostVisibilityToggle({
58
+ isOpen,
59
+ onClick
60
+ }) {
71
61
  const label = (0, _editor.usePostVisibilityLabel)();
72
62
  return (0, _element.createElement)(_components.Button, {
73
63
  className: "edit-post-post-visibility__toggle",
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"names":["PostVisibility","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","canEdit","isOpen","onToggle","onClose","PostVisibilityToggle","onClick","label"],"mappings":";;;;;;;;AAWA;;AARA;;AACA;;AACA;;AALA;AACA;AACA;AAWO,SAASA,cAAT,GAA0B;AAChC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHgC,CAIhC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AACP;AACA;AACAC,IAAAA,MAAM,EAAEH,aAHD;AAIPI,IAAAA,SAAS,EAAE;AAJJ,GAAR,CADoB,EAOpB,CAAEJ,aAAF,CAPoB,CAArB;AAUA,SACC,4BAAC,2BAAD;AACC,IAAA,MAAM,EAAG;AAAA,UAAE;AAAEK,QAAAA;AAAF,OAAF;AAAA,aACR,4BAAC,oBAAD;AACC,QAAA,GAAG,EAAGJ,gBADP;AAEC,QAAA,SAAS,EAAC;AAFX,SAIC,0CAAQ,cAAI,YAAJ,CAAR,CAJD,EAKG,CAAEI,OAAF,IACD,0CACC,4BAAC,2BAAD,OADD,CANF,EAUGA,OAAO,IACR,4BAAC,oBAAD;AACC,QAAA,gBAAgB,EAAC,mCADlB;AAEC,QAAA,YAAY,EAAGH,YAFhB;AAGC,QAAA,YAAY,MAHb;AAIC,QAAA,YAAY,EAAG;AAAA,cAAE;AAAEI,YAAAA,MAAF;AAAUC,YAAAA;AAAV,WAAF;AAAA,iBACd,4BAAC,oBAAD;AACC,YAAA,MAAM,EAAGD,MADV;AAEC,YAAA,OAAO,EAAGC;AAFX,YADc;AAAA,SAJhB;AAUC,QAAA,aAAa,EAAG;AAAA,cAAE;AAAEC,YAAAA;AAAF,WAAF;AAAA,iBACf,4BAAC,sBAAD;AAAoB,YAAA,OAAO,EAAGA;AAA9B,YADe;AAAA;AAVjB,QAXF,CADQ;AAAA;AADV,IADD;AAiCA;;AAED,SAASC,oBAAT,QAAqD;AAAA,MAAtB;AAAEH,IAAAA,MAAF;AAAUI,IAAAA;AAAV,GAAsB;AACpD,QAAMC,KAAK,GAAG,qCAAd;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,qBAAgBL,MAHjB,CAIC;AAJD;AAKC,kBAAa,mBAAS,cAAI,uBAAJ,CAAT,EAAwCK,KAAxC,CALd;AAMC,IAAA,OAAO,EAAGD;AANX,KAQGC,KARH,CADD;AAYA;;eAEcZ,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport {\n\tPostVisibility as PostVisibilityForm,\n\tPostVisibilityLabel,\n\tPostVisibilityCheck,\n\tusePostVisibilityLabel,\n} from '@wordpress/editor';\nimport { useMemo, useState } from '@wordpress/element';\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<PanelRow\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\tclassName=\"edit-post-post-visibility\"\n\t\t\t\t>\n\t\t\t\t\t<span>{ __( 'Visibility' ) }</span>\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</PanelRow>\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\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/post-visibility/index.js"],"names":["PostVisibility","popoverAnchor","setPopoverAnchor","popoverProps","anchor","placement","canEdit","isOpen","onToggle","onClose","PostVisibilityToggle","onClick","label"],"mappings":";;;;;;;;AAWA;;AARA;;AACA;;AACA;;AALA;AACA;AACA;AAWO,SAASA,cAAT,GAA0B;AAChC;AACA;AACA,QAAM,CAAEC,aAAF,EAAiBC,gBAAjB,IAAsC,uBAAU,IAAV,CAA5C,CAHgC,CAIhC;;AACA,QAAMC,YAAY,GAAG,sBACpB,OAAQ;AACP;AACA;AACAC,IAAAA,MAAM,EAAEH,aAHD;AAIPI,IAAAA,SAAS,EAAE;AAJJ,GAAR,CADoB,EAOpB,CAAEJ,aAAF,CAPoB,CAArB;AAUA,SACC,4BAAC,2BAAD;AACC,IAAA,MAAM,EAAG,CAAE;AAAEK,MAAAA;AAAF,KAAF,KACR,4BAAC,oBAAD;AACC,MAAA,GAAG,EAAGJ,gBADP;AAEC,MAAA,SAAS,EAAC;AAFX,OAIC,0CAAQ,cAAI,YAAJ,CAAR,CAJD,EAKG,CAAEI,OAAF,IACD,0CACC,4BAAC,2BAAD,OADD,CANF,EAUGA,OAAO,IACR,4BAAC,oBAAD;AACC,MAAA,gBAAgB,EAAC,mCADlB;AAEC,MAAA,YAAY,EAAGH,YAFhB;AAGC,MAAA,YAAY,MAHb;AAIC,MAAA,YAAY,EAAG,CAAE;AAAEI,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAAF,KACd,4BAAC,oBAAD;AACC,QAAA,MAAM,EAAGD,MADV;AAEC,QAAA,OAAO,EAAGC;AAFX,QALF;AAUC,MAAA,aAAa,EAAG,CAAE;AAAEC,QAAAA;AAAF,OAAF,KACf,4BAAC,sBAAD;AAAoB,QAAA,OAAO,EAAGA;AAA9B;AAXF,MAXF;AAFF,IADD;AAiCA;;AAED,SAASC,oBAAT,CAA+B;AAAEH,EAAAA,MAAF;AAAUI,EAAAA;AAAV,CAA/B,EAAqD;AACpD,QAAMC,KAAK,GAAG,qCAAd;AACA,SACC,4BAAC,kBAAD;AACC,IAAA,SAAS,EAAC,mCADX;AAEC,IAAA,OAAO,EAAC,UAFT;AAGC,qBAAgBL,MAHjB,CAIC;AAJD;AAKC,kBAAa,mBAAS,cAAI,uBAAJ,CAAT,EAAwCK,KAAxC,CALd;AAMC,IAAA,OAAO,EAAGD;AANX,KAQGC,KARH,CADD;AAYA;;eAEcZ,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { PanelRow, Dropdown, Button } from '@wordpress/components';\nimport {\n\tPostVisibility as PostVisibilityForm,\n\tPostVisibilityLabel,\n\tPostVisibilityCheck,\n\tusePostVisibilityLabel,\n} from '@wordpress/editor';\nimport { useMemo, useState } from '@wordpress/element';\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<PanelRow\n\t\t\t\t\tref={ setPopoverAnchor }\n\t\t\t\t\tclassName=\"edit-post-post-visibility\"\n\t\t\t\t>\n\t\t\t\t\t<span>{ __( 'Visibility' ) }</span>\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</PanelRow>\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\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"]}
@@ -24,10 +24,9 @@ var _store = require("../../../store");
24
24
  /**
25
25
  * Internal dependencies
26
26
  */
27
- const SettingsHeader = _ref => {
28
- let {
29
- sidebarName
30
- } = _ref;
27
+ const SettingsHeader = ({
28
+ sidebarName
29
+ }) => {
31
30
  const {
32
31
  openGeneralSidebar
33
32
  } = (0, _data.useDispatch)(_store.store);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"names":["SettingsHeader","sidebarName","openGeneralSidebar","editPostStore","openDocumentSettings","openBlockSettings","documentLabel","isTemplateMode","select","postTypeLabel","editorStore","getPostTypeLabel","isEditingTemplate","documentAriaLabel","documentActiveClass","blockAriaLabel","blockActiveClass","templateAriaLabel","templateActiveClass"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,QAAuB;AAAA,MAArB;AAAEC,IAAAA;AAAF,GAAqB;AAC7C,QAAM;AAAEC,IAAAA;AAAF,MAAyB,uBAAaC,YAAb,CAA/B;;AACA,QAAMC,oBAAoB,GAAG,MAC5BF,kBAAkB,CAAE,oBAAF,CADnB;;AAEA,QAAMG,iBAAiB,GAAG,MAAMH,kBAAkB,CAAE,iBAAF,CAAlD;;AAEA,QAAM;AAAEI,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAoC,qBAAaC,MAAF,IAAc;AAClE,UAAMC,aAAa,GAAGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,gBAAtB,EAAtB;AAEA,WAAO;AACN;AACAL,MAAAA,aAAa,EAAEG,aAAa,IAAI,cAAI,UAAJ,EAAgB,MAAhB,CAF1B;AAGNF,MAAAA,cAAc,EAAEC,MAAM,CAAEL,YAAF,CAAN,CAAwBS,iBAAxB;AAHV,KAAP;AAKA,GARyC,EAQvC,EARuC,CAA1C;AAUA,QAAM,CAAEC,iBAAF,EAAqBC,mBAArB,IACLb,WAAW,KAAK,oBAAhB,GACG;AACA,GAAE,mBAAS,cAAI,eAAJ,CAAT,EAAgCK,aAAhC,CAAF,EAAmD,WAAnD,CAFH,GAGG,CAAEA,aAAF,EAAiB,EAAjB,CAJJ;AAMA,QAAM,CAAES,cAAF,EAAkBC,gBAAlB,IACLf,WAAW,KAAK,iBAAhB,GACG;AACA,GAAE,cAAI,kBAAJ,CAAF,EAA4B,WAA5B,CAFH,GAGG;AACA,GAAE,cAAI,OAAJ,CAAF,EAAiB,EAAjB,CALJ;AAOA,QAAM,CAAEgB,iBAAF,EAAqBC,mBAArB,IACLjB,WAAW,KAAK,oBAAhB,GACG,CAAE,cAAI,qBAAJ,CAAF,EAA+B,WAA/B,CADH,GAEG,CAAE,cAAI,UAAJ,CAAF,EAAoB,EAApB,CAHJ;AAKA;;AACA,SACC,wCACG,CAAEM,cAAF,IACD,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGH,oBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCU,mBAAqB,EAFnE;AAGC,kBAAaD,iBAHd;AAIC,kBAAaP;AAJd,KAMGA,aANH,CADD,CAFF,EAaGC,cAAc,IACf,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGH,oBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCc,mBAAqB,EAFnE;AAGC,kBAAaD,iBAHd;AAIC,kBAAa,cAAI,UAAJ;AAJd,KAMG,cAAI,UAAJ,CANH,CADD,CAdF,EAyBC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGZ,iBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCW,gBAAkB,EAFhE;AAGC,kBAAaD,cAHd,CAIC;AAJD;AAKC,kBAAa,cAAI,OAAJ;AALd,KAQE;AACA,gBAAI,OAAJ,CATF,CADD,CAzBD,CADD;AA0CA,CA7ED;;eA+Eef,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\tconst openDocumentSettings = () =>\n\t\topenGeneralSidebar( 'edit-post/document' );\n\tconst openBlockSettings = () => openGeneralSidebar( 'edit-post/block' );\n\n\tconst { documentLabel, isTemplateMode } = useSelect( ( select ) => {\n\t\tconst postTypeLabel = select( editorStore ).getPostTypeLabel();\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst [ documentAriaLabel, documentActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.\n\t\t\t [ sprintf( __( '%s (selected)' ), documentLabel ), 'is-active' ]\n\t\t\t: [ documentLabel, '' ];\n\n\tconst [ blockAriaLabel, blockActiveClass ] =\n\t\tsidebarName === 'edit-post/block'\n\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t [ __( 'Block (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Block' ), '' ];\n\n\tconst [ templateAriaLabel, templateActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? [ __( 'Template (selected)' ), 'is-active' ]\n\t\t\t: [ __( 'Template' ), '' ];\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t{ ! isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ documentActiveClass }` }\n\t\t\t\t\t\taria-label={ documentAriaLabel }\n\t\t\t\t\t\tdata-label={ documentLabel }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ documentLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t{ isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ templateActiveClass }` }\n\t\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\t\tdata-label={ __( 'Template' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ blockActiveClass }` }\n\t\t\t\t\taria-label={ blockAriaLabel }\n\t\t\t\t\t// translators: Data label for the Block Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Block Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/settings-header/index.js"],"names":["SettingsHeader","sidebarName","openGeneralSidebar","editPostStore","openDocumentSettings","openBlockSettings","documentLabel","isTemplateMode","select","postTypeLabel","editorStore","getPostTypeLabel","isEditingTemplate","documentAriaLabel","documentActiveClass","blockAriaLabel","blockActiveClass","templateAriaLabel","templateActiveClass"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AAKA;;AAXA;AACA;AACA;;AAMA;AACA;AACA;AAGA,MAAMA,cAAc,GAAG,CAAE;AAAEC,EAAAA;AAAF,CAAF,KAAuB;AAC7C,QAAM;AAAEC,IAAAA;AAAF,MAAyB,uBAAaC,YAAb,CAA/B;;AACA,QAAMC,oBAAoB,GAAG,MAC5BF,kBAAkB,CAAE,oBAAF,CADnB;;AAEA,QAAMG,iBAAiB,GAAG,MAAMH,kBAAkB,CAAE,iBAAF,CAAlD;;AAEA,QAAM;AAAEI,IAAAA,aAAF;AAAiBC,IAAAA;AAAjB,MAAoC,qBAAaC,MAAF,IAAc;AAClE,UAAMC,aAAa,GAAGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,gBAAtB,EAAtB;AAEA,WAAO;AACN;AACAL,MAAAA,aAAa,EAAEG,aAAa,IAAI,cAAI,UAAJ,EAAgB,MAAhB,CAF1B;AAGNF,MAAAA,cAAc,EAAEC,MAAM,CAAEL,YAAF,CAAN,CAAwBS,iBAAxB;AAHV,KAAP;AAKA,GARyC,EAQvC,EARuC,CAA1C;AAUA,QAAM,CAAEC,iBAAF,EAAqBC,mBAArB,IACLb,WAAW,KAAK,oBAAhB,GACG;AACA,GAAE,mBAAS,cAAI,eAAJ,CAAT,EAAgCK,aAAhC,CAAF,EAAmD,WAAnD,CAFH,GAGG,CAAEA,aAAF,EAAiB,EAAjB,CAJJ;AAMA,QAAM,CAAES,cAAF,EAAkBC,gBAAlB,IACLf,WAAW,KAAK,iBAAhB,GACG;AACA,GAAE,cAAI,kBAAJ,CAAF,EAA4B,WAA5B,CAFH,GAGG;AACA,GAAE,cAAI,OAAJ,CAAF,EAAiB,EAAjB,CALJ;AAOA,QAAM,CAAEgB,iBAAF,EAAqBC,mBAArB,IACLjB,WAAW,KAAK,oBAAhB,GACG,CAAE,cAAI,qBAAJ,CAAF,EAA+B,WAA/B,CADH,GAEG,CAAE,cAAI,UAAJ,CAAF,EAAoB,EAApB,CAHJ;AAKA;;AACA,SACC,wCACG,CAAEM,cAAF,IACD,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGH,oBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCU,mBAAqB,EAFnE;AAGC,kBAAaD,iBAHd;AAIC,kBAAaP;AAJd,KAMGA,aANH,CADD,CAFF,EAaGC,cAAc,IACf,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGH,oBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCc,mBAAqB,EAFnE;AAGC,kBAAaD,iBAHd;AAIC,kBAAa,cAAI,UAAJ;AAJd,KAMG,cAAI,UAAJ,CANH,CADD,CAdF,EAyBC,wCACC,4BAAC,kBAAD;AACC,IAAA,OAAO,EAAGZ,iBADX;AAEC,IAAA,SAAS,EAAI,gCAAgCW,gBAAkB,EAFhE;AAGC,kBAAaD,cAHd,CAIC;AAJD;AAKC,kBAAa,cAAI,OAAJ;AALd,KAQE;AACA,gBAAI,OAAJ,CATF,CADD,CAzBD,CADD;AA0CA,CA7ED;;eA+Eef,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nconst SettingsHeader = ( { sidebarName } ) => {\n\tconst { openGeneralSidebar } = useDispatch( editPostStore );\n\tconst openDocumentSettings = () =>\n\t\topenGeneralSidebar( 'edit-post/document' );\n\tconst openBlockSettings = () => openGeneralSidebar( 'edit-post/block' );\n\n\tconst { documentLabel, isTemplateMode } = useSelect( ( select ) => {\n\t\tconst postTypeLabel = select( editorStore ).getPostTypeLabel();\n\n\t\treturn {\n\t\t\t// translators: Default label for the Document sidebar tab, not selected.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tisTemplateMode: select( editPostStore ).isEditingTemplate(),\n\t\t};\n\t}, [] );\n\n\tconst [ documentAriaLabel, documentActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? // translators: ARIA label for the Document sidebar tab, selected. %s: Document label.\n\t\t\t [ sprintf( __( '%s (selected)' ), documentLabel ), 'is-active' ]\n\t\t\t: [ documentLabel, '' ];\n\n\tconst [ blockAriaLabel, blockActiveClass ] =\n\t\tsidebarName === 'edit-post/block'\n\t\t\t? // translators: ARIA label for the Block Settings Sidebar tab, selected.\n\t\t\t [ __( 'Block (selected)' ), 'is-active' ]\n\t\t\t: // translators: ARIA label for the Block Settings Sidebar tab, not selected.\n\t\t\t [ __( 'Block' ), '' ];\n\n\tconst [ templateAriaLabel, templateActiveClass ] =\n\t\tsidebarName === 'edit-post/document'\n\t\t\t? [ __( 'Template (selected)' ), 'is-active' ]\n\t\t\t: [ __( 'Template' ), '' ];\n\n\t/* Use a list so screen readers will announce how many tabs there are. */\n\treturn (\n\t\t<ul>\n\t\t\t{ ! isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ documentActiveClass }` }\n\t\t\t\t\t\taria-label={ documentAriaLabel }\n\t\t\t\t\t\tdata-label={ documentLabel }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ documentLabel }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t{ isTemplateMode && (\n\t\t\t\t<li>\n\t\t\t\t\t<Button\n\t\t\t\t\t\tonClick={ openDocumentSettings }\n\t\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ templateActiveClass }` }\n\t\t\t\t\t\taria-label={ templateAriaLabel }\n\t\t\t\t\t\tdata-label={ __( 'Template' ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Template' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</li>\n\t\t\t) }\n\t\t\t<li>\n\t\t\t\t<Button\n\t\t\t\t\tonClick={ openBlockSettings }\n\t\t\t\t\tclassName={ `edit-post-sidebar__panel-tab ${ blockActiveClass }` }\n\t\t\t\t\taria-label={ blockAriaLabel }\n\t\t\t\t\t// translators: Data label for the Block Settings Sidebar tab.\n\t\t\t\t\tdata-label={ __( 'Block' ) }\n\t\t\t\t>\n\t\t\t\t\t{\n\t\t\t\t\t\t// translators: Text label for the Block Settings Sidebar tab.\n\t\t\t\t\t\t__( 'Block' )\n\t\t\t\t\t}\n\t\t\t\t</Button>\n\t\t\t</li>\n\t\t</ul>\n\t);\n};\n\nexport default SettingsHeader;\n"]}
@@ -41,7 +41,7 @@ function TemplateSummary() {
41
41
  icon: _icons.layout
42
42
  })), (0, _element.createElement)(_components.FlexBlock, null, (0, _element.createElement)("h2", {
43
43
  className: "edit-post-template-summary__title"
44
- }, (template === null || template === void 0 ? void 0 : template.title) || (template === null || template === void 0 ? void 0 : template.slug)), (0, _element.createElement)("p", null, template === null || template === void 0 ? void 0 : template.description))));
44
+ }, template?.title || template?.slug), (0, _element.createElement)("p", null, template?.description))));
45
45
  }
46
46
 
47
47
  var _default = TemplateSummary;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/template-summary/index.js"],"names":["TemplateSummary","template","select","getEditedPostTemplate","editPostStore","layout","title","slug","description"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,eAAT,GAA2B;AAC1B,QAAMC,QAAQ,GAAG,qBAAaC,MAAF,IAAc;AACzC,UAAM;AAAEC,MAAAA;AAAF,QAA4BD,MAAM,CAAEE,YAAF,CAAxC;AACA,WAAOD,qBAAqB,EAA5B;AACA,GAHgB,EAGd,EAHc,CAAjB;;AAKA,MAAK,CAAEF,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD,QACC,4BAAC,gBAAD;AAAM,IAAA,KAAK,EAAC,YAAZ;AAAyB,IAAA,GAAG,EAAC;AAA7B,KACC,4BAAC,oBAAD,QACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGI;AAAb,IADD,CADD,EAKC,4BAAC,qBAAD,QACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACG,CAAAJ,QAAQ,SAAR,IAAAA,QAAQ,WAAR,YAAAA,QAAQ,CAAEK,KAAV,MAAmBL,QAAnB,aAAmBA,QAAnB,uBAAmBA,QAAQ,CAAEM,IAA7B,CADH,CADD,EAIC,uCAAKN,QAAL,aAAKA,QAAL,uBAAKA,QAAQ,CAAEO,WAAf,CAJD,CALD,CADD,CADD;AAgBA;;eAEcR,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, layout } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { Flex, FlexItem, FlexBlock, PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TemplateSummary() {\n\tconst template = useSelect( ( select ) => {\n\t\tconst { getEditedPostTemplate } = select( editPostStore );\n\t\treturn getEditedPostTemplate();\n\t}, [] );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody>\n\t\t\t<Flex align=\"flex-start\" gap=\"3\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Icon icon={ layout } />\n\t\t\t\t</FlexItem>\n\n\t\t\t\t<FlexBlock>\n\t\t\t\t\t<h2 className=\"edit-post-template-summary__title\">\n\t\t\t\t\t\t{ template?.title || template?.slug }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p>{ template?.description }</p>\n\t\t\t\t</FlexBlock>\n\t\t\t</Flex>\n\t\t</PanelBody>\n\t);\n}\n\nexport default TemplateSummary;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/sidebar/template-summary/index.js"],"names":["TemplateSummary","template","select","getEditedPostTemplate","editPostStore","layout","title","slug","description"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AAKA;;AAVA;AACA;AACA;;AAKA;AACA;AACA;AAGA,SAASA,eAAT,GAA2B;AAC1B,QAAMC,QAAQ,GAAG,qBAAaC,MAAF,IAAc;AACzC,UAAM;AAAEC,MAAAA;AAAF,QAA4BD,MAAM,CAAEE,YAAF,CAAxC;AACA,WAAOD,qBAAqB,EAA5B;AACA,GAHgB,EAGd,EAHc,CAAjB;;AAKA,MAAK,CAAEF,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,qBAAD,QACC,4BAAC,gBAAD;AAAM,IAAA,KAAK,EAAC,YAAZ;AAAyB,IAAA,GAAG,EAAC;AAA7B,KACC,4BAAC,oBAAD,QACC,4BAAC,WAAD;AAAM,IAAA,IAAI,EAAGI;AAAb,IADD,CADD,EAKC,4BAAC,qBAAD,QACC;AAAI,IAAA,SAAS,EAAC;AAAd,KACGJ,QAAQ,EAAEK,KAAV,IAAmBL,QAAQ,EAAEM,IADhC,CADD,EAIC,uCAAKN,QAAQ,EAAEO,WAAf,CAJD,CALD,CADD,CADD;AAgBA;;eAEcR,e","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Icon, layout } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\nimport { Flex, FlexItem, FlexBlock, PanelBody } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../../store';\n\nfunction TemplateSummary() {\n\tconst template = useSelect( ( select ) => {\n\t\tconst { getEditedPostTemplate } = select( editPostStore );\n\t\treturn getEditedPostTemplate();\n\t}, [] );\n\n\tif ( ! template ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<PanelBody>\n\t\t\t<Flex align=\"flex-start\" gap=\"3\">\n\t\t\t\t<FlexItem>\n\t\t\t\t\t<Icon icon={ layout } />\n\t\t\t\t</FlexItem>\n\n\t\t\t\t<FlexBlock>\n\t\t\t\t\t<h2 className=\"edit-post-template-summary__title\">\n\t\t\t\t\t\t{ template?.title || template?.slug }\n\t\t\t\t\t</h2>\n\t\t\t\t\t<p>{ template?.description }</p>\n\t\t\t\t</FlexBlock>\n\t\t\t</Flex>\n\t\t</PanelBody>\n\t);\n}\n\nexport default TemplateSummary;\n"]}
@@ -56,10 +56,9 @@ function useStartPatterns() {
56
56
  }, [postType, blockPatternsWithPostContentBlockType]);
57
57
  }
58
58
 
59
- function PatternSelection(_ref) {
60
- let {
61
- onChoosePattern
62
- } = _ref;
59
+ function PatternSelection({
60
+ onChoosePattern
61
+ }) {
63
62
  const blockPatterns = useStartPatterns();
64
63
  const shownBlockPatterns = (0, _compose.useAsyncList)(blockPatterns);
65
64
  const {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/start-page-options/index.js"],"names":["useStartPatterns","blockPatternsWithPostContentBlockType","postType","select","getPatternsByBlockTypes","blockEditorStore","getCurrentPostType","editorStore","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","onChoosePattern","blockPatterns","shownBlockPatterns","resetEditorBlocks","_pattern","blocks","START_PAGE_MODAL_STATES","INITIAL","PATTERN","CLOSED","StartPageOptions","modalState","setModalState","hasStartPattern","length","shouldOpenModel","getEditedPostContent","isEditedPostSaveable","isEditingTemplate","isFeatureActive","editPostStore"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declares and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes } = select( blockEditorStore );\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType:\n\t\t\t\t\tgetPatternsByBlockTypes( 'core/post-content' ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { onChoosePattern } ) {\n\tconst blockPatterns = useStartPatterns();\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { resetEditorBlocks } = useDispatch( editorStore );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nconst START_PAGE_MODAL_STATES = {\n\tINITIAL: 'INITIAL',\n\tPATTERN: 'PATTERN',\n\tCLOSED: 'CLOSED',\n};\n\nexport default function StartPageOptions() {\n\tconst [ modalState, setModalState ] = useState(\n\t\tSTART_PAGE_MODAL_STATES.INITIAL\n\t);\n\tconst blockPatterns = useStartPatterns();\n\tconst hasStartPattern = blockPatterns.length > 0;\n\tconst shouldOpenModel = useSelect(\n\t\t( select ) => {\n\t\t\tif (\n\t\t\t\t! hasStartPattern ||\n\t\t\t\tmodalState !== START_PAGE_MODAL_STATES.INITIAL\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst { getEditedPostContent, isEditedPostSaveable } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { isEditingTemplate, isFeatureActive } =\n\t\t\t\tselect( editPostStore );\n\t\t\treturn (\n\t\t\t\t! isEditedPostSaveable() &&\n\t\t\t\t'' === getEditedPostContent() &&\n\t\t\t\t! isEditingTemplate() &&\n\t\t\t\t! isFeatureActive( 'welcomeGuide' )\n\t\t\t);\n\t\t},\n\t\t[ modalState, hasStartPattern ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldOpenModel ) {\n\t\t\tsetModalState( START_PAGE_MODAL_STATES.PATTERN );\n\t\t}\n\t}, [ shouldOpenModel ] );\n\n\tif (\n\t\tmodalState === START_PAGE_MODAL_STATES.INITIAL ||\n\t\tmodalState === START_PAGE_MODAL_STATES.CLOSED\n\t) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen={ true }\n\t\t\tonRequestClose={ () => {\n\t\t\t\tsetModalState( START_PAGE_MODAL_STATES.CLOSED );\n\t\t\t} }\n\t\t>\n\t\t\t<div className=\"edit-post-start-page-options__modal-content\">\n\t\t\t\t{ modalState === START_PAGE_MODAL_STATES.PATTERN && (\n\t\t\t\t\t<PatternSelection\n\t\t\t\t\t\tonChoosePattern={ () => {\n\t\t\t\t\t\t\tsetModalState( START_PAGE_MODAL_STATES.CLOSED );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/start-page-options/index.js"],"names":["useStartPatterns","blockPatternsWithPostContentBlockType","postType","select","getPatternsByBlockTypes","blockEditorStore","getCurrentPostType","editorStore","filter","pattern","postTypes","Array","isArray","includes","PatternSelection","onChoosePattern","blockPatterns","shownBlockPatterns","resetEditorBlocks","_pattern","blocks","START_PAGE_MODAL_STATES","INITIAL","PATTERN","CLOSED","StartPageOptions","modalState","setModalState","hasStartPattern","length","shouldOpenModel","getEditedPostContent","isEditedPostSaveable","isEditingTemplate","isFeatureActive","editPostStore"],"mappings":"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","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Modal } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useState, useEffect, useMemo } from '@wordpress/element';\nimport {\n\tstore as blockEditorStore,\n\t__experimentalBlockPatternsList as BlockPatternsList,\n} from '@wordpress/block-editor';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useAsyncList } from '@wordpress/compose';\nimport { store as editorStore } from '@wordpress/editor';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nfunction useStartPatterns() {\n\t// A pattern is a start pattern if it includes 'core/post-content' in its blockTypes,\n\t// and it has no postTypes declares and the current post type is page or if\n\t// the current post type is part of the postTypes declared.\n\tconst { blockPatternsWithPostContentBlockType, postType } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getPatternsByBlockTypes } = select( blockEditorStore );\n\t\t\tconst { getCurrentPostType } = select( editorStore );\n\t\t\treturn {\n\t\t\t\tblockPatternsWithPostContentBlockType:\n\t\t\t\t\tgetPatternsByBlockTypes( 'core/post-content' ),\n\t\t\t\tpostType: getCurrentPostType(),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\n\treturn useMemo( () => {\n\t\t// filter patterns without postTypes declared if the current postType is page\n\t\t// or patterns that declare the current postType in its post type array.\n\t\treturn blockPatternsWithPostContentBlockType.filter( ( pattern ) => {\n\t\t\treturn (\n\t\t\t\t( postType === 'page' && ! pattern.postTypes ) ||\n\t\t\t\t( Array.isArray( pattern.postTypes ) &&\n\t\t\t\t\tpattern.postTypes.includes( postType ) )\n\t\t\t);\n\t\t} );\n\t}, [ postType, blockPatternsWithPostContentBlockType ] );\n}\n\nfunction PatternSelection( { onChoosePattern } ) {\n\tconst blockPatterns = useStartPatterns();\n\tconst shownBlockPatterns = useAsyncList( blockPatterns );\n\tconst { resetEditorBlocks } = useDispatch( editorStore );\n\treturn (\n\t\t<BlockPatternsList\n\t\t\tblockPatterns={ blockPatterns }\n\t\t\tshownPatterns={ shownBlockPatterns }\n\t\t\tonClickPattern={ ( _pattern, blocks ) => {\n\t\t\t\tresetEditorBlocks( blocks );\n\t\t\t\tonChoosePattern();\n\t\t\t} }\n\t\t/>\n\t);\n}\n\nconst START_PAGE_MODAL_STATES = {\n\tINITIAL: 'INITIAL',\n\tPATTERN: 'PATTERN',\n\tCLOSED: 'CLOSED',\n};\n\nexport default function StartPageOptions() {\n\tconst [ modalState, setModalState ] = useState(\n\t\tSTART_PAGE_MODAL_STATES.INITIAL\n\t);\n\tconst blockPatterns = useStartPatterns();\n\tconst hasStartPattern = blockPatterns.length > 0;\n\tconst shouldOpenModel = useSelect(\n\t\t( select ) => {\n\t\t\tif (\n\t\t\t\t! hasStartPattern ||\n\t\t\t\tmodalState !== START_PAGE_MODAL_STATES.INITIAL\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\tconst { getEditedPostContent, isEditedPostSaveable } =\n\t\t\t\tselect( editorStore );\n\t\t\tconst { isEditingTemplate, isFeatureActive } =\n\t\t\t\tselect( editPostStore );\n\t\t\treturn (\n\t\t\t\t! isEditedPostSaveable() &&\n\t\t\t\t'' === getEditedPostContent() &&\n\t\t\t\t! isEditingTemplate() &&\n\t\t\t\t! isFeatureActive( 'welcomeGuide' )\n\t\t\t);\n\t\t},\n\t\t[ modalState, hasStartPattern ]\n\t);\n\n\tuseEffect( () => {\n\t\tif ( shouldOpenModel ) {\n\t\t\tsetModalState( START_PAGE_MODAL_STATES.PATTERN );\n\t\t}\n\t}, [ shouldOpenModel ] );\n\n\tif (\n\t\tmodalState === START_PAGE_MODAL_STATES.INITIAL ||\n\t\tmodalState === START_PAGE_MODAL_STATES.CLOSED\n\t) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<Modal\n\t\t\tclassName=\"edit-post-start-page-options__modal\"\n\t\t\ttitle={ __( 'Choose a pattern' ) }\n\t\t\tisFullScreen={ true }\n\t\t\tonRequestClose={ () => {\n\t\t\t\tsetModalState( START_PAGE_MODAL_STATES.CLOSED );\n\t\t\t} }\n\t\t>\n\t\t\t<div className=\"edit-post-start-page-options__modal-content\">\n\t\t\t\t{ modalState === START_PAGE_MODAL_STATES.PATTERN && (\n\t\t\t\t\t<PatternSelection\n\t\t\t\t\t\tonChoosePattern={ () => {\n\t\t\t\t\t\t\tsetModalState( START_PAGE_MODAL_STATES.CLOSED );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</Modal>\n\t);\n}\n"]}
@@ -34,7 +34,7 @@ function ViewLink() {
34
34
  return {
35
35
  permalink: select(_editor.store).getPermalink(),
36
36
  isPublished: select(_editor.store).isCurrentPostPublished(),
37
- label: postType === null || postType === void 0 ? void 0 : postType.labels.view_item
37
+ label: postType?.labels.view_item
38
38
  };
39
39
  }, []); // Only render the view button if the post is published and has a permalink.
40
40
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/view-link/index.js"],"names":["ViewLink","permalink","isPublished","label","select","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","getPermalink","isCurrentPostPublished","labels","view_item","external"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQe,SAASA,QAAT,GAAoB;AAClC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,WAAb;AAA0BC,IAAAA;AAA1B,MAAoC,qBAAaC,MAAF,IAAc;AAClE;AACA,UAAMC,YAAY,GAAGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,kBAAtB,EAArB;AACA,UAAMC,QAAQ,GAAGJ,MAAM,CAAEK,eAAF,CAAN,CAAoBC,WAApB,CAAiCL,YAAjC,CAAjB;AAEA,WAAO;AACNJ,MAAAA,SAAS,EAAEG,MAAM,CAAEE,aAAF,CAAN,CAAsBK,YAAtB,EADL;AAENT,MAAAA,WAAW,EAAEE,MAAM,CAAEE,aAAF,CAAN,CAAsBM,sBAAtB,EAFP;AAGNT,MAAAA,KAAK,EAAEK,QAAF,aAAEA,QAAF,uBAAEA,QAAQ,CAAEK,MAAV,CAAiBC;AAHlB,KAAP;AAKA,GAVyC,EAUvC,EAVuC,CAA1C,CADkC,CAalC;;AACA,MAAK,CAAEZ,WAAF,IAAiB,CAAED,SAAxB,EAAoC;AACnC,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAGc,eADR;AAEC,IAAA,KAAK,EAAGZ,KAAK,IAAI,cAAI,WAAJ,CAFlB;AAGC,IAAA,IAAI,EAAGF,SAHR;AAIC,IAAA,MAAM,EAAC;AAJR,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nexport default function ViewLink() {\n\tconst { permalink, isPublished, label } = useSelect( ( select ) => {\n\t\t// Grab post type to retrieve the view_item label.\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\n\t\treturn {\n\t\t\tpermalink: select( editorStore ).getPermalink(),\n\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\tlabel: postType?.labels.view_item,\n\t\t};\n\t}, [] );\n\n\t// Only render the view button if the post is published and has a permalink.\n\tif ( ! isPublished || ! permalink ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\ticon={ external }\n\t\t\tlabel={ label || __( 'View post' ) }\n\t\t\thref={ permalink }\n\t\t\ttarget=\"_blank\"\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/view-link/index.js"],"names":["ViewLink","permalink","isPublished","label","select","postTypeSlug","editorStore","getCurrentPostType","postType","coreStore","getPostType","getPermalink","isCurrentPostPublished","labels","view_item","external"],"mappings":";;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AACA;;AARA;AACA;AACA;AAQe,SAASA,QAAT,GAAoB;AAClC,QAAM;AAAEC,IAAAA,SAAF;AAAaC,IAAAA,WAAb;AAA0BC,IAAAA;AAA1B,MAAoC,qBAAaC,MAAF,IAAc;AAClE;AACA,UAAMC,YAAY,GAAGD,MAAM,CAAEE,aAAF,CAAN,CAAsBC,kBAAtB,EAArB;AACA,UAAMC,QAAQ,GAAGJ,MAAM,CAAEK,eAAF,CAAN,CAAoBC,WAApB,CAAiCL,YAAjC,CAAjB;AAEA,WAAO;AACNJ,MAAAA,SAAS,EAAEG,MAAM,CAAEE,aAAF,CAAN,CAAsBK,YAAtB,EADL;AAENT,MAAAA,WAAW,EAAEE,MAAM,CAAEE,aAAF,CAAN,CAAsBM,sBAAtB,EAFP;AAGNT,MAAAA,KAAK,EAAEK,QAAQ,EAAEK,MAAV,CAAiBC;AAHlB,KAAP;AAKA,GAVyC,EAUvC,EAVuC,CAA1C,CADkC,CAalC;;AACA,MAAK,CAAEZ,WAAF,IAAiB,CAAED,SAAxB,EAAoC;AACnC,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,kBAAD;AACC,IAAA,IAAI,EAAGc,eADR;AAEC,IAAA,KAAK,EAAGZ,KAAK,IAAI,cAAI,WAAJ,CAFlB;AAGC,IAAA,IAAI,EAAGF,SAHR;AAIC,IAAA,MAAM,EAAC;AAJR,IADD;AAQA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { store as editorStore } from '@wordpress/editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useSelect } from '@wordpress/data';\n\nexport default function ViewLink() {\n\tconst { permalink, isPublished, label } = useSelect( ( select ) => {\n\t\t// Grab post type to retrieve the view_item label.\n\t\tconst postTypeSlug = select( editorStore ).getCurrentPostType();\n\t\tconst postType = select( coreStore ).getPostType( postTypeSlug );\n\n\t\treturn {\n\t\t\tpermalink: select( editorStore ).getPermalink(),\n\t\t\tisPublished: select( editorStore ).isCurrentPostPublished(),\n\t\t\tlabel: postType?.labels.view_item,\n\t\t};\n\t}, [] );\n\n\t// Only render the view button if the post is published and has a permalink.\n\tif ( ! isPublished || ! permalink ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<Button\n\t\t\ticon={ external }\n\t\t\tlabel={ label || __( 'View post' ) }\n\t\t\thref={ permalink }\n\t\t\ttarget=\"_blank\"\n\t\t/>\n\t);\n}\n"]}
@@ -29,11 +29,10 @@ var _store = require("../../store");
29
29
  */
30
30
  const noop = () => {};
31
31
 
32
- function BlockInspectorButton(_ref) {
33
- let {
34
- onClick = noop,
35
- small = false
36
- } = _ref;
32
+ function BlockInspectorButton({
33
+ onClick = noop,
34
+ small = false
35
+ }) {
37
36
  const {
38
37
  shortcut,
39
38
  areAdvancedSettingsOpened
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/block-inspector-button.js"],"names":["noop","BlockInspectorButton","onClick","small","shortcut","areAdvancedSettingsOpened","select","keyboardShortcutsStore","getShortcutRepresentation","editPostStore","getActiveGeneralSidebarName","openGeneralSidebar","closeGeneralSidebar","label"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEO,SAASC,oBAAT,OAAmE;AAAA,MAApC;AAAEC,IAAAA,OAAO,GAAGF,IAAZ;AAAkBG,IAAAA,KAAK,GAAG;AAA1B,GAAoC;AACzE,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA0C,qBAC7CC,MAAF,KAAgB;AACfF,IAAAA,QAAQ,EAAEE,MAAM,CACfC,wBADe,CAAN,CAERC,yBAFQ,CAEmB,+BAFnB,CADK;AAIfH,IAAAA,yBAAyB,EACxBC,MAAM,CAAEG,YAAF,CAAN,CAAwBC,2BAAxB,OACA;AANc,GAAhB,CAD+C,EAS/C,EAT+C,CAAhD;AAWA,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MACL,uBAAaH,YAAb,CADD;AAGA,QAAMI,KAAK,GAAGR,yBAAyB,GACpC,cAAI,oBAAJ,CADoC,GAEpC,cAAI,oBAAJ,CAFH;AAIA,SACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKA,yBAAL,EAAiC;AAChCO,QAAAA,mBAAmB;AACnB,yBAAO,cAAI,uBAAJ,CAAP;AACA,OAHD,MAGO;AACND,QAAAA,kBAAkB,CAAE,iBAAF,CAAlB;AACA,yBACC,cACC,4EADD,CADD;AAKA;;AACDT,MAAAA,OAAO;AACP,KAdF;AAeC,IAAA,QAAQ,EAAGE;AAfZ,KAiBG,CAAED,KAAF,IAAWU,KAjBd,CADD;AAqBA;;eAEcZ,oB","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"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/block-inspector-button.js"],"names":["noop","BlockInspectorButton","onClick","small","shortcut","areAdvancedSettingsOpened","select","keyboardShortcutsStore","getShortcutRepresentation","editPostStore","getActiveGeneralSidebarName","openGeneralSidebar","closeGeneralSidebar","label"],"mappings":";;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AACA;;AAKA;;AAZA;AACA;AACA;;AAOA;AACA;AACA;AAGA,MAAMA,IAAI,GAAG,MAAM,CAAE,CAArB;;AAEO,SAASC,oBAAT,CAA+B;AAAEC,EAAAA,OAAO,GAAGF,IAAZ;AAAkBG,EAAAA,KAAK,GAAG;AAA1B,CAA/B,EAAmE;AACzE,QAAM;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,MAA0C,qBAC7CC,MAAF,KAAgB;AACfF,IAAAA,QAAQ,EAAEE,MAAM,CACfC,wBADe,CAAN,CAERC,yBAFQ,CAEmB,+BAFnB,CADK;AAIfH,IAAAA,yBAAyB,EACxBC,MAAM,CAAEG,YAAF,CAAN,CAAwBC,2BAAxB,OACA;AANc,GAAhB,CAD+C,EAS/C,EAT+C,CAAhD;AAWA,QAAM;AAAEC,IAAAA,kBAAF;AAAsBC,IAAAA;AAAtB,MACL,uBAAaH,YAAb,CADD;AAGA,QAAMI,KAAK,GAAGR,yBAAyB,GACpC,cAAI,oBAAJ,CADoC,GAEpC,cAAI,oBAAJ,CAFH;AAIA,SACC,4BAAC,oBAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACf,UAAKA,yBAAL,EAAiC;AAChCO,QAAAA,mBAAmB;AACnB,yBAAO,cAAI,uBAAJ,CAAP;AACA,OAHD,MAGO;AACND,QAAAA,kBAAkB,CAAE,iBAAF,CAAlB;AACA,yBACC,cACC,4EADD,CADD;AAKA;;AACDT,MAAAA,OAAO;AACP,KAdF;AAeC,IAAA,QAAQ,EAAGE;AAfZ,KAiBG,CAAED,KAAF,IAAWU,KAjBd,CADD;AAqBA;;eAEcZ,oB","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"]}
@@ -34,13 +34,12 @@ var _style = _interopRequireDefault(require("./style.scss"));
34
34
  /**
35
35
  * Internal dependencies
36
36
  */
37
- const Header = (0, _element.memo)(function EditorHeader(_ref) {
38
- let {
39
- editTitle,
40
- setTitleRef,
41
- title,
42
- getStylesFromColorScheme
43
- } = _ref;
37
+ const Header = (0, _element.memo)(function EditorHeader({
38
+ editTitle,
39
+ setTitleRef,
40
+ title,
41
+ getStylesFromColorScheme
42
+ }) {
44
43
  const [wrapperStyles] = (0, _blockEditor.useEditorWrapperStyles)();
45
44
  const blockHolderFocusedStyle = getStylesFromColorScheme(_style.default.blockHolderFocused, _style.default.blockHolderFocusedDark);
46
45
  return (0, _element.createElement)(_reactNative.View, {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/header.native.js"],"names":["Header","EditorHeader","editTitle","setTitleRef","title","getStylesFromColorScheme","wrapperStyles","blockHolderFocusedStyle","styles","blockHolderFocused","blockHolderFocusedDark","blockHolderFullBordered","borderColor","prevProps","nextProps","select","getEditedPostAttribute","dispatch","editPost","clearSelectedBlock","blockEditorStore","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAGA,MAAMA,MAAM,GAAG,mBACd,SAASC,YAAT,OAKI;AAAA,MALmB;AACtBC,IAAAA,SADsB;AAEtBC,IAAAA,WAFsB;AAGtBC,IAAAA,KAHsB;AAItBC,IAAAA;AAJsB,GAKnB;AACH,QAAM,CAAEC,aAAF,IAAoB,0CAA1B;AACA,QAAMC,uBAAuB,GAAGF,wBAAwB,CACvDG,eAAOC,kBADgD,EAEvDD,eAAOE,sBAFgD,CAAxD;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGJ;AAAd,KACC,4BAAC,iBAAD;AACC,IAAA,QAAQ,EAAGH,WADZ;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,QAAQ,EAAGF,SAHZ;AAIC,IAAA,WAAW,EAAG,cAAI,WAAJ,CAJf;AAKC,IAAA,WAAW,EAAGM,eAAOG,uBALtB;AAMC,IAAA,kBAAkB,EAAGJ,uBAAuB,CAACK,WAN9C;AAOC,IAAA,kBAAkB,EAAC;AAPpB,IADD,CADD;AAaA,CAzBa,EA0Bd,CAAEC,SAAF,EAAaC,SAAb,KAA4BD,SAAS,CAACT,KAAV,KAAoBU,SAAS,CAACV,KA1B5C,CAAf;;eA6Be,sBAAS,CACvB,sBAAcW,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAE,aAAF,CAAzC;AAEA,SAAO;AACNX,IAAAA,KAAK,EAAEY,sBAAsB,CAAE,OAAF;AADvB,GAAP;AAGA,CAND,CADuB,EAQvB,wBAAgBC,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA;AAAF,MAAeD,QAAQ,CAAE,aAAF,CAA7B;AAEA,QAAM;AAAEE,IAAAA;AAAF,MAAyBF,QAAQ,CAAEG,kBAAF,CAAvC;AAEA,SAAO;AACND,IAAAA,kBADM;;AAENjB,IAAAA,SAAS,CAAEE,KAAF,EAAU;AAClBc,MAAAA,QAAQ,CAAE;AAAEd,QAAAA;AAAF,OAAF,CAAR;AACA;;AAJK,GAAP;AAMA,CAXD,CARuB,EAoBvBiB,iCApBuB,CAAT,EAqBVrB,MArBU,C","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\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst Header = memo(\n\tfunction EditorHeader( {\n\t\teditTitle,\n\t\tsetTitleRef,\n\t\ttitle,\n\t\tgetStylesFromColorScheme,\n\t} ) {\n\t\tconst [ wrapperStyles ] = useEditorWrapperStyles();\n\t\tconst blockHolderFocusedStyle = getStylesFromColorScheme(\n\t\t\tstyles.blockHolderFocused,\n\t\t\tstyles.blockHolderFocusedDark\n\t\t);\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\tborderStyle={ styles.blockHolderFullBordered }\n\t\t\t\t\tfocusedBorderColor={ blockHolderFocusedStyle.borderColor }\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"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/components/visual-editor/header.native.js"],"names":["Header","EditorHeader","editTitle","setTitleRef","title","getStylesFromColorScheme","wrapperStyles","blockHolderFocusedStyle","styles","blockHolderFocused","blockHolderFocusedDark","blockHolderFullBordered","borderColor","prevProps","nextProps","select","getEditedPostAttribute","dispatch","editPost","clearSelectedBlock","blockEditorStore","withPreferredColorScheme"],"mappings":";;;;;;;;;AAQA;;AALA;;AAMA;;AACA;;AACA;;AACA;;AACA;;AAQA;;AArBA;AACA;AACA;;AAGA;AACA;AACA;;AAWA;AACA;AACA;AAGA,MAAMA,MAAM,GAAG,mBACd,SAASC,YAAT,CAAuB;AACtBC,EAAAA,SADsB;AAEtBC,EAAAA,WAFsB;AAGtBC,EAAAA,KAHsB;AAItBC,EAAAA;AAJsB,CAAvB,EAKI;AACH,QAAM,CAAEC,aAAF,IAAoB,0CAA1B;AACA,QAAMC,uBAAuB,GAAGF,wBAAwB,CACvDG,eAAOC,kBADgD,EAEvDD,eAAOE,sBAFgD,CAAxD;AAIA,SACC,4BAAC,iBAAD;AAAM,IAAA,KAAK,EAAGJ;AAAd,KACC,4BAAC,iBAAD;AACC,IAAA,QAAQ,EAAGH,WADZ;AAEC,IAAA,KAAK,EAAGC,KAFT;AAGC,IAAA,QAAQ,EAAGF,SAHZ;AAIC,IAAA,WAAW,EAAG,cAAI,WAAJ,CAJf;AAKC,IAAA,WAAW,EAAGM,eAAOG,uBALtB;AAMC,IAAA,kBAAkB,EAAGJ,uBAAuB,CAACK,WAN9C;AAOC,IAAA,kBAAkB,EAAC;AAPpB,IADD,CADD;AAaA,CAzBa,EA0Bd,CAAEC,SAAF,EAAaC,SAAb,KAA4BD,SAAS,CAACT,KAAV,KAAoBU,SAAS,CAACV,KA1B5C,CAAf;;eA6Be,sBAAS,CACvB,sBAAcW,MAAF,IAAc;AACzB,QAAM;AAAEC,IAAAA;AAAF,MAA6BD,MAAM,CAAE,aAAF,CAAzC;AAEA,SAAO;AACNX,IAAAA,KAAK,EAAEY,sBAAsB,CAAE,OAAF;AADvB,GAAP;AAGA,CAND,CADuB,EAQvB,wBAAgBC,QAAF,IAAgB;AAC7B,QAAM;AAAEC,IAAAA;AAAF,MAAeD,QAAQ,CAAE,aAAF,CAA7B;AAEA,QAAM;AAAEE,IAAAA;AAAF,MAAyBF,QAAQ,CAAEG,kBAAF,CAAvC;AAEA,SAAO;AACND,IAAAA,kBADM;;AAENjB,IAAAA,SAAS,CAAEE,KAAF,EAAU;AAClBc,MAAAA,QAAQ,CAAE;AAAEd,QAAAA;AAAF,OAAF,CAAR;AACA;;AAJK,GAAP;AAMA,CAXD,CARuB,EAoBvBiB,iCApBuB,CAAT,EAqBVrB,MArBU,C","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\n/**\n * Internal dependencies\n */\nimport styles from './style.scss';\n\nconst Header = memo(\n\tfunction EditorHeader( {\n\t\teditTitle,\n\t\tsetTitleRef,\n\t\ttitle,\n\t\tgetStylesFromColorScheme,\n\t} ) {\n\t\tconst [ wrapperStyles ] = useEditorWrapperStyles();\n\t\tconst blockHolderFocusedStyle = getStylesFromColorScheme(\n\t\t\tstyles.blockHolderFocused,\n\t\t\tstyles.blockHolderFocusedDark\n\t\t);\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\tborderStyle={ styles.blockHolderFullBordered }\n\t\t\t\t\tfocusedBorderColor={ blockHolderFocusedStyle.borderColor }\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"]}
@@ -21,10 +21,6 @@ var _data = require("@wordpress/data");
21
21
 
22
22
  var _compose = require("@wordpress/compose");
23
23
 
24
- var _icons = require("@wordpress/icons");
25
-
26
- var _i18n = require("@wordpress/i18n");
27
-
28
24
  var _blocks = require("@wordpress/blocks");
29
25
 
30
26
  var _coreData = require("@wordpress/core-data");
@@ -44,14 +40,13 @@ var _store = require("../../store");
44
40
  */
45
41
  const isGutenbergPlugin = process.env.IS_GUTENBERG_PLUGIN ? true : false;
46
42
 
47
- function MaybeIframe(_ref) {
48
- let {
49
- children,
50
- contentRef,
51
- shouldIframe,
52
- styles,
53
- style
54
- } = _ref;
43
+ function MaybeIframe({
44
+ children,
45
+ contentRef,
46
+ shouldIframe,
47
+ styles,
48
+ style
49
+ }) {
55
50
  const ref = (0, _blockEditor.__unstableUseMouseMoveTypingReset)();
56
51
 
57
52
  if (!shouldIframe) {
@@ -108,10 +103,9 @@ function getPostContentAttributes(blocks) {
108
103
  }
109
104
  }
110
105
 
111
- function VisualEditor(_ref2) {
112
- let {
113
- styles
114
- } = _ref2;
106
+ function VisualEditor({
107
+ styles
108
+ }) {
115
109
  const {
116
110
  deviceType,
117
111
  isWelcomeGuideVisible,
@@ -120,7 +114,8 @@ function VisualEditor(_ref2) {
120
114
  editedPostTemplate = {},
121
115
  wrapperBlockName,
122
116
  wrapperUniqueId,
123
- isBlockBasedTheme
117
+ isBlockBasedTheme,
118
+ hasV3BlocksOnly
124
119
  } = (0, _data.useSelect)(select => {
125
120
  const {
126
121
  isFeatureActive,
@@ -133,6 +128,9 @@ function VisualEditor(_ref2) {
133
128
  getCurrentPostType,
134
129
  getEditorSettings
135
130
  } = select(_editor.store);
131
+ const {
132
+ getBlockTypes
133
+ } = select(_blocks.store);
136
134
 
137
135
  const _isTemplateMode = isEditingTemplate();
138
136
 
@@ -157,7 +155,10 @@ function VisualEditor(_ref2) {
157
155
  editedPostTemplate: supportsTemplateMode && canEditTemplate ? getEditedPostTemplate() : undefined,
158
156
  wrapperBlockName: _wrapperBlockName,
159
157
  wrapperUniqueId: getCurrentPostId(),
160
- isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme
158
+ isBlockBasedTheme: editorSettings.__unstableIsBlockBasedTheme,
159
+ hasV3BlocksOnly: getBlockTypes().every(type => {
160
+ return type.apiVersion >= 3;
161
+ })
161
162
  };
162
163
  }, []);
163
164
  const {
@@ -170,23 +171,15 @@ function VisualEditor(_ref2) {
170
171
  themeHasDisabledLayoutStyles,
171
172
  themeSupportsLayout
172
173
  } = (0, _data.useSelect)(select => {
173
- var _settings$__experimen;
174
-
175
174
  const _settings = select(_blockEditor.store).getSettings();
176
175
 
177
176
  return {
178
177
  themeHasDisabledLayoutStyles: _settings.disableLayoutStyles,
179
178
  themeSupportsLayout: _settings.supportsLayout,
180
179
  isFocusMode: _settings.focusMode,
181
- hasRootPaddingAwareAlignments: (_settings$__experimen = _settings.__experimentalFeatures) === null || _settings$__experimen === void 0 ? void 0 : _settings$__experimen.useRootPaddingAwareAlignments
180
+ hasRootPaddingAwareAlignments: _settings.__experimentalFeatures?.useRootPaddingAwareAlignments
182
181
  };
183
182
  }, []);
184
- const {
185
- clearSelectedBlock
186
- } = (0, _data.useDispatch)(_blockEditor.store);
187
- const {
188
- setIsEditingTemplate
189
- } = (0, _data.useDispatch)(_store.store);
190
183
  const desktopCanvasStyles = {
191
184
  height: '100%',
192
185
  width: '100%',
@@ -244,20 +237,20 @@ function VisualEditor(_ref2) {
244
237
  };
245
238
  }, [isTemplateMode, themeSupportsLayout, globalLayoutSettings]);
246
239
  const newestPostContentAttributes = (0, _element.useMemo)(() => {
247
- if (!(editedPostTemplate !== null && editedPostTemplate !== void 0 && editedPostTemplate.content) && !(editedPostTemplate !== null && editedPostTemplate !== void 0 && editedPostTemplate.blocks)) {
240
+ if (!editedPostTemplate?.content && !editedPostTemplate?.blocks) {
248
241
  return postContentAttributes;
249
242
  } // When in template editing mode, we can access the blocks directly.
250
243
 
251
244
 
252
- if (editedPostTemplate !== null && editedPostTemplate !== void 0 && editedPostTemplate.blocks) {
253
- return getPostContentAttributes(editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.blocks);
245
+ if (editedPostTemplate?.blocks) {
246
+ return getPostContentAttributes(editedPostTemplate?.blocks);
254
247
  } // If there are no blocks, we have to parse the content string.
255
248
  // Best double-check it's a string otherwise the parse function gets unhappy.
256
249
 
257
250
 
258
- const parseableContent = typeof (editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content) === 'string' ? editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content : '';
251
+ const parseableContent = typeof editedPostTemplate?.content === 'string' ? editedPostTemplate?.content : '';
259
252
  return getPostContentAttributes((0, _blocks.parse)(parseableContent)) || {};
260
- }, [editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.content, editedPostTemplate === null || editedPostTemplate === void 0 ? void 0 : editedPostTemplate.blocks, postContentAttributes]);
253
+ }, [editedPostTemplate?.content, editedPostTemplate?.blocks, postContentAttributes]);
261
254
  const {
262
255
  layout = {},
263
256
  align = ''
@@ -269,26 +262,24 @@ function VisualEditor(_ref2) {
269
262
  const postContentLayoutStyles = (0, _blockEditor.__experimentaluseLayoutStyles)(newestPostContentAttributes, 'core/post-content', '.block-editor-block-list__layout.is-root-container'); // Update type for blocks using legacy layouts.
270
263
 
271
264
  const postContentLayout = (0, _element.useMemo)(() => {
272
- return layout && ((layout === null || layout === void 0 ? void 0 : layout.type) === 'constrained' || layout !== null && layout !== void 0 && layout.inherit || layout !== null && layout !== void 0 && layout.contentSize || layout !== null && layout !== void 0 && layout.wideSize) ? { ...globalLayoutSettings,
265
+ return layout && (layout?.type === 'constrained' || layout?.inherit || layout?.contentSize || layout?.wideSize) ? { ...globalLayoutSettings,
273
266
  ...layout,
274
267
  type: 'constrained'
275
268
  } : { ...globalLayoutSettings,
276
269
  ...layout,
277
270
  type: 'default'
278
271
  };
279
- }, [layout === null || layout === void 0 ? void 0 : layout.type, layout === null || layout === void 0 ? void 0 : layout.inherit, layout === null || layout === void 0 ? void 0 : layout.contentSize, layout === null || layout === void 0 ? void 0 : layout.wideSize, globalLayoutSettings]); // If there is a Post Content block we use its layout for the block list;
272
+ }, [layout?.type, layout?.inherit, layout?.contentSize, layout?.wideSize, globalLayoutSettings]); // If there is a Post Content block we use its layout for the block list;
280
273
  // if not, this must be a classic theme, in which case we use the fallback layout.
281
274
 
282
275
  const blockListLayout = postContentAttributes ? postContentLayout : fallbackLayout;
283
276
  const titleRef = (0, _element.useRef)();
284
277
  (0, _element.useEffect)(() => {
285
- var _titleRef$current;
286
-
287
278
  if (isWelcomeGuideVisible || !isCleanNewPost()) {
288
279
  return;
289
280
  }
290
281
 
291
- titleRef === null || titleRef === void 0 ? void 0 : (_titleRef$current = titleRef.current) === null || _titleRef$current === void 0 ? void 0 : _titleRef$current.focus();
282
+ titleRef?.current?.focus();
292
283
  }, [isWelcomeGuideVisible, isCleanNewPost]);
293
284
  styles = (0, _element.useMemo)(() => [...styles, {
294
285
  // We should move this in to future to the body.
@@ -310,31 +301,24 @@ function VisualEditor(_ref2) {
310
301
  padding: isTemplateMode ? '48px 48px 0' : 0
311
302
  },
312
303
  ref: blockSelectionClearerRef
313
- }, isTemplateMode && (0, _element.createElement)(_components.Button, {
314
- className: "edit-post-visual-editor__exit-template-mode",
315
- icon: _icons.arrowLeft,
316
- onClick: () => {
317
- clearSelectedBlock();
318
- setIsEditingTemplate(false);
319
- }
320
- }, (0, _i18n.__)('Back')), (0, _element.createElement)(_components.__unstableMotion.div, {
304
+ }, (0, _element.createElement)(_components.__unstableMotion.div, {
321
305
  animate: animatedStyles,
322
306
  initial: desktopCanvasStyles,
323
307
  className: previewMode
324
308
  }, (0, _element.createElement)(MaybeIframe, {
325
- shouldIframe: isGutenbergPlugin && isBlockBasedTheme && !hasMetaBoxes || isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile',
309
+ shouldIframe: (hasV3BlocksOnly || isGutenbergPlugin && isBlockBasedTheme) && !hasMetaBoxes || isTemplateMode || deviceType === 'Tablet' || deviceType === 'Mobile',
326
310
  contentRef: contentRef,
327
311
  styles: styles
328
312
  }, themeSupportsLayout && !themeHasDisabledLayoutStyles && !isTemplateMode && (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_blockEditor.__experimentalLayoutStyle, {
329
313
  selector: ".edit-post-visual-editor__post-title-wrapper, .block-editor-block-list__layout.is-root-container",
330
314
  layout: fallbackLayout,
331
- layoutDefinitions: globalLayoutSettings === null || globalLayoutSettings === void 0 ? void 0 : globalLayoutSettings.definitions
315
+ layoutDefinitions: globalLayoutSettings?.definitions
332
316
  }), align && (0, _element.createElement)(_blockEditor.__experimentalLayoutStyle, {
333
317
  css: alignCSS
334
318
  }), postContentLayoutStyles && (0, _element.createElement)(_blockEditor.__experimentalLayoutStyle, {
335
319
  layout: postContentLayout,
336
320
  css: postContentLayoutStyles,
337
- layoutDefinitions: globalLayoutSettings === null || globalLayoutSettings === void 0 ? void 0 : globalLayoutSettings.definitions
321
+ layoutDefinitions: globalLayoutSettings?.definitions
338
322
  })), !isTemplateMode && (0, _element.createElement)("div", {
339
323
  className: (0, _classnames.default)('edit-post-visual-editor__post-title-wrapper', {
340
324
  'is-focus-mode': isFocusMode,