@wordpress/block-editor 8.1.2-next.f435e9e01b.0 → 8.2.1-next.a55ed9455a.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 (586) hide show
  1. package/CHANGELOG.md +11 -1
  2. package/README.md +6 -26
  3. package/build/autocompleters/link.js +78 -0
  4. package/build/autocompleters/link.js.map +1 -0
  5. package/build/components/autocomplete/index.js +3 -1
  6. package/build/components/autocomplete/index.js.map +1 -1
  7. package/build/components/block-actions/index.js +1 -1
  8. package/build/components/block-actions/index.js.map +1 -1
  9. package/build/components/block-breadcrumb/index.js +4 -2
  10. package/build/components/block-breadcrumb/index.js.map +1 -1
  11. package/build/components/block-compare/index.js +2 -2
  12. package/build/components/block-compare/index.js.map +1 -1
  13. package/build/components/block-controls/index.js +1 -1
  14. package/build/components/block-controls/index.js.map +1 -1
  15. package/build/components/block-draggable/index.js +1 -1
  16. package/build/components/block-draggable/index.js.map +1 -1
  17. package/build/components/block-edit/edit.js +1 -1
  18. package/build/components/block-edit/edit.js.map +1 -1
  19. package/build/components/block-list/block-html.js +1 -1
  20. package/build/components/block-list/block-html.js.map +1 -1
  21. package/build/components/block-list/block-invalid-warning.js +1 -1
  22. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  23. package/build/components/block-list/block-list-item.native.js +4 -4
  24. package/build/components/block-list/block-list-item.native.js.map +1 -1
  25. package/build/components/block-list/block-selection-button.native.js +4 -3
  26. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  27. package/build/components/block-list/block.js +17 -3
  28. package/build/components/block-list/block.js.map +1 -1
  29. package/build/components/block-list/block.native.js +6 -6
  30. package/build/components/block-list/block.native.js.map +1 -1
  31. package/build/components/block-list/index.native.js +5 -5
  32. package/build/components/block-list/index.native.js.map +1 -1
  33. package/build/components/block-list/use-block-props/use-block-class-names.js +1 -1
  34. package/build/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  35. package/build/components/block-list/use-block-props/use-focus-first-element.js +3 -0
  36. package/build/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  37. package/build/components/block-list/use-block-props/use-multi-selection.js +25 -27
  38. package/build/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  39. package/build/components/block-media-update-progress/index.native.js +4 -4
  40. package/build/components/block-media-update-progress/index.native.js.map +1 -1
  41. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
  42. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  43. package/build/components/block-mobile-toolbar/index.native.js +1 -1
  44. package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
  45. package/build/components/block-mover/mover-description.js +4 -4
  46. package/build/components/block-mover/mover-description.js.map +1 -1
  47. package/build/components/block-mover/mover-description.native.js +5 -5
  48. package/build/components/block-mover/mover-description.native.js.map +1 -1
  49. package/build/components/block-settings/container.native.js +1 -5
  50. package/build/components/block-settings/container.native.js.map +1 -1
  51. package/build/components/block-settings-menu/block-settings-dropdown.js +7 -12
  52. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  53. package/build/components/block-styles/preview.native.js +1 -1
  54. package/build/components/block-styles/preview.native.js.map +1 -1
  55. package/build/components/block-switcher/index.js +2 -1
  56. package/build/components/block-switcher/index.js.map +1 -1
  57. package/build/components/block-switcher/use-transformed-patterns.js +0 -1
  58. package/build/components/block-switcher/use-transformed-patterns.js.map +1 -1
  59. package/build/components/block-title/index.js +7 -62
  60. package/build/components/block-title/index.js.map +1 -1
  61. package/build/components/block-title/use-block-display-title.js +94 -0
  62. package/build/components/block-title/use-block-display-title.js.map +1 -0
  63. package/build/components/block-toolbar/utils.js +9 -1
  64. package/build/components/block-toolbar/utils.js.map +1 -1
  65. package/build/components/block-tools/block-popover.js +1 -1
  66. package/build/components/block-tools/block-popover.js.map +1 -1
  67. package/build/components/block-tools/block-selection-button.js +2 -1
  68. package/build/components/block-tools/block-selection-button.js.map +1 -1
  69. package/build/components/block-types-list/index.native.js +1 -1
  70. package/build/components/block-types-list/index.native.js.map +1 -1
  71. package/build/components/border-radius-control/index.js +2 -2
  72. package/build/components/border-radius-control/index.js.map +1 -1
  73. package/build/components/border-radius-control/utils.js +10 -6
  74. package/build/components/border-radius-control/utils.js.map +1 -1
  75. package/build/components/contrast-checker/index.js +3 -3
  76. package/build/components/contrast-checker/index.js.map +1 -1
  77. package/build/components/convert-to-group-buttons/index.js +1 -1
  78. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  79. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +1 -3
  80. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  81. package/build/components/copy-handler/index.js +3 -3
  82. package/build/components/copy-handler/index.js.map +1 -1
  83. package/build/components/font-sizes/with-font-sizes.js +3 -3
  84. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  85. package/build/components/index.js +9 -0
  86. package/build/components/index.js.map +1 -1
  87. package/build/components/index.native.js +38 -1
  88. package/build/components/index.native.js.map +1 -1
  89. package/build/components/inserter/block-patterns-tab.js +4 -4
  90. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  91. package/build/components/inserter/block-types-tab.js +1 -1
  92. package/build/components/inserter/block-types-tab.js.map +1 -1
  93. package/build/components/inserter/hooks/use-block-type-impressions.native.js +2 -2
  94. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  95. package/build/components/inserter/index.js +3 -3
  96. package/build/components/inserter/index.js.map +1 -1
  97. package/build/components/inserter/index.native.js +7 -7
  98. package/build/components/inserter/index.native.js.map +1 -1
  99. package/build/components/inserter/menu.js.map +1 -1
  100. package/build/components/inserter/menu.native.js +3 -3
  101. package/build/components/inserter/menu.native.js.map +1 -1
  102. package/build/components/inserter/quick-inserter.js +20 -8
  103. package/build/components/inserter/quick-inserter.js.map +1 -1
  104. package/build/components/inserter/search-items.js +1 -1
  105. package/build/components/inserter/search-items.js.map +1 -1
  106. package/build/components/inserter/search-results.js +28 -11
  107. package/build/components/inserter/search-results.js.map +1 -1
  108. package/build/components/keyboard-shortcuts/index.js +1 -1
  109. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  110. package/build/components/letter-spacing-control/index.js +3 -3
  111. package/build/components/letter-spacing-control/index.js.map +1 -1
  112. package/build/components/line-height-control/index.js +63 -45
  113. package/build/components/line-height-control/index.js.map +1 -1
  114. package/build/components/line-height-control/index.native.js +3 -1
  115. package/build/components/line-height-control/index.native.js.map +1 -1
  116. package/build/components/link-control/index.js +2 -2
  117. package/build/components/link-control/index.js.map +1 -1
  118. package/build/components/link-control/search-input.js +1 -1
  119. package/build/components/link-control/search-input.js.map +1 -1
  120. package/build/components/link-control/search-results.js +2 -2
  121. package/build/components/link-control/search-results.js.map +1 -1
  122. package/build/components/link-control/use-rich-url-data.js +1 -1
  123. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  124. package/build/components/link-control/use-search-handler.js +2 -2
  125. package/build/components/link-control/use-search-handler.js.map +1 -1
  126. package/build/components/list-view/block-contents.js +8 -4
  127. package/build/components/list-view/block-contents.js.map +1 -1
  128. package/build/components/list-view/block-select-button.js +2 -2
  129. package/build/components/list-view/block-select-button.js.map +1 -1
  130. package/build/components/list-view/block.js +20 -9
  131. package/build/components/list-view/block.js.map +1 -1
  132. package/build/components/list-view/branch.js +2 -1
  133. package/build/components/list-view/branch.js.map +1 -1
  134. package/build/components/list-view/index.js +49 -41
  135. package/build/components/list-view/index.js.map +1 -1
  136. package/build/components/list-view/use-block-selection.js +139 -0
  137. package/build/components/list-view/use-block-selection.js.map +1 -0
  138. package/build/components/list-view/use-list-view-expand-selected-item.js +60 -0
  139. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -0
  140. package/build/components/list-view/utils.js +29 -1
  141. package/build/components/list-view/utils.js.map +1 -1
  142. package/build/components/media-placeholder/index.native.js +7 -5
  143. package/build/components/media-placeholder/index.native.js.map +1 -1
  144. package/build/components/media-replace-flow/index.js +20 -24
  145. package/build/components/media-replace-flow/index.js.map +1 -1
  146. package/build/components/media-upload/index.native.js +4 -3
  147. package/build/components/media-upload/index.native.js.map +1 -1
  148. package/build/components/media-upload-progress/index.native.js +1 -1
  149. package/build/components/media-upload-progress/index.native.js.map +1 -1
  150. package/build/components/navigable-toolbar/index.js +3 -3
  151. package/build/components/navigable-toolbar/index.js.map +1 -1
  152. package/build/components/plain-text/index.native.js +3 -3
  153. package/build/components/plain-text/index.native.js.map +1 -1
  154. package/build/components/rich-text/format-toolbar-container.js +2 -2
  155. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  156. package/build/components/rich-text/format-toolbar-container.native.js +1 -1
  157. package/build/components/rich-text/format-toolbar-container.native.js.map +1 -1
  158. package/build/components/rich-text/index.js +7 -12
  159. package/build/components/rich-text/index.js.map +1 -1
  160. package/build/components/rich-text/index.native.js +3 -3
  161. package/build/components/rich-text/index.native.js.map +1 -1
  162. package/build/components/rich-text/use-paste-handler.js +7 -12
  163. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  164. package/build/components/url-input/index.js +11 -11
  165. package/build/components/url-input/index.js.map +1 -1
  166. package/build/components/use-moving-animation/index.js +1 -1
  167. package/build/components/use-moving-animation/index.js.map +1 -1
  168. package/build/components/use-on-block-drop/index.js +2 -2
  169. package/build/components/use-on-block-drop/index.js.map +1 -1
  170. package/build/components/writing-flow/index.js +1 -0
  171. package/build/components/writing-flow/index.js.map +1 -1
  172. package/build/components/writing-flow/use-multi-selection.js +22 -24
  173. package/build/components/writing-flow/use-multi-selection.js.map +1 -1
  174. package/build/components/writing-flow/use-select-all.js +3 -2
  175. package/build/components/writing-flow/use-select-all.js.map +1 -1
  176. package/build/components/writing-flow/use-tab-nav.js +4 -3
  177. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  178. package/build/hooks/align.js +1 -1
  179. package/build/hooks/align.js.map +1 -1
  180. package/build/hooks/anchor.js +1 -1
  181. package/build/hooks/anchor.js.map +1 -1
  182. package/build/hooks/border.js +2 -14
  183. package/build/hooks/border.js.map +1 -1
  184. package/build/hooks/color.js +2 -2
  185. package/build/hooks/color.js.map +1 -1
  186. package/build/hooks/custom-class-name.js +40 -0
  187. package/build/hooks/custom-class-name.js.map +1 -1
  188. package/build/hooks/generated-class-name.js +3 -3
  189. package/build/hooks/generated-class-name.js.map +1 -1
  190. package/build/hooks/line-height.js +2 -0
  191. package/build/hooks/line-height.js.map +1 -1
  192. package/build/hooks/lock.js +1 -1
  193. package/build/hooks/lock.js.map +1 -1
  194. package/build/hooks/style.js +32 -13
  195. package/build/hooks/style.js.map +1 -1
  196. package/build/layouts/flow.js +7 -5
  197. package/build/layouts/flow.js.map +1 -1
  198. package/build/store/actions.js +55 -48
  199. package/build/store/actions.js.map +1 -1
  200. package/build/store/defaults.js +2 -1
  201. package/build/store/defaults.js.map +1 -1
  202. package/build/store/index.js +1 -2
  203. package/build/store/index.js.map +1 -1
  204. package/build/store/reducer.js +13 -13
  205. package/build/store/reducer.js.map +1 -1
  206. package/build/store/selectors.js +6 -6
  207. package/build/store/selectors.js.map +1 -1
  208. package/build/utils/index.js +0 -14
  209. package/build/utils/index.js.map +1 -1
  210. package/build/utils/parse-css-unit-to-px.js +3 -3
  211. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  212. package/build/utils/pasting.js +91 -0
  213. package/build/utils/pasting.js.map +1 -0
  214. package/build/utils/transform-styles/ast/parse.js +5 -5
  215. package/build/utils/transform-styles/ast/parse.js.map +1 -1
  216. package/build/utils/transform-styles/transforms/url-rewrite.js +2 -2
  217. package/build/utils/transform-styles/transforms/url-rewrite.js.map +1 -1
  218. package/build-module/autocompleters/link.js +64 -0
  219. package/build-module/autocompleters/link.js.map +1 -0
  220. package/build-module/components/autocomplete/index.js +2 -1
  221. package/build-module/components/autocomplete/index.js.map +1 -1
  222. package/build-module/components/block-actions/index.js +1 -1
  223. package/build-module/components/block-actions/index.js.map +1 -1
  224. package/build-module/components/block-breadcrumb/index.js +4 -2
  225. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  226. package/build-module/components/block-compare/index.js +2 -2
  227. package/build-module/components/block-compare/index.js.map +1 -1
  228. package/build-module/components/block-controls/index.js +1 -1
  229. package/build-module/components/block-controls/index.js.map +1 -1
  230. package/build-module/components/block-draggable/index.js +1 -1
  231. package/build-module/components/block-draggable/index.js.map +1 -1
  232. package/build-module/components/block-edit/edit.js +1 -1
  233. package/build-module/components/block-edit/edit.js.map +1 -1
  234. package/build-module/components/block-list/block-html.js +1 -1
  235. package/build-module/components/block-list/block-html.js.map +1 -1
  236. package/build-module/components/block-list/block-invalid-warning.js +1 -1
  237. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  238. package/build-module/components/block-list/block-list-item.native.js +4 -4
  239. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  240. package/build-module/components/block-list/block-selection-button.native.js +4 -3
  241. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  242. package/build-module/components/block-list/block.js +18 -4
  243. package/build-module/components/block-list/block.js.map +1 -1
  244. package/build-module/components/block-list/block.native.js +7 -7
  245. package/build-module/components/block-list/block.native.js.map +1 -1
  246. package/build-module/components/block-list/index.native.js +5 -5
  247. package/build-module/components/block-list/index.native.js.map +1 -1
  248. package/build-module/components/block-list/use-block-props/use-block-class-names.js +1 -1
  249. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  250. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +2 -0
  251. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  252. package/build-module/components/block-list/use-block-props/use-multi-selection.js +23 -28
  253. package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  254. package/build-module/components/block-media-update-progress/index.native.js +4 -4
  255. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  256. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
  257. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  258. package/build-module/components/block-mobile-toolbar/index.native.js +1 -1
  259. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  260. package/build-module/components/block-mover/mover-description.js +4 -4
  261. package/build-module/components/block-mover/mover-description.js.map +1 -1
  262. package/build-module/components/block-mover/mover-description.native.js +5 -5
  263. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  264. package/build-module/components/block-settings/container.native.js +2 -6
  265. package/build-module/components/block-settings/container.native.js.map +1 -1
  266. package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -13
  267. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  268. package/build-module/components/block-styles/preview.native.js +1 -1
  269. package/build-module/components/block-styles/preview.native.js.map +1 -1
  270. package/build-module/components/block-switcher/index.js +2 -1
  271. package/build-module/components/block-switcher/index.js.map +1 -1
  272. package/build-module/components/block-switcher/use-transformed-patterns.js +0 -1
  273. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  274. package/build-module/components/block-title/index.js +7 -58
  275. package/build-module/components/block-title/index.js.map +1 -1
  276. package/build-module/components/block-title/use-block-display-title.js +80 -0
  277. package/build-module/components/block-title/use-block-display-title.js.map +1 -0
  278. package/build-module/components/block-toolbar/utils.js +9 -1
  279. package/build-module/components/block-toolbar/utils.js.map +1 -1
  280. package/build-module/components/block-tools/block-popover.js +1 -1
  281. package/build-module/components/block-tools/block-popover.js.map +1 -1
  282. package/build-module/components/block-tools/block-selection-button.js +2 -1
  283. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  284. package/build-module/components/block-types-list/index.native.js +1 -1
  285. package/build-module/components/block-types-list/index.native.js.map +1 -1
  286. package/build-module/components/border-radius-control/index.js +3 -3
  287. package/build-module/components/border-radius-control/index.js.map +1 -1
  288. package/build-module/components/border-radius-control/utils.js +11 -7
  289. package/build-module/components/border-radius-control/utils.js.map +1 -1
  290. package/build-module/components/contrast-checker/index.js +3 -3
  291. package/build-module/components/contrast-checker/index.js.map +1 -1
  292. package/build-module/components/convert-to-group-buttons/index.js +1 -1
  293. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  294. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +1 -3
  295. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  296. package/build-module/components/copy-handler/index.js +2 -2
  297. package/build-module/components/copy-handler/index.js.map +1 -1
  298. package/build-module/components/font-sizes/with-font-sizes.js +3 -3
  299. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  300. package/build-module/components/index.js +1 -0
  301. package/build-module/components/index.js.map +1 -1
  302. package/build-module/components/index.native.js +5 -4
  303. package/build-module/components/index.native.js.map +1 -1
  304. package/build-module/components/inserter/block-patterns-tab.js +4 -4
  305. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  306. package/build-module/components/inserter/block-types-tab.js +1 -1
  307. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  308. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +2 -2
  309. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  310. package/build-module/components/inserter/index.js +3 -3
  311. package/build-module/components/inserter/index.js.map +1 -1
  312. package/build-module/components/inserter/index.native.js +7 -7
  313. package/build-module/components/inserter/index.native.js.map +1 -1
  314. package/build-module/components/inserter/menu.js.map +1 -1
  315. package/build-module/components/inserter/menu.native.js +3 -3
  316. package/build-module/components/inserter/menu.native.js.map +1 -1
  317. package/build-module/components/inserter/quick-inserter.js +20 -8
  318. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  319. package/build-module/components/inserter/search-items.js +1 -1
  320. package/build-module/components/inserter/search-items.js.map +1 -1
  321. package/build-module/components/inserter/search-results.js +28 -11
  322. package/build-module/components/inserter/search-results.js.map +1 -1
  323. package/build-module/components/keyboard-shortcuts/index.js +1 -1
  324. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  325. package/build-module/components/letter-spacing-control/index.js +3 -3
  326. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  327. package/build-module/components/line-height-control/index.js +61 -45
  328. package/build-module/components/line-height-control/index.js.map +1 -1
  329. package/build-module/components/line-height-control/index.native.js +3 -1
  330. package/build-module/components/line-height-control/index.native.js.map +1 -1
  331. package/build-module/components/link-control/index.js +2 -2
  332. package/build-module/components/link-control/index.js.map +1 -1
  333. package/build-module/components/link-control/search-input.js +1 -1
  334. package/build-module/components/link-control/search-input.js.map +1 -1
  335. package/build-module/components/link-control/search-results.js +2 -2
  336. package/build-module/components/link-control/search-results.js.map +1 -1
  337. package/build-module/components/link-control/use-rich-url-data.js +1 -1
  338. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  339. package/build-module/components/link-control/use-search-handler.js +2 -2
  340. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  341. package/build-module/components/list-view/block-contents.js +8 -4
  342. package/build-module/components/list-view/block-contents.js.map +1 -1
  343. package/build-module/components/list-view/block-select-button.js +2 -2
  344. package/build-module/components/list-view/block-select-button.js.map +1 -1
  345. package/build-module/components/list-view/block.js +20 -9
  346. package/build-module/components/list-view/block.js.map +1 -1
  347. package/build-module/components/list-view/branch.js +2 -1
  348. package/build-module/components/list-view/branch.js.map +1 -1
  349. package/build-module/components/list-view/index.js +46 -42
  350. package/build-module/components/list-view/index.js.map +1 -1
  351. package/build-module/components/list-view/use-block-selection.js +123 -0
  352. package/build-module/components/list-view/use-block-selection.js.map +1 -0
  353. package/build-module/components/list-view/use-list-view-expand-selected-item.js +50 -0
  354. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -0
  355. package/build-module/components/list-view/utils.js +25 -0
  356. package/build-module/components/list-view/utils.js.map +1 -1
  357. package/build-module/components/media-placeholder/index.native.js +7 -5
  358. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  359. package/build-module/components/media-replace-flow/index.js +22 -27
  360. package/build-module/components/media-replace-flow/index.js.map +1 -1
  361. package/build-module/components/media-upload/index.native.js +4 -3
  362. package/build-module/components/media-upload/index.native.js.map +1 -1
  363. package/build-module/components/media-upload-progress/index.native.js +1 -1
  364. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  365. package/build-module/components/navigable-toolbar/index.js +3 -3
  366. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  367. package/build-module/components/plain-text/index.native.js +3 -3
  368. package/build-module/components/plain-text/index.native.js.map +1 -1
  369. package/build-module/components/rich-text/format-toolbar-container.js +2 -2
  370. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  371. package/build-module/components/rich-text/format-toolbar-container.native.js +1 -1
  372. package/build-module/components/rich-text/format-toolbar-container.native.js.map +1 -1
  373. package/build-module/components/rich-text/index.js +7 -12
  374. package/build-module/components/rich-text/index.js.map +1 -1
  375. package/build-module/components/rich-text/index.native.js +3 -3
  376. package/build-module/components/rich-text/index.native.js.map +1 -1
  377. package/build-module/components/rich-text/use-paste-handler.js +6 -12
  378. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  379. package/build-module/components/url-input/index.js +11 -11
  380. package/build-module/components/url-input/index.js.map +1 -1
  381. package/build-module/components/use-moving-animation/index.js +1 -1
  382. package/build-module/components/use-moving-animation/index.js.map +1 -1
  383. package/build-module/components/use-on-block-drop/index.js +2 -2
  384. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  385. package/build-module/components/writing-flow/index.js +1 -0
  386. package/build-module/components/writing-flow/index.js.map +1 -1
  387. package/build-module/components/writing-flow/use-multi-selection.js +21 -21
  388. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  389. package/build-module/components/writing-flow/use-select-all.js +3 -2
  390. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  391. package/build-module/components/writing-flow/use-tab-nav.js +4 -3
  392. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  393. package/build-module/hooks/align.js +1 -1
  394. package/build-module/hooks/align.js.map +1 -1
  395. package/build-module/hooks/anchor.js +1 -1
  396. package/build-module/hooks/anchor.js.map +1 -1
  397. package/build-module/hooks/border.js +2 -14
  398. package/build-module/hooks/border.js.map +1 -1
  399. package/build-module/hooks/color.js +2 -2
  400. package/build-module/hooks/color.js.map +1 -1
  401. package/build-module/hooks/custom-class-name.js +38 -0
  402. package/build-module/hooks/custom-class-name.js.map +1 -1
  403. package/build-module/hooks/generated-class-name.js +3 -3
  404. package/build-module/hooks/generated-class-name.js.map +1 -1
  405. package/build-module/hooks/line-height.js +2 -0
  406. package/build-module/hooks/line-height.js.map +1 -1
  407. package/build-module/hooks/lock.js +1 -1
  408. package/build-module/hooks/lock.js.map +1 -1
  409. package/build-module/hooks/style.js +31 -13
  410. package/build-module/hooks/style.js.map +1 -1
  411. package/build-module/layouts/flow.js +7 -5
  412. package/build-module/layouts/flow.js.map +1 -1
  413. package/build-module/store/actions.js +52 -45
  414. package/build-module/store/actions.js.map +1 -1
  415. package/build-module/store/defaults.js +2 -1
  416. package/build-module/store/defaults.js.map +1 -1
  417. package/build-module/store/index.js +1 -2
  418. package/build-module/store/index.js.map +1 -1
  419. package/build-module/store/reducer.js +13 -13
  420. package/build-module/store/reducer.js.map +1 -1
  421. package/build-module/store/selectors.js +6 -6
  422. package/build-module/store/selectors.js.map +1 -1
  423. package/build-module/utils/index.js +0 -1
  424. package/build-module/utils/index.js.map +1 -1
  425. package/build-module/utils/parse-css-unit-to-px.js +3 -3
  426. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  427. package/build-module/utils/pasting.js +80 -0
  428. package/build-module/utils/pasting.js.map +1 -0
  429. package/build-module/utils/transform-styles/ast/parse.js +5 -5
  430. package/build-module/utils/transform-styles/ast/parse.js.map +1 -1
  431. package/build-module/utils/transform-styles/transforms/url-rewrite.js +2 -2
  432. package/build-module/utils/transform-styles/transforms/url-rewrite.js.map +1 -1
  433. package/build-style/style-rtl.css +10 -12
  434. package/build-style/style.css +10 -12
  435. package/package.json +27 -26
  436. package/src/autocompleters/link.js +62 -0
  437. package/src/autocompleters/style.scss +8 -0
  438. package/src/components/alignment-control/test/index.js +2 -2
  439. package/src/components/autocomplete/index.js +2 -0
  440. package/src/components/block-actions/index.js +1 -1
  441. package/src/components/block-alignment-control/test/index.js +1 -1
  442. package/src/components/block-breadcrumb/index.js +5 -2
  443. package/src/components/block-compare/index.js +2 -2
  444. package/src/components/block-controls/index.js +1 -1
  445. package/src/components/block-draggable/index.js +1 -1
  446. package/src/components/block-draggable/stories/index.js +1 -1
  447. package/src/components/block-edit/edit.js +1 -1
  448. package/src/components/block-list/block-html.js +1 -1
  449. package/src/components/block-list/block-invalid-warning.js +1 -1
  450. package/src/components/block-list/block-list-item.native.js +4 -4
  451. package/src/components/block-list/block-selection-button.native.js +3 -3
  452. package/src/components/block-list/block.js +28 -4
  453. package/src/components/block-list/block.native.js +7 -6
  454. package/src/components/block-list/index.native.js +5 -5
  455. package/src/components/block-list/style.scss +3 -1
  456. package/src/components/block-list/use-block-props/use-block-class-names.js +1 -1
  457. package/src/components/block-list/use-block-props/use-focus-first-element.js +3 -0
  458. package/src/components/block-list/use-block-props/use-multi-selection.js +22 -30
  459. package/src/components/block-media-update-progress/index.native.js +4 -4
  460. package/src/components/block-media-update-progress/test/index.native.js +2 -2
  461. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
  462. package/src/components/block-mobile-toolbar/index.native.js +2 -2
  463. package/src/components/block-mover/mover-description.js +4 -4
  464. package/src/components/block-mover/mover-description.native.js +5 -5
  465. package/src/components/block-settings/container.native.js +5 -6
  466. package/src/components/block-settings-menu/block-settings-dropdown.js +7 -8
  467. package/src/components/block-styles/preview.native.js +1 -1
  468. package/src/components/block-switcher/index.js +4 -1
  469. package/src/components/block-switcher/use-transformed-patterns.js +0 -1
  470. package/src/components/block-title/README.md +17 -1
  471. package/src/components/block-title/index.js +7 -62
  472. package/src/components/block-title/test/index.js +21 -3
  473. package/src/components/block-title/use-block-display-title.js +83 -0
  474. package/src/components/block-toolbar/utils.js +12 -2
  475. package/src/components/block-tools/block-popover.js +1 -1
  476. package/src/components/block-tools/block-selection-button.js +4 -1
  477. package/src/components/block-types-list/index.native.js +1 -1
  478. package/src/components/border-radius-control/index.js +5 -3
  479. package/src/components/border-radius-control/test/utils.js +10 -10
  480. package/src/components/border-radius-control/utils.js +10 -8
  481. package/src/components/contrast-checker/index.js +3 -3
  482. package/src/components/convert-to-group-buttons/index.js +1 -1
  483. package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +1 -6
  484. package/src/components/copy-handler/index.js +2 -2
  485. package/src/components/font-sizes/with-font-sizes.js +3 -3
  486. package/src/components/image-size-control/test/index.js +1 -1
  487. package/src/components/index.js +1 -0
  488. package/src/components/index.native.js +11 -4
  489. package/src/components/inserter/block-patterns-tab.js +13 -17
  490. package/src/components/inserter/block-types-tab.js +1 -1
  491. package/src/components/inserter/hooks/use-block-type-impressions.native.js +2 -2
  492. package/src/components/inserter/index.js +3 -3
  493. package/src/components/inserter/index.native.js +7 -7
  494. package/src/components/inserter/menu.js +1 -1
  495. package/src/components/inserter/menu.native.js +3 -3
  496. package/src/components/inserter/quick-inserter.js +32 -10
  497. package/src/components/inserter/search-items.js +1 -1
  498. package/src/components/inserter/search-results.js +55 -43
  499. package/src/components/inserter/test/fixtures/index.native.js +1 -1
  500. package/src/components/inserter/test/reusable-blocks-tab.js +2 -2
  501. package/src/components/justify-content-control/README.md +1 -1
  502. package/src/components/keyboard-shortcuts/index.js +1 -1
  503. package/src/components/letter-spacing-control/index.js +1 -1
  504. package/src/components/line-height-control/README.md +13 -2
  505. package/src/components/line-height-control/index.js +66 -43
  506. package/src/components/line-height-control/index.native.js +2 -0
  507. package/src/components/line-height-control/stories/index.js +33 -0
  508. package/src/components/line-height-control/test/index.js +61 -0
  509. package/src/components/link-control/index.js +2 -2
  510. package/src/components/link-control/search-input.js +1 -1
  511. package/src/components/link-control/search-results.js +2 -2
  512. package/src/components/link-control/test/index.js +142 -144
  513. package/src/components/link-control/use-rich-url-data.js +1 -1
  514. package/src/components/link-control/use-search-handler.js +2 -2
  515. package/src/components/list-view/README.md +2 -2
  516. package/src/components/list-view/block-contents.js +10 -3
  517. package/src/components/list-view/block-select-button.js +1 -2
  518. package/src/components/list-view/block.js +30 -10
  519. package/src/components/list-view/branch.js +1 -0
  520. package/src/components/list-view/index.js +56 -30
  521. package/src/components/list-view/test/utils.js +50 -0
  522. package/src/components/list-view/use-block-selection.js +163 -0
  523. package/src/components/list-view/use-list-view-expand-selected-item.js +58 -0
  524. package/src/components/list-view/utils.js +31 -0
  525. package/src/components/media-placeholder/index.native.js +11 -9
  526. package/src/components/media-replace-flow/README.md +7 -0
  527. package/src/components/media-replace-flow/index.js +20 -26
  528. package/src/components/media-replace-flow/test/index.js +100 -0
  529. package/src/components/media-upload/index.native.js +3 -2
  530. package/src/components/media-upload-progress/index.native.js +1 -1
  531. package/src/components/navigable-toolbar/index.js +3 -3
  532. package/src/components/plain-text/index.native.js +3 -3
  533. package/src/components/responsive-block-control/test/index.js +6 -6
  534. package/src/components/rich-text/format-toolbar-container.js +2 -2
  535. package/src/components/rich-text/format-toolbar-container.native.js +1 -1
  536. package/src/components/rich-text/index.js +7 -14
  537. package/src/components/rich-text/index.native.js +3 -3
  538. package/src/components/rich-text/use-paste-handler.js +7 -14
  539. package/src/components/url-input/index.js +11 -11
  540. package/src/components/use-block-drop-zone/test/index.js +1 -1
  541. package/src/components/use-moving-animation/index.js +1 -1
  542. package/src/components/use-on-block-drop/index.js +2 -2
  543. package/src/components/writing-flow/index.js +1 -0
  544. package/src/components/writing-flow/use-multi-selection.js +17 -20
  545. package/src/components/writing-flow/use-select-all.js +6 -2
  546. package/src/components/writing-flow/use-tab-nav.js +6 -3
  547. package/src/hooks/align.js +1 -1
  548. package/src/hooks/anchor.js +1 -1
  549. package/src/hooks/border.js +8 -19
  550. package/src/hooks/color.js +2 -2
  551. package/src/hooks/custom-class-name.js +45 -0
  552. package/src/hooks/generated-class-name.js +3 -3
  553. package/src/hooks/line-height.js +2 -0
  554. package/src/hooks/lock.js +1 -1
  555. package/src/hooks/style.js +31 -13
  556. package/src/hooks/test/align.js +1 -1
  557. package/src/hooks/typography.scss +0 -4
  558. package/src/layouts/flow.js +10 -5
  559. package/src/store/actions.js +24 -14
  560. package/src/store/defaults.js +2 -2
  561. package/src/store/index.js +0 -1
  562. package/src/store/reducer.js +13 -12
  563. package/src/store/selectors.js +6 -6
  564. package/src/store/test/actions.js +2 -2
  565. package/src/store/test/reducer.js +10 -1
  566. package/src/store/test/selectors.js +1 -1
  567. package/src/style.scss +0 -1
  568. package/src/utils/index.js +0 -1
  569. package/src/utils/parse-css-unit-to-px.js +3 -3
  570. package/src/utils/pasting.js +77 -0
  571. package/src/utils/test/parse-css-unit-to-px.js +5 -5
  572. package/src/utils/test/pasting.js +84 -0
  573. package/src/utils/transform-styles/ast/parse.js +5 -5
  574. package/src/utils/transform-styles/transforms/url-rewrite.js +2 -2
  575. package/build/utils/get-paste-event-data.js +0 -56
  576. package/build/utils/get-paste-event-data.js.map +0 -1
  577. package/build/utils/theme.js +0 -63
  578. package/build/utils/theme.js.map +0 -1
  579. package/build-module/utils/get-paste-event-data.js +0 -47
  580. package/build-module/utils/get-paste-event-data.js.map +0 -1
  581. package/build-module/utils/theme.js +0 -53
  582. package/build-module/utils/theme.js.map +0 -1
  583. package/src/components/line-height-control/style.scss +0 -8
  584. package/src/components/writing-flow/test/use-multi-selection.js +0 -36
  585. package/src/utils/get-paste-event-data.js +0 -42
  586. package/src/utils/theme.js +0 -48
@@ -78,7 +78,7 @@ export function onBlockDrop(
78
78
  blocks,
79
79
  } = parseDropEvent( event );
80
80
 
81
- // If the user is inserting a block
81
+ // If the user is inserting a block.
82
82
  if ( dropType === 'inserter' ) {
83
83
  clearSelectedBlock();
84
84
  const blocksToInsert = blocks.map( ( block ) =>
@@ -93,7 +93,7 @@ export function onBlockDrop(
93
93
  );
94
94
  }
95
95
 
96
- // If the user is moving a block
96
+ // If the user is moving a block.
97
97
  if ( dropType === 'block' ) {
98
98
  const sourceBlockIndex = getBlockIndex( sourceClientIds[ 0 ] );
99
99
 
@@ -37,6 +37,7 @@ export function useWritingFlow() {
37
37
  useRefEffect(
38
38
  ( node ) => {
39
39
  node.tabIndex = -1;
40
+ node.contentEditable = hasMultiSelection;
40
41
 
41
42
  if ( ! hasMultiSelection ) {
42
43
  return;
@@ -15,21 +15,6 @@ import { useSelect } from '@wordpress/data';
15
15
  import { store as blockEditorStore } from '../../store';
16
16
  import { __unstableUseBlockRef as useBlockRef } from '../block-list/use-block-props/use-block-refs';
17
17
 
18
- export function toggleRichText( container, toggle ) {
19
- Array.from(
20
- container.querySelectorAll(
21
- // Exclude the Post Title from multi-select disable.
22
- '.rich-text:not( .editor-post-title__input )'
23
- )
24
- ).forEach( ( node ) => {
25
- if ( toggle ) {
26
- node.setAttribute( 'contenteditable', true );
27
- } else {
28
- node.removeAttribute( 'contenteditable' );
29
- }
30
- } );
31
- }
32
-
33
18
  /**
34
19
  * Returns for the deepest node at the start or end of a container node. Ignores
35
20
  * any text nodes that only contain HTML formatting whitespace.
@@ -62,6 +47,7 @@ function selector( select ) {
62
47
  getMultiSelectedBlockClientIds,
63
48
  hasMultiSelection,
64
49
  getSelectedBlockClientId,
50
+ getSelectedBlocksInitialCaretPosition,
65
51
  } = select( blockEditorStore );
66
52
 
67
53
  return {
@@ -69,11 +55,13 @@ function selector( select ) {
69
55
  multiSelectedBlockClientIds: getMultiSelectedBlockClientIds(),
70
56
  hasMultiSelection: hasMultiSelection(),
71
57
  selectedBlockClientId: getSelectedBlockClientId(),
58
+ initialPosition: getSelectedBlocksInitialCaretPosition(),
72
59
  };
73
60
  }
74
61
 
75
62
  export default function useMultiSelection() {
76
63
  const {
64
+ initialPosition,
77
65
  isMultiSelecting,
78
66
  multiSelectedBlockClientIds,
79
67
  hasMultiSelection,
@@ -93,6 +81,13 @@ export default function useMultiSelection() {
93
81
  const { ownerDocument } = node;
94
82
  const { defaultView } = ownerDocument;
95
83
 
84
+ // Allow initialPosition to bypass focus behavior. This is useful
85
+ // for the list view or other areas where we don't want to transfer
86
+ // focus to the editor canvas.
87
+ if ( initialPosition === undefined || initialPosition === null ) {
88
+ return;
89
+ }
90
+
96
91
  if ( ! hasMultiSelection || isMultiSelecting ) {
97
92
  if ( ! selectedBlockClientId || isMultiSelecting ) {
98
93
  return;
@@ -131,6 +126,12 @@ export default function useMultiSelection() {
131
126
  return;
132
127
  }
133
128
 
129
+ // Allow cross contentEditable selection by temporarily making
130
+ // all content editable. We can't rely on using the store and
131
+ // React because re-rending happens too slowly. We need to be
132
+ // able to select across instances immediately.
133
+ node.contentEditable = true;
134
+
134
135
  // For some browsers, like Safari, it is important that focus happens
135
136
  // BEFORE selection.
136
137
  node.focus();
@@ -144,11 +145,6 @@ export default function useMultiSelection() {
144
145
  const startNode = getDeepestNode( startRef.current, 'start' );
145
146
  const endNode = getDeepestNode( endRef.current, 'end' );
146
147
 
147
- // While rich text will be disabled with a delay when there is a multi
148
- // selection, we must do it immediately because it's not possible to set
149
- // selection across editable hosts.
150
- toggleRichText( node, false );
151
-
152
148
  range.setStartBefore( startNode );
153
149
  range.setEndAfter( endNode );
154
150
 
@@ -160,6 +156,7 @@ export default function useMultiSelection() {
160
156
  isMultiSelecting,
161
157
  multiSelectedBlockClientIds,
162
158
  selectedBlockClientId,
159
+ initialPosition,
163
160
  ]
164
161
  );
165
162
  }
@@ -31,11 +31,15 @@ export default function useSelectAll() {
31
31
  return;
32
32
  }
33
33
 
34
- if ( ! isEntirelySelected( event.target ) ) {
34
+ const selectedClientIds = getSelectedBlockClientIds();
35
+
36
+ if (
37
+ selectedClientIds.length < 2 &&
38
+ ! isEntirelySelected( event.target )
39
+ ) {
35
40
  return;
36
41
  }
37
42
 
38
- const selectedClientIds = getSelectedBlockClientIds();
39
43
  const [ firstSelectedClientId ] = selectedClientIds;
40
44
  const rootClientId = getBlockRootClientId( firstSelectedClientId );
41
45
  let blockClientIds = getBlockOrder( rootClientId );
@@ -118,13 +118,16 @@ export default function useTabNav() {
118
118
  return;
119
119
  }
120
120
 
121
- // Allow tabbing between form elements rendered in a block,
121
+ // Allow tabbing from the block wrapper to a form element,
122
+ // and between form elements rendered in a block,
122
123
  // such as inside a placeholder. Form elements are generally
123
124
  // meant to be UI rather than part of the content. Ideally
124
125
  // these are not rendered in the content and perhaps in the
125
126
  // future they can be rendered in an iframe or shadow DOM.
126
127
  if (
127
- isFormElement( event.target ) &&
128
+ ( isFormElement( event.target ) ||
129
+ event.target.getAttribute( 'data-block' ) ===
130
+ getSelectedBlockClientId() ) &&
128
131
  isFormElement( focus.tabbable[ direction ]( event.target ) )
129
132
  ) {
130
133
  return;
@@ -183,7 +186,7 @@ export default function useTabNav() {
183
186
  const isShift = event.shiftKey;
184
187
  const direction = isShift ? 'findPrevious' : 'findNext';
185
188
  const target = focus.tabbable[ direction ]( event.target );
186
- // only do something when the next tabbable is a focus capture div (before/after)
189
+ // Only do something when the next tabbable is a focus capture div (before/after)
187
190
  if (
188
191
  target === focusCaptureBeforeRef.current ||
189
192
  target === focusCaptureAfterRef.current
@@ -86,7 +86,7 @@ export function getValidAlignments(
86
86
  * @return {Object} Filtered block settings.
87
87
  */
88
88
  export function addAttribute( settings ) {
89
- // allow blocks to specify their own attribute definition with default values if needed.
89
+ // Allow blocks to specify their own attribute definition with default values if needed.
90
90
  if ( has( settings.attributes, [ 'align', 'type' ] ) ) {
91
91
  return settings;
92
92
  }
@@ -34,7 +34,7 @@ const ANCHOR_REGEX = /[\s#]/g;
34
34
  * @return {Object} Filtered block settings.
35
35
  */
36
36
  export function addAttribute( settings ) {
37
- // allow blocks to specify their own attribute definition with default values if needed.
37
+ // Allow blocks to specify their own attribute definition with default values if needed.
38
38
  if ( has( settings.attributes, [ 'anchor', 'type' ] ) ) {
39
39
  return settings;
40
40
  }
@@ -37,8 +37,6 @@ export const BORDER_SUPPORT_KEY = '__experimentalBorder';
37
37
 
38
38
  export function BorderPanel( props ) {
39
39
  const { clientId } = props;
40
- const isDisabled = useIsBorderDisabled( props );
41
- const isSupported = hasBorderSupport( props.name );
42
40
 
43
41
  const isColorSupported =
44
42
  useSetting( 'border.color' ) && hasBorderSupport( props.name, 'color' );
@@ -53,7 +51,14 @@ export function BorderPanel( props ) {
53
51
  const isWidthSupported =
54
52
  useSetting( 'border.width' ) && hasBorderSupport( props.name, 'width' );
55
53
 
56
- if ( isDisabled || ! isSupported ) {
54
+ const isDisabled = [
55
+ ! isColorSupported,
56
+ ! isRadiusSupported,
57
+ ! isStyleSupported,
58
+ ! isWidthSupported,
59
+ ].every( Boolean );
60
+
61
+ if ( isDisabled ) {
57
62
  return null;
58
63
  }
59
64
 
@@ -179,22 +184,6 @@ export function shouldSkipSerialization( blockType ) {
179
184
  return support?.__experimentalSkipSerialization;
180
185
  }
181
186
 
182
- /**
183
- * Determines if all border support features have been disabled.
184
- *
185
- * @return {boolean} If border support is completely disabled.
186
- */
187
- const useIsBorderDisabled = () => {
188
- const configs = [
189
- ! useSetting( 'border.color' ),
190
- ! useSetting( 'border.radius' ),
191
- ! useSetting( 'border.style' ),
192
- ! useSetting( 'border.width' ),
193
- ];
194
-
195
- return configs.every( Boolean );
196
- };
197
-
198
187
  /**
199
188
  * Returns a new style object where the specified border attribute has been
200
189
  * removed.
@@ -209,7 +209,7 @@ function addAttributes( settings ) {
209
209
  return settings;
210
210
  }
211
211
 
212
- // allow blocks to specify their own attribute definition with default values if needed.
212
+ // Allow blocks to specify their own attribute definition with default values if needed.
213
213
  if ( ! settings.attributes.backgroundColor ) {
214
214
  Object.assign( settings.attributes, {
215
215
  backgroundColor: {
@@ -269,7 +269,7 @@ export function addSaveProps( props, blockType, attributes ) {
269
269
  textClass,
270
270
  gradientClass,
271
271
  {
272
- // Don't apply the background class if there's a custom gradient
272
+ // Don't apply the background class if there's a custom gradient.
273
273
  [ backgroundClass ]:
274
274
  ( ! hasGradient || ! style?.color?.gradient ) &&
275
275
  !! backgroundClass,
@@ -112,6 +112,45 @@ export function addSaveProps( extraProps, blockType, attributes ) {
112
112
  return extraProps;
113
113
  }
114
114
 
115
+ export function addTransforms( result, source, index, results ) {
116
+ if ( ! hasBlockSupport( result.name, 'customClassName', true ) ) {
117
+ return result;
118
+ }
119
+
120
+ // If the condition verifies we are probably in the presence of a wrapping transform
121
+ // e.g: nesting paragraphs in a group or columns and in that case the class should not be kept.
122
+ if ( results.length === 1 && result.innerBlocks.length === source.length ) {
123
+ return result;
124
+ }
125
+
126
+ // If we are transforming one block to multiple blocks or multiple blocks to one block,
127
+ // we ignore the class during the transform.
128
+ if (
129
+ ( results.length === 1 && source.length > 1 ) ||
130
+ ( results.length > 1 && source.length === 1 )
131
+ ) {
132
+ return result;
133
+ }
134
+
135
+ // If we are in presence of transform between one or more block in the source
136
+ // that have one or more blocks in the result
137
+ // we apply the class on source N to the result N,
138
+ // if source N does not exists we do nothing.
139
+ if ( source[ index ] ) {
140
+ const originClassName = source[ index ]?.attributes.className;
141
+ if ( originClassName ) {
142
+ return {
143
+ ...result,
144
+ attributes: {
145
+ ...result.attributes,
146
+ className: originClassName,
147
+ },
148
+ };
149
+ }
150
+ }
151
+ return result;
152
+ }
153
+
115
154
  addFilter(
116
155
  'blocks.registerBlockType',
117
156
  'core/custom-class-name/attribute',
@@ -127,3 +166,9 @@ addFilter(
127
166
  'core/custom-class-name/save-props',
128
167
  addSaveProps
129
168
  );
169
+
170
+ addFilter(
171
+ 'blocks.switchToBlockType.transformedBlock',
172
+ 'core/color/addTransforms',
173
+ addTransforms
174
+ );
@@ -20,11 +20,11 @@ import { hasBlockSupport, getBlockDefaultClassName } from '@wordpress/blocks';
20
20
  * @return {Object} Filtered props applied to save element.
21
21
  */
22
22
  export function addGeneratedClassName( extraProps, blockType ) {
23
- // Adding the generated className
23
+ // Adding the generated className.
24
24
  if ( hasBlockSupport( blockType, 'className', true ) ) {
25
25
  if ( typeof extraProps.className === 'string' ) {
26
26
  // We have some extra classes and want to add the default classname
27
- // We use uniq to prevent duplicate classnames
27
+ // We use uniq to prevent duplicate classnames.
28
28
 
29
29
  extraProps.className = uniq( [
30
30
  getBlockDefaultClassName( blockType.name ),
@@ -34,7 +34,7 @@ export function addGeneratedClassName( extraProps, blockType ) {
34
34
  .trim();
35
35
  } else {
36
36
  // There is no string in the className variable,
37
- // so we just dump the default name in there
37
+ // so we just dump the default name in there.
38
38
  extraProps.className = getBlockDefaultClassName( blockType.name );
39
39
  }
40
40
  }
@@ -38,6 +38,8 @@ export function LineHeightEdit( props ) {
38
38
  };
39
39
  return (
40
40
  <LineHeightControl
41
+ __unstableInputWidth="100%"
42
+ __nextHasNoMarginBottom={ true }
41
43
  value={ style?.typography?.lineHeight }
42
44
  onChange={ onChange }
43
45
  />
package/src/hooks/lock.js CHANGED
@@ -16,7 +16,7 @@ import { addFilter } from '@wordpress/hooks';
16
16
  * @return {Object} Filtered block settings.
17
17
  */
18
18
  export function addAttribute( settings ) {
19
- // allow blocks to specify their own attribute definition with default values if needed.
19
+ // Allow blocks to specify their own attribute definition with default values if needed.
20
20
  if ( has( settings.attributes, [ 'lock', 'type' ] ) ) {
21
21
  return settings;
22
22
  }
@@ -27,6 +27,7 @@ import {
27
27
  __EXPERIMENTAL_ELEMENTS as ELEMENTS,
28
28
  } from '@wordpress/blocks';
29
29
  import { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';
30
+ import { getCSSRules } from '@wordpress/style-engine';
30
31
 
31
32
  /**
32
33
  * Internal dependencies
@@ -85,21 +86,35 @@ export function getInlineStyles( styles = {} ) {
85
86
  // option and backwards compatibility for border radius support.
86
87
  const styleValue = get( styles, path );
87
88
 
88
- if ( !! subPaths && ! isString( styleValue ) ) {
89
- Object.entries( subPaths ).forEach( ( entry ) => {
90
- const [ name, subPath ] = entry;
91
- const value = get( styleValue, [ subPath ] );
92
-
93
- if ( value ) {
94
- output[ name ] = compileStyleValue( value );
95
- }
96
- } );
97
- } else if ( ! ignoredStyles.includes( path.join( '.' ) ) ) {
98
- output[ propKey ] = compileStyleValue( get( styles, path ) );
89
+ if ( ! STYLE_PROPERTY[ propKey ].useEngine ) {
90
+ if ( !! subPaths && ! isString( styleValue ) ) {
91
+ Object.entries( subPaths ).forEach( ( entry ) => {
92
+ const [ name, subPath ] = entry;
93
+ const value = get( styleValue, [ subPath ] );
94
+
95
+ if ( value ) {
96
+ output[ name ] = compileStyleValue( value );
97
+ }
98
+ } );
99
+ } else if ( ! ignoredStyles.includes( path.join( '.' ) ) ) {
100
+ output[ propKey ] = compileStyleValue(
101
+ get( styles, path )
102
+ );
103
+ }
99
104
  }
100
105
  }
101
106
  } );
102
107
 
108
+ // The goal is to move everything to server side generated engine styles
109
+ // This is temporary as we absorb more and more styles into the engine.
110
+ const extraRules = getCSSRules( styles, { selector: 'self' } );
111
+ extraRules.forEach( ( rule ) => {
112
+ if ( rule.selector !== 'self' ) {
113
+ throw "This style can't be added as inline style";
114
+ }
115
+ output[ rule.key ] = rule.value;
116
+ } );
117
+
103
118
  return output;
104
119
  }
105
120
 
@@ -107,8 +122,11 @@ function compileElementsStyles( selector, elements = {} ) {
107
122
  return map( elements, ( styles, element ) => {
108
123
  const elementStyles = getInlineStyles( styles );
109
124
  if ( ! isEmpty( elementStyles ) ) {
125
+ // The .editor-styles-wrapper selector is required on elements styles. As it is
126
+ // added to all other editor styles, not providing it causes reset and global
127
+ // styles to override element styles because of higher specificity.
110
128
  return [
111
- `.${ selector } ${ ELEMENTS[ element ] }{`,
129
+ `.editor-styles-wrapper .${ selector } ${ ELEMENTS[ element ] }{`,
112
130
  ...map(
113
131
  elementStyles,
114
132
  ( value, property ) =>
@@ -133,7 +151,7 @@ function addAttribute( settings ) {
133
151
  return settings;
134
152
  }
135
153
 
136
- // allow blocks to specify their own attribute definition with default values if needed.
154
+ // Allow blocks to specify their own attribute definition with default values if needed.
137
155
  if ( ! settings.attributes.style ) {
138
156
  Object.assign( settings.attributes, {
139
157
  style: {
@@ -167,7 +167,7 @@ describe( 'align', () => {
167
167
  isSelected
168
168
  />
169
169
  );
170
- // when there's only one child, `rendered` in the tree is an object not an array.
170
+ // When there's only one child, `rendered` in the tree is an object not an array.
171
171
  expect( wrapper.toTree().rendered ).toBeInstanceOf( Object );
172
172
  } );
173
173
 
@@ -6,10 +6,6 @@
6
6
  margin-bottom: 0;
7
7
  }
8
8
 
9
- .block-editor-line-height-control input {
10
- max-width: 100%;
11
- }
12
-
13
9
  .single-column {
14
10
  grid-column: span 1;
15
11
  }
@@ -115,31 +115,36 @@ export default {
115
115
  let output =
116
116
  !! contentSize || !! wideSize
117
117
  ? `
118
- ${ appendSelectors( selector, '> *' ) } {
118
+ ${ appendSelectors(
119
+ selector,
120
+ '> :where(:not(.alignleft):not(.alignright))'
121
+ ) } {
119
122
  max-width: ${ contentSize ?? wideSize };
120
123
  margin-left: auto !important;
121
124
  margin-right: auto !important;
122
125
  }
123
126
 
124
- ${ appendSelectors( selector, '> [data-align="wide"]' ) } {
127
+ ${ appendSelectors( selector, '> .alignwide' ) } {
125
128
  max-width: ${ wideSize ?? contentSize };
126
129
  }
127
130
 
128
- ${ appendSelectors( selector, '> [data-align="full"]' ) } {
131
+ ${ appendSelectors( selector, '> .alignfull' ) } {
129
132
  max-width: none;
130
133
  }
131
134
  `
132
135
  : '';
133
136
 
134
137
  output += `
135
- ${ appendSelectors( selector, '> [data-align="left"]' ) } {
138
+ ${ appendSelectors( selector, '> .alignleft' ) } {
136
139
  float: left;
137
140
  margin-right: 2em;
141
+ margin-left: 0;
138
142
  }
139
143
 
140
- ${ appendSelectors( selector, '> [data-align="right"]' ) } {
144
+ ${ appendSelectors( selector, '> .alignright' ) } {
141
145
  float: right;
142
146
  margin-left: 2em;
147
+ margin-right: 0;
143
148
  }
144
149
 
145
150
  `;
@@ -259,10 +259,15 @@ export function stopMultiSelect() {
259
259
  /**
260
260
  * Action that changes block multi-selection.
261
261
  *
262
- * @param {string} start First block of the multi selection.
263
- * @param {string} end Last block of the multiselection.
262
+ * @param {string} start First block of the multi selection.
263
+ * @param {string} end Last block of the multiselection.
264
+ * @param {number|null} __experimentalInitialPosition Optional initial position. Pass as null to skip focus within editor canvas.
264
265
  */
265
- export const multiSelect = ( start, end ) => ( { select, dispatch } ) => {
266
+ export const multiSelect = (
267
+ start,
268
+ end,
269
+ __experimentalInitialPosition = 0
270
+ ) => ( { select, dispatch } ) => {
266
271
  const startBlockRootClientId = select.getBlockRootClientId( start );
267
272
  const endBlockRootClientId = select.getBlockRootClientId( end );
268
273
 
@@ -271,7 +276,12 @@ export const multiSelect = ( start, end ) => ( { select, dispatch } ) => {
271
276
  return;
272
277
  }
273
278
 
274
- dispatch( { type: 'MULTI_SELECT', start, end } );
279
+ dispatch( {
280
+ type: 'MULTI_SELECT',
281
+ start,
282
+ end,
283
+ initialPosition: __experimentalInitialPosition,
284
+ } );
275
285
 
276
286
  const blockCount = select.getSelectedBlockCount();
277
287
 
@@ -665,7 +675,7 @@ export const mergeBlocks = ( firstBlockClientId, secondBlockClientId ) => ( {
665
675
  const blockA = select.getBlock( clientIdA );
666
676
  const blockAType = getBlockType( blockA.name );
667
677
 
668
- // Only focus the previous block if it's not mergeable
678
+ // Only focus the previous block if it's not mergeable.
669
679
  if ( blockAType && ! blockAType.merge ) {
670
680
  dispatch.selectBlock( blockA.clientId );
671
681
  return;
@@ -734,18 +744,18 @@ export const mergeBlocks = ( firstBlockClientId, secondBlockClientId ) => ( {
734
744
  }
735
745
 
736
746
  // We can only merge blocks with similar types
737
- // thus, we transform the block to merge first
747
+ // thus, we transform the block to merge first.
738
748
  const blocksWithTheSameType =
739
749
  blockA.name === blockB.name
740
750
  ? [ cloneB ]
741
751
  : switchToBlockType( cloneB, blockA.name );
742
752
 
743
- // If the block types can not match, do nothing
753
+ // If the block types can not match, do nothing.
744
754
  if ( ! blocksWithTheSameType || ! blocksWithTheSameType.length ) {
745
755
  return;
746
756
  }
747
757
 
748
- // Calling the merge to update the attributes and remove the block to be merged
758
+ // Calling the merge to update the attributes and remove the block to be merged.
749
759
  const updatedAttributes = blockAType.merge(
750
760
  cloneA.attributes,
751
761
  blocksWithTheSameType[ 0 ].attributes
@@ -996,11 +1006,11 @@ export function selectionChange(
996
1006
  * @param {?Object} attributes Optional attributes of the block to assign.
997
1007
  * @param {?string} rootClientId Optional root client ID of block list on which
998
1008
  * to append.
999
- * @param {?number} index Optional index where to insert the default block
1000
- *
1001
- * @return {Object} Action object
1009
+ * @param {?number} index Optional index where to insert the default block.
1002
1010
  */
1003
- export function insertDefaultBlock( attributes, rootClientId, index ) {
1011
+ export const insertDefaultBlock = ( attributes, rootClientId, index ) => ( {
1012
+ dispatch,
1013
+ } ) => {
1004
1014
  // Abort if there is no default block type (if it has been unregistered).
1005
1015
  const defaultBlockName = getDefaultBlockName();
1006
1016
  if ( ! defaultBlockName ) {
@@ -1009,8 +1019,8 @@ export function insertDefaultBlock( attributes, rootClientId, index ) {
1009
1019
 
1010
1020
  const block = createBlock( defaultBlockName, attributes );
1011
1021
 
1012
- return insertBlock( block, index, rootClientId );
1013
- }
1022
+ return dispatch.insertBlock( block, index, rootClientId );
1023
+ };
1014
1024
 
1015
1025
  /**
1016
1026
  * Action that changes the nested settings of a given block.
@@ -134,7 +134,7 @@ export const SETTINGS_DEFAULTS = {
134
134
  { slug: 'full', name: __( 'Full Size' ) },
135
135
  ],
136
136
 
137
- // Allow plugin to disable Image Editor if need be
137
+ // Allow plugin to disable Image Editor if need be.
138
138
  imageEditing: true,
139
139
 
140
140
  // This is current max width of the block inner area
@@ -156,8 +156,8 @@ export const SETTINGS_DEFAULTS = {
156
156
  __experimentalBlockPatterns: [],
157
157
  __experimentalBlockPatternCategories: [],
158
158
  __experimentalSpotlightEntityBlocks: [],
159
+ __experimentalGenerateAnchors: false,
159
160
  __unstableGalleryWithImageBlocks: false,
160
-
161
161
  // gradients setting is not used anymore now defaults are passed from theme.json on the server and core has its own defaults.
162
162
  // The setting is only kept for backward compatibility purposes.
163
163
  gradients: [
@@ -22,7 +22,6 @@ export const storeConfig = {
22
22
  reducer,
23
23
  selectors,
24
24
  actions,
25
- __experimentalUseThunks: true,
26
25
  };
27
26
 
28
27
  /**