@wordpress/edit-post 7.11.0 → 7.12.1

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 (328) 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 +29 -17
  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 +3 -5
  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.js +2 -2
  19. package/build/components/header/header-toolbar/index.js.map +1 -1
  20. package/build/components/header/header-toolbar/index.native.js +12 -13
  21. package/build/components/header/header-toolbar/index.native.js.map +1 -1
  22. package/build/components/header/index.js +14 -20
  23. package/build/components/header/index.js.map +1 -1
  24. package/build/components/header/main-dashboard-button/index.js +3 -4
  25. package/build/components/header/main-dashboard-button/index.js.map +1 -1
  26. package/build/components/header/more-menu/index.js +19 -23
  27. package/build/components/header/more-menu/index.js.map +1 -1
  28. package/build/components/header/plugin-sidebar-more-menu-item/index.js +4 -7
  29. package/build/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
  30. package/build/components/header/post-publish-button-or-toggle.js +15 -16
  31. package/build/components/header/post-publish-button-or-toggle.js.map +1 -1
  32. package/build/components/header/tools-more-menu-group/index.js +7 -10
  33. package/build/components/header/tools-more-menu-group/index.js.map +1 -1
  34. package/build/components/header/writing-menu/index.js +0 -8
  35. package/build/components/header/writing-menu/index.js.map +1 -1
  36. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  37. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  38. package/build/components/keyboard-shortcut-help-modal/index.js +45 -54
  39. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  40. package/build/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  41. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  42. package/build/components/keyboard-shortcuts/index.js +1 -1
  43. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  44. package/build/components/layout/actions-panel.js +5 -6
  45. package/build/components/layout/actions-panel.js.map +1 -1
  46. package/build/components/layout/index.js +3 -4
  47. package/build/components/layout/index.js.map +1 -1
  48. package/build/components/layout/index.native.js +3 -7
  49. package/build/components/layout/index.native.js.map +1 -1
  50. package/build/components/meta-boxes/index.js +9 -13
  51. package/build/components/meta-boxes/index.js.map +1 -1
  52. package/build/components/meta-boxes/meta-box-visibility.js +5 -8
  53. package/build/components/meta-boxes/meta-box-visibility.js.map +1 -1
  54. package/build/components/meta-boxes/meta-boxes-area/index.js +3 -4
  55. package/build/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  56. package/build/components/preferences-modal/meta-boxes-section.js +18 -24
  57. package/build/components/preferences-modal/meta-boxes-section.js.map +1 -1
  58. package/build/components/preferences-modal/options/enable-custom-fields.js +8 -10
  59. package/build/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  60. package/build/components/preferences-modal/options/enable-feature.js +12 -16
  61. package/build/components/preferences-modal/options/enable-feature.js.map +1 -1
  62. package/build/components/preferences-modal/options/enable-panel.js +10 -17
  63. package/build/components/preferences-modal/options/enable-panel.js.map +1 -1
  64. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  65. package/build/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  66. package/build/components/secondary-sidebar/inserter-sidebar.js +4 -8
  67. package/build/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  68. package/build/components/secondary-sidebar/list-view-sidebar.js +58 -44
  69. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  70. package/build/components/sidebar/discussion-panel/index.js +5 -7
  71. package/build/components/sidebar/discussion-panel/index.js.map +1 -1
  72. package/build/components/sidebar/featured-image/index.js +9 -17
  73. package/build/components/sidebar/featured-image/index.js.map +1 -1
  74. package/build/components/sidebar/page-attributes/index.js +3 -9
  75. package/build/components/sidebar/page-attributes/index.js.map +1 -1
  76. package/build/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  77. package/build/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  78. package/build/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  79. package/build/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  80. package/build/components/sidebar/plugin-post-status-info/index.js +6 -9
  81. package/build/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  82. package/build/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  83. package/build/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  84. package/build/components/sidebar/plugin-sidebar/index.js +8 -12
  85. package/build/components/sidebar/plugin-sidebar/index.js.map +1 -1
  86. package/build/components/sidebar/post-excerpt/index.js +5 -7
  87. package/build/components/sidebar/post-excerpt/index.js.map +1 -1
  88. package/build/components/sidebar/post-schedule/index.js +16 -23
  89. package/build/components/sidebar/post-schedule/index.js.map +1 -1
  90. package/build/components/sidebar/post-status/index.js +8 -12
  91. package/build/components/sidebar/post-status/index.js.map +1 -1
  92. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  93. package/build/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  94. package/build/components/sidebar/post-template/create-modal.js +3 -4
  95. package/build/components/sidebar/post-template/create-modal.js.map +1 -1
  96. package/build/components/sidebar/post-template/form.js +13 -20
  97. package/build/components/sidebar/post-template/form.js.map +1 -1
  98. package/build/components/sidebar/post-template/index.js +18 -25
  99. package/build/components/sidebar/post-template/index.js.map +1 -1
  100. package/build/components/sidebar/post-url/index.js +16 -23
  101. package/build/components/sidebar/post-url/index.js.map +1 -1
  102. package/build/components/sidebar/post-visibility/index.js +26 -36
  103. package/build/components/sidebar/post-visibility/index.js.map +1 -1
  104. package/build/components/sidebar/settings-header/index.js +3 -4
  105. package/build/components/sidebar/settings-header/index.js.map +1 -1
  106. package/build/components/sidebar/template-summary/index.js +1 -1
  107. package/build/components/sidebar/template-summary/index.js.map +1 -1
  108. package/build/components/start-page-options/index.js +3 -4
  109. package/build/components/start-page-options/index.js.map +1 -1
  110. package/build/components/view-link/index.js +1 -1
  111. package/build/components/view-link/index.js.map +1 -1
  112. package/build/components/visual-editor/block-inspector-button.js +4 -5
  113. package/build/components/visual-editor/block-inspector-button.js.map +1 -1
  114. package/build/components/visual-editor/header.native.js +6 -7
  115. package/build/components/visual-editor/header.native.js.map +1 -1
  116. package/build/components/visual-editor/index.js +49 -57
  117. package/build/components/visual-editor/index.js.map +1 -1
  118. package/build/components/welcome-guide/image.js +4 -5
  119. package/build/components/welcome-guide/image.js.map +1 -1
  120. package/build/editor.js +42 -30
  121. package/build/editor.js.map +1 -1
  122. package/build/editor.native.js +7 -11
  123. package/build/editor.native.js.map +1 -1
  124. package/build/hooks/validate-multiple-use/index.js +24 -37
  125. package/build/hooks/validate-multiple-use/index.js.map +1 -1
  126. package/build/index.js +18 -2
  127. package/build/index.js.map +1 -1
  128. package/build/{private-apis.js → lock-unlock.js} +1 -1
  129. package/build/lock-unlock.js.map +1 -0
  130. package/build/plugins/index.js +20 -23
  131. package/build/plugins/index.js.map +1 -1
  132. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  133. package/build/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  134. package/build/store/actions.js +60 -88
  135. package/build/store/actions.js.map +1 -1
  136. package/build/store/reducer.js +11 -43
  137. package/build/store/reducer.js.map +1 -1
  138. package/build/store/selectors.js +11 -16
  139. package/build/store/selectors.js.map +1 -1
  140. package/build-module/components/block-manager/category.js +14 -22
  141. package/build-module/components/block-manager/category.js.map +1 -1
  142. package/build-module/components/block-manager/checklist.js +6 -13
  143. package/build-module/components/block-manager/checklist.js.map +1 -1
  144. package/build-module/components/block-manager/index.js +32 -20
  145. package/build-module/components/block-manager/index.js.map +1 -1
  146. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +21 -26
  147. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  148. package/build-module/components/device-preview/index.js +3 -5
  149. package/build-module/components/device-preview/index.js.map +1 -1
  150. package/build-module/components/editor-initialization/index.js +3 -4
  151. package/build-module/components/editor-initialization/index.js.map +1 -1
  152. package/build-module/components/header/document-title/index.js +88 -0
  153. package/build-module/components/header/document-title/index.js.map +1 -0
  154. package/build-module/components/header/fullscreen-mode-close/index.js +7 -8
  155. package/build-module/components/header/fullscreen-mode-close/index.js.map +1 -1
  156. package/build-module/components/header/header-toolbar/index.js +1 -1
  157. package/build-module/components/header/header-toolbar/index.js.map +1 -1
  158. package/build-module/components/header/header-toolbar/index.native.js +12 -13
  159. package/build-module/components/header/header-toolbar/index.native.js.map +1 -1
  160. package/build-module/components/header/index.js +14 -20
  161. package/build-module/components/header/index.js.map +1 -1
  162. package/build-module/components/header/main-dashboard-button/index.js +3 -4
  163. package/build-module/components/header/main-dashboard-button/index.js.map +1 -1
  164. package/build-module/components/header/more-menu/index.js +19 -23
  165. package/build-module/components/header/more-menu/index.js.map +1 -1
  166. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js +4 -4
  167. package/build-module/components/header/plugin-sidebar-more-menu-item/index.js.map +1 -1
  168. package/build-module/components/header/post-publish-button-or-toggle.js +15 -16
  169. package/build-module/components/header/post-publish-button-or-toggle.js.map +1 -1
  170. package/build-module/components/header/tools-more-menu-group/index.js +7 -10
  171. package/build-module/components/header/tools-more-menu-group/index.js.map +1 -1
  172. package/build-module/components/header/writing-menu/index.js +0 -8
  173. package/build-module/components/header/writing-menu/index.js.map +1 -1
  174. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +3 -4
  175. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -1
  176. package/build-module/components/keyboard-shortcut-help-modal/index.js +43 -52
  177. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -1
  178. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +10 -12
  179. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -1
  180. package/build-module/components/keyboard-shortcuts/index.js +1 -1
  181. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  182. package/build-module/components/layout/actions-panel.js +5 -6
  183. package/build-module/components/layout/actions-panel.js.map +1 -1
  184. package/build-module/components/layout/index.js +3 -4
  185. package/build-module/components/layout/index.js.map +1 -1
  186. package/build-module/components/layout/index.native.js +3 -7
  187. package/build-module/components/layout/index.native.js.map +1 -1
  188. package/build-module/components/meta-boxes/index.js +9 -13
  189. package/build-module/components/meta-boxes/index.js.map +1 -1
  190. package/build-module/components/meta-boxes/meta-box-visibility.js +5 -8
  191. package/build-module/components/meta-boxes/meta-box-visibility.js.map +1 -1
  192. package/build-module/components/meta-boxes/meta-boxes-area/index.js +3 -4
  193. package/build-module/components/meta-boxes/meta-boxes-area/index.js.map +1 -1
  194. package/build-module/components/preferences-modal/meta-boxes-section.js +18 -24
  195. package/build-module/components/preferences-modal/meta-boxes-section.js.map +1 -1
  196. package/build-module/components/preferences-modal/options/enable-custom-fields.js +8 -10
  197. package/build-module/components/preferences-modal/options/enable-custom-fields.js.map +1 -1
  198. package/build-module/components/preferences-modal/options/enable-feature.js +12 -16
  199. package/build-module/components/preferences-modal/options/enable-feature.js.map +1 -1
  200. package/build-module/components/preferences-modal/options/enable-panel.js +10 -17
  201. package/build-module/components/preferences-modal/options/enable-panel.js.map +1 -1
  202. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js +7 -10
  203. package/build-module/components/preferences-modal/options/enable-plugin-document-setting-panel.js.map +1 -1
  204. package/build-module/components/secondary-sidebar/inserter-sidebar.js +4 -5
  205. package/build-module/components/secondary-sidebar/inserter-sidebar.js.map +1 -1
  206. package/build-module/components/secondary-sidebar/list-view-sidebar.js +58 -44
  207. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  208. package/build-module/components/sidebar/discussion-panel/index.js +5 -7
  209. package/build-module/components/sidebar/discussion-panel/index.js.map +1 -1
  210. package/build-module/components/sidebar/featured-image/index.js +9 -17
  211. package/build-module/components/sidebar/featured-image/index.js.map +1 -1
  212. package/build-module/components/sidebar/page-attributes/index.js +3 -9
  213. package/build-module/components/sidebar/page-attributes/index.js.map +1 -1
  214. package/build-module/components/sidebar/plugin-document-setting-panel/index.js +20 -25
  215. package/build-module/components/sidebar/plugin-document-setting-panel/index.js.map +1 -1
  216. package/build-module/components/sidebar/plugin-post-publish-panel/index.js +12 -15
  217. package/build-module/components/sidebar/plugin-post-publish-panel/index.js.map +1 -1
  218. package/build-module/components/sidebar/plugin-post-status-info/index.js +6 -9
  219. package/build-module/components/sidebar/plugin-post-status-info/index.js.map +1 -1
  220. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js +12 -15
  221. package/build-module/components/sidebar/plugin-pre-publish-panel/index.js.map +1 -1
  222. package/build-module/components/sidebar/plugin-sidebar/index.js +8 -9
  223. package/build-module/components/sidebar/plugin-sidebar/index.js.map +1 -1
  224. package/build-module/components/sidebar/post-excerpt/index.js +5 -7
  225. package/build-module/components/sidebar/post-excerpt/index.js.map +1 -1
  226. package/build-module/components/sidebar/post-schedule/index.js +16 -23
  227. package/build-module/components/sidebar/post-schedule/index.js.map +1 -1
  228. package/build-module/components/sidebar/post-status/index.js +9 -13
  229. package/build-module/components/sidebar/post-status/index.js.map +1 -1
  230. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js +9 -15
  231. package/build-module/components/sidebar/post-taxonomies/taxonomy-panel.js.map +1 -1
  232. package/build-module/components/sidebar/post-template/create-modal.js +3 -4
  233. package/build-module/components/sidebar/post-template/create-modal.js.map +1 -1
  234. package/build-module/components/sidebar/post-template/form.js +13 -20
  235. package/build-module/components/sidebar/post-template/form.js.map +1 -1
  236. package/build-module/components/sidebar/post-template/index.js +18 -25
  237. package/build-module/components/sidebar/post-template/index.js.map +1 -1
  238. package/build-module/components/sidebar/post-url/index.js +16 -23
  239. package/build-module/components/sidebar/post-url/index.js.map +1 -1
  240. package/build-module/components/sidebar/post-visibility/index.js +26 -36
  241. package/build-module/components/sidebar/post-visibility/index.js.map +1 -1
  242. package/build-module/components/sidebar/settings-header/index.js +3 -4
  243. package/build-module/components/sidebar/settings-header/index.js.map +1 -1
  244. package/build-module/components/sidebar/template-summary/index.js +1 -1
  245. package/build-module/components/sidebar/template-summary/index.js.map +1 -1
  246. package/build-module/components/start-page-options/index.js +3 -4
  247. package/build-module/components/start-page-options/index.js.map +1 -1
  248. package/build-module/components/view-link/index.js +1 -1
  249. package/build-module/components/view-link/index.js.map +1 -1
  250. package/build-module/components/visual-editor/block-inspector-button.js +4 -5
  251. package/build-module/components/visual-editor/block-inspector-button.js.map +1 -1
  252. package/build-module/components/visual-editor/header.native.js +6 -7
  253. package/build-module/components/visual-editor/header.native.js.map +1 -1
  254. package/build-module/components/visual-editor/index.js +47 -54
  255. package/build-module/components/visual-editor/index.js.map +1 -1
  256. package/build-module/components/welcome-guide/image.js +4 -5
  257. package/build-module/components/welcome-guide/image.js.map +1 -1
  258. package/build-module/editor.js +38 -26
  259. package/build-module/editor.js.map +1 -1
  260. package/build-module/editor.native.js +7 -10
  261. package/build-module/editor.native.js.map +1 -1
  262. package/build-module/hooks/validate-multiple-use/index.js +24 -34
  263. package/build-module/hooks/validate-multiple-use/index.js.map +1 -1
  264. package/build-module/index.js +18 -2
  265. package/build-module/index.js.map +1 -1
  266. package/build-module/{private-apis.js → lock-unlock.js} +1 -1
  267. package/build-module/lock-unlock.js.map +1 -0
  268. package/build-module/plugins/index.js +20 -23
  269. package/build-module/plugins/index.js.map +1 -1
  270. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js +3 -4
  271. package/build-module/plugins/keyboard-shortcuts-help-menu-item/index.js.map +1 -1
  272. package/build-module/store/actions.js +60 -88
  273. package/build-module/store/actions.js.map +1 -1
  274. package/build-module/store/reducer.js +11 -43
  275. package/build-module/store/reducer.js.map +1 -1
  276. package/build-module/store/selectors.js +11 -16
  277. package/build-module/store/selectors.js.map +1 -1
  278. package/build-style/style-rtl.css +66 -102
  279. package/build-style/style.css +66 -102
  280. package/package.json +32 -32
  281. package/src/components/block-manager/index.js +51 -31
  282. package/src/components/block-manager/style.scss +3 -1
  283. package/src/components/device-preview/index.js +1 -2
  284. package/src/components/header/document-title/index.js +86 -0
  285. package/src/components/header/document-title/style.scss +61 -0
  286. package/src/components/header/header-toolbar/index.js +1 -1
  287. package/src/components/header/header-toolbar/style.scss +0 -1
  288. package/src/components/header/index.js +7 -10
  289. package/src/components/header/style.scss +6 -0
  290. package/src/components/header/writing-menu/index.js +0 -10
  291. package/src/components/keyboard-shortcuts/index.js +1 -1
  292. package/src/components/preferences-modal/options/enable-custom-fields.js +2 -2
  293. package/src/components/preferences-modal/options/test/__snapshots__/enable-custom-fields.js.snap +2 -2
  294. package/src/components/preferences-modal/test/__snapshots__/index.js.snap +10 -4
  295. package/src/components/secondary-sidebar/list-view-sidebar.js +68 -66
  296. package/src/components/secondary-sidebar/style.scss +28 -31
  297. package/src/components/sidebar/post-status/index.js +2 -1
  298. package/src/components/visual-editor/index.js +22 -32
  299. package/src/components/visual-editor/style.scss +0 -13
  300. package/src/editor.js +22 -1
  301. package/src/index.js +30 -3
  302. package/src/plugins/index.js +1 -1
  303. package/src/style.scss +1 -1
  304. package/src/test/editor.native.js +34 -9
  305. package/build/components/header/template-title/delete-template.js +0 -117
  306. package/build/components/header/template-title/delete-template.js.map +0 -1
  307. package/build/components/header/template-title/edit-template-title.js +0 -95
  308. package/build/components/header/template-title/edit-template-title.js.map +0 -1
  309. package/build/components/header/template-title/index.js +0 -124
  310. package/build/components/header/template-title/index.js.map +0 -1
  311. package/build/components/header/template-title/template-description.js +0 -55
  312. package/build/components/header/template-title/template-description.js.map +0 -1
  313. package/build/private-apis.js.map +0 -1
  314. package/build-module/components/header/template-title/delete-template.js +0 -104
  315. package/build-module/components/header/template-title/delete-template.js.map +0 -1
  316. package/build-module/components/header/template-title/edit-template-title.js +0 -83
  317. package/build-module/components/header/template-title/edit-template-title.js.map +0 -1
  318. package/build-module/components/header/template-title/index.js +0 -105
  319. package/build-module/components/header/template-title/index.js.map +0 -1
  320. package/build-module/components/header/template-title/template-description.js +0 -45
  321. package/build-module/components/header/template-title/template-description.js.map +0 -1
  322. package/build-module/private-apis.js.map +0 -1
  323. package/src/components/header/template-title/delete-template.js +0 -106
  324. package/src/components/header/template-title/edit-template-title.js +0 -78
  325. package/src/components/header/template-title/index.js +0 -115
  326. package/src/components/header/template-title/style.scss +0 -94
  327. package/src/components/header/template-title/template-description.js +0 -42
  328. /package/src/{private-apis.js → lock-unlock.js} +0 -0
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/editor.js"],"names":["store","blocksStore","useSelect","useDispatch","ErrorBoundary","PostLockedModal","editorStore","privateApis","editorPrivateApis","useMemo","SlotFillProvider","coreStore","ShortcutProvider","preferencesStore","CommandMenu","coreCommandsPrivateApis","Layout","EditorInitialization","editPostStore","unlock","ExperimentalEditorProvider","useCommands","Editor","postId","postType","settings","initialEdits","props","hasFixedToolbar","focusMode","isDistractionFree","hasInlineToolbar","hasThemeStyles","post","preferredStyleVariations","hiddenBlockTypes","blockTypes","keepCaretInsideBlock","isTemplateMode","template","select","isFeatureActive","__experimentalGetPreviewDeviceType","isEditingTemplate","getEditedPostTemplate","getHiddenBlockTypes","getEntityRecord","getPostType","getEntityRecords","canUser","getEditorSettings","getBlockTypes","isTemplate","includes","postObject","posts","wp_id","supportsTemplateMode","isViewable","viewable","canEditTemplate","get","updatePreferredStyleVariations","setIsInserterOpened","editorSettings","result","__experimentalPreferredStyleVariations","value","onChange","__experimentalSetIsInserterOpened","defaultAllowedBlockTypes","allowedBlockTypes","length","map","name","filter","type","styles","themeStyles","presetStyles","forEach","style","__unstableType","push","defaultEditorStyles","undefined"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,aADD,EAECC,eAFD,EAGCL,KAAK,IAAIM,WAHV,EAICC,WAAW,IAAIC,iBAJhB,QAKO,mBALP;AAMA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SAASC,gBAAT,QAAiC,uBAAjC;AACA,SAASV,KAAK,IAAIW,SAAlB,QAAmC,sBAAnC;AACA,SAASC,gBAAT,QAAiC,+BAAjC;AACA,SAASZ,KAAK,IAAIa,gBAAlB,QAA0C,wBAA1C;AACA,SAASC,WAAT,QAA4B,qBAA5B;AACA,SAASP,WAAW,IAAIQ,uBAAxB,QAAuD,0BAAvD;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,qBAAnB;AACA,OAAOC,oBAAP,MAAiC,oCAAjC;AACA,SAASjB,KAAK,IAAIkB,aAAlB,QAAuC,SAAvC;AACA,SAASC,MAAT,QAAuB,gBAAvB;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAAiCD,MAAM,CAAEX,iBAAF,CAA7C;AACA,MAAM;AAAEa,EAAAA;AAAF,IAAkBF,MAAM,CAAEJ,uBAAF,CAA9B;;AAEA,SAASO,MAAT,OAA0E;AAAA,MAAzD;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,QAAV;AAAoBC,IAAAA,QAApB;AAA8BC,IAAAA,YAA9B;AAA4C,OAAGC;AAA/C,GAAyD;AACzEN,EAAAA,WAAW;AACX,QAAM;AACLO,IAAAA,eADK;AAELC,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Ab,CAAmBF,KAAnB;AACA;AACD,KAND;AAOA,UAAMG,mBAAmB,GAAG,CAC3B,GAAG3D,QAAQ,CAAC2D,mBADe,EAE3B,GAAGL,YAFwB,CAA5B;AAIA,WAAO/C,cAAc,IAAI8C,WAAW,CAACN,MAA9B,GACJ/C,QAAQ,CAACoD,MADL,GAEJO,mBAFH;AAGA,GAjBqB,EAiBnB,CAAE3D,QAAF,EAAYO,cAAZ,CAjBmB,CAAtB;;AAmBA,MAAK,CAAEC,IAAP,EAAc;AACb,WAAO,IAAP;AACA;;AAED,SACC,cAAC,gBAAD,QACC,cAAC,gBAAD,QACC,cAAC,0BAAD;AACC,IAAA,QAAQ,EAAG+B,cADZ;AAEC,IAAA,IAAI,EAAG/B,IAFR;AAGC,IAAA,YAAY,EAAGP,YAHhB;AAIC,IAAA,cAAc,EAAG,KAJlB;AAKC,IAAA,kBAAkB,EAAGY,cAAc,GAAGC,QAAH,GAAc8C;AALlD,KAMM1D,KANN,GAQC,cAAC,aAAD,QACC,cAAC,WAAD,OADD,EAEC,cAAC,oBAAD;AAAsB,IAAA,MAAM,EAAGJ;AAA/B,IAFD,EAGC,cAAC,MAAD;AAAQ,IAAA,MAAM,EAAGsD;AAAjB,IAHD,CARD,EAaC,cAAC,eAAD,OAbD,CADD,CADD,CADD;AAqBA;;AAED,eAAevD,MAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { useMemo } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ShortcutProvider } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { CommandMenu } from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport EditorInitialization from './components/editor-initialization';\nimport { store as editPostStore } from './store';\nimport { unlock } from './private-apis';\n\nconst { ExperimentalEditorProvider } = unlock( editorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\n\nfunction Editor( { postId, postType, settings, initialEdits, ...props } ) {\n\tuseCommands();\n\tconst {\n\t\thasFixedToolbar,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thasInlineToolbar,\n\t\thasThemeStyles,\n\t\tpost,\n\t\tpreferredStyleVariations,\n\t\thiddenBlockTypes,\n\t\tblockTypes,\n\t\tkeepCaretInsideBlock,\n\t\tisTemplateMode,\n\t\ttemplate,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisFeatureActive,\n\t\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\t\tisEditingTemplate,\n\t\t\t\tgetEditedPostTemplate,\n\t\t\t\tgetHiddenBlockTypes,\n\t\t\t} = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, getEntityRecords, canUser } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes(\n\t\t\t\tpostType\n\t\t\t);\n\t\t\t// Ideally the initializeEditor function should be called using the ID of the REST endpoint.\n\t\t\t// to avoid the special case.\n\t\t\tlet postObject;\n\t\t\tif ( isTemplate ) {\n\t\t\t\tconst posts = getEntityRecords( 'postType', postType, {\n\t\t\t\t\twp_id: postId,\n\t\t\t\t} );\n\t\t\t\tpostObject = posts?.[ 0 ];\n\t\t\t} else {\n\t\t\t\tpostObject = getEntityRecord( 'postType', postType, postId );\n\t\t\t}\n\t\t\tconst supportsTemplateMode =\n\t\t\t\tgetEditorSettings().supportsTemplateMode;\n\t\t\tconst isViewable = getPostType( postType )?.viewable ?? false;\n\t\t\tconst canEditTemplate = canUser( 'create', 'templates' );\n\n\t\t\treturn {\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tisFeatureActive( 'fixedToolbar' ) ||\n\t\t\t\t\t__experimentalGetPreviewDeviceType() !== 'Desktop',\n\t\t\t\tfocusMode: isFeatureActive( 'focusMode' ),\n\t\t\t\tisDistractionFree: isFeatureActive( 'distractionFree' ),\n\t\t\t\thasInlineToolbar: isFeatureActive( 'inlineToolbar' ),\n\t\t\t\thasThemeStyles: isFeatureActive( 'themeStyles' ),\n\t\t\t\tpreferredStyleVariations: select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations'\n\t\t\t\t),\n\t\t\t\thiddenBlockTypes: getHiddenBlockTypes(),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tkeepCaretInsideBlock: isFeatureActive( 'keepCaretInsideBlock' ),\n\t\t\t\tisTemplateMode: isEditingTemplate(),\n\t\t\t\ttemplate:\n\t\t\t\t\tsupportsTemplateMode && isViewable && canEditTemplate\n\t\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t\t: null,\n\t\t\t\tpost: postObject,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { updatePreferredStyleVariations, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst editorSettings = useMemo( () => {\n\t\tconst result = {\n\t\t\t...settings,\n\t\t\t__experimentalPreferredStyleVariations: {\n\t\t\t\tvalue: preferredStyleVariations,\n\t\t\t\tonChange: updatePreferredStyleVariations,\n\t\t\t},\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t\tisDistractionFree,\n\t\t\thasInlineToolbar,\n\n\t\t\t// This is marked as experimental to give time for the quick inserter to mature.\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t// Keep a reference of the `allowedBlockTypes` from the server to handle use cases\n\t\t\t// where we need to differentiate if a block is disabled by the user or some plugin.\n\t\t\tdefaultAllowedBlockTypes: settings.allowedBlockTypes,\n\t\t};\n\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\tresult.allowedBlockTypes = defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}, [\n\t\tsettings,\n\t\thasFixedToolbar,\n\t\thasInlineToolbar,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thiddenBlockTypes,\n\t\tblockTypes,\n\t\tpreferredStyleVariations,\n\t\tsetIsInserterOpened,\n\t\tupdatePreferredStyleVariations,\n\t\tkeepCaretInsideBlock,\n\t] );\n\n\tconst styles = useMemo( () => {\n\t\tconst themeStyles = [];\n\t\tconst presetStyles = [];\n\t\tsettings.styles?.forEach( ( style ) => {\n\t\t\tif ( ! style.__unstableType || style.__unstableType === 'theme' ) {\n\t\t\t\tthemeStyles.push( style );\n\t\t\t} else {\n\t\t\t\tpresetStyles.push( style );\n\t\t\t}\n\t\t} );\n\t\tconst defaultEditorStyles = [\n\t\t\t...settings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\t\treturn hasThemeStyles && themeStyles.length\n\t\t\t? settings.styles\n\t\t\t: defaultEditorStyles;\n\t}, [ settings, hasThemeStyles ] );\n\n\tif ( ! post ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ShortcutProvider>\n\t\t\t<SlotFillProvider>\n\t\t\t\t<ExperimentalEditorProvider\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tpost={ post }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t__unstableTemplate={ isTemplateMode ? template : undefined }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t<CommandMenu />\n\t\t\t\t\t\t<EditorInitialization postId={ postId } />\n\t\t\t\t\t\t<Layout styles={ styles } />\n\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t<PostLockedModal />\n\t\t\t\t</ExperimentalEditorProvider>\n\t\t\t</SlotFillProvider>\n\t\t</ShortcutProvider>\n\t);\n}\n\nexport default Editor;\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/editor.js"],"names":["store","blocksStore","useSelect","useDispatch","ErrorBoundary","PostLockedModal","editorStore","privateApis","editorPrivateApis","blockEditorPrivateApis","useMemo","SlotFillProvider","coreStore","ShortcutProvider","preferencesStore","CommandMenu","coreCommandsPrivateApis","Layout","EditorInitialization","editPostStore","unlock","ExperimentalEditorProvider","getLayoutStyles","useCommands","Editor","postId","postType","settings","initialEdits","props","hasFixedToolbar","focusMode","isDistractionFree","hasInlineToolbar","hasThemeStyles","post","preferredStyleVariations","hiddenBlockTypes","blockTypes","keepCaretInsideBlock","isTemplateMode","template","select","isFeatureActive","__experimentalGetPreviewDeviceType","isEditingTemplate","getEditedPostTemplate","getHiddenBlockTypes","getEntityRecord","getPostType","getEntityRecords","canUser","getEditorSettings","getBlockTypes","isTemplate","includes","postObject","posts","wp_id","supportsTemplateMode","isViewable","viewable","canEditTemplate","get","updatePreferredStyleVariations","setIsInserterOpened","editorSettings","result","__experimentalPreferredStyleVariations","value","onChange","__experimentalSetIsInserterOpened","defaultAllowedBlockTypes","allowedBlockTypes","length","map","name","filter","type","styles","themeStyles","presetStyles","forEach","style","__unstableType","push","defaultEditorStyles","disableLayoutStyles","css","selector","hasBlockGapSupport","hasFallbackGapSupport","fallbackGapValue","und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BAAX,IACA,EAAIrD,cAAc,IAAI8C,WAAW,CAACN,MAAlC,CAFD,EAGE;AACDY,MAAAA,mBAAmB,CAACD,IAApB,CAA0B;AACzBG,QAAAA,GAAG,EAAElE,eAAe,CAAE;AACrB6D,UAAAA,KAAK,EAAE,EADc;AAErBM,UAAAA,QAAQ,EAAE,MAFW;AAGrBC,UAAAA,kBAAkB,EAAE,KAHC;AAIrBC,UAAAA,qBAAqB,EAAE,IAJF;AAKrBC,UAAAA,gBAAgB,EAAE;AALG,SAAF;AADK,OAA1B;AASA;;AAED,WAAO1D,cAAc,IAAI8C,WAAW,CAACN,MAA9B,GACJ/C,QAAQ,CAACoD,MADL,GAEJO,mBAFH;AAGA,GApCqB,EAoCnB,CAAE3D,QAAF,EAAYO,cAAZ,CApCmB,CAAtB;;AAsCA,MAAK,CAAEC,IAAP,EAAc;AACb,WAAO,IAAP;AACA;;AAED,SACC,cAAC,gBAAD,QACC,cAAC,gBAAD,QACC,cAAC,0BAAD;AACC,IAAA,QAAQ,EAAG+B,cADZ;AAEC,IAAA,IAAI,EAAG/B,IAFR;AAGC,IAAA,YAAY,EAAGP,YAHhB;AAIC,IAAA,cAAc,EAAG,KAJlB;AAKC,IAAA,kBAAkB,EAAGY,cAAc,GAAGC,QAAH,GAAcoD,SALlD;AAAA,OAMMhE;AANN,KAQC,cAAC,aAAD,QACC,cAAC,WAAD,OADD,EAEC,cAAC,oBAAD;AAAsB,IAAA,MAAM,EAAGJ;AAA/B,IAFD,EAGC,cAAC,MAAD;AAAQ,IAAA,MAAM,EAAGsD;AAAjB,IAHD,CARD,EAaC,cAAC,eAAD,OAbD,CADD,CADD,CADD;AAqBA;;AAED,eAAevD,MAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tErrorBoundary,\n\tPostLockedModal,\n\tstore as editorStore,\n\tprivateApis as editorPrivateApis,\n} from '@wordpress/editor';\nimport { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';\nimport { useMemo } from '@wordpress/element';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { ShortcutProvider } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { CommandMenu } from '@wordpress/commands';\nimport { privateApis as coreCommandsPrivateApis } from '@wordpress/core-commands';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport EditorInitialization from './components/editor-initialization';\nimport { store as editPostStore } from './store';\nimport { unlock } from './lock-unlock';\n\nconst { ExperimentalEditorProvider } = unlock( editorPrivateApis );\nconst { getLayoutStyles } = unlock( blockEditorPrivateApis );\nconst { useCommands } = unlock( coreCommandsPrivateApis );\n\nfunction Editor( { postId, postType, settings, initialEdits, ...props } ) {\n\tuseCommands();\n\tconst {\n\t\thasFixedToolbar,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thasInlineToolbar,\n\t\thasThemeStyles,\n\t\tpost,\n\t\tpreferredStyleVariations,\n\t\thiddenBlockTypes,\n\t\tblockTypes,\n\t\tkeepCaretInsideBlock,\n\t\tisTemplateMode,\n\t\ttemplate,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisFeatureActive,\n\t\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\t\tisEditingTemplate,\n\t\t\t\tgetEditedPostTemplate,\n\t\t\t\tgetHiddenBlockTypes,\n\t\t\t} = select( editPostStore );\n\t\t\tconst { getEntityRecord, getPostType, getEntityRecords, canUser } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst { getEditorSettings } = select( editorStore );\n\t\t\tconst { getBlockTypes } = select( blocksStore );\n\t\t\tconst isTemplate = [ 'wp_template', 'wp_template_part' ].includes(\n\t\t\t\tpostType\n\t\t\t);\n\t\t\t// Ideally the initializeEditor function should be called using the ID of the REST endpoint.\n\t\t\t// to avoid the special case.\n\t\t\tlet postObject;\n\t\t\tif ( isTemplate ) {\n\t\t\t\tconst posts = getEntityRecords( 'postType', postType, {\n\t\t\t\t\twp_id: postId,\n\t\t\t\t} );\n\t\t\t\tpostObject = posts?.[ 0 ];\n\t\t\t} else {\n\t\t\t\tpostObject = getEntityRecord( 'postType', postType, postId );\n\t\t\t}\n\t\t\tconst supportsTemplateMode =\n\t\t\t\tgetEditorSettings().supportsTemplateMode;\n\t\t\tconst isViewable = getPostType( postType )?.viewable ?? false;\n\t\t\tconst canEditTemplate = canUser( 'create', 'templates' );\n\n\t\t\treturn {\n\t\t\t\thasFixedToolbar:\n\t\t\t\t\tisFeatureActive( 'fixedToolbar' ) ||\n\t\t\t\t\t__experimentalGetPreviewDeviceType() !== 'Desktop',\n\t\t\t\tfocusMode: isFeatureActive( 'focusMode' ),\n\t\t\t\tisDistractionFree: isFeatureActive( 'distractionFree' ),\n\t\t\t\thasInlineToolbar: isFeatureActive( 'inlineToolbar' ),\n\t\t\t\thasThemeStyles: isFeatureActive( 'themeStyles' ),\n\t\t\t\tpreferredStyleVariations: select( preferencesStore ).get(\n\t\t\t\t\t'core/edit-post',\n\t\t\t\t\t'preferredStyleVariations'\n\t\t\t\t),\n\t\t\t\thiddenBlockTypes: getHiddenBlockTypes(),\n\t\t\t\tblockTypes: getBlockTypes(),\n\t\t\t\tkeepCaretInsideBlock: isFeatureActive( 'keepCaretInsideBlock' ),\n\t\t\t\tisTemplateMode: isEditingTemplate(),\n\t\t\t\ttemplate:\n\t\t\t\t\tsupportsTemplateMode && isViewable && canEditTemplate\n\t\t\t\t\t\t? getEditedPostTemplate()\n\t\t\t\t\t\t: null,\n\t\t\t\tpost: postObject,\n\t\t\t};\n\t\t},\n\t\t[ postType, postId ]\n\t);\n\n\tconst { updatePreferredStyleVariations, setIsInserterOpened } =\n\t\tuseDispatch( editPostStore );\n\n\tconst editorSettings = useMemo( () => {\n\t\tconst result = {\n\t\t\t...settings,\n\t\t\t__experimentalPreferredStyleVariations: {\n\t\t\t\tvalue: preferredStyleVariations,\n\t\t\t\tonChange: updatePreferredStyleVariations,\n\t\t\t},\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t\tisDistractionFree,\n\t\t\thasInlineToolbar,\n\n\t\t\t// This is marked as experimental to give time for the quick inserter to mature.\n\t\t\t__experimentalSetIsInserterOpened: setIsInserterOpened,\n\t\t\tkeepCaretInsideBlock,\n\t\t\t// Keep a reference of the `allowedBlockTypes` from the server to handle use cases\n\t\t\t// where we need to differentiate if a block is disabled by the user or some plugin.\n\t\t\tdefaultAllowedBlockTypes: settings.allowedBlockTypes,\n\t\t};\n\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes.length > 0 ) {\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\tresult.allowedBlockTypes = defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn result;\n\t}, [\n\t\tsettings,\n\t\thasFixedToolbar,\n\t\thasInlineToolbar,\n\t\tfocusMode,\n\t\tisDistractionFree,\n\t\thiddenBlockTypes,\n\t\tblockTypes,\n\t\tpreferredStyleVariations,\n\t\tsetIsInserterOpened,\n\t\tupdatePreferredStyleVariations,\n\t\tkeepCaretInsideBlock,\n\t] );\n\n\tconst styles = useMemo( () => {\n\t\tconst themeStyles = [];\n\t\tconst presetStyles = [];\n\t\tsettings.styles?.forEach( ( style ) => {\n\t\t\tif ( ! style.__unstableType || style.__unstableType === 'theme' ) {\n\t\t\t\tthemeStyles.push( style );\n\t\t\t} else {\n\t\t\t\tpresetStyles.push( style );\n\t\t\t}\n\t\t} );\n\n\t\tconst defaultEditorStyles = [\n\t\t\t...settings.defaultEditorStyles,\n\t\t\t...presetStyles,\n\t\t];\n\n\t\t// If theme styles are not present or displayed, ensure that\n\t\t// base layout styles are still present in the editor.\n\t\tif (\n\t\t\t! settings.disableLayoutStyles &&\n\t\t\t! ( hasThemeStyles && themeStyles.length )\n\t\t) {\n\t\t\tdefaultEditorStyles.push( {\n\t\t\t\tcss: getLayoutStyles( {\n\t\t\t\t\tstyle: {},\n\t\t\t\t\tselector: 'body',\n\t\t\t\t\thasBlockGapSupport: false,\n\t\t\t\t\thasFallbackGapSupport: true,\n\t\t\t\t\tfallbackGapValue: '0.5em',\n\t\t\t\t} ),\n\t\t\t} );\n\t\t}\n\n\t\treturn hasThemeStyles && themeStyles.length\n\t\t\t? settings.styles\n\t\t\t: defaultEditorStyles;\n\t}, [ settings, hasThemeStyles ] );\n\n\tif ( ! post ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ShortcutProvider>\n\t\t\t<SlotFillProvider>\n\t\t\t\t<ExperimentalEditorProvider\n\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\tpost={ post }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t__unstableTemplate={ isTemplateMode ? template : undefined }\n\t\t\t\t\t{ ...props }\n\t\t\t\t>\n\t\t\t\t\t<ErrorBoundary>\n\t\t\t\t\t\t<CommandMenu />\n\t\t\t\t\t\t<EditorInitialization postId={ postId } />\n\t\t\t\t\t\t<Layout styles={ styles } />\n\t\t\t\t\t</ErrorBoundary>\n\t\t\t\t\t<PostLockedModal />\n\t\t\t\t</ExperimentalEditorProvider>\n\t\t\t</SlotFillProvider>\n\t\t</ShortcutProvider>\n\t);\n}\n\nexport default Editor;\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -64,12 +63,9 @@ class Editor extends Component {
64
63
  // all block types).
65
64
 
66
65
 
67
- const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(_ref => {
68
- let {
69
- name
70
- } = _ref;
71
- return name;
72
- }) : settings.allowedBlockTypes || [];
66
+ const defaultAllowedBlockTypes = true === settings.allowedBlockTypes ? blockTypes.map(({
67
+ name
68
+ }) => name) : settings.allowedBlockTypes || [];
73
69
  settings.allowedBlockTypes = defaultAllowedBlockTypes.filter(type => !hiddenBlockTypes.includes(type));
74
70
  }
75
71
 
@@ -154,12 +150,13 @@ class Editor extends Component {
154
150
  style: {
155
151
  flex: 1
156
152
  }
157
- }, createElement(SlotFillProvider, null, createElement(EditorProvider, _extends({
153
+ }, createElement(SlotFillProvider, null, createElement(EditorProvider, {
158
154
  settings: editorSettings,
159
155
  post: normalizedPost,
160
156
  initialEdits: initialEdits,
161
- useSubRegistry: false
162
- }, props), createElement(Layout, {
157
+ useSubRegistry: false,
158
+ ...props
159
+ }, createElement(Layout, {
163
160
  setTitleRef: this.setTitleRef
164
161
  }))));
165
162
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/editor.native.js"],"names":["memize","I18nManager","GestureHandlerRootView","Component","EditorProvider","parse","serialize","store","blocksStore","withDispatch","withSelect","compose","subscribeSetFocusOnTitle","subscribeFeaturedImageIdNativeUpdated","SlotFillProvider","coreStore","Layout","editPostStore","Editor","constructor","props","arguments","galleryWithImageBlocks","window","wp","galleryBlockV2Enabled","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","maxSize","setTitleRef","bind","settings","hasFixedToolbar","focusMode","hiddenBlockTypes","blockTypes","isRTL","length","allowedBlockTypes","undefined","defaultAllowedBlockTypes","map","name","filter","type","includes","componentDidMount","editEntityRecord","postType","postId","subscriptionParentSetFocusOnTitle","postTitleRef","focus","focusTitleWhenAvailable","subscriptionParentFeaturedImageIdNativeUpdated","payload","featured_media","featuredImageId","undoIgnore","componentWillUnmount","remove","titleRef","render","initialEdits","post","initialHtml","editorSettings","normalizedPost","id","title","raw","initialTitle","content","status","meta","flex","select","isFeatureActive","getEditorMode","__experimentalGetPreviewDeviceType","getHiddenBlockTypes","getBlockTypes","dispatch"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AACA,SAASC,WAAT,QAA4B,cAA5B;AACA,SAASC,sBAAT,QAAuC,8BAAvC;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,KAAT,EAAgBC,SAAhB,EAA2BC,KAAK,IAAIC,WAApC,QAAuD,mBAAvD;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SACCC,wBADD,EAECC,qCAFD,QAGO,gCAHP;AAIA,SAASC,gBAAT,QAAiC,uBAAjC;AACA,SAASP,KAAK,IAAIQ,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,qBAAnB;AACA,SAAST,KAAK,IAAIU,aAAlB,QAAuC,SAAvC;;AAEA,MAAMC,MAAN,SAAqBf,SAArB,CAA+B;AAC9BgB,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAO,GAAGC,SAAV,EADoB,CAGpB;AACA;;AACA,UAAM;AAAEC,MAAAA,sBAAsB,GAAG;AAA3B,QAAoCF,KAA1C;AACAG,IAAAA,MAAM,CAACC,EAAP,CAAUC,qBAAV,GAAkCH,sBAAlC;;AAEA,QAAKF,KAAK,CAACM,sBAAN,IAAgCN,KAAK,CAACO,IAAN,KAAe,QAApD,EAA+D;AAC9D;AACA,WAAKP,KAAL,CAAWQ,gBAAX,CAA6B,MAA7B;AACA;;AAED,SAAKC,iBAAL,GAAyB7B,MAAM,CAAE,KAAK6B,iBAAP,EAA0B;AACxDC,MAAAA,OAAO,EAAE;AAD+C,KAA1B,CAA/B;AAIA,SAAKC,WAAL,GAAmB,K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IAAgB;AAC7B,QAAM;AAAExD,IAAAA;AAAF,MAAuBwD,QAAQ,CAAEnE,aAAF,CAArC;AACA,QAAM;AAAEgC,IAAAA;AAAF,MAAuBmC,QAAQ,CAAErE,SAAF,CAArC;AACA,SAAO;AACNa,IAAAA,gBADM;AAENqB,IAAAA;AAFM,GAAP;AAIA,CAPW,CApBW,CAAF,CAAP,CA4BV/B,MA5BU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { I18nManager } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { EditorProvider } from '@wordpress/editor';\nimport { parse, serialize, store as blocksStore } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport {\n\tsubscribeSetFocusOnTitle,\n\tsubscribeFeaturedImageIdNativeUpdated,\n} from '@wordpress/react-native-bridge';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { store as editPostStore } from './store';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\t// need to set this globally to avoid race with deprecations\n\t\t// defaulting to true to avoid issues with a not-yet-cached value\n\t\tconst { galleryWithImageBlocks = true } = props;\n\t\twindow.wp.galleryBlockV2Enabled = galleryWithImageBlocks;\n\n\t\tif ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {\n\t\t\t// Enable html mode if the initial mode the parent wants it but we're not already in it.\n\t\t\tthis.props.switchEditorMode( 'text' );\n\t\t}\n\n\t\tthis.getEditorSettings = memize( this.getEditorSettings, {\n\t\t\tmaxSize: 1,\n\t\t} );\n\n\t\tthis.setTitleRef = this.setTitleRef.bind( this );\n\t}\n\n\tgetEditorSettings(\n\t\tsettings,\n\t\thasFixedToolbar,\n\t\tfocusMode,\n\t\thiddenBlockTypes,\n\t\tblockTypes\n\t) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t};\n\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes.length > 0 ) {\n\t\t\tif ( settings.allowedBlockTypes === undefined ) {\n\t\t\t\t// If no specific flags for allowedBlockTypes are set, assume `true`\n\t\t\t\t// meaning allow all block types.\n\t\t\t\tsettings.allowedBlockTypes = true;\n\t\t\t}\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\tsettings.allowedBlockTypes = defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { editEntityRecord, postType, postId } = this.props;\n\n\t\tthis.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(\n\t\t\t() => {\n\t\t\t\tif ( this.postTitleRef ) {\n\t\t\t\t\tthis.postTitleRef.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// If the post title ref is not available, we postpone setting focus to when it's available.\n\t\t\t\t\tthis.focusTitleWhenAvailable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentFeaturedImageIdNativeUpdated =\n\t\t\tsubscribeFeaturedImageIdNativeUpdated( ( payload ) => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ featured_media: payload.featuredImageId },\n\t\t\t\t\t{\n\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentSetFocusOnTitle ) {\n\t\t\tthis.subscriptionParentSetFocusOnTitle.remove();\n\t\t}\n\n\t\tif ( this.subscribeFeaturedImageIdNativeUpdated ) {\n\t\t\tthis.subscribeFeaturedImageIdNativeUpdated.remove();\n\t\t}\n\t}\n\n\tsetTitleRef( titleRef ) {\n\t\tif ( this.focusTitleWhenAvailable && ! this.postTitleRef ) {\n\t\t\tthis.focusTitleWhenAvailable = false;\n\t\t\ttitleRef.focus();\n\t\t}\n\n\t\tthis.postTitleRef = titleRef;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsettings,\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t\tinitialEdits,\n\t\t\thiddenBlockTypes,\n\t\t\tblockTypes,\n\t\t\tpost,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfeaturedImageId,\n\t\t\tinitialHtml,\n\t\t\t...props\n\t\t} = this.props;\n\n\t\tconst editorSettings = this.getEditorSettings(\n\t\t\tsettings,\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t\thiddenBlockTypes,\n\t\t\tblockTypes\n\t\t);\n\n\t\tconst normalizedPost = post || {\n\t\t\tid: postId,\n\t\t\ttitle: {\n\t\t\t\traw: props.initialTitle || '',\n\t\t\t},\n\t\t\tfeatured_media: featuredImageId,\n\t\t\tcontent: {\n\t\t\t\t// Make sure the post content is in sync with gutenberg store\n\t\t\t\t// to avoid marking the post as modified when simply loaded\n\t\t\t\t// For now, let's assume: serialize( parse( html ) ) !== html.\n\t\t\t\traw: serialize( parse( initialHtml || '' ) ),\n\t\t\t},\n\t\t\ttype: postType,\n\t\t\tstatus: 'draft',\n\t\t\tmeta: [],\n\t\t};\n\n\t\treturn (\n\t\t\t<GestureHandlerRootView style={ { flex: 1 } }>\n\t\t\t\t<SlotFillProvider>\n\t\t\t\t\t<EditorProvider\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tpost={ normalizedPost }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Layout setTitleRef={ this.setTitleRef } />\n\t\t\t\t\t</EditorProvider>\n\t\t\t\t</SlotFillProvider>\n\t\t\t</GestureHandlerRootView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisFeatureActive,\n\t\t\tgetEditorMode,\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\tgetHiddenBlockTypes,\n\t\t} = select( editPostStore );\n\t\tconst { getBlockTypes } = select( blocksStore );\n\n\t\treturn {\n\t\t\thasFixedToolbar:\n\t\t\t\tisFeatureActive( 'fixedToolbar' ) ||\n\t\t\t\t__experimentalGetPreviewDeviceType() !== 'Desktop',\n\t\t\tfocusMode: isFeatureActive( 'focusMode' ),\n\t\t\tmode: getEditorMode(),\n\t\t\thiddenBlockTypes: getHiddenBlockTypes(),\n\t\t\tblockTypes: getBlockTypes(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editPostStore );\n\t\tconst { editEntityRecord } = dispatch( coreStore );\n\t\treturn {\n\t\t\tswitchEditorMode,\n\t\t\teditEntityRecord,\n\t\t};\n\t} ),\n] )( Editor );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/editor.native.js"],"names":["memize","I18nManager","GestureHandlerRootView","Component","EditorProvider","parse","serialize","store","blocksStore","withDispatch","withSelect","compose","subscribeSetFocusOnTitle","subscribeFeaturedImageIdNativeUpdated","SlotFillProvider","coreStore","Layout","editPostStore","Editor","constructor","props","arguments","galleryWithImageBlocks","window","wp","galleryBlockV2Enabled","initialHtmlModeEnabled","mode","switchEditorMode","getEditorSettings","maxSize","setTitleRef","bind","settings","hasFixedToolbar","focusMode","hiddenBlockTypes","blockTypes","isRTL","length","allowedBlockTypes","undefined","defaultAllowedBlockTypes","map","name","filter","type","includes","componentDidMount","editEntityRecord","postType","postId","subscriptionParentSetFocusOnTitle","postTitleRef","focus","focusTitleWhenAvailable","subscriptionParentFeaturedImageIdNativeUpdated","payload","featured_media","featuredImageId","undoIgnore","componentWillUnmount","remove","titleRef","render","initialEdits","post","initialHtml","editorSettings","normalizedPost","id","title","raw","initialTitle","content","status","meta","flex","select","isFeatureActive","getEditorMode","__experimentalGetPreviewDeviceType","getHiddenBlockTypes","getBlockTypes","dispatch"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,MAAP,MAAmB,QAAnB;AACA,SAASC,WAAT,QAA4B,cAA5B;AACA,SAASC,sBAAT,QAAuC,8BAAvC;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,oBAA1B;AACA,SAASC,cAAT,QAA+B,mBAA/B;AACA,SAASC,KAAT,EAAgBC,SAAhB,EAA2BC,KAAK,IAAIC,WAApC,QAAuD,mBAAvD;AACA,SAASC,YAAT,EAAuBC,UAAvB,QAAyC,iBAAzC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AACA,SACCC,wBADD,EAECC,qCAFD,QAGO,gCAHP;AAIA,SAASC,gBAAT,QAAiC,uBAAjC;AACA,SAASP,KAAK,IAAIQ,SAAlB,QAAmC,sBAAnC;AAEA;AACA;AACA;;AACA,OAAOC,MAAP,MAAmB,qBAAnB;AACA,SAAST,KAAK,IAAIU,aAAlB,QAAuC,SAAvC;;AAEA,MAAMC,MAAN,SAAqBf,SAArB,CAA+B;AAC9BgB,EAAAA,WAAW,CAAEC,KAAF,EAAU;AACpB,UAAO,GAAGC,SAAV,EADoB,CAGpB;AACA;;AACA,UAAM;AAAEC,MAAAA,sBAAsB,GAAG;AAA3B,QAAoCF,KAA1C;AACAG,IAAAA,MAAM,CAACC,EAAP,CAAUC,qBAAV,GAAkCH,sBAAlC;;AAEA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,OAAO,SAHpC;AAIN9C,IAAAA,SAAS,EAAE4C,eAAe,CAAE,WAAF,CAJpB;AAKNpD,IAAAA,IAAI,EAAEqD,aAAa,EALb;AAMN5C,IAAAA,gBAAgB,EAAE8C,mBAAmB,EAN/B;AAON7C,IAAAA,UAAU,EAAE8C,aAAa;AAPnB,GAAP;AASA,CAlBS,CADa,EAoBvB1E,YAAY,CAAI2E,QAAF,IAAgB;AAC7B,QAAM;AAAExD,IAAAA;AAAF,MAAuBwD,QAAQ,CAAEnE,aAAF,CAArC;AACA,QAAM;AAAEgC,IAAAA;AAAF,MAAuBmC,QAAQ,CAAErE,SAAF,CAArC;AACA,SAAO;AACNa,IAAAA,gBADM;AAENqB,IAAAA;AAFM,GAAP;AAIA,CAPW,CApBW,CAAF,CAAP,CA4BV/B,MA5BU,CAAf","sourcesContent":["/**\n * External dependencies\n */\nimport memize from 'memize';\nimport { I18nManager } from 'react-native';\nimport { GestureHandlerRootView } from 'react-native-gesture-handler';\n\n/**\n * WordPress dependencies\n */\nimport { Component } from '@wordpress/element';\nimport { EditorProvider } from '@wordpress/editor';\nimport { parse, serialize, store as blocksStore } from '@wordpress/blocks';\nimport { withDispatch, withSelect } from '@wordpress/data';\nimport { compose } from '@wordpress/compose';\nimport {\n\tsubscribeSetFocusOnTitle,\n\tsubscribeFeaturedImageIdNativeUpdated,\n} from '@wordpress/react-native-bridge';\nimport { SlotFillProvider } from '@wordpress/components';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport Layout from './components/layout';\nimport { store as editPostStore } from './store';\n\nclass Editor extends Component {\n\tconstructor( props ) {\n\t\tsuper( ...arguments );\n\n\t\t// need to set this globally to avoid race with deprecations\n\t\t// defaulting to true to avoid issues with a not-yet-cached value\n\t\tconst { galleryWithImageBlocks = true } = props;\n\t\twindow.wp.galleryBlockV2Enabled = galleryWithImageBlocks;\n\n\t\tif ( props.initialHtmlModeEnabled && props.mode === 'visual' ) {\n\t\t\t// Enable html mode if the initial mode the parent wants it but we're not already in it.\n\t\t\tthis.props.switchEditorMode( 'text' );\n\t\t}\n\n\t\tthis.getEditorSettings = memize( this.getEditorSettings, {\n\t\t\tmaxSize: 1,\n\t\t} );\n\n\t\tthis.setTitleRef = this.setTitleRef.bind( this );\n\t}\n\n\tgetEditorSettings(\n\t\tsettings,\n\t\thasFixedToolbar,\n\t\tfocusMode,\n\t\thiddenBlockTypes,\n\t\tblockTypes\n\t) {\n\t\tsettings = {\n\t\t\t...settings,\n\t\t\tisRTL: I18nManager.isRTL,\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t};\n\n\t\t// Omit hidden block types if exists and non-empty.\n\t\tif ( hiddenBlockTypes.length > 0 ) {\n\t\t\tif ( settings.allowedBlockTypes === undefined ) {\n\t\t\t\t// If no specific flags for allowedBlockTypes are set, assume `true`\n\t\t\t\t// meaning allow all block types.\n\t\t\t\tsettings.allowedBlockTypes = true;\n\t\t\t}\n\t\t\t// Defer to passed setting for `allowedBlockTypes` if provided as\n\t\t\t// anything other than `true` (where `true` is equivalent to allow\n\t\t\t// all block types).\n\t\t\tconst defaultAllowedBlockTypes =\n\t\t\t\ttrue === settings.allowedBlockTypes\n\t\t\t\t\t? blockTypes.map( ( { name } ) => name )\n\t\t\t\t\t: settings.allowedBlockTypes || [];\n\n\t\t\tsettings.allowedBlockTypes = defaultAllowedBlockTypes.filter(\n\t\t\t\t( type ) => ! hiddenBlockTypes.includes( type )\n\t\t\t);\n\t\t}\n\n\t\treturn settings;\n\t}\n\n\tcomponentDidMount() {\n\t\tconst { editEntityRecord, postType, postId } = this.props;\n\n\t\tthis.subscriptionParentSetFocusOnTitle = subscribeSetFocusOnTitle(\n\t\t\t() => {\n\t\t\t\tif ( this.postTitleRef ) {\n\t\t\t\t\tthis.postTitleRef.focus();\n\t\t\t\t} else {\n\t\t\t\t\t// If the post title ref is not available, we postpone setting focus to when it's available.\n\t\t\t\t\tthis.focusTitleWhenAvailable = true;\n\t\t\t\t}\n\t\t\t}\n\t\t);\n\n\t\tthis.subscriptionParentFeaturedImageIdNativeUpdated =\n\t\t\tsubscribeFeaturedImageIdNativeUpdated( ( payload ) => {\n\t\t\t\teditEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t\t{ featured_media: payload.featuredImageId },\n\t\t\t\t\t{\n\t\t\t\t\t\tundoIgnore: true,\n\t\t\t\t\t}\n\t\t\t\t);\n\t\t\t} );\n\t}\n\n\tcomponentWillUnmount() {\n\t\tif ( this.subscriptionParentSetFocusOnTitle ) {\n\t\t\tthis.subscriptionParentSetFocusOnTitle.remove();\n\t\t}\n\n\t\tif ( this.subscribeFeaturedImageIdNativeUpdated ) {\n\t\t\tthis.subscribeFeaturedImageIdNativeUpdated.remove();\n\t\t}\n\t}\n\n\tsetTitleRef( titleRef ) {\n\t\tif ( this.focusTitleWhenAvailable && ! this.postTitleRef ) {\n\t\t\tthis.focusTitleWhenAvailable = false;\n\t\t\ttitleRef.focus();\n\t\t}\n\n\t\tthis.postTitleRef = titleRef;\n\t}\n\n\trender() {\n\t\tconst {\n\t\t\tsettings,\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t\tinitialEdits,\n\t\t\thiddenBlockTypes,\n\t\t\tblockTypes,\n\t\t\tpost,\n\t\t\tpostId,\n\t\t\tpostType,\n\t\t\tfeaturedImageId,\n\t\t\tinitialHtml,\n\t\t\t...props\n\t\t} = this.props;\n\n\t\tconst editorSettings = this.getEditorSettings(\n\t\t\tsettings,\n\t\t\thasFixedToolbar,\n\t\t\tfocusMode,\n\t\t\thiddenBlockTypes,\n\t\t\tblockTypes\n\t\t);\n\n\t\tconst normalizedPost = post || {\n\t\t\tid: postId,\n\t\t\ttitle: {\n\t\t\t\traw: props.initialTitle || '',\n\t\t\t},\n\t\t\tfeatured_media: featuredImageId,\n\t\t\tcontent: {\n\t\t\t\t// Make sure the post content is in sync with gutenberg store\n\t\t\t\t// to avoid marking the post as modified when simply loaded\n\t\t\t\t// For now, let's assume: serialize( parse( html ) ) !== html.\n\t\t\t\traw: serialize( parse( initialHtml || '' ) ),\n\t\t\t},\n\t\t\ttype: postType,\n\t\t\tstatus: 'draft',\n\t\t\tmeta: [],\n\t\t};\n\n\t\treturn (\n\t\t\t<GestureHandlerRootView style={ { flex: 1 } }>\n\t\t\t\t<SlotFillProvider>\n\t\t\t\t\t<EditorProvider\n\t\t\t\t\t\tsettings={ editorSettings }\n\t\t\t\t\t\tpost={ normalizedPost }\n\t\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t>\n\t\t\t\t\t\t<Layout setTitleRef={ this.setTitleRef } />\n\t\t\t\t\t</EditorProvider>\n\t\t\t\t</SlotFillProvider>\n\t\t\t</GestureHandlerRootView>\n\t\t);\n\t}\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tisFeatureActive,\n\t\t\tgetEditorMode,\n\t\t\t__experimentalGetPreviewDeviceType,\n\t\t\tgetHiddenBlockTypes,\n\t\t} = select( editPostStore );\n\t\tconst { getBlockTypes } = select( blocksStore );\n\n\t\treturn {\n\t\t\thasFixedToolbar:\n\t\t\t\tisFeatureActive( 'fixedToolbar' ) ||\n\t\t\t\t__experimentalGetPreviewDeviceType() !== 'Desktop',\n\t\t\tfocusMode: isFeatureActive( 'focusMode' ),\n\t\t\tmode: getEditorMode(),\n\t\t\thiddenBlockTypes: getHiddenBlockTypes(),\n\t\t\tblockTypes: getBlockTypes(),\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { switchEditorMode } = dispatch( editPostStore );\n\t\tconst { editEntityRecord } = dispatch( coreStore );\n\t\treturn {\n\t\t\tswitchEditorMode,\n\t\t\teditEntityRecord,\n\t\t};\n\t} ),\n] )( Editor );\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -34,34 +33,27 @@ withSelect((select, block) => {
34
33
 
35
34
 
36
35
  const blocks = select(blockEditorStore).getBlocks();
37
- const firstOfSameType = blocks.find(_ref => {
38
- let {
39
- name
40
- } = _ref;
41
- return block.name === name;
42
- });
36
+ const firstOfSameType = blocks.find(({
37
+ name
38
+ }) => block.name === name);
43
39
  const isInvalid = firstOfSameType && firstOfSameType.clientId !== block.clientId;
44
40
  return {
45
41
  originalBlockClientId: isInvalid && firstOfSameType.clientId
46
42
  };
47
- }), withDispatch((dispatch, _ref2) => {
48
- let {
49
- originalBlockClientId
50
- } = _ref2;
51
- return {
52
- selectFirst: () => dispatch(blockEditorStore).selectBlock(originalBlockClientId)
53
- };
54
- }));
43
+ }), withDispatch((dispatch, {
44
+ originalBlockClientId
45
+ }) => ({
46
+ selectFirst: () => dispatch(blockEditorStore).selectBlock(originalBlockClientId)
47
+ })));
55
48
  const withMultipleValidation = createHigherOrderComponent(BlockEdit => {
56
- return enhance(_ref3 => {
57
- let {
58
- originalBlockClientId,
59
- selectFirst,
60
- ...props
61
- } = _ref3;
62
-
49
+ return enhance(({
50
+ originalBlockClientId,
51
+ selectFirst,
52
+ ...props
53
+ }) => {
63
54
  if (!originalBlockClientId) {
64
- return createElement(BlockEdit, props);
55
+ return createElement(BlockEdit, { ...props
56
+ });
65
57
  }
66
58
 
67
59
  const blockType = getBlockType(props.name);
@@ -71,9 +63,10 @@ const withMultipleValidation = createHigherOrderComponent(BlockEdit => {
71
63
  style: {
72
64
  minHeight: '60px'
73
65
  }
74
- }, createElement(BlockEdit, _extends({
75
- key: "block-edit"
76
- }, props))), createElement(Warning, {
66
+ }, createElement(BlockEdit, {
67
+ key: "block-edit",
68
+ ...props
69
+ })), createElement(Warning, {
77
70
  key: "multiple-use-warning",
78
71
  actions: [createElement(Button, {
79
72
  key: "find-original",
@@ -88,7 +81,7 @@ const withMultipleValidation = createHigherOrderComponent(BlockEdit => {
88
81
  variant: "secondary",
89
82
  onClick: () => props.onReplace(createBlock(outboundType.name, props.attributes))
90
83
  }, __('Transform into:'), " ", outboundType.title)]
91
- }, createElement("strong", null, blockType === null || blockType === void 0 ? void 0 : blockType.title, ": "), __('This block can only be used once.'))];
84
+ }, createElement("strong", null, blockType?.title, ": "), __('This block can only be used once.'))];
92
85
  });
93
86
  }, 'withMultipleValidation');
94
87
  /**
@@ -102,13 +95,10 @@ const withMultipleValidation = createHigherOrderComponent(BlockEdit => {
102
95
 
103
96
  function getOutboundType(blockName) {
104
97
  // Grab the first outbound transform.
105
- const transform = findTransform(getBlockTransforms('to', blockName), _ref4 => {
106
- let {
107
- type,
108
- blocks
109
- } = _ref4;
110
- return type === 'block' && blocks.length === 1;
111
- } // What about when .length > 1?
98
+ const transform = findTransform(getBlockTransforms('to', blockName), ({
99
+ type,
100
+ blocks
101
+ }) => type === 'block' && blocks.length === 1 // What about when .length > 1?
112
102
  );
113
103
 
114
104
  if (!transform) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/hooks/validate-multiple-use/index.js"],"names":["createBlock","findTransform","getBlockTransforms","getBlockType","hasBlockSupport","Button","withSelect","withDispatch","Warning","store","blockEditorStore","addFilter","__","compose","createHigherOrderComponent","enhance","select","block","multiple","name","blocks","getBlocks","firstOfSameType","find","isInvalid","clientId","originalBlockClientId","dispatch","selectFirst","selectBlock","withMultipleValidation","BlockEdit","props","blockType","outboundType","getOutboundType","minHeight","onReplace","attributes","title","blockName","transform","type","length"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,WADD,EAECC,aAFD,EAGCC,kBAHD,EAICC,YAJD,EAKCC,eALD,QAMO,mBANP;AAOA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,EAAkBC,KAAK,IAAIC,gBAA3B,QAAmD,yBAAnD;AACA,SAASC,SAAT,QAA0B,kBAA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D,EAqDtD,wBArDsD,CAAzD;AAuDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASuB,eAAT,CAA0BK,SAA1B,EAAsC;AACrC;AACA,QAAMC,SAAS,GAAGxC,aAAa,CAC9BC,kBAAkB,CAAE,IAAF,EAAQsC,SAAR,CADY,EAE9B;AAAA,QAAE;AAAEE,MAAAA,IAAF;AAAQtB,MAAAA;AAAR,KAAF;AAAA,WAAwBsB,IAAI,KAAK,OAAT,IAAoBtB,MAAM,CAACuB,MAAP,KAAkB,CAA9D;AAAA,GAF8B,CAEkC;AAFlC,GAA/B;;AAKA,MAAK,CAAEF,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SAAOtC,YAAY,CAAEsC,SAAS,CAACrB,MAAV,CAAkB,CAAlB,CAAF,CAAnB;AACA;;AAEDT,SAAS,CACR,kBADQ,EAER,+DAFQ,EAGRmB,sBAHQ,CAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateBlock,\n\tfindTransform,\n\tgetBlockTransforms,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { Button } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { Warning, store as blockEditorStore } from '@wordpress/block-editor';\nimport { addFilter } from '@wordpress/hooks';\nimport { __ } from '@wordpress/i18n';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\n\nconst enhance = compose(\n\t/**\n\t * For blocks whose block type doesn't support `multiple`, provides the\n\t * wrapped component with `originalBlockClientId` -- a reference to the\n\t * first block of the same type in the content -- if and only if that\n\t * \"original\" block is not the current one. Thus, an inexisting\n\t * `originalBlockClientId` prop signals that the block is valid.\n\t *\n\t * @param {WPComponent} WrappedBlockEdit A filtered BlockEdit instance.\n\t *\n\t * @return {WPComponent} Enhanced component with merged state data props.\n\t */\n\twithSelect( ( select, block ) => {\n\t\tconst multiple = hasBlockSupport( block.name, 'multiple', true );\n\n\t\t// For block types with `multiple` support, there is no \"original\n\t\t// block\" to be found in the content, as the block itself is valid.\n\t\tif ( multiple ) {\n\t\t\treturn {};\n\t\t}\n\n\t\t// Otherwise, only pass `originalBlockClientId` if it refers to a different\n\t\t// block from the current one.\n\t\tconst blocks = select( blockEditorStore ).getBlocks();\n\t\tconst firstOfSameType = blocks.find(\n\t\t\t( { name } ) => block.name === name\n\t\t);\n\t\tconst isInvalid =\n\t\t\tfirstOfSameType && firstOfSameType.clientId !== block.clientId;\n\t\treturn {\n\t\t\toriginalBlockClientId: isInvalid && firstOfSameType.clientId,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { originalBlockClientId } ) => ( {\n\t\tselectFirst: () =>\n\t\t\tdispatch( blockEditorStore ).selectBlock( originalBlockClientId ),\n\t} ) )\n);\n\nconst withMultipleValidation = createHigherOrderComponent( ( BlockEdit ) => {\n\treturn enhance( ( { originalBlockClientId, selectFirst, ...props } ) => {\n\t\tif ( ! originalBlockClientId ) {\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t}\n\n\t\tconst blockType = getBlockType( props.name );\n\t\tconst outboundType = getOutboundType( props.name );\n\n\t\treturn [\n\t\t\t<div key=\"invalid-preview\" style={ { minHeight: '60px' } }>\n\t\t\t\t<BlockEdit key=\"block-edit\" { ...props } />\n\t\t\t</div>,\n\t\t\t<Warning\n\t\t\t\tkey=\"multiple-use-warning\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"find-original\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ selectFirst }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Find original' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"remove\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ () => props.onReplace( [] ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\toutboundType && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey=\"transform\"\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tprops.onReplace(\n\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\toutboundType.name,\n\t\t\t\t\t\t\t\t\t\tprops.attributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Transform into:' ) } { outboundType.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t),\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t<strong>{ blockType?.title }: </strong>\n\t\t\t\t{ __( 'This block can only be used once.' ) }\n\t\t\t</Warning>,\n\t\t];\n\t} );\n}, 'withMultipleValidation' );\n\n/**\n * Given a base block name, returns the default block type to which to offer\n * transforms.\n *\n * @param {string} blockName Base block name.\n *\n * @return {?Object} The chosen default block type.\n */\nfunction getOutboundType( blockName ) {\n\t// Grab the first outbound transform.\n\tconst transform = findTransform(\n\t\tgetBlockTransforms( 'to', blockName ),\n\t\t( { type, blocks } ) => type === 'block' && blocks.length === 1 // What about when .length > 1?\n\t);\n\n\tif ( ! transform ) {\n\t\treturn null;\n\t}\n\n\treturn getBlockType( transform.blocks[ 0 ] );\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-post/validate-multiple-use/with-multiple-validation',\n\twithMultipleValidation\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/hooks/validate-multiple-use/index.js"],"names":["createBlock","findTransform","getBlockTransforms","getBlockType","hasBlockSupport","Button","withSelect","withDispatch","Warning","store","blockEditorStore","addFilter","__","compose","createHigherOrderComponent","enhance","select","block","multiple","name","blocks","getBlocks","firstOfSameType","find","isInvalid","clientId","originalBlockClientId","dispatch","selectFirst","selectBlock","withMultipleValidation","BlockEdit","props","blockType","outboundType","getOutboundType","minHeight","onReplace","attributes","title","blockName","transform","type","length"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,WADD,EAECC,aAFD,EAGCC,kBAHD,EAICC,YAJD,EAKCC,eALD,QAMO,mBANP;AAOA,SAASC,MAAT,QAAuB,uBAAvB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,iBAAzC;AACA,SAASC,OAAT,EAAkBC,KAAK,IAAIC,gBAA3B,QAAmD,yBAAnD;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,OAAT,EAAkBC,0BAAlB,QAAoD,oBAApD;AAEA,MAAMC,OAAO,GAAGF,OAAO;AACtB;AACD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACCP,UAAU,CAAE,CAAEU,MAAF,EAAUC,KAAV,KAAqB;AAChC,QAAMC,QAAQ,GAAGd,eAAe,CAAEa,KAAK,CAACE,IAAR,EAAc,UAAd,EAA0B,IAA1B,CAAhC,CADgC,CAGhC;AACA;;AACA,MAAKD,QAAL,EAAgB;AACf,WAAO,EAAP;AACA,GAP+B,CAShC;AACA;;;AACA,QAAME,MAAM,GAAGJ,MAAM,CAAEN,gBAAF,CAAN,CAA2BW,SAA3B,EAAf;AACA,QAAMC,eAAe,GAAGF,MAAM,CAACG,IAAP,CACvB,CAAE;AAAEJ,IAAAA;AAAF,GAAF,KAAgBF,KAAK,CAACE,IAAN,KAAeA,IADR,CAAxB;AAGA,QAAMK,SAAS,GACdF,eAAe,IAAIA,eAAe,CAACG,QAAhB,KAA6BR,KAAK,CAACQ,QADvD;AAEA,SAAO;AACNC,IAAAA,qBAAqB,EAAEF,SAAS,IAAIF,eAAe,CAACG;AAD9C,GAAP;AAGA,CApBS,CAZY,EAiCtBlB,YAAY,CAAE,CAAEoB,QAAF,EAAY;AAAED,EAAAA;AAAF,CAAZ,MAA6C;AAC1DE,EAAAA,WAAW,EAAE,M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W,CACVkC,YAAY,CAACf,IADH,EAEVa,KAAK,CAACM,UAFI,CADZ;AAJF,SAYG1B,EAAE,CAAE,iBAAF,CAZL,OAY+BsB,YAAY,CAACK,KAZ5C,CAhBQ;AAFX,OAmCC,8BAAUN,SAAS,EAAEM,KAArB,OAnCD,EAoCG3B,EAAE,CAAE,mCAAF,CApCL,CAJM,CAAP;AA2CA,GAnDa,CAAd;AAoDA,CArDwD,EAqDtD,wBArDsD,CAAzD;AAuDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASuB,eAAT,CAA0BK,SAA1B,EAAsC;AACrC;AACA,QAAMC,SAAS,GAAGxC,aAAa,CAC9BC,kBAAkB,CAAE,IAAF,EAAQsC,SAAR,CADY,EAE9B,CAAE;AAAEE,IAAAA,IAAF;AAAQtB,IAAAA;AAAR,GAAF,KAAwBsB,IAAI,KAAK,OAAT,IAAoBtB,MAAM,CAACuB,MAAP,KAAkB,CAFhC,CAEkC;AAFlC,GAA/B;;AAKA,MAAK,CAAEF,SAAP,EAAmB;AAClB,WAAO,IAAP;AACA;;AAED,SAAOtC,YAAY,CAAEsC,SAAS,CAACrB,MAAV,CAAkB,CAAlB,CAAF,CAAnB;AACA;;AAEDT,SAAS,CACR,kBADQ,EAER,+DAFQ,EAGRmB,sBAHQ,CAAT","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tcreateBlock,\n\tfindTransform,\n\tgetBlockTransforms,\n\tgetBlockType,\n\thasBlockSupport,\n} from '@wordpress/blocks';\nimport { Button } from '@wordpress/components';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { Warning, store as blockEditorStore } from '@wordpress/block-editor';\nimport { addFilter } from '@wordpress/hooks';\nimport { __ } from '@wordpress/i18n';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\n\nconst enhance = compose(\n\t/**\n\t * For blocks whose block type doesn't support `multiple`, provides the\n\t * wrapped component with `originalBlockClientId` -- a reference to the\n\t * first block of the same type in the content -- if and only if that\n\t * \"original\" block is not the current one. Thus, an inexisting\n\t * `originalBlockClientId` prop signals that the block is valid.\n\t *\n\t * @param {WPComponent} WrappedBlockEdit A filtered BlockEdit instance.\n\t *\n\t * @return {WPComponent} Enhanced component with merged state data props.\n\t */\n\twithSelect( ( select, block ) => {\n\t\tconst multiple = hasBlockSupport( block.name, 'multiple', true );\n\n\t\t// For block types with `multiple` support, there is no \"original\n\t\t// block\" to be found in the content, as the block itself is valid.\n\t\tif ( multiple ) {\n\t\t\treturn {};\n\t\t}\n\n\t\t// Otherwise, only pass `originalBlockClientId` if it refers to a different\n\t\t// block from the current one.\n\t\tconst blocks = select( blockEditorStore ).getBlocks();\n\t\tconst firstOfSameType = blocks.find(\n\t\t\t( { name } ) => block.name === name\n\t\t);\n\t\tconst isInvalid =\n\t\t\tfirstOfSameType && firstOfSameType.clientId !== block.clientId;\n\t\treturn {\n\t\t\toriginalBlockClientId: isInvalid && firstOfSameType.clientId,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch, { originalBlockClientId } ) => ( {\n\t\tselectFirst: () =>\n\t\t\tdispatch( blockEditorStore ).selectBlock( originalBlockClientId ),\n\t} ) )\n);\n\nconst withMultipleValidation = createHigherOrderComponent( ( BlockEdit ) => {\n\treturn enhance( ( { originalBlockClientId, selectFirst, ...props } ) => {\n\t\tif ( ! originalBlockClientId ) {\n\t\t\treturn <BlockEdit { ...props } />;\n\t\t}\n\n\t\tconst blockType = getBlockType( props.name );\n\t\tconst outboundType = getOutboundType( props.name );\n\n\t\treturn [\n\t\t\t<div key=\"invalid-preview\" style={ { minHeight: '60px' } }>\n\t\t\t\t<BlockEdit key=\"block-edit\" { ...props } />\n\t\t\t</div>,\n\t\t\t<Warning\n\t\t\t\tkey=\"multiple-use-warning\"\n\t\t\t\tactions={ [\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"find-original\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ selectFirst }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Find original' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey=\"remove\"\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tonClick={ () => props.onReplace( [] ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Remove' ) }\n\t\t\t\t\t</Button>,\n\t\t\t\t\toutboundType && (\n\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\tkey=\"transform\"\n\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\t\tprops.onReplace(\n\t\t\t\t\t\t\t\t\tcreateBlock(\n\t\t\t\t\t\t\t\t\t\toutboundType.name,\n\t\t\t\t\t\t\t\t\t\tprops.attributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ __( 'Transform into:' ) } { outboundType.title }\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t),\n\t\t\t\t] }\n\t\t\t>\n\t\t\t\t<strong>{ blockType?.title }: </strong>\n\t\t\t\t{ __( 'This block can only be used once.' ) }\n\t\t\t</Warning>,\n\t\t];\n\t} );\n}, 'withMultipleValidation' );\n\n/**\n * Given a base block name, returns the default block type to which to offer\n * transforms.\n *\n * @param {string} blockName Base block name.\n *\n * @return {?Object} The chosen default block type.\n */\nfunction getOutboundType( blockName ) {\n\t// Grab the first outbound transform.\n\tconst transform = findTransform(\n\t\tgetBlockTransforms( 'to', blockName ),\n\t\t( { type, blocks } ) => type === 'block' && blocks.length === 1 // What about when .length > 1?\n\t);\n\n\tif ( ! transform ) {\n\t\treturn null;\n\t}\n\n\treturn getBlockType( transform.blocks[ 0 ] );\n}\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/edit-post/validate-multiple-use/with-multiple-validation',\n\twithMultipleValidation\n);\n"]}
@@ -72,7 +72,7 @@ export function initializeEditor(id, postType, postId, settings, initialEdits) {
72
72
  });
73
73
  }
74
74
  /*
75
- * Prevent adding template part and post content block in the post editor.
75
+ * Prevent adding template part in the post editor.
76
76
  * Only add the filter when the post editor is initialized, not imported.
77
77
  * Also only add the filter(s) after registerCoreBlocks()
78
78
  * so that common filters in the block library are not overwritten.
@@ -80,10 +80,26 @@ export function initializeEditor(id, postType, postId, settings, initialEdits) {
80
80
 
81
81
 
82
82
  addFilter('blockEditor.__unstableCanInsertBlockType', 'removeTemplatePartsFromInserter', (canInsert, blockType) => {
83
- if (!select(editPostStore).isEditingTemplate() && (blockType.name === 'core/template-part' || blockType.name === 'core/post-content')) {
83
+ if (!select(editPostStore).isEditingTemplate() && blockType.name === 'core/template-part') {
84
84
  return false;
85
85
  }
86
86
 
87
+ return canInsert;
88
+ });
89
+ /*
90
+ * Prevent adding post content block (except in query block) in the post editor.
91
+ * Only add the filter when the post editor is initialized, not imported.
92
+ * Also only add the filter(s) after registerCoreBlocks()
93
+ * so that common filters in the block library are not overwritten.
94
+ */
95
+
96
+ addFilter('blockEditor.__unstableCanInsertBlockType', 'removePostContentFromInserter', (canInsert, blockType, rootClientId, {
97
+ getBlockParentsByBlockName
98
+ }) => {
99
+ if (!select(editPostStore).isEditingTemplate() && blockType.name === 'core/post-content') {
100
+ return getBlockParentsByBlockName(rootClientId, 'core/query').length > 0;
101
+ }
102
+
87
103
  return canInsert;
88
104
  }); // Show a console log warning if the browser is not in Standards rendering mode.
89
105
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","addFilter","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","Editor","editPostStore","initializeEditor","id","postType","postId","settings","initialEdits","target","document","getElementById","root","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","isFeatureActive","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","canInsert","blockType","isEditingTemplate","name","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","reinitializeEditor","since","version","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR,KAAK,IAAIS,gBAAlB,QAA0C,wBAA1C;AACA,SACCC,yBADD,EAECC,wBAFD,QAGO,oBAHP;AAKA;AACA;AACA;;AACA,OAAO,SAAP;AACA,OAAO,WAAP;AACA,OAAOC,MAAP,MAAmB,UAAnB;AACA,SAASZ,KAAK,IAAIa,aAAlB,QAAuC,SAAvC;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CACNC,EADM,EAENC,QAFM,EAGNC,MAHM,EAINC,QAJM,EAKNC,YALM,EAML;AACD,QAAMC,MAAM,GAAGC,QAAQ,CAACC,cAAT,CAAyBP,EAAzB,CAAf;AACA,QAAMQ,IAAI,GAAGlB,UAAU,CAAEe,MAA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AhGA,CAkGD;;;AACAV,EAAAA,MAAM,CAACI,gBAAP,CAAyB,UAAzB,EAAuCO,CAAF,IAASA,CAAC,CAACC,cAAF,EAA9C,EAAkE,KAAlE;AACAZ,EAAAA,MAAM,CAACI,gBAAP,CAAyB,MAAzB,EAAmCO,CAAF,IAASA,CAAC,CAACC,cAAF,EAA1C,EAA8D,KAA9D;AAEA9C,EAAAA,IAAI,CAAC+C,MAAL,CACC,cAAC,MAAD;AACC,IAAA,QAAQ,EAAGpD,QADZ;AAEC,IAAA,MAAM,EAAGD,MAFV;AAGC,IAAA,QAAQ,EAAGD,QAHZ;AAIC,IAAA,YAAY,EAAGG;AAJhB,IADD;AASA,SAAOI,IAAP;AACA;AAED;AACA;AACA;;AACA,OAAO,SAASgD,kBAAT,GAA8B;AACpCnE,EAAAA,UAAU,CAAE,gCAAF,EAAoC;AAC7CoE,IAAAA,KAAK,EAAE,KADsC;AAE7CC,IAAAA,OAAO,EAAE;AAFoC,GAApC,CAAV;AAIA;AAED,SAASC,OAAO,IAAIC,2BAApB,QAAuD,kEAAvD;AACA,SAASD,OAAO,IAAIE,0BAApB,QAAsD,oDAAtD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,2CAA9C;AACA,SAASH,OAAO,IAAII,sBAApB,QAAkD,gDAAlD;AACA,SAASJ,OAAO,IAAIK,oBAApB,QAAgD,8CAAhD;AACA,SAASL,OAAO,IAAIM,qBAApB,QAAiD,+CAAjD;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,qCAAzC;AACA,SAASP,OAAO,IAAIQ,yBAApB,QAAqD,mDAArD;AACA,SAASR,OAAO,IAAIS,iCAApB,QAA6D,2CAA7D;AACA,SAAST,OAAO,IAAIU,iCAApB,QAA6D,2CAA7D;AACA,SAASpF,KAAT,QAAsB,SAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\tif ( select( editPostStore ).isFeatureActive( 'showListViewByDefault' ) ) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t/*\n\t * Prevent adding template part and post content block in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\t( blockType.name === 'core/template-part' ||\n\t\t\t\t\tblockType.name === 'core/post-content' )\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/index.js"],"names":["store","blocksStore","registerCoreBlocks","__experimentalRegisterExperimentalCoreBlocks","deprecated","createRoot","dispatch","select","addFilter","preferencesStore","registerLegacyWidgetBlock","registerWidgetGroupBlock","Editor","editPostStore","initializeEditor","id","postType","postId","settings","initialEdits","target","document","getElementById","root","setDefaults","editorMode","fixedToolbar","fullscreenMode","hiddenBlockTypes","inactivePanels","isPublishSidebarEnabled","openPanels","preferredStyleVariations","showBlockBreadcrumbs","showIconLabels","showListViewByDefault","themeStyles","welcomeGuide","welcomeGuideTemplate","__experimentalReapplyBlockTypeFilters","isFeatureActive","setIsListViewOpened","inserter","process","env","IS_GUTENBERG_PLUGIN","enableFSEBlocks","__unstableEnableFullSiteEditingBlocks","canInsert","blockType","isEditingTemplate","name","rootClientId","getBlockParentsByBlockName","length","documentMode","compatMode","console","warn","isIphone","window","navigator","userAgent","indexOf","addEventListener","event","editorScrollContainer","getElementsByClassName","scrollY","scrollTop","scrollTo","e","preventDefault","render","reinitializeEditor","since","version","default","PluginBlockSettingsMenuItem","PluginDocumentSettingPanel","PluginMoreMenuItem","PluginPostPublishPanel","PluginPostStatusInfo","PluginPrePublishPanel","PluginSidebar","PluginSidebarMoreMenuItem","__experimentalFullscreenModeClose","__experimentalMainDashboardButton"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,WAAlB,QAAqC,mBAArC;AACA,SACCC,kBADD,EAECC,4CAFD,QAGO,0BAHP;AAIA,OAAOC,UAAP,MAAuB,uBAAvB;AACA,SAASC,UAAT,QAA2B,oBAA3B;AACA,SAASC,QAAT,EAAmBC,MAAnB,QAAiC,iBAAjC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASR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;AASA,SAAOI,IAAP;AACA;AAED;AACA;AACA;;AACA,OAAO,SAASmD,kBAAT,GAA8B;AACpCtE,EAAAA,UAAU,CAAE,gCAAF,EAAoC;AAC7CuE,IAAAA,KAAK,EAAE,KADsC;AAE7CC,IAAAA,OAAO,EAAE;AAFoC,GAApC,CAAV;AAIA;AAED,SAASC,OAAO,IAAIC,2BAApB,QAAuD,kEAAvD;AACA,SAASD,OAAO,IAAIE,0BAApB,QAAsD,oDAAtD;AACA,SAASF,OAAO,IAAIG,kBAApB,QAA8C,2CAA9C;AACA,SAASH,OAAO,IAAII,sBAApB,QAAkD,gDAAlD;AACA,SAASJ,OAAO,IAAIK,oBAApB,QAAgD,8CAAhD;AACA,SAASL,OAAO,IAAIM,qBAApB,QAAiD,+CAAjD;AACA,SAASN,OAAO,IAAIO,aAApB,QAAyC,qCAAzC;AACA,SAASP,OAAO,IAAIQ,yBAApB,QAAqD,mDAArD;AACA,SAASR,OAAO,IAAIS,iCAApB,QAA6D,2CAA7D;AACA,SAAST,OAAO,IAAIU,iCAApB,QAA6D,2CAA7D;AACA,SAASvF,KAAT,QAAsB,SAAtB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport {\n\tregisterCoreBlocks,\n\t__experimentalRegisterExperimentalCoreBlocks,\n} from '@wordpress/block-library';\nimport deprecated from '@wordpress/deprecated';\nimport { createRoot } from '@wordpress/element';\nimport { dispatch, select } from '@wordpress/data';\nimport { addFilter } from '@wordpress/hooks';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tregisterLegacyWidgetBlock,\n\tregisterWidgetGroupBlock,\n} from '@wordpress/widgets';\n\n/**\n * Internal dependencies\n */\nimport './hooks';\nimport './plugins';\nimport Editor from './editor';\nimport { store as editPostStore } from './store';\n\n/**\n * Initializes and returns an instance of Editor.\n *\n * @param {string} id Unique identifier for editor instance.\n * @param {string} postType Post type of the post to edit.\n * @param {Object} postId ID of the post to edit.\n * @param {?Object} settings Editor settings object.\n * @param {Object} initialEdits Programmatic edits to apply initially, to be\n * considered as non-user-initiated (bypass for\n * unsaved changes prompt).\n */\nexport function initializeEditor(\n\tid,\n\tpostType,\n\tpostId,\n\tsettings,\n\tinitialEdits\n) {\n\tconst target = document.getElementById( id );\n\tconst root = createRoot( target );\n\n\tdispatch( preferencesStore ).setDefaults( 'core/edit-post', {\n\t\teditorMode: 'visual',\n\t\tfixedToolbar: false,\n\t\tfullscreenMode: true,\n\t\thiddenBlockTypes: [],\n\t\tinactivePanels: [],\n\t\tisPublishSidebarEnabled: true,\n\t\topenPanels: [ 'post-status' ],\n\t\tpreferredStyleVariations: {},\n\t\tshowBlockBreadcrumbs: true,\n\t\tshowIconLabels: false,\n\t\tshowListViewByDefault: false,\n\t\tthemeStyles: true,\n\t\twelcomeGuide: true,\n\t\twelcomeGuideTemplate: true,\n\t} );\n\n\tdispatch( blocksStore ).__experimentalReapplyBlockTypeFilters();\n\n\t// Check if the block list view should be open by default.\n\tif ( select( editPostStore ).isFeatureActive( 'showListViewByDefault' ) ) {\n\t\tdispatch( editPostStore ).setIsListViewOpened( true );\n\t}\n\n\tregisterCoreBlocks();\n\tregisterLegacyWidgetBlock( { inserter: false } );\n\tregisterWidgetGroupBlock( { inserter: false } );\n\tif ( process.env.IS_GUTENBERG_PLUGIN ) {\n\t\t__experimentalRegisterExperimentalCoreBlocks( {\n\t\t\tenableFSEBlocks: settings.__unstableEnableFullSiteEditingBlocks,\n\t\t} );\n\t}\n\n\t/*\n\t * Prevent adding template part in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removeTemplatePartsFromInserter',\n\t\t( canInsert, blockType ) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/template-part'\n\t\t\t) {\n\t\t\t\treturn false;\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t/*\n\t * Prevent adding post content block (except in query block) in the post editor.\n\t * Only add the filter when the post editor is initialized, not imported.\n\t * Also only add the filter(s) after registerCoreBlocks()\n\t * so that common filters in the block library are not overwritten.\n\t */\n\taddFilter(\n\t\t'blockEditor.__unstableCanInsertBlockType',\n\t\t'removePostContentFromInserter',\n\t\t(\n\t\t\tcanInsert,\n\t\t\tblockType,\n\t\t\trootClientId,\n\t\t\t{ getBlockParentsByBlockName }\n\t\t) => {\n\t\t\tif (\n\t\t\t\t! select( editPostStore ).isEditingTemplate() &&\n\t\t\t\tblockType.name === 'core/post-content'\n\t\t\t) {\n\t\t\t\treturn (\n\t\t\t\t\tgetBlockParentsByBlockName( rootClientId, 'core/query' )\n\t\t\t\t\t\t.length > 0\n\t\t\t\t);\n\t\t\t}\n\t\t\treturn canInsert;\n\t\t}\n\t);\n\n\t// Show a console log warning if the browser is not in Standards rendering mode.\n\tconst documentMode =\n\t\tdocument.compatMode === 'CSS1Compat' ? 'Standards' : 'Quirks';\n\tif ( documentMode !== 'Standards' ) {\n\t\t// eslint-disable-next-line no-console\n\t\tconsole.warn(\n\t\t\t\"Your browser is using Quirks Mode. \\nThis can cause rendering issues such as blocks overlaying meta boxes in the editor. Quirks Mode can be triggered by PHP errors or HTML code appearing before the opening <!DOCTYPE html>. Try checking the raw page source or your site's PHP error log and resolving errors there, removing any HTML before the doctype, or disabling plugins.\"\n\t\t);\n\t}\n\n\t// This is a temporary fix for a couple of issues specific to Webkit on iOS.\n\t// Without this hack the browser scrolls the mobile toolbar off-screen.\n\t// Once supported in Safari we can replace this in favor of preventScroll.\n\t// For details see issue #18632 and PR #18686\n\t// Specifically, we scroll `interface-interface-skeleton__body` to enable a fixed top toolbar.\n\t// But Mobile Safari forces the `html` element to scroll upwards, hiding the toolbar.\n\n\tconst isIphone = window.navigator.userAgent.indexOf( 'iPhone' ) !== -1;\n\tif ( isIphone ) {\n\t\twindow.addEventListener( 'scroll', ( event ) => {\n\t\t\tconst editorScrollContainer = document.getElementsByClassName(\n\t\t\t\t'interface-interface-skeleton__body'\n\t\t\t)[ 0 ];\n\t\t\tif ( event.target === document ) {\n\t\t\t\t// Scroll element into view by scrolling the editor container by the same amount\n\t\t\t\t// that Mobile Safari tried to scroll the html element upwards.\n\t\t\t\tif ( window.scrollY > 100 ) {\n\t\t\t\t\teditorScrollContainer.scrollTop =\n\t\t\t\t\t\teditorScrollContainer.scrollTop + window.scrollY;\n\t\t\t\t}\n\t\t\t\t// Undo unwanted scroll on html element, but only in the visual editor.\n\t\t\t\tif (\n\t\t\t\t\tdocument.getElementsByClassName( 'is-mode-visual' )[ 0 ]\n\t\t\t\t) {\n\t\t\t\t\twindow.scrollTo( 0, 0 );\n\t\t\t\t}\n\t\t\t}\n\t\t} );\n\t}\n\n\t// Prevent the default browser action for files dropped outside of dropzones.\n\twindow.addEventListener( 'dragover', ( e ) => e.preventDefault(), false );\n\twindow.addEventListener( 'drop', ( e ) => e.preventDefault(), false );\n\n\troot.render(\n\t\t<Editor\n\t\t\tsettings={ settings }\n\t\t\tpostId={ postId }\n\t\t\tpostType={ postType }\n\t\t\tinitialEdits={ initialEdits }\n\t\t/>\n\t);\n\n\treturn root;\n}\n\n/**\n * Used to reinitialize the editor after an error. Now it's a deprecated noop function.\n */\nexport function reinitializeEditor() {\n\tdeprecated( 'wp.editPost.reinitializeEditor', {\n\t\tsince: '6.2',\n\t\tversion: '6.3',\n\t} );\n}\n\nexport { default as PluginBlockSettingsMenuItem } from './components/block-settings-menu/plugin-block-settings-menu-item';\nexport { default as PluginDocumentSettingPanel } from './components/sidebar/plugin-document-setting-panel';\nexport { default as PluginMoreMenuItem } from './components/header/plugin-more-menu-item';\nexport { default as PluginPostPublishPanel } from './components/sidebar/plugin-post-publish-panel';\nexport { default as PluginPostStatusInfo } from './components/sidebar/plugin-post-status-info';\nexport { default as PluginPrePublishPanel } from './components/sidebar/plugin-pre-publish-panel';\nexport { default as PluginSidebar } from './components/sidebar/plugin-sidebar';\nexport { default as PluginSidebarMoreMenuItem } from './components/header/plugin-sidebar-more-menu-item';\nexport { default as __experimentalFullscreenModeClose } from './components/header/fullscreen-mode-close';\nexport { default as __experimentalMainDashboardButton } from './components/header/main-dashboard-button';\nexport { store } from './store';\n"]}
@@ -6,4 +6,4 @@ export const {
6
6
  lock,
7
7
  unlock
8
8
  } = __dangerousOptInToUnstableAPIsOnlyForCoreModules('I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.', '@wordpress/edit-post');
9
- //# sourceMappingURL=private-apis.js.map
9
+ //# sourceMappingURL=lock-unlock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["@wordpress/edit-post/src/lock-unlock.js"],"names":["__dangerousOptInToUnstableAPIsOnlyForCoreModules","lock","unlock"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,gDAAT,QAAiE,yBAAjE;AAEA,OAAO,MAAM;AAAEC,EAAAA,IAAF;AAAQC,EAAAA;AAAR,IACZF,gDAAgD,CAC/C,8GAD+C,EAE/C,sBAF+C,CAD1C","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/private-apis';\n\nexport const { lock, unlock } =\n\t__dangerousOptInToUnstableAPIsOnlyForCoreModules(\n\t\t'I know using unstable features means my plugin or theme will inevitably break on the next WordPress release.',\n\t\t'@wordpress/edit-post'\n\t);\n"]}
@@ -18,29 +18,26 @@ import ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';
18
18
  import WelcomeGuideMenuItem from './welcome-guide-menu-item';
19
19
  registerPlugin('edit-post', {
20
20
  render() {
21
- return createElement(Fragment, null, createElement(ToolsMoreMenuGroup, null, _ref => {
22
- let {
23
- onClose
24
- } = _ref;
25
- return createElement(Fragment, null, createElement(MenuItem, {
26
- role: "menuitem",
27
- href: addQueryArgs('edit.php', {
28
- post_type: 'wp_block'
29
- })
30
- }, __('Manage Reusable blocks')), createElement(KeyboardShortcutsHelpMenuItem, {
31
- onSelect: onClose
32
- }), createElement(WelcomeGuideMenuItem, null), createElement(CopyContentMenuItem, null), createElement(MenuItem, {
33
- role: "menuitem",
34
- icon: external,
35
- href: __('https://wordpress.org/documentation/article/wordpress-block-editor/'),
36
- target: "_blank",
37
- rel: "noopener noreferrer"
38
- }, __('Help'), createElement(VisuallyHidden, {
39
- as: "span"
40
- },
41
- /* translators: accessibility text */
42
- __('(opens in a new tab)'))));
43
- }));
21
+ return createElement(Fragment, null, createElement(ToolsMoreMenuGroup, null, ({
22
+ onClose
23
+ }) => createElement(Fragment, null, createElement(MenuItem, {
24
+ role: "menuitem",
25
+ href: addQueryArgs('edit.php', {
26
+ post_type: 'wp_block'
27
+ })
28
+ }, __('Manage Patterns')), createElement(KeyboardShortcutsHelpMenuItem, {
29
+ onSelect: onClose
30
+ }), createElement(WelcomeGuideMenuItem, null), createElement(CopyContentMenuItem, null), createElement(MenuItem, {
31
+ role: "menuitem",
32
+ icon: external,
33
+ href: __('https://wordpress.org/documentation/article/wordpress-block-editor/'),
34
+ target: "_blank",
35
+ rel: "noopener noreferrer"
36
+ }, __('Help'), createElement(VisuallyHidden, {
37
+ as: "span"
38
+ },
39
+ /* translators: accessibility text */
40
+ __('(opens in a new tab)'))))));
44
41
  }
45
42
 
46
43
  });
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["MenuItem","VisuallyHidden","external","__","registerPlugin","addQueryArgs","CopyContentMenuItem","KeyboardShortcutsHelpMenuItem","ToolsMoreMenuGroup","WelcomeGuideMenuItem","render","onClose","post_type"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,cAAnB,QAAyC,uBAAzC;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,oBAA/B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,6BAAP,MAA0C,qCAA1C;AACA,OAAOC,kBAAP,MAA+B,4CAA/B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AAEAL,cAAc,CAAE,WAAF,EAAe;AAC5BM,EAAAA,MAAM,GAAG;AACR,WACC,8BACC,cAAC,kBAAD,QACG;AAAA,UAAE;AAAEC,QAAAA;AAAF,OAAF;AAAA,aACD,8BACC,cAAC,QAAD;AACC,QAAA,IAAI,EAAC,UADN;AAEC,QAAA,IAAI,EAAGN,YAAY,CAAE,UAAF,EAAc;AAChCO,UAAAA,SAAS,EAAE;AADqB,SAAd;AAFpB,SAMGT,EAAE,CAAE,wBAAF,CANL,CADD,EASC,cAAC,6BAAD;AACC,QAAA,QAAQ,EAAGQ;AADZ,QATD,EAYC,cAAC,oBAAD,OAZD,EAaC,cAAC,mBAAD,OAbD,EAcC,cAAC,QAAD;AACC,QAAA,IAAI,EAAC,UADN;AAEC,QAAA,IAAI,EAAGT,QAFR;AAGC,QAAA,IAAI,EAAGC,EAAE,CACR,qEADQ,CAHV;AAMC,QAAA,MAAM,EAAC,QANR;AAOC,QAAA,GAAG,EAAC;AAPL,SASGA,EAAE,CAAE,MAAF,CATL,EAUC,cAAC,cAAD;AAAgB,QAAA,EAAE,EAAC;AAAnB;AAEE;AACAA,MAAAA,EAAE,CAAE,sBAAF,CAHJ,CAVD,CAdD,CADC;AAAA,KADH,CADD,CADD;AAwCA;;AA1C2B,CAAf,CAAd","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\t\t\tpost_type: 'wp_block',\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Manage Reusable blocks' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/plugins/index.js"],"names":["MenuItem","VisuallyHidden","external","__","registerPlugin","addQueryArgs","CopyContentMenuItem","KeyboardShortcutsHelpMenuItem","ToolsMoreMenuGroup","WelcomeGuideMenuItem","render","onClose","post_type"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,cAAnB,QAAyC,uBAAzC;AACA,SAASC,QAAT,QAAyB,kBAAzB;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,cAAT,QAA+B,oBAA/B;AACA,SAASC,YAAT,QAA6B,gBAA7B;AAEA;AACA;AACA;;AACA,OAAOC,mBAAP,MAAgC,0BAAhC;AACA,OAAOC,6BAAP,MAA0C,qCAA1C;AACA,OAAOC,kBAAP,MAA+B,4CAA/B;AACA,OAAOC,oBAAP,MAAiC,2BAAjC;AAEAL,cAAc,CAAE,WAAF,EAAe;AAC5BM,EAAAA,MAAM,GAAG;AACR,WACC,8BACC,cAAC,kBAAD,QACG,CAAE;AAAEC,MAAAA;AAAF,KAAF,KACD,8BACC,cAAC,QAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAGN,YAAY,CAAE,UAAF,EAAc;AAChCO,QAAAA,SAAS,EAAE;AADqB,OAAd;AAFpB,OAMGT,EAAE,CAAE,iBAAF,CANL,CADD,EASC,cAAC,6BAAD;AACC,MAAA,QAAQ,EAAGQ;AADZ,MATD,EAYC,cAAC,oBAAD,OAZD,EAaC,cAAC,mBAAD,OAbD,EAcC,cAAC,QAAD;AACC,MAAA,IAAI,EAAC,UADN;AAEC,MAAA,IAAI,EAAGT,QAFR;AAGC,MAAA,IAAI,EAAGC,EAAE,CACR,qEADQ,CAHV;AAMC,MAAA,MAAM,EAAC,QANR;AAOC,MAAA,GAAG,EAAC;AAPL,OASGA,EAAE,CAAE,MAAF,CATL,EAUC,cAAC,cAAD;AAAgB,MAAA,EAAE,EAAC;AAAnB;AAEE;AACAA,IAAAA,EAAE,CAAE,sBAAF,CAHJ,CAVD,CAdD,CAFF,CADD,CADD;AAwCA;;AA1C2B,CAAf,CAAd","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem, VisuallyHidden } from '@wordpress/components';\nimport { external } from '@wordpress/icons';\nimport { __ } from '@wordpress/i18n';\nimport { registerPlugin } from '@wordpress/plugins';\nimport { addQueryArgs } from '@wordpress/url';\n\n/**\n * Internal dependencies\n */\nimport CopyContentMenuItem from './copy-content-menu-item';\nimport KeyboardShortcutsHelpMenuItem from './keyboard-shortcuts-help-menu-item';\nimport ToolsMoreMenuGroup from '../components/header/tools-more-menu-group';\nimport WelcomeGuideMenuItem from './welcome-guide-menu-item';\n\nregisterPlugin( 'edit-post', {\n\trender() {\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<ToolsMoreMenuGroup>\n\t\t\t\t\t{ ( { onClose } ) => (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\thref={ addQueryArgs( 'edit.php', {\n\t\t\t\t\t\t\t\t\tpost_type: 'wp_block',\n\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Manage Patterns' ) }\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t\t<KeyboardShortcutsHelpMenuItem\n\t\t\t\t\t\t\t\tonSelect={ onClose }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<WelcomeGuideMenuItem />\n\t\t\t\t\t\t\t<CopyContentMenuItem />\n\t\t\t\t\t\t\t<MenuItem\n\t\t\t\t\t\t\t\trole=\"menuitem\"\n\t\t\t\t\t\t\t\ticon={ external }\n\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t'https://wordpress.org/documentation/article/wordpress-block-editor/'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\ttarget=\"_blank\"\n\t\t\t\t\t\t\t\trel=\"noopener noreferrer\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Help' ) }\n\t\t\t\t\t\t\t\t<VisuallyHidden as=\"span\">\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\t/* translators: accessibility text */\n\t\t\t\t\t\t\t\t\t\t__( '(opens in a new tab)' )\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t</VisuallyHidden>\n\t\t\t\t\t\t\t</MenuItem>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsMoreMenuGroup>\n\t\t\t</>\n\t\t);\n\t},\n} );\n"]}
@@ -12,10 +12,9 @@ import { displayShortcut } from '@wordpress/keycodes';
12
12
  */
13
13
 
14
14
  import { store as editPostStore } from '../../store';
15
- export function KeyboardShortcutsHelpMenuItem(_ref) {
16
- let {
17
- openModal
18
- } = _ref;
15
+ export function KeyboardShortcutsHelpMenuItem({
16
+ openModal
17
+ }) {
19
18
  return createElement(MenuItem, {
20
19
  onClick: () => {
21
20
  openModal('edit-post/keyboard-shortcut-help');
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"names":["MenuItem","withDispatch","__","displayShortcut","store","editPostStore","KeyboardShortcutsHelpMenuItem","openModal","access","dispatch"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,uBAAzB;AACA,SAASC,YAAT,QAA6B,iBAA7B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,qBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,OAAO,SAASC,6BAAT,OAAwD;AAAA,MAAhB;AAAEC,IAAAA;AAAF,GAAgB;AAC9D,SACC,cAAC,QAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfA,MAAAA,SAAS,CAAE,kCAAF,CAAT;AACA,KAHF;AAIC,IAAA,QAAQ,EAAGJ,eAAe,CAACK,MAAhB,CAAwB,GAAxB;AAJZ,KAMGN,EAAE,CAAE,oBAAF,CANL,CADD;AAUA;AAED,eAAeD,YAAY,CAAIQ,QAAF,IAAgB;AAC5C,QAAM;AAAEF,IAAAA;AAAF,MAAgBE,QAAQ,CAAEJ,aAAF,CAA9B;AAEA,SAAO;AACNE,IAAAA;AADM,GAAP;AAGA,CAN0B,CAAZ,CAMVD,6BANU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { withDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function KeyboardShortcutsHelpMenuItem( { openModal } ) {\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( 'edit-post/keyboard-shortcut-help' );\n\t\t\t} }\n\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t>\n\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default withDispatch( ( dispatch ) => {\n\tconst { openModal } = dispatch( editPostStore );\n\n\treturn {\n\t\topenModal,\n\t};\n} )( KeyboardShortcutsHelpMenuItem );\n"]}
1
+ {"version":3,"sources":["@wordpress/edit-post/src/plugins/keyboard-shortcuts-help-menu-item/index.js"],"names":["MenuItem","withDispatch","__","displayShortcut","store","editPostStore","KeyboardShortcutsHelpMenuItem","openModal","access","dispatch"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,QAAT,QAAyB,uBAAzB;AACA,SAASC,YAAT,QAA6B,iBAA7B;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,eAAT,QAAgC,qBAAhC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,aAAlB,QAAuC,aAAvC;AAEA,OAAO,SAASC,6BAAT,CAAwC;AAAEC,EAAAA;AAAF,CAAxC,EAAwD;AAC9D,SACC,cAAC,QAAD;AACC,IAAA,OAAO,EAAG,MAAM;AACfA,MAAAA,SAAS,CAAE,kCAAF,CAAT;AACA,KAHF;AAIC,IAAA,QAAQ,EAAGJ,eAAe,CAACK,MAAhB,CAAwB,GAAxB;AAJZ,KAMGN,EAAE,CAAE,oBAAF,CANL,CADD;AAUA;AAED,eAAeD,YAAY,CAAIQ,QAAF,IAAgB;AAC5C,QAAM;AAAEF,IAAAA;AAAF,MAAgBE,QAAQ,CAAEJ,aAAF,CAA9B;AAEA,SAAO;AACNE,IAAAA;AADM,GAAP;AAGA,CAN0B,CAAZ,CAMVD,6BANU,CAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { MenuItem } from '@wordpress/components';\nimport { withDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport { displayShortcut } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { store as editPostStore } from '../../store';\n\nexport function KeyboardShortcutsHelpMenuItem( { openModal } ) {\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\topenModal( 'edit-post/keyboard-shortcut-help' );\n\t\t\t} }\n\t\t\tshortcut={ displayShortcut.access( 'h' ) }\n\t\t>\n\t\t\t{ __( 'Keyboard shortcuts' ) }\n\t\t</MenuItem>\n\t);\n}\n\nexport default withDispatch( ( dispatch ) => {\n\tconst { openModal } = dispatch( editPostStore );\n\n\treturn {\n\t\topenModal,\n\t};\n} )( KeyboardShortcutsHelpMenuItem );\n"]}