@wordpress/editor 14.12.0 → 14.13.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 (742) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +120 -99
  3. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  4. package/build/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  5. package/build/components/collab-sidebar/add-comment.js +17 -65
  6. package/build/components/collab-sidebar/add-comment.js.map +1 -1
  7. package/build/components/collab-sidebar/comment-author-info.js +76 -0
  8. package/build/components/collab-sidebar/comment-author-info.js.map +1 -0
  9. package/build/components/collab-sidebar/comment-button-toolbar.js +2 -2
  10. package/build/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
  11. package/build/components/collab-sidebar/comment-button.js +2 -2
  12. package/build/components/collab-sidebar/comment-button.js.map +1 -1
  13. package/build/components/collab-sidebar/comment-form.js +64 -0
  14. package/build/components/collab-sidebar/comment-form.js.map +1 -0
  15. package/build/components/collab-sidebar/comments.js +33 -91
  16. package/build/components/collab-sidebar/comments.js.map +1 -1
  17. package/build/components/create-template-part-modal/index.js +1 -2
  18. package/build/components/create-template-part-modal/index.js.map +1 -1
  19. package/build/components/document-bar/index.js +10 -3
  20. package/build/components/document-bar/index.js.map +1 -1
  21. package/build/components/document-outline/check.js +4 -4
  22. package/build/components/document-outline/check.js.map +1 -1
  23. package/build/components/document-outline/index.js +8 -8
  24. package/build/components/document-outline/index.js.map +1 -1
  25. package/build/components/document-tools/index.js +1 -1
  26. package/build/components/document-tools/index.js.map +1 -1
  27. package/build/components/editor-history/redo.js +1 -1
  28. package/build/components/editor-history/redo.js.map +1 -1
  29. package/build/components/editor-history/undo.js +1 -1
  30. package/build/components/editor-history/undo.js.map +1 -1
  31. package/build/components/editor-interface/content-slot-fill.js +1 -10
  32. package/build/components/editor-interface/content-slot-fill.js.map +1 -1
  33. package/build/components/editor-interface/index.js +3 -9
  34. package/build/components/editor-interface/index.js.map +1 -1
  35. package/build/components/editor-notices/index.js +1 -1
  36. package/build/components/editor-notices/index.js.map +1 -1
  37. package/build/components/editor-snackbars/index.js +1 -1
  38. package/build/components/editor-snackbars/index.js.map +1 -1
  39. package/build/components/entities-saved-states/entity-record-item.js +9 -1
  40. package/build/components/entities-saved-states/entity-record-item.js.map +1 -1
  41. package/build/components/entities-saved-states/index.js +2 -2
  42. package/build/components/entities-saved-states/index.js.map +1 -1
  43. package/build/components/page-attributes/check.js +3 -3
  44. package/build/components/page-attributes/check.js.map +1 -1
  45. package/build/components/page-attributes/order.js +1 -1
  46. package/build/components/page-attributes/order.js.map +1 -1
  47. package/build/components/page-attributes/panel.js +1 -1
  48. package/build/components/page-attributes/panel.js.map +1 -1
  49. package/build/components/page-attributes/parent.js +1 -1
  50. package/build/components/page-attributes/parent.js.map +1 -1
  51. package/build/components/plugin-document-setting-panel/index.js +2 -2
  52. package/build/components/plugin-document-setting-panel/index.js.map +1 -1
  53. package/build/components/plugin-more-menu-item/index.js +2 -1
  54. package/build/components/plugin-more-menu-item/index.js.map +1 -1
  55. package/build/components/plugin-post-publish-panel/index.js +2 -2
  56. package/build/components/plugin-post-publish-panel/index.js.map +1 -1
  57. package/build/components/plugin-post-status-info/index.js +4 -4
  58. package/build/components/plugin-post-status-info/index.js.map +1 -1
  59. package/build/components/plugin-pre-publish-panel/index.js +2 -2
  60. package/build/components/plugin-pre-publish-panel/index.js.map +1 -1
  61. package/build/components/plugin-preview-menu-item/index.js +2 -1
  62. package/build/components/plugin-preview-menu-item/index.js.map +1 -1
  63. package/build/components/plugin-sidebar/index.js +1 -0
  64. package/build/components/plugin-sidebar/index.js.map +1 -1
  65. package/build/components/plugin-sidebar-more-menu-item/index.js +2 -1
  66. package/build/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  67. package/build/components/post-actions/actions.js +3 -3
  68. package/build/components/post-actions/actions.js.map +1 -1
  69. package/build/components/post-author/check.js +3 -3
  70. package/build/components/post-author/check.js.map +1 -1
  71. package/build/components/post-author/index.js +1 -1
  72. package/build/components/post-author/index.js.map +1 -1
  73. package/build/components/post-author/panel.js +1 -1
  74. package/build/components/post-author/panel.js.map +1 -1
  75. package/build/components/post-card-panel/index.js +9 -4
  76. package/build/components/post-card-panel/index.js.map +1 -1
  77. package/build/components/post-comments/index.js +1 -1
  78. package/build/components/post-comments/index.js.map +1 -1
  79. package/build/components/post-discussion/panel.js +1 -1
  80. package/build/components/post-discussion/panel.js.map +1 -1
  81. package/build/components/post-excerpt/check.js +3 -3
  82. package/build/components/post-excerpt/check.js.map +1 -1
  83. package/build/components/post-excerpt/panel.js +1 -1
  84. package/build/components/post-excerpt/panel.js.map +1 -1
  85. package/build/components/post-excerpt/plugin.js +4 -4
  86. package/build/components/post-excerpt/plugin.js.map +1 -1
  87. package/build/components/post-featured-image/check.js +3 -3
  88. package/build/components/post-featured-image/check.js.map +1 -1
  89. package/build/components/post-featured-image/index.js +39 -9
  90. package/build/components/post-featured-image/index.js.map +1 -1
  91. package/build/components/post-featured-image/panel.js +1 -1
  92. package/build/components/post-featured-image/panel.js.map +1 -1
  93. package/build/components/post-fields/index.js +70 -0
  94. package/build/components/post-fields/index.js.map +1 -0
  95. package/build/components/post-format/check.js +9 -12
  96. package/build/components/post-format/check.js.map +1 -1
  97. package/build/components/post-format/index.js +1 -1
  98. package/build/components/post-format/index.js.map +1 -1
  99. package/build/components/post-format/panel.js +1 -1
  100. package/build/components/post-format/panel.js.map +1 -1
  101. package/build/components/post-last-revision/check.js +3 -3
  102. package/build/components/post-last-revision/check.js.map +1 -1
  103. package/build/components/post-last-revision/index.js +1 -1
  104. package/build/components/post-last-revision/index.js.map +1 -1
  105. package/build/components/post-last-revision/panel.js +1 -1
  106. package/build/components/post-last-revision/panel.js.map +1 -1
  107. package/build/components/post-locked-modal/index.js +1 -1
  108. package/build/components/post-locked-modal/index.js.map +1 -1
  109. package/build/components/post-pending-status/check.js +3 -3
  110. package/build/components/post-pending-status/check.js.map +1 -1
  111. package/build/components/post-pending-status/index.js +1 -1
  112. package/build/components/post-pending-status/index.js.map +1 -1
  113. package/build/components/post-preview-button/index.js +1 -1
  114. package/build/components/post-preview-button/index.js.map +1 -1
  115. package/build/components/post-publish-panel/index.js +5 -2
  116. package/build/components/post-publish-panel/index.js.map +1 -1
  117. package/build/components/post-schedule/check.js +3 -3
  118. package/build/components/post-schedule/check.js.map +1 -1
  119. package/build/components/post-schedule/index.js +1 -1
  120. package/build/components/post-schedule/index.js.map +1 -1
  121. package/build/components/post-schedule/label.js +1 -1
  122. package/build/components/post-schedule/label.js.map +1 -1
  123. package/build/components/post-schedule/panel.js +1 -1
  124. package/build/components/post-schedule/panel.js.map +1 -1
  125. package/build/components/post-slug/check.js +3 -3
  126. package/build/components/post-slug/check.js.map +1 -1
  127. package/build/components/post-slug/index.js +1 -1
  128. package/build/components/post-slug/index.js.map +1 -1
  129. package/build/components/post-sticky/check.js +3 -3
  130. package/build/components/post-sticky/check.js.map +1 -1
  131. package/build/components/post-sticky/index.js +1 -1
  132. package/build/components/post-sticky/index.js.map +1 -1
  133. package/build/components/post-switch-to-draft-button/index.js +1 -1
  134. package/build/components/post-switch-to-draft-button/index.js.map +1 -1
  135. package/build/components/post-sync-status/index.js +1 -1
  136. package/build/components/post-sync-status/index.js.map +1 -1
  137. package/build/components/post-taxonomies/check.js +3 -3
  138. package/build/components/post-taxonomies/check.js.map +1 -1
  139. package/build/components/post-taxonomies/flat-term-selector.js +1 -1
  140. package/build/components/post-taxonomies/flat-term-selector.js.map +1 -1
  141. package/build/components/post-taxonomies/panel.js +16 -13
  142. package/build/components/post-taxonomies/panel.js.map +1 -1
  143. package/build/components/post-template/classic-theme.js +2 -2
  144. package/build/components/post-template/classic-theme.js.map +1 -1
  145. package/build/components/post-template/panel.js +1 -1
  146. package/build/components/post-template/panel.js.map +1 -1
  147. package/build/components/post-text-editor/index.js +1 -1
  148. package/build/components/post-text-editor/index.js.map +1 -1
  149. package/build/components/post-title/index.js +20 -18
  150. package/build/components/post-title/index.js.map +1 -1
  151. package/build/components/post-title/post-title-raw.js +1 -1
  152. package/build/components/post-title/post-title-raw.js.map +1 -1
  153. package/build/components/post-trash/check.js +3 -3
  154. package/build/components/post-trash/check.js.map +1 -1
  155. package/build/components/post-trash/index.js +1 -1
  156. package/build/components/post-trash/index.js.map +1 -1
  157. package/build/components/post-type-support-check/index.js +6 -6
  158. package/build/components/post-type-support-check/index.js.map +1 -1
  159. package/build/components/post-url/check.js +3 -3
  160. package/build/components/post-url/check.js.map +1 -1
  161. package/build/components/post-url/index.js +1 -1
  162. package/build/components/post-url/index.js.map +1 -1
  163. package/build/components/post-url/label.js +1 -1
  164. package/build/components/post-url/label.js.map +1 -1
  165. package/build/components/post-url/panel.js +1 -1
  166. package/build/components/post-url/panel.js.map +1 -1
  167. package/build/components/post-visibility/check.js +1 -1
  168. package/build/components/post-visibility/check.js.map +1 -1
  169. package/build/components/post-visibility/index.js +1 -1
  170. package/build/components/post-visibility/index.js.map +1 -1
  171. package/build/components/preferences-modal/block-visibility.js +87 -0
  172. package/build/components/preferences-modal/block-visibility.js.map +1 -0
  173. package/build/components/preferences-modal/enable-panel.js +27 -19
  174. package/build/components/preferences-modal/enable-panel.js.map +1 -1
  175. package/build/components/preferences-modal/enable-publish-sidebar.js +13 -10
  176. package/build/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  177. package/build/components/preferences-modal/index.js +2 -2
  178. package/build/components/preferences-modal/index.js.map +1 -1
  179. package/build/components/provider/index.js +14 -8
  180. package/build/components/provider/index.js.map +1 -1
  181. package/build/components/table-of-contents/index.js +1 -1
  182. package/build/components/table-of-contents/index.js.map +1 -1
  183. package/build/components/theme-support-check/index.js +4 -4
  184. package/build/components/theme-support-check/index.js.map +1 -1
  185. package/build/components/time-to-read/index.js +1 -1
  186. package/build/components/time-to-read/index.js.map +1 -1
  187. package/build/components/unsaved-changes-warning/index.js +1 -1
  188. package/build/components/unsaved-changes-warning/index.js.map +1 -1
  189. package/build/components/word-count/index.js +1 -1
  190. package/build/components/word-count/index.js.map +1 -1
  191. package/build/components/zoom-out-toggle/index.js +8 -3
  192. package/build/components/zoom-out-toggle/index.js.map +1 -1
  193. package/build/dataviews/api.js +41 -0
  194. package/build/dataviews/api.js.map +1 -1
  195. package/build/dataviews/store/private-actions.js +26 -4
  196. package/build/dataviews/store/private-actions.js.map +1 -1
  197. package/build/dataviews/store/private-selectors.js +5 -0
  198. package/build/dataviews/store/private-selectors.js.map +1 -1
  199. package/build/dataviews/store/reducer.js +23 -0
  200. package/build/dataviews/store/reducer.js.map +1 -1
  201. package/build/private-apis.js +4 -0
  202. package/build/private-apis.js.map +1 -1
  203. package/build/store/actions.js +11 -9
  204. package/build/store/actions.js.map +1 -1
  205. package/build/store/private-selectors.js +5 -1
  206. package/build/store/private-selectors.js.map +1 -1
  207. package/build/store/reducer.native.js +1 -0
  208. package/build/store/reducer.native.js.map +1 -1
  209. package/build/store/selectors.js +34 -42
  210. package/build/store/selectors.js.map +1 -1
  211. package/build/utils/get-template-info.js +60 -0
  212. package/build/utils/get-template-info.js.map +1 -0
  213. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  214. package/build-module/components/block-settings-menu/plugin-block-settings-menu-item.js.map +1 -1
  215. package/build-module/components/collab-sidebar/add-comment.js +18 -67
  216. package/build-module/components/collab-sidebar/add-comment.js.map +1 -1
  217. package/build-module/components/collab-sidebar/comment-author-info.js +71 -0
  218. package/build-module/components/collab-sidebar/comment-author-info.js.map +1 -0
  219. package/build-module/components/collab-sidebar/comment-button-toolbar.js +2 -2
  220. package/build-module/components/collab-sidebar/comment-button-toolbar.js.map +1 -1
  221. package/build-module/components/collab-sidebar/comment-button.js +2 -2
  222. package/build-module/components/collab-sidebar/comment-button.js.map +1 -1
  223. package/build-module/components/collab-sidebar/comment-form.js +59 -0
  224. package/build-module/components/collab-sidebar/comment-form.js.map +1 -0
  225. package/build-module/components/collab-sidebar/comments.js +33 -91
  226. package/build-module/components/collab-sidebar/comments.js.map +1 -1
  227. package/build-module/components/create-template-part-modal/index.js +1 -2
  228. package/build-module/components/create-template-part-modal/index.js.map +1 -1
  229. package/build-module/components/document-bar/index.js +10 -3
  230. package/build-module/components/document-bar/index.js.map +1 -1
  231. package/build-module/components/document-outline/check.js +4 -4
  232. package/build-module/components/document-outline/check.js.map +1 -1
  233. package/build-module/components/document-outline/index.js +8 -8
  234. package/build-module/components/document-outline/index.js.map +1 -1
  235. package/build-module/components/document-tools/index.js +1 -1
  236. package/build-module/components/document-tools/index.js.map +1 -1
  237. package/build-module/components/editor-history/redo.js +1 -1
  238. package/build-module/components/editor-history/redo.js.map +1 -1
  239. package/build-module/components/editor-history/undo.js +1 -1
  240. package/build-module/components/editor-history/undo.js.map +1 -1
  241. package/build-module/components/editor-interface/content-slot-fill.js +2 -11
  242. package/build-module/components/editor-interface/content-slot-fill.js.map +1 -1
  243. package/build-module/components/editor-interface/index.js +4 -10
  244. package/build-module/components/editor-interface/index.js.map +1 -1
  245. package/build-module/components/editor-notices/index.js +1 -1
  246. package/build-module/components/editor-notices/index.js.map +1 -1
  247. package/build-module/components/editor-snackbars/index.js +1 -1
  248. package/build-module/components/editor-snackbars/index.js.map +1 -1
  249. package/build-module/components/entities-saved-states/entity-record-item.js +9 -1
  250. package/build-module/components/entities-saved-states/entity-record-item.js.map +1 -1
  251. package/build-module/components/entities-saved-states/index.js +2 -2
  252. package/build-module/components/entities-saved-states/index.js.map +1 -1
  253. package/build-module/components/page-attributes/check.js +3 -3
  254. package/build-module/components/page-attributes/check.js.map +1 -1
  255. package/build-module/components/page-attributes/order.js +1 -1
  256. package/build-module/components/page-attributes/order.js.map +1 -1
  257. package/build-module/components/page-attributes/panel.js +1 -1
  258. package/build-module/components/page-attributes/panel.js.map +1 -1
  259. package/build-module/components/page-attributes/parent.js +1 -1
  260. package/build-module/components/page-attributes/parent.js.map +1 -1
  261. package/build-module/components/plugin-document-setting-panel/index.js +2 -2
  262. package/build-module/components/plugin-document-setting-panel/index.js.map +1 -1
  263. package/build-module/components/plugin-more-menu-item/index.js +2 -1
  264. package/build-module/components/plugin-more-menu-item/index.js.map +1 -1
  265. package/build-module/components/plugin-post-publish-panel/index.js +2 -2
  266. package/build-module/components/plugin-post-publish-panel/index.js.map +1 -1
  267. package/build-module/components/plugin-post-status-info/index.js +4 -4
  268. package/build-module/components/plugin-post-status-info/index.js.map +1 -1
  269. package/build-module/components/plugin-pre-publish-panel/index.js +2 -2
  270. package/build-module/components/plugin-pre-publish-panel/index.js.map +1 -1
  271. package/build-module/components/plugin-preview-menu-item/index.js +2 -1
  272. package/build-module/components/plugin-preview-menu-item/index.js.map +1 -1
  273. package/build-module/components/plugin-sidebar/index.js +1 -0
  274. package/build-module/components/plugin-sidebar/index.js.map +1 -1
  275. package/build-module/components/plugin-sidebar-more-menu-item/index.js +2 -1
  276. package/build-module/components/plugin-sidebar-more-menu-item/index.js.map +1 -1
  277. package/build-module/components/post-actions/actions.js +3 -3
  278. package/build-module/components/post-actions/actions.js.map +1 -1
  279. package/build-module/components/post-author/check.js +3 -3
  280. package/build-module/components/post-author/check.js.map +1 -1
  281. package/build-module/components/post-author/index.js +1 -1
  282. package/build-module/components/post-author/index.js.map +1 -1
  283. package/build-module/components/post-author/panel.js +1 -1
  284. package/build-module/components/post-author/panel.js.map +1 -1
  285. package/build-module/components/post-card-panel/index.js +9 -4
  286. package/build-module/components/post-card-panel/index.js.map +1 -1
  287. package/build-module/components/post-comments/index.js +1 -1
  288. package/build-module/components/post-comments/index.js.map +1 -1
  289. package/build-module/components/post-discussion/panel.js +1 -1
  290. package/build-module/components/post-discussion/panel.js.map +1 -1
  291. package/build-module/components/post-excerpt/check.js +3 -3
  292. package/build-module/components/post-excerpt/check.js.map +1 -1
  293. package/build-module/components/post-excerpt/panel.js +1 -1
  294. package/build-module/components/post-excerpt/panel.js.map +1 -1
  295. package/build-module/components/post-excerpt/plugin.js +4 -4
  296. package/build-module/components/post-excerpt/plugin.js.map +1 -1
  297. package/build-module/components/post-featured-image/check.js +3 -3
  298. package/build-module/components/post-featured-image/check.js.map +1 -1
  299. package/build-module/components/post-featured-image/index.js +40 -10
  300. package/build-module/components/post-featured-image/index.js.map +1 -1
  301. package/build-module/components/post-featured-image/panel.js +1 -1
  302. package/build-module/components/post-featured-image/panel.js.map +1 -1
  303. package/build-module/components/post-fields/index.js +62 -0
  304. package/build-module/components/post-fields/index.js.map +1 -0
  305. package/build-module/components/post-format/check.js +10 -11
  306. package/build-module/components/post-format/check.js.map +1 -1
  307. package/build-module/components/post-format/index.js +1 -1
  308. package/build-module/components/post-format/index.js.map +1 -1
  309. package/build-module/components/post-format/panel.js +1 -1
  310. package/build-module/components/post-format/panel.js.map +1 -1
  311. package/build-module/components/post-last-revision/check.js +3 -3
  312. package/build-module/components/post-last-revision/check.js.map +1 -1
  313. package/build-module/components/post-last-revision/index.js +1 -1
  314. package/build-module/components/post-last-revision/index.js.map +1 -1
  315. package/build-module/components/post-last-revision/panel.js +1 -1
  316. package/build-module/components/post-last-revision/panel.js.map +1 -1
  317. package/build-module/components/post-locked-modal/index.js +1 -1
  318. package/build-module/components/post-locked-modal/index.js.map +1 -1
  319. package/build-module/components/post-pending-status/check.js +3 -3
  320. package/build-module/components/post-pending-status/check.js.map +1 -1
  321. package/build-module/components/post-pending-status/index.js +1 -1
  322. package/build-module/components/post-pending-status/index.js.map +1 -1
  323. package/build-module/components/post-preview-button/index.js +1 -1
  324. package/build-module/components/post-preview-button/index.js.map +1 -1
  325. package/build-module/components/post-publish-panel/index.js +5 -2
  326. package/build-module/components/post-publish-panel/index.js.map +1 -1
  327. package/build-module/components/post-schedule/check.js +3 -3
  328. package/build-module/components/post-schedule/check.js.map +1 -1
  329. package/build-module/components/post-schedule/index.js +1 -1
  330. package/build-module/components/post-schedule/index.js.map +1 -1
  331. package/build-module/components/post-schedule/label.js +1 -1
  332. package/build-module/components/post-schedule/label.js.map +1 -1
  333. package/build-module/components/post-schedule/panel.js +1 -1
  334. package/build-module/components/post-schedule/panel.js.map +1 -1
  335. package/build-module/components/post-slug/check.js +3 -3
  336. package/build-module/components/post-slug/check.js.map +1 -1
  337. package/build-module/components/post-slug/index.js +1 -1
  338. package/build-module/components/post-slug/index.js.map +1 -1
  339. package/build-module/components/post-sticky/check.js +3 -3
  340. package/build-module/components/post-sticky/check.js.map +1 -1
  341. package/build-module/components/post-sticky/index.js +1 -1
  342. package/build-module/components/post-sticky/index.js.map +1 -1
  343. package/build-module/components/post-switch-to-draft-button/index.js +1 -1
  344. package/build-module/components/post-switch-to-draft-button/index.js.map +1 -1
  345. package/build-module/components/post-sync-status/index.js +1 -1
  346. package/build-module/components/post-sync-status/index.js.map +1 -1
  347. package/build-module/components/post-taxonomies/check.js +3 -3
  348. package/build-module/components/post-taxonomies/check.js.map +1 -1
  349. package/build-module/components/post-taxonomies/flat-term-selector.js +1 -1
  350. package/build-module/components/post-taxonomies/flat-term-selector.js.map +1 -1
  351. package/build-module/components/post-taxonomies/panel.js +17 -12
  352. package/build-module/components/post-taxonomies/panel.js.map +1 -1
  353. package/build-module/components/post-template/classic-theme.js +2 -2
  354. package/build-module/components/post-template/classic-theme.js.map +1 -1
  355. package/build-module/components/post-template/panel.js +1 -1
  356. package/build-module/components/post-template/panel.js.map +1 -1
  357. package/build-module/components/post-text-editor/index.js +1 -1
  358. package/build-module/components/post-text-editor/index.js.map +1 -1
  359. package/build-module/components/post-title/index.js +20 -18
  360. package/build-module/components/post-title/index.js.map +1 -1
  361. package/build-module/components/post-title/post-title-raw.js +1 -1
  362. package/build-module/components/post-title/post-title-raw.js.map +1 -1
  363. package/build-module/components/post-trash/check.js +3 -3
  364. package/build-module/components/post-trash/check.js.map +1 -1
  365. package/build-module/components/post-trash/index.js +1 -1
  366. package/build-module/components/post-trash/index.js.map +1 -1
  367. package/build-module/components/post-type-support-check/index.js +6 -6
  368. package/build-module/components/post-type-support-check/index.js.map +1 -1
  369. package/build-module/components/post-url/check.js +3 -3
  370. package/build-module/components/post-url/check.js.map +1 -1
  371. package/build-module/components/post-url/index.js +1 -1
  372. package/build-module/components/post-url/index.js.map +1 -1
  373. package/build-module/components/post-url/label.js +1 -1
  374. package/build-module/components/post-url/label.js.map +1 -1
  375. package/build-module/components/post-url/panel.js +1 -1
  376. package/build-module/components/post-url/panel.js.map +1 -1
  377. package/build-module/components/post-visibility/check.js +1 -1
  378. package/build-module/components/post-visibility/check.js.map +1 -1
  379. package/build-module/components/post-visibility/index.js +1 -1
  380. package/build-module/components/post-visibility/index.js.map +1 -1
  381. package/build-module/components/preferences-modal/block-visibility.js +80 -0
  382. package/build-module/components/preferences-modal/block-visibility.js.map +1 -0
  383. package/build-module/components/preferences-modal/enable-panel.js +27 -19
  384. package/build-module/components/preferences-modal/enable-panel.js.map +1 -1
  385. package/build-module/components/preferences-modal/enable-publish-sidebar.js +13 -10
  386. package/build-module/components/preferences-modal/enable-publish-sidebar.js.map +1 -1
  387. package/build-module/components/preferences-modal/index.js +2 -2
  388. package/build-module/components/preferences-modal/index.js.map +1 -1
  389. package/build-module/components/provider/index.js +14 -8
  390. package/build-module/components/provider/index.js.map +1 -1
  391. package/build-module/components/table-of-contents/index.js +1 -1
  392. package/build-module/components/table-of-contents/index.js.map +1 -1
  393. package/build-module/components/theme-support-check/index.js +4 -4
  394. package/build-module/components/theme-support-check/index.js.map +1 -1
  395. package/build-module/components/time-to-read/index.js +1 -1
  396. package/build-module/components/time-to-read/index.js.map +1 -1
  397. package/build-module/components/unsaved-changes-warning/index.js +1 -1
  398. package/build-module/components/unsaved-changes-warning/index.js.map +1 -1
  399. package/build-module/components/word-count/index.js +1 -1
  400. package/build-module/components/word-count/index.js.map +1 -1
  401. package/build-module/components/zoom-out-toggle/index.js +8 -3
  402. package/build-module/components/zoom-out-toggle/index.js.map +1 -1
  403. package/build-module/dataviews/api.js +39 -0
  404. package/build-module/dataviews/api.js.map +1 -1
  405. package/build-module/dataviews/store/private-actions.js +23 -3
  406. package/build-module/dataviews/store/private-actions.js.map +1 -1
  407. package/build-module/dataviews/store/private-selectors.js +4 -0
  408. package/build-module/dataviews/store/private-selectors.js.map +1 -1
  409. package/build-module/dataviews/store/reducer.js +23 -0
  410. package/build-module/dataviews/store/reducer.js.map +1 -1
  411. package/build-module/private-apis.js +4 -0
  412. package/build-module/private-apis.js.map +1 -1
  413. package/build-module/store/actions.js +11 -9
  414. package/build-module/store/actions.js.map +1 -1
  415. package/build-module/store/private-selectors.js +6 -3
  416. package/build-module/store/private-selectors.js.map +1 -1
  417. package/build-module/store/reducer.native.js +2 -1
  418. package/build-module/store/reducer.native.js.map +1 -1
  419. package/build-module/store/selectors.js +33 -39
  420. package/build-module/store/selectors.js.map +1 -1
  421. package/build-module/utils/get-template-info.js +51 -0
  422. package/build-module/utils/get-template-info.js.map +1 -0
  423. package/build-style/style-rtl.css +11 -81
  424. package/build-style/style.css +11 -81
  425. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts +2 -2
  426. package/build-types/components/block-settings-menu/plugin-block-settings-menu-item.d.ts.map +1 -1
  427. package/build-types/components/collab-sidebar/add-comment.d.ts +2 -2
  428. package/build-types/components/collab-sidebar/add-comment.d.ts.map +1 -1
  429. package/build-types/components/collab-sidebar/comment-author-info.d.ts +17 -0
  430. package/build-types/components/collab-sidebar/comment-author-info.d.ts.map +1 -0
  431. package/build-types/components/collab-sidebar/comment-form.d.ts +18 -0
  432. package/build-types/components/collab-sidebar/comment-form.d.ts.map +1 -0
  433. package/build-types/components/collab-sidebar/comments.d.ts +2 -2
  434. package/build-types/components/collab-sidebar/comments.d.ts.map +1 -1
  435. package/build-types/components/create-template-part-modal/index.d.ts.map +1 -1
  436. package/build-types/components/document-bar/index.d.ts +2 -2
  437. package/build-types/components/document-bar/index.d.ts.map +1 -1
  438. package/build-types/components/document-outline/check.d.ts +5 -5
  439. package/build-types/components/document-outline/check.d.ts.map +1 -1
  440. package/build-types/components/document-outline/index.d.ts +4 -6
  441. package/build-types/components/document-outline/index.d.ts.map +1 -1
  442. package/build-types/components/document-tools/index.d.ts.map +1 -1
  443. package/build-types/components/editor-interface/content-slot-fill.d.ts +12 -1
  444. package/build-types/components/editor-interface/content-slot-fill.d.ts.map +1 -1
  445. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  446. package/build-types/components/editor-notices/index.d.ts +2 -2
  447. package/build-types/components/editor-notices/index.d.ts.map +1 -1
  448. package/build-types/components/editor-snackbars/index.d.ts +2 -2
  449. package/build-types/components/editor-snackbars/index.d.ts.map +1 -1
  450. package/build-types/components/entities-saved-states/entity-record-item.d.ts.map +1 -1
  451. package/build-types/components/entities-saved-states/index.d.ts +4 -4
  452. package/build-types/components/entities-saved-states/index.d.ts.map +1 -1
  453. package/build-types/components/header/back-button.d.ts.map +1 -1
  454. package/build-types/components/more-menu/tools-more-menu-group.d.ts.map +1 -1
  455. package/build-types/components/more-menu/view-more-menu-group.d.ts.map +1 -1
  456. package/build-types/components/page-attributes/check.d.ts +5 -5
  457. package/build-types/components/page-attributes/check.d.ts.map +1 -1
  458. package/build-types/components/page-attributes/order.d.ts +2 -2
  459. package/build-types/components/page-attributes/order.d.ts.map +1 -1
  460. package/build-types/components/page-attributes/panel.d.ts +2 -2
  461. package/build-types/components/page-attributes/panel.d.ts.map +1 -1
  462. package/build-types/components/page-attributes/parent.d.ts +2 -2
  463. package/build-types/components/page-attributes/parent.d.ts.map +1 -1
  464. package/build-types/components/plugin-document-setting-panel/index.d.ts +4 -4
  465. package/build-types/components/plugin-document-setting-panel/index.d.ts.map +1 -1
  466. package/build-types/components/plugin-more-menu-item/index.d.ts +4 -2
  467. package/build-types/components/plugin-more-menu-item/index.d.ts.map +1 -1
  468. package/build-types/components/plugin-post-publish-panel/index.d.ts +4 -4
  469. package/build-types/components/plugin-post-publish-panel/index.d.ts.map +1 -1
  470. package/build-types/components/plugin-post-status-info/index.d.ts +6 -6
  471. package/build-types/components/plugin-post-status-info/index.d.ts.map +1 -1
  472. package/build-types/components/plugin-pre-publish-panel/index.d.ts +4 -4
  473. package/build-types/components/plugin-pre-publish-panel/index.d.ts.map +1 -1
  474. package/build-types/components/plugin-preview-menu-item/index.d.ts +4 -2
  475. package/build-types/components/plugin-preview-menu-item/index.d.ts.map +1 -1
  476. package/build-types/components/plugin-sidebar/index.d.ts +2 -0
  477. package/build-types/components/plugin-sidebar/index.d.ts.map +1 -1
  478. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts +4 -2
  479. package/build-types/components/plugin-sidebar-more-menu-item/index.d.ts.map +1 -1
  480. package/build-types/components/post-author/check.d.ts +5 -5
  481. package/build-types/components/post-author/check.d.ts.map +1 -1
  482. package/build-types/components/post-author/index.d.ts +2 -2
  483. package/build-types/components/post-author/index.d.ts.map +1 -1
  484. package/build-types/components/post-author/panel.d.ts +2 -2
  485. package/build-types/components/post-author/panel.d.ts.map +1 -1
  486. package/build-types/components/post-card-panel/index.d.ts.map +1 -1
  487. package/build-types/components/post-discussion/panel.d.ts +2 -2
  488. package/build-types/components/post-discussion/panel.d.ts.map +1 -1
  489. package/build-types/components/post-excerpt/check.d.ts +5 -5
  490. package/build-types/components/post-excerpt/check.d.ts.map +1 -1
  491. package/build-types/components/post-excerpt/panel.d.ts +2 -2
  492. package/build-types/components/post-excerpt/panel.d.ts.map +1 -1
  493. package/build-types/components/post-excerpt/plugin.d.ts +6 -6
  494. package/build-types/components/post-excerpt/plugin.d.ts.map +1 -1
  495. package/build-types/components/post-featured-image/check.d.ts +5 -5
  496. package/build-types/components/post-featured-image/check.d.ts.map +1 -1
  497. package/build-types/components/post-featured-image/panel.d.ts +2 -2
  498. package/build-types/components/post-featured-image/panel.d.ts.map +1 -1
  499. package/build-types/components/post-fields/index.d.ts +12 -0
  500. package/build-types/components/post-fields/index.d.ts.map +1 -0
  501. package/build-types/components/post-format/check.d.ts +11 -4
  502. package/build-types/components/post-format/check.d.ts.map +1 -1
  503. package/build-types/components/post-format/index.d.ts +2 -2
  504. package/build-types/components/post-format/index.d.ts.map +1 -1
  505. package/build-types/components/post-format/panel.d.ts +2 -2
  506. package/build-types/components/post-format/panel.d.ts.map +1 -1
  507. package/build-types/components/post-last-revision/check.d.ts +5 -5
  508. package/build-types/components/post-last-revision/check.d.ts.map +1 -1
  509. package/build-types/components/post-last-revision/index.d.ts +2 -2
  510. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  511. package/build-types/components/post-last-revision/panel.d.ts +2 -2
  512. package/build-types/components/post-last-revision/panel.d.ts.map +1 -1
  513. package/build-types/components/post-locked-modal/index.d.ts +2 -2
  514. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  515. package/build-types/components/post-pending-status/check.d.ts +5 -5
  516. package/build-types/components/post-pending-status/check.d.ts.map +1 -1
  517. package/build-types/components/post-pending-status/index.d.ts +2 -2
  518. package/build-types/components/post-pending-status/index.d.ts.map +1 -1
  519. package/build-types/components/post-preview-button/index.d.ts +2 -2
  520. package/build-types/components/post-preview-button/index.d.ts.map +1 -1
  521. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  522. package/build-types/components/post-schedule/check.d.ts +5 -5
  523. package/build-types/components/post-schedule/check.d.ts.map +1 -1
  524. package/build-types/components/post-schedule/index.d.ts +2 -2
  525. package/build-types/components/post-schedule/index.d.ts.map +1 -1
  526. package/build-types/components/post-schedule/label.d.ts +2 -2
  527. package/build-types/components/post-schedule/label.d.ts.map +1 -1
  528. package/build-types/components/post-schedule/panel.d.ts +2 -2
  529. package/build-types/components/post-schedule/panel.d.ts.map +1 -1
  530. package/build-types/components/post-slug/check.d.ts +5 -5
  531. package/build-types/components/post-slug/check.d.ts.map +1 -1
  532. package/build-types/components/post-slug/index.d.ts +2 -2
  533. package/build-types/components/post-slug/index.d.ts.map +1 -1
  534. package/build-types/components/post-sticky/check.d.ts +5 -5
  535. package/build-types/components/post-sticky/check.d.ts.map +1 -1
  536. package/build-types/components/post-sticky/index.d.ts +2 -2
  537. package/build-types/components/post-sticky/index.d.ts.map +1 -1
  538. package/build-types/components/post-switch-to-draft-button/index.d.ts +2 -2
  539. package/build-types/components/post-switch-to-draft-button/index.d.ts.map +1 -1
  540. package/build-types/components/post-sync-status/index.d.ts +2 -2
  541. package/build-types/components/post-sync-status/index.d.ts.map +1 -1
  542. package/build-types/components/post-taxonomies/check.d.ts +5 -5
  543. package/build-types/components/post-taxonomies/check.d.ts.map +1 -1
  544. package/build-types/components/post-taxonomies/flat-term-selector.d.ts +2 -2
  545. package/build-types/components/post-taxonomies/flat-term-selector.d.ts.map +1 -1
  546. package/build-types/components/post-taxonomies/panel.d.ts +6 -2
  547. package/build-types/components/post-taxonomies/panel.d.ts.map +1 -1
  548. package/build-types/components/post-template/panel.d.ts +2 -2
  549. package/build-types/components/post-template/panel.d.ts.map +1 -1
  550. package/build-types/components/post-text-editor/index.d.ts +2 -2
  551. package/build-types/components/post-text-editor/index.d.ts.map +1 -1
  552. package/build-types/components/post-title/index.d.ts +1 -1
  553. package/build-types/components/post-trash/check.d.ts +5 -5
  554. package/build-types/components/post-trash/check.d.ts.map +1 -1
  555. package/build-types/components/post-trash/index.d.ts +2 -2
  556. package/build-types/components/post-trash/index.d.ts.map +1 -1
  557. package/build-types/components/post-type-support-check/index.d.ts +8 -8
  558. package/build-types/components/post-type-support-check/index.d.ts.map +1 -1
  559. package/build-types/components/post-url/check.d.ts +5 -5
  560. package/build-types/components/post-url/check.d.ts.map +1 -1
  561. package/build-types/components/post-url/index.d.ts +2 -2
  562. package/build-types/components/post-url/index.d.ts.map +1 -1
  563. package/build-types/components/post-url/label.d.ts +2 -2
  564. package/build-types/components/post-url/label.d.ts.map +1 -1
  565. package/build-types/components/post-url/panel.d.ts +2 -2
  566. package/build-types/components/post-url/panel.d.ts.map +1 -1
  567. package/build-types/components/post-visibility/check.d.ts +2 -2
  568. package/build-types/components/post-visibility/check.d.ts.map +1 -1
  569. package/build-types/components/post-visibility/index.d.ts +2 -2
  570. package/build-types/components/post-visibility/index.d.ts.map +1 -1
  571. package/build-types/components/preferences-modal/block-visibility.d.ts +2 -0
  572. package/build-types/components/preferences-modal/block-visibility.d.ts.map +1 -0
  573. package/build-types/components/preferences-modal/enable-panel.d.ts +1 -2
  574. package/build-types/components/preferences-modal/enable-panel.d.ts.map +1 -1
  575. package/build-types/components/preferences-modal/enable-plugin-document-setting-panel.d.ts.map +1 -1
  576. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts +1 -2
  577. package/build-types/components/preferences-modal/enable-publish-sidebar.d.ts.map +1 -1
  578. package/build-types/components/provider/index.d.ts +2 -2
  579. package/build-types/components/provider/index.d.ts.map +1 -1
  580. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  581. package/build-types/components/theme-support-check/index.d.ts +6 -6
  582. package/build-types/components/theme-support-check/index.d.ts.map +1 -1
  583. package/build-types/components/time-to-read/index.d.ts +2 -2
  584. package/build-types/components/time-to-read/index.d.ts.map +1 -1
  585. package/build-types/components/unsaved-changes-warning/index.d.ts +2 -2
  586. package/build-types/components/unsaved-changes-warning/index.d.ts.map +1 -1
  587. package/build-types/components/word-count/index.d.ts +2 -2
  588. package/build-types/components/word-count/index.d.ts.map +1 -1
  589. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -1
  590. package/build-types/dataviews/api.d.ts +24 -0
  591. package/build-types/dataviews/api.d.ts.map +1 -1
  592. package/build-types/dataviews/store/private-actions.d.ts +14 -2
  593. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  594. package/build-types/dataviews/store/private-selectors.d.ts +1 -0
  595. package/build-types/dataviews/store/private-selectors.d.ts.map +1 -1
  596. package/build-types/dataviews/store/reducer.d.ts +10 -2
  597. package/build-types/dataviews/store/reducer.d.ts.map +1 -1
  598. package/build-types/private-apis.d.ts.map +1 -1
  599. package/build-types/store/actions.d.ts +7 -5
  600. package/build-types/store/actions.d.ts.map +1 -1
  601. package/build-types/store/private-selectors.d.ts +1 -0
  602. package/build-types/store/private-selectors.d.ts.map +1 -1
  603. package/build-types/store/reducer.d.ts +5 -0
  604. package/build-types/store/reducer.d.ts.map +1 -1
  605. package/build-types/store/selectors.d.ts +4 -11
  606. package/build-types/store/selectors.d.ts.map +1 -1
  607. package/build-types/utils/get-template-info.d.ts +6 -0
  608. package/build-types/utils/get-template-info.d.ts.map +1 -0
  609. package/package.json +2 -2
  610. package/src/components/block-settings-menu/plugin-block-settings-menu-item.js +1 -1
  611. package/src/components/collab-sidebar/add-comment.js +21 -78
  612. package/src/components/collab-sidebar/comment-author-info.js +68 -0
  613. package/src/components/collab-sidebar/comment-button-toolbar.js +3 -3
  614. package/src/components/collab-sidebar/comment-button.js +3 -3
  615. package/src/components/collab-sidebar/comment-form.js +62 -0
  616. package/src/components/collab-sidebar/comments.js +39 -101
  617. package/src/components/create-template-part-modal/index.js +3 -2
  618. package/src/components/document-bar/index.js +12 -3
  619. package/src/components/document-outline/check.js +4 -4
  620. package/src/components/document-outline/index.js +9 -9
  621. package/src/components/document-tools/index.js +3 -2
  622. package/src/components/editor-history/redo.js +1 -1
  623. package/src/components/editor-history/undo.js +1 -1
  624. package/src/components/editor-interface/content-slot-fill.js +4 -9
  625. package/src/components/editor-interface/index.js +1 -11
  626. package/src/components/editor-notices/index.js +1 -1
  627. package/src/components/editor-snackbars/index.js +1 -1
  628. package/src/components/entities-saved-states/entity-record-item.js +12 -4
  629. package/src/components/entities-saved-states/index.js +2 -2
  630. package/src/components/header/style.scss +2 -1
  631. package/src/components/page-attributes/check.js +3 -3
  632. package/src/components/page-attributes/order.js +1 -1
  633. package/src/components/page-attributes/panel.js +1 -1
  634. package/src/components/page-attributes/parent.js +1 -1
  635. package/src/components/plugin-document-setting-panel/index.js +2 -2
  636. package/src/components/plugin-more-menu-item/index.js +2 -1
  637. package/src/components/plugin-post-publish-panel/index.js +2 -2
  638. package/src/components/plugin-post-status-info/index.js +4 -4
  639. package/src/components/plugin-pre-publish-panel/index.js +2 -2
  640. package/src/components/plugin-preview-menu-item/index.js +2 -1
  641. package/src/components/plugin-sidebar/index.js +1 -0
  642. package/src/components/plugin-sidebar-more-menu-item/index.js +2 -2
  643. package/src/components/post-actions/actions.js +3 -3
  644. package/src/components/post-author/check.js +3 -3
  645. package/src/components/post-author/index.js +1 -1
  646. package/src/components/post-author/panel.js +1 -1
  647. package/src/components/post-card-panel/index.js +18 -5
  648. package/src/components/post-comments/index.js +1 -1
  649. package/src/components/post-discussion/panel.js +1 -1
  650. package/src/components/post-excerpt/check.js +3 -3
  651. package/src/components/post-excerpt/panel.js +1 -1
  652. package/src/components/post-excerpt/plugin.js +4 -4
  653. package/src/components/post-featured-image/check.js +3 -3
  654. package/src/components/post-featured-image/index.js +107 -43
  655. package/src/components/post-featured-image/panel.js +1 -1
  656. package/src/components/post-featured-image/style.scss +23 -13
  657. package/src/components/post-fields/index.ts +76 -0
  658. package/src/components/post-format/check.js +9 -11
  659. package/src/components/post-format/index.js +1 -1
  660. package/src/components/post-format/panel.js +1 -1
  661. package/src/components/post-last-revision/check.js +3 -3
  662. package/src/components/post-last-revision/index.js +1 -1
  663. package/src/components/post-last-revision/panel.js +1 -1
  664. package/src/components/post-locked-modal/index.js +1 -1
  665. package/src/components/post-pending-status/check.js +3 -3
  666. package/src/components/post-pending-status/index.js +1 -1
  667. package/src/components/post-preview-button/index.js +1 -1
  668. package/src/components/post-publish-panel/index.js +7 -3
  669. package/src/components/post-schedule/check.js +3 -3
  670. package/src/components/post-schedule/index.js +1 -1
  671. package/src/components/post-schedule/label.js +1 -1
  672. package/src/components/post-schedule/panel.js +1 -1
  673. package/src/components/post-slug/check.js +3 -3
  674. package/src/components/post-slug/index.js +1 -1
  675. package/src/components/post-sticky/check.js +3 -3
  676. package/src/components/post-sticky/index.js +1 -1
  677. package/src/components/post-switch-to-draft-button/index.js +1 -1
  678. package/src/components/post-sync-status/index.js +1 -1
  679. package/src/components/post-taxonomies/check.js +3 -3
  680. package/src/components/post-taxonomies/flat-term-selector.js +1 -1
  681. package/src/components/post-taxonomies/panel.js +15 -12
  682. package/src/components/post-template/classic-theme.js +2 -2
  683. package/src/components/post-template/panel.js +1 -1
  684. package/src/components/post-text-editor/index.js +1 -1
  685. package/src/components/post-title/index.js +20 -18
  686. package/src/components/post-title/post-title-raw.js +1 -1
  687. package/src/components/post-trash/check.js +3 -3
  688. package/src/components/post-trash/index.js +1 -1
  689. package/src/components/post-type-support-check/index.js +6 -6
  690. package/src/components/post-url/check.js +3 -3
  691. package/src/components/post-url/index.js +1 -1
  692. package/src/components/post-url/label.js +1 -1
  693. package/src/components/post-url/panel.js +1 -1
  694. package/src/components/post-visibility/check.js +1 -1
  695. package/src/components/post-visibility/index.js +1 -1
  696. package/src/components/preferences-modal/block-visibility.js +96 -0
  697. package/src/components/preferences-modal/enable-panel.js +27 -17
  698. package/src/components/preferences-modal/enable-publish-sidebar.js +18 -15
  699. package/src/components/preferences-modal/index.js +2 -2
  700. package/src/components/provider/index.js +55 -30
  701. package/src/components/table-of-contents/index.js +1 -1
  702. package/src/components/theme-support-check/index.js +4 -4
  703. package/src/components/time-to-read/index.js +1 -1
  704. package/src/components/unsaved-changes-warning/index.js +1 -1
  705. package/src/components/word-count/index.js +1 -1
  706. package/src/components/zoom-out-toggle/index.js +26 -13
  707. package/src/dataviews/api.js +41 -0
  708. package/src/dataviews/store/private-actions.ts +57 -3
  709. package/src/dataviews/store/private-selectors.ts +4 -0
  710. package/src/dataviews/store/reducer.ts +38 -1
  711. package/src/private-apis.js +4 -1
  712. package/src/store/actions.js +13 -9
  713. package/src/store/private-selectors.js +13 -8
  714. package/src/store/reducer.native.js +2 -0
  715. package/src/store/selectors.js +80 -62
  716. package/src/store/test/selectors.js +0 -255
  717. package/src/style.scss +0 -1
  718. package/src/utils/get-template-info.js +52 -0
  719. package/src/utils/test/get-template-info.js +224 -0
  720. package/tsconfig.tsbuildinfo +1 -1
  721. package/build/components/block-manager/category.js +0 -107
  722. package/build/components/block-manager/category.js.map +0 -1
  723. package/build/components/block-manager/checklist.js +0 -35
  724. package/build/components/block-manager/checklist.js.map +0 -1
  725. package/build/components/block-manager/index.js +0 -115
  726. package/build/components/block-manager/index.js.map +0 -1
  727. package/build-module/components/block-manager/category.js +0 -99
  728. package/build-module/components/block-manager/category.js.map +0 -1
  729. package/build-module/components/block-manager/checklist.js +0 -28
  730. package/build-module/components/block-manager/checklist.js.map +0 -1
  731. package/build-module/components/block-manager/index.js +0 -107
  732. package/build-module/components/block-manager/index.js.map +0 -1
  733. package/build-types/components/block-manager/category.d.ts +0 -6
  734. package/build-types/components/block-manager/category.d.ts.map +0 -1
  735. package/build-types/components/block-manager/checklist.d.ts +0 -7
  736. package/build-types/components/block-manager/checklist.d.ts.map +0 -1
  737. package/build-types/components/block-manager/index.d.ts +0 -2
  738. package/build-types/components/block-manager/index.d.ts.map +0 -1
  739. package/src/components/block-manager/category.js +0 -96
  740. package/src/components/block-manager/checklist.js +0 -30
  741. package/src/components/block-manager/index.js +0 -145
  742. package/src/components/block-manager/style.scss +0 -82
@@ -63,7 +63,7 @@ const NON_CONTEXTUAL_POST_TYPES = ['wp_block', 'wp_navigation', 'wp_template_par
63
63
  * @return {Array} Block editor props.
64
64
  */
65
65
  function useBlockEditorProps(post, template, mode) {
66
- const rootLevelPost = mode === 'post-only' || !template ? 'post' : 'template';
66
+ const rootLevelPost = mode === 'template-locked' ? 'template' : 'post';
67
67
  const [postBlocks, onInput, onChange] = useEntityBlockEditor('postType', post.type, {
68
68
  id: post.id
69
69
  });
@@ -144,8 +144,11 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
144
144
  selection,
145
145
  isReady,
146
146
  mode,
147
- postTypeEntities
147
+ defaultMode,
148
+ postTypeEntities,
149
+ hasLoadedPostObject
148
150
  } = useSelect(select => {
151
+ var _postTypeObject$defau;
149
152
  const {
150
153
  getEditorSettings,
151
154
  getEditorSelection,
@@ -155,10 +158,14 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
155
158
  const {
156
159
  getEntitiesConfig
157
160
  } = select(coreStore);
161
+ const postTypeObject = select(coreStore).getPostType(post.type);
162
+ const _hasLoadedPostObject = select(coreStore).hasFinishedResolution('getPostType', [post.type]);
158
163
  return {
164
+ hasLoadedPostObject: _hasLoadedPostObject,
159
165
  editorSettings: getEditorSettings(),
160
166
  isReady: __unstableIsEditorReady(),
161
167
  mode: getRenderingMode(),
168
+ defaultMode: (_postTypeObject$defau = postTypeObject?.default_rendering_mode) !== null && _postTypeObject$defau !== void 0 ? _postTypeObject$defau : 'post-only',
162
169
  selection: getEditorSelection(),
163
170
  postTypeEntities: post.type === 'wp_template' ? getEntitiesConfig('postType') : null
164
171
  };
@@ -225,7 +232,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
225
232
  }]
226
233
  });
227
234
  }
228
- }, []);
235
+ }, [createWarningNotice, initialEdits, settings, post, recovery, setupEditor, updatePostLock]);
229
236
 
230
237
  // Synchronizes the active post with the state
231
238
  useEffect(() => {
@@ -244,14 +251,13 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
244
251
 
245
252
  // Sets the right rendering mode when loading the editor.
246
253
  useEffect(() => {
247
- var _settings$defaultRend;
248
- setRenderingMode((_settings$defaultRend = settings.defaultRenderingMode) !== null && _settings$defaultRend !== void 0 ? _settings$defaultRend : 'post-only');
249
- }, [settings.defaultRenderingMode, setRenderingMode]);
254
+ setRenderingMode(defaultMode);
255
+ }, [defaultMode, setRenderingMode]);
250
256
  useHideBlocksFromInserter(post.type, mode);
251
257
 
252
258
  // Register the editor commands.
253
259
  useCommands();
254
- if (!isReady) {
260
+ if (!isReady || !mode || !hasLoadedPostObject) {
255
261
  return null;
256
262
  }
257
263
  return /*#__PURE__*/_jsx(EntityProvider, {
@@ -307,7 +313,7 @@ export const ExperimentalEditorProvider = withRegistryProvider(({
307
313
  * </EditorProvider>
308
314
  * ```
309
315
  *
310
- * @return {JSX.Element} The rendered EditorProvider component.
316
+ * @return {React.ReactNode} The rendered EditorProvider component.
311
317
  */
312
318
  export function EditorProvider(props) {
313
319
  return /*#__PURE__*/_jsx(ExperimentalEditorProvider, {
@@ -1 +1 @@
1
- {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","TemplatePartMenuItems","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","editorSettings","selection","isReady","postTypeEntities","select","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getEntitiesConfig","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","includes","postId","templateSlug","undefined","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","_settings$defaultRend","defaultRenderingMode","kind","value","useSubRegistry","isPreviewMode","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost =\n\t\tmode === 'post-only' || ! template ? 'post' : 'template';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst { editorSettings, selection, isReady, mode, postTypeEntities } =\n\t\t\tuseSelect(\n\t\t\t\t( select ) => {\n\t\t\t\t\tconst {\n\t\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t\t} = select( editorStore );\n\t\t\t\t\tconst { getEntitiesConfig } = select( coreStore );\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t\t: null,\n\t\t\t\t\t};\n\t\t\t\t},\n\t\t\t\t[ post.type ]\n\t\t\t);\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\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\t}, [] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( settings.defaultRenderingMode ?? 'post-only' );\n\t\t}, [ settings.defaultRenderingMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {JSX.Element} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,cAAc,EACdC,oBAAoB,EACpBC,KAAK,I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,4BAA4B,EAAGzD,mBAAqB;IAAAwD,QAAA,EAElDkD,KAAK,CAAClD;EAAQ,CACW,CAAC;AAE/B;AAEA,eAAeiD,cAAc","ignoreList":[]}
1
+ {"version":3,"names":["useEffect","useLayoutEffect","useMemo","useDispatch","useSelect","__","EntityProvider","useEntityBlockEditor","store","coreStore","BlockEditorProvider","BlockContextProvider","privateApis","blockEditorPrivateApis","noticesStore","editPatternsPrivateApis","createBlock","withRegistryProvider","editorStore","useBlockEditorSettings","unlock","DisableNonPageContentBlocks","NavigationBlockEditingMode","useHideBlocksFromInserter","useCommands","BlockRemovalWarnings","StartPageOptions","KeyboardShortcutHelpModal","ContentOnlySettingsMenu","StartTemplateOptions","EditorKeyboardShortcuts","PatternRenameModal","PatternDuplicateModal","TemplatePartMenuItems","jsx","_jsx","Fragment","_Fragment","jsxs","_jsxs","ExperimentalBlockEditorProvider","PatternsMenuItems","noop","NON_CONTEXTUAL_POST_TYPES","useBlockEditorProps","post","template","mode","rootLevelPost","postBlocks","onInput","onChange","type","id","templateBlocks","onInputTemplate","onChangeTemplate","maybeNavigationBlocks","ref","templateLock","blocks","disableRootLevelChanges","ExperimentalEditorProvider","settings","recovery","initialEdits","children","BlockEditorProviderComponent","__unstableTemplate","editorSettings","selection","isReady","defaultMode","postTypeEntities","hasLoadedPostObject","select","_postTypeObject$defau","getEditorSettings","getEditorSelection","getRenderingMode","__unstableIsEditorReady","getEntitiesConfig","postTypeObject","getPostType","_hasLoadedPostObject","hasFinishedResolution","default_rendering_mode","shouldRenderTemplate","defaultBlockContext","postContext","slug","postType","split","postTypeNames","map","entity","name","match","join","includes","postId","templateSlug","undefined","blockEditorSettings","updatePostLock","setupEditor","updateEditorSettings","setCurrentTemplateId","setEditedPost","setRenderingMode","createWarningNotice","postLock","autosave","actions","label","url","editLink","kind","value","useSubRegistry","isPreviewMode","EditorProvider","props"],"sources":["@wordpress/editor/src/components/provider/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useEffect, useLayoutEffect, useMemo } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tEntityProvider,\n\tuseEntityBlockEditor,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport {\n\tBlockEditorProvider,\n\tBlockContextProvider,\n\tprivateApis as blockEditorPrivateApis,\n} from '@wordpress/block-editor';\nimport { store as noticesStore } from '@wordpress/notices';\nimport { privateApis as editPatternsPrivateApis } from '@wordpress/patterns';\nimport { createBlock } from '@wordpress/blocks';\n\n/**\n * Internal dependencies\n */\nimport withRegistryProvider from './with-registry-provider';\nimport { store as editorStore } from '../../store';\nimport useBlockEditorSettings from './use-block-editor-settings';\nimport { unlock } from '../../lock-unlock';\nimport DisableNonPageContentBlocks from './disable-non-page-content-blocks';\nimport NavigationBlockEditingMode from './navigation-block-editing-mode';\nimport { useHideBlocksFromInserter } from './use-hide-blocks-from-inserter';\nimport useCommands from '../commands';\nimport BlockRemovalWarnings from '../block-removal-warnings';\nimport StartPageOptions from '../start-page-options';\nimport KeyboardShortcutHelpModal from '../keyboard-shortcut-help-modal';\nimport ContentOnlySettingsMenu from '../block-settings-menu/content-only-settings-menu';\nimport StartTemplateOptions from '../start-template-options';\nimport EditorKeyboardShortcuts from '../global-keyboard-shortcuts';\nimport PatternRenameModal from '../pattern-rename-modal';\nimport PatternDuplicateModal from '../pattern-duplicate-modal';\nimport TemplatePartMenuItems from '../template-part-menu-items';\n\nconst { ExperimentalBlockEditorProvider } = unlock( blockEditorPrivateApis );\nconst { PatternsMenuItems } = unlock( editPatternsPrivateApis );\n\nconst noop = () => {};\n\n/**\n * These are global entities that are only there to split blocks into logical units\n * They don't provide a \"context\" for the current post/page being rendered.\n * So we should not use their ids as post context. This is important to allow post blocks\n * (post content, post title) to be used within them without issues.\n */\nconst NON_CONTEXTUAL_POST_TYPES = [\n\t'wp_block',\n\t'wp_navigation',\n\t'wp_template_part',\n];\n\n/**\n * Depending on the post, template and template mode,\n * returns the appropriate blocks and change handlers for the block editor provider.\n *\n * @param {Array} post Block list.\n * @param {boolean} template Whether the page content has focus (and the surrounding template is inert). If `true` return page content blocks. Default `false`.\n * @param {string} mode Rendering mode.\n *\n * @example\n * ```jsx\n * const [ blocks, onInput, onChange ] = useBlockEditorProps( post, template, mode );\n * ```\n *\n * @return {Array} Block editor props.\n */\nfunction useBlockEditorProps( post, template, mode ) {\n\tconst rootLevelPost = mode === 'template-locked' ? 'template' : 'post';\n\tconst [ postBlocks, onInput, onChange ] = useEntityBlockEditor(\n\t\t'postType',\n\t\tpost.type,\n\t\t{ id: post.id }\n\t);\n\tconst [ templateBlocks, onInputTemplate, onChangeTemplate ] =\n\t\tuseEntityBlockEditor( 'postType', template?.type, {\n\t\t\tid: template?.id,\n\t\t} );\n\tconst maybeNavigationBlocks = useMemo( () => {\n\t\tif ( post.type === 'wp_navigation' ) {\n\t\t\treturn [\n\t\t\t\tcreateBlock( 'core/navigation', {\n\t\t\t\t\tref: post.id,\n\t\t\t\t\t// As the parent editor is locked with `templateLock`, the template locking\n\t\t\t\t\t// must be explicitly \"unset\" on the block itself to allow the user to modify\n\t\t\t\t\t// the block's content.\n\t\t\t\t\ttemplateLock: false,\n\t\t\t\t} ),\n\t\t\t];\n\t\t}\n\t}, [ post.type, post.id ] );\n\n\t// It is important that we don't create a new instance of blocks on every change\n\t// We should only create a new instance if the blocks them selves change, not a dependency of them.\n\tconst blocks = useMemo( () => {\n\t\tif ( maybeNavigationBlocks ) {\n\t\t\treturn maybeNavigationBlocks;\n\t\t}\n\n\t\tif ( rootLevelPost === 'template' ) {\n\t\t\treturn templateBlocks;\n\t\t}\n\n\t\treturn postBlocks;\n\t}, [ maybeNavigationBlocks, rootLevelPost, templateBlocks, postBlocks ] );\n\n\t// Handle fallback to postBlocks outside of the above useMemo, to ensure\n\t// that constructed block templates that call `createBlock` are not generated\n\t// too frequently. This ensures that clientIds are stable.\n\tconst disableRootLevelChanges =\n\t\t( !! template && mode === 'template-locked' ) ||\n\t\tpost.type === 'wp_navigation';\n\tif ( disableRootLevelChanges ) {\n\t\treturn [ blocks, noop, noop ];\n\t}\n\n\treturn [\n\t\tblocks,\n\t\trootLevelPost === 'post' ? onInput : onInputTemplate,\n\t\trootLevelPost === 'post' ? onChange : onChangeTemplate,\n\t];\n}\n\n/**\n * This component provides the editor context and manages the state of the block editor.\n *\n * @param {Object} props The component props.\n * @param {Object} props.post The post object.\n * @param {Object} props.settings The editor settings.\n * @param {boolean} props.recovery Indicates if the editor is in recovery mode.\n * @param {Array} props.initialEdits The initial edits for the editor.\n * @param {Object} props.children The child components.\n * @param {Object} [props.BlockEditorProviderComponent] The block editor provider component to use. Defaults to ExperimentalBlockEditorProvider.\n * @param {Object} [props.__unstableTemplate] The template object.\n *\n * @example\n * ```jsx\n * <ExperimentalEditorProvider\n * post={ post }\n * settings={ settings }\n * recovery={ recovery }\n * initialEdits={ initialEdits }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </ExperimentalEditorProvider>\n *\n * @return {Object} The rendered ExperimentalEditorProvider component.\n */\nexport const ExperimentalEditorProvider = withRegistryProvider(\n\t( {\n\t\tpost,\n\t\tsettings,\n\t\trecovery,\n\t\tinitialEdits,\n\t\tchildren,\n\t\tBlockEditorProviderComponent = ExperimentalBlockEditorProvider,\n\t\t__unstableTemplate: template,\n\t} ) => {\n\t\tconst {\n\t\t\teditorSettings,\n\t\t\tselection,\n\t\t\tisReady,\n\t\t\tmode,\n\t\t\tdefaultMode,\n\t\t\tpostTypeEntities,\n\t\t\thasLoadedPostObject,\n\t\t} = useSelect(\n\t\t\t( select ) => {\n\t\t\t\tconst {\n\t\t\t\t\tgetEditorSettings,\n\t\t\t\t\tgetEditorSelection,\n\t\t\t\t\tgetRenderingMode,\n\t\t\t\t\t__unstableIsEditorReady,\n\t\t\t\t} = select( editorStore );\n\t\t\t\tconst { getEntitiesConfig } = select( coreStore );\n\n\t\t\t\tconst postTypeObject = select( coreStore ).getPostType(\n\t\t\t\t\tpost.type\n\t\t\t\t);\n\n\t\t\t\tconst _hasLoadedPostObject = select(\n\t\t\t\t\tcoreStore\n\t\t\t\t).hasFinishedResolution( 'getPostType', [ post.type ] );\n\n\t\t\t\treturn {\n\t\t\t\t\thasLoadedPostObject: _hasLoadedPostObject,\n\t\t\t\t\teditorSettings: getEditorSettings(),\n\t\t\t\t\tisReady: __unstableIsEditorReady(),\n\t\t\t\t\tmode: getRenderingMode(),\n\t\t\t\t\tdefaultMode:\n\t\t\t\t\t\tpostTypeObject?.default_rendering_mode ?? 'post-only',\n\t\t\t\t\tselection: getEditorSelection(),\n\t\t\t\t\tpostTypeEntities:\n\t\t\t\t\t\tpost.type === 'wp_template'\n\t\t\t\t\t\t\t? getEntitiesConfig( 'postType' )\n\t\t\t\t\t\t\t: null,\n\t\t\t\t};\n\t\t\t},\n\t\t\t[ post.type ]\n\t\t);\n\t\tconst shouldRenderTemplate = !! template && mode !== 'post-only';\n\t\tconst rootLevelPost = shouldRenderTemplate ? template : post;\n\t\tconst defaultBlockContext = useMemo( () => {\n\t\t\tconst postContext = {};\n\t\t\t// If it is a template, try to inherit the post type from the name.\n\t\t\tif ( post.type === 'wp_template' ) {\n\t\t\t\tif ( post.slug === 'page' ) {\n\t\t\t\t\tpostContext.postType = 'page';\n\t\t\t\t} else if ( post.slug === 'single' ) {\n\t\t\t\t\tpostContext.postType = 'post';\n\t\t\t\t} else if ( post.slug.split( '-' )[ 0 ] === 'single' ) {\n\t\t\t\t\t// If the slug is single-{postType}, infer the post type from the name.\n\t\t\t\t\tconst postTypeNames =\n\t\t\t\t\t\tpostTypeEntities?.map( ( entity ) => entity.name ) ||\n\t\t\t\t\t\t[];\n\t\t\t\t\tconst match = post.slug.match(\n\t\t\t\t\t\t`^single-(${ postTypeNames.join( '|' ) })(?:-.+)?$`\n\t\t\t\t\t);\n\t\t\t\t\tif ( match ) {\n\t\t\t\t\t\tpostContext.postType = match[ 1 ];\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t} else if (\n\t\t\t\t! NON_CONTEXTUAL_POST_TYPES.includes( rootLevelPost.type ) ||\n\t\t\t\tshouldRenderTemplate\n\t\t\t) {\n\t\t\t\tpostContext.postId = post.id;\n\t\t\t\tpostContext.postType = post.type;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\t...postContext,\n\t\t\t\ttemplateSlug:\n\t\t\t\t\trootLevelPost.type === 'wp_template'\n\t\t\t\t\t\t? rootLevelPost.slug\n\t\t\t\t\t\t: undefined,\n\t\t\t};\n\t\t}, [\n\t\t\tshouldRenderTemplate,\n\t\t\tpost.id,\n\t\t\tpost.type,\n\t\t\tpost.slug,\n\t\t\trootLevelPost.type,\n\t\t\trootLevelPost.slug,\n\t\t\tpostTypeEntities,\n\t\t] );\n\t\tconst { id, type } = rootLevelPost;\n\t\tconst blockEditorSettings = useBlockEditorSettings(\n\t\t\teditorSettings,\n\t\t\ttype,\n\t\t\tid,\n\t\t\tmode\n\t\t);\n\t\tconst [ blocks, onInput, onChange ] = useBlockEditorProps(\n\t\t\tpost,\n\t\t\ttemplate,\n\t\t\tmode\n\t\t);\n\n\t\tconst {\n\t\t\tupdatePostLock,\n\t\t\tsetupEditor,\n\t\t\tupdateEditorSettings,\n\t\t\tsetCurrentTemplateId,\n\t\t\tsetEditedPost,\n\t\t\tsetRenderingMode,\n\t\t} = unlock( useDispatch( editorStore ) );\n\t\tconst { createWarningNotice } = useDispatch( noticesStore );\n\n\t\t// Ideally this should be synced on each change and not just something you do once.\n\t\tuseLayoutEffect( () => {\n\t\t\t// Assume that we don't need to initialize in the case of an error recovery.\n\t\t\tif ( recovery ) {\n\t\t\t\treturn;\n\t\t\t}\n\n\t\t\tupdatePostLock( settings.postLock );\n\t\t\tsetupEditor( post, initialEdits, settings.template );\n\t\t\tif ( settings.autosave ) {\n\t\t\t\tcreateWarningNotice(\n\t\t\t\t\t__(\n\t\t\t\t\t\t'There is an autosave of this post that is more recent than the version below.'\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tid: 'autosave-exists',\n\t\t\t\t\t\tactions: [\n\t\t\t\t\t\t\t{\n\t\t\t\t\t\t\t\tlabel: __( 'View the autosave' ),\n\t\t\t\t\t\t\t\turl: settings.autosave.editLink,\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\t}, [\n\t\t\tcreateWarningNotice,\n\t\t\tinitialEdits,\n\t\t\tsettings,\n\t\t\tpost,\n\t\t\trecovery,\n\t\t\tsetupEditor,\n\t\t\tupdatePostLock,\n\t\t] );\n\n\t\t// Synchronizes the active post with the state\n\t\tuseEffect( () => {\n\t\t\tsetEditedPost( post.type, post.id );\n\t\t}, [ post.type, post.id, setEditedPost ] );\n\n\t\t// Synchronize the editor settings as they change.\n\t\tuseEffect( () => {\n\t\t\tupdateEditorSettings( settings );\n\t\t}, [ settings, updateEditorSettings ] );\n\n\t\t// Synchronizes the active template with the state.\n\t\tuseEffect( () => {\n\t\t\tsetCurrentTemplateId( template?.id );\n\t\t}, [ template?.id, setCurrentTemplateId ] );\n\n\t\t// Sets the right rendering mode when loading the editor.\n\t\tuseEffect( () => {\n\t\t\tsetRenderingMode( defaultMode );\n\t\t}, [ defaultMode, setRenderingMode ] );\n\n\t\tuseHideBlocksFromInserter( post.type, mode );\n\n\t\t// Register the editor commands.\n\t\tuseCommands();\n\n\t\tif ( ! isReady || ! mode || ! hasLoadedPostObject ) {\n\t\t\treturn null;\n\t\t}\n\n\t\treturn (\n\t\t\t<EntityProvider kind=\"root\" type=\"site\">\n\t\t\t\t<EntityProvider\n\t\t\t\t\tkind=\"postType\"\n\t\t\t\t\ttype={ post.type }\n\t\t\t\t\tid={ post.id }\n\t\t\t\t>\n\t\t\t\t\t<BlockContextProvider value={ defaultBlockContext }>\n\t\t\t\t\t\t<BlockEditorProviderComponent\n\t\t\t\t\t\t\tvalue={ blocks }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tonInput={ onInput }\n\t\t\t\t\t\t\tselection={ selection }\n\t\t\t\t\t\t\tsettings={ blockEditorSettings }\n\t\t\t\t\t\t\tuseSubRegistry={ false }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ children }\n\t\t\t\t\t\t\t{ ! settings.isPreviewMode && (\n\t\t\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t\t\t<PatternsMenuItems />\n\t\t\t\t\t\t\t\t\t<TemplatePartMenuItems />\n\t\t\t\t\t\t\t\t\t<ContentOnlySettingsMenu />\n\t\t\t\t\t\t\t\t\t{ mode === 'template-locked' && (\n\t\t\t\t\t\t\t\t\t\t<DisableNonPageContentBlocks />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t{ type === 'wp_navigation' && (\n\t\t\t\t\t\t\t\t\t\t<NavigationBlockEditingMode />\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t\t<EditorKeyboardShortcuts />\n\t\t\t\t\t\t\t\t\t<KeyboardShortcutHelpModal />\n\t\t\t\t\t\t\t\t\t<BlockRemovalWarnings />\n\t\t\t\t\t\t\t\t\t<StartPageOptions />\n\t\t\t\t\t\t\t\t\t<StartTemplateOptions />\n\t\t\t\t\t\t\t\t\t<PatternRenameModal />\n\t\t\t\t\t\t\t\t\t<PatternDuplicateModal />\n\t\t\t\t\t\t\t\t</>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</BlockEditorProviderComponent>\n\t\t\t\t\t</BlockContextProvider>\n\t\t\t\t</EntityProvider>\n\t\t\t</EntityProvider>\n\t\t);\n\t}\n);\n\n/**\n * This component establishes a new post editing context, and serves as the entry point for a new post editor (or post with template editor).\n *\n * It supports a large number of post types, including post, page, templates,\n * custom post types, patterns, template parts.\n *\n * All modification and changes are performed to the `@wordpress/core-data` store.\n *\n * @param {Object} props The component props.\n * @param {Object} [props.post] The post object to edit. This is required.\n * @param {Object} [props.__unstableTemplate] The template object wrapper the edited post.\n * This is optional and can only be used when the post type supports templates (like posts and pages).\n * @param {Object} [props.settings] The settings object to use for the editor.\n * This is optional and can be used to override the default settings.\n * @param {Element} [props.children] Children elements for which the BlockEditorProvider context should apply.\n * This is optional.\n *\n * @example\n * ```jsx\n * <EditorProvider\n * post={ post }\n * settings={ settings }\n * __unstableTemplate={ template }\n * >\n * { children }\n * </EditorProvider>\n * ```\n *\n * @return {React.ReactNode} The rendered EditorProvider component.\n */\nexport function EditorProvider( props ) {\n\treturn (\n\t\t<ExperimentalEditorProvider\n\t\t\t{ ...props }\n\t\t\tBlockEditorProviderComponent={ BlockEditorProvider }\n\t\t>\n\t\t\t{ props.children }\n\t\t</ExperimentalEditorProvider>\n\t);\n}\n\nexport default EditorProvider;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,EAAEC,eAAe,EAAEC,OAAO,QAAQ,oBAAoB;AACxE,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SACCC,cAAc,EACdC,oBAAoB,EACpBC,KAAK,IAAIC,SAAS,QACZ,sBAAsB;AAC7B,SACCC,mBAAmB,EACnBC,oBAAoB,EACpBC,WAAW,IAAIC,sBAAsB,QAC/B,yBAAyB;AAChC,SAASL,KAAK,IAAIM,YAAY,QAAQ,oBAAoB;AAC1D,SAASF,WAAW,IAAIG,uBAAuB,QAAQ,qBAAqB;AAC5E,SAASC,WAAW,QAAQ,mBAAmB;;AAE/C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,0BAA0B;AAC3D,SAAST,KAAK,IAAIU,WAAW,QAAQ,aAAa;AAClD,OAAOC,sBAAsB,MAAM,6BAA6B;AAChE,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,OAAOC,2BAA2B,MAAM,mCAAmC;AAC3E,OAAOC,0BAA0B,MAAM,iCAAiC;AACxE,SAASC,yBAAyB,QAAQ,iCAAiC;AAC3E,OAAOC,WAAW,MAAM,aAAa;AACrC,OAAOC,oBAAoB,M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param {boolean} props.repositionDropdown Whether to reposition the dropdown.
59
59
  * @param {Element.ref} ref The component's ref.
60
60
  *
61
- * @return {JSX.Element} The rendered table of contents component.
61
+ * @return {React.ReactNode} The rendered table of contents component.
62
62
  */
63
63
  export default forwardRef(TableOfContents);
64
64
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","jsx","_jsx","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","__next40pxDefaultSize","onClick","undefined","icon","label","tooltipPosition","renderContent","onClose","onRequestClose"],"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a table of contents component.\n *\n * @param {Object} props The component props.\n * @param {boolean} props.hasOutlineItemsDisabled Whether outline items are disabled.\n * @param {boolean} props.repositionDropdown Whether to reposition the dropdown.\n * @param {Element.ref} ref The component's ref.\n *\n * @return {JSX.Element} The rendered table of contents component.\n */\nexport default forwardRef( TableOfContents );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;AACxD,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,IAAI,QAAQ,kBAAkB;AACvC,SAASC,UAAU,QAAQ,oBAAoB;AAC/C,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;;AAEnE;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,SAAS;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,SAASC,eAAeA,CACvB;EAAEC,uBAAuB;EAAEC,kBAAkB;EAAE,GAAGC;AAAM,CAAC,EACzDC,GAAG,EACF;EACD,MAAMC,SAAS,GAAGb,SAAS,CACxBc,MAAM,IAAM,CAAC,CAAEA,MAAM,CAAEV,gBAAiB,CAAC,CAACW,aAAa,CAAC,CAAC,EAC3D,EACD,CAAC;EACD,oBACCR,IAAA,CAACT,QAAQ;IACRkB,YAAY,EAAG;MACdC,SAAS,EAAEP,kBAAkB,GAAG,OAAO,GAAG;IAC3C,CAAG;IACHQ,SAAS,EAAC,mBAAmB;IAC7BC,gBAAgB,EAAC,4BAA4B;IAC7CC,YAAY,EAAGA,CAAE;MAAEC,MAAM;MAAEC;IAAS,CAAC,kBACpCf,IAAA,CAACR,MAAM;MACNwB,qBAAqB;MAAA,GAChBZ,KAAK;MACVC,GAAG,EAAGA,GAAK;MACXY,OAAO,EAAGX,SAAS,GAAGS,QAAQ,GAAGG,SAAW;MAC5CC,IAAI,EAAGzB,IAAM;MACb,iBAAgBoB,MAAQ;MACxB,iBAAc;MACd;MACAM,KAAK,EAAG9B,EAAE,CAAE,SAAU,CAAG;MACzB+B,eAAe,EAAC,QAAQ;MACxB,iBAAgB,CAAEf;IAAW,CAC7B,CACC;IACHgB,aAAa,EAAGA,CAAE;MAAEC;IAAQ,CAAC,kBAC5BvB,IAAA,CAACF,oBAAoB;MACpB0B,cAAc,EAAGD,OAAS;MAC1BrB,uBAAuB,EAAGA;IAAyB,CACnD;EACC,CACH,CAAC;AAEJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAeP,UAAU,CAAEM,eAAgB,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["__","Dropdown","Button","useSelect","info","forwardRef","store","blockEditorStore","TableOfContentsPanel","jsx","_jsx","TableOfContents","hasOutlineItemsDisabled","repositionDropdown","props","ref","hasBlocks","select","getBlockCount","popoverProps","placement","className","contentClassName","renderToggle","isOpen","onToggle","__next40pxDefaultSize","onClick","undefined","icon","label","tooltipPosition","renderContent","onClose","onRequestClose"],"sources":["@wordpress/editor/src/components/table-of-contents/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { Dropdown, Button } from '@wordpress/components';\nimport { useSelect } from '@wordpress/data';\nimport { info } from '@wordpress/icons';\nimport { forwardRef } from '@wordpress/element';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\n\n/**\n * Internal dependencies\n */\nimport TableOfContentsPanel from './panel';\n\nfunction TableOfContents(\n\t{ hasOutlineItemsDisabled, repositionDropdown, ...props },\n\tref\n) {\n\tconst hasBlocks = useSelect(\n\t\t( select ) => !! select( blockEditorStore ).getBlockCount(),\n\t\t[]\n\t);\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tplacement: repositionDropdown ? 'right' : 'bottom',\n\t\t\t} }\n\t\t\tclassName=\"table-of-contents\"\n\t\t\tcontentClassName=\"table-of-contents__popover\"\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => (\n\t\t\t\t<Button\n\t\t\t\t\t__next40pxDefaultSize\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tref={ ref }\n\t\t\t\t\tonClick={ hasBlocks ? onToggle : undefined }\n\t\t\t\t\ticon={ info }\n\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t/* translators: button label text should, if possible, be under 16 characters. */\n\t\t\t\t\tlabel={ __( 'Details' ) }\n\t\t\t\t\ttooltipPosition=\"bottom\"\n\t\t\t\t\taria-disabled={ ! hasBlocks }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\trenderContent={ ( { onClose } ) => (\n\t\t\t\t<TableOfContentsPanel\n\t\t\t\t\tonRequestClose={ onClose }\n\t\t\t\t\thasOutlineItemsDisabled={ hasOutlineItemsDisabled }\n\t\t\t\t/>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\n/**\n * Renders a table of contents component.\n *\n * @param {Object} props The component props.\n * @param {boolean} props.hasOutlineItemsDisabled Whether outline items are disabled.\n * @param {boolean} props.repositionDropdown Whether to reposition the dropdown.\n * @param {Element.ref} ref The component's ref.\n *\n * @return {React.ReactNode} The rendered table of contents component.\n */\nexport default forwardRef( TableOfContents );\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,QAAQ,EAAEC,MAAM,QAAQ,uBAAuB;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A;AACA;AACA,eAAeP,UAAU,CAAEM,eAAgB,CAAC","ignoreList":[]}
@@ -12,11 +12,11 @@ import { store as editorStore } from '../../store';
12
12
  /**
13
13
  * Checks if the current theme supports specific features and renders the children if supported.
14
14
  *
15
- * @param {Object} props The component props.
16
- * @param {Element} props.children The children to render if the theme supports the specified features.
17
- * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
15
+ * @param {Object} props The component props.
16
+ * @param {React.ReactElement} props.children The children to render if the theme supports the specified features.
17
+ * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.
18
18
  *
19
- * @return {JSX.Element|null} The rendered children if the theme supports the specified features, otherwise null.
19
+ * @return {React.ReactElement} The rendered children if the theme supports the specified features, otherwise null.
20
20
  */
21
21
  export default function ThemeSupportCheck({
22
22
  children,
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","store","coreStore","editorStore","ThemeSupportCheck","children","supportKeys","postType","themeSupports","select","getEditedPostAttribute","getThemeSupports","isSupported","Array","isArray","some","key","_themeSupports$key","supported","includes"],"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Checks if the current theme supports specific features and renders the children if supported.\n *\n * @param {Object} props The component props.\n * @param {Element} props.children The children to render if the theme supports the specified features.\n * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.\n *\n * @return {JSX.Element|null} The rendered children if the theme supports the specified features, otherwise null.\n */\nexport default function ThemeSupportCheck( { children, supportKeys } ) {\n\tconst { postType, themeSupports } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t\t\tthemeSupports: select( coreStore ).getThemeSupports(),\n\t\t};\n\t}, [] );\n\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EAAG;EACtE,MAAM;IAAEC,QAAQ;IAAEC;EAAc,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAC5D,OAAO;MACNF,QAAQ,EAAEE,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,MAAO,CAAC;MAChEF,aAAa,EAAEC,MAAM,CAAEP,SAAU,CAAC,CAACS,gBAAgB,CAAC;IACrD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,WAAW,GAAG,CACnBC,KAAK,CAACC,OAAO,CAAER,WAAY,CAAC,GAAGA,WAAW,GAAG,CAAEA,WAAW,CAAE,EAC3DS,IAAI,CAAIC,GAAG,IAAM;IAAA,IAAAC,kBAAA;IAClB,MAAMC,SAAS,IAAAD,kBAAA,GAAGT,aAAa,GAAIQ,GAAG,CAAE,cAAAC,kBAAA,cAAAA,kBAAA,GAAI,KAAK;IACjD;IACA;IACA;IACA;IACA,IAAK,iBAAiB,KAAKD,GAAG,IAAIH,KAAK,CAACC,OAAO,CAAEI,SAAU,CAAC,EAAG;MAC9D,OAAOA,SAAS,CAACC,QAAQ,CAAEZ,QAAS,CAAC;IACtC;IACA,OAAOW,SAAS;EACjB,CAAE,CAAC;EAEH,IAAK,CAAEN,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAOP,QAAQ;AAChB","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","store","coreStore","editorStore","ThemeSupportCheck","children","supportKeys","postType","themeSupports","select","getEditedPostAttribute","getThemeSupports","isSupported","Array","isArray","some","key","_themeSupports$key","supported","includes"],"sources":["@wordpress/editor/src/components/theme-support-check/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Checks if the current theme supports specific features and renders the children if supported.\n *\n * @param {Object} props The component props.\n * @param {React.ReactElement} props.children The children to render if the theme supports the specified features.\n * @param {string|string[]} props.supportKeys The key(s) of the theme support(s) to check.\n *\n * @return {React.ReactElement} The rendered children if the theme supports the specified features, otherwise null.\n */\nexport default function ThemeSupportCheck( { children, supportKeys } ) {\n\tconst { postType, themeSupports } = useSelect( ( select ) => {\n\t\treturn {\n\t\t\tpostType: select( editorStore ).getEditedPostAttribute( 'type' ),\n\t\t\tthemeSupports: select( coreStore ).getThemeSupports(),\n\t\t};\n\t}, [] );\n\n\tconst isSupported = (\n\t\tArray.isArray( supportKeys ) ? supportKeys : [ supportKeys ]\n\t).some( ( key ) => {\n\t\tconst supported = themeSupports?.[ key ] ?? false;\n\t\t// 'post-thumbnails' can be boolean or an array of post types.\n\t\t// In the latter case, we need to verify `postType` exists\n\t\t// within `supported`. If `postType` isn't passed, then the check\n\t\t// should fail.\n\t\tif ( 'post-thumbnails' === key && Array.isArray( supported ) ) {\n\t\t\treturn supported.includes( postType );\n\t\t}\n\t\treturn supported;\n\t} );\n\n\tif ( ! isSupported ) {\n\t\treturn null;\n\t}\n\n\treturn children;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASD,KAAK,IAAIE,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,iBAAiBA,CAAE;EAAEC,QAAQ;EAAEC;AAAY,CAAC,EAAG;EACtE,MAAM;IAAEC,QAAQ;IAAEC;EAAc,CAAC,GAAGR,SAAS,CAAIS,MAAM,IAAM;IAC5D,OAAO;MACNF,QAAQ,EAAEE,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,MAAO,CAAC;MAChEF,aAAa,EAAEC,MAAM,CAAEP,SAAU,CAAC,CAACS,gBAAgB,CAAC;IACrD,CAAC;EACF,CAAC,EAAE,EAAG,CAAC;EAEP,MAAMC,WAAW,GAAG,CACnBC,KAAK,CAACC,OAAO,CAAER,WAAY,CAAC,GAAGA,WAAW,GAAG,CAAEA,WAAW,CAAE,EAC3DS,IAAI,CAAIC,GAAG,IAAM;IAAA,IAAAC,kBAAA;IAClB,MAAMC,SAAS,IAAAD,kBAAA,GAAGT,aAAa,GAAIQ,GAAG,CAAE,cAAAC,kBAAA,cAAAA,kBAAA,GAAI,KAAK;IACjD;IACA;IACA;IACA;IACA,IAAK,iBAAiB,KAAKD,GAAG,IAAIH,KAAK,CAACC,OAAO,CAAEI,SAAU,CAAC,EAAG;MAC9D,OAAOA,SAAS,CAACC,QAAQ,CAAEZ,QAAS,CAAC;IACtC;IACA,OAAOW,SAAS;EACjB,CAAE,CAAC;EAEH,IAAK,CAAEN,WAAW,EAAG;IACpB,OAAO,IAAI;EACZ;EAEA,OAAOP,QAAQ;AAChB","ignoreList":[]}
@@ -24,7 +24,7 @@ const AVERAGE_READING_RATE = 189;
24
24
  /**
25
25
  * Component for showing Time To Read in Content.
26
26
  *
27
- * @return {JSX.Element} The rendered TimeToRead component.
27
+ * @return {React.ReactNode} The rendered TimeToRead component.
28
28
  */
29
29
  export default function TimeToRead() {
30
30
  const content = useSelect(select => select(editorStore).getEditedPostAttribute('content'), []);
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","_x","_n","__","sprintf","count","wordCount","createInterpolateElement","store","editorStore","jsx","_jsx","AVERAGE_READING_RATE","TimeToRead","content","select","getEditedPostAttribute","wordCountType","minutesToRead","Math","round","minutesToReadString","span","className","children"],"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\n/**\n * Component for showing Time To Read in Content.\n *\n * @return {JSX.Element} The rendered TimeToRead component.\n */\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: the number of minutes to read the post. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<span>%s</span> minute',\n\t\t\t\t\t\t\t'<span>%s</span> minutes',\n\t\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t\t),\n\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t}\n\t\t\t );\n\n\treturn <span className=\"time-to-read\">{ minutesToReadString }</span>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAOA,MAAMC,oBAAoB,GAAG,GAAG;;AAEhC;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAMC,OAAO,GAAGd,SAAS,CACtBe,MAAM,IAAMA,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGhB,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EACzE,MAAMiB,aAAa,GAAGC,IAAI,CAACC,KAAK,CAC/Bd,SAAS,CAAEQ,OAAO,EAAEG,aAAc,CAAC,GAAGL,oBACvC,CAAC;EACD,MAAMS,mBAAmB,GACxBH,aAAa,KAAK,CAAC,GAChBX,wBAAwB,CAAEJ,EAAE,CAAE,yBAA0B,CAAC,EAAE;IAC3DmB,IAAI,eAAEX,IAAA,WAAO;EACb,CAAE,CAAC,GACHJ,wBAAwB,CACxBH,OAAO,CACN;EACAF,EAAE,CACD,wBAAwB,EACxB,yBAAyB,EACzBgB,aACD,CAAC,EACDA,aACD,CAAC,EACD;IACCI,IAAI,eAAEX,IAAA,WAAO;EACd,CACA,CAAC;EAEL,oBAAOA,IAAA;IAAMY,SAAS,EAAC,cAAc;IAAAC,QAAA,EAAGH;EAAmB,CAAQ,CAAC;AACrE","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","_x","_n","__","sprintf","count","wordCount","createInterpolateElement","store","editorStore","jsx","_jsx","AVERAGE_READING_RATE","TimeToRead","content","select","getEditedPostAttribute","wordCountType","minutesToRead","Math","round","minutesToReadString","span","className","children"],"sources":["@wordpress/editor/src/components/time-to-read/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x, _n, __, sprintf } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\nimport { createInterpolateElement } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Average reading rate - based on average taken from\n * https://irisreading.com/average-reading-speed-in-various-languages/\n * (Characters/minute used for Chinese rather than words).\n *\n * @type {number} A rough estimate of the average reading rate across multiple languages.\n */\nconst AVERAGE_READING_RATE = 189;\n\n/**\n * Component for showing Time To Read in Content.\n *\n * @return {React.ReactNode} The rendered TimeToRead component.\n */\nexport default function TimeToRead() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\tconst minutesToRead = Math.round(\n\t\twordCount( content, wordCountType ) / AVERAGE_READING_RATE\n\t);\n\tconst minutesToReadString =\n\t\tminutesToRead === 0\n\t\t\t? createInterpolateElement( __( '<span>< 1</span> minute' ), {\n\t\t\t\t\tspan: <span />,\n\t\t\t } )\n\t\t\t: createInterpolateElement(\n\t\t\t\t\tsprintf(\n\t\t\t\t\t\t/* translators: %s: the number of minutes to read the post. */\n\t\t\t\t\t\t_n(\n\t\t\t\t\t\t\t'<span>%s</span> minute',\n\t\t\t\t\t\t\t'<span>%s</span> minutes',\n\t\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t\t),\n\t\t\t\t\t\tminutesToRead\n\t\t\t\t\t),\n\t\t\t\t\t{\n\t\t\t\t\t\tspan: <span />,\n\t\t\t\t\t}\n\t\t\t );\n\n\treturn <span className=\"time-to-read\">{ minutesToReadString }</span>;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,EAAEC,EAAE,EAAEC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;AACrD,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AACzD,SAASC,wBAAwB,QAAQ,oBAAoB;;AAE7D;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AACA;AACA;AANA,SAAAC,GAAA,IAAAC,IAAA;AAOA,MAAMC,oBAAoB,GAAG,GAAG;;AAEhC;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,UAAUA,CAAA,EAAG;EACpC,MAAMC,OAAO,GAAGd,SAAS,CACtBe,MAAM,IAAMA,MAAM,CAAEN,WAAY,CAAC,CAACO,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGhB,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EACzE,MAAMiB,aAAa,GAAGC,IAAI,CAACC,KAAK,CAC/Bd,SAAS,CAAEQ,OAAO,EAAEG,aAAc,CAAC,GAAGL,oBACvC,CAAC;EACD,MAAMS,mBAAmB,GACxBH,aAAa,KAAK,CAAC,GAChBX,wBAAwB,CAAEJ,EAAE,CAAE,yBAA0B,CAAC,EAAE;IAC3DmB,IAAI,eAAEX,IAAA,WAAO;EACb,CAAE,CAAC,GACHJ,wBAAwB,CACxBH,OAAO,CACN;EACAF,EAAE,CACD,wBAAwB,EACxB,yBAAyB,EACzBgB,aACD,CAAC,EACDA,aACD,CAAC,EACD;IACCI,IAAI,eAAEX,IAAA,WAAO;EACd,CACA,CAAC;EAEL,oBAAOA,IAAA;IAAMY,SAAS,EAAC,cAAc;IAAAC,QAAA,EAAGH;EAAmB,CAAQ,CAAC;AACrE","ignoreList":[]}
@@ -10,7 +10,7 @@ import { store as coreStore } from '@wordpress/core-data';
10
10
  * Warns the user if there are unsaved changes before leaving the editor.
11
11
  * Compatible with Post Editor and Site Editor.
12
12
  *
13
- * @return {Component} The component.
13
+ * @return {React.ReactNode} The component.
14
14
  */
15
15
  export default function UnsavedChangesWarning() {
16
16
  const {
@@ -1 +1 @@
1
- {"version":3,"names":["__","useEffect","useSelect","store","coreStore","UnsavedChangesWarning","__experimentalGetDirtyEntityRecords","warnIfUnsavedChanges","event","dirtyEntityRecords","length","returnValue","window","addEventListener","removeEventListener"],"sources":["@wordpress/editor/src/components/unsaved-changes-warning/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n * Compatible with Post Editor and Site Editor.\n *\n * @return {Component} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst { __experimentalGetDirtyEntityRecords } = useSelect( coreStore );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\t// We need to call the selector directly in the listener to avoid race\n\t\t\t// conditions with `BrowserURL` where `componentDidUpdate` gets the\n\t\t\t// new value of `isEditedPostDirty` before this component does,\n\t\t\t// causing this component to incorrectly think a trashed post is still dirty.\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tif ( dirtyEntityRecords.length > 0 ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ __experimentalGetDirtyEntityRecords ] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAA,EAAG;EAC/C,MAAM;IAAEC;EAAoC,CAAC,GAAGJ,SAAS,CAAEE,SAAU,CAAC;EAEtEH,SAAS,CAAE,MAAM;IAChB;AACF;AACA;AACA;AACA;AACA;AACA;IACE,MAAMM,oBAAoB,GAAKC,KAAK,IAAM;MACzC;MACA;MACA;MACA;MACA,MAAMC,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;MAChE,IAAKG,kBAAkB,CAACC,MAAM,GAAG,CAAC,EAAG;QACpCF,KAAK,CAACG,WAAW,GAAGX,EAAE,CACrB,8DACD,CAAC;QACD,OAAOQ,KAAK,CAACG,WAAW;MACzB;IACD,CAAC;IAEDC,MAAM,CAACC,gBAAgB,CAAE,cAAc,EAAEN,oBAAqB,CAAC;IAE/D,OAAO,MAAM;MACZK,MAAM,CAACE,mBAAmB,CAAE,cAAc,EAAEP,oBAAqB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,CAAED,mCAAmC,CAAG,CAAC;EAE5C,OAAO,IAAI;AACZ","ignoreList":[]}
1
+ {"version":3,"names":["__","useEffect","useSelect","store","coreStore","UnsavedChangesWarning","__experimentalGetDirtyEntityRecords","warnIfUnsavedChanges","event","dirtyEntityRecords","length","returnValue","window","addEventListener","removeEventListener"],"sources":["@wordpress/editor/src/components/unsaved-changes-warning/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\nimport { store as coreStore } from '@wordpress/core-data';\n\n/**\n * Warns the user if there are unsaved changes before leaving the editor.\n * Compatible with Post Editor and Site Editor.\n *\n * @return {React.ReactNode} The component.\n */\nexport default function UnsavedChangesWarning() {\n\tconst { __experimentalGetDirtyEntityRecords } = useSelect( coreStore );\n\n\tuseEffect( () => {\n\t\t/**\n\t\t * Warns the user if there are unsaved changes before leaving the editor.\n\t\t *\n\t\t * @param {Event} event `beforeunload` event.\n\t\t *\n\t\t * @return {string | undefined} Warning prompt message, if unsaved changes exist.\n\t\t */\n\t\tconst warnIfUnsavedChanges = ( event ) => {\n\t\t\t// We need to call the selector directly in the listener to avoid race\n\t\t\t// conditions with `BrowserURL` where `componentDidUpdate` gets the\n\t\t\t// new value of `isEditedPostDirty` before this component does,\n\t\t\t// causing this component to incorrectly think a trashed post is still dirty.\n\t\t\tconst dirtyEntityRecords = __experimentalGetDirtyEntityRecords();\n\t\t\tif ( dirtyEntityRecords.length > 0 ) {\n\t\t\t\tevent.returnValue = __(\n\t\t\t\t\t'You have unsaved changes. If you proceed, they will be lost.'\n\t\t\t\t);\n\t\t\t\treturn event.returnValue;\n\t\t\t}\n\t\t};\n\n\t\twindow.addEventListener( 'beforeunload', warnIfUnsavedChanges );\n\n\t\treturn () => {\n\t\t\twindow.removeEventListener( 'beforeunload', warnIfUnsavedChanges );\n\t\t};\n\t}, [ __experimentalGetDirtyEntityRecords ] );\n\n\treturn null;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASC,qBAAqBA,CAAA,EAAG;EAC/C,MAAM;IAAEC;EAAoC,CAAC,GAAGJ,SAAS,CAAEE,SAAU,CAAC;EAEtEH,SAAS,CAAE,MAAM;IAChB;AACF;AACA;AACA;AACA;AACA;AACA;IACE,MAAMM,oBAAoB,GAAKC,KAAK,IAAM;MACzC;MACA;MACA;MACA;MACA,MAAMC,kBAAkB,GAAGH,mCAAmC,CAAC,CAAC;MAChE,IAAKG,kBAAkB,CAACC,MAAM,GAAG,CAAC,EAAG;QACpCF,KAAK,CAACG,WAAW,GAAGX,EAAE,CACrB,8DACD,CAAC;QACD,OAAOQ,KAAK,CAACG,WAAW;MACzB;IACD,CAAC;IAEDC,MAAM,CAACC,gBAAgB,CAAE,cAAc,EAAEN,oBAAqB,CAAC;IAE/D,OAAO,MAAM;MACZK,MAAM,CAACE,mBAAmB,CAAE,cAAc,EAAEP,oBAAqB,CAAC;IACnE,CAAC;EACF,CAAC,EAAE,CAAED,mCAAmC,CAAG,CAAC;EAE5C,OAAO,IAAI;AACZ","ignoreList":[]}
@@ -13,7 +13,7 @@ import { store as editorStore } from '../../store';
13
13
  /**
14
14
  * Renders the word count of the post content.
15
15
  *
16
- * @return {JSX.Element|null} The rendered WordCount component.
16
+ * @return {React.ReactNode} The rendered WordCount component.
17
17
  */
18
18
  import { jsx as _jsx } from "react/jsx-runtime";
19
19
  export default function WordCount() {
@@ -1 +1 @@
1
- {"version":3,"names":["useSelect","_x","count","wordCount","store","editorStore","jsx","_jsx","WordCount","content","select","getEditedPostAttribute","wordCountType","className","children"],"sources":["@wordpress/editor/src/components/word-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the word count of the post content.\n *\n * @return {JSX.Element|null} The rendered WordCount component.\n */\nexport default function WordCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\treturn (\n\t\t<span className=\"word-count\">\n\t\t\t{ wordCount( content, wordCountType ) }\n\t\t</span>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,eAAe,SAASC,SAASA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGT,SAAS,CACtBU,MAAM,IAAMA,MAAM,CAAEL,WAAY,CAAC,CAACM,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGX,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EAEzE,oBACCM,IAAA;IAAMM,SAAS,EAAC,YAAY;IAAAC,QAAA,EACzBX,SAAS,CAAEM,OAAO,EAAEG,aAAc;EAAC,CAChC,CAAC;AAET","ignoreList":[]}
1
+ {"version":3,"names":["useSelect","_x","count","wordCount","store","editorStore","jsx","_jsx","WordCount","content","select","getEditedPostAttribute","wordCountType","className","children"],"sources":["@wordpress/editor/src/components/word-count/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useSelect } from '@wordpress/data';\nimport { _x } from '@wordpress/i18n';\nimport { count as wordCount } from '@wordpress/wordcount';\n\n/**\n * Internal dependencies\n */\nimport { store as editorStore } from '../../store';\n\n/**\n * Renders the word count of the post content.\n *\n * @return {React.ReactNode} The rendered WordCount component.\n */\nexport default function WordCount() {\n\tconst content = useSelect(\n\t\t( select ) => select( editorStore ).getEditedPostAttribute( 'content' ),\n\t\t[]\n\t);\n\n\t/*\n\t * translators: If your word count is based on single characters (e.g. East Asian characters),\n\t * enter 'characters_excluding_spaces' or 'characters_including_spaces'. Otherwise, enter 'words'.\n\t * Do not translate into your own language.\n\t */\n\tconst wordCountType = _x( 'words', 'Word count type. Do not translate!' );\n\n\treturn (\n\t\t<span className=\"word-count\">\n\t\t\t{ wordCount( content, wordCountType ) }\n\t\t</span>\n\t);\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,iBAAiB;AAC3C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;;AAEzD;AACA;AACA;AACA,SAASC,KAAK,IAAIC,WAAW,QAAQ,aAAa;;AAElD;AACA;AACA;AACA;AACA;AAJA,SAAAC,GAAA,IAAAC,IAAA;AAKA,eAAe,SAASC,SAASA,CAAA,EAAG;EACnC,MAAMC,OAAO,GAAGT,SAAS,CACtBU,MAAM,IAAMA,MAAM,CAAEL,WAAY,CAAC,CAACM,sBAAsB,CAAE,SAAU,CAAC,EACvE,EACD,CAAC;;EAED;AACD;AACA;AACA;AACA;EACC,MAAMC,aAAa,GAAGX,EAAE,CAAE,OAAO,EAAE,oCAAqC,CAAC;EAEzE,oBACCM,IAAA;IAAMM,SAAS,EAAC,YAAY;IAAAC,QAAA,EACzBX,SAAS,CAAEM,OAAO,EAAEG,aAAc;EAAC,CAChC,CAAC;AAET","ignoreList":[]}
@@ -21,10 +21,12 @@ const ZoomOutToggle = ({
21
21
  }) => {
22
22
  const {
23
23
  isZoomOut,
24
- showIconLabels
24
+ showIconLabels,
25
+ isDistractionFree
25
26
  } = useSelect(select => ({
26
27
  isZoomOut: unlock(select(blockEditorStore)).isZoomOut(),
27
- showIconLabels: select(preferencesStore).get('core', 'showIconLabels')
28
+ showIconLabels: select(preferencesStore).get('core', 'showIconLabels'),
29
+ isDistractionFree: select(preferencesStore).get('core', 'distractionFree')
28
30
  }));
29
31
  const {
30
32
  resetZoomLevel,
@@ -56,6 +58,8 @@ const ZoomOutToggle = ({
56
58
  } else {
57
59
  setZoomLevel('auto-scaled');
58
60
  }
61
+ }, {
62
+ isDisabled: isDistractionFree
59
63
  });
60
64
  const handleZoomOut = () => {
61
65
  if (isZoomOut) {
@@ -72,7 +76,8 @@ const ZoomOutToggle = ({
72
76
  label: __('Zoom Out'),
73
77
  isPressed: isZoomOut,
74
78
  size: "compact",
75
- showTooltip: !showIconLabels
79
+ showTooltip: !showIconLabels,
80
+ className: "editor-zoom-out-toggle"
76
81
  });
77
82
  };
78
83
  export default ZoomOutToggle;
@@ -1 +1 @@
1
- {"version":3,"names":["Button","__","useEffect","useDispatch","useSelect","store","blockEditorStore","square","zoomOutIcon","preferencesStore","useShortcut","keyboardShortcutsStore","isAppleOS","unlock","jsx","_jsx","ZoomOutToggle","disabled","isZoomOut","showIconLabels","select","get","resetZoomLevel","setZoomLevel","registerShortcut","unregisterShortcut","name","category","description","keyCombination","modifier","character","handleZoomOut","accessibleWhenDisabled","onClick","icon","label","isPressed","size","showTooltip"],"sources":["@wordpress/editor/src/components/zoom-out-toggle/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { square as zoomOutIcon } from '@wordpress/icons';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst ZoomOutToggle = ( { disabled } ) => {\n\tconst { isZoomOut, showIconLabels } = useSelect( ( select ) => ( {\n\t\tisZoomOut: unlock( select( blockEditorStore ) ).isZoomOut(),\n\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t'core',\n\t\t\t'showIconLabels'\n\t\t),\n\t} ) );\n\n\tconst { resetZoomLevel, setZoomLevel } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/zoom',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Enter or exit zoom out.' ),\n\t\t\tkeyCombination: {\n\t\t\t\t// `primaryShift+0` (`ctrl+shift+0`) is the shortcut for switching\n\t\t\t\t// to input mode in Windows, so apply a different key combination.\n\t\t\t\tmodifier: isAppleOS() ? 'primaryShift' : 'secondary',\n\t\t\t\tcharacter: '0',\n\t\t\t},\n\t\t} );\n\t\treturn () => {\n\t\t\tunregisterShortcut( 'core/editor/zoom' );\n\t\t};\n\t}, [ registerShortcut, unregisterShortcut ] );\n\n\tuseShortcut( 'core/editor/zoom', () => {\n\t\tif ( isZoomOut ) {\n\t\t\tresetZoomLevel();\n\t\t} else {\n\t\t\tsetZoomLevel( 'auto-scaled' );\n\t\t}\n\t} );\n\n\tconst handleZoomOut = () => {\n\t\tif ( isZoomOut ) {\n\t\t\tresetZoomLevel();\n\t\t} else {\n\t\t\tsetZoomLevel( 'auto-scaled' );\n\t\t}\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ disabled }\n\t\t\tonClick={ handleZoomOut }\n\t\t\ticon={ zoomOutIcon }\n\t\t\tlabel={ __( 'Zoom Out' ) }\n\t\t\tisPressed={ isZoomOut }\n\t\t\tsize=\"compact\"\n\t\t\tshowTooltip={ ! showIconLabels }\n\t\t/>\n\t);\n};\n\nexport default ZoomOutToggle;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,MAAM,IAAIC,WAAW,QAAQ,kBAAkB;AACxD,SAASH,KAAK,IAAII,gBAAgB,QAAQ,wBAAwB;AAClE,SACCC,WAAW,EACXL,KAAK,IAAIM,sBAAsB,QACzB,+BAA+B;AACtC,SAASC,SAAS,QAAQ,qBAAqB;;AAE/C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;AAAC,SAAAC,GAAA,IAAAC,IAAA;AAE3C,MAAMC,aAAa,GAAGA,CAAE;EAAEC;AAAS,CAAC,KAAM;EACzC,MAAM;IAAEC,SAAS;IAAEC;EAAe,CAAC,GAAGf,SAAS,CAAIgB,MAAM,KAAQ;IAChEF,SAAS,EAAEL,MAAM,CAAEO,MAAM,CAAEd,gBAAiB,CAAE,CAAC,CAACY,SAAS,CAAC,CAAC;IAC3DC,cAAc,EAAEC,MAAM,CAAEX,gBAAiB,CAAC,CAACY,GAAG,CAC7C,MAAM,EACN,gBACD;EACD,CAA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AAeH,aAAa","ignoreList":[]}
1
+ {"version":3,"names":["Button","__","useEffect","useDispatch","useSelect","store","blockEditorStore","square","zoomOutIcon","preferencesStore","useShortcut","keyboardShortcutsStore","isAppleOS","unlock","jsx","_jsx","ZoomOutToggle","disabled","isZoomOut","showIconLabels","isDistractionFree","select","get","resetZoomLevel","setZoomLevel","registerShortcut","unregisterShortcut","name","category","description","keyCombination","modifier","character","isDisabled","handleZoomOut","accessibleWhenDisabled","onClick","icon","label","isPressed","size","showTooltip","className"],"sources":["@wordpress/editor/src/components/zoom-out-toggle/index.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Button } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useEffect } from '@wordpress/element';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { store as blockEditorStore } from '@wordpress/block-editor';\nimport { square as zoomOutIcon } from '@wordpress/icons';\nimport { store as preferencesStore } from '@wordpress/preferences';\nimport {\n\tuseShortcut,\n\tstore as keyboardShortcutsStore,\n} from '@wordpress/keyboard-shortcuts';\nimport { isAppleOS } from '@wordpress/keycodes';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\nconst ZoomOutToggle = ( { disabled } ) => {\n\tconst { isZoomOut, showIconLabels, isDistractionFree } = useSelect(\n\t\t( select ) => ( {\n\t\t\tisZoomOut: unlock( select( blockEditorStore ) ).isZoomOut(),\n\t\t\tshowIconLabels: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'showIconLabels'\n\t\t\t),\n\t\t\tisDistractionFree: select( preferencesStore ).get(\n\t\t\t\t'core',\n\t\t\t\t'distractionFree'\n\t\t\t),\n\t\t} )\n\t);\n\n\tconst { resetZoomLevel, setZoomLevel } = unlock(\n\t\tuseDispatch( blockEditorStore )\n\t);\n\tconst { registerShortcut, unregisterShortcut } = useDispatch(\n\t\tkeyboardShortcutsStore\n\t);\n\n\tuseEffect( () => {\n\t\tregisterShortcut( {\n\t\t\tname: 'core/editor/zoom',\n\t\t\tcategory: 'global',\n\t\t\tdescription: __( 'Enter or exit zoom out.' ),\n\t\t\tkeyCombination: {\n\t\t\t\t// `primaryShift+0` (`ctrl+shift+0`) is the shortcut for switching\n\t\t\t\t// to input mode in Windows, so apply a different key combination.\n\t\t\t\tmodifier: isAppleOS() ? 'primaryShift' : 'secondary',\n\t\t\t\tcharacter: '0',\n\t\t\t},\n\t\t} );\n\t\treturn () => {\n\t\t\tunregisterShortcut( 'core/editor/zoom' );\n\t\t};\n\t}, [ registerShortcut, unregisterShortcut ] );\n\n\tuseShortcut(\n\t\t'core/editor/zoom',\n\t\t() => {\n\t\t\tif ( isZoomOut ) {\n\t\t\t\tresetZoomLevel();\n\t\t\t} else {\n\t\t\t\tsetZoomLevel( 'auto-scaled' );\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\tisDisabled: isDistractionFree,\n\t\t}\n\t);\n\n\tconst handleZoomOut = () => {\n\t\tif ( isZoomOut ) {\n\t\t\tresetZoomLevel();\n\t\t} else {\n\t\t\tsetZoomLevel( 'auto-scaled' );\n\t\t}\n\t};\n\n\treturn (\n\t\t<Button\n\t\t\taccessibleWhenDisabled\n\t\t\tdisabled={ disabled }\n\t\t\tonClick={ handleZoomOut }\n\t\t\ticon={ zoomOutIcon }\n\t\t\tlabel={ __( 'Zoom Out' ) }\n\t\t\tisPressed={ isZoomOut }\n\t\t\tsize=\"compact\"\n\t\t\tshowTooltip={ ! showIconLabels }\n\t\t\tclassName=\"editor-zoom-out-toggle\"\n\t\t/>\n\t);\n};\n\nexport default ZoomOutToggle;\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,MAAM,QAAQ,uBAAuB;AAC9C,SAASC,EAAE,QAAQ,iBAAiB;AACpC,SAASC,SAAS,QAAQ,oBAAoB;AAC9C,SAASC,WAAW,EAAEC,SAAS,QAAQ,iBAAiB;AACxD,SAASC,KAAK,IAAIC,gBAAgB,QAAQ,yBAAyB;AACnE,SAASC,MAAM,IAAIC,WAA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CAAC,EAAE,CAAED,gBAAgB,EAAEC,kBAAkB,CAAG,CAAC;EAE7ChB,WAAW,CACV,kBAAkB,EAClB,MAAM;IACL,IAAKQ,SAAS,EAAG;MAChBK,cAAc,CAAC,CAAC;IACjB,CAAC,MAAM;MACNC,YAAY,CAAE,aAAc,CAAC;IAC9B;EACD,CAAC,EACD;IACCS,UAAU,EAAEb;EACb,CACD,CAAC;EAED,MAAMc,aAAa,GAAGA,CAAA,KAAM;IAC3B,IAAKhB,SAAS,EAAG;MAChBK,cAAc,CAAC,CAAC;IACjB,CAAC,MAAM;MACNC,YAAY,CAAE,aAAc,CAAC;IAC9B;EACD,CAAC;EAED,oBACCT,IAAA,CAACf,MAAM;IACNmC,sBAAsB;IACtBlB,QAAQ,EAAGA,QAAU;IACrBmB,OAAO,EAAGF,aAAe;IACzBG,IAAI,EAAG7B,WAAa;IACpB8B,KAAK,EAAGrC,EAAE,CAAE,UAAW,CAAG;IAC1BsC,SAAS,EAAGrB,SAAW;IACvBsB,IAAI,EAAC,SAAS;IACdC,WAAW,EAAG,CAAEtB,cAAgB;IAChCuB,SAAS,EAAC;EAAwB,CAClC,CAAC;AAEJ,CAAC;AAED,eAAe1B,aAAa","ignoreList":[]}
@@ -11,6 +11,7 @@ import { store as editorStore } from '../store';
11
11
 
12
12
  /**
13
13
  * @typedef {import('@wordpress/dataviews').Action} Action
14
+ * @typedef {import('@wordpress/dataviews').Field} Field
14
15
  */
15
16
 
16
17
  /**
@@ -51,4 +52,42 @@ export function unregisterEntityAction(kind, name, actionId) {
51
52
  _unregisterEntityAction(kind, name, actionId);
52
53
  }
53
54
  }
55
+
56
+ /**
57
+ * Registers a new DataViews field.
58
+ *
59
+ * This is an experimental API and is subject to change.
60
+ * it's only available in the Gutenberg plugin for now.
61
+ *
62
+ * @param {string} kind Entity kind.
63
+ * @param {string} name Entity name.
64
+ * @param {Field} config Field configuration.
65
+ */
66
+ export function registerEntityField(kind, name, config) {
67
+ const {
68
+ registerEntityField: _registerEntityField
69
+ } = unlock(dispatch(editorStore));
70
+ if (globalThis.IS_GUTENBERG_PLUGIN) {
71
+ _registerEntityField(kind, name, config);
72
+ }
73
+ }
74
+
75
+ /**
76
+ * Unregisters a DataViews field.
77
+ *
78
+ * This is an experimental API and is subject to change.
79
+ * it's only available in the Gutenberg plugin for now.
80
+ *
81
+ * @param {string} kind Entity kind.
82
+ * @param {string} name Entity name.
83
+ * @param {string} fieldId Field ID.
84
+ */
85
+ export function unregisterEntityField(kind, name, fieldId) {
86
+ const {
87
+ unregisterEntityField: _unregisterEntityField
88
+ } = unlock(dispatch(editorStore));
89
+ if (globalThis.IS_GUTENBERG_PLUGIN) {
90
+ _unregisterEntityField(kind, name, fieldId);
91
+ }
92
+ }
54
93
  //# sourceMappingURL=api.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["dispatch","unlock","store","editorStore","registerEntityAction","kind","name","config","_registerEntityAction","globalThis","IS_GUTENBERG_PLUGIN","unregisterEntityAction","actionId","_unregisterEntityAction"],"sources":["@wordpress/editor/src/dataviews/api.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { dispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { store as editorStore } from '../store';\n\n/**\n * @typedef {import('@wordpress/dataviews').Action} Action\n */\n\n/**\n * Registers a new DataViews action.\n *\n * This is an experimental API and is subject to change.\n * it's only available in the Gutenberg plugin for now.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {Action} config Action configuration.\n */\n\nexport function registerEntityAction( kind, name, config ) {\n\tconst { registerEntityAction: _registerEntityAction } = unlock(\n\t\tdispatch( editorStore )\n\t);\n\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t_registerEntityAction( kind, name, config );\n\t}\n}\n\n/**\n * Unregisters a DataViews action.\n *\n * This is an experimental API and is subject to change.\n * it's only available in the Gutenberg plugin for now.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {string} actionId Action ID.\n */\nexport function unregisterEntityAction( kind, name, actionId ) {\n\tconst { unregisterEntityAction: _unregisterEntityAction } = unlock(\n\t\tdispatch( editorStore )\n\t);\n\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t_unregisterEntityAction( kind, name, actionId );\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,iBAAiB;;AAE1C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,KAAK,IAAIC,WAAW,QAAQ,UAAU;;AAE/C;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,oBAAoBA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,MAAM,EAAG;EAC1D,MAAM;IAAEH,oBAAoB,EAAEI;EAAsB,CAAC,GAAGP,MAAM,CAC7DD,QAAQ,CAAEG,WAAY,CACvB,CAAC;EAED,IAAKM,UAAU,CAACC,mBAAmB,EAAG;IACrCF,qBAAqB,CAAEH,IAAI,EAAEC,IAAI,EAAEC,MAAO,CAAC;EAC5C;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,sBAAsBA,CAAEN,IAAI,EAAEC,IAAI,EAAEM,QAAQ,EAAG;EAC9D,MAAM;IAAED,sBAAsB,EAAEE;EAAwB,CAAC,GAAGZ,MAAM,CACjED,QAAQ,CAAEG,WAAY,CACvB,CAAC;EAED,IAAKM,UAAU,CAACC,mBAAmB,EAAG;IACrCG,uBAAuB,CAAER,IAAI,EAAEC,IAAI,EAAEM,QAAS,CAAC;EAChD;AACD","ignoreList":[]}
1
+ {"version":3,"names":["dispatch","unlock","store","editorStore","registerEntityAction","kind","name","config","_registerEntityAction","globalThis","IS_GUTENBERG_PLUGIN","unregisterEntityAction","actionId","_unregisterEntityAction","registerEntityField","_registerEntityField","unregisterEntityField","fieldId","_unregisterEntityField"],"sources":["@wordpress/editor/src/dataviews/api.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { dispatch } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../lock-unlock';\nimport { store as editorStore } from '../store';\n\n/**\n * @typedef {import('@wordpress/dataviews').Action} Action\n * @typedef {import('@wordpress/dataviews').Field} Field\n */\n\n/**\n * Registers a new DataViews action.\n *\n * This is an experimental API and is subject to change.\n * it's only available in the Gutenberg plugin for now.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {Action} config Action configuration.\n */\n\nexport function registerEntityAction( kind, name, config ) {\n\tconst { registerEntityAction: _registerEntityAction } = unlock(\n\t\tdispatch( editorStore )\n\t);\n\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t_registerEntityAction( kind, name, config );\n\t}\n}\n\n/**\n * Unregisters a DataViews action.\n *\n * This is an experimental API and is subject to change.\n * it's only available in the Gutenberg plugin for now.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {string} actionId Action ID.\n */\nexport function unregisterEntityAction( kind, name, actionId ) {\n\tconst { unregisterEntityAction: _unregisterEntityAction } = unlock(\n\t\tdispatch( editorStore )\n\t);\n\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t_unregisterEntityAction( kind, name, actionId );\n\t}\n}\n\n/**\n * Registers a new DataViews field.\n *\n * This is an experimental API and is subject to change.\n * it's only available in the Gutenberg plugin for now.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {Field} config Field configuration.\n */\nexport function registerEntityField( kind, name, config ) {\n\tconst { registerEntityField: _registerEntityField } = unlock(\n\t\tdispatch( editorStore )\n\t);\n\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t_registerEntityField( kind, name, config );\n\t}\n}\n\n/**\n * Unregisters a DataViews field.\n *\n * This is an experimental API and is subject to change.\n * it's only available in the Gutenberg plugin for now.\n *\n * @param {string} kind Entity kind.\n * @param {string} name Entity name.\n * @param {string} fieldId Field ID.\n */\nexport function unregisterEntityField( kind, name, fieldId ) {\n\tconst { unregisterEntityField: _unregisterEntityField } = unlock(\n\t\tdispatch( editorStore )\n\t);\n\n\tif ( globalThis.IS_GUTENBERG_PLUGIN ) {\n\t\t_unregisterEntityField( kind, name, fieldId );\n\t}\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,QAAQ,QAAQ,iBAAiB;;AAE1C;AACA;AACA;AACA,SAASC,MAAM,QAAQ,gBAAgB;AACvC,SAASC,KAAK,IAAIC,WAAW,QAAQ,UAAU;;AAE/C;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,oBAAoBA,CAAEC,IAAI,EAAEC,IAAI,EAAEC,MAAM,EAAG;EAC1D,MAAM;IAAEH,oBAAoB,EAAEI;EAAsB,CAAC,GAAGP,MAAM,CAC7DD,QAAQ,CAAEG,WAAY,CACvB,CAAC;EAED,IAAKM,UAAU,CAACC,mBAAmB,EAAG;IACrCF,qBAAqB,CAAEH,IAAI,EAAEC,IAAI,EAAEC,MAAO,CAAC;EAC5C;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASI,sBAAsBA,CAAEN,IAAI,EAAEC,IAAI,EAAEM,QAAQ,EAAG;EAC9D,MAAM;IAAED,sBAAsB,EAAEE;EAAwB,CAAC,GAAGZ,MAAM,CACjED,QAAQ,CAAEG,WAAY,CACvB,CAAC;EAED,IAAKM,UAAU,CAACC,mBAAmB,EAAG;IACrCG,uBAAuB,CAAER,IAAI,EAAEC,IAAI,EAAEM,QAAS,CAAC;EAChD;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASE,mBAAmBA,CAAET,IAAI,EAAEC,IAAI,EAAEC,MAAM,EAAG;EACzD,MAAM;IAAEO,mBAAmB,EAAEC;EAAqB,CAAC,GAAGd,MAAM,CAC3DD,QAAQ,CAAEG,WAAY,CACvB,CAAC;EAED,IAAKM,UAAU,CAACC,mBAAmB,EAAG;IACrCK,oBAAoB,CAAEV,IAAI,EAAEC,IAAI,EAAEC,MAAO,CAAC;EAC3C;AACD;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASS,qBAAqBA,CAAEX,IAAI,EAAEC,IAAI,EAAEW,OAAO,EAAG;EAC5D,MAAM;IAAED,qBAAqB,EAAEE;EAAuB,CAAC,GAAGjB,MAAM,CAC/DD,QAAQ,CAAEG,WAAY,CACvB,CAAC;EAED,IAAKM,UAAU,CAACC,mBAAmB,EAAG;IACrCQ,sBAAsB,CAAEb,IAAI,EAAEC,IAAI,EAAEW,OAAQ,CAAC;EAC9C;AACD","ignoreList":[]}
@@ -10,7 +10,7 @@ import { doAction } from '@wordpress/hooks';
10
10
 
11
11
  import { store as editorStore } from '../../store';
12
12
  import { unlock } from '../../lock-unlock';
13
- import { viewPost, viewPostRevisions, duplicatePost, duplicatePattern, reorderPage, exportPattern, permanentlyDeletePost, restorePost, trashPost, renamePost, resetPost, deletePost } from '@wordpress/fields';
13
+ import { viewPost, viewPostRevisions, duplicatePost, duplicatePattern, reorderPage, exportPattern, permanentlyDeletePost, restorePost, trashPost, renamePost, resetPost, deletePost, featuredImageField, dateField, parentField, passwordField, commentStatusField, slugField, statusField, authorField, titleField } from '@wordpress/fields';
14
14
  import duplicateTemplatePart from '../actions/duplicate-template-part';
15
15
  export function registerEntityAction(kind, name, config) {
16
16
  return {
@@ -28,6 +28,22 @@ export function unregisterEntityAction(kind, name, actionId) {
28
28
  actionId
29
29
  };
30
30
  }
31
+ export function registerEntityField(kind, name, config) {
32
+ return {
33
+ type: 'REGISTER_ENTITY_FIELD',
34
+ kind,
35
+ name,
36
+ config
37
+ };
38
+ }
39
+ export function unregisterEntityField(kind, name, fieldId) {
40
+ return {
41
+ type: 'UNREGISTER_ENTITY_FIELD',
42
+ kind,
43
+ name,
44
+ fieldId
45
+ };
46
+ }
31
47
  export function setIsReady(kind, name) {
32
48
  return {
33
49
  type: 'SET_IS_READY',
@@ -35,7 +51,7 @@ export function setIsReady(kind, name) {
35
51
  name
36
52
  };
37
53
  }
38
- export const registerPostTypeActions = postType => async ({
54
+ export const registerPostTypeSchema = postType => async ({
39
55
  registry
40
56
  }) => {
41
57
  const isReady = unlock(registry.select(editorStore)).isEntityReady('postType', postType);
@@ -52,6 +68,7 @@ export const registerPostTypeActions = postType => async ({
52
68
  const actions = [postTypeConfig.viewable ? viewPost : undefined, !!postTypeConfig?.supports?.revisions ? viewPostRevisions : undefined,
53
69
  // @ts-ignore
54
70
  globalThis.IS_GUTENBERG_PLUGIN ? !['wp_template', 'wp_block', 'wp_template_part'].includes(postTypeConfig.slug) && canCreate && duplicatePost : undefined, postTypeConfig.slug === 'wp_template_part' && canCreate && currentTheme?.is_block_theme ? duplicateTemplatePart : undefined, canCreate && postTypeConfig.slug === 'wp_block' ? duplicatePattern : undefined, postTypeConfig.supports?.title ? renamePost : undefined, postTypeConfig?.supports?.['page-attributes'] ? reorderPage : undefined, postTypeConfig.slug === 'wp_block' ? exportPattern : undefined, restorePost, resetPost, deletePost, trashPost, permanentlyDeletePost];
71
+ const fields = [featuredImageField, titleField, authorField, statusField, dateField, slugField, parentField, commentStatusField, passwordField];
55
72
  registry.batch(() => {
56
73
  actions.forEach(action => {
57
74
  if (!action) {
@@ -59,7 +76,10 @@ export const registerPostTypeActions = postType => async ({
59
76
  }
60
77
  unlock(registry.dispatch(editorStore)).registerEntityAction('postType', postType, action);
61
78
  });
79
+ fields.forEach(field => {
80
+ unlock(registry.dispatch(editorStore)).registerEntityField('postType', postType, field);
81
+ });
62
82
  });
63
- doAction('core.registerPostTypeActions', postType);
83
+ doAction('core.registerPostTypeSchema', postType);
64
84
  };
65
85
  //# sourceMappingURL=private-actions.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["store","coreStore","doAction","editorStore","unlock","viewPost","viewPostRevisions","duplicatePost","duplicatePattern","reorderPage","exportPattern","permanentlyDeletePost","restorePost","trashPost","renamePost","resetPost","deletePost","duplicateTemplatePart","registerEntityAction","kind","name","config","type","unregisterEntityAction","actionId","setIsReady","registerPostTypeActions","postType","registry","isReady","select","isEntityReady","dispatch","postTypeConfig","resolveSelect","getPostType","canCreate","canUser","currentTheme","getCurrentTheme","actions","viewable","undefined","supports","revisions","globalThis","IS_GUTENBERG_PLUGIN","includes","slug","is_block_theme","title","batch","forEach","action"],"sources":["@wordpress/editor/src/dataviews/store/private-actions.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport type { PostType } from '../types';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n} from '@wordpress/fields';\nimport duplicateTemplatePart from '../actions/duplicate-template-part';\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\nexport const registerPostTypeActions =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig?.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tglobalThis.IS_GUTENBERG_PLUGIN\n\t\t\t\t? ! [ 'wp_template', 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\t\t\tpostTypeConfig.slug\n\t\t\t\t ) &&\n\t\t\t\t canCreate &&\n\t\t\t\t duplicatePost\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig?.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t];\n\n\t\tregistry.batch( () => {\n\t\t\tactions.forEach( ( action ) => {\n\t\t\t\tif ( ! action ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityAction(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\taction\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\n\t\tdoAction( 'core.registerPostTypeActions', postType );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAEzD,SAASC,QAAQ,QAAQ,kBAAkB;;AAE3C;AACA;AACA;;AAEA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,QAAQ,EACRC,iBAAiB,EACjBC,aAAa,EACbC,gBAAgB,EAChBC,WAAW,EACXC,aAAa,EACbC,qBAAqB,EACrBC,WAAW,EACXC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,UAAU,QACJ,mBAAmB;AAC1B,OAAOC,qBAAqB,MAAM,oCAAoC;AAEtE,OAAO,SAASC,oBAAoBA,CACnCC,IAAY,EACZC,IAAY,EACZC,MAAsB,EACrB;EACD,OAAO;IACNC,IAAI,EAAE,wBAAiC;IACvCH,IAAI;IACJC,IAAI;IACJC;EACD,CAAC;AACF;AAEA,OAAO,SAASE,sBAAsBA,CACrCJ,IAAY,EACZC,IAAY,EACZI,QAAgB,EACf;EACD,OAAO;IACNF,IAAI,EAAE,0BAAmC;IACzCH,IAAI;IACJC,IAAI;IACJI;EACD,CAAC;AACF;AAEA,OAAO,SAASC,UAAUA,CAAEN,IAAY,EAAEC,IAAY,EAAG;EACxD,OAAO;IACNE,IAAI,EAAE,cAAuB;IAC7BH,IAAI;IACJC;EACD,CAAC;AACF;AAEA,OAAO,MAAMM,uBAAuB,GACjCC,QA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SAAS,EACZT,cAAc,CAACU,QAAQ,EAAEO,KAAK,GAAGpC,UAAU,GAAG4B,SAAS,EACvDT,cAAc,EAAEU,QAAQ,GAAI,iBAAiB,CAAE,GAC5ClC,WAAW,GACXiC,SAAS,EACZT,cAAc,CAACe,IAAI,KAAK,UAAU,GAAGtC,aAAa,GAAGgC,SAAS,EAC9D9B,WAAW,EACXG,SAAS,EACTC,UAAU,EACVH,SAAS,EACTF,qBAAqB,CACrB;EAEDiB,QAAQ,CAACuB,KAAK,CAAE,MAAM;IACrBX,OAAO,CAACY,OAAO,CAAIC,MAAM,IAAM;MAC9B,IAAK,CAAEA,MAAM,EAAG;QACf;MACD;MACAjD,MAAM,CAAEwB,QAAQ,CAACI,QAAQ,CAAE7B,WAAY,CAAE,CAAC,CAACe,oBAAoB,CAC9D,UAAU,EACVS,QAAQ,EACR0B,MACD,CAAC;IACF,CAAE,CAAC;EACJ,CAAE,CAAC;EAEHnD,QAAQ,CAAE,8BAA8B,EAAEyB,QAAS,CAAC;AACrD,CAAC","ignoreList":[]}
1
+ {"version":3,"names":["store","coreStore","doAction","editorStore","unlock","viewPost","viewPostRevisions","duplicatePost","duplicatePattern","reorderPage","exportPattern","permanentlyDeletePost","restorePost","trashPost","renamePost","resetPost","deletePost","featuredImageField","dateField","parentField","passwordField","commentStatusField","slugField","statusField","authorField","titleField","duplicateTemplatePart","registerEntityAction","kind","name","config","type","unregisterEntityAction","actionId","registerEntityField","unregisterEntityField","fieldId","setIsReady","registerPostTypeSchema","postType","registry","isReady","select","isEntityReady","dispatch","postTypeConfig","resolveSelect","getPostType","canCreate","canUser","currentTheme","getCurrentTheme","actions","viewable","undefined","supports","revisions","globalThis","IS_GUTENBERG_PLUGIN","includes","slug","is_block_theme","title","fields","batch","forEach","action","field"],"sources":["@wordpress/editor/src/dataviews/store/private-actions.ts"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { store as coreStore } from '@wordpress/core-data';\nimport type { Action, Field } from '@wordpress/dataviews';\nimport { doAction } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport type { PostType } from '../types';\nimport { store as editorStore } from '../../store';\nimport { unlock } from '../../lock-unlock';\nimport {\n\tviewPost,\n\tviewPostRevisions,\n\tduplicatePost,\n\tduplicatePattern,\n\treorderPage,\n\texportPattern,\n\tpermanentlyDeletePost,\n\trestorePost,\n\ttrashPost,\n\trenamePost,\n\tresetPost,\n\tdeletePost,\n\tfeaturedImageField,\n\tdateField,\n\tparentField,\n\tpasswordField,\n\tcommentStatusField,\n\tslugField,\n\tstatusField,\n\tauthorField,\n\ttitleField,\n} from '@wordpress/fields';\nimport duplicateTemplatePart from '../actions/duplicate-template-part';\n\nexport function registerEntityAction< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Action< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityAction(\n\tkind: string,\n\tname: string,\n\tactionId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_ACTION' as const,\n\t\tkind,\n\t\tname,\n\t\tactionId,\n\t};\n}\n\nexport function registerEntityField< Item >(\n\tkind: string,\n\tname: string,\n\tconfig: Field< Item >\n) {\n\treturn {\n\t\ttype: 'REGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tconfig,\n\t};\n}\n\nexport function unregisterEntityField(\n\tkind: string,\n\tname: string,\n\tfieldId: string\n) {\n\treturn {\n\t\ttype: 'UNREGISTER_ENTITY_FIELD' as const,\n\t\tkind,\n\t\tname,\n\t\tfieldId,\n\t};\n}\n\nexport function setIsReady( kind: string, name: string ) {\n\treturn {\n\t\ttype: 'SET_IS_READY' as const,\n\t\tkind,\n\t\tname,\n\t};\n}\n\nexport const registerPostTypeSchema =\n\t( postType: string ) =>\n\tasync ( { registry }: { registry: any } ) => {\n\t\tconst isReady = unlock( registry.select( editorStore ) ).isEntityReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\t\tif ( isReady ) {\n\t\t\treturn;\n\t\t}\n\n\t\tunlock( registry.dispatch( editorStore ) ).setIsReady(\n\t\t\t'postType',\n\t\t\tpostType\n\t\t);\n\n\t\tconst postTypeConfig = ( await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getPostType( postType ) ) as PostType;\n\n\t\tconst canCreate = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.canUser( 'create', {\n\t\t\t\tkind: 'postType',\n\t\t\t\tname: postType,\n\t\t\t} );\n\t\tconst currentTheme = await registry\n\t\t\t.resolveSelect( coreStore )\n\t\t\t.getCurrentTheme();\n\n\t\tconst actions = [\n\t\t\tpostTypeConfig.viewable ? viewPost : undefined,\n\t\t\t!! postTypeConfig?.supports?.revisions\n\t\t\t\t? viewPostRevisions\n\t\t\t\t: undefined,\n\t\t\t// @ts-ignore\n\t\t\tglobalThis.IS_GUTENBERG_PLUGIN\n\t\t\t\t? ! [ 'wp_template', 'wp_block', 'wp_template_part' ].includes(\n\t\t\t\t\t\tpostTypeConfig.slug\n\t\t\t\t ) &&\n\t\t\t\t canCreate &&\n\t\t\t\t duplicatePost\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_template_part' &&\n\t\t\tcanCreate &&\n\t\t\tcurrentTheme?.is_block_theme\n\t\t\t\t? duplicateTemplatePart\n\t\t\t\t: undefined,\n\t\t\tcanCreate && postTypeConfig.slug === 'wp_block'\n\t\t\t\t? duplicatePattern\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.supports?.title ? renamePost : undefined,\n\t\t\tpostTypeConfig?.supports?.[ 'page-attributes' ]\n\t\t\t\t? reorderPage\n\t\t\t\t: undefined,\n\t\t\tpostTypeConfig.slug === 'wp_block' ? exportPattern : undefined,\n\t\t\trestorePost,\n\t\t\tresetPost,\n\t\t\tdeletePost,\n\t\t\ttrashPost,\n\t\t\tpermanentlyDeletePost,\n\t\t];\n\n\t\tconst fields = [\n\t\t\tfeaturedImageField,\n\t\t\ttitleField,\n\t\t\tauthorField,\n\t\t\tstatusField,\n\t\t\tdateField,\n\t\t\tslugField,\n\t\t\tparentField,\n\t\t\tcommentStatusField,\n\t\t\tpasswordField,\n\t\t];\n\n\t\tregistry.batch( () => {\n\t\t\tactions.forEach( ( action ) => {\n\t\t\t\tif ( ! action ) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityAction(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\taction\n\t\t\t\t);\n\t\t\t} );\n\t\t\tfields.forEach( ( field ) => {\n\t\t\t\tunlock( registry.dispatch( editorStore ) ).registerEntityField(\n\t\t\t\t\t'postType',\n\t\t\t\t\tpostType,\n\t\t\t\t\tfield\n\t\t\t\t);\n\t\t\t} );\n\t\t} );\n\n\t\tdoAction( 'core.registerPostTypeSchema', postType );\n\t};\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,KAAK,IAAIC,SAAS,QAAQ,sBAAsB;AAEzD,SAASC,QAAQ,QAAQ,kBAAkB;;AAE3C;AACA;AACA;;AAEA,SAASF,KAAK,IAAIG,WAAW,QAAQ,aAAa;AAClD,SAASC,MAAM,QAAQ,mBAAmB;AAC1C,SACCC,QAAQ,EACRC,iBAAiB,EACjBC,aAAa,EACbC,gBAAgB,EAChBC,WAAW,EACXC,aAAa,EACbC,qBAAqB,EACrBC,WAAW,EACXC,SAAS,EACTC,UAAU,EACVC,SAAS,EACTC,UAAU,EACVC,kBAAkB,EAClBC,SAAS,EACTC,WAAW,EACXC,aAAa,EACbC,kBAAkB,EAClBC,SAAS,EACTC,WAAW,EACXC,WAAW,EACXC,UAAU,QACJ,mBAAmB;AAC1B,OAAOC,qBAAqB,MAAM,oCAAoC;AAEtE,OAAO,SAASC,oBAAoBA,CACnCC,IAAY,EACZC,IAAY,EACZC,MAAsB,EACrB;EACD,OAAO;IACNC,IAAI,EAAE,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AM,EAAG;QACf;MACD;MACA9D,MAAM,CAAEoC,QAAQ,CAACI,QAAQ,CAAEzC,WAAY,CAAE,CAAC,CAACwB,oBAAoB,CAC9D,UAAU,EACVY,QAAQ,EACR2B,MACD,CAAC;IACF,CAAE,CAAC;IACHH,MAAM,CAACE,OAAO,CAAIE,KAAK,IAAM;MAC5B/D,MAAM,CAAEoC,QAAQ,CAACI,QAAQ,CAAEzC,WAAY,CAAE,CAAC,CAAC+B,mBAAmB,CAC7D,UAAU,EACVK,QAAQ,EACR4B,KACD,CAAC;IACF,CAAE,CAAC;EACJ,CAAE,CAAC;EAEHjE,QAAQ,CAAE,6BAA6B,EAAEqC,QAAS,CAAC;AACpD,CAAC","ignoreList":[]}
@@ -7,6 +7,10 @@ export function getEntityActions(state, kind, name) {
7
7
  var _state$actions$kind$n;
8
8
  return (_state$actions$kind$n = state.actions[kind]?.[name]) !== null && _state$actions$kind$n !== void 0 ? _state$actions$kind$n : EMPTY_ARRAY;
9
9
  }
10
+ export function getEntityFields(state, kind, name) {
11
+ var _state$fields$kind$na;
12
+ return (_state$fields$kind$na = state.fields[kind]?.[name]) !== null && _state$fields$kind$na !== void 0 ? _state$fields$kind$na : EMPTY_ARRAY;
13
+ }
10
14
  export function isEntityReady(state, kind, name) {
11
15
  return state.isReady[kind]?.[name];
12
16
  }