@wordpress/block-editor 15.11.0 → 15.12.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 (393) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/block-breadcrumb/index.cjs +10 -2
  3. package/build/components/block-breadcrumb/index.cjs.map +2 -2
  4. package/build/components/block-controls/index.cjs +1 -1
  5. package/build/components/block-controls/index.cjs.map +2 -2
  6. package/build/components/block-inspector/index.cjs +8 -21
  7. package/build/components/block-inspector/index.cjs.map +3 -3
  8. package/build/components/block-list/block.cjs +6 -3
  9. package/build/components/block-list/block.cjs.map +3 -3
  10. package/build/components/block-list/index.cjs +26 -18
  11. package/build/components/block-list/index.cjs.map +2 -2
  12. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs +39 -19
  13. package/build/components/block-list/use-block-props/use-selected-block-event-handlers.cjs.map +2 -2
  14. package/build/components/block-list/use-in-between-inserter.cjs +4 -4
  15. package/build/components/block-list/use-in-between-inserter.cjs.map +2 -2
  16. package/build/components/block-settings-menu/block-settings-dropdown.cjs +10 -7
  17. package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +2 -2
  18. package/build/components/block-settings-menu-controls/edit-section-menu-item.cjs +1 -1
  19. package/build/components/block-settings-menu-controls/edit-section-menu-item.cjs.map +2 -2
  20. package/build/components/block-settings-menu-controls/index.cjs +11 -16
  21. package/build/components/block-settings-menu-controls/index.cjs.map +2 -2
  22. package/build/components/block-toolbar/block-toolbar-icon.cjs +6 -4
  23. package/build/components/block-toolbar/block-toolbar-icon.cjs.map +2 -2
  24. package/build/components/block-toolbar/index.cjs +2 -2
  25. package/build/components/block-toolbar/index.cjs.map +2 -2
  26. package/build/components/block-tools/index.cjs +2 -26
  27. package/build/components/block-tools/index.cjs.map +2 -2
  28. package/build/components/block-variation-transforms/index.cjs +1 -2
  29. package/build/components/block-variation-transforms/index.cjs.map +2 -2
  30. package/build/components/block-visibility/index.cjs +7 -9
  31. package/build/components/block-visibility/index.cjs.map +3 -3
  32. package/build/components/block-visibility/modal.cjs +18 -103
  33. package/build/components/block-visibility/modal.cjs.map +2 -2
  34. package/build/components/block-visibility/use-block-visibility.cjs +1 -1
  35. package/build/components/block-visibility/use-block-visibility.cjs.map +2 -2
  36. package/build/components/block-visibility/utils.cjs +5 -1
  37. package/build/components/block-visibility/utils.cjs.map +2 -2
  38. package/build/components/block-visibility/viewport-menu-item.cjs +11 -4
  39. package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
  40. package/build/components/block-visibility/viewport-toolbar.cjs +4 -6
  41. package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
  42. package/build/components/block-visibility/viewport-visibility-info.cjs +121 -0
  43. package/build/components/block-visibility/viewport-visibility-info.cjs.map +7 -0
  44. package/build/components/color-palette/with-color-context.cjs +1 -1
  45. package/build/components/color-palette/with-color-context.cjs.map +2 -2
  46. package/build/components/color-style-selector/index.cjs +1 -1
  47. package/build/components/color-style-selector/index.cjs.map +2 -2
  48. package/build/components/colors/with-colors.cjs +5 -3
  49. package/build/components/colors/with-colors.cjs.map +2 -2
  50. package/build/components/colors-gradients/dropdown.cjs +1 -1
  51. package/build/components/colors-gradients/dropdown.cjs.map +2 -2
  52. package/build/components/editable-text/index.cjs +5 -1
  53. package/build/components/editable-text/index.cjs.map +2 -2
  54. package/build/components/font-sizes/with-font-sizes.cjs +5 -3
  55. package/build/components/font-sizes/with-font-sizes.cjs.map +2 -2
  56. package/build/components/global-styles/advanced-panel.cjs +26 -13
  57. package/build/components/global-styles/advanced-panel.cjs.map +2 -2
  58. package/build/components/global-styles/filters-panel.cjs +1 -1
  59. package/build/components/global-styles/filters-panel.cjs.map +2 -2
  60. package/build/components/global-styles/shadow-panel-components.cjs +1 -1
  61. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  62. package/build/components/gradients/with-gradient.cjs +1 -1
  63. package/build/components/gradients/with-gradient.cjs.map +2 -2
  64. package/build/components/inserter/index.cjs +1 -0
  65. package/build/components/inserter/index.cjs.map +2 -2
  66. package/build/components/inspector-controls/fill.cjs +12 -2
  67. package/build/components/inspector-controls/fill.cjs.map +2 -2
  68. package/build/components/inspector-controls/index.cjs +1 -1
  69. package/build/components/inspector-controls/index.cjs.map +2 -2
  70. package/build/components/inspector-controls-tabs/index.cjs +3 -3
  71. package/build/components/inspector-controls-tabs/index.cjs.map +3 -3
  72. package/build/components/inspector-controls-tabs/styles-tab.cjs +1 -1
  73. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  74. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs +2 -2
  75. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
  76. package/build/components/list-view/block-select-button.cjs +8 -16
  77. package/build/components/list-view/block-select-button.cjs.map +2 -2
  78. package/build/components/list-view/block.cjs +29 -34
  79. package/build/components/list-view/block.cjs.map +3 -3
  80. package/build/components/list-view/utils.cjs +3 -1
  81. package/build/components/list-view/utils.cjs.map +2 -2
  82. package/build/components/media-replace-flow/index.cjs +2 -2
  83. package/build/components/media-replace-flow/index.cjs.map +2 -2
  84. package/build/components/provider/index.cjs +7 -8
  85. package/build/components/provider/index.cjs.map +2 -2
  86. package/build/components/provider/with-registry-provider.cjs +1 -1
  87. package/build/components/provider/with-registry-provider.cjs.map +2 -2
  88. package/build/components/rich-text/index.cjs +1 -1
  89. package/build/components/rich-text/index.cjs.map +2 -2
  90. package/build/components/use-block-commands/index.cjs +2 -34
  91. package/build/components/use-block-commands/index.cjs.map +2 -2
  92. package/build/components/use-block-display-information/index.cjs +1 -1
  93. package/build/components/use-block-display-information/index.cjs.map +2 -2
  94. package/build/components/writing-flow/index.cjs +2 -0
  95. package/build/components/writing-flow/index.cjs.map +2 -2
  96. package/build/components/writing-flow/use-arrow-nav.cjs +3 -0
  97. package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
  98. package/build/components/writing-flow/use-drag-selection.cjs +2 -1
  99. package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
  100. package/build/components/writing-flow/use-preview-mode-nav.cjs +92 -0
  101. package/build/components/writing-flow/use-preview-mode-nav.cjs.map +7 -0
  102. package/build/hooks/block-renaming.cjs +1 -1
  103. package/build/hooks/block-renaming.cjs.map +2 -2
  104. package/build/hooks/cross-origin-isolation.cjs +1 -1
  105. package/build/hooks/cross-origin-isolation.cjs.map +2 -2
  106. package/build/hooks/custom-css.cjs +141 -0
  107. package/build/hooks/custom-css.cjs.map +7 -0
  108. package/build/hooks/fit-text.cjs +14 -7
  109. package/build/hooks/fit-text.cjs.map +2 -2
  110. package/build/hooks/grid-visualizer.cjs +1 -1
  111. package/build/hooks/grid-visualizer.cjs.map +2 -2
  112. package/build/hooks/index.cjs +4 -2
  113. package/build/hooks/index.cjs.map +3 -3
  114. package/build/hooks/layout.cjs +10 -4
  115. package/build/hooks/layout.cjs.map +2 -2
  116. package/build/hooks/list-view.cjs +9 -5
  117. package/build/hooks/list-view.cjs.map +3 -3
  118. package/build/hooks/utils.cjs +2 -2
  119. package/build/hooks/utils.cjs.map +2 -2
  120. package/build/layouts/grid.cjs +12 -1
  121. package/build/layouts/grid.cjs.map +2 -2
  122. package/build/store/actions.cjs +5 -0
  123. package/build/store/actions.cjs.map +2 -2
  124. package/build/store/defaults.cjs +3 -0
  125. package/build/store/defaults.cjs.map +2 -2
  126. package/build/store/private-selectors.cjs +46 -38
  127. package/build/store/private-selectors.cjs.map +2 -2
  128. package/build/store/reducer.cjs +5 -7
  129. package/build/store/reducer.cjs.map +2 -2
  130. package/build/store/selectors.cjs +15 -0
  131. package/build/store/selectors.cjs.map +2 -2
  132. package/build/utils/fit-text-utils.cjs +18 -4
  133. package/build/utils/fit-text-utils.cjs.map +2 -2
  134. package/build-module/components/block-breadcrumb/index.mjs +10 -2
  135. package/build-module/components/block-breadcrumb/index.mjs.map +2 -2
  136. package/build-module/components/block-controls/index.mjs +1 -1
  137. package/build-module/components/block-controls/index.mjs.map +2 -2
  138. package/build-module/components/block-inspector/index.mjs +8 -21
  139. package/build-module/components/block-inspector/index.mjs.map +2 -2
  140. package/build-module/components/block-list/block.mjs +6 -3
  141. package/build-module/components/block-list/block.mjs.map +3 -3
  142. package/build-module/components/block-list/index.mjs +26 -18
  143. package/build-module/components/block-list/index.mjs.map +2 -2
  144. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs +39 -19
  145. package/build-module/components/block-list/use-block-props/use-selected-block-event-handlers.mjs.map +2 -2
  146. package/build-module/components/block-list/use-in-between-inserter.mjs +4 -4
  147. package/build-module/components/block-list/use-in-between-inserter.mjs.map +2 -2
  148. package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +10 -7
  149. package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
  150. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.mjs +1 -1
  151. package/build-module/components/block-settings-menu-controls/edit-section-menu-item.mjs.map +2 -2
  152. package/build-module/components/block-settings-menu-controls/index.mjs +12 -17
  153. package/build-module/components/block-settings-menu-controls/index.mjs.map +2 -2
  154. package/build-module/components/block-toolbar/block-toolbar-icon.mjs +6 -4
  155. package/build-module/components/block-toolbar/block-toolbar-icon.mjs.map +2 -2
  156. package/build-module/components/block-toolbar/index.mjs +3 -3
  157. package/build-module/components/block-toolbar/index.mjs.map +2 -2
  158. package/build-module/components/block-tools/index.mjs +2 -26
  159. package/build-module/components/block-tools/index.mjs.map +2 -2
  160. package/build-module/components/block-variation-transforms/index.mjs +1 -2
  161. package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
  162. package/build-module/components/block-visibility/index.mjs +6 -9
  163. package/build-module/components/block-visibility/index.mjs.map +2 -2
  164. package/build-module/components/block-visibility/modal.mjs +18 -103
  165. package/build-module/components/block-visibility/modal.mjs.map +2 -2
  166. package/build-module/components/block-visibility/use-block-visibility.mjs +1 -1
  167. package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
  168. package/build-module/components/block-visibility/utils.mjs +5 -1
  169. package/build-module/components/block-visibility/utils.mjs.map +2 -2
  170. package/build-module/components/block-visibility/viewport-menu-item.mjs +11 -4
  171. package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
  172. package/build-module/components/block-visibility/viewport-toolbar.mjs +4 -6
  173. package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
  174. package/build-module/components/block-visibility/viewport-visibility-info.mjs +95 -0
  175. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +7 -0
  176. package/build-module/components/color-palette/with-color-context.mjs +1 -1
  177. package/build-module/components/color-palette/with-color-context.mjs.map +2 -2
  178. package/build-module/components/color-style-selector/index.mjs +1 -1
  179. package/build-module/components/color-style-selector/index.mjs.map +2 -2
  180. package/build-module/components/colors/with-colors.mjs +5 -3
  181. package/build-module/components/colors/with-colors.mjs.map +2 -2
  182. package/build-module/components/colors-gradients/dropdown.mjs +1 -1
  183. package/build-module/components/colors-gradients/dropdown.mjs.map +2 -2
  184. package/build-module/components/editable-text/index.mjs +5 -1
  185. package/build-module/components/editable-text/index.mjs.map +2 -2
  186. package/build-module/components/font-sizes/with-font-sizes.mjs +5 -3
  187. package/build-module/components/font-sizes/with-font-sizes.mjs.map +2 -2
  188. package/build-module/components/global-styles/advanced-panel.mjs +22 -13
  189. package/build-module/components/global-styles/advanced-panel.mjs.map +2 -2
  190. package/build-module/components/global-styles/filters-panel.mjs +1 -1
  191. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  192. package/build-module/components/global-styles/shadow-panel-components.mjs +1 -1
  193. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  194. package/build-module/components/gradients/with-gradient.mjs +1 -1
  195. package/build-module/components/gradients/with-gradient.mjs.map +2 -2
  196. package/build-module/components/inserter/index.mjs +1 -0
  197. package/build-module/components/inserter/index.mjs.map +2 -2
  198. package/build-module/components/inspector-controls/fill.mjs +12 -2
  199. package/build-module/components/inspector-controls/fill.mjs.map +2 -2
  200. package/build-module/components/inspector-controls/index.mjs +1 -1
  201. package/build-module/components/inspector-controls/index.mjs.map +2 -2
  202. package/build-module/components/inspector-controls-tabs/index.mjs +3 -3
  203. package/build-module/components/inspector-controls-tabs/index.mjs.map +2 -2
  204. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +1 -1
  205. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  206. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs +2 -2
  207. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
  208. package/build-module/components/list-view/block-select-button.mjs +8 -16
  209. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  210. package/build-module/components/list-view/block.mjs +31 -36
  211. package/build-module/components/list-view/block.mjs.map +2 -2
  212. package/build-module/components/list-view/utils.mjs +3 -1
  213. package/build-module/components/list-view/utils.mjs.map +2 -2
  214. package/build-module/components/media-replace-flow/index.mjs +2 -2
  215. package/build-module/components/media-replace-flow/index.mjs.map +2 -2
  216. package/build-module/components/provider/index.mjs +7 -8
  217. package/build-module/components/provider/index.mjs.map +2 -2
  218. package/build-module/components/provider/with-registry-provider.mjs +1 -1
  219. package/build-module/components/provider/with-registry-provider.mjs.map +2 -2
  220. package/build-module/components/rich-text/index.mjs +1 -1
  221. package/build-module/components/rich-text/index.mjs.map +2 -2
  222. package/build-module/components/use-block-commands/index.mjs +3 -37
  223. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  224. package/build-module/components/use-block-display-information/index.mjs +1 -1
  225. package/build-module/components/use-block-display-information/index.mjs.map +2 -2
  226. package/build-module/components/writing-flow/index.mjs +2 -0
  227. package/build-module/components/writing-flow/index.mjs.map +2 -2
  228. package/build-module/components/writing-flow/use-arrow-nav.mjs +3 -0
  229. package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
  230. package/build-module/components/writing-flow/use-drag-selection.mjs +2 -1
  231. package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
  232. package/build-module/components/writing-flow/use-preview-mode-nav.mjs +67 -0
  233. package/build-module/components/writing-flow/use-preview-mode-nav.mjs.map +7 -0
  234. package/build-module/hooks/block-renaming.mjs +1 -1
  235. package/build-module/hooks/block-renaming.mjs.map +2 -2
  236. package/build-module/hooks/cross-origin-isolation.mjs +1 -1
  237. package/build-module/hooks/cross-origin-isolation.mjs.map +2 -2
  238. package/build-module/hooks/custom-css.mjs +112 -0
  239. package/build-module/hooks/custom-css.mjs.map +7 -0
  240. package/build-module/hooks/fit-text.mjs +14 -7
  241. package/build-module/hooks/fit-text.mjs.map +2 -2
  242. package/build-module/hooks/grid-visualizer.mjs +1 -1
  243. package/build-module/hooks/grid-visualizer.mjs.map +2 -2
  244. package/build-module/hooks/index.mjs +4 -2
  245. package/build-module/hooks/index.mjs.map +2 -2
  246. package/build-module/hooks/layout.mjs +10 -4
  247. package/build-module/hooks/layout.mjs.map +2 -2
  248. package/build-module/hooks/list-view.mjs +10 -6
  249. package/build-module/hooks/list-view.mjs.map +2 -2
  250. package/build-module/hooks/utils.mjs +2 -2
  251. package/build-module/hooks/utils.mjs.map +2 -2
  252. package/build-module/layouts/grid.mjs +12 -1
  253. package/build-module/layouts/grid.mjs.map +2 -2
  254. package/build-module/store/actions.mjs +5 -0
  255. package/build-module/store/actions.mjs.map +2 -2
  256. package/build-module/store/defaults.mjs +3 -0
  257. package/build-module/store/defaults.mjs.map +2 -2
  258. package/build-module/store/private-selectors.mjs +43 -41
  259. package/build-module/store/private-selectors.mjs.map +2 -2
  260. package/build-module/store/reducer.mjs +5 -7
  261. package/build-module/store/reducer.mjs.map +2 -2
  262. package/build-module/store/selectors.mjs +15 -0
  263. package/build-module/store/selectors.mjs.map +2 -2
  264. package/build-module/utils/fit-text-utils.mjs +18 -4
  265. package/build-module/utils/fit-text-utils.mjs.map +2 -2
  266. package/build-style/content-rtl.css +10 -0
  267. package/build-style/content.css +10 -0
  268. package/build-style/style-rtl.css +3 -0
  269. package/build-style/style.css +3 -0
  270. package/package.json +39 -39
  271. package/src/components/block-breadcrumb/index.js +6 -1
  272. package/src/components/block-controls/index.js +1 -1
  273. package/src/components/block-controls/test/index.js +1 -0
  274. package/src/components/block-edit/test/edit.js +10 -0
  275. package/src/components/block-inspector/index.js +15 -36
  276. package/src/components/block-list/block.js +5 -2
  277. package/src/components/block-list/content.scss +11 -0
  278. package/src/components/block-list/index.js +25 -17
  279. package/src/components/block-list/use-block-props/use-selected-block-event-handlers.js +51 -36
  280. package/src/components/block-list/use-in-between-inserter.js +8 -6
  281. package/src/components/block-preview/test/index.js +11 -7
  282. package/src/components/block-settings-menu/block-settings-dropdown.js +11 -6
  283. package/src/components/block-settings-menu-controls/edit-section-menu-item.js +1 -7
  284. package/src/components/block-settings-menu-controls/index.js +16 -18
  285. package/src/components/block-switcher/test/index.js +2 -0
  286. package/src/components/block-switcher/test/use-transformed.patterns.js +2 -0
  287. package/src/components/block-switcher/test/utils.js +2 -0
  288. package/src/components/block-toolbar/block-toolbar-icon.js +6 -10
  289. package/src/components/block-toolbar/index.js +3 -9
  290. package/src/components/block-tools/index.js +2 -29
  291. package/src/components/block-variation-transforms/index.js +1 -4
  292. package/src/components/block-visibility/index.js +3 -19
  293. package/src/components/block-visibility/modal.js +16 -14
  294. package/src/components/block-visibility/test/use-block-visibility.js +27 -25
  295. package/src/components/block-visibility/test/utils.js +24 -8
  296. package/src/components/block-visibility/use-block-visibility.js +1 -4
  297. package/src/components/block-visibility/utils.js +9 -1
  298. package/src/components/block-visibility/viewport-menu-item.js +11 -5
  299. package/src/components/block-visibility/viewport-toolbar.js +5 -6
  300. package/src/components/block-visibility/viewport-visibility-info.js +131 -0
  301. package/src/components/color-palette/with-color-context.js +1 -1
  302. package/src/components/color-style-selector/index.js +2 -3
  303. package/src/components/colors/with-colors.js +23 -20
  304. package/src/components/colors-gradients/dropdown.js +2 -3
  305. package/src/components/editable-text/index.js +5 -1
  306. package/src/components/font-sizes/with-font-sizes.js +13 -10
  307. package/src/components/global-styles/advanced-panel.js +35 -16
  308. package/src/components/global-styles/filters-panel.js +2 -3
  309. package/src/components/global-styles/shadow-panel-components.js +1 -1
  310. package/src/components/global-styles/style.scss +9 -5
  311. package/src/components/gradients/with-gradient.js +7 -4
  312. package/src/components/inner-blocks/test/index.js +2 -0
  313. package/src/components/inserter/index.js +1 -0
  314. package/src/components/inserter/stories/index.story.jsx +31 -24
  315. package/src/components/inspector-controls/fill.js +25 -5
  316. package/src/components/inspector-controls/index.js +1 -1
  317. package/src/components/inspector-controls-tabs/index.js +6 -2
  318. package/src/components/inspector-controls-tabs/styles-tab.js +7 -8
  319. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +3 -4
  320. package/src/components/link-control/test/index.js +6 -1
  321. package/src/components/list-view/block-select-button.js +16 -25
  322. package/src/components/list-view/block.js +38 -43
  323. package/src/components/list-view/utils.js +4 -2
  324. package/src/components/media-replace-flow/index.js +3 -3
  325. package/src/components/media-replace-flow/test/index.js +13 -11
  326. package/src/components/provider/index.js +11 -10
  327. package/src/components/provider/test/use-block-sync.js +1 -0
  328. package/src/components/provider/with-registry-provider.js +1 -1
  329. package/src/components/rich-text/index.js +1 -1
  330. package/src/components/use-block-commands/index.js +0 -41
  331. package/src/components/use-block-display-information/index.js +1 -5
  332. package/src/components/writing-flow/index.js +2 -0
  333. package/src/components/writing-flow/use-arrow-nav.js +5 -0
  334. package/src/components/writing-flow/use-drag-selection.js +7 -1
  335. package/src/components/writing-flow/use-preview-mode-nav.js +102 -0
  336. package/src/hooks/block-renaming.js +5 -2
  337. package/src/hooks/cross-origin-isolation.js +19 -18
  338. package/src/hooks/custom-css.js +176 -0
  339. package/src/hooks/fit-text.js +20 -5
  340. package/src/hooks/grid-visualizer.js +15 -14
  341. package/src/hooks/index.js +4 -2
  342. package/src/hooks/layout.js +55 -43
  343. package/src/hooks/list-view.js +10 -6
  344. package/src/hooks/test/align.js +1 -0
  345. package/src/hooks/test/allowed-blocks.js +8 -0
  346. package/src/hooks/test/auto-inspector-controls.js +4 -0
  347. package/src/hooks/test/font-size.js +1 -0
  348. package/src/hooks/test/metadata.js +4 -0
  349. package/src/hooks/test/text-align.js +1 -0
  350. package/src/hooks/utils.js +123 -119
  351. package/src/layouts/grid.js +19 -3
  352. package/src/layouts/test/grid.js +1 -1
  353. package/src/store/actions.js +7 -0
  354. package/src/store/defaults.js +4 -0
  355. package/src/store/private-selectors.js +94 -64
  356. package/src/store/reducer.js +11 -18
  357. package/src/store/selectors.js +25 -0
  358. package/src/store/test/actions.js +7 -0
  359. package/src/store/test/private-selectors.js +116 -119
  360. package/src/store/test/reducer.js +262 -266
  361. package/src/store/test/registry-selectors.js +2 -0
  362. package/src/store/test/selectors.js +19 -0
  363. package/src/utils/fit-text-utils.js +31 -5
  364. package/build/components/block-visibility/block-visibility-info.cjs +0 -63
  365. package/build/components/block-visibility/block-visibility-info.cjs.map +0 -7
  366. package/build/components/block-visibility/menu-item.cjs +0 -109
  367. package/build/components/block-visibility/menu-item.cjs.map +0 -7
  368. package/build/components/block-visibility/toolbar.cjs +0 -92
  369. package/build/components/block-visibility/toolbar.cjs.map +0 -7
  370. package/build/components/content-lock/index.cjs +0 -31
  371. package/build/components/content-lock/index.cjs.map +0 -7
  372. package/build/components/content-lock/modify-content-lock-menu-item.cjs +0 -70
  373. package/build/components/content-lock/modify-content-lock-menu-item.cjs.map +0 -7
  374. package/build/hooks/content-lock-ui.cjs +0 -68
  375. package/build/hooks/content-lock-ui.cjs.map +0 -7
  376. package/build-module/components/block-visibility/block-visibility-info.mjs +0 -47
  377. package/build-module/components/block-visibility/block-visibility-info.mjs.map +0 -7
  378. package/build-module/components/block-visibility/menu-item.mjs +0 -88
  379. package/build-module/components/block-visibility/menu-item.mjs.map +0 -7
  380. package/build-module/components/block-visibility/toolbar.mjs +0 -71
  381. package/build-module/components/block-visibility/toolbar.mjs.map +0 -7
  382. package/build-module/components/content-lock/index.mjs +0 -6
  383. package/build-module/components/content-lock/index.mjs.map +0 -7
  384. package/build-module/components/content-lock/modify-content-lock-menu-item.mjs +0 -45
  385. package/build-module/components/content-lock/modify-content-lock-menu-item.mjs.map +0 -7
  386. package/build-module/hooks/content-lock-ui.mjs +0 -47
  387. package/build-module/hooks/content-lock-ui.mjs.map +0 -7
  388. package/src/components/block-visibility/block-visibility-info.js +0 -62
  389. package/src/components/block-visibility/menu-item.js +0 -96
  390. package/src/components/block-visibility/toolbar.js +0 -88
  391. package/src/components/content-lock/index.js +0 -1
  392. package/src/components/content-lock/modify-content-lock-menu-item.js +0 -67
  393. package/src/hooks/content-lock-ui.js +0 -76
@@ -199,6 +199,7 @@ describe( 'state', () => {
199
199
  describe( 'blocks()', () => {
200
200
  beforeAll( () => {
201
201
  registerBlockType( 'core/test-block', {
202
+ apiVersion: 3,
202
203
  save: noop,
203
204
  edit: noop,
204
205
  category: 'text',
@@ -213,12 +214,14 @@ describe( 'state', () => {
213
214
  describe( 'replace inner blocks', () => {
214
215
  beforeAll( () => {
215
216
  registerBlockType( 'core/test-parent-block', {
217
+ apiVersion: 3,
216
218
  save: noop,
217
219
  edit: noop,
218
220
  category: 'text',
219
221
  title: 'test parent block',
220
222
  } );
221
223
  registerBlockType( 'core/test-child-block', {
224
+ apiVersion: 3,
222
225
  save: noop,
223
226
  edit: noop,
224
227
  category: 'text',
@@ -2994,6 +2997,7 @@ describe( 'state', () => {
2994
2997
  blockAttributes?.fruit === variationAttributes.fruit,
2995
2998
  } ) );
2996
2999
  registerBlockType( blockWithVariations, {
3000
+ apiVersion: 3,
2997
3001
  save: noop,
2998
3002
  edit: noop,
2999
3003
  title: 'Fruit with variations',
@@ -3973,6 +3977,9 @@ describe( 'state', () => {
3973
3977
  expect( editingState.derivedBlockEditingModes ).toEqual(
3974
3978
  new Map(
3975
3979
  Object.entries( {
3980
+ // blocks outside the section are disabled.
3981
+ '': 'disabled',
3982
+ // blocks inside the section are fully editable.
3976
3983
  'group-1': 'default',
3977
3984
  'paragraph-1': 'default',
3978
3985
  'group-2': 'default',
@@ -4082,9 +4089,13 @@ describe( 'state', () => {
4082
4089
  expect( editingSection1.derivedBlockEditingModes ).toEqual(
4083
4090
  new Map(
4084
4091
  Object.entries( {
4092
+ // Blocks outside the section are disabled.
4093
+ '': 'disabled',
4094
+ 'section-2': 'disabled',
4095
+ 'section-2-paragraph': 'disabled',
4096
+ // Block inside the section are fully editable.
4085
4097
  'section-1': 'default',
4086
4098
  'section-1-paragraph': 'default',
4087
- 'section-2-paragraph': 'contentOnly',
4088
4099
  } )
4089
4100
  )
4090
4101
  );
@@ -4283,294 +4294,279 @@ describe( 'state', () => {
4283
4294
  } );
4284
4295
  } );
4285
4296
 
4286
- // Tests for the contentOnly experiments pattern.
4287
- // If/when the experiment is stabilized, this wrapping `describe` and
4288
- // `beforeAll`/`afterAll` can be removed, un-nesting the tests within.
4289
- describe( 'contentOnly patterns experiment', () => {
4297
+ describe( 'unsynced patterns', () => {
4298
+ let initialState;
4290
4299
  beforeAll( () => {
4291
- globalThis.window.__experimentalContentOnlyPatternInsertion = true;
4292
- } );
4293
-
4294
- afterAll( () => {
4295
- delete globalThis.window
4296
- .__experimentalContentOnlyPatternInsertion;
4297
- } );
4298
-
4299
- describe( 'unsynced patterns', () => {
4300
- let initialState;
4301
- beforeAll( () => {
4302
- initialState = dispatchActions(
4303
- [
4304
- {
4305
- type: 'RESET_BLOCKS',
4306
- blocks: [
4307
- {
4308
- name: 'core/group',
4309
- clientId: 'group-1',
4310
- attributes: {
4311
- metadata: {
4312
- patternName: 'test-pattern',
4313
- },
4300
+ initialState = dispatchActions(
4301
+ [
4302
+ {
4303
+ type: 'RESET_BLOCKS',
4304
+ blocks: [
4305
+ {
4306
+ name: 'core/group',
4307
+ clientId: 'group-1',
4308
+ attributes: {
4309
+ metadata: {
4310
+ patternName: 'test-pattern',
4314
4311
  },
4315
- innerBlocks: [
4316
- {
4317
- name: 'core/paragraph',
4318
- clientId: 'paragraph-1',
4319
- attributes: {},
4320
- innerBlocks: [],
4321
- },
4322
- {
4323
- name: 'core/group',
4324
- clientId: 'group-2',
4325
- attributes: {},
4326
- innerBlocks: [
4327
- {
4328
- name: 'core/paragraph',
4329
- clientId: 'paragraph-2',
4330
- attributes: {},
4331
- innerBlocks: [],
4332
- },
4333
- ],
4334
- },
4335
- ],
4336
4312
  },
4337
- ],
4338
- },
4339
- ],
4340
- testReducer,
4341
- initialState
4342
- );
4343
- } );
4313
+ innerBlocks: [
4314
+ {
4315
+ name: 'core/paragraph',
4316
+ clientId: 'paragraph-1',
4317
+ attributes: {},
4318
+ innerBlocks: [],
4319
+ },
4320
+ {
4321
+ name: 'core/group',
4322
+ clientId: 'group-2',
4323
+ attributes: {},
4324
+ innerBlocks: [
4325
+ {
4326
+ name: 'core/paragraph',
4327
+ clientId: 'paragraph-2',
4328
+ attributes: {},
4329
+ innerBlocks: [],
4330
+ },
4331
+ ],
4332
+ },
4333
+ ],
4334
+ },
4335
+ ],
4336
+ },
4337
+ ],
4338
+ testReducer,
4339
+ initialState
4340
+ );
4341
+ } );
4344
4342
 
4345
- it( 'returns the expected block editing modes for an unsynced pattern', () => {
4346
- expect( initialState.derivedBlockEditingModes ).toEqual(
4347
- new Map(
4348
- Object.entries( {
4349
- 'paragraph-1': 'contentOnly',
4350
- 'group-2': 'disabled',
4351
- 'paragraph-2': 'contentOnly',
4352
- } )
4353
- )
4354
- );
4355
- } );
4343
+ it( 'returns the expected block editing modes for an unsynced pattern', () => {
4344
+ expect( initialState.derivedBlockEditingModes ).toEqual(
4345
+ new Map(
4346
+ Object.entries( {
4347
+ 'paragraph-1': 'contentOnly',
4348
+ 'group-2': 'disabled',
4349
+ 'paragraph-2': 'contentOnly',
4350
+ } )
4351
+ )
4352
+ );
4353
+ } );
4356
4354
 
4357
- it( 'removes block editing modes when an unsynced pattern is removed', () => {
4358
- const { derivedBlockEditingModes } = dispatchActions(
4359
- [
4360
- {
4361
- type: 'REMOVE_BLOCKS',
4362
- clientIds: [ 'group-1' ],
4363
- },
4364
- ],
4365
- testReducer,
4366
- initialState
4367
- );
4355
+ it( 'removes block editing modes when an unsynced pattern is removed', () => {
4356
+ const { derivedBlockEditingModes } = dispatchActions(
4357
+ [
4358
+ {
4359
+ type: 'REMOVE_BLOCKS',
4360
+ clientIds: [ 'group-1' ],
4361
+ },
4362
+ ],
4363
+ testReducer,
4364
+ initialState
4365
+ );
4368
4366
 
4369
- expect( derivedBlockEditingModes ).toEqual( new Map() );
4370
- } );
4367
+ expect( derivedBlockEditingModes ).toEqual( new Map() );
4368
+ } );
4371
4369
 
4372
- it( 'removes block editing modes when the `patternName` attribute is removed from the unsynced pattern', () => {
4373
- const { derivedBlockEditingModes } = dispatchActions(
4374
- [
4375
- {
4376
- type: 'UPDATE_BLOCK_ATTRIBUTES',
4377
- clientIds: [ 'group-1' ],
4378
- attributes: {
4379
- metadata: {
4380
- patternName: undefined,
4381
- },
4370
+ it( 'removes block editing modes when the `patternName` attribute is removed from the unsynced pattern', () => {
4371
+ const { derivedBlockEditingModes } = dispatchActions(
4372
+ [
4373
+ {
4374
+ type: 'UPDATE_BLOCK_ATTRIBUTES',
4375
+ clientIds: [ 'group-1' ],
4376
+ attributes: {
4377
+ metadata: {
4378
+ patternName: undefined,
4382
4379
  },
4383
4380
  },
4384
- ],
4385
- testReducer,
4386
- initialState
4387
- );
4381
+ },
4382
+ ],
4383
+ testReducer,
4384
+ initialState
4385
+ );
4388
4386
 
4389
- expect( derivedBlockEditingModes ).toEqual( new Map() );
4390
- } );
4387
+ expect( derivedBlockEditingModes ).toEqual( new Map() );
4388
+ } );
4391
4389
 
4392
- it( 'allows explicitly set blockEditingModes to override the unsynced pattern editing modes', () => {
4393
- const { derivedBlockEditingModes } = dispatchActions(
4394
- [
4395
- {
4396
- type: 'SET_BLOCK_EDITING_MODE',
4397
- clientId: 'paragraph-2',
4398
- mode: 'disabled',
4399
- },
4400
- ],
4401
- testReducer,
4402
- initialState
4403
- );
4390
+ it( 'allows explicitly set blockEditingModes to override the unsynced pattern editing modes', () => {
4391
+ const { derivedBlockEditingModes } = dispatchActions(
4392
+ [
4393
+ {
4394
+ type: 'SET_BLOCK_EDITING_MODE',
4395
+ clientId: 'paragraph-2',
4396
+ mode: 'disabled',
4397
+ },
4398
+ ],
4399
+ testReducer,
4400
+ initialState
4401
+ );
4404
4402
 
4405
- expect( derivedBlockEditingModes ).toEqual(
4406
- new Map(
4407
- Object.entries( {
4408
- 'paragraph-1': 'contentOnly',
4409
- 'group-2': 'disabled',
4410
- // Paragraph 2 already has an explicit mode, so isn't set as a derived mode.
4411
- } )
4412
- )
4413
- );
4414
- } );
4403
+ expect( derivedBlockEditingModes ).toEqual(
4404
+ new Map(
4405
+ Object.entries( {
4406
+ 'paragraph-1': 'contentOnly',
4407
+ 'group-2': 'disabled',
4408
+ // Paragraph 2 already has an explicit mode, so isn't set as a derived mode.
4409
+ } )
4410
+ )
4411
+ );
4412
+ } );
4415
4413
 
4416
- it( 'sets the correct block editing modes when a new unsynced pattern is inserted', () => {
4417
- const { derivedBlockEditingModes } = dispatchActions(
4418
- [
4419
- {
4420
- type: 'INSERT_BLOCKS',
4421
- rootClientId: '',
4422
- index: 1,
4423
- blocks: [
4424
- {
4425
- name: 'core/group',
4426
- clientId: 'group-3',
4427
- attributes: {
4428
- metadata: {
4429
- patternName: 'test-pattern-2',
4430
- },
4414
+ it( 'sets the correct block editing modes when a new unsynced pattern is inserted', () => {
4415
+ const { derivedBlockEditingModes } = dispatchActions(
4416
+ [
4417
+ {
4418
+ type: 'INSERT_BLOCKS',
4419
+ rootClientId: '',
4420
+ index: 1,
4421
+ blocks: [
4422
+ {
4423
+ name: 'core/group',
4424
+ clientId: 'group-3',
4425
+ attributes: {
4426
+ metadata: {
4427
+ patternName: 'test-pattern-2',
4431
4428
  },
4432
- innerBlocks: [
4433
- {
4434
- name: 'core/paragraph',
4435
- clientId: 'paragraph-3',
4436
- attributes: {},
4437
- innerBlocks: [],
4438
- },
4439
- ],
4440
4429
  },
4441
- ],
4442
- },
4443
- ],
4444
- testReducer,
4445
- initialState
4446
- );
4430
+ innerBlocks: [
4431
+ {
4432
+ name: 'core/paragraph',
4433
+ clientId: 'paragraph-3',
4434
+ attributes: {},
4435
+ innerBlocks: [],
4436
+ },
4437
+ ],
4438
+ },
4439
+ ],
4440
+ },
4441
+ ],
4442
+ testReducer,
4443
+ initialState
4444
+ );
4447
4445
 
4448
- expect( derivedBlockEditingModes ).toEqual(
4449
- new Map(
4450
- Object.entries( {
4451
- 'paragraph-1': 'contentOnly',
4452
- 'group-2': 'disabled',
4453
- 'paragraph-2': 'contentOnly',
4454
- 'paragraph-3': 'contentOnly',
4455
- } )
4456
- )
4457
- );
4458
- } );
4446
+ expect( derivedBlockEditingModes ).toEqual(
4447
+ new Map(
4448
+ Object.entries( {
4449
+ 'paragraph-1': 'contentOnly',
4450
+ 'group-2': 'disabled',
4451
+ 'paragraph-2': 'contentOnly',
4452
+ 'paragraph-3': 'contentOnly',
4453
+ } )
4454
+ )
4455
+ );
4459
4456
  } );
4457
+ } );
4460
4458
 
4461
- describe( 'template parts', () => {
4462
- let initialState;
4463
- beforeAll( () => {
4464
- // Simulates how the editor typically inserts controlled blocks,
4465
- // - first the template part is inserted with no inner blocks.
4466
- // - next the template part is marked as a controlled block.
4467
- // - finally, once the inner blocks of the template part are received, they're inserted.
4468
- initialState = dispatchActions(
4469
- [
4470
- {
4471
- type: 'RESET_BLOCKS',
4472
- blocks: [
4473
- {
4474
- name: 'core/template-part',
4475
- clientId: 'template-part',
4476
- attributes: {},
4477
- innerBlocks: [],
4478
- },
4479
- ],
4480
- },
4481
- {
4482
- type: 'SET_HAS_CONTROLLED_INNER_BLOCKS',
4483
- clientId: 'template-part',
4484
- hasControlledInnerBlocks: true,
4485
- },
4486
- {
4487
- type: 'REPLACE_INNER_BLOCKS',
4488
- rootClientId: 'template-part',
4489
- blocks: [
4490
- {
4491
- name: 'core/paragraph',
4492
- clientId: 'template-part-paragraph',
4493
- attributes: {},
4494
- innerBlocks: [],
4495
- },
4496
- {
4497
- name: 'core/group',
4498
- clientId: 'template-part-group',
4499
- attributes: {},
4500
- innerBlocks: [
4501
- {
4502
- name: 'core/paragraph',
4503
- clientId:
4504
- 'template-part-grouped-paragraph',
4505
- attributes: {},
4506
- innerBlocks: [],
4507
- },
4508
- ],
4509
- },
4510
- ],
4511
- },
4512
- ],
4513
- testReducer,
4514
- initialState
4515
- );
4516
- } );
4459
+ describe( 'template parts', () => {
4460
+ let initialState;
4461
+ beforeAll( () => {
4462
+ // Simulates how the editor typically inserts controlled blocks,
4463
+ // - first the template part is inserted with no inner blocks.
4464
+ // - next the template part is marked as a controlled block.
4465
+ // - finally, once the inner blocks of the template part are received, they're inserted.
4466
+ initialState = dispatchActions(
4467
+ [
4468
+ {
4469
+ type: 'RESET_BLOCKS',
4470
+ blocks: [
4471
+ {
4472
+ name: 'core/template-part',
4473
+ clientId: 'template-part',
4474
+ attributes: {},
4475
+ innerBlocks: [],
4476
+ },
4477
+ ],
4478
+ },
4479
+ {
4480
+ type: 'SET_HAS_CONTROLLED_INNER_BLOCKS',
4481
+ clientId: 'template-part',
4482
+ hasControlledInnerBlocks: true,
4483
+ },
4484
+ {
4485
+ type: 'REPLACE_INNER_BLOCKS',
4486
+ rootClientId: 'template-part',
4487
+ blocks: [
4488
+ {
4489
+ name: 'core/paragraph',
4490
+ clientId: 'template-part-paragraph',
4491
+ attributes: {},
4492
+ innerBlocks: [],
4493
+ },
4494
+ {
4495
+ name: 'core/group',
4496
+ clientId: 'template-part-group',
4497
+ attributes: {},
4498
+ innerBlocks: [
4499
+ {
4500
+ name: 'core/paragraph',
4501
+ clientId:
4502
+ 'template-part-grouped-paragraph',
4503
+ attributes: {},
4504
+ innerBlocks: [],
4505
+ },
4506
+ ],
4507
+ },
4508
+ ],
4509
+ },
4510
+ ],
4511
+ testReducer,
4512
+ initialState
4513
+ );
4514
+ } );
4517
4515
 
4518
- it( 'returns the expected block editing modes for synced patterns', () => {
4519
- expect( initialState.derivedBlockEditingModes ).toEqual(
4520
- new Map(
4521
- Object.entries( {
4522
- 'template-part-paragraph': 'contentOnly',
4523
- 'template-part-group': 'disabled',
4524
- 'template-part-grouped-paragraph':
4525
- 'contentOnly',
4526
- } )
4527
- )
4528
- );
4529
- } );
4516
+ it( 'returns the expected block editing modes for synced patterns', () => {
4517
+ expect( initialState.derivedBlockEditingModes ).toEqual(
4518
+ new Map(
4519
+ Object.entries( {
4520
+ 'template-part-paragraph': 'contentOnly',
4521
+ 'template-part-group': 'disabled',
4522
+ 'template-part-grouped-paragraph': 'contentOnly',
4523
+ } )
4524
+ )
4525
+ );
4526
+ } );
4530
4527
 
4531
- it( 'removes the block editing modes when the template part is removed', () => {
4532
- const { derivedBlockEditingModes } = dispatchActions(
4533
- [
4534
- {
4535
- type: 'REMOVE_BLOCKS',
4536
- clientIds: [ 'template-part' ],
4537
- },
4538
- {
4539
- type: 'SET_HAS_CONTROLLED_INNER_BLOCKS',
4540
- clientId: 'template-part',
4541
- hasControlledInnerBlocks: false,
4542
- },
4543
- ],
4544
- testReducer,
4545
- initialState
4546
- );
4528
+ it( 'removes the block editing modes when the template part is removed', () => {
4529
+ const { derivedBlockEditingModes } = dispatchActions(
4530
+ [
4531
+ {
4532
+ type: 'REMOVE_BLOCKS',
4533
+ clientIds: [ 'template-part' ],
4534
+ },
4535
+ {
4536
+ type: 'SET_HAS_CONTROLLED_INNER_BLOCKS',
4537
+ clientId: 'template-part',
4538
+ hasControlledInnerBlocks: false,
4539
+ },
4540
+ ],
4541
+ testReducer,
4542
+ initialState
4543
+ );
4547
4544
 
4548
- expect( derivedBlockEditingModes ).toEqual( new Map() );
4549
- } );
4545
+ expect( derivedBlockEditingModes ).toEqual( new Map() );
4546
+ } );
4550
4547
 
4551
- it( 'allows explicitly set blockEditingModes to override the template part editing modes', () => {
4552
- const { derivedBlockEditingModes } = dispatchActions(
4553
- [
4554
- {
4555
- type: 'SET_BLOCK_EDITING_MODE',
4556
- clientId: 'template-part-grouped-paragraph',
4557
- mode: 'disabled',
4558
- },
4559
- ],
4560
- testReducer,
4561
- initialState
4562
- );
4548
+ it( 'allows explicitly set blockEditingModes to override the template part editing modes', () => {
4549
+ const { derivedBlockEditingModes } = dispatchActions(
4550
+ [
4551
+ {
4552
+ type: 'SET_BLOCK_EDITING_MODE',
4553
+ clientId: 'template-part-grouped-paragraph',
4554
+ mode: 'disabled',
4555
+ },
4556
+ ],
4557
+ testReducer,
4558
+ initialState
4559
+ );
4563
4560
 
4564
- expect( derivedBlockEditingModes ).toEqual(
4565
- new Map(
4566
- Object.entries( {
4567
- 'template-part-paragraph': 'contentOnly',
4568
- 'template-part-group': 'disabled',
4569
- // template-part-grouped-paragraph already has an explicit mode, so isn't set as a derived mode.
4570
- } )
4571
- )
4572
- );
4573
- } );
4561
+ expect( derivedBlockEditingModes ).toEqual(
4562
+ new Map(
4563
+ Object.entries( {
4564
+ 'template-part-paragraph': 'contentOnly',
4565
+ 'template-part-group': 'disabled',
4566
+ // template-part-grouped-paragraph already has an explicit mode, so isn't set as a derived mode.
4567
+ } )
4568
+ )
4569
+ );
4574
4570
  } );
4575
4571
  } );
4576
4572
  } );
@@ -12,6 +12,7 @@ import { store } from '../';
12
12
  describe( 'selectors', () => {
13
13
  beforeEach( () => {
14
14
  registerBlockType( 'core/test-block-a', {
15
+ apiVersion: 3,
15
16
  save: ( props ) => props.attributes.text,
16
17
  category: 'design',
17
18
  title: 'Test Block A',
@@ -20,6 +21,7 @@ describe( 'selectors', () => {
20
21
  } );
21
22
 
22
23
  registerBlockType( 'core/test-block-b', {
24
+ apiVersion: 3,
23
25
  save: ( props ) => props.attributes.text,
24
26
  category: 'text',
25
27
  title: 'Test Block B',