@wordpress/editor 14.6.0 → 14.7.1-next.1f6eadc42.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 (421) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +41 -0
  3. package/build/bindings/post-meta.js +11 -8
  4. package/build/bindings/post-meta.js.map +1 -1
  5. package/build/components/block-manager/index.js +1 -0
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/block-settings-menu/content-only-settings-menu.js +5 -8
  8. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  9. package/build/components/document-bar/index.js +4 -4
  10. package/build/components/document-bar/index.js.map +1 -1
  11. package/build/components/editor/index.js +2 -2
  12. package/build/components/editor/index.js.map +1 -1
  13. package/build/components/editor-history/redo.js +1 -0
  14. package/build/components/editor-history/redo.js.map +1 -1
  15. package/build/components/editor-history/undo.js +1 -0
  16. package/build/components/editor-history/undo.js.map +1 -1
  17. package/build/components/editor-interface/index.js +2 -3
  18. package/build/components/editor-interface/index.js.map +1 -1
  19. package/build/components/error-boundary/index.js +1 -0
  20. package/build/components/error-boundary/index.js.map +1 -1
  21. package/build/components/global-styles-provider/index.js +3 -4
  22. package/build/components/global-styles-provider/index.js.map +1 -1
  23. package/build/components/header/index.js +6 -4
  24. package/build/components/header/index.js.map +1 -1
  25. package/build/components/index.js +8 -0
  26. package/build/components/index.js.map +1 -1
  27. package/build/components/inserter-sidebar/index.js +5 -10
  28. package/build/components/inserter-sidebar/index.js.map +1 -1
  29. package/build/components/local-autosave-monitor/index.js +5 -5
  30. package/build/components/local-autosave-monitor/index.js.map +1 -1
  31. package/build/components/page-attributes/parent.js +4 -1
  32. package/build/components/page-attributes/parent.js.map +1 -1
  33. package/build/components/plugin-preview-menu-item/index.js +57 -0
  34. package/build/components/plugin-preview-menu-item/index.js.map +1 -0
  35. package/build/components/post-actions/index.js +5 -8
  36. package/build/components/post-actions/index.js.map +1 -1
  37. package/build/components/post-excerpt/panel.js +1 -1
  38. package/build/components/post-excerpt/panel.js.map +1 -1
  39. package/build/components/post-featured-image/index.js +3 -0
  40. package/build/components/post-featured-image/index.js.map +1 -1
  41. package/build/components/post-format/index.js +1 -0
  42. package/build/components/post-format/index.js.map +1 -1
  43. package/build/components/post-last-revision/index.js +1 -0
  44. package/build/components/post-last-revision/index.js.map +1 -1
  45. package/build/components/post-locked-modal/index.js +6 -1
  46. package/build/components/post-locked-modal/index.js.map +1 -1
  47. package/build/components/post-publish-panel/index.js +1 -0
  48. package/build/components/post-publish-panel/index.js.map +1 -1
  49. package/build/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  50. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  51. package/build/components/post-publish-panel/maybe-upload-media.js +156 -33
  52. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  53. package/build/components/post-publish-panel/media-util.js +79 -0
  54. package/build/components/post-publish-panel/media-util.js.map +1 -0
  55. package/build/components/post-status/index.js +4 -2
  56. package/build/components/post-status/index.js.map +1 -1
  57. package/build/components/post-taxonomies/hierarchical-term-selector.js +4 -1
  58. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  59. package/build/components/post-taxonomies/most-used-terms.js +4 -1
  60. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  61. package/build/components/post-template/block-theme.js +13 -4
  62. package/build/components/post-template/block-theme.js.map +1 -1
  63. package/build/components/post-template/classic-theme.js +4 -1
  64. package/build/components/post-template/classic-theme.js.map +1 -1
  65. package/build/components/post-title/index.js +32 -46
  66. package/build/components/post-title/index.js.map +1 -1
  67. package/build/components/post-trash/check.js +2 -1
  68. package/build/components/post-trash/check.js.map +1 -1
  69. package/build/components/post-trash/index.js +22 -8
  70. package/build/components/post-trash/index.js.map +1 -1
  71. package/build/components/post-url/index.js +4 -1
  72. package/build/components/post-url/index.js.map +1 -1
  73. package/build/components/preferences-modal/index.js +28 -1
  74. package/build/components/preferences-modal/index.js.map +1 -1
  75. package/build/components/preview-dropdown/index.js +11 -51
  76. package/build/components/preview-dropdown/index.js.map +1 -1
  77. package/build/components/provider/index.js +34 -8
  78. package/build/components/provider/index.js.map +1 -1
  79. package/build/components/provider/use-block-editor-settings.js +14 -10
  80. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  81. package/build/components/save-publish-panels/index.js +8 -2
  82. package/build/components/save-publish-panels/index.js.map +1 -1
  83. package/build/components/sidebar/post-summary.js +3 -0
  84. package/build/components/sidebar/post-summary.js.map +1 -1
  85. package/build/components/start-page-options/index.js +16 -19
  86. package/build/components/start-page-options/index.js.map +1 -1
  87. package/build/components/start-template-options/index.js +1 -0
  88. package/build/components/start-template-options/index.js.map +1 -1
  89. package/build/components/table-of-contents/index.js +1 -0
  90. package/build/components/table-of-contents/index.js.map +1 -1
  91. package/build/components/text-editor/index.js +1 -0
  92. package/build/components/text-editor/index.js.map +1 -1
  93. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -1
  94. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  95. package/build/components/visual-editor/index.js +1 -6
  96. package/build/components/visual-editor/index.js.map +1 -1
  97. package/build/components/zoom-out-toggle/index.js +38 -0
  98. package/build/components/zoom-out-toggle/index.js.map +1 -0
  99. package/build/dataviews/actions/reset-post.js +2 -0
  100. package/build/dataviews/actions/reset-post.js.map +1 -1
  101. package/build/dataviews/actions/trash-post.js +2 -0
  102. package/build/dataviews/actions/trash-post.js.map +1 -1
  103. package/build/dataviews/store/private-actions.js +4 -10
  104. package/build/dataviews/store/private-actions.js.map +1 -1
  105. package/build/private-apis.js +0 -2
  106. package/build/private-apis.js.map +1 -1
  107. package/build/store/private-actions.js +1 -1
  108. package/build/store/private-actions.js.map +1 -1
  109. package/build/store/selectors.js +7 -3
  110. package/build/store/selectors.js.map +1 -1
  111. package/build-module/bindings/post-meta.js +11 -8
  112. package/build-module/bindings/post-meta.js.map +1 -1
  113. package/build-module/components/block-manager/index.js +1 -0
  114. package/build-module/components/block-manager/index.js.map +1 -1
  115. package/build-module/components/block-settings-menu/content-only-settings-menu.js +6 -9
  116. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  117. package/build-module/components/document-bar/index.js +4 -4
  118. package/build-module/components/document-bar/index.js.map +1 -1
  119. package/build-module/components/editor/index.js +2 -2
  120. package/build-module/components/editor/index.js.map +1 -1
  121. package/build-module/components/editor-history/redo.js +1 -0
  122. package/build-module/components/editor-history/redo.js.map +1 -1
  123. package/build-module/components/editor-history/undo.js +1 -0
  124. package/build-module/components/editor-history/undo.js.map +1 -1
  125. package/build-module/components/editor-interface/index.js +2 -3
  126. package/build-module/components/editor-interface/index.js.map +1 -1
  127. package/build-module/components/error-boundary/index.js +1 -0
  128. package/build-module/components/error-boundary/index.js.map +1 -1
  129. package/build-module/components/global-styles-provider/index.js +3 -4
  130. package/build-module/components/global-styles-provider/index.js.map +1 -1
  131. package/build-module/components/header/index.js +6 -4
  132. package/build-module/components/header/index.js.map +1 -1
  133. package/build-module/components/index.js +1 -0
  134. package/build-module/components/index.js.map +1 -1
  135. package/build-module/components/inserter-sidebar/index.js +5 -10
  136. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  137. package/build-module/components/local-autosave-monitor/index.js +5 -5
  138. package/build-module/components/local-autosave-monitor/index.js.map +1 -1
  139. package/build-module/components/page-attributes/parent.js +4 -1
  140. package/build-module/components/page-attributes/parent.js.map +1 -1
  141. package/build-module/components/plugin-preview-menu-item/index.js +52 -0
  142. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -0
  143. package/build-module/components/post-actions/index.js +5 -8
  144. package/build-module/components/post-actions/index.js.map +1 -1
  145. package/build-module/components/post-excerpt/panel.js +1 -1
  146. package/build-module/components/post-excerpt/panel.js.map +1 -1
  147. package/build-module/components/post-featured-image/index.js +3 -0
  148. package/build-module/components/post-featured-image/index.js.map +1 -1
  149. package/build-module/components/post-format/index.js +1 -0
  150. package/build-module/components/post-format/index.js.map +1 -1
  151. package/build-module/components/post-last-revision/index.js +1 -0
  152. package/build-module/components/post-last-revision/index.js.map +1 -1
  153. package/build-module/components/post-locked-modal/index.js +6 -1
  154. package/build-module/components/post-locked-modal/index.js.map +1 -1
  155. package/build-module/components/post-publish-panel/index.js +1 -0
  156. package/build-module/components/post-publish-panel/index.js.map +1 -1
  157. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  158. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  159. package/build-module/components/post-publish-panel/maybe-upload-media.js +155 -32
  160. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  161. package/build-module/components/post-publish-panel/media-util.js +72 -0
  162. package/build-module/components/post-publish-panel/media-util.js.map +1 -0
  163. package/build-module/components/post-status/index.js +4 -2
  164. package/build-module/components/post-status/index.js.map +1 -1
  165. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +4 -1
  166. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  167. package/build-module/components/post-taxonomies/most-used-terms.js +4 -1
  168. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  169. package/build-module/components/post-template/block-theme.js +13 -4
  170. package/build-module/components/post-template/block-theme.js.map +1 -1
  171. package/build-module/components/post-template/classic-theme.js +4 -1
  172. package/build-module/components/post-template/classic-theme.js.map +1 -1
  173. package/build-module/components/post-title/index.js +33 -47
  174. package/build-module/components/post-title/index.js.map +1 -1
  175. package/build-module/components/post-trash/check.js +2 -1
  176. package/build-module/components/post-trash/check.js.map +1 -1
  177. package/build-module/components/post-trash/index.js +23 -11
  178. package/build-module/components/post-trash/index.js.map +1 -1
  179. package/build-module/components/post-url/index.js +4 -1
  180. package/build-module/components/post-url/index.js.map +1 -1
  181. package/build-module/components/preferences-modal/index.js +28 -1
  182. package/build-module/components/preferences-modal/index.js.map +1 -1
  183. package/build-module/components/preview-dropdown/index.js +11 -51
  184. package/build-module/components/preview-dropdown/index.js.map +1 -1
  185. package/build-module/components/provider/index.js +35 -9
  186. package/build-module/components/provider/index.js.map +1 -1
  187. package/build-module/components/provider/use-block-editor-settings.js +15 -11
  188. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  189. package/build-module/components/save-publish-panels/index.js +8 -2
  190. package/build-module/components/save-publish-panels/index.js.map +1 -1
  191. package/build-module/components/sidebar/post-summary.js +3 -0
  192. package/build-module/components/sidebar/post-summary.js.map +1 -1
  193. package/build-module/components/start-page-options/index.js +17 -21
  194. package/build-module/components/start-page-options/index.js.map +1 -1
  195. package/build-module/components/start-template-options/index.js +1 -0
  196. package/build-module/components/start-template-options/index.js.map +1 -1
  197. package/build-module/components/table-of-contents/index.js +1 -0
  198. package/build-module/components/table-of-contents/index.js.map +1 -1
  199. package/build-module/components/text-editor/index.js +1 -0
  200. package/build-module/components/text-editor/index.js.map +1 -1
  201. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -1
  202. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  203. package/build-module/components/visual-editor/index.js +1 -6
  204. package/build-module/components/visual-editor/index.js.map +1 -1
  205. package/build-module/components/zoom-out-toggle/index.js +31 -0
  206. package/build-module/components/zoom-out-toggle/index.js.map +1 -0
  207. package/build-module/dataviews/actions/reset-post.js +2 -0
  208. package/build-module/dataviews/actions/reset-post.js.map +1 -1
  209. package/build-module/dataviews/actions/trash-post.js +2 -0
  210. package/build-module/dataviews/actions/trash-post.js.map +1 -1
  211. package/build-module/dataviews/store/private-actions.js +2 -8
  212. package/build-module/dataviews/store/private-actions.js.map +1 -1
  213. package/build-module/private-apis.js +0 -2
  214. package/build-module/private-apis.js.map +1 -1
  215. package/build-module/store/private-actions.js +1 -1
  216. package/build-module/store/private-actions.js.map +1 -1
  217. package/build-module/store/selectors.js +6 -2
  218. package/build-module/store/selectors.js.map +1 -1
  219. package/build-style/style-rtl.css +14 -13
  220. package/build-style/style.css +14 -13
  221. package/build-types/bindings/post-meta.d.ts +0 -3
  222. package/build-types/bindings/post-meta.d.ts.map +1 -1
  223. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -1
  224. package/build-types/components/editor-history/redo.d.ts.map +1 -1
  225. package/build-types/components/editor-history/undo.d.ts.map +1 -1
  226. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  227. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  228. package/build-types/components/header/back-button.d.ts.map +1 -1
  229. package/build-types/components/header/index.d.ts.map +1 -1
  230. package/build-types/components/index.d.ts +1 -0
  231. package/build-types/components/index.d.ts.map +1 -1
  232. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -1
  233. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  234. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  235. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  236. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  237. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  238. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  239. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  240. package/build-types/components/plugin-preview-menu-item/index.d.ts +3 -0
  241. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -0
  242. package/build-types/components/post-actions/index.d.ts.map +1 -1
  243. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  244. package/build-types/components/post-format/index.d.ts.map +1 -1
  245. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  246. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  247. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  248. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
  249. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +1 -1
  250. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  251. package/build-types/components/post-publish-panel/media-util.d.ts +20 -0
  252. package/build-types/components/post-publish-panel/media-util.d.ts.map +1 -0
  253. package/build-types/components/post-status/index.d.ts.map +1 -1
  254. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  255. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
  256. package/build-types/components/post-template/block-theme.d.ts.map +1 -1
  257. package/build-types/components/post-template/classic-theme.d.ts.map +1 -1
  258. package/build-types/components/post-trash/check.d.ts.map +1 -1
  259. package/build-types/components/post-trash/index.d.ts +4 -1
  260. package/build-types/components/post-trash/index.d.ts.map +1 -1
  261. package/build-types/components/post-url/index.d.ts.map +1 -1
  262. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  263. package/build-types/components/preferences-modal/index.d.ts.map +1 -1
  264. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  265. package/build-types/components/provider/index.d.ts.map +1 -1
  266. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -1
  267. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  268. package/build-types/components/sidebar/post-summary.d.ts.map +1 -1
  269. package/build-types/components/start-page-options/index.d.ts +1 -0
  270. package/build-types/components/start-page-options/index.d.ts.map +1 -1
  271. package/build-types/components/start-template-options/index.d.ts.map +1 -1
  272. package/build-types/components/text-editor/index.d.ts.map +1 -1
  273. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -1
  274. package/build-types/components/visual-editor/index.d.ts.map +1 -1
  275. package/build-types/components/zoom-out-toggle/index.d.ts +3 -0
  276. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -0
  277. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -1
  278. package/build-types/dataviews/actions/trash-post.d.ts.map +1 -1
  279. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  280. package/build-types/private-apis.d.ts.map +1 -1
  281. package/build-types/store/private-actions.d.ts.map +1 -1
  282. package/build-types/store/selectors.d.ts +8 -8
  283. package/build-types/store/selectors.d.ts.map +1 -1
  284. package/package.json +37 -36
  285. package/src/bindings/post-meta.js +12 -6
  286. package/src/components/block-manager/index.js +1 -0
  287. package/src/components/block-settings-menu/content-only-settings-menu.js +5 -9
  288. package/src/components/create-template-part-modal/style.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/editor/index.js +1 -1
  292. package/src/components/editor-history/redo.js +1 -0
  293. package/src/components/editor-history/undo.js +1 -0
  294. package/src/components/editor-interface/index.js +2 -4
  295. package/src/components/error-boundary/index.js +1 -1
  296. package/src/components/global-styles-provider/index.js +11 -7
  297. package/src/components/header/index.js +12 -3
  298. package/src/components/header/style.scss +6 -3
  299. package/src/components/index.js +1 -0
  300. package/src/components/inserter-sidebar/index.js +6 -8
  301. package/src/components/local-autosave-monitor/index.js +6 -6
  302. package/src/components/page-attributes/parent.js +5 -4
  303. package/src/components/plugin-preview-menu-item/index.js +52 -0
  304. package/src/components/post-actions/index.js +8 -14
  305. package/src/components/post-card-panel/style.scss +1 -1
  306. package/src/components/post-excerpt/panel.js +1 -1
  307. package/src/components/post-featured-image/index.js +3 -0
  308. package/src/components/post-featured-image/style.scss +2 -7
  309. package/src/components/post-format/index.js +1 -0
  310. package/src/components/post-last-revision/index.js +1 -0
  311. package/src/components/post-locked-modal/index.js +12 -2
  312. package/src/components/post-locked-modal/style.scss +1 -1
  313. package/src/components/post-publish-panel/index.js +1 -0
  314. package/src/components/post-publish-panel/maybe-post-format-panel.js +1 -0
  315. package/src/components/post-publish-panel/maybe-upload-media.js +144 -36
  316. package/src/components/post-publish-panel/media-util.js +87 -0
  317. package/src/components/post-publish-panel/style.scss +3 -1
  318. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  319. package/src/components/post-publish-panel/test/media-util.js +118 -0
  320. package/src/components/post-status/index.js +3 -2
  321. package/src/components/post-taxonomies/hierarchical-term-selector.js +2 -0
  322. package/src/components/post-taxonomies/most-used-terms.js +2 -0
  323. package/src/components/post-template/block-theme.js +15 -9
  324. package/src/components/post-template/classic-theme.js +2 -0
  325. package/src/components/post-title/index.js +30 -41
  326. package/src/components/post-trash/check.js +5 -2
  327. package/src/components/post-trash/index.js +23 -12
  328. package/src/components/post-url/index.js +2 -0
  329. package/src/components/preferences-modal/index.js +227 -172
  330. package/src/components/preview-dropdown/index.js +22 -72
  331. package/src/components/provider/index.js +42 -10
  332. package/src/components/provider/use-block-editor-settings.js +16 -11
  333. package/src/components/resizable-editor/style.scss +2 -2
  334. package/src/components/save-publish-panels/index.js +4 -0
  335. package/src/components/sidebar/post-summary.js +4 -0
  336. package/src/components/start-page-options/index.js +28 -26
  337. package/src/components/start-template-options/index.js +5 -1
  338. package/src/components/table-of-contents/index.js +1 -0
  339. package/src/components/text-editor/index.js +1 -0
  340. package/src/components/text-editor/style.scss +1 -1
  341. package/src/components/visual-editor/edit-template-blocks-notification.js +4 -1
  342. package/src/components/visual-editor/index.js +2 -9
  343. package/src/components/zoom-out-toggle/index.js +34 -0
  344. package/src/dataviews/actions/reset-post.tsx +2 -0
  345. package/src/dataviews/actions/trash-post.tsx +2 -0
  346. package/src/dataviews/store/private-actions.ts +10 -8
  347. package/src/private-apis.js +0 -2
  348. package/src/store/private-actions.js +3 -1
  349. package/src/store/selectors.js +9 -3
  350. package/tsconfig.json +2 -0
  351. package/tsconfig.tsbuildinfo +1 -1
  352. package/build/dataviews/actions/duplicate-pattern.js +0 -48
  353. package/build/dataviews/actions/duplicate-pattern.js.map +0 -1
  354. package/build/dataviews/actions/duplicate-post.js +0 -146
  355. package/build/dataviews/actions/duplicate-post.js.map +0 -1
  356. package/build/dataviews/actions/duplicate-post.native.js +0 -9
  357. package/build/dataviews/actions/duplicate-post.native.js.map +0 -1
  358. package/build/dataviews/actions/export-pattern.js +0 -55
  359. package/build/dataviews/actions/export-pattern.js.map +0 -1
  360. package/build/dataviews/actions/export-pattern.native.js +0 -9
  361. package/build/dataviews/actions/export-pattern.native.js.map +0 -1
  362. package/build/dataviews/actions/permanently-delete-post.js +0 -107
  363. package/build/dataviews/actions/permanently-delete-post.js.map +0 -1
  364. package/build/dataviews/actions/reorder-page.js +0 -116
  365. package/build/dataviews/actions/reorder-page.js.map +0 -1
  366. package/build/dataviews/actions/reorder-page.native.js +0 -9
  367. package/build/dataviews/actions/reorder-page.native.js.map +0 -1
  368. package/build/dataviews/actions/view-post-revisions.js +0 -49
  369. package/build/dataviews/actions/view-post-revisions.js.map +0 -1
  370. package/build/dataviews/actions/view-post.js +0 -36
  371. package/build/dataviews/actions/view-post.js.map +0 -1
  372. package/build-module/dataviews/actions/duplicate-pattern.js +0 -39
  373. package/build-module/dataviews/actions/duplicate-pattern.js.map +0 -1
  374. package/build-module/dataviews/actions/duplicate-post.js +0 -139
  375. package/build-module/dataviews/actions/duplicate-post.js.map +0 -1
  376. package/build-module/dataviews/actions/duplicate-post.native.js +0 -3
  377. package/build-module/dataviews/actions/duplicate-post.native.js.map +0 -1
  378. package/build-module/dataviews/actions/export-pattern.js +0 -49
  379. package/build-module/dataviews/actions/export-pattern.js.map +0 -1
  380. package/build-module/dataviews/actions/export-pattern.native.js +0 -3
  381. package/build-module/dataviews/actions/export-pattern.native.js.map +0 -1
  382. package/build-module/dataviews/actions/permanently-delete-post.js +0 -99
  383. package/build-module/dataviews/actions/permanently-delete-post.js.map +0 -1
  384. package/build-module/dataviews/actions/reorder-page.js +0 -111
  385. package/build-module/dataviews/actions/reorder-page.js.map +0 -1
  386. package/build-module/dataviews/actions/reorder-page.native.js +0 -3
  387. package/build-module/dataviews/actions/reorder-page.native.js.map +0 -1
  388. package/build-module/dataviews/actions/view-post-revisions.js +0 -43
  389. package/build-module/dataviews/actions/view-post-revisions.js.map +0 -1
  390. package/build-module/dataviews/actions/view-post.js +0 -30
  391. package/build-module/dataviews/actions/view-post.js.map +0 -1
  392. package/build-types/dataviews/actions/duplicate-pattern.d.ts +0 -5
  393. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +0 -1
  394. package/build-types/dataviews/actions/duplicate-post.d.ts +0 -5
  395. package/build-types/dataviews/actions/duplicate-post.d.ts.map +0 -1
  396. package/build-types/dataviews/actions/duplicate-post.native.d.ts +0 -3
  397. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +0 -1
  398. package/build-types/dataviews/actions/export-pattern.d.ts +0 -8
  399. package/build-types/dataviews/actions/export-pattern.d.ts.map +0 -1
  400. package/build-types/dataviews/actions/export-pattern.native.d.ts +0 -3
  401. package/build-types/dataviews/actions/export-pattern.native.d.ts.map +0 -1
  402. package/build-types/dataviews/actions/permanently-delete-post.d.ts +0 -5
  403. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +0 -1
  404. package/build-types/dataviews/actions/reorder-page.d.ts +0 -8
  405. package/build-types/dataviews/actions/reorder-page.d.ts.map +0 -1
  406. package/build-types/dataviews/actions/reorder-page.native.d.ts +0 -3
  407. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +0 -1
  408. package/build-types/dataviews/actions/view-post-revisions.d.ts +0 -8
  409. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +0 -1
  410. package/build-types/dataviews/actions/view-post.d.ts +0 -8
  411. package/build-types/dataviews/actions/view-post.d.ts.map +0 -1
  412. package/src/dataviews/actions/duplicate-pattern.tsx +0 -40
  413. package/src/dataviews/actions/duplicate-post.native.tsx +0 -3
  414. package/src/dataviews/actions/duplicate-post.tsx +0 -174
  415. package/src/dataviews/actions/export-pattern.native.tsx +0 -3
  416. package/src/dataviews/actions/export-pattern.tsx +0 -74
  417. package/src/dataviews/actions/permanently-delete-post.tsx +0 -116
  418. package/src/dataviews/actions/reorder-page.native.tsx +0 -3
  419. package/src/dataviews/actions/reorder-page.tsx +0 -125
  420. package/src/dataviews/actions/view-post-revisions.tsx +0 -47
  421. package/src/dataviews/actions/view-post.tsx +0 -30
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 14.7.0 (2024-09-05)
6
+
5
7
  ## 14.6.0 (2024-08-21)
6
8
 
7
9
  ## 14.5.0 (2024-08-07)
package/README.md CHANGED
@@ -862,6 +862,43 @@ _Returns_
862
862
 
863
863
  - `Component`: The component to be rendered.
864
864
 
865
+ ### PluginPreviewMenuItem
866
+
867
+ Renders a menu item in the Preview dropdown, which can be used as a button or link depending on the props provided. The text within the component appears as the menu item label.
868
+
869
+ _Usage_
870
+
871
+ ```jsx
872
+ import { __ } from '@wordpress/i18n';
873
+ import { PluginPreviewMenuItem } from '@wordpress/editor';
874
+ import { external } from '@wordpress/icons';
875
+
876
+ function onPreviewClick() {
877
+ // Handle preview action
878
+ }
879
+
880
+ const ExternalPreviewMenuItem = () => (
881
+ <PreviewDropdownMenuItem icon={ external } onClick={ onPreviewClick }>
882
+ { __( 'Preview in new tab' ) }
883
+ </PreviewDropdownMenuItem>
884
+ );
885
+ registerPlugin( 'external-preview-menu-item', {
886
+ render: ExternalPreviewMenuItem,
887
+ } );
888
+ ```
889
+
890
+ _Parameters_
891
+
892
+ - _props_ `Object`: Component properties.
893
+ - _props.href_ `[string]`: When `href` is provided, the menu item is rendered as an anchor instead of a button. It corresponds to the `href` attribute of the anchor.
894
+ - _props.icon_ `[WPBlockTypeIconRender]`: The icon to be rendered to the left of the menu item label. Can be a Dashicon slug or an SVG WP element.
895
+ - _props.onClick_ `[Function]`: The callback function to be executed when the user clicks the menu item.
896
+ - _props.other_ `[...*]`: Any additional props are passed through to the underlying MenuItem component.
897
+
898
+ _Returns_
899
+
900
+ - `Component`: The rendered menu item component.
901
+
865
902
  ### PluginSidebar
866
903
 
867
904
  Renders a sidebar when activated. The contents within the `PluginSidebar` will appear as content within the sidebar. It also automatically renders a corresponding `PluginSidebarMenuItem` component when `isPinnable` flag is set to `true`. If you wish to display the sidebar, you can with use the `PluginSidebarMoreMenuItem` component or the `wp.data.dispatch` API:
@@ -1434,6 +1471,10 @@ Undocumented declaration.
1434
1471
 
1435
1472
  Displays the Post Trash Button and Confirm Dialog in the Editor.
1436
1473
 
1474
+ _Parameters_
1475
+
1476
+ - _An_ `?{onActionPerformed: Object}`: object containing the onActionPerformed function.
1477
+
1437
1478
  _Returns_
1438
1479
 
1439
1480
  - `JSX.Element|null`: The rendered PostTrash component.
@@ -14,11 +14,6 @@ var _store = require("../store");
14
14
  */
15
15
  var _default = exports.default = {
16
16
  name: 'core/post-meta',
17
- getPlaceholder({
18
- args
19
- }) {
20
- return args.key;
21
- },
22
17
  getValues({
23
18
  registry,
24
19
  context,
@@ -27,7 +22,9 @@ var _default = exports.default = {
27
22
  const meta = registry.select(_coreData.store).getEditedEntityRecord('postType', context?.postType, context?.postId)?.meta;
28
23
  const newValues = {};
29
24
  for (const [attributeName, source] of Object.entries(bindings)) {
30
- newValues[attributeName] = meta?.[source.args.key];
25
+ var _meta$source$args$key;
26
+ // Use the key if the value is not set.
27
+ newValues[attributeName] = (_meta$source$args$key = meta?.[source.args.key]) !== null && _meta$source$args$key !== void 0 ? _meta$source$args$key : source.args.key;
31
28
  }
32
29
  return newValues;
33
30
  },
@@ -64,8 +61,14 @@ var _default = exports.default = {
64
61
  }
65
62
 
66
63
  // Check that the custom field is not protected and available in the REST API.
67
- const isFieldExposed = !!select(_coreData.store).getEntityRecord('postType', postType, context?.postId)?.meta?.[args.key];
68
- if (!isFieldExposed) {
64
+ // Empty string or `false` could be a valid value, so we need to check if the field value is undefined.
65
+ const fieldValue = select(_coreData.store).getEntityRecord('postType', postType, context?.postId)?.meta?.[args.key];
66
+ if (fieldValue === undefined) {
67
+ return false;
68
+ }
69
+ // Check that custom fields metabox is not enabled.
70
+ const areCustomFieldsEnabled = select(_store.store).getEditorSettings().enableCustomFields;
71
+ if (areCustomFieldsEnabled) {
69
72
  return false;
70
73
  }
71
74
 
@@ -1 +1 @@
1
- {"version":3,"names":["_coreData","require","_store","_default","exports","default","name","getPlaceholder","args","key","getValues","registry","context","bindings","meta","select","coreDataStore","getEditedEntityRecord","postType","postId","newValues","attributeName","source","Object","entries","setValues","newMeta","values","forEach","newValue","dispatch","editEntityRecord","canUserEditValue","query","queryId","editorStore","getCurrentPostType","isFieldExposed","getEntityRecord","canUserEdit","canUser","kind","id","getFieldsList","metaFields","keys","length","fromEntries","filter","charAt"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\nexport default {\n\tname: 'core/post-meta',\n\tgetPlaceholder( { args } ) {\n\t\treturn args.key;\n\t},\n\tgetValues( { registry, context, bindings } ) {\n\t\tconst meta = registry\n\t\t\t.select( coreDataStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tcontext?.postType,\n\t\t\t\tcontext?.postId\n\t\t\t)?.meta;\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, source ] of Object.entries( bindings ) ) {\n\t\t\tnewValues[ attributeName ] = meta?.[ source.args.key ];\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { registry, context, bindings } ) {\n\t\tconst newMeta = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewMeta[ args.key ] = newValue;\n\t\t} );\n\t\tregistry\n\t\t\t.dispatch( coreDataStore )\n\t\t\t.editEntityRecord( 'postType', context?.postType, context?.postId, {\n\t\t\t\tmeta: newMeta,\n\t\t\t} );\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst postType =\n\t\t\tcontext?.postType || select( editorStore ).getCurrentPostType();\n\n\t\t// Check that editing is happening in the post editor and not a template.\n\t\tif ( postType === 'wp_template' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the custom field is not protected and available in the REST API.\n\t\tconst isFieldExposed = !! select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tcontext?.postId\n\t\t)?.meta?.[ args.key ];\n\n\t\tif ( ! isFieldExposed ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { registry, context } ) {\n\t\tconst metaFields = registry\n\t\t\t.select( coreDataStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tcontext?.postType,\n\t\t\t\tcontext?.postId\n\t\t\t).meta;\n\n\t\tif ( ! metaFields || ! Object.keys( metaFields ).length ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Remove footnotes or private keys from the list of fields.\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries( metaFields ).filter(\n\t\t\t\t( [ key ] ) => key !== 'footnotes' && key.charAt( 0 ) !== '_'\n\t\t\t)\n\t\t);\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;AAGA;AACA;AACA;AAFA,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACdC,IAAI,EAAE,gBAAgB;EACtBC,cAAcA,CAAE;IAAEC;EAAK,CAAC,EAAG;IAC1B,OAAOA,IAAI,CAACC,GAAG;EAChB,CAAC;EACDC,SAASA,CAAE;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAS,CAAC,EAAG;IAC5C,MAAMC,IAAI,GAAGH,QAAQ,CACnBI,MAAM,CAAEC,eAAc,CAAC,CACvBC,qBAAqB,CACrB,UAAU,EACVL,OAAO,EAAEM,QAAQ,EACjBN,OAAO,EAAEO,MACV,CAAC,EAAEL,IAAI;IACR,MAAMM,SAAS,GAAG,CAAC,CAAC;IACpB,KAAM,MAAM,CAAEC,aAAa,EAAEC,MAAM,C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AAG;MACvB,OAAO,KAAK;IACb;;IAEA;IACA,MAAME,WAAW,GAAGxB,MAAM,CAAEC,eAAc,CAAC,CAACwB,OAAO,CAAE,QAAQ,EAAE;MAC9DC,IAAI,EAAE,UAAU;MAChBnC,IAAI,EAAEM,OAAO,EAAEM,QAAQ;MACvBwB,EAAE,EAAE9B,OAAO,EAAEO;IACd,CAAE,CAAC;IACH,IAAK,CAAEoB,WAAW,EAAG;MACpB,OAAO,KAAK;IACb;IAEA,OAAO,IAAI;EACZ,CAAC;EACDI,aAAaA,CAAE;IAAEhC,QAAQ;IAAEC;EAAQ,CAAC,EAAG;IACtC,MAAMgC,UAAU,GAAGjC,QAAQ,CACzBI,MAAM,CAAEC,eAAc,CAAC,CACvBC,qBAAqB,CACrB,UAAU,EACVL,OAAO,EAAEM,QAAQ,EACjBN,OAAO,EAAEO,MACV,CAAC,CAACL,IAAI;IAEP,IAAK,CAAE8B,UAAU,IAAI,CAAErB,MAAM,CAACsB,IAAI,CAAED,UAAW,CAAC,CAACE,MAAM,EAAG;MACzD,OAAO,IAAI;IACZ;;IAEA;IACA,OAAOvB,MAAM,CAACwB,WAAW,CACxBxB,MAAM,CAACC,OAAO,CAAEoB,UAAW,CAAC,CAACI,MAAM,CAClC,CAAE,CAAEvC,GAAG,CAAE,KAAMA,GAAG,KAAK,WAAW,IAAIA,GAAG,CAACwC,MAAM,CAAE,CAAE,CAAC,KAAK,GAC3D,CACD,CAAC;EACF;AACD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_coreData","require","_store","_default","exports","default","name","getValues","registry","context","bindings","meta","select","coreDataStore","getEditedEntityRecord","postType","postId","newValues","attributeName","source","Object","entries","_meta$source$args$key","args","key","setValues","newMeta","values","forEach","newValue","dispatch","editEntityRecord","canUserEditValue","query","queryId","editorStore","getCurrentPostType","fieldValue","getEntityRecord","undefined","areCustomFieldsEnabled","getEditorSettings","enableCustomFields","canUserEdit","canUser","kind","id","getFieldsList","metaFields","keys","length","fromEntries","filter","charAt"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\nexport default {\n\tname: 'core/post-meta',\n\tgetValues( { registry, context, bindings } ) {\n\t\tconst meta = registry\n\t\t\t.select( coreDataStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tcontext?.postType,\n\t\t\t\tcontext?.postId\n\t\t\t)?.meta;\n\t\tconst newValues = {};\n\t\tfor ( const [ attributeName, source ] of Object.entries( bindings ) ) {\n\t\t\t// Use the key if the value is not set.\n\t\t\tnewValues[ attributeName ] =\n\t\t\t\tmeta?.[ source.args.key ] ?? source.args.key;\n\t\t}\n\t\treturn newValues;\n\t},\n\tsetValues( { registry, context, bindings } ) {\n\t\tconst newMeta = {};\n\t\tObject.values( bindings ).forEach( ( { args, newValue } ) => {\n\t\t\tnewMeta[ args.key ] = newValue;\n\t\t} );\n\t\tregistry\n\t\t\t.dispatch( coreDataStore )\n\t\t\t.editEntityRecord( 'postType', context?.postType, context?.postId, {\n\t\t\t\tmeta: newMeta,\n\t\t\t} );\n\t},\n\tcanUserEditValue( { select, context, args } ) {\n\t\t// Lock editing in query loop.\n\t\tif ( context?.query || context?.queryId ) {\n\t\t\treturn false;\n\t\t}\n\n\t\tconst postType =\n\t\t\tcontext?.postType || select( editorStore ).getCurrentPostType();\n\n\t\t// Check that editing is happening in the post editor and not a template.\n\t\tif ( postType === 'wp_template' ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the custom field is not protected and available in the REST API.\n\t\t// Empty string or `false` could be a valid value, so we need to check if the field value is undefined.\n\t\tconst fieldValue = select( coreDataStore ).getEntityRecord(\n\t\t\t'postType',\n\t\t\tpostType,\n\t\t\tcontext?.postId\n\t\t)?.meta?.[ args.key ];\n\n\t\tif ( fieldValue === undefined ) {\n\t\t\treturn false;\n\t\t}\n\t\t// Check that custom fields metabox is not enabled.\n\t\tconst areCustomFieldsEnabled =\n\t\t\tselect( editorStore ).getEditorSettings().enableCustomFields;\n\t\tif ( areCustomFieldsEnabled ) {\n\t\t\treturn false;\n\t\t}\n\n\t\t// Check that the user has the capability to edit post meta.\n\t\tconst canUserEdit = select( coreDataStore ).canUser( 'update', {\n\t\t\tkind: 'postType',\n\t\t\tname: context?.postType,\n\t\t\tid: context?.postId,\n\t\t} );\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n\tgetFieldsList( { registry, context } ) {\n\t\tconst metaFields = registry\n\t\t\t.select( coreDataStore )\n\t\t\t.getEditedEntityRecord(\n\t\t\t\t'postType',\n\t\t\t\tcontext?.postType,\n\t\t\t\tcontext?.postId\n\t\t\t).meta;\n\n\t\tif ( ! metaFields || ! Object.keys( metaFields ).length ) {\n\t\t\treturn null;\n\t\t}\n\n\t\t// Remove footnotes or private keys from the list of fields.\n\t\treturn Object.fromEntries(\n\t\t\tObject.entries( metaFields ).filter(\n\t\t\t\t( [ key ] ) => key !== 'footnotes' && key.charAt( 0 ) !== '_'\n\t\t\t)\n\t\t);\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AAKA,IAAAC,MAAA,GAAAD,OAAA;AARA;AACA;AACA;AAGA;AACA;AACA;AAFA,IAAAE,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAKe;EACdC,IAAI,EAAE,gBAAgB;EACtBC,SAASA,CAAE;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAS,CAAC,EAAG;IAC5C,MAAMC,IAAI,GAAGH,QAAQ,CACnBI,MAAM,CAAEC,eAAc,CAAC,CACvBC,qBAAqB,CACrB,UAAU,EACVL,OAAO,EAAEM,QAAQ,EACjBN,OAAO,EAAEO,MACV,CAAC,EAAEL,IAAI;IACR,MAAMM,SAAS,GAAG,CAAC,CAAC;IACpB,KAAM,MAAM,CAAEC,a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 function BlockManager({
57
57
  className: "editor-block-manager__disabled-blocks-count",
58
58
  children: [(0, _i18n.sprintf)( /* translators: %d: number of blocks. */
59
59
  (0, _i18n._n)('%d block is hidden.', '%d blocks are hidden.', numberOfHiddenBlocks), numberOfHiddenBlocks), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
60
+ __next40pxDefaultSize: true,
60
61
  variant: "link",
61
62
  onClick: () => enableAllBlockTypes(blockTypes),
62
63
  children: (0, _i18n.__)('Reset')
@@ -1 +1 @@
1
- {"version":3,"names":["_blocks","require","_data","_components","_i18n","_element","_compose","_a11y","_preferences","_lockUnlock","_store","_category","_interopRequireDefault","_jsxRuntime","BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","enableAllBlockTypes","debouncedSpeak","useDebounce","speak","search","setSearch","useState","filter","blockType","parent","includes","useEffect","count","length","resultsFoundMessage","sprintf","_n","jsxs","className","children","jsx","Button","variant","onClick","__","SearchControl","__nextHasNoMarginBottom","label","placeholder","value","onChange","nextSearch","tabIndex","role","map","category","default","title","slug","_default","exports","compose","withSelect","select","_get","getBlockTypes","getCategories","blocksStore","get","preferencesStore","hiddenBlockTypes","hiddenBlock","some","registeredBlock","name","Array","isArray","withDispatch","dispatch","showBlockTypes","unlock","editorStore","blockNames"],"sources":["@wordpress/editor/src/components/block-manager/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { SearchControl, Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce, compose } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport BlockManagerCategory from './category';\n\nfunction BlockManager( {\n\tblockTypes,\n\tcategories,\n\thasBlockSupport,\n\tisMatchingSearchTerm,\n\tnumberOfHiddenBlocks,\n\tenableAllBlockTypes,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ search, setSearch ] = useState( '' );\n\n\t// Filtering occurs here (as opposed to `withSelect`) to avoid\n\t// wasted renders by consequence of `Array#filter` producing\n\t// a new value reference on each call.\n\tblockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tblockType.parent.includes( 'core/post-content' ) )\n\t);\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! search ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = blockTypes.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ blockTypes.length, search, debouncedSpeak ] );\n\n\treturn (\n\t\t<div className=\"editor-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"editor-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => enableAllBlockTypes( blockTypes ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"editor-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"editor-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ blockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"editor-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\t\t\tblockType.category === category.slug\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockTypes,\n\t\t\tgetCategories,\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t} = select( blocksStore );\n\t\tconst { get } = select( preferencesStore );\n\n\t\t// Some hidden blocks become unregistered\n\t\t// by removing for instance the plugin that registered them, yet\n\t\t// they're still remain as hidden by the user's action.\n\t\t// We consider \"hidden\", blocks which were hidden and\n\t\t// are still registered.\n\t\tconst blockTypes = getBlockTypes();\n\t\tconst hiddenBlockTypes = (\n\t\t\tget( 'core', 'hiddenBlockTypes' ) ?? []\n\t\t).filter( ( hiddenBlock ) => {\n\t\t\treturn blockTypes.some(\n\t\t\t\t( registeredBlock ) => registeredBlock.name === hiddenBlock\n\t\t\t);\n\t\t} );\n\t\tconst numberOfHiddenBlocks =\n\t\t\tArray.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;\n\n\t\treturn {\n\t\t\tblockTypes,\n\t\t\tcategories: getCategories(),\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t\tnumberOfHiddenBlocks,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { showBlockTypes } = unlock( dispatch( editorStore ) );\n\t\treturn {\n\t\t\tenableAllBlockTypes: ( blockTypes ) => {\n\t\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t},\n\t\t};\n\t} ),\n] )( BlockManager );\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAC,sBAAA,CAAAX,OAAA;AAA8C,IAAAY,WAAA,GAAAZ,OAAA;AAjB9C;AACA;AACA;;AAUA;AACA;AACA;;AAKA,SAASa,YAAYA,CAAE;EACtBC,UAAU;EACVC,UAAU;EACVC,eAAe;EACfC,oBAAoB;EACpBC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAA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AC,KAAMA,IAAK,CAAC;MACzDK,cAAc,CAAEG,UAAW,CAAC;IAC7B;EACD,CAAC;AACF,CAAE,CAAC,CACF,CAAC,CAAEpE,YAAa,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_blocks","require","_data","_components","_i18n","_element","_compose","_a11y","_preferences","_lockUnlock","_store","_category","_interopRequireDefault","_jsxRuntime","BlockManager","blockTypes","categories","hasBlockSupport","isMatchingSearchTerm","numberOfHiddenBlocks","enableAllBlockTypes","debouncedSpeak","useDebounce","speak","search","setSearch","useState","filter","blockType","parent","includes","useEffect","count","length","resultsFoundMessage","sprintf","_n","jsxs","className","children","jsx","Button","__next40pxDefaultSize","variant","onClick","__","SearchControl","__nextHasNoMarginBottom","label","placeholder","value","onChange","nextSearch","tabIndex","role","map","category","default","title","slug","_default","exports","compose","withSelect","select","_get","getBlockTypes","getCategories","blocksStore","get","preferencesStore","hiddenBlockTypes","hiddenBlock","some","registeredBlock","name","Array","isArray","withDispatch","dispatch","showBlockTypes","unlock","editorStore","blockNames"],"sources":["@wordpress/editor/src/components/block-manager/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blocksStore } from '@wordpress/blocks';\nimport { withSelect, withDispatch } from '@wordpress/data';\nimport { SearchControl, Button } from '@wordpress/components';\nimport { __, _n, sprintf } from '@wordpress/i18n';\nimport { useEffect, useState } from '@wordpress/element';\nimport { useDebounce, compose } from '@wordpress/compose';\nimport { speak } from '@wordpress/a11y';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport BlockManagerCategory from './category';\n\nfunction BlockManager( {\n\tblockTypes,\n\tcategories,\n\thasBlockSupport,\n\tisMatchingSearchTerm,\n\tnumberOfHiddenBlocks,\n\tenableAllBlockTypes,\n} ) {\n\tconst debouncedSpeak = useDebounce( speak, 500 );\n\tconst [ search, setSearch ] = useState( '' );\n\n\t// Filtering occurs here (as opposed to `withSelect`) to avoid\n\t// wasted renders by consequence of `Array#filter` producing\n\t// a new value reference on each call.\n\tblockTypes = blockTypes.filter(\n\t\t( blockType ) =>\n\t\t\thasBlockSupport( blockType, 'inserter', true ) &&\n\t\t\t( ! search || isMatchingSearchTerm( blockType, search ) ) &&\n\t\t\t( ! blockType.parent ||\n\t\t\t\tblockType.parent.includes( 'core/post-content' ) )\n\t);\n\n\t// Announce search results on change\n\tuseEffect( () => {\n\t\tif ( ! search ) {\n\t\t\treturn;\n\t\t}\n\t\tconst count = blockTypes.length;\n\t\tconst resultsFoundMessage = sprintf(\n\t\t\t/* translators: %d: number of results. */\n\t\t\t_n( '%d result found.', '%d results found.', count ),\n\t\t\tcount\n\t\t);\n\t\tdebouncedSpeak( resultsFoundMessage );\n\t}, [ blockTypes.length, search, debouncedSpeak ] );\n\n\treturn (\n\t\t<div className=\"editor-block-manager__content\">\n\t\t\t{ !! numberOfHiddenBlocks && (\n\t\t\t\t<div className=\"editor-block-manager__disabled-blocks-count\">\n\t\t\t\t\t{ sprintf(\n\t\t\t\t\t\t/* translators: %d: number of blocks. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'%d block is hidden.',\n\t\t\t\t\t\t\t'%d blocks are hidden.',\n\t\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t\t),\n\t\t\t\t\t\tnumberOfHiddenBlocks\n\t\t\t\t\t) }\n\t\t\t\t\t<Button\n\t\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t\tvariant=\"link\"\n\t\t\t\t\t\tonClick={ () => enableAllBlockTypes( blockTypes ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\t\t\t) }\n\t\t\t<SearchControl\n\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\tlabel={ __( 'Search for a block' ) }\n\t\t\t\tplaceholder={ __( 'Search for a block' ) }\n\t\t\t\tvalue={ search }\n\t\t\t\tonChange={ ( nextSearch ) => setSearch( nextSearch ) }\n\t\t\t\tclassName=\"editor-block-manager__search\"\n\t\t\t/>\n\t\t\t<div\n\t\t\t\ttabIndex=\"0\"\n\t\t\t\trole=\"region\"\n\t\t\t\taria-label={ __( 'Available block types' ) }\n\t\t\t\tclassName=\"editor-block-manager__results\"\n\t\t\t>\n\t\t\t\t{ blockTypes.length === 0 && (\n\t\t\t\t\t<p className=\"editor-block-manager__no-results\">\n\t\t\t\t\t\t{ __( 'No blocks found.' ) }\n\t\t\t\t\t</p>\n\t\t\t\t) }\n\t\t\t\t{ categories.map( ( category ) => (\n\t\t\t\t\t<BlockManagerCategory\n\t\t\t\t\t\tkey={ category.slug }\n\t\t\t\t\t\ttitle={ category.title }\n\t\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t\t( blockType ) =>\n\t\t\t\t\t\t\t\tblockType.category === category.slug\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t) ) }\n\t\t\t\t<BlockManagerCategory\n\t\t\t\t\ttitle={ __( 'Uncategorized' ) }\n\t\t\t\t\tblockTypes={ blockTypes.filter(\n\t\t\t\t\t\t( { category } ) => ! category\n\t\t\t\t\t) }\n\t\t\t\t/>\n\t\t\t</div>\n\t\t</div>\n\t);\n}\n\nexport default compose( [\n\twithSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetBlockTypes,\n\t\t\tgetCategories,\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t} = select( blocksStore );\n\t\tconst { get } = select( preferencesStore );\n\n\t\t// Some hidden blocks become unregistered\n\t\t// by removing for instance the plugin that registered them, yet\n\t\t// they're still remain as hidden by the user's action.\n\t\t// We consider \"hidden\", blocks which were hidden and\n\t\t// are still registered.\n\t\tconst blockTypes = getBlockTypes();\n\t\tconst hiddenBlockTypes = (\n\t\t\tget( 'core', 'hiddenBlockTypes' ) ?? []\n\t\t).filter( ( hiddenBlock ) => {\n\t\t\treturn blockTypes.some(\n\t\t\t\t( registeredBlock ) => registeredBlock.name === hiddenBlock\n\t\t\t);\n\t\t} );\n\t\tconst numberOfHiddenBlocks =\n\t\t\tArray.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;\n\n\t\treturn {\n\t\t\tblockTypes,\n\t\t\tcategories: getCategories(),\n\t\t\thasBlockSupport,\n\t\t\tisMatchingSearchTerm,\n\t\t\tnumberOfHiddenBlocks,\n\t\t};\n\t} ),\n\twithDispatch( ( dispatch ) => {\n\t\tconst { showBlockTypes } = unlock( dispatch( editorStore ) );\n\t\treturn {\n\t\t\tenableAllBlockTypes: ( blockTypes ) => {\n\t\t\t\tconst blockNames = blockTypes.map( ( { name } ) => name );\n\t\t\t\tshowBlockTypes( blockNames );\n\t\t\t},\n\t\t};\n\t} ),\n] )( BlockManager );\n"],"mappings":";;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,QAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,WAAA,GAAAR,OAAA;AACA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,SAAA,GAAAC,sBAAA,CAAAX,OAAA;AAA8C,IAAAY,WAAA,GAAAZ,OAAA;AAjB9C;AACA;AACA;;AAUA;AACA;AACA;;AAKA,SAASa,YAAYA,CAAE;EACtBC,UAAU;EACVC,UAAU;EACVC,eAAe;EACfC,oBAAoB;EACpBC,oBAAoB;EACpBC;AACD,CAAC,EAAG;EACH,MAAMC,cAAc,GAAG,IAAAC,oBAAW,EAAEC,WAAK,EAAE,GAAI,CAAC;EAChD,MAAM,CAAEC,MAAM,EAAEC,SAAS,CAAE,GAAG,IAAAC,iBAAQ,EAAE,EAAG,CA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":[]}
@@ -111,24 +111,21 @@ function TemplateLockContentOnlyMenuItems({
111
111
  };
112
112
  }, [clientId]);
113
113
  const blockDisplayInformation = (0, _blockEditor.useBlockDisplayInformation)(contentLockingParent);
114
- // Disable reason: We're using a hook here so it has to be on top-level.
115
- // eslint-disable-next-line @wordpress/no-unused-vars-before-return
116
- const {
117
- modifyContentLockBlock,
118
- selectBlock
119
- } = (0, _lockUnlock.unlock)((0, _data.useDispatch)(_blockEditor.store));
114
+ const blockEditorActions = (0, _data.useDispatch)(_blockEditor.store);
120
115
  if (!blockDisplayInformation?.title) {
121
116
  return null;
122
117
  }
118
+ const {
119
+ modifyContentLockBlock
120
+ } = (0, _lockUnlock.unlock)(blockEditorActions);
123
121
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
124
122
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__unstableBlockSettingsMenuFirstItem, {
125
123
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
126
124
  onClick: () => {
127
- selectBlock(contentLockingParent);
128
125
  modifyContentLockBlock(contentLockingParent);
129
126
  onClose();
130
127
  },
131
- children: (0, _i18n.__)('Unlock')
128
+ children: (0, _i18n._x)('Unlock', 'Unlock content locked blocks')
132
129
  })
133
130
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
134
131
  variant: "muted",
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_coreData","_components","_data","_i18n","_store","_lockUnlock","_jsxRuntime","ContentOnlySettingsMenuItems","clientId","onClose","entity","onNavigateToEntityRecord","canEditTemplates","useSelect","select","getBlockEditingMode","getBlockParentsByBlockName","getSettings","getBlockAttributes","blockEditorStore","contentOnly","patternParent","record","coreStore","getEntityRecord","ref","getCurrentTemplateId","editorStore","templateId","getContentLockingParent","unlock","_canEditTemplates","canUser","kind","name","jsx","TemplateLockContentOnlyMenuItems","isPattern","type","helpText","__","jsxs","Fragment","children","__unstableBlockSettingsMenuFirstItem","MenuItem","onClick","postId","id","postType","disabled","__experimentalText","variant","as","className","contentLockingParent","blockDisplayInformation","useBlockDisplayInformation","modifyContentLockBlock","selectBlock","useDispatch","title","ContentOnlySettingsMenu","BlockSettingsMenuControls","selectedClientIds","length"],"sources":["@wordpress/editor/src/components/block-settings-menu/content-only-settings-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockSettingsMenuControls,\n\t__unstableBlockSettingsMenuFirstItem as BlockSettingsMenuFirstItem,\n\tstore as blockEditorStore,\n\tuseBlockDisplayInformation,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalText as Text, MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction ContentOnlySettingsMenuItems( { clientId, onClose } ) {\n\tconst { entity, onNavigateToEntityRecord, canEditTemplates } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockAttributes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst contentOnly =\n\t\t\t\tgetBlockEditingMode( clientId ) === 'contentOnly';\n\t\t\tif ( ! contentOnly ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst patternParent = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/block',\n\t\t\t\ttrue\n\t\t\t)[ 0 ];\n\n\t\t\tlet record;\n\t\t\tif ( patternParent ) {\n\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_block',\n\t\t\t\t\tgetBlockAttributes( patternParent ).ref\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst { getCurrentTemplateId } = select( editorStore );\n\t\t\t\tconst templateId = getCurrentTemplateId();\n\t\t\t\tconst { getContentLockingParent } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\t\t\t\tif ( ! getContentLockingParent( clientId ) && templateId ) {\n\t\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_template',\n\t\t\t\t\t\ttemplateId\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst _canEditTemplates = select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\treturn {\n\t\t\t\tcanEditTemplates: _canEditTemplates,\n\t\t\t\tentity: record,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tif ( ! entity ) {\n\t\treturn (\n\t\t\t<TemplateLockContentOnlyMenuItems\n\t\t\t\tclientId={ clientId }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst isPattern = entity.type === 'wp_block';\n\tlet helpText = isPattern\n\t\t? __(\n\t\t\t\t'Edit the pattern to move, delete, or make further changes to this block.'\n\t\t )\n\t\t: __(\n\t\t\t\t'Edit the template to move, delete, or make further changes to this block.'\n\t\t );\n\n\tif ( ! canEditTemplates ) {\n\t\thelpText = __(\n\t\t\t'Only users with permissions to edit the template can move or delete this block'\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\tpostId: entity.id,\n\t\t\t\t\t\t\tpostType: entity.type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdisabled={ ! canEditTemplates }\n\t\t\t\t>\n\t\t\t\t\t{ isPattern ? __( 'Edit pattern' ) : __( 'Edit template' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ helpText }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nfunction TemplateLockContentOnlyMenuItems( { clientId, onClose } ) {\n\tconst { contentLockingParent } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getContentLockingParent } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tcontentLockingParent: getContentLockingParent( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst blockDisplayInformation =\n\t\tuseBlockDisplayInformation( contentLockingParent );\n\t// Disable reason: We're using a hook here so it has to be on top-level.\n\t// eslint-disable-next-line @wordpress/no-unused-vars-before-return\n\tconst { modifyContentLockBlock, selectBlock } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\n\tif ( ! blockDisplayInformation?.title ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tselectBlock( contentLockingParent );\n\t\t\t\t\t\tmodifyContentLockBlock( contentLockingParent );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ __( 'Unlock' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Temporarily unlock the parent block to edit, delete or make further changes to this block.'\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nexport default function ContentOnlySettingsMenu() {\n\treturn (\n\t\t<BlockSettingsMenuControls>\n\t\t\t{ ( { selectedClientIds, onClose } ) =>\n\t\t\t\tselectedClientIds.length === 1 && (\n\t\t\t\t\t<ContentOnlySettingsMenuItems\n\t\t\t\t\t\tclientId={ selectedClientIds[ 0 ] }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockSettingsMenuControls>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAlB3C;AACA;AACA;;AAYA;AACA;AACA;;AAIA,SAASQ,4BAA4BA,CAAE;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,EAAG;EAC9D,MAAM;IAAEC,MAAM;IAAEC,wBAAwB;IAAEC;EAAiB,CAAC,GAAG,IAAAC,eAAS,EACrEC,MAAM,IAAM;IACb,MAAM;MACLC,mBAAmB;MACnBC,0BAA0B;MAC1BC,WAAW;MACXC;IACD,CAAC,GAAGJ,MAAM,CAAEK,kBAAiB,CAAC;IAC9B,MAAMC,WAAW,GAChBL,mBAAmB,CAAEP,QAAS,CAAC,KAAK,aAAa;IAClD,IAAK,CAAEY,WAAW,EAAG;MACpB,OAAO,CAAC,CAAC;IACV;IACA,MAAMC,aAAa,GAAGL,0BAA0B,CAC/CR,QAAQ,EACR,YAAY,EACZ,IACD,CAAC,CAAE,CAAC,CAAE;IAEN,IAAIc,MAAM;IACV,IAAKD,aAAa,EAAG;MACpBC,MAAM,GAAGR,MAAM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_i18n","_store","_lockUnlock","_jsxRuntime","ContentOnlySettingsMenuItems","clientId","onClose","entity","onNavigateToEntityRecord","canEditTemplates","useSelect","select","getBlockEditingMode","getBlockParentsByBlockName","getSettings","getBlockAttributes","blockEditorStore","contentOnly","patternParent","record","coreStore","getEntityRecord","ref","getCurrentTemplateId","editorStore","templateId","getContentLockingParent","unlock","_canEditTemplates","canUser","kind","name","jsx","TemplateLockContentOnlyMenuItems","isPattern","type","helpText","__","jsxs","Fragment","children","__unstableBlockSettingsMenuFirstItem","MenuItem","onClick","postId","id","postType","disabled","__experimentalText","variant","as","className","contentLockingParent","blockDisplayInformation","useBlockDisplayInformation","blockEditorActions","useDispatch","title","modifyContentLockBlock","_x","ContentOnlySettingsMenu","BlockSettingsMenuControls","selectedClientIds","length"],"sources":["@wordpress/editor/src/components/block-settings-menu/content-only-settings-menu.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBlockSettingsMenuControls,\n\t__unstableBlockSettingsMenuFirstItem as BlockSettingsMenuFirstItem,\n\tstore as blockEditorStore,\n\tuseBlockDisplayInformation,\n} from '@wordpress/block-editor';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { __experimentalText as Text, MenuItem } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nfunction ContentOnlySettingsMenuItems( { clientId, onClose } ) {\n\tconst { entity, onNavigateToEntityRecord, canEditTemplates } = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tgetBlockEditingMode,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetSettings,\n\t\t\t\tgetBlockAttributes,\n\t\t\t} = select( blockEditorStore );\n\t\t\tconst contentOnly =\n\t\t\t\tgetBlockEditingMode( clientId ) === 'contentOnly';\n\t\t\tif ( ! contentOnly ) {\n\t\t\t\treturn {};\n\t\t\t}\n\t\t\tconst patternParent = getBlockParentsByBlockName(\n\t\t\t\tclientId,\n\t\t\t\t'core/block',\n\t\t\t\ttrue\n\t\t\t)[ 0 ];\n\n\t\t\tlet record;\n\t\t\tif ( patternParent ) {\n\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t'postType',\n\t\t\t\t\t'wp_block',\n\t\t\t\t\tgetBlockAttributes( patternParent ).ref\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst { getCurrentTemplateId } = select( editorStore );\n\t\t\t\tconst templateId = getCurrentTemplateId();\n\t\t\t\tconst { getContentLockingParent } = unlock(\n\t\t\t\t\tselect( blockEditorStore )\n\t\t\t\t);\n\t\t\t\tif ( ! getContentLockingParent( clientId ) && templateId ) {\n\t\t\t\t\trecord = select( coreStore ).getEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'wp_template',\n\t\t\t\t\t\ttemplateId\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t\tconst _canEditTemplates = select( coreStore ).canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: 'wp_template',\n\t\t\t} );\n\t\t\treturn {\n\t\t\t\tcanEditTemplates: _canEditTemplates,\n\t\t\t\tentity: record,\n\t\t\t\tonNavigateToEntityRecord:\n\t\t\t\t\tgetSettings().onNavigateToEntityRecord,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tif ( ! entity ) {\n\t\treturn (\n\t\t\t<TemplateLockContentOnlyMenuItems\n\t\t\t\tclientId={ clientId }\n\t\t\t\tonClose={ onClose }\n\t\t\t/>\n\t\t);\n\t}\n\n\tconst isPattern = entity.type === 'wp_block';\n\tlet helpText = isPattern\n\t\t? __(\n\t\t\t\t'Edit the pattern to move, delete, or make further changes to this block.'\n\t\t )\n\t\t: __(\n\t\t\t\t'Edit the template to move, delete, or make further changes to this block.'\n\t\t );\n\n\tif ( ! canEditTemplates ) {\n\t\thelpText = __(\n\t\t\t'Only users with permissions to edit the template can move or delete this block'\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tonNavigateToEntityRecord( {\n\t\t\t\t\t\t\tpostId: entity.id,\n\t\t\t\t\t\t\tpostType: entity.type,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tdisabled={ ! canEditTemplates }\n\t\t\t\t>\n\t\t\t\t\t{ isPattern ? __( 'Edit pattern' ) : __( 'Edit template' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ helpText }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nfunction TemplateLockContentOnlyMenuItems( { clientId, onClose } ) {\n\tconst { contentLockingParent } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getContentLockingParent } = unlock(\n\t\t\t\tselect( blockEditorStore )\n\t\t\t);\n\t\t\treturn {\n\t\t\t\tcontentLockingParent: getContentLockingParent( clientId ),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst blockDisplayInformation =\n\t\tuseBlockDisplayInformation( contentLockingParent );\n\tconst blockEditorActions = useDispatch( blockEditorStore );\n\tif ( ! blockDisplayInformation?.title ) {\n\t\treturn null;\n\t}\n\n\tconst { modifyContentLockBlock } = unlock( blockEditorActions );\n\n\treturn (\n\t\t<>\n\t\t\t<BlockSettingsMenuFirstItem>\n\t\t\t\t<MenuItem\n\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\tmodifyContentLockBlock( contentLockingParent );\n\t\t\t\t\t\tonClose();\n\t\t\t\t\t} }\n\t\t\t\t>\n\t\t\t\t\t{ _x( 'Unlock', 'Unlock content locked blocks' ) }\n\t\t\t\t</MenuItem>\n\t\t\t</BlockSettingsMenuFirstItem>\n\t\t\t<Text\n\t\t\t\tvariant=\"muted\"\n\t\t\t\tas=\"p\"\n\t\t\t\tclassName=\"editor-content-only-settings-menu__description\"\n\t\t\t>\n\t\t\t\t{ __(\n\t\t\t\t\t'Temporarily unlock the parent block to edit, delete or make further changes to this block.'\n\t\t\t\t) }\n\t\t\t</Text>\n\t\t</>\n\t);\n}\n\nexport default function ContentOnlySettingsMenu() {\n\treturn (\n\t\t<BlockSettingsMenuControls>\n\t\t\t{ ( { selectedClientIds, onClose } ) =>\n\t\t\t\tselectedClientIds.length === 1 && (\n\t\t\t\t\t<ContentOnlySettingsMenuItems\n\t\t\t\t\t\tclientId={ selectedClientIds[ 0 ] }\n\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t</BlockSettingsMenuControls>\n\t);\n}\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AAKA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,WAAA,GAAAN,OAAA;AAA2C,IAAAO,WAAA,GAAAP,OAAA;AAlB3C;AACA;AACA;;AAYA;AACA;AACA;;AAIA,SAASQ,4BAA4BA,CAAE;EAAEC,QAAQ;EAAEC;AAAQ,CAAC,EAAG;EAC9D,MAAM;IAAEC,MAAM;IAAEC,wBAAwB;IAAEC;EAAiB,CAAC,GAAG,IAAAC,eAAS,EACrEC,MAAM,IAAM;IACb,MAAM;MACLC,mBAAmB;MACnBC,0BAA0B;MAC1BC,WAAW;MACXC;IACD,CAAC,GAAGJ,MAAM,CAAEK,kBAAiB,CAAC;IAC9B,MAAMC,WAAW,GAChBL,mBAAmB,CAAEP,QAAS,CAAC,KAAK,aA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AAC,iBAC7B,IAAA5D,WAAA,CAAA6B,GAAA,EAAC5B,4BAA4B;MAC5BC,QAAQ,EAAGyD,iBAAiB,CAAE,CAAC,CAAI;MACnCxD,OAAO,EAAGA;IAAS,CACnB;EACD,CAEwB,CAAC;AAE9B","ignoreList":[]}
@@ -108,9 +108,9 @@ function DocumentBar(props) {
108
108
  const entityTitle = isTemplate ? templateTitle : documentTitle;
109
109
  const title = props.title || entityTitle;
110
110
  const icon = props.icon || templateIcon;
111
- const mounted = (0, _element.useRef)(false);
111
+ const mountedRef = (0, _element.useRef)(false);
112
112
  (0, _element.useEffect)(() => {
113
- mounted.current = true;
113
+ mountedRef.current = true;
114
114
  }, []);
115
115
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
116
116
  className: (0, _clsx.default)('editor-document-bar', {
@@ -126,7 +126,7 @@ function DocumentBar(props) {
126
126
  onNavigateToPreviousEntityRecord();
127
127
  },
128
128
  size: "compact",
129
- initial: mounted.current ? {
129
+ initial: mountedRef.current ? {
130
130
  opacity: 0,
131
131
  transform: 'translateX(15%)'
132
132
  } : false // Don't show entry animation when DocumentBar mounts.
@@ -155,7 +155,7 @@ function DocumentBar(props) {
155
155
  // Force entry animation when the back button is added or removed.
156
156
  ,
157
157
 
158
- initial: mounted.current ? {
158
+ initial: mountedRef.current ? {
159
159
  opacity: 0,
160
160
  transform: hasBackButton ? 'translateX(15%)' : 'translateX(-15%)'
161
161
  } : false // Don't show entry animation when DocumentBar mounts.
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_htmlEntities","_constants","_store","_lockUnlock","_jsxRuntime","TYPE_LABELS","wp_pattern","__","wp_navigation","wp_template","wp_template_part","MotionButton","motion","Button","DocumentBar","props","postType","documentTitle","isNotFound","isUnsyncedPattern","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","useSelect","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","getEditedEntityRecord","isResolving","isResolvingSelector","coreStore","_postType","_postId","_document","_templateInfo","title","wp_pattern_sync_status","unlock","getPostIcon","area","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isTemplate","TEMPLATE_POST_TYPES","includes","isGlobalEntity","GLOBAL_POST_TYPES","hasBackButton","entityTitle","icon","mounted","useRef","useEffect","current","jsxs","className","clsx","children","jsx","__unstableAnimatePresence","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__experimentalText","__unstableMotion","div","BlockIcon","as","sprintf","decodeEntities","displayShortcut","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst TYPE_LABELS = {\n\t// translators: 1: Pattern title.\n\twp_pattern: __( 'Editing pattern: %s' ),\n\t// translators: 1: Navigation menu title.\n\twp_navigation: __( 'Editing navigation menu: %s' ),\n\t// translators: 1: Template title.\n\twp_template: __( 'Editing template: %s' ),\n\t// translators: 1: Template part title.\n\twp_template_part: __( 'Editing template part: %s' ),\n};\n\nconst MotionButton = motion( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n * @param {Object} props The component props.\n * @param {string} props.title A title for the document, defaulting to the document or\n * template title currently being edited.\n * @param {import(\"@wordpress/components\").IconType} props.icon An icon for the document, defaulting to an icon for document\n * or template currently being edited.\n *\n * @return {JSX.Element} The rendered DocumentBar component.\n */\nexport default function DocumentBar( props ) {\n\tconst {\n\t\tpostType,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\tisUnsyncedPattern,\n\t\ttemplateIcon,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t} = select( editorStore );\n\t\tconst { getEditedEntityRecord, isResolving: isResolvingSelector } =\n\t\t\tselect( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\t\tconst _templateInfo = getTemplateInfo( _document );\n\t\treturn {\n\t\t\tpostType: _postType,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\tisUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',\n\t\t\ttemplateIcon: unlock( select( editorStore ) ).getPostIcon(\n\t\t\t\t_postType,\n\t\t\t\t{\n\t\t\t\t\tarea: _document?.area,\n\t\t\t\t}\n\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst entityTitle = isTemplate ? templateTitle : documentTitle;\n\tconst title = props.title || entityTitle;\n\tconst icon = props.icon || templateIcon;\n\n\tconst mounted = useRef( false );\n\tuseEffect( () => {\n\t\tmounted.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t\t'is-global': isGlobalEntity && ! isUnsyncedPattern,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmounted.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t! props.title && TYPE_LABELS[ postType ]\n\t\t\t\t\t\t\t\t\t? // eslint-disable-next-line @wordpress/valid-sprintf\n\t\t\t\t\t\t\t\t\t sprintf( TYPE_LABELS[ postType ], title )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t? decodeEntities( title )\n\t\t\t\t\t\t\t\t: __( 'No title' ) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAKA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAA2C,IAAAe,WAAA,GAAAf,OAAA;AA9B3C;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAKA,MAAMgB,WAAW,GAAG;EACnB;EACAC,UAAU,EAAE,IAAAC,QAAE,EAAE,qBAAsB,CAAC;EACvC;EACAC,aAAa,EAAE,IAAAD,QAAE,EAAE,6BAA8B,CAAC;EAClD;EACAE,WAAW,EAAE,IAA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AAO,EAAE,CAAC;UACVC,SAAS,EAAE;QACZ,CAAG;QACHG,UAAU,EACThC,eAAe,GAAG;UAAEiC,QAAQ,EAAE;QAAE,CAAC,GAAGC,SACpC;QAAAjB,QAAA,gBAED,IAAA7D,WAAA,CAAA8D,GAAA,EAACzE,YAAA,CAAA6F,SAAS;UAAC7B,IAAI,EAAGA;QAAM,CAAE,CAAC,eAC3B,IAAArD,WAAA,CAAA8D,GAAA,EAAC1E,WAAA,CAAA2F,kBAAI;UACJT,IAAI,EAAC,MAAM;UACXa,EAAE,EAAC,IAAI;UACP,cACC,CAAExE,KAAK,CAACwB,KAAK,IAAIlC,WAAW,CAAEW,QAAQ,CAAE;UACrC;UACA,IAAAwE,aAAO,EAAEnF,WAAW,CAAEW,QAAQ,CAAE,EAAEuB,KAAM,CAAC,GACzC2C,SACH;UAAAjB,QAAA,EAEC1B,KAAK,GACJ,IAAAkD,4BAAc,EAAElD,KAAM,CAAC,GACvB,IAAAhC,QAAE,EAAE,UAAW;QAAC,CACd,CAAC;MAAA,GAjCDgD,aAkCK,CAAC,eACb,IAAAnD,WAAA,CAAA8D,GAAA;QAAMH,SAAS,EAAC,+BAA+B;QAAAE,QAAA,EAC5CyB,yBAAe,CAACC,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_i18n","_data","_components","_blockEditor","_icons","_keycodes","_coreData","_commands","_element","_compose","_htmlEntities","_constants","_store","_lockUnlock","_jsxRuntime","TYPE_LABELS","wp_pattern","__","wp_navigation","wp_template","wp_template_part","MotionButton","motion","Button","DocumentBar","props","postType","documentTitle","isNotFound","isUnsyncedPattern","templateIcon","templateTitle","onNavigateToPreviousEntityRecord","useSelect","select","getCurrentPostType","getCurrentPostId","getEditorSettings","__experimentalGetTemplateInfo","getTemplateInfo","editorStore","getEditedEntityRecord","isResolving","isResolvingSelector","coreStore","_postType","_postId","_document","_templateInfo","title","wp_pattern_sync_status","unlock","getPostIcon","area","open","openCommandCenter","useDispatch","commandsStore","isReducedMotion","useReducedMotion","isTemplate","TEMPLATE_POST_TYPES","includes","isGlobalEntity","GLOBAL_POST_TYPES","hasBackButton","entityTitle","icon","mountedRef","useRef","useEffect","current","jsxs","className","clsx","children","jsx","__unstableAnimatePresence","isRTL","chevronRightSmall","chevronLeftSmall","onClick","event","stopPropagation","size","initial","opacity","transform","animate","exit","transition","duration","undefined","__experimentalText","__unstableMotion","div","BlockIcon","as","sprintf","decodeEntities","displayShortcut","primary"],"sources":["@wordpress/editor/src/components/document-bar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { __, isRTL, sprintf } from '@wordpress/i18n';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tButton,\n\t__experimentalText as Text,\n\t__unstableMotion as motion,\n\t__unstableAnimatePresence as AnimatePresence,\n} from '@wordpress/components';\nimport { BlockIcon } from '@wordpress/block-editor';\nimport { chevronLeftSmall, chevronRightSmall } from '@wordpress/icons';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { store as commandsStore } from '@wordpress/commands';\nimport { useRef, useEffect } from '@wordpress/element';\nimport { useReducedMotion } from '@wordpress/compose';\nimport { decodeEntities } from '@wordpress/html-entities';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPES, GLOBAL_POST_TYPES } from '../../store/constants';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\n\nconst TYPE_LABELS = {\n\t// translators: 1: Pattern title.\n\twp_pattern: __( 'Editing pattern: %s' ),\n\t// translators: 1: Navigation menu title.\n\twp_navigation: __( 'Editing navigation menu: %s' ),\n\t// translators: 1: Template title.\n\twp_template: __( 'Editing template: %s' ),\n\t// translators: 1: Template part title.\n\twp_template_part: __( 'Editing template part: %s' ),\n};\n\nconst MotionButton = motion( Button );\n\n/**\n * This component renders a navigation bar at the top of the editor. It displays the title of the current document,\n * a back button (if applicable), and a command center button. It also handles different states of the document,\n * such as \"not found\" or \"unsynced\".\n *\n * @example\n * ```jsx\n * <DocumentBar />\n * ```\n * @param {Object} props The component props.\n * @param {string} props.title A title for the document, defaulting to the document or\n * template title currently being edited.\n * @param {import(\"@wordpress/components\").IconType} props.icon An icon for the document, defaulting to an icon for document\n * or template currently being edited.\n *\n * @return {JSX.Element} The rendered DocumentBar component.\n */\nexport default function DocumentBar( props ) {\n\tconst {\n\t\tpostType,\n\t\tdocumentTitle,\n\t\tisNotFound,\n\t\tisUnsyncedPattern,\n\t\ttemplateIcon,\n\t\ttemplateTitle,\n\t\tonNavigateToPreviousEntityRecord,\n\t} = useSelect( ( select ) => {\n\t\tconst {\n\t\t\tgetCurrentPostType,\n\t\t\tgetCurrentPostId,\n\t\t\tgetEditorSettings,\n\t\t\t__experimentalGetTemplateInfo: getTemplateInfo,\n\t\t} = select( editorStore );\n\t\tconst { getEditedEntityRecord, isResolving: isResolvingSelector } =\n\t\t\tselect( coreStore );\n\t\tconst _postType = getCurrentPostType();\n\t\tconst _postId = getCurrentPostId();\n\t\tconst _document = getEditedEntityRecord(\n\t\t\t'postType',\n\t\t\t_postType,\n\t\t\t_postId\n\t\t);\n\t\tconst _templateInfo = getTemplateInfo( _document );\n\t\treturn {\n\t\t\tpostType: _postType,\n\t\t\tdocumentTitle: _document.title,\n\t\t\tisNotFound:\n\t\t\t\t! _document &&\n\t\t\t\t! isResolvingSelector(\n\t\t\t\t\t'getEditedEntityRecord',\n\t\t\t\t\t'postType',\n\t\t\t\t\t_postType,\n\t\t\t\t\t_postId\n\t\t\t\t),\n\t\t\tisUnsyncedPattern: _document?.wp_pattern_sync_status === 'unsynced',\n\t\t\ttemplateIcon: unlock( select( editorStore ) ).getPostIcon(\n\t\t\t\t_postType,\n\t\t\t\t{\n\t\t\t\t\tarea: _document?.area,\n\t\t\t\t}\n\t\t\t),\n\t\t\ttemplateTitle: _templateInfo.title,\n\t\t\tonNavigateToPreviousEntityRecord:\n\t\t\t\tgetEditorSettings().onNavigateToPreviousEntityRecord,\n\t\t};\n\t}, [] );\n\n\tconst { open: openCommandCenter } = useDispatch( commandsStore );\n\tconst isReducedMotion = useReducedMotion();\n\n\tconst isTemplate = TEMPLATE_POST_TYPES.includes( postType );\n\tconst isGlobalEntity = GLOBAL_POST_TYPES.includes( postType );\n\tconst hasBackButton = !! onNavigateToPreviousEntityRecord;\n\tconst entityTitle = isTemplate ? templateTitle : documentTitle;\n\tconst title = props.title || entityTitle;\n\tconst icon = props.icon || templateIcon;\n\n\tconst mountedRef = useRef( false );\n\tuseEffect( () => {\n\t\tmountedRef.current = true;\n\t}, [] );\n\n\treturn (\n\t\t<div\n\t\t\tclassName={ clsx( 'editor-document-bar', {\n\t\t\t\t'has-back-button': hasBackButton,\n\t\t\t\t'is-global': isGlobalEntity && ! isUnsyncedPattern,\n\t\t\t} ) }\n\t\t>\n\t\t\t<AnimatePresence>\n\t\t\t\t{ hasBackButton && (\n\t\t\t\t\t<MotionButton\n\t\t\t\t\t\tclassName=\"editor-document-bar__back\"\n\t\t\t\t\t\ticon={ isRTL() ? chevronRightSmall : chevronLeftSmall }\n\t\t\t\t\t\tonClick={ ( event ) => {\n\t\t\t\t\t\t\tevent.stopPropagation();\n\t\t\t\t\t\t\tonNavigateToPreviousEntityRecord();\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? { opacity: 0, transform: 'translateX(15%)' }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ { opacity: 1, transform: 'translateX(0%)' } }\n\t\t\t\t\t\texit={ { opacity: 0, transform: 'translateX(15%)' } }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Back' ) }\n\t\t\t\t\t</MotionButton>\n\t\t\t\t) }\n\t\t\t</AnimatePresence>\n\t\t\t{ isNotFound ? (\n\t\t\t\t<Text>{ __( 'Document not found' ) }</Text>\n\t\t\t) : (\n\t\t\t\t<Button\n\t\t\t\t\tclassName=\"editor-document-bar__command\"\n\t\t\t\t\tonClick={ () => openCommandCenter() }\n\t\t\t\t\tsize=\"compact\"\n\t\t\t\t>\n\t\t\t\t\t<motion.div\n\t\t\t\t\t\tclassName=\"editor-document-bar__title\"\n\t\t\t\t\t\t// Force entry animation when the back button is added or removed.\n\t\t\t\t\t\tkey={ hasBackButton }\n\t\t\t\t\t\tinitial={\n\t\t\t\t\t\t\tmountedRef.current\n\t\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\t\topacity: 0,\n\t\t\t\t\t\t\t\t\t\ttransform: hasBackButton\n\t\t\t\t\t\t\t\t\t\t\t? 'translateX(15%)'\n\t\t\t\t\t\t\t\t\t\t\t: 'translateX(-15%)',\n\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t: false // Don't show entry animation when DocumentBar mounts.\n\t\t\t\t\t\t}\n\t\t\t\t\t\tanimate={ {\n\t\t\t\t\t\t\topacity: 1,\n\t\t\t\t\t\t\ttransform: 'translateX(0%)',\n\t\t\t\t\t\t} }\n\t\t\t\t\t\ttransition={\n\t\t\t\t\t\t\tisReducedMotion ? { duration: 0 } : undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t<BlockIcon icon={ icon } />\n\t\t\t\t\t\t<Text\n\t\t\t\t\t\t\tsize=\"body\"\n\t\t\t\t\t\t\tas=\"h1\"\n\t\t\t\t\t\t\taria-label={\n\t\t\t\t\t\t\t\t! props.title && TYPE_LABELS[ postType ]\n\t\t\t\t\t\t\t\t\t? // eslint-disable-next-line @wordpress/valid-sprintf\n\t\t\t\t\t\t\t\t\t sprintf( TYPE_LABELS[ postType ], title )\n\t\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ title\n\t\t\t\t\t\t\t\t? decodeEntities( title )\n\t\t\t\t\t\t\t\t: __( 'No title' ) }\n\t\t\t\t\t\t</Text>\n\t\t\t\t\t</motion.div>\n\t\t\t\t\t<span className=\"editor-document-bar__shortcut\">\n\t\t\t\t\t\t{ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t</span>\n\t\t\t\t</Button>\n\t\t\t) }\n\t\t</div>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,KAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AAMA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,SAAA,GAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,SAAA,GAAAR,OAAA;AACA,IAAAS,QAAA,GAAAT,OAAA;AACA,IAAAU,QAAA,GAAAV,OAAA;AACA,IAAAW,aAAA,GAAAX,OAAA;AAKA,IAAAY,UAAA,GAAAZ,OAAA;AACA,IAAAa,MAAA,GAAAb,OAAA;AACA,IAAAc,WAAA,GAAAd,OAAA;AAA2C,IAAAe,WAAA,GAAAf,OAAA;AA9B3C;AACA;AACA;;AAGA;AACA;AACA;;AAkBA;AACA;AACA;;AAKA,MAAMgB,WAAW,GAAG;EACnB;EACAC,UAAU,EAAE,IAAAC,QAAE,EAAE,qBAAsB,CAAC;EACvC;EACAC,aAAa,EAAE,IAAAD,QAAE,EAAE,6BAA8B,CAAC;EAClD;EACAE,WAAW,EAAE,IAAAF,QAAE,EAAE,sBAAuB,CAAC;EACzC;EACAG,gBAAgB,EAAE,IAAAH,QAAE,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AAG;UAAEiC,QAAQ,EAAE;QAAE,CAAC,GAAGC,SACpC;QAAAjB,QAAA,gBAED,IAAA7D,WAAA,CAAA8D,GAAA,EAACzE,YAAA,CAAA6F,SAAS;UAAC7B,IAAI,EAAGA;QAAM,CAAE,CAAC,eAC3B,IAAArD,WAAA,CAAA8D,GAAA,EAAC1E,WAAA,CAAA2F,kBAAI;UACJT,IAAI,EAAC,MAAM;UACXa,EAAE,EAAC,IAAI;UACP,cACC,CAAExE,KAAK,CAACwB,KAAK,IAAIlC,WAAW,CAAEW,QAAQ,CAAE;UACrC;UACA,IAAAwE,aAAO,EAAEnF,WAAW,CAAEW,QAAQ,CAAE,EAAEuB,KAAM,CAAC,GACzC2C,SACH;UAAAjB,QAAA,EAEC1B,KAAK,GACJ,IAAAkD,4BAAc,EAAElD,KAAM,CAAC,GACvB,IAAAhC,QAAE,EAAE,UAAW;QAAC,CACd,CAAC;MAAA,GAjCDgD,aAkCK,CAAC,eACb,IAAAnD,WAAA,CAAA8D,GAAA;QAAMH,SAAS,EAAC,+BAA+B;QAAAE,QAAA,EAC5CyB,yBAAe,CAACC,OAAO,CAAE,GAAI;MAAC,CAC3B,CAAC;IAAA,CACA,CACR;EAAA,CACG,CAAC;AAER","ignoreList":[]}
@@ -66,10 +66,10 @@ function Editor({
66
66
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_editorInterface.default, {
67
67
  ...props,
68
68
  children: extraContent
69
- }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebar.default, {
69
+ }), children, /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebar.default, {
70
70
  onActionPerformed: onActionPerformed,
71
71
  extraPanels: extraSidebarPanels
72
- }), children]
72
+ })]
73
73
  })]
74
74
  });
75
75
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_data","require","_coreData","_components","_i18n","_constants","_editorInterface","_interopRequireDefault","_provider","_sidebar","_jsxRuntime","Editor","postType","postId","templateId","settings","children","initialEdits","onActionPerformed","extraContent","extraSidebarPanels","props","post","template","hasLoadedPost","useSelect","select","getEntityRecord","hasFinishedResolution","coreStore","TEMPLATE_POST_TYPE","undefined","jsxs","Fragment","jsx","Notice","status","isDismissible","__","ExperimentalEditorProvider","__unstableTemplate","useSubRegistry","default","extraPanels","_default","exports"],"sources":["@wordpress/editor/src/components/editor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport EditorInterface from '../editor-interface';\nimport { ExperimentalEditorProvider } from '../provider';\nimport Sidebar from '../sidebar';\n\nfunction Editor( {\n\tpostType,\n\tpostId,\n\ttemplateId,\n\tsettings,\n\tchildren,\n\tinitialEdits,\n\n\t// This could be part of the settings.\n\tonActionPerformed,\n\n\t// The following abstractions are not ideal but necessary\n\t// to account for site editor and post editor differences for now.\n\textraContent,\n\textraSidebarPanels,\n\t...props\n} ) {\n\tconst { post, template, hasLoadedPost } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\treturn {\n\t\t\t\tpost: getEntityRecord( 'postType', postType, postId ),\n\t\t\t\ttemplate: templateId\n\t\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t\ttemplateId\n\t\t\t\t\t )\n\t\t\t\t\t: undefined,\n\t\t\t\thasLoadedPost: hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t] ),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, templateId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ hasLoadedPost && ! post && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ !! post && (\n\t\t\t\t<ExperimentalEditorProvider\n\t\t\t\t\tpost={ post }\n\t\t\t\t\t__unstableTemplate={ template }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<EditorInterface { ...props }>\n\t\t\t\t\t\t{ extraContent }\n\t\t\t\t\t</EditorInterface>\n\t\t\t\t\t<Sidebar\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraPanels={ extraSidebarPanels }\n\t\t\t\t\t/>\n\t\t\t\t\t{ children }\n\t\t\t\t</ExperimentalEditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Editor;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAF,sBAAA,CAAAN,OAAA;AAAiC,IAAAS,WAAA,GAAAT,OAAA;AAdjC;AACA;AACA;;AAMA;AACA;AACA;;AAMA,SAASU,MAAMA,CAAE;EAChBC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,QAAQ;EACRC,QAAQ;EACRC,YAAY;EAEZ;EACAC,iBAAiB;EAEjB;EACA;EACAC,YAAY;EACZC,kBAAkB;EAClB,GAAGC;AACJ,CAAC,EAAG;EACH,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IA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AmB;QACvCyB,WAAW,EAAGvB;MAAoB,CAClC,CAAC,EACAJ,QAAQ;IAAA,CACiB,CAC5B;EAAA,CACA,CAAC;AAEL;AAAC,IAAA4B,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEc/B,MAAM","ignoreList":[]}
1
+ {"version":3,"names":["_data","require","_coreData","_components","_i18n","_constants","_editorInterface","_interopRequireDefault","_provider","_sidebar","_jsxRuntime","Editor","postType","postId","templateId","settings","children","initialEdits","onActionPerformed","extraContent","extraSidebarPanels","props","post","template","hasLoadedPost","useSelect","select","getEntityRecord","hasFinishedResolution","coreStore","TEMPLATE_POST_TYPE","undefined","jsxs","Fragment","jsx","Notice","status","isDismissible","__","ExperimentalEditorProvider","__unstableTemplate","useSubRegistry","default","extraPanels","_default","exports"],"sources":["@wordpress/editor/src/components/editor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport EditorInterface from '../editor-interface';\nimport { ExperimentalEditorProvider } from '../provider';\nimport Sidebar from '../sidebar';\n\nfunction Editor( {\n\tpostType,\n\tpostId,\n\ttemplateId,\n\tsettings,\n\tchildren,\n\tinitialEdits,\n\n\t// This could be part of the settings.\n\tonActionPerformed,\n\n\t// The following abstractions are not ideal but necessary\n\t// to account for site editor and post editor differences for now.\n\textraContent,\n\textraSidebarPanels,\n\t...props\n} ) {\n\tconst { post, template, hasLoadedPost } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\treturn {\n\t\t\t\tpost: getEntityRecord( 'postType', postType, postId ),\n\t\t\t\ttemplate: templateId\n\t\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t\ttemplateId\n\t\t\t\t\t )\n\t\t\t\t\t: undefined,\n\t\t\t\thasLoadedPost: hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t] ),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, templateId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ hasLoadedPost && ! post && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ !! post && (\n\t\t\t\t<ExperimentalEditorProvider\n\t\t\t\t\tpost={ post }\n\t\t\t\t\t__unstableTemplate={ template }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<EditorInterface { ...props }>\n\t\t\t\t\t\t{ extraContent }\n\t\t\t\t\t</EditorInterface>\n\t\t\t\t\t{ children }\n\t\t\t\t\t<Sidebar\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraPanels={ extraSidebarPanels }\n\t\t\t\t\t/>\n\t\t\t\t</ExperimentalEditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Editor;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAF,sBAAA,CAAAN,O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MAC/BR,QAAQ,EAAGA,QAAU;MACrBE,YAAY,EAAGA,YAAc;MAC7BwB,cAAc,EAAG,KAAO;MAAAzB,QAAA,gBAExB,IAAAN,WAAA,CAAAwB,GAAA,EAAC5B,gBAAA,CAAAoC,OAAe;QAAA,GAAMrB,KAAK;QAAAL,QAAA,EACxBG;MAAY,CACE,CAAC,EAChBH,QAAQ,eACV,IAAAN,WAAA,CAAAwB,GAAA,EAACzB,QAAA,CAAAiC,OAAO;QACPxB,iBAAiB,EAAGA,iBAAmB;QACvCyB,WAAW,EAAGvB;MAAoB,CAClC,CAAC;IAAA,CACyB,CAC5B;EAAA,CACA,CAAC;AAEL;AAAC,IAAAwB,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEc/B,MAAM","ignoreList":[]}
@@ -27,6 +27,7 @@ function EditorHistoryRedo(props, ref) {
27
27
  redo
28
28
  } = (0, _data.useDispatch)(_store.store);
29
29
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
30
+ __next40pxDefaultSize: true,
30
31
  ...props,
31
32
  ref: ref,
32
33
  icon: !(0, _i18n.isRTL)() ? _icons.redo : _icons.undo
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_keycodes","_icons","_element","_store","_jsxRuntime","EditorHistoryRedo","props","ref","shortcut","isAppleOS","displayShortcut","primaryShift","primary","hasRedo","useSelect","select","editorStore","hasEditorRedo","redo","useDispatch","jsx","Button","icon","isRTL","redoIcon","undoIcon","label","__","onClick","undefined","className","_default","exports","default","forwardRef"],"sources":["@wordpress/editor/src/components/editor-history/redo.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut, isAppleOS } from '@wordpress/keycodes';\nimport { redo as redoIcon, undo as undoIcon } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction EditorHistoryRedo( props, ref ) {\n\tconst shortcut = isAppleOS()\n\t\t? displayShortcut.primaryShift( 'z' )\n\t\t: displayShortcut.primary( 'y' );\n\n\tconst hasRedo = useSelect(\n\t\t( select ) => select( editorStore ).hasEditorRedo(),\n\t\t[]\n\t);\n\tconst { redo } = useDispatch( editorStore );\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\tlabel={ __( 'Redo' ) }\n\t\t\tshortcut={ shortcut }\n\t\t\t// If there are no redo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasRedo }\n\t\t\tonClick={ hasRedo ? redo : undefined }\n\t\t\tclassName=\"editor-history__redo\"\n\t\t/>\n\t);\n}\n\n/** @typedef {import('react').Ref<HTMLElement>} Ref */\n\n/**\n * Renders the redo button for the editor history.\n *\n * @param {Object} props - Props.\n * @param {Ref} ref - Forwarded ref.\n *\n * @return {Component} The component to be rendered.\n */\nexport default forwardRef( EditorHistoryRedo );\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAmD,IAAAO,WAAA,GAAAP,OAAA;AAbnD;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASQ,iBAAiBA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACxC,MAAMC,QAAQ,GAAG,IAAAC,mBAAS,EAAC,CAAC,GACzBC,yBAAe,CAACC,YAAY,CAAE,GAAI,CAAC,GACnCD,yBAAe,CAACE,OAAO,CAAE,GAAI,CAAC;EAEjC,MAAMC,OAAO,GAAG,IAAAC,eAAS,EACtBC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,aAAa,CAAC,CAAC,EACnD,EACD,CAAC;EACD,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAY,CAAC;EAC3C,oBACC,IAAAZ,WAAA,CAAAgB,GAAA,EAACtB,WAAA,CAAAuB,MAAM;IAAA,GACDf,KAAK;IACVC,GAAG,EAAGA,GAAK;IACXe,IAAI,EAAG,CAAE,IAAAC,WAAK,EAAC,CAAC,GAAGC,WAAQ,GAAGC;IAC9B;IACAC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;IACtBnB,QAAQ,EAAGA;IACX;IACA;IACA;IAAA;IACA,iBAAgB,CAAEK,OAAS;IAC3Be,OAAO,EAAGf,OAAO,GAAGK,IAAI,GAAGW,SAAW;IACtCC,SAAS,EAAC;EAAsB,CAChC,CAAC;AAEJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQe,IAAAC,mBAAU,EAAE7B,iBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_keycodes","_icons","_element","_store","_jsxRuntime","EditorHistoryRedo","props","ref","shortcut","isAppleOS","displayShortcut","primaryShift","primary","hasRedo","useSelect","select","editorStore","hasEditorRedo","redo","useDispatch","jsx","Button","__next40pxDefaultSize","icon","isRTL","redoIcon","undoIcon","label","__","onClick","undefined","className","_default","exports","default","forwardRef"],"sources":["@wordpress/editor/src/components/editor-history/redo.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut, isAppleOS } from '@wordpress/keycodes';\nimport { redo as redoIcon, undo as undoIcon } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction EditorHistoryRedo( props, ref ) {\n\tconst shortcut = isAppleOS()\n\t\t? displayShortcut.primaryShift( 'z' )\n\t\t: displayShortcut.primary( 'y' );\n\n\tconst hasRedo = useSelect(\n\t\t( select ) => select( editorStore ).hasEditorRedo(),\n\t\t[]\n\t);\n\tconst { redo } = useDispatch( editorStore );\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ticon={ ! isRTL() ? redoIcon : undoIcon }\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\tlabel={ __( 'Redo' ) }\n\t\t\tshortcut={ shortcut }\n\t\t\t// If there are no redo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasRedo }\n\t\t\tonClick={ hasRedo ? redo : undefined }\n\t\t\tclassName=\"editor-history__redo\"\n\t\t/>\n\t);\n}\n\n/** @typedef {import('react').Ref<HTMLElement>} Ref */\n\n/**\n * Renders the redo button for the editor history.\n *\n * @param {Object} props - Props.\n * @param {Ref} ref - Forwarded ref.\n *\n * @return {Component} The component to be rendered.\n */\nexport default forwardRef( EditorHistoryRedo );\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAmD,IAAAO,WAAA,GAAAP,OAAA;AAbnD;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASQ,iBAAiBA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACxC,MAAMC,QAAQ,GAAG,IAAAC,mBAAS,EAAC,CAAC,GACzBC,yBAAe,CAACC,YAAY,CAAE,GAAI,CAAC,GACnCD,yBAAe,CAACE,OAAO,CAAE,GAAI,CAAC;EAEjC,MAAMC,OAAO,GAAG,IAAAC,eAAS,EACtBC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,aAAa,CAAC,CAAC,EACnD,EACD,CAAC;EACD,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAY,CAAC;EAC3C,oBACC,IAAAZ,WAAA,CAAAgB,GAAA,EAACtB,WAAA,CAAAuB,MAAM;IACNC,qBAAqB;IAAA,GAChBhB,KAAK;IACVC,GAAG,EAAGA,GAAK;IACXgB,IAAI,EAAG,CAAE,IAAAC,WAAK,EAAC,CAAC,GAAGC,WAAQ,GAAGC;IAC9B;IACAC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;IACtBpB,QAAQ,EAAGA;IACX;IACA;IACA;IAAA;IACA,iBAAgB,CAAEK,OAAS;IAC3BgB,OAAO,EAAGhB,OAAO,GAAGK,IAAI,GAAGY,SAAW;IACtCC,SAAS,EAAC;EAAsB,CAChC,CAAC;AAEJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQe,IAAAC,mBAAU,EAAE9B,iBAAkB,CAAC","ignoreList":[]}
@@ -26,6 +26,7 @@ function EditorHistoryUndo(props, ref) {
26
26
  undo
27
27
  } = (0, _data.useDispatch)(_store.store);
28
28
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Button, {
29
+ __next40pxDefaultSize: true,
29
30
  ...props,
30
31
  ref: ref,
31
32
  icon: !(0, _i18n.isRTL)() ? _icons.undo : _icons.redo
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_components","_data","_keycodes","_icons","_element","_store","_jsxRuntime","EditorHistoryUndo","props","ref","hasUndo","useSelect","select","editorStore","hasEditorUndo","undo","useDispatch","jsx","Button","icon","isRTL","undoIcon","redoIcon","label","__","shortcut","displayShortcut","primary","onClick","undefined","className","_default","exports","default","forwardRef"],"sources":["@wordpress/editor/src/components/editor-history/undo.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction EditorHistoryUndo( props, ref ) {\n\tconst hasUndo = useSelect(\n\t\t( select ) => select( editorStore ).hasEditorUndo(),\n\t\t[]\n\t);\n\tconst { undo } = useDispatch( editorStore );\n\treturn (\n\t\t<Button\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\tlabel={ __( 'Undo' ) }\n\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasUndo }\n\t\t\tonClick={ hasUndo ? undo : undefined }\n\t\t\tclassName=\"editor-history__undo\"\n\t\t/>\n\t);\n}\n\n/** @typedef {import('react').Ref<HTMLElement>} Ref */\n\n/**\n * Renders the undo button for the editor history.\n *\n * @param {Object} props - Props.\n * @param {Ref} ref - Forwarded ref.\n *\n * @return {Component} The component to be rendered.\n */\nexport default forwardRef( EditorHistoryUndo );\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAmD,IAAAO,WAAA,GAAAP,OAAA;AAbnD;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASQ,iBAAiBA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACxC,MAAMC,OAAO,GAAG,IAAAC,eAAS,EACtBC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,aAAa,CAAC,CAAC,EACnD,EACD,CAAC;EACD,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAY,CAAC;EAC3C,oBACC,IAAAP,WAAA,CAAAW,GAAA,EAACjB,WAAA,CAAAkB,MAAM;IAAA,GACDV,KAAK;IACVC,GAAG,EAAGA,GAAK;IACXU,IAAI,EAAG,CAAE,IAAAC,WAAK,EAAC,CAAC,GAAGC,WAAQ,GAAGC;IAC9B;IACAC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;IACtBC,QAAQ,EAAGC,yBAAe,CAACC,OAAO,CAAE,GAAI;IACxC;IACA;IACA;IAAA;IACA,iBAAgB,CAAEjB,OAAS;IAC3BkB,OAAO,EAAGlB,OAAO,GAAGK,IAAI,GAAGc,SAAW;IACtCC,SAAS,EAAC;EAAsB,CAChC,CAAC;AAEJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQe,IAAAC,mBAAU,EAAE3B,iBAAkB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_components","_data","_keycodes","_icons","_element","_store","_jsxRuntime","EditorHistoryUndo","props","ref","hasUndo","useSelect","select","editorStore","hasEditorUndo","undo","useDispatch","jsx","Button","__next40pxDefaultSize","icon","isRTL","undoIcon","redoIcon","label","__","shortcut","displayShortcut","primary","onClick","undefined","className","_default","exports","default","forwardRef"],"sources":["@wordpress/editor/src/components/editor-history/undo.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, isRTL } from '@wordpress/i18n';\nimport { Button } from '@wordpress/components';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { displayShortcut } from '@wordpress/keycodes';\nimport { undo as undoIcon, redo as redoIcon } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\nfunction EditorHistoryUndo( props, ref ) {\n\tconst hasUndo = useSelect(\n\t\t( select ) => select( editorStore ).hasEditorUndo(),\n\t\t[]\n\t);\n\tconst { undo } = useDispatch( editorStore );\n\treturn (\n\t\t<Button\n\t\t\t__next40pxDefaultSize\n\t\t\t{ ...props }\n\t\t\tref={ ref }\n\t\t\ticon={ ! isRTL() ? undoIcon : redoIcon }\n\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\tlabel={ __( 'Undo' ) }\n\t\t\tshortcut={ displayShortcut.primary( 'z' ) }\n\t\t\t// If there are no undo levels we don't want to actually disable this\n\t\t\t// button, because it will remove focus for keyboard users.\n\t\t\t// See: https://github.com/WordPress/gutenberg/issues/3486\n\t\t\taria-disabled={ ! hasUndo }\n\t\t\tonClick={ hasUndo ? undo : undefined }\n\t\t\tclassName=\"editor-history__undo\"\n\t\t/>\n\t);\n}\n\n/** @typedef {import('react').Ref<HTMLElement>} Ref */\n\n/**\n * Renders the undo button for the editor history.\n *\n * @param {Object} props - Props.\n * @param {Ref} ref - Forwarded ref.\n *\n * @return {Component} The component to be rendered.\n */\nexport default forwardRef( EditorHistoryUndo );\n"],"mappings":";;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,WAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,MAAA,GAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAKA,IAAAM,MAAA,GAAAN,OAAA;AAAmD,IAAAO,WAAA,GAAAP,OAAA;AAbnD;AACA;AACA;;AAQA;AACA;AACA;;AAGA,SAASQ,iBAAiBA,CAAEC,KAAK,EAAEC,GAAG,EAAG;EACxC,MAAMC,OAAO,GAAG,IAAAC,eAAS,EACtBC,MAAM,IAAMA,MAAM,CAAEC,YAAY,CAAC,CAACC,aAAa,CAAC,CAAC,EACnD,EACD,CAAC;EACD,MAAM;IAAEC;EAAK,CAAC,GAAG,IAAAC,iBAAW,EAAEH,YAAY,CAAC;EAC3C,oBACC,IAAAP,WAAA,CAAAW,GAAA,EAACjB,WAAA,CAAAkB,MAAM;IACNC,qBAAqB;IAAA,GAChBX,KAAK;IACVC,GAAG,EAAGA,GAAK;IACXW,IAAI,EAAG,CAAE,IAAAC,WAAK,EAAC,CAAC,GAAGC,WAAQ,GAAGC;IAC9B;IACAC,KAAK,EAAG,IAAAC,QAAE,EAAE,MAAO,CAAG;IACtBC,QAAQ,EAAGC,yBAAe,CAACC,OAAO,CAAE,GAAI;IACxC;IACA;IACA;IAAA;IACA,iBAAgB,CAAElB,OAAS;IAC3BmB,OAAO,EAAGnB,OAAO,GAAGK,IAAI,GAAGe,SAAW;IACtCC,SAAS,EAAC;EAAsB,CAChC,CAAC;AAEJ;;AAEA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAPA,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAQe,IAAAC,mBAAU,EAAE5B,iBAAkB,CAAC","ignoreList":[]}
@@ -101,7 +101,6 @@ function EditorInterface({
101
101
  blockEditorMode: select(_blockEditor.store).__unstableGetEditorMode()
102
102
  };
103
103
  }, []);
104
- const isWideViewport = (0, _compose.useViewportMatch)('large');
105
104
  const isLargeViewport = (0, _compose.useViewportMatch)('medium');
106
105
  const secondarySidebarLabel = isListViewOpened ? (0, _i18n.__)('Document Overview') : (0, _i18n.__)('Block Library');
107
106
 
@@ -116,10 +115,10 @@ function EditorInterface({
116
115
  }, [entitiesSavedStatesCallback]);
117
116
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_interface.InterfaceSkeleton, {
118
117
  enableRegionNavigation: enableRegionNavigation,
119
- isDistractionFree: isDistractionFree && isWideViewport,
118
+ isDistractionFree: isDistractionFree,
120
119
  className: (0, _clsx.default)('editor-editor-interface', className, {
121
120
  'is-entity-save-view-open': !!entitiesSavedStatesCallback,
122
- 'is-distraction-free': isDistractionFree && isWideViewport && !isPreviewMode
121
+ 'is-distraction-free': isDistractionFree && !isPreviewMode
123
122
  }),
124
123
  labels: {
125
124
  ...interfaceLabels,