@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
@@ -1,6 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
+ import { isReusableBlock, isTemplatePart } from '@wordpress/blocks';
4
5
  import { isTextField } from '@wordpress/dom';
5
6
  import { ENTER, BACKSPACE, DELETE } from '@wordpress/keycodes';
6
7
  import { useSelect, useDispatch } from '@wordpress/data';
@@ -31,6 +32,7 @@ export function useEventHandlers( { clientId, isSelected } ) {
31
32
  hasMultiSelection,
32
33
  isSectionBlock,
33
34
  editedContentOnlySection,
35
+ getBlock,
34
36
  } = unlock( useSelect( blockEditorStore ) );
35
37
  const {
36
38
  insertAfterBlock,
@@ -128,15 +130,13 @@ export function useEventHandlers( { clientId, isSelected } ) {
128
130
 
129
131
  const rect = node.getBoundingClientRect();
130
132
 
131
- const clone = node.cloneNode( true );
132
- clone.style.visibility = 'hidden';
133
- // Maybe remove the clone now that it's relative?
134
- clone.style.display = 'none';
135
-
136
- // Remove the id and leave it on the clone so that drop target
137
- // calculations are correct.
133
+ // Remove the id and leave it on a shallow clone so that drop
134
+ // target calculations are correct.
138
135
  const id = node.id;
136
+ const clone = node.cloneNode();
137
+ clone.style.display = 'none';
139
138
  node.id = null;
139
+ node.after( clone );
140
140
 
141
141
  let _scale = 1;
142
142
 
@@ -154,8 +154,6 @@ export function useEventHandlers( { clientId, isSelected } ) {
154
154
 
155
155
  const inverted = 1 / _scale;
156
156
 
157
- node.after( clone );
158
-
159
157
  const originalNodeProperties = {};
160
158
  for ( const property of [
161
159
  'transform',
@@ -225,32 +223,41 @@ export function useEventHandlers( { clientId, isSelected } ) {
225
223
  }
226
224
 
227
225
  let hasStarted = false;
226
+ let lastClientX = originClientX;
227
+ let lastClientY = originClientY;
228
+
229
+ function dragOver( e ) {
230
+ // Only trigger `over` if the mouse has moved.
231
+ if (
232
+ e.clientX === lastClientX &&
233
+ e.clientY === lastClientY
234
+ ) {
235
+ return;
236
+ }
237
+ lastClientX = e.clientX;
238
+ lastClientY = e.clientY;
239
+ over();
240
+ }
228
241
 
229
- function over( e ) {
242
+ function over() {
230
243
  if ( ! hasStarted ) {
231
244
  hasStarted = true;
232
245
  node.style.pointerEvents = 'none';
233
246
  }
247
+ const pointerYDelta = lastClientY - originClientY;
248
+ const pointerXDelta = lastClientX - originClientX;
234
249
  const scrollTop = defaultView.scrollY;
235
250
  const scrollLeft = defaultView.scrollX;
236
- node.style.top = `${
237
- ( e.clientY -
238
- originClientY +
239
- scrollTop -
240
- originScrollTop ) *
241
- inverted
242
- }px`;
243
- node.style.left = `${
244
- ( e.clientX -
245
- originClientX +
246
- scrollLeft -
247
- originScrollLeft ) *
248
- inverted
249
- }px`;
251
+ const scrollTopDelta = scrollTop - originScrollTop;
252
+ const scrollLeftDelta = scrollLeft - originScrollLeft;
253
+ const topDelta = pointerYDelta + scrollTopDelta;
254
+ const leftDelta = pointerXDelta + scrollLeftDelta;
255
+ node.style.top = `${ topDelta * inverted }px`;
256
+ node.style.left = `${ leftDelta * inverted }px`;
250
257
  }
251
258
 
252
259
  function end() {
253
- ownerDocument.removeEventListener( 'dragover', over );
260
+ ownerDocument.removeEventListener( 'dragover', dragOver );
254
261
  ownerDocument.removeEventListener( 'dragend', end );
255
262
  ownerDocument.removeEventListener( 'drop', end );
256
263
  ownerDocument.removeEventListener( 'scroll', over );
@@ -271,7 +278,7 @@ export function useEventHandlers( { clientId, isSelected } ) {
271
278
  );
272
279
  }
273
280
 
274
- ownerDocument.addEventListener( 'dragover', over );
281
+ ownerDocument.addEventListener( 'dragover', dragOver );
275
282
  ownerDocument.addEventListener( 'dragend', end );
276
283
  ownerDocument.addEventListener( 'drop', end );
277
284
  ownerDocument.addEventListener( 'scroll', over );
@@ -294,31 +301,39 @@ export function useEventHandlers( { clientId, isSelected } ) {
294
301
  */
295
302
  function onDoubleClick( event ) {
296
303
  const isSection = isSectionBlock( clientId );
304
+ const block = getBlock( clientId );
305
+ const isSyncedPattern = isReusableBlock( block );
306
+ const isTemplatePartBlock = isTemplatePart( block );
297
307
  const isAlreadyEditing = editedContentOnlySection === clientId;
298
308
 
299
- if ( isSection && ! isAlreadyEditing ) {
300
- event.preventDefault();
301
- editContentOnlySection( clientId );
309
+ if (
310
+ ! isSection ||
311
+ isAlreadyEditing ||
312
+ isSyncedPattern ||
313
+ isTemplatePartBlock
314
+ ) {
315
+ return;
302
316
  }
303
- }
304
317
 
305
- // Only add double-click listener if experimental flag is enabled
306
- if ( window?.__experimentalContentOnlyPatternInsertion ) {
307
- node.addEventListener( 'dblclick', onDoubleClick );
318
+ event.preventDefault();
319
+ editContentOnlySection( clientId );
308
320
  }
309
321
 
322
+ node.addEventListener( 'dblclick', onDoubleClick );
323
+
310
324
  return () => {
311
325
  node.removeEventListener( 'keydown', onKeyDown );
312
326
  node.removeEventListener( 'dragstart', onDragStart );
313
- if ( window?.__experimentalContentOnlyPatternInsertion ) {
314
- node.removeEventListener( 'dblclick', onDoubleClick );
315
- }
327
+ node.removeEventListener( 'dblclick', onDoubleClick );
316
328
  };
317
329
  },
318
330
  [
319
331
  clientId,
320
332
  isSelected,
321
333
  getBlockRootClientId,
334
+ getBlock,
335
+ isReusableBlock,
336
+ isTemplatePart,
322
337
  insertAfterBlock,
323
338
  removeBlock,
324
339
  isZoomOut,
@@ -15,12 +15,14 @@ import { unlock } from '../../lock-unlock';
15
15
 
16
16
  export function useInBetweenInserter() {
17
17
  const openRef = useContext( InsertionPointOpenRef );
18
- const isInBetweenInserterDisabled = useSelect(
19
- ( select ) =>
20
- select( blockEditorStore ).getSettings().isDistractionFree ||
21
- unlock( select( blockEditorStore ) ).isZoomOut(),
22
- []
23
- );
18
+ const isInBetweenInserterDisabled = useSelect( ( select ) => {
19
+ const settings = select( blockEditorStore ).getSettings();
20
+ return (
21
+ settings.isDistractionFree ||
22
+ settings.isPreviewMode ||
23
+ unlock( select( blockEditorStore ) ).isZoomOut()
24
+ );
25
+ }, [] );
24
26
  const {
25
27
  getBlockListSettings,
26
28
  getBlockIndex,
@@ -16,22 +16,26 @@ import {
16
16
  * Internal dependencies
17
17
  */
18
18
  import { useBlockPreview } from '../';
19
+ import { useBlockProps } from '../../block-list/use-block-props';
19
20
 
20
21
  describe( 'useBlockPreview', () => {
21
22
  beforeAll( () => {
22
23
  registerBlockType( 'core/test-block', {
24
+ apiVersion: 3,
23
25
  save: () => (
24
- <div>
26
+ <div { ...useBlockProps.save() }>
25
27
  Test block save view
26
28
  <button>Button</button>
27
29
  </div>
28
30
  ),
29
- edit: () => (
30
- <div>
31
- Test block edit view
32
- <button>Button</button>
33
- </div>
34
- ),
31
+ edit: function Edit() {
32
+ return (
33
+ <div { ...useBlockProps() }>
34
+ Test block edit view
35
+ <button>Button</button>
36
+ </div>
37
+ );
38
+ },
35
39
  category: 'text',
36
40
  title: 'test block',
37
41
  } );
@@ -87,6 +87,7 @@ export function BlockSettingsDropdown( {
87
87
  selectedBlockClientIds,
88
88
  isContentOnly,
89
89
  isZoomOut,
90
+ canEdit,
90
91
  } = useSelect(
91
92
  ( select ) => {
92
93
  const {
@@ -97,6 +98,7 @@ export function BlockSettingsDropdown( {
97
98
  getBlockAttributes,
98
99
  getBlockEditingMode,
99
100
  isZoomOut: _isZoomOut,
101
+ canEditBlock,
100
102
  } = unlock( select( blockEditorStore ) );
101
103
 
102
104
  const { getActiveBlockVariation } = select( blocksStore );
@@ -121,6 +123,7 @@ export function BlockSettingsDropdown( {
121
123
  isContentOnly:
122
124
  getBlockEditingMode( firstBlockClientId ) === 'contentOnly',
123
125
  isZoomOut: _isZoomOut(),
126
+ canEdit: canEditBlock( firstBlockClientId ),
124
127
  };
125
128
  },
126
129
  [ firstBlockClientId ]
@@ -240,7 +243,7 @@ export function BlockSettingsDropdown( {
240
243
  parentBlockType={ parentBlockType }
241
244
  />
242
245
  ) }
243
- { count === 1 && (
246
+ { canEdit && count === 1 && (
244
247
  <BlockHTMLConvertButton
245
248
  clientId={ firstBlockClientId }
246
249
  />
@@ -252,7 +255,7 @@ export function BlockSettingsDropdown( {
252
255
  shortcut={ shortcuts.copy }
253
256
  />
254
257
  ) }
255
- { ! isContentOnly && (
258
+ { canRemove && ! isContentOnly && (
256
259
  <CopyMenuItem
257
260
  clientIds={ clientIds }
258
261
  label={ __( 'Cut' ) }
@@ -301,7 +304,7 @@ export function BlockSettingsDropdown( {
301
304
  </MenuItem>
302
305
  </>
303
306
  ) }
304
- { count === 1 && (
307
+ { canEdit && count === 1 && (
305
308
  <CommentIconSlotFill.Slot
306
309
  fillProps={ {
307
310
  clientId: firstBlockClientId,
@@ -318,9 +321,11 @@ export function BlockSettingsDropdown( {
318
321
  label={ __( 'Copy styles' ) }
319
322
  eventType="copyStyles"
320
323
  />
321
- <MenuItem onClick={ onPasteStyles }>
322
- { __( 'Paste styles' ) }
323
- </MenuItem>
324
+ { canEdit && (
325
+ <MenuItem onClick={ onPasteStyles }>
326
+ { __( 'Paste styles' ) }
327
+ </MenuItem>
328
+ ) }
324
329
  </MenuGroup>
325
330
  ) }
326
331
  { ! isContentOnly && (
@@ -31,13 +31,7 @@ export function EditSectionMenuItem( { clientId, onClose } ) {
31
31
  [ clientId ]
32
32
  );
33
33
 
34
- // Only show when the experiment is enabled, the block is a section block,
35
- // and we're not already editing it
36
- if (
37
- ! window?.__experimentalContentOnlyPatternInsertion ||
38
- ! isSectionBlock ||
39
- isEditingContentOnlySection
40
- ) {
34
+ if ( ! isSectionBlock || isEditingContentOnlySection ) {
41
35
  return null;
42
36
  }
43
37
 
@@ -19,9 +19,8 @@ import {
19
19
  import { BlockLockMenuItem, useBlockLock } from '../block-lock';
20
20
  import { store as blockEditorStore } from '../../store';
21
21
  import BlockModeToggle from '../block-settings-menu/block-mode-toggle';
22
- import { ModifyContentOnlySectionMenuItem } from '../content-lock';
23
22
  import { BlockRenameControl, useBlockRename } from '../block-rename';
24
- import { BlockVisibilityMenuItem } from '../block-visibility';
23
+ import { BlockVisibilityViewportMenuItem } from '../block-visibility';
25
24
  import { EditSectionMenuItem } from './edit-section-menu-item';
26
25
 
27
26
  const { Fill, Slot } = createSlotFill( 'BlockSettingsMenuControls' );
@@ -32,6 +31,7 @@ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {
32
31
  selectedClientIds,
33
32
  isContentOnly,
34
33
  canToggleSelectedBlocksVisibility,
34
+ canEdit,
35
35
  } = useSelect(
36
36
  ( select ) => {
37
37
  const {
@@ -39,6 +39,7 @@ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {
39
39
  getBlockNamesByClientId,
40
40
  getSelectedBlockClientIds,
41
41
  getBlockEditingMode,
42
+ canEditBlock,
42
43
  } = select( blockEditorStore );
43
44
  const ids =
44
45
  clientIds !== null ? clientIds : getSelectedBlockClientIds();
@@ -52,6 +53,7 @@ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {
52
53
  ).every( ( block ) =>
53
54
  hasBlockSupport( block.name, 'visibility', true )
54
55
  ),
56
+ canEdit: canEditBlock( ids[ 0 ] ),
55
57
  };
56
58
  },
57
59
  [ clientIds ]
@@ -105,34 +107,30 @@ const BlockSettingsMenuControlsSlot = ( { fillProps, clientIds = null } ) => {
105
107
  onClose={ fillProps?.onClose }
106
108
  />
107
109
  ) }
108
- { showLockButton && (
110
+ { canEdit && showLockButton && (
109
111
  <BlockLockMenuItem
110
112
  clientId={ selectedClientIds[ 0 ] }
111
113
  />
112
114
  ) }
113
- { showRenameButton && (
115
+ { canEdit && showRenameButton && (
114
116
  <BlockRenameControl
115
117
  clientId={ selectedClientIds[ 0 ] }
116
118
  />
117
119
  ) }
118
- { showVisibilityButton && (
119
- <BlockVisibilityMenuItem
120
+ { canEdit && showVisibilityButton && (
121
+ <BlockVisibilityViewportMenuItem
120
122
  clientIds={ selectedClientIds }
121
123
  />
122
124
  ) }
123
125
  { fills }
124
- { selectedClientIds.length === 1 && (
125
- <ModifyContentOnlySectionMenuItem
126
- clientId={ selectedClientIds[ 0 ] }
127
- onClose={ fillProps?.onClose }
128
- />
129
- ) }
130
- { fillProps?.count === 1 && ! isContentOnly && (
131
- <BlockModeToggle
132
- clientId={ fillProps?.firstBlockClientId }
133
- onToggle={ fillProps?.onClose }
134
- />
135
- ) }
126
+ { canEdit &&
127
+ fillProps?.count === 1 &&
128
+ ! isContentOnly && (
129
+ <BlockModeToggle
130
+ clientId={ fillProps?.firstBlockClientId }
131
+ onToggle={ fillProps?.onClose }
132
+ />
133
+ ) }
136
134
  </MenuGroup>
137
135
  );
138
136
  } }
@@ -33,6 +33,7 @@ describe( 'BlockSwitcher', () => {
33
33
  clientId: 'a1303fd6-3e60-4fff-a770-0e0ea656c5b9',
34
34
  };
35
35
  const headingBlockType = {
36
+ apiVersion: 3,
36
37
  category: 'text',
37
38
  title: 'Heading',
38
39
  edit: () => {},
@@ -54,6 +55,7 @@ describe( 'BlockSwitcher', () => {
54
55
  },
55
56
  };
56
57
  const paragraphBlockType = {
58
+ apiVersion: 3,
57
59
  category: 'text',
58
60
  title: 'Paragraph',
59
61
  edit: () => {},
@@ -14,6 +14,7 @@ import {
14
14
  describe( 'use-transformed-patterns', () => {
15
15
  beforeAll( () => {
16
16
  registerBlockType( 'core/test-block-1', {
17
+ apiVersion: 3,
17
18
  attributes: {
18
19
  align: {
19
20
  type: 'string',
@@ -36,6 +37,7 @@ describe( 'use-transformed-patterns', () => {
36
37
  title: 'test block 1',
37
38
  } );
38
39
  registerBlockType( 'core/test-block-2', {
40
+ apiVersion: 3,
39
41
  attributes: {
40
42
  align: { type: 'string' },
41
43
  content: { type: 'boolean' },
@@ -12,6 +12,7 @@ describe( 'BlockSwitcher - utils', () => {
12
12
  describe( 'getRetainedBlockAttributes', () => {
13
13
  beforeAll( () => {
14
14
  registerBlockType( 'core/test-block-1', {
15
+ apiVersion: 3,
15
16
  attributes: {
16
17
  align: {
17
18
  type: 'string',
@@ -34,6 +35,7 @@ describe( 'BlockSwitcher - utils', () => {
34
35
  title: 'test block 1',
35
36
  } );
36
37
  registerBlockType( 'core/test-block-2', {
38
+ apiVersion: 3,
37
39
  attributes: {
38
40
  align: { type: 'string' },
39
41
  content: { type: 'boolean' },
@@ -27,6 +27,7 @@ function getBlockIconVariant( { select, clientIds } ) {
27
27
  canRemoveBlocks,
28
28
  getTemplateLock,
29
29
  getBlockEditingMode,
30
+ canEditBlock,
30
31
  } = unlock( select( blockEditorStore ) );
31
32
  const { getBlockStyles } = select( blocksStore );
32
33
 
@@ -53,17 +54,16 @@ function getBlockIconVariant( { select, clientIds } ) {
53
54
  0
54
55
  );
55
56
  const canRemove = canRemoveBlocks( clientIds );
56
-
57
+ const canEdit = clientIds.every( ( clientId ) => canEditBlock( clientId ) );
57
58
  const isDefaultEditingMode =
58
59
  getBlockEditingMode( clientIds[ 0 ] ) === 'default';
59
- const _hideTransformsForSections =
60
- window?.__experimentalContentOnlyPatternInsertion &&
61
- hasPatternNameInSelection;
60
+ const _hideTransformsForSections = hasPatternNameInSelection;
62
61
  const _showBlockSwitcher =
63
62
  ! _hideTransformsForSections &&
64
63
  isDefaultEditingMode &&
65
64
  ( hasBlockStyles || canRemove ) &&
66
- ! hasTemplateLock;
65
+ ! hasTemplateLock &&
66
+ canEdit;
67
67
 
68
68
  const _showPatternOverrides = hasPatternOverrides && hasParentPattern;
69
69
 
@@ -84,11 +84,7 @@ function getBlockIcon( { select, clientIds } ) {
84
84
  const _isSingleBlock = clientIds.length === 1;
85
85
  const firstClientId = clientIds[ 0 ];
86
86
  const blockAttributes = getBlockAttributes( firstClientId );
87
- if (
88
- _isSingleBlock &&
89
- blockAttributes?.metadata?.patternName &&
90
- window?.__experimentalContentOnlyPatternInsertion
91
- ) {
87
+ if ( _isSingleBlock && blockAttributes?.metadata?.patternName ) {
92
88
  return symbol;
93
89
  }
94
90
 
@@ -27,7 +27,7 @@ import BlockControls from '../block-controls';
27
27
  import __unstableBlockToolbarLastItem from './block-toolbar-last-item';
28
28
  import BlockSettingsMenu from '../block-settings-menu';
29
29
  import { BlockLockToolbar } from '../block-lock';
30
- import { BlockVisibilityToolbar } from '../block-visibility';
30
+ import { ViewportVisibilityToolbar } from '../block-visibility';
31
31
  import { BlockGroupToolbar } from '../convert-to-group-buttons';
32
32
  import BlockEditVisuallyButton from '../block-edit-visually-button';
33
33
  import { useShowHoveredOrFocusedGestures } from './utils';
@@ -116,14 +116,8 @@ export function PrivateBlockToolbar( {
116
116
  );
117
117
 
118
118
  const _isZoomOut = isZoomOut();
119
-
120
119
  const _isSectionBlock = isSectionBlock( selectedBlockClientId );
121
-
122
- // The switch style button appears more prominently with the
123
- // content only pattern experiment.
124
- const _showSwitchSectionStyleButton =
125
- window?.__experimentalContentOnlyPatternInsertion &&
126
- ( _isZoomOut || _isSectionBlock );
120
+ const _showSwitchSectionStyleButton = _isZoomOut || _isSectionBlock;
127
121
 
128
122
  return {
129
123
  blockClientId: selectedBlockClientId,
@@ -213,7 +207,7 @@ export function PrivateBlockToolbar( {
213
207
  />
214
208
  { isDefaultEditingMode &&
215
209
  showBlockVisibilityButton && (
216
- <BlockVisibilityToolbar
210
+ <ViewportVisibilityToolbar
217
211
  clientIds={ blockClientIds }
218
212
  />
219
213
  ) }
@@ -35,7 +35,6 @@ import { useShowBlockTools } from './use-show-block-tools';
35
35
  import { unlock } from '../../lock-unlock';
36
36
  import usePasteStyles from '../use-paste-styles';
37
37
  import { BlockVisibilityModal } from '../block-visibility';
38
- import { cleanEmptyObject } from '../../hooks/utils';
39
38
 
40
39
  function selector( select ) {
41
40
  const {
@@ -101,7 +100,6 @@ export default function BlockTools( {
101
100
  moveBlocksDown,
102
101
  expandBlock,
103
102
  stopEditingContentOnlySection,
104
- updateBlockAttributes,
105
103
  } = unlock( useDispatch( blockEditorStore ) );
106
104
 
107
105
  function onKeyDown( event ) {
@@ -230,33 +228,8 @@ export default function BlockTools( {
230
228
  return;
231
229
  }
232
230
 
233
- if ( window.__experimentalHideBlocksBasedOnScreenSize ) {
234
- // Open the visibility breakpoints modal.
235
- setVisibilityModalClientIds( clientIds );
236
- } else {
237
- const hasHiddenBlock = blocks.some(
238
- ( block ) =>
239
- block.attributes.metadata?.blockVisibility === false
240
- );
241
- const attributesByClientId = Object.fromEntries(
242
- blocks.map(
243
- ( { clientId: mapClientId, attributes } ) => [
244
- mapClientId,
245
- {
246
- metadata: cleanEmptyObject( {
247
- ...attributes?.metadata,
248
- blockVisibility: hasHiddenBlock
249
- ? undefined
250
- : false,
251
- } ),
252
- },
253
- ]
254
- )
255
- );
256
- updateBlockAttributes( clientIds, attributesByClientId, {
257
- uniqueByBlock: true,
258
- } );
259
- }
231
+ // Open the visibility breakpoints modal.
232
+ setVisibilityModalClientIds( clientIds );
260
233
  }
261
234
  }
262
235
 
@@ -205,10 +205,7 @@ function __experimentalBlockVariationTransforms( { blockClientId } ) {
205
205
  } );
206
206
  };
207
207
 
208
- const hideVariationsForSections =
209
- window?.__experimentalContentOnlyPatternInsertion && isSection;
210
-
211
- if ( ! variations?.length || isContentOnly || hideVariationsForSections ) {
208
+ if ( ! variations?.length || isContentOnly || isSection ) {
212
209
  return null;
213
210
  }
214
211
 
@@ -1,21 +1,5 @@
1
1
  export { default as BlockVisibilityModal } from './modal';
2
2
  export { default as useBlockVisibility } from './use-block-visibility';
3
-
4
- import BlockVisibilityToolbarDefault from './toolbar';
5
- import BlockVisibilityViewportToolbar from './viewport-toolbar';
6
-
7
- import BlockVisibilityMenuItemDefault from './menu-item';
8
- import BlockVisibilityViewportMenuItem from './viewport-menu-item';
9
-
10
- const hasViewportVisibilityExperiment =
11
- typeof window !== 'undefined' &&
12
- window.__experimentalHideBlocksBasedOnScreenSize;
13
-
14
- // Conditionally export the viewport versions when the experimental flag is enabled.
15
- export const BlockVisibilityMenuItem = hasViewportVisibilityExperiment
16
- ? BlockVisibilityViewportMenuItem
17
- : BlockVisibilityMenuItemDefault;
18
-
19
- export const BlockVisibilityToolbar = hasViewportVisibilityExperiment
20
- ? BlockVisibilityViewportToolbar
21
- : BlockVisibilityToolbarDefault;
3
+ export { default as ViewportVisibilityToolbar } from './viewport-toolbar';
4
+ export { default as BlockVisibilityViewportMenuItem } from './viewport-menu-item';
5
+ export { default as ViewportVisibilityInfo } from './viewport-visibility-info';
@@ -118,7 +118,7 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
118
118
  return sprintf(
119
119
  // translators: %s: The shortcut key to access the List View.
120
120
  __(
121
- 'Block visibility settings saved. You can access them via the List View (%s).'
121
+ 'Block visibility settings updated. You can access them via the List View (%s).'
122
122
  ),
123
123
  listViewShortcut
124
124
  );
@@ -160,18 +160,20 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
160
160
  event.preventDefault();
161
161
  const newVisibility = hideEverywhere
162
162
  ? false
163
- : BLOCK_VISIBILITY_VIEWPORT_ENTRIES.reduce(
164
- ( acc, [ , { key } ] ) => {
165
- if ( viewportChecked[ key ] ) {
166
- // Values are inverted to hide the block on the selected viewport.
167
- // In the UI, the checkbox is checked (true) when the block is hidden on the selected viewport,
168
- // so 'false' means hide the block on the selected viewport.
169
- acc[ key ] = false;
170
- }
171
- return acc;
172
- },
173
- {}
174
- );
163
+ : {
164
+ viewport: BLOCK_VISIBILITY_VIEWPORT_ENTRIES.reduce(
165
+ ( acc, [ , { key } ] ) => {
166
+ if ( viewportChecked[ key ] ) {
167
+ // Values are inverted to hide the block on the selected viewport.
168
+ // In the UI, the checkbox is checked (true) when the block is hidden on the selected viewport,
169
+ // so 'false' means hide the block on the selected viewport.
170
+ acc[ key ] = false;
171
+ }
172
+ return acc;
173
+ },
174
+ {}
175
+ ),
176
+ };
175
177
  const attributesByClientId = Object.fromEntries(
176
178
  blocks.map( ( { clientId, attributes } ) => [
177
179
  clientId,
@@ -190,7 +192,7 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
190
192
  createSuccessNotice( noticeMessage, {
191
193
  id: hideEverywhere
192
194
  ? 'block-visibility-hidden'
193
- : 'block-visibility-viewports-saved',
195
+ : 'block-visibility-viewports-updated',
194
196
  type: 'snackbar',
195
197
  } );
196
198
  onClose();