@wordpress/block-editor 8.1.2 → 8.3.0-next.e230fbab09.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 (591) hide show
  1. package/CHANGELOG.md +10 -0
  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 +2 -2
  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/duotone.js +22 -4
  189. package/build/hooks/duotone.js.map +1 -1
  190. package/build/hooks/generated-class-name.js +3 -3
  191. package/build/hooks/generated-class-name.js.map +1 -1
  192. package/build/hooks/line-height.js +2 -0
  193. package/build/hooks/line-height.js.map +1 -1
  194. package/build/hooks/lock.js +1 -1
  195. package/build/hooks/lock.js.map +1 -1
  196. package/build/hooks/style.js +32 -13
  197. package/build/hooks/style.js.map +1 -1
  198. package/build/layouts/flow.js +7 -5
  199. package/build/layouts/flow.js.map +1 -1
  200. package/build/store/actions.js +55 -48
  201. package/build/store/actions.js.map +1 -1
  202. package/build/store/defaults.js +2 -1
  203. package/build/store/defaults.js.map +1 -1
  204. package/build/store/index.js +1 -2
  205. package/build/store/index.js.map +1 -1
  206. package/build/store/reducer.js +13 -13
  207. package/build/store/reducer.js.map +1 -1
  208. package/build/store/selectors.js +6 -6
  209. package/build/store/selectors.js.map +1 -1
  210. package/build/utils/index.js +0 -14
  211. package/build/utils/index.js.map +1 -1
  212. package/build/utils/parse-css-unit-to-px.js +3 -3
  213. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  214. package/build/utils/pasting.js +91 -0
  215. package/build/utils/pasting.js.map +1 -0
  216. package/build/utils/transform-styles/ast/parse.js +5 -5
  217. package/build/utils/transform-styles/ast/parse.js.map +1 -1
  218. package/build/utils/transform-styles/transforms/url-rewrite.js +2 -2
  219. package/build/utils/transform-styles/transforms/url-rewrite.js.map +1 -1
  220. package/build-module/autocompleters/link.js +64 -0
  221. package/build-module/autocompleters/link.js.map +1 -0
  222. package/build-module/components/autocomplete/index.js +2 -1
  223. package/build-module/components/autocomplete/index.js.map +1 -1
  224. package/build-module/components/block-actions/index.js +1 -1
  225. package/build-module/components/block-actions/index.js.map +1 -1
  226. package/build-module/components/block-breadcrumb/index.js +4 -2
  227. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  228. package/build-module/components/block-compare/index.js +2 -2
  229. package/build-module/components/block-compare/index.js.map +1 -1
  230. package/build-module/components/block-controls/index.js +1 -1
  231. package/build-module/components/block-controls/index.js.map +1 -1
  232. package/build-module/components/block-draggable/index.js +1 -1
  233. package/build-module/components/block-draggable/index.js.map +1 -1
  234. package/build-module/components/block-edit/edit.js +1 -1
  235. package/build-module/components/block-edit/edit.js.map +1 -1
  236. package/build-module/components/block-list/block-html.js +1 -1
  237. package/build-module/components/block-list/block-html.js.map +1 -1
  238. package/build-module/components/block-list/block-invalid-warning.js +1 -1
  239. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  240. package/build-module/components/block-list/block-list-item.native.js +4 -4
  241. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  242. package/build-module/components/block-list/block-selection-button.native.js +4 -3
  243. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  244. package/build-module/components/block-list/block.js +18 -4
  245. package/build-module/components/block-list/block.js.map +1 -1
  246. package/build-module/components/block-list/block.native.js +7 -7
  247. package/build-module/components/block-list/block.native.js.map +1 -1
  248. package/build-module/components/block-list/index.native.js +5 -5
  249. package/build-module/components/block-list/index.native.js.map +1 -1
  250. package/build-module/components/block-list/use-block-props/use-block-class-names.js +1 -1
  251. package/build-module/components/block-list/use-block-props/use-block-class-names.js.map +1 -1
  252. package/build-module/components/block-list/use-block-props/use-focus-first-element.js +2 -0
  253. package/build-module/components/block-list/use-block-props/use-focus-first-element.js.map +1 -1
  254. package/build-module/components/block-list/use-block-props/use-multi-selection.js +23 -28
  255. package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  256. package/build-module/components/block-media-update-progress/index.native.js +4 -4
  257. package/build-module/components/block-media-update-progress/index.native.js.map +1 -1
  258. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
  259. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  260. package/build-module/components/block-mobile-toolbar/index.native.js +1 -1
  261. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  262. package/build-module/components/block-mover/mover-description.js +4 -4
  263. package/build-module/components/block-mover/mover-description.js.map +1 -1
  264. package/build-module/components/block-mover/mover-description.native.js +5 -5
  265. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  266. package/build-module/components/block-settings/container.native.js +2 -6
  267. package/build-module/components/block-settings/container.native.js.map +1 -1
  268. package/build-module/components/block-settings-menu/block-settings-dropdown.js +7 -13
  269. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  270. package/build-module/components/block-styles/preview.native.js +1 -1
  271. package/build-module/components/block-styles/preview.native.js.map +1 -1
  272. package/build-module/components/block-switcher/index.js +2 -1
  273. package/build-module/components/block-switcher/index.js.map +1 -1
  274. package/build-module/components/block-switcher/use-transformed-patterns.js +0 -1
  275. package/build-module/components/block-switcher/use-transformed-patterns.js.map +1 -1
  276. package/build-module/components/block-title/index.js +7 -58
  277. package/build-module/components/block-title/index.js.map +1 -1
  278. package/build-module/components/block-title/use-block-display-title.js +80 -0
  279. package/build-module/components/block-title/use-block-display-title.js.map +1 -0
  280. package/build-module/components/block-toolbar/utils.js +9 -1
  281. package/build-module/components/block-toolbar/utils.js.map +1 -1
  282. package/build-module/components/block-tools/block-popover.js +1 -1
  283. package/build-module/components/block-tools/block-popover.js.map +1 -1
  284. package/build-module/components/block-tools/block-selection-button.js +2 -1
  285. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  286. package/build-module/components/block-types-list/index.native.js +1 -1
  287. package/build-module/components/block-types-list/index.native.js.map +1 -1
  288. package/build-module/components/border-radius-control/index.js +3 -3
  289. package/build-module/components/border-radius-control/index.js.map +1 -1
  290. package/build-module/components/border-radius-control/utils.js +11 -7
  291. package/build-module/components/border-radius-control/utils.js.map +1 -1
  292. package/build-module/components/contrast-checker/index.js +3 -3
  293. package/build-module/components/contrast-checker/index.js.map +1 -1
  294. package/build-module/components/convert-to-group-buttons/index.js +1 -1
  295. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  296. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +1 -3
  297. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  298. package/build-module/components/copy-handler/index.js +2 -2
  299. package/build-module/components/copy-handler/index.js.map +1 -1
  300. package/build-module/components/font-sizes/with-font-sizes.js +3 -3
  301. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  302. package/build-module/components/index.js +1 -0
  303. package/build-module/components/index.js.map +1 -1
  304. package/build-module/components/index.native.js +5 -4
  305. package/build-module/components/index.native.js.map +1 -1
  306. package/build-module/components/inserter/block-patterns-tab.js +4 -4
  307. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  308. package/build-module/components/inserter/block-types-tab.js +1 -1
  309. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  310. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +2 -2
  311. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  312. package/build-module/components/inserter/index.js +3 -3
  313. package/build-module/components/inserter/index.js.map +1 -1
  314. package/build-module/components/inserter/index.native.js +7 -7
  315. package/build-module/components/inserter/index.native.js.map +1 -1
  316. package/build-module/components/inserter/menu.js.map +1 -1
  317. package/build-module/components/inserter/menu.native.js +3 -3
  318. package/build-module/components/inserter/menu.native.js.map +1 -1
  319. package/build-module/components/inserter/quick-inserter.js +20 -8
  320. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  321. package/build-module/components/inserter/search-items.js +1 -1
  322. package/build-module/components/inserter/search-items.js.map +1 -1
  323. package/build-module/components/inserter/search-results.js +28 -11
  324. package/build-module/components/inserter/search-results.js.map +1 -1
  325. package/build-module/components/keyboard-shortcuts/index.js +1 -1
  326. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  327. package/build-module/components/letter-spacing-control/index.js +3 -3
  328. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  329. package/build-module/components/line-height-control/index.js +61 -45
  330. package/build-module/components/line-height-control/index.js.map +1 -1
  331. package/build-module/components/line-height-control/index.native.js +3 -1
  332. package/build-module/components/line-height-control/index.native.js.map +1 -1
  333. package/build-module/components/link-control/index.js +2 -2
  334. package/build-module/components/link-control/index.js.map +1 -1
  335. package/build-module/components/link-control/search-input.js +1 -1
  336. package/build-module/components/link-control/search-input.js.map +1 -1
  337. package/build-module/components/link-control/search-results.js +2 -2
  338. package/build-module/components/link-control/search-results.js.map +1 -1
  339. package/build-module/components/link-control/use-rich-url-data.js +1 -1
  340. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  341. package/build-module/components/link-control/use-search-handler.js +2 -2
  342. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  343. package/build-module/components/list-view/block-contents.js +8 -4
  344. package/build-module/components/list-view/block-contents.js.map +1 -1
  345. package/build-module/components/list-view/block-select-button.js +2 -2
  346. package/build-module/components/list-view/block-select-button.js.map +1 -1
  347. package/build-module/components/list-view/block.js +20 -9
  348. package/build-module/components/list-view/block.js.map +1 -1
  349. package/build-module/components/list-view/branch.js +2 -1
  350. package/build-module/components/list-view/branch.js.map +1 -1
  351. package/build-module/components/list-view/index.js +46 -42
  352. package/build-module/components/list-view/index.js.map +1 -1
  353. package/build-module/components/list-view/use-block-selection.js +123 -0
  354. package/build-module/components/list-view/use-block-selection.js.map +1 -0
  355. package/build-module/components/list-view/use-list-view-expand-selected-item.js +50 -0
  356. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -0
  357. package/build-module/components/list-view/utils.js +25 -0
  358. package/build-module/components/list-view/utils.js.map +1 -1
  359. package/build-module/components/media-placeholder/index.native.js +7 -5
  360. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  361. package/build-module/components/media-replace-flow/index.js +22 -27
  362. package/build-module/components/media-replace-flow/index.js.map +1 -1
  363. package/build-module/components/media-upload/index.native.js +4 -3
  364. package/build-module/components/media-upload/index.native.js.map +1 -1
  365. package/build-module/components/media-upload-progress/index.native.js +2 -2
  366. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  367. package/build-module/components/navigable-toolbar/index.js +3 -3
  368. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  369. package/build-module/components/plain-text/index.native.js +3 -3
  370. package/build-module/components/plain-text/index.native.js.map +1 -1
  371. package/build-module/components/rich-text/format-toolbar-container.js +2 -2
  372. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  373. package/build-module/components/rich-text/format-toolbar-container.native.js +1 -1
  374. package/build-module/components/rich-text/format-toolbar-container.native.js.map +1 -1
  375. package/build-module/components/rich-text/index.js +7 -12
  376. package/build-module/components/rich-text/index.js.map +1 -1
  377. package/build-module/components/rich-text/index.native.js +3 -3
  378. package/build-module/components/rich-text/index.native.js.map +1 -1
  379. package/build-module/components/rich-text/use-paste-handler.js +6 -12
  380. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  381. package/build-module/components/url-input/index.js +11 -11
  382. package/build-module/components/url-input/index.js.map +1 -1
  383. package/build-module/components/use-moving-animation/index.js +1 -1
  384. package/build-module/components/use-moving-animation/index.js.map +1 -1
  385. package/build-module/components/use-on-block-drop/index.js +2 -2
  386. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  387. package/build-module/components/writing-flow/index.js +1 -0
  388. package/build-module/components/writing-flow/index.js.map +1 -1
  389. package/build-module/components/writing-flow/use-multi-selection.js +21 -21
  390. package/build-module/components/writing-flow/use-multi-selection.js.map +1 -1
  391. package/build-module/components/writing-flow/use-select-all.js +3 -2
  392. package/build-module/components/writing-flow/use-select-all.js.map +1 -1
  393. package/build-module/components/writing-flow/use-tab-nav.js +4 -3
  394. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  395. package/build-module/hooks/align.js +1 -1
  396. package/build-module/hooks/align.js.map +1 -1
  397. package/build-module/hooks/anchor.js +1 -1
  398. package/build-module/hooks/anchor.js.map +1 -1
  399. package/build-module/hooks/border.js +2 -14
  400. package/build-module/hooks/border.js.map +1 -1
  401. package/build-module/hooks/color.js +2 -2
  402. package/build-module/hooks/color.js.map +1 -1
  403. package/build-module/hooks/custom-class-name.js +38 -0
  404. package/build-module/hooks/custom-class-name.js.map +1 -1
  405. package/build-module/hooks/duotone.js +23 -5
  406. package/build-module/hooks/duotone.js.map +1 -1
  407. package/build-module/hooks/generated-class-name.js +3 -3
  408. package/build-module/hooks/generated-class-name.js.map +1 -1
  409. package/build-module/hooks/line-height.js +2 -0
  410. package/build-module/hooks/line-height.js.map +1 -1
  411. package/build-module/hooks/lock.js +1 -1
  412. package/build-module/hooks/lock.js.map +1 -1
  413. package/build-module/hooks/style.js +31 -13
  414. package/build-module/hooks/style.js.map +1 -1
  415. package/build-module/layouts/flow.js +7 -5
  416. package/build-module/layouts/flow.js.map +1 -1
  417. package/build-module/store/actions.js +52 -45
  418. package/build-module/store/actions.js.map +1 -1
  419. package/build-module/store/defaults.js +2 -1
  420. package/build-module/store/defaults.js.map +1 -1
  421. package/build-module/store/index.js +1 -2
  422. package/build-module/store/index.js.map +1 -1
  423. package/build-module/store/reducer.js +13 -13
  424. package/build-module/store/reducer.js.map +1 -1
  425. package/build-module/store/selectors.js +6 -6
  426. package/build-module/store/selectors.js.map +1 -1
  427. package/build-module/utils/index.js +0 -1
  428. package/build-module/utils/index.js.map +1 -1
  429. package/build-module/utils/parse-css-unit-to-px.js +3 -3
  430. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  431. package/build-module/utils/pasting.js +80 -0
  432. package/build-module/utils/pasting.js.map +1 -0
  433. package/build-module/utils/transform-styles/ast/parse.js +5 -5
  434. package/build-module/utils/transform-styles/ast/parse.js.map +1 -1
  435. package/build-module/utils/transform-styles/transforms/url-rewrite.js +2 -2
  436. package/build-module/utils/transform-styles/transforms/url-rewrite.js.map +1 -1
  437. package/build-style/style-rtl.css +10 -12
  438. package/build-style/style.css +10 -12
  439. package/package.json +27 -26
  440. package/src/autocompleters/link.js +62 -0
  441. package/src/autocompleters/style.scss +8 -0
  442. package/src/components/alignment-control/test/index.js +2 -2
  443. package/src/components/autocomplete/index.js +2 -0
  444. package/src/components/block-actions/index.js +1 -1
  445. package/src/components/block-alignment-control/test/index.js +1 -1
  446. package/src/components/block-breadcrumb/index.js +5 -2
  447. package/src/components/block-compare/index.js +2 -2
  448. package/src/components/block-controls/index.js +1 -1
  449. package/src/components/block-draggable/index.js +1 -1
  450. package/src/components/block-draggable/stories/index.js +1 -1
  451. package/src/components/block-edit/edit.js +1 -1
  452. package/src/components/block-list/block-html.js +1 -1
  453. package/src/components/block-list/block-invalid-warning.js +1 -1
  454. package/src/components/block-list/block-list-item.native.js +4 -4
  455. package/src/components/block-list/block-selection-button.native.js +3 -3
  456. package/src/components/block-list/block.js +28 -4
  457. package/src/components/block-list/block.native.js +7 -6
  458. package/src/components/block-list/index.native.js +5 -5
  459. package/src/components/block-list/style.scss +3 -1
  460. package/src/components/block-list/use-block-props/use-block-class-names.js +1 -1
  461. package/src/components/block-list/use-block-props/use-focus-first-element.js +3 -0
  462. package/src/components/block-list/use-block-props/use-multi-selection.js +22 -30
  463. package/src/components/block-media-update-progress/index.native.js +4 -4
  464. package/src/components/block-media-update-progress/test/index.native.js +2 -2
  465. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +3 -3
  466. package/src/components/block-mobile-toolbar/index.native.js +2 -2
  467. package/src/components/block-mover/mover-description.js +4 -4
  468. package/src/components/block-mover/mover-description.native.js +5 -5
  469. package/src/components/block-settings/container.native.js +5 -6
  470. package/src/components/block-settings-menu/block-settings-dropdown.js +7 -8
  471. package/src/components/block-styles/preview.native.js +1 -1
  472. package/src/components/block-switcher/index.js +4 -1
  473. package/src/components/block-switcher/use-transformed-patterns.js +0 -1
  474. package/src/components/block-title/README.md +17 -1
  475. package/src/components/block-title/index.js +7 -62
  476. package/src/components/block-title/test/index.js +21 -3
  477. package/src/components/block-title/use-block-display-title.js +83 -0
  478. package/src/components/block-toolbar/utils.js +12 -2
  479. package/src/components/block-tools/block-popover.js +1 -1
  480. package/src/components/block-tools/block-selection-button.js +4 -1
  481. package/src/components/block-types-list/index.native.js +1 -1
  482. package/src/components/border-radius-control/index.js +5 -3
  483. package/src/components/border-radius-control/test/utils.js +10 -10
  484. package/src/components/border-radius-control/utils.js +10 -8
  485. package/src/components/contrast-checker/index.js +3 -3
  486. package/src/components/convert-to-group-buttons/index.js +1 -1
  487. package/src/components/convert-to-group-buttons/use-convert-to-group-button-props.js +1 -6
  488. package/src/components/copy-handler/index.js +2 -2
  489. package/src/components/font-sizes/with-font-sizes.js +3 -3
  490. package/src/components/image-size-control/test/index.js +1 -1
  491. package/src/components/index.js +1 -0
  492. package/src/components/index.native.js +11 -4
  493. package/src/components/inserter/block-patterns-tab.js +13 -17
  494. package/src/components/inserter/block-types-tab.js +1 -1
  495. package/src/components/inserter/hooks/use-block-type-impressions.native.js +2 -2
  496. package/src/components/inserter/index.js +3 -3
  497. package/src/components/inserter/index.native.js +7 -7
  498. package/src/components/inserter/menu.js +1 -1
  499. package/src/components/inserter/menu.native.js +3 -3
  500. package/src/components/inserter/quick-inserter.js +32 -10
  501. package/src/components/inserter/search-items.js +1 -1
  502. package/src/components/inserter/search-results.js +55 -43
  503. package/src/components/inserter/test/fixtures/index.native.js +1 -1
  504. package/src/components/inserter/test/reusable-blocks-tab.js +2 -2
  505. package/src/components/justify-content-control/README.md +1 -1
  506. package/src/components/keyboard-shortcuts/index.js +1 -1
  507. package/src/components/letter-spacing-control/index.js +1 -1
  508. package/src/components/line-height-control/README.md +13 -2
  509. package/src/components/line-height-control/index.js +66 -43
  510. package/src/components/line-height-control/index.native.js +2 -0
  511. package/src/components/line-height-control/stories/index.js +33 -0
  512. package/src/components/line-height-control/test/index.js +61 -0
  513. package/src/components/link-control/index.js +2 -2
  514. package/src/components/link-control/search-input.js +1 -1
  515. package/src/components/link-control/search-results.js +2 -2
  516. package/src/components/link-control/test/index.js +142 -144
  517. package/src/components/link-control/use-rich-url-data.js +1 -1
  518. package/src/components/link-control/use-search-handler.js +2 -2
  519. package/src/components/list-view/README.md +2 -2
  520. package/src/components/list-view/block-contents.js +10 -3
  521. package/src/components/list-view/block-select-button.js +1 -2
  522. package/src/components/list-view/block.js +30 -10
  523. package/src/components/list-view/branch.js +1 -0
  524. package/src/components/list-view/index.js +56 -30
  525. package/src/components/list-view/test/utils.js +50 -0
  526. package/src/components/list-view/use-block-selection.js +163 -0
  527. package/src/components/list-view/use-list-view-expand-selected-item.js +58 -0
  528. package/src/components/list-view/utils.js +31 -0
  529. package/src/components/media-placeholder/index.native.js +11 -9
  530. package/src/components/media-replace-flow/README.md +7 -0
  531. package/src/components/media-replace-flow/index.js +20 -26
  532. package/src/components/media-replace-flow/test/index.js +100 -0
  533. package/src/components/media-upload/index.native.js +3 -2
  534. package/src/components/media-upload-progress/index.native.js +2 -2
  535. package/src/components/navigable-toolbar/index.js +3 -3
  536. package/src/components/plain-text/index.native.js +3 -3
  537. package/src/components/responsive-block-control/test/index.js +6 -6
  538. package/src/components/rich-text/format-toolbar-container.js +2 -2
  539. package/src/components/rich-text/format-toolbar-container.native.js +1 -1
  540. package/src/components/rich-text/index.js +7 -14
  541. package/src/components/rich-text/index.native.js +3 -3
  542. package/src/components/rich-text/use-paste-handler.js +7 -14
  543. package/src/components/url-input/index.js +11 -11
  544. package/src/components/use-block-drop-zone/test/index.js +1 -1
  545. package/src/components/use-moving-animation/index.js +1 -1
  546. package/src/components/use-on-block-drop/index.js +2 -2
  547. package/src/components/writing-flow/index.js +1 -0
  548. package/src/components/writing-flow/use-multi-selection.js +17 -20
  549. package/src/components/writing-flow/use-select-all.js +6 -2
  550. package/src/components/writing-flow/use-tab-nav.js +6 -3
  551. package/src/hooks/align.js +1 -1
  552. package/src/hooks/anchor.js +1 -1
  553. package/src/hooks/border.js +8 -19
  554. package/src/hooks/color.js +2 -2
  555. package/src/hooks/custom-class-name.js +45 -0
  556. package/src/hooks/duotone.js +27 -3
  557. package/src/hooks/generated-class-name.js +3 -3
  558. package/src/hooks/line-height.js +2 -0
  559. package/src/hooks/lock.js +1 -1
  560. package/src/hooks/style.js +31 -13
  561. package/src/hooks/test/align.js +1 -1
  562. package/src/hooks/typography.scss +0 -4
  563. package/src/layouts/flow.js +10 -5
  564. package/src/store/actions.js +24 -14
  565. package/src/store/defaults.js +2 -2
  566. package/src/store/index.js +0 -1
  567. package/src/store/reducer.js +13 -12
  568. package/src/store/selectors.js +6 -6
  569. package/src/store/test/actions.js +2 -2
  570. package/src/store/test/reducer.js +10 -1
  571. package/src/store/test/selectors.js +1 -1
  572. package/src/style.scss +0 -1
  573. package/src/utils/index.js +0 -1
  574. package/src/utils/parse-css-unit-to-px.js +3 -3
  575. package/src/utils/pasting.js +77 -0
  576. package/src/utils/test/parse-css-unit-to-px.js +5 -5
  577. package/src/utils/test/pasting.js +84 -0
  578. package/src/utils/transform-styles/ast/parse.js +5 -5
  579. package/src/utils/transform-styles/transforms/url-rewrite.js +2 -2
  580. package/build/utils/get-paste-event-data.js +0 -56
  581. package/build/utils/get-paste-event-data.js.map +0 -1
  582. package/build/utils/theme.js +0 -63
  583. package/build/utils/theme.js.map +0 -1
  584. package/build-module/utils/get-paste-event-data.js +0 -47
  585. package/build-module/utils/get-paste-event-data.js.map +0 -1
  586. package/build-module/utils/theme.js +0 -53
  587. package/build-module/utils/theme.js.map +0 -1
  588. package/src/components/line-height-control/style.scss +0 -8
  589. package/src/components/writing-flow/test/use-multi-selection.js +0 -36
  590. package/src/utils/get-paste-event-data.js +0 -42
  591. package/src/utils/theme.js +0 -48
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/style.js"],"names":["first","forEach","get","has","isEmpty","isString","kebabCase","map","omit","startsWith","classnames","useContext","createPortal","addFilter","getBlockSupport","hasBlockSupport","__EXPERIMENTAL_STYLE_PROPERTY","STYLE_PROPERTY","__EXPERIMENTAL_ELEMENTS","ELEMENTS","createHigherOrderComponent","useInstanceId","BlockList","BORDER_SUPPORT_KEY","BorderPanel","COLOR_SUPPORT_KEY","ColorEdit","TypographyPanel","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","SPACING_SUPPORT_KEY","DimensionsPanel","useDisplayBlockControls","styleSupportKeys","hasStyleSupport","blockType","some","key","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","compileStyleValue","uncompiledValue","variable","slice","length","split","join","getInlineStyles","styles","ignoredStyles","output","Object","keys","propKey","path","value","subPaths","properties","styleValue","entries","entry","name","subPath","includes","compileElementsStyles","selector","elements","element","elementStyles","property","addAttribute","settings","attributes","style","assign","type","skipSerializationPathsEdit","skipSerializationPathsSave","addSaveProps","props","skipPaths","indicator","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBlockControls","BlockEdit","shouldDisplayControls","withElementsStyles","BlockListBlock","blockElementsContainerIdentifier","__unstableElementContext","__html","className"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,KADD,EAECC,OAFD,EAGCC,GAHD,EAICC,GAJD,EAKCC,OALD,EAMCC,QAND,EAOCC,SAPD,EAQCC,GARD,EASCC,IATD,EAUCC,UAVD,QAWO,QAXP;AAYA,OAAOC,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,oBAAzC;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SACCC,eADD,EAECC,eAFD,EAGCC,6BAA6B,IAAIC,cAHlC,EAICC,uBAAuB,IAAIC,QAJ5B,QAKO,mBALP;AAMA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,0BAAtB;AACA,SAASC,kBAAT,EAA6BC,WAA7B,QAAgD,UAAhD;AACA,SAASC,iBAAT,EAA4BC,SAA5B,QAA6C,SAA7C;AACA,SACCC,eADD,EAECC,sBAFD,EAGCC,uBAHD,QAIO,cAJP;A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AT;AAMAzE,SAAS,CACR,uBADQ,EAER,kCAFQ,EAGR4E,kBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tfirst,\n\tforEach,\n\tget,\n\thas,\n\tisEmpty,\n\tisString,\n\tkebabCase,\n\tmap,\n\tomit,\n\tstartsWith,\n} from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, createPortal } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport { SPACING_SUPPORT_KEY, DimensionsPanel } from './dimensions';\nimport useDisplayBlockControls from '../components/use-display-block-controls';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( blockType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( blockType, key ) );\n\nconst VARIABLE_REFERENCE_PREFIX = 'var:';\nconst VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';\nconst VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';\nfunction compileStyleValue( uncompiledValue ) {\n\tif ( startsWith( uncompiledValue, VARIABLE_REFERENCE_PREFIX ) ) {\n\t\tconst variable = uncompiledValue\n\t\t\t.slice( VARIABLE_REFERENCE_PREFIX.length )\n\t\t\t.split( VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE )\n\t\t\t.join( VARIABLE_PATH_SEPARATOR_TOKEN_STYLE );\n\t\treturn `var(--wp--${ variable })`;\n\t}\n\treturn uncompiledValue;\n}\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst ignoredStyles = [ 'spacing.blockGap' ];\n\tconst output = {};\n\tObject.keys( STYLE_PROPERTY ).forEach( ( propKey ) => {\n\t\tconst path = STYLE_PROPERTY[ propKey ].value;\n\t\tconst subPaths = STYLE_PROPERTY[ propKey ].properties;\n\t\t// Ignore styles on elements because they are handled on the server.\n\t\tif ( has( styles, path ) && 'elements' !== first( path ) ) {\n\t\t\t// Checking if style value is a string allows for shorthand css\n\t\t\t// option and backwards compatibility for border radius support.\n\t\t\tconst styleValue = get( styles, path );\n\n\t\t\tif ( !! subPaths && ! isString( styleValue ) ) {\n\t\t\t\tObject.entries( subPaths ).forEach( ( entry ) => {\n\t\t\t\t\tconst [ name, subPath ] = entry;\n\t\t\t\t\tconst value = get( styleValue, [ subPath ] );\n\n\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\toutput[ name ] = compileStyleValue( value );\n\t\t\t\t\t}\n\t\t\t\t} );\n\t\t\t} else if ( ! ignoredStyles.includes( path.join( '.' ) ) ) {\n\t\t\t\toutput[ propKey ] = compileStyleValue( get( styles, path ) );\n\t\t\t}\n\t\t}\n\t} );\n\n\treturn output;\n}\n\nfunction compileElementsStyles( selector, elements = {} ) {\n\treturn map( elements, ( styles, element ) => {\n\t\tconst elementStyles = getInlineStyles( styles );\n\t\tif ( ! isEmpty( elementStyles ) ) {\n\t\t\treturn [\n\t\t\t\t`.${ selector } ${ ELEMENTS[ element ] }{`,\n\t\t\t\t...map(\n\t\t\t\t\telementStyles,\n\t\t\t\t\t( value, property ) =>\n\t\t\t\t\t\t`\\t${ kebabCase( property ) }: ${ value };`\n\t\t\t\t),\n\t\t\t\t'}',\n\t\t\t].join( '\\n' );\n\t\t}\n\t\treturn '';\n\t} ).join( '\\n' );\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\t'spacing',\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ SPACING_SUPPORT_KEY }` ]: [ 'spacing.blockGap' ],\n};\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\n\tforEach( skipPaths, ( path, indicator ) => {\n\t\tif ( getBlockSupport( blockType, indicator ) ) {\n\t\t\tstyle = omit( style, path );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\n/**\n * Filters registered block settings to extend the block edit wrapper\n * to apply the desired styles and classnames properly.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object}.Filtered block settings.\n */\nexport function addEditProps( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\tconst existingGetEditWrapperProps = settings.getEditWrapperProps;\n\tsettings.getEditWrapperProps = ( attributes ) => {\n\t\tlet props = {};\n\t\tif ( existingGetEditWrapperProps ) {\n\t\t\tprops = existingGetEditWrapperProps( attributes );\n\t\t}\n\n\t\treturn addSaveProps(\n\t\t\tprops,\n\t\t\tsettings,\n\t\t\tattributes,\n\t\t\tskipSerializationPathsEdit\n\t\t);\n\t};\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include new inspector controls for\n * all the custom styles configs.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst shouldDisplayControls = useDisplayBlockControls();\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldDisplayControls && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ColorEdit { ...props } />\n\t\t\t\t\t\t<TypographyPanel { ...props } />\n\t\t\t\t\t\t<BorderPanel { ...props } />\n\t\t\t\t\t\t<DimensionsPanel { ...props } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withToolbarControls'\n);\n\n/**\n * Override the default block element to include duotone styles.\n *\n * @param {Function} BlockListBlock Original component\n * @return {Function} Wrapped component\n */\nconst withElementsStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst elements = props.attributes.style?.elements;\n\n\t\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\t\tBlockListBlock\n\t\t) }`;\n\t\tconst styles = compileElementsStyles(\n\t\t\tblockElementsContainerIdentifier,\n\t\t\tprops.attributes.style?.elements\n\t\t);\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ elements &&\n\t\t\t\t\telement &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: styles,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tclassName={\n\t\t\t\t\t\telements\n\t\t\t\t\t\t\t? classnames(\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\tblockElementsContainerIdentifier\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: props.className\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/style/addSaveProps',\n\taddSaveProps\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addEditProps',\n\taddEditProps\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/style/with-block-controls',\n\twithBlockControls\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/with-elements-styles',\n\twithElementsStyles\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/style.js"],"names":["first","forEach","get","has","isEmpty","isString","kebabCase","map","omit","startsWith","classnames","useContext","createPortal","addFilter","getBlockSupport","hasBlockSupport","__EXPERIMENTAL_STYLE_PROPERTY","STYLE_PROPERTY","__EXPERIMENTAL_ELEMENTS","ELEMENTS","createHigherOrderComponent","useInstanceId","getCSSRules","BlockList","BORDER_SUPPORT_KEY","BorderPanel","COLOR_SUPPORT_KEY","ColorEdit","TypographyPanel","TYPOGRAPHY_SUPPORT_KEY","TYPOGRAPHY_SUPPORT_KEYS","SPACING_SUPPORT_KEY","DimensionsPanel","useDisplayBlockControls","styleSupportKeys","hasStyleSupport","blockType","some","key","VARIABLE_REFERENCE_PREFIX","VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE","VARIABLE_PATH_SEPARATOR_TOKEN_STYLE","compileStyleValue","uncompiledValue","variable","slice","length","split","join","getInlineStyles","styles","ignoredStyles","output","Object","keys","propKey","path","value","subPaths","properties","styleValue","useEngine","entries","entry","name","subPath","includes","extraRules","selector","rule","compileElementsStyles","elements","element","elementStyles","property","addAttribute","settings","attributes","style","assign","type","skipSerializationPathsEdit","skipSerializationPathsSave","addSaveProps","props","skipPaths","indicator","addEditProps","existingGetEditWrapperProps","getEditWrapperProps","withBlockControls","BlockEdit","shouldDisplayControls","withElementsStyles","BlockListBlock","blockElementsContainerIdentifier","__unstableElementContext","__html","className"],"mappings":";;;AAAA;AACA;AACA;AACA,SACCA,KADD,EAECC,OAFD,EAGCC,GAHD,EAICC,GAJD,EAKCC,OALD,EAMCC,QAND,EAOCC,SAPD,EAQCC,GARD,EASCC,IATD,EAUCC,UAVD,QAWO,QAXP;AAYA,OA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A0B,CAClD0E,cAAF,IAAwBV,KAAF,IAAa;AAAA;;AAClC,QAAMb,QAAQ,4BAAGa,KAAK,CAACP,UAAN,CAAiBC,KAApB,0DAAG,sBAAwBP,QAAzC;AAEA,QAAMwB,gCAAgC,GAAI,eAAe1E,aAAa,CACrEyE,cADqE,CAEnE,EAFH;AAGA,QAAM5C,MAAM,GAAGoB,qBAAqB,CACnCyB,gCADmC,4BAEnCX,KAAK,CAACP,UAAN,CAAiBC,KAFkB,2DAEnC,uBAAwBP,QAFW,CAApC;AAIA,QAAMC,OAAO,GAAG7D,UAAU,CAAEY,SAAS,CAACyE,wBAAZ,CAA1B;AAEA,SACC,8BACGzB,QAAQ,IACTC,OADC,IAED5D,YAAY,CACX;AACC,IAAA,uBAAuB,EAAG;AACzBqF,MAAAA,MAAM,EAAE/C;AADiB;AAD3B,IADW,EAMXsB,OANW,CAHd,EAYC,cAAC,cAAD,eACMY,KADN;AAEC,IAAA,SAAS,EACRb,QAAQ,GACL7D,UAAU,CACV0E,KAAK,CAACc,SADI,EAEVH,gCAFU,CADL,GAKLX,KAAK,CAACc;AARX,KAZD,CADD;AA0BA,CAvCmD,CAArD;AA0CArF,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGR8D,YAHQ,CAAT;AAMA9D,SAAS,CACR,kCADQ,EAER,yBAFQ,EAGRsE,YAHQ,CAAT;AAMAtE,SAAS,CACR,0BADQ,EAER,yBAFQ,EAGR0E,YAHQ,CAAT;AAMA1E,SAAS,CACR,kBADQ,EAER,gCAFQ,EAGR6E,iBAHQ,CAAT;AAMA7E,SAAS,CACR,uBADQ,EAER,kCAFQ,EAGRgF,kBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport {\n\tfirst,\n\tforEach,\n\tget,\n\thas,\n\tisEmpty,\n\tisString,\n\tkebabCase,\n\tmap,\n\tomit,\n\tstartsWith,\n} from 'lodash';\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useContext, createPortal } from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\nimport {\n\tgetBlockSupport,\n\thasBlockSupport,\n\t__EXPERIMENTAL_STYLE_PROPERTY as STYLE_PROPERTY,\n\t__EXPERIMENTAL_ELEMENTS as ELEMENTS,\n} from '@wordpress/blocks';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { getCSSRules } from '@wordpress/style-engine';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport { BORDER_SUPPORT_KEY, BorderPanel } from './border';\nimport { COLOR_SUPPORT_KEY, ColorEdit } from './color';\nimport {\n\tTypographyPanel,\n\tTYPOGRAPHY_SUPPORT_KEY,\n\tTYPOGRAPHY_SUPPORT_KEYS,\n} from './typography';\nimport { SPACING_SUPPORT_KEY, DimensionsPanel } from './dimensions';\nimport useDisplayBlockControls from '../components/use-display-block-controls';\n\nconst styleSupportKeys = [\n\t...TYPOGRAPHY_SUPPORT_KEYS,\n\tBORDER_SUPPORT_KEY,\n\tCOLOR_SUPPORT_KEY,\n\tSPACING_SUPPORT_KEY,\n];\n\nconst hasStyleSupport = ( blockType ) =>\n\tstyleSupportKeys.some( ( key ) => hasBlockSupport( blockType, key ) );\n\nconst VARIABLE_REFERENCE_PREFIX = 'var:';\nconst VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE = '|';\nconst VARIABLE_PATH_SEPARATOR_TOKEN_STYLE = '--';\nfunction compileStyleValue( uncompiledValue ) {\n\tif ( startsWith( uncompiledValue, VARIABLE_REFERENCE_PREFIX ) ) {\n\t\tconst variable = uncompiledValue\n\t\t\t.slice( VARIABLE_REFERENCE_PREFIX.length )\n\t\t\t.split( VARIABLE_PATH_SEPARATOR_TOKEN_ATTRIBUTE )\n\t\t\t.join( VARIABLE_PATH_SEPARATOR_TOKEN_STYLE );\n\t\treturn `var(--wp--${ variable })`;\n\t}\n\treturn uncompiledValue;\n}\n\n/**\n * Returns the inline styles to add depending on the style object\n *\n * @param {Object} styles Styles configuration.\n *\n * @return {Object} Flattened CSS variables declaration.\n */\nexport function getInlineStyles( styles = {} ) {\n\tconst ignoredStyles = [ 'spacing.blockGap' ];\n\tconst output = {};\n\tObject.keys( STYLE_PROPERTY ).forEach( ( propKey ) => {\n\t\tconst path = STYLE_PROPERTY[ propKey ].value;\n\t\tconst subPaths = STYLE_PROPERTY[ propKey ].properties;\n\t\t// Ignore styles on elements because they are handled on the server.\n\t\tif ( has( styles, path ) && 'elements' !== first( path ) ) {\n\t\t\t// Checking if style value is a string allows for shorthand css\n\t\t\t// option and backwards compatibility for border radius support.\n\t\t\tconst styleValue = get( styles, path );\n\n\t\t\tif ( ! STYLE_PROPERTY[ propKey ].useEngine ) {\n\t\t\t\tif ( !! subPaths && ! isString( styleValue ) ) {\n\t\t\t\t\tObject.entries( subPaths ).forEach( ( entry ) => {\n\t\t\t\t\t\tconst [ name, subPath ] = entry;\n\t\t\t\t\t\tconst value = get( styleValue, [ subPath ] );\n\n\t\t\t\t\t\tif ( value ) {\n\t\t\t\t\t\t\toutput[ name ] = compileStyleValue( value );\n\t\t\t\t\t\t}\n\t\t\t\t\t} );\n\t\t\t\t} else if ( ! ignoredStyles.includes( path.join( '.' ) ) ) {\n\t\t\t\t\toutput[ propKey ] = compileStyleValue(\n\t\t\t\t\t\tget( styles, path )\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t} );\n\n\t// The goal is to move everything to server side generated engine styles\n\t// This is temporary as we absorb more and more styles into the engine.\n\tconst extraRules = getCSSRules( styles, { selector: 'self' } );\n\textraRules.forEach( ( rule ) => {\n\t\tif ( rule.selector !== 'self' ) {\n\t\t\tthrow \"This style can't be added as inline style\";\n\t\t}\n\t\toutput[ rule.key ] = rule.value;\n\t} );\n\n\treturn output;\n}\n\nfunction compileElementsStyles( selector, elements = {} ) {\n\treturn map( elements, ( styles, element ) => {\n\t\tconst elementStyles = getInlineStyles( styles );\n\t\tif ( ! isEmpty( elementStyles ) ) {\n\t\t\t// The .editor-styles-wrapper selector is required on elements styles. As it is\n\t\t\t// added to all other editor styles, not providing it causes reset and global\n\t\t\t// styles to override element styles because of higher specificity.\n\t\t\treturn [\n\t\t\t\t`.editor-styles-wrapper .${ selector } ${ ELEMENTS[ element ] }{`,\n\t\t\t\t...map(\n\t\t\t\t\telementStyles,\n\t\t\t\t\t( value, property ) =>\n\t\t\t\t\t\t`\\t${ kebabCase( property ) }: ${ value };`\n\t\t\t\t),\n\t\t\t\t'}',\n\t\t\t].join( '\\n' );\n\t\t}\n\t\treturn '';\n\t} ).join( '\\n' );\n}\n\n/**\n * Filters registered block settings, extending attributes to include `style` attribute.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nfunction addAttribute( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\t// Allow blocks to specify their own attribute definition with default values if needed.\n\tif ( ! settings.attributes.style ) {\n\t\tObject.assign( settings.attributes, {\n\t\t\tstyle: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t} );\n\t}\n\n\treturn settings;\n}\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsEdit = {\n\t[ `${ BORDER_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [ 'border' ],\n\t[ `${ COLOR_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tCOLOR_SUPPORT_KEY,\n\t],\n\t[ `${ TYPOGRAPHY_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\tTYPOGRAPHY_SUPPORT_KEY,\n\t],\n\t[ `${ SPACING_SUPPORT_KEY }.__experimentalSkipSerialization` ]: [\n\t\t'spacing',\n\t],\n};\n\n/**\n * A dictionary of paths to flag skipping block support serialization as the key,\n * with values providing the style paths to be omitted from serialization.\n *\n * Extends the Edit skip paths to enable skipping additional paths in just\n * the Save component. This allows a block support to be serialized within the\n * editor, while using an alternate approach, such as server-side rendering, when\n * the support is saved.\n *\n * @constant\n * @type {Record<string, string[]>}\n */\nconst skipSerializationPathsSave = {\n\t...skipSerializationPathsEdit,\n\t[ `${ SPACING_SUPPORT_KEY }` ]: [ 'spacing.blockGap' ],\n};\n\n/**\n * Override props assigned to save component to inject the CSS variables definition.\n *\n * @param {Object} props Additional props applied to save element.\n * @param {Object} blockType Block type.\n * @param {Object} attributes Block attributes.\n * @param {?Record<string, string[]>} skipPaths An object of keys and paths to skip serialization.\n *\n * @return {Object} Filtered props applied to save element.\n */\nexport function addSaveProps(\n\tprops,\n\tblockType,\n\tattributes,\n\tskipPaths = skipSerializationPathsSave\n) {\n\tif ( ! hasStyleSupport( blockType ) ) {\n\t\treturn props;\n\t}\n\n\tlet { style } = attributes;\n\n\tforEach( skipPaths, ( path, indicator ) => {\n\t\tif ( getBlockSupport( blockType, indicator ) ) {\n\t\t\tstyle = omit( style, path );\n\t\t}\n\t} );\n\n\tprops.style = {\n\t\t...getInlineStyles( style ),\n\t\t...props.style,\n\t};\n\n\treturn props;\n}\n\n/**\n * Filters registered block settings to extend the block edit wrapper\n * to apply the desired styles and classnames properly.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object}.Filtered block settings.\n */\nexport function addEditProps( settings ) {\n\tif ( ! hasStyleSupport( settings ) ) {\n\t\treturn settings;\n\t}\n\n\tconst existingGetEditWrapperProps = settings.getEditWrapperProps;\n\tsettings.getEditWrapperProps = ( attributes ) => {\n\t\tlet props = {};\n\t\tif ( existingGetEditWrapperProps ) {\n\t\t\tprops = existingGetEditWrapperProps( attributes );\n\t\t}\n\n\t\treturn addSaveProps(\n\t\t\tprops,\n\t\t\tsettings,\n\t\t\tattributes,\n\t\t\tskipSerializationPathsEdit\n\t\t);\n\t};\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include new inspector controls for\n * all the custom styles configs.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withBlockControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst shouldDisplayControls = useDisplayBlockControls();\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldDisplayControls && (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<ColorEdit { ...props } />\n\t\t\t\t\t\t<TypographyPanel { ...props } />\n\t\t\t\t\t\t<BorderPanel { ...props } />\n\t\t\t\t\t\t<DimensionsPanel { ...props } />\n\t\t\t\t\t</>\n\t\t\t\t) }\n\t\t\t\t<BlockEdit { ...props } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withToolbarControls'\n);\n\n/**\n * Override the default block element to include duotone styles.\n *\n * @param {Function} BlockListBlock Original component\n * @return {Function} Wrapped component\n */\nconst withElementsStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst elements = props.attributes.style?.elements;\n\n\t\tconst blockElementsContainerIdentifier = `wp-elements-${ useInstanceId(\n\t\t\tBlockListBlock\n\t\t) }`;\n\t\tconst styles = compileElementsStyles(\n\t\t\tblockElementsContainerIdentifier,\n\t\t\tprops.attributes.style?.elements\n\t\t);\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ elements &&\n\t\t\t\t\telement &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<style\n\t\t\t\t\t\t\tdangerouslySetInnerHTML={ {\n\t\t\t\t\t\t\t\t__html: styles,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\tclassName={\n\t\t\t\t\t\telements\n\t\t\t\t\t\t\t? classnames(\n\t\t\t\t\t\t\t\t\tprops.className,\n\t\t\t\t\t\t\t\t\tblockElementsContainerIdentifier\n\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t: props.className\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t}\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addAttribute',\n\taddAttribute\n);\n\naddFilter(\n\t'blocks.getSaveContent.extraProps',\n\t'core/style/addSaveProps',\n\taddSaveProps\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/style/addEditProps',\n\taddEditProps\n);\n\naddFilter(\n\t'editor.BlockEdit',\n\t'core/style/with-block-controls',\n\twithBlockControls\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/with-elements-styles',\n\twithElementsStyles\n);\n"]}
@@ -95,29 +95,31 @@ export default {
95
95
  const hasBlockGapStylesSupport = blockGapSupport !== null;
96
96
  const blockGapValue = (_style$spacing$blockG = style === null || style === void 0 ? void 0 : (_style$spacing = style.spacing) === null || _style$spacing === void 0 ? void 0 : _style$spacing.blockGap) !== null && _style$spacing$blockG !== void 0 ? _style$spacing$blockG : 'var( --wp--style--block-gap )';
97
97
  let output = !!contentSize || !!wideSize ? `
98
- ${appendSelectors(selector, '> *')} {
98
+ ${appendSelectors(selector, '> :where(:not(.alignleft):not(.alignright))')} {
99
99
  max-width: ${contentSize !== null && contentSize !== void 0 ? contentSize : wideSize};
100
100
  margin-left: auto !important;
101
101
  margin-right: auto !important;
102
102
  }
103
103
 
104
- ${appendSelectors(selector, '> [data-align="wide"]')} {
104
+ ${appendSelectors(selector, '> .alignwide')} {
105
105
  max-width: ${wideSize !== null && wideSize !== void 0 ? wideSize : contentSize};
106
106
  }
107
107
 
108
- ${appendSelectors(selector, '> [data-align="full"]')} {
108
+ ${appendSelectors(selector, '> .alignfull')} {
109
109
  max-width: none;
110
110
  }
111
111
  ` : '';
112
112
  output += `
113
- ${appendSelectors(selector, '> [data-align="left"]')} {
113
+ ${appendSelectors(selector, '> .alignleft')} {
114
114
  float: left;
115
115
  margin-right: 2em;
116
+ margin-left: 0;
116
117
  }
117
118
 
118
- ${appendSelectors(selector, '> [data-align="right"]')} {
119
+ ${appendSelectors(selector, '> .alignright')} {
119
120
  float: right;
120
121
  margin-left: 2em;
122
+ margin-right: 0;
121
123
  }
122
124
 
123
125
  `;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/layouts/flow.js"],"names":["Button","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__","sprintf","Icon","positionCenter","stretchWide","useSetting","appendSelectors","name","label","inspectorControls","DefaultLayoutInspectorControls","layout","onChange","wideSize","contentSize","units","availableUnits","nextWidth","parseFloat","undefined","inherit","toolBarControls","DefaultLayoutToolbarControls","save","DefaultLayoutStyle","selector","style","blockGapSupport","hasBlockGapStylesSupport","blockGapValue","spacing","blockGap","output","getOrientation","getAlignments","alignmentInfo","getAlignmentsInfo","alignments","includes","unshift","map","alignment","info","wide","none","sizeRegex","test"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,4BAA4B,IAAIC,cAFjC,EAGCC,yBAAyB,IAAIC,WAH9B,QAIO,uBAJP;AAKA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,IAAT,EAAeC,cAAf,EAA+BC,WAA/B,QAAkD,kBAAlD;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,SAASC,eAAT,QAAgC,SAAhC;AAEA,eAAe;AACdC,EAAAA,IAAI,EAAE,SADQ;AAEdC,EAAAA,KAAK,EAAER,EAAE,CAAE,MAAF,CAFK;AAGdS,EAAAA,iBAAiB,EAAE,SAASC,8BAAT,OAGf;AAAA,QAHwD;AAC3DC,MAAAA,MAD2D;AAE3DC,MAAAA;AAF2D,KAGxD;AACH,UAAM;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,QAA4BH,MAAlC;AACA,UAAMI,KAAK,GAAGlB,cAAc,CAAE;AAC7BmB,MAAAA,cAAc,EAAEX,UAAU,CAAE,eAAF,CAAV,IAAiC,CAChD,GADgD,EAEhD,IAFgD,EAGhD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cesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, positionCenter, stretchWide } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../components/use-setting';\nimport { appendSelectors } from './utils';\n\nexport default {\n\tname: 'default',\n\tlabel: __( 'Flow' ),\n\tinspectorControls: function DefaultLayoutInspectorControls( {\n\t\tlayout,\n\t\tonChange,\n\t} ) {\n\t\tconst { wideSize, contentSize } = layout;\n\t\tconst units = useCustomUnits( {\n\t\t\tavailableUnits: useSetting( 'spacing.units' ) || [\n\t\t\t\t'%',\n\t\t\t\t'px',\n\t\t\t\t'em',\n\t\t\t\t'rem',\n\t\t\t\t'vw',\n\t\t\t],\n\t\t} );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"block-editor-hooks__layout-controls\">\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Content' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ contentSize || wideSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\tcontentSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Icon icon={ positionCenter } />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Wide' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ wideSize || contentSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\twideSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-hooks__layout-controls-reset\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tisSmall\n\t\t\t\t\t\tdisabled={ ! contentSize && ! wideSize }\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tcontentSize: undefined,\n\t\t\t\t\t\t\t\twideSize: undefined,\n\t\t\t\t\t\t\t\tinherit: false,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\n\t\t\t\t<p className=\"block-editor-hooks__layout-controls-helptext\">\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the width for all elements that are assigned to the center or wide columns.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function DefaultLayoutToolbarControls() {\n\t\treturn null;\n\t},\n\tsave: function DefaultLayoutStyle( { selector, layout = {}, style } ) {\n\t\tconst { contentSize, wideSize } = layout;\n\t\tconst blockGapSupport = useSetting( 'spacing.blockGap' );\n\t\tconst hasBlockGapStylesSupport = blockGapSupport !== null;\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap ?? 'var( --wp--style--block-gap )';\n\n\t\tlet output =\n\t\t\t!! contentSize || !! wideSize\n\t\t\t\t? `\n\t\t\t\t\t${ appendSelectors( selector, '> *' ) } {\n\t\t\t\t\t\tmax-width: ${ contentSize ?? wideSize };\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${ appendSelectors( selector, '> [data-align=\"wide\"]' ) } {\n\t\t\t\t\t\tmax-width: ${ wideSize ?? contentSize };\n\t\t\t\t\t}\n\n\t\t\t\t\t${ appendSelectors( selector, '> [data-align=\"full\"]' ) } {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`\n\t\t\t\t: '';\n\n\t\toutput += `\n\t\t\t${ appendSelectors( selector, '> [data-align=\"left\"]' ) } {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t}\n\n\t\t\t${ appendSelectors( selector, '> [data-align=\"right\"]' ) } {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t}\n\n\t\t`;\n\n\t\tif ( hasBlockGapStylesSupport ) {\n\t\t\toutput += `\n\t\t\t\t${ appendSelectors( selector, '> *' ) } {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${ appendSelectors( selector, '> * + *' ) } {\n\t\t\t\t\tmargin-top: ${ blockGapValue };\n\t\t\t\t}\n\t\t\t`;\n\t\t}\n\n\t\treturn <style>{ output }</style>;\n\t},\n\tgetOrientation() {\n\t\treturn 'vertical';\n\t},\n\tgetAlignments( layout ) {\n\t\tconst alignmentInfo = getAlignmentsInfo( layout );\n\t\tif ( layout.alignments !== undefined ) {\n\t\t\tif ( ! layout.alignments.includes( 'none' ) ) {\n\t\t\t\tlayout.alignments.unshift( 'none' );\n\t\t\t}\n\t\t\treturn layout.alignments.map( ( alignment ) => ( {\n\t\t\t\tname: alignment,\n\t\t\t\tinfo: alignmentInfo[ alignment ],\n\t\t\t} ) );\n\t\t}\n\t\tconst { contentSize, wideSize } = layout;\n\n\t\tconst alignments = [\n\t\t\t{ name: 'left' },\n\t\t\t{ name: 'center' },\n\t\t\t{ name: 'right' },\n\t\t];\n\n\t\tif ( contentSize ) {\n\t\t\talignments.unshift( { name: 'full' } );\n\t\t}\n\n\t\tif ( wideSize ) {\n\t\t\talignments.unshift( { name: 'wide', info: alignmentInfo.wide } );\n\t\t}\n\n\t\talignments.unshift( { name: 'none', info: alignmentInfo.none } );\n\n\t\treturn alignments;\n\t},\n};\n\n/**\n * Helper method to assign contextual info to clarify\n * alignment settings.\n *\n * Besides checking if `contentSize` and `wideSize` have a\n * value, we now show this information only if their values\n * are not a `css var`. This needs to change when parsing\n * css variables land.\n *\n * @see https://github.com/WordPress/gutenberg/pull/34710#issuecomment-918000752\n *\n * @param {Object} layout The layout object.\n * @return {Object} An object with contextual info per alignment.\n */\nfunction getAlignmentsInfo( layout ) {\n\tconst { contentSize, wideSize } = layout;\n\tconst alignmentInfo = {};\n\tconst sizeRegex = /^(?!0)\\d+(px|em|rem|vw|vh|%)?$/i;\n\tif ( sizeRegex.test( contentSize ) ) {\n\t\t// translators: %s: container size (i.e. 600px etc)\n\t\talignmentInfo.none = sprintf( __( 'Max %s wide' ), contentSize );\n\t}\n\tif ( sizeRegex.test( wideSize ) ) {\n\t\t// translators: %s: container size (i.e. 600px etc)\n\t\talignmentInfo.wide = sprintf( __( 'Max %s wide' ), wideSize );\n\t}\n\treturn alignmentInfo;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/layouts/flow.js"],"names":["Button","__experimentalUseCustomUnits","useCustomUnits","__experimentalUnitControl","UnitControl","__","sprintf","Icon","positionCenter","stretchWide","useSetting","appendSelectors","name","label","inspectorControls","DefaultLayoutInspectorControls","layout","onChange","wideSize","contentSize","units","availableUnits","nextWidth","parseFloat","undefined","inherit","toolBarControls","DefaultLayoutToolbarControls","save","DefaultLayoutStyle","selector","style","blockGapSupport","hasBlockGapStylesSupport","blockGapValue","spacing","blockGap","output","getOrientation","getAlignments","alignmentInfo","getAlignmentsInfo","alignments","includes","unshift","map","alignment","info","wide","none","sizeRegex","test"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,MADD,EAECC,4BAA4B,IAAIC,cAFjC,EAGCC,yBAAyB,IAAIC,WAH9B,QAIO,uBAJP;AAKA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SAASC,IAAT,EAAeC,cAAf,EAA+BC,WAA/B,QAAkD,kBAAlD;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,SAASC,eAAT,QAAgC,SAAhC;AAEA,eAAe;AACdC,EAAAA,IAAI,EAAE,SADQ;AAEdC,EAAAA,KAAK,EAAER,EAAE,CAAE,MAAF,CAFK;AAGdS,EAAAA,iBAAiB,EAAE,SAASC,8BAAT,OAGf;AAAA,QAHwD;AAC3DC,MAAAA,MAD2D;AAE3DC,MAAAA;AAF2D,KAGxD;AACH,UAAM;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,QAA4BH,MAAlC;AACA,UAAMI,KAAK,GAAGlB,cAAc,CAAE;AAC7BmB,MAAAA,cAAc,EAAEX,UAAU,CAAE,eAAF,CAAV,IAAiC,CAChD,GADgD,EAEhD,IAFgD,EAGhD,IAHgD,EAIhD,KAJgD,EAKhD,IALgD;AADpB,KAAF,CAA5B;AAUA,WACC,8BACC;AAAK,MAAA,SAAS,EAAC;AAA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,KAFkB,EAGlB;AAAEA,MAAAA,IAAI,EAAE;AAAR,KAHkB,CAAnB;;AAMA,QAAKO,WAAL,EAAmB;AAClBuB,MAAAA,UAAU,CAACE,OAAX,CAAoB;AAAEhC,QAAAA,IAAI,EAAE;AAAR,OAApB;AACA;;AAED,QAAKM,QAAL,EAAgB;AACfwB,MAAAA,UAAU,CAACE,OAAX,CAAoB;AAAEhC,QAAAA,IAAI,EAAE,MAAR;AAAgBmC,QAAAA,IAAI,EAAEP,aAAa,CAACQ;AAApC,OAApB;AACA;;AAEDN,IAAAA,UAAU,CAACE,OAAX,CAAoB;AAAEhC,MAAAA,IAAI,EAAE,MAAR;AAAgBmC,MAAAA,IAAI,EAAEP,aAAa,CAACS;AAApC,KAApB;AAEA,WAAOP,UAAP;AACA;;AArLa,CAAf;AAwLA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,SAASD,iBAAT,CAA4BzB,MAA5B,EAAqC;AACpC,QAAM;AAAEG,IAAAA,WAAF;AAAeD,IAAAA;AAAf,MAA4BF,MAAlC;AACA,QAAMwB,aAAa,GAAG,EAAtB;AACA,QAAMU,SAAS,GAAG,iCAAlB;;AACA,MAAKA,SAAS,CAACC,IAAV,CAAgBhC,WAAhB,CAAL,EAAqC;AACpC;AACAqB,IAAAA,aAAa,CAACS,IAAd,GAAqB3C,OAAO,CAAED,EAAE,CAAE,aAAF,CAAJ,EAAuBc,WAAvB,CAA5B;AACA;;AACD,MAAK+B,SAAS,CAACC,IAAV,CAAgBjC,QAAhB,CAAL,EAAkC;AACjC;AACAsB,IAAAA,aAAa,CAACQ,IAAd,GAAqB1C,OAAO,CAAED,EAAE,CAAE,aAAF,CAAJ,EAAuBa,QAAvB,CAA5B;AACA;;AACD,SAAOsB,aAAP;AACA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\t__experimentalUseCustomUnits as useCustomUnits,\n\t__experimentalUnitControl as UnitControl,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\nimport { Icon, positionCenter, stretchWide } from '@wordpress/icons';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../components/use-setting';\nimport { appendSelectors } from './utils';\n\nexport default {\n\tname: 'default',\n\tlabel: __( 'Flow' ),\n\tinspectorControls: function DefaultLayoutInspectorControls( {\n\t\tlayout,\n\t\tonChange,\n\t} ) {\n\t\tconst { wideSize, contentSize } = layout;\n\t\tconst units = useCustomUnits( {\n\t\t\tavailableUnits: useSetting( 'spacing.units' ) || [\n\t\t\t\t'%',\n\t\t\t\t'px',\n\t\t\t\t'em',\n\t\t\t\t'rem',\n\t\t\t\t'vw',\n\t\t\t],\n\t\t} );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t<div className=\"block-editor-hooks__layout-controls\">\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Content' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ contentSize || wideSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\tcontentSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Icon icon={ positionCenter } />\n\t\t\t\t\t</div>\n\t\t\t\t\t<div className=\"block-editor-hooks__layout-controls-unit\">\n\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\tlabel={ __( 'Wide' ) }\n\t\t\t\t\t\t\tlabelPosition=\"top\"\n\t\t\t\t\t\t\t__unstableInputWidth=\"80px\"\n\t\t\t\t\t\t\tvalue={ wideSize || contentSize || '' }\n\t\t\t\t\t\t\tonChange={ ( nextWidth ) => {\n\t\t\t\t\t\t\t\tnextWidth =\n\t\t\t\t\t\t\t\t\t0 > parseFloat( nextWidth )\n\t\t\t\t\t\t\t\t\t\t? '0'\n\t\t\t\t\t\t\t\t\t\t: nextWidth;\n\t\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\t\t...layout,\n\t\t\t\t\t\t\t\t\twideSize: nextWidth,\n\t\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<Icon icon={ stretchWide } />\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<div className=\"block-editor-hooks__layout-controls-reset\">\n\t\t\t\t\t<Button\n\t\t\t\t\t\tvariant=\"secondary\"\n\t\t\t\t\t\tisSmall\n\t\t\t\t\t\tdisabled={ ! contentSize && ! wideSize }\n\t\t\t\t\t\tonClick={ () =>\n\t\t\t\t\t\t\tonChange( {\n\t\t\t\t\t\t\t\tcontentSize: undefined,\n\t\t\t\t\t\t\t\twideSize: undefined,\n\t\t\t\t\t\t\t\tinherit: false,\n\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t}\n\t\t\t\t\t>\n\t\t\t\t\t\t{ __( 'Reset' ) }\n\t\t\t\t\t</Button>\n\t\t\t\t</div>\n\n\t\t\t\t<p className=\"block-editor-hooks__layout-controls-helptext\">\n\t\t\t\t\t{ __(\n\t\t\t\t\t\t'Customize the width for all elements that are assigned to the center or wide columns.'\n\t\t\t\t\t) }\n\t\t\t\t</p>\n\t\t\t</>\n\t\t);\n\t},\n\ttoolBarControls: function DefaultLayoutToolbarControls() {\n\t\treturn null;\n\t},\n\tsave: function DefaultLayoutStyle( { selector, layout = {}, style } ) {\n\t\tconst { contentSize, wideSize } = layout;\n\t\tconst blockGapSupport = useSetting( 'spacing.blockGap' );\n\t\tconst hasBlockGapStylesSupport = blockGapSupport !== null;\n\t\tconst blockGapValue =\n\t\t\tstyle?.spacing?.blockGap ?? 'var( --wp--style--block-gap )';\n\n\t\tlet output =\n\t\t\t!! contentSize || !! wideSize\n\t\t\t\t? `\n\t\t\t\t\t${ appendSelectors(\n\t\t\t\t\t\tselector,\n\t\t\t\t\t\t'> :where(:not(.alignleft):not(.alignright))'\n\t\t\t\t\t) } {\n\t\t\t\t\t\tmax-width: ${ contentSize ?? wideSize };\n\t\t\t\t\t\tmargin-left: auto !important;\n\t\t\t\t\t\tmargin-right: auto !important;\n\t\t\t\t\t}\n\n\t\t\t\t\t${ appendSelectors( selector, '> .alignwide' ) } {\n\t\t\t\t\t\tmax-width: ${ wideSize ?? contentSize };\n\t\t\t\t\t}\n\n\t\t\t\t\t${ appendSelectors( selector, '> .alignfull' ) } {\n\t\t\t\t\t\tmax-width: none;\n\t\t\t\t\t}\n\t\t\t\t`\n\t\t\t\t: '';\n\n\t\toutput += `\n\t\t\t${ appendSelectors( selector, '> .alignleft' ) } {\n\t\t\t\tfloat: left;\n\t\t\t\tmargin-right: 2em;\n\t\t\t\tmargin-left: 0;\n\t\t\t}\n\n\t\t\t${ appendSelectors( selector, '> .alignright' ) } {\n\t\t\t\tfloat: right;\n\t\t\t\tmargin-left: 2em;\n\t\t\t\tmargin-right: 0;\n\t\t\t}\n\n\t\t`;\n\n\t\tif ( hasBlockGapStylesSupport ) {\n\t\t\toutput += `\n\t\t\t\t${ appendSelectors( selector, '> *' ) } {\n\t\t\t\t\tmargin-top: 0;\n\t\t\t\t\tmargin-bottom: 0;\n\t\t\t\t}\n\t\t\t\t${ appendSelectors( selector, '> * + *' ) } {\n\t\t\t\t\tmargin-top: ${ blockGapValue };\n\t\t\t\t}\n\t\t\t`;\n\t\t}\n\n\t\treturn <style>{ output }</style>;\n\t},\n\tgetOrientation() {\n\t\treturn 'vertical';\n\t},\n\tgetAlignments( layout ) {\n\t\tconst alignmentInfo = getAlignmentsInfo( layout );\n\t\tif ( layout.alignments !== undefined ) {\n\t\t\tif ( ! layout.alignments.includes( 'none' ) ) {\n\t\t\t\tlayout.alignments.unshift( 'none' );\n\t\t\t}\n\t\t\treturn layout.alignments.map( ( alignment ) => ( {\n\t\t\t\tname: alignment,\n\t\t\t\tinfo: alignmentInfo[ alignment ],\n\t\t\t} ) );\n\t\t}\n\t\tconst { contentSize, wideSize } = layout;\n\n\t\tconst alignments = [\n\t\t\t{ name: 'left' },\n\t\t\t{ name: 'center' },\n\t\t\t{ name: 'right' },\n\t\t];\n\n\t\tif ( contentSize ) {\n\t\t\talignments.unshift( { name: 'full' } );\n\t\t}\n\n\t\tif ( wideSize ) {\n\t\t\talignments.unshift( { name: 'wide', info: alignmentInfo.wide } );\n\t\t}\n\n\t\talignments.unshift( { name: 'none', info: alignmentInfo.none } );\n\n\t\treturn alignments;\n\t},\n};\n\n/**\n * Helper method to assign contextual info to clarify\n * alignment settings.\n *\n * Besides checking if `contentSize` and `wideSize` have a\n * value, we now show this information only if their values\n * are not a `css var`. This needs to change when parsing\n * css variables land.\n *\n * @see https://github.com/WordPress/gutenberg/pull/34710#issuecomment-918000752\n *\n * @param {Object} layout The layout object.\n * @return {Object} An object with contextual info per alignment.\n */\nfunction getAlignmentsInfo( layout ) {\n\tconst { contentSize, wideSize } = layout;\n\tconst alignmentInfo = {};\n\tconst sizeRegex = /^(?!0)\\d+(px|em|rem|vw|vh|%)?$/i;\n\tif ( sizeRegex.test( contentSize ) ) {\n\t\t// translators: %s: container size (i.e. 600px etc)\n\t\talignmentInfo.none = sprintf( __( 'Max %s wide' ), contentSize );\n\t}\n\tif ( sizeRegex.test( wideSize ) ) {\n\t\t// translators: %s: container size (i.e. 600px etc)\n\t\talignmentInfo.wide = sprintf( __( 'Max %s wide' ), wideSize );\n\t}\n\treturn alignmentInfo;\n}\n"]}
@@ -265,31 +265,37 @@ export function stopMultiSelect() {
265
265
  /**
266
266
  * Action that changes block multi-selection.
267
267
  *
268
- * @param {string} start First block of the multi selection.
269
- * @param {string} end Last block of the multiselection.
268
+ * @param {string} start First block of the multi selection.
269
+ * @param {string} end Last block of the multiselection.
270
+ * @param {number|null} __experimentalInitialPosition Optional initial position. Pass as null to skip focus within editor canvas.
270
271
  */
271
272
 
272
- export const multiSelect = (start, end) => _ref6 => {
273
- let {
274
- select,
275
- dispatch
276
- } = _ref6;
277
- const startBlockRootClientId = select.getBlockRootClientId(start);
278
- const endBlockRootClientId = select.getBlockRootClientId(end); // Only allow block multi-selections at the same level.
273
+ export const multiSelect = function (start, end) {
274
+ let __experimentalInitialPosition = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
279
275
 
280
- if (startBlockRootClientId !== endBlockRootClientId) {
281
- return;
282
- }
276
+ return _ref6 => {
277
+ let {
278
+ select,
279
+ dispatch
280
+ } = _ref6;
281
+ const startBlockRootClientId = select.getBlockRootClientId(start);
282
+ const endBlockRootClientId = select.getBlockRootClientId(end); // Only allow block multi-selections at the same level.
283
283
 
284
- dispatch({
285
- type: 'MULTI_SELECT',
286
- start,
287
- end
288
- });
289
- const blockCount = select.getSelectedBlockCount();
290
- speak(sprintf(
291
- /* translators: %s: number of selected blocks */
292
- _n('%s block selected.', '%s blocks selected.', blockCount), blockCount), 'assertive');
284
+ if (startBlockRootClientId !== endBlockRootClientId) {
285
+ return;
286
+ }
287
+
288
+ dispatch({
289
+ type: 'MULTI_SELECT',
290
+ start,
291
+ end,
292
+ initialPosition: __experimentalInitialPosition
293
+ });
294
+ const blockCount = select.getSelectedBlockCount();
295
+ speak(sprintf(
296
+ /* translators: %s: number of selected blocks */
297
+ _n('%s block selected.', '%s blocks selected.', blockCount), blockCount), 'assertive');
298
+ };
293
299
  };
294
300
  /**
295
301
  * Action that clears the block selection.
@@ -670,7 +676,7 @@ export const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 =
670
676
  });
671
677
  const [clientIdA, clientIdB] = blocks;
672
678
  const blockA = select.getBlock(clientIdA);
673
- const blockAType = getBlockType(blockA.name); // Only focus the previous block if it's not mergeable
679
+ const blockAType = getBlockType(blockA.name); // Only focus the previous block if it's not mergeable.
674
680
 
675
681
  if (blockAType && !blockAType.merge) {
676
682
  dispatch.selectBlock(blockA.clientId);
@@ -727,14 +733,14 @@ export const mergeBlocks = (firstBlockClientId, secondBlockClientId) => _ref12 =
727
733
  preserveWhiteSpace
728
734
  });
729
735
  } // We can only merge blocks with similar types
730
- // thus, we transform the block to merge first
736
+ // thus, we transform the block to merge first.
731
737
 
732
738
 
733
- const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : switchToBlockType(cloneB, blockA.name); // If the block types can not match, do nothing
739
+ const blocksWithTheSameType = blockA.name === blockB.name ? [cloneB] : switchToBlockType(cloneB, blockA.name); // If the block types can not match, do nothing.
734
740
 
735
741
  if (!blocksWithTheSameType || !blocksWithTheSameType.length) {
736
742
  return;
737
- } // Calling the merge to update the attributes and remove the block to be merged
743
+ } // Calling the merge to update the attributes and remove the block to be merged.
738
744
 
739
745
 
740
746
  const updatedAttributes = blockAType.merge(cloneA.attributes, blocksWithTheSameType[0].attributes);
@@ -965,12 +971,13 @@ export function selectionChange(clientId, attributeKey, startOffset, endOffset)
965
971
  * @param {?Object} attributes Optional attributes of the block to assign.
966
972
  * @param {?string} rootClientId Optional root client ID of block list on which
967
973
  * to append.
968
- * @param {?number} index Optional index where to insert the default block
969
- *
970
- * @return {Object} Action object
974
+ * @param {?number} index Optional index where to insert the default block.
971
975
  */
972
976
 
973
- export function insertDefaultBlock(attributes, rootClientId, index) {
977
+ export const insertDefaultBlock = (attributes, rootClientId, index) => _ref14 => {
978
+ let {
979
+ dispatch
980
+ } = _ref14;
974
981
  // Abort if there is no default block type (if it has been unregistered).
975
982
  const defaultBlockName = getDefaultBlockName();
976
983
 
@@ -979,8 +986,8 @@ export function insertDefaultBlock(attributes, rootClientId, index) {
979
986
  }
980
987
 
981
988
  const block = createBlock(defaultBlockName, attributes);
982
- return insertBlock(block, index, rootClientId);
983
- }
989
+ return dispatch.insertBlock(block, index, rootClientId);
990
+ };
984
991
  /**
985
992
  * Action that changes the nested settings of a given block.
986
993
  *
@@ -1059,10 +1066,10 @@ export function __unstableMarkNextChangeAsNotPersistent() {
1059
1066
  * selection changes have been recorded.
1060
1067
  */
1061
1068
 
1062
- export const __unstableMarkAutomaticChange = () => _ref14 => {
1069
+ export const __unstableMarkAutomaticChange = () => _ref15 => {
1063
1070
  let {
1064
1071
  dispatch
1065
- } = _ref14;
1072
+ } = _ref15;
1066
1073
  dispatch({
1067
1074
  type: 'MARK_AUTOMATIC_CHANGE'
1068
1075
  });
@@ -1083,10 +1090,10 @@ export const __unstableMarkAutomaticChange = () => _ref14 => {
1083
1090
 
1084
1091
  export const setNavigationMode = function () {
1085
1092
  let isNavigationMode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;
1086
- return _ref15 => {
1093
+ return _ref16 => {
1087
1094
  let {
1088
1095
  dispatch
1089
- } = _ref15;
1096
+ } = _ref16;
1090
1097
  dispatch({
1091
1098
  type: 'SET_NAVIGATION_MODE',
1092
1099
  isNavigationMode
@@ -1107,10 +1114,10 @@ export const setNavigationMode = function () {
1107
1114
 
1108
1115
  export const setBlockMovingClientId = function () {
1109
1116
  let hasBlockMovingClientId = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : null;
1110
- return _ref16 => {
1117
+ return _ref17 => {
1111
1118
  let {
1112
1119
  dispatch
1113
- } = _ref16;
1120
+ } = _ref17;
1114
1121
  dispatch({
1115
1122
  type: 'SET_BLOCK_MOVING_MODE',
1116
1123
  hasBlockMovingClientId
@@ -1130,11 +1137,11 @@ export const setBlockMovingClientId = function () {
1130
1137
 
1131
1138
  export const duplicateBlocks = function (clientIds) {
1132
1139
  let updateSelection = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
1133
- return _ref17 => {
1140
+ return _ref18 => {
1134
1141
  let {
1135
1142
  select,
1136
1143
  dispatch
1137
- } = _ref17;
1144
+ } = _ref18;
1138
1145
 
1139
1146
  if (!clientIds || !clientIds.length) {
1140
1147
  return;
@@ -1172,11 +1179,11 @@ export const duplicateBlocks = function (clientIds) {
1172
1179
  * @param {string} clientId
1173
1180
  */
1174
1181
 
1175
- export const insertBeforeBlock = clientId => _ref18 => {
1182
+ export const insertBeforeBlock = clientId => _ref19 => {
1176
1183
  let {
1177
1184
  select,
1178
1185
  dispatch
1179
- } = _ref18;
1186
+ } = _ref19;
1180
1187
 
1181
1188
  if (!clientId) {
1182
1189
  return;
@@ -1198,11 +1205,11 @@ export const insertBeforeBlock = clientId => _ref18 => {
1198
1205
  * @param {string} clientId
1199
1206
  */
1200
1207
 
1201
- export const insertAfterBlock = clientId => _ref19 => {
1208
+ export const insertAfterBlock = clientId => _ref20 => {
1202
1209
  let {
1203
1210
  select,
1204
1211
  dispatch
1205
- } = _ref19;
1212
+ } = _ref20;
1206
1213
 
1207
1214
  if (!clientId) {
1208
1215
  return;
@@ -1238,10 +1245,10 @@ export function toggleBlockHighlight(clientId, isHighlighted) {
1238
1245
  * @param {string} clientId Target block client ID.
1239
1246
  */
1240
1247
 
1241
- export const flashBlock = clientId => async _ref20 => {
1248
+ export const flashBlock = clientId => async _ref21 => {
1242
1249
  let {
1243
1250
  dispatch
1244
- } = _ref20;
1251
+ } = _ref21;
1245
1252
  dispatch(toggleBlockHighlight(clientId, true));
1246
1253
  await new Promise(resolve => setTimeout(resolve, 150));
1247
1254
  dispatch(toggleBlockHighlight(clientId, false));