@wordpress/editor 14.2.0 → 14.4.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 (882) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +2 -1
  3. package/build/bindings/api.js +65 -0
  4. package/build/bindings/api.js.map +1 -0
  5. package/build/bindings/pattern-overrides.js +26 -13
  6. package/build/bindings/pattern-overrides.js.map +1 -1
  7. package/build/bindings/post-meta.js +27 -12
  8. package/build/bindings/post-meta.js.map +1 -1
  9. package/build/components/block-settings-menu/content-only-settings-menu.js +4 -1
  10. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  11. package/build/components/blog-title/index.js +6 -2
  12. package/build/components/blog-title/index.js.map +1 -1
  13. package/build/components/collapsible-block-toolbar/index.js +2 -3
  14. package/build/components/collapsible-block-toolbar/index.js.map +1 -1
  15. package/build/components/editor-interface/index.js +2 -1
  16. package/build/components/editor-interface/index.js.map +1 -1
  17. package/build/components/entities-saved-states/index.js +1 -1
  18. package/build/components/entities-saved-states/index.js.map +1 -1
  19. package/build/components/global-styles-provider/index.js +15 -3
  20. package/build/components/global-styles-provider/index.js.map +1 -1
  21. package/build/components/header/back-button.js +7 -8
  22. package/build/components/header/back-button.js.map +1 -1
  23. package/build/components/header/index.js +19 -17
  24. package/build/components/header/index.js.map +1 -1
  25. package/build/components/inserter-sidebar/index.js +10 -21
  26. package/build/components/inserter-sidebar/index.js.map +1 -1
  27. package/build/components/list-view-sidebar/index.js +19 -47
  28. package/build/components/list-view-sidebar/index.js.map +1 -1
  29. package/build/components/page-attributes/order.js +1 -67
  30. package/build/components/page-attributes/order.js.map +1 -1
  31. package/build/components/page-attributes/panel.js +1 -4
  32. package/build/components/page-attributes/panel.js.map +1 -1
  33. package/build/components/page-attributes/parent.js +2 -1
  34. package/build/components/page-attributes/parent.js.map +1 -1
  35. package/build/components/post-actions/actions.js +189 -244
  36. package/build/components/post-actions/actions.js.map +1 -1
  37. package/build/components/post-actions/index.js +1 -1
  38. package/build/components/post-actions/index.js.map +1 -1
  39. package/build/components/post-card-panel/index.js +8 -2
  40. package/build/components/post-card-panel/index.js.map +1 -1
  41. package/build/components/post-comments/index.js +1 -1
  42. package/build/components/post-comments/index.js.map +1 -1
  43. package/build/components/post-content-information/index.js +7 -1
  44. package/build/components/post-content-information/index.js.map +1 -1
  45. package/build/components/post-discussion/panel.js +2 -2
  46. package/build/components/post-discussion/panel.js.map +1 -1
  47. package/build/components/post-excerpt/panel.js +2 -2
  48. package/build/components/post-excerpt/panel.js.map +1 -1
  49. package/build/components/post-featured-image/index.js +3 -1
  50. package/build/components/post-featured-image/index.js.map +1 -1
  51. package/build/components/post-last-revision/index.js +2 -1
  52. package/build/components/post-last-revision/index.js.map +1 -1
  53. package/build/components/post-preview-button/index.js +1 -1
  54. package/build/components/post-preview-button/index.js.map +1 -1
  55. package/build/components/post-publish-button/index.js +4 -11
  56. package/build/components/post-publish-button/index.js.map +1 -1
  57. package/build/components/post-publish-panel/index.js +1 -1
  58. package/build/components/post-publish-panel/index.js.map +1 -1
  59. package/build/components/post-publish-panel/maybe-category-panel.js +4 -1
  60. package/build/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  61. package/build/components/post-publish-panel/maybe-tags-panel.js +2 -1
  62. package/build/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  63. package/build/components/post-saved-state/index.js +11 -1
  64. package/build/components/post-saved-state/index.js.map +1 -1
  65. package/build/components/post-schedule/index.js +3 -0
  66. package/build/components/post-schedule/index.js.map +1 -1
  67. package/build/components/post-status/index.js +32 -11
  68. package/build/components/post-status/index.js.map +1 -1
  69. package/build/components/post-taxonomies/flat-term-selector.js +17 -6
  70. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  71. package/build/components/post-taxonomies/index.js +7 -1
  72. package/build/components/post-taxonomies/index.js.map +1 -1
  73. package/build/components/post-template/block-theme.js +4 -4
  74. package/build/components/post-template/block-theme.js.map +1 -1
  75. package/build/components/post-template/classic-theme.js +8 -2
  76. package/build/components/post-template/classic-theme.js.map +1 -1
  77. package/build/components/post-template/create-new-template.js +4 -1
  78. package/build/components/post-template/create-new-template.js.map +1 -1
  79. package/build/components/post-template/hooks.js +5 -1
  80. package/build/components/post-template/hooks.js.map +1 -1
  81. package/build/components/post-template/panel.js +8 -2
  82. package/build/components/post-template/panel.js.map +1 -1
  83. package/build/components/post-title/index.js +5 -13
  84. package/build/components/post-title/index.js.map +1 -1
  85. package/build/components/post-trash/check.js +6 -4
  86. package/build/components/post-trash/check.js.map +1 -1
  87. package/build/components/post-url/panel.js +6 -2
  88. package/build/components/post-url/panel.js.map +1 -1
  89. package/build/components/posts-per-page/index.js +6 -2
  90. package/build/components/posts-per-page/index.js.map +1 -1
  91. package/build/components/preview-dropdown/index.js +1 -1
  92. package/build/components/preview-dropdown/index.js.map +1 -1
  93. package/build/components/provider/index.native.js +0 -4
  94. package/build/components/provider/index.native.js.map +1 -1
  95. package/build/components/provider/use-block-editor-settings.js +21 -9
  96. package/build/components/provider/use-block-editor-settings.js.map +1 -1
  97. package/build/components/save-publish-panels/index.js +30 -17
  98. package/build/components/save-publish-panels/index.js.map +1 -1
  99. package/build/components/sidebar/index.js +3 -7
  100. package/build/components/sidebar/index.js.map +1 -1
  101. package/build/components/sidebar/post-summary.js +1 -2
  102. package/build/components/sidebar/post-summary.js.map +1 -1
  103. package/build/components/site-discussion/index.js +7 -3
  104. package/build/components/site-discussion/index.js.map +1 -1
  105. package/build/components/template-content-panel/index.js +28 -3
  106. package/build/components/template-content-panel/index.js.map +1 -1
  107. package/build/components/visual-editor/edit-template-blocks-notification.js +4 -4
  108. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  109. package/build/components/visual-editor/index.js +6 -3
  110. package/build/components/visual-editor/index.js.map +1 -1
  111. package/build/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  112. package/build/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
  113. package/build/dataviews/actions/delete-post.js +98 -0
  114. package/build/dataviews/actions/delete-post.js.map +1 -0
  115. package/build/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +11 -20
  116. package/build/dataviews/actions/export-pattern.js.map +1 -0
  117. package/build/dataviews/actions/index.js +32 -0
  118. package/build/dataviews/actions/index.js.map +1 -0
  119. package/build/dataviews/actions/reset-post.js +111 -0
  120. package/build/dataviews/actions/reset-post.js.map +1 -0
  121. package/build/dataviews/actions/utils.js +50 -0
  122. package/build/dataviews/actions/utils.js.map +1 -0
  123. package/build/dataviews/store/private-actions.js.map +1 -1
  124. package/build/dataviews/store/private-selectors.js +6 -6
  125. package/build/dataviews/store/private-selectors.js.map +1 -1
  126. package/build/dataviews/store/reducer.js +6 -2
  127. package/build/dataviews/store/reducer.js.map +1 -1
  128. package/build/dataviews/types.js +6 -0
  129. package/build/dataviews/types.js.map +1 -0
  130. package/build/hooks/pattern-overrides.js +3 -3
  131. package/build/hooks/pattern-overrides.js.map +1 -1
  132. package/build/index.js +0 -1
  133. package/build/index.js.map +1 -1
  134. package/build/private-apis.js +5 -0
  135. package/build/private-apis.js.map +1 -1
  136. package/build/private-apis.native.js +0 -2
  137. package/build/private-apis.native.js.map +1 -1
  138. package/build/store/constants.js.map +1 -1
  139. package/build/store/private-actions.js +1 -1
  140. package/build/store/private-actions.js.map +1 -1
  141. package/build/store/private-selectors.js +0 -18
  142. package/build/store/private-selectors.js.map +1 -1
  143. package/build/store/utils/is-template-revertable.js +6 -8
  144. package/build/store/utils/is-template-revertable.js.map +1 -1
  145. package/build/utils/media-upload/index.js +35 -2
  146. package/build/utils/media-upload/index.js.map +1 -1
  147. package/build-module/bindings/api.js +57 -0
  148. package/build-module/bindings/api.js.map +1 -0
  149. package/build-module/bindings/pattern-overrides.js +26 -13
  150. package/build-module/bindings/pattern-overrides.js.map +1 -1
  151. package/build-module/bindings/post-meta.js +27 -12
  152. package/build-module/bindings/post-meta.js.map +1 -1
  153. package/build-module/components/block-settings-menu/content-only-settings-menu.js +4 -1
  154. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  155. package/build-module/components/blog-title/index.js +6 -2
  156. package/build-module/components/blog-title/index.js.map +1 -1
  157. package/build-module/components/collapsible-block-toolbar/index.js +1 -2
  158. package/build-module/components/collapsible-block-toolbar/index.js.map +1 -1
  159. package/build-module/components/editor-interface/index.js +2 -1
  160. package/build-module/components/editor-interface/index.js.map +1 -1
  161. package/build-module/components/entities-saved-states/index.js +1 -1
  162. package/build-module/components/entities-saved-states/index.js.map +1 -1
  163. package/build-module/components/global-styles-provider/index.js +15 -3
  164. package/build-module/components/global-styles-provider/index.js.map +1 -1
  165. package/build-module/components/header/back-button.js +5 -7
  166. package/build-module/components/header/back-button.js.map +1 -1
  167. package/build-module/components/header/index.js +19 -19
  168. package/build-module/components/header/index.js.map +1 -1
  169. package/build-module/components/inserter-sidebar/index.js +11 -22
  170. package/build-module/components/inserter-sidebar/index.js.map +1 -1
  171. package/build-module/components/list-view-sidebar/index.js +20 -49
  172. package/build-module/components/list-view-sidebar/index.js.map +1 -1
  173. package/build-module/components/page-attributes/order.js +4 -70
  174. package/build-module/components/page-attributes/order.js.map +1 -1
  175. package/build-module/components/page-attributes/panel.js +1 -6
  176. package/build-module/components/page-attributes/panel.js.map +1 -1
  177. package/build-module/components/page-attributes/parent.js +2 -1
  178. package/build-module/components/page-attributes/parent.js.map +1 -1
  179. package/build-module/components/post-actions/actions.js +186 -240
  180. package/build-module/components/post-actions/actions.js.map +1 -1
  181. package/build-module/components/post-actions/index.js +1 -1
  182. package/build-module/components/post-actions/index.js.map +1 -1
  183. package/build-module/components/post-card-panel/index.js +8 -2
  184. package/build-module/components/post-card-panel/index.js.map +1 -1
  185. package/build-module/components/post-comments/index.js +2 -2
  186. package/build-module/components/post-comments/index.js.map +1 -1
  187. package/build-module/components/post-content-information/index.js +7 -1
  188. package/build-module/components/post-content-information/index.js.map +1 -1
  189. package/build-module/components/post-discussion/panel.js +3 -3
  190. package/build-module/components/post-discussion/panel.js.map +1 -1
  191. package/build-module/components/post-excerpt/panel.js +2 -2
  192. package/build-module/components/post-excerpt/panel.js.map +1 -1
  193. package/build-module/components/post-featured-image/index.js +3 -1
  194. package/build-module/components/post-featured-image/index.js.map +1 -1
  195. package/build-module/components/post-last-revision/index.js +2 -1
  196. package/build-module/components/post-last-revision/index.js.map +1 -1
  197. package/build-module/components/post-preview-button/index.js +1 -1
  198. package/build-module/components/post-preview-button/index.js.map +1 -1
  199. package/build-module/components/post-publish-button/index.js +4 -11
  200. package/build-module/components/post-publish-button/index.js.map +1 -1
  201. package/build-module/components/post-publish-panel/index.js +1 -1
  202. package/build-module/components/post-publish-panel/index.js.map +1 -1
  203. package/build-module/components/post-publish-panel/maybe-category-panel.js +4 -1
  204. package/build-module/components/post-publish-panel/maybe-category-panel.js.map +1 -1
  205. package/build-module/components/post-publish-panel/maybe-tags-panel.js +2 -1
  206. package/build-module/components/post-publish-panel/maybe-tags-panel.js.map +1 -1
  207. package/build-module/components/post-saved-state/index.js +11 -1
  208. package/build-module/components/post-saved-state/index.js.map +1 -1
  209. package/build-module/components/post-schedule/index.js +3 -0
  210. package/build-module/components/post-schedule/index.js.map +1 -1
  211. package/build-module/components/post-status/index.js +31 -11
  212. package/build-module/components/post-status/index.js.map +1 -1
  213. package/build-module/components/post-taxonomies/flat-term-selector.js +17 -6
  214. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  215. package/build-module/components/post-taxonomies/index.js +7 -1
  216. package/build-module/components/post-taxonomies/index.js.map +1 -1
  217. package/build-module/components/post-template/block-theme.js +4 -4
  218. package/build-module/components/post-template/block-theme.js.map +1 -1
  219. package/build-module/components/post-template/classic-theme.js +8 -2
  220. package/build-module/components/post-template/classic-theme.js.map +1 -1
  221. package/build-module/components/post-template/create-new-template.js +4 -1
  222. package/build-module/components/post-template/create-new-template.js.map +1 -1
  223. package/build-module/components/post-template/hooks.js +5 -1
  224. package/build-module/components/post-template/hooks.js.map +1 -1
  225. package/build-module/components/post-template/panel.js +8 -2
  226. package/build-module/components/post-template/panel.js.map +1 -1
  227. package/build-module/components/post-title/index.js +5 -13
  228. package/build-module/components/post-title/index.js.map +1 -1
  229. package/build-module/components/post-trash/check.js +6 -4
  230. package/build-module/components/post-trash/check.js.map +1 -1
  231. package/build-module/components/post-url/panel.js +6 -2
  232. package/build-module/components/post-url/panel.js.map +1 -1
  233. package/build-module/components/posts-per-page/index.js +6 -2
  234. package/build-module/components/posts-per-page/index.js.map +1 -1
  235. package/build-module/components/preview-dropdown/index.js +1 -1
  236. package/build-module/components/preview-dropdown/index.js.map +1 -1
  237. package/build-module/components/provider/index.native.js +0 -4
  238. package/build-module/components/provider/index.native.js.map +1 -1
  239. package/build-module/components/provider/use-block-editor-settings.js +21 -9
  240. package/build-module/components/provider/use-block-editor-settings.js.map +1 -1
  241. package/build-module/components/save-publish-panels/index.js +30 -17
  242. package/build-module/components/save-publish-panels/index.js.map +1 -1
  243. package/build-module/components/sidebar/index.js +3 -7
  244. package/build-module/components/sidebar/index.js.map +1 -1
  245. package/build-module/components/sidebar/post-summary.js +1 -2
  246. package/build-module/components/sidebar/post-summary.js.map +1 -1
  247. package/build-module/components/site-discussion/index.js +8 -4
  248. package/build-module/components/site-discussion/index.js.map +1 -1
  249. package/build-module/components/template-content-panel/index.js +29 -4
  250. package/build-module/components/template-content-panel/index.js.map +1 -1
  251. package/build-module/components/visual-editor/edit-template-blocks-notification.js +4 -4
  252. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  253. package/build-module/components/visual-editor/index.js +6 -3
  254. package/build-module/components/visual-editor/index.js.map +1 -1
  255. package/build-module/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  256. package/build-module/components/visual-editor/use-select-nearest-editable-block.js.map +1 -0
  257. package/build-module/dataviews/actions/delete-post.js +89 -0
  258. package/build-module/dataviews/actions/delete-post.js.map +1 -0
  259. package/build-module/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.js} +10 -19
  260. package/build-module/dataviews/actions/export-pattern.js.map +1 -0
  261. package/build-module/dataviews/actions/index.js +24 -0
  262. package/build-module/dataviews/actions/index.js.map +1 -0
  263. package/build-module/dataviews/actions/reset-post.js +104 -0
  264. package/build-module/dataviews/actions/reset-post.js.map +1 -0
  265. package/build-module/dataviews/actions/utils.js +41 -0
  266. package/build-module/dataviews/actions/utils.js.map +1 -0
  267. package/build-module/dataviews/store/private-actions.js.map +1 -1
  268. package/build-module/dataviews/store/private-selectors.js +5 -5
  269. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  270. package/build-module/dataviews/store/reducer.js +6 -2
  271. package/build-module/dataviews/store/reducer.js.map +1 -1
  272. package/build-module/dataviews/types.js +2 -0
  273. package/build-module/dataviews/types.js.map +1 -0
  274. package/build-module/hooks/pattern-overrides.js +4 -2
  275. package/build-module/hooks/pattern-overrides.js.map +1 -1
  276. package/build-module/index.js +0 -1
  277. package/build-module/index.js.map +1 -1
  278. package/build-module/private-apis.js +5 -0
  279. package/build-module/private-apis.js.map +1 -1
  280. package/build-module/private-apis.native.js +0 -2
  281. package/build-module/private-apis.native.js.map +1 -1
  282. package/build-module/store/constants.js.map +1 -1
  283. package/build-module/store/private-actions.js +1 -1
  284. package/build-module/store/private-actions.js.map +1 -1
  285. package/build-module/store/private-selectors.js +0 -17
  286. package/build-module/store/private-selectors.js.map +1 -1
  287. package/build-module/store/utils/is-template-revertable.js +6 -8
  288. package/build-module/store/utils/is-template-revertable.js.map +1 -1
  289. package/build-module/utils/media-upload/index.js +36 -3
  290. package/build-module/utils/media-upload/index.js.map +1 -1
  291. package/build-style/style-rtl.css +93 -95
  292. package/build-style/style.css +93 -95
  293. package/build-types/bindings/api.d.ts +25 -0
  294. package/build-types/bindings/api.d.ts.map +1 -0
  295. package/build-types/bindings/pattern-overrides.d.ts +17 -0
  296. package/build-types/bindings/pattern-overrides.d.ts.map +1 -0
  297. package/build-types/bindings/post-meta.d.ts +23 -0
  298. package/build-types/bindings/post-meta.d.ts.map +1 -0
  299. package/build-types/components/autocompleters/index.d.ts +2 -0
  300. package/build-types/components/autocompleters/index.d.ts.map +1 -0
  301. package/build-types/components/autocompleters/user.d.ts +6 -0
  302. package/build-types/components/autocompleters/user.d.ts.map +1 -0
  303. package/build-types/components/autosave-monitor/index.d.ts +15 -0
  304. package/build-types/components/autosave-monitor/index.d.ts.map +1 -0
  305. package/build-types/components/block-manager/category.d.ts +6 -0
  306. package/build-types/components/block-manager/category.d.ts.map +1 -0
  307. package/build-types/components/block-manager/checklist.d.ts +7 -0
  308. package/build-types/components/block-manager/checklist.d.ts.map +1 -0
  309. package/build-types/components/block-manager/index.d.ts +3 -0
  310. package/build-types/components/block-manager/index.d.ts.map +1 -0
  311. package/build-types/components/block-removal-warnings/index.d.ts +2 -0
  312. package/build-types/components/block-removal-warnings/index.d.ts.map +1 -0
  313. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts +2 -0
  314. package/build-types/components/block-settings-menu/content-only-settings-menu.d.ts.map +1 -0
  315. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +65 -0
  316. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -0
  317. package/build-types/components/blog-title/index.d.ts +2 -0
  318. package/build-types/components/blog-title/index.d.ts.map +1 -0
  319. package/build-types/components/character-count/index.d.ts +7 -0
  320. package/build-types/components/character-count/index.d.ts.map +1 -0
  321. package/build-types/components/collapsible-block-toolbar/index.d.ts +5 -0
  322. package/build-types/components/collapsible-block-toolbar/index.d.ts.map +1 -0
  323. package/build-types/components/commands/index.d.ts +2 -0
  324. package/build-types/components/commands/index.d.ts.map +1 -0
  325. package/build-types/components/create-template-part-modal/index.d.ts +14 -0
  326. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -0
  327. package/build-types/components/create-template-part-modal/utils.d.ts +4 -0
  328. package/build-types/components/create-template-part-modal/utils.d.ts.map +1 -0
  329. package/build-types/components/deprecated.d.ts +182 -0
  330. package/build-types/components/deprecated.d.ts.map +1 -0
  331. package/build-types/components/document-bar/index.d.ts +22 -0
  332. package/build-types/components/document-bar/index.d.ts.map +1 -0
  333. package/build-types/components/document-outline/check.d.ts +12 -0
  334. package/build-types/components/document-outline/check.d.ts.map +1 -0
  335. package/build-types/components/document-outline/index.d.ts +16 -0
  336. package/build-types/components/document-outline/index.d.ts.map +1 -0
  337. package/build-types/components/document-outline/item.d.ts +9 -0
  338. package/build-types/components/document-outline/item.d.ts.map +1 -0
  339. package/build-types/components/document-tools/index.d.ts +6 -0
  340. package/build-types/components/document-tools/index.d.ts.map +1 -0
  341. package/build-types/components/editor/index.d.ts +14 -0
  342. package/build-types/components/editor/index.d.ts.map +1 -0
  343. package/build-types/components/editor-history/redo.d.ts +4 -0
  344. package/build-types/components/editor-history/redo.d.ts.map +1 -0
  345. package/build-types/components/editor-history/undo.d.ts +4 -0
  346. package/build-types/components/editor-history/undo.d.ts.map +1 -0
  347. package/build-types/components/editor-interface/content-slot-fill.d.ts +3 -0
  348. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -0
  349. package/build-types/components/editor-interface/index.d.ts +17 -0
  350. package/build-types/components/editor-interface/index.d.ts.map +1 -0
  351. package/build-types/components/editor-notices/index.d.ts +13 -0
  352. package/build-types/components/editor-notices/index.d.ts.map +1 -0
  353. package/build-types/components/editor-snackbars/index.d.ts +7 -0
  354. package/build-types/components/editor-snackbars/index.d.ts.map +1 -0
  355. package/build-types/components/entities-saved-states/entity-record-item.d.ts +6 -0
  356. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -0
  357. package/build-types/components/entities-saved-states/entity-type-list.d.ts +6 -0
  358. package/build-types/components/entities-saved-states/entity-type-list.d.ts.map +1 -0
  359. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts +2 -0
  360. package/build-types/components/entities-saved-states/hooks/use-is-dirty.d.ts.map +1 -0
  361. package/build-types/components/entities-saved-states/index.d.ts +43 -0
  362. package/build-types/components/entities-saved-states/index.d.ts.map +1 -0
  363. package/build-types/components/error-boundary/index.d.ts +14 -0
  364. package/build-types/components/error-boundary/index.d.ts.map +1 -0
  365. package/build-types/components/global-keyboard-shortcuts/index.d.ts +9 -0
  366. package/build-types/components/global-keyboard-shortcuts/index.d.ts.map +1 -0
  367. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts +8 -0
  368. package/build-types/components/global-keyboard-shortcuts/register-shortcuts.d.ts.map +1 -0
  369. package/build-types/components/global-styles-provider/index.d.ts +20 -0
  370. package/build-types/components/global-styles-provider/index.d.ts.map +1 -0
  371. package/build-types/components/header/back-button.d.ts +7 -0
  372. package/build-types/components/header/back-button.d.ts.map +1 -0
  373. package/build-types/components/header/index.d.ts +10 -0
  374. package/build-types/components/header/index.d.ts.map +1 -0
  375. package/build-types/components/index.d.ts +108 -0
  376. package/build-types/components/index.d.ts.map +1 -0
  377. package/build-types/components/inserter-sidebar/index.d.ts +2 -0
  378. package/build-types/components/inserter-sidebar/index.d.ts.map +1 -0
  379. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts +26 -0
  380. package/build-types/components/keyboard-shortcut-help-modal/config.d.ts.map +1 -0
  381. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts +5 -0
  382. package/build-types/components/keyboard-shortcut-help-modal/dynamic-shortcut.d.ts.map +1 -0
  383. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts +3 -0
  384. package/build-types/components/keyboard-shortcut-help-modal/index.d.ts.map +1 -0
  385. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts +8 -0
  386. package/build-types/components/keyboard-shortcut-help-modal/shortcut.d.ts.map +1 -0
  387. package/build-types/components/list-view-sidebar/index.d.ts +2 -0
  388. package/build-types/components/list-view-sidebar/index.d.ts.map +1 -0
  389. package/build-types/components/list-view-sidebar/list-view-outline.d.ts +2 -0
  390. package/build-types/components/list-view-sidebar/list-view-outline.d.ts.map +1 -0
  391. package/build-types/components/local-autosave-monitor/index.d.ts +3 -0
  392. package/build-types/components/local-autosave-monitor/index.d.ts.map +1 -0
  393. package/build-types/components/media-categories/index.d.ts +7 -0
  394. package/build-types/components/media-categories/index.d.ts.map +1 -0
  395. package/build-types/components/mode-switcher/index.d.ts +3 -0
  396. package/build-types/components/mode-switcher/index.d.ts.map +1 -0
  397. package/build-types/components/more-menu/copy-content-menu-item.d.ts +2 -0
  398. package/build-types/components/more-menu/copy-content-menu-item.d.ts.map +1 -0
  399. package/build-types/components/more-menu/index.d.ts +2 -0
  400. package/build-types/components/more-menu/index.d.ts.map +1 -0
  401. package/build-types/components/more-menu/tools-more-menu-group.d.ts +6 -0
  402. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -0
  403. package/build-types/components/more-menu/view-more-menu-group.d.ts +6 -0
  404. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -0
  405. package/build-types/components/page-attributes/check.d.ts +13 -0
  406. package/build-types/components/page-attributes/check.d.ts.map +1 -0
  407. package/build-types/components/page-attributes/order.d.ts +9 -0
  408. package/build-types/components/page-attributes/order.d.ts.map +1 -0
  409. package/build-types/components/page-attributes/panel.d.ts +7 -0
  410. package/build-types/components/page-attributes/panel.d.ts.map +1 -0
  411. package/build-types/components/page-attributes/parent.d.ts +11 -0
  412. package/build-types/components/page-attributes/parent.d.ts.map +1 -0
  413. package/build-types/components/pattern-duplicate-modal/index.d.ts +3 -0
  414. package/build-types/components/pattern-duplicate-modal/index.d.ts.map +1 -0
  415. package/build-types/components/pattern-overrides-panel/index.d.ts +2 -0
  416. package/build-types/components/pattern-overrides-panel/index.d.ts.map +1 -0
  417. package/build-types/components/pattern-rename-modal/index.d.ts +3 -0
  418. package/build-types/components/pattern-rename-modal/index.d.ts.map +1 -0
  419. package/build-types/components/plugin-document-setting-panel/index.d.ts +69 -0
  420. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -0
  421. package/build-types/components/plugin-more-menu-item/index.d.ts +3 -0
  422. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -0
  423. package/build-types/components/plugin-post-publish-panel/index.d.ts +47 -0
  424. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -0
  425. package/build-types/components/plugin-post-status-info/index.d.ts +57 -0
  426. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -0
  427. package/build-types/components/plugin-pre-publish-panel/index.d.ts +50 -0
  428. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -0
  429. package/build-types/components/plugin-sidebar/index.d.ts +73 -0
  430. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -0
  431. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +52 -0
  432. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -0
  433. package/build-types/components/post-actions/actions.d.ts +31 -0
  434. package/build-types/components/post-actions/actions.d.ts.map +1 -0
  435. package/build-types/components/post-actions/index.d.ts +5 -0
  436. package/build-types/components/post-actions/index.d.ts.map +1 -0
  437. package/build-types/components/post-author/check.d.ts +13 -0
  438. package/build-types/components/post-author/check.d.ts.map +1 -0
  439. package/build-types/components/post-author/combobox.d.ts +2 -0
  440. package/build-types/components/post-author/combobox.d.ts.map +1 -0
  441. package/build-types/components/post-author/constants.d.ts +9 -0
  442. package/build-types/components/post-author/constants.d.ts.map +1 -0
  443. package/build-types/components/post-author/hook.d.ts +6 -0
  444. package/build-types/components/post-author/hook.d.ts.map +1 -0
  445. package/build-types/components/post-author/index.d.ts +8 -0
  446. package/build-types/components/post-author/index.d.ts.map +1 -0
  447. package/build-types/components/post-author/panel.d.ts +8 -0
  448. package/build-types/components/post-author/panel.d.ts.map +1 -0
  449. package/build-types/components/post-author/select.d.ts +2 -0
  450. package/build-types/components/post-author/select.d.ts.map +1 -0
  451. package/build-types/components/post-card-panel/index.d.ts +4 -0
  452. package/build-types/components/post-card-panel/index.d.ts.map +1 -0
  453. package/build-types/components/post-comments/index.d.ts +3 -0
  454. package/build-types/components/post-comments/index.d.ts.map +1 -0
  455. package/build-types/components/post-content-information/index.d.ts +2 -0
  456. package/build-types/components/post-content-information/index.d.ts.map +1 -0
  457. package/build-types/components/post-discussion/panel.d.ts +10 -0
  458. package/build-types/components/post-discussion/panel.d.ts.map +1 -0
  459. package/build-types/components/post-excerpt/check.d.ts +13 -0
  460. package/build-types/components/post-excerpt/check.d.ts.map +1 -0
  461. package/build-types/components/post-excerpt/index.d.ts +15 -0
  462. package/build-types/components/post-excerpt/index.d.ts.map +1 -0
  463. package/build-types/components/post-excerpt/panel.d.ts +8 -0
  464. package/build-types/components/post-excerpt/panel.d.ts.map +1 -0
  465. package/build-types/components/post-excerpt/plugin.d.ts +53 -0
  466. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -0
  467. package/build-types/components/post-featured-image/check.d.ts +14 -0
  468. package/build-types/components/post-featured-image/check.d.ts.map +1 -0
  469. package/build-types/components/post-featured-image/index.d.ts +3 -0
  470. package/build-types/components/post-featured-image/index.d.ts.map +1 -0
  471. package/build-types/components/post-featured-image/panel.d.ts +13 -0
  472. package/build-types/components/post-featured-image/panel.d.ts.map +1 -0
  473. package/build-types/components/post-format/check.d.ts +5 -0
  474. package/build-types/components/post-format/check.d.ts.map +1 -0
  475. package/build-types/components/post-format/index.d.ts +16 -0
  476. package/build-types/components/post-format/index.d.ts.map +1 -0
  477. package/build-types/components/post-format/panel.d.ts +8 -0
  478. package/build-types/components/post-format/panel.d.ts.map +1 -0
  479. package/build-types/components/post-last-edited-panel/index.d.ts +2 -0
  480. package/build-types/components/post-last-edited-panel/index.d.ts.map +1 -0
  481. package/build-types/components/post-last-revision/check.d.ts +13 -0
  482. package/build-types/components/post-last-revision/check.d.ts.map +1 -0
  483. package/build-types/components/post-last-revision/index.d.ts +9 -0
  484. package/build-types/components/post-last-revision/index.d.ts.map +1 -0
  485. package/build-types/components/post-last-revision/panel.d.ts +8 -0
  486. package/build-types/components/post-last-revision/panel.d.ts.map +1 -0
  487. package/build-types/components/post-locked-modal/index.d.ts +8 -0
  488. package/build-types/components/post-locked-modal/index.d.ts.map +1 -0
  489. package/build-types/components/post-panel-row/index.d.ts +3 -0
  490. package/build-types/components/post-panel-row/index.d.ts.map +1 -0
  491. package/build-types/components/post-panel-section/index.d.ts +6 -0
  492. package/build-types/components/post-panel-section/index.d.ts.map +1 -0
  493. package/build-types/components/post-pending-status/check.d.ts +15 -0
  494. package/build-types/components/post-pending-status/check.d.ts.map +1 -0
  495. package/build-types/components/post-pending-status/index.d.ts +8 -0
  496. package/build-types/components/post-pending-status/index.d.ts.map +1 -0
  497. package/build-types/components/post-pingbacks/index.d.ts +3 -0
  498. package/build-types/components/post-pingbacks/index.d.ts.map +1 -0
  499. package/build-types/components/post-preview-button/index.d.ts +23 -0
  500. package/build-types/components/post-preview-button/index.d.ts.map +1 -0
  501. package/build-types/components/post-publish-button/index.d.ts +17 -0
  502. package/build-types/components/post-publish-button/index.d.ts.map +1 -0
  503. package/build-types/components/post-publish-button/label.d.ts +7 -0
  504. package/build-types/components/post-publish-button/label.d.ts.map +1 -0
  505. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts +17 -0
  506. package/build-types/components/post-publish-button/post-publish-button-or-toggle.d.ts.map +1 -0
  507. package/build-types/components/post-publish-panel/index.d.ts +10 -0
  508. package/build-types/components/post-publish-panel/index.d.ts.map +1 -0
  509. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts +3 -0
  510. package/build-types/components/post-publish-panel/maybe-category-panel.d.ts.map +1 -0
  511. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts +2 -0
  512. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -0
  513. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts +3 -0
  514. package/build-types/components/post-publish-panel/maybe-tags-panel.d.ts.map +1 -0
  515. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts +2 -0
  516. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -0
  517. package/build-types/components/post-publish-panel/postpublish.d.ts +3 -0
  518. package/build-types/components/post-publish-panel/postpublish.d.ts.map +1 -0
  519. package/build-types/components/post-publish-panel/prepublish.d.ts +5 -0
  520. package/build-types/components/post-publish-panel/prepublish.d.ts.map +1 -0
  521. package/build-types/components/post-saved-state/index.d.ts +13 -0
  522. package/build-types/components/post-saved-state/index.d.ts.map +1 -0
  523. package/build-types/components/post-schedule/check.d.ts +12 -0
  524. package/build-types/components/post-schedule/check.d.ts.map +1 -0
  525. package/build-types/components/post-schedule/index.d.ts +17 -0
  526. package/build-types/components/post-schedule/index.d.ts.map +1 -0
  527. package/build-types/components/post-schedule/label.d.ts +25 -0
  528. package/build-types/components/post-schedule/label.d.ts.map +1 -0
  529. package/build-types/components/post-schedule/panel.d.ts +7 -0
  530. package/build-types/components/post-schedule/panel.d.ts.map +1 -0
  531. package/build-types/components/post-slug/check.d.ts +12 -0
  532. package/build-types/components/post-slug/check.d.ts.map +1 -0
  533. package/build-types/components/post-slug/index.d.ts +7 -0
  534. package/build-types/components/post-slug/index.d.ts.map +1 -0
  535. package/build-types/components/post-slug/panel.d.ts +3 -0
  536. package/build-types/components/post-slug/panel.d.ts.map +1 -0
  537. package/build-types/components/post-status/index.d.ts +6 -0
  538. package/build-types/components/post-status/index.d.ts.map +1 -0
  539. package/build-types/components/post-sticky/check.d.ts +12 -0
  540. package/build-types/components/post-sticky/check.d.ts.map +1 -0
  541. package/build-types/components/post-sticky/index.d.ts +7 -0
  542. package/build-types/components/post-sticky/index.d.ts.map +1 -0
  543. package/build-types/components/post-sticky/panel.d.ts +3 -0
  544. package/build-types/components/post-sticky/panel.d.ts.map +1 -0
  545. package/build-types/components/post-switch-to-draft-button/index.d.ts +7 -0
  546. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -0
  547. package/build-types/components/post-sync-status/index.d.ts +7 -0
  548. package/build-types/components/post-sync-status/index.d.ts.map +1 -0
  549. package/build-types/components/post-taxonomies/check.d.ts +12 -0
  550. package/build-types/components/post-taxonomies/check.d.ts.map +1 -0
  551. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +66 -0
  552. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -0
  553. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts +104 -0
  554. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -0
  555. package/build-types/components/post-taxonomies/index.d.ts +5 -0
  556. package/build-types/components/post-taxonomies/index.d.ts.map +1 -0
  557. package/build-types/components/post-taxonomies/most-used-terms.d.ts +5 -0
  558. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -0
  559. package/build-types/components/post-taxonomies/panel.d.ts +3 -0
  560. package/build-types/components/post-taxonomies/panel.d.ts.map +1 -0
  561. package/build-types/components/post-template/block-theme.d.ts +4 -0
  562. package/build-types/components/post-template/block-theme.d.ts.map +1 -0
  563. package/build-types/components/post-template/classic-theme.d.ts +3 -0
  564. package/build-types/components/post-template/classic-theme.d.ts.map +1 -0
  565. package/build-types/components/post-template/create-new-template-modal.d.ts +4 -0
  566. package/build-types/components/post-template/create-new-template-modal.d.ts.map +1 -0
  567. package/build-types/components/post-template/create-new-template.d.ts +4 -0
  568. package/build-types/components/post-template/create-new-template.d.ts.map +1 -0
  569. package/build-types/components/post-template/hooks.d.ts +8 -0
  570. package/build-types/components/post-template/hooks.d.ts.map +1 -0
  571. package/build-types/components/post-template/panel.d.ts +7 -0
  572. package/build-types/components/post-template/panel.d.ts.map +1 -0
  573. package/build-types/components/post-template/reset-default-template.d.ts +4 -0
  574. package/build-types/components/post-template/reset-default-template.d.ts.map +1 -0
  575. package/build-types/components/post-template/swap-template-button.d.ts +4 -0
  576. package/build-types/components/post-template/swap-template-button.d.ts.map +1 -0
  577. package/build-types/components/post-text-editor/index.d.ts +7 -0
  578. package/build-types/components/post-text-editor/index.d.ts.map +1 -0
  579. package/build-types/components/post-title/constants.d.ts +3 -0
  580. package/build-types/components/post-title/constants.d.ts.map +1 -0
  581. package/build-types/components/post-title/index.d.ts +3 -0
  582. package/build-types/components/post-title/index.d.ts.map +1 -0
  583. package/build-types/components/post-title/post-title-raw.d.ts +3 -0
  584. package/build-types/components/post-title/post-title-raw.d.ts.map +1 -0
  585. package/build-types/components/post-title/use-post-title-focus.d.ts +9 -0
  586. package/build-types/components/post-title/use-post-title-focus.d.ts.map +1 -0
  587. package/build-types/components/post-title/use-post-title.d.ts +7 -0
  588. package/build-types/components/post-title/use-post-title.d.ts.map +1 -0
  589. package/build-types/components/post-transform-panel/hooks.d.ts +2 -0
  590. package/build-types/components/post-transform-panel/hooks.d.ts.map +1 -0
  591. package/build-types/components/post-transform-panel/index.d.ts +2 -0
  592. package/build-types/components/post-transform-panel/index.d.ts.map +1 -0
  593. package/build-types/components/post-trash/check.d.ts +12 -0
  594. package/build-types/components/post-trash/check.d.ts.map +1 -0
  595. package/build-types/components/post-trash/index.d.ts +7 -0
  596. package/build-types/components/post-trash/index.d.ts.map +1 -0
  597. package/build-types/components/post-type-support-check/index.d.ts +18 -0
  598. package/build-types/components/post-type-support-check/index.d.ts.map +1 -0
  599. package/build-types/components/post-url/check.d.ts +12 -0
  600. package/build-types/components/post-url/check.d.ts.map +1 -0
  601. package/build-types/components/post-url/index.d.ts +14 -0
  602. package/build-types/components/post-url/index.d.ts.map +1 -0
  603. package/build-types/components/post-url/label.d.ts +13 -0
  604. package/build-types/components/post-url/label.d.ts.map +1 -0
  605. package/build-types/components/post-url/panel.d.ts +7 -0
  606. package/build-types/components/post-url/panel.d.ts.map +1 -0
  607. package/build-types/components/post-view-link/index.d.ts +2 -0
  608. package/build-types/components/post-view-link/index.d.ts.map +1 -0
  609. package/build-types/components/post-visibility/check.d.ts +13 -0
  610. package/build-types/components/post-visibility/check.d.ts.map +1 -0
  611. package/build-types/components/post-visibility/index.d.ts +11 -0
  612. package/build-types/components/post-visibility/index.d.ts.map +1 -0
  613. package/build-types/components/post-visibility/label.d.ts +13 -0
  614. package/build-types/components/post-visibility/label.d.ts.map +1 -0
  615. package/build-types/components/post-visibility/utils.d.ts +21 -0
  616. package/build-types/components/post-visibility/utils.d.ts.map +1 -0
  617. package/build-types/components/posts-per-page/index.d.ts +2 -0
  618. package/build-types/components/posts-per-page/index.d.ts.map +1 -0
  619. package/build-types/components/preferences-modal/enable-panel.d.ts +3 -0
  620. package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -0
  621. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts +14 -0
  622. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -0
  623. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +3 -0
  624. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -0
  625. package/build-types/components/preferences-modal/index.d.ts +4 -0
  626. package/build-types/components/preferences-modal/index.d.ts.map +1 -0
  627. package/build-types/components/preview-dropdown/index.d.ts +5 -0
  628. package/build-types/components/preview-dropdown/index.d.ts.map +1 -0
  629. package/build-types/components/provider/disable-non-page-content-blocks.d.ts +6 -0
  630. package/build-types/components/provider/disable-non-page-content-blocks.d.ts.map +1 -0
  631. package/build-types/components/provider/index.d.ts +65 -0
  632. package/build-types/components/provider/index.d.ts.map +1 -0
  633. package/build-types/components/provider/navigation-block-editing-mode.d.ts +9 -0
  634. package/build-types/components/provider/navigation-block-editing-mode.d.ts.map +1 -0
  635. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts +7 -0
  636. package/build-types/components/provider/use-auto-switch-editor-sidebars.d.ts.map +1 -0
  637. package/build-types/components/provider/use-block-editor-settings.d.ts +13 -0
  638. package/build-types/components/provider/use-block-editor-settings.d.ts.map +1 -0
  639. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts +9 -0
  640. package/build-types/components/provider/use-hide-blocks-from-inserter.d.ts.map +1 -0
  641. package/build-types/components/provider/with-registry-provider.d.ts +3 -0
  642. package/build-types/components/provider/with-registry-provider.d.ts.map +1 -0
  643. package/build-types/components/resizable-editor/index.d.ts +8 -0
  644. package/build-types/components/resizable-editor/index.d.ts.map +1 -0
  645. package/build-types/components/resizable-editor/resize-handle.d.ts +5 -0
  646. package/build-types/components/resizable-editor/resize-handle.d.ts.map +1 -0
  647. package/build-types/components/save-publish-panels/index.d.ts +11 -0
  648. package/build-types/components/save-publish-panels/index.d.ts.map +1 -0
  649. package/build-types/components/sidebar/constants.d.ts +5 -0
  650. package/build-types/components/sidebar/constants.d.ts.map +1 -0
  651. package/build-types/components/sidebar/header.d.ts +3 -0
  652. package/build-types/components/sidebar/header.d.ts.map +1 -0
  653. package/build-types/components/sidebar/index.d.ts +6 -0
  654. package/build-types/components/sidebar/index.d.ts.map +1 -0
  655. package/build-types/components/sidebar/post-summary.d.ts +4 -0
  656. package/build-types/components/sidebar/post-summary.d.ts.map +1 -0
  657. package/build-types/components/site-discussion/index.d.ts +2 -0
  658. package/build-types/components/site-discussion/index.d.ts.map +1 -0
  659. package/build-types/components/start-page-options/index.d.ts +2 -0
  660. package/build-types/components/start-page-options/index.d.ts.map +1 -0
  661. package/build-types/components/start-template-options/index.d.ts +2 -0
  662. package/build-types/components/start-template-options/index.d.ts.map +1 -0
  663. package/build-types/components/table-of-contents/index.d.ts +7 -0
  664. package/build-types/components/table-of-contents/index.d.ts.map +1 -0
  665. package/build-types/components/table-of-contents/panel.d.ts +6 -0
  666. package/build-types/components/table-of-contents/panel.d.ts.map +1 -0
  667. package/build-types/components/template-content-panel/index.d.ts +2 -0
  668. package/build-types/components/template-content-panel/index.d.ts.map +1 -0
  669. package/build-types/components/template-part-content-panel/index.d.ts +2 -0
  670. package/build-types/components/template-part-content-panel/index.d.ts.map +1 -0
  671. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts +5 -0
  672. package/build-types/components/template-part-menu-items/convert-to-regular.d.ts.map +1 -0
  673. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts +5 -0
  674. package/build-types/components/template-part-menu-items/convert-to-template-part.d.ts.map +1 -0
  675. package/build-types/components/template-part-menu-items/index.d.ts +2 -0
  676. package/build-types/components/template-part-menu-items/index.d.ts.map +1 -0
  677. package/build-types/components/template-validation-notice/index.d.ts +2 -0
  678. package/build-types/components/template-validation-notice/index.d.ts.map +1 -0
  679. package/build-types/components/text-editor/index.d.ts +4 -0
  680. package/build-types/components/text-editor/index.d.ts.map +1 -0
  681. package/build-types/components/theme-support-check/index.d.ts +14 -0
  682. package/build-types/components/theme-support-check/index.d.ts.map +1 -0
  683. package/build-types/components/time-to-read/index.d.ts +7 -0
  684. package/build-types/components/time-to-read/index.d.ts.map +1 -0
  685. package/build-types/components/unsaved-changes-warning/index.d.ts +8 -0
  686. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -0
  687. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts +18 -0
  688. package/build-types/components/visual-editor/edit-template-blocks-notification.d.ts.map +1 -0
  689. package/build-types/components/visual-editor/index.d.ts +10 -0
  690. package/build-types/components/visual-editor/index.d.ts.map +1 -0
  691. package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts +4 -0
  692. package/build-types/components/visual-editor/use-select-nearest-editable-block.d.ts.map +1 -0
  693. package/build-types/components/word-count/index.d.ts +7 -0
  694. package/build-types/components/word-count/index.d.ts.map +1 -0
  695. package/build-types/dataviews/actions/delete-post.d.ts +5 -0
  696. package/build-types/dataviews/actions/delete-post.d.ts.map +1 -0
  697. package/build-types/dataviews/actions/export-pattern.d.ts +8 -0
  698. package/build-types/dataviews/actions/export-pattern.d.ts.map +1 -0
  699. package/build-types/dataviews/actions/index.d.ts +2 -0
  700. package/build-types/dataviews/actions/index.d.ts.map +1 -0
  701. package/build-types/dataviews/actions/reset-post.d.ts +5 -0
  702. package/build-types/dataviews/actions/reset-post.d.ts.map +1 -0
  703. package/build-types/dataviews/actions/utils.d.ts +11 -0
  704. package/build-types/dataviews/actions/utils.d.ts.map +1 -0
  705. package/build-types/dataviews/api.d.ts +27 -0
  706. package/build-types/dataviews/api.d.ts.map +1 -0
  707. package/build-types/dataviews/store/private-actions.d.ts +2 -2
  708. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  709. package/build-types/dataviews/store/private-selectors.d.ts +1 -5
  710. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  711. package/build-types/dataviews/store/reducer.d.ts +5 -1
  712. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  713. package/build-types/dataviews/types.d.ts +34 -0
  714. package/build-types/dataviews/types.d.ts.map +1 -0
  715. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts +10 -0
  716. package/build-types/hooks/custom-sources-backwards-compatibility.d.ts.map +1 -0
  717. package/build-types/hooks/default-autocompleters.d.ts +2 -0
  718. package/build-types/hooks/default-autocompleters.d.ts.map +1 -0
  719. package/build-types/hooks/index.d.ts +2 -0
  720. package/build-types/hooks/index.d.ts.map +1 -0
  721. package/build-types/hooks/media-upload.d.ts +2 -0
  722. package/build-types/hooks/media-upload.d.ts.map +1 -0
  723. package/build-types/hooks/pattern-overrides.d.ts +2 -0
  724. package/build-types/hooks/pattern-overrides.d.ts.map +1 -0
  725. package/build-types/index.d.ts +6 -0
  726. package/build-types/index.d.ts.map +1 -0
  727. package/build-types/lock-unlock.d.ts +3 -0
  728. package/build-types/lock-unlock.d.ts.map +1 -0
  729. package/build-types/private-apis.d.ts +2 -0
  730. package/build-types/private-apis.d.ts.map +1 -0
  731. package/build-types/store/actions.d.ts +367 -0
  732. package/build-types/store/actions.d.ts.map +1 -0
  733. package/build-types/store/constants.d.ts +31 -0
  734. package/build-types/store/constants.d.ts.map +1 -0
  735. package/build-types/store/defaults.d.ts +21 -0
  736. package/build-types/store/defaults.d.ts.map +1 -0
  737. package/build-types/store/index.d.ts +17 -0
  738. package/build-types/store/index.d.ts.map +1 -0
  739. package/build-types/store/local-autosave.d.ts +4 -0
  740. package/build-types/store/local-autosave.d.ts.map +1 -0
  741. package/build-types/store/private-actions.d.ts +37 -0
  742. package/build-types/store/private-actions.d.ts.map +1 -0
  743. package/build-types/store/private-selectors.d.ts +24 -0
  744. package/build-types/store/private-selectors.d.ts.map +1 -0
  745. package/build-types/store/reducer.d.ts +228 -0
  746. package/build-types/store/reducer.d.ts.map +1 -0
  747. package/build-types/store/selectors.d.ts +853 -0
  748. package/build-types/store/selectors.d.ts.map +1 -0
  749. package/build-types/store/utils/is-template-revertable.d.ts +8 -0
  750. package/build-types/store/utils/is-template-revertable.d.ts.map +1 -0
  751. package/build-types/store/utils/notice-builder.d.ts +27 -0
  752. package/build-types/store/utils/notice-builder.d.ts.map +1 -0
  753. package/build-types/utils/get-template-part-icon.d.ts +9 -0
  754. package/build-types/utils/get-template-part-icon.d.ts.map +1 -0
  755. package/build-types/utils/index.d.ts +5 -0
  756. package/build-types/utils/index.d.ts.map +1 -0
  757. package/build-types/utils/media-upload/index.d.ts +21 -0
  758. package/build-types/utils/media-upload/index.d.ts.map +1 -0
  759. package/build-types/utils/terms.d.ts +12 -0
  760. package/build-types/utils/terms.d.ts.map +1 -0
  761. package/build-types/utils/url.d.ts +18 -0
  762. package/build-types/utils/url.d.ts.map +1 -0
  763. package/package.json +38 -36
  764. package/src/bindings/api.js +57 -0
  765. package/src/bindings/pattern-overrides.js +30 -20
  766. package/src/bindings/post-meta.js +24 -14
  767. package/src/components/block-settings-menu/content-only-settings-menu.js +4 -4
  768. package/src/components/blog-title/index.js +7 -2
  769. package/src/components/collapsible-block-toolbar/index.js +1 -3
  770. package/src/components/collapsible-block-toolbar/style.scss +0 -3
  771. package/src/components/document-bar/style.scss +1 -5
  772. package/src/components/document-tools/style.scss +4 -4
  773. package/src/components/editor-interface/index.js +17 -12
  774. package/src/components/editor-interface/style.scss +4 -0
  775. package/src/components/entities-saved-states/index.js +1 -1
  776. package/src/components/global-styles-provider/index.js +22 -11
  777. package/src/components/header/back-button.js +6 -6
  778. package/src/components/header/index.js +26 -25
  779. package/src/components/header/style.scss +64 -21
  780. package/src/components/inserter-sidebar/index.js +4 -24
  781. package/src/components/inserter-sidebar/style.scss +1 -6
  782. package/src/components/list-view-sidebar/index.js +34 -62
  783. package/src/components/list-view-sidebar/style.scss +0 -34
  784. package/src/components/page-attributes/order.js +3 -77
  785. package/src/components/page-attributes/panel.js +1 -7
  786. package/src/components/page-attributes/parent.js +6 -3
  787. package/src/components/post-actions/actions.js +227 -304
  788. package/src/components/post-actions/index.js +1 -1
  789. package/src/components/post-card-panel/index.js +8 -2
  790. package/src/components/post-comments/index.js +2 -2
  791. package/src/components/post-content-information/index.js +7 -1
  792. package/src/components/post-discussion/panel.js +5 -3
  793. package/src/components/post-excerpt/panel.js +3 -2
  794. package/src/components/post-featured-image/index.js +5 -1
  795. package/src/components/post-featured-image/style.scss +15 -0
  796. package/src/components/post-last-revision/index.js +1 -0
  797. package/src/components/post-panel-row/style.scss +1 -1
  798. package/src/components/post-preview-button/index.js +1 -1
  799. package/src/components/post-publish-button/index.js +4 -17
  800. package/src/components/post-publish-panel/index.js +1 -1
  801. package/src/components/post-publish-panel/maybe-category-panel.js +4 -1
  802. package/src/components/post-publish-panel/maybe-tags-panel.js +1 -1
  803. package/src/components/post-saved-state/index.js +11 -1
  804. package/src/components/post-schedule/index.js +5 -0
  805. package/src/components/post-status/index.js +19 -11
  806. package/src/components/post-taxonomies/README.md +1 -1
  807. package/src/components/post-taxonomies/flat-term-selector.js +19 -5
  808. package/src/components/post-taxonomies/index.js +8 -1
  809. package/src/components/post-template/block-theme.js +5 -1
  810. package/src/components/post-template/classic-theme.js +8 -3
  811. package/src/components/post-template/create-new-template.js +4 -1
  812. package/src/components/post-template/hooks.js +8 -2
  813. package/src/components/post-template/panel.js +10 -2
  814. package/src/components/post-title/index.js +5 -12
  815. package/src/components/post-trash/check.js +9 -5
  816. package/src/components/post-url/panel.js +7 -2
  817. package/src/components/posts-per-page/index.js +7 -2
  818. package/src/components/preview-dropdown/index.js +1 -1
  819. package/src/components/provider/index.native.js +3 -11
  820. package/src/components/provider/use-block-editor-settings.js +25 -11
  821. package/src/components/save-publish-panels/index.js +31 -24
  822. package/src/components/sidebar/index.js +2 -7
  823. package/src/components/sidebar/post-summary.js +0 -2
  824. package/src/components/site-discussion/index.js +9 -4
  825. package/src/components/template-content-panel/index.js +29 -4
  826. package/src/components/visual-editor/edit-template-blocks-notification.js +5 -1
  827. package/src/components/visual-editor/index.js +6 -3
  828. package/src/components/visual-editor/style.scss +1 -2
  829. package/src/{hooks → components/visual-editor}/use-select-nearest-editable-block.js +1 -1
  830. package/src/dataviews/actions/delete-post.tsx +109 -0
  831. package/src/{components/post-actions/export-pattern-action.js → dataviews/actions/export-pattern.tsx} +19 -19
  832. package/src/dataviews/actions/index.ts +25 -0
  833. package/src/dataviews/actions/reset-post.tsx +144 -0
  834. package/src/dataviews/actions/utils.ts +54 -0
  835. package/src/dataviews/store/private-actions.ts +2 -2
  836. package/src/dataviews/store/private-selectors.ts +13 -6
  837. package/src/dataviews/store/reducer.ts +12 -5
  838. package/src/dataviews/types.ts +33 -0
  839. package/src/hooks/pattern-overrides.js +5 -2
  840. package/src/index.js +0 -1
  841. package/src/private-apis.js +8 -0
  842. package/src/private-apis.native.js +0 -2
  843. package/src/store/private-actions.js +1 -6
  844. package/src/store/private-selectors.js +0 -25
  845. package/src/store/test/actions.js +9 -3
  846. package/src/store/utils/is-template-revertable.js +8 -8
  847. package/src/style.scss +0 -1
  848. package/src/utils/media-upload/index.js +38 -3
  849. package/tsconfig.json +3 -2
  850. package/tsconfig.tsbuildinfo +1 -1
  851. package/build/bindings/index.js +0 -22
  852. package/build/bindings/index.js.map +0 -1
  853. package/build/components/post-actions/export-pattern-action.js.map +0 -1
  854. package/build/components/post-actions/export-pattern-action.native.js +0 -11
  855. package/build/components/post-actions/export-pattern-action.native.js.map +0 -1
  856. package/build/components/template-areas/index.js +0 -84
  857. package/build/components/template-areas/index.js.map +0 -1
  858. package/build/hooks/use-select-nearest-editable-block.js.map +0 -1
  859. package/build/store/utils/get-filtered-template-parts.js +0 -71
  860. package/build/store/utils/get-filtered-template-parts.js.map +0 -1
  861. package/build/utils/set-nested-value.js +0 -44
  862. package/build/utils/set-nested-value.js.map +0 -1
  863. package/build-module/bindings/index.js +0 -17
  864. package/build-module/bindings/index.js.map +0 -1
  865. package/build-module/components/post-actions/export-pattern-action.js.map +0 -1
  866. package/build-module/components/post-actions/export-pattern-action.native.js +0 -5
  867. package/build-module/components/post-actions/export-pattern-action.native.js.map +0 -1
  868. package/build-module/components/template-areas/index.js +0 -78
  869. package/build-module/components/template-areas/index.js.map +0 -1
  870. package/build-module/hooks/use-select-nearest-editable-block.js.map +0 -1
  871. package/build-module/store/utils/get-filtered-template-parts.js +0 -64
  872. package/build-module/store/utils/get-filtered-template-parts.js.map +0 -1
  873. package/build-module/utils/set-nested-value.js +0 -38
  874. package/build-module/utils/set-nested-value.js.map +0 -1
  875. package/src/bindings/index.js +0 -15
  876. package/src/components/post-actions/export-pattern-action.native.js +0 -4
  877. package/src/components/template-areas/index.js +0 -94
  878. package/src/components/template-areas/style.scss +0 -22
  879. package/src/store/utils/get-filtered-template-parts.js +0 -69
  880. package/src/store/utils/test/get-filtered-template-parts.js +0 -189
  881. package/src/utils/set-nested-value.js +0 -39
  882. /package/src/store/{constants.js → constants.ts} +0 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 14.4.0 (2024-07-24)
6
+
7
+ ### Deprecations
8
+
9
+ - `PostTaxonomiesFlatTermSelector`: Deprecate bottom margin. Add a `__nextHasNoMarginBottom` prop to start opting into the margin-free styles that will become the default in a future version, currently scheduled to be WordPress 7.0 ([#63491](https://github.com/WordPress/gutenberg/pull/63491)).
10
+
11
+ ## 14.3.0 (2024-07-10)
12
+
5
13
  ## 14.2.0 (2024-06-26)
6
14
 
7
15
  ## 14.1.0 (2024-06-15)
package/README.md CHANGED
@@ -532,7 +532,7 @@ _Returns_
532
532
 
533
533
  ### PageAttributesOrder
534
534
 
535
- Renders the Page Attributes Order component. A number input in an editor interface for setting the order of a given page.
535
+ Renders the Page Attributes Order component. A number input in an editor interface for setting the order of a given page. The component is now not used in core but was kept for backward compatibility.
536
536
 
537
537
  _Returns_
538
538
 
@@ -1364,6 +1364,7 @@ _Parameters_
1364
1364
 
1365
1365
  - _props_ `Object`: The component props.
1366
1366
  - _props.slug_ `string`: The slug of the taxonomy.
1367
+ - _props.\_\_nextHasNoMarginBottom_ `boolean`: Start opting into the new margin-free styles that will become the default in a future version, currently scheduled to be WordPress 7.0. (The prop can be safely removed once this happens.)
1367
1368
 
1368
1369
  _Returns_
1369
1370
 
@@ -0,0 +1,65 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.bootstrapBlockBindingsSourcesFromServer = bootstrapBlockBindingsSourcesFromServer;
8
+ exports.registerCoreBlockBindingsSources = registerCoreBlockBindingsSources;
9
+ var _blocks = require("@wordpress/blocks");
10
+ var _data = require("@wordpress/data");
11
+ var _patternOverrides = _interopRequireDefault(require("./pattern-overrides"));
12
+ var _postMeta = _interopRequireDefault(require("./post-meta"));
13
+ var _lockUnlock = require("../lock-unlock");
14
+ /**
15
+ * WordPress dependencies
16
+ */
17
+
18
+ /**
19
+ * Internal dependencies
20
+ */
21
+
22
+ /**
23
+ * Function to register core block bindings sources provided by the editor.
24
+ *
25
+ * @example
26
+ * ```js
27
+ * import { registerCoreBlockBindingsSources } from '@wordpress/editor';
28
+ *
29
+ * registerCoreBlockBindingsSources();
30
+ * ```
31
+ */
32
+ function registerCoreBlockBindingsSources() {
33
+ const {
34
+ registerBlockBindingsSource
35
+ } = (0, _lockUnlock.unlock)(_blocks.privateApis);
36
+ registerBlockBindingsSource(_patternOverrides.default);
37
+ registerBlockBindingsSource(_postMeta.default);
38
+ }
39
+
40
+ /**
41
+ * Function to bootstrap core block bindings sources defined in the server.
42
+ *
43
+ * @param {Object} sources Object containing the sources to bootstrap.
44
+ *
45
+ * @example
46
+ * ```js
47
+ * import { bootstrapBlockBindingsSourcesFromServer } from '@wordpress/editor';
48
+ *
49
+ * bootstrapBlockBindingsSourcesFromServer( sources );
50
+ * ```
51
+ */
52
+ function bootstrapBlockBindingsSourcesFromServer(sources) {
53
+ if (sources) {
54
+ const {
55
+ addBootstrappedBlockBindingsSource
56
+ } = (0, _lockUnlock.unlock)((0, _data.dispatch)(_blocks.store));
57
+ for (const [name, args] of Object.entries(sources)) {
58
+ addBootstrappedBlockBindingsSource({
59
+ name,
60
+ ...args
61
+ });
62
+ }
63
+ }
64
+ }
65
+ //# sourceMappingURL=api.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_blocks","require","_data","_patternOverrides","_interopRequireDefault","_postMeta","_lockUnlock","registerCoreBlockBindingsSources","registerBlockBindingsSource","unlock","blocksPrivateApis","patternOverrides","postMeta","bootstrapBlockBindingsSourcesFromServer","sources","addBootstrappedBlockBindingsSource","dispatch","blocksStore","name","args","Object","entries"],"sources":["@wordpress/editor/src/bindings/api.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tprivateApis as blocksPrivateApis,\n\tstore as blocksStore,\n} from '@wordpress/blocks';\nimport { dispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport patternOverrides from './pattern-overrides';\nimport postMeta from './post-meta';\nimport { unlock } from '../lock-unlock';\n\n/**\n * Function to register core block bindings sources provided by the editor.\n *\n * @example\n * ```js\n * import { registerCoreBlockBindingsSources } from '@wordpress/editor';\n *\n * registerCoreBlockBindingsSources();\n * ```\n */\nexport function registerCoreBlockBindingsSources() {\n\tconst { registerBlockBindingsSource } = unlock( blocksPrivateApis );\n\tregisterBlockBindingsSource( patternOverrides );\n\tregisterBlockBindingsSource( postMeta );\n}\n\n/**\n * Function to bootstrap core block bindings sources defined in the server.\n *\n * @param {Object} sources Object containing the sources to bootstrap.\n *\n * @example\n * ```js\n * import { bootstrapBlockBindingsSourcesFromServer } from '@wordpress/editor';\n *\n * bootstrapBlockBindingsSourcesFromServer( sources );\n * ```\n */\nexport function bootstrapBlockBindingsSourcesFromServer( sources ) {\n\tif ( sources ) {\n\t\tconst { addBootstrappedBlockBindingsSource } = unlock(\n\t\t\tdispatch( blocksStore )\n\t\t);\n\t\tfor ( const [ name, args ] of Object.entries( sources ) ) {\n\t\t\taddBootstrappedBlockBindingsSource( {\n\t\t\t\tname,\n\t\t\t\t...args,\n\t\t\t} );\n\t\t}\n\t}\n}\n"],"mappings":";;;;;;;;AAGA,IAAAA,OAAA,GAAAC,OAAA;AAIA,IAAAC,KAAA,GAAAD,OAAA;AAKA,IAAAE,iBAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,SAAA,GAAAD,sBAAA,CAAAH,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAdA;AACA;AACA;;AAOA;AACA;AACA;;AAKA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASM,gCAAgCA,CAAA,EAAG;EAClD,MAAM;IAAEC;EAA4B,CAAC,GAAG,IAAAC,kBAAM,EAAEC,mBAAkB,CAAC;EACnEF,2BAA2B,CAAEG,yBAAiB,CAAC;EAC/CH,2BAA2B,CAAEI,iBAAS,CAAC;AACxC;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAASC,uCAAuCA,CAAEC,OAAO,EAAG;EAClE,IAAKA,OAAO,EAAG;IACd,MAAM;MAAEC;IAAmC,CAAC,GAAG,IAAAN,kBAAM,EACpD,IAAAO,cAAQ,EAAEC,aAAY,CACvB,CAAC;IACD,KAAM,MAAM,CAAEC,IAAI,EAAEC,IAAI,CAAE,IAAIC,MAAM,CAACC,OAAO,CAAEP,OAAQ,CAAC,EAAG;MACzDC,kCAAkC,CAAE;QACnCG,IAAI;QACJ,GAAGC;MACJ,CAAE,CAAC;IACJ;EACD;AACD","ignoreList":[]}
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _i18n = require("@wordpress/i18n");
8
7
  var _blockEditor = require("@wordpress/block-editor");
9
8
  /**
10
9
  * WordPress dependencies
@@ -13,30 +12,36 @@ var _blockEditor = require("@wordpress/block-editor");
13
12
  const CONTENT = 'content';
14
13
  var _default = exports.default = {
15
14
  name: 'core/pattern-overrides',
16
- label: (0, _i18n._x)('Pattern Overrides', 'block bindings source'),
17
- getValue({
15
+ getValues({
18
16
  registry,
19
17
  clientId,
20
- attributeName
18
+ context,
19
+ bindings
21
20
  }) {
21
+ const patternOverridesContent = context['pattern/overrides'];
22
22
  const {
23
- getBlockAttributes,
24
- getBlockParentsByBlockName
23
+ getBlockAttributes
25
24
  } = registry.select(_blockEditor.store);
26
25
  const currentBlockAttributes = getBlockAttributes(clientId);
27
- const [patternClientId] = getBlockParentsByBlockName(clientId, 'core/block', true);
28
- const overridableValue = getBlockAttributes(patternClientId)?.[CONTENT]?.[currentBlockAttributes?.metadata?.name]?.[attributeName];
26
+ const overridesValues = {};
27
+ for (const attributeName of Object.keys(bindings)) {
28
+ const overridableValue = patternOverridesContent?.[currentBlockAttributes?.metadata?.name]?.[attributeName];
29
29
 
30
- // If there is no pattern client ID, or it is not overwritten, return the default value.
31
- if (!patternClientId || overridableValue === undefined) {
32
- return currentBlockAttributes[attributeName];
30
+ // If it has not been overriden, return the original value.
31
+ // Check undefined because empty string is a valid value.
32
+ if (overridableValue === undefined) {
33
+ overridesValues[attributeName] = currentBlockAttributes[attributeName];
34
+ continue;
35
+ } else {
36
+ overridesValues[attributeName] = overridableValue === '' ? undefined : overridableValue;
37
+ }
33
38
  }
34
- return overridableValue === '' ? undefined : overridableValue;
39
+ return overridesValues;
35
40
  },
36
41
  setValues({
37
42
  registry,
38
43
  clientId,
39
- attributes
44
+ bindings
40
45
  }) {
41
46
  const {
42
47
  getBlockAttributes,
@@ -50,6 +55,14 @@ var _default = exports.default = {
50
55
  }
51
56
  const [patternClientId] = getBlockParentsByBlockName(clientId, 'core/block', true);
52
57
 
58
+ // Extract the updated attributes from the source bindings.
59
+ const attributes = Object.entries(bindings).reduce((attrs, [key, {
60
+ newValue
61
+ }]) => {
62
+ attrs[key] = newValue;
63
+ return attrs;
64
+ }, {});
65
+
53
66
  // If there is no pattern client ID, sync blocks with the same name and same attributes.
54
67
  if (!patternClientId) {
55
68
  const syncBlocksWithSameName = blocks => {
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_blockEditor","CONTENT","_default","exports","default","name","label","_x","getValue","registry","clientId","attributeName","getBlockAttributes","getBlockParentsByBlockName","select","blockEditorStore","currentBlockAttributes","patternClientId","overridableValue","metadata","undefined","setValues","attributes","getBlocks","blockName","syncBlocksWithSameName","blocks","block","dispatch","updateBlockAttributes","innerBlocks","currentBindingValue","Object","entries","reduce","acc","key","value","canUserEditValue"],"sources":["@wordpress/editor/src/bindings/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst CONTENT = 'content';\n\nexport default {\n\tname: 'core/pattern-overrides',\n\tlabel: _x( 'Pattern Overrides', 'block bindings source' ),\n\tgetValue( { registry, clientId, attributeName } ) {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName } =\n\t\t\tregistry.select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tclientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\tconst overridableValue =\n\t\t\tgetBlockAttributes( patternClientId )?.[ CONTENT ]?.[\n\t\t\t\tcurrentBlockAttributes?.metadata?.name\n\t\t\t]?.[ attributeName ];\n\n\t\t// If there is no pattern client ID, or it is not overwritten, return the default value.\n\t\tif ( ! patternClientId || overridableValue === undefined ) {\n\t\t\treturn currentBlockAttributes[ attributeName ];\n\t\t}\n\n\t\treturn overridableValue === '' ? undefined : overridableValue;\n\t},\n\tsetValues( { registry, clientId, attributes } ) {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =\n\t\t\tregistry.select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\t\tconst blockName = currentBlockAttributes?.metadata?.name;\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tclientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\t// If there is no pattern client ID, sync blocks with the same name and same attributes.\n\t\tif ( ! patternClientId ) {\n\t\t\tconst syncBlocksWithSameName = ( blocks ) => {\n\t\t\t\tfor ( const block of blocks ) {\n\t\t\t\t\tif ( block.attributes?.metadata?.name === blockName ) {\n\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t\t\t.updateBlockAttributes(\n\t\t\t\t\t\t\t\tblock.clientId,\n\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tsyncBlocksWithSameName( block.innerBlocks );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsyncBlocksWithSameName( getBlocks() );\n\t\t\treturn;\n\t\t}\n\t\tconst currentBindingValue =\n\t\t\tgetBlockAttributes( patternClientId )?.[ CONTENT ];\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.updateBlockAttributes( patternClientId, {\n\t\t\t\t[ CONTENT ]: {\n\t\t\t\t\t...currentBindingValue,\n\t\t\t\t\t[ blockName ]: {\n\t\t\t\t\t\t...currentBindingValue?.[ blockName ],\n\t\t\t\t\t\t...Object.entries( attributes ).reduce(\n\t\t\t\t\t\t\t( acc, [ key, value ] ) => {\n\t\t\t\t\t\t\t\t// TODO: We need a way to represent `undefined` in the serialized overrides.\n\t\t\t\t\t\t\t\t// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871\n\t\t\t\t\t\t\t\t// We use an empty string to represent undefined for now until\n\t\t\t\t\t\t\t\t// we support a richer format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A;YACA;YACAF,GAAG,CAAEC,GAAG,CAAE,GAAGC,KAAK,KAAKjB,SAAS,GAAG,EAAE,GAAGiB,KAAK;YAC7C,OAAOF,GAAG;UACX,CAAC,EACD,CAAC,CACF;QACD;MACD;IACD,CAAE,CAAC;EACL,CAAC;EACDG,gBAAgB,EAAEA,CAAA,KAAM;AACzB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["_blockEditor","require","CONTENT","_default","exports","default","name","getValues","registry","clientId","context","bindings","patternOverridesContent","getBlockAttributes","select","blockEditorStore","currentBlockAttributes","overridesValues","attributeName","Object","keys","overridableValue","metadata","undefined","setValues","getBlockParentsByBlockName","getBlocks","blockName","patternClientId","attributes","entries","reduce","attrs","key","newValue","syncBlocksWithSameName","blocks","block","dispatch","updateBlockAttributes","innerBlocks","currentBindingValue","acc","value","canUserEditValue"],"sources":["@wordpress/editor/src/bindings/pattern-overrides.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\nconst CONTENT = 'content';\n\nexport default {\n\tname: 'core/pattern-overrides',\n\tgetValues( { registry, clientId, context, bindings } ) {\n\t\tconst patternOverridesContent = context[ 'pattern/overrides' ];\n\t\tconst { getBlockAttributes } = registry.select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\n\t\tconst overridesValues = {};\n\t\tfor ( const attributeName of Object.keys( bindings ) ) {\n\t\t\tconst overridableValue =\n\t\t\t\tpatternOverridesContent?.[\n\t\t\t\t\tcurrentBlockAttributes?.metadata?.name\n\t\t\t\t]?.[ attributeName ];\n\n\t\t\t// If it has not been overriden, return the original value.\n\t\t\t// Check undefined because empty string is a valid value.\n\t\t\tif ( overridableValue === undefined ) {\n\t\t\t\toverridesValues[ attributeName ] =\n\t\t\t\t\tcurrentBlockAttributes[ attributeName ];\n\t\t\t\tcontinue;\n\t\t\t} else {\n\t\t\t\toverridesValues[ attributeName ] =\n\t\t\t\t\toverridableValue === '' ? undefined : overridableValue;\n\t\t\t}\n\t\t}\n\t\treturn overridesValues;\n\t},\n\tsetValues( { registry, clientId, bindings } ) {\n\t\tconst { getBlockAttributes, getBlockParentsByBlockName, getBlocks } =\n\t\t\tregistry.select( blockEditorStore );\n\t\tconst currentBlockAttributes = getBlockAttributes( clientId );\n\t\tconst blockName = currentBlockAttributes?.metadata?.name;\n\t\tif ( ! blockName ) {\n\t\t\treturn;\n\t\t}\n\n\t\tconst [ patternClientId ] = getBlockParentsByBlockName(\n\t\t\tclientId,\n\t\t\t'core/block',\n\t\t\ttrue\n\t\t);\n\n\t\t// Extract the updated attributes from the source bindings.\n\t\tconst attributes = Object.entries( bindings ).reduce(\n\t\t\t( attrs, [ key, { newValue } ] ) => {\n\t\t\t\tattrs[ key ] = newValue;\n\t\t\t\treturn attrs;\n\t\t\t},\n\t\t\t{}\n\t\t);\n\n\t\t// If there is no pattern client ID, sync blocks with the same name and same attributes.\n\t\tif ( ! patternClientId ) {\n\t\t\tconst syncBlocksWithSameName = ( blocks ) => {\n\t\t\t\tfor ( const block of blocks ) {\n\t\t\t\t\tif ( block.attributes?.metadata?.name === blockName ) {\n\t\t\t\t\t\tregistry\n\t\t\t\t\t\t\t.dispatch( blockEditorStore )\n\t\t\t\t\t\t\t.updateBlockAttributes(\n\t\t\t\t\t\t\t\tblock.clientId,\n\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t);\n\t\t\t\t\t}\n\t\t\t\t\tsyncBlocksWithSameName( block.innerBlocks );\n\t\t\t\t}\n\t\t\t};\n\n\t\t\tsyncBlocksWithSameName( getBlocks() );\n\t\t\treturn;\n\t\t}\n\t\tconst currentBindingValue =\n\t\t\tgetBlockAttributes( patternClientId )?.[ CONTENT ];\n\t\tregistry\n\t\t\t.dispatch( blockEditorStore )\n\t\t\t.updateBlockAttributes( patternClientId, {\n\t\t\t\t[ CONTENT ]: {\n\t\t\t\t\t...currentBindingValue,\n\t\t\t\t\t[ blockName ]: {\n\t\t\t\t\t\t...currentBindingValue?.[ blockName ],\n\t\t\t\t\t\t...Object.entries( attributes ).reduce(\n\t\t\t\t\t\t\t( acc, [ key, value ] ) => {\n\t\t\t\t\t\t\t\t// TODO: We need a way to represent `undefined` in the serialized overrides.\n\t\t\t\t\t\t\t\t// Also see: https://github.com/WordPress/gutenberg/pull/57249#discussion_r1452987871\n\t\t\t\t\t\t\t\t// We use an empty string to represent undefined for now until\n\t\t\t\t\t\t\t\t// we support a richer format for overrides and the block bindings API.\n\t\t\t\t\t\t\t\tacc[ key ] = value === undefined ? '' : value;\n\t\t\t\t\t\t\t\treturn acc;\n\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t{}\n\t\t\t\t\t\t),\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t} );\n\t},\n\tcanUserEditValue: () => true,\n};\n"],"mappings":";;;;;;AAGA,IAAAA,YAAA,GAAAC,OAAA;AAHA;AACA;AACA;;AAGA,MAAMC,OAAO,GAAG,SAAS;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEX;EACdC,IAAI,EAAE,wBAAwB;EAC9BC,SAASA,CAAE;IAAEC,QAAQ;IAAEC,QAAQ;IAAEC,OAAO;IAAEC;EAAS,CAAC,EAAG;IACtD,MAAMC,uBAAuB,GAAGF,OAAO,CAAE,mBAAmB,CAAE;IAC9D,MAAM;MAAEG;IAAmB,CAAC,GAAGL,QAAQ,CAACM,MAAM,CAAEC,kBAAiB,CAAC;IAClE,MAAMC,sBAAsB,GAAGH,kBAAkB,CAAEJ,QAAS,CAAC;IAE7D,MAAMQ,eAAe,GAAG,CAAC,CAAC;IAC1B,KAAM,MAAMC,aAAa,IAAIC,MAAM,CAACC,IAAI,CAAET,QAAS,CAAC,EAAG;MACtD,MAAMU,gBAAgB,GACrBT,uBAAuB,GACtBI,sBAAsB,EAAEM,QAAQ,EAAEhB,IAAI,CACtC,GAAIY,aAAa,CAAE;;MAErB;MACA;MACA,IAAKG,gBAAgB,KAAKE,SAAS,EAA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doB,UACD,CAAC;UACH;UACAM,sBAAsB,CAAEE,KAAK,CAACG,WAAY,CAAC;QAC5C;MACD,CAAC;MAEDL,sBAAsB,CAAET,SAAS,CAAC,CAAE,CAAC;MACrC;IACD;IACA,MAAMe,mBAAmB,GACxB5B,kBAAkB,CAAEe,eAAgB,CAAC,GAAI1B,OAAO,CAAE;IACnDM,QAAQ,CACN8B,QAAQ,CAAEvB,kBAAiB,CAAC,CAC5BwB,qBAAqB,CAAEX,eAAe,EAAE;MACxC,CAAE1B,OAAO,GAAI;QACZ,GAAGuC,mBAAmB;QACtB,CAAEd,SAAS,GAAI;UACd,GAAGc,mBAAmB,GAAId,SAAS,CAAE;UACrC,GAAGR,MAAM,CAACW,OAAO,CAAED,UAAW,CAAC,CAACE,MAAM,CACrC,CAAEW,GAAG,EAAE,CAAET,GAAG,EAAEU,KAAK,CAAE,KAAM;YAC1B;YACA;YACA;YACA;YACAD,GAAG,CAAET,GAAG,CAAE,GAAGU,KAAK,KAAKpB,SAAS,GAAG,EAAE,GAAGoB,KAAK;YAC7C,OAAOD,GAAG;UACX,CAAC,EACD,CAAC,CACF;QACD;MACD;IACD,CAAE,CAAC;EACL,CAAC;EACDE,gBAAgB,EAAEA,CAAA,KAAM;AACzB,CAAC","ignoreList":[]}
@@ -5,7 +5,6 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.default = void 0;
7
7
  var _coreData = require("@wordpress/core-data");
8
- var _i18n = require("@wordpress/i18n");
9
8
  var _store = require("../store");
10
9
  /**
11
10
  * WordPress dependencies
@@ -15,29 +14,37 @@ var _store = require("../store");
15
14
  */
16
15
  var _default = exports.default = {
17
16
  name: 'core/post-meta',
18
- label: (0, _i18n._x)('Post Meta', 'block bindings source'),
19
17
  getPlaceholder({
20
18
  args
21
19
  }) {
22
20
  return args.key;
23
21
  },
24
- getValue({
22
+ getValues({
25
23
  registry,
26
24
  context,
27
- args
25
+ bindings
28
26
  }) {
29
- return registry.select(_coreData.store).getEditedEntityRecord('postType', context?.postType, context?.postId).meta?.[args.key];
27
+ const meta = registry.select(_coreData.store).getEditedEntityRecord('postType', context?.postType, context?.postId)?.meta;
28
+ const newValues = {};
29
+ for (const [attributeName, source] of Object.entries(bindings)) {
30
+ newValues[attributeName] = meta?.[source.args.key];
31
+ }
32
+ return newValues;
30
33
  },
31
- setValue({
34
+ setValues({
32
35
  registry,
33
36
  context,
34
- args,
35
- value
37
+ bindings
36
38
  }) {
39
+ const newMeta = {};
40
+ Object.values(bindings).forEach(({
41
+ args,
42
+ newValue
43
+ }) => {
44
+ newMeta[args.key] = newValue;
45
+ });
37
46
  registry.dispatch(_coreData.store).editEntityRecord('postType', context?.postType, context?.postId, {
38
- meta: {
39
- [args.key]: value
40
- }
47
+ meta: newMeta
41
48
  });
42
49
  },
43
50
  canUserEditValue({
@@ -45,6 +52,10 @@ var _default = exports.default = {
45
52
  context,
46
53
  args
47
54
  }) {
55
+ // Lock editing in query loop.
56
+ if (context?.query || context?.queryId) {
57
+ return false;
58
+ }
48
59
  const postType = context?.postType || select(_store.store).getCurrentPostType();
49
60
 
50
61
  // Check that editing is happening in the post editor and not a template.
@@ -59,7 +70,11 @@ var _default = exports.default = {
59
70
  }
60
71
 
61
72
  // Check that the user has the capability to edit post meta.
62
- const canUserEdit = select(_coreData.store).canUserEditEntityRecord('postType', context?.postType, context?.postId);
73
+ const canUserEdit = select(_coreData.store).canUser('update', {
74
+ kind: 'postType',
75
+ name: context?.postType,
76
+ id: context?.postId
77
+ });
63
78
  if (!canUserEdit) {
64
79
  return false;
65
80
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_coreData","require","_i18n","_store","_default","exports","default","name","label","_x","getPlaceholder","args","key","getValue","registry","context","select","coreDataStore","getEditedEntityRecord","postType","postId","meta","setValue","value","dispatch","editEntityRecord","canUserEditValue","editorStore","getCurrentPostType","isFieldExposed","getEntityRecord","canUserEdit","canUserEditEntityRecord"],"sources":["@wordpress/editor/src/bindings/post-meta.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreDataStore } from '@wordpress/core-data';\nimport { _x } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../store';\n\nexport default {\n\tname: 'core/post-meta',\n\tlabel: _x( 'Post Meta', 'block bindings source' ),\n\tgetPlaceholder( { args } ) {\n\t\treturn args.key;\n\t},\n\tgetValue( { registry, context, args } ) {\n\t\treturn 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?.[ args.key ];\n\t},\n\tsetValue( { registry, context, args, value } ) {\n\t\tregistry\n\t\t\t.dispatch( coreDataStore )\n\t\t\t.editEntityRecord( 'postType', context?.postType, context?.postId, {\n\t\t\t\tmeta: {\n\t\t\t\t\t[ args.key ]: value,\n\t\t\t\t},\n\t\t\t} );\n\t},\n\tcanUserEditValue( { select, context, args } ) {\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 ).canUserEditEntityRecord(\n\t\t\t'postType',\n\t\t\tcontext?.postType,\n\t\t\tcontext?.postId\n\t\t);\n\t\tif ( ! canUserEdit ) {\n\t\t\treturn false;\n\t\t}\n\n\t\treturn true;\n\t},\n};\n"],"mappings":";;;;;;AAGA,IAAAA,SAAA,GAAAC,OAAA;AACA,IAAAC,KAAA,GAAAD,OAAA;AAKA,I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,OAAO,EAAEK,MACV,CAAC,EAAEC,IAAI,GAAIV,IAAI,CAACC,GAAG,CAAE;IAErB,IAAK,CAAEiB,cAAc,EAAG;MACvB,OAAO,KAAK;IACb;;IAEA;IACA,MAAME,WAAW,GAAGf,MAAM,CAAEC,eAAc,CAAC,CAACe,uBAAuB,CAClE,UAAU,EACVjB,OAAO,EAAEI,QAAQ,EACjBJ,OAAO,EAAEK,MACV,CAAC;IACD,IAAK,CAAEW,WAAW,EAAG;MACpB,OAAO,KAAK;IACb;IAEA,OAAO,IAAI;EACZ;AACD,CAAC","ignoreList":[]}
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"],"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};\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,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AAe,CAChE,UAAU,EACVpB,QAAQ,EACRN,OAAO,EAAEO,MACV,CAAC,EAAEL,IAAI,GAAIN,IAAI,CAACC,GAAG,CAAE;IAErB,IAAK,CAAE4B,cAAc,EAAG;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;AACD,CAAC","ignoreList":[]}
@@ -55,7 +55,10 @@ function ContentOnlySettingsMenuItems({
55
55
  record = select(_coreData.store).getEntityRecord('postType', 'wp_template', templateId);
56
56
  }
57
57
  }
58
- const _canEditTemplates = select(_coreData.store).canUser('create', 'templates');
58
+ const _canEditTemplates = select(_coreData.store).canUser('create', {
59
+ kind: 'postType',
60
+ name: 'wp_template'
61
+ });
59
62
  return {
60
63
  canEditTemplates: _canEditTemplates,
61
64
  entity: record,
@@ -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","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(\n\t\t\t\t'create',\n\t\t\t\t'templates'\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,CAAES,eAAU,CAAC,CAACC,eAAe,CAC3C,UAAU,EACV,UAAU,EACVN,kBAAkB,CAAEG,aAAc,CAAC,CAACI,GACrC,CAAC;IACF,CAAC,MAAM;MACN,MAAM;QAAEC;MAAqB,CAA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QAAA;IAAAC,QAAA,gBACC,IAAAnC,WAAA,CAAA2B,GAAA,EAACnC,YAAA,CAAA4C,oCAA0B;MAAAD,QAAA,eAC1B,IAAAnC,WAAA,CAAA2B,GAAA,EAAChC,WAAA,CAAA0C,QAAQ;QACRC,OAAO,EAAGA,CAAA,KAAM;UACfa,WAAW,CAAEJ,oBAAqB,CAAC;UACnCG,sBAAsB,CAAEH,oBAAqB,CAAC;UAC9C5C,OAAO,CAAC,CAAC;QACV,CAAG;QAAAgC,QAAA,EAED,IAAAH,QAAE,EAAE,QAAS;MAAC,CACP;IAAC,CACgB,CAAC,eAC7B,IAAAhC,WAAA,CAAA2B,GAAA,EAAChC,WAAA,CAAAgD,kBAAI;MACJC,OAAO,EAAC,OAAO;MACfC,EAAE,EAAC,GAAG;MACNC,SAAS,EAAC,gDAAgD;MAAAX,QAAA,EAExD,IAAAH,QAAE,EACH,4FACD;IAAC,CACI,CAAC;EAAA,CACN,CAAC;AAEL;AAEe,SAASsB,uBAAuBA,CAAA,EAAG;EACjD,oBACC,IAAAtD,WAAA,CAAA2B,GAAA,EAACnC,YAAA,CAAA+D,yBAAyB;IAAApB,QAAA,EACvBA,CAAE;MAAEqB,iBAAiB;MAAErD;IAAQ,CAAC,KACjCqD,iBAAiB,CAACC,MAAM,KAAK,CAAC,iBAC7B,IAAAzD,WAAA,CAAA2B,GAAA,EAAC1B,4BAA4B;MAC5BC,QAAQ,EAAGsD,iBAAiB,CAAE,CAAC,CAAI;MACnCrD,OAAO,EAAGA;IAAS,CACnB;EACD,CAEwB,CAAC;AAE9B","ignoreList":[]}
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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,EAAGA;IAAS,CACnB;EACD,CAEwB,CAAC;AAE9B","ignoreList":[]}
@@ -38,9 +38,13 @@ function BlogTitle() {
38
38
  } = (0, _data.useSelect)(select => {
39
39
  const {
40
40
  getEntityRecord,
41
- getEditedEntityRecord
41
+ getEditedEntityRecord,
42
+ canUser
42
43
  } = select(_coreData.store);
43
- const siteSettings = getEntityRecord('root', 'site');
44
+ const siteSettings = canUser('read', {
45
+ kind: 'root',
46
+ name: 'site'
47
+ }) ? getEntityRecord('root', 'site') : undefined;
44
48
  const _postsPageRecord = siteSettings?.page_for_posts ? getEditedEntityRecord('postType', 'page', siteSettings?.page_for_posts) : EMPTY_OBJECT;
45
49
  const {
46
50
  getEditedPostAttribute,
@@ -1 +1 @@
1
- {"version":3,"names":["_i18n","require","_compose","_data","_coreData","_htmlEntities","_components","_element","_blockEditor","_constants","_postPanelRow","_interopRequireDefault","_store","_jsxRuntime","EMPTY_OBJECT","BlogTitle","editEntityRecord","useDispatch","coreStore","postsPageTitle","postsPageId","isTemplate","postSlug","useSelect","select","getEntityRecord","getEditedEntityRecord","siteSettings","_postsPageRecord","page_for_posts","getEditedPostAttribute","getCurrentPostType","editorStore","id","title","TEMPLATE_POST_TYPE","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","offset","shift","includes","setPostsPageTitle","newValue","decodedTitle","decodeEntities","jsx","default","label","__","ref","children","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","Button","size","variant","sprintf","onClick","renderContent","onClose","jsxs","Fragment","__experimentalInspectorPopoverHeader","__experimentalInputControl","placeholder","value","onChange","debounce","help","hideLabelFromVision"],"sources":["@wordpress/editor/src/components/blog-title/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { debounce } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\tButton,\n\tDropdown,\n\t__experimentalInputControl as InputControl,\n} from '@wordpress/components';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_OBJECT = {};\n\nexport default function BlogTitle() {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postsPageTitle, postsPageId, isTemplate, postSlug } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, getEditedEntityRecord } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteSettings = getEntityRecord( 'root', 'site' );\n\t\t\tconst _postsPageRecord = siteSettings?.page_for_posts\n\t\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\tsiteSettings?.page_for_posts\n\t\t\t\t )\n\t\t\t\t: EMPTY_OBJECT;\n\t\t\tconst { getEditedPostAttribute, getCurrentPostType } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tpostsPageId: _postsPageRecord?.id,\n\t\t\t\tpostsPageTitle: _postsPageRecord?.title,\n\t\t\t\tisTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,\n\t\t\t\tpostSlug: getEditedPostAttribute( 'slug' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tif (\n\t\t! isTemplate ||\n\t\t! [ 'home', 'index' ].includes( postSlug ) ||\n\t\t! postsPageId\n\t) {\n\t\treturn null;\n\t}\n\n\tconst setPostsPageTitle = ( newValue ) => {\n\t\teditEntityRecord( 'postType', 'page', postsPageId, {\n\t\t\ttitle: newValue,\n\t\t} );\n\t};\n\tconst decodedTitle = decodeEntities( postsPageTitle );\n\treturn (\n\t\t<PostPanelRow label={ __( 'Blog title' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tcontentClassName=\"editor-blog-title-dropdown__content\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t// translators: %s: Current post link.\n\t\t\t\t\t\t\t__( 'Change blog title: %s' ),\n\t\t\t\t\t\t\tdecodedTitle\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ decodedTitle }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Blog title' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tplaceholder={ __( 'No Title' ) }\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tvalue={ postsPageTitle }\n\t\t\t\t\t\t\tonChange={ debounce( setPostsPageTitle, 300 ) }\n\t\t\t\t\t\t\tlabel={ __( 'Blog title' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Set the Posts Page title. Appears in search results, and when the page is shared on social media.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OAAA;AAKA,IAAAQ,UAAA,GAAAR,OAAA;AACA,IAAAS,aAAA,GAAAC,sBAAA,CAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AAAmD,IAAAY,WAAA,GAAAZ,OAAA;AArBnD;AACA;AACA;;AAcA;AACA;AACA;;AAKA,MAAMa,YAAY,GAAG,CAAC,CAAC;AAER,SAASC,SAASA,CAAA,EAAG;EACnC,MAAM;IAAEC;EAAiB,CAAC,GAAG,IAAAC,iBAAW,EAAEC,eAAU,CAAC;EACrD,MAAM;IAAEC,cAAc;IAAEC,WAAW;IAAEC,UAAU;IAAEC;EAAS,CAAC,GAAG,IAAAC,eAAS,EACpEC,MAAM,IAAM;IACb,MAAM;MAAEC,eAAe;MAAEC;IAAsB,CAAC,GAC/CF,MAAM,CAAEN,eAAU,CAAC;IACpB,MAAMS,YAAY,GAAGF,eAAe,CAAE,MAAM,EAAE,MAAO,CAAC;IACtD,MAAMG,gBAAgB,GAAGD,YAAY,EAAEE,cAAc,GAClDH,qBAAqB,CACrB,UAAU,EACV,MAAM,EACNC,YAAY,EAAEE,cACd,CAAC,GACDf,YAAY;IACf,MAAM;MAAEgB,sBAAsB;MAAEC;I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ACtDC,YAAY;MACZC,YAAY,EAAGA,CAAE;QAAEC,MAAM;QAAEC;MAAS,CAAC,kBACpC,IAAAhD,WAAA,CAAAqC,GAAA,EAAC5C,WAAA,CAAAwD,MAAM;QACNC,IAAI,EAAC,SAAS;QACdC,OAAO,EAAC,UAAU;QAClB,iBAAgBJ,MAAQ;QACxB,cAAa,IAAAK,aAAO;QACnB;QACA,IAAAZ,QAAE,EAAE,uBAAwB,CAAC,EAC7BL,YACD,CAAG;QACHkB,OAAO,EAAGL,QAAU;QAAAN,QAAA,EAElBP;MAAY,CACP,CACN;MACHmB,aAAa,EAAGA,CAAE;QAAEC;MAAQ,CAAC,kBAC5B,IAAAvD,WAAA,CAAAwD,IAAA,EAAAxD,WAAA,CAAAyD,QAAA;QAAAf,QAAA,gBACC,IAAA1C,WAAA,CAAAqC,GAAA,EAAC1C,YAAA,CAAA+D,oCAAsB;UACtBrC,KAAK,EAAG,IAAAmB,QAAE,EAAE,YAAa,CAAG;UAC5Be,OAAO,EAAGA;QAAS,CACnB,CAAC,eACF,IAAAvD,WAAA,CAAAqC,GAAA,EAAC5C,WAAA,CAAAkE,0BAAY;UACZC,WAAW,EAAG,IAAApB,QAAE,EAAE,UAAW,CAAG;UAChCU,IAAI,EAAC,kBAAkB;UACvBW,KAAK,EAAGvD,cAAgB;UACxBwD,QAAQ,EAAG,IAAAC,iBAAQ,EAAE9B,iBAAiB,EAAE,GAAI,CAAG;UAC/CM,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa,CAAG;UAC5BwB,IAAI,EAAG,IAAAxB,QAAE,EACR,mGACD,CAAG;UACHyB,mBAAmB;QAAA,CACnB,CAAC;MAAA,CACD;IACA,CACH;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}
1
+ {"version":3,"names":["_i18n","require","_compose","_data","_coreData","_htmlEntities","_components","_element","_blockEditor","_constants","_postPanelRow","_interopRequireDefault","_store","_jsxRuntime","EMPTY_OBJECT","BlogTitle","editEntityRecord","useDispatch","coreStore","postsPageTitle","postsPageId","isTemplate","postSlug","useSelect","select","getEntityRecord","getEditedEntityRecord","canUser","siteSettings","kind","name","undefined","_postsPageRecord","page_for_posts","getEditedPostAttribute","getCurrentPostType","editorStore","id","title","TEMPLATE_POST_TYPE","popoverAnchor","setPopoverAnchor","useState","popoverProps","useMemo","anchor","placement","offset","shift","includes","setPostsPageTitle","newValue","decodedTitle","decodeEntities","jsx","default","label","__","ref","children","Dropdown","contentClassName","focusOnMount","renderToggle","isOpen","onToggle","Button","size","variant","sprintf","onClick","renderContent","onClose","jsxs","Fragment","__experimentalInspectorPopoverHeader","__experimentalInputControl","placeholder","value","onChange","debounce","help","hideLabelFromVision"],"sources":["@wordpress/editor/src/components/blog-title/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __, sprintf } from '@wordpress/i18n';\nimport { debounce } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { decodeEntities } from '@wordpress/html-entities';\nimport {\n\tButton,\n\tDropdown,\n\t__experimentalInputControl as InputControl,\n} from '@wordpress/components';\nimport { useState, useMemo } from '@wordpress/element';\nimport { __experimentalInspectorPopoverHeader as InspectorPopoverHeader } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport PostPanelRow from '../post-panel-row';\nimport { store as editorStore } from '../../store';\n\nconst EMPTY_OBJECT = {};\n\nexport default function BlogTitle() {\n\tconst { editEntityRecord } = useDispatch( coreStore );\n\tconst { postsPageTitle, postsPageId, isTemplate, postSlug } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, getEditedEntityRecord, canUser } =\n\t\t\t\tselect( coreStore );\n\t\t\tconst siteSettings = canUser( 'read', {\n\t\t\t\tkind: 'root',\n\t\t\t\tname: 'site',\n\t\t\t} )\n\t\t\t\t? getEntityRecord( 'root', 'site' )\n\t\t\t\t: undefined;\n\t\t\tconst _postsPageRecord = siteSettings?.page_for_posts\n\t\t\t\t? getEditedEntityRecord(\n\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t'page',\n\t\t\t\t\t\tsiteSettings?.page_for_posts\n\t\t\t\t )\n\t\t\t\t: EMPTY_OBJECT;\n\t\t\tconst { getEditedPostAttribute, getCurrentPostType } =\n\t\t\t\tselect( editorStore );\n\t\t\treturn {\n\t\t\t\tpostsPageId: _postsPageRecord?.id,\n\t\t\t\tpostsPageTitle: _postsPageRecord?.title,\n\t\t\t\tisTemplate: getCurrentPostType() === TEMPLATE_POST_TYPE,\n\t\t\t\tpostSlug: getEditedPostAttribute( 'slug' ),\n\t\t\t};\n\t\t},\n\t\t[]\n\t);\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\t// Memoize popoverProps to avoid returning a new object every time.\n\tconst popoverProps = useMemo(\n\t\t() => ( {\n\t\t\t// Anchor the popover to the middle of the entire row so that it doesn't\n\t\t\t// move around when the label changes.\n\t\t\tanchor: popoverAnchor,\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t} ),\n\t\t[ popoverAnchor ]\n\t);\n\n\tif (\n\t\t! isTemplate ||\n\t\t! [ 'home', 'index' ].includes( postSlug ) ||\n\t\t! postsPageId\n\t) {\n\t\treturn null;\n\t}\n\n\tconst setPostsPageTitle = ( newValue ) => {\n\t\teditEntityRecord( 'postType', 'page', postsPageId, {\n\t\t\ttitle: newValue,\n\t\t} );\n\t};\n\tconst decodedTitle = decodeEntities( postsPageTitle );\n\treturn (\n\t\t<PostPanelRow label={ __( 'Blog title' ) } ref={ setPopoverAnchor }>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tcontentClassName=\"editor-blog-title-dropdown__content\"\n\t\t\t\tfocusOnMount\n\t\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\tvariant=\"tertiary\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\taria-label={ sprintf(\n\t\t\t\t\t\t\t// translators: %s: Current post link.\n\t\t\t\t\t\t\t__( 'Change blog title: %s' ),\n\t\t\t\t\t\t\tdecodedTitle\n\t\t\t\t\t\t) }\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ decodedTitle }\n\t\t\t\t\t</Button>\n\t\t\t\t) }\n\t\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<InspectorPopoverHeader\n\t\t\t\t\t\t\ttitle={ __( 'Blog title' ) }\n\t\t\t\t\t\t\tonClose={ onClose }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<InputControl\n\t\t\t\t\t\t\tplaceholder={ __( 'No Title' ) }\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t\tvalue={ postsPageTitle }\n\t\t\t\t\t\t\tonChange={ debounce( setPostsPageTitle, 300 ) }\n\t\t\t\t\t\t\tlabel={ __( 'Blog title' ) }\n\t\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t\t'Set the Posts Page title. Appears in search results, and when the page is shared on social media.'\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</PostPanelRow>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,SAAA,GAAAH,OAAA;AACA,IAAAI,aAAA,GAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAL,OAAA;AAKA,IAAAM,QAAA,GAAAN,OAAA;AACA,IAAAO,YAAA,GAAAP,OA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AAGA,CAAE;QAAEC;MAAQ,CAAC,kBAC5B,IAAA3D,WAAA,CAAA4D,IAAA,EAAA5D,WAAA,CAAA6D,QAAA;QAAAf,QAAA,gBACC,IAAA9C,WAAA,CAAAyC,GAAA,EAAC9C,YAAA,CAAAmE,oCAAsB;UACtBrC,KAAK,EAAG,IAAAmB,QAAE,EAAE,YAAa,CAAG;UAC5Be,OAAO,EAAGA;QAAS,CACnB,CAAC,eACF,IAAA3D,WAAA,CAAAyC,GAAA,EAAChD,WAAA,CAAAsE,0BAAY;UACZC,WAAW,EAAG,IAAApB,QAAE,EAAE,UAAW,CAAG;UAChCU,IAAI,EAAC,kBAAkB;UACvBW,KAAK,EAAG3D,cAAgB;UACxB4D,QAAQ,EAAG,IAAAC,iBAAQ,EAAE9B,iBAAiB,EAAE,GAAI,CAAG;UAC/CM,KAAK,EAAG,IAAAC,QAAE,EAAE,YAAa,CAAG;UAC5BwB,IAAI,EAAG,IAAAxB,QAAE,EACR,mGACD,CAAG;UACHyB,mBAAmB;QAAA,CACnB,CAAC;MAAA,CACD;IACA,CACH;EAAC,CACW,CAAC;AAEjB","ignoreList":[]}
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
  Object.defineProperty(exports, "__esModule", {
5
5
  value: true
6
6
  });
7
- exports.default = void 0;
7
+ exports.default = CollapsibleBlockToolbar;
8
8
  var _clsx = _interopRequireDefault(require("clsx"));
9
9
  var _blockEditor = require("@wordpress/block-editor");
10
10
  var _element = require("@wordpress/element");
@@ -29,7 +29,7 @@ var _jsxRuntime = require("react/jsx-runtime");
29
29
  const {
30
30
  useHasBlockToolbar
31
31
  } = (0, _lockUnlock.unlock)(_blockEditor.privateApis);
32
- function CollapsableBlockToolbar({
32
+ function CollapsibleBlockToolbar({
33
33
  isCollapsed,
34
34
  onToggle
35
35
  }) {
@@ -72,5 +72,4 @@ function CollapsableBlockToolbar({
72
72
  })]
73
73
  });
74
74
  }
75
- var _default = exports.default = CollapsableBlockToolbar;
76
75
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_element","_components","_i18n","_icons","_data","_lockUnlock","_jsxRuntime","useHasBlockToolbar","unlock","blockEditorPrivateApis","CollapsableBlockToolbar","isCollapsed","onToggle","blockSelectionStart","useSelect","select","blockEditorStore","getBlockSelectionStart","hasBlockToolbar","hasBlockSelection","useEffect","jsxs","Fragment","children","jsx","className","clsx","BlockToolbar","hideDragHandle","Popover","Slot","name","Button","icon","next","previous","onClick","label","__","size","_default","exports","default"],"sources":["@wordpress/editor/src/components/collapsible-block-toolbar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { Button, Popover } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useHasBlockToolbar } = unlock( blockEditorPrivateApis );\n\nfunction CollapsableBlockToolbar( { isCollapsed, onToggle } ) {\n\tconst { blockSelectionStart } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tblockSelectionStart:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\tconst hasBlockToolbar = useHasBlockToolbar();\n\n\tconst hasBlockSelection = !! blockSelectionStart;\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( blockSelectionStart ) {\n\t\t\tonToggle( false );\n\t\t}\n\t}, [ blockSelectionStart, onToggle ] );\n\n\tif ( ! hasBlockToolbar ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'editor-collapsible-block-toolbar', {\n\t\t\t\t\t'is-collapsed': isCollapsed || ! hasBlockSelection,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t</div>\n\t\t\t<Popover.Slot name=\"block-toolbar\" />\n\n\t\t\t<Button\n\t\t\t\tclassName=\"editor-collapsible-block-toolbar__toggle\"\n\t\t\t\ticon={ isCollapsed ? next : previous }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tonToggle( ! isCollapsed );\n\t\t\t\t} }\n\t\t\t\tlabel={\n\t\t\t\t\tisCollapsed\n\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t}\n\t\t\t\tsize=\"compact\"\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nexport default CollapsableBlockToolbar;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAtB3C;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,MAAM;EAAES;AAAmB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAE/D,SAASC,uBAAuBA,CAAE;EAAEC,WAAW;EAAEC;AAAS,CAAC,EAAG;EAC7D,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxD,OAAO;MACNF,mBAAmB,EAClBE,MAAM,CAAEC,kBAAiB,CAAC,CAACC,sBAAsB,CAAC;IACpD,CAAC;EACF,CAAC,EA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C,uBAAuB","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_blockEditor","_element","_components","_i18n","_icons","_data","_lockUnlock","_jsxRuntime","useHasBlockToolbar","unlock","blockEditorPrivateApis","CollapsibleBlockToolbar","isCollapsed","onToggle","blockSelectionStart","useSelect","select","blockEditorStore","getBlockSelectionStart","hasBlockToolbar","hasBlockSelection","useEffect","jsxs","Fragment","children","jsx","className","clsx","BlockToolbar","hideDragHandle","Popover","Slot","name","Button","icon","next","previous","onClick","label","__","size"],"sources":["@wordpress/editor/src/components/collapsible-block-toolbar/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBlockToolbar,\n\tstore as blockEditorStore,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { useEffect } from '@wordpress/element';\nimport { Button, Popover } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { next, previous } from '@wordpress/icons';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst { useHasBlockToolbar } = unlock( blockEditorPrivateApis );\n\nexport default function CollapsibleBlockToolbar( { isCollapsed, onToggle } ) {\n\tconst { blockSelectionStart } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tblockSelectionStart:\n\t\t\t\tselect( blockEditorStore ).getBlockSelectionStart(),\n\t\t};\n\t}, [] );\n\tconst hasBlockToolbar = useHasBlockToolbar();\n\n\tconst hasBlockSelection = !! blockSelectionStart;\n\n\tuseEffect( () => {\n\t\t// If we have a new block selection, show the block tools\n\t\tif ( blockSelectionStart ) {\n\t\t\tonToggle( false );\n\t\t}\n\t}, [ blockSelectionStart, onToggle ] );\n\n\tif ( ! hasBlockToolbar ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t<div\n\t\t\t\tclassName={ clsx( 'editor-collapsible-block-toolbar', {\n\t\t\t\t\t'is-collapsed': isCollapsed || ! hasBlockSelection,\n\t\t\t\t} ) }\n\t\t\t>\n\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t</div>\n\t\t\t<Popover.Slot name=\"block-toolbar\" />\n\n\t\t\t<Button\n\t\t\t\tclassName=\"editor-collapsible-block-toolbar__toggle\"\n\t\t\t\ticon={ isCollapsed ? next : previous }\n\t\t\t\tonClick={ () => {\n\t\t\t\t\tonToggle( ! isCollapsed );\n\t\t\t\t} }\n\t\t\t\tlabel={\n\t\t\t\t\tisCollapsed\n\t\t\t\t\t\t? __( 'Show block tools' )\n\t\t\t\t\t\t: __( 'Hide block tools' )\n\t\t\t\t}\n\t\t\t\tsize=\"compact\"\n\t\t\t/>\n\t\t</>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,YAAA,GAAAD,OAAA;AAKA,IAAAE,QAAA,GAAAF,OAAA;AACA,IAAAG,WAAA,GAAAH,OAAA;AACA,IAAAI,KAAA,GAAAJ,OAAA;AACA,IAAAK,MAAA,GAAAL,OAAA;AACA,IAAAM,KAAA,GAAAN,OAAA;AAKA,IAAAO,WAAA,GAAAP,OAAA;AAA2C,IAAAQ,WAAA,GAAAR,OAAA;AAtB3C;AACA;AACA;;AAGA;AACA;AACA;;AAYA;AACA;AACA;;AAGA,MAAM;EAAES;AAAmB,CAAC,GAAG,IAAAC,kBAAM,EAAEC,wBAAuB,CAAC;AAEhD,SAASC,uBAAuBA,CAAE;EAAEC,WAAW;EAAEC;AAAS,CAAC,EAAG;EAC5E,MAAM;IAAEC;EAAoB,CAAC,GAAG,IAAAC,eAAS,EAAIC,MAAM,IAAM;IACxD,OAAO;MACNF,mBAAmB,EAClBE,MAAM,CAAEC,kBAAiB,CAAC,CAACC,sBAAsB,CAAC;IACpD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EACP,MAAMC,eAAe,GAAGX,kBAAkB,CAAC,CAAC;EAE5C,MAAMY,iBAAiB,GAAG,CAAC,CAAEN,mBAAmB;EAEhD,IAAAO,kBAAS,EAAE,MAAM;IAChB;IACA,IAAKP,mBAAmB,EAAG;MAC1BD,QAAQ,CAAE,KAAM,CAAC;IAClB;EACD,CAAC,EAAE,CAAEC,mBAAmB,EAAED,QAAQ,CAAG,CAAC;EAEtC,IAAK,CAAEM,eAAe,EAAG;IACxB,OAAO,IAAI;EACZ;EAEA,oBACC,IAAAZ,WAAA,CAAAe,IAAA,EAAAf,WAAA,CAAAgB,QAAA;IAAAC,QAAA,gBACC,IAAAjB,WAAA,CAAAkB,GAAA;MACCC,SAAS,EAAG,IAAAC,aAAI,EAAE,kCAAkC,EAAE;QACrD,cAAc,EAAEf,WAAW,IAAI,CAAEQ;MAClC,CAAE,CAAG;MAAAI,QAAA,eAEL,IAAAjB,WAAA,CAAAkB,GAAA,EAACzB,YAAA,CAAA4B,YAAY;QAACC,cAAc;MAAA,CAAE;IAAC,CAC3B,CAAC,eACN,IAAAtB,WAAA,CAAAkB,GAAA,EAACvB,WAAA,CAAA4B,OAAO,CAACC,IAAI;MAACC,IAAI,EAAC;IAAe,CAAE,CAAC,eAErC,IAAAzB,WAAA,CAAAkB,GAAA,EAACvB,WAAA,CAAA+B,MAAM;MACNP,SAAS,EAAC,0CAA0C;MACpDQ,IAAI,EAAGtB,WAAW,GAAGuB,WAAI,GAAGC,eAAU;MACtCC,OAAO,EAAGA,CAAA,KAAM;QACfxB,QAAQ,CAAE,CAAED,WAAY,CAAC;MAC1B,CAAG;MACH0B,KAAK,EACJ1B,WAAW,GACR,IAAA2B,QAAE,EAAE,kBAAmB,CAAC,GACxB,IAAAA,QAAE,EAAE,kBAAmB,CAC1B;MACDC,IAAI,EAAC;IAAS,CACd,CAAC;EAAA,CACD,CAAC;AAEL","ignoreList":[]}
@@ -58,6 +58,7 @@ function EditorInterface({
58
58
  disableIframe,
59
59
  autoFocus,
60
60
  customSaveButton,
61
+ customSavePanel,
61
62
  forceDisableBlockTools,
62
63
  title,
63
64
  icon,
@@ -163,7 +164,7 @@ function EditorInterface({
163
164
  footer: !isPreviewMode && !isDistractionFree && isLargeViewport && showBlockBreadcrumbs && isRichEditingEnabled && blockEditorMode !== 'zoom-out' && mode === 'visual' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockBreadcrumb, {
164
165
  rootLabelText: documentLabel
165
166
  }),
166
- actions: !isPreviewMode ? /*#__PURE__*/(0, _jsxRuntime.jsx)(_savePublishPanels.default, {
167
+ actions: !isPreviewMode ? customSavePanel || /*#__PURE__*/(0, _jsxRuntime.jsx)(_savePublishPanels.default, {
167
168
  closeEntitiesSavedStates: closeEntitiesSavedStates,
168
169
  isEntitiesSavedStatesOpen: entitiesSavedStatesCallback,
169
170
  setEntitiesSavedStatesCallback: setEntitiesSavedStatesCallback,
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_interface","_data","_i18n","_preferences","_blockEditor","_keyboardShortcuts","_compose","_element","_store","_editorNotices","_header","_inserterSidebar","_listViewSidebar","_savePublishPanels","_textEditor","_visualEditor","_contentSlotFill","_jsxRuntime","interfaceLabels","header","__","body","sidebar","actions","footer","EditorInterface","className","enableRegionNavigation","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","forceDisableBlockTools","title","icon","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","previousShortcut","nextShortcut","showBlockBreadcrumbs","documentLabel","blockEditorMode","useSelect","select","get","preferencesStore","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","getEditorMode","richEditingEnabled","__unstableIsPreviewMode","keyboardShortcutsStore","getAllShortcutKeyCombinations","_x","blockEditorStore","__unstableGetEditorMode","isWideViewport","useViewportMatch","isLargeViewport","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","useState","closeEntitiesSavedStates","useCallback","arg","jsx","InterfaceSkeleton","clsx","labels","secondarySidebar","default","editorNotices","ComplementaryArea","Slot","scope","content","jsxs","Fragment","editorCanvasView","BlockToolbar","hideDragHandle","BlockBreadcrumb","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","undefined","shortcuts","previous","next"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tenableRegionNavigation,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tforceDisableBlockTools,\n\ttitle,\n\ticon,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tblockEditorMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.__unstableIsPreviewMode,\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/next-region' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tblockEditorMode:\n\t\t\t\tselect( blockEditorStore ).__unstableGetEditorMode(),\n\t\t};\n\t}, [] );\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tenableRegionNavigation={ enableRegionNavigation }\n\t\t\tisDistractionFree={ isDistractionFree && isWideViewport }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free':\n\t\t\t\t\tisDistractionFree && isWideViewport && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tblockEditorMode !== 'zoom-out' &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t! isPreviewMode ? (\n\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\tcloseEntitiesSavedStates={ closeEntitiesSavedStates }\n\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }\n\t\t\t\t\t/>\n\t\t\t\t) : undefined\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;A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AEyB,eAAe,IACjB9B,IAAI,KAAK,QAAQ,iBAChB,IAAAtB,WAAA,CAAA4D,GAAA,EAACzE,YAAA,CAAAuF,YAAY;YAACC,cAAc;UAAA,CAAE,CAC9B,EACA,CAAEhD,aAAa,IACdJ,oBAAoB,IACrBD,IAAI,KAAK,QAAU,kBACpB,IAAAtB,WAAA,CAAA4D,GAAA,EAAC9D,aAAA,CAAAmE,OAAY;YACZtD,MAAM,EAAGA,MAAQ;YACjBG,UAAU,EAAGA,UAAY;YACzBC,aAAa,EAAGA;YAChB;YACA;YAAA;YACAC,SAAS,EAAGA,SAAW;YACvBK,WAAW,EAAGA;UAAa,CAC3B,CACD,EACCT,QAAQ;QAAA,CACT;MACF,CAEyB,CAAC;IAAA,CAC5B,CACF;IACDL,MAAM,EACL,CAAEoB,aAAa,IACf,CAAED,iBAAiB,IACnB0B,eAAe,IACftB,oBAAoB,IACpBP,oBAAoB,IACpBS,eAAe,KAAK,UAAU,IAC9BV,IAAI,KAAK,QAAQ,iBAChB,IAAAtB,WAAA,CAAA4D,GAAA,EAACzE,YAAA,CAAAyF,eAAe;MAACC,aAAa,EAAG9C;IAAe,CAAE,CAEnD;IACDzB,OAAO,EACN,CAAEqB,aAAa,gBACd,IAAA3B,WAAA,CAAA4D,GAAA,EAAChE,kBAAA,CAAAqE,OAAiB;MACjBR,wBAAwB,EAAGA,wBAA0B;MACrDqB,yBAAyB,EACxBxB,2BACA;MACDC,8BAA8B,EAC7BA,8BACA;MACDwB,wBAAwB,EAAGlE;IAAc,CACzC,CAAC,GACCmE,SACJ;IACDC,SAAS,EAAG;MACXC,QAAQ,EAAEtD,gBAAgB;MAC1BuD,IAAI,EAAEtD;IACP;EAAG,CACH,CAAC;AAEJ","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_interface","_data","_i18n","_preferences","_blockEditor","_keyboardShortcuts","_compose","_element","_store","_editorNotices","_header","_inserterSidebar","_listViewSidebar","_savePublishPanels","_textEditor","_visualEditor","_contentSlotFill","_jsxRuntime","interfaceLabels","header","__","body","sidebar","actions","footer","EditorInterface","className","enableRegionNavigation","styles","children","forceIsDirty","contentRef","disableIframe","autoFocus","customSaveButton","customSavePanel","forceDisableBlockTools","title","icon","iframeProps","mode","isRichEditingEnabled","isInserterOpened","isListViewOpened","isDistractionFree","isPreviewMode","previousShortcut","nextShortcut","showBlockBreadcrumbs","documentLabel","blockEditorMode","useSelect","select","get","preferencesStore","getEditorSettings","getPostTypeLabel","editorStore","editorSettings","postTypeLabel","getEditorMode","richEditingEnabled","__unstableIsPreviewMode","keyboardShortcutsStore","getAllShortcutKeyCombinations","_x","blockEditorStore","__unstableGetEditorMode","isWideViewport","useViewportMatch","isLargeViewport","secondarySidebarLabel","entitiesSavedStatesCallback","setEntitiesSavedStatesCallback","useState","closeEntitiesSavedStates","useCallback","arg","jsx","InterfaceSkeleton","clsx","labels","secondarySidebar","default","editorNotices","ComplementaryArea","Slot","scope","content","jsxs","Fragment","editorCanvasView","BlockToolbar","hideDragHandle","BlockBreadcrumb","rootLabelText","isEntitiesSavedStatesOpen","forceIsDirtyPublishPanel","undefined","shortcuts","previous","next"],"sources":["@wordpress/editor/src/components/editor-interface/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { InterfaceSkeleton, ComplementaryArea } from '@wordpress/interface';\nimport { useSelect } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tstore as blockEditorStore,\n\tBlockBreadcrumb,\n\tBlockToolbar,\n} from '@wordpress/block-editor';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useState, useCallback } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\nimport EditorNotices from '../editor-notices';\nimport Header from '../header';\nimport InserterSidebar from '../inserter-sidebar';\nimport ListViewSidebar from '../list-view-sidebar';\nimport SavePublishPanels from '../save-publish-panels';\nimport TextEditor from '../text-editor';\nimport VisualEditor from '../visual-editor';\nimport EditorContentSlotFill from './content-slot-fill';\n\nconst interfaceLabels = {\n\t/* translators: accessibility text for the editor top bar landmark region. */\n\theader: __( 'Editor top bar' ),\n\t/* translators: accessibility text for the editor content landmark region. */\n\tbody: __( 'Editor content' ),\n\t/* translators: accessibility text for the editor settings landmark region. */\n\tsidebar: __( 'Editor settings' ),\n\t/* translators: accessibility text for the editor publish landmark region. */\n\tactions: __( 'Editor publish' ),\n\t/* translators: accessibility text for the editor footer landmark region. */\n\tfooter: __( 'Editor footer' ),\n};\n\nexport default function EditorInterface( {\n\tclassName,\n\tenableRegionNavigation,\n\tstyles,\n\tchildren,\n\tforceIsDirty,\n\tcontentRef,\n\tdisableIframe,\n\tautoFocus,\n\tcustomSaveButton,\n\tcustomSavePanel,\n\tforceDisableBlockTools,\n\ttitle,\n\ticon,\n\tiframeProps,\n} ) {\n\tconst {\n\t\tmode,\n\t\tisRichEditingEnabled,\n\t\tisInserterOpened,\n\t\tisListViewOpened,\n\t\tisDistractionFree,\n\t\tisPreviewMode,\n\t\tpreviousShortcut,\n\t\tnextShortcut,\n\t\tshowBlockBreadcrumbs,\n\t\tdocumentLabel,\n\t\tblockEditorMode,\n\t} = useSelect( ( select ) => {\n\t\tconst { get } = select( preferencesStore );\n\t\tconst { getEditorSettings, getPostTypeLabel } = select( editorStore );\n\t\tconst editorSettings = getEditorSettings();\n\t\tconst postTypeLabel = getPostTypeLabel();\n\n\t\treturn {\n\t\t\tmode: select( editorStore ).getEditorMode(),\n\t\t\tisRichEditingEnabled: editorSettings.richEditingEnabled,\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpened: select( editorStore ).isListViewOpened(),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisPreviewMode: editorSettings.__unstableIsPreviewMode,\n\t\t\tpreviousShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/previous-region' ),\n\t\t\tnextShortcut: select(\n\t\t\t\tkeyboardShortcutsStore\n\t\t\t).getAllShortcutKeyCombinations( 'core/editor/next-region' ),\n\t\t\tshowBlockBreadcrumbs: get( 'core', 'showBlockBreadcrumbs' ),\n\t\t\t// translators: Default label for the Document in the Block Breadcrumb.\n\t\t\tdocumentLabel: postTypeLabel || _x( 'Document', 'noun' ),\n\t\t\tblockEditorMode:\n\t\t\t\tselect( blockEditorStore ).__unstableGetEditorMode(),\n\t\t};\n\t}, [] );\n\tconst isWideViewport = useViewportMatch( 'large' );\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst secondarySidebarLabel = isListViewOpened\n\t\t? __( 'Document Overview' )\n\t\t: __( 'Block Library' );\n\n\t// Local state for save panel.\n\t// Note 'truthy' callback implies an open panel.\n\tconst [ entitiesSavedStatesCallback, setEntitiesSavedStatesCallback ] =\n\t\tuseState( false );\n\tconst closeEntitiesSavedStates = useCallback(\n\t\t( arg ) => {\n\t\t\tif ( typeof entitiesSavedStatesCallback === 'function' ) {\n\t\t\t\tentitiesSavedStatesCallback( arg );\n\t\t\t}\n\t\t\tsetEntitiesSavedStatesCallback( false );\n\t\t},\n\t\t[ entitiesSavedStatesCallback ]\n\t);\n\n\treturn (\n\t\t<InterfaceSkeleton\n\t\t\tenableRegionNavigation={ enableRegionNavigation }\n\t\t\tisDistractionFree={ isDistractionFree && isWideViewport }\n\t\t\tclassName={ clsx( 'editor-editor-interface', className, {\n\t\t\t\t'is-entity-save-view-open': !! entitiesSavedStatesCallback,\n\t\t\t\t'is-distraction-free':\n\t\t\t\t\tisDistractionFree && isWideViewport && ! isPreviewMode,\n\t\t\t} ) }\n\t\t\tlabels={ {\n\t\t\t\t...interfaceLabels,\n\t\t\t\tsecondarySidebar: secondarySidebarLabel,\n\t\t\t} }\n\t\t\theader={\n\t\t\t\t! isPreviewMode && (\n\t\t\t\t\t<Header\n\t\t\t\t\t\tforceIsDirty={ forceIsDirty }\n\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t}\n\t\t\t\t\t\tcustomSaveButton={ customSaveButton }\n\t\t\t\t\t\tforceDisableBlockTools={ forceDisableBlockTools }\n\t\t\t\t\t\ttitle={ title }\n\t\t\t\t\t\ticon={ icon }\n\t\t\t\t\t/>\n\t\t\t\t)\n\t\t\t}\n\t\t\teditorNotices={ <EditorNotices /> }\n\t\t\tsecondarySidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\tmode === 'visual' &&\n\t\t\t\t( ( isInserterOpened && <InserterSidebar /> ) ||\n\t\t\t\t\t( isListViewOpened && <ListViewSidebar /> ) )\n\t\t\t}\n\t\t\tsidebar={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree && <ComplementaryArea.Slot scope=\"core\" />\n\t\t\t}\n\t\t\tcontent={\n\t\t\t\t<>\n\t\t\t\t\t{ ! isDistractionFree && ! isPreviewMode && (\n\t\t\t\t\t\t<EditorNotices />\n\t\t\t\t\t) }\n\n\t\t\t\t\t<EditorContentSlotFill.Slot>\n\t\t\t\t\t\t{ ( [ editorCanvasView ] ) =>\n\t\t\t\t\t\t\teditorCanvasView ? (\n\t\t\t\t\t\t\t\teditorCanvasView\n\t\t\t\t\t\t\t) : (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t( mode === 'text' ||\n\t\t\t\t\t\t\t\t\t\t\t! isRichEditingEnabled ) && (\n\t\t\t\t\t\t\t\t\t\t\t<TextEditor\n\t\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ! isPreviewMode &&\n\t\t\t\t\t\t\t\t\t\t! isLargeViewport &&\n\t\t\t\t\t\t\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t\t\t\t\t\t\t<BlockToolbar hideDragHandle />\n\t\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ ( isPreviewMode ||\n\t\t\t\t\t\t\t\t\t\t( isRichEditingEnabled &&\n\t\t\t\t\t\t\t\t\t\t\tmode === 'visual' ) ) && (\n\t\t\t\t\t\t\t\t\t\t<VisualEditor\n\t\t\t\t\t\t\t\t\t\t\tstyles={ styles }\n\t\t\t\t\t\t\t\t\t\t\tcontentRef={ contentRef }\n\t\t\t\t\t\t\t\t\t\t\tdisableIframe={ disableIframe }\n\t\t\t\t\t\t\t\t\t\t\t// We should auto-focus the canvas (title) on load.\n\t\t\t\t\t\t\t\t\t\t\t// eslint-disable-next-line jsx-a11y/no-autofocus\n\t\t\t\t\t\t\t\t\t\t\tautoFocus={ autoFocus }\n\t\t\t\t\t\t\t\t\t\t\tiframeProps={ iframeProps }\n\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t)\n\t\t\t\t\t\t}\n\t\t\t\t\t</EditorContentSlotFill.Slot>\n\t\t\t\t</>\n\t\t\t}\n\t\t\tfooter={\n\t\t\t\t! isPreviewMode &&\n\t\t\t\t! isDistractionFree &&\n\t\t\t\tisLargeViewport &&\n\t\t\t\tshowBlockBreadcrumbs &&\n\t\t\t\tisRichEditingEnabled &&\n\t\t\t\tblockEditorMode !== 'zoom-out' &&\n\t\t\t\tmode === 'visual' && (\n\t\t\t\t\t<BlockBreadcrumb rootLabelText={ documentLabel } />\n\t\t\t\t)\n\t\t\t}\n\t\t\tactions={\n\t\t\t\t! isPreviewMode\n\t\t\t\t\t? customSavePanel || (\n\t\t\t\t\t\t\t<SavePublishPanels\n\t\t\t\t\t\t\t\tcloseEntitiesSavedStates={\n\t\t\t\t\t\t\t\t\tcloseEntitiesSavedStates\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tisEntitiesSavedStatesOpen={\n\t\t\t\t\t\t\t\t\tentitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback={\n\t\t\t\t\t\t\t\t\tsetEntitiesSavedStatesCallback\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tforceIsDirtyPublishPanel={ forceIsDirty }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t )\n\t\t\t\t\t: undefined\n\t\t\t}\n\t\t\tshortcuts={ {\n\t\t\t\tprevious: previousShortcut,\n\t\t\t\tnext: nextShortcut,\n\t\t\t} }\n\t\t/>\n\t);\n}\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,UAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AACA,IAAAK,YAAA,GAAAL,OAAA;AAKA,IAAAM,kBAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAR,OAAA;AAKA,IAAAS,MAAA,GAAAT,OAAA;AACA,IAAAU,cAAA,GAAAX,sBAAA,CAAAC,OAAA;AACA,IAAAW,OAAA,GAAAZ,sBAAA,CAAAC,OAAA;AACA,IAAAY,gBAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,gBAAA,GAAAd,sBAAA,CAAAC,OAAA;AACA,IAAAc,kBAAA,GAAAf,sBAAA,CAAAC,OAAA;AACA,IAAAe,WAAA,GAAAhB,sBAAA,C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