@wordpress/editor 14.0.0 → 14.1.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 (301) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +164 -20
  3. package/build/components/block-settings-menu/content-only-settings-menu.js +14 -5
  4. package/build/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  5. package/build/components/document-tools/index.js +12 -3
  6. package/build/components/document-tools/index.js.map +1 -1
  7. package/build/components/editor/index.js +77 -0
  8. package/build/components/editor/index.js.map +1 -0
  9. package/build/components/editor-interface/index.js +6 -8
  10. package/build/components/editor-interface/index.js.map +1 -1
  11. package/build/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  12. package/build/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  13. package/build/components/entities-saved-states/index.js +28 -0
  14. package/build/components/entities-saved-states/index.js.map +1 -1
  15. package/build/components/global-styles-provider/index.js +9 -2
  16. package/build/components/global-styles-provider/index.js.map +1 -1
  17. package/build/components/header/back-button.js +4 -1
  18. package/build/components/header/back-button.js.map +1 -1
  19. package/build/components/header/index.js +1 -5
  20. package/build/components/header/index.js.map +1 -1
  21. package/build/components/index.js +7 -0
  22. package/build/components/index.js.map +1 -1
  23. package/build/components/media-categories/index.js +1 -1
  24. package/build/components/media-categories/index.js.map +1 -1
  25. package/build/components/post-actions/actions.js +10 -4
  26. package/build/components/post-actions/actions.js.map +1 -1
  27. package/build/components/post-last-revision/index.js +35 -9
  28. package/build/components/post-last-revision/index.js.map +1 -1
  29. package/build/components/post-preview-button/index.js +1 -0
  30. package/build/components/post-preview-button/index.js.map +1 -1
  31. package/build/components/post-publish-button/index.js +4 -0
  32. package/build/components/post-publish-button/index.js.map +1 -1
  33. package/build/components/post-publish-button/label.js +5 -0
  34. package/build/components/post-publish-button/label.js.map +1 -1
  35. package/build/components/post-publish-panel/index.js +5 -0
  36. package/build/components/post-publish-panel/index.js.map +1 -1
  37. package/build/components/post-sticky/check.js +8 -0
  38. package/build/components/post-sticky/check.js.map +1 -1
  39. package/build/components/post-sticky/index.js +5 -1
  40. package/build/components/post-sticky/index.js.map +1 -1
  41. package/build/components/post-switch-to-draft-button/index.js +11 -2
  42. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  43. package/build/components/post-sync-status/index.js +6 -2
  44. package/build/components/post-sync-status/index.js.map +1 -1
  45. package/build/components/post-taxonomies/check.js +8 -0
  46. package/build/components/post-taxonomies/check.js.map +1 -1
  47. package/build/components/post-taxonomies/flat-term-selector.js +14 -2
  48. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  49. package/build/components/post-taxonomies/index.js +9 -0
  50. package/build/components/post-taxonomies/index.js.map +1 -1
  51. package/build/components/post-taxonomies/panel.js +10 -0
  52. package/build/components/post-taxonomies/panel.js.map +1 -1
  53. package/build/components/post-title/index.js +4 -8
  54. package/build/components/post-title/index.js.map +1 -1
  55. package/build/components/post-title/post-title-raw.js +3 -7
  56. package/build/components/post-title/post-title-raw.js.map +1 -1
  57. package/build/components/post-trash/check.js +8 -0
  58. package/build/components/post-trash/check.js.map +1 -1
  59. package/build/components/post-trash/index.js +6 -1
  60. package/build/components/post-trash/index.js.map +1 -1
  61. package/build/components/post-url/panel.js +25 -3
  62. package/build/components/post-url/panel.js.map +1 -1
  63. package/build/components/post-visibility/index.js +1 -0
  64. package/build/components/post-visibility/index.js.map +1 -1
  65. package/build/components/provider/disable-non-page-content-blocks.js +5 -3
  66. package/build/components/provider/disable-non-page-content-blocks.js.map +1 -1
  67. package/build/components/provider/index.js +18 -15
  68. package/build/components/provider/index.js.map +1 -1
  69. package/build/components/sidebar/post-summary.js +3 -2
  70. package/build/components/sidebar/post-summary.js.map +1 -1
  71. package/build/components/table-of-contents/index.js +11 -0
  72. package/build/components/table-of-contents/index.js.map +1 -1
  73. package/build/components/template-part-menu-items/convert-to-regular.js +38 -0
  74. package/build/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  75. package/build/components/template-part-menu-items/convert-to-template-part.js +77 -0
  76. package/build/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  77. package/build/components/template-part-menu-items/index.js +67 -0
  78. package/build/components/template-part-menu-items/index.js.map +1 -0
  79. package/build/components/template-part-menu-items/index.native.js +10 -0
  80. package/build/components/template-part-menu-items/index.native.js.map +1 -0
  81. package/build/components/template-validation-notice/index.js +1 -0
  82. package/build/components/template-validation-notice/index.js.map +1 -1
  83. package/build/components/theme-support-check/index.js +9 -0
  84. package/build/components/theme-support-check/index.js.map +1 -1
  85. package/build/components/time-to-read/index.js +6 -0
  86. package/build/components/time-to-read/index.js.map +1 -1
  87. package/build/components/visual-editor/edit-template-blocks-notification.js +1 -0
  88. package/build/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  89. package/build/components/word-count/index.js +5 -1
  90. package/build/components/word-count/index.js.map +1 -1
  91. package/build/dataviews/api.js +61 -0
  92. package/build/dataviews/api.js.map +1 -0
  93. package/build/dataviews/store/private-actions.js +28 -0
  94. package/build/dataviews/store/private-actions.js.map +1 -0
  95. package/build/dataviews/store/private-selectors.js +20 -0
  96. package/build/dataviews/store/private-selectors.js.map +1 -0
  97. package/build/dataviews/store/reducer.js +36 -0
  98. package/build/dataviews/store/reducer.js.map +1 -0
  99. package/build/hooks/pattern-overrides.js +2 -1
  100. package/build/hooks/pattern-overrides.js.map +1 -1
  101. package/build/index.js +12 -0
  102. package/build/index.js.map +1 -1
  103. package/build/private-apis.js +2 -6
  104. package/build/private-apis.js.map +1 -1
  105. package/build/private-apis.native.js +0 -2
  106. package/build/private-apis.native.js.map +1 -1
  107. package/build/store/private-actions.js +21 -0
  108. package/build/store/private-actions.js.map +1 -1
  109. package/build/store/private-selectors.js +5 -0
  110. package/build/store/private-selectors.js.map +1 -1
  111. package/build/store/reducer.js +4 -1
  112. package/build/store/reducer.js.map +1 -1
  113. package/build-module/components/block-settings-menu/content-only-settings-menu.js +14 -5
  114. package/build-module/components/block-settings-menu/content-only-settings-menu.js.map +1 -1
  115. package/build-module/components/document-tools/index.js +12 -3
  116. package/build-module/components/document-tools/index.js.map +1 -1
  117. package/build-module/components/editor/index.js +71 -0
  118. package/build-module/components/editor/index.js.map +1 -0
  119. package/build-module/components/editor-interface/index.js +6 -8
  120. package/build-module/components/editor-interface/index.js.map +1 -1
  121. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js +10 -0
  122. package/build-module/components/entities-saved-states/hooks/use-is-dirty.js.map +1 -1
  123. package/build-module/components/entities-saved-states/index.js +28 -0
  124. package/build-module/components/entities-saved-states/index.js.map +1 -1
  125. package/build-module/components/global-styles-provider/index.js +9 -2
  126. package/build-module/components/global-styles-provider/index.js.map +1 -1
  127. package/build-module/components/header/back-button.js +4 -1
  128. package/build-module/components/header/back-button.js.map +1 -1
  129. package/build-module/components/header/index.js +1 -5
  130. package/build-module/components/header/index.js.map +1 -1
  131. package/build-module/components/index.js +7 -0
  132. package/build-module/components/index.js.map +1 -1
  133. package/build-module/components/media-categories/index.js +1 -1
  134. package/build-module/components/media-categories/index.js.map +1 -1
  135. package/build-module/components/post-actions/actions.js +10 -4
  136. package/build-module/components/post-actions/actions.js.map +1 -1
  137. package/build-module/components/post-last-revision/index.js +34 -11
  138. package/build-module/components/post-last-revision/index.js.map +1 -1
  139. package/build-module/components/post-preview-button/index.js +1 -0
  140. package/build-module/components/post-preview-button/index.js.map +1 -1
  141. package/build-module/components/post-publish-button/index.js +4 -0
  142. package/build-module/components/post-publish-button/index.js.map +1 -1
  143. package/build-module/components/post-publish-button/label.js +6 -0
  144. package/build-module/components/post-publish-button/label.js.map +1 -1
  145. package/build-module/components/post-publish-panel/index.js +5 -0
  146. package/build-module/components/post-publish-panel/index.js.map +1 -1
  147. package/build-module/components/post-sticky/check.js +9 -0
  148. package/build-module/components/post-sticky/check.js.map +1 -1
  149. package/build-module/components/post-sticky/index.js +6 -0
  150. package/build-module/components/post-sticky/index.js.map +1 -1
  151. package/build-module/components/post-switch-to-draft-button/index.js +10 -1
  152. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  153. package/build-module/components/post-sync-status/index.js +7 -1
  154. package/build-module/components/post-sync-status/index.js.map +1 -1
  155. package/build-module/components/post-taxonomies/check.js +9 -0
  156. package/build-module/components/post-taxonomies/check.js.map +1 -1
  157. package/build-module/components/post-taxonomies/flat-term-selector.js +14 -2
  158. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  159. package/build-module/components/post-taxonomies/index.js +9 -0
  160. package/build-module/components/post-taxonomies/index.js.map +1 -1
  161. package/build-module/components/post-taxonomies/panel.js +10 -0
  162. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  163. package/build-module/components/post-title/index.js +4 -8
  164. package/build-module/components/post-title/index.js.map +1 -1
  165. package/build-module/components/post-title/post-title-raw.js +3 -7
  166. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  167. package/build-module/components/post-trash/check.js +9 -0
  168. package/build-module/components/post-trash/check.js.map +1 -1
  169. package/build-module/components/post-trash/index.js +7 -0
  170. package/build-module/components/post-trash/index.js.map +1 -1
  171. package/build-module/components/post-url/panel.js +26 -3
  172. package/build-module/components/post-url/panel.js.map +1 -1
  173. package/build-module/components/post-visibility/index.js +1 -0
  174. package/build-module/components/post-visibility/index.js.map +1 -1
  175. package/build-module/components/provider/disable-non-page-content-blocks.js +5 -3
  176. package/build-module/components/provider/disable-non-page-content-blocks.js.map +1 -1
  177. package/build-module/components/provider/index.js +18 -15
  178. package/build-module/components/provider/index.js.map +1 -1
  179. package/build-module/components/sidebar/post-summary.js +3 -2
  180. package/build-module/components/sidebar/post-summary.js.map +1 -1
  181. package/build-module/components/table-of-contents/index.js +11 -0
  182. package/build-module/components/table-of-contents/index.js.map +1 -1
  183. package/build-module/components/template-part-menu-items/convert-to-regular.js +31 -0
  184. package/build-module/components/template-part-menu-items/convert-to-regular.js.map +1 -0
  185. package/build-module/components/template-part-menu-items/convert-to-template-part.js +71 -0
  186. package/build-module/components/template-part-menu-items/convert-to-template-part.js.map +1 -0
  187. package/build-module/components/template-part-menu-items/index.js +59 -0
  188. package/build-module/components/template-part-menu-items/index.js.map +1 -0
  189. package/build-module/components/template-part-menu-items/index.native.js +4 -0
  190. package/build-module/components/template-part-menu-items/index.native.js.map +1 -0
  191. package/build-module/components/template-validation-notice/index.js +1 -0
  192. package/build-module/components/template-validation-notice/index.js.map +1 -1
  193. package/build-module/components/theme-support-check/index.js +10 -0
  194. package/build-module/components/theme-support-check/index.js.map +1 -1
  195. package/build-module/components/time-to-read/index.js +6 -0
  196. package/build-module/components/time-to-read/index.js.map +1 -1
  197. package/build-module/components/visual-editor/edit-template-blocks-notification.js +1 -0
  198. package/build-module/components/visual-editor/edit-template-blocks-notification.js.map +1 -1
  199. package/build-module/components/word-count/index.js +6 -0
  200. package/build-module/components/word-count/index.js.map +1 -1
  201. package/build-module/dataviews/api.js +54 -0
  202. package/build-module/dataviews/api.js.map +1 -0
  203. package/build-module/dataviews/store/private-actions.js +21 -0
  204. package/build-module/dataviews/store/private-actions.js.map +1 -0
  205. package/build-module/dataviews/store/private-selectors.js +14 -0
  206. package/build-module/dataviews/store/private-selectors.js.map +1 -0
  207. package/build-module/dataviews/store/reducer.js +29 -0
  208. package/build-module/dataviews/store/reducer.js.map +1 -0
  209. package/build-module/hooks/pattern-overrides.js +2 -1
  210. package/build-module/hooks/pattern-overrides.js.map +1 -1
  211. package/build-module/index.js +1 -0
  212. package/build-module/index.js.map +1 -1
  213. package/build-module/private-apis.js +2 -6
  214. package/build-module/private-apis.js.map +1 -1
  215. package/build-module/private-apis.native.js +0 -2
  216. package/build-module/private-apis.native.js.map +1 -1
  217. package/build-module/store/private-actions.js +1 -0
  218. package/build-module/store/private-actions.js.map +1 -1
  219. package/build-module/store/private-selectors.js +4 -0
  220. package/build-module/store/private-selectors.js.map +1 -1
  221. package/build-module/store/reducer.js +3 -1
  222. package/build-module/store/reducer.js.map +1 -1
  223. package/build-style/style-rtl.css +35 -43
  224. package/build-style/style.css +35 -43
  225. package/build-types/dataviews/store/private-actions.d.ts +17 -0
  226. package/build-types/dataviews/store/private-actions.d.ts.map +1 -0
  227. package/build-types/dataviews/store/private-selectors.d.ts +10 -0
  228. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -0
  229. package/build-types/dataviews/store/reducer.d.ts +11 -0
  230. package/build-types/dataviews/store/reducer.d.ts.map +1 -0
  231. package/package.json +35 -35
  232. package/src/components/block-settings-menu/content-only-settings-menu.js +26 -12
  233. package/src/components/collapsible-block-toolbar/style.scss +3 -1
  234. package/src/components/document-tools/index.js +13 -4
  235. package/src/components/editor/index.js +88 -0
  236. package/src/components/editor-interface/index.js +5 -5
  237. package/src/components/editor-interface/style.scss +3 -0
  238. package/src/components/entities-saved-states/hooks/use-is-dirty.js +9 -0
  239. package/src/components/entities-saved-states/index.js +26 -0
  240. package/src/components/entities-saved-states/style.scss +0 -7
  241. package/src/components/global-styles-provider/index.js +12 -2
  242. package/src/components/header/back-button.js +6 -1
  243. package/src/components/header/index.js +1 -8
  244. package/src/components/header/style.scss +1 -1
  245. package/src/components/index.js +7 -0
  246. package/src/components/keyboard-shortcut-help-modal/style.scss +0 -3
  247. package/src/components/media-categories/index.js +1 -3
  248. package/src/components/post-actions/actions.js +9 -3
  249. package/src/components/post-card-panel/style.scss +4 -0
  250. package/src/components/post-last-revision/index.js +30 -7
  251. package/src/components/post-last-revision/style.scss +4 -0
  252. package/src/components/post-panel-row/style.scss +2 -1
  253. package/src/components/post-preview-button/index.js +1 -0
  254. package/src/components/post-preview-button/test/index.js +10 -2
  255. package/src/components/post-publish-button/index.js +3 -0
  256. package/src/components/post-publish-button/label.js +5 -0
  257. package/src/components/post-publish-panel/index.js +4 -0
  258. package/src/components/post-publish-panel/style.scss +28 -36
  259. package/src/components/post-status/style.scss +5 -0
  260. package/src/components/post-sticky/check.js +8 -0
  261. package/src/components/post-sticky/index.js +5 -0
  262. package/src/components/post-switch-to-draft-button/index.js +10 -1
  263. package/src/components/post-sync-status/index.js +7 -8
  264. package/src/components/post-taxonomies/check.js +8 -0
  265. package/src/components/post-taxonomies/flat-term-selector.js +13 -2
  266. package/src/components/post-taxonomies/index.js +8 -0
  267. package/src/components/post-taxonomies/panel.js +9 -0
  268. package/src/components/post-title/index.js +2 -5
  269. package/src/components/post-title/post-title-raw.js +2 -5
  270. package/src/components/post-trash/check.js +8 -0
  271. package/src/components/post-trash/index.js +6 -0
  272. package/src/components/post-url/panel.js +13 -5
  273. package/src/components/post-visibility/index.js +1 -0
  274. package/src/components/provider/disable-non-page-content-blocks.js +9 -4
  275. package/src/components/provider/index.js +17 -17
  276. package/src/components/save-publish-panels/style.scss +0 -8
  277. package/src/components/sidebar/post-summary.js +3 -1
  278. package/src/components/table-of-contents/index.js +10 -0
  279. package/src/components/template-part-menu-items/convert-to-regular.js +32 -0
  280. package/src/components/template-part-menu-items/convert-to-template-part.js +75 -0
  281. package/src/components/template-part-menu-items/index.js +59 -0
  282. package/src/components/template-part-menu-items/index.native.js +3 -0
  283. package/src/components/template-validation-notice/index.js +1 -0
  284. package/src/components/theme-support-check/index.js +9 -0
  285. package/src/components/time-to-read/index.js +5 -0
  286. package/src/components/visual-editor/edit-template-blocks-notification.js +1 -0
  287. package/src/components/word-count/index.js +5 -0
  288. package/src/dataviews/api.js +55 -0
  289. package/src/dataviews/store/private-actions.ts +30 -0
  290. package/src/dataviews/store/private-selectors.ts +15 -0
  291. package/src/dataviews/store/reducer.ts +44 -0
  292. package/src/hooks/pattern-overrides.js +2 -0
  293. package/src/index.js +1 -0
  294. package/src/private-apis.js +2 -6
  295. package/src/private-apis.native.js +0 -2
  296. package/src/store/private-actions.js +1 -0
  297. package/src/store/private-selectors.js +5 -0
  298. package/src/store/reducer.js +2 -0
  299. package/src/style.scss +1 -0
  300. package/tsconfig.json +36 -0
  301. package/tsconfig.tsbuildinfo +1 -0
package/CHANGELOG.md CHANGED
@@ -2,6 +2,8 @@
2
2
 
3
3
  ## Unreleased
4
4
 
5
+ ## 14.1.0 (2024-06-15)
6
+
5
7
  ## 14.0.0 (2024-05-31)
6
8
 
7
9
  ### Breaking Changes
package/README.md CHANGED
@@ -390,7 +390,17 @@ _Returns_
390
390
 
391
391
  ### EntitiesSavedStates
392
392
 
393
- Undocumented declaration.
393
+ Renders the component for managing saved states of entities.
394
+
395
+ _Parameters_
396
+
397
+ - _props_ `Object`: The component props.
398
+ - _props.close_ `Function`: The function to close the dialog.
399
+ - _props.renderDialog_ `Function`: The function to render the dialog.
400
+
401
+ _Returns_
402
+
403
+ - `JSX.Element`: The rendered component.
394
404
 
395
405
  ### ErrorBoundary
396
406
 
@@ -1183,15 +1193,19 @@ _Returns_
1183
1193
 
1184
1194
  ### PostPublishButton
1185
1195
 
1186
- Undocumented declaration.
1196
+ Renders the publish button.
1187
1197
 
1188
1198
  ### PostPublishButtonLabel
1189
1199
 
1190
- Undocumented declaration.
1200
+ Renders the label for the publish button.
1201
+
1202
+ _Returns_
1203
+
1204
+ - `string`: The label for the publish button.
1191
1205
 
1192
1206
  ### PostPublishPanel
1193
1207
 
1194
- Undocumented declaration.
1208
+ Renders a panel for publishing a post.
1195
1209
 
1196
1210
  ### PostSavedState
1197
1211
 
@@ -1262,31 +1276,79 @@ Undocumented declaration.
1262
1276
 
1263
1277
  ### PostSticky
1264
1278
 
1265
- Undocumented declaration.
1279
+ Renders the PostSticky component. It provide toggle control for the sticky post feature.
1280
+
1281
+ _Returns_
1282
+
1283
+ - `Component`: The component to be rendered.
1266
1284
 
1267
1285
  ### PostStickyCheck
1268
1286
 
1269
- Undocumented declaration.
1287
+ Wrapper component that renders its children only if post has a sticky action.
1288
+
1289
+ _Parameters_
1290
+
1291
+ - _props_ `Object`: Props.
1292
+ - _props.children_ `Element`: Children to be rendered.
1293
+
1294
+ _Returns_
1295
+
1296
+ - `Component`: The component to be rendered or null if post type is not 'post' or hasStickyAction is false.
1270
1297
 
1271
1298
  ### PostSwitchToDraftButton
1272
1299
 
1273
- Undocumented declaration.
1300
+ Renders a button component that allows the user to switch a post to draft status.
1301
+
1302
+ _Returns_
1303
+
1304
+ - `JSX.Element`: The rendered component.
1274
1305
 
1275
1306
  ### PostSyncStatus
1276
1307
 
1277
- Undocumented declaration.
1308
+ Renders the sync status of a post.
1309
+
1310
+ _Returns_
1311
+
1312
+ - `JSX.Element|null`: The rendered sync status component.
1278
1313
 
1279
1314
  ### PostTaxonomies
1280
1315
 
1281
- Undocumented declaration.
1316
+ Renders the taxonomies associated with a post.
1317
+
1318
+ _Parameters_
1319
+
1320
+ - _props_ `Object`: The component props.
1321
+ - _props.taxonomyWrapper_ `Function`: The wrapper function for each taxonomy component.
1322
+
1323
+ _Returns_
1324
+
1325
+ - `Array`: An array of JSX elements representing the visible taxonomies.
1282
1326
 
1283
1327
  ### PostTaxonomiesCheck
1284
1328
 
1285
- Undocumented declaration.
1329
+ Renders the children components only if the current post type has taxonomies.
1330
+
1331
+ _Parameters_
1332
+
1333
+ - _props_ `Object`: The component props.
1334
+ - _props.children_ `Element`: The children components to render.
1335
+
1336
+ _Returns_
1337
+
1338
+ - `Component|null`: The rendered children components or null if the current post type has no taxonomies.
1286
1339
 
1287
1340
  ### PostTaxonomiesFlatTermSelector
1288
1341
 
1289
- Undocumented declaration.
1342
+ Renders a flat term selector component.
1343
+
1344
+ _Parameters_
1345
+
1346
+ - _props_ `Object`: The component props.
1347
+ - _props.slug_ `string`: The slug of the taxonomy.
1348
+
1349
+ _Returns_
1350
+
1351
+ - `JSX.Element`: The rendered flat term selector component.
1290
1352
 
1291
1353
  ### PostTaxonomiesHierarchicalTermSelector
1292
1354
 
@@ -1303,7 +1365,17 @@ _Returns_
1303
1365
 
1304
1366
  ### PostTaxonomiesPanel
1305
1367
 
1306
- Undocumented declaration.
1368
+ Renders a panel for a specific taxonomy.
1369
+
1370
+ _Parameters_
1371
+
1372
+ - _props_ `Object`: The component props.
1373
+ - _props.taxonomy_ `Object`: The taxonomy object.
1374
+ - _props.children_ `Element`: The child components.
1375
+
1376
+ _Returns_
1377
+
1378
+ - `Component`: The rendered taxonomy panel.
1307
1379
 
1308
1380
  ### PostTemplatePanel
1309
1381
 
@@ -1340,11 +1412,24 @@ Undocumented declaration.
1340
1412
 
1341
1413
  ### PostTrash
1342
1414
 
1343
- Undocumented declaration.
1415
+ Displays the Post Trash Button and Confirm Dialog in the Editor.
1416
+
1417
+ _Returns_
1418
+
1419
+ - `JSX.Element|null`: The rendered PostTrash component.
1344
1420
 
1345
1421
  ### PostTrashCheck
1346
1422
 
1347
- Undocumented declaration.
1423
+ Wrapper component that renders its children only if the post can trashed.
1424
+
1425
+ _Parameters_
1426
+
1427
+ - _props_ `Object`: - The component props.
1428
+ - _props.children_ `Element`: - The child components to render.
1429
+
1430
+ _Returns_
1431
+
1432
+ - `Component|null`: The rendered child components or null if the post can not trashed.
1348
1433
 
1349
1434
  ### PostTypeSupportCheck
1350
1435
 
@@ -1445,6 +1530,18 @@ _Returns_
1445
1530
 
1446
1531
  Undocumented declaration.
1447
1532
 
1533
+ ### registerEntityAction
1534
+
1535
+ Registers a new DataViews action.
1536
+
1537
+ This is an experimental API and is subject to change. it's only available in the Gutenberg plugin for now.
1538
+
1539
+ _Parameters_
1540
+
1541
+ - _kind_ `string`: Entity kind.
1542
+ - _name_ `string`: Entity name.
1543
+ - _config_ `Action`: Action configuration.
1544
+
1448
1545
  ### RichText
1449
1546
 
1450
1547
  > **Deprecated** since 5.3, use `wp.blockEditor.RichText` instead.
@@ -1491,24 +1588,63 @@ _Type_
1491
1588
 
1492
1589
  ### TableOfContents
1493
1590
 
1494
- Undocumented declaration.
1591
+ Renders a table of contents component.
1592
+
1593
+ _Parameters_
1594
+
1595
+ - _props_ `Object`: The component props.
1596
+ - _props.hasOutlineItemsDisabled_ `boolean`: Whether outline items are disabled.
1597
+ - _props.repositionDropdown_ `boolean`: Whether to reposition the dropdown.
1598
+ - _ref_ `Element.ref`: The component's ref.
1599
+
1600
+ _Returns_
1601
+
1602
+ - `JSX.Element`: The rendered table of contents component.
1495
1603
 
1496
1604
  ### TextEditorGlobalKeyboardShortcuts
1497
1605
 
1498
- Undocumented declaration.
1606
+ Component handles the global keyboard shortcuts for the Text editor.
1607
+
1608
+ It provides functionality for various keyboard shortcuts such as toggling editor mode, toggling distraction-free mode, undo/redo.
1499
1609
 
1500
1610
  ### ThemeSupportCheck
1501
1611
 
1502
- Undocumented declaration.
1612
+ Checks if the current theme supports specific features and renders the children if supported.
1613
+
1614
+ _Parameters_
1615
+
1616
+ - _props_ `Object`: The component props.
1617
+ - _props.children_ `Element`: The children to render if the theme supports the specified features.
1618
+ - _props.supportKeys_ `string|string[]`: The key(s) of the theme support(s) to check.
1619
+
1620
+ _Returns_
1621
+
1622
+ - `JSX.Element|null`: The rendered children if the theme supports the specified features, otherwise null.
1503
1623
 
1504
1624
  ### TimeToRead
1505
1625
 
1506
- Undocumented declaration.
1626
+ Component for showing Time To Read in Content.
1627
+
1628
+ _Returns_
1629
+
1630
+ - `JSX.Element`: The rendered TimeToRead component.
1507
1631
 
1508
1632
  ### transformStyles
1509
1633
 
1510
1634
  Undocumented declaration.
1511
1635
 
1636
+ ### unregisterEntityAction
1637
+
1638
+ Unregisters a DataViews action.
1639
+
1640
+ This is an experimental API and is subject to change. it's only available in the Gutenberg plugin for now.
1641
+
1642
+ _Parameters_
1643
+
1644
+ - _kind_ `string`: Entity kind.
1645
+ - _name_ `string`: Entity name.
1646
+ - _actionId_ `string`: Action ID.
1647
+
1512
1648
  ### UnsavedChangesWarning
1513
1649
 
1514
1650
  Warns the user if there are unsaved changes before leaving the editor. Compatible with Post Editor and Site Editor.
@@ -1531,7 +1667,11 @@ _Returns_
1531
1667
 
1532
1668
  ### useEntitiesSavedStatesIsDirty
1533
1669
 
1534
- Undocumented declaration.
1670
+ Custom hook that determines if any entities are dirty (edited) and provides a way to manage selected/unselected entities.
1671
+
1672
+ _Returns_
1673
+
1674
+ - `Object`: An object containing the following properties: - dirtyEntityRecords: An array of dirty entity records. - isDirty: A boolean indicating if there are any dirty entity records. - setUnselectedEntities: A function to set the unselected entities. - unselectedEntities: An array of unselected entities.
1535
1675
 
1536
1676
  ### usePostScheduleLabel
1537
1677
 
@@ -1592,7 +1732,11 @@ Undocumented declaration.
1592
1732
 
1593
1733
  ### WordCount
1594
1734
 
1595
- Undocumented declaration.
1735
+ Renders the word count of the post content.
1736
+
1737
+ _Returns_
1738
+
1739
+ - `JSX.Element|null`: The rendered WordCount component.
1596
1740
 
1597
1741
  ### WritingFlow
1598
1742
 
@@ -26,7 +26,8 @@ function ContentOnlySettingsMenuItems({
26
26
  }) {
27
27
  const {
28
28
  entity,
29
- onNavigateToEntityRecord
29
+ onNavigateToEntityRecord,
30
+ canEditTemplates
30
31
  } = (0, _data.useSelect)(select => {
31
32
  const {
32
33
  getBlockEditingMode,
@@ -44,16 +45,19 @@ function ContentOnlySettingsMenuItems({
44
45
  record = select(_coreData.store).getEntityRecord('postType', 'wp_block', getBlockAttributes(patternParent).ref);
45
46
  } else {
46
47
  const {
47
- getCurrentPostType,
48
48
  getCurrentTemplateId
49
49
  } = select(_store.store);
50
- const currentPostType = getCurrentPostType();
51
50
  const templateId = getCurrentTemplateId();
52
- if (currentPostType === 'page' && templateId) {
51
+ const {
52
+ getContentLockingParent
53
+ } = (0, _lockUnlock.unlock)(select(_blockEditor.store));
54
+ if (!getContentLockingParent(clientId) && templateId) {
53
55
  record = select(_coreData.store).getEntityRecord('postType', 'wp_template', templateId);
54
56
  }
55
57
  }
58
+ const _canEditTemplates = select(_coreData.store).canUser('create', 'templates');
56
59
  return {
60
+ canEditTemplates: _canEditTemplates,
57
61
  entity: record,
58
62
  onNavigateToEntityRecord: getSettings().onNavigateToEntityRecord
59
63
  };
@@ -65,6 +69,10 @@ function ContentOnlySettingsMenuItems({
65
69
  });
66
70
  }
67
71
  const isPattern = entity.type === 'wp_block';
72
+ let helpText = isPattern ? (0, _i18n.__)('Edit the pattern to move, delete, or make further changes to this block.') : (0, _i18n.__)('Edit the template to move, delete, or make further changes to this block.');
73
+ if (!canEditTemplates) {
74
+ helpText = (0, _i18n.__)('Only users with permissions to edit the template can move or delete this block');
75
+ }
68
76
  return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
69
77
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.__unstableBlockSettingsMenuFirstItem, {
70
78
  children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.MenuItem, {
@@ -74,13 +82,14 @@ function ContentOnlySettingsMenuItems({
74
82
  postType: entity.type
75
83
  });
76
84
  },
85
+ disabled: !canEditTemplates,
77
86
  children: isPattern ? (0, _i18n.__)('Edit pattern') : (0, _i18n.__)('Edit template')
78
87
  })
79
88
  }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.__experimentalText, {
80
89
  variant: "muted",
81
90
  as: "p",
82
91
  className: "editor-content-only-settings-menu__description",
83
- children: isPattern ? (0, _i18n.__)('Edit the pattern to move, delete, or make further changes to this block.') : (0, _i18n.__)('Edit the template to move, delete, or make further changes to this block.')
92
+ children: helpText
84
93
  })]
85
94
  });
86
95
  }
@@ -1 +1 @@
1
- {"version":3,"names":["_blockEditor","require","_coreData","_components","_data","_i18n","_store","_lockUnlock","_jsxRuntime","ContentOnlySettingsMenuItems","clientId","onClose","entity","onNavigateToEntityRecord","useSelect","select","getBlockEditingMode","getBlockParentsByBlockName","getSettings","getBlockAttributes","blockEditorStore","contentOnly","patternParent","record","coreStore","getEntityRecord","ref","getCurrentPostType","getCurrentTemplateId","editorStore","currentPostType","templateId","jsx","TemplateLockContentOnlyMenuItems","isPattern","type","jsxs","Fragment","children","__unstableBlockSettingsMenuFirstItem","MenuItem","onClick","postId","id","postType","__","__experimentalText","variant","as","className","contentLockingParent","getContentLockingParent","unlock","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 } = 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 { getCurrentPostType, getCurrentTemplateId } =\n\t\t\t\t\tselect( editorStore );\n\t\t\t\tconst currentPostType = getCurrentPostType();\n\t\t\t\tconst templateId = getCurrentTemplateId();\n\t\t\t\tif ( currentPostType === 'page' && 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\treturn {\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\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>\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{ isPattern\n\t\t\t\t\t? __(\n\t\t\t\t\t\t\t'Edit the pattern to move, delete, or make further changes to this block.'\n\t\t\t\t\t )\n\t\t\t\t\t: __(\n\t\t\t\t\t\t\t'Edit the template to move, delete, or make further changes to this block.'\n\t\t\t\t\t ) }\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,IAAA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IAAAtB,QAAA,EACvBA,CAAE;MAAEuB,iBAAiB;MAAElD;IAAQ,CAAC,KACjCkD,iBAAiB,CAACC,MAAM,KAAK,CAAC,iBAC7B,IAAAtD,WAAA,CAAAwB,GAAA,EAACvB,4BAA4B;MAC5BC,QAAQ,EAAGmD,iBAAiB,CAAE,CAAC,CAAI;MACnClD,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","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;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AC,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":[]}
@@ -32,9 +32,6 @@ var _jsxRuntime = require("react/jsx-runtime");
32
32
  * Internal dependencies
33
33
  */
34
34
 
35
- const preventDefault = event => {
36
- event.preventDefault();
37
- };
38
35
  function DocumentTools({
39
36
  className,
40
37
  disableBlockTools = false
@@ -84,6 +81,18 @@ function DocumentTools({
84
81
  isZoomedOutView: __unstableGetEditorMode() === 'zoom-out'
85
82
  };
86
83
  }, []);
84
+ const preventDefault = event => {
85
+ // Because the inserter behaves like a dialog,
86
+ // if the inserter is opened already then when we click on the toggle button
87
+ // then the initial click event will close the inserter and then be propagated
88
+ // to the inserter toggle and it will open it again.
89
+ // To prevent this we need to stop the propagation of the event.
90
+ // This won't be necessary when the inserter no longer behaves like a dialog.
91
+
92
+ if (isInserterOpened) {
93
+ event.preventDefault();
94
+ }
95
+ };
87
96
  const isLargeViewport = (0, _compose.useViewportMatch)('medium');
88
97
  const isWideViewport = (0, _compose.useViewportMatch)('wide');
89
98
 
@@ -1 +1 @@
1
- {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","_jsxRuntime","preventDefault","event","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","hasFixedToolbar","showIconLabels","useSelect","select","getSettings","blockEditorStore","get","preferencesStore","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","unlock","getShortcutRepresentation","keyboardShortcutsStore","__unstableGetEditorMode","isVisualMode","isZoomedOutView","isLargeViewport","useViewportMatch","isWideViewport","toolbarAriaLabel","__","toggleListView","useCallback","toggleInserter","longLabel","_x","shortLabel","jsx","NavigableToolbar","clsx","variant","children","jsxs","ToolbarItem","ref","as","Button","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nconst preventDefault = ( event ) => {\n\tevent.preventDefault();\n};\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\thasFixedToolbar,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t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;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEctE,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["_clsx","_interopRequireDefault","require","_compose","_data","_i18n","_blockEditor","_components","_icons","_element","_keyboardShortcuts","_preferences","_lockUnlock","_store","_redo","_undo","_jsxRuntime","DocumentTools","className","disableBlockTools","setIsInserterOpened","setIsListViewOpened","useDispatch","editorStore","isDistractionFree","isInserterOpened","isListViewOpen","listViewShortcut","inserterSidebarToggleRef","listViewToggleRef","hasFixedToolbar","showIconLabels","useSelect","select","getSettings","blockEditorStore","get","preferencesStore","isListViewOpened","getEditorMode","getInserterSidebarToggleRef","getListViewToggleRef","unlock","getShortcutRepresentation","keyboardShortcutsStore","__unstableGetEditorMode","isVisualMode","isZoomedOutView","preventDefault","event","isLargeViewport","useViewportMatch","isWideViewport","toolbarAriaLabel","__","toggleListView","useCallback","toggleInserter","longLabel","_x","shortLabel","jsx","NavigableToolbar","clsx","variant","children","jsxs","ToolbarItem","ref","as","Button","isPressed","onMouseDown","onClick","disabled","icon","plus","label","showTooltip","Fragment","ToolSelector","undefined","size","EditorHistoryUndo","EditorHistoryRedo","listView","shortcut","_default","exports","default"],"sources":["@wordpress/editor/src/components/document-tools/index.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport clsx from 'clsx';\n\n/**\n * WordPress dependencies\n */\nimport { useViewportMatch } from '@wordpress/compose';\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport { __, _x } from '@wordpress/i18n';\nimport {\n\tNavigableToolbar,\n\tToolSelector,\n\tstore as blockEditorStore,\n} from '@wordpress/block-editor';\nimport { Button, ToolbarItem } from '@wordpress/components';\nimport { listView, plus } from '@wordpress/icons';\nimport { useCallback } from '@wordpress/element';\nimport { store as keyboardShortcutsStore } from '@wordpress/keyboard-shortcuts';\nimport { store as preferencesStore } from '@wordpress/preferences';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\nimport { store as editorStore } from '../../store';\nimport EditorHistoryRedo from '../editor-history/redo';\nimport EditorHistoryUndo from '../editor-history/undo';\n\nfunction DocumentTools( { className, disableBlockTools = false } ) {\n\tconst { setIsInserterOpened, setIsListViewOpened } =\n\t\tuseDispatch( editorStore );\n\tconst {\n\t\tisDistractionFree,\n\t\tisInserterOpened,\n\t\tisListViewOpen,\n\t\tlistViewShortcut,\n\t\tinserterSidebarToggleRef,\n\t\tlistViewToggleRef,\n\t\thasFixedToolbar,\n\t\tshowIconLabels,\n\t} = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\tconst { get } = select( preferencesStore );\n\t\tconst {\n\t\t\tisListViewOpened,\n\t\t\tgetEditorMode,\n\t\t\tgetInserterSidebarToggleRef,\n\t\t\tgetListViewToggleRef,\n\t\t} = unlock( select( editorStore ) );\n\t\tconst { getShortcutRepresentation } = select( keyboardShortcutsStore );\n\t\tconst { __unstableGetEditorMode } = select( blockEditorStore );\n\n\t\treturn {\n\t\t\tisInserterOpened: select( editorStore ).isInserterOpened(),\n\t\t\tisListViewOpen: isListViewOpened(),\n\t\t\tlistViewShortcut: getShortcutRepresentation(\n\t\t\t\t'core/editor/toggle-list-view'\n\t\t\t),\n\t\t\tinserterSidebarToggleRef: getInserterSidebarToggleRef(),\n\t\t\tlistViewToggleRef: getListViewToggleRef(),\n\t\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\t\tshowIconLabels: get( 'core', 'showIconLabels' ),\n\t\t\tisDistractionFree: get( 'core', 'distractionFree' ),\n\t\t\tisVisualMode: getEditorMode() === 'visual',\n\t\t\tisZoomedOutView: __unstableGetEditorMode() === 'zoom-out',\n\t\t};\n\t}, [] );\n\n\tconst preventDefault = ( event ) => {\n\t\t// Because the inserter behaves like a dialog,\n\t\t// if the inserter is opened already then when we click on the toggle button\n\t\t// then the initial click event will close the inserter and then be propagated\n\t\t// to the inserter toggle and it will open it again.\n\t\t// To prevent this we need to stop the propagation of the event.\n\t\t// This won't be necessary when the inserter no longer behaves like a dialog.\n\n\t\tif ( isInserterOpened ) {\n\t\t\tevent.preventDefault();\n\t\t}\n\t};\n\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isWideViewport = useViewportMatch( 'wide' );\n\n\t/* translators: accessibility text for the editor toolbar */\n\tconst toolbarAriaLabel = __( 'Document tools' );\n\n\tconst toggleListView = useCallback(\n\t\t() => setIsListViewOpened( ! isListViewOpen ),\n\t\t[ setIsListViewOpened, isListViewOpen ]\n\t);\n\n\tconst toggleInserter = useCallback(\n\t\t() => setIsInserterOpened( ! isInserterOpened ),\n\t\t[ isInserterOpened, setIsInserterOpened ]\n\t);\n\n\t/* translators: button label text should, if possible, be under 16 characters. */\n\tconst longLabel = _x(\n\t\t'Toggle block inserter',\n\t\t'Generic label for block inserter button'\n\t);\n\tconst shortLabel = ! isInserterOpened ? __( 'Add' ) : __( 'Close' );\n\n\treturn (\n\t\t// Some plugins expect and use the `edit-post-header-toolbar` CSS class to\n\t\t// find the toolbar and inject UI elements into it. This is not officially\n\t\t// supported, but we're keeping it in the list of class names for backwards\n\t\t// compatibility.\n\t\t<NavigableToolbar\n\t\t\tclassName={ clsx(\n\t\t\t\t'editor-document-tools',\n\t\t\t\t'edit-post-header-toolbar',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\taria-label={ toolbarAriaLabel }\n\t\t\tvariant=\"unstyled\"\n\t\t>\n\t\t\t<div className=\"editor-document-tools__left\">\n\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\tref={ inserterSidebarToggleRef }\n\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\tclassName=\"editor-document-tools__inserter-toggle\"\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\tisPressed={ isInserterOpened }\n\t\t\t\t\t\tonMouseDown={ preventDefault }\n\t\t\t\t\t\tonClick={ toggleInserter }\n\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\ticon={ plus }\n\t\t\t\t\t\tlabel={ showIconLabels ? shortLabel : longLabel }\n\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\taria-expanded={ isInserterOpened }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ ( isWideViewport || ! showIconLabels ) && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ isLargeViewport && ! hasFixedToolbar && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ ToolSelector }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryUndo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\tas={ EditorHistoryRedo }\n\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\tvariant={ showIconLabels ? 'tertiary' : undefined }\n\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t{ ! isDistractionFree && (\n\t\t\t\t\t\t\t<ToolbarItem\n\t\t\t\t\t\t\t\tas={ Button }\n\t\t\t\t\t\t\t\tclassName=\"editor-document-tools__document-overview-toggle\"\n\t\t\t\t\t\t\t\ticon={ listView }\n\t\t\t\t\t\t\t\tdisabled={ disableBlockTools }\n\t\t\t\t\t\t\t\tisPressed={ isListViewOpen }\n\t\t\t\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\t\t\t\tlabel={ __( 'Document Overview' ) }\n\t\t\t\t\t\t\t\tonClick={ toggleListView }\n\t\t\t\t\t\t\t\tshortcut={ listViewShortcut }\n\t\t\t\t\t\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\t\t\t\t\t\tvariant={\n\t\t\t\t\t\t\t\t\tshowIconLabels ? 'tertiary' : undefined\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\taria-expanded={ isListViewOpen }\n\t\t\t\t\t\t\t\tref={ listViewToggleRef }\n\t\t\t\t\t\t\t\tsize=\"compact\"\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t) }\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t</div>\n\t\t</NavigableToolbar>\n\t);\n}\n\nexport default DocumentTools;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,sBAAA,CAAAC,OAAA;AAKA,IAAAC,QAAA,GAAAD,OAAA;AACA,IAAAE,KAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AACA,IAAAI,YAAA,GAAAJ,OAAA;AAKA,IAAAK,WAAA,GAAAL,OAAA;AACA,IAAAM,MAAA,GAAAN,OAAA;AACA,IAAAO,QAAA,GAAAP,OAAA;AACA,IAAAQ,kBAAA,GAAAR,OAAA;AACA,IAAAS,YAAA,GAAAT,OAAA;AAKA,IAAAU,WAAA,GAAAV,OAAA;AACA,IAAAW,MAAA,GAAAX,OAAA;AACA,IAAAY,KAAA,GAAAb,sBAAA,CAAAC,OAAA;AACA,IAAAa,KAAA,GAAAd,sBAAA,CAAAC,OAAA;AAAuD,IAAAc,WAAA,GAAAd,OAAA;AA5BvD;AACA;AACA;;AAGA;AACA;AACA;;AAeA;AACA;AACA;;AAMA,SAASe,aAAaA,CAAE;EAAEC,SAAS;EAAEC,iBAAiB,GAAG;AAAM,CAAC,EAAG;EACl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pB,IAAAR,WAAA,CAAA6C,GAAA,EAACtD,WAAA,CAAA4D,WAAW;YACXE,EAAE,EAAGC,kBAAQ;YACbpD,SAAS,EAAC,iDAAiD;YAC3DyD,IAAI,EAAGU,eAAU;YACjBX,QAAQ,EAAGvD,iBAAmB;YAC9BoD,SAAS,EAAG7C;YACZ;YACAmD,KAAK,EAAG,IAAAvB,QAAE,EAAE,mBAAoB,CAAG;YACnCmB,OAAO,EAAGlB,cAAgB;YAC1B+B,QAAQ,EAAG3D,gBAAkB;YAC7BmD,WAAW,EAAG,CAAE/C,cAAgB;YAChCiC,OAAO,EACNjC,cAAc,GAAG,UAAU,GAAGkD,SAC9B;YACD,iBAAgBvD,cAAgB;YAChC0C,GAAG,EAAGvC,iBAAmB;YACzBqD,IAAI,EAAC;UAAS,CACd,CACD;QAAA,CACA,CACF;MAAA,CACG;IAAC,CACW;EAAC;AAErB;AAAC,IAAAK,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAEcxE,aAAa","ignoreList":[]}
@@ -0,0 +1,77 @@
1
+ "use strict";
2
+
3
+ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
+ Object.defineProperty(exports, "__esModule", {
5
+ value: true
6
+ });
7
+ exports.default = void 0;
8
+ var _data = require("@wordpress/data");
9
+ var _coreData = require("@wordpress/core-data");
10
+ var _components = require("@wordpress/components");
11
+ var _i18n = require("@wordpress/i18n");
12
+ var _constants = require("../../store/constants");
13
+ var _editorInterface = _interopRequireDefault(require("../editor-interface"));
14
+ var _provider = require("../provider");
15
+ var _sidebar = _interopRequireDefault(require("../sidebar"));
16
+ var _jsxRuntime = require("react/jsx-runtime");
17
+ /**
18
+ * WordPress dependencies
19
+ */
20
+
21
+ /**
22
+ * Internal dependencies
23
+ */
24
+
25
+ function Editor({
26
+ postType,
27
+ postId,
28
+ templateId,
29
+ settings,
30
+ children,
31
+ initialEdits,
32
+ // This could be part of the settings.
33
+ onActionPerformed,
34
+ // The following abstractions are not ideal but necessary
35
+ // to account for site editor and post editor differences for now.
36
+ extraContent,
37
+ extraSidebarPanels,
38
+ ...props
39
+ }) {
40
+ const {
41
+ post,
42
+ template,
43
+ hasLoadedPost
44
+ } = (0, _data.useSelect)(select => {
45
+ const {
46
+ getEntityRecord,
47
+ hasFinishedResolution
48
+ } = select(_coreData.store);
49
+ return {
50
+ post: getEntityRecord('postType', postType, postId),
51
+ template: templateId ? getEntityRecord('postType', _constants.TEMPLATE_POST_TYPE, templateId) : undefined,
52
+ hasLoadedPost: hasFinishedResolution('getEntityRecord', ['postType', postType, postId])
53
+ };
54
+ }, [postType, postId, templateId]);
55
+ return /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
56
+ children: [hasLoadedPost && !post && /*#__PURE__*/(0, _jsxRuntime.jsx)(_components.Notice, {
57
+ status: "warning",
58
+ isDismissible: false,
59
+ children: (0, _i18n.__)("You attempted to edit an item that doesn't exist. Perhaps it was deleted?")
60
+ }), !!post && /*#__PURE__*/(0, _jsxRuntime.jsxs)(_provider.ExperimentalEditorProvider, {
61
+ post: post,
62
+ __unstableTemplate: template,
63
+ settings: settings,
64
+ initialEdits: initialEdits,
65
+ useSubRegistry: false,
66
+ children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_editorInterface.default, {
67
+ ...props,
68
+ children: extraContent
69
+ }), /*#__PURE__*/(0, _jsxRuntime.jsx)(_sidebar.default, {
70
+ onActionPerformed: onActionPerformed,
71
+ extraPanels: extraSidebarPanels
72
+ }), children]
73
+ })]
74
+ });
75
+ }
76
+ var _default = exports.default = Editor;
77
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_data","require","_coreData","_components","_i18n","_constants","_editorInterface","_interopRequireDefault","_provider","_sidebar","_jsxRuntime","Editor","postType","postId","templateId","settings","children","initialEdits","onActionPerformed","extraContent","extraSidebarPanels","props","post","template","hasLoadedPost","useSelect","select","getEntityRecord","hasFinishedResolution","coreStore","TEMPLATE_POST_TYPE","undefined","jsxs","Fragment","jsx","Notice","status","isDismissible","__","ExperimentalEditorProvider","__unstableTemplate","useSubRegistry","default","extraPanels","_default","exports"],"sources":["@wordpress/editor/src/components/editor/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\nimport { Notice } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { TEMPLATE_POST_TYPE } from '../../store/constants';\nimport EditorInterface from '../editor-interface';\nimport { ExperimentalEditorProvider } from '../provider';\nimport Sidebar from '../sidebar';\n\nfunction Editor( {\n\tpostType,\n\tpostId,\n\ttemplateId,\n\tsettings,\n\tchildren,\n\tinitialEdits,\n\n\t// This could be part of the settings.\n\tonActionPerformed,\n\n\t// The following abstractions are not ideal but necessary\n\t// to account for site editor and post editor differences for now.\n\textraContent,\n\textraSidebarPanels,\n\t...props\n} ) {\n\tconst { post, template, hasLoadedPost } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getEntityRecord, hasFinishedResolution } =\n\t\t\t\tselect( coreStore );\n\t\t\treturn {\n\t\t\t\tpost: getEntityRecord( 'postType', postType, postId ),\n\t\t\t\ttemplate: templateId\n\t\t\t\t\t? getEntityRecord(\n\t\t\t\t\t\t\t'postType',\n\t\t\t\t\t\t\tTEMPLATE_POST_TYPE,\n\t\t\t\t\t\t\ttemplateId\n\t\t\t\t\t )\n\t\t\t\t\t: undefined,\n\t\t\t\thasLoadedPost: hasFinishedResolution( 'getEntityRecord', [\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tpostId,\n\t\t\t\t] ),\n\t\t\t};\n\t\t},\n\t\t[ postType, postId, templateId ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t{ hasLoadedPost && ! post && (\n\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t\"You attempted to edit an item that doesn't exist. Perhaps it was deleted?\"\n\t\t\t\t\t) }\n\t\t\t\t</Notice>\n\t\t\t) }\n\t\t\t{ !! post && (\n\t\t\t\t<ExperimentalEditorProvider\n\t\t\t\t\tpost={ post }\n\t\t\t\t\t__unstableTemplate={ template }\n\t\t\t\t\tsettings={ settings }\n\t\t\t\t\tinitialEdits={ initialEdits }\n\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t>\n\t\t\t\t\t<EditorInterface { ...props }>\n\t\t\t\t\t\t{ extraContent }\n\t\t\t\t\t</EditorInterface>\n\t\t\t\t\t<Sidebar\n\t\t\t\t\t\tonActionPerformed={ onActionPerformed }\n\t\t\t\t\t\textraPanels={ extraSidebarPanels }\n\t\t\t\t\t/>\n\t\t\t\t\t{ children }\n\t\t\t\t</ExperimentalEditorProvider>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nexport default Editor;\n"],"mappings":";;;;;;;AAGA,IAAAA,KAAA,GAAAC,OAAA;AACA,IAAAC,SAAA,GAAAD,OAAA;AACA,IAAAE,WAAA,GAAAF,OAAA;AACA,IAAAG,KAAA,GAAAH,OAAA;AAKA,IAAAI,UAAA,GAAAJ,OAAA;AACA,IAAAK,gBAAA,GAAAC,sBAAA,CAAAN,OAAA;AACA,IAAAO,SAAA,GAAAP,OAAA;AACA,IAAAQ,QAAA,GAAAF,sBAAA,CAAAN,OAAA;AAAiC,IAAAS,WAAA,GAAAT,OAAA;AAdjC;AACA;AACA;;AAMA;AACA;AACA;;AAMA,SAASU,MAAMA,CAAE;EAChBC,QAAQ;EACRC,MAAM;EACNC,UAAU;EACVC,QAAQ;EACRC,QAAQ;EACRC,YAAY;EAEZ;EACAC,iBAAiB;EAEjB;EACA;EACAC,YAAY;EACZC,kBAAkB;EAClB,GAAGC;AACJ,CAAC,EAAG;EACH,MAAM;IAAEC,IAAI;IAAEC,QAAQ;IAAEC;EAAc,CAAC,GAAG,IAAAC,eAAS,EAChDC,MAAM,IAAM;IACb,MAAM;MAAEC,eAAe;M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EAAA,CACA,CAAC;AAEL;AAAC,IAAA4B,QAAA,GAAAC,OAAA,CAAAH,OAAA,GAEc/B,MAAM","ignoreList":[]}
@@ -115,8 +115,9 @@ function EditorInterface({
115
115
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_interface.InterfaceSkeleton, {
116
116
  enableRegionNavigation: enableRegionNavigation,
117
117
  isDistractionFree: isDistractionFree && isWideViewport,
118
- className: (0, _clsx.default)(className, {
119
- 'is-entity-save-view-open': !!entitiesSavedStatesCallback
118
+ className: (0, _clsx.default)('editor-editor-interface', className, {
119
+ 'is-entity-save-view-open': !!entitiesSavedStatesCallback,
120
+ 'is-distraction-free': isDistractionFree && isWideViewport && !isPreviewMode
120
121
  }),
121
122
  labels: {
122
123
  ...interfaceLabels,
@@ -136,7 +137,7 @@ function EditorInterface({
136
137
  }),
137
138
  content: /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
138
139
  children: [!isDistractionFree && !isPreviewMode && /*#__PURE__*/(0, _jsxRuntime.jsx)(_editorNotices.default, {}), /*#__PURE__*/(0, _jsxRuntime.jsx)(_contentSlotFill.default.Slot, {
139
- children: ([editorCanvasView]) => !isPreviewMode && editorCanvasView ? editorCanvasView : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
140
+ children: ([editorCanvasView]) => editorCanvasView ? editorCanvasView : /*#__PURE__*/(0, _jsxRuntime.jsxs)(_jsxRuntime.Fragment, {
140
141
  children: [!isPreviewMode && (mode === 'text' || !isRichEditingEnabled) && /*#__PURE__*/(0, _jsxRuntime.jsx)(_textEditor.default
141
142
  // We should auto-focus the canvas (title) on load.
142
143
  // eslint-disable-next-line jsx-a11y/no-autofocus
@@ -157,11 +158,8 @@ function EditorInterface({
157
158
  })
158
159
  })]
159
160
  }),
160
- footer: !isPreviewMode && !isDistractionFree && isLargeViewport && showBlockBreadcrumbs && isRichEditingEnabled && blockEditorMode !== 'zoom-out' && mode === 'visual' && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
161
- className: "edit-post-layout__footer",
162
- children: /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockBreadcrumb, {
163
- rootLabelText: documentLabel
164
- })
161
+ footer: !isPreviewMode && !isDistractionFree && isLargeViewport && showBlockBreadcrumbs && isRichEditingEnabled && blockEditorMode !== 'zoom-out' && mode === 'visual' && /*#__PURE__*/(0, _jsxRuntime.jsx)(_blockEditor.BlockBreadcrumb, {
162
+ rootLabelText: documentLabel
165
163
  }),
166
164
  actions: /*#__PURE__*/(0, _jsxRuntime.jsx)(_savePublishPanels.default, {
167
165
  closeEntitiesSavedStates: closeEntitiesSavedStates,