@wordpress/editor 14.44.0 → 14.45.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 (363) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/collab-sidebar/{comment-menu-item.cjs → add-note-menu-item.cjs} +17 -14
  3. package/build/components/collab-sidebar/add-note-menu-item.cjs.map +7 -0
  4. package/build/components/collab-sidebar/add-note.cjs +100 -0
  5. package/build/components/collab-sidebar/add-note.cjs.map +7 -0
  6. package/build/components/collab-sidebar/board-store.cjs +106 -0
  7. package/build/components/collab-sidebar/board-store.cjs.map +7 -0
  8. package/build/components/collab-sidebar/floating-container.cjs +63 -0
  9. package/build/components/collab-sidebar/floating-container.cjs.map +7 -0
  10. package/build/components/collab-sidebar/hooks.cjs +105 -140
  11. package/build/components/collab-sidebar/hooks.cjs.map +3 -3
  12. package/build/components/collab-sidebar/index.cjs +28 -90
  13. package/build/components/collab-sidebar/index.cjs.map +3 -3
  14. package/build/components/collab-sidebar/{comment-author-info.cjs → note-byline.cjs} +13 -9
  15. package/build/components/collab-sidebar/note-byline.cjs.map +7 -0
  16. package/build/components/collab-sidebar/note-card.cjs +58 -0
  17. package/build/components/collab-sidebar/note-card.cjs.map +7 -0
  18. package/build/components/collab-sidebar/{comment-form.cjs → note-form.cjs} +46 -45
  19. package/build/components/collab-sidebar/note-form.cjs.map +7 -0
  20. package/build/components/collab-sidebar/{comment-indicator-toolbar.cjs → note-indicator-toolbar.cjs} +31 -27
  21. package/build/components/collab-sidebar/note-indicator-toolbar.cjs.map +7 -0
  22. package/build/components/collab-sidebar/note-thread.cjs +321 -0
  23. package/build/components/collab-sidebar/note-thread.cjs.map +7 -0
  24. package/build/components/collab-sidebar/note.cjs +207 -0
  25. package/build/components/collab-sidebar/note.cjs.map +7 -0
  26. package/build/components/collab-sidebar/notes.cjs +237 -0
  27. package/build/components/collab-sidebar/notes.cjs.map +7 -0
  28. package/build/components/collab-sidebar/utils.cjs +80 -14
  29. package/build/components/collab-sidebar/utils.cjs.map +2 -2
  30. package/build/components/collaborators-presence/avatar/component.cjs.map +1 -1
  31. package/build/components/collaborators-presence/index.cjs +3 -3
  32. package/build/components/collaborators-presence/index.cjs.map +2 -2
  33. package/build/components/collaborators-presence/list.cjs +3 -3
  34. package/build/components/collaborators-presence/list.cjs.map +2 -2
  35. package/build/components/document-bar/index.cjs.map +3 -3
  36. package/build/components/error-boundary/index.cjs.map +3 -3
  37. package/build/components/list-view-sidebar/list-view-outline.cjs.map +3 -3
  38. package/build/components/media/media-editor-modal.cjs +93 -0
  39. package/build/components/media/media-editor-modal.cjs.map +7 -0
  40. package/build/components/media-categories/index.cjs +1 -1
  41. package/build/components/media-categories/index.cjs.map +1 -1
  42. package/build/components/more-menu/index.cjs +4 -3
  43. package/build/components/more-menu/index.cjs.map +2 -2
  44. package/build/components/post-actions/set-as-homepage.cjs.map +3 -3
  45. package/build/components/post-actions/set-as-posts-page.cjs.map +3 -3
  46. package/build/components/post-card-panel/index.cjs +2 -2
  47. package/build/components/post-card-panel/index.cjs.map +3 -3
  48. package/build/components/post-content-information/index.cjs.map +3 -3
  49. package/build/components/post-excerpt/panel.cjs.map +3 -3
  50. package/build/components/post-last-edited-panel/index.cjs.map +3 -3
  51. package/build/components/post-preview-button/index.cjs +3 -2
  52. package/build/components/post-preview-button/index.cjs.map +2 -2
  53. package/build/components/post-publish-button/index.cjs +2 -2
  54. package/build/components/post-publish-button/index.cjs.map +2 -2
  55. package/build/components/post-publish-button/label.cjs +4 -2
  56. package/build/components/post-publish-button/label.cjs.map +2 -2
  57. package/build/components/post-publish-panel/maybe-upload-media.cjs +1 -1
  58. package/build/components/post-publish-panel/maybe-upload-media.cjs.map +1 -1
  59. package/build/components/post-publish-panel/postpublish.cjs +3 -2
  60. package/build/components/post-publish-panel/postpublish.cjs.map +2 -2
  61. package/build/components/post-revisions-panel/index.cjs +2 -2
  62. package/build/components/post-revisions-panel/index.cjs.map +2 -2
  63. package/build/components/post-revisions-preview/diff-markers.cjs +1 -1
  64. package/build/components/post-revisions-preview/diff-markers.cjs.map +2 -2
  65. package/build/components/post-revisions-preview/revisions-slider.cjs +1 -0
  66. package/build/components/post-revisions-preview/revisions-slider.cjs.map +2 -2
  67. package/build/components/post-saved-state/index.cjs +4 -1
  68. package/build/components/post-saved-state/index.cjs.map +2 -2
  69. package/build/components/post-text-editor/index.cjs +3 -4
  70. package/build/components/post-text-editor/index.cjs.map +2 -2
  71. package/build/components/preview-dropdown/index.cjs +3 -2
  72. package/build/components/preview-dropdown/index.cjs.map +2 -2
  73. package/build/components/provider/index.cjs +3 -1
  74. package/build/components/provider/index.cjs.map +3 -3
  75. package/build/components/provider/use-block-editor-settings.cjs +7 -1
  76. package/build/components/provider/use-block-editor-settings.cjs.map +3 -3
  77. package/build/components/provider/use-upload-save-lock.cjs +2 -12
  78. package/build/components/provider/use-upload-save-lock.cjs.map +2 -2
  79. package/build/components/resizable-editor/resize-handle.cjs +2 -1
  80. package/build/components/resizable-editor/resize-handle.cjs.map +2 -2
  81. package/build/components/revision-created-panel/index.cjs.map +3 -3
  82. package/build/components/site-discussion/index.cjs.map +2 -2
  83. package/build/components/style-book/constants.cjs +1 -1
  84. package/build/components/style-book/constants.cjs.map +1 -1
  85. package/build/components/style-book/index.cjs +1 -1
  86. package/build/components/style-book/index.cjs.map +1 -1
  87. package/build/components/template-actions-panel/classic-theme-content.cjs.map +2 -2
  88. package/build/components/template-part-menu-items/convert-to-regular.cjs +54 -11
  89. package/build/components/template-part-menu-items/convert-to-regular.cjs.map +3 -3
  90. package/build/components/visual-editor/index.cjs +5 -22
  91. package/build/components/visual-editor/index.cjs.map +2 -2
  92. package/build/store/private-actions.cjs +0 -8
  93. package/build/store/private-actions.cjs.map +2 -2
  94. package/build/store/private-selectors.cjs +0 -5
  95. package/build/store/private-selectors.cjs.map +2 -2
  96. package/build/store/reducer.cjs +0 -10
  97. package/build/store/reducer.cjs.map +2 -2
  98. package/build/utils/media-finalize/index.cjs +3 -2
  99. package/build/utils/media-finalize/index.cjs.map +2 -2
  100. package/build/utils/media-upload/index.cjs +14 -25
  101. package/build/utils/media-upload/index.cjs.map +2 -2
  102. package/build-module/components/collab-sidebar/{comment-menu-item.mjs → add-note-menu-item.mjs} +10 -11
  103. package/build-module/components/collab-sidebar/add-note-menu-item.mjs.map +7 -0
  104. package/build-module/components/collab-sidebar/add-note.mjs +78 -0
  105. package/build-module/components/collab-sidebar/add-note.mjs.map +7 -0
  106. package/build-module/components/collab-sidebar/board-store.mjs +81 -0
  107. package/build-module/components/collab-sidebar/board-store.mjs.map +7 -0
  108. package/build-module/components/collab-sidebar/floating-container.mjs +28 -0
  109. package/build-module/components/collab-sidebar/floating-container.mjs.map +7 -0
  110. package/build-module/components/collab-sidebar/hooks.mjs +105 -144
  111. package/build-module/components/collab-sidebar/hooks.mjs.map +2 -2
  112. package/build-module/components/collab-sidebar/index.mjs +29 -95
  113. package/build-module/components/collab-sidebar/index.mjs.map +2 -2
  114. package/build-module/components/collab-sidebar/{comment-author-info.mjs → note-byline.mjs} +7 -7
  115. package/build-module/components/collab-sidebar/note-byline.mjs.map +7 -0
  116. package/build-module/components/collab-sidebar/note-card.mjs +33 -0
  117. package/build-module/components/collab-sidebar/note-card.mjs.map +7 -0
  118. package/build-module/components/collab-sidebar/note-form.mjs +84 -0
  119. package/build-module/components/collab-sidebar/note-form.mjs.map +7 -0
  120. package/build-module/components/collab-sidebar/{comment-indicator-toolbar.mjs → note-indicator-toolbar.mjs} +25 -29
  121. package/build-module/components/collab-sidebar/note-indicator-toolbar.mjs.map +7 -0
  122. package/build-module/components/collab-sidebar/note-thread.mjs +289 -0
  123. package/build-module/components/collab-sidebar/note-thread.mjs.map +7 -0
  124. package/build-module/components/collab-sidebar/note.mjs +176 -0
  125. package/build-module/components/collab-sidebar/note.mjs.map +7 -0
  126. package/build-module/components/collab-sidebar/notes.mjs +215 -0
  127. package/build-module/components/collab-sidebar/notes.mjs.map +7 -0
  128. package/build-module/components/collab-sidebar/utils.mjs +76 -10
  129. package/build-module/components/collab-sidebar/utils.mjs.map +2 -2
  130. package/build-module/components/collaborators-presence/avatar/component.mjs.map +1 -1
  131. package/build-module/components/collaborators-presence/index.mjs +3 -3
  132. package/build-module/components/collaborators-presence/index.mjs.map +2 -2
  133. package/build-module/components/collaborators-presence/list.mjs +3 -3
  134. package/build-module/components/collaborators-presence/list.mjs.map +2 -2
  135. package/build-module/components/document-bar/index.mjs +3 -3
  136. package/build-module/components/document-bar/index.mjs.map +2 -2
  137. package/build-module/components/error-boundary/index.mjs +2 -2
  138. package/build-module/components/error-boundary/index.mjs.map +2 -2
  139. package/build-module/components/list-view-sidebar/list-view-outline.mjs +5 -5
  140. package/build-module/components/list-view-sidebar/list-view-outline.mjs.map +2 -2
  141. package/build-module/components/media/media-editor-modal.mjs +62 -0
  142. package/build-module/components/media/media-editor-modal.mjs.map +7 -0
  143. package/build-module/components/media-categories/index.mjs +1 -1
  144. package/build-module/components/media-categories/index.mjs.map +1 -1
  145. package/build-module/components/more-menu/index.mjs +4 -8
  146. package/build-module/components/more-menu/index.mjs.map +2 -2
  147. package/build-module/components/post-actions/set-as-homepage.mjs +2 -2
  148. package/build-module/components/post-actions/set-as-homepage.mjs.map +2 -2
  149. package/build-module/components/post-actions/set-as-posts-page.mjs +2 -2
  150. package/build-module/components/post-actions/set-as-posts-page.mjs.map +2 -2
  151. package/build-module/components/post-card-panel/index.mjs +5 -5
  152. package/build-module/components/post-card-panel/index.mjs.map +2 -2
  153. package/build-module/components/post-content-information/index.mjs +2 -2
  154. package/build-module/components/post-content-information/index.mjs.map +2 -2
  155. package/build-module/components/post-excerpt/panel.mjs +2 -2
  156. package/build-module/components/post-excerpt/panel.mjs.map +2 -2
  157. package/build-module/components/post-last-edited-panel/index.mjs +2 -2
  158. package/build-module/components/post-last-edited-panel/index.mjs.map +2 -2
  159. package/build-module/components/post-preview-button/index.mjs +3 -2
  160. package/build-module/components/post-preview-button/index.mjs.map +2 -2
  161. package/build-module/components/post-publish-button/index.mjs +2 -2
  162. package/build-module/components/post-publish-button/index.mjs.map +2 -2
  163. package/build-module/components/post-publish-button/label.mjs +4 -2
  164. package/build-module/components/post-publish-button/label.mjs.map +2 -2
  165. package/build-module/components/post-publish-panel/maybe-upload-media.mjs +1 -1
  166. package/build-module/components/post-publish-panel/maybe-upload-media.mjs.map +1 -1
  167. package/build-module/components/post-publish-panel/postpublish.mjs +3 -3
  168. package/build-module/components/post-publish-panel/postpublish.mjs.map +2 -2
  169. package/build-module/components/post-revisions-panel/index.mjs +2 -2
  170. package/build-module/components/post-revisions-panel/index.mjs.map +2 -2
  171. package/build-module/components/post-revisions-preview/diff-markers.mjs +1 -1
  172. package/build-module/components/post-revisions-preview/diff-markers.mjs.map +2 -2
  173. package/build-module/components/post-revisions-preview/revisions-slider.mjs +1 -0
  174. package/build-module/components/post-revisions-preview/revisions-slider.mjs.map +2 -2
  175. package/build-module/components/post-saved-state/index.mjs +4 -1
  176. package/build-module/components/post-saved-state/index.mjs.map +2 -2
  177. package/build-module/components/post-text-editor/index.mjs +2 -3
  178. package/build-module/components/post-text-editor/index.mjs.map +2 -2
  179. package/build-module/components/preview-dropdown/index.mjs +2 -2
  180. package/build-module/components/preview-dropdown/index.mjs.map +2 -2
  181. package/build-module/components/provider/index.mjs +3 -1
  182. package/build-module/components/provider/index.mjs.map +2 -2
  183. package/build-module/components/provider/use-block-editor-settings.mjs +7 -1
  184. package/build-module/components/provider/use-block-editor-settings.mjs.map +2 -2
  185. package/build-module/components/provider/use-upload-save-lock.mjs +2 -12
  186. package/build-module/components/provider/use-upload-save-lock.mjs.map +2 -2
  187. package/build-module/components/resizable-editor/resize-handle.mjs +2 -5
  188. package/build-module/components/resizable-editor/resize-handle.mjs.map +2 -2
  189. package/build-module/components/revision-created-panel/index.mjs +2 -2
  190. package/build-module/components/revision-created-panel/index.mjs.map +2 -2
  191. package/build-module/components/site-discussion/index.mjs +2 -2
  192. package/build-module/components/site-discussion/index.mjs.map +2 -2
  193. package/build-module/components/style-book/constants.mjs +1 -1
  194. package/build-module/components/style-book/constants.mjs.map +1 -1
  195. package/build-module/components/style-book/index.mjs +1 -1
  196. package/build-module/components/style-book/index.mjs.map +1 -1
  197. package/build-module/components/template-actions-panel/classic-theme-content.mjs +2 -2
  198. package/build-module/components/template-actions-panel/classic-theme-content.mjs.map +2 -2
  199. package/build-module/components/template-part-menu-items/convert-to-regular.mjs +60 -14
  200. package/build-module/components/template-part-menu-items/convert-to-regular.mjs.map +2 -2
  201. package/build-module/components/visual-editor/index.mjs +5 -22
  202. package/build-module/components/visual-editor/index.mjs.map +2 -2
  203. package/build-module/store/private-actions.mjs +0 -7
  204. package/build-module/store/private-actions.mjs.map +2 -2
  205. package/build-module/store/private-selectors.mjs +0 -4
  206. package/build-module/store/private-selectors.mjs.map +2 -2
  207. package/build-module/store/reducer.mjs +0 -9
  208. package/build-module/store/reducer.mjs.map +2 -2
  209. package/build-module/utils/media-finalize/index.mjs +3 -2
  210. package/build-module/utils/media-finalize/index.mjs.map +2 -2
  211. package/build-module/utils/media-upload/index.mjs +14 -25
  212. package/build-module/utils/media-upload/index.mjs.map +2 -2
  213. package/build-style/style-rtl.css +397 -171
  214. package/build-style/style.css +397 -171
  215. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts +5 -0
  216. package/build-types/components/collab-sidebar/add-note-menu-item.d.ts.map +1 -0
  217. package/build-types/components/collab-sidebar/add-note.d.ts +6 -0
  218. package/build-types/components/collab-sidebar/add-note.d.ts.map +1 -0
  219. package/build-types/components/collab-sidebar/board-store.d.ts +9 -0
  220. package/build-types/components/collab-sidebar/board-store.d.ts.map +1 -0
  221. package/build-types/components/collab-sidebar/floating-container.d.ts +8 -0
  222. package/build-types/components/collab-sidebar/floating-container.d.ts.map +1 -0
  223. package/build-types/components/collab-sidebar/hooks.d.ts +13 -22
  224. package/build-types/components/collab-sidebar/hooks.d.ts.map +1 -1
  225. package/build-types/components/collab-sidebar/index.d.ts.map +1 -1
  226. package/build-types/components/collab-sidebar/note-byline.d.ts +7 -0
  227. package/build-types/components/collab-sidebar/note-byline.d.ts.map +1 -0
  228. package/build-types/components/collab-sidebar/note-card.d.ts +8 -0
  229. package/build-types/components/collab-sidebar/note-card.d.ts.map +1 -0
  230. package/build-types/components/collab-sidebar/note-form.d.ts +7 -0
  231. package/build-types/components/collab-sidebar/note-form.d.ts.map +1 -0
  232. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts +5 -0
  233. package/build-types/components/collab-sidebar/note-indicator-toolbar.d.ts.map +1 -0
  234. package/build-types/components/collab-sidebar/note-thread.d.ts +11 -0
  235. package/build-types/components/collab-sidebar/note-thread.d.ts.map +1 -0
  236. package/build-types/components/collab-sidebar/note.d.ts +9 -0
  237. package/build-types/components/collab-sidebar/note.d.ts.map +1 -0
  238. package/build-types/components/collab-sidebar/notes.d.ts +7 -0
  239. package/build-types/components/collab-sidebar/notes.d.ts.map +1 -0
  240. package/build-types/components/collab-sidebar/utils.d.ts +41 -17
  241. package/build-types/components/collab-sidebar/utils.d.ts.map +1 -1
  242. package/build-types/components/media/media-editor-modal.d.ts +11 -0
  243. package/build-types/components/media/media-editor-modal.d.ts.map +1 -0
  244. package/build-types/components/more-menu/index.d.ts.map +1 -1
  245. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  246. package/build-types/components/post-publish-button/index.d.ts.map +1 -1
  247. package/build-types/components/post-publish-button/label.d.ts.map +1 -1
  248. package/build-types/components/post-revisions-preview/revisions-slider.d.ts.map +1 -1
  249. package/build-types/components/post-saved-state/index.d.ts.map +1 -1
  250. package/build-types/components/provider/index.d.ts.map +1 -1
  251. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  252. package/build-types/components/provider/use-upload-save-lock.d.ts +0 -2
  253. package/build-types/components/provider/use-upload-save-lock.d.ts.map +1 -1
  254. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -1
  255. package/build-types/components/style-book/constants.d.ts +1 -1
  256. package/build-types/components/style-book/constants.d.ts.map +1 -1
  257. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -1
  258. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  259. package/build-types/store/private-actions.d.ts +0 -7
  260. package/build-types/store/private-actions.d.ts.map +1 -1
  261. package/build-types/store/private-selectors.d.ts +0 -7
  262. package/build-types/store/private-selectors.d.ts.map +1 -1
  263. package/build-types/store/reducer.d.ts +0 -10
  264. package/build-types/store/reducer.d.ts.map +1 -1
  265. package/build-types/utils/media-finalize/index.d.ts +1 -1
  266. package/build-types/utils/media-finalize/index.d.ts.map +1 -1
  267. package/build-types/utils/media-upload/index.d.ts.map +1 -1
  268. package/package.json +46 -46
  269. package/src/components/collab-sidebar/README.md +117 -0
  270. package/src/components/collab-sidebar/{comment-menu-item.js → add-note-menu-item.js} +8 -10
  271. package/src/components/collab-sidebar/{add-comment.js → add-note.js} +26 -49
  272. package/src/components/collab-sidebar/board-store.js +85 -0
  273. package/src/components/collab-sidebar/floating-container.js +30 -0
  274. package/src/components/collab-sidebar/hooks.js +130 -178
  275. package/src/components/collab-sidebar/index.js +35 -106
  276. package/src/components/collab-sidebar/{comment-author-info.js → note-byline.js} +5 -6
  277. package/src/components/collab-sidebar/note-card.js +36 -0
  278. package/src/components/collab-sidebar/{comment-form.js → note-form.js} +29 -40
  279. package/src/components/collab-sidebar/{comment-indicator-toolbar.js → note-indicator-toolbar.js} +29 -32
  280. package/src/components/collab-sidebar/note-thread.js +331 -0
  281. package/src/components/collab-sidebar/note.js +209 -0
  282. package/src/components/collab-sidebar/notes.js +276 -0
  283. package/src/components/collab-sidebar/style.scss +21 -11
  284. package/src/components/collab-sidebar/test/utils.js +155 -0
  285. package/src/components/collab-sidebar/utils.js +125 -19
  286. package/src/components/collaborators-presence/avatar/component.tsx +1 -1
  287. package/src/components/collaborators-presence/styles/collaborators-list.scss +1 -1
  288. package/src/components/collaborators-presence/styles/collaborators-presence.scss +1 -1
  289. package/src/components/document-bar/index.js +4 -4
  290. package/src/components/document-outline/style.scss +1 -1
  291. package/src/components/error-boundary/index.js +3 -3
  292. package/src/components/list-view-sidebar/list-view-outline.js +6 -6
  293. package/src/components/media/media-editor-modal.js +95 -0
  294. package/src/components/media-categories/index.js +1 -1
  295. package/src/components/more-menu/index.js +4 -8
  296. package/src/components/post-actions/set-as-homepage.js +2 -2
  297. package/src/components/post-actions/set-as-posts-page.js +2 -2
  298. package/src/components/post-card-panel/index.js +7 -7
  299. package/src/components/post-content-information/index.js +3 -3
  300. package/src/components/post-excerpt/panel.js +3 -3
  301. package/src/components/post-last-edited-panel/index.js +3 -3
  302. package/src/components/post-preview-button/index.js +3 -2
  303. package/src/components/post-publish-button/index.js +6 -5
  304. package/src/components/post-publish-button/label.js +3 -1
  305. package/src/components/post-publish-panel/maybe-upload-media.js +1 -1
  306. package/src/components/post-publish-panel/postpublish.js +2 -2
  307. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +10 -16
  308. package/src/components/post-revisions-panel/index.js +3 -3
  309. package/src/components/post-revisions-preview/diff-markers.js +1 -1
  310. package/src/components/post-revisions-preview/revisions-slider.js +1 -0
  311. package/src/components/post-revisions-preview/style.scss +1 -1
  312. package/src/components/post-saved-state/index.js +4 -1
  313. package/src/components/post-saved-state/test/__snapshots__/index.js.snap +0 -1
  314. package/src/components/post-text-editor/index.js +3 -3
  315. package/src/components/preview-dropdown/index.js +2 -2
  316. package/src/components/provider/index.js +4 -0
  317. package/src/components/provider/use-block-editor-settings.js +10 -0
  318. package/src/components/provider/use-upload-save-lock.js +2 -17
  319. package/src/components/resizable-editor/resize-handle.js +2 -5
  320. package/src/components/revision-created-panel/index.js +3 -3
  321. package/src/components/site-discussion/index.js +3 -3
  322. package/src/components/style-book/constants.ts +1 -1
  323. package/src/components/style-book/index.js +1 -1
  324. package/src/components/template-actions-panel/classic-theme-content.js +3 -3
  325. package/src/components/template-actions-panel/style.scss +1 -1
  326. package/src/components/template-part-menu-items/convert-to-regular.js +74 -12
  327. package/src/components/visual-editor/index.js +2 -29
  328. package/src/store/private-actions.js +0 -13
  329. package/src/store/private-selectors.js +0 -10
  330. package/src/store/reducer.js +0 -16
  331. package/src/utils/media-finalize/index.js +2 -1
  332. package/src/utils/media-finalize/test/index.js +25 -1
  333. package/src/utils/media-upload/index.js +26 -29
  334. package/build/components/collab-sidebar/add-comment.cjs +0 -129
  335. package/build/components/collab-sidebar/add-comment.cjs.map +0 -7
  336. package/build/components/collab-sidebar/comment-author-info.cjs.map +0 -7
  337. package/build/components/collab-sidebar/comment-form.cjs.map +0 -7
  338. package/build/components/collab-sidebar/comment-indicator-toolbar.cjs.map +0 -7
  339. package/build/components/collab-sidebar/comment-menu-item.cjs.map +0 -7
  340. package/build/components/collab-sidebar/comments.cjs +0 -816
  341. package/build/components/collab-sidebar/comments.cjs.map +0 -7
  342. package/build-module/components/collab-sidebar/add-comment.mjs +0 -100
  343. package/build-module/components/collab-sidebar/add-comment.mjs.map +0 -7
  344. package/build-module/components/collab-sidebar/comment-author-info.mjs.map +0 -7
  345. package/build-module/components/collab-sidebar/comment-form.mjs +0 -90
  346. package/build-module/components/collab-sidebar/comment-form.mjs.map +0 -7
  347. package/build-module/components/collab-sidebar/comment-indicator-toolbar.mjs.map +0 -7
  348. package/build-module/components/collab-sidebar/comment-menu-item.mjs.map +0 -7
  349. package/build-module/components/collab-sidebar/comments.mjs +0 -799
  350. package/build-module/components/collab-sidebar/comments.mjs.map +0 -7
  351. package/build-types/components/collab-sidebar/add-comment.d.ts +0 -10
  352. package/build-types/components/collab-sidebar/add-comment.d.ts.map +0 -1
  353. package/build-types/components/collab-sidebar/comment-author-info.d.ts +0 -8
  354. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +0 -1
  355. package/build-types/components/collab-sidebar/comment-form.d.ts +0 -11
  356. package/build-types/components/collab-sidebar/comment-form.d.ts.map +0 -1
  357. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts +0 -6
  358. package/build-types/components/collab-sidebar/comment-indicator-toolbar.d.ts.map +0 -1
  359. package/build-types/components/collab-sidebar/comment-menu-item.d.ts +0 -6
  360. package/build-types/components/collab-sidebar/comment-menu-item.d.ts.map +0 -1
  361. package/build-types/components/collab-sidebar/comments.d.ts +0 -12
  362. package/build-types/components/collab-sidebar/comments.d.ts.map +0 -1
  363. package/src/components/collab-sidebar/comments.js +0 -985
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/template-actions-panel/classic-theme-content.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseEntityRecord,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tButton,\n\t__experimentalText as Text,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport CreateNewTemplateModal from '../post-template/create-new-template-modal';\n\nexport default function ClassicThemeContent() {\n\tconst templateId = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentTemplateId(),\n\t\t[]\n\t);\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\tconst {\n\t\tonNavigateToEntityRecord,\n\t\tcanCreateTemplate,\n\t\thasGoBack,\n\t\tgetEditorSettings,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings: _getEditorSettings } = select( editorStore );\n\t\tconst editorSettings = _getEditorSettings();\n\t\treturn {\n\t\t\tonNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,\n\t\t\tcanCreateTemplate:\n\t\t\t\t!! select( coreStore ).canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'wp_template',\n\t\t\t\t} ) && editorSettings.supportsTemplateMode,\n\t\t\thasGoBack: editorSettings.hasOwnProperty(\n\t\t\t\t'onNavigateToPreviousEntityRecord'\n\t\t\t),\n\t\t\tgetEditorSettings: _getEditorSettings,\n\t\t};\n\t}, [] );\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst { editedRecord: template } = useEntityRecord(\n\t\t'postType',\n\t\t'wp_template',\n\t\ttemplateId\n\t);\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', 'wp_template', {\n\t\tid: templateId,\n\t} );\n\n\t// Path A: No block template and cannot create templates.\n\tif ( ! templateId && ! canCreateTemplate ) {\n\t\treturn null;\n\t}\n\n\tconst notificationAction = hasGoBack\n\t\t? [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord(),\n\t\t\t\t},\n\t\t ]\n\t\t: undefined;\n\n\tconst mayShowTemplateEditNotice = () => {\n\t\tif ( ! getPreference( 'core/edit-site', 'welcomeGuideTemplate' ) ) {\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', actions: notificationAction }\n\t\t\t);\n\t\t}\n\t};\n\n\tconst templateName = template\n\t\t? decodeEntities( template.title )\n\t\t: undefined;\n\n\tconst previewContent = !! blocks?.length && (\n\t\t<BlockPreview.Async>\n\t\t\t<BlockPreview blocks={ blocks } />\n\t\t</BlockPreview.Async>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\ttemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: template name */\n\t\t\t\t\t\t\t\t__( 'Template: %s' ),\n\t\t\t\t\t\t\t\ttemplateName\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Template' )\n\t\t\t\t}\n\t\t\t\tinitialOpen={ false }\n\t\t\t>\n\t\t\t\t<VStack>\n\t\t\t\t\t{ ! templateId && (\n\t\t\t\t\t\t<Text>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'This page uses a classic template. To edit this template with blocks, create a block template.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t) }\n\t\t\t\t\t{ template && previewContent && (\n\t\t\t\t\t\t<div className=\"editor-template-actions-panel__preview\">\n\t\t\t\t\t\t\t{ previewContent }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t{ template && onNavigateToEntityRecord && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\t\t\tpostId: template.id,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\tmayShowTemplateEditNotice();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ canCreateTemplate && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => setIsCreateModalOpen( true ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ! templateId\n\t\t\t\t\t\t\t\t\t? __( 'Create block template' )\n\t\t\t\t\t\t\t\t\t: __( 'Create new' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</PanelBody>\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<CreateNewTemplateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
5
- "mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,EACA,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;AACP,SAAS,gBAAgB;AACzB,SAAS,IAAI,eAAe;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,SAAS,oBAAoB;AACtC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,SAAS,mBAAmB;AACrC,OAAO,4BAA4B;AAwEhC,SAKD,UALC,KA+BE,YA/BF;AAtEY,SAAR,sBAAuC;AAC7C,QAAM,aAAa;AAAA,IAClB,CAAE,WAAY,OAAQ,WAAY,EAAE,qBAAqB;AAAA,IACzD,CAAC;AAAA,EACF;AACA,QAAM,CAAE,mBAAmB,oBAAqB,IAAI,SAAU,KAAM;AACpE,QAAM;AAAA,IACL;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,IAAI,UAAW,CAAE,WAAY;AAC5B,UAAM,EAAE,mBAAmB,mBAAmB,IAAI,OAAQ,WAAY;AACtE,UAAM,iBAAiB,mBAAmB;AAC1C,WAAO;AAAA,MACN,0BAA0B,eAAe;AAAA,MACzC,mBACC,CAAC,CAAE,OAAQ,SAAU,EAAE,QAAS,UAA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C,SAAI,WAAU,0CACZ,0BACH;AAAA,UAED,qBAAC,UACE;AAAA,wBAAY,4BACb;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,SAAU,MAAM;AACf,2CAA0B;AAAA,oBACzB,QAAQ,SAAS;AAAA,oBACjB,UAAU;AAAA,kBACX,CAAE;AACF,4CAA0B;AAAA,gBAC3B;AAAA,gBAEE,aAAI,MAAO;AAAA;AAAA,YACd;AAAA,YAEC,qBACD;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,SAAU,MAAM,qBAAsB,IAAK;AAAA,gBAEzC,WAAE,aACD,GAAI,uBAAwB,IAC5B,GAAI,YAAa;AAAA;AAAA,YACrB;AAAA,aAEF;AAAA,WACD;AAAA;AAAA,IACD;AAAA,IACE,qBACD;AAAA,MAAC;AAAA;AAAA,QACA,SAAU,MAAM,qBAAsB,KAAM;AAAA;AAAA,IAC7C;AAAA,KAEF;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tuseEntityRecord,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { BlockPreview } from '@wordpress/block-editor';\nimport {\n\tPanelBody,\n\tButton,\n\t__experimentalText as WCText,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport CreateNewTemplateModal from '../post-template/create-new-template-modal';\n\nexport default function ClassicThemeContent() {\n\tconst templateId = useSelect(\n\t\t( select ) => select( editorStore ).getCurrentTemplateId(),\n\t\t[]\n\t);\n\tconst [ isCreateModalOpen, setIsCreateModalOpen ] = useState( false );\n\tconst {\n\t\tonNavigateToEntityRecord,\n\t\tcanCreateTemplate,\n\t\thasGoBack,\n\t\tgetEditorSettings,\n\t} = useSelect( ( select ) => {\n\t\tconst { getEditorSettings: _getEditorSettings } = select( editorStore );\n\t\tconst editorSettings = _getEditorSettings();\n\t\treturn {\n\t\t\tonNavigateToEntityRecord: editorSettings.onNavigateToEntityRecord,\n\t\t\tcanCreateTemplate:\n\t\t\t\t!! select( coreStore ).canUser( 'create', {\n\t\t\t\t\tkind: 'postType',\n\t\t\t\t\tname: 'wp_template',\n\t\t\t\t} ) && editorSettings.supportsTemplateMode,\n\t\t\thasGoBack: editorSettings.hasOwnProperty(\n\t\t\t\t'onNavigateToPreviousEntityRecord'\n\t\t\t),\n\t\t\tgetEditorSettings: _getEditorSettings,\n\t\t};\n\t}, [] );\n\tconst { get: getPreference } = useSelect( preferencesStore );\n\tconst { createSuccessNotice } = useDispatch( noticesStore );\n\tconst { editedRecord: template } = useEntityRecord(\n\t\t'postType',\n\t\t'wp_template',\n\t\ttemplateId\n\t);\n\tconst [ blocks ] = useEntityBlockEditor( 'postType', 'wp_template', {\n\t\tid: templateId,\n\t} );\n\n\t// Path A: No block template and cannot create templates.\n\tif ( ! templateId && ! canCreateTemplate ) {\n\t\treturn null;\n\t}\n\n\tconst notificationAction = hasGoBack\n\t\t? [\n\t\t\t\t{\n\t\t\t\t\tlabel: __( 'Go back' ),\n\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord(),\n\t\t\t\t},\n\t\t ]\n\t\t: undefined;\n\n\tconst mayShowTemplateEditNotice = () => {\n\t\tif ( ! getPreference( 'core/edit-site', 'welcomeGuideTemplate' ) ) {\n\t\t\tcreateSuccessNotice(\n\t\t\t\t__(\n\t\t\t\t\t'Editing template. Changes made here affect all posts and pages that use the template.'\n\t\t\t\t),\n\t\t\t\t{ type: 'snackbar', actions: notificationAction }\n\t\t\t);\n\t\t}\n\t};\n\n\tconst templateName = template\n\t\t? decodeEntities( template.title )\n\t\t: undefined;\n\n\tconst previewContent = !! blocks?.length && (\n\t\t<BlockPreview.Async>\n\t\t\t<BlockPreview blocks={ blocks } />\n\t\t</BlockPreview.Async>\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<PanelBody\n\t\t\t\ttitle={\n\t\t\t\t\ttemplate\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: template name */\n\t\t\t\t\t\t\t\t__( 'Template: %s' ),\n\t\t\t\t\t\t\t\ttemplateName\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: __( 'Template' )\n\t\t\t\t}\n\t\t\t\tinitialOpen={ false }\n\t\t\t>\n\t\t\t\t<VStack>\n\t\t\t\t\t{ ! templateId && (\n\t\t\t\t\t\t<WCText>\n\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t'This page uses a classic template. To edit this template with blocks, create a block template.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</WCText>\n\t\t\t\t\t) }\n\t\t\t\t\t{ template && previewContent && (\n\t\t\t\t\t\t<div className=\"editor-template-actions-panel__preview\">\n\t\t\t\t\t\t\t{ previewContent }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<HStack>\n\t\t\t\t\t\t{ template && onNavigateToEntityRecord && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\t\t\t\tpostId: template.id,\n\t\t\t\t\t\t\t\t\t\tpostType: 'wp_template',\n\t\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t\t\tmayShowTemplateEditNotice();\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ __( 'Edit' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t{ canCreateTemplate && (\n\t\t\t\t\t\t\t<Button\n\t\t\t\t\t\t\t\tclassName=\"editor-template-actions-panel__action\"\n\t\t\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\t\t\tonClick={ () => setIsCreateModalOpen( true ) }\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t{ ! templateId\n\t\t\t\t\t\t\t\t\t? __( 'Create block template' )\n\t\t\t\t\t\t\t\t\t: __( 'Create new' ) }\n\t\t\t\t\t\t\t</Button>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</HStack>\n\t\t\t\t</VStack>\n\t\t\t</PanelBody>\n\t\t\t{ isCreateModalOpen && (\n\t\t\t\t<CreateNewTemplateModal\n\t\t\t\t\tonClose={ () => setIsCreateModalOpen( false ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"],
5
+ "mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC;AAAA,EACC;AAAA,EACA;AAAA,EACA,SAAS;AAAA,OACH;AACP,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,EACA,sBAAsB;AAAA,EACtB,wBAAwB;AAAA,EACxB,wBAAwB;AAAA,OAClB;AACP,SAAS,gBAAgB;AACzB,SAAS,IAAI,eAAe;AAC5B,SAAS,sBAAsB;AAC/B,SAAS,SAAS,oBAAoB;AACtC,SAAS,SAAS,wBAAwB;AAK1C,SAAS,SAAS,mBAAmB;AACrC,OAAO,4BAA4B;AAwEhC,SAKD,UALC,KA+BE,YA/BF;AAtEY,SAAR,sBAAuC;AAC7C,QAAM,aAAa;AAAA,IAClB,CAAE,WAAY,OAAQ,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AS,KAAM,IAC/B;AAEH,QAAM,iBAAiB,CAAC,CAAE,QAAQ,UACjC,oBAAC,aAAa,OAAb,EACA,8BAAC,gBAAa,QAAkB,GACjC;AAGD,SACC,iCACC;AAAA;AAAA,MAAC;AAAA;AAAA,QACA,OACC,WACG;AAAA;AAAA,UAEA,GAAI,cAAe;AAAA,UACnB;AAAA,QACA,IACA,GAAI,UAAW;AAAA,QAEnB,aAAc;AAAA,QAEd,+BAAC,UACE;AAAA,WAAE,cACH,oBAAC,UACE;AAAA,YACD;AAAA,UACD,GACD;AAAA,UAEC,YAAY,kBACb,oBAAC,SAAI,WAAU,0CACZ,0BACH;AAAA,UAED,qBAAC,UACE;AAAA,wBAAY,4BACb;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,SAAU,MAAM;AACf,2CAA0B;AAAA,oBACzB,QAAQ,SAAS;AAAA,oBACjB,UAAU;AAAA,kBACX,CAAE;AACF,4CAA0B;AAAA,gBAC3B;AAAA,gBAEE,aAAI,MAAO;AAAA;AAAA,YACd;AAAA,YAEC,qBACD;AAAA,cAAC;AAAA;AAAA,gBACA,WAAU;AAAA,gBACV,uBAAqB;AAAA,gBACrB,SAAQ;AAAA,gBACR,SAAU,MAAM,qBAAsB,IAAK;AAAA,gBAEzC,WAAE,aACD,GAAI,uBAAwB,IAC5B,GAAI,YAAa;AAAA;AAAA,YACrB;AAAA,aAEF;AAAA,WACD;AAAA;AAAA,IACD;AAAA,IACE,qBACD;AAAA,MAAC;AAAA;AAAA,QACA,SAAU,MAAM,qBAAsB,KAAM;AAAA;AAAA,IAC7C;AAAA,KAEF;AAEF;",
6
6
  "names": []
7
7
  }
@@ -1,29 +1,75 @@
1
1
  // packages/editor/src/components/template-part-menu-items/convert-to-regular.js
2
2
  import { useSelect, useDispatch } from "@wordpress/data";
3
3
  import { store as blockEditorStore } from "@wordpress/block-editor";
4
- import { MenuItem } from "@wordpress/components";
5
- import { __ } from "@wordpress/i18n";
6
- import { jsx } from "react/jsx-runtime";
4
+ import { store as coreStore } from "@wordpress/core-data";
5
+ import {
6
+ MenuItem,
7
+ __experimentalConfirmDialog as ConfirmDialog
8
+ } from "@wordpress/components";
9
+ import { __, sprintf } from "@wordpress/i18n";
10
+ import { decodeEntities } from "@wordpress/html-entities";
11
+ import { useState } from "@wordpress/element";
12
+ import { Fragment, jsx, jsxs } from "react/jsx-runtime";
7
13
  function ConvertToRegularBlocks({ clientId, onClose }) {
14
+ const [showConfirmDialog, setShowConfirmDialog] = useState(false);
8
15
  const { getBlocks } = useSelect(blockEditorStore);
9
16
  const { replaceBlocks } = useDispatch(blockEditorStore);
10
- const canRemove = useSelect(
11
- (select) => select(blockEditorStore).canRemoveBlock(clientId),
17
+ const { canRemove, templatePartTitle } = useSelect(
18
+ (select) => {
19
+ const { canRemoveBlock, getBlock } = select(blockEditorStore);
20
+ const { getEntityRecord, getCurrentTheme } = select(coreStore);
21
+ const block = getBlock(clientId);
22
+ const { slug, theme } = block?.attributes ?? {};
23
+ const themeSlug = theme || getCurrentTheme()?.stylesheet;
24
+ const templatePartId = themeSlug && slug ? `${themeSlug}//${slug}` : null;
25
+ const entity = templatePartId ? getEntityRecord(
26
+ "postType",
27
+ "wp_template_part",
28
+ templatePartId
29
+ ) : null;
30
+ return {
31
+ canRemove: canRemoveBlock(clientId),
32
+ templatePartTitle: entity?.title?.rendered ? decodeEntities(entity.title.rendered) : null
33
+ };
34
+ },
12
35
  [clientId]
13
36
  );
14
37
  if (!canRemove) {
15
38
  return null;
16
39
  }
17
- return /* @__PURE__ */ jsx(
18
- MenuItem,
19
- {
20
- onClick: () => {
21
- replaceBlocks(clientId, getBlocks(clientId));
22
- onClose();
23
- },
24
- children: __("Detach")
25
- }
40
+ const title = templatePartTitle ? sprintf(
41
+ /* translators: %s: template part title, e.g. "Header" */
42
+ __("Detach %s?"),
43
+ templatePartTitle
44
+ ) : __("Detach template part?");
45
+ const message = templatePartTitle ? sprintf(
46
+ /* translators: %s: template part title, e.g. "Header" */
47
+ __(
48
+ "The blocks will be separated from the original template part and will be fully editable. Future changes to the %s template part will not apply here."
49
+ ),
50
+ templatePartTitle
51
+ ) : __(
52
+ "The blocks will be separated from the original template part and will be fully editable. Future changes to the template part will not apply here."
26
53
  );
54
+ return /* @__PURE__ */ jsxs(Fragment, { children: [
55
+ /* @__PURE__ */ jsx(MenuItem, { onClick: () => setShowConfirmDialog(true), children: __("Detach") }),
56
+ /* @__PURE__ */ jsx(
57
+ ConfirmDialog,
58
+ {
59
+ isOpen: showConfirmDialog,
60
+ onConfirm: () => {
61
+ replaceBlocks(clientId, getBlocks(clientId));
62
+ onClose();
63
+ },
64
+ onCancel: () => setShowConfirmDialog(false),
65
+ confirmButtonText: __("Detach"),
66
+ size: "medium",
67
+ title,
68
+ __experimentalHideHeader: false,
69
+ children: message
70
+ }
71
+ )
72
+ ] });
27
73
  }
28
74
  export {
29
75
  ConvertToRegularBlocks as default
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/template-part-menu-items/convert-to-regular.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { MenuItem } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nexport default function ConvertToRegularBlocks( { clientId, onClose } ) {\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\n\tconst canRemove = useSelect(\n\t\t( select ) => select( blockEditorStore ).canRemoveBlock( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tif ( ! canRemove ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<MenuItem\n\t\t\tonClick={ () => {\n\t\t\t\treplaceBlocks( clientId, getBlocks( clientId ) );\n\t\t\t\tonClose();\n\t\t\t} }\n\t\t>\n\t\t\t{ __( 'Detach' ) }\n\t\t</MenuItem>\n\t);\n}\n"],
5
- "mappings": ";AAGA,SAAS,WAAW,mBAAmB;AACvC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,gBAAgB;AACzB,SAAS,UAAU;AAgBjB;AAda,SAAR,uBAAyC,EAAE,UAAU,QAAQ,GAAI;AACvE,QAAM,EAAE,UAAU,IAAI,UAAW,gBAAiB;AAClD,QAAM,EAAE,cAAc,IAAI,YAAa,gBAAiB;AAExD,QAAM,YAAY;AAAA,IACjB,CAAE,WAAY,OAAQ,gBAAiB,EAAE,eAAgB,QAAS;AAAA,IAClE,CAAE,QAAS;AAAA,EACZ;AAEA,MAAK,CAAE,WAAY;AAClB,WAAO;AAAA,EACR;AAEA,SACC;AAAA,IAAC;AAAA;AAAA,MACA,SAAU,MAAM;AACf,sBAAe,UAAU,UAAW,QAAS,CAAE;AAC/C,gBAAQ;AAAA,MACT;AAAA,MAEE,aAAI,QAAS;AAAA;AAAA,EAChB;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport {\n\tMenuItem,\n\t__experimentalConfirmDialog as ConfirmDialog,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { useState } from '@wordpress/element';\n\nexport default function ConvertToRegularBlocks( { clientId, onClose } ) {\n\tconst [ showConfirmDialog, setShowConfirmDialog ] = useState( false );\n\n\tconst { getBlocks } = useSelect( blockEditorStore );\n\tconst { replaceBlocks } = useDispatch( blockEditorStore );\n\n\tconst { canRemove, templatePartTitle } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canRemoveBlock, getBlock } = select( blockEditorStore );\n\t\t\tconst { getEntityRecord, getCurrentTheme } = select( coreStore );\n\n\t\t\tconst block = getBlock( clientId );\n\t\t\tconst { slug, theme } = block?.attributes ?? {};\n\t\t\tconst themeSlug = theme || getCurrentTheme()?.stylesheet;\n\t\t\tconst templatePartId =\n\t\t\t\tthemeSlug && slug ? `${ themeSlug }//${ slug }` : null;\n\t\t\tconst entity = templatePartId\n\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_template_part',\n\t\t\t\t\t\ttemplatePartId\n\t\t\t\t )\n\t\t\t\t: null;\n\n\t\t\treturn {\n\t\t\t\tcanRemove: canRemoveBlock( clientId ),\n\t\t\t\ttemplatePartTitle: entity?.title?.rendered\n\t\t\t\t\t? decodeEntities( entity.title.rendered )\n\t\t\t\t\t: null,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tif ( ! canRemove ) {\n\t\treturn null;\n\t}\n\n\tconst title = templatePartTitle\n\t\t? sprintf(\n\t\t\t\t/* translators: %s: template part title, e.g. \"Header\" */\n\t\t\t\t__( 'Detach %s?' ),\n\t\t\t\ttemplatePartTitle\n\t\t )\n\t\t: __( 'Detach template part?' );\n\n\tconst message = templatePartTitle\n\t\t? sprintf(\n\t\t\t\t/* translators: %s: template part title, e.g. \"Header\" */\n\t\t\t\t__(\n\t\t\t\t\t'The blocks will be separated from the original template part and will be fully editable. Future changes to the %s template part will not apply here.'\n\t\t\t\t),\n\t\t\t\ttemplatePartTitle\n\t\t )\n\t\t: __(\n\t\t\t\t'The blocks will be separated from the original template part and will be fully editable. Future changes to the template part will not apply here.'\n\t\t );\n\n\treturn (\n\t\t<>\n\t\t\t<MenuItem onClick={ () => setShowConfirmDialog( true ) }>\n\t\t\t\t{ __( 'Detach' ) }\n\t\t\t</MenuItem>\n\t\t\t<ConfirmDialog\n\t\t\t\tisOpen={ showConfirmDialog }\n\t\t\t\tonConfirm={ () => {\n\t\t\t\t\treplaceBlocks( clientId, getBlocks( clientId ) );\n\t\t\t\t\tonClose();\n\t\t\t\t} }\n\t\t\t\tonCancel={ () => setShowConfirmDialog( false ) }\n\t\t\t\tconfirmButtonText={ __(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QAAM,QAAQ,oBACX;AAAA;AAAA,IAEA,GAAI,YAAa;AAAA,IACjB;AAAA,EACA,IACA,GAAI,uBAAwB;AAE/B,QAAM,UAAU,oBACb;AAAA;AAAA,IAEA;AAAA,MACC;AAAA,IACD;AAAA,IACA;AAAA,EACA,IACA;AAAA,IACA;AAAA,EACA;AAEH,SACC,iCACC;AAAA,wBAAC,YAAS,SAAU,MAAM,qBAAsB,IAAK,GAClD,aAAI,QAAS,GAChB;AAAA,IACA;AAAA,MAAC;AAAA;AAAA,QACA,QAAS;AAAA,QACT,WAAY,MAAM;AACjB,wBAAe,UAAU,UAAW,QAAS,CAAE;AAC/C,kBAAQ;AAAA,QACT;AAAA,QACA,UAAW,MAAM,qBAAsB,KAAM;AAAA,QAC7C,mBAAoB,GAAI,QAAS;AAAA,QACjC,MAAK;AAAA,QACL;AAAA,QACA,0BAA2B;AAAA,QAEzB;AAAA;AAAA,IACH;AAAA,KACD;AAEF;",
6
6
  "names": []
7
7
  }
@@ -83,8 +83,7 @@ function VisualEditor({
83
83
  isDesignPostType,
84
84
  postType,
85
85
  isPreview,
86
- styles,
87
- canvasMinHeight
86
+ styles
88
87
  } = useSelect((select) => {
89
88
  const {
90
89
  getCurrentPostId,
@@ -92,8 +91,7 @@ function VisualEditor({
92
91
  getCurrentTemplateId,
93
92
  getEditorSettings,
94
93
  getRenderingMode,
95
- getDeviceType,
96
- getCanvasMinHeight
94
+ getDeviceType
97
95
  } = unlock(select(editorStore));
98
96
  const { getPostType, getEditedEntityRecord } = select(coreStore);
99
97
  const postTypeSlug = getCurrentPostType();
@@ -126,8 +124,7 @@ function VisualEditor({
126
124
  isFocusedEntity: !!editorSettings.onNavigateToPreviousEntityRecord,
127
125
  postType: postTypeSlug,
128
126
  isPreview: editorSettings.isPreviewMode,
129
- styles: editorSettings.styles,
130
- canvasMinHeight: getCanvasMinHeight()
127
+ styles: editorSettings.styles
131
128
  };
132
129
  }, []);
133
130
  const { isCleanNewPost } = useSelect(editorStore);
@@ -238,14 +235,6 @@ function VisualEditor({
238
235
  !isMobileViewport && // Disable resizing in zoomed-out mode.
239
236
  !isZoomedOut;
240
237
  const isNavigationPreview = postType === NAVIGATION_POST_TYPE && isPreview;
241
- const calculatedMinHeight = useMemo(() => {
242
- if (!localRef.current) {
243
- return canvasMinHeight;
244
- }
245
- const { ownerDocument } = localRef.current;
246
- const scrollTop = ownerDocument.documentElement.scrollTop || ownerDocument.body.scrollTop;
247
- return canvasMinHeight + scrollTop;
248
- }, [canvasMinHeight]);
249
238
  const [paddingAppenderRef, paddingStyle] = usePaddingAppender(
250
239
  !isPreview && renderingMode === "post-only" && !isDesignPostType
251
240
  );
@@ -257,7 +246,7 @@ function VisualEditor({
257
246
  // Ensures margins of children are contained so that the body background paints behind them.
258
247
  // Otherwise, the background of html (when zoomed out) would show there and appear broken. It's
259
248
  // important mostly for post-only views yet conceivably an issue in templated views too.
260
- css: `:where(.block-editor-iframe__body){display:flow-root;${calculatedMinHeight ? `min-height:${calculatedMinHeight}px;` : ""}}.is-root-container{display:flow-root;${// Some themes will have `min-height: 100vh` for the root container,
249
+ css: `:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${// Some themes will have `min-height: 100vh` for the root container,
261
250
  // which isn't a requirement in auto resize mode.
262
251
  enableResizing || isNavigationPreview ? "min-height:0!important;" : ""}}
263
252
  ${paddingStyle ? paddingStyle : ""}
@@ -267,13 +256,7 @@ function VisualEditor({
267
256
  // The CSS for isNavigationPreview centers the body content vertically and horizontally when the navigation is in preview mode.
268
257
  }
269
258
  ];
270
- }, [
271
- styles,
272
- enableResizing,
273
- isNavigationPreview,
274
- calculatedMinHeight,
275
- paddingStyle
276
- ]);
259
+ }, [styles, enableResizing, isNavigationPreview, paddingStyle]);
277
260
  const typewriterRef = useTypewriter();
278
261
  contentRef = useMergeRefs([
279
262
  localRef,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/visual-editor/index.js"],
4
- "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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, useViewportMatch } 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 ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from './use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tDESIGN_POST_TYPES,\n} from '../../store/constants';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\nimport { usePaddingAppender } from './use-padding-appender';\nimport { useEditContentOnlySectionExit } from './use-edit-content-only-section-exit';\nimport { SyncConnectionErrorModal } from '../sync-connection-error-modal';\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 */\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 VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t\tstyles,\n\t\tcanvasMinHeight,\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\tgetCanvasMinHeight,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getPostType, getEditedEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\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 postTypeObject = getPostType( postTypeSlug );\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\tTEMPLATE_POST_TYPE,\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\tpostTypeObject?.viewable && supportsTemplateMode\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\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.isPreviewMode,\n\t\t\tstyles: editorSettings.styles,\n\t\t\tcanvasMinHeight: getCanvasMinHeight(),\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomedOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, isZoomOut: _isZoomOut } = unlock(\n\t\t\tselect( blockEditorStore )\n\t\t);\n\n\t\tconst _settings = 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\tisZoomedOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\n\tconst localRef = useRef();\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 = clsx(\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\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 enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Disable resizing in zoomed-out mode.\n\t\t! isZoomedOut;\n\n\tconst isNavigationPreview = postType === NAVIGATION_POST_TYPE && isPreview;\n\n\t// Calculate the minimum height including scroll offset to fit all notes.\n\tconst calculatedMinHeight = useMemo( () => {\n\t\tif ( ! localRef.current ) {\n\t\t\treturn canvasMinHeight;\n\t\t}\n\n\t\tconst { ownerDocument } = localRef.current;\n\t\tconst scrollTop =\n\t\t\townerDocument.documentElement.scrollTop ||\n\t\t\townerDocument.body.scrollTop;\n\n\t\treturn canvasMinHeight + scrollTop;\n\t}, [ canvasMinHeight ] );\n\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\t! isPreview && renderingMode === 'post-only' && ! isDesignPostType\n\t);\n\n\tconst centerContentCSS = `display:flex;align-items:center;justify-content:center;`;\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\t// Ensures margins of children are contained so that the body background paints behind them.\n\t\t\t\t// Otherwise, the background of html (when zoomed out) would show there and appear broken. It's\n\t\t\t\t// important mostly for post-only views yet conceivably an issue in templated views too.\n\t\t\t\tcss: `:where(.block-editor-iframe__body){display:flow-root;${\n\t\t\t\t\tcalculatedMinHeight\n\t\t\t\t\t\t? `min-height:${ calculatedMinHeight }px;`\n\t\t\t\t\t\t: ''\n\t\t\t\t}}.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing || isNavigationPreview\n\t\t\t\t\t\t? 'min-height:0!important;'\n\t\t\t\t\t\t: ''\n\t\t\t\t}}\n\t\t\t\t${ paddingStyle ? paddingStyle : '' }\n\t\t\t\t${\n\t\t\t\t\tenableResizing\n\t\t\t\t\t\t? `.block-editor-iframe__html{background:var(--wp-editor-canvas-background);min-height:100vh;${ centerContentCSS }}.block-editor-iframe__body{width:100%;}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}${\n\t\t\t\t\tisNavigationPreview\n\t\t\t\t\t\t? `.block-editor-iframe__body{${ centerContentCSS }padding:var(--wp--style--block-gap,2em);}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}`,\n\t\t\t\t// The CSS for enableResizing centers the body content vertically when resizing is enabled and applies a background\n\t\t\t\t// color to the iframe HTML element to match the background color of the editor canvas.\n\t\t\t\t// The CSS for isNavigationPreview centers the body content vertically and horizontally when the navigation is in preview mode.\n\t\t\t},\n\t\t];\n\t}, [\n\t\tstyles,\n\t\tenableResizing,\n\t\tisNavigationPreview,\n\t\tcalculatedMinHeight,\n\t\tpaddingStyle,\n\t] );\n\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\tuseZoomOutModeExit(),\n\t\tpaddingAppenderRef,\n\t\tuseEditContentOnlySectionExit(),\n\t] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': ! disableIframe,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<SyncConnectionErrorModal />\n\t\t\t<ResizableEditor enableResizing={ enableResizing } height=\"100%\">\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ ! disableIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward compatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\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\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t\t\t\t\t! isDesignPostType &&\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\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\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\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pC;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAY;AAAA,oBACX;AAAA;AAAA;AAAA,oBAGA;AAAA,oBACA;AAAA,sBACC,sBACC;AAAA,oBACF;AAAA,kBACD;AAAA,kBACA,iBAAkB;AAAA,kBAClB,KAAM;AAAA,kBACN,OAAQ;AAAA;AAAA;AAAA,oBAGP,WAAW;AAAA,kBACZ;AAAA,kBAEA,8BAAC,aAAU,KAAM,UAAW;AAAA;AAAA,cAC7B;AAAA,cAED;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAY;AAAA,kBACZ,UAAW;AAAA,kBAEX;AAAA;AAAA,sBAAC;AAAA;AAAA,wBACA,WAAY;AAAA,0BACX,QAAQ,WAAW,YAAY,IAAI;AAAA,0BACnC,kBAAkB,eACjB,mBACE,mBACA,GAAI,oBAAqB;AAAA;AAAA,0BAC5B;AAAA,4BACC,sBACC,kBAAkB,eAClB,CAAE,oBACF;AAAA,0BACF;AAAA,wBACD;AAAA,wBACA,QAAS;AAAA,wBACT;AAAA;AAAA;AAAA,0BAGC,gBACG,SAAS,UACT,SAAS,SAAS;AAAA;AAAA,wBAEtB;AAAA;AAAA,0BAEC,kBAAkB,oBACf,OACA;AAAA;AAAA;AAAA,oBAEL;AAAA,oBACE,kBAAkB,qBACnB;AAAA,sBAAC;AAAA;AAAA,wBACA,YAAa;AAAA;AAAA,oBACd;AAAA;AAAA;AAAA,cAEF;AAAA;AAAA;AAAA,QACD,GACD;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,wBAAQ;",
4
+ "sourcesContent": ["/**\n * External dependencies\n */\nimport clsx from 'clsx';\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, useViewportMatch } 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 ResizableEditor from '../resizable-editor';\nimport useSelectNearestEditableBlock from './use-select-nearest-editable-block';\nimport {\n\tNAVIGATION_POST_TYPE,\n\tPATTERN_POST_TYPE,\n\tTEMPLATE_PART_POST_TYPE,\n\tTEMPLATE_POST_TYPE,\n\tDESIGN_POST_TYPES,\n} from '../../store/constants';\nimport { useZoomOutModeExit } from './use-zoom-out-mode-exit';\nimport { usePaddingAppender } from './use-padding-appender';\nimport { useEditContentOnlySectionExit } from './use-edit-content-only-section-exit';\nimport { SyncConnectionErrorModal } from '../sync-connection-error-modal';\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 */\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 VisualEditor( {\n\t// Ideally as we unify post and site editors, we won't need these props.\n\tautoFocus,\n\tdisableIframe = false,\n\tiframeProps,\n\tcontentRef,\n\tclassName,\n} ) {\n\tconst isMobileViewport = useViewportMatch( 'small', '<' );\n\tconst {\n\t\trenderingMode,\n\t\tpostContentAttributes,\n\t\teditedPostTemplate = {},\n\t\twrapperBlockName,\n\t\twrapperUniqueId,\n\t\tdeviceType,\n\t\tisFocusedEntity,\n\t\tisDesignPostType,\n\t\tpostType,\n\t\tisPreview,\n\t\tstyles,\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} = unlock( select( editorStore ) );\n\t\tconst { getPostType, getEditedEntityRecord } = select( coreStore );\n\t\tconst postTypeSlug = getCurrentPostType();\n\t\tconst _renderingMode = getRenderingMode();\n\t\tlet _wrapperBlockName;\n\n\t\tif ( postTypeSlug === PATTERN_POST_TYPE ) {\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 postTypeObject = getPostType( postTypeSlug );\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\tTEMPLATE_POST_TYPE,\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\tpostTypeObject?.viewable && supportsTemplateMode\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\tisFocusedEntity: !! editorSettings.onNavigateToPreviousEntityRecord,\n\t\t\tpostType: postTypeSlug,\n\t\t\tisPreview: editorSettings.isPreviewMode,\n\t\t\tstyles: editorSettings.styles,\n\t\t};\n\t}, [] );\n\tconst { isCleanNewPost } = useSelect( editorStore );\n\tconst {\n\t\thasRootPaddingAwareAlignments,\n\t\tthemeHasDisabledLayoutStyles,\n\t\tthemeSupportsLayout,\n\t\tisZoomedOut,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings, isZoomOut: _isZoomOut } = unlock(\n\t\t\tselect( blockEditorStore )\n\t\t);\n\n\t\tconst _settings = 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\tisZoomedOut: _isZoomOut(),\n\t\t};\n\t}, [] );\n\n\tconst localRef = useRef();\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 = clsx(\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\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 enableResizing =\n\t\t[\n\t\t\tNAVIGATION_POST_TYPE,\n\t\t\tTEMPLATE_PART_POST_TYPE,\n\t\t\tPATTERN_POST_TYPE,\n\t\t].includes( postType ) &&\n\t\t// Disable in previews / view mode.\n\t\t! isPreview &&\n\t\t// Disable resizing in mobile viewport.\n\t\t! isMobileViewport &&\n\t\t// Disable resizing in zoomed-out mode.\n\t\t! isZoomedOut;\n\n\tconst isNavigationPreview = postType === NAVIGATION_POST_TYPE && isPreview;\n\n\tconst [ paddingAppenderRef, paddingStyle ] = usePaddingAppender(\n\t\t! isPreview && renderingMode === 'post-only' && ! isDesignPostType\n\t);\n\n\tconst centerContentCSS = `display:flex;align-items:center;justify-content:center;`;\n\n\tconst iframeStyles = useMemo( () => {\n\t\treturn [\n\t\t\t...( styles ?? [] ),\n\t\t\t{\n\t\t\t\t// Ensures margins of children are contained so that the body background paints behind them.\n\t\t\t\t// Otherwise, the background of html (when zoomed out) would show there and appear broken. It's\n\t\t\t\t// important mostly for post-only views yet conceivably an issue in templated views too.\n\t\t\t\tcss: `:where(.block-editor-iframe__body){display:flow-root;}.is-root-container{display:flow-root;${\n\t\t\t\t\t// Some themes will have `min-height: 100vh` for the root container,\n\t\t\t\t\t// which isn't a requirement in auto resize mode.\n\t\t\t\t\tenableResizing || isNavigationPreview\n\t\t\t\t\t\t? 'min-height:0!important;'\n\t\t\t\t\t\t: ''\n\t\t\t\t}}\n\t\t\t\t${ paddingStyle ? paddingStyle : '' }\n\t\t\t\t${\n\t\t\t\t\tenableResizing\n\t\t\t\t\t\t? `.block-editor-iframe__html{background:var(--wp-editor-canvas-background);min-height:100vh;${ centerContentCSS }}.block-editor-iframe__body{width:100%;}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}${\n\t\t\t\t\tisNavigationPreview\n\t\t\t\t\t\t? `.block-editor-iframe__body{${ centerContentCSS }padding:var(--wp--style--block-gap,2em);}`\n\t\t\t\t\t\t: ''\n\t\t\t\t}`,\n\t\t\t\t// The CSS for enableResizing centers the body content vertically when resizing is enabled and applies a background\n\t\t\t\t// color to the iframe HTML element to match the background color of the editor canvas.\n\t\t\t\t// The CSS for isNavigationPreview centers the body content vertically and horizontally when the navigation is in preview mode.\n\t\t\t},\n\t\t];\n\t}, [ styles, enableResizing, isNavigationPreview, paddingStyle ] );\n\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\tuseZoomOutModeExit(),\n\t\tpaddingAppenderRef,\n\t\tuseEditContentOnlySectionExit(),\n\t] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-visual-editor',\n\t\t\t\t// this class is here for backward compatibility reasons.\n\t\t\t\t'edit-post-visual-editor',\n\t\t\t\tclassName,\n\t\t\t\t{\n\t\t\t\t\t'has-padding': isFocusedEntity || enableResizing,\n\t\t\t\t\t'is-resizable': enableResizing,\n\t\t\t\t\t'is-iframed': ! disableIframe,\n\t\t\t\t}\n\t\t\t) }\n\t\t>\n\t\t\t<SyncConnectionErrorModal />\n\t\t\t<ResizableEditor enableResizing={ enableResizing } height=\"100%\">\n\t\t\t\t<BlockCanvas\n\t\t\t\t\tshouldIframe={ ! disableIframe }\n\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\tstyles={ iframeStyles }\n\t\t\t\t\theight=\"100%\"\n\t\t\t\t\tiframeProps={ {\n\t\t\t\t\t\t...iframeProps,\n\t\t\t\t\t\tstyle: {\n\t\t\t\t\t\t\t...iframeProps?.style,\n\t\t\t\t\t\t\t...deviceStyles,\n\t\t\t\t\t\t},\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ themeSupportsLayout &&\n\t\t\t\t\t\t! themeHasDisabledLayoutStyles &&\n\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t! isDesignPostType && (\n\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".editor-visual-editor__post-title-wrapper\"\n\t\t\t\t\t\t\t\t\tlayout={ fallbackLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\tselector=\".block-editor-block-list__layout.is-root-container\"\n\t\t\t\t\t\t\t\t\tlayout={ postEditorLayout }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t{ align && <LayoutStyle css={ alignCSS } /> }\n\t\t\t\t\t\t\t\t{ postContentLayoutStyles && (\n\t\t\t\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\t\t\t\tlayout={ postContentLayout }\n\t\t\t\t\t\t\t\t\t\tcss={ postContentLayoutStyles }\n\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t) }\n\t\t\t\t\t{ renderingMode === 'post-only' && ! isDesignPostType && (\n\t\t\t\t\t\t<div\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'editor-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t// The following class is only here for backward compatibility\n\t\t\t\t\t\t\t\t// some themes might be using it to style the post title.\n\t\t\t\t\t\t\t\t'edit-post-visual-editor__post-title-wrapper',\n\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tcontentEditable={ false }\n\t\t\t\t\t\t\tref={ observeTypingRef }\n\t\t\t\t\t\t\tstyle={ {\n\t\t\t\t\t\t\t\t// This is using inline styles\n\t\t\t\t\t\t\t\t// so it's applied for both iframed and non iframed editors.\n\t\t\t\t\t\t\t\tmarginTop: '4rem',\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<PostTitle ref={ titleRef } />\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t\t<RecursionProvider\n\t\t\t\t\t\tblockName={ wrapperBlockName }\n\t\t\t\t\t\tuniqueId={ wrapperUniqueId }\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockList\n\t\t\t\t\t\t\tclassName={ clsx(\n\t\t\t\t\t\t\t\t'is-' + deviceType.toLowerCase() + '-preview',\n\t\t\t\t\t\t\t\trenderingMode !== 'post-only' ||\n\t\t\t\t\t\t\t\t\tisDesignPostType\n\t\t\t\t\t\t\t\t\t? 'wp-site-blocks'\n\t\t\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\t\t\t{\n\t\t\t\t\t\t\t\t\t'has-global-padding':\n\t\t\t\t\t\t\t\t\t\trenderingMode === 'post-only' &&\n\t\t\t\t\t\t\t\t\t\t! isDesignPostType &&\n\t\t\t\t\t\t\t\t\t\thasRootPaddingAwareAlignments,\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\tlayout={ blockListLayout }\n\t\t\t\t\t\t\tdropZoneElement={\n\t\t\t\t\t\t\t\t// When iframed, pass in the html element of the iframe to\n\t\t\t\t\t\t\t\t// ensure the drop zone extends to the edges of the iframe.\n\t\t\t\t\t\t\t\tdisableIframe\n\t\t\t\t\t\t\t\t\t? localRef.current\n\t\t\t\t\t\t\t\t\t: localRef.current?.parentNode\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__unstableDisableDropZone={\n\t\t\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\t\t\trenderingMode === 'template-locked'\n\t\t\t\t\t\t\t\t\t? true\n\t\t\t\t\t\t\t\t\t: false\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ renderingMode === 'template-locked' && (\n\t\t\t\t\t\t\t<EditTemplateBlocksNotification\n\t\t\t\t\t\t\t\tcontentRef={ localRef }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</RecursionProvider>\n\t\t\t\t</BlockCanvas>\n\t\t\t</ResizableEditor>\n\t\t</div>\n\t);\n}\n\nexport default VisualEditor;\n"],
5
+ "mappings": ";AAGA,OAAO,UAAU;AAKjB;AAAA,EACC;AAAA,EACA,SAAS;AAAA,EACT,2BAA2B;AAAA,EAC3B,+BAA+B;AAAA,EAC/B;AAAA,EACA;AAAA,EACA,eAAe;AAAA,EACf,iCAAiC;AAAA,OAC3B;AACP,SAAS,WAAW,QAAQ,eAAe;AAC3C,SAAS,iBAAiB;AAC1B,SAAS,aAAa;AACtB,SAAS,SAAS,iBAAiB;AACnC,SAAS,cAAc,wBAAwB;AAK/C,OAAO,eAAe;AACtB,SAAS,SAAS,mBAAmB;AACrC,SAAS,cAAc;AACvB,OAAO,oCAAoC;AAC3C,OAAO,qBAAqB;AAC5B,OAAO,mCAAmC;AAC1C;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AACP,SAAS,0BAA0B;AACnC,SAAS,0BAA0B;AACnC,SAAS,qCAAqC;AAC9C,SAAS,gCAAgC;AAuWtC,SAmBI,UAnBJ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ACA,QAAS;AAAA,oBACT,KAAM;AAAA;AAAA,gBACP;AAAA,iBAEF;AAAA,cAEA,kBAAkB,eAAe,CAAE,oBACpC;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAY;AAAA,oBACX;AAAA;AAAA;AAAA,oBAGA;AAAA,oBACA;AAAA,sBACC,sBACC;AAAA,oBACF;AAAA,kBACD;AAAA,kBACA,iBAAkB;AAAA,kBAClB,KAAM;AAAA,kBACN,OAAQ;AAAA;AAAA;AAAA,oBAGP,WAAW;AAAA,kBACZ;AAAA,kBAEA,8BAAC,aAAU,KAAM,UAAW;AAAA;AAAA,cAC7B;AAAA,cAED;AAAA,gBAAC;AAAA;AAAA,kBACA,WAAY;AAAA,kBACZ,UAAW;AAAA,kBAEX;AAAA;AAAA,sBAAC;AAAA;AAAA,wBACA,WAAY;AAAA,0BACX,QAAQ,WAAW,YAAY,IAAI;AAAA,0BACnC,kBAAkB,eACjB,mBACE,mBACA,GAAI,oBAAqB;AAAA;AAAA,0BAC5B;AAAA,4BACC,sBACC,kBAAkB,eAClB,CAAE,oBACF;AAAA,0BACF;AAAA,wBACD;AAAA,wBACA,QAAS;AAAA,wBACT;AAAA;AAAA;AAAA,0BAGC,gBACG,SAAS,UACT,SAAS,SAAS;AAAA;AAAA,wBAEtB;AAAA;AAAA,0BAEC,kBAAkB,oBACf,OACA;AAAA;AAAA;AAAA,oBAEL;AAAA,oBACE,kBAAkB,qBACnB;AAAA,sBAAC;AAAA;AAAA,wBACA,YAAa;AAAA;AAAA,oBACd;AAAA;AAAA;AAAA,cAEF;AAAA;AAAA;AAAA,QACD,GACD;AAAA;AAAA;AAAA,EACD;AAEF;AAEA,IAAO,wBAAQ;",
6
6
  "names": []
7
7
  }
@@ -356,12 +356,6 @@ function resetStylesNavigation() {
356
356
  type: "RESET_STYLES_NAVIGATION"
357
357
  };
358
358
  }
359
- function setCanvasMinHeight(minHeight) {
360
- return {
361
- type: "SET_CANVAS_MIN_HEIGHT",
362
- minHeight
363
- };
364
- }
365
359
  function setCurrentRevisionId(revisionId) {
366
360
  return {
367
361
  type: "SET_CURRENT_REVISION_ID",
@@ -442,7 +436,6 @@ export {
442
436
  revertTemplate,
443
437
  saveDirtyEntities,
444
438
  selectNote,
445
- setCanvasMinHeight,
446
439
  setCurrentRevisionId,
447
440
  setCurrentTemplateId,
448
441
  setDefaultRenderingMode,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../src/store/private-actions.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { addQueryArgs } from '@wordpress/url';\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { dateI18n, getSettings as getDateSettings } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from './utils/is-template-revertable';\nexport * from '../dataviews/store/private-actions';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {?Object} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\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: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\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\treturn savedTemplate;\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', newBlockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n\t};\n\n/**\n * Save entity records marked as dirty.\n *\n * @param {Object} options Options for the action.\n * @param {Function} [options.onSave] Callback when saving happens.\n * @param {object[]} [options.dirtyEntityRecords] Array of dirty entities.\n * @param {object[]} [options.entitiesToSkip] Array of entities to skip saving.\n * @param {Function} [options.close] Callback when the actions is called. It should be consolidated with `onSave`.\n * @param {string} [options.successNoticeContent] Optional custom success notice content. Defaults to 'Site updated.'.\n */\nexport const saveDirtyEntities =\n\t( {\n\t\tonSave,\n\t\tdirtyEntityRecords = [],\n\t\tentitiesToSkip = [],\n\t\tclose,\n\t\tsuccessNoticeContent,\n\t} = {} ) =>\n\t( { registry } ) => {\n\t\tconst PUBLISH_ON_SAVE_ENTITIES = [\n\t\t\t{ kind: 'postType', name: 'wp_navigation' },\n\t\t];\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tconst homeUrl = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEntityRecord( 'root', '__unstableBase' )?.home;\n\t\tregistry.dispatch( noticesStore ).removeNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! entitiesToSkip.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\tclose?.( entitiesToSave );\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord( kind, name, key, {\n\t\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.saveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__experimentalSaveSpecifiedEntityEdits(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'site',\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tsiteItemsToSave\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave ? onSave( values ) : values;\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createSuccessNotice(\n\t\t\t\t\t\t\tsuccessNoticeContent || __( 'Site updated.' ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\t\t\t\t\turl: homeUrl,\n\t\t\t\t\t\t\t\t\t\topenInNewTab: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t`${ __( 'Saving failed.' ) } ${ error }`\n\t\t\t\t\t)\n\t\t\t);\n\t};\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: template.origin }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reset.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\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}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that removes an array of templates, template parts or patterns.\n *\n * @param {Array} items An array of template,template part or pattern objects to remove.\n */\nexport const removeTemplates =\n\t( items ) =>\n\tasync ( { registry } ) => {\n\t\tconst isResetting = items.every( ( item ) => item?.has_theme_file );\n\n\t\tconst promiseResult = await Promise.allSettled(\n\t\t\titems.map( ( item ) => {\n\t\t\t\treturn registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.deleteEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\titem.type,\n\t\t\t\t\t\titem.id,\n\t\t\t\t\t\t{ force: true },\n\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t);\n\t\t\t} )\n\t\t);\n\n\t\t// If all the promises were fulfilled with success.\n\t\tif ( promiseResult.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\t\tlet successMessage;\n\n\t\t\tif ( items.length === 1 ) {\n\t\t\t\t// Depending on how the entity was retrieved its title might be\n\t\t\t\t// an object or simple string.\n\t\t\t\tlet title;\n\t\t\t\tif ( typeof items[ 0 ].title === 'string' ) {\n\t\t\t\t\ttitle = items[ 0 ].title;\n\t\t\t\t} else if ( typeof items[ 0 ].title?.rendered === 'string' ) {\n\t\t\t\t\ttitle = items[ 0 ].title?.rendered;\n\t\t\t\t} else if ( typeof items[ 0 ].title?.raw === 'string' ) {\n\t\t\t\t\ttitle = items[ 0 ].title?.raw;\n\t\t\t\t}\n\t\t\t\tsuccessMessage = isResetting\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: The template/part's name. */\n\t\t\t\t\t\t\t__( '\"%s\" reset.' ),\n\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: %s: The template/part's name. */\n\t\t\t\t\t\t\t_x( '\"%s\" deleted.', 'template part' ),\n\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tsuccessMessage = isResetting\n\t\t\t\t\t? __( 'Items reset.' )\n\t\t\t\t\t: __( 'Items deleted.' );\n\t\t\t}\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( successMessage, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'editor-template-deleted-success',\n\t\t\t\t} );\n\t\t} else {\n\t\t\t// If there was at lease one failure.\n\t\t\tlet errorMessage;\n\t\t\t// If we were trying to delete a single template.\n\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\terrorMessage = promiseResult[ 0 ].reason.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? __( 'An error occurred while reverting the item.' )\n\t\t\t\t\t\t: __( 'An error occurred while deleting the item.' );\n\t\t\t\t}\n\t\t\t\t// If we were trying to delete a multiple templates\n\t\t\t} else {\n\t\t\t\tconst errorMessages = new Set();\n\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t);\n\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\terrorMessages.add( failedPromise.reason.message );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t'An error occurred while deleting the items.'\n\t\t\t\t\t);\n\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while reverting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while reverting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t}\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Set the default rendering mode preference for the current post type.\n *\n * @param {string} mode The rendering mode to set as default.\n */\nexport const setDefaultRenderingMode =\n\t( mode ) =>\n\t( { select, registry } ) => {\n\t\tconst postType = select.getCurrentPostType();\n\t\tconst theme = registry\n\t\t\t.select( coreStore )\n\t\t\t.getCurrentTheme()?.stylesheet;\n\t\tconst renderingModes =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'renderingModes' )?.[ theme ] ?? {};\n\n\t\tif ( renderingModes[ postType ] === mode ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newModes = {\n\t\t\t[ theme ]: {\n\t\t\t\t...renderingModes,\n\t\t\t\t[ postType ]: mode,\n\t\t\t},\n\t\t};\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'renderingModes', newModes );\n\t};\n\n/**\n * Set the current global styles navigation path.\n *\n * @param {string} path The navigation path.\n * @return {Object} Action object.\n */\nexport function setStylesPath( path ) {\n\treturn {\n\t\ttype: 'SET_STYLES_PATH',\n\t\tpath,\n\t};\n}\n\n/**\n * Set whether the stylebook is visible.\n *\n * @param {boolean} show Whether to show the stylebook.\n * @return {Object} Action object.\n */\nexport function setShowStylebook( show ) {\n\treturn {\n\t\ttype: 'SET_SHOW_STYLEBOOK',\n\t\tshow,\n\t};\n}\n\n/**\n * Reset the global styles navigation to initial state.\n *\n * @return {Object} Action object.\n */\nexport function resetStylesNavigation() {\n\treturn {\n\t\ttype: 'RESET_STYLES_NAVIGATION',\n\t};\n}\n\n/**\n * Set the minimum height of the canvas.\n *\n * @param {number} minHeight\n * @return {Object} Action object.\n */\nexport function setCanvasMinHeight( minHeight ) {\n\treturn {\n\t\ttype: 'SET_CANVAS_MIN_HEIGHT',\n\t\tminHeight,\n\t};\n}\n\n/**\n * Set the current revision ID for revisions preview mode.\n * Pass a revision ID to enter revisions mode, or null to exit.\n *\n * @param {number|null} revisionId The revision ID, or null to exit revisions mode.\n * @return {Object} Action object.\n */\nexport function setCurrentRevisionId( revisionId ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_REVISION_ID',\n\t\trevisionId,\n\t};\n}\n\n/**\n * Set whether the revision diff highlighting is shown.\n *\n * @param {boolean} showDiff Whether to show diff highlighting.\n * @return {Object} Action object.\n */\nexport function setShowRevisionDiff( showDiff ) {\n\treturn {\n\t\ttype: 'SET_SHOW_REVISION_DIFF',\n\t\tshowDiff,\n\t};\n}\n\n/**\n * Restore a revision by replacing the current content with the revision's content\n * and auto-saving.\n *\n * @param {number} revisionId The revision ID to restore.\n */\nexport const restoreRevision =\n\t( revisionId ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postType = select.getCurrentPostType();\n\t\tconst postId = select.getCurrentPostId();\n\n\t\tconst entityConfig = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEntityConfig( 'postType', postType );\n\t\tconst revisionKey = entityConfig?.revisionKey || 'id';\n\n\t\t// Use resolveSelect to ensure the revision is fetched if not yet\n\t\t// in the store. The _fields parameter matches the query used by\n\t\t// getRevisions so the result is served from cache without an\n\t\t// extra API call.\n\t\tconst revision = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getRevision( 'postType', postType, postId, revisionId, {\n\t\t\t\tcontext: 'edit',\n\t\t\t\t_fields: [\n\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t'id',\n\t\t\t\t\t\t'date',\n\t\t\t\t\t\t'modified',\n\t\t\t\t\t\t'author',\n\t\t\t\t\t\t'meta',\n\t\t\t\t\t\t'title.raw',\n\t\t\t\t\t\t'excerpt.raw',\n\t\t\t\t\t\t'content.raw',\n\t\t\t\t\t\trevisionKey,\n\t\t\t\t\t] ),\n\t\t\t\t].join(),\n\t\t\t} );\n\n\t\tif ( ! revision ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Build the edits object with all restorable fields from the revision.\n\t\tconst edits = {\n\t\t\tblocks: undefined,\n\t\t\tcontent: revision.content.raw,\n\t\t};\n\t\tif ( revision.title?.raw !== undefined ) {\n\t\t\tedits.title = revision.title.raw;\n\t\t}\n\t\tif ( revision.excerpt?.raw !== undefined ) {\n\t\t\tedits.excerpt = revision.excerpt.raw;\n\t\t}\n\t\tif ( revision.meta !== undefined ) {\n\t\t\tedits.meta = revision.meta;\n\t\t}\n\n\t\t// Apply edits and save.\n\t\tdispatch.editPost( edits );\n\n\t\t// Exit revisions mode.\n\t\tdispatch.setCurrentRevisionId( null );\n\n\t\t// Save the post to persist the restored revision.\n\t\tawait dispatch.savePost();\n\n\t\t// Show success notice.\n\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Date and time of the revision. */\n\t\t\t\t__( 'Restored to revision from %s.' ),\n\t\t\t\tdateI18n( getDateSettings().formats.datetime, revision.date )\n\t\t\t),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'editor-revision-restored',\n\t\t\t}\n\t\t);\n\t};\n\n/**\n * Select a note by its ID, or clear the selection.\n *\n * @param {undefined|number|'new'} noteId The note ID to select, 'new' to open the new note form, or undefined to clear.\n * @param {Object} [options] Optional options for the selection.\n * @param {boolean} [options.focus] Whether to focus the selected note. Default false.\n * @return {Object} Action object.\n */\nexport function selectNote( noteId, options = { focus: false } ) {\n\treturn {\n\t\ttype: 'SELECT_NOTE',\n\t\tnoteId,\n\t\toptions,\n\t};\n}\n"],
5
- "mappings": ";AAGA,SAAS,SAAS,iBAAiB;AACnC,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,SAAS,oBAAoB;AACtC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,SAAS,wBAAwB;AAC1C,SAAS,oBAAoB;AAC7B,OAAO,cAAc;AACrB,SAAS,OAAO,mCAAmC;AACnD,SAAS,sBAAsB;AAC/B,SAAS,UAAU,eAAe,uBAAuB;AAKzD,OAAO,0BAA0B;AACjC,cAAc;AASP,SAAS,qBAAsB,IAAK;AAC1C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAOO,IAAM,iBACZ,CAAE,aACF,OAAQ,EAAE,QAAQ,UAAU,SAAS,MAAO;AAC3C,QAAM,gBAAgB,MAAM,SAC1B,SAAU,SAAU,EACpB,iBAAkB,YAAY,eAAe,QAAS;AACxD,WACE,SAAU,SAAU,EACpB;AAAA,IACA;AAAA,IACA,OAAO,mBAAmB;AAAA,IAC1B,OAAO,iBAAiB;AAAA,IACxB;AAAA,MACC,UAAU,cAAc;AAAA,IACzB;AAAA,EACD;AACD,WACE,SAAU,YAAa,EACvB;AAAA,IACA,GAAI,uDAAwD;AAAA,IAC5D;AAAA,MACC,MAAM;AAAA,MACN,SAAS;AAAA,QACR;AAAA,UACC,OAAO,GAAI,SAAU;AAAA,UACrB,SAAS,MACR,SAAS;AAAA,YACR,OAAO,kBAAkB,EACvB;AAAA,UACH;AAAA,QACF;AAAA,MACD;AAAA,IACD;AAAA,EACD;AACD,SAAO;AACR;AAOM,IAAM,iBAC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AAY;AACxC,UAAM,QAAQ,SAAS,MAAM;AAAA,EAC9B;AACA,MAAK,SAAS,SAAS,QAAQ,QAAY;AAC1C,UAAM,UAAU,SAAS,QAAQ;AAAA,EAClC;AACA,MAAK,SAAS,SAAS,QAAY;AAClC,UAAM,OAAO,SAAS;AAAA,EACvB;AAGA,WAAS,SAAU,KAAM;AAGzB,WAAS,qBAAsB,IAAK;AAGpC,QAAM,SAAS,SAAS;AAGxB,WAAS,SAAU,YAAa,EAAE;AAAA,IACjC;AAAA;AAAA,MAEC,GAAI,+BAAgC;AAAA,MACpC,SAAU,gBAAgB,EAAE,QAAQ,UAAU,SAAS,IAAK;AAAA,IAC7D;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,IAAI;AAAA,IACL;AAAA,EACD;AACD;AAUM,SAAS,WAAY,QAAQ,UAAU,EAAE,OAAO,MAAM,GAAI;AAChE,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport { addQueryArgs } from '@wordpress/url';\nimport apiFetch from '@wordpress/api-fetch';\nimport { parse, __unstableSerializeAndClean } from '@wordpress/blocks';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport { dateI18n, getSettings as getDateSettings } from '@wordpress/date';\n\n/**\n * Internal dependencies\n */\nimport isTemplateRevertable from './utils/is-template-revertable';\nexport * from '../dataviews/store/private-actions';\n\n/**\n * Returns an action object used to set which template is currently being used/edited.\n *\n * @param {string} id Template Id.\n *\n * @return {Object} Action object.\n */\nexport function setCurrentTemplateId( id ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_TEMPLATE_ID',\n\t\tid,\n\t};\n}\n\n/**\n * Create a block based template.\n *\n * @param {?Object} template Template to create and assign.\n */\nexport const createTemplate =\n\t( template ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst savedTemplate = await registry\n\t\t\t.dispatch( coreStore )\n\t\t\t.saveEntityRecord( 'postType', 'wp_template', template );\n\t\tregistry\n\t\t\t.dispatch( coreStore )\n\t\t\t.editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tselect.getCurrentPostType(),\n\t\t\t\tselect.getCurrentPostId(),\n\t\t\t\t{\n\t\t\t\t\ttemplate: savedTemplate.slug,\n\t\t\t\t}\n\t\t\t);\n\t\tregistry\n\t\t\t.dispatch( noticesStore )\n\t\t\t.createSuccessNotice(\n\t\t\t\t__( \"Custom template created. You're in template mode now.\" ),\n\t\t\t\t{\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: __( 'Go back' ),\n\t\t\t\t\t\t\tonClick: () =>\n\t\t\t\t\t\t\t\tdispatch.setRenderingMode(\n\t\t\t\t\t\t\t\t\tselect.getEditorSettings()\n\t\t\t\t\t\t\t\t\t\t.defaultRenderingMode\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\treturn savedTemplate;\n\t};\n\n/**\n * Update the provided block types to be visible.\n *\n * @param {string[]} blockNames Names of block types to show.\n */\nexport const showBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst newBlockNames = existingBlockNames.filter(\n\t\t\t( type ) =>\n\t\t\t\t! (\n\t\t\t\t\tArray.isArray( blockNames ) ? blockNames : [ blockNames ]\n\t\t\t\t).includes( type )\n\t\t);\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', newBlockNames );\n\t};\n\n/**\n * Update the provided block types to be hidden.\n *\n * @param {string[]} blockNames Names of block types to hide.\n */\nexport const hideBlockTypes =\n\t( blockNames ) =>\n\t( { registry } ) => {\n\t\tconst existingBlockNames =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'hiddenBlockTypes' ) ?? [];\n\n\t\tconst mergedBlockNames = new Set( [\n\t\t\t...existingBlockNames,\n\t\t\t...( Array.isArray( blockNames ) ? blockNames : [ blockNames ] ),\n\t\t] );\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'hiddenBlockTypes', [ ...mergedBlockNames ] );\n\t};\n\n/**\n * Save entity records marked as dirty.\n *\n * @param {Object} options Options for the action.\n * @param {Function} [options.onSave] Callback when saving happens.\n * @param {object[]} [options.dirtyEntityRecords] Array of dirty entities.\n * @param {object[]} [options.entitiesToSkip] Array of entities to skip saving.\n * @param {Function} [options.close] Callback when the actions is called. It should be consolidated with `onSave`.\n * @param {string} [options.successNoticeContent] Optional custom success notice content. Defaults to 'Site updated.'.\n */\nexport const saveDirtyEntities =\n\t( {\n\t\tonSave,\n\t\tdirtyEntityRecords = [],\n\t\tentitiesToSkip = [],\n\t\tclose,\n\t\tsuccessNoticeContent,\n\t} = {} ) =>\n\t( { registry } ) => {\n\t\tconst PUBLISH_ON_SAVE_ENTITIES = [\n\t\t\t{ kind: 'postType', name: 'wp_navigation' },\n\t\t];\n\t\tconst saveNoticeId = 'site-editor-save-success';\n\t\tconst homeUrl = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEntityRecord( 'root', '__unstableBase' )?.home;\n\t\tregistry.dispatch( noticesStore ).removeNotice( saveNoticeId );\n\t\tconst entitiesToSave = dirtyEntityRecords.filter(\n\t\t\t( { kind, name, key, property } ) => {\n\t\t\t\treturn ! entitiesToSkip.some(\n\t\t\t\t\t( elt ) =>\n\t\t\t\t\t\telt.kind === kind &&\n\t\t\t\t\t\telt.name === name &&\n\t\t\t\t\t\telt.key === key &&\n\t\t\t\t\t\telt.property === property\n\t\t\t\t);\n\t\t\t}\n\t\t);\n\t\tclose?.( entitiesToSave );\n\t\tconst siteItemsToSave = [];\n\t\tconst pendingSavedRecords = [];\n\t\tentitiesToSave.forEach( ( { kind, name, key, property } ) => {\n\t\t\tif ( 'root' === kind && 'site' === name ) {\n\t\t\t\tsiteItemsToSave.push( property );\n\t\t\t} else {\n\t\t\t\tif (\n\t\t\t\t\tPUBLISH_ON_SAVE_ENTITIES.some(\n\t\t\t\t\t\t( typeToPublish ) =>\n\t\t\t\t\t\t\ttypeToPublish.kind === kind &&\n\t\t\t\t\t\t\ttypeToPublish.name === name\n\t\t\t\t\t)\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord( kind, name, key, {\n\t\t\t\t\t\t\tstatus: 'publish',\n\t\t\t\t\t\t} );\n\t\t\t\t}\n\n\t\t\t\tpendingSavedRecords.push(\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.saveEditedEntityRecord( kind, name, key )\n\t\t\t\t);\n\t\t\t}\n\t\t} );\n\t\tif ( siteItemsToSave.length ) {\n\t\t\tpendingSavedRecords.push(\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.__experimentalSaveSpecifiedEntityEdits(\n\t\t\t\t\t\t'root',\n\t\t\t\t\t\t'site',\n\t\t\t\t\t\tundefined,\n\t\t\t\t\t\tsiteItemsToSave\n\t\t\t\t\t)\n\t\t\t);\n\t\t}\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.__unstableMarkLastChangeAsPersistent();\n\t\tPromise.all( pendingSavedRecords )\n\t\t\t.then( ( values ) => {\n\t\t\t\treturn onSave ? onSave( values ) : values;\n\t\t\t} )\n\t\t\t.then( ( values ) => {\n\t\t\t\tif (\n\t\t\t\t\tvalues.some( ( value ) => typeof value === 'undefined' )\n\t\t\t\t) {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createErrorNotice( __( 'Saving failed.' ) );\n\t\t\t\t} else {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t\t.createSuccessNotice(\n\t\t\t\t\t\t\tsuccessNoticeContent || __( 'Site updated.' ),\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\t\t\tid: saveNoticeId,\n\t\t\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\t\t\tlabel: __( 'View site' ),\n\t\t\t\t\t\t\t\t\t\turl: homeUrl,\n\t\t\t\t\t\t\t\t\t\topenInNewTab: true,\n\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t],\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t} )\n\t\t\t.catch( ( error ) =>\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t`${ __( 'Saving failed.' ) } ${ error }`\n\t\t\t\t\t)\n\t\t\t);\n\t};\n\n/**\n * Reverts a template to its original theme-provided file.\n *\n * @param {Object} template The template to revert.\n * @param {Object} [options]\n * @param {boolean} [options.allowUndo] Whether to allow the user to undo\n * reverting the template. Default true.\n */\nexport const revertTemplate =\n\t( template, { allowUndo = true } = {} ) =>\n\tasync ( { registry } ) => {\n\t\tconst noticeId = 'edit-site-template-reverted';\n\t\tregistry.dispatch( noticesStore ).removeNotice( noticeId );\n\t\tif ( ! isTemplateRevertable( template ) ) {\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( __( 'This template is not revertable.' ), {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t} );\n\t\t\treturn;\n\t\t}\n\n\t\ttry {\n\t\t\tconst templateEntityConfig = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEntityConfig( 'postType', template.type );\n\n\t\t\tif ( ! templateEntityConfig ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst fileTemplatePath = addQueryArgs(\n\t\t\t\t`${ templateEntityConfig.baseURL }/${ template.id }`,\n\t\t\t\t{ context: 'edit', source: template.origin }\n\t\t\t);\n\n\t\t\tconst fileTemplate = await apiFetch( { path: fileTemplatePath } );\n\t\t\tif ( ! fileTemplate ) {\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createErrorNotice(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'The editor has encountered an unexpected error. Please reload.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{ type: 'snackbar' }\n\t\t\t\t\t);\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tconst serializeBlocks = ( {\n\t\t\t\tblocks: blocksForSerialization = [],\n\t\t\t} ) => __unstableSerializeAndClean( blocksForSerialization );\n\n\t\t\tconst edited = registry\n\t\t\t\t.select( coreStore )\n\t\t\t\t.getEditedEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\ttemplate.type,\n\t\t\t\t\ttemplate.id\n\t\t\t\t);\n\n\t\t\t// We are fixing up the undo level here to make sure we can undo\n\t\t\t// the revert in the header toolbar correctly.\n\t\t\tregistry.dispatch( coreStore ).editEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\ttemplate.type,\n\t\t\t\ttemplate.id,\n\t\t\t\t{\n\t\t\t\t\tcontent: serializeBlocks, // Required to make the `undo` behave correctly.\n\t\t\t\t\tblocks: edited.blocks, // Required to revert the blocks in the editor.\n\t\t\t\t\tsource: 'custom', // required to avoid turning the editor into a dirty state\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tundoIgnore: true, // Required to merge this edit with the last undo level.\n\t\t\t\t}\n\t\t\t);\n\n\t\t\tconst blocks = parse( fileTemplate?.content?.raw );\n\t\t\tregistry\n\t\t\t\t.dispatch( coreStore )\n\t\t\t\t.editEntityRecord( 'postType', template.type, fileTemplate.id, {\n\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\tblocks,\n\t\t\t\t\tsource: 'theme',\n\t\t\t\t} );\n\n\t\t\tif ( allowUndo ) {\n\t\t\t\tconst undoRevert = () => {\n\t\t\t\t\tregistry\n\t\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t\t.editEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\ttemplate.type,\n\t\t\t\t\t\t\tedited.id,\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tcontent: serializeBlocks,\n\t\t\t\t\t\t\t\tblocks: edited.blocks,\n\t\t\t\t\t\t\t\tsource: 'custom',\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t);\n\t\t\t\t};\n\n\t\t\t\tregistry\n\t\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t\t.createSuccessNotice( __( 'Template reset.' ), {\n\t\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\t\tid: noticeId,\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'Undo' ),\n\t\t\t\t\t\t\t\tonClick: undoRevert,\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}\n\t\t} catch ( error ) {\n\t\t\tconst errorMessage =\n\t\t\t\terror.message && error.code !== 'unknown_error'\n\t\t\t\t\t? error.message\n\t\t\t\t\t: __( 'Template revert failed. Please reload.' );\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Action that removes an array of templates, template parts or patterns.\n *\n * @param {Array} items An array of template,template part or pattern objects to remove.\n */\nexport const removeTemplates =\n\t( items ) =>\n\tasync ( { registry } ) => {\n\t\tconst isResetting = items.every( ( item ) => item?.has_theme_file );\n\n\t\tconst promiseResult = await Promise.allSettled(\n\t\t\titems.map( ( item ) => {\n\t\t\t\treturn registry\n\t\t\t\t\t.dispatch( coreStore )\n\t\t\t\t\t.deleteEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\titem.type,\n\t\t\t\t\t\titem.id,\n\t\t\t\t\t\t{ force: true },\n\t\t\t\t\t\t{ throwOnError: true }\n\t\t\t\t\t);\n\t\t\t} )\n\t\t);\n\n\t\t// If all the promises were fulfilled with success.\n\t\tif ( promiseResult.every( ( { status } ) => status === 'fulfilled' ) ) {\n\t\t\tlet successMessage;\n\n\t\t\tif ( items.length === 1 ) {\n\t\t\t\t// Depending on how the entity was retrieved its title might be\n\t\t\t\t// an object or simple string.\n\t\t\t\tlet title;\n\t\t\t\tif ( typeof items[ 0 ].title === 'string' ) {\n\t\t\t\t\ttitle = items[ 0 ].title;\n\t\t\t\t} else if ( typeof items[ 0 ].title?.rendered === 'string' ) {\n\t\t\t\t\ttitle = items[ 0 ].title?.rendered;\n\t\t\t\t} else if ( typeof items[ 0 ].title?.raw === 'string' ) {\n\t\t\t\t\ttitle = items[ 0 ].title?.raw;\n\t\t\t\t}\n\t\t\t\tsuccessMessage = isResetting\n\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t/* translators: %s: The template/part's name. */\n\t\t\t\t\t\t\t__( '\"%s\" reset.' ),\n\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t )\n\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t/* translators: %s: The template/part's name. */\n\t\t\t\t\t\t\t_x( '\"%s\" deleted.', 'template part' ),\n\t\t\t\t\t\t\tdecodeEntities( title )\n\t\t\t\t\t );\n\t\t\t} else {\n\t\t\t\tsuccessMessage = isResetting\n\t\t\t\t\t? __( 'Items reset.' )\n\t\t\t\t\t: __( 'Items deleted.' );\n\t\t\t}\n\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createSuccessNotice( successMessage, {\n\t\t\t\t\ttype: 'snackbar',\n\t\t\t\t\tid: 'editor-template-deleted-success',\n\t\t\t\t} );\n\t\t} else {\n\t\t\t// If there was at lease one failure.\n\t\t\tlet errorMessage;\n\t\t\t// If we were trying to delete a single template.\n\t\t\tif ( promiseResult.length === 1 ) {\n\t\t\t\tif ( promiseResult[ 0 ].reason?.message ) {\n\t\t\t\t\terrorMessage = promiseResult[ 0 ].reason.message;\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? __( 'An error occurred while reverting the item.' )\n\t\t\t\t\t\t: __( 'An error occurred while deleting the item.' );\n\t\t\t\t}\n\t\t\t\t// If we were trying to delete a multiple templates\n\t\t\t} else {\n\t\t\t\tconst errorMessages = new Set();\n\t\t\t\tconst failedPromises = promiseResult.filter(\n\t\t\t\t\t( { status } ) => status === 'rejected'\n\t\t\t\t);\n\t\t\t\tfor ( const failedPromise of failedPromises ) {\n\t\t\t\t\tif ( failedPromise.reason?.message ) {\n\t\t\t\t\t\terrorMessages.add( failedPromise.reason.message );\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif ( errorMessages.size === 0 ) {\n\t\t\t\t\terrorMessage = __(\n\t\t\t\t\t\t'An error occurred while deleting the items.'\n\t\t\t\t\t);\n\t\t\t\t} else if ( errorMessages.size === 1 ) {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while reverting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: an error message */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'An error occurred while deleting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ][ 0 ]\n\t\t\t\t\t\t );\n\t\t\t\t} else {\n\t\t\t\t\terrorMessage = isResetting\n\t\t\t\t\t\t? sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while reverting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t )\n\t\t\t\t\t\t: sprintf(\n\t\t\t\t\t\t\t\t/* translators: %s: a list of comma separated error messages */\n\t\t\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t\t\t'Some errors occurred while deleting the items: %s'\n\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t[ ...errorMessages ].join( ',' )\n\t\t\t\t\t\t );\n\t\t\t\t}\n\t\t\t}\n\t\t\tregistry\n\t\t\t\t.dispatch( noticesStore )\n\t\t\t\t.createErrorNotice( errorMessage, { type: 'snackbar' } );\n\t\t}\n\t};\n\n/**\n * Set the default rendering mode preference for the current post type.\n *\n * @param {string} mode The rendering mode to set as default.\n */\nexport const setDefaultRenderingMode =\n\t( mode ) =>\n\t( { select, registry } ) => {\n\t\tconst postType = select.getCurrentPostType();\n\t\tconst theme = registry\n\t\t\t.select( coreStore )\n\t\t\t.getCurrentTheme()?.stylesheet;\n\t\tconst renderingModes =\n\t\t\tregistry\n\t\t\t\t.select( preferencesStore )\n\t\t\t\t.get( 'core', 'renderingModes' )?.[ theme ] ?? {};\n\n\t\tif ( renderingModes[ postType ] === mode ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst newModes = {\n\t\t\t[ theme ]: {\n\t\t\t\t...renderingModes,\n\t\t\t\t[ postType ]: mode,\n\t\t\t},\n\t\t};\n\n\t\tregistry\n\t\t\t.dispatch( preferencesStore )\n\t\t\t.set( 'core', 'renderingModes', newModes );\n\t};\n\n/**\n * Set the current global styles navigation path.\n *\n * @param {string} path The navigation path.\n * @return {Object} Action object.\n */\nexport function setStylesPath( path ) {\n\treturn {\n\t\ttype: 'SET_STYLES_PATH',\n\t\tpath,\n\t};\n}\n\n/**\n * Set whether the stylebook is visible.\n *\n * @param {boolean} show Whether to show the stylebook.\n * @return {Object} Action object.\n */\nexport function setShowStylebook( show ) {\n\treturn {\n\t\ttype: 'SET_SHOW_STYLEBOOK',\n\t\tshow,\n\t};\n}\n\n/**\n * Reset the global styles navigation to initial state.\n *\n * @return {Object} Action object.\n */\nexport function resetStylesNavigation() {\n\treturn {\n\t\ttype: 'RESET_STYLES_NAVIGATION',\n\t};\n}\n\n/**\n * Set the current revision ID for revisions preview mode.\n * Pass a revision ID to enter revisions mode, or null to exit.\n *\n * @param {number|null} revisionId The revision ID, or null to exit revisions mode.\n * @return {Object} Action object.\n */\nexport function setCurrentRevisionId( revisionId ) {\n\treturn {\n\t\ttype: 'SET_CURRENT_REVISION_ID',\n\t\trevisionId,\n\t};\n}\n\n/**\n * Set whether the revision diff highlighting is shown.\n *\n * @param {boolean} showDiff Whether to show diff highlighting.\n * @return {Object} Action object.\n */\nexport function setShowRevisionDiff( showDiff ) {\n\treturn {\n\t\ttype: 'SET_SHOW_REVISION_DIFF',\n\t\tshowDiff,\n\t};\n}\n\n/**\n * Restore a revision by replacing the current content with the revision's content\n * and auto-saving.\n *\n * @param {number} revisionId The revision ID to restore.\n */\nexport const restoreRevision =\n\t( revisionId ) =>\n\tasync ( { select, dispatch, registry } ) => {\n\t\tconst postType = select.getCurrentPostType();\n\t\tconst postId = select.getCurrentPostId();\n\n\t\tconst entityConfig = registry\n\t\t\t.select( coreStore )\n\t\t\t.getEntityConfig( 'postType', postType );\n\t\tconst revisionKey = entityConfig?.revisionKey || 'id';\n\n\t\t// Use resolveSelect to ensure the revision is fetched if not yet\n\t\t// in the store. The _fields parameter matches the query used by\n\t\t// getRevisions so the result is served from cache without an\n\t\t// extra API call.\n\t\tconst revision = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getRevision( 'postType', postType, postId, revisionId, {\n\t\t\t\tcontext: 'edit',\n\t\t\t\t_fields: [\n\t\t\t\t\t...new Set( [\n\t\t\t\t\t\t'id',\n\t\t\t\t\t\t'date',\n\t\t\t\t\t\t'modified',\n\t\t\t\t\t\t'author',\n\t\t\t\t\t\t'meta',\n\t\t\t\t\t\t'title.raw',\n\t\t\t\t\t\t'excerpt.raw',\n\t\t\t\t\t\t'content.raw',\n\t\t\t\t\t\trevisionKey,\n\t\t\t\t\t] ),\n\t\t\t\t].join(),\n\t\t\t} );\n\n\t\tif ( ! revision ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Build the edits object with all restorable fields from the revision.\n\t\tconst edits = {\n\t\t\tblocks: undefined,\n\t\t\tcontent: revision.content.raw,\n\t\t};\n\t\tif ( revision.title?.raw !== undefined ) {\n\t\t\tedits.title = revision.title.raw;\n\t\t}\n\t\tif ( revision.excerpt?.raw !== undefined ) {\n\t\t\tedits.excerpt = revision.excerpt.raw;\n\t\t}\n\t\tif ( revision.meta !== undefined ) {\n\t\t\tedits.meta = revision.meta;\n\t\t}\n\n\t\t// Apply edits and save.\n\t\tdispatch.editPost( edits );\n\n\t\t// Exit revisions mode.\n\t\tdispatch.setCurrentRevisionId( null );\n\n\t\t// Save the post to persist the restored revision.\n\t\tawait dispatch.savePost();\n\n\t\t// Show success notice.\n\t\tregistry.dispatch( noticesStore ).createSuccessNotice(\n\t\t\tsprintf(\n\t\t\t\t/* translators: %s: Date and time of the revision. */\n\t\t\t\t__( 'Restored to revision from %s.' ),\n\t\t\t\tdateI18n( getDateSettings().formats.datetime, revision.date )\n\t\t\t),\n\t\t\t{\n\t\t\t\ttype: 'snackbar',\n\t\t\t\tid: 'editor-revision-restored',\n\t\t\t}\n\t\t);\n\t};\n\n/**\n * Select a note by its ID, or clear the selection.\n *\n * @param {undefined|number|'new'} noteId The note ID to select, 'new' to open the new note form, or undefined to clear.\n * @param {Object} [options] Optional options for the selection.\n * @param {boolean} [options.focus] Whether to focus the selected note. Default false.\n * @return {Object} Action object.\n */\nexport function selectNote( noteId, options = { focus: false } ) {\n\treturn {\n\t\ttype: 'SELECT_NOTE',\n\t\tnoteId,\n\t\toptions,\n\t};\n}\n"],
5
+ "mappings": ";AAGA,SAAS,SAAS,iBAAiB;AACnC,SAAS,IAAI,IAAI,eAAe;AAChC,SAAS,SAAS,oBAAoB;AACtC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,SAAS,wBAAwB;AAC1C,SAAS,oBAAoB;AAC7B,OAAO,cAAc;AACrB,SAAS,OAAO,mCAAmC;AACnD,SAAS,sBAAsB;AAC/B,SAAS,UAAU,eAAe,uBAAuB;AAKzD,OAAO,0BAA0B;AACjC,cAAc;AASP,SAAS,qBAAsB,IAAK;AAC1C,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,EACD;AACD;AAOO,IAAM,iBACZ,CAAE,aACF,OAAQ,EAAE,QAAQ,UAAU,SAAS,MAAO;AAC3C,QAAM,gBAAgB,MAAM,SAC1B,SAAU,SAAU,EACpB,iBAAkB,YAAY,eAAe,QAAS;AACxD,WACE,SAAU,SAAU,EACpB;AAAA,IACA;AAAA,IACA,OAAO,mBAAmB;AAAA,IAC1B,OAAO,iBAAiB;AAAA,IACxB;AAAA,MACC,UAAU,cAAc;AAAA,IACzB;AAAA,EACD;AACD,WACE,SAAU,YAAa,EACvB;AAAA,IACA,GAAI,uDAAwD;AAAA,IAC5D;AAAA,MACC,MAAM;AAAA,MACN,SAAS;AAAA,QACR;AAAA,UACC,OAAO,GAA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A,IACR,SAAS,SAAS,QAAQ;AAAA,EAC3B;AACA,MAAK,SAAS,OAAO,QAAQ,QAAY;AACxC,UAAM,QAAQ,SAAS,MAAM;AAAA,EAC9B;AACA,MAAK,SAAS,SAAS,QAAQ,QAAY;AAC1C,UAAM,UAAU,SAAS,QAAQ;AAAA,EAClC;AACA,MAAK,SAAS,SAAS,QAAY;AAClC,UAAM,OAAO,SAAS;AAAA,EACvB;AAGA,WAAS,SAAU,KAAM;AAGzB,WAAS,qBAAsB,IAAK;AAGpC,QAAM,SAAS,SAAS;AAGxB,WAAS,SAAU,YAAa,EAAE;AAAA,IACjC;AAAA;AAAA,MAEC,GAAI,+BAAgC;AAAA,MACpC,SAAU,gBAAgB,EAAE,QAAQ,UAAU,SAAS,IAAK;AAAA,IAC7D;AAAA,IACA;AAAA,MACC,MAAM;AAAA,MACN,IAAI;AAAA,IACL;AAAA,EACD;AACD;AAUM,SAAS,WAAY,QAAQ,UAAU,EAAE,OAAO,MAAM,GAAI;AAChE,SAAO;AAAA,IACN,MAAM;AAAA,IACN;AAAA,IACA;AAAA,EACD;AACD;",
6
6
  "names": []
7
7
  }
@@ -199,9 +199,6 @@ function getStylesPath(state) {
199
199
  function getShowStylebook(state) {
200
200
  return state.showStylebook ?? false;
201
201
  }
202
- function getCanvasMinHeight(state) {
203
- return state.canvasMinHeight;
204
- }
205
202
  function isRevisionsMode(state) {
206
203
  return state.revisionId !== null;
207
204
  }
@@ -306,7 +303,6 @@ var getPreviousRevision = createRegistrySelector(
306
303
  }
307
304
  );
308
305
  export {
309
- getCanvasMinHeight,
310
306
  getCurrentRevision,
311
307
  getCurrentRevisionId,
312
308
  getDefaultRenderingMode,