@wordpress/block-editor 13.4.0 → 14.0.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 (331) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +11 -1
  3. package/build/components/block-breadcrumb/index.js +3 -1
  4. package/build/components/block-breadcrumb/index.js.map +1 -1
  5. package/build/components/block-draggable/index.js +2 -2
  6. package/build/components/block-draggable/index.js.map +1 -1
  7. package/build/components/block-list/use-block-props/use-block-refs.js +24 -32
  8. package/build/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  9. package/build/components/block-mover/index.js +1 -2
  10. package/build/components/block-mover/index.js.map +1 -1
  11. package/build/components/block-popover/cover.js +1 -1
  12. package/build/components/block-popover/cover.js.map +1 -1
  13. package/build/components/block-popover/inbetween.js +2 -2
  14. package/build/components/block-popover/inbetween.js.map +1 -1
  15. package/build/components/block-popover/index.js +2 -2
  16. package/build/components/block-popover/index.js.map +1 -1
  17. package/build/components/block-tools/block-selection-button.js +1 -2
  18. package/build/components/block-tools/block-selection-button.js.map +1 -1
  19. package/build/components/block-tools/index.js +1 -1
  20. package/build/components/block-tools/index.js.map +1 -1
  21. package/build/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  22. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  23. package/build/components/block-tools/zoom-out-mode-inserters.js +15 -16
  24. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  25. package/build/components/block-tools/zoom-out-toolbar.js +0 -1
  26. package/build/components/block-tools/zoom-out-toolbar.js.map +1 -1
  27. package/build/components/child-layout-control/index.js +3 -1
  28. package/build/components/child-layout-control/index.js.map +1 -1
  29. package/build/components/dimensions-tool/scale-tool.js +1 -0
  30. package/build/components/dimensions-tool/scale-tool.js.map +1 -1
  31. package/build/components/font-family/index.js +12 -0
  32. package/build/components/font-family/index.js.map +1 -1
  33. package/build/components/global-styles/background-panel.js +55 -51
  34. package/build/components/global-styles/background-panel.js.map +1 -1
  35. package/build/components/global-styles/image-settings-panel.js +1 -0
  36. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  37. package/build/components/global-styles/theme-file-uri-utils.js +0 -59
  38. package/build/components/global-styles/theme-file-uri-utils.js.map +1 -1
  39. package/build/components/global-styles/typography-panel.js +0 -1
  40. package/build/components/global-styles/typography-panel.js.map +1 -1
  41. package/build/components/global-styles/use-global-styles-output.js +58 -39
  42. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  43. package/build/components/global-styles/utils.js +96 -0
  44. package/build/components/global-styles/utils.js.map +1 -1
  45. package/build/components/grid/grid-item-movers.js +30 -26
  46. package/build/components/grid/grid-item-movers.js.map +1 -1
  47. package/build/components/grid/grid-item-resizer.js +14 -15
  48. package/build/components/grid/grid-item-resizer.js.map +1 -1
  49. package/build/components/grid/grid-visualizer.js +1 -1
  50. package/build/components/grid/grid-visualizer.js.map +1 -1
  51. package/build/components/grid/use-grid-layout-sync.js +56 -20
  52. package/build/components/grid/use-grid-layout-sync.js.map +1 -1
  53. package/build/components/iframe/index.js +4 -8
  54. package/build/components/iframe/index.js.map +1 -1
  55. package/build/components/inserter/category-tabs/index.js +29 -2
  56. package/build/components/inserter/category-tabs/index.js.map +1 -1
  57. package/build/components/inserter/menu.js +2 -2
  58. package/build/components/inserter/menu.js.map +1 -1
  59. package/build/components/line-height-control/index.js +0 -15
  60. package/build/components/line-height-control/index.js.map +1 -1
  61. package/build/components/link-control/search-input.js +0 -1
  62. package/build/components/link-control/search-input.js.map +1 -1
  63. package/build/components/media-replace-flow/index.js +3 -1
  64. package/build/components/media-replace-flow/index.js.map +1 -1
  65. package/build/components/resolution-tool/index.js +1 -0
  66. package/build/components/resolution-tool/index.js.map +1 -1
  67. package/build/components/skip-to-selected-block/index.js +4 -2
  68. package/build/components/skip-to-selected-block/index.js.map +1 -1
  69. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -6
  70. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  71. package/build/components/url-input/button.js +0 -1
  72. package/build/components/url-input/button.js.map +1 -1
  73. package/build/components/url-input/index.js +1 -11
  74. package/build/components/url-input/index.js.map +1 -1
  75. package/build/components/url-popover/link-editor.js +0 -1
  76. package/build/components/url-popover/link-editor.js.map +1 -1
  77. package/build/components/use-block-drop-zone/index.js +30 -4
  78. package/build/components/use-block-drop-zone/index.js.map +1 -1
  79. package/build/components/use-on-block-drop/index.js +3 -6
  80. package/build/components/use-on-block-drop/index.js.map +1 -1
  81. package/build/components/use-resize-canvas/index.js +1 -3
  82. package/build/components/use-resize-canvas/index.js.map +1 -1
  83. package/build/components/use-settings/index.js +2 -1
  84. package/build/components/use-settings/index.js.map +1 -1
  85. package/build/hooks/block-bindings.js +248 -36
  86. package/build/hooks/block-bindings.js.map +1 -1
  87. package/build/hooks/block-hooks.js +1 -0
  88. package/build/hooks/block-hooks.js.map +1 -1
  89. package/build/hooks/block-style-variation.js +2 -2
  90. package/build/hooks/block-style-variation.js.map +1 -1
  91. package/build/hooks/contrast-checker.js +6 -6
  92. package/build/hooks/contrast-checker.js.map +1 -1
  93. package/build/hooks/duotone.js +3 -3
  94. package/build/hooks/duotone.js.map +1 -1
  95. package/build/hooks/index.js +7 -1
  96. package/build/hooks/index.js.map +1 -1
  97. package/build/hooks/line-height.js +0 -1
  98. package/build/hooks/line-height.js.map +1 -1
  99. package/build/hooks/spacing-visualizer.js +1 -1
  100. package/build/hooks/spacing-visualizer.js.map +1 -1
  101. package/build/hooks/use-bindings-attributes.js +4 -0
  102. package/build/hooks/use-bindings-attributes.js.map +1 -1
  103. package/build/hooks/use-zoom-out.js +1 -1
  104. package/build/hooks/use-zoom-out.js.map +1 -1
  105. package/build/hooks/utils.js +20 -0
  106. package/build/hooks/utils.js.map +1 -1
  107. package/build/index.js +7 -0
  108. package/build/index.js.map +1 -1
  109. package/build/private-apis.js +0 -1
  110. package/build/private-apis.js.map +1 -1
  111. package/build/store/actions.js +9 -1
  112. package/build/store/actions.js.map +1 -1
  113. package/build/store/selectors.js +4 -4
  114. package/build/store/selectors.js.map +1 -1
  115. package/build/utils/get-editor-region.js +1 -1
  116. package/build/utils/get-editor-region.js.map +1 -1
  117. package/build/utils/get-px-from-css-unit.js +1 -1
  118. package/build/utils/get-px-from-css-unit.js.map +1 -1
  119. package/build-module/components/block-breadcrumb/index.js +4 -2
  120. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  121. package/build-module/components/block-draggable/index.js +3 -3
  122. package/build-module/components/block-draggable/index.js.map +1 -1
  123. package/build-module/components/block-list/use-block-props/use-block-refs.js +24 -34
  124. package/build-module/components/block-list/use-block-props/use-block-refs.js.map +1 -1
  125. package/build-module/components/block-mover/index.js +1 -2
  126. package/build-module/components/block-mover/index.js.map +1 -1
  127. package/build-module/components/block-popover/cover.js +1 -1
  128. package/build-module/components/block-popover/cover.js.map +1 -1
  129. package/build-module/components/block-popover/inbetween.js +1 -1
  130. package/build-module/components/block-popover/inbetween.js.map +1 -1
  131. package/build-module/components/block-popover/index.js +1 -1
  132. package/build-module/components/block-popover/index.js.map +1 -1
  133. package/build-module/components/block-tools/block-selection-button.js +1 -2
  134. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  135. package/build-module/components/block-tools/index.js +1 -1
  136. package/build-module/components/block-tools/index.js.map +1 -1
  137. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  138. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  139. package/build-module/components/block-tools/zoom-out-mode-inserters.js +16 -17
  140. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  141. package/build-module/components/block-tools/zoom-out-toolbar.js +0 -1
  142. package/build-module/components/block-tools/zoom-out-toolbar.js.map +1 -1
  143. package/build-module/components/child-layout-control/index.js +3 -1
  144. package/build-module/components/child-layout-control/index.js.map +1 -1
  145. package/build-module/components/dimensions-tool/scale-tool.js +1 -0
  146. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -1
  147. package/build-module/components/font-family/index.js +11 -0
  148. package/build-module/components/font-family/index.js.map +1 -1
  149. package/build-module/components/global-styles/background-panel.js +55 -51
  150. package/build-module/components/global-styles/background-panel.js.map +1 -1
  151. package/build-module/components/global-styles/image-settings-panel.js +1 -0
  152. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  153. package/build-module/components/global-styles/theme-file-uri-utils.js +0 -58
  154. package/build-module/components/global-styles/theme-file-uri-utils.js.map +1 -1
  155. package/build-module/components/global-styles/typography-panel.js +0 -1
  156. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  157. package/build-module/components/global-styles/use-global-styles-output.js +57 -38
  158. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  159. package/build-module/components/global-styles/utils.js +92 -0
  160. package/build-module/components/global-styles/utils.js.map +1 -1
  161. package/build-module/components/grid/grid-item-movers.js +30 -26
  162. package/build-module/components/grid/grid-item-movers.js.map +1 -1
  163. package/build-module/components/grid/grid-item-resizer.js +14 -15
  164. package/build-module/components/grid/grid-item-resizer.js.map +1 -1
  165. package/build-module/components/grid/grid-visualizer.js +1 -1
  166. package/build-module/components/grid/grid-visualizer.js.map +1 -1
  167. package/build-module/components/grid/use-grid-layout-sync.js +56 -20
  168. package/build-module/components/grid/use-grid-layout-sync.js.map +1 -1
  169. package/build-module/components/iframe/index.js +4 -8
  170. package/build-module/components/iframe/index.js.map +1 -1
  171. package/build-module/components/inserter/category-tabs/index.js +30 -3
  172. package/build-module/components/inserter/category-tabs/index.js.map +1 -1
  173. package/build-module/components/inserter/menu.js +2 -2
  174. package/build-module/components/inserter/menu.js.map +1 -1
  175. package/build-module/components/line-height-control/index.js +0 -14
  176. package/build-module/components/line-height-control/index.js.map +1 -1
  177. package/build-module/components/link-control/search-input.js +0 -1
  178. package/build-module/components/link-control/search-input.js.map +1 -1
  179. package/build-module/components/media-replace-flow/index.js +3 -1
  180. package/build-module/components/media-replace-flow/index.js.map +1 -1
  181. package/build-module/components/resolution-tool/index.js +1 -0
  182. package/build-module/components/resolution-tool/index.js.map +1 -1
  183. package/build-module/components/skip-to-selected-block/index.js +5 -3
  184. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  185. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +4 -6
  186. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  187. package/build-module/components/url-input/button.js +0 -1
  188. package/build-module/components/url-input/button.js.map +1 -1
  189. package/build-module/components/url-input/index.js +1 -11
  190. package/build-module/components/url-input/index.js.map +1 -1
  191. package/build-module/components/url-popover/link-editor.js +0 -1
  192. package/build-module/components/url-popover/link-editor.js.map +1 -1
  193. package/build-module/components/use-block-drop-zone/index.js +30 -4
  194. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  195. package/build-module/components/use-on-block-drop/index.js +3 -6
  196. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  197. package/build-module/components/use-resize-canvas/index.js +1 -3
  198. package/build-module/components/use-resize-canvas/index.js.map +1 -1
  199. package/build-module/components/use-settings/index.js +2 -1
  200. package/build-module/components/use-settings/index.js.map +1 -1
  201. package/build-module/hooks/block-bindings.js +253 -40
  202. package/build-module/hooks/block-bindings.js.map +1 -1
  203. package/build-module/hooks/block-hooks.js +1 -0
  204. package/build-module/hooks/block-hooks.js.map +1 -1
  205. package/build-module/hooks/block-style-variation.js +3 -3
  206. package/build-module/hooks/block-style-variation.js.map +1 -1
  207. package/build-module/hooks/contrast-checker.js +7 -7
  208. package/build-module/hooks/contrast-checker.js.map +1 -1
  209. package/build-module/hooks/duotone.js +4 -4
  210. package/build-module/hooks/duotone.js.map +1 -1
  211. package/build-module/hooks/index.js +2 -1
  212. package/build-module/hooks/index.js.map +1 -1
  213. package/build-module/hooks/line-height.js +0 -1
  214. package/build-module/hooks/line-height.js.map +1 -1
  215. package/build-module/hooks/spacing-visualizer.js +1 -1
  216. package/build-module/hooks/spacing-visualizer.js.map +1 -1
  217. package/build-module/hooks/use-bindings-attributes.js +3 -0
  218. package/build-module/hooks/use-bindings-attributes.js.map +1 -1
  219. package/build-module/hooks/use-zoom-out.js +1 -1
  220. package/build-module/hooks/use-zoom-out.js.map +1 -1
  221. package/build-module/hooks/utils.js +19 -0
  222. package/build-module/hooks/utils.js.map +1 -1
  223. package/build-module/index.js +1 -1
  224. package/build-module/index.js.map +1 -1
  225. package/build-module/private-apis.js +1 -2
  226. package/build-module/private-apis.js.map +1 -1
  227. package/build-module/store/actions.js +9 -1
  228. package/build-module/store/actions.js.map +1 -1
  229. package/build-module/store/selectors.js +4 -4
  230. package/build-module/store/selectors.js.map +1 -1
  231. package/build-module/utils/get-editor-region.js +1 -1
  232. package/build-module/utils/get-editor-region.js.map +1 -1
  233. package/build-module/utils/get-px-from-css-unit.js +1 -1
  234. package/build-module/utils/get-px-from-css-unit.js.map +1 -1
  235. package/build-style/content-rtl.css +5 -12
  236. package/build-style/content.css +5 -12
  237. package/build-style/default-editor-styles-rtl.css +3 -0
  238. package/build-style/default-editor-styles.css +3 -0
  239. package/build-style/style-rtl.css +88 -46
  240. package/build-style/style.css +88 -46
  241. package/package.json +31 -31
  242. package/src/autocompleters/style.scss +4 -0
  243. package/src/components/block-breadcrumb/index.js +4 -2
  244. package/src/components/block-canvas/style.scss +1 -0
  245. package/src/components/block-draggable/index.js +3 -3
  246. package/src/components/block-list/use-block-props/use-block-refs.js +27 -43
  247. package/src/components/block-mover/index.js +5 -2
  248. package/src/components/block-popover/cover.js +1 -1
  249. package/src/components/block-popover/inbetween.js +1 -1
  250. package/src/components/block-popover/index.js +1 -1
  251. package/src/components/block-tools/block-selection-button.js +1 -2
  252. package/src/components/block-tools/index.js +5 -6
  253. package/src/components/block-tools/use-block-toolbar-popover-props.js +1 -1
  254. package/src/components/block-tools/zoom-out-mode-inserters.js +14 -18
  255. package/src/components/block-tools/zoom-out-toolbar.js +0 -1
  256. package/src/components/button-block-appender/content.scss +1 -1
  257. package/src/components/child-layout-control/index.js +2 -0
  258. package/src/components/color-palette/test/__snapshots__/control.js.snap +2 -2
  259. package/src/components/colors-gradients/test/control.js +3 -2
  260. package/src/components/dimensions-tool/scale-tool.js +1 -0
  261. package/src/components/font-family/README.md +8 -0
  262. package/src/components/font-family/index.js +16 -0
  263. package/src/components/font-family/stories/index.story.js +54 -0
  264. package/src/components/global-styles/background-panel.js +69 -61
  265. package/src/components/global-styles/image-settings-panel.js +1 -0
  266. package/src/components/global-styles/style.scss +0 -10
  267. package/src/components/global-styles/test/theme-file-uri-utils.js +1 -26
  268. package/src/components/global-styles/test/use-global-styles-output.js +49 -4
  269. package/src/components/global-styles/test/utils.js +120 -0
  270. package/src/components/global-styles/theme-file-uri-utils.js +0 -59
  271. package/src/components/global-styles/typography-panel.js +0 -1
  272. package/src/components/global-styles/use-global-styles-output.js +67 -48
  273. package/src/components/global-styles/utils.js +112 -0
  274. package/src/components/grid/grid-item-movers.js +46 -44
  275. package/src/components/grid/grid-item-resizer.js +11 -17
  276. package/src/components/grid/grid-visualizer.js +1 -1
  277. package/src/components/grid/style.scss +60 -10
  278. package/src/components/grid/use-grid-layout-sync.js +68 -14
  279. package/src/components/iframe/content.scss +2 -2
  280. package/src/components/iframe/index.js +3 -7
  281. package/src/components/inserter/category-tabs/index.js +35 -2
  282. package/src/components/inserter/menu.js +2 -2
  283. package/src/components/inserter/style.scss +16 -11
  284. package/src/components/inspector-controls/README.md +5 -0
  285. package/src/components/line-height-control/README.md +0 -8
  286. package/src/components/line-height-control/index.js +1 -21
  287. package/src/components/line-height-control/stories/index.story.js +0 -1
  288. package/src/components/line-height-control/test/index.js +1 -7
  289. package/src/components/link-control/search-input.js +0 -1
  290. package/src/components/media-replace-flow/README.md +7 -0
  291. package/src/components/media-replace-flow/index.js +3 -1
  292. package/src/components/resolution-tool/index.js +1 -0
  293. package/src/components/responsive-block-control/test/index.js +5 -1
  294. package/src/components/skip-to-selected-block/index.js +5 -3
  295. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +3 -6
  296. package/src/components/tabbed-sidebar/style.scss +1 -19
  297. package/src/components/url-input/README.md +0 -5
  298. package/src/components/url-input/button.js +0 -1
  299. package/src/components/url-input/index.js +1 -15
  300. package/src/components/url-popover/link-editor.js +0 -1
  301. package/src/components/use-block-drop-zone/index.js +66 -14
  302. package/src/components/use-on-block-drop/index.js +1 -9
  303. package/src/components/use-resize-canvas/index.js +1 -3
  304. package/src/components/use-settings/index.js +2 -1
  305. package/src/hooks/block-bindings.js +303 -52
  306. package/src/hooks/block-bindings.scss +13 -2
  307. package/src/hooks/block-hooks.js +1 -0
  308. package/src/hooks/block-hooks.scss +1 -0
  309. package/src/hooks/block-style-variation.js +3 -3
  310. package/src/hooks/contrast-checker.js +7 -7
  311. package/src/hooks/duotone.js +4 -4
  312. package/src/hooks/index.js +2 -1
  313. package/src/hooks/line-height.js +0 -1
  314. package/src/hooks/spacing-visualizer.js +1 -1
  315. package/src/hooks/use-bindings-attributes.js +4 -0
  316. package/src/hooks/use-editor-wrapper-styles.native.scss +1 -0
  317. package/src/hooks/use-zoom-out.js +1 -1
  318. package/src/hooks/utils.js +14 -1
  319. package/src/index.js +1 -0
  320. package/src/private-apis.js +1 -2
  321. package/src/store/actions.js +13 -5
  322. package/src/store/selectors.js +4 -4
  323. package/src/style.scss +1 -1
  324. package/src/utils/get-editor-region.js +1 -1
  325. package/src/utils/get-px-from-css-unit.js +1 -1
  326. package/tsconfig.tsbuildinfo +1 -1
  327. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -30
  328. package/build/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +0 -1
  329. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -23
  330. package/build-module/components/inserter/block-patterns-tab/pattern-category-preview-panel.js.map +0 -1
  331. package/src/components/inserter/block-patterns-tab/pattern-category-preview-panel.js +0 -25
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-editor",
3
- "version": "13.4.0",
3
+ "version": "14.0.0",
4
4
  "description": "Generic block editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -36,35 +36,35 @@
36
36
  "@emotion/react": "^11.7.1",
37
37
  "@emotion/styled": "^11.6.0",
38
38
  "@react-spring/web": "^9.4.5",
39
- "@wordpress/a11y": "^4.4.0",
40
- "@wordpress/api-fetch": "^7.4.0",
41
- "@wordpress/blob": "^4.4.0",
42
- "@wordpress/blocks": "^13.4.0",
43
- "@wordpress/commands": "^1.4.0",
44
- "@wordpress/components": "^28.4.0",
45
- "@wordpress/compose": "^7.4.0",
46
- "@wordpress/data": "^10.4.0",
47
- "@wordpress/date": "^5.4.0",
48
- "@wordpress/deprecated": "^4.4.0",
49
- "@wordpress/dom": "^4.4.0",
50
- "@wordpress/element": "^6.4.0",
51
- "@wordpress/escape-html": "^3.4.0",
52
- "@wordpress/hooks": "^4.4.0",
53
- "@wordpress/html-entities": "^4.4.0",
54
- "@wordpress/i18n": "^5.4.0",
55
- "@wordpress/icons": "^10.4.0",
56
- "@wordpress/is-shallow-equal": "^5.4.0",
57
- "@wordpress/keyboard-shortcuts": "^5.4.0",
58
- "@wordpress/keycodes": "^4.4.0",
59
- "@wordpress/notices": "^5.4.0",
60
- "@wordpress/preferences": "^4.4.0",
61
- "@wordpress/private-apis": "^1.4.0",
62
- "@wordpress/rich-text": "^7.4.0",
63
- "@wordpress/style-engine": "^2.4.0",
64
- "@wordpress/token-list": "^3.4.0",
65
- "@wordpress/url": "^4.4.0",
66
- "@wordpress/warning": "^3.4.0",
67
- "@wordpress/wordcount": "^4.4.0",
39
+ "@wordpress/a11y": "^4.5.0",
40
+ "@wordpress/api-fetch": "^7.5.0",
41
+ "@wordpress/blob": "^4.5.0",
42
+ "@wordpress/blocks": "^13.5.0",
43
+ "@wordpress/commands": "^1.5.0",
44
+ "@wordpress/components": "^28.5.0",
45
+ "@wordpress/compose": "^7.5.0",
46
+ "@wordpress/data": "^10.5.0",
47
+ "@wordpress/date": "^5.5.0",
48
+ "@wordpress/deprecated": "^4.5.0",
49
+ "@wordpress/dom": "^4.5.0",
50
+ "@wordpress/element": "^6.5.0",
51
+ "@wordpress/escape-html": "^3.5.0",
52
+ "@wordpress/hooks": "^4.5.0",
53
+ "@wordpress/html-entities": "^4.5.0",
54
+ "@wordpress/i18n": "^5.5.0",
55
+ "@wordpress/icons": "^10.5.0",
56
+ "@wordpress/is-shallow-equal": "^5.5.0",
57
+ "@wordpress/keyboard-shortcuts": "^5.5.0",
58
+ "@wordpress/keycodes": "^4.5.0",
59
+ "@wordpress/notices": "^5.5.0",
60
+ "@wordpress/preferences": "^4.5.0",
61
+ "@wordpress/private-apis": "^1.5.0",
62
+ "@wordpress/rich-text": "^7.5.0",
63
+ "@wordpress/style-engine": "^2.5.0",
64
+ "@wordpress/token-list": "^3.5.0",
65
+ "@wordpress/url": "^4.5.0",
66
+ "@wordpress/warning": "^3.5.0",
67
+ "@wordpress/wordcount": "^4.5.0",
68
68
  "change-case": "^4.1.2",
69
69
  "clsx": "^2.1.1",
70
70
  "colord": "^2.7.0",
@@ -86,5 +86,5 @@
86
86
  "publishConfig": {
87
87
  "access": "public"
88
88
  },
89
- "gitHead": "363edb39b8dda8727f652e42cbb8497732693ed2"
89
+ "gitHead": "c3101ab024e2bfc85d525c6d247e0d57cafc9fd9"
90
90
  }
@@ -4,6 +4,10 @@
4
4
  .block-editor-block-icon {
5
5
  margin-right: $grid-unit-10;
6
6
  }
7
+
8
+ &[aria-selected="true"] .block-editor-block-icon {
9
+ color: inherit !important;
10
+ }
7
11
  }
8
12
 
9
13
  .block-editor-autocompleters__link {
@@ -5,6 +5,7 @@ import { Button } from '@wordpress/components';
5
5
  import { useSelect, useDispatch } from '@wordpress/data';
6
6
  import { __ } from '@wordpress/i18n';
7
7
  import { chevronRightSmall, Icon } from '@wordpress/icons';
8
+ import { useRef } from '@wordpress/element';
8
9
 
9
10
  /**
10
11
  * Internal dependencies
@@ -12,7 +13,7 @@ import { chevronRightSmall, Icon } from '@wordpress/icons';
12
13
  import BlockTitle from '../block-title';
13
14
  import { store as blockEditorStore } from '../../store';
14
15
  import { unlock } from '../../lock-unlock';
15
- import { __unstableUseBlockRef as useBlockRef } from '../block-list/use-block-props/use-block-refs';
16
+ import { useBlockElementRef } from '../block-list/use-block-props/use-block-refs';
16
17
  import getEditorRegion from '../../utils/get-editor-region';
17
18
 
18
19
  /**
@@ -41,7 +42,8 @@ function BlockBreadcrumb( { rootLabelText } ) {
41
42
 
42
43
  // We don't care about this specific ref, but this is a way
43
44
  // to get a ref within the editor canvas so we can focus it later.
44
- const blockRef = useBlockRef( clientId );
45
+ const blockRef = useRef();
46
+ useBlockElementRef( clientId, blockRef );
45
47
 
46
48
  /*
47
49
  * Disable reason: The `list` ARIA role is redundant but
@@ -4,4 +4,5 @@ iframe[name="editor-canvas"] {
4
4
  height: 100%;
5
5
  display: block;
6
6
  background-color: transparent;
7
+ @include editor-canvas-resize-animation;
7
8
  }
@@ -13,7 +13,7 @@ import { throttle } from '@wordpress/compose';
13
13
  import BlockDraggableChip from './draggable-chip';
14
14
  import useScrollWhenDragging from './use-scroll-when-dragging';
15
15
  import { store as blockEditorStore } from '../../store';
16
- import { __unstableUseBlockRef as useBlockRef } from '../block-list/use-block-props/use-block-refs';
16
+ import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
17
17
  import { isDropTargetValid } from '../use-block-drop-zone';
18
18
 
19
19
  const BlockDraggable = ( {
@@ -82,8 +82,8 @@ const BlockDraggable = ( {
82
82
  }, [] );
83
83
 
84
84
  // Find the root of the editor iframe.
85
- const blockRef = useBlockRef( clientIds[ 0 ] );
86
- const editorRoot = blockRef.current?.closest( 'body' );
85
+ const blockEl = useBlockElement( clientIds[ 0 ] );
86
+ const editorRoot = blockEl?.closest( 'body' );
87
87
 
88
88
  /*
89
89
  * Add a dragover event listener to the editor root to track the blocks being dragged over.
@@ -1,13 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import {
5
- useContext,
6
- useMemo,
7
- useRef,
8
- useState,
9
- useLayoutEffect,
10
- } from '@wordpress/element';
4
+ import { useContext, useState, useLayoutEffect } from '@wordpress/element';
11
5
  import { useRefEffect } from '@wordpress/compose';
12
6
 
13
7
  /**
@@ -16,7 +10,7 @@ import { useRefEffect } from '@wordpress/compose';
16
10
  import { BlockRefs } from '../../provider/block-refs-provider';
17
11
 
18
12
  /** @typedef {import('@wordpress/element').RefCallback} RefCallback */
19
- /** @typedef {import('@wordpress/element').RefObject} RefObject */
13
+ /** @typedef {import('@wordpress/element').Ref} Ref */
20
14
 
21
15
  /**
22
16
  * Provides a ref to the BlockRefs context.
@@ -36,31 +30,33 @@ export function useBlockRefProvider( clientId ) {
36
30
  );
37
31
  }
38
32
 
33
+ function assignRef( ref, value ) {
34
+ if ( typeof ref === 'function' ) {
35
+ ref( value );
36
+ } else if ( ref ) {
37
+ ref.current = value;
38
+ }
39
+ }
40
+
39
41
  /**
40
- * Gets a ref pointing to the current block element. Continues to return the same
41
- * stable ref object even if the `clientId` argument changes. This hook is not
42
- * reactive, i.e., it won't trigger a rerender of the calling component if the
43
- * ref value changes. For reactive use cases there is the `useBlockElement` hook.
44
- *
45
- * @param {string} clientId The client ID to get a ref for.
42
+ * Tracks the DOM element for the block identified by `clientId` and assigns it to the `ref`
43
+ * whenever it changes.
46
44
  *
47
- * @return {RefObject} A ref containing the element.
45
+ * @param {string} clientId The client ID to track.
46
+ * @param {Ref} ref The ref object/callback to assign to.
48
47
  */
49
- function useBlockRef( clientId ) {
48
+ export function useBlockElementRef( clientId, ref ) {
50
49
  const { refsMap } = useContext( BlockRefs );
51
- const latestClientId = useRef();
52
- latestClientId.current = clientId;
53
-
54
- // Always return an object, even if no ref exists for a given client ID, so
55
- // that `current` works at a later point.
56
- return useMemo(
57
- () => ( {
58
- get current() {
59
- return refsMap.get( latestClientId.current ) ?? null;
60
- },
61
- } ),
62
- [ refsMap ]
63
- );
50
+ useLayoutEffect( () => {
51
+ assignRef( ref, refsMap.get( clientId ) );
52
+ const unsubscribe = refsMap.subscribe( clientId, () =>
53
+ assignRef( ref, refsMap.get( clientId ) )
54
+ );
55
+ return () => {
56
+ unsubscribe();
57
+ assignRef( ref, null );
58
+ };
59
+ }, [ refsMap, clientId, ref ] );
64
60
  }
65
61
 
66
62
  /**
@@ -71,20 +67,8 @@ function useBlockRef( clientId ) {
71
67
  *
72
68
  * @return {Element|null} The block's wrapper element.
73
69
  */
74
- function useBlockElement( clientId ) {
75
- const { refsMap } = useContext( BlockRefs );
70
+ export function useBlockElement( clientId ) {
76
71
  const [ blockElement, setBlockElement ] = useState( null );
77
- // Delay setting the resulting `blockElement` until an effect. If the block element
78
- // changes (i.e., the block is unmounted and re-mounted), this allows enough time
79
- // for the ref callbacks to clean up the old element and set the new one.
80
- useLayoutEffect( () => {
81
- setBlockElement( refsMap.get( clientId ) );
82
- return refsMap.subscribe( clientId, () =>
83
- setBlockElement( refsMap.get( clientId ) )
84
- );
85
- }, [ refsMap, clientId ] );
72
+ useBlockElementRef( clientId, setBlockElement );
86
73
  return blockElement;
87
74
  }
88
-
89
- export { useBlockRef as __unstableUseBlockRef };
90
- export { useBlockElement as __unstableUseBlockElement };
@@ -69,7 +69,11 @@ function BlockMover( {
69
69
  [ clientIds ]
70
70
  );
71
71
 
72
- if ( ! canMove || ( isFirst && isLast && ! rootClientId ) ) {
72
+ if (
73
+ ! canMove ||
74
+ ( isFirst && isLast && ! rootClientId ) ||
75
+ ( hideDragHandle && isManualGrid )
76
+ ) {
73
77
  return null;
74
78
  }
75
79
 
@@ -85,7 +89,6 @@ function BlockMover( {
85
89
  <Button
86
90
  icon={ dragHandle }
87
91
  className="block-editor-block-mover__drag-handle"
88
- aria-hidden="true"
89
92
  label={ __( 'Drag' ) }
90
93
  // Should not be able to tab to drag handle as this
91
94
  // button can only be used with a pointer device.
@@ -6,7 +6,7 @@ import { useEffect, useState, useMemo, forwardRef } from '@wordpress/element';
6
6
  /**
7
7
  * Internal dependencies
8
8
  */
9
- import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
9
+ import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
10
10
  import { PrivateBlockPopover } from '.';
11
11
 
12
12
  function BlockPopoverCover(
@@ -20,7 +20,7 @@ import { isRTL } from '@wordpress/i18n';
20
20
  * Internal dependencies
21
21
  */
22
22
  import { store as blockEditorStore } from '../../store';
23
- import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
23
+ import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
24
24
  import usePopoverScroll from './use-popover-scroll';
25
25
 
26
26
  const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
@@ -18,7 +18,7 @@ import {
18
18
  /**
19
19
  * Internal dependencies
20
20
  */
21
- import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
21
+ import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
22
22
  import usePopoverScroll from './use-popover-scroll';
23
23
 
24
24
  const MAX_POPOVER_RECOMPUTE_COUNTER = Number.MAX_SAFE_INTEGER;
@@ -37,7 +37,7 @@ import BlockTitle from '../block-title';
37
37
  import BlockIcon from '../block-icon';
38
38
  import { store as blockEditorStore } from '../../store';
39
39
  import BlockDraggable from '../block-draggable';
40
- import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
40
+ import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
41
41
 
42
42
  /**
43
43
  * Block selection button component, displaying the label of the block. If the block
@@ -259,7 +259,6 @@ function BlockSelectionButton( { clientId, rootClientId }, ref ) {
259
259
  <Button
260
260
  icon={ dragHandle }
261
261
  className="block-selection-button_drag-handle"
262
- aria-hidden="true"
263
262
  label={ dragHandleLabel }
264
263
  // Should not be able to tab to drag handle as this
265
264
  // button can only be used with a pointer device.
@@ -251,12 +251,11 @@ export default function BlockTools( {
251
251
  name="__unstable-block-tools-after"
252
252
  ref={ blockToolbarAfterRef }
253
253
  />
254
- { window.__experimentalEnableZoomedOutPatternsTab &&
255
- isZoomOutMode && (
256
- <ZoomOutModeInserters
257
- __unstableContentRef={ __unstableContentRef }
258
- />
259
- ) }
254
+ { isZoomOutMode && (
255
+ <ZoomOutModeInserters
256
+ __unstableContentRef={ __unstableContentRef }
257
+ />
258
+ ) }
260
259
  </InsertionPointOpenRef.Provider>
261
260
  </div>
262
261
  );
@@ -15,7 +15,7 @@ import {
15
15
  * Internal dependencies
16
16
  */
17
17
  import { store as blockEditorStore } from '../../store';
18
- import { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';
18
+ import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
19
19
  import { hasStickyOrFixedPositionValue } from '../../hooks/position';
20
20
 
21
21
  const COMMON_PROPS = {
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { useSelect } from '@wordpress/data';
4
+ import { useSelect, useDispatch } from '@wordpress/data';
5
5
  import { useEffect, useState } from '@wordpress/element';
6
6
 
7
7
  /**
@@ -16,8 +16,9 @@ function ZoomOutModeInserters() {
16
16
  const [ isReady, setIsReady ] = useState( false );
17
17
  const {
18
18
  hasSelection,
19
+ blockInsertionPoint,
19
20
  blockOrder,
20
- insertionPoint,
21
+ blockInsertionPointVisible,
21
22
  setInserterIsOpened,
22
23
  sectionRootClientId,
23
24
  selectedBlockClientId,
@@ -25,23 +26,19 @@ function ZoomOutModeInserters() {
25
26
  } = useSelect( ( select ) => {
26
27
  const {
27
28
  getSettings,
29
+ getBlockInsertionPoint,
28
30
  getBlockOrder,
29
31
  getSelectionStart,
30
32
  getSelectedBlockClientId,
31
33
  getHoveredBlockClientId,
34
+ isBlockInsertionPointVisible,
32
35
  } = select( blockEditorStore );
33
36
  const { sectionRootClientId: root } = unlock( getSettings() );
34
- // To do: move ZoomOutModeInserters to core/editor.
35
- // Or we perhaps we should move the insertion point state to the
36
- // block-editor store. I'm not sure what it was ever moved to the editor
37
- // store, because all the inserter components all live in the
38
- // block-editor package.
39
- // eslint-disable-next-line @wordpress/data-no-store-string-literals
40
- const editor = select( 'core/editor' );
41
37
  return {
42
38
  hasSelection: !! getSelectionStart().clientId,
39
+ blockInsertionPoint: getBlockInsertionPoint(),
43
40
  blockOrder: getBlockOrder( root ),
44
- insertionPoint: unlock( editor ).getInsertionPoint(),
41
+ blockInsertionPointVisible: isBlockInsertionPointVisible(),
45
42
  sectionRootClientId: root,
46
43
  setInserterIsOpened:
47
44
  getSettings().__experimentalSetIsInserterOpened,
@@ -50,6 +47,8 @@ function ZoomOutModeInserters() {
50
47
  };
51
48
  }, [] );
52
49
 
50
+ const { showInsertionPoint } = useDispatch( blockEditorStore );
51
+
53
52
  // Defer the initial rendering to avoid the jumps due to the animation.
54
53
  useEffect( () => {
55
54
  const timeout = setTimeout( () => {
@@ -65,14 +64,8 @@ function ZoomOutModeInserters() {
65
64
  }
66
65
 
67
66
  return [ undefined, ...blockOrder ].map( ( clientId, index ) => {
68
- const shouldRenderInserter = insertionPoint.insertionIndex !== index;
69
-
70
67
  const shouldRenderInsertionPoint =
71
- insertionPoint.insertionIndex === index;
72
-
73
- if ( ! shouldRenderInserter && ! shouldRenderInsertionPoint ) {
74
- return null;
75
- }
68
+ blockInsertionPointVisible && blockInsertionPoint.index === index;
76
69
 
77
70
  const previousClientId = clientId;
78
71
  const nextClientId = blockOrder[ index ];
@@ -104,7 +97,7 @@ function ZoomOutModeInserters() {
104
97
  className="block-editor-block-list__insertion-point-indicator"
105
98
  />
106
99
  ) }
107
- { shouldRenderInserter && (
100
+ { ! shouldRenderInsertionPoint && (
108
101
  <ZoomOutModeInserterButton
109
102
  isVisible={ isSelected || isHovered }
110
103
  onClick={ () => {
@@ -114,6 +107,9 @@ function ZoomOutModeInserters() {
114
107
  tab: 'patterns',
115
108
  category: 'all',
116
109
  } );
110
+ showInsertionPoint( sectionRootClientId, index, {
111
+ operation: 'insert',
112
+ } );
117
113
  } }
118
114
  />
119
115
  ) }
@@ -100,7 +100,6 @@ export default function ZoomOutToolbar( { clientId, rootClientId } ) {
100
100
  <Button
101
101
  icon={ dragHandle }
102
102
  className="block-selection-button_drag-handle zoom-out-toolbar-button"
103
- aria-hidden="true"
104
103
  label={ __( 'Drag' ) }
105
104
  iconSize={ 24 }
106
105
  size="compact"
@@ -52,7 +52,7 @@
52
52
  left: 0;
53
53
  pointer-events: none;
54
54
  border: $border-width dashed currentColor;
55
- @include placeholder-style();
55
+ border-radius: $radius-block-ui;
56
56
  }
57
57
 
58
58
  .block-editor-inserter {
@@ -174,6 +174,8 @@ function FlexControls( {
174
174
  } );
175
175
  } }
176
176
  value={ flexSize }
177
+ label={ flexResetLabel }
178
+ hideLabelFromVision
177
179
  />
178
180
  ) }
179
181
  </VStack>
@@ -45,7 +45,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
45
45
  font-weight: 500;
46
46
  line-height: 1.4;
47
47
  text-transform: uppercase;
48
- display: inline-block;
48
+ display: block;
49
49
  margin-bottom: calc(4px * 2);
50
50
  padding: 0;
51
51
  }
@@ -220,7 +220,7 @@ exports[`ColorPaletteControl matches the snapshot 1`] = `
220
220
  aria-label="Color: red"
221
221
  aria-selected="true"
222
222
  class="components-button components-circular-option-picker__option"
223
- data-active-item=""
223
+ data-active-item="true"
224
224
  id="components-circular-option-picker-0-0"
225
225
  role="option"
226
226
  style="background-color: rgb(255, 0, 0); color: rgb(255, 0, 0);"
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * External dependencies
3
3
  */
4
- import { render, screen } from '@testing-library/react';
4
+ import { screen } from '@testing-library/react';
5
+ import { render } from '@ariakit/test/react';
5
6
 
6
7
  /**
7
8
  * Internal dependencies
@@ -12,7 +13,7 @@ const noop = () => {};
12
13
 
13
14
  describe( 'ColorPaletteControl', () => {
14
15
  it( 'renders tabs if it is possible to select a color and a gradient rendering a color picker at the start', async () => {
15
- render(
16
+ await render(
16
17
  <ColorGradientControl
17
18
  label="Test Color Gradient"
18
19
  colorValue="#f00"
@@ -105,6 +105,7 @@ export default function ScaleTool( {
105
105
  panelId={ panelId }
106
106
  >
107
107
  <ToggleGroupControl
108
+ __nextHasNoMarginBottom
108
109
  label={ __( 'Scale' ) }
109
110
  isBlock
110
111
  help={ scaleHelp[ displayValue ] }
@@ -24,6 +24,7 @@ const MyFontFamilyControl = () => {
24
24
  onChange={ ( newFontFamily ) => {
25
25
  setFontFamily( newFontFamily );
26
26
  } }
27
+ __nextHasNoMarginBottom
27
28
  />
28
29
  );
29
30
  };
@@ -69,3 +70,10 @@ The current font family value.
69
70
  - Default: ''
70
71
 
71
72
  The rest of the props are passed down to the underlying `<SelectControl />` instance.
73
+
74
+ #### `__nextHasNoMarginBottom`
75
+
76
+ - **Type:** `boolean`
77
+ - **Default:** `false`
78
+
79
+ Start opting into the new margin-free styles that will become the default in a future version.
@@ -2,6 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { SelectControl } from '@wordpress/components';
5
+ import deprecated from '@wordpress/deprecated';
5
6
  import { __ } from '@wordpress/i18n';
6
7
 
7
8
  /**
@@ -10,6 +11,8 @@ import { __ } from '@wordpress/i18n';
10
11
  import { useSettings } from '../use-settings';
11
12
 
12
13
  export default function FontFamilyControl( {
14
+ /** Start opting into the new margin-free styles that will become the default in a future version. */
15
+ __nextHasNoMarginBottom = false,
13
16
  value = '',
14
17
  onChange,
15
18
  fontFamilies,
@@ -33,8 +36,21 @@ export default function FontFamilyControl( {
33
36
  };
34
37
  } ),
35
38
  ];
39
+
40
+ if ( ! __nextHasNoMarginBottom ) {
41
+ deprecated(
42
+ 'Bottom margin styles for wp.blockEditor.FontFamilyControl',
43
+ {
44
+ since: '6.7',
45
+ version: '7.0',
46
+ hint: 'Set the `__nextHasNoMarginBottom` prop to true to start opting into the new styles, which will become the default in a future version',
47
+ }
48
+ );
49
+ }
50
+
36
51
  return (
37
52
  <SelectControl
53
+ __nextHasNoMarginBottom={ __nextHasNoMarginBottom }
38
54
  label={ __( 'Font' ) }
39
55
  options={ options }
40
56
  value={ value }
@@ -0,0 +1,54 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useState } from '@wordpress/element';
5
+
6
+ /**
7
+ * Internal dependencies
8
+ */
9
+ import FontFamilyControl from '..';
10
+
11
+ export default {
12
+ component: FontFamilyControl,
13
+ title: 'BlockEditor/FontFamilyControl',
14
+ };
15
+
16
+ export const Default = {
17
+ render: function Template( props ) {
18
+ const [ value, setValue ] = useState();
19
+ return (
20
+ <FontFamilyControl
21
+ onChange={ setValue }
22
+ value={ value }
23
+ { ...props }
24
+ />
25
+ );
26
+ },
27
+ args: {
28
+ fontFamilies: [
29
+ {
30
+ fontFace: [
31
+ {
32
+ fontFamily: 'Inter',
33
+ fontStretch: 'normal',
34
+ fontStyle: 'normal',
35
+ fontWeight: '200 900',
36
+ src: [
37
+ 'file:./assets/fonts/inter/Inter-VariableFont_slnt,wght.ttf',
38
+ ],
39
+ },
40
+ ],
41
+ fontFamily: '"Inter", sans-serif',
42
+ name: 'Inter',
43
+ slug: 'inter',
44
+ },
45
+ {
46
+ fontFamily:
47
+ '-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif',
48
+ name: 'System Font',
49
+ slug: 'system-font',
50
+ },
51
+ ],
52
+ __nextHasNoMarginBottom: true,
53
+ },
54
+ };