@wordpress/editor 14.7.1-next.5368f64a9.0 → 14.8.1

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 (241) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/README.md +1 -1
  3. package/build/bindings/post-meta.js +42 -7
  4. package/build/bindings/post-meta.js.map +1 -1
  5. package/build/components/block-manager/index.js +45 -66
  6. package/build/components/block-manager/index.js.map +1 -1
  7. package/build/components/document-bar/index.js +20 -28
  8. package/build/components/document-bar/index.js.map +1 -1
  9. package/build/components/editor-history/redo.js +2 -4
  10. package/build/components/editor-history/redo.js.map +1 -1
  11. package/build/components/editor-history/undo.js +2 -4
  12. package/build/components/editor-history/undo.js.map +1 -1
  13. package/build/components/editor-interface/index.js +1 -2
  14. package/build/components/editor-interface/index.js.map +1 -1
  15. package/build/components/error-boundary/index.js +2 -4
  16. package/build/components/error-boundary/index.js.map +1 -1
  17. package/build/components/global-styles-provider/index.js +21 -12
  18. package/build/components/global-styles-provider/index.js.map +1 -1
  19. package/build/components/header/index.js +4 -4
  20. package/build/components/header/index.js.map +1 -1
  21. package/build/components/media-categories/index.js +1 -0
  22. package/build/components/media-categories/index.js.map +1 -1
  23. package/build/components/post-excerpt/panel.js +2 -5
  24. package/build/components/post-excerpt/panel.js.map +1 -1
  25. package/build/components/post-featured-image/index.js +6 -12
  26. package/build/components/post-featured-image/index.js.map +1 -1
  27. package/build/components/post-format/index.js +2 -4
  28. package/build/components/post-format/index.js.map +1 -1
  29. package/build/components/post-last-revision/index.js +2 -4
  30. package/build/components/post-last-revision/index.js.map +1 -1
  31. package/build/components/post-locked-modal/index.js +4 -8
  32. package/build/components/post-locked-modal/index.js.map +1 -1
  33. package/build/components/post-publish-panel/index.js +2 -4
  34. package/build/components/post-publish-panel/index.js.map +1 -1
  35. package/build/components/post-publish-panel/maybe-post-format-panel.js +2 -4
  36. package/build/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  37. package/build/components/post-publish-panel/maybe-upload-media.js +2 -4
  38. package/build/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  39. package/build/components/post-status/index.js +1 -0
  40. package/build/components/post-status/index.js.map +1 -1
  41. package/build/components/post-taxonomies/hierarchical-term-selector.js +2 -4
  42. package/build/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  43. package/build/components/post-taxonomies/most-used-terms.js +2 -4
  44. package/build/components/post-taxonomies/most-used-terms.js.map +1 -1
  45. package/build/components/post-url/index.js +8 -7
  46. package/build/components/post-url/index.js.map +1 -1
  47. package/build/components/preview-dropdown/index.js +5 -57
  48. package/build/components/preview-dropdown/index.js.map +1 -1
  49. package/build/components/save-publish-panels/index.js +4 -10
  50. package/build/components/save-publish-panels/index.js.map +1 -1
  51. package/build/components/zoom-out-toggle/index.js +38 -0
  52. package/build/components/zoom-out-toggle/index.js.map +1 -0
  53. package/build/dataviews/store/private-actions.js +4 -10
  54. package/build/dataviews/store/private-actions.js.map +1 -1
  55. package/build-module/bindings/post-meta.js +40 -7
  56. package/build-module/bindings/post-meta.js.map +1 -1
  57. package/build-module/components/block-manager/index.js +46 -67
  58. package/build-module/components/block-manager/index.js.map +1 -1
  59. package/build-module/components/document-bar/index.js +22 -28
  60. package/build-module/components/document-bar/index.js.map +1 -1
  61. package/build-module/components/editor-history/redo.js +2 -4
  62. package/build-module/components/editor-history/redo.js.map +1 -1
  63. package/build-module/components/editor-history/undo.js +2 -4
  64. package/build-module/components/editor-history/undo.js.map +1 -1
  65. package/build-module/components/editor-interface/index.js +1 -2
  66. package/build-module/components/editor-interface/index.js.map +1 -1
  67. package/build-module/components/error-boundary/index.js +2 -4
  68. package/build-module/components/error-boundary/index.js.map +1 -1
  69. package/build-module/components/global-styles-provider/index.js +21 -12
  70. package/build-module/components/global-styles-provider/index.js.map +1 -1
  71. package/build-module/components/header/index.js +4 -4
  72. package/build-module/components/header/index.js.map +1 -1
  73. package/build-module/components/media-categories/index.js +1 -0
  74. package/build-module/components/media-categories/index.js.map +1 -1
  75. package/build-module/components/post-excerpt/panel.js +2 -5
  76. package/build-module/components/post-excerpt/panel.js.map +1 -1
  77. package/build-module/components/post-featured-image/index.js +6 -12
  78. package/build-module/components/post-featured-image/index.js.map +1 -1
  79. package/build-module/components/post-format/index.js +2 -4
  80. package/build-module/components/post-format/index.js.map +1 -1
  81. package/build-module/components/post-last-revision/index.js +2 -4
  82. package/build-module/components/post-last-revision/index.js.map +1 -1
  83. package/build-module/components/post-locked-modal/index.js +4 -8
  84. package/build-module/components/post-locked-modal/index.js.map +1 -1
  85. package/build-module/components/post-publish-panel/index.js +2 -4
  86. package/build-module/components/post-publish-panel/index.js.map +1 -1
  87. package/build-module/components/post-publish-panel/maybe-post-format-panel.js +2 -4
  88. package/build-module/components/post-publish-panel/maybe-post-format-panel.js.map +1 -1
  89. package/build-module/components/post-publish-panel/maybe-upload-media.js +2 -4
  90. package/build-module/components/post-publish-panel/maybe-upload-media.js.map +1 -1
  91. package/build-module/components/post-status/index.js +1 -0
  92. package/build-module/components/post-status/index.js.map +1 -1
  93. package/build-module/components/post-taxonomies/hierarchical-term-selector.js +2 -4
  94. package/build-module/components/post-taxonomies/hierarchical-term-selector.js.map +1 -1
  95. package/build-module/components/post-taxonomies/most-used-terms.js +2 -4
  96. package/build-module/components/post-taxonomies/most-used-terms.js.map +1 -1
  97. package/build-module/components/post-url/index.js +9 -8
  98. package/build-module/components/post-url/index.js.map +1 -1
  99. package/build-module/components/preview-dropdown/index.js +5 -57
  100. package/build-module/components/preview-dropdown/index.js.map +1 -1
  101. package/build-module/components/save-publish-panels/index.js +4 -10
  102. package/build-module/components/save-publish-panels/index.js.map +1 -1
  103. package/build-module/components/zoom-out-toggle/index.js +31 -0
  104. package/build-module/components/zoom-out-toggle/index.js.map +1 -0
  105. package/build-module/dataviews/store/private-actions.js +2 -8
  106. package/build-module/dataviews/store/private-actions.js.map +1 -1
  107. package/build-style/style-rtl.css +38 -23
  108. package/build-style/style.css +38 -23
  109. package/build-types/bindings/post-meta.d.ts +4 -1
  110. package/build-types/bindings/post-meta.d.ts.map +1 -1
  111. package/build-types/components/block-manager/index.d.ts +1 -2
  112. package/build-types/components/block-manager/index.d.ts.map +1 -1
  113. package/build-types/components/document-bar/index.d.ts +7 -6
  114. package/build-types/components/document-bar/index.d.ts.map +1 -1
  115. package/build-types/components/editor-history/redo.d.ts.map +1 -1
  116. package/build-types/components/editor-history/undo.d.ts.map +1 -1
  117. package/build-types/components/editor-interface/index.d.ts +1 -2
  118. package/build-types/components/editor-interface/index.d.ts.map +1 -1
  119. package/build-types/components/error-boundary/index.d.ts.map +1 -1
  120. package/build-types/components/global-styles-provider/index.d.ts.map +1 -1
  121. package/build-types/components/header/index.d.ts +2 -2
  122. package/build-types/components/header/index.d.ts.map +1 -1
  123. package/build-types/components/post-format/index.d.ts.map +1 -1
  124. package/build-types/components/post-last-revision/index.d.ts.map +1 -1
  125. package/build-types/components/post-locked-modal/index.d.ts.map +1 -1
  126. package/build-types/components/post-publish-panel/index.d.ts.map +1 -1
  127. package/build-types/components/post-publish-panel/maybe-post-format-panel.d.ts.map +1 -1
  128. package/build-types/components/post-publish-panel/maybe-upload-media.d.ts.map +1 -1
  129. package/build-types/components/post-status/index.d.ts.map +1 -1
  130. package/build-types/components/post-taxonomies/hierarchical-term-selector.d.ts.map +1 -1
  131. package/build-types/components/post-taxonomies/most-used-terms.d.ts.map +1 -1
  132. package/build-types/components/post-url/index.d.ts.map +1 -1
  133. package/build-types/components/preview-dropdown/index.d.ts.map +1 -1
  134. package/build-types/components/save-publish-panels/index.d.ts.map +1 -1
  135. package/build-types/components/zoom-out-toggle/index.d.ts +3 -0
  136. package/build-types/components/zoom-out-toggle/index.d.ts.map +1 -0
  137. package/build-types/dataviews/store/private-actions.d.ts.map +1 -1
  138. package/package.json +37 -36
  139. package/src/bindings/post-meta.js +56 -20
  140. package/src/components/block-manager/index.js +50 -67
  141. package/src/components/document-bar/index.js +29 -41
  142. package/src/components/document-bar/style.scss +33 -15
  143. package/src/components/editor-history/redo.js +1 -2
  144. package/src/components/editor-history/undo.js +1 -2
  145. package/src/components/editor-interface/index.js +1 -2
  146. package/src/components/error-boundary/index.js +1 -6
  147. package/src/components/global-styles-provider/index.js +50 -36
  148. package/src/components/header/index.js +8 -2
  149. package/src/components/post-excerpt/panel.js +1 -3
  150. package/src/components/post-featured-image/index.js +3 -6
  151. package/src/components/post-featured-image/style.scss +1 -5
  152. package/src/components/post-format/index.js +1 -2
  153. package/src/components/post-last-revision/index.js +1 -2
  154. package/src/components/post-locked-modal/index.js +2 -4
  155. package/src/components/post-panel-row/style.scss +1 -0
  156. package/src/components/post-publish-panel/index.js +1 -2
  157. package/src/components/post-publish-panel/maybe-post-format-panel.js +1 -2
  158. package/src/components/post-publish-panel/maybe-upload-media.js +1 -2
  159. package/src/components/post-publish-panel/test/__snapshots__/index.js.snap +2 -2
  160. package/src/components/post-status/index.js +1 -0
  161. package/src/components/post-status/style.scss +5 -0
  162. package/src/components/post-taxonomies/hierarchical-term-selector.js +1 -2
  163. package/src/components/post-taxonomies/most-used-terms.js +1 -2
  164. package/src/components/post-taxonomies/style.scss +0 -4
  165. package/src/components/post-url/index.js +9 -7
  166. package/src/components/preview-dropdown/index.js +26 -84
  167. package/src/components/save-publish-panels/index.js +2 -6
  168. package/src/components/zoom-out-toggle/index.js +34 -0
  169. package/src/dataviews/store/private-actions.ts +10 -8
  170. package/tsconfig.json +1 -0
  171. package/tsconfig.tsbuildinfo +1 -1
  172. package/build/dataviews/actions/duplicate-pattern.js +0 -48
  173. package/build/dataviews/actions/duplicate-pattern.js.map +0 -1
  174. package/build/dataviews/actions/duplicate-post.js +0 -146
  175. package/build/dataviews/actions/duplicate-post.js.map +0 -1
  176. package/build/dataviews/actions/duplicate-post.native.js +0 -9
  177. package/build/dataviews/actions/duplicate-post.native.js.map +0 -1
  178. package/build/dataviews/actions/export-pattern.js +0 -57
  179. package/build/dataviews/actions/export-pattern.js.map +0 -1
  180. package/build/dataviews/actions/export-pattern.native.js +0 -9
  181. package/build/dataviews/actions/export-pattern.native.js.map +0 -1
  182. package/build/dataviews/actions/permanently-delete-post.js +0 -109
  183. package/build/dataviews/actions/permanently-delete-post.js.map +0 -1
  184. package/build/dataviews/actions/reorder-page.js +0 -116
  185. package/build/dataviews/actions/reorder-page.js.map +0 -1
  186. package/build/dataviews/actions/reorder-page.native.js +0 -9
  187. package/build/dataviews/actions/reorder-page.native.js.map +0 -1
  188. package/build/dataviews/actions/view-post-revisions.js +0 -49
  189. package/build/dataviews/actions/view-post-revisions.js.map +0 -1
  190. package/build/dataviews/actions/view-post.js +0 -36
  191. package/build/dataviews/actions/view-post.js.map +0 -1
  192. package/build-module/dataviews/actions/duplicate-pattern.js +0 -39
  193. package/build-module/dataviews/actions/duplicate-pattern.js.map +0 -1
  194. package/build-module/dataviews/actions/duplicate-post.js +0 -139
  195. package/build-module/dataviews/actions/duplicate-post.js.map +0 -1
  196. package/build-module/dataviews/actions/duplicate-post.native.js +0 -3
  197. package/build-module/dataviews/actions/duplicate-post.native.js.map +0 -1
  198. package/build-module/dataviews/actions/export-pattern.js +0 -51
  199. package/build-module/dataviews/actions/export-pattern.js.map +0 -1
  200. package/build-module/dataviews/actions/export-pattern.native.js +0 -3
  201. package/build-module/dataviews/actions/export-pattern.native.js.map +0 -1
  202. package/build-module/dataviews/actions/permanently-delete-post.js +0 -102
  203. package/build-module/dataviews/actions/permanently-delete-post.js.map +0 -1
  204. package/build-module/dataviews/actions/reorder-page.js +0 -111
  205. package/build-module/dataviews/actions/reorder-page.js.map +0 -1
  206. package/build-module/dataviews/actions/reorder-page.native.js +0 -3
  207. package/build-module/dataviews/actions/reorder-page.native.js.map +0 -1
  208. package/build-module/dataviews/actions/view-post-revisions.js +0 -43
  209. package/build-module/dataviews/actions/view-post-revisions.js.map +0 -1
  210. package/build-module/dataviews/actions/view-post.js +0 -30
  211. package/build-module/dataviews/actions/view-post.js.map +0 -1
  212. package/build-types/dataviews/actions/duplicate-pattern.d.ts +0 -5
  213. package/build-types/dataviews/actions/duplicate-pattern.d.ts.map +0 -1
  214. package/build-types/dataviews/actions/duplicate-post.d.ts +0 -5
  215. package/build-types/dataviews/actions/duplicate-post.d.ts.map +0 -1
  216. package/build-types/dataviews/actions/duplicate-post.native.d.ts +0 -3
  217. package/build-types/dataviews/actions/duplicate-post.native.d.ts.map +0 -1
  218. package/build-types/dataviews/actions/export-pattern.d.ts +0 -8
  219. package/build-types/dataviews/actions/export-pattern.d.ts.map +0 -1
  220. package/build-types/dataviews/actions/export-pattern.native.d.ts +0 -3
  221. package/build-types/dataviews/actions/export-pattern.native.d.ts.map +0 -1
  222. package/build-types/dataviews/actions/permanently-delete-post.d.ts +0 -5
  223. package/build-types/dataviews/actions/permanently-delete-post.d.ts.map +0 -1
  224. package/build-types/dataviews/actions/reorder-page.d.ts +0 -8
  225. package/build-types/dataviews/actions/reorder-page.d.ts.map +0 -1
  226. package/build-types/dataviews/actions/reorder-page.native.d.ts +0 -3
  227. package/build-types/dataviews/actions/reorder-page.native.d.ts.map +0 -1
  228. package/build-types/dataviews/actions/view-post-revisions.d.ts +0 -8
  229. package/build-types/dataviews/actions/view-post-revisions.d.ts.map +0 -1
  230. package/build-types/dataviews/actions/view-post.d.ts +0 -8
  231. package/build-types/dataviews/actions/view-post.d.ts.map +0 -1
  232. package/src/dataviews/actions/duplicate-pattern.tsx +0 -40
  233. package/src/dataviews/actions/duplicate-post.native.tsx +0 -3
  234. package/src/dataviews/actions/duplicate-post.tsx +0 -174
  235. package/src/dataviews/actions/export-pattern.native.tsx +0 -3
  236. package/src/dataviews/actions/export-pattern.tsx +0 -76
  237. package/src/dataviews/actions/permanently-delete-post.tsx +0 -118
  238. package/src/dataviews/actions/reorder-page.native.tsx +0 -3
  239. package/src/dataviews/actions/reorder-page.tsx +0 -125
  240. package/src/dataviews/actions/view-post-revisions.tsx +0 -47
  241. package/src/dataviews/actions/view-post.tsx +0 -30
@@ -7,16 +7,17 @@
7
7
  * ```jsx
8
8
  * <DocumentBar />
9
9
  * ```
10
- * @param {Object} props The component props.
11
- * @param {string} props.title A title for the document, defaulting to the document or
12
- * template title currently being edited.
13
- * @param {import("@wordpress/components").IconType} props.icon An icon for the document, defaulting to an icon for document
14
- * or template currently being edited.
10
+ * @param {Object} props The component props.
11
+ * @param {string} props.title A title for the document, defaulting to the document or
12
+ * template title currently being edited.
13
+ * @param {IconType} props.icon An icon for the document, no default.
14
+ * (A default icon indicating the document post type is no longer used.)
15
15
  *
16
16
  * @return {JSX.Element} The rendered DocumentBar component.
17
17
  */
18
18
  export default function DocumentBar(props: {
19
19
  title: string;
20
- icon: import("@wordpress/components").IconType;
20
+ icon: IconType;
21
21
  }): JSX.Element;
22
+ export type IconType = import("@wordpress/components").IconType;
22
23
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/document-bar/index.js"],"names":[],"mappings":"AA6CA;;;;;;;;;;;;;;;;GAgBG;AACH,2CAPG;IAAwD,KAAK,EAArD,MAAM;IAE0C,IAAI,EAApD,OAAO,uBAAuB,EAAE,QAAQ;CAGhD,GAAS,GAAG,CAAC,OAAO,CAwJtB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/document-bar/index.js"],"names":[],"mappings":"AAmCA;;;;;;;;;;;;;;;;GAgBG;AACH,2CAPG;IAAwB,KAAK,EAArB,MAAM;IAEU,IAAI,EAApB,QAAQ;CAGhB,GAAS,GAAG,CAAC,OAAO,CAsJtB;uBAzKa,OAAO,uBAAuB,EAAE,QAAQ"}
@@ -1 +1 @@
1
- {"version":3,"file":"redo.d.ts","sourceRoot":"","sources":["../../../src/components/editor-history/redo.js"],"names":[],"mappings":";;kBA6Cc,OAAO,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC"}
1
+ {"version":3,"file":"redo.d.ts","sourceRoot":"","sources":["../../../src/components/editor-history/redo.js"],"names":[],"mappings":";;kBA4Cc,OAAO,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../../src/components/editor-history/undo.js"],"names":[],"mappings":";;kBAyCc,OAAO,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC"}
1
+ {"version":3,"file":"undo.d.ts","sourceRoot":"","sources":["../../../src/components/editor-history/undo.js"],"names":[],"mappings":";;kBAwCc,OAAO,OAAO,EAAE,GAAG,CAAC,WAAW,CAAC"}
@@ -1,4 +1,4 @@
1
- export default function EditorInterface({ className, enableRegionNavigation, styles, children, forceIsDirty, contentRef, disableIframe, autoFocus, customSaveButton, customSavePanel, forceDisableBlockTools, title, icon, iframeProps, }: {
1
+ export default function EditorInterface({ className, enableRegionNavigation, styles, children, forceIsDirty, contentRef, disableIframe, autoFocus, customSaveButton, customSavePanel, forceDisableBlockTools, title, iframeProps, }: {
2
2
  className: any;
3
3
  enableRegionNavigation: any;
4
4
  styles: any;
@@ -11,7 +11,6 @@ export default function EditorInterface({ className, enableRegionNavigation, sty
11
11
  customSavePanel: any;
12
12
  forceDisableBlockTools: any;
13
13
  title: any;
14
- icon: any;
15
14
  iframeProps: any;
16
15
  }): import("react").JSX.Element;
17
16
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/editor-interface/index.js"],"names":[],"mappings":"AA+CA;;;;;;;;;;;;;;;gCA+LC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/editor-interface/index.js"],"names":[],"mappings":"AA+CA;;;;;;;;;;;;;;gCA8LC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error-boundary/index.js"],"names":[],"mappings":";AA0CA;IAaC;;MAEC;IAdD,4BAMC;IAHA;;MAEC;IAGF,oCAEC;IAMD,cAoBC;CACD;0BA7EyB,oBAAoB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/error-boundary/index.js"],"names":[],"mappings":";AAqCA;IAaC;;MAEC;IAdD,4BAMC;IAHA;;MAEC;IAGF,oCAEC;IAMD,cAoBC;CACD;0BAxEyB,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/global-styles-provider/index.js"],"names":[],"mappings":"AAuBA,mEAoBC;AAyHD;;;;;;4BA1Da,WAAS,MAAM,YAEf,MAAM;;;;;;;4BAFN,WAAS,MAAM,YAEf,MAAM;EAuFlB;AAED;;uCAWC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/global-styles-provider/index.js"],"names":[],"mappings":"AAuBA,mEAoBC;AAuID;;;;;;4BAjDa,WAAS,MAAM,YAEf,MAAM;;;;;;;4BAFN,WAAS,MAAM,YAEf,MAAM;EA8ElB;AAED;;uCAWC"}
@@ -1,10 +1,10 @@
1
1
  export default Header;
2
- declare function Header({ customSaveButton, forceIsDirty, forceDisableBlockTools, setEntitiesSavedStatesCallback, title, icon, }: {
2
+ declare function Header({ customSaveButton, forceIsDirty, forceDisableBlockTools, setEntitiesSavedStatesCallback, title, isEditorIframed, }: {
3
3
  customSaveButton: any;
4
4
  forceIsDirty: any;
5
5
  forceDisableBlockTools: any;
6
6
  setEntitiesSavedStatesCallback: any;
7
7
  title: any;
8
- icon: any;
8
+ isEditorIframed: any;
9
9
  }): import("react").JSX.Element;
10
10
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/header/index.js"],"names":[],"mappings":";AA0CA;;;;;;;gCAsHC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/header/index.js"],"names":[],"mappings":";AA2CA;;;;;;;gCA2HC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-format/index.js"],"names":[],"mappings":"AAwCA;;;;;;;;;GASG;AACH,sCAFY,GAAG,CAAC,OAAO,CAwEtB;AAxGD;;;IAsBI"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-format/index.js"],"names":[],"mappings":"AAwCA;;;;;;;;;GASG;AACH,sCAFY,GAAG,CAAC,OAAO,CAuEtB;AAvGD;;;IAsBI"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-last-revision/index.js"],"names":[],"mappings":"AAwDA,uEAiBC;;AA9CD;;;;GAIG;AACH,qCAFY,SAAS,CAwBpB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-last-revision/index.js"],"names":[],"mappings":"AAuDA,uEAiBC;;AA7CD;;;;GAIG;AACH,qCAFY,SAAS,CAuBpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-locked-modal/index.js"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,2CAFY,GAAG,CAAC,OAAO,GAAC,IAAI,CA8P3B"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-locked-modal/index.js"],"names":[],"mappings":"AAsBA;;;;;GAKG;AACH,2CAFY,GAAG,CAAC,OAAO,GAAC,IAAI,CA4P3B"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/index.js"],"names":[],"mappings":"AAyBA;IACC,4BAGC;IAcD,iBAKC;IAjBD,yCAUC;IASD,sCAkFC;CACD;;;0BAjIyB,oBAAoB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/index.js"],"names":[],"mappings":"AAyBA;IACC,4BAGC;IAcD,iBAKC;IAjBD,yCAUC;IASD,sCAiFC;CACD;;;0BAhIyB,oBAAoB"}
@@ -1 +1 @@
1
- {"version":3,"file":"maybe-post-format-panel.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-post-format-panel.js"],"names":[],"mappings":"AAoCA,8EAkDC"}
1
+ {"version":3,"file":"maybe-post-format-panel.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-post-format-panel.js"],"names":[],"mappings":"AAmCA,8EAkDC"}
@@ -1 +1 @@
1
- {"version":3,"file":"maybe-upload-media.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-upload-media.js"],"names":[],"mappings":"AA+GA,oFA+JC"}
1
+ {"version":3,"file":"maybe-upload-media.d.ts","sourceRoot":"","sources":["../../../src/components/post-publish-panel/maybe-upload-media.js"],"names":[],"mappings":"AA+GA,oFA8JC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-status/index.js"],"names":[],"mappings":"AAmFA,yEAiMC;AApOD;;;;IA0BE"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-status/index.js"],"names":[],"mappings":"AAmFA,yEAkMC;AArOD;;;;IA0BE"}
@@ -1 +1 @@
1
- {"version":3,"file":"hierarchical-term-selector.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/hierarchical-term-selector.js"],"names":[],"mappings":"AA2CA;;;;;;;GAOG;AACH,0CALW,MAAM,EAAE,SACR,MAAM,EAAE,GAEP,MAAM,EAAE,CAqCnB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,EAAE,UACR,MAAM,GAAC,MAAM,QACb,MAAM,GACL,MAAM,CAUjB;AAED;;;;;GAKG;AACH,8CAHW,MAAM,GACL,CAAC,CAAS,IAAM,EAAN,MAAM,KAAG,CAAC,MAAM,GAAC,OAAO,CAAC,CAAC,CAmC/C;AAED;;;;;;GAMG;AACH,mDAHG;IAAsB,IAAI,EAAlB,MAAM;CACd,GAAS,OAAO,CAuUlB;;;;;;;yBA1ae,OAAO;;wJASC,CAAC;4BAGS,CAAC;;;;kCAIJ,OAAO;;6BAIJ,CAAC;yBASjC,CAAC,iCAC6B,OAChC;+BACQ,CAAA;0BAMyB,CAAA,2DAE3B,CAAC;0BACJ,CAAC;iCAEM,CAAC;iCACP,CAAC;wCAGS,CAAA;2BACsB,CAAC;kCASpC,CAAD;;;;;yBAI0B,OACxB;;wJAOW,CAAC;4BACX,CAAC;;;;kCAIuB,OAAO;;6BAGiB,CAAC;yBAG7C,CAAC,iCACuB,OAAO;+BACjB,CAAC;0BAKmC,CAAC,2DAEtD,CAAC;0BAEoB,CAAC;iCAMzB,CAAD;iCAA2C,CAAC;wCAED,CAAC;2BAES,CAAA;kCAInD,CAAC;;yBAGgB,OAAO"}
1
+ {"version":3,"file":"hierarchical-term-selector.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/hierarchical-term-selector.js"],"names":[],"mappings":"AA2CA;;;;;;;GAOG;AACH,0CALW,MAAM,EAAE,SACR,MAAM,EAAE,GAEP,MAAM,EAAE,CAqCnB;AAED;;;;;;;GAOG;AACH,gCALW,MAAM,EAAE,UACR,MAAM,GAAC,MAAM,QACb,MAAM,GACL,MAAM,CAUjB;AAED;;;;;GAKG;AACH,8CAHW,MAAM,GACL,CAAC,CAAS,IAAM,EAAN,MAAM,KAAG,CAAC,MAAM,GAAC,OAAO,CAAC,CAAC,CAmC/C;AAED;;;;;;GAMG;AACH,mDAHG;IAAsB,IAAI,EAAlB,MAAM;CACd,GAAS,OAAO,CAsUlB;;;;;;;yBAzae,OAAO;;wJASC,CAAC;4BAGS,CAAC;;;;kCAIJ,OAAO;;6BAIJ,CAAC;yBASjC,CAAC,iCAC6B,OAChC;+BACQ,CAAA;0BAMyB,CAAA,2DAE3B,CAAC;0BACJ,CAAC;iCAEM,CAAC;iCACP,CAAC;wCAGS,CAAA;2BACsB,CAAC;kCASpC,CAAD;;;;;yBAI0B,OACxB;;wJAOW,CAAC;4BACX,CAAC;;;;kCAIuB,OAAO;;6BAGiB,CAAC;yBAG7C,CAAC,iCACuB,OAAO;+BACjB,CAAC;0BAKmC,CAAC,2DAEtD,CAAC;0BAEoB,CAAC;iCAMzB,CAAD;iCAA2C,CAAC;wCAED,CAAC;2BAES,CAAA;kCAInD,CAAC;;yBAGgB,OAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"most-used-terms.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/most-used-terms.js"],"names":[],"mappings":"AAsBA;;;uCAuDC"}
1
+ {"version":3,"file":"most-used-terms.d.ts","sourceRoot":"","sources":["../../../src/components/post-taxonomies/most-used-terms.js"],"names":[],"mappings":"AAsBA;;;uCAsDC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-url/index.js"],"names":[],"mappings":"AAyBA;;;;;;;;;;;GAWG;AACH,wDAFY,SAAS,CAmJpB"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/post-url/index.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;GAWG;AACH,wDAFY,SAAS,CAoJpB"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/preview-dropdown/index.js"],"names":[],"mappings":"AAgCA;;;uCA4LC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/preview-dropdown/index.js"],"names":[],"mappings":"AA8BA;;;uCAoIC"}
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/save-publish-panels/index.js"],"names":[],"mappings":"AAqBA;;;;;gCA6FC;AA/FD;kHAoBmB,OACf;;EArBiC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/save-publish-panels/index.js"],"names":[],"mappings":"AAqBA;;;;;gCAyFC;AA3FD;kHAoBmB,OACf;;EArBiC"}
@@ -0,0 +1,3 @@
1
+ export default ZoomOutToggle;
2
+ declare function ZoomOutToggle(): import("react").JSX.Element;
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/components/zoom-out-toggle/index.js"],"names":[],"mappings":";AAUA,8DAqBC"}
@@ -1 +1 @@
1
- {"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAuBnD,wBAAgB,oBAAoB,CAAE,IAAI,EACzC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAE,IAAI,CAAE;;;;;EAQtB;AAED,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM;;;;;EAQhB;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;EAMrD;AAED,eAAO,MAAM,uBAAuB,aACvB,MAAM,oBACI;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,kBA2EtC,CAAC"}
1
+ {"version":3,"file":"private-actions.d.ts","sourceRoot":"","sources":["../../../src/dataviews/store/private-actions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAyBnD,wBAAgB,oBAAoB,CAAE,IAAI,EACzC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,CAAE,IAAI,CAAE;;;;;EAQtB;AAED,wBAAgB,sBAAsB,CACrC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,EACZ,QAAQ,EAAE,MAAM;;;;;EAQhB;AAED,wBAAgB,UAAU,CAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;;;;EAMrD;AAED,eAAO,MAAM,uBAAuB,aACvB,MAAM,oBACI;IAAE,QAAQ,EAAE,GAAG,CAAA;CAAE,kBA2EtC,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/editor",
3
- "version": "14.7.1-next.5368f64a9.0",
3
+ "version": "14.8.1",
4
4
  "description": "Enhanced block editor for WordPress posts.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -32,40 +32,41 @@
32
32
  ],
33
33
  "dependencies": {
34
34
  "@babel/runtime": "^7.16.0",
35
- "@wordpress/a11y": "^4.7.1-next.5368f64a9.0",
36
- "@wordpress/api-fetch": "^7.7.1-next.5368f64a9.0",
37
- "@wordpress/blob": "^4.7.1-next.5368f64a9.0",
38
- "@wordpress/block-editor": "^14.2.1-next.5368f64a9.0",
39
- "@wordpress/blocks": "^13.7.1-next.5368f64a9.0",
40
- "@wordpress/commands": "^1.7.1-next.5368f64a9.0",
41
- "@wordpress/components": "^28.8.1-next.5368f64a9.0",
42
- "@wordpress/compose": "^7.8.1-next.5368f64a9.0",
43
- "@wordpress/core-data": "^7.7.1-next.5368f64a9.0",
44
- "@wordpress/data": "^10.7.1-next.5368f64a9.0",
45
- "@wordpress/dataviews": "^4.3.1-next.5368f64a9.0",
46
- "@wordpress/date": "^5.7.1-next.5368f64a9.0",
47
- "@wordpress/deprecated": "^4.7.1-next.5368f64a9.0",
48
- "@wordpress/dom": "^4.7.1-next.5368f64a9.0",
49
- "@wordpress/element": "^6.7.1-next.5368f64a9.0",
50
- "@wordpress/hooks": "^4.7.1-next.5368f64a9.0",
51
- "@wordpress/html-entities": "^4.7.1-next.5368f64a9.0",
52
- "@wordpress/i18n": "^5.7.1-next.5368f64a9.0",
53
- "@wordpress/icons": "^10.7.1-next.5368f64a9.0",
54
- "@wordpress/interface": "^6.7.1-next.5368f64a9.0",
55
- "@wordpress/keyboard-shortcuts": "^5.7.1-next.5368f64a9.0",
56
- "@wordpress/keycodes": "^4.7.1-next.5368f64a9.0",
57
- "@wordpress/media-utils": "^5.8.1-next.5368f64a9.0",
58
- "@wordpress/notices": "^5.7.1-next.5368f64a9.0",
59
- "@wordpress/patterns": "^2.7.1-next.5368f64a9.0",
60
- "@wordpress/plugins": "^7.7.1-next.5368f64a9.0",
61
- "@wordpress/preferences": "^4.7.1-next.5368f64a9.0",
62
- "@wordpress/private-apis": "^1.7.1-next.5368f64a9.0",
63
- "@wordpress/reusable-blocks": "^5.7.1-next.5368f64a9.0",
64
- "@wordpress/rich-text": "^7.7.1-next.5368f64a9.0",
65
- "@wordpress/server-side-render": "^5.7.1-next.5368f64a9.0",
66
- "@wordpress/url": "^4.7.1-next.5368f64a9.0",
67
- "@wordpress/warning": "^3.7.1-next.5368f64a9.0",
68
- "@wordpress/wordcount": "^4.7.1-next.5368f64a9.0",
35
+ "@wordpress/a11y": "^4.8.1",
36
+ "@wordpress/api-fetch": "^7.8.1",
37
+ "@wordpress/blob": "^4.8.1",
38
+ "@wordpress/block-editor": "^14.3.1",
39
+ "@wordpress/blocks": "^13.8.1",
40
+ "@wordpress/commands": "^1.8.1",
41
+ "@wordpress/components": "^28.8.1",
42
+ "@wordpress/compose": "^7.8.1",
43
+ "@wordpress/core-data": "^7.8.1",
44
+ "@wordpress/data": "^10.8.1",
45
+ "@wordpress/dataviews": "^4.4.1",
46
+ "@wordpress/date": "^5.8.1",
47
+ "@wordpress/deprecated": "^4.8.1",
48
+ "@wordpress/dom": "^4.8.1",
49
+ "@wordpress/element": "^6.8.1",
50
+ "@wordpress/fields": "^0.0.1",
51
+ "@wordpress/hooks": "^4.8.1",
52
+ "@wordpress/html-entities": "^4.8.1",
53
+ "@wordpress/i18n": "^5.8.1",
54
+ "@wordpress/icons": "^10.8.1",
55
+ "@wordpress/interface": "^6.8.1",
56
+ "@wordpress/keyboard-shortcuts": "^5.8.1",
57
+ "@wordpress/keycodes": "^4.8.1",
58
+ "@wordpress/media-utils": "^5.8.1",
59
+ "@wordpress/notices": "^5.8.1",
60
+ "@wordpress/patterns": "^2.8.1",
61
+ "@wordpress/plugins": "^7.8.1",
62
+ "@wordpress/preferences": "^4.8.1",
63
+ "@wordpress/private-apis": "^1.8.1",
64
+ "@wordpress/reusable-blocks": "^5.8.1",
65
+ "@wordpress/rich-text": "^7.8.1",
66
+ "@wordpress/server-side-render": "^5.8.1",
67
+ "@wordpress/url": "^4.8.1",
68
+ "@wordpress/warning": "^3.8.1",
69
+ "@wordpress/wordcount": "^4.8.1",
69
70
  "change-case": "^4.1.2",
70
71
  "client-zip": "^2.4.5",
71
72
  "clsx": "^2.1.1",
@@ -85,5 +86,5 @@
85
86
  "publishConfig": {
86
87
  "access": "public"
87
88
  },
88
- "gitHead": "24934a1f5251bbee15045d1fd953d9c5650317cd"
89
+ "gitHead": "cf707c1f25a2716e310cc8f9afcc8554405c79ac"
89
90
  }
@@ -7,22 +7,50 @@ import { store as coreDataStore } from '@wordpress/core-data';
7
7
  * Internal dependencies
8
8
  */
9
9
  import { store as editorStore } from '../store';
10
+ import { unlock } from '../lock-unlock';
11
+
12
+ function getMetadata( registry, context, registeredFields ) {
13
+ let metaFields = {};
14
+ const type = registry.select( editorStore ).getCurrentPostType();
15
+ const { getEditedEntityRecord } = registry.select( coreDataStore );
16
+
17
+ if ( context?.postType && context?.postId ) {
18
+ metaFields = getEditedEntityRecord(
19
+ 'postType',
20
+ context?.postType,
21
+ context?.postId
22
+ ).meta;
23
+ } else if ( type === 'wp_template' ) {
24
+ // Populate the `metaFields` object with the default values.
25
+ Object.entries( registeredFields || {} ).forEach(
26
+ ( [ key, props ] ) => {
27
+ if ( props.default ) {
28
+ metaFields[ key ] = props.default;
29
+ }
30
+ }
31
+ );
32
+ }
33
+
34
+ return metaFields;
35
+ }
10
36
 
11
37
  export default {
12
38
  name: 'core/post-meta',
13
39
  getValues( { registry, context, bindings } ) {
14
- const meta = registry
15
- .select( coreDataStore )
16
- .getEditedEntityRecord(
17
- 'postType',
18
- context?.postType,
19
- context?.postId
20
- )?.meta;
40
+ const { getRegisteredPostMeta } = unlock(
41
+ registry.select( coreDataStore )
42
+ );
43
+ const registeredFields = getRegisteredPostMeta( context?.postType );
44
+ const metaFields = getMetadata( registry, context, registeredFields );
45
+
21
46
  const newValues = {};
22
47
  for ( const [ attributeName, source ] of Object.entries( bindings ) ) {
23
- // Use the key if the value is not set.
48
+ // Use the value, the field label, or the field key.
49
+ const metaKey = source.args.key;
24
50
  newValues[ attributeName ] =
25
- meta?.[ source.args.key ] ?? source.args.key;
51
+ metaFields?.[ metaKey ] ??
52
+ registeredFields?.[ metaKey ]?.title ??
53
+ metaKey;
26
54
  }
27
55
  return newValues;
28
56
  },
@@ -82,23 +110,31 @@ export default {
82
110
  return true;
83
111
  },
84
112
  getFieldsList( { registry, context } ) {
85
- const metaFields = registry
86
- .select( coreDataStore )
87
- .getEditedEntityRecord(
88
- 'postType',
89
- context?.postType,
90
- context?.postId
91
- ).meta;
113
+ const { getRegisteredPostMeta } = unlock(
114
+ registry.select( coreDataStore )
115
+ );
116
+ const registeredFields = getRegisteredPostMeta( context?.postType );
117
+ const metaFields = getMetadata( registry, context, registeredFields );
92
118
 
93
119
  if ( ! metaFields || ! Object.keys( metaFields ).length ) {
94
120
  return null;
95
121
  }
96
122
 
97
- // Remove footnotes or private keys from the list of fields.
98
123
  return Object.fromEntries(
99
- Object.entries( metaFields ).filter(
100
- ( [ key ] ) => key !== 'footnotes' && key.charAt( 0 ) !== '_'
101
- )
124
+ Object.entries( metaFields )
125
+ // Remove footnotes or private keys from the list of fields.
126
+ .filter(
127
+ ( [ key ] ) =>
128
+ key !== 'footnotes' && key.charAt( 0 ) !== '_'
129
+ )
130
+ // Return object with label and value.
131
+ .map( ( [ key, value ] ) => [
132
+ key,
133
+ {
134
+ label: registeredFields?.[ key ]?.title || key,
135
+ value,
136
+ },
137
+ ] )
102
138
  );
103
139
  },
104
140
  };
@@ -2,11 +2,11 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { store as blocksStore } from '@wordpress/blocks';
5
- import { withSelect, withDispatch } from '@wordpress/data';
5
+ import { useDispatch, useSelect } from '@wordpress/data';
6
6
  import { SearchControl, Button } from '@wordpress/components';
7
7
  import { __, _n, sprintf } from '@wordpress/i18n';
8
8
  import { useEffect, useState } from '@wordpress/element';
9
- import { useDebounce, compose } from '@wordpress/compose';
9
+ import { useDebounce } from '@wordpress/compose';
10
10
  import { speak } from '@wordpress/a11y';
11
11
  import { store as preferencesStore } from '@wordpress/preferences';
12
12
 
@@ -17,21 +17,48 @@ import { unlock } from '../../lock-unlock';
17
17
  import { store as editorStore } from '../../store';
18
18
  import BlockManagerCategory from './category';
19
19
 
20
- function BlockManager( {
21
- blockTypes,
22
- categories,
23
- hasBlockSupport,
24
- isMatchingSearchTerm,
25
- numberOfHiddenBlocks,
26
- enableAllBlockTypes,
27
- } ) {
20
+ export default function BlockManager() {
28
21
  const debouncedSpeak = useDebounce( speak, 500 );
29
22
  const [ search, setSearch ] = useState( '' );
23
+ const { showBlockTypes } = unlock( useDispatch( editorStore ) );
30
24
 
31
- // Filtering occurs here (as opposed to `withSelect`) to avoid
32
- // wasted renders by consequence of `Array#filter` producing
33
- // a new value reference on each call.
34
- blockTypes = blockTypes.filter(
25
+ const {
26
+ blockTypes,
27
+ categories,
28
+ hasBlockSupport,
29
+ isMatchingSearchTerm,
30
+ numberOfHiddenBlocks,
31
+ } = useSelect( ( select ) => {
32
+ // Some hidden blocks become unregistered
33
+ // by removing for instance the plugin that registered them, yet
34
+ // they're still remain as hidden by the user's action.
35
+ // We consider "hidden", blocks which were hidden and
36
+ // are still registered.
37
+ const _blockTypes = select( blocksStore ).getBlockTypes();
38
+ const hiddenBlockTypes = (
39
+ select( preferencesStore ).get( 'core', 'hiddenBlockTypes' ) ?? []
40
+ ).filter( ( hiddenBlock ) => {
41
+ return _blockTypes.some(
42
+ ( registeredBlock ) => registeredBlock.name === hiddenBlock
43
+ );
44
+ } );
45
+
46
+ return {
47
+ blockTypes: _blockTypes,
48
+ categories: select( blocksStore ).getCategories(),
49
+ hasBlockSupport: select( blocksStore ).hasBlockSupport,
50
+ isMatchingSearchTerm: select( blocksStore ).isMatchingSearchTerm,
51
+ numberOfHiddenBlocks:
52
+ Array.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length,
53
+ };
54
+ }, [] );
55
+
56
+ function enableAllBlockTypes( newBlockTypes ) {
57
+ const blockNames = newBlockTypes.map( ( { name } ) => name );
58
+ showBlockTypes( blockNames );
59
+ }
60
+
61
+ const filteredBlockTypes = blockTypes.filter(
35
62
  ( blockType ) =>
36
63
  hasBlockSupport( blockType, 'inserter', true ) &&
37
64
  ( ! search || isMatchingSearchTerm( blockType, search ) ) &&
@@ -44,14 +71,14 @@ function BlockManager( {
44
71
  if ( ! search ) {
45
72
  return;
46
73
  }
47
- const count = blockTypes.length;
74
+ const count = filteredBlockTypes.length;
48
75
  const resultsFoundMessage = sprintf(
49
76
  /* translators: %d: number of results. */
50
77
  _n( '%d result found.', '%d results found.', count ),
51
78
  count
52
79
  );
53
80
  debouncedSpeak( resultsFoundMessage );
54
- }, [ blockTypes.length, search, debouncedSpeak ] );
81
+ }, [ filteredBlockTypes?.length, search, debouncedSpeak ] );
55
82
 
56
83
  return (
57
84
  <div className="editor-block-manager__content">
@@ -67,10 +94,11 @@ function BlockManager( {
67
94
  numberOfHiddenBlocks
68
95
  ) }
69
96
  <Button
70
- // TODO: Switch to `true` (40px size) if possible
71
- __next40pxDefaultSize={ false }
97
+ __next40pxDefaultSize
72
98
  variant="link"
73
- onClick={ () => enableAllBlockTypes( blockTypes ) }
99
+ onClick={ () =>
100
+ enableAllBlockTypes( filteredBlockTypes )
101
+ }
74
102
  >
75
103
  { __( 'Reset' ) }
76
104
  </Button>
@@ -90,7 +118,7 @@ function BlockManager( {
90
118
  aria-label={ __( 'Available block types' ) }
91
119
  className="editor-block-manager__results"
92
120
  >
93
- { blockTypes.length === 0 && (
121
+ { filteredBlockTypes.length === 0 && (
94
122
  <p className="editor-block-manager__no-results">
95
123
  { __( 'No blocks found.' ) }
96
124
  </p>
@@ -99,7 +127,7 @@ function BlockManager( {
99
127
  <BlockManagerCategory
100
128
  key={ category.slug }
101
129
  title={ category.title }
102
- blockTypes={ blockTypes.filter(
130
+ blockTypes={ filteredBlockTypes.filter(
103
131
  ( blockType ) =>
104
132
  blockType.category === category.slug
105
133
  ) }
@@ -107,7 +135,7 @@ function BlockManager( {
107
135
  ) ) }
108
136
  <BlockManagerCategory
109
137
  title={ __( 'Uncategorized' ) }
110
- blockTypes={ blockTypes.filter(
138
+ blockTypes={ filteredBlockTypes.filter(
111
139
  ( { category } ) => ! category
112
140
  ) }
113
141
  />
@@ -115,48 +143,3 @@ function BlockManager( {
115
143
  </div>
116
144
  );
117
145
  }
118
-
119
- export default compose( [
120
- withSelect( ( select ) => {
121
- const {
122
- getBlockTypes,
123
- getCategories,
124
- hasBlockSupport,
125
- isMatchingSearchTerm,
126
- } = select( blocksStore );
127
- const { get } = select( preferencesStore );
128
-
129
- // Some hidden blocks become unregistered
130
- // by removing for instance the plugin that registered them, yet
131
- // they're still remain as hidden by the user's action.
132
- // We consider "hidden", blocks which were hidden and
133
- // are still registered.
134
- const blockTypes = getBlockTypes();
135
- const hiddenBlockTypes = (
136
- get( 'core', 'hiddenBlockTypes' ) ?? []
137
- ).filter( ( hiddenBlock ) => {
138
- return blockTypes.some(
139
- ( registeredBlock ) => registeredBlock.name === hiddenBlock
140
- );
141
- } );
142
- const numberOfHiddenBlocks =
143
- Array.isArray( hiddenBlockTypes ) && hiddenBlockTypes.length;
144
-
145
- return {
146
- blockTypes,
147
- categories: getCategories(),
148
- hasBlockSupport,
149
- isMatchingSearchTerm,
150
- numberOfHiddenBlocks,
151
- };
152
- } ),
153
- withDispatch( ( dispatch ) => {
154
- const { showBlockTypes } = unlock( dispatch( editorStore ) );
155
- return {
156
- enableAllBlockTypes: ( blockTypes ) => {
157
- const blockNames = blockTypes.map( ( { name } ) => name );
158
- showBlockTypes( blockNames );
159
- },
160
- };
161
- } ),
162
- ] )( BlockManager );