@wordpress/editor 13.31.0 → 13.33.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (647) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/README.md +1080 -0
  3. package/build/bindings/index.js.map +1 -1
  4. package/build/bindings/pattern-overrides.js.map +1 -1
  5. package/build/bindings/post-meta.js +12 -30
  6. package/build/bindings/post-meta.js.map +1 -1
  7. package/build/components/autocompleters/index.js.map +1 -1
  8. package/build/components/autocompleters/user.js.map +1 -1
  9. package/build/components/autosave-monitor/index.js +10 -0
  10. package/build/components/autosave-monitor/index.js.map +1 -1
  11. package/build/components/block-manager/category.js.map +1 -1
  12. package/build/components/block-manager/checklist.js.map +1 -1
  13. package/build/components/block-manager/index.js.map +1 -1
  14. package/build/components/block-removal-warnings/index.js.map +1 -1
  15. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +107 -0
  16. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
  17. package/build/components/character-count/index.js.map +1 -1
  18. package/build/components/commands/index.js +20 -1
  19. package/build/components/commands/index.js.map +1 -1
  20. package/build/components/commands/index.native.js.map +1 -1
  21. package/build/components/deprecated.js +158 -0
  22. package/build/components/deprecated.js.map +1 -1
  23. package/build/components/deprecated.native.js.map +1 -1
  24. package/build/components/document-bar/index.js +5 -8
  25. package/build/components/document-bar/index.js.map +1 -1
  26. package/build/components/document-outline/check.js.map +1 -1
  27. package/build/components/document-outline/index.js.map +1 -1
  28. package/build/components/document-outline/item.js.map +1 -1
  29. package/build/components/document-tools/index.js +1 -1
  30. package/build/components/document-tools/index.js.map +1 -1
  31. package/build/components/editor-canvas/edit-template-blocks-notification.js +12 -38
  32. package/build/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  33. package/build/components/editor-canvas/index.js +5 -2
  34. package/build/components/editor-canvas/index.js.map +1 -1
  35. package/build/components/editor-help/add-blocks.native.js.map +1 -1
  36. package/build/components/editor-help/customize-blocks.native.js.map +1 -1
  37. package/build/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  38. package/build/components/editor-help/help-get-support-button.native.js.map +1 -1
  39. package/build/components/editor-help/help-section-title.native.js.map +1 -1
  40. package/build/components/editor-help/help-topic-row.native.js.map +1 -1
  41. package/build/components/editor-help/icon-move-blocks.native.js.map +1 -1
  42. package/build/components/editor-help/index.native.js.map +1 -1
  43. package/build/components/editor-help/intro-to-blocks.native.js.map +1 -1
  44. package/build/components/editor-help/move-blocks.native.js.map +1 -1
  45. package/build/components/editor-help/remove-blocks.native.js.map +1 -1
  46. package/build/components/editor-help/view-sections.native.js.map +1 -1
  47. package/build/components/editor-history/redo.js.map +1 -1
  48. package/build/components/editor-history/undo.js.map +1 -1
  49. package/build/components/editor-notices/index.js.map +1 -1
  50. package/build/components/editor-snackbars/index.js.map +1 -1
  51. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  52. package/build/components/entities-saved-states/entity-type-list.js.map +1 -1
  53. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  54. package/build/components/entities-saved-states/index.js +11 -85
  55. package/build/components/entities-saved-states/index.js.map +1 -1
  56. package/build/components/error-boundary/index.js.map +1 -1
  57. package/build/components/error-boundary/index.native.js.map +1 -1
  58. package/build/components/global-keyboard-shortcuts/index.js +24 -0
  59. package/build/components/global-keyboard-shortcuts/index.js.map +1 -1
  60. package/build/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  61. package/build/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  62. package/build/components/index.js +57 -1
  63. package/build/components/index.js.map +1 -1
  64. package/build/components/index.native.js.map +1 -1
  65. package/build/components/inserter-sidebar/index.js +5 -1
  66. package/build/components/inserter-sidebar/index.js.map +1 -1
  67. package/build/components/keyboard-shortcut-help-modal/config.js +78 -0
  68. package/build/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  69. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +49 -0
  70. package/build/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  71. package/build/components/keyboard-shortcut-help-modal/index.js +126 -0
  72. package/build/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  73. package/build/components/keyboard-shortcut-help-modal/shortcut.js +55 -0
  74. package/build/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  75. package/build/components/list-view-sidebar/index.js +2 -1
  76. package/build/components/list-view-sidebar/index.js.map +1 -1
  77. package/build/components/list-view-sidebar/list-view-outline.js.map +1 -1
  78. package/build/components/local-autosave-monitor/index.js.map +1 -1
  79. package/build/components/media-categories/index.js.map +1 -1
  80. package/build/components/mode-switcher/index.js.map +1 -1
  81. package/build/components/offline-status/index.native.js.map +1 -1
  82. package/build/components/page-attributes/check.js.map +1 -1
  83. package/build/components/page-attributes/order.js.map +1 -1
  84. package/build/components/page-attributes/panel.js.map +1 -1
  85. package/build/components/page-attributes/parent.js.map +1 -1
  86. package/build/components/pattern-overrides-panel/index.js +30 -0
  87. package/build/components/pattern-overrides-panel/index.js.map +1 -0
  88. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  89. package/build/components/plugin-more-menu-item/index.js +78 -0
  90. package/build/components/plugin-more-menu-item/index.js.map +1 -0
  91. package/build/components/plugin-post-publish-panel/index.js +68 -0
  92. package/build/components/plugin-post-publish-panel/index.js.map +1 -0
  93. package/build/components/plugin-post-status-info/index.js +73 -0
  94. package/build/components/plugin-post-status-info/index.js.map +1 -0
  95. package/build/components/plugin-pre-publish-panel/index.js +71 -0
  96. package/build/components/plugin-pre-publish-panel/index.js.map +1 -0
  97. package/build/components/plugin-sidebar/index.js +108 -0
  98. package/build/components/plugin-sidebar/index.js.map +1 -0
  99. package/build/components/plugin-sidebar-more-menu-item/index.js +71 -0
  100. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  101. package/build/components/post-actions/actions.js +656 -0
  102. package/build/components/post-actions/actions.js.map +1 -0
  103. package/build/components/post-actions/index.js +137 -0
  104. package/build/components/post-actions/index.js.map +1 -0
  105. package/build/components/post-author/check.js.map +1 -1
  106. package/build/components/post-author/combobox.js.map +1 -1
  107. package/build/components/post-author/constants.js.map +1 -1
  108. package/build/components/post-author/hook.js.map +1 -1
  109. package/build/components/post-author/index.js.map +1 -1
  110. package/build/components/post-author/panel.js.map +1 -1
  111. package/build/components/post-author/select.js.map +1 -1
  112. package/build/components/post-card-panel/index.js +127 -0
  113. package/build/components/post-card-panel/index.js.map +1 -0
  114. package/build/components/post-comments/index.js.map +1 -1
  115. package/build/components/post-discussion/panel.js.map +1 -1
  116. package/build/components/post-excerpt/check.js +8 -0
  117. package/build/components/post-excerpt/check.js.map +1 -1
  118. package/build/components/post-excerpt/index.js.map +1 -1
  119. package/build/components/post-excerpt/panel.js.map +1 -1
  120. package/build/components/post-excerpt/plugin.js.map +1 -1
  121. package/build/components/post-featured-image/check.js.map +1 -1
  122. package/build/components/post-featured-image/index.js.map +1 -1
  123. package/build/components/post-featured-image/panel.js.map +1 -1
  124. package/build/components/post-format/check.js.map +1 -1
  125. package/build/components/post-format/index.js.map +1 -1
  126. package/build/components/post-last-revision/check.js.map +1 -1
  127. package/build/components/post-last-revision/index.js.map +1 -1
  128. package/build/components/post-last-revision/panel.js.map +1 -1
  129. package/build/components/post-locked-modal/index.js.map +1 -1
  130. package/build/components/post-panel-row/index.js.map +1 -1
  131. package/build/components/post-pending-status/check.js.map +1 -1
  132. package/build/components/post-pending-status/index.js.map +1 -1
  133. package/build/components/post-pingbacks/index.js.map +1 -1
  134. package/build/components/post-preview-button/index.js.map +1 -1
  135. package/build/components/post-publish-button/index.js +31 -31
  136. package/build/components/post-publish-button/index.js.map +1 -1
  137. package/build/components/post-publish-button/label.js +51 -43
  138. package/build/components/post-publish-button/label.js.map +1 -1
  139. package/build/components/post-publish-panel/index.js.map +1 -1
  140. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  141. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  142. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  143. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  144. package/build/components/post-publish-panel/postpublish.js.map +1 -1
  145. package/build/components/post-publish-panel/prepublish.js.map +1 -1
  146. package/build/components/post-saved-state/index.js +10 -6
  147. package/build/components/post-saved-state/index.js.map +1 -1
  148. package/build/components/post-schedule/check.js.map +1 -1
  149. package/build/components/post-schedule/index.js.map +1 -1
  150. package/build/components/post-schedule/label.js.map +1 -1
  151. package/build/components/post-schedule/panel.js +8 -0
  152. package/build/components/post-schedule/panel.js.map +1 -1
  153. package/build/components/post-slug/check.js.map +1 -1
  154. package/build/components/post-slug/index.js +43 -68
  155. package/build/components/post-slug/index.js.map +1 -1
  156. package/build/components/post-status/index.js +239 -0
  157. package/build/components/post-status/index.js.map +1 -0
  158. package/build/components/post-sticky/check.js.map +1 -1
  159. package/build/components/post-sticky/index.js.map +1 -1
  160. package/build/components/post-switch-to-draft-button/index.js +6 -1
  161. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  162. package/build/components/post-sync-status/index.js.map +1 -1
  163. package/build/components/post-taxonomies/check.js.map +1 -1
  164. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  165. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  166. package/build/components/post-taxonomies/index.js.map +1 -1
  167. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  168. package/build/components/post-taxonomies/panel.js.map +1 -1
  169. package/build/components/post-template/block-theme.js +6 -2
  170. package/build/components/post-template/block-theme.js.map +1 -1
  171. package/build/components/post-template/classic-theme.js.map +1 -1
  172. package/build/components/post-template/create-new-template-modal.js.map +1 -1
  173. package/build/components/post-template/create-new-template.js.map +1 -1
  174. package/build/components/post-template/hooks.js.map +1 -1
  175. package/build/components/post-template/panel.js.map +1 -1
  176. package/build/components/post-template/reset-default-template.js.map +1 -1
  177. package/build/components/post-template/swap-template-button.js.map +1 -1
  178. package/build/components/post-text-editor/index.js.map +1 -1
  179. package/build/components/post-title/constants.js.map +1 -1
  180. package/build/components/post-title/index.js.map +1 -1
  181. package/build/components/post-title/index.native.js +1 -1
  182. package/build/components/post-title/index.native.js.map +1 -1
  183. package/build/components/post-title/post-title-raw.js.map +1 -1
  184. package/build/components/post-title/use-post-title-focus.js.map +1 -1
  185. package/build/components/post-title/use-post-title.js.map +1 -1
  186. package/build/components/post-trash/check.js +23 -25
  187. package/build/components/post-trash/check.js.map +1 -1
  188. package/build/components/post-trash/index.js +2 -1
  189. package/build/components/post-trash/index.js.map +1 -1
  190. package/build/components/post-type-support-check/index.js.map +1 -1
  191. package/build/components/post-url/check.js.map +1 -1
  192. package/build/components/post-url/index.js +44 -19
  193. package/build/components/post-url/index.js.map +1 -1
  194. package/build/components/post-url/label.js.map +1 -1
  195. package/build/components/post-url/panel.js +14 -7
  196. package/build/components/post-url/panel.js.map +1 -1
  197. package/build/components/post-view-link/index.js.map +1 -1
  198. package/build/components/post-visibility/check.js.map +1 -1
  199. package/build/components/post-visibility/index.js +2 -1
  200. package/build/components/post-visibility/index.js.map +1 -1
  201. package/build/components/post-visibility/label.js.map +1 -1
  202. package/build/components/post-visibility/utils.js.map +1 -1
  203. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  204. package/build/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  205. package/build/components/preferences-modal/index.js +19 -17
  206. package/build/components/preferences-modal/index.js.map +1 -1
  207. package/build/components/preview-dropdown/index.js.map +1 -1
  208. package/build/components/provider/disable-non-page-content-blocks.js +36 -20
  209. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  210. package/build/components/provider/index.js +4 -2
  211. package/build/components/provider/index.js.map +1 -1
  212. package/build/components/provider/index.native.js +6 -1
  213. package/build/components/provider/index.native.js.map +1 -1
  214. package/build/components/provider/navigation-block-editing-mode.js.map +1 -1
  215. package/build/components/provider/use-auto-switch-editor-sidebars.js +52 -0
  216. package/build/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  217. package/build/components/provider/use-block-editor-settings.js +70 -50
  218. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  219. package/build/components/provider/use-block-editor-settings.native.js.map +1 -1
  220. package/build/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  221. package/build/components/provider/with-registry-provider.js +1 -0
  222. package/build/components/provider/with-registry-provider.js.map +1 -1
  223. package/build/components/start-page-options/index.js +139 -0
  224. package/build/components/start-page-options/index.js.map +1 -0
  225. package/build/components/table-of-contents/index.js.map +1 -1
  226. package/build/components/table-of-contents/panel.js.map +1 -1
  227. package/build/components/template-areas/index.js +70 -0
  228. package/build/components/template-areas/index.js.map +1 -0
  229. package/build/components/template-validation-notice/index.js +23 -29
  230. package/build/components/template-validation-notice/index.js.map +1 -1
  231. package/build/components/theme-support-check/index.js +10 -16
  232. package/build/components/theme-support-check/index.js.map +1 -1
  233. package/build/components/time-to-read/index.js.map +1 -1
  234. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  235. package/build/components/word-count/index.js.map +1 -1
  236. package/build/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  237. package/build/hooks/default-autocompleters.js.map +1 -1
  238. package/build/hooks/index.js.map +1 -1
  239. package/build/hooks/index.native.js.map +1 -1
  240. package/build/hooks/pattern-overrides.js +22 -10
  241. package/build/hooks/pattern-overrides.js.map +1 -1
  242. package/build/hooks/use-select-nearest-editable-block.js +87 -0
  243. package/build/hooks/use-select-nearest-editable-block.js.map +1 -0
  244. package/build/index.js.map +1 -1
  245. package/build/index.native.js.map +1 -1
  246. package/build/lock-unlock.js.map +1 -1
  247. package/build/private-apis.js +26 -1
  248. package/build/private-apis.js.map +1 -1
  249. package/build/store/actions.js +46 -6
  250. package/build/store/actions.js.map +1 -1
  251. package/build/store/actions.native.js.map +1 -1
  252. package/build/store/constants.js +10 -1
  253. package/build/store/constants.js.map +1 -1
  254. package/build/store/defaults.js.map +1 -1
  255. package/build/store/index.js +1 -1
  256. package/build/store/index.js.map +1 -1
  257. package/build/store/local-autosave.js.map +1 -1
  258. package/build/store/private-actions.js +253 -1
  259. package/build/store/private-actions.js.map +1 -1
  260. package/build/store/private-selectors.js +50 -3
  261. package/build/store/private-selectors.js.map +1 -1
  262. package/build/store/reducer.js +14 -1
  263. package/build/store/reducer.js.map +1 -1
  264. package/build/store/reducer.native.js.map +1 -1
  265. package/build/store/selectors.js +25 -20
  266. package/build/store/selectors.js.map +1 -1
  267. package/build/store/selectors.native.js.map +1 -1
  268. package/build/store/utils/get-filtered-template-parts.js +71 -0
  269. package/build/store/utils/get-filtered-template-parts.js.map +1 -0
  270. package/build/store/utils/is-template-revertable.js +28 -0
  271. package/build/store/utils/is-template-revertable.js.map +1 -0
  272. package/build/store/utils/notice-builder.js.map +1 -1
  273. package/build/utils/get-template-part-icon.js.map +1 -1
  274. package/build/utils/index.js.map +1 -1
  275. package/build/utils/index.native.js.map +1 -1
  276. package/build/utils/media-upload/index.js.map +1 -1
  277. package/build/utils/media-upload/index.native.js.map +1 -1
  278. package/build/utils/terms.js.map +1 -1
  279. package/build/utils/url.js.map +1 -1
  280. package/build-module/bindings/index.js.map +1 -1
  281. package/build-module/bindings/pattern-overrides.js.map +1 -1
  282. package/build-module/bindings/post-meta.js +14 -31
  283. package/build-module/bindings/post-meta.js.map +1 -1
  284. package/build-module/components/autocompleters/index.js.map +1 -1
  285. package/build-module/components/autocompleters/user.js.map +1 -1
  286. package/build-module/components/autosave-monitor/index.js +10 -0
  287. package/build-module/components/autosave-monitor/index.js.map +1 -1
  288. package/build-module/components/block-manager/category.js.map +1 -1
  289. package/build-module/components/block-manager/checklist.js.map +1 -1
  290. package/build-module/components/block-manager/index.js.map +1 -1
  291. package/build-module/components/block-removal-warnings/index.js.map +1 -1
  292. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +100 -0
  293. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -0
  294. package/build-module/components/character-count/index.js.map +1 -1
  295. package/build-module/components/commands/index.js +21 -2
  296. package/build-module/components/commands/index.js.map +1 -1
  297. package/build-module/components/commands/index.native.js.map +1 -1
  298. package/build-module/components/deprecated.js +159 -0
  299. package/build-module/components/deprecated.js.map +1 -1
  300. package/build-module/components/deprecated.native.js.map +1 -1
  301. package/build-module/components/document-bar/index.js +6 -9
  302. package/build-module/components/document-bar/index.js.map +1 -1
  303. package/build-module/components/document-outline/check.js.map +1 -1
  304. package/build-module/components/document-outline/index.js.map +1 -1
  305. package/build-module/components/document-outline/item.js.map +1 -1
  306. package/build-module/components/document-tools/index.js +1 -1
  307. package/build-module/components/document-tools/index.js.map +1 -1
  308. package/build-module/components/editor-canvas/edit-template-blocks-notification.js +14 -40
  309. package/build-module/components/editor-canvas/edit-template-blocks-notification.js.map +1 -1
  310. package/build-module/components/editor-canvas/index.js +5 -2
  311. package/build-module/components/editor-canvas/index.js.map +1 -1
  312. package/build-module/components/editor-help/add-blocks.native.js.map +1 -1
  313. package/build-module/components/editor-help/customize-blocks.native.js.map +1 -1
  314. package/build-module/components/editor-help/help-detail-navigation-screen.native.js.map +1 -1
  315. package/build-module/components/editor-help/help-get-support-button.native.js.map +1 -1
  316. package/build-module/components/editor-help/help-section-title.native.js.map +1 -1
  317. package/build-module/components/editor-help/help-topic-row.native.js.map +1 -1
  318. package/build-module/components/editor-help/icon-move-blocks.native.js.map +1 -1
  319. package/build-module/components/editor-help/index.native.js.map +1 -1
  320. package/build-module/components/editor-help/intro-to-blocks.native.js.map +1 -1
  321. package/build-module/components/editor-help/move-blocks.native.js.map +1 -1
  322. package/build-module/components/editor-help/remove-blocks.native.js.map +1 -1
  323. package/build-module/components/editor-help/view-sections.native.js.map +1 -1
  324. package/build-module/components/editor-history/redo.js.map +1 -1
  325. package/build-module/components/editor-history/undo.js.map +1 -1
  326. package/build-module/components/editor-notices/index.js.map +1 -1
  327. package/build-module/components/editor-snackbars/index.js.map +1 -1
  328. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  329. package/build-module/components/entities-saved-states/entity-type-list.js.map +1 -1
  330. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  331. package/build-module/components/entities-saved-states/index.js +11 -85
  332. package/build-module/components/entities-saved-states/index.js.map +1 -1
  333. package/build-module/components/error-boundary/index.js.map +1 -1
  334. package/build-module/components/error-boundary/index.native.js.map +1 -1
  335. package/build-module/components/global-keyboard-shortcuts/index.js +24 -0
  336. package/build-module/components/global-keyboard-shortcuts/index.js.map +1 -1
  337. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js +18 -0
  338. package/build-module/components/global-keyboard-shortcuts/register-shortcuts.js.map +1 -1
  339. package/build-module/components/index.js +7 -0
  340. package/build-module/components/index.js.map +1 -1
  341. package/build-module/components/index.native.js.map +1 -1
  342. package/build-module/components/inserter-sidebar/index.js +5 -1
  343. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  344. package/build-module/components/keyboard-shortcut-help-modal/config.js +71 -0
  345. package/build-module/components/keyboard-shortcut-help-modal/config.js.map +1 -0
  346. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +41 -0
  347. package/build-module/components/keyboard-shortcut-help-modal/dynamic-shortcut.js.map +1 -0
  348. package/build-module/components/keyboard-shortcut-help-modal/index.js +118 -0
  349. package/build-module/components/keyboard-shortcut-help-modal/index.js.map +1 -0
  350. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js +48 -0
  351. package/build-module/components/keyboard-shortcut-help-modal/shortcut.js.map +1 -0
  352. package/build-module/components/list-view-sidebar/index.js +2 -1
  353. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  354. package/build-module/components/list-view-sidebar/list-view-outline.js.map +1 -1
  355. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  356. package/build-module/components/media-categories/index.js.map +1 -1
  357. package/build-module/components/mode-switcher/index.js.map +1 -1
  358. package/build-module/components/offline-status/index.native.js.map +1 -1
  359. package/build-module/components/page-attributes/check.js.map +1 -1
  360. package/build-module/components/page-attributes/order.js.map +1 -1
  361. package/build-module/components/page-attributes/panel.js.map +1 -1
  362. package/build-module/components/page-attributes/parent.js.map +1 -1
  363. package/build-module/components/pattern-overrides-panel/index.js +23 -0
  364. package/build-module/components/pattern-overrides-panel/index.js.map +1 -0
  365. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  366. package/build-module/components/plugin-more-menu-item/index.js +73 -0
  367. package/build-module/components/plugin-more-menu-item/index.js.map +1 -0
  368. package/build-module/components/plugin-post-publish-panel/index.js +61 -0
  369. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -0
  370. package/build-module/components/plugin-post-status-info/index.js +66 -0
  371. package/build-module/components/plugin-post-status-info/index.js.map +1 -0
  372. package/build-module/components/plugin-pre-publish-panel/index.js +64 -0
  373. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -0
  374. package/build-module/components/plugin-sidebar/index.js +102 -0
  375. package/build-module/components/plugin-sidebar/index.js.map +1 -0
  376. package/build-module/components/plugin-sidebar-more-menu-item/index.js +65 -0
  377. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -0
  378. package/build-module/components/post-actions/actions.js +648 -0
  379. package/build-module/components/post-actions/actions.js.map +1 -0
  380. package/build-module/components/post-actions/index.js +130 -0
  381. package/build-module/components/post-actions/index.js.map +1 -0
  382. package/build-module/components/post-author/check.js.map +1 -1
  383. package/build-module/components/post-author/combobox.js.map +1 -1
  384. package/build-module/components/post-author/constants.js.map +1 -1
  385. package/build-module/components/post-author/hook.js.map +1 -1
  386. package/build-module/components/post-author/index.js.map +1 -1
  387. package/build-module/components/post-author/panel.js.map +1 -1
  388. package/build-module/components/post-author/select.js.map +1 -1
  389. package/build-module/components/post-card-panel/index.js +119 -0
  390. package/build-module/components/post-card-panel/index.js.map +1 -0
  391. package/build-module/components/post-comments/index.js.map +1 -1
  392. package/build-module/components/post-discussion/panel.js.map +1 -1
  393. package/build-module/components/post-excerpt/check.js +9 -0
  394. package/build-module/components/post-excerpt/check.js.map +1 -1
  395. package/build-module/components/post-excerpt/index.js.map +1 -1
  396. package/build-module/components/post-excerpt/panel.js.map +1 -1
  397. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  398. package/build-module/components/post-featured-image/check.js.map +1 -1
  399. package/build-module/components/post-featured-image/index.js.map +1 -1
  400. package/build-module/components/post-featured-image/panel.js.map +1 -1
  401. package/build-module/components/post-format/check.js.map +1 -1
  402. package/build-module/components/post-format/index.js.map +1 -1
  403. package/build-module/components/post-last-revision/check.js.map +1 -1
  404. package/build-module/components/post-last-revision/index.js.map +1 -1
  405. package/build-module/components/post-last-revision/panel.js.map +1 -1
  406. package/build-module/components/post-locked-modal/index.js.map +1 -1
  407. package/build-module/components/post-panel-row/index.js.map +1 -1
  408. package/build-module/components/post-pending-status/check.js.map +1 -1
  409. package/build-module/components/post-pending-status/index.js.map +1 -1
  410. package/build-module/components/post-pingbacks/index.js.map +1 -1
  411. package/build-module/components/post-preview-button/index.js.map +1 -1
  412. package/build-module/components/post-publish-button/index.js +31 -31
  413. package/build-module/components/post-publish-button/index.js.map +1 -1
  414. package/build-module/components/post-publish-button/label.js +51 -42
  415. package/build-module/components/post-publish-button/label.js.map +1 -1
  416. package/build-module/components/post-publish-panel/index.js.map +1 -1
  417. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  418. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  419. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  420. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  421. package/build-module/components/post-publish-panel/postpublish.js.map +1 -1
  422. package/build-module/components/post-publish-panel/prepublish.js.map +1 -1
  423. package/build-module/components/post-saved-state/index.js +10 -6
  424. package/build-module/components/post-saved-state/index.js.map +1 -1
  425. package/build-module/components/post-schedule/check.js.map +1 -1
  426. package/build-module/components/post-schedule/index.js.map +1 -1
  427. package/build-module/components/post-schedule/label.js.map +1 -1
  428. package/build-module/components/post-schedule/panel.js +8 -0
  429. package/build-module/components/post-schedule/panel.js.map +1 -1
  430. package/build-module/components/post-slug/check.js.map +1 -1
  431. package/build-module/components/post-slug/index.js +44 -68
  432. package/build-module/components/post-slug/index.js.map +1 -1
  433. package/build-module/components/post-status/index.js +231 -0
  434. package/build-module/components/post-status/index.js.map +1 -0
  435. package/build-module/components/post-sticky/check.js.map +1 -1
  436. package/build-module/components/post-sticky/index.js.map +1 -1
  437. package/build-module/components/post-switch-to-draft-button/index.js +7 -1
  438. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  439. package/build-module/components/post-sync-status/index.js.map +1 -1
  440. package/build-module/components/post-taxonomies/check.js.map +1 -1
  441. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  442. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  443. package/build-module/components/post-taxonomies/index.js.map +1 -1
  444. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  445. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  446. package/build-module/components/post-template/block-theme.js +7 -3
  447. package/build-module/components/post-template/block-theme.js.map +1 -1
  448. package/build-module/components/post-template/classic-theme.js.map +1 -1
  449. package/build-module/components/post-template/create-new-template-modal.js.map +1 -1
  450. package/build-module/components/post-template/create-new-template.js.map +1 -1
  451. package/build-module/components/post-template/hooks.js.map +1 -1
  452. package/build-module/components/post-template/panel.js.map +1 -1
  453. package/build-module/components/post-template/reset-default-template.js.map +1 -1
  454. package/build-module/components/post-template/swap-template-button.js.map +1 -1
  455. package/build-module/components/post-text-editor/index.js.map +1 -1
  456. package/build-module/components/post-title/constants.js.map +1 -1
  457. package/build-module/components/post-title/index.js.map +1 -1
  458. package/build-module/components/post-title/index.native.js +1 -1
  459. package/build-module/components/post-title/index.native.js.map +1 -1
  460. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  461. package/build-module/components/post-title/use-post-title-focus.js.map +1 -1
  462. package/build-module/components/post-title/use-post-title.js.map +1 -1
  463. package/build-module/components/post-trash/check.js +24 -26
  464. package/build-module/components/post-trash/check.js.map +1 -1
  465. package/build-module/components/post-trash/index.js +2 -1
  466. package/build-module/components/post-trash/index.js.map +1 -1
  467. package/build-module/components/post-type-support-check/index.js.map +1 -1
  468. package/build-module/components/post-url/check.js.map +1 -1
  469. package/build-module/components/post-url/index.js +46 -21
  470. package/build-module/components/post-url/index.js.map +1 -1
  471. package/build-module/components/post-url/label.js.map +1 -1
  472. package/build-module/components/post-url/panel.js +14 -7
  473. package/build-module/components/post-url/panel.js.map +1 -1
  474. package/build-module/components/post-view-link/index.js.map +1 -1
  475. package/build-module/components/post-visibility/check.js.map +1 -1
  476. package/build-module/components/post-visibility/index.js +2 -1
  477. package/build-module/components/post-visibility/index.js.map +1 -1
  478. package/build-module/components/post-visibility/label.js.map +1 -1
  479. package/build-module/components/post-visibility/utils.js.map +1 -1
  480. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  481. package/build-module/components/preferences-modal/enable-plugin-document-setting-panel.js.map +1 -1
  482. package/build-module/components/preferences-modal/index.js +19 -17
  483. package/build-module/components/preferences-modal/index.js.map +1 -1
  484. package/build-module/components/preview-dropdown/index.js.map +1 -1
  485. package/build-module/components/provider/disable-non-page-content-blocks.js +36 -20
  486. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  487. package/build-module/components/provider/index.js +5 -3
  488. package/build-module/components/provider/index.js.map +1 -1
  489. package/build-module/components/provider/index.native.js.map +1 -1
  490. package/build-module/components/provider/navigation-block-editing-mode.js.map +1 -1
  491. package/build-module/components/provider/use-auto-switch-editor-sidebars.js +46 -0
  492. package/build-module/components/provider/use-auto-switch-editor-sidebars.js.map +1 -0
  493. package/build-module/components/provider/use-block-editor-settings.js +73 -53
  494. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  495. package/build-module/components/provider/use-block-editor-settings.native.js.map +1 -1
  496. package/build-module/components/provider/use-hide-blocks-from-inserter.js.map +1 -1
  497. package/build-module/components/provider/with-registry-provider.js +1 -0
  498. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  499. package/build-module/components/start-page-options/index.js +132 -0
  500. package/build-module/components/start-page-options/index.js.map +1 -0
  501. package/build-module/components/table-of-contents/index.js.map +1 -1
  502. package/build-module/components/table-of-contents/panel.js.map +1 -1
  503. package/build-module/components/template-areas/index.js +63 -0
  504. package/build-module/components/template-areas/index.js.map +1 -0
  505. package/build-module/components/template-validation-notice/index.js +25 -31
  506. package/build-module/components/template-validation-notice/index.js.map +1 -1
  507. package/build-module/components/theme-support-check/index.js +11 -16
  508. package/build-module/components/theme-support-check/index.js.map +1 -1
  509. package/build-module/components/time-to-read/index.js.map +1 -1
  510. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  511. package/build-module/components/word-count/index.js.map +1 -1
  512. package/build-module/hooks/custom-sources-backwards-compatibility.js.map +1 -1
  513. package/build-module/hooks/default-autocompleters.js.map +1 -1
  514. package/build-module/hooks/index.js.map +1 -1
  515. package/build-module/hooks/index.native.js.map +1 -1
  516. package/build-module/hooks/pattern-overrides.js +22 -10
  517. package/build-module/hooks/pattern-overrides.js.map +1 -1
  518. package/build-module/hooks/use-select-nearest-editable-block.js +80 -0
  519. package/build-module/hooks/use-select-nearest-editable-block.js.map +1 -0
  520. package/build-module/index.js.map +1 -1
  521. package/build-module/index.native.js.map +1 -1
  522. package/build-module/lock-unlock.js.map +1 -1
  523. package/build-module/private-apis.js +24 -1
  524. package/build-module/private-apis.js.map +1 -1
  525. package/build-module/store/actions.js +37 -3
  526. package/build-module/store/actions.js.map +1 -1
  527. package/build-module/store/actions.native.js.map +1 -1
  528. package/build-module/store/constants.js +9 -0
  529. package/build-module/store/constants.js.map +1 -1
  530. package/build-module/store/defaults.js.map +1 -1
  531. package/build-module/store/index.js.map +1 -1
  532. package/build-module/store/local-autosave.js.map +1 -1
  533. package/build-module/store/private-actions.js +249 -1
  534. package/build-module/store/private-actions.js.map +1 -1
  535. package/build-module/store/private-selectors.js +50 -4
  536. package/build-module/store/private-selectors.js.map +1 -1
  537. package/build-module/store/reducer.js +13 -1
  538. package/build-module/store/reducer.js.map +1 -1
  539. package/build-module/store/reducer.native.js.map +1 -1
  540. package/build-module/store/selectors.js +20 -16
  541. package/build-module/store/selectors.js.map +1 -1
  542. package/build-module/store/selectors.native.js.map +1 -1
  543. package/build-module/store/utils/get-filtered-template-parts.js +64 -0
  544. package/build-module/store/utils/get-filtered-template-parts.js.map +1 -0
  545. package/build-module/store/utils/is-template-revertable.js +22 -0
  546. package/build-module/store/utils/is-template-revertable.js.map +1 -0
  547. package/build-module/store/utils/notice-builder.js.map +1 -1
  548. package/build-module/utils/get-template-part-icon.js.map +1 -1
  549. package/build-module/utils/index.js.map +1 -1
  550. package/build-module/utils/index.native.js.map +1 -1
  551. package/build-module/utils/media-upload/index.js.map +1 -1
  552. package/build-module/utils/media-upload/index.native.js.map +1 -1
  553. package/build-module/utils/terms.js.map +1 -1
  554. package/build-module/utils/url.js.map +1 -1
  555. package/build-style/style-rtl.css +565 -49
  556. package/build-style/style.css +565 -49
  557. package/package.json +36 -36
  558. package/src/bindings/post-meta.js +11 -27
  559. package/src/components/autosave-monitor/index.js +9 -0
  560. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +108 -0
  561. package/src/components/commands/index.js +21 -2
  562. package/src/components/deprecated.js +157 -0
  563. package/src/components/document-bar/index.js +9 -15
  564. package/src/components/document-bar/style.scss +9 -12
  565. package/src/components/document-tools/index.js +16 -14
  566. package/src/components/document-tools/style.scss +4 -11
  567. package/src/components/editor-canvas/edit-template-blocks-notification.js +17 -53
  568. package/src/components/editor-canvas/index.js +8 -4
  569. package/src/components/entities-saved-states/index.js +12 -113
  570. package/src/components/error-boundary/style.native.scss +1 -1
  571. package/src/components/global-keyboard-shortcuts/index.js +25 -0
  572. package/src/components/global-keyboard-shortcuts/register-shortcuts.js +20 -0
  573. package/src/components/index.js +7 -0
  574. package/src/components/inserter-sidebar/index.js +7 -1
  575. package/src/components/keyboard-shortcut-help-modal/config.js +53 -0
  576. package/src/components/keyboard-shortcut-help-modal/dynamic-shortcut.js +43 -0
  577. package/src/components/keyboard-shortcut-help-modal/index.js +160 -0
  578. package/src/components/keyboard-shortcut-help-modal/shortcut.js +67 -0
  579. package/src/components/keyboard-shortcut-help-modal/style.scss +61 -0
  580. package/src/components/list-view-sidebar/index.js +1 -0
  581. package/src/components/list-view-sidebar/style.scss +1 -1
  582. package/src/components/pattern-overrides-panel/index.js +26 -0
  583. package/src/components/plugin-more-menu-item/index.js +73 -0
  584. package/src/components/plugin-post-publish-panel/index.js +64 -0
  585. package/src/components/plugin-post-publish-panel/test/__snapshots__/index.js.snap +39 -0
  586. package/src/components/plugin-post-publish-panel/test/index.js +33 -0
  587. package/src/components/plugin-post-status-info/index.js +63 -0
  588. package/src/components/plugin-pre-publish-panel/index.js +67 -0
  589. package/src/components/plugin-pre-publish-panel/test/index.js +33 -0
  590. package/src/components/plugin-sidebar/index.js +98 -0
  591. package/src/components/plugin-sidebar-more-menu-item/index.js +64 -0
  592. package/src/components/post-actions/actions.js +862 -0
  593. package/src/components/post-actions/index.js +156 -0
  594. package/src/components/post-actions/style.scss +3 -0
  595. package/src/components/post-card-panel/index.js +168 -0
  596. package/src/components/post-card-panel/style.scss +32 -0
  597. package/src/components/post-excerpt/check.js +8 -0
  598. package/src/components/post-featured-image/style.scss +3 -2
  599. package/src/components/post-publish-button/index.js +23 -36
  600. package/src/components/post-publish-button/label.js +54 -39
  601. package/src/components/post-publish-button/test/index.js +15 -26
  602. package/src/components/post-publish-button/test/label.js +44 -21
  603. package/src/components/post-saved-state/index.js +13 -6
  604. package/src/components/post-saved-state/test/index.js +4 -0
  605. package/src/components/post-schedule/panel.js +22 -0
  606. package/src/components/post-slug/index.js +50 -68
  607. package/src/components/post-slug/test/index.js +29 -6
  608. package/src/components/post-status/index.js +310 -0
  609. package/src/components/post-status/style.scss +75 -0
  610. package/src/components/post-switch-to-draft-button/index.js +5 -0
  611. package/src/components/post-template/block-theme.js +31 -22
  612. package/src/components/post-title/index.native.js +1 -1
  613. package/src/components/post-trash/check.js +19 -19
  614. package/src/components/post-trash/index.js +1 -0
  615. package/src/components/post-url/index.js +131 -101
  616. package/src/components/post-url/panel.js +20 -7
  617. package/src/components/post-url/style.scss +8 -6
  618. package/src/components/post-visibility/index.js +1 -0
  619. package/src/components/preferences-modal/index.js +26 -22
  620. package/src/components/provider/disable-non-page-content-blocks.js +40 -20
  621. package/src/components/provider/index.js +17 -8
  622. package/src/components/provider/use-auto-switch-editor-sidebars.js +49 -0
  623. package/src/components/provider/use-block-editor-settings.js +70 -44
  624. package/src/components/provider/with-registry-provider.js +1 -0
  625. package/src/components/start-page-options/index.js +135 -0
  626. package/src/components/start-page-options/style.scss +26 -0
  627. package/src/components/template-areas/index.js +85 -0
  628. package/src/components/template-areas/style.scss +23 -0
  629. package/src/components/template-validation-notice/index.js +48 -50
  630. package/src/components/theme-support-check/index.js +9 -16
  631. package/src/components/theme-support-check/test/index.js +44 -43
  632. package/src/hooks/pattern-overrides.js +25 -14
  633. package/src/hooks/use-select-nearest-editable-block.js +95 -0
  634. package/src/private-apis.js +21 -0
  635. package/src/store/actions.js +37 -3
  636. package/src/store/constants.js +9 -0
  637. package/src/store/private-actions.js +377 -1
  638. package/src/store/private-selectors.js +101 -18
  639. package/src/store/reducer.js +13 -0
  640. package/src/store/selectors.js +51 -46
  641. package/src/store/utils/get-filtered-template-parts.js +69 -0
  642. package/src/store/utils/is-template-revertable.js +23 -0
  643. package/src/store/utils/test/get-filtered-template-parts.js +189 -0
  644. package/src/style.scss +8 -2
  645. package/src/components/post-publish-button/style.scss +0 -8
  646. package/src/components/provider/test/disable-non-page-content-blocks.js +0 -90
  647. package/src/components/template-validation-notice/style.scss +0 -9
@@ -11,7 +11,7 @@ import { __, isRTL, sprintf } from '@wordpress/i18n';
11
11
  import { useSelect, useDispatch } from '@wordpress/data';
12
12
  import { Button, __experimentalText as Text, __unstableMotion as motion, __unstableAnimatePresence as AnimatePresence } from '@wordpress/components';
13
13
  import { BlockIcon } from '@wordpress/block-editor';
14
- import { chevronLeftSmall, chevronRightSmall, page as pageIcon, navigation as navigationIcon, symbol } from '@wordpress/icons';
14
+ import { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';
15
15
  import { displayShortcut } from '@wordpress/keycodes';
16
16
  import { store as coreStore } from '@wordpress/core-data';
17
17
  import { store as commandsStore } from '@wordpress/commands';
@@ -22,6 +22,7 @@ import { useReducedMotion } from '@wordpress/compose';
22
22
  * Internal dependencies
23
23
  */
24
24
  import { store as editorStore } from '../../store';
25
+ import { unlock } from '../../lock-unlock';
25
26
  const TYPE_LABELS = {
26
27
  // translators: 1: Pattern title.
27
28
  wp_pattern: __('Editing pattern: %s'),
@@ -32,15 +33,10 @@ const TYPE_LABELS = {
32
33
  // translators: 1: Template part title.
33
34
  wp_template_part: __('Editing template part: %s')
34
35
  };
35
- const ICONS = {
36
- wp_block: symbol,
37
- wp_navigation: navigationIcon
38
- };
39
36
  const TEMPLATE_POST_TYPES = ['wp_template', 'wp_template_part'];
40
37
  const GLOBAL_POST_TYPES = [...TEMPLATE_POST_TYPES, 'wp_block', 'wp_navigation'];
41
38
  const MotionButton = motion(Button);
42
39
  export default function DocumentBar() {
43
- var _ICONS$postType;
44
40
  const {
45
41
  postType,
46
42
  document,
@@ -67,7 +63,9 @@ export default function DocumentBar() {
67
63
  postType: _postType,
68
64
  document: _document,
69
65
  isResolving: isResolvingSelector('getEditedEntityRecord', 'postType', _postType, _postId),
70
- templateIcon: _templateInfo.icon,
66
+ templateIcon: unlock(select(editorStore)).getPostIcon(_postType, {
67
+ area: _document?.area
68
+ }),
71
69
  templateTitle: _templateInfo.title,
72
70
  onNavigateToPreviousEntityRecord: getEditorSettings().onNavigateToPreviousEntityRecord
73
71
  };
@@ -77,7 +75,6 @@ export default function DocumentBar() {
77
75
  } = useDispatch(commandsStore);
78
76
  const isReducedMotion = useReducedMotion();
79
77
  const isNotFound = !document && !isResolving;
80
- const icon = (_ICONS$postType = ICONS[postType]) !== null && _ICONS$postType !== void 0 ? _ICONS$postType : pageIcon;
81
78
  const isTemplate = TEMPLATE_POST_TYPES.includes(postType);
82
79
  const isGlobalEntity = GLOBAL_POST_TYPES.includes(postType);
83
80
  const hasBackButton = !!onNavigateToPreviousEntityRecord;
@@ -137,7 +134,7 @@ export default function DocumentBar() {
137
134
  duration: 0
138
135
  } : undefined
139
136
  }, createElement(BlockIcon, {
140
- icon: isTemplate ? templateIcon : icon
137
+ icon: templateIcon
141
138
  }), createElement(Text, {
142
139
  size: "body",
143
140
  as: "h1",
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__","isRTL","sprintf","useSelect","useDispatch","Button","__experimentalText","Text","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","BlockIcon","chevronLeftSmall","chevronRightSmall","page","pageIcon","navigation","navigationIcon","symbol","displayShortcut","store","coreStore","commandsStore","useRef","useEffect","useReducedMotion","editorStore","TYPE_LABELS","wp_pattern","wp_navigation","wp_template","wp_template_part","ICONS","wp_block","TEMPLATE_POST_TYPES","GLOBAL_POST_TYPES","MotionButton","DocumentBar","_ICONS$postType","postType","document","isResolving","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","getEditedEntityRecord","isResolvingSelector","_postType","_postId","_document","_templateInfo","icon","title","open","openCommandCenter","isReducedMotion","isNotFound","isTemplate","includes","isGlobalEntity","hasBackButton","mounted","current","createElement","className","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","div","key","as","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport {\n\tchevronLeftSmall,\n\tchevronRightSmall,\n\tpage as pageIcon,\n\tnavigation as navigationIcon,\n\tsymbol,\n} from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nconst TYPE_LABELS = {\n\t// translators: 1: Pattern title.\n\twp_pattern: __( 'Editing pattern: %s' ),\n\t// translators: 1: Navigation menu title.\n\twp_navigation: __( 'Editing navigation menu: %s' ),\n\t// translators: 1: Template title.\n\twp_template: __( 'Editing template: %s' ),\n\t// translators: 1: Template part title.\n\twp_template_part: __( 'Editing template part: %s' ),\n};\n\nconst ICONS = {\n\twp_block: symbol,\n\twp_navigation: navigationIcon,\n};\n\nconst TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];\n\nconst GLOBAL_POST_TYPES = [\n\t...TEMPLATE_POST_TYPES,\n\t'wp_block',\n\t'wp_navigation',\n];\n\nconst MotionButton = motion( Button );\n\nexport default function DocumentBar() {\n\tconst {\n\t\tpostType,\n\t\tdocument,\n\t\tisResolving,\n\t\ttemplateIcon,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t} = select( editorStore );\n\t\tconst { getEditedEntityRecord, isResolving: isResolvingSelector } =\n\t\t\tselect( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\t\tconst _templateInfo = getTemplateInfo( _document );\n\t\treturn {\n\t\t\tpostType: _postType,\n\t\t\tdocument: _document,\n\t\t\tisResolving: isResolvingSelector(\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\t_postId\n\t\t\t),\n\t\t\ttemplateIcon: _templateInfo.icon,\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isNotFound = ! document && ! isResolving;\n\tconst icon = ICONS[ postType ] ?? pageIcon;\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst title = isTemplate ? templateTitle : document.title;\n\n\tconst mounted = useRef( false );\n\tuseEffect( () => {\n\t\tmounted.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t\t'is-global': isGlobalEntity,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockIcon icon={ isTemplate ? templateIcon : icon } />\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\tTYPE_LABELS[ postType ]\n\t\t\t\t\t\t\t\t\t? // eslint-disable-next-line @wordpress/valid-sprintf\n\t\t\t\t\t\t\t\t\t sprintf( TYPE_LABELS[ postType ], title )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,EAC1BC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,yBAAyB;AACnD,SACCC,gBAAgB,EAChBC,iBAAiB,EACjBC,IAAI,IAAIC,QAAQ,EAChBC,UAAU,IAAIC,cAAc,EAC5BC,MAAM,QACA,kBAAkB;AACzB,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,SAASL,KAAK,IA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;IAAC8C,IAAI,EAAGM,UAAU,GAAGrB,YAAY,GAAGe;EAAM,CAAE,CAAC,EACvDY,aAAA,CAAC/D,IAAI;IACJoE,IAAI,EAAC,MAAM;IACXW,EAAE,EAAC,IAAI;IACP,cACC1D,WAAW,CAAEY,QAAQ,CAAE;IACpB;IACAtC,OAAO,CAAE0B,WAAW,CAAEY,QAAQ,CAAE,EAAEmB,KAAM,CAAC,GACzCwB;EACH,GAECxB,KACG,CACK,CAAC,EACbW,aAAA;IAAMC,SAAS,EAAC;EAA+B,GAC5CnD,eAAe,CAACmE,OAAO,CAAE,GAAI,CAC1B,CACC,CAEL,CAAC;AAER"}
1
+ {"version":3,"names":["classnames","__","isRTL","sprintf","useSelect","useDispatch","Button","__experimentalText","Text","__unstableMotion","motion","__unstableAnimatePresence","AnimatePresence","BlockIcon","chevronLeftSmall","chevronRightSmall","displayShortcut","store","coreStore","commandsStore","useRef","useEffect","useReducedMotion","editorStore","unlock","TYPE_LABELS","wp_pattern","wp_navigation","wp_template","wp_template_part","TEMPLATE_POST_TYPES","GLOBAL_POST_TYPES","MotionButton","DocumentBar","postType","document","isResolving","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","getEditedEntityRecord","isResolvingSelector","_postType","_postId","_document","_templateInfo","getPostIcon","area","title","open","openCommandCenter","isReducedMotion","isNotFound","isTemplate","includes","isGlobalEntity","hasBackButton","mounted","current","createElement","className","icon","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","div","key","as","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst TYPE_LABELS = {\n\t// translators: 1: Pattern title.\n\twp_pattern: __( 'Editing pattern: %s' ),\n\t// translators: 1: Navigation menu title.\n\twp_navigation: __( 'Editing navigation menu: %s' ),\n\t// translators: 1: Template title.\n\twp_template: __( 'Editing template: %s' ),\n\t// translators: 1: Template part title.\n\twp_template_part: __( 'Editing template part: %s' ),\n};\n\nconst TEMPLATE_POST_TYPES = [ 'wp_template', 'wp_template_part' ];\n\nconst GLOBAL_POST_TYPES = [\n\t...TEMPLATE_POST_TYPES,\n\t'wp_block',\n\t'wp_navigation',\n];\n\nconst MotionButton = motion( Button );\n\nexport default function DocumentBar() {\n\tconst {\n\t\tpostType,\n\t\tdocument,\n\t\tisResolving,\n\t\ttemplateIcon,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t} = select( editorStore );\n\t\tconst { getEditedEntityRecord, isResolving: isResolvingSelector } =\n\t\t\tselect( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\t\tconst _templateInfo = getTemplateInfo( _document );\n\t\treturn {\n\t\t\tpostType: _postType,\n\t\t\tdocument: _document,\n\t\t\tisResolving: isResolvingSelector(\n\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t'postType',\n\t\t\t\t_postType,\n\t\t\t\t_postId\n\t\t\t),\n\t\t\ttemplateIcon: unlock( select( editorStore ) ).getPostIcon(\n\t\t\t\t_postType,\n\t\t\t\t{\n\t\t\t\t\tarea: _document?.area,\n\t\t\t\t}\n\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isNotFound = ! document && ! isResolving;\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst title = isTemplate ? templateTitle : document.title;\n\n\tconst mounted = useRef( false );\n\tuseEffect( () => {\n\t\tmounted.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ classnames( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t\t'is-global': isGlobalEntity,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockIcon icon={ templateIcon } />\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\tTYPE_LABELS[ postType ]\n\t\t\t\t\t\t\t\t\t? // eslint-disable-next-line @wordpress/valid-sprintf\n\t\t\t\t\t\t\t\t\t sprintf( TYPE_LABELS[ postType ], title )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,EAAE,EAAEC,KAAK,EAAEC,OAAO,QAAQ,iBAAiB;AACpD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SACCC,MAAM,EACNC,kBAAkB,IAAIC,IAAI,EAC1BC,gBAAgB,IAAIC,MAAM,EAC1BC,yBAAyB,IAAIC,eAAe,QACtC,uBAAuB;AAC9B,SAASC,SAAS,QAAQ,yBAAyB;AACnD,SAASC,gBAAgB,EAAEC,iBAAiB,QAAQ,kBAAkB;AACtE,SAASC,eAAe,QAAQ,qBAAqB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASD,KAAK,IAAIE,aAAa,QAAQ,qBAAqB;AAC5D,SAASC,MAAM,EAAEC,SAAS,QAAQ,oBAAoB;AACtD,SAASC,gBAAgB,QAAQ,oBAAoB;;AAErD;AACA;AACA;AACA,SAASL,KAAK,IAAIM,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,MAAMC,WAAW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AAE;IACpB;IACA/B,OAAO,CAAEsB,WAAW,CAAES,QAAQ,CAAE,EAAEoB,KAAM,CAAC,GACzCyB;EACH,GAECzB,KACG,CACK,CAAC,EACbW,aAAA;IAAMC,SAAS,EAAC;EAA+B,GAC5ClD,eAAe,CAACmE,OAAO,CAAE,GAAI,CAC1B,CACC,CAEL,CAAC;AAER","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","blockEditorStore","DocumentOutlineCheck","children","hasHeadings","select","getGlobalBlockCount"],"sources":["@wordpress/editor/src/components/document-outline/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function DocumentOutlineCheck( { children } ) {\n\tconst hasHeadings = useSelect( ( select ) => {\n\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\n\t\treturn getGlobalBlockCount( 'core/heading' ) > 0;\n\t} );\n\n\tif ( hasHeadings ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AAEnE,eAAe,SAASC,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,WAAW,GAAGL,SAAS,CAAIM,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEJ,gBAAiB,CAAC;IAE1D,OAAOK,mBAAmB,CAAE,cAAe,CAAC,GAAG,CAAC;EACjD,CAAE,CAAC;EAEH,IAAKF,WAAW,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB"}
1
+ {"version":3,"names":["useSelect","store","blockEditorStore","DocumentOutlineCheck","children","hasHeadings","select","getGlobalBlockCount"],"sources":["@wordpress/editor/src/components/document-outline/check.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nexport default function DocumentOutlineCheck( { children } ) {\n\tconst hasHeadings = useSelect( ( select ) => {\n\t\tconst { getGlobalBlockCount } = select( blockEditorStore );\n\n\t\treturn getGlobalBlockCount( 'core/heading' ) > 0;\n\t} );\n\n\tif ( hasHeadings ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AAEnE,eAAe,SAASC,oBAAoBA,CAAE;EAAEC;AAAS,CAAC,EAAG;EAC5D,MAAMC,WAAW,GAAGL,SAAS,CAAIM,MAAM,IAAM;IAC5C,MAAM;MAAEC;IAAoB,CAAC,GAAGD,MAAM,CAAEJ,gBAAiB,CAAC;IAE1D,OAAOK,mBAAmB,CAAE,cAAe,CAAC,GAAG,CAAC;EACjD,CAAE,CAAC;EAEH,IAAKF,WAAW,EAAG;IAClB,OAAO,IAAI;EACZ;EAEA,OAAOD,QAAQ;AAChB","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["__","useDispatch","useSelect","create","getTextContent","store","blockEditorStore","coreStore","Path","SVG","Line","Rect","DocumentOutlineItem","editorStore","emptyHeadingContent","createElement","incorrectLevelContent","key","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","width","height","viewBox","fill","xmlns","rx","x1","y1","x2","y2","stroke","x","y","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","title","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","getPostType","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\nexport default function DocumentOutline( {\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\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{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ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ACdD,MAAM,CAAE;MACP+E,IAAI,EAAEJ,IAAI,CAACrC,UAAU,CAACK;IACvB,CAAE,CACF,CAAC,EACFkC,gBAAgB,IAAIhE,qBAAqB,EACzC8D,IAAI,CAACtC,KAAK,KAAK,CAAC,IACjBgC,aAAa,IACbrD,kBAAkB,EACjBiD,QAAQ,IACTU,IAAI,CAACtC,KAAK,KAAK,CAAC,IAChB,CAAEgC,aAAa,IACftD,gBACmB,CAAC;EAExB,CAAE,CACC,CACA,CAAC;AAER"}
1
+ {"version":3,"names":["__","useDispatch","useSelect","create","getTextContent","store","blockEditorStore","coreStore","Path","SVG","Line","Rect","DocumentOutlineItem","editorStore","emptyHeadingContent","createElement","incorrectLevelContent","key","singleH1Headings","multipleH1Headings","EmptyOutlineIllustration","width","height","viewBox","fill","xmlns","rx","x1","y1","x2","y2","stroke","x","y","d","computeOutlineHeadings","blocks","flatMap","block","name","level","attributes","isEmpty","isEmptyHeading","innerBlocks","heading","content","trim","length","DocumentOutline","onSelect","isTitleSupported","hasOutlineItemsDisabled","selectBlock","title","select","_postType$supports$ti","getBlocks","getEditedPostAttribute","getPostType","postType","supports","headings","className","prevHeadingLevel","titleNode","document","querySelector","hasTitle","countByLevel","reduce","acc","hasMultipleH1","isValid","href","id","isDisabled","map","item","index","isIncorrectLevel","clientId","html"],"sources":["@wordpress/editor/src/components/document-outline/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { create, getTextContent } from '@wordpress/rich-text';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Path, SVG, Line, Rect } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport DocumentOutlineItem from './item';\nimport { store as editorStore } from '../../store';\n\n/**\n * Module constants\n */\nconst emptyHeadingContent = <em>{ __( '(Empty heading)' ) }</em>;\nconst incorrectLevelContent = [\n\t<br key=\"incorrect-break\" />,\n\t<em key=\"incorrect-message\">{ __( '(Incorrect heading level)' ) }</em>,\n];\nconst singleH1Headings = [\n\t<br key=\"incorrect-break-h1\" />,\n\t<em key=\"incorrect-message-h1\">\n\t\t{ __( '(Your theme may already use a H1 for the post title)' ) }\n\t</em>,\n];\nconst multipleH1Headings = [\n\t<br key=\"incorrect-break-multiple-h1\" />,\n\t<em key=\"incorrect-message-multiple-h1\">\n\t\t{ __( '(Multiple H1 headings are not recommended)' ) }\n\t</em>,\n];\nfunction EmptyOutlineIllustration() {\n\treturn (\n\t\t<SVG\n\t\t\twidth=\"138\"\n\t\t\theight=\"148\"\n\t\t\tviewBox=\"0 0 138 148\"\n\t\t\tfill=\"none\"\n\t\t\txmlns=\"http://www.w3.org/2000/svg\"\n\t\t>\n\t\t\t<Rect width=\"138\" height=\"148\" rx=\"4\" fill=\"#F0F6FC\" />\n\t\t\t<Line x1=\"44\" y1=\"28\" x2=\"24\" y2=\"28\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"48\" y=\"16\" width=\"27\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M54.7585 32V23.2727H56.6037V26.8736H60.3494V23.2727H62.1903V32H60.3494V28.3949H56.6037V32H54.7585ZM67.4574 23.2727V32H65.6122V25.0241H65.5611L63.5625 26.277V24.6406L65.723 23.2727H67.4574Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"55\" y1=\"59\" x2=\"24\" y2=\"59\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"59\" y=\"47\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M65.7585 63V54.2727H67.6037V57.8736H71.3494V54.2727H73.1903V63H71.3494V59.3949H67.6037V63H65.7585ZM74.6605 63V61.6705L77.767 58.794C78.0313 58.5384 78.2528 58.3082 78.4318 58.1037C78.6136 57.8991 78.7514 57.6989 78.8452 57.5028C78.9389 57.304 78.9858 57.0895 78.9858 56.8594C78.9858 56.6037 78.9276 56.3835 78.8111 56.1989C78.6946 56.0114 78.5355 55.8679 78.3338 55.7685C78.1321 55.6662 77.9034 55.6151 77.6477 55.6151C77.3807 55.6151 77.1477 55.669 76.9489 55.777C76.75 55.8849 76.5966 56.0398 76.4886 56.2415C76.3807 56.4432 76.3267 56.6832 76.3267 56.9616H74.5753C74.5753 56.3906 74.7045 55.8949 74.9631 55.4744C75.2216 55.054 75.5838 54.7287 76.0497 54.4986C76.5156 54.2685 77.0526 54.1534 77.6605 54.1534C78.2855 54.1534 78.8295 54.2642 79.2926 54.4858C79.7585 54.7045 80.1207 55.0085 80.3793 55.3977C80.6378 55.7869 80.767 56.233 80.767 56.7358C80.767 57.0653 80.7017 57.3906 80.571 57.7116C80.4432 58.0327 80.2145 58.3892 79.8849 58.7812C79.5554 59.1705 79.0909 59.6378 78.4915 60.1832L77.2173 61.4318V61.4915H80.8821V63H74.6605Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"80\" y1=\"90\" x2=\"24\" y2=\"90\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"84\" y=\"78\" width=\"30\" height=\"23\" rx=\"4\" fill=\"#F0B849\" />\n\t\t\t<Path\n\t\t\t\td=\"M90.7585 94V85.2727H92.6037V88.8736H96.3494V85.2727H98.1903V94H96.3494V90.3949H92.6037V94H90.7585ZM99.5284 92.4659V91.0128L103.172 85.2727H104.425V87.2841H103.683L101.386 90.919V90.9872H106.564V92.4659H99.5284ZM103.717 94V92.0227L103.751 91.3793V85.2727H105.482V94H103.717Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t\t<Line x1=\"66\" y1=\"121\" x2=\"24\" y2=\"121\" stroke=\"#DDDDDD\" />\n\t\t\t<Rect x=\"70\" y=\"109\" width=\"29\" height=\"23\" rx=\"4\" fill=\"#DDDDDD\" />\n\t\t\t<Path\n\t\t\t\td=\"M76.7585 125V116.273H78.6037V119.874H82.3494V116.273H84.1903V125H82.3494V121.395H78.6037V125H76.7585ZM88.8864 125.119C88.25 125.119 87.6832 125.01 87.1861 124.791C86.6918 124.57 86.3011 124.266 86.0142 123.879C85.7301 123.49 85.5838 123.041 85.5753 122.533H87.4332C87.4446 122.746 87.5142 122.933 87.642 123.095C87.7727 123.254 87.946 123.378 88.1619 123.466C88.3778 123.554 88.6207 123.598 88.8906 123.598C89.1719 123.598 89.4205 123.548 89.6364 123.449C89.8523 123.349 90.0213 123.212 90.1435 123.036C90.2656 122.859 90.3267 122.656 90.3267 122.426C90.3267 122.193 90.2614 121.987 90.1307 121.808C90.0028 121.626 89.8182 121.484 89.5767 121.382C89.3381 121.28 89.054 121.229 88.7244 121.229H87.9105V119.874H88.7244C89.0028 119.874 89.2486 119.825 89.4616 119.729C89.6776 119.632 89.8452 119.499 89.9645 119.328C90.0838 119.155 90.1435 118.953 90.1435 118.723C90.1435 118.504 90.0909 118.312 89.9858 118.148C89.8835 117.98 89.7386 117.849 89.5511 117.756C89.3665 117.662 89.1506 117.615 88.9034 117.615C88.6534 117.615 88.4247 117.661 88.2173 117.751C88.0099 117.839 87.8438 117.966 87.7188 118.131C87.5938 118.295 87.527 118.489 87.5185 118.71H85.75C85.7585 118.207 85.902 117.764 86.1804 117.381C86.4588 116.997 86.8338 116.697 87.3054 116.482C87.7798 116.263 88.3153 116.153 88.9119 116.153C89.5142 116.153 90.0412 116.263 90.4929 116.482C90.9446 116.7 91.2955 116.996 91.5455 117.368C91.7983 117.737 91.9233 118.152 91.9205 118.612C91.9233 119.101 91.7713 119.509 91.4645 119.835C91.1605 120.162 90.7642 120.369 90.2756 120.457V120.526C90.9176 120.608 91.4063 120.831 91.7415 121.195C92.0795 121.555 92.2472 122.007 92.2443 122.55C92.2472 123.047 92.1037 123.489 91.8139 123.875C91.527 124.261 91.1307 124.565 90.625 124.787C90.1193 125.009 89.5398 125.119 88.8864 125.119Z\"\n\t\t\t\tfill=\"black\"\n\t\t\t/>\n\t\t</SVG>\n\t);\n}\n\n/**\n * Returns an array of heading blocks enhanced with the following properties:\n * level - An integer with the heading level.\n * isEmpty - Flag indicating if the heading has no content.\n *\n * @param {?Array} blocks An array of blocks.\n *\n * @return {Array} An array of heading blocks enhanced with the properties described above.\n */\nconst computeOutlineHeadings = ( blocks = [] ) => {\n\treturn blocks.flatMap( ( block = {} ) => {\n\t\tif ( block.name === 'core/heading' ) {\n\t\t\treturn {\n\t\t\t\t...block,\n\t\t\t\tlevel: block.attributes.level,\n\t\t\t\tisEmpty: isEmptyHeading( block ),\n\t\t\t};\n\t\t}\n\t\treturn computeOutlineHeadings( block.innerBlocks );\n\t} );\n};\n\nconst isEmptyHeading = ( heading ) =>\n\t! heading.attributes.content ||\n\theading.attributes.content.trim().length === 0;\n\nexport default function DocumentOutline( {\n\tonSelect,\n\tisTitleSupported,\n\thasOutlineItemsDisabled,\n} ) {\n\tconst { selectBlock } = useDispatch( blockEditorStore );\n\tconst { blocks, title } = useSelect( ( select ) => {\n\t\tconst { getBlocks } = select( blockEditorStore );\n\t\tconst { getEditedPostAttribute } = select( editorStore );\n\t\tconst { getPostType } = select( coreStore );\n\t\tconst postType = getPostType( getEditedPostAttribute( 'type' ) );\n\n\t\treturn {\n\t\t\ttitle: getEditedPostAttribute( 'title' ),\n\t\t\tblocks: getBlocks(),\n\t\t\tisTitleSupported: postType?.supports?.title ?? false,\n\t\t};\n\t} );\n\n\tconst headings = computeOutlineHeadings( blocks );\n\tif ( headings.length < 1 ) {\n\t\treturn (\n\t\t\t<div className=\"editor-document-outline has-no-headings\">\n\t\t\t\t<EmptyOutlineIllustration />\n\t\t\t\t<p>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Navigate the structure of your document and address issues like empty or incorrect heading levels.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</div>\n\t\t);\n\t}\n\n\tlet prevHeadingLevel = 1;\n\n\t// Not great but it's the simplest way to locate the title right now.\n\tconst titleNode = document.querySelector( '.editor-post-title__input' );\n\tconst hasTitle = isTitleSupported && title && titleNode;\n\tconst countByLevel = headings.reduce(\n\t\t( acc, heading ) => ( {\n\t\t\t...acc,\n\t\t\t[ heading.level ]: ( acc[ heading.level ] || 0 ) + 1,\n\t\t} ),\n\t\t{}\n\t);\n\tconst hasMultipleH1 = countByLevel[ 1 ] > 1;\n\n\treturn (\n\t\t<div className=\"document-outline\">\n\t\t\t<ul>\n\t\t\t\t{ hasTitle && (\n\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\tlevel={ __( 'Title' ) }\n\t\t\t\t\t\tisValid\n\t\t\t\t\t\tonSelect={ onSelect }\n\t\t\t\t\t\thref={ `#${ titleNode.id }` }\n\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ title }\n\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t) }\n\t\t\t\t{ headings.map( ( item, index ) => {\n\t\t\t\t\t// Headings remain the same, go up by one, or down by any amount.\n\t\t\t\t\t// Otherwise there are missing levels.\n\t\t\t\t\tconst isIncorrectLevel = item.level > prevHeadingLevel + 1;\n\n\t\t\t\t\tconst isValid =\n\t\t\t\t\t\t! item.isEmpty &&\n\t\t\t\t\t\t! isIncorrectLevel &&\n\t\t\t\t\t\t!! item.level &&\n\t\t\t\t\t\t( item.level !== 1 ||\n\t\t\t\t\t\t\t( ! hasMultipleH1 && ! hasTitle ) );\n\t\t\t\t\tprevHeadingLevel = item.level;\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<DocumentOutlineItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tlevel={ `H${ item.level }` }\n\t\t\t\t\t\t\tisValid={ isValid }\n\t\t\t\t\t\t\tisDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t\t\t\thref={ `#block-${ item.clientId }` }\n\t\t\t\t\t\t\tonSelect={ () => {\n\t\t\t\t\t\t\t\tselectBlock( item.clientId );\n\t\t\t\t\t\t\t\tonSelect?.();\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ item.isEmpty\n\t\t\t\t\t\t\t\t? emptyHeadingContent\n\t\t\t\t\t\t\t\t: getTextContent(\n\t\t\t\t\t\t\t\t\t\tcreate( {\n\t\t\t\t\t\t\t\t\t\t\thtml: item.attributes.content,\n\t\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{ isIncorrectLevel && incorrectLevelContent }\n\t\t\t\t\t\t\t{ item.level === 1 &&\n\t\t\t\t\t\t\t\thasMultipleH1 &&\n\t\t\t\t\t\t\t\tmultipleH1Headings }\n\t\t\t\t\t\t\t{ hasTitle &&\n\t\t\t\t\t\t\t\titem.level === 1 &&\n\t\t\t\t\t\t\t\t! hasMultipleH1 &&\n\t\t\t\t\t\t\t\tsingleH1Headings }\n\t\t\t\t\t\t</DocumentOutlineItem>\n\t\t\t\t\t);\n\t\t\t\t} ) }\n\t\t\t</ul>\n\t\t</div>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,MAAM,EAAEC,cAAc,QAAQ,sBAAsB;AAC7D,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASD,KAAK,IAAIE,SAAS,QAAQ,sBAAsB;AACzD,SAASC,IAAI,EAAEC,GAAG,EAAEC,IAAI,EAAEC,IAAI,QAAQ,uBAAuB;;AAE7D;AACA;AACA;AACA,OAAOC,mBAAmB,MAAM,QAAQ;AACxC,SAASP,KAAK,IAAIQ,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA,MAAMC,mBAAmB,GAAGC,aAAA,aAAMf,EAAE,CAAE,iBAAkB,CAAO,CAAC;AAChE,MAAMgB,qBAAqB,GAAG,CAC7BD,aAA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EAAyB,GAEpCE,KACkB,CACrB,EACCQ,QAAQ,CAACe,GAAG,CAAE,CAAEC,IAAI,EAAEC,KAAK,KAAM;IAClC;IACA;IACA,MAAMC,gBAAgB,GAAGF,IAAI,CAACtC,KAAK,GAAGwB,gBAAgB,GAAG,CAAC;IAE1D,MAAMS,OAAO,GACZ,CAAEK,IAAI,CAACpC,OAAO,IACd,CAAEsC,gBAAgB,IAClB,CAAC,CAAEF,IAAI,CAACtC,KAAK,KACXsC,IAAI,CAACtC,KAAK,KAAK,CAAC,IACf,CAAEgC,aAAa,IAAI,CAAEJ,QAAU,CAAE;IACrCJ,gBAAgB,GAAGc,IAAI,CAACtC,KAAK;IAE7B,OACCzB,aAAA,CAACH,mBAAmB;MACnBK,GAAG,EAAG8D,KAAO;MACbvC,KAAK,EAAI,IAAIsC,IAAI,CAACtC,KAAO,EAAG;MAC5BiC,OAAO,EAAGA,OAAS;MACnBG,UAAU,EAAGxB,uBAAyB;MACtCsB,IAAI,EAAI,UAAUI,IAAI,CAACG,QAAU,EAAG;MACpC/B,QAAQ,EAAGA,CAAA,KAAM;QAChBG,WAAW,CAAEyB,IAAI,CAACG,QAAS,CAAC;QAC5B/B,QAAQ,GAAG,CAAC;MACb;IAAG,GAED4B,IAAI,CAACpC,OAAO,GACX5B,mBAAmB,GACnBV,cAAc,CACdD,MAAM,CAAE;MACP+E,IAAI,EAAEJ,IAAI,CAACrC,UAAU,CAACK;IACvB,CAAE,CACF,CAAC,EACFkC,gBAAgB,IAAIhE,qBAAqB,EACzC8D,IAAI,CAACtC,KAAK,KAAK,CAAC,IACjBgC,aAAa,IACbrD,kBAAkB,EACjBiD,QAAQ,IACTU,IAAI,CAACtC,KAAK,KAAK,CAAC,IAChB,CAAEgC,aAAa,IACftD,gBACmB,CAAC;EAExB,CAAE,CACC,CACA,CAAC;AAER","ignoreList":[]}
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","TableOfContentsItem","children","isValid","level","href","onSelect","createElement","className","toLowerCase","onClick"],"sources":["@wordpress/editor/src/components/document-outline/item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\nconst TableOfContentsItem = ( {\n\tchildren,\n\tisValid,\n\tlevel,\n\thref,\n\tonSelect,\n} ) => (\n\t<li\n\t\tclassName={ classnames(\n\t\t\t'document-outline__item',\n\t\t\t`is-${ level.toLowerCase() }`,\n\t\t\t{\n\t\t\t\t'is-invalid': ! isValid,\n\t\t\t}\n\t\t) }\n\t>\n\t\t<a\n\t\t\thref={ href }\n\t\t\tclassName=\"document-outline__button\"\n\t\t\tonClick={ onSelect }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"document-outline__emdash\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t></span>\n\t\t\t<strong className=\"document-outline__level\">{ level }</strong>\n\t\t\t<span className=\"document-outline__item-content\">{ children }</span>\n\t\t</a>\n\t</li>\n);\n\nexport default TableOfContentsItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAEnC,MAAMC,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KACAC,aAAA;EACCC,SAAS,EAAGR,UAAU,CACrB,wBAAwB,EACvB,MAAMI,KAAK,CAACK,WAAW,CAAC,CAAG,EAAC,EAC7B;IACC,YAAY,EAAE,CAAEN;EACjB,CACD;AAAG,GAEHI,aAAA;EACCF,IAAI,EAAGA,IAAM;EACbG,SAAS,EAAC,0BAA0B;EACpCE,OAAO,EAAGJ;AAAU,GAEpBC,aAAA;EACCC,SAAS,EAAC,0BAA0B;EACpC,eAAY;AAAM,CACZ,CAAC,EACRD,aAAA;EAAQC,SAAS,EAAC;AAAyB,GAAGJ,KAAe,CAAC,EAC9DG,aAAA;EAAMC,SAAS,EAAC;AAAgC,GAAGN,QAAgB,CACjE,CACA,CACJ;AAED,eAAeD,mBAAmB"}
1
+ {"version":3,"names":["classnames","TableOfContentsItem","children","isValid","level","href","onSelect","createElement","className","toLowerCase","onClick"],"sources":["@wordpress/editor/src/components/document-outline/item.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\nconst TableOfContentsItem = ( {\n\tchildren,\n\tisValid,\n\tlevel,\n\thref,\n\tonSelect,\n} ) => (\n\t<li\n\t\tclassName={ classnames(\n\t\t\t'document-outline__item',\n\t\t\t`is-${ level.toLowerCase() }`,\n\t\t\t{\n\t\t\t\t'is-invalid': ! isValid,\n\t\t\t}\n\t\t) }\n\t>\n\t\t<a\n\t\t\thref={ href }\n\t\t\tclassName=\"document-outline__button\"\n\t\t\tonClick={ onSelect }\n\t\t>\n\t\t\t<span\n\t\t\t\tclassName=\"document-outline__emdash\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t></span>\n\t\t\t<strong className=\"document-outline__level\">{ level }</strong>\n\t\t\t<span className=\"document-outline__item-content\">{ children }</span>\n\t\t</a>\n\t</li>\n);\n\nexport default TableOfContentsItem;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;AAEnC,MAAMC,mBAAmB,GAAGA,CAAE;EAC7BC,QAAQ;EACRC,OAAO;EACPC,KAAK;EACLC,IAAI;EACJC;AACD,CAAC,KACAC,aAAA;EACCC,SAAS,EAAGR,UAAU,CACrB,wBAAwB,EACvB,MAAMI,KAAK,CAACK,WAAW,CAAC,CAAG,EAAC,EAC7B;IACC,YAAY,EAAE,CAAEN;EACjB,CACD;AAAG,GAEHI,aAAA;EACCF,IAAI,EAAGA,IAAM;EACbG,SAAS,EAAC,0BAA0B;EACpCE,OAAO,EAAGJ;AAAU,GAEpBC,aAAA;EACCC,SAAS,EAAC,0BAA0B;EACpC,eAAY;AAAM,CACZ,CAAC,EACRD,aAAA;EAAQC,SAAS,EAAC;AAAyB,GAAGJ,KAAe,CAAC,EAC9DG,aAAA;EAAMC,SAAS,EAAC;AAAgC,GAAGN,QAAgB,CACjE,CACA,CACJ;AAED,eAAeD,mBAAmB","ignoreList":[]}
@@ -110,7 +110,7 @@ function DocumentTools({
110
110
  variant: "unstyled"
111
111
  }, createElement("div", {
112
112
  className: "editor-document-tools__left"
113
- }, createElement(ToolbarItem, {
113
+ }, !isDistractionFree && createElement(ToolbarItem, {
114
114
  ref: inserterButton,
115
115
  as: Button,
116
116
  className: "editor-document-tools__inserter-toggle",
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","store","blockEditorStore","privateApis","blockEditorPrivateApis","Button","ToolbarItem","listView","plus","useRef","useCallback","keyboardShortcutsStore","preferencesStore","unlock","editorStore","EditorHistoryRedo","EditorHistoryUndo","useShowBlockTools","preventDefault","event","DocumentTools","className","disableBlockTools","children","listViewLabel","inserterButton","setIsInserterOpened","setIsListViewOpened","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","listViewToggleRef","hasFixedToolbar","showIconLabels","select","getSettings","get","isListViewOpened","getListViewToggleRef","getShortcutRepresentation","isLargeViewport","isWideViewport","showFixedToolbar","toolbarAriaLabel","toggleListView","toggleInserter","current","focus","longLabel","shortLabel","createElement","shouldUseKeyboardFocusShortcut","variant","ref","as","isPressed","onMouseDown","onClick","disabled","icon","label","showTooltip","Fragment","undefined","size","shortcut"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nconst { useShowBlockTools } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction DocumentTools( {\n\tclassName,\n\tdisableBlockTools = false,\n\tchildren,\n\t// This is a temporary prop until the list view is fully unified between post and site editors.\n\tlistViewLabel = __( 'Document Overview' ),\n} ) {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tlistViewToggleRef,\n\t\thasFixedToolbar,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isListViewOpened, getListViewToggleRef } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\tconst { showFixedToolbar } = useShowBlockTools();\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ classnames(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tshouldUseKeyboardFocusShortcut={ ! showFixedToolbar }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t<ToolbarItem\n\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\tas={ Button }\n\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\ticon={ plus }\n\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t/>\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ listViewLabel }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,gBAAgB,EAChBC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AAC3D,SAASC,QAAQ,EAAEC,IAAI,QAAQ,kBAAkB;AACjD,SAASC,MAAM,EAAEC,WAAW,QAAQ,oBAAoB;AACxD,SAAST,KAAK,IAAIU,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASV,KAAK,IAAIW,gBAAgB,QAAQ,wBAAwB;;AAElE;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SAASZ,KAAK,IAAIa,WAAW,QAAQ,aAAa;AAClD,OAAOC,iBAAiB,MAAM,wBAAwB;AACtD,OAAOC,iBAAiB,MAAM,wBAAwB;AAEtD,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kC,SAAS,EAAG1B;MACZ;MACA+B,KAAK,EAAGrC,aAAe;MACvBkC,OAAO,EAAGb,cAAgB;MAC1BqB,QAAQ,EAAGnC,gBAAkB;MAC7B+B,WAAW,EAAG,CAAE5B,cAAgB;MAChCmB,OAAO,EACNnB,cAAc,GAAG,UAAU,GAAG8B,SAC9B;MACD,iBAAgBlC,cAAgB;MAChCwB,GAAG,EAAGtB,iBAAmB;MACzBiC,IAAI,EAAC;IAAS,CACd,CAED,CACF,EACC1C,QACE,CACY;EAAC;AAErB;AAEA,eAAeH,aAAa"}
1
+ {"version":3,"names":["classnames","useViewportMatch","useSelect","useDispatch","__","_x","NavigableToolbar","ToolSelector","store","blockEditorStore","privateApis","blockEditorPrivateApis","Button","ToolbarItem","listView","plus","useRef","useCallback","keyboardShortcutsStore","preferencesStore","unlock","editorStore","EditorHistoryRedo","EditorHistoryUndo","useShowBlockTools","preventDefault","event","DocumentTools","className","disableBlockTools","children","listViewLabel","inserterButton","setIsInserterOpened","setIsListViewOpened","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","listViewToggleRef","hasFixedToolbar","showIconLabels","select","getSettings","get","isListViewOpened","getListViewToggleRef","getShortcutRepresentation","isLargeViewport","isWideViewport","showFixedToolbar","toolbarAriaLabel","toggleListView","toggleInserter","current","focus","longLabel","shortLabel","createElement","shouldUseKeyboardFocusShortcut","variant","ref","as","isPressed","onMouseDown","onClick","disabled","icon","label","showTooltip","Fragment","undefined","size","shortcut"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useRef, useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nconst { useShowBlockTools } = unlock( blockEditorPrivateApis );\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction DocumentTools( {\n\tclassName,\n\tdisableBlockTools = false,\n\tchildren,\n\t// This is a temporary prop until the list view is fully unified between post and site editors.\n\tlistViewLabel = __( 'Document Overview' ),\n} ) {\n\tconst inserterButton = useRef();\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tlistViewToggleRef,\n\t\thasFixedToolbar,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { isListViewOpened, getListViewToggleRef } = unlock(\n\t\t\tselect( editorStore )\n\t\t);\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\tconst { showFixedToolbar } = useShowBlockTools();\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback( () => {\n\t\tif ( isInserterOpened ) {\n\t\t\t// Focusing the inserter button should close the inserter popover.\n\t\t\t// However, there are some cases it won't close when the focus is lost.\n\t\t\t// See https://github.com/WordPress/gutenberg/issues/43090 for more details.\n\t\t\tinserterButton.current.focus();\n\t\t\tsetIsInserterOpened( false );\n\t\t} else {\n\t\t\tsetIsInserterOpened( true );\n\t\t}\n\t}, [ isInserterOpened, setIsInserterOpened ] );\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ classnames(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tshouldUseKeyboardFocusShortcut={ ! showFixedToolbar }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterButton }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ listViewLabel }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SAASC,gBAAgB,QAAQ,oBAAoB;AACrD,SAASC,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,EAAE,EAAEC,EAAE,QAAQ,iBAAiB;AACxC,SACCC,gBAAgB,EAChBC,YAAY,EACZC,KAAK,IAAIC,gBAAgB,EACzBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASC,MAAM,EAAEC,WAAW,QAAQ,uBAAuB;AAC3D,SAASC,QAAQ,EAAEC,IAAI,QAAQ,kBAAkB;AACjD,SAASC,MAAM,EAAEC,WAAW,QAAQ,oBAAoB;AACxD,SAAST,KAAK,IAAIU,sBAAsB,QAAQ,+BAA+B;AAC/E,SAASV,KAAK,IAAIW,gBAAgB,QAAQ,wBAAwB;;A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;IAAS,CACd,CAAC,EACA,CAAErC,iBAAiB,IACpBuB,aAAA,CAAC7C,WAAW;MACXiD,EAAE,EAAGlD,MAAQ;MACbgB,SAAS,EAAC,iDAAiD;MAC3DuC,IAAI,EAAGrD,QAAU;MACjBoD,QAAQ,EAAGrC,iBAAmB;MAC9BkC,SAAS,EAAG1B;MACZ;MACA+B,KAAK,EAAGrC,aAAe;MACvBkC,OAAO,EAAGb,cAAgB;MAC1BqB,QAAQ,EAAGnC,gBAAkB;MAC7B+B,WAAW,EAAG,CAAE5B,cAAgB;MAChCmB,OAAO,EACNnB,cAAc,GAAG,UAAU,GAAG8B,SAC9B;MACD,iBAAgBlC,cAAgB;MAChCwB,GAAG,EAAGtB,iBAAmB;MACzBiC,IAAI,EAAC;IAAS,CACd,CAED,CACF,EACC1C,QACE,CACY;EAAC;AAErB;AAEA,eAAeH,aAAa","ignoreList":[]}
@@ -2,9 +2,9 @@ import { createElement } from "react";
2
2
  /**
3
3
  * WordPress dependencies
4
4
  */
5
- import { useSelect, useDispatch } from '@wordpress/data';
6
- import { useEffect, useState, useRef } from '@wordpress/element';
7
- import { store as noticesStore } from '@wordpress/notices';
5
+ import { useSelect } from '@wordpress/data';
6
+ import { store as coreStore } from '@wordpress/core-data';
7
+ import { useEffect, useState } from '@wordpress/element';
8
8
  import { __ } from '@wordpress/i18n';
9
9
  import { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';
10
10
 
@@ -43,56 +43,30 @@ export default function EditTemplateBlocksNotification({
43
43
  templateId: getCurrentTemplateId()
44
44
  };
45
45
  }, []);
46
- const {
47
- getNotices
48
- } = useSelect(noticesStore);
49
- const {
50
- createInfoNotice,
51
- removeNotice
52
- } = useDispatch(noticesStore);
46
+ const canEditTemplate = useSelect(select => {
47
+ var _select$canUser;
48
+ return (_select$canUser = select(coreStore).canUser('create', 'templates')) !== null && _select$canUser !== void 0 ? _select$canUser : false;
49
+ });
53
50
  const [isDialogOpen, setIsDialogOpen] = useState(false);
54
- const lastNoticeId = useRef(0);
55
51
  useEffect(() => {
56
- const handleClick = async event => {
57
- if (!event.target.classList.contains('is-root-container')) {
58
- return;
59
- }
60
- const isNoticeAlreadyShowing = getNotices().some(notice => notice.id === lastNoticeId.current);
61
- if (isNoticeAlreadyShowing) {
52
+ const handleDblClick = event => {
53
+ if (!canEditTemplate) {
62
54
  return;
63
55
  }
64
- const {
65
- notice
66
- } = await createInfoNotice(__('Edit your template to edit this block.'), {
67
- isDismissible: true,
68
- type: 'snackbar',
69
- actions: [{
70
- label: __('Edit template'),
71
- onClick: () => onNavigateToEntityRecord({
72
- postId: templateId,
73
- postType: 'wp_template'
74
- })
75
- }]
76
- });
77
- lastNoticeId.current = notice.id;
78
- };
79
- const handleDblClick = event => {
80
56
  if (!event.target.classList.contains('is-root-container')) {
81
57
  return;
82
58
  }
83
- if (lastNoticeId.current) {
84
- removeNotice(lastNoticeId.current);
85
- }
86
59
  setIsDialogOpen(true);
87
60
  };
88
61
  const canvas = contentRef.current;
89
- canvas?.addEventListener('click', handleClick);
90
62
  canvas?.addEventListener('dblclick', handleDblClick);
91
63
  return () => {
92
- canvas?.removeEventListener('click', handleClick);
93
64
  canvas?.removeEventListener('dblclick', handleDblClick);
94
65
  };
95
- }, [lastNoticeId, contentRef, getNotices, createInfoNotice, onNavigateToEntityRecord, templateId, removeNotice]);
66
+ }, [contentRef, canEditTemplate]);
67
+ if (!canEditTemplate) {
68
+ return null;
69
+ }
96
70
  return createElement(ConfirmDialog, {
97
71
  isOpen: isDialogOpen,
98
72
  confirmButtonText: __('Edit template'),
@@ -104,6 +78,6 @@ export default function EditTemplateBlocksNotification({
104
78
  });
105
79
  },
106
80
  onCancel: () => setIsDialogOpen(false)
107
- }, __('Edit your template to edit this block.'));
81
+ }, __('You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?.'));
108
82
  }
109
83
  //# sourceMappingURL=edit-template-blocks-notification.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","useDispatch","useEffect","useState","useRef","store","noticesStore","__","__experimentalConfirmDialog","ConfirmDialog","editorStore","EditTemplateBlocksNotification","contentRef","onNavigateToEntityRecord","templateId","select","getEditorSettings","getCurrentTemplateId","getNotices","createInfoNotice","removeNotice","isDialogOpen","setIsDialogOpen","lastNoticeId","handleClick","event","target","classList","contains","isNoticeAlreadyShowing","some","notice","id","current","isDismissible","type","actions","label","onClick","postId","postType","handleDblClick","canvas","addEventListener","removeEventListener","createElement","isOpen","confirmButtonText","onConfirm","onCancel"],"sources":["@wordpress/editor/src/components/editor-canvas/edit-template-blocks-notification.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { useEffect, useState, useRef } from '@wordpress/element';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component that:\n *\n * - Displays a 'Edit your template to edit this block' notification when the\n * user is focusing on editing page content and clicks on a disabled template\n * block.\n * - Displays a 'Edit your template to edit this block' dialog when the user\n * is focusing on editing page conetnt and double clicks on a disabled\n * template block.\n *\n * @param {Object} props\n * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block\n * editor iframe canvas.\n */\nexport default function EditTemplateBlocksNotification( { contentRef } ) {\n\tconst { onNavigateToEntityRecord, templateId } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentTemplateId } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tonNavigateToEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToEntityRecord,\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t};\n\t}, [] );\n\n\tconst { getNotices } = useSelect( noticesStore );\n\n\tconst { createInfoNotice, removeNotice } = useDispatch( noticesStore );\n\n\tconst [ isDialogOpen, setIsDialogOpen ] = useState( false );\n\n\tconst lastNoticeId = useRef( 0 );\n\n\tuseEffect( () => {\n\t\tconst handleClick = async ( event ) => {\n\t\t\tif ( ! event.target.classList.contains( 'is-root-container' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst isNoticeAlreadyShowing = getNotices().some(\n\t\t\t\t( notice ) => notice.id === lastNoticeId.current\n\t\t\t);\n\t\t\tif ( isNoticeAlreadyShowing ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst { notice } = await createInfoNotice(\n\t\t\t\t__( 'Edit your template to edit this block.' ),\n\t\t\t\t{\n\t\t\t\t\tisDismissible: true,\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tactions: [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tlabel: __( 'Edit template' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\t\tpostId: templateId,\n\t\t\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t\t\t} ),\n\t\t\t\t\t\t},\n\t\t\t\t\t],\n\t\t\t\t}\n\t\t\t);\n\t\t\tlastNoticeId.current = notice.id;\n\t\t};\n\n\t\tconst handleDblClick = ( event ) => {\n\t\t\tif ( ! event.target.classList.contains( 'is-root-container' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tif ( lastNoticeId.current ) {\n\t\t\t\tremoveNotice( lastNoticeId.current );\n\t\t\t}\n\t\t\tsetIsDialogOpen( true );\n\t\t};\n\n\t\tconst canvas = contentRef.current;\n\t\tcanvas?.addEventListener( 'click', handleClick );\n\t\tcanvas?.addEventListener( 'dblclick', handleDblClick );\n\t\treturn () => {\n\t\t\tcanvas?.removeEventListener( 'click', handleClick );\n\t\t\tcanvas?.removeEventListener( 'dblclick', handleDblClick );\n\t\t};\n\t}, [\n\t\tlastNoticeId,\n\t\tcontentRef,\n\t\tgetNotices,\n\t\tcreateInfoNotice,\n\t\tonNavigateToEntityRecord,\n\t\ttemplateId,\n\t\tremoveNotice,\n\t] );\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isDialogOpen }\n\t\t\tconfirmButtonText={ __( 'Edit template' ) }\n\t\t\tonConfirm={ () => {\n\t\t\t\tsetIsDialogOpen( false );\n\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\tpostId: templateId,\n\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonCancel={ () => setIsDialogOpen( false ) }\n\t\t>\n\t\t\t{ __( 'Edit your template to edit this block.' ) }\n\t\t</ConfirmDialog>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,WAAW,QAAQ,iBAAiB;AACxD,SAASC,SAAS,EAAEC,QAAQ,EAAEC,MAAM,QAAQ,oBAAoB;AAChE,SAASC,KAAK,IAAIC,YAAY,QAAQ,oBAAoB;AAC1D,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;;AAEpF;AACA;AACA;AACA,SAASJ,KAAK,IAAIK,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,8BAA8BA,CAAE;EAAEC;AAAW,CAAC,EAAG;EACxE,MAAM;IAAEC,wBAAwB;IAAEC;EAAW,CAAC,GAAGd,SAAS,CAAIe,MAAM,IAAM;IACzE,MAAM;MAAEC,iBAAiB;MAAEC;IAAqB,CAAC,GAChDF,MAAM,CAAEL,WAAY,CAAC;IAEtB,OAAO;MACNG,wBAAwB,EACvBG,iBAAiB,CAAC,CAAC,CAACH,wBAAwB;MAC7CC,UAAU,EAAEG,oBAAoB,CAAC;IAClC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAM;IAAEC;EAAW,CAAC,GAAGlB,SAAS,CAAEM,YAAa,CAAC;EAEhD,MAAM;IAAEa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IAED,MAAMoB,MAAM,GAAG9B,UAAU,CAACqB,OAAO;IACjCS,MAAM,EAAEC,gBAAgB,CAAE,OAAO,EAAEnB,WAAY,CAAC;IAChDkB,MAAM,EAAEC,gBAAgB,CAAE,UAAU,EAAEF,cAAe,CAAC;IACtD,OAAO,MAAM;MACZC,MAAM,EAAEE,mBAAmB,CAAE,OAAO,EAAEpB,WAAY,CAAC;MACnDkB,MAAM,EAAEE,mBAAmB,CAAE,UAAU,EAAEH,cAAe,CAAC;IAC1D,CAAC;EACF,CAAC,EAAE,CACFlB,YAAY,EACZX,UAAU,EACVM,UAAU,EACVC,gBAAgB,EAChBN,wBAAwB,EACxBC,UAAU,EACVM,YAAY,CACX,CAAC;EAEH,OACCyB,aAAA,CAACpC,aAAa;IACbqC,MAAM,EAAGzB,YAAc;IACvB0B,iBAAiB,EAAGxC,EAAE,CAAE,eAAgB,CAAG;IAC3CyC,SAAS,EAAGA,CAAA,KAAM;MACjB1B,eAAe,CAAE,KAAM,CAAC;MACxBT,wBAAwB,CAAE;QACzB0B,MAAM,EAAEzB,UAAU;QAClB0B,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ,CAAG;IACHS,QAAQ,EAAGA,CAAA,KAAM3B,eAAe,CAAE,KAAM;EAAG,GAEzCf,EAAE,CAAE,wCAAyC,CACjC,CAAC;AAElB"}
1
+ {"version":3,"names":["useSelect","store","coreStore","useEffect","useState","__","__experimentalConfirmDialog","ConfirmDialog","editorStore","EditTemplateBlocksNotification","contentRef","onNavigateToEntityRecord","templateId","select","getEditorSettings","getCurrentTemplateId","canEditTemplate","_select$canUser","canUser","isDialogOpen","setIsDialogOpen","handleDblClick","event","target","classList","contains","canvas","current","addEventListener","removeEventListener","createElement","isOpen","confirmButtonText","onConfirm","postId","postType","onCancel"],"sources":["@wordpress/editor/src/components/editor-canvas/edit-template-blocks-notification.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useEffect, useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalConfirmDialog as ConfirmDialog } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Component that:\n *\n * - Displays a 'Edit your template to edit this block' notification when the\n * user is focusing on editing page content and clicks on a disabled template\n * block.\n * - Displays a 'Edit your template to edit this block' dialog when the user\n * is focusing on editing page conetnt and double clicks on a disabled\n * template block.\n *\n * @param {Object} props\n * @param {import('react').RefObject<HTMLElement>} props.contentRef Ref to the block\n * editor iframe canvas.\n */\nexport default function EditTemplateBlocksNotification( { contentRef } ) {\n\tconst { onNavigateToEntityRecord, templateId } = useSelect( ( select ) => {\n\t\tconst { getEditorSettings, getCurrentTemplateId } =\n\t\t\tselect( editorStore );\n\n\t\treturn {\n\t\t\tonNavigateToEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToEntityRecord,\n\t\t\ttemplateId: getCurrentTemplateId(),\n\t\t};\n\t}, [] );\n\n\tconst canEditTemplate = useSelect(\n\t\t( select ) =>\n\t\t\tselect( coreStore ).canUser( 'create', 'templates' ) ?? false\n\t);\n\n\tconst [ isDialogOpen, setIsDialogOpen ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst handleDblClick = ( event ) => {\n\t\t\tif ( ! canEditTemplate ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tif ( ! event.target.classList.contains( 'is-root-container' ) ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetIsDialogOpen( true );\n\t\t};\n\n\t\tconst canvas = contentRef.current;\n\t\tcanvas?.addEventListener( 'dblclick', handleDblClick );\n\t\treturn () => {\n\t\t\tcanvas?.removeEventListener( 'dblclick', handleDblClick );\n\t\t};\n\t}, [ contentRef, canEditTemplate ] );\n\n\tif ( ! canEditTemplate ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<ConfirmDialog\n\t\t\tisOpen={ isDialogOpen }\n\t\t\tconfirmButtonText={ __( 'Edit template' ) }\n\t\t\tonConfirm={ () => {\n\t\t\t\tsetIsDialogOpen( false );\n\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\tpostId: templateId,\n\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t} );\n\t\t\t} }\n\t\t\tonCancel={ () => setIsDialogOpen( false ) }\n\t\t>\n\t\t\t{ __(\n\t\t\t\t'You’ve tried to select a block that is part of a template, which may be used on other posts and pages. Would you like to edit the template?.'\n\t\t\t) }\n\t\t</ConfirmDialog>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,SAAS,EAAEC,QAAQ,QAAQ,oBAAoB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,2BAA2B,IAAIC,aAAa,QAAQ,uBAAuB;;AAEpF;AACA;AACA;AACA,SAASN,KAAK,IAAIO,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,8BAA8BA,CAAE;EAAEC;AAAW,CAAC,EAAG;EACxE,MAAM;IAAEC,wBAAwB;IAAEC;EAAW,CAAC,GAAGZ,SAAS,CAAIa,MAAM,IAAM;IACzE,MAAM;MAAEC,iBAAiB;MAAEC;IAAqB,CAAC,GAChDF,MAAM,CAAEL,WAAY,CAAC;IAEtB,OAAO;MACNG,wBAAwB,EACvBG,iBAAiB,CAAC,CAAC,CAACH,wBAAwB;MAC7CC,UAAU,EAAEG,oBAAoB,CAAC;IAClC,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,eAAe,GAAGhB,SAAS,CAC9Ba,MAAM;IAAA,IAAAI,eAAA;IAAA,QAAAA,eAAA,GACPJ,MAAM,CAAEX,SAAU,CAAC,CAACgB,OAAO,CAAE,QAAQ,EAAE,WAAY,CAAC,cAAAD,eAAA,cAAAA,eAAA,GAAI,KAAK;EAAA,CAC/D,CAAC;EAED,MAAM,CAAEE,YAAY,EAAEC,eAAe,CAAE,GAAGhB,QAAQ,CAAE,KAAM,CAAC;EAE3DD,SAAS,CAAE,MAAM;IAChB,MAAMkB,cAAc,GAAKC,KAAK,IAAM;MACnC,IAAK,CAAEN,eAAe,EAAG;QACxB;MACD;MAEA,IAAK,CAAEM,KAAK,CAACC,MAAM,CAACC,SAAS,CAACC,QAAQ,CAAE,mBAAoB,CAAC,EAAG;QAC/D;MACD;MACAL,eAAe,CAAE,IAAK,CAAC;IACxB,CAAC;IAED,MAAMM,MAAM,GAAGhB,UAAU,CAACiB,OAAO;IACjCD,MAAM,EAAEE,gBAAgB,CAAE,UAAU,EAAEP,cAAe,CAAC;IACtD,OAAO,MAAM;MACZK,MAAM,EAAEG,mBAAmB,CAAE,UAAU,EAAER,cAAe,CAAC;IAC1D,CAAC;EACF,CAAC,EAAE,CAAEX,UAAU,EAAEM,eAAe,CAAG,CAAC;EAEpC,IAAK,CAAEA,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,OACCc,aAAA,CAACvB,aAAa;IACbwB,MAAM,EAAGZ,YAAc;IACvBa,iBAAiB,EAAG3B,EAAE,CAAE,eAAgB,CAAG;IAC3C4B,SAAS,EAAGA,CAAA,KAAM;MACjBb,eAAe,CAAE,KAAM,CAAC;MACxBT,wBAAwB,CAAE;QACzBuB,MAAM,EAAEtB,UAAU;QAClBuB,QAAQ,EAAE;MACX,CAAE,CAAC;IACJ,CAAG;IACHC,QAAQ,EAAGA,CAAA,KAAMhB,eAAe,CAAE,KAAM;EAAG,GAEzCf,EAAE,CACH,8IACD,CACc,CAAC;AAElB","ignoreList":[]}
@@ -21,6 +21,7 @@ import PostTitle from '../post-title';
21
21
  import { store as editorStore } from '../../store';
22
22
  import { unlock } from '../../lock-unlock';
23
23
  import EditTemplateBlocksNotification from './edit-template-blocks-notification';
24
+ import useSelectNearestEditableBlock from '../../hooks/use-select-nearest-editable-block';
24
25
  const {
25
26
  LayoutStyle,
26
27
  useLayoutClasses,
@@ -28,7 +29,6 @@ const {
28
29
  ExperimentalBlockCanvas: BlockCanvas,
29
30
  useFlashEditableBlocks
30
31
  } = unlock(blockEditorPrivateApis);
31
- const noop = () => {};
32
32
 
33
33
  /**
34
34
  * These post types have a special editor where they don't allow you to fill the title
@@ -74,6 +74,7 @@ function EditorCanvas({
74
74
  styles,
75
75
  disableIframe = false,
76
76
  iframeProps,
77
+ contentRef,
77
78
  children
78
79
  }) {
79
80
  const {
@@ -234,7 +235,9 @@ function EditorCanvas({
234
235
  .is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;
235
236
  const localRef = useRef();
236
237
  const typewriterRef = useTypewriter();
237
- const contentRef = useMergeRefs([localRef, renderingMode === 'post-only' ? typewriterRef : noop, useFlashEditableBlocks({
238
+ contentRef = useMergeRefs([localRef, contentRef, renderingMode === 'post-only' ? typewriterRef : null, useFlashEditableBlocks({
239
+ isEnabled: renderingMode === 'template-locked'
240
+ }), useSelectNearestEditableBlock({
238
241
  isEnabled: renderingMode === 'template-locked'
239
242
  })]);
240
243
  return createElement(BlockCanvas, {
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","BlockList","store","blockEditorStore","__unstableUseTypewriter","useTypewriter","__unstableUseTypingObserver","useTypingObserver","useSettings","RecursionProvider","privateApis","blockEditorPrivateApis","__experimentalUseResizeCanvas","useResizeCanvas","useEffect","useRef","useMemo","useSelect","parse","coreStore","useMergeRefs","PostTitle","editorStore","unlock","EditTemplateBlocksNotification","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","useFlashEditableBlocks","noop","DESIGN_POST_TYPES","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","EditorCanvas","autoFocus","className","renderAppender","styles","disableIframe","iframeProps","children","renderingMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","deviceType","showEditorPadding","isDesignPostType","select","getCurrentPostId","getCurrentPostType","getCurrentTemplateId","getEditorSettings","getRenderingMode","getDeviceType","getPostType","canUser","getEditedEntityRecord","postTypeSlug","_renderingMode","_wrapperBlockName","editorSettings","supportsTemplateMode","postType","canEditTemplate","currentTemplateId","template","undefined","includes","viewable","onNavigateToPreviousEntityRecord","isCleanNewPost","hasRootPaddingAwareAlignments","themeHasDisabledLayoutStyles","themeSupportsLayout","_settings","getSettings","disableLayoutStyles","supportsLayout","__experimentalFeatures","useRootPaddingAwareAlignments","deviceStyles","globalLayoutSettings","fallbackLayout","type","newestPostContentAttributes","content","parseableContent","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","titleRef","current","focus","alignCSS","localRef","typewriterRef","contentRef","isEnabled","createElement","shouldIframe","height","style","Fragment","selector","css","contentEditable","ref","marginTop","blockName","uniqueId","toLowerCase","dropZoneElement","parentNode","__unstableDisableDropZone"],"sources":["@wordpress/editor/src/components/editor-canvas/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n} = unlock( blockEditorPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\nconst DESIGN_POST_TYPES = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction EditorCanvas( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tclassName,\n\trenderAppender,\n\tstyles,\n\tdisableIframe = false,\n\tiframeProps,\n\tchildren,\n} ) {\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tshowEditorPadding,\n\t\tisDesignPostType,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t} = select( editorStore );\n\t\tconst { getPostType, canUser, getEditedEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === 'wp_block' ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postType = getPostType( postTypeSlug );\n\t\tconst canEditTemplate = canUser( 'create', 'templates' );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostType?.viewable && supportsTemplateMode && canEditTemplate\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tshowEditorPadding:\n\t\t\t\t!! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t} = useSelect( ( select ) => {\n\t\tconst _settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t};\n\t}, [] );\n\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = classnames(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst localRef = useRef();\n\tconst typewriterRef = useTypewriter();\n\tconst contentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : noop,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t] );\n\n\treturn (\n\t\t<BlockCanvas\n\t\t\tshouldIframe={\n\t\t\t\t! disableIframe || [ 'Tablet', 'Mobile' ].includes( deviceType )\n\t\t\t}\n\t\t\tcontentRef={ contentRef }\n\t\t\tstyles={ styles }\n\t\t\theight=\"100%\"\n\t\t\tiframeProps={ {\n\t\t\t\tclassName: classnames( 'editor-canvas__iframe', {\n\t\t\t\t\t'has-editor-padding': showEditorPadding,\n\t\t\t\t} ),\n\t\t\t\t...iframeProps,\n\t\t\t\tstyle: {\n\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t...deviceStyles,\n\t\t\t\t},\n\t\t\t} }\n\t\t>\n\t\t\t{ themeSupportsLayout &&\n\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tselector=\".editor-editor-canvas__post-title-wrapper\"\n\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'editor-editor-canvas__post-title-wrapper',\n\t\t\t\t\t\t// The following class is only here for backward comapatibility\n\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-global-padding': hasRootPaddingAwareAlignments,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<RecursionProvider\n\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t>\n\t\t\t\t<BlockList\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\trenderingMode !== 'post-only' || isDesignPostType\n\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t) }\n\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t}\n\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\trenderingMode === 'template-locked' ? true : false\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t<EditTemplateBlocksNotification contentRef={ localRef } />\n\t\t\t\t) }\n\t\t\t</RecursionProvider>\n\t\t\t{ children }\n\t\t</BlockCanvas>\n\t);\n}\n\nexport default EditorCanvas;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,SAAS,EACTC,KAAK,IAAIC,gBAAgB,EACzBC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EAAiB,GAE5BiE,aAAA,CAACtH,SAAS;IACT2C,SAAS,EAAG5C,UAAU,CACrB4C,SAAS,EACT,KAAK,GAAGW,UAAU,CAAC4E,WAAW,CAAC,CAAC,GAAG,UAAU,EAC7CjF,aAAa,KAAK,WAAW,IAAIO,gBAAgB,GAC9C,gBAAgB,GACf,GAAG6C,oBAAsB,wBAAuB,CAAC;IACtD,CAAG;IACHH,MAAM,EAAGS,eAAiB;IAC1BwB,eAAe;IACd;IACA;IACArF,aAAa,GACVoE,QAAQ,CAACH,OAAO,GAChBG,QAAQ,CAACH,OAAO,EAAEqB,UACrB;IACDxF,cAAc,EAAGA,cAAgB;IACjCyF,yBAAyB;IACxB;IACApF,aAAa,KAAK,iBAAiB,GAAG,IAAI,GAAG;EAC7C,CACD,CAAC,EACAA,aAAa,KAAK,iBAAiB,IACpCqE,aAAA,CAAC/F,8BAA8B;IAAC6F,UAAU,EAAGF;EAAU,CAAE,CAExC,CAAC,EAClBlE,QACU,CAAC;AAEhB;AAEA,eAAeP,YAAY"}
1
+ {"version":3,"names":["classnames","BlockList","store","blockEditorStore","__unstableUseTypewriter","useTypewriter","__unstableUseTypingObserver","useTypingObserver","useSettings","RecursionProvider","privateApis","blockEditorPrivateApis","__experimentalUseResizeCanvas","useResizeCanvas","useEffect","useRef","useMemo","useSelect","parse","coreStore","useMergeRefs","PostTitle","editorStore","unlock","EditTemplateBlocksNotification","useSelectNearestEditableBlock","LayoutStyle","useLayoutClasses","useLayoutStyles","ExperimentalBlockCanvas","BlockCanvas","useFlashEditableBlocks","DESIGN_POST_TYPES","getPostContentAttributes","blocks","i","length","name","attributes","innerBlocks","nestedPostContent","checkForPostContentAtRootLevel","EditorCanvas","autoFocus","className","renderAppender","styles","disableIframe","iframeProps","contentRef","children","renderingMode","postContentAttributes","editedPostTemplate","wrapperBlockName","wrapperUniqueId","deviceType","showEditorPadding","isDesignPostType","select","getCurrentPostId","getCurrentPostType","getCurrentTemplateId","getEditorSettings","getRenderingMode","getDeviceType","getPostType","canUser","getEditedEntityRecord","postTypeSlug","_renderingMode","_wrapperBlockName","editorSettings","supportsTemplateMode","postType","canEditTemplate","currentTemplateId","template","undefined","includes","viewable","onNavigateToPreviousEntityRecord","isCleanNewPost","hasRootPaddingAwareAlignments","themeHasDisabledLayoutStyles","themeSupportsLayout","_settings","getSettings","disableLayoutStyles","supportsLayout","__experimentalFeatures","useRootPaddingAwareAlignments","deviceStyles","globalLayoutSettings","fallbackLayout","type","newestPostContentAttributes","content","parseableContent","hasPostContentAtRootLevel","layout","align","postContentLayoutClasses","blockListLayoutClass","postContentLayoutStyles","postContentLayout","inherit","contentSize","wideSize","blockListLayout","postEditorLayout","observeTypingRef","titleRef","current","focus","alignCSS","localRef","typewriterRef","isEnabled","createElement","shouldIframe","height","style","Fragment","selector","css","contentEditable","ref","marginTop","blockName","uniqueId","toLowerCase","dropZoneElement","parentNode","__unstableDisableDropZone"],"sources":["@wordpress/editor/src/components/editor-canvas/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockList,\n\tstore as blockEditorStore,\n\t__unstableUseTypewriter as useTypewriter,\n\t__unstableUseTypingObserver as useTypingObserver,\n\tuseSettings,\n\tRecursionProvider,\n\tprivateApis as blockEditorPrivateApis,\n\t__experimentalUseResizeCanvas as useResizeCanvas,\n} from '@wordpress/block-editor';\nimport { useEffect, useRef, useMemo } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { parse } from '@wordpress/blocks';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport PostTitle from '../post-title';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport EditTemplateBlocksNotification from './edit-template-blocks-notification';\nimport useSelectNearestEditableBlock from '../../hooks/use-select-nearest-editable-block';\n\nconst {\n\tLayoutStyle,\n\tuseLayoutClasses,\n\tuseLayoutStyles,\n\tExperimentalBlockCanvas: BlockCanvas,\n\tuseFlashEditableBlocks,\n} = unlock( blockEditorPrivateApis );\n\n/**\n * These post types have a special editor where they don't allow you to fill the title\n * and they don't apply the layout styles.\n */\nconst DESIGN_POST_TYPES = [\n\t'wp_block',\n\t'wp_template',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Given an array of nested blocks, find the first Post Content\n * block inside it, recursing through any nesting levels,\n * and return its attributes.\n *\n * @param {Array} blocks A list of blocks.\n *\n * @return {Object | undefined} The Post Content block.\n */\nfunction getPostContentAttributes( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn blocks[ i ].attributes;\n\t\t}\n\t\tif ( blocks[ i ].innerBlocks.length ) {\n\t\t\tconst nestedPostContent = getPostContentAttributes(\n\t\t\t\tblocks[ i ].innerBlocks\n\t\t\t);\n\n\t\t\tif ( nestedPostContent ) {\n\t\t\t\treturn nestedPostContent;\n\t\t\t}\n\t\t}\n\t}\n}\n\nfunction checkForPostContentAtRootLevel( blocks ) {\n\tfor ( let i = 0; i < blocks.length; i++ ) {\n\t\tif ( blocks[ i ].name === 'core/post-content' ) {\n\t\t\treturn true;\n\t\t}\n\t}\n\treturn false;\n}\n\nfunction EditorCanvas( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tclassName,\n\trenderAppender,\n\tstyles,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tchildren,\n} ) {\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tshowEditorPadding,\n\t\tisDesignPostType,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostId,\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentTemplateId,\n\t\t\tgetEditorSettings,\n\t\t\tgetRenderingMode,\n\t\t\tgetDeviceType,\n\t\t} = select( editorStore );\n\t\tconst { getPostType, canUser, getEditedEntityRecord } =\n\t\t\tselect( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === 'wp_block' ) {\n\t\t\t_wrapperBlockName = 'core/block';\n\t\t} else if ( _renderingMode === 'post-only' ) {\n\t\t\t_wrapperBlockName = 'core/post-content';\n\t\t}\n\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst supportsTemplateMode = editorSettings.supportsTemplateMode;\n\t\tconst postType = getPostType( postTypeSlug );\n\t\tconst canEditTemplate = canUser( 'create', 'templates' );\n\t\tconst currentTemplateId = getCurrentTemplateId();\n\t\tconst template = currentTemplateId\n\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_template',\n\t\t\t\t\tcurrentTemplateId\n\t\t\t )\n\t\t\t: undefined;\n\n\t\treturn {\n\t\t\trenderingMode: _renderingMode,\n\t\t\tpostContentAttributes: editorSettings.postContentAttributes,\n\t\t\tisDesignPostType: DESIGN_POST_TYPES.includes( postTypeSlug ),\n\t\t\t// Post template fetch returns a 404 on classic themes, which\n\t\t\t// messes with e2e tests, so check it's a block theme first.\n\t\t\teditedPostTemplate:\n\t\t\t\tpostType?.viewable && supportsTemplateMode && canEditTemplate\n\t\t\t\t\t? template\n\t\t\t\t\t: undefined,\n\t\t\twrapperBlockName: _wrapperBlockName,\n\t\t\twrapperUniqueId: getCurrentPostId(),\n\t\t\tdeviceType: getDeviceType(),\n\t\t\tshowEditorPadding:\n\t\t\t\t!! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t} = useSelect( ( select ) => {\n\t\tconst _settings = select( blockEditorStore ).getSettings();\n\t\treturn {\n\t\t\tthemeHasDisabledLayoutStyles: _settings.disableLayoutStyles,\n\t\t\tthemeSupportsLayout: _settings.supportsLayout,\n\t\t\thasRootPaddingAwareAlignments:\n\t\t\t\t_settings.__experimentalFeatures?.useRootPaddingAwareAlignments,\n\t\t};\n\t}, [] );\n\n\tconst deviceStyles = useResizeCanvas( deviceType );\n\tconst [ globalLayoutSettings ] = useSettings( 'layout' );\n\n\t// fallbackLayout is used if there is no Post Content,\n\t// and for Post Title.\n\tconst fallbackLayout = useMemo( () => {\n\t\tif ( renderingMode !== 'post-only' || isDesignPostType ) {\n\t\t\treturn { type: 'default' };\n\t\t}\n\n\t\tif ( themeSupportsLayout ) {\n\t\t\t// We need to ensure support for wide and full alignments,\n\t\t\t// so we add the constrained type.\n\t\t\treturn { ...globalLayoutSettings, type: 'constrained' };\n\t\t}\n\t\t// Set default layout for classic themes so all alignments are supported.\n\t\treturn { type: 'default' };\n\t}, [\n\t\trenderingMode,\n\t\tthemeSupportsLayout,\n\t\tglobalLayoutSettings,\n\t\tisDesignPostType,\n\t] );\n\n\tconst newestPostContentAttributes = useMemo( () => {\n\t\tif (\n\t\t\t! editedPostTemplate?.content &&\n\t\t\t! editedPostTemplate?.blocks &&\n\t\t\tpostContentAttributes\n\t\t) {\n\t\t\treturn postContentAttributes;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn getPostContentAttributes( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn getPostContentAttributes( parse( parseableContent ) ) || {};\n\t}, [\n\t\teditedPostTemplate?.content,\n\t\teditedPostTemplate?.blocks,\n\t\tpostContentAttributes,\n\t] );\n\n\tconst hasPostContentAtRootLevel = useMemo( () => {\n\t\tif ( ! editedPostTemplate?.content && ! editedPostTemplate?.blocks ) {\n\t\t\treturn false;\n\t\t}\n\t\t// When in template editing mode, we can access the blocks directly.\n\t\tif ( editedPostTemplate?.blocks ) {\n\t\t\treturn checkForPostContentAtRootLevel( editedPostTemplate?.blocks );\n\t\t}\n\t\t// If there are no blocks, we have to parse the content string.\n\t\t// Best double-check it's a string otherwise the parse function gets unhappy.\n\t\tconst parseableContent =\n\t\t\ttypeof editedPostTemplate?.content === 'string'\n\t\t\t\t? editedPostTemplate?.content\n\t\t\t\t: '';\n\n\t\treturn (\n\t\t\tcheckForPostContentAtRootLevel( parse( parseableContent ) ) || false\n\t\t);\n\t}, [ editedPostTemplate?.content, editedPostTemplate?.blocks ] );\n\n\tconst { layout = {}, align = '' } = newestPostContentAttributes || {};\n\n\tconst postContentLayoutClasses = useLayoutClasses(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content'\n\t);\n\n\tconst blockListLayoutClass = classnames(\n\t\t{\n\t\t\t'is-layout-flow': ! themeSupportsLayout,\n\t\t},\n\t\tthemeSupportsLayout && postContentLayoutClasses,\n\t\talign && `align${ align }`\n\t);\n\n\tconst postContentLayoutStyles = useLayoutStyles(\n\t\tnewestPostContentAttributes,\n\t\t'core/post-content',\n\t\t'.block-editor-block-list__layout.is-root-container'\n\t);\n\n\t// Update type for blocks using legacy layouts.\n\tconst postContentLayout = useMemo( () => {\n\t\treturn layout &&\n\t\t\t( layout?.type === 'constrained' ||\n\t\t\t\tlayout?.inherit ||\n\t\t\t\tlayout?.contentSize ||\n\t\t\t\tlayout?.wideSize )\n\t\t\t? { ...globalLayoutSettings, ...layout, type: 'constrained' }\n\t\t\t: { ...globalLayoutSettings, ...layout, type: 'default' };\n\t}, [\n\t\tlayout?.type,\n\t\tlayout?.inherit,\n\t\tlayout?.contentSize,\n\t\tlayout?.wideSize,\n\t\tglobalLayoutSettings,\n\t] );\n\n\t// If there is a Post Content block we use its layout for the block list;\n\t// if not, this must be a classic theme, in which case we use the fallback layout.\n\tconst blockListLayout = postContentAttributes\n\t\t? postContentLayout\n\t\t: fallbackLayout;\n\n\tconst postEditorLayout =\n\t\tblockListLayout?.type === 'default' && ! hasPostContentAtRootLevel\n\t\t\t? fallbackLayout\n\t\t\t: blockListLayout;\n\n\tconst observeTypingRef = useTypingObserver();\n\tconst titleRef = useRef();\n\tuseEffect( () => {\n\t\tif ( ! autoFocus || ! isCleanNewPost() ) {\n\t\t\treturn;\n\t\t}\n\t\ttitleRef?.current?.focus();\n\t}, [ autoFocus, isCleanNewPost ] );\n\n\t// Add some styles for alignwide/alignfull Post Content and its children.\n\tconst alignCSS = `.is-root-container.alignwide { max-width: var(--wp--style--global--wide-size); margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignwide:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: var(--wp--style--global--wide-size);}\n\t\t.is-root-container.alignfull { max-width: none; margin-left: auto; margin-right: auto;}\n\t\t.is-root-container.alignfull:where(.is-layout-flow) > :not(.alignleft):not(.alignright) { max-width: none;}`;\n\n\tconst localRef = useRef();\n\tconst typewriterRef = useTypewriter();\n\tcontentRef = useMergeRefs( [\n\t\tlocalRef,\n\t\tcontentRef,\n\t\trenderingMode === 'post-only' ? typewriterRef : null,\n\t\tuseFlashEditableBlocks( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t\tuseSelectNearestEditableBlock( {\n\t\t\tisEnabled: renderingMode === 'template-locked',\n\t\t} ),\n\t] );\n\n\treturn (\n\t\t<BlockCanvas\n\t\t\tshouldIframe={\n\t\t\t\t! disableIframe || [ 'Tablet', 'Mobile' ].includes( deviceType )\n\t\t\t}\n\t\t\tcontentRef={ contentRef }\n\t\t\tstyles={ styles }\n\t\t\theight=\"100%\"\n\t\t\tiframeProps={ {\n\t\t\t\tclassName: classnames( 'editor-canvas__iframe', {\n\t\t\t\t\t'has-editor-padding': showEditorPadding,\n\t\t\t\t} ),\n\t\t\t\t...iframeProps,\n\t\t\t\tstyle: {\n\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t...deviceStyles,\n\t\t\t\t},\n\t\t\t} }\n\t\t>\n\t\t\t{ themeSupportsLayout &&\n\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tselector=\".editor-editor-canvas__post-title-wrapper\"\n\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t<div\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'editor-editor-canvas__post-title-wrapper',\n\t\t\t\t\t\t// The following class is only here for backward comapatibility\n\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'has-global-padding': hasRootPaddingAwareAlignments,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<RecursionProvider\n\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t>\n\t\t\t\t<BlockList\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\tclassName,\n\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\trenderingMode !== 'post-only' || isDesignPostType\n\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\t\t\t\t\t: `${ blockListLayoutClass } wp-block-post-content` // Ensure root level blocks receive default/flow blockGap styling rules.\n\t\t\t\t\t) }\n\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t}\n\t\t\t\t\trenderAppender={ renderAppender }\n\t\t\t\t\t__unstableDisableDropZone={\n\t\t\t\t\t\t// In template preview mode, disable drop zones at the root of the template.\n\t\t\t\t\t\trenderingMode === 'template-locked' ? true : false\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t<EditTemplateBlocksNotification contentRef={ localRef } />\n\t\t\t\t) }\n\t\t\t</RecursionProvider>\n\t\t\t{ children }\n\t\t</BlockCanvas>\n\t);\n}\n\nexport default EditorCanvas;\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,SAAS,EACTC,KAAK,IAAIC,gBAAgB,EACzBC,uBAAuB,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