@wordpress/block-editor 12.3.0 → 12.3.2

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 (971) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/README.md +13 -0
  3. package/build/autocompleters/block.js +5 -3
  4. package/build/autocompleters/block.js.map +1 -1
  5. package/build/components/alignment-control/index.js +4 -6
  6. package/build/components/alignment-control/index.js.map +1 -1
  7. package/build/components/alignment-control/ui.js +5 -9
  8. package/build/components/alignment-control/ui.js.map +1 -1
  9. package/build/components/autocomplete/index.js +2 -4
  10. package/build/components/autocomplete/index.js.map +1 -1
  11. package/build/components/block-actions/index.js +4 -0
  12. package/build/components/block-actions/index.js.map +1 -1
  13. package/build/components/block-alignment-control/constants.js +1 -5
  14. package/build/components/block-alignment-control/constants.js.map +1 -1
  15. package/build/components/block-alignment-control/index.js +4 -6
  16. package/build/components/block-alignment-control/index.js.map +1 -1
  17. package/build/components/block-alignment-control/ui.js +3 -4
  18. package/build/components/block-alignment-control/ui.js.map +1 -1
  19. package/build/components/block-alignment-control/ui.native.js +3 -3
  20. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  21. package/build/components/block-alignment-matrix-control/index.js +0 -1
  22. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  23. package/build/components/block-breadcrumb/index.js +2 -3
  24. package/build/components/block-breadcrumb/index.js.map +1 -1
  25. package/build/components/block-controls/fill.js +2 -1
  26. package/build/components/block-controls/fill.js.map +1 -1
  27. package/build/components/block-controls/index.js +8 -8
  28. package/build/components/block-controls/index.js.map +1 -1
  29. package/build/components/block-controls/slot.js +2 -4
  30. package/build/components/block-controls/slot.js.map +1 -1
  31. package/build/components/block-controls/slot.native.js +4 -2
  32. package/build/components/block-controls/slot.native.js.map +1 -1
  33. package/build/components/block-edit/edit.js +4 -6
  34. package/build/components/block-edit/edit.js.map +1 -1
  35. package/build/components/block-edit/edit.native.js +2 -4
  36. package/build/components/block-edit/edit.native.js.map +1 -1
  37. package/build/components/block-edit/index.js +3 -2
  38. package/build/components/block-edit/index.js.map +1 -1
  39. package/build/components/block-heading-level-dropdown/heading-level-icon.js +47 -0
  40. package/build/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  41. package/build/components/block-heading-level-dropdown/index.js +83 -0
  42. package/build/components/block-heading-level-dropdown/index.js.map +1 -0
  43. package/build/components/block-heading-level-dropdown/index.native.js +72 -0
  44. package/build/components/block-heading-level-dropdown/index.native.js.map +1 -0
  45. package/build/components/block-icon/index.native.js +6 -7
  46. package/build/components/block-icon/index.native.js.map +1 -1
  47. package/build/components/block-info-slot-fill/index.js +4 -2
  48. package/build/components/block-info-slot-fill/index.js.map +1 -1
  49. package/build/components/block-inspector/index.js +20 -87
  50. package/build/components/block-inspector/index.js.map +1 -1
  51. package/build/components/block-list/block-list-item.native.js +4 -2
  52. package/build/components/block-list/block-list-item.native.js.map +1 -1
  53. package/build/components/block-list/block.js +6 -4
  54. package/build/components/block-list/block.js.map +1 -1
  55. package/build/components/block-list/block.native.js +1 -0
  56. package/build/components/block-list/block.native.js.map +1 -1
  57. package/build/components/block-list/index.js +7 -4
  58. package/build/components/block-list/index.js.map +1 -1
  59. package/build/components/block-list/index.native.js +8 -9
  60. package/build/components/block-list/index.native.js.map +1 -1
  61. package/build/components/block-list/subdirectory-icon.js +4 -7
  62. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  63. package/build/components/block-list/use-in-between-inserter.js +1 -3
  64. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  65. package/build/components/block-list-appender/index.js +21 -19
  66. package/build/components/block-list-appender/index.js.map +1 -1
  67. package/build/components/block-lock/toolbar.js +25 -6
  68. package/build/components/block-lock/toolbar.js.map +1 -1
  69. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  70. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  71. package/build/components/block-mover/button.js +12 -12
  72. package/build/components/block-mover/button.js.map +1 -1
  73. package/build/components/block-mover/index.js +11 -10
  74. package/build/components/block-mover/index.js.map +1 -1
  75. package/build/components/block-navigation/dropdown.js +4 -6
  76. package/build/components/block-navigation/dropdown.js.map +1 -1
  77. package/build/components/block-parent-selector/index.js +4 -5
  78. package/build/components/block-parent-selector/index.js.map +1 -1
  79. package/build/components/block-pattern-setup/index.js +6 -8
  80. package/build/components/block-pattern-setup/index.js.map +1 -1
  81. package/build/components/block-patterns-list/index.js +6 -8
  82. package/build/components/block-patterns-list/index.js.map +1 -1
  83. package/build/components/block-popover/inbetween.js +4 -6
  84. package/build/components/block-popover/inbetween.js.map +1 -1
  85. package/build/components/block-popover/index.js +4 -6
  86. package/build/components/block-popover/index.js.map +1 -1
  87. package/build/components/block-preview/auto.js +2 -4
  88. package/build/components/block-preview/auto.js.map +1 -1
  89. package/build/components/block-preview/index.js +7 -7
  90. package/build/components/block-preview/index.js.map +1 -1
  91. package/build/components/block-quick-navigation/index.js +83 -0
  92. package/build/components/block-quick-navigation/index.js.map +1 -0
  93. package/build/components/block-removal-warning-modal/index.js +90 -0
  94. package/build/components/block-removal-warning-modal/index.js.map +1 -0
  95. package/build/components/block-selection-clearer/index.js +4 -7
  96. package/build/components/block-selection-clearer/index.js.map +1 -1
  97. package/build/components/block-settings/button.native.js +2 -1
  98. package/build/components/block-settings/button.native.js.map +1 -1
  99. package/build/components/block-settings/container.native.js +6 -6
  100. package/build/components/block-settings/container.native.js.map +1 -1
  101. package/build/components/block-settings-menu/block-settings-dropdown.js +10 -11
  102. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  103. package/build/components/block-settings-menu/index.js +4 -5
  104. package/build/components/block-settings-menu/index.js.map +1 -1
  105. package/build/components/block-settings-menu-controls/index.js +4 -5
  106. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  107. package/build/components/block-switcher/index.js +1 -2
  108. package/build/components/block-switcher/index.js.map +1 -1
  109. package/build/components/block-switcher/pattern-transformations-menu.js +6 -8
  110. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  111. package/build/components/block-toolbar/index.js +10 -8
  112. package/build/components/block-toolbar/index.js.map +1 -1
  113. package/build/components/block-tools/block-contextual-toolbar.js +4 -5
  114. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  115. package/build/components/block-tools/block-selection-button.js +4 -5
  116. package/build/components/block-tools/block-selection-button.js.map +1 -1
  117. package/build/components/block-tools/index.js +13 -6
  118. package/build/components/block-tools/index.js.map +1 -1
  119. package/build/components/block-tools/insertion-point.js +5 -5
  120. package/build/components/block-tools/insertion-point.js.map +1 -1
  121. package/build/components/block-tools/selected-block-popover.js +8 -8
  122. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  123. package/build/components/block-types-list/index.native.js +4 -6
  124. package/build/components/block-types-list/index.native.js.map +1 -1
  125. package/build/components/block-vertical-alignment-control/index.js +4 -6
  126. package/build/components/block-vertical-alignment-control/index.js.map +1 -1
  127. package/build/components/block-vertical-alignment-control/ui.js +5 -12
  128. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  129. package/build/components/border-radius-control/all-input-control.js +2 -6
  130. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  131. package/build/components/border-radius-control/input-controls.js +2 -6
  132. package/build/components/border-radius-control/input-controls.js.map +1 -1
  133. package/build/components/border-radius-control/linked-button.js +2 -6
  134. package/build/components/border-radius-control/linked-button.js.map +1 -1
  135. package/build/components/color-palette/control.js +2 -4
  136. package/build/components/color-palette/control.js.map +1 -1
  137. package/build/components/color-palette/with-color-context.js +2 -4
  138. package/build/components/color-palette/with-color-context.js.map +1 -1
  139. package/build/components/colors/utils.js +7 -3
  140. package/build/components/colors/utils.js.map +1 -1
  141. package/build/components/colors/with-colors.js +11 -16
  142. package/build/components/colors/with-colors.js.map +1 -1
  143. package/build/components/colors-gradients/control.js +7 -5
  144. package/build/components/colors-gradients/control.js.map +1 -1
  145. package/build/components/colors-gradients/dropdown.js +12 -11
  146. package/build/components/colors-gradients/dropdown.js.map +1 -1
  147. package/build/components/colors-gradients/panel-color-gradient-settings.js +7 -5
  148. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  149. package/build/components/copy-handler/index.js +5 -6
  150. package/build/components/copy-handler/index.js.map +1 -1
  151. package/build/components/dimensions-tool/aspect-ratio-tool.js +99 -0
  152. package/build/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  153. package/build/components/dimensions-tool/index.js +207 -0
  154. package/build/components/dimensions-tool/index.js.map +1 -0
  155. package/build/components/dimensions-tool/scale-tool.js +111 -0
  156. package/build/components/dimensions-tool/scale-tool.js.map +1 -0
  157. package/build/components/dimensions-tool/width-height-tool.js +125 -0
  158. package/build/components/dimensions-tool/width-height-tool.js.map +1 -0
  159. package/build/components/duotone-control/index.js +1 -2
  160. package/build/components/duotone-control/index.js.map +1 -1
  161. package/build/components/editable-text/index.js +6 -7
  162. package/build/components/editable-text/index.js.map +1 -1
  163. package/build/components/font-appearance-control/index.js +2 -6
  164. package/build/components/font-appearance-control/index.js.map +1 -1
  165. package/build/components/font-family/index.js +4 -5
  166. package/build/components/font-family/index.js.map +1 -1
  167. package/build/components/font-sizes/font-size-picker.js +2 -4
  168. package/build/components/font-sizes/font-size-picker.js.map +1 -1
  169. package/build/components/font-sizes/utils.js +3 -3
  170. package/build/components/font-sizes/utils.js.map +1 -1
  171. package/build/components/font-sizes/with-font-sizes.js +7 -7
  172. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  173. package/build/components/global-styles/color-panel.js +15 -16
  174. package/build/components/global-styles/color-panel.js.map +1 -1
  175. package/build/components/global-styles/effects-panel.js +2 -1
  176. package/build/components/global-styles/effects-panel.js.map +1 -1
  177. package/build/components/global-styles/filters-panel.js +2 -1
  178. package/build/components/global-styles/filters-panel.js.map +1 -1
  179. package/build/components/global-styles/index.js +6 -0
  180. package/build/components/global-styles/index.js.map +1 -1
  181. package/build/components/global-styles/typography-panel.js +7 -7
  182. package/build/components/global-styles/typography-panel.js.map +1 -1
  183. package/build/components/global-styles/use-global-styles-output.js +19 -16
  184. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  185. package/build/components/gradients/with-gradient.js +2 -6
  186. package/build/components/gradients/with-gradient.js.map +1 -1
  187. package/build/components/iframe/index.js +5 -7
  188. package/build/components/iframe/index.js.map +1 -1
  189. package/build/components/image-editor/aspect-ratio-dropdown.js +1 -1
  190. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  191. package/build/components/image-editor/constants.js +1 -2
  192. package/build/components/image-editor/constants.js.map +1 -1
  193. package/build/components/image-editor/use-save-image.js +1 -2
  194. package/build/components/image-editor/use-save-image.js.map +1 -1
  195. package/build/components/image-size-control/index.js +6 -0
  196. package/build/components/image-size-control/index.js.map +1 -1
  197. package/build/components/index.js +9 -9
  198. package/build/components/index.js.map +1 -1
  199. package/build/components/index.native.js +9 -0
  200. package/build/components/index.native.js.map +1 -1
  201. package/build/components/inner-blocks/index.js +9 -8
  202. package/build/components/inner-blocks/index.js.map +1 -1
  203. package/build/components/inner-blocks/index.native.js +8 -7
  204. package/build/components/inner-blocks/index.native.js.map +1 -1
  205. package/build/components/inner-blocks/use-nested-settings-update.js +24 -30
  206. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  207. package/build/components/inner-blocks/with-client-id.js +2 -6
  208. package/build/components/inner-blocks/with-client-id.js.map +1 -1
  209. package/build/components/inserter/block-patterns-explorer/explorer.js +2 -1
  210. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  211. package/build/components/inserter/block-patterns-tab.js +33 -5
  212. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  213. package/build/components/inserter/hooks/use-block-types-state.js +4 -3
  214. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  215. package/build/components/inserter/hooks/use-insertion-point.js +1 -1
  216. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  217. package/build/components/inserter/index.js +8 -8
  218. package/build/components/inserter/index.js.map +1 -1
  219. package/build/components/inserter/index.native.js +4 -5
  220. package/build/components/inserter/index.native.js.map +1 -1
  221. package/build/components/inserter/library.js +1 -1
  222. package/build/components/inserter/library.js.map +1 -1
  223. package/build/components/inserter/media-tab/media-list.js +2 -6
  224. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  225. package/build/components/inserter/media-tab/media-preview.js +4 -6
  226. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  227. package/build/components/inserter/media-tab/media-tab.js +1 -1
  228. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  229. package/build/components/inserter/reusable-blocks-tab.js +3 -3
  230. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  231. package/build/components/inserter/tabs.js +3 -3
  232. package/build/components/inserter/tabs.js.map +1 -1
  233. package/build/components/inserter-list-item/index.js +4 -5
  234. package/build/components/inserter-list-item/index.js.map +1 -1
  235. package/build/components/inserter-listbox/group.js +4 -7
  236. package/build/components/inserter-listbox/group.js.map +1 -1
  237. package/build/components/inserter-listbox/item.js +8 -7
  238. package/build/components/inserter-listbox/item.js.map +1 -1
  239. package/build/components/inserter-listbox/row.js +4 -5
  240. package/build/components/inserter-listbox/row.js.map +1 -1
  241. package/build/components/inspector-controls/block-support-slot-container.js +2 -6
  242. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  243. package/build/components/inspector-controls/fill.native.js +2 -1
  244. package/build/components/inspector-controls/fill.native.js.map +1 -1
  245. package/build/components/inspector-controls/index.js +4 -6
  246. package/build/components/inspector-controls/index.js.map +1 -1
  247. package/build/components/inspector-controls/slot.js +4 -6
  248. package/build/components/inspector-controls/slot.js.map +1 -1
  249. package/build/components/inspector-controls/slot.native.js +2 -1
  250. package/build/components/inspector-controls/slot.native.js.map +1 -1
  251. package/build/components/justify-content-control/index.js +4 -6
  252. package/build/components/justify-content-control/index.js.map +1 -1
  253. package/build/components/justify-content-control/ui.js +4 -7
  254. package/build/components/justify-content-control/ui.js.map +1 -1
  255. package/build/components/letter-spacing-control/index.js +2 -4
  256. package/build/components/letter-spacing-control/index.js.map +1 -1
  257. package/build/components/line-height-control/index.js +2 -4
  258. package/build/components/line-height-control/index.js.map +1 -1
  259. package/build/components/link-control/index.js +20 -24
  260. package/build/components/link-control/index.js.map +1 -1
  261. package/build/components/link-control/search-create-button.js +2 -4
  262. package/build/components/link-control/search-create-button.js.map +1 -1
  263. package/build/components/link-control/search-input.js +7 -5
  264. package/build/components/link-control/search-input.js.map +1 -1
  265. package/build/components/link-control/search-item.js +2 -4
  266. package/build/components/link-control/search-item.js.map +1 -1
  267. package/build/components/link-control/search-results.js +2 -4
  268. package/build/components/link-control/search-results.js.map +1 -1
  269. package/build/components/link-control/settings-drawer.js +2 -3
  270. package/build/components/link-control/settings-drawer.js.map +1 -1
  271. package/build/components/list-view/appender.js +4 -6
  272. package/build/components/list-view/appender.js.map +1 -1
  273. package/build/components/list-view/aria-referenced-text.js +4 -8
  274. package/build/components/list-view/aria-referenced-text.js.map +1 -1
  275. package/build/components/list-view/block-contents.js +4 -5
  276. package/build/components/list-view/block-contents.js.map +1 -1
  277. package/build/components/list-view/block-select-button.js +13 -2
  278. package/build/components/list-view/block-select-button.js.map +1 -1
  279. package/build/components/list-view/branch.js +9 -8
  280. package/build/components/list-view/branch.js.map +1 -1
  281. package/build/components/list-view/drop-indicator.js +62 -11
  282. package/build/components/list-view/drop-indicator.js.map +1 -1
  283. package/build/components/list-view/index.js +4 -6
  284. package/build/components/list-view/index.js.map +1 -1
  285. package/build/components/list-view/leaf.js +4 -5
  286. package/build/components/list-view/leaf.js.map +1 -1
  287. package/build/components/list-view/use-list-view-client-ids.js +2 -22
  288. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  289. package/build/components/list-view/use-list-view-drop-zone.js +46 -34
  290. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  291. package/build/components/media-placeholder/index.js +38 -13
  292. package/build/components/media-placeholder/index.js.map +1 -1
  293. package/build/components/media-replace-flow/index.js +1 -3
  294. package/build/components/media-replace-flow/index.js.map +1 -1
  295. package/build/components/navigable-toolbar/index.js +8 -8
  296. package/build/components/navigable-toolbar/index.js.map +1 -1
  297. package/build/components/panel-color-settings/index.js +4 -5
  298. package/build/components/panel-color-settings/index.js.map +1 -1
  299. package/build/components/plain-text/index.js +8 -8
  300. package/build/components/plain-text/index.js.map +1 -1
  301. package/build/components/plain-text/index.native.js +7 -6
  302. package/build/components/plain-text/index.native.js.map +1 -1
  303. package/build/components/preview-options/index.js +5 -4
  304. package/build/components/preview-options/index.js.map +1 -1
  305. package/build/components/provider/index.js +2 -4
  306. package/build/components/provider/index.js.map +1 -1
  307. package/build/components/provider/use-block-sync.js +21 -0
  308. package/build/components/provider/use-block-sync.js.map +1 -1
  309. package/build/components/provider/with-registry-provider.js +8 -10
  310. package/build/components/provider/with-registry-provider.js.map +1 -1
  311. package/build/components/publish-date-time-picker/index.js +4 -5
  312. package/build/components/publish-date-time-picker/index.js.map +1 -1
  313. package/build/components/resizable-box-popover/index.js +5 -5
  314. package/build/components/resizable-box-popover/index.js.map +1 -1
  315. package/build/components/resolution-tool/index.js +55 -0
  316. package/build/components/resolution-tool/index.js.map +1 -0
  317. package/build/components/rich-text/content.js +99 -0
  318. package/build/components/rich-text/content.js.map +1 -0
  319. package/build/components/rich-text/format-toolbar/index.js +1 -2
  320. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  321. package/build/components/rich-text/index.js +8 -42
  322. package/build/components/rich-text/index.js.map +1 -1
  323. package/build/components/rich-text/index.native.js +6 -34
  324. package/build/components/rich-text/index.native.js.map +1 -1
  325. package/build/components/rich-text/toolbar-button.js +2 -6
  326. package/build/components/rich-text/toolbar-button.js.map +1 -1
  327. package/build/components/spacing-sizes-control/index.js +8 -8
  328. package/build/components/spacing-sizes-control/index.js.map +1 -1
  329. package/build/components/tool-selector/index.js +2 -6
  330. package/build/components/tool-selector/index.js.map +1 -1
  331. package/build/components/unit-control/index.js +4 -5
  332. package/build/components/unit-control/index.js.map +1 -1
  333. package/build/components/url-input/index.js +12 -10
  334. package/build/components/url-input/index.js.map +1 -1
  335. package/build/components/url-input/index.native.js +4 -7
  336. package/build/components/url-input/index.native.js.map +1 -1
  337. package/build/components/url-popover/image-url-input-ui.js +21 -14
  338. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  339. package/build/components/url-popover/index.js +4 -5
  340. package/build/components/url-popover/index.js.map +1 -1
  341. package/build/components/url-popover/link-editor.js +4 -5
  342. package/build/components/url-popover/link-editor.js.map +1 -1
  343. package/build/components/url-popover/link-viewer.js +4 -5
  344. package/build/components/url-popover/link-viewer.js.map +1 -1
  345. package/build/components/use-block-display-information/index.js +30 -2
  346. package/build/components/use-block-display-information/index.js.map +1 -1
  347. package/build/components/video-player/index.native.js +2 -4
  348. package/build/components/video-player/index.native.js.map +1 -1
  349. package/build/components/warning/index.native.js +4 -5
  350. package/build/components/warning/index.native.js.map +1 -1
  351. package/build/components/writing-flow/index.js +2 -4
  352. package/build/components/writing-flow/index.js.map +1 -1
  353. package/build/components/writing-flow/use-drag-selection.js +1 -1
  354. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  355. package/build/components/writing-flow/use-tab-nav.js +32 -4
  356. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  357. package/build/hooks/align.js +8 -8
  358. package/build/hooks/align.js.map +1 -1
  359. package/build/hooks/anchor.js +4 -2
  360. package/build/hooks/anchor.js.map +1 -1
  361. package/build/hooks/behaviors.js +75 -37
  362. package/build/hooks/behaviors.js.map +1 -1
  363. package/build/hooks/border.js +4 -5
  364. package/build/hooks/border.js.map +1 -1
  365. package/build/hooks/color.js +4 -5
  366. package/build/hooks/color.js.map +1 -1
  367. package/build/hooks/content-lock-ui.js +8 -10
  368. package/build/hooks/content-lock-ui.js.map +1 -1
  369. package/build/hooks/custom-class-name.js +4 -2
  370. package/build/hooks/custom-class-name.js.map +1 -1
  371. package/build/hooks/dimensions.js +7 -7
  372. package/build/hooks/dimensions.js.map +1 -1
  373. package/build/hooks/duotone.js +5 -5
  374. package/build/hooks/duotone.js.map +1 -1
  375. package/build/hooks/font-family.js +2 -6
  376. package/build/hooks/font-family.js.map +1 -1
  377. package/build/hooks/font-size.js +10 -8
  378. package/build/hooks/font-size.js.map +1 -1
  379. package/build/hooks/layout.js +30 -28
  380. package/build/hooks/layout.js.map +1 -1
  381. package/build/hooks/position.js +24 -16
  382. package/build/hooks/position.js.map +1 -1
  383. package/build/hooks/style.js +8 -5
  384. package/build/hooks/style.js.map +1 -1
  385. package/build/hooks/supports.js +1 -1
  386. package/build/hooks/supports.js.map +1 -1
  387. package/build/hooks/typography.native.js +3 -1
  388. package/build/hooks/typography.native.js.map +1 -1
  389. package/build/hooks/use-typography-props.js +10 -17
  390. package/build/hooks/use-typography-props.js.map +1 -1
  391. package/build/index.js +0 -14
  392. package/build/index.js.map +1 -1
  393. package/build/layouts/constrained.js +3 -1
  394. package/build/layouts/constrained.js.map +1 -1
  395. package/build/layouts/definitions.js +154 -0
  396. package/build/layouts/definitions.js.map +1 -0
  397. package/build/layouts/flex.js +8 -5
  398. package/build/layouts/flex.js.map +1 -1
  399. package/build/layouts/flow.js +3 -1
  400. package/build/layouts/flow.js.map +1 -1
  401. package/build/layouts/grid.js +3 -1
  402. package/build/layouts/grid.js.map +1 -1
  403. package/build/layouts/utils.js +8 -2
  404. package/build/layouts/utils.js.map +1 -1
  405. package/build/private-apis.js +23 -1
  406. package/build/private-apis.js.map +1 -1
  407. package/build/store/actions.js +2 -62
  408. package/build/store/actions.js.map +1 -1
  409. package/build/store/defaults.js +1 -0
  410. package/build/store/defaults.js.map +1 -1
  411. package/build/store/private-actions.js +200 -0
  412. package/build/store/private-actions.js.map +1 -1
  413. package/build/store/private-selectors.js +72 -4
  414. package/build/store/private-selectors.js.map +1 -1
  415. package/build/store/reducer.js +52 -1
  416. package/build/store/reducer.js.map +1 -1
  417. package/build/store/selectors.js +42 -42
  418. package/build/store/selectors.js.map +1 -1
  419. package/build/utils/object.js +39 -0
  420. package/build/utils/object.js.map +1 -1
  421. package/build-module/autocompleters/block.js +5 -3
  422. package/build-module/autocompleters/block.js.map +1 -1
  423. package/build-module/components/alignment-control/index.js +4 -5
  424. package/build-module/components/alignment-control/index.js.map +1 -1
  425. package/build-module/components/alignment-control/ui.js +5 -6
  426. package/build-module/components/alignment-control/ui.js.map +1 -1
  427. package/build-module/components/autocomplete/index.js +2 -3
  428. package/build-module/components/autocomplete/index.js.map +1 -1
  429. package/build-module/components/block-actions/index.js +4 -0
  430. package/build-module/components/block-actions/index.js.map +1 -1
  431. package/build-module/components/block-alignment-control/constants.js +0 -3
  432. package/build-module/components/block-alignment-control/constants.js.map +1 -1
  433. package/build-module/components/block-alignment-control/index.js +4 -5
  434. package/build-module/components/block-alignment-control/index.js.map +1 -1
  435. package/build-module/components/block-alignment-control/ui.js +4 -4
  436. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  437. package/build-module/components/block-alignment-control/ui.native.js +3 -2
  438. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  439. package/build-module/components/block-alignment-matrix-control/index.js +0 -1
  440. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  441. package/build-module/components/block-breadcrumb/index.js +2 -3
  442. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  443. package/build-module/components/block-controls/fill.js +2 -1
  444. package/build-module/components/block-controls/fill.js.map +1 -1
  445. package/build-module/components/block-controls/index.js +8 -7
  446. package/build-module/components/block-controls/index.js.map +1 -1
  447. package/build-module/components/block-controls/slot.js +2 -3
  448. package/build-module/components/block-controls/slot.js.map +1 -1
  449. package/build-module/components/block-controls/slot.native.js +4 -2
  450. package/build-module/components/block-controls/slot.native.js.map +1 -1
  451. package/build-module/components/block-edit/edit.js +4 -5
  452. package/build-module/components/block-edit/edit.js.map +1 -1
  453. package/build-module/components/block-edit/edit.native.js +2 -3
  454. package/build-module/components/block-edit/edit.native.js.map +1 -1
  455. package/build-module/components/block-edit/index.js +3 -2
  456. package/build-module/components/block-edit/index.js.map +1 -1
  457. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js +39 -0
  458. package/build-module/components/block-heading-level-dropdown/heading-level-icon.js.map +1 -0
  459. package/build-module/components/block-heading-level-dropdown/index.js +71 -0
  460. package/build-module/components/block-heading-level-dropdown/index.js.map +1 -0
  461. package/build-module/components/block-heading-level-dropdown/index.native.js +60 -0
  462. package/build-module/components/block-heading-level-dropdown/index.native.js.map +1 -0
  463. package/build-module/components/block-icon/index.native.js +6 -6
  464. package/build-module/components/block-icon/index.native.js.map +1 -1
  465. package/build-module/components/block-info-slot-fill/index.js +4 -2
  466. package/build-module/components/block-info-slot-fill/index.js.map +1 -1
  467. package/build-module/components/block-inspector/index.js +20 -88
  468. package/build-module/components/block-inspector/index.js.map +1 -1
  469. package/build-module/components/block-list/block-list-item.native.js +4 -2
  470. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  471. package/build-module/components/block-list/block.js +6 -4
  472. package/build-module/components/block-list/block.js.map +1 -1
  473. package/build-module/components/block-list/block.native.js +1 -0
  474. package/build-module/components/block-list/block.native.js.map +1 -1
  475. package/build-module/components/block-list/index.js +7 -4
  476. package/build-module/components/block-list/index.js.map +1 -1
  477. package/build-module/components/block-list/index.native.js +8 -8
  478. package/build-module/components/block-list/index.native.js.map +1 -1
  479. package/build-module/components/block-list/subdirectory-icon.js +4 -4
  480. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  481. package/build-module/components/block-list/use-in-between-inserter.js +1 -3
  482. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  483. package/build-module/components/block-list-appender/index.js +21 -19
  484. package/build-module/components/block-list-appender/index.js.map +1 -1
  485. package/build-module/components/block-lock/toolbar.js +25 -7
  486. package/build-module/components/block-lock/toolbar.js.map +1 -1
  487. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  488. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  489. package/build-module/components/block-mover/button.js +12 -11
  490. package/build-module/components/block-mover/button.js.map +1 -1
  491. package/build-module/components/block-mover/index.js +11 -9
  492. package/build-module/components/block-mover/index.js.map +1 -1
  493. package/build-module/components/block-navigation/dropdown.js +4 -5
  494. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  495. package/build-module/components/block-parent-selector/index.js +4 -4
  496. package/build-module/components/block-parent-selector/index.js.map +1 -1
  497. package/build-module/components/block-pattern-setup/index.js +6 -7
  498. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  499. package/build-module/components/block-patterns-list/index.js +6 -7
  500. package/build-module/components/block-patterns-list/index.js.map +1 -1
  501. package/build-module/components/block-popover/inbetween.js +4 -5
  502. package/build-module/components/block-popover/inbetween.js.map +1 -1
  503. package/build-module/components/block-popover/index.js +4 -5
  504. package/build-module/components/block-popover/index.js.map +1 -1
  505. package/build-module/components/block-preview/auto.js +2 -3
  506. package/build-module/components/block-preview/auto.js.map +1 -1
  507. package/build-module/components/block-preview/index.js +7 -7
  508. package/build-module/components/block-preview/index.js.map +1 -1
  509. package/build-module/components/block-quick-navigation/index.js +69 -0
  510. package/build-module/components/block-quick-navigation/index.js.map +1 -0
  511. package/build-module/components/block-removal-warning-modal/index.js +76 -0
  512. package/build-module/components/block-removal-warning-modal/index.js.map +1 -0
  513. package/build-module/components/block-selection-clearer/index.js +4 -4
  514. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  515. package/build-module/components/block-settings/button.native.js +2 -1
  516. package/build-module/components/block-settings/button.native.js.map +1 -1
  517. package/build-module/components/block-settings/container.native.js +6 -5
  518. package/build-module/components/block-settings/container.native.js.map +1 -1
  519. package/build-module/components/block-settings-menu/block-settings-dropdown.js +10 -10
  520. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  521. package/build-module/components/block-settings-menu/index.js +4 -4
  522. package/build-module/components/block-settings-menu/index.js.map +1 -1
  523. package/build-module/components/block-settings-menu-controls/index.js +4 -4
  524. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  525. package/build-module/components/block-switcher/index.js +1 -2
  526. package/build-module/components/block-switcher/index.js.map +1 -1
  527. package/build-module/components/block-switcher/pattern-transformations-menu.js +6 -7
  528. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  529. package/build-module/components/block-toolbar/index.js +10 -7
  530. package/build-module/components/block-toolbar/index.js.map +1 -1
  531. package/build-module/components/block-tools/block-contextual-toolbar.js +4 -4
  532. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  533. package/build-module/components/block-tools/block-selection-button.js +4 -4
  534. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  535. package/build-module/components/block-tools/index.js +13 -5
  536. package/build-module/components/block-tools/index.js.map +1 -1
  537. package/build-module/components/block-tools/insertion-point.js +5 -4
  538. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  539. package/build-module/components/block-tools/selected-block-popover.js +8 -7
  540. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  541. package/build-module/components/block-types-list/index.native.js +4 -5
  542. package/build-module/components/block-types-list/index.native.js.map +1 -1
  543. package/build-module/components/block-vertical-alignment-control/index.js +4 -5
  544. package/build-module/components/block-vertical-alignment-control/index.js.map +1 -1
  545. package/build-module/components/block-vertical-alignment-control/ui.js +5 -9
  546. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  547. package/build-module/components/border-radius-control/all-input-control.js +2 -3
  548. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  549. package/build-module/components/border-radius-control/input-controls.js +2 -3
  550. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  551. package/build-module/components/border-radius-control/linked-button.js +2 -3
  552. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  553. package/build-module/components/color-palette/control.js +2 -3
  554. package/build-module/components/color-palette/control.js.map +1 -1
  555. package/build-module/components/color-palette/with-color-context.js +2 -3
  556. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  557. package/build-module/components/colors/utils.js +5 -1
  558. package/build-module/components/colors/utils.js.map +1 -1
  559. package/build-module/components/colors/with-colors.js +10 -14
  560. package/build-module/components/colors/with-colors.js.map +1 -1
  561. package/build-module/components/colors-gradients/control.js +7 -4
  562. package/build-module/components/colors-gradients/control.js.map +1 -1
  563. package/build-module/components/colors-gradients/dropdown.js +12 -10
  564. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  565. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +7 -4
  566. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  567. package/build-module/components/copy-handler/index.js +5 -6
  568. package/build-module/components/copy-handler/index.js.map +1 -1
  569. package/build-module/components/dimensions-tool/aspect-ratio-tool.js +87 -0
  570. package/build-module/components/dimensions-tool/aspect-ratio-tool.js.map +1 -0
  571. package/build-module/components/dimensions-tool/index.js +195 -0
  572. package/build-module/components/dimensions-tool/index.js.map +1 -0
  573. package/build-module/components/dimensions-tool/scale-tool.js +103 -0
  574. package/build-module/components/dimensions-tool/scale-tool.js.map +1 -0
  575. package/build-module/components/dimensions-tool/width-height-tool.js +122 -0
  576. package/build-module/components/dimensions-tool/width-height-tool.js.map +1 -0
  577. package/build-module/components/duotone-control/index.js +1 -2
  578. package/build-module/components/duotone-control/index.js.map +1 -1
  579. package/build-module/components/editable-text/index.js +6 -6
  580. package/build-module/components/editable-text/index.js.map +1 -1
  581. package/build-module/components/font-appearance-control/index.js +2 -3
  582. package/build-module/components/font-appearance-control/index.js.map +1 -1
  583. package/build-module/components/font-family/index.js +4 -4
  584. package/build-module/components/font-family/index.js.map +1 -1
  585. package/build-module/components/font-sizes/font-size-picker.js +2 -3
  586. package/build-module/components/font-sizes/font-size-picker.js.map +1 -1
  587. package/build-module/components/font-sizes/utils.js +2 -2
  588. package/build-module/components/font-sizes/utils.js.map +1 -1
  589. package/build-module/components/font-sizes/with-font-sizes.js +7 -6
  590. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  591. package/build-module/components/global-styles/color-panel.js +15 -15
  592. package/build-module/components/global-styles/color-panel.js.map +1 -1
  593. package/build-module/components/global-styles/effects-panel.js +2 -1
  594. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  595. package/build-module/components/global-styles/filters-panel.js +2 -1
  596. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  597. package/build-module/components/global-styles/index.js +1 -1
  598. package/build-module/components/global-styles/index.js.map +1 -1
  599. package/build-module/components/global-styles/typography-panel.js +7 -7
  600. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  601. package/build-module/components/global-styles/use-global-styles-output.js +11 -10
  602. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  603. package/build-module/components/gradients/with-gradient.js +2 -3
  604. package/build-module/components/gradients/with-gradient.js.map +1 -1
  605. package/build-module/components/iframe/index.js +5 -6
  606. package/build-module/components/iframe/index.js.map +1 -1
  607. package/build-module/components/image-editor/aspect-ratio-dropdown.js +1 -1
  608. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  609. package/build-module/components/image-editor/constants.js +1 -2
  610. package/build-module/components/image-editor/constants.js.map +1 -1
  611. package/build-module/components/image-editor/use-save-image.js +1 -2
  612. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  613. package/build-module/components/image-size-control/index.js +5 -0
  614. package/build-module/components/image-size-control/index.js.map +1 -1
  615. package/build-module/components/index.js +1 -1
  616. package/build-module/components/index.js.map +1 -1
  617. package/build-module/components/index.native.js +1 -0
  618. package/build-module/components/index.native.js.map +1 -1
  619. package/build-module/components/inner-blocks/index.js +9 -7
  620. package/build-module/components/inner-blocks/index.js.map +1 -1
  621. package/build-module/components/inner-blocks/index.native.js +8 -6
  622. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  623. package/build-module/components/inner-blocks/use-nested-settings-update.js +24 -27
  624. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  625. package/build-module/components/inner-blocks/with-client-id.js +2 -3
  626. package/build-module/components/inner-blocks/with-client-id.js.map +1 -1
  627. package/build-module/components/inserter/block-patterns-explorer/explorer.js +2 -1
  628. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  629. package/build-module/components/inserter/block-patterns-tab.js +33 -7
  630. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  631. package/build-module/components/inserter/hooks/use-block-types-state.js +4 -3
  632. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  633. package/build-module/components/inserter/hooks/use-insertion-point.js +1 -1
  634. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  635. package/build-module/components/inserter/index.js +8 -7
  636. package/build-module/components/inserter/index.js.map +1 -1
  637. package/build-module/components/inserter/index.native.js +4 -4
  638. package/build-module/components/inserter/index.native.js.map +1 -1
  639. package/build-module/components/inserter/library.js +1 -1
  640. package/build-module/components/inserter/library.js.map +1 -1
  641. package/build-module/components/inserter/media-tab/media-list.js +2 -3
  642. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  643. package/build-module/components/inserter/media-tab/media-preview.js +4 -5
  644. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  645. package/build-module/components/inserter/media-tab/media-tab.js +3 -3
  646. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  647. package/build-module/components/inserter/reusable-blocks-tab.js +3 -3
  648. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  649. package/build-module/components/inserter/tabs.js +3 -3
  650. package/build-module/components/inserter/tabs.js.map +1 -1
  651. package/build-module/components/inserter-list-item/index.js +4 -4
  652. package/build-module/components/inserter-list-item/index.js.map +1 -1
  653. package/build-module/components/inserter-listbox/group.js +4 -4
  654. package/build-module/components/inserter-listbox/group.js.map +1 -1
  655. package/build-module/components/inserter-listbox/item.js +8 -6
  656. package/build-module/components/inserter-listbox/item.js.map +1 -1
  657. package/build-module/components/inserter-listbox/row.js +4 -4
  658. package/build-module/components/inserter-listbox/row.js.map +1 -1
  659. package/build-module/components/inspector-controls/block-support-slot-container.js +2 -3
  660. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  661. package/build-module/components/inspector-controls/fill.native.js +2 -1
  662. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  663. package/build-module/components/inspector-controls/index.js +4 -5
  664. package/build-module/components/inspector-controls/index.js.map +1 -1
  665. package/build-module/components/inspector-controls/slot.js +4 -5
  666. package/build-module/components/inspector-controls/slot.js.map +1 -1
  667. package/build-module/components/inspector-controls/slot.native.js +2 -1
  668. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  669. package/build-module/components/justify-content-control/index.js +4 -5
  670. package/build-module/components/justify-content-control/index.js.map +1 -1
  671. package/build-module/components/justify-content-control/ui.js +4 -4
  672. package/build-module/components/justify-content-control/ui.js.map +1 -1
  673. package/build-module/components/letter-spacing-control/index.js +2 -3
  674. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  675. package/build-module/components/line-height-control/index.js +2 -3
  676. package/build-module/components/line-height-control/index.js.map +1 -1
  677. package/build-module/components/link-control/index.js +20 -24
  678. package/build-module/components/link-control/index.js.map +1 -1
  679. package/build-module/components/link-control/search-create-button.js +2 -3
  680. package/build-module/components/link-control/search-create-button.js.map +1 -1
  681. package/build-module/components/link-control/search-input.js +7 -5
  682. package/build-module/components/link-control/search-input.js.map +1 -1
  683. package/build-module/components/link-control/search-item.js +2 -3
  684. package/build-module/components/link-control/search-item.js.map +1 -1
  685. package/build-module/components/link-control/search-results.js +2 -3
  686. package/build-module/components/link-control/search-results.js.map +1 -1
  687. package/build-module/components/link-control/settings-drawer.js +4 -5
  688. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  689. package/build-module/components/list-view/appender.js +4 -5
  690. package/build-module/components/list-view/appender.js.map +1 -1
  691. package/build-module/components/list-view/aria-referenced-text.js +4 -5
  692. package/build-module/components/list-view/aria-referenced-text.js.map +1 -1
  693. package/build-module/components/list-view/block-contents.js +4 -4
  694. package/build-module/components/list-view/block-contents.js.map +1 -1
  695. package/build-module/components/list-view/block-select-button.js +14 -4
  696. package/build-module/components/list-view/block-select-button.js.map +1 -1
  697. package/build-module/components/list-view/branch.js +9 -7
  698. package/build-module/components/list-view/branch.js.map +1 -1
  699. package/build-module/components/list-view/drop-indicator.js +61 -11
  700. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  701. package/build-module/components/list-view/index.js +4 -5
  702. package/build-module/components/list-view/index.js.map +1 -1
  703. package/build-module/components/list-view/leaf.js +4 -4
  704. package/build-module/components/list-view/leaf.js.map +1 -1
  705. package/build-module/components/list-view/use-list-view-client-ids.js +2 -22
  706. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  707. package/build-module/components/list-view/use-list-view-drop-zone.js +45 -34
  708. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  709. package/build-module/components/media-placeholder/index.js +38 -13
  710. package/build-module/components/media-placeholder/index.js.map +1 -1
  711. package/build-module/components/media-replace-flow/index.js +1 -3
  712. package/build-module/components/media-replace-flow/index.js.map +1 -1
  713. package/build-module/components/navigable-toolbar/index.js +8 -7
  714. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  715. package/build-module/components/panel-color-settings/index.js +4 -4
  716. package/build-module/components/panel-color-settings/index.js.map +1 -1
  717. package/build-module/components/plain-text/index.js +8 -7
  718. package/build-module/components/plain-text/index.js.map +1 -1
  719. package/build-module/components/plain-text/index.native.js +7 -5
  720. package/build-module/components/plain-text/index.native.js.map +1 -1
  721. package/build-module/components/preview-options/index.js +5 -4
  722. package/build-module/components/preview-options/index.js.map +1 -1
  723. package/build-module/components/provider/index.js +2 -3
  724. package/build-module/components/provider/index.js.map +1 -1
  725. package/build-module/components/provider/use-block-sync.js +21 -0
  726. package/build-module/components/provider/use-block-sync.js.map +1 -1
  727. package/build-module/components/provider/with-registry-provider.js +8 -7
  728. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  729. package/build-module/components/publish-date-time-picker/index.js +4 -4
  730. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  731. package/build-module/components/resizable-box-popover/index.js +5 -4
  732. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  733. package/build-module/components/resolution-tool/index.js +45 -0
  734. package/build-module/components/resolution-tool/index.js.map +1 -0
  735. package/build-module/components/rich-text/content.js +85 -0
  736. package/build-module/components/rich-text/content.js.map +1 -0
  737. package/build-module/components/rich-text/format-toolbar/index.js +1 -2
  738. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  739. package/build-module/components/rich-text/index.js +8 -42
  740. package/build-module/components/rich-text/index.js.map +1 -1
  741. package/build-module/components/rich-text/index.native.js +6 -34
  742. package/build-module/components/rich-text/index.native.js.map +1 -1
  743. package/build-module/components/rich-text/toolbar-button.js +2 -3
  744. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  745. package/build-module/components/spacing-sizes-control/index.js +8 -7
  746. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  747. package/build-module/components/tool-selector/index.js +2 -3
  748. package/build-module/components/tool-selector/index.js.map +1 -1
  749. package/build-module/components/unit-control/index.js +4 -4
  750. package/build-module/components/unit-control/index.js.map +1 -1
  751. package/build-module/components/url-input/index.js +12 -9
  752. package/build-module/components/url-input/index.js.map +1 -1
  753. package/build-module/components/url-input/index.native.js +4 -4
  754. package/build-module/components/url-input/index.native.js.map +1 -1
  755. package/build-module/components/url-popover/image-url-input-ui.js +22 -15
  756. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  757. package/build-module/components/url-popover/index.js +4 -4
  758. package/build-module/components/url-popover/index.js.map +1 -1
  759. package/build-module/components/url-popover/link-editor.js +4 -4
  760. package/build-module/components/url-popover/link-editor.js.map +1 -1
  761. package/build-module/components/url-popover/link-viewer.js +4 -4
  762. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  763. package/build-module/components/use-block-display-information/index.js +29 -2
  764. package/build-module/components/use-block-display-information/index.js.map +1 -1
  765. package/build-module/components/video-player/index.native.js +2 -3
  766. package/build-module/components/video-player/index.native.js.map +1 -1
  767. package/build-module/components/warning/index.native.js +4 -4
  768. package/build-module/components/warning/index.native.js.map +1 -1
  769. package/build-module/components/writing-flow/index.js +2 -3
  770. package/build-module/components/writing-flow/index.js.map +1 -1
  771. package/build-module/components/writing-flow/use-drag-selection.js +1 -1
  772. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  773. package/build-module/components/writing-flow/use-tab-nav.js +32 -5
  774. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  775. package/build-module/hooks/align.js +8 -7
  776. package/build-module/hooks/align.js.map +1 -1
  777. package/build-module/hooks/anchor.js +4 -2
  778. package/build-module/hooks/anchor.js.map +1 -1
  779. package/build-module/hooks/behaviors.js +76 -34
  780. package/build-module/hooks/behaviors.js.map +1 -1
  781. package/build-module/hooks/border.js +4 -4
  782. package/build-module/hooks/border.js.map +1 -1
  783. package/build-module/hooks/color.js +4 -4
  784. package/build-module/hooks/color.js.map +1 -1
  785. package/build-module/hooks/content-lock-ui.js +8 -7
  786. package/build-module/hooks/content-lock-ui.js.map +1 -1
  787. package/build-module/hooks/custom-class-name.js +4 -2
  788. package/build-module/hooks/custom-class-name.js.map +1 -1
  789. package/build-module/hooks/dimensions.js +7 -6
  790. package/build-module/hooks/dimensions.js.map +1 -1
  791. package/build-module/hooks/duotone.js +5 -4
  792. package/build-module/hooks/duotone.js.map +1 -1
  793. package/build-module/hooks/font-family.js +1 -5
  794. package/build-module/hooks/font-family.js.map +1 -1
  795. package/build-module/hooks/font-size.js +10 -9
  796. package/build-module/hooks/font-size.js.map +1 -1
  797. package/build-module/hooks/layout.js +26 -24
  798. package/build-module/hooks/layout.js.map +1 -1
  799. package/build-module/hooks/position.js +23 -15
  800. package/build-module/hooks/position.js.map +1 -1
  801. package/build-module/hooks/style.js +8 -4
  802. package/build-module/hooks/style.js.map +1 -1
  803. package/build-module/hooks/supports.js +1 -1
  804. package/build-module/hooks/supports.js.map +1 -1
  805. package/build-module/hooks/typography.native.js +3 -1
  806. package/build-module/hooks/typography.native.js.map +1 -1
  807. package/build-module/hooks/use-typography-props.js +8 -15
  808. package/build-module/hooks/use-typography-props.js.map +1 -1
  809. package/build-module/index.js +1 -1
  810. package/build-module/index.js.map +1 -1
  811. package/build-module/layouts/constrained.js +2 -1
  812. package/build-module/layouts/constrained.js.map +1 -1
  813. package/build-module/layouts/definitions.js +147 -0
  814. package/build-module/layouts/definitions.js.map +1 -0
  815. package/build-module/layouts/flex.js +8 -6
  816. package/build-module/layouts/flex.js.map +1 -1
  817. package/build-module/layouts/flow.js +2 -1
  818. package/build-module/layouts/flow.js.map +1 -1
  819. package/build-module/layouts/grid.js +2 -1
  820. package/build-module/layouts/grid.js.map +1 -1
  821. package/build-module/layouts/utils.js +7 -2
  822. package/build-module/layouts/utils.js.map +1 -1
  823. package/build-module/private-apis.js +16 -1
  824. package/build-module/private-apis.js.map +1 -1
  825. package/build-module/store/actions.js +2 -62
  826. package/build-module/store/actions.js.map +1 -1
  827. package/build-module/store/defaults.js +1 -0
  828. package/build-module/store/defaults.js.map +1 -1
  829. package/build-module/store/private-actions.js +186 -0
  830. package/build-module/store/private-actions.js.map +1 -1
  831. package/build-module/store/private-selectors.js +63 -3
  832. package/build-module/store/private-selectors.js.map +1 -1
  833. package/build-module/store/reducer.js +52 -1
  834. package/build-module/store/reducer.js.map +1 -1
  835. package/build-module/store/selectors.js +42 -42
  836. package/build-module/store/selectors.js.map +1 -1
  837. package/build-module/utils/object.js +37 -1
  838. package/build-module/utils/object.js.map +1 -1
  839. package/build-style/style-rtl.css +58 -67
  840. package/build-style/style.css +58 -67
  841. package/package.json +32 -31
  842. package/src/autocompleters/block.js +4 -2
  843. package/src/components/alignment-control/test/__snapshots__/index.js.snap +6 -6
  844. package/src/components/alignment-control/ui.js +1 -2
  845. package/src/components/block-actions/index.js +10 -0
  846. package/src/components/block-alignment-control/constants.js +0 -4
  847. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +5 -5
  848. package/src/components/block-alignment-control/ui.js +1 -6
  849. package/src/components/block-alignment-matrix-control/index.js +1 -1
  850. package/src/components/block-breadcrumb/index.js +2 -6
  851. package/src/components/block-edit/index.js +3 -5
  852. package/src/components/block-heading-level-dropdown/README.md +52 -0
  853. package/src/components/block-heading-level-dropdown/heading-level-icon.js +43 -0
  854. package/src/components/block-heading-level-dropdown/index.js +77 -0
  855. package/src/components/block-heading-level-dropdown/index.native.js +63 -0
  856. package/src/components/block-inspector/index.js +18 -92
  857. package/src/components/block-inspector/style.scss +0 -5
  858. package/src/components/block-list/block.native.js +1 -0
  859. package/src/components/block-list/index.js +1 -1
  860. package/src/components/block-list/use-in-between-inserter.js +0 -4
  861. package/src/components/block-list-appender/index.js +29 -22
  862. package/src/components/block-lock/style.scss +11 -4
  863. package/src/components/block-lock/toolbar.js +34 -6
  864. package/src/components/block-mobile-toolbar/block-actions-menu.native.js +1 -1
  865. package/src/components/block-mobile-toolbar/test/block-actions-menu.native.js +2 -2
  866. package/src/components/block-mover/test/__snapshots__/index.native.js.snap +3 -3
  867. package/src/components/block-mover/test/index.native.js +1 -20
  868. package/src/components/block-preview/index.js +7 -14
  869. package/src/components/block-quick-navigation/index.js +81 -0
  870. package/src/components/block-removal-warning-modal/index.js +94 -0
  871. package/src/components/block-settings-menu/block-settings-dropdown.js +15 -13
  872. package/src/components/block-switcher/index.js +1 -2
  873. package/src/components/block-toolbar/index.js +9 -6
  874. package/src/components/block-toolbar/style.scss +0 -4
  875. package/src/components/block-tools/index.js +10 -1
  876. package/src/components/block-tools/style.scss +4 -0
  877. package/src/components/block-vertical-alignment-control/ui.js +1 -3
  878. package/src/components/colors/utils.js +5 -1
  879. package/src/components/colors/with-colors.js +1 -5
  880. package/src/components/copy-handler/index.js +5 -5
  881. package/src/components/dimensions-tool/aspect-ratio-tool.js +124 -0
  882. package/src/components/dimensions-tool/index.js +212 -0
  883. package/src/components/dimensions-tool/scale-tool.js +124 -0
  884. package/src/components/dimensions-tool/stories/aspect-ratio-tool.js +52 -0
  885. package/src/components/dimensions-tool/stories/index.js +54 -0
  886. package/src/components/dimensions-tool/stories/scale-tool.js +48 -0
  887. package/src/components/dimensions-tool/stories/width-height-tool.js +54 -0
  888. package/src/components/dimensions-tool/test/index.js +641 -0
  889. package/src/components/dimensions-tool/width-height-tool.js +113 -0
  890. package/src/components/duotone-control/index.js +0 -1
  891. package/src/components/font-sizes/test/fluid-utils.js +97 -76
  892. package/src/components/font-sizes/utils.js +2 -2
  893. package/src/components/global-styles/color-panel.js +3 -3
  894. package/src/components/global-styles/index.js +1 -0
  895. package/src/components/global-styles/test/use-global-styles-output.js +14 -9
  896. package/src/components/global-styles/typography-panel.js +19 -16
  897. package/src/components/global-styles/use-global-styles-output.js +12 -12
  898. package/src/components/iframe/index.js +1 -1
  899. package/src/components/image-editor/aspect-ratio-dropdown.js +1 -1
  900. package/src/components/image-editor/constants.js +0 -1
  901. package/src/components/image-editor/use-save-image.js +0 -1
  902. package/src/components/image-size-control/index.js +6 -0
  903. package/src/components/index.js +1 -1
  904. package/src/components/index.native.js +1 -0
  905. package/src/components/inner-blocks/index.js +4 -2
  906. package/src/components/inner-blocks/index.native.js +1 -1
  907. package/src/components/inner-blocks/use-nested-settings-update.js +31 -36
  908. package/src/components/inserter/block-patterns-tab.js +63 -8
  909. package/src/components/inserter/hooks/use-block-types-state.js +4 -3
  910. package/src/components/inserter/hooks/use-insertion-point.js +1 -0
  911. package/src/components/inserter/library.js +2 -1
  912. package/src/components/inserter/media-tab/media-tab.js +9 -3
  913. package/src/components/inserter/reusable-blocks-tab.js +3 -3
  914. package/src/components/inserter/tabs.js +3 -3
  915. package/src/components/link-control/index.js +34 -37
  916. package/src/components/link-control/search-input.js +5 -3
  917. package/src/components/link-control/settings-drawer.js +6 -5
  918. package/src/components/link-control/style.scss +33 -55
  919. package/src/components/link-control/test/index.js +161 -159
  920. package/src/components/list-view/block-select-button.js +19 -1
  921. package/src/components/list-view/branch.js +6 -3
  922. package/src/components/list-view/drop-indicator.js +94 -9
  923. package/src/components/list-view/style.scss +13 -12
  924. package/src/components/list-view/test/use-list-view-drop-zone.js +188 -93
  925. package/src/components/list-view/use-list-view-client-ids.js +3 -20
  926. package/src/components/list-view/use-list-view-drop-zone.js +97 -54
  927. package/src/components/media-placeholder/index.js +54 -20
  928. package/src/components/media-replace-flow/index.js +1 -3
  929. package/src/components/media-replace-flow/test/index.js +1 -1
  930. package/src/components/preview-options/index.js +3 -2
  931. package/src/components/provider/test/experimental-provider.js +9 -6
  932. package/src/components/provider/test/use-block-sync.js +21 -6
  933. package/src/components/provider/use-block-sync.js +19 -0
  934. package/src/components/resolution-tool/index.js +56 -0
  935. package/src/components/resolution-tool/stories/index.js +48 -0
  936. package/src/components/rich-text/content.js +85 -0
  937. package/src/components/rich-text/format-toolbar/index.js +1 -2
  938. package/src/components/rich-text/index.js +2 -35
  939. package/src/components/rich-text/index.native.js +3 -33
  940. package/src/components/url-input/index.js +2 -0
  941. package/src/components/url-popover/image-url-input-ui.js +15 -15
  942. package/src/components/url-popover/test/__snapshots__/index.js.snap +3 -3
  943. package/src/components/use-block-display-information/index.js +26 -0
  944. package/src/components/writing-flow/use-drag-selection.js +1 -1
  945. package/src/components/writing-flow/use-tab-nav.js +42 -6
  946. package/src/hooks/behaviors.js +82 -39
  947. package/src/hooks/font-family.js +1 -5
  948. package/src/hooks/font-size.js +12 -17
  949. package/src/hooks/layout.js +17 -25
  950. package/src/hooks/position.js +24 -12
  951. package/src/hooks/supports.js +1 -1
  952. package/src/hooks/use-typography-props.js +14 -19
  953. package/src/index.js +0 -2
  954. package/src/layouts/constrained.js +2 -1
  955. package/src/layouts/definitions.js +174 -0
  956. package/src/layouts/flex.js +7 -5
  957. package/src/layouts/flow.js +2 -1
  958. package/src/layouts/grid.js +2 -1
  959. package/src/layouts/test/utils.js +2 -7
  960. package/src/layouts/utils.js +7 -2
  961. package/src/private-apis.js +15 -0
  962. package/src/store/actions.js +7 -56
  963. package/src/store/defaults.js +1 -0
  964. package/src/store/private-actions.js +193 -0
  965. package/src/store/private-selectors.js +108 -35
  966. package/src/store/reducer.js +44 -0
  967. package/src/store/selectors.js +61 -39
  968. package/src/store/test/private-selectors.js +269 -1
  969. package/src/store/test/selectors.js +18 -17
  970. package/src/utils/object.js +35 -0
  971. package/src/utils/test/object.js +96 -1
@@ -1,11 +1,9 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement, Fragment } from "@wordpress/element";
3
2
 
4
3
  /**
5
4
  * External dependencies
6
5
  */
7
6
  import classnames from 'classnames';
8
- import { kebabCase } from 'lodash';
9
7
  /**
10
8
  * WordPress dependencies
11
9
  */
@@ -28,7 +26,13 @@ import { LayoutStyle } from '../components/block-list/layout';
28
26
  import BlockList from '../components/block-list';
29
27
  import { getLayoutType, getLayoutTypes } from '../layouts';
30
28
  import { useBlockEditingMode } from '../components/block-editing-mode';
31
- const layoutBlockSupportKey = '__experimentalLayout';
29
+ import { LAYOUT_DEFINITIONS } from '../layouts/definitions';
30
+ import { kebabCase } from '../utils/object';
31
+ const layoutBlockSupportKey = 'layout';
32
+
33
+ function hasLayoutBlockSupport(blockName) {
34
+ return hasBlockSupport(blockName, 'layout') || hasBlockSupport(blockName, '__experimentalLayout');
35
+ }
32
36
  /**
33
37
  * Generates the utility classnames for the given block's layout attributes.
34
38
  *
@@ -38,6 +42,7 @@ const layoutBlockSupportKey = '__experimentalLayout';
38
42
  * @return { Array } Array of CSS classname strings.
39
43
  */
40
44
 
45
+
41
46
  export function useLayoutClasses(blockAttributes = {}, blockName = '') {
42
47
  const rootPaddingAlignment = useSelect(select => {
43
48
  const {
@@ -45,7 +50,6 @@ export function useLayoutClasses(blockAttributes = {}, blockName = '') {
45
50
  } = select(blockEditorStore);
46
51
  return getSettings().__experimentalFeatures?.useRootPaddingAwareAlignments;
47
52
  }, []);
48
- const globalLayoutSettings = useSetting('layout') || {};
49
53
  const {
50
54
  layout
51
55
  } = blockAttributes;
@@ -57,8 +61,8 @@ export function useLayoutClasses(blockAttributes = {}, blockName = '') {
57
61
  } : layout || defaultBlockLayout || {};
58
62
  const layoutClassnames = [];
59
63
 
60
- if (globalLayoutSettings?.definitions?.[usedLayout?.type || 'default']?.className) {
61
- const baseClassName = globalLayoutSettings?.definitions?.[usedLayout?.type || 'default']?.className;
64
+ if (LAYOUT_DEFINITIONS[usedLayout?.type || 'default']?.className) {
65
+ const baseClassName = LAYOUT_DEFINITIONS[usedLayout?.type || 'default']?.className;
62
66
  const compoundClassName = `wp-block-${blockName.split('/').pop()}-${baseClassName}`;
63
67
  layoutClassnames.push(baseClassName, compoundClassName);
64
68
  }
@@ -101,14 +105,12 @@ export function useLayoutStyles(blockAttributes = {}, blockName, selector) {
101
105
  type: 'constrained'
102
106
  } : layout || {};
103
107
  const fullLayoutType = getLayoutType(usedLayout?.type || 'default');
104
- const globalLayoutSettings = useSetting('layout') || {};
105
108
  const blockGapSupport = useSetting('spacing.blockGap');
106
109
  const hasBlockGapSupport = blockGapSupport !== null;
107
110
  const css = fullLayoutType?.getLayoutStyle?.({
108
111
  blockName,
109
112
  selector,
110
113
  layout,
111
- layoutDefinitions: globalLayoutSettings?.definitions,
112
114
  style,
113
115
  hasBlockGapSupport
114
116
  });
@@ -244,7 +246,7 @@ export function addAttribute(settings) {
244
246
  return settings;
245
247
  }
246
248
 
247
- if (hasBlockSupport(settings, layoutBlockSupportKey)) {
249
+ if (hasLayoutBlockSupport(settings)) {
248
250
  settings.attributes = { ...settings.attributes,
249
251
  layout: {
250
252
  type: 'object'
@@ -266,13 +268,15 @@ export const withInspectorControls = createHigherOrderComponent(BlockEdit => pro
266
268
  const {
267
269
  name: blockName
268
270
  } = props;
269
- const supportLayout = hasBlockSupport(blockName, layoutBlockSupportKey);
271
+ const supportLayout = hasLayoutBlockSupport(blockName);
270
272
  const blockEditingMode = useBlockEditingMode();
271
- return [supportLayout && blockEditingMode === 'default' && createElement(LayoutPanel, _extends({
272
- key: "layout"
273
- }, props)), createElement(BlockEdit, _extends({
274
- key: "edit"
275
- }, props))];
273
+ return [supportLayout && blockEditingMode === 'default' && createElement(LayoutPanel, {
274
+ key: "layout",
275
+ ...props
276
+ }), createElement(BlockEdit, {
277
+ key: "edit",
278
+ ...props
279
+ })];
276
280
  }, 'withInspectorControls');
277
281
  /**
278
282
  * Override the default block element to add the layout styles.
@@ -287,16 +291,15 @@ export const withLayoutStyles = createHigherOrderComponent(BlockListBlock => pro
287
291
  name,
288
292
  attributes
289
293
  } = props;
290
- const hasLayoutBlockSupport = hasBlockSupport(name, layoutBlockSupportKey);
294
+ const blockSupportsLayout = hasLayoutBlockSupport(name);
291
295
  const disableLayoutStyles = useSelect(select => {
292
296
  const {
293
297
  getSettings
294
298
  } = select(blockEditorStore);
295
299
  return !!getSettings().disableLayoutStyles;
296
300
  });
297
- const shouldRenderLayoutStyles = hasLayoutBlockSupport && !disableLayoutStyles;
301
+ const shouldRenderLayoutStyles = blockSupportsLayout && !disableLayoutStyles;
298
302
  const id = useInstanceId(BlockListBlock);
299
- const defaultThemeLayout = useSetting('layout') || {};
300
303
  const element = useContext(BlockList.__unstableElementContext);
301
304
  const {
302
305
  layout
@@ -307,7 +310,7 @@ export const withLayoutStyles = createHigherOrderComponent(BlockListBlock => pro
307
310
  const usedLayout = layout?.inherit || layout?.contentSize || layout?.wideSize ? { ...layout,
308
311
  type: 'constrained'
309
312
  } : layout || defaultBlockLayout || {};
310
- const layoutClasses = hasLayoutBlockSupport ? useLayoutClasses(attributes, name) : null; // Higher specificity to override defaults from theme.json.
313
+ const layoutClasses = blockSupportsLayout ? useLayoutClasses(attributes, name) : null; // Higher specificity to override defaults from theme.json.
311
314
 
312
315
  const selector = `.wp-container-${id}.wp-container-${id}`;
313
316
  const blockGapSupport = useSetting('spacing.blockGap');
@@ -322,7 +325,6 @@ export const withLayoutStyles = createHigherOrderComponent(BlockListBlock => pro
322
325
  blockName: name,
323
326
  selector,
324
327
  layout: usedLayout,
325
- layoutDefinitions: defaultThemeLayout?.definitions,
326
328
  style: attributes?.style,
327
329
  hasBlockGapSupport
328
330
  });
@@ -339,9 +341,9 @@ export const withLayoutStyles = createHigherOrderComponent(BlockListBlock => pro
339
341
  css: css,
340
342
  layout: usedLayout,
341
343
  style: attributes?.style
342
- }), element), createElement(BlockListBlock, _extends({}, props, {
344
+ }), element), createElement(BlockListBlock, { ...props,
343
345
  __unstableLayoutClassNames: layoutClassNames
344
- })));
346
+ }));
345
347
  }, 'withLayoutStyles');
346
348
  /**
347
349
  * Override the default block element to add the child layout styles.
@@ -393,9 +395,9 @@ export const withChildLayoutStyles = createHigherOrderComponent(BlockListBlock =
393
395
  [`wp-container-content-${id}`]: shouldRenderChildLayoutStyles && !!css // Only attach a container class if there is generated CSS to be attached.
394
396
 
395
397
  });
396
- return createElement(Fragment, null, shouldRenderChildLayoutStyles && element && !!css && createPortal(createElement("style", null, css), element), createElement(BlockListBlock, _extends({}, props, {
398
+ return createElement(Fragment, null, shouldRenderChildLayoutStyles && element && !!css && createPortal(createElement("style", null, css), element), createElement(BlockListBlock, { ...props,
397
399
  className: className
398
- })));
400
+ }));
399
401
  }, 'withChildLayoutStyles');
400
402
  addFilter('blocks.registerBlockType', 'core/layout/addAttribute', addAttribute);
401
403
  addFilter('editor.BlockListBlock', 'core/editor/layout/with-layout-styles', withLayoutStyles);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/layout.js"],"names":["classnames","kebabCase","createHigherOrderComponent","useInstanceId","addFilter","getBlockSupport","hasBlockSupport","useSelect","Button","ButtonGroup","ToggleControl","PanelBody","__","useContext","createPortal","store","blockEditorStore","InspectorControls","useSetting","LayoutStyle","BlockList","getLayoutType","getLayoutTypes","useBlockEditingMode","layoutBlockSupportKey","useLayoutClasses","blockAttributes","blockName","rootPaddingAlignment","select","getSettings","__experimentalFeatures","useRootPaddingAwareAlignments","globalLayoutSettings","layout","default","defaultBlockLayout","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","definitions","className","baseClassName","compoundClassName","split","pop","push","orientation","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","blockGapSupport","hasBlockGapSupport","css","getLayoutStyle","layoutDefinitions","LayoutPanel","setAttributes","attributes","name","defaultThemeLayout","themeSupportsLayout","supportsLayout","blockEditingMode","layoutBlockSupport","allowSwitching","allowEditing","allowInheriting","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","LayoutTypeSwitcher","onChange","map","label","addAttribute","settings","withInspectorControls","BlockEdit","props","supportLayout","withLayoutStyles","BlockListBlock","hasLayoutBlockSupport","disableLayoutStyles","shouldRenderLayoutStyles","id","element","__unstableElementContext","layoutClasses","layoutClassNames","withChildLayoutStyles","selfStretch","flexSize","hasChildLayout","shouldRenderChildLayoutStyles"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,SAAT,QAA0B,QAA1B;AAEA;AACA;AACA;;AACA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,mBAAjD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,MADD,EAECC,WAFD,EAGCC,aAHD,EAICC,SAJD,QAKO,uBALP;AAMA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,UAA1C;AACA,SAASC,iBAAT,QAAkC,eAAlC;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,SAASC,WAAT,QAA4B,iCAA5B;AACA,OAAOC,SAAP,MAAsB,0BAAtB;AACA,SAASC,aAAT,EAAwBC,cAAxB,QAA8C,YAA9C;AACA,SAASC,mBAAT,QAAoC,kCAApC;AAEA,MAAMC,qBAAqB,GAAG,sBAA9B;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,gBAAT,CAA2BC,eAAe,GAAG,EAA7C,EAAiDC,SAAS,GAAG,EAA7D,EAAkE;AACx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AAD,eAAqBR,KAArB;AAA6B,IAAA,SAAS,EAAG/C;AAAzC,KALD,CADD;AASA,CA7C6D,EA8C9D,uBA9C8D,CAAxD;AAiDPxC,SAAS,CACR,0BADQ,EAER,0BAFQ,EAGRmF,YAHQ,CAAT;AAKAnF,SAAS,CACR,uBADQ,EAER,uCAFQ,EAGRyF,gBAHQ,CAAT;AAKAzF,SAAS,CACR,uBADQ,EAER,6CAFQ,EAGRmG,qBAHQ,CAAT;AAKAnG,SAAS,CACR,kBADQ,EAER,4CAFQ,EAGRqF,qBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { kebabCase } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useContext, createPortal } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport useSetting from '../components/use-setting';\nimport { LayoutStyle } from '../components/block-list/layout';\nimport BlockList from '../components/block-list';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\n\nconst layoutBlockSupportKey = '__experimentalLayout';\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst rootPaddingAlignment = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalFeatures\n\t\t\t?.useRootPaddingAwareAlignments;\n\t}, [] );\n\tconst globalLayoutSettings = useSetting( 'layout' ) || {};\n\n\tconst { layout } = blockAttributes;\n\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif (\n\t\tglobalLayoutSettings?.definitions?.[ usedLayout?.type || 'default' ]\n\t\t\t?.className\n\t) {\n\t\tconst baseClassName =\n\t\t\tglobalLayoutSettings?.definitions?.[ usedLayout?.type || 'default' ]\n\t\t\t\t?.className;\n\t\tconst compoundClassName = `wp-block-${ blockName\n\t\t\t.split( '/' )\n\t\t\t.pop() }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tif (\n\t\t( usedLayout?.inherit ||\n\t\t\tusedLayout?.contentSize ||\n\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\trootPaddingAlignment\n\t) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst globalLayoutSettings = useSetting( 'layout' ) || {};\n\tconst blockGapSupport = useSetting( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tlayoutDefinitions: globalLayoutSettings?.definitions,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n\treturn css;\n}\n\nfunction LayoutPanel( { setAttributes, attributes, name: blockName } ) {\n\tconst { layout } = attributes;\n\tconst defaultThemeLayout = useSetting( 'layout' );\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = layoutBlockSupport;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t// Only show the inherit toggle if it's supported,\n\t// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t!! defaultThemeLayout &&\n\t\t( ! layout?.type ||\n\t\t\tlayout?.type === 'default' ||\n\t\t\tlayout?.type === 'constrained' ||\n\t\t\tlayout?.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst {\n\t\tinherit = false,\n\t\ttype = 'default',\n\t\tcontentSize = null,\n\t} = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( type === 'default' || type === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( type );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__toggle-control\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && blockEditingMode === 'default' && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasBlockSupport( settings, layoutBlockSupportKey ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include layout controls\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withInspectorControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\tconst supportLayout = hasBlockSupport(\n\t\t\tblockName,\n\t\t\tlayoutBlockSupportKey\n\t\t);\n\n\t\tconst blockEditingMode = useBlockEditingMode();\n\t\treturn [\n\t\t\tsupportLayout && blockEditingMode === 'default' && (\n\t\t\t\t<LayoutPanel key=\"layout\" { ...props } />\n\t\t\t),\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withInspectorControls'\n);\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst hasLayoutBlockSupport = hasBlockSupport(\n\t\t\tname,\n\t\t\tlayoutBlockSupportKey\n\t\t);\n\t\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\treturn !! getSettings().disableLayoutStyles;\n\t\t} );\n\t\tconst shouldRenderLayoutStyles =\n\t\t\thasLayoutBlockSupport && ! disableLayoutStyles;\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst defaultThemeLayout = useSetting( 'layout' ) || {};\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\t\tconst { layout } = attributes;\n\t\tconst { default: defaultBlockLayout } =\n\t\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\t\tconst usedLayout =\n\t\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t\t: layout || defaultBlockLayout || {};\n\t\tconst layoutClasses = hasLayoutBlockSupport\n\t\t\t? useLayoutClasses( attributes, name )\n\t\t\t: null;\n\t\t// Higher specificity to override defaults from theme.json.\n\t\tconst selector = `.wp-container-${ id }.wp-container-${ id }`;\n\t\tconst blockGapSupport = useSetting( 'spacing.blockGap' );\n\t\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t\t// Get CSS string for the current layout type.\n\t\t// The CSS and `style` element is only output if it is not empty.\n\t\tlet css;\n\t\tif ( shouldRenderLayoutStyles ) {\n\t\t\tconst fullLayoutType = getLayoutType(\n\t\t\t\tusedLayout?.type || 'default'\n\t\t\t);\n\t\t\tcss = fullLayoutType?.getLayoutStyle?.( {\n\t\t\t\tblockName: name,\n\t\t\t\tselector,\n\t\t\t\tlayout: usedLayout,\n\t\t\t\tlayoutDefinitions: defaultThemeLayout?.definitions,\n\t\t\t\tstyle: attributes?.style,\n\t\t\t\thasBlockGapSupport,\n\t\t\t} );\n\t\t}\n\n\t\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\t\tconst layoutClassNames = classnames(\n\t\t\t{\n\t\t\t\t[ `wp-container-${ id }` ]: shouldRenderLayoutStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t\t},\n\t\t\tlayoutClasses\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldRenderLayoutStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\t!! css &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tblockName={ name }\n\t\t\t\t\t\t\tselector={ selector }\n\t\t\t\t\t\t\tcss={ css }\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tstyle={ attributes?.style }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\n/**\n * Override the default block element to add the child layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withChildLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { attributes } = props;\n\t\tconst { style: { layout = {} } = {} } = attributes;\n\t\tconst { selfStretch, flexSize } = layout;\n\t\tconst hasChildLayout = selfStretch || flexSize;\n\t\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\treturn !! getSettings().disableLayoutStyles;\n\t\t} );\n\t\tconst shouldRenderChildLayoutStyles =\n\t\t\thasChildLayout && ! disableLayoutStyles;\n\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst selector = `.wp-container-content-${ id }`;\n\n\t\tlet css = '';\n\n\t\tif ( selfStretch === 'fixed' && flexSize ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tflex-basis: ${ flexSize };\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`;\n\t\t} else if ( selfStretch === 'fill' ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`;\n\t\t}\n\n\t\t// Attach a `wp-container-content` id-based classname.\n\t\tconst className = classnames( props?.className, {\n\t\t\t[ `wp-container-content-${ id }` ]:\n\t\t\t\tshouldRenderChildLayoutStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t} );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldRenderChildLayoutStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\t!! css &&\n\t\t\t\t\tcreatePortal( <style>{ css }</style>, element ) }\n\t\t\t\t<BlockListBlock { ...props } className={ className } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withChildLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-child-layout-styles',\n\twithChildLayoutStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/layout/with-inspector-controls',\n\twithInspectorControls\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/layout.js"],"names":["classnames","createHigherOrderComponent","useInstanceId","addFilter","getBlockSupport","hasBlockSupport","useSelect","Button","ButtonGroup","ToggleControl","PanelBody","__","useContext","createPortal","store","blockEditorStore","InspectorControls","useSetting","LayoutStyle","BlockList","getLayoutType","getLayoutTypes","useBlockEditingMode","LAYOUT_DEFINITIONS","kebabCase","layoutBlockSupportKey","hasLayoutBlockSupport","blockName","useLayoutClasses","blockAttributes","rootPaddingAlignment","select","getSettings","__experimentalFeatures","useRootPaddingAwareAlignments","layout","default","defaultBlockLayout","usedLayout","inherit","contentSize","wideSize","type","layoutClassnames","className","baseClassName","compoundClassName","split","pop","push","orientation","justifyContent","flexWrap","useLayoutStyles","selector","style","fullLayoutType","blockGapSupport","hasBlockGapSupport","css","getLayoutStyle","LayoutPanel","setAttributes","attributes","name","defaultThemeLayout","themeSupportsLayout","supportsLayout","blockEditingMode","layoutBlockSupport","allowSwitching","allowEditing","allowInheriting","showInheritToggle","layoutType","constrainedType","displayControlsForLegacyLayouts","hasContentSizeOrLegacySettings","onChangeType","newType","onChangeLayout","newLayout","LayoutTypeSwitcher","onChange","map","label","addAttribute","settings","withInspectorControls","BlockEdit","props","supportLayout","withLayoutStyles","BlockListBlock","blockSupportsLayout","disableLayoutStyles","shouldRenderLayoutStyles","id","element","__unstableElementContext","layoutClasses","layoutClassNames","withChildLayoutStyles","selfStretch","flexSize","hasChildLayout","shouldRenderChildLayoutStyles"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,SAAT,QAA0B,kBAA1B;AACA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,mBAAjD;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,MADD,EAECC,WAFD,EAGCC,aAHD,EAICC,SAJD,QAKO,uBALP;AAMA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,UAAT,EAAqBC,YAArB,QAAyC,oBAAzC;AAEA;AACA;AACA;;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,UAA1C;AACA,SAASC,iBAAT,QAAkC,eAAlC;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,SAASC,WAA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EL;;AAFK,GAApB,CAA5B;AAKA,SACC,8BACG+C,6BAA6B,IAC9BR,OADC,IAED,CAAC,CAAEvC,GAFF,IAGD9C,YAAY,CAAE,6BAAS8C,GAAT,CAAF,EAA0BuC,OAA1B,CAJd,EAKC,cAAC,cAAD,OAAqBR,KAArB;AAA6B,IAAA,SAAS,EAAG9C;AAAzC,IALD,CADD;AASA,CA7C6D,EA8C9D,uBA9C8D,CAAxD;AAiDPzC,SAAS,CACR,0BADQ,EAER,0BAFQ,EAGRmF,YAHQ,CAAT;AAKAnF,SAAS,CACR,uBADQ,EAER,uCAFQ,EAGRyF,gBAHQ,CAAT;AAKAzF,SAAS,CACR,uBADQ,EAER,6CAFQ,EAGRmG,qBAHQ,CAAT;AAKAnG,SAAS,CACR,kBADQ,EAER,4CAFQ,EAGRqF,qBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { addFilter } from '@wordpress/hooks';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tButton,\n\tButtonGroup,\n\tToggleControl,\n\tPanelBody,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useContext, createPortal } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../store';\nimport { InspectorControls } from '../components';\nimport useSetting from '../components/use-setting';\nimport { LayoutStyle } from '../components/block-list/layout';\nimport BlockList from '../components/block-list';\nimport { getLayoutType, getLayoutTypes } from '../layouts';\nimport { useBlockEditingMode } from '../components/block-editing-mode';\nimport { LAYOUT_DEFINITIONS } from '../layouts/definitions';\nimport { kebabCase } from '../utils/object';\n\nconst layoutBlockSupportKey = 'layout';\n\nfunction hasLayoutBlockSupport( blockName ) {\n\treturn (\n\t\thasBlockSupport( blockName, 'layout' ) ||\n\t\thasBlockSupport( blockName, '__experimentalLayout' )\n\t);\n}\n\n/**\n * Generates the utility classnames for the given block's layout attributes.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n *\n * @return { Array } Array of CSS classname strings.\n */\nexport function useLayoutClasses( blockAttributes = {}, blockName = '' ) {\n\tconst rootPaddingAlignment = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn getSettings().__experimentalFeatures\n\t\t\t?.useRootPaddingAwareAlignments;\n\t}, [] );\n\tconst { layout } = blockAttributes;\n\n\tconst { default: defaultBlockLayout } =\n\t\tgetBlockSupport( blockName, layoutBlockSupportKey ) || {};\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || defaultBlockLayout || {};\n\n\tconst layoutClassnames = [];\n\n\tif ( LAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className ) {\n\t\tconst baseClassName =\n\t\t\tLAYOUT_DEFINITIONS[ usedLayout?.type || 'default' ]?.className;\n\t\tconst compoundClassName = `wp-block-${ blockName\n\t\t\t.split( '/' )\n\t\t\t.pop() }-${ baseClassName }`;\n\t\tlayoutClassnames.push( baseClassName, compoundClassName );\n\t}\n\n\tif (\n\t\t( usedLayout?.inherit ||\n\t\t\tusedLayout?.contentSize ||\n\t\t\tusedLayout?.type === 'constrained' ) &&\n\t\trootPaddingAlignment\n\t) {\n\t\tlayoutClassnames.push( 'has-global-padding' );\n\t}\n\n\tif ( usedLayout?.orientation ) {\n\t\tlayoutClassnames.push( `is-${ kebabCase( usedLayout.orientation ) }` );\n\t}\n\n\tif ( usedLayout?.justifyContent ) {\n\t\tlayoutClassnames.push(\n\t\t\t`is-content-justification-${ kebabCase(\n\t\t\t\tusedLayout.justifyContent\n\t\t\t) }`\n\t\t);\n\t}\n\n\tif ( usedLayout?.flexWrap && usedLayout.flexWrap === 'nowrap' ) {\n\t\tlayoutClassnames.push( 'is-nowrap' );\n\t}\n\n\treturn layoutClassnames;\n}\n\n/**\n * Generates a CSS rule with the given block's layout styles.\n *\n * @param { Object } blockAttributes Block attributes.\n * @param { string } blockName Block name.\n * @param { string } selector A selector to use in generating the CSS rule.\n *\n * @return { string } CSS rule.\n */\nexport function useLayoutStyles( blockAttributes = {}, blockName, selector ) {\n\tconst { layout = {}, style = {} } = blockAttributes;\n\t// Update type for blocks using legacy layouts.\n\tconst usedLayout =\n\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t: layout || {};\n\tconst fullLayoutType = getLayoutType( usedLayout?.type || 'default' );\n\tconst blockGapSupport = useSetting( 'spacing.blockGap' );\n\tconst hasBlockGapSupport = blockGapSupport !== null;\n\tconst css = fullLayoutType?.getLayoutStyle?.( {\n\t\tblockName,\n\t\tselector,\n\t\tlayout,\n\t\tstyle,\n\t\thasBlockGapSupport,\n\t} );\n\treturn css;\n}\n\nfunction LayoutPanel( { setAttributes, attributes, name: blockName } ) {\n\tconst { layout } = attributes;\n\tconst defaultThemeLayout = useSetting( 'layout' );\n\tconst { themeSupportsLayout } = useSelect( ( select ) => {\n\t\tconst { getSettings } = select( blockEditorStore );\n\t\treturn {\n\t\t\tthemeSupportsLayout: getSettings().supportsLayout,\n\t\t};\n\t}, [] );\n\tconst blockEditingMode = useBlockEditingMode();\n\n\tconst layoutBlockSupport = getBlockSupport(\n\t\tblockName,\n\t\tlayoutBlockSupportKey,\n\t\t{}\n\t);\n\tconst {\n\t\tallowSwitching,\n\t\tallowEditing = true,\n\t\tallowInheriting = true,\n\t\tdefault: defaultBlockLayout,\n\t} = layoutBlockSupport;\n\n\tif ( ! allowEditing ) {\n\t\treturn null;\n\t}\n\n\t// Only show the inherit toggle if it's supported,\n\t// a default theme layout is set (e.g. one that provides `contentSize` and/or `wideSize` values),\n\t// and either the default / flow or the constrained layout type is in use, as the toggle switches from one to the other.\n\tconst showInheritToggle = !! (\n\t\tallowInheriting &&\n\t\t!! defaultThemeLayout &&\n\t\t( ! layout?.type ||\n\t\t\tlayout?.type === 'default' ||\n\t\t\tlayout?.type === 'constrained' ||\n\t\t\tlayout?.inherit )\n\t);\n\n\tconst usedLayout = layout || defaultBlockLayout || {};\n\tconst {\n\t\tinherit = false,\n\t\ttype = 'default',\n\t\tcontentSize = null,\n\t} = usedLayout;\n\t/**\n\t * `themeSupportsLayout` is only relevant to the `default/flow` or\n\t * `constrained` layouts and it should not be taken into account when other\n\t * `layout` types are used.\n\t */\n\tif (\n\t\t( type === 'default' || type === 'constrained' ) &&\n\t\t! themeSupportsLayout\n\t) {\n\t\treturn null;\n\t}\n\tconst layoutType = getLayoutType( type );\n\tconst constrainedType = getLayoutType( 'constrained' );\n\tconst displayControlsForLegacyLayouts =\n\t\t! usedLayout.type && ( contentSize || inherit );\n\tconst hasContentSizeOrLegacySettings = !! inherit || !! contentSize;\n\n\tconst onChangeType = ( newType ) =>\n\t\tsetAttributes( { layout: { type: newType } } );\n\tconst onChangeLayout = ( newLayout ) =>\n\t\tsetAttributes( { layout: newLayout } );\n\n\treturn (\n\t\t<>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Layout' ) }>\n\t\t\t\t\t{ showInheritToggle && (\n\t\t\t\t\t\t<>\n\t\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t\t\tclassName=\"block-editor-hooks__toggle-control\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Inner blocks use content width' ) }\n\t\t\t\t\t\t\t\tchecked={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonChange={ () =>\n\t\t\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\t\t\tlayout: {\n\t\t\t\t\t\t\t\t\t\t\ttype:\n\t\t\t\t\t\t\t\t\t\t\t\tlayoutType?.name ===\n\t\t\t\t\t\t\t\t\t\t\t\t\t'constrained' ||\n\t\t\t\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t? 'default'\n\t\t\t\t\t\t\t\t\t\t\t\t\t: 'constrained',\n\t\t\t\t\t\t\t\t\t\t},\n\t\t\t\t\t\t\t\t\t} )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\thelp={\n\t\t\t\t\t\t\t\t\tlayoutType?.name === 'constrained' ||\n\t\t\t\t\t\t\t\t\thasContentSizeOrLegacySettings\n\t\t\t\t\t\t\t\t\t\t? __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks use content width with options for full and wide widths.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t\t\t: __(\n\t\t\t\t\t\t\t\t\t\t\t\t'Nested blocks will fill the width of this container. Toggle to constrain.'\n\t\t\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ ! inherit && allowSwitching && (\n\t\t\t\t\t\t<LayoutTypeSwitcher\n\t\t\t\t\t\t\ttype={ type }\n\t\t\t\t\t\t\tonChange={ onChangeType }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t{ layoutType && layoutType.name !== 'default' && (\n\t\t\t\t\t\t<layoutType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ constrainedType && displayControlsForLegacyLayouts && (\n\t\t\t\t\t\t<constrainedType.inspectorControls\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t{ ! inherit && blockEditingMode === 'default' && layoutType && (\n\t\t\t\t<layoutType.toolBarControls\n\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\tonChange={ onChangeLayout }\n\t\t\t\t\tlayoutBlockSupport={ layoutBlockSupport }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction LayoutTypeSwitcher( { type, onChange } ) {\n\treturn (\n\t\t<ButtonGroup>\n\t\t\t{ getLayoutTypes().map( ( { name, label } ) => {\n\t\t\t\treturn (\n\t\t\t\t\t<Button\n\t\t\t\t\t\tkey={ name }\n\t\t\t\t\t\tisPressed={ type === name }\n\t\t\t\t\t\tonClick={ () => onChange( name ) }\n\t\t\t\t\t>\n\t\t\t\t\t\t{ label }\n\t\t\t\t\t</Button>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</ButtonGroup>\n\t);\n}\n\n/**\n * Filters registered block settings, extending attributes to include `layout`.\n *\n * @param {Object} settings Original block settings.\n *\n * @return {Object} Filtered block settings.\n */\nexport function addAttribute( settings ) {\n\tif ( 'type' in ( settings.attributes?.layout ?? {} ) ) {\n\t\treturn settings;\n\t}\n\tif ( hasLayoutBlockSupport( settings ) ) {\n\t\tsettings.attributes = {\n\t\t\t...settings.attributes,\n\t\t\tlayout: {\n\t\t\t\ttype: 'object',\n\t\t\t},\n\t\t};\n\t}\n\n\treturn settings;\n}\n\n/**\n * Override the default edit UI to include layout controls\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withInspectorControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\tconst supportLayout = hasLayoutBlockSupport( blockName );\n\n\t\tconst blockEditingMode = useBlockEditingMode();\n\t\treturn [\n\t\t\tsupportLayout && blockEditingMode === 'default' && (\n\t\t\t\t<LayoutPanel key=\"layout\" { ...props } />\n\t\t\t),\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withInspectorControls'\n);\n\n/**\n * Override the default block element to add the layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst blockSupportsLayout = hasLayoutBlockSupport( name );\n\t\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\treturn !! getSettings().disableLayoutStyles;\n\t\t} );\n\t\tconst shouldRenderLayoutStyles =\n\t\t\tblockSupportsLayout && ! disableLayoutStyles;\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\t\tconst { layout } = attributes;\n\t\tconst { default: defaultBlockLayout } =\n\t\t\tgetBlockSupport( name, layoutBlockSupportKey ) || {};\n\t\tconst usedLayout =\n\t\t\tlayout?.inherit || layout?.contentSize || layout?.wideSize\n\t\t\t\t? { ...layout, type: 'constrained' }\n\t\t\t\t: layout || defaultBlockLayout || {};\n\t\tconst layoutClasses = blockSupportsLayout\n\t\t\t? useLayoutClasses( attributes, name )\n\t\t\t: null;\n\t\t// Higher specificity to override defaults from theme.json.\n\t\tconst selector = `.wp-container-${ id }.wp-container-${ id }`;\n\t\tconst blockGapSupport = useSetting( 'spacing.blockGap' );\n\t\tconst hasBlockGapSupport = blockGapSupport !== null;\n\n\t\t// Get CSS string for the current layout type.\n\t\t// The CSS and `style` element is only output if it is not empty.\n\t\tlet css;\n\t\tif ( shouldRenderLayoutStyles ) {\n\t\t\tconst fullLayoutType = getLayoutType(\n\t\t\t\tusedLayout?.type || 'default'\n\t\t\t);\n\t\t\tcss = fullLayoutType?.getLayoutStyle?.( {\n\t\t\t\tblockName: name,\n\t\t\t\tselector,\n\t\t\t\tlayout: usedLayout,\n\t\t\t\tstyle: attributes?.style,\n\t\t\t\thasBlockGapSupport,\n\t\t\t} );\n\t\t}\n\n\t\t// Attach a `wp-container-` id-based class name as well as a layout class name such as `is-layout-flex`.\n\t\tconst layoutClassNames = classnames(\n\t\t\t{\n\t\t\t\t[ `wp-container-${ id }` ]: shouldRenderLayoutStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t\t},\n\t\t\tlayoutClasses\n\t\t);\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldRenderLayoutStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\t!! css &&\n\t\t\t\t\tcreatePortal(\n\t\t\t\t\t\t<LayoutStyle\n\t\t\t\t\t\t\tblockName={ name }\n\t\t\t\t\t\t\tselector={ selector }\n\t\t\t\t\t\t\tcss={ css }\n\t\t\t\t\t\t\tlayout={ usedLayout }\n\t\t\t\t\t\t\tstyle={ attributes?.style }\n\t\t\t\t\t\t/>,\n\t\t\t\t\t\telement\n\t\t\t\t\t) }\n\t\t\t\t<BlockListBlock\n\t\t\t\t\t{ ...props }\n\t\t\t\t\t__unstableLayoutClassNames={ layoutClassNames }\n\t\t\t\t/>\n\t\t\t</>\n\t\t);\n\t},\n\t'withLayoutStyles'\n);\n\n/**\n * Override the default block element to add the child layout styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withChildLayoutStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { attributes } = props;\n\t\tconst { style: { layout = {} } = {} } = attributes;\n\t\tconst { selfStretch, flexSize } = layout;\n\t\tconst hasChildLayout = selfStretch || flexSize;\n\t\tconst disableLayoutStyles = useSelect( ( select ) => {\n\t\t\tconst { getSettings } = select( blockEditorStore );\n\t\t\treturn !! getSettings().disableLayoutStyles;\n\t\t} );\n\t\tconst shouldRenderChildLayoutStyles =\n\t\t\thasChildLayout && ! disableLayoutStyles;\n\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst selector = `.wp-container-content-${ id }`;\n\n\t\tlet css = '';\n\n\t\tif ( selfStretch === 'fixed' && flexSize ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tflex-basis: ${ flexSize };\n\t\t\t\tbox-sizing: border-box;\n\t\t\t}`;\n\t\t} else if ( selfStretch === 'fill' ) {\n\t\t\tcss += `${ selector } {\n\t\t\t\tflex-grow: 1;\n\t\t\t}`;\n\t\t}\n\n\t\t// Attach a `wp-container-content` id-based classname.\n\t\tconst className = classnames( props?.className, {\n\t\t\t[ `wp-container-content-${ id }` ]:\n\t\t\t\tshouldRenderChildLayoutStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t} );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ shouldRenderChildLayoutStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\t!! css &&\n\t\t\t\t\tcreatePortal( <style>{ css }</style>, element ) }\n\t\t\t\t<BlockListBlock { ...props } className={ className } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withChildLayoutStyles'\n);\n\naddFilter(\n\t'blocks.registerBlockType',\n\t'core/layout/addAttribute',\n\taddAttribute\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-layout-styles',\n\twithLayoutStyles\n);\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/layout/with-child-layout-styles',\n\twithChildLayoutStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/layout/with-inspector-controls',\n\twithInspectorControls\n);\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement, Fragment } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -23,6 +22,7 @@ import { addFilter } from '@wordpress/hooks';
23
22
  import BlockList from '../components/block-list';
24
23
  import useSetting from '../components/use-setting';
25
24
  import InspectorControls from '../components/inspector-controls';
25
+ import useBlockDisplayInformation from '../components/use-block-display-information';
26
26
  import { cleanEmptyObject } from './utils';
27
27
  import { unlock } from '../lock-unlock';
28
28
  import { store as blockEditorStore } from '../store';
@@ -214,21 +214,25 @@ export function PositionPanel(props) {
214
214
  const allowSticky = hasStickyPositionSupport(blockName);
215
215
  const value = style?.position?.type;
216
216
  const {
217
- hasParents
217
+ firstParentClientId
218
218
  } = useSelect(select => {
219
219
  const {
220
220
  getBlockParents
221
221
  } = select(blockEditorStore);
222
222
  const parents = getBlockParents(clientId);
223
223
  return {
224
- hasParents: parents.length
224
+ firstParentClientId: parents[parents.length - 1]
225
225
  };
226
226
  }, [clientId]);
227
+ const blockInformation = useBlockDisplayInformation(firstParentClientId);
228
+ const stickyHelpText = allowSticky && value === STICKY_OPTION.value && blockInformation ? sprintf(
229
+ /* translators: %s: the name of the parent block. */
230
+ __('The block will stick to the scrollable area of the parent %s block.'), blockInformation.title) : null;
227
231
  const options = useMemo(() => {
228
- const availableOptions = [DEFAULT_OPTION]; // Only display sticky option if the block has no parents (is at the root of the document),
229
- // or if the block already has a sticky position value set.
232
+ const availableOptions = [DEFAULT_OPTION]; // Display options if they are allowed, or if a block already has a valid value set.
233
+ // This allows for a block to be switched off from a position type that is not allowed.
230
234
 
231
- if (allowSticky && !hasParents || value === STICKY_OPTION.value) {
235
+ if (allowSticky || value === STICKY_OPTION.value) {
232
236
  availableOptions.push(STICKY_OPTION);
233
237
  }
234
238
 
@@ -237,7 +241,7 @@ export function PositionPanel(props) {
237
241
  }
238
242
 
239
243
  return availableOptions;
240
- }, [allowFixed, allowSticky, hasParents, value]);
244
+ }, [allowFixed, allowSticky, value]);
241
245
 
242
246
  const onChangeType = next => {
243
247
  // For now, use a hard-coded `0px` value for the position.
@@ -261,7 +265,9 @@ export function PositionPanel(props) {
261
265
  web: options.length > 1 ? createElement(InspectorControls, {
262
266
  group: "position"
263
267
  }, createElement(BaseControl, {
264
- className: "block-editor-hooks__position-selection"
268
+ className: "block-editor-hooks__position-selection",
269
+ __nextHasNoMarginBottom: true,
270
+ help: stickyHelpText
265
271
  }, createElement(CustomSelectControl, {
266
272
  __nextUnconstrainedWidth: true,
267
273
  __next36pxDefaultSize: true,
@@ -297,11 +303,13 @@ export const withInspectorControls = createHigherOrderComponent(BlockEdit => pro
297
303
  } = props;
298
304
  const positionSupport = hasBlockSupport(blockName, POSITION_SUPPORT_KEY);
299
305
  const showPositionControls = positionSupport && !useIsPositionDisabled(props);
300
- return [showPositionControls && createElement(PositionPanel, _extends({
301
- key: "position"
302
- }, props)), createElement(BlockEdit, _extends({
303
- key: "edit"
304
- }, props))];
306
+ return [showPositionControls && createElement(PositionPanel, {
307
+ key: "position",
308
+ ...props
309
+ }), createElement(BlockEdit, {
310
+ key: "edit",
311
+ ...props
312
+ })];
305
313
  }, 'withInspectorControls');
306
314
  /**
307
315
  * Override the default block element to add the position styles.
@@ -338,9 +346,9 @@ export const withPositionStyles = createHigherOrderComponent(BlockListBlock => p
338
346
  // Only attach a container class if there is generated CSS to be attached.
339
347
  [`is-position-${attributes?.style?.position?.type}`]: allowPositionStyles && !!css && !!attributes?.style?.position?.type
340
348
  });
341
- return createElement(Fragment, null, allowPositionStyles && element && !!css && createPortal(createElement("style", null, css), element), createElement(BlockListBlock, _extends({}, props, {
349
+ return createElement(Fragment, null, allowPositionStyles && element && !!css && createPortal(createElement("style", null, css), element), createElement(BlockListBlock, { ...props,
342
350
  className: className
343
- })));
351
+ }));
344
352
  }, 'withPositionStyles');
345
353
  addFilter('editor.BlockListBlock', 'core/editor/position/with-position-styles', withPositionStyles);
346
354
  addFilter('editor.BlockEdit', 'core/editor/position/with-inspector-controls', withInspectorControls);
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/hooks/position.js"],"names":["classnames","__","_x","sprintf","getBlockSupport","hasBlockSupport","BaseControl","privateApis","componentsPrivateApis","createHigherOrderComponent","useInstanceId","useSelect","useContext","useMemo","createPortal","Platform","addFilter","BlockList","useSetting","InspectorControls","cleanEmptyObject","unlock","store","blockEditorStore","CustomSelectControl","POSITION_SUPPORT_KEY","OPTION_CLASSNAME","DEFAULT_OPTION","key","value","name","className","STICKY_OPTION","__experimentalHint","FIXED_OPTION","POSITION_SIDES","VALID_POSITION_TYPES","getPositionCSS","selector","style","output","type","positionType","position","includes","forEach","side","undefined","hasStickyPositionSupport","blockType","support","sticky","hasFixedPositionSupport","fixed","hasPositionSupport","hasPositionValue","props","attributes","hasStickyOrFixedPositionValue","resetPosition","setAttributes","top","right","bottom","left","useIsPositionDisabled","blockName","allowFixed","allowSticky","isDisabled","PositionPanel","clientId","hasParents","select","getBlockParents","parents","length","options","availableOptions","push","onChangeType","next","placementValue","newStyle","selectedOption","find","option","web","selectedItem","native","withInspectorControls","BlockEdit","positionSupport","showPositionControls","withPositionStyles","BlockListBlock","hasPositionBlockSupport","allowPositionStyles","id","element","__unstableElementContext","positionSelector","css"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,mBAAjD;AACA,SACCC,WADD,EAECC,WAAW,IAAIC,qBAFhB,QAGO,uBAHP;AAIA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,UADD,EAECC,OAFD,EAGCC,YAHD,EAICC,QAJD,QAKO,oBALP;AAMA,SAASC,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,0BAAtB;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,SAASC,gBAAT,QAAiC,SAAjC;AACA,SAASC,MAAT,QAAuB,gBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,UAA1C;AAEA,MAAM;A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AF,CAAxB;AACA,QAAMI,OAAO,GAAGvF,UAAU,CAAEK,SAAS,CAACmF,wBAAZ,CAA1B,CAVkC,CAYlC;;AACA,QAAMC,gBAAgB,GAAI,iBAAiBH,EAAI,iBAAiBA,EAAI,EAApE,CAbkC,CAelC;;AACA,MAAII,GAAJ;;AACA,MAAKL,mBAAL,EAA2B;AAC1BK,IAAAA,GAAG,GACFjE,cAAc,CAAE;AACfC,MAAAA,QAAQ,EAAE+D,gBADK;AAEf9D,MAAAA,KAAK,EAAEkB,UAAU,EAAElB;AAFJ,KAAF,CAAd,IAGO,EAJR;AAKA,GAvBiC,CAyBlC;;;AACA,QAAMR,SAAS,GAAG/B,UAAU,CAAEwD,KAAK,EAAEzB,SAAT,EAAoB;AAC/C,KAAG,gBAAgBmE,EAAI,EAAvB,GAA4BD,mBAAmB,IAAI,CAAC,CAAEK,GADP;AACY;AAC3D,KAAG,eAAe7C,UAAU,EAAElB,KAAZ,EAAmBI,QAAnB,EAA6BF,IAAM,EAArD,GACCwD,mBAAmB,IACnB,CAAC,CAAEK,GADH,IAEA,CAAC,CAAE7C,UAAU,EAAElB,KAAZ,EAAmBI,QAAnB,EAA6BF;AALc,GAApB,CAA5B;AAQA,SACC,8BACGwD,mBAAmB,IACpBE,OADC,IAED,CAAC,CAAEG,GAFF,IAGDxF,YAAY,CAAE,6BAASwF,GAAT,CAAF,EAA0BH,OAA1B,CAJd,EAKC,cAAC,cAAD,eAAqB3C,KAArB;AAA6B,IAAA,SAAS,EAAGzB;AAAzC,KALD,CADD;AASA,CA5C0D,EA6C3D,oBA7C2D,CAArD;AAgDPf,SAAS,CACR,uBADQ,EAER,2CAFQ,EAGR8E,kBAHQ,CAAT;AAKA9E,SAAS,CACR,kBADQ,EAER,8CAFQ,EAGR0E,qBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tBaseControl,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseContext,\n\tuseMemo,\n\tcreatePortal,\n\tPlatform,\n} from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport useSetting from '../components/use-setting';\nimport InspectorControls from '../components/inspector-controls';\nimport { cleanEmptyObject } from './utils';\nimport { unlock } from '../lock-unlock';\nimport { store as blockEditorStore } from '../store';\n\nconst { CustomSelectControl } = unlock( componentsPrivateApis );\n\nconst POSITION_SUPPORT_KEY = 'position';\n\nconst OPTION_CLASSNAME =\n\t'block-editor-hooks__position-selection__select-control__option';\n\nconst DEFAULT_OPTION = {\n\tkey: 'default',\n\tvalue: '',\n\tname: __( 'Default' ),\n\tclassName: OPTION_CLASSNAME,\n};\n\nconst STICKY_OPTION = {\n\tkey: 'sticky',\n\tvalue: 'sticky',\n\tname: _x( 'Sticky', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will stick to the top of the window instead of scrolling.'\n\t),\n};\n\nconst FIXED_OPTION = {\n\tkey: 'fixed',\n\tvalue: 'fixed',\n\tname: _x( 'Fixed', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will not move when the page is scrolled.'\n\t),\n};\n\nconst POSITION_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nconst VALID_POSITION_TYPES = [ 'sticky', 'fixed' ];\n\n/**\n * Get calculated position CSS.\n *\n * @param {Object} props Component props.\n * @param {string} props.selector Selector to use.\n * @param {Object} props.style Style object.\n * @return {string} The generated CSS rules.\n */\nexport function getPositionCSS( { selector, style } ) {\n\tlet output = '';\n\n\tconst { type: positionType } = style?.position || {};\n\n\tif ( ! VALID_POSITION_TYPES.includes( positionType ) ) {\n\t\treturn output;\n\t}\n\n\toutput += `${ selector } {`;\n\toutput += `position: ${ positionType };`;\n\n\tPOSITION_SIDES.forEach( ( side ) => {\n\t\tif ( style?.position?.[ side ] !== undefined ) {\n\t\t\toutput += `${ side }: ${ style.position[ side ] };`;\n\t\t}\n\t} );\n\n\tif ( positionType === 'sticky' || positionType === 'fixed' ) {\n\t\t// TODO: Replace hard-coded z-index value with a z-index preset approach in theme.json.\n\t\toutput += `z-index: 10`;\n\t}\n\toutput += `}`;\n\n\treturn output;\n}\n\n/**\n * Determines if there is sticky position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasStickyPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.sticky );\n}\n\n/**\n * Determines if there is fixed position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasFixedPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.fixed );\n}\n\n/**\n * Determines if there is position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! support;\n}\n\n/**\n * Checks if there is a current value in the position block support attributes.\n *\n * @param {Object} props Block props.\n * @return {boolean} Whether or not the block has a position value set.\n */\nexport function hasPositionValue( props ) {\n\treturn props.attributes.style?.position?.type !== undefined;\n}\n\n/**\n * Checks if the block is currently set to a sticky or fixed position.\n * This check is helpful for determining how to position block toolbars or other elements.\n *\n * @param {Object} attributes Block attributes.\n * @return {boolean} Whether or not the block is set to a sticky or fixed position.\n */\nexport function hasStickyOrFixedPositionValue( attributes ) {\n\tconst positionType = attributes.style?.position?.type;\n\treturn positionType === 'sticky' || positionType === 'fixed';\n}\n\n/**\n * Resets the position block support attributes. This can be used when disabling\n * the position support controls for a block via a `ToolsPanel`.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block's attributes.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetPosition( { attributes = {}, setAttributes } ) {\n\tconst { style = {} } = attributes;\n\n\tsetAttributes( {\n\t\tstyle: cleanEmptyObject( {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: undefined,\n\t\t\t\ttop: undefined,\n\t\t\t\tright: undefined,\n\t\t\t\tbottom: undefined,\n\t\t\t\tleft: undefined,\n\t\t\t},\n\t\t} ),\n\t} );\n}\n\n/**\n * Custom hook that checks if position settings have been disabled.\n *\n * @param {string} name The name of the block.\n *\n * @return {boolean} Whether padding setting is disabled.\n */\nexport function useIsPositionDisabled( { name: blockName } = {} ) {\n\tconst allowFixed = useSetting( 'position.fixed' );\n\tconst allowSticky = useSetting( 'position.sticky' );\n\tconst isDisabled = ! allowFixed && ! allowSticky;\n\n\treturn ! hasPositionSupport( blockName ) || isDisabled;\n}\n\n/*\n * Position controls rendered in an inspector control panel.\n *\n * @param {Object} props\n *\n * @return {WPElement} Position panel.\n */\nexport function PositionPanel( props ) {\n\tconst {\n\t\tattributes: { style = {} },\n\t\tclientId,\n\t\tname: blockName,\n\t\tsetAttributes,\n\t} = props;\n\n\tconst allowFixed = hasFixedPositionSupport( blockName );\n\tconst allowSticky = hasStickyPositionSupport( blockName );\n\tconst value = style?.position?.type;\n\n\tconst { hasParents } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents } = select( blockEditorStore );\n\t\t\tconst parents = getBlockParents( clientId );\n\t\t\treturn {\n\t\t\t\thasParents: parents.length,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst options = useMemo( () => {\n\t\tconst availableOptions = [ DEFAULT_OPTION ];\n\t\t// Only display sticky option if the block has no parents (is at the root of the document),\n\t\t// or if the block already has a sticky position value set.\n\t\tif (\n\t\t\t( allowSticky && ! hasParents ) ||\n\t\t\tvalue === STICKY_OPTION.value\n\t\t) {\n\t\t\tavailableOptions.push( STICKY_OPTION );\n\t\t}\n\t\tif ( allowFixed || value === FIXED_OPTION.value ) {\n\t\t\tavailableOptions.push( FIXED_OPTION );\n\t\t}\n\t\treturn availableOptions;\n\t}, [ allowFixed, allowSticky, hasParents, value ] );\n\n\tconst onChangeType = ( next ) => {\n\t\t// For now, use a hard-coded `0px` value for the position.\n\t\t// `0px` is preferred over `0` as it can be used in `calc()` functions.\n\t\t// In the future, it could be useful to allow for an offset value.\n\t\tconst placementValue = '0px';\n\n\t\tconst newStyle = {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: next,\n\t\t\t\ttop:\n\t\t\t\t\tnext === 'sticky' || next === 'fixed'\n\t\t\t\t\t\t? placementValue\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) || DEFAULT_OPTION\n\t\t: DEFAULT_OPTION;\n\n\t// Only display position controls if there is at least one option to choose from.\n\treturn Platform.select( {\n\t\tweb:\n\t\t\toptions.length > 1 ? (\n\t\t\t\t<InspectorControls group=\"position\">\n\t\t\t\t\t<BaseControl className=\"block-editor-hooks__position-selection\">\n\t\t\t\t\t\t<CustomSelectControl\n\t\t\t\t\t\t\t__nextUnconstrainedWidth\n\t\t\t\t\t\t\t__next36pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__position-selection__select-control\"\n\t\t\t\t\t\t\tlabel={ __( 'Position' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tdescribedBy={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Currently selected position.\n\t\t\t\t\t\t\t\t__( 'Currently selected position: %s' ),\n\t\t\t\t\t\t\t\tselectedOption.name\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\t\tvalue={ selectedOption }\n\t\t\t\t\t\t\t__experimentalShowSelectedHint\n\t\t\t\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\t\t\t\tonChangeType( selectedItem.value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BaseControl>\n\t\t\t\t</InspectorControls>\n\t\t\t) : null,\n\t\tnative: null,\n\t} );\n}\n\n/**\n * Override the default edit UI to include position controls.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withInspectorControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\tconst positionSupport = hasBlockSupport(\n\t\t\tblockName,\n\t\t\tPOSITION_SUPPORT_KEY\n\t\t);\n\t\tconst showPositionControls =\n\t\t\tpositionSupport && ! useIsPositionDisabled( props );\n\n\t\treturn [\n\t\t\tshowPositionControls && (\n\t\t\t\t<PositionPanel key=\"position\" { ...props } />\n\t\t\t),\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withInspectorControls'\n);\n\n/**\n * Override the default block element to add the position styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withPositionStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst hasPositionBlockSupport = hasBlockSupport(\n\t\t\tname,\n\t\t\tPOSITION_SUPPORT_KEY\n\t\t);\n\t\tconst allowPositionStyles =\n\t\t\thasPositionBlockSupport && ! useIsPositionDisabled( props );\n\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\t// Higher specificity to override defaults in editor UI.\n\t\tconst positionSelector = `.wp-container-${ id }.wp-container-${ id }`;\n\n\t\t// Get CSS string for the current position values.\n\t\tlet css;\n\t\tif ( allowPositionStyles ) {\n\t\t\tcss =\n\t\t\t\tgetPositionCSS( {\n\t\t\t\t\tselector: positionSelector,\n\t\t\t\t\tstyle: attributes?.style,\n\t\t\t\t} ) || '';\n\t\t}\n\n\t\t// Attach a `wp-container-` id-based class name.\n\t\tconst className = classnames( props?.className, {\n\t\t\t[ `wp-container-${ id }` ]: allowPositionStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t\t[ `is-position-${ attributes?.style?.position?.type }` ]:\n\t\t\t\tallowPositionStyles &&\n\t\t\t\t!! css &&\n\t\t\t\t!! attributes?.style?.position?.type,\n\t\t} );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ allowPositionStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\t!! css &&\n\t\t\t\t\tcreatePortal( <style>{ css }</style>, element ) }\n\t\t\t\t<BlockListBlock { ...props } className={ className } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withPositionStyles'\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/position/with-position-styles',\n\twithPositionStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/position/with-inspector-controls',\n\twithInspectorControls\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/hooks/position.js"],"names":["classnames","__","_x","sprintf","getBlockSupport","hasBlockSupport","BaseControl","privateApis","componentsPrivateApis","createHigherOrderComponent","useInstanceId","useSelect","useContext","useMemo","createPortal","Platform","addFilter","BlockList","useSetting","InspectorControls","useBlockDisplayInformation","cleanEmptyObject","unlock","store","blockEditorStore","CustomSelectControl","POSITION_SUPPORT_KEY","OPTION_CLASSNAME","DEFAULT_OPTION","key","value","name","className","STICKY_OPTION","__experimentalHint","FIXED_OPTION","POSITION_SIDES","VALID_POSITION_TYPES","getPositionCSS","selector","style","output","type","positionType","position","includes","forEach","side","undefined","hasStickyPositionSupport","blockType","support","sticky","hasFixedPositionSupport","fixed","hasPositionSupport","hasPositionValue","props","attributes","hasStickyOrFixedPositionValue","resetPosition","setAttributes","top","right","bottom","left","useIsPositionDisabled","blockName","allowFixed","allowSticky","isDisabled","PositionPanel","clientId","firstParentClientId","select","getBlockParents","parents","length","blockInformation","stickyHelpText","title","options","availableOptions","push","onChangeType","next","placementValue","newStyle","selectedOption","find","option","web","selectedItem","native","withInspectorControls","BlockEdit","positionSupport","showPositionControls","withPositionStyles","BlockListBlock","hasPositionBlockSupport","allowPositionStyles","id","element","__unstableElementContext","positionSelector","css"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,EAAT,EAAaC,EAAb,EAAiBC,OAAjB,QAAgC,iBAAhC;AACA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,mBAAjD;AACA,SACCC,WADD,EAECC,WAAW,IAAIC,qBAFhB,QAGO,uBAHP;AAIA,SAASC,0BAAT,EAAqCC,aAArC,QAA0D,oBAA1D;AACA,SAASC,SAAT,QAA0B,iBAA1B;AACA,SACCC,UADD,EAECC,OAFD,EAGCC,YAHD,EAICC,QAJD,QAKO,oBALP;AAMA,SAASC,SAAT,QAA0B,kBAA1B;AAEA;AACA;AACA;;AACA,OAAOC,SAAP,MAAsB,0BAAtB;AACA,OAAOC,UAAP,MAAuB,2BAAvB;AACA,OAAOC,iBAAP,MAA8B,kCAA9B;AACA,OAAOC,0BAAP,MAAuC,6CAAvC;AACA,SAASC,gBAAT,QAAiC,SAAjC;AACA,SAASC,MAAT,QAAuB,gBAAvB;AACA,SAASC,KAAK,IAAIC,gBAAlB,QAA0C,UAA1C;AAEA,MAAM;AAAEC,EAAAA;AAAF,IAA0BH,MAAM,CAAEd,qBAAF,CAAtC;AAEA,MAAMkB,oBAAoB,GAAG,UAA7B;AAEA,MAAMC,gBAAgB,GACrB,gEADD;A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kBAHQ,CAAT;AAKAlF,SAAS,CACR,kBADQ,EAER,8CAFQ,EAGR8E,qBAHQ,CAAT","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { __, _x, sprintf } from '@wordpress/i18n';\nimport { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';\nimport {\n\tBaseControl,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { createHigherOrderComponent, useInstanceId } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport {\n\tuseContext,\n\tuseMemo,\n\tcreatePortal,\n\tPlatform,\n} from '@wordpress/element';\nimport { addFilter } from '@wordpress/hooks';\n\n/**\n * Internal dependencies\n */\nimport BlockList from '../components/block-list';\nimport useSetting from '../components/use-setting';\nimport InspectorControls from '../components/inspector-controls';\nimport useBlockDisplayInformation from '../components/use-block-display-information';\nimport { cleanEmptyObject } from './utils';\nimport { unlock } from '../lock-unlock';\nimport { store as blockEditorStore } from '../store';\n\nconst { CustomSelectControl } = unlock( componentsPrivateApis );\n\nconst POSITION_SUPPORT_KEY = 'position';\n\nconst OPTION_CLASSNAME =\n\t'block-editor-hooks__position-selection__select-control__option';\n\nconst DEFAULT_OPTION = {\n\tkey: 'default',\n\tvalue: '',\n\tname: __( 'Default' ),\n\tclassName: OPTION_CLASSNAME,\n};\n\nconst STICKY_OPTION = {\n\tkey: 'sticky',\n\tvalue: 'sticky',\n\tname: _x( 'Sticky', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will stick to the top of the window instead of scrolling.'\n\t),\n};\n\nconst FIXED_OPTION = {\n\tkey: 'fixed',\n\tvalue: 'fixed',\n\tname: _x( 'Fixed', 'Name for the value of the CSS position property' ),\n\tclassName: OPTION_CLASSNAME,\n\t__experimentalHint: __(\n\t\t'The block will not move when the page is scrolled.'\n\t),\n};\n\nconst POSITION_SIDES = [ 'top', 'right', 'bottom', 'left' ];\nconst VALID_POSITION_TYPES = [ 'sticky', 'fixed' ];\n\n/**\n * Get calculated position CSS.\n *\n * @param {Object} props Component props.\n * @param {string} props.selector Selector to use.\n * @param {Object} props.style Style object.\n * @return {string} The generated CSS rules.\n */\nexport function getPositionCSS( { selector, style } ) {\n\tlet output = '';\n\n\tconst { type: positionType } = style?.position || {};\n\n\tif ( ! VALID_POSITION_TYPES.includes( positionType ) ) {\n\t\treturn output;\n\t}\n\n\toutput += `${ selector } {`;\n\toutput += `position: ${ positionType };`;\n\n\tPOSITION_SIDES.forEach( ( side ) => {\n\t\tif ( style?.position?.[ side ] !== undefined ) {\n\t\t\toutput += `${ side }: ${ style.position[ side ] };`;\n\t\t}\n\t} );\n\n\tif ( positionType === 'sticky' || positionType === 'fixed' ) {\n\t\t// TODO: Replace hard-coded z-index value with a z-index preset approach in theme.json.\n\t\toutput += `z-index: 10`;\n\t}\n\toutput += `}`;\n\n\treturn output;\n}\n\n/**\n * Determines if there is sticky position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasStickyPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.sticky );\n}\n\n/**\n * Determines if there is fixed position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasFixedPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! ( true === support || support?.fixed );\n}\n\n/**\n * Determines if there is position support.\n *\n * @param {string|Object} blockType Block name or Block Type object.\n *\n * @return {boolean} Whether there is support.\n */\nexport function hasPositionSupport( blockType ) {\n\tconst support = getBlockSupport( blockType, POSITION_SUPPORT_KEY );\n\treturn !! support;\n}\n\n/**\n * Checks if there is a current value in the position block support attributes.\n *\n * @param {Object} props Block props.\n * @return {boolean} Whether or not the block has a position value set.\n */\nexport function hasPositionValue( props ) {\n\treturn props.attributes.style?.position?.type !== undefined;\n}\n\n/**\n * Checks if the block is currently set to a sticky or fixed position.\n * This check is helpful for determining how to position block toolbars or other elements.\n *\n * @param {Object} attributes Block attributes.\n * @return {boolean} Whether or not the block is set to a sticky or fixed position.\n */\nexport function hasStickyOrFixedPositionValue( attributes ) {\n\tconst positionType = attributes.style?.position?.type;\n\treturn positionType === 'sticky' || positionType === 'fixed';\n}\n\n/**\n * Resets the position block support attributes. This can be used when disabling\n * the position support controls for a block via a `ToolsPanel`.\n *\n * @param {Object} props Block props.\n * @param {Object} props.attributes Block's attributes.\n * @param {Object} props.setAttributes Function to set block's attributes.\n */\nexport function resetPosition( { attributes = {}, setAttributes } ) {\n\tconst { style = {} } = attributes;\n\n\tsetAttributes( {\n\t\tstyle: cleanEmptyObject( {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: undefined,\n\t\t\t\ttop: undefined,\n\t\t\t\tright: undefined,\n\t\t\t\tbottom: undefined,\n\t\t\t\tleft: undefined,\n\t\t\t},\n\t\t} ),\n\t} );\n}\n\n/**\n * Custom hook that checks if position settings have been disabled.\n *\n * @param {string} name The name of the block.\n *\n * @return {boolean} Whether padding setting is disabled.\n */\nexport function useIsPositionDisabled( { name: blockName } = {} ) {\n\tconst allowFixed = useSetting( 'position.fixed' );\n\tconst allowSticky = useSetting( 'position.sticky' );\n\tconst isDisabled = ! allowFixed && ! allowSticky;\n\n\treturn ! hasPositionSupport( blockName ) || isDisabled;\n}\n\n/*\n * Position controls rendered in an inspector control panel.\n *\n * @param {Object} props\n *\n * @return {WPElement} Position panel.\n */\nexport function PositionPanel( props ) {\n\tconst {\n\t\tattributes: { style = {} },\n\t\tclientId,\n\t\tname: blockName,\n\t\tsetAttributes,\n\t} = props;\n\n\tconst allowFixed = hasFixedPositionSupport( blockName );\n\tconst allowSticky = hasStickyPositionSupport( blockName );\n\tconst value = style?.position?.type;\n\n\tconst { firstParentClientId } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockParents } = select( blockEditorStore );\n\t\t\tconst parents = getBlockParents( clientId );\n\t\t\treturn { firstParentClientId: parents[ parents.length - 1 ] };\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst blockInformation = useBlockDisplayInformation( firstParentClientId );\n\tconst stickyHelpText =\n\t\tallowSticky && value === STICKY_OPTION.value && blockInformation\n\t\t\t? sprintf(\n\t\t\t\t\t/* translators: %s: the name of the parent block. */\n\t\t\t\t\t__(\n\t\t\t\t\t\t'The block will stick to the scrollable area of the parent %s block.'\n\t\t\t\t\t),\n\t\t\t\t\tblockInformation.title\n\t\t\t )\n\t\t\t: null;\n\n\tconst options = useMemo( () => {\n\t\tconst availableOptions = [ DEFAULT_OPTION ];\n\t\t// Display options if they are allowed, or if a block already has a valid value set.\n\t\t// This allows for a block to be switched off from a position type that is not allowed.\n\t\tif ( allowSticky || value === STICKY_OPTION.value ) {\n\t\t\tavailableOptions.push( STICKY_OPTION );\n\t\t}\n\t\tif ( allowFixed || value === FIXED_OPTION.value ) {\n\t\t\tavailableOptions.push( FIXED_OPTION );\n\t\t}\n\t\treturn availableOptions;\n\t}, [ allowFixed, allowSticky, value ] );\n\n\tconst onChangeType = ( next ) => {\n\t\t// For now, use a hard-coded `0px` value for the position.\n\t\t// `0px` is preferred over `0` as it can be used in `calc()` functions.\n\t\t// In the future, it could be useful to allow for an offset value.\n\t\tconst placementValue = '0px';\n\n\t\tconst newStyle = {\n\t\t\t...style,\n\t\t\tposition: {\n\t\t\t\t...style?.position,\n\t\t\t\ttype: next,\n\t\t\t\ttop:\n\t\t\t\t\tnext === 'sticky' || next === 'fixed'\n\t\t\t\t\t\t? placementValue\n\t\t\t\t\t\t: undefined,\n\t\t\t},\n\t\t};\n\n\t\tsetAttributes( {\n\t\t\tstyle: cleanEmptyObject( newStyle ),\n\t\t} );\n\t};\n\n\tconst selectedOption = value\n\t\t? options.find( ( option ) => option.value === value ) || DEFAULT_OPTION\n\t\t: DEFAULT_OPTION;\n\n\t// Only display position controls if there is at least one option to choose from.\n\treturn Platform.select( {\n\t\tweb:\n\t\t\toptions.length > 1 ? (\n\t\t\t\t<InspectorControls group=\"position\">\n\t\t\t\t\t<BaseControl\n\t\t\t\t\t\tclassName=\"block-editor-hooks__position-selection\"\n\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\thelp={ stickyHelpText }\n\t\t\t\t\t>\n\t\t\t\t\t\t<CustomSelectControl\n\t\t\t\t\t\t\t__nextUnconstrainedWidth\n\t\t\t\t\t\t\t__next36pxDefaultSize\n\t\t\t\t\t\t\tclassName=\"block-editor-hooks__position-selection__select-control\"\n\t\t\t\t\t\t\tlabel={ __( 'Position' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tdescribedBy={ sprintf(\n\t\t\t\t\t\t\t\t// translators: %s: Currently selected position.\n\t\t\t\t\t\t\t\t__( 'Currently selected position: %s' ),\n\t\t\t\t\t\t\t\tselectedOption.name\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\toptions={ options }\n\t\t\t\t\t\t\tvalue={ selectedOption }\n\t\t\t\t\t\t\t__experimentalShowSelectedHint\n\t\t\t\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\t\t\t\tonChangeType( selectedItem.value );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</BaseControl>\n\t\t\t\t</InspectorControls>\n\t\t\t) : null,\n\t\tnative: null,\n\t} );\n}\n\n/**\n * Override the default edit UI to include position controls.\n *\n * @param {Function} BlockEdit Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withInspectorControls = createHigherOrderComponent(\n\t( BlockEdit ) => ( props ) => {\n\t\tconst { name: blockName } = props;\n\t\tconst positionSupport = hasBlockSupport(\n\t\t\tblockName,\n\t\t\tPOSITION_SUPPORT_KEY\n\t\t);\n\t\tconst showPositionControls =\n\t\t\tpositionSupport && ! useIsPositionDisabled( props );\n\n\t\treturn [\n\t\t\tshowPositionControls && (\n\t\t\t\t<PositionPanel key=\"position\" { ...props } />\n\t\t\t),\n\t\t\t<BlockEdit key=\"edit\" { ...props } />,\n\t\t];\n\t},\n\t'withInspectorControls'\n);\n\n/**\n * Override the default block element to add the position styles.\n *\n * @param {Function} BlockListBlock Original component.\n *\n * @return {Function} Wrapped component.\n */\nexport const withPositionStyles = createHigherOrderComponent(\n\t( BlockListBlock ) => ( props ) => {\n\t\tconst { name, attributes } = props;\n\t\tconst hasPositionBlockSupport = hasBlockSupport(\n\t\t\tname,\n\t\t\tPOSITION_SUPPORT_KEY\n\t\t);\n\t\tconst allowPositionStyles =\n\t\t\thasPositionBlockSupport && ! useIsPositionDisabled( props );\n\n\t\tconst id = useInstanceId( BlockListBlock );\n\t\tconst element = useContext( BlockList.__unstableElementContext );\n\n\t\t// Higher specificity to override defaults in editor UI.\n\t\tconst positionSelector = `.wp-container-${ id }.wp-container-${ id }`;\n\n\t\t// Get CSS string for the current position values.\n\t\tlet css;\n\t\tif ( allowPositionStyles ) {\n\t\t\tcss =\n\t\t\t\tgetPositionCSS( {\n\t\t\t\t\tselector: positionSelector,\n\t\t\t\t\tstyle: attributes?.style,\n\t\t\t\t} ) || '';\n\t\t}\n\n\t\t// Attach a `wp-container-` id-based class name.\n\t\tconst className = classnames( props?.className, {\n\t\t\t[ `wp-container-${ id }` ]: allowPositionStyles && !! css, // Only attach a container class if there is generated CSS to be attached.\n\t\t\t[ `is-position-${ attributes?.style?.position?.type }` ]:\n\t\t\t\tallowPositionStyles &&\n\t\t\t\t!! css &&\n\t\t\t\t!! attributes?.style?.position?.type,\n\t\t} );\n\n\t\treturn (\n\t\t\t<>\n\t\t\t\t{ allowPositionStyles &&\n\t\t\t\t\telement &&\n\t\t\t\t\t!! css &&\n\t\t\t\t\tcreatePortal( <style>{ css }</style>, element ) }\n\t\t\t\t<BlockListBlock { ...props } className={ className } />\n\t\t\t</>\n\t\t);\n\t},\n\t'withPositionStyles'\n);\n\naddFilter(\n\t'editor.BlockListBlock',\n\t'core/editor/position/with-position-styles',\n\twithPositionStyles\n);\naddFilter(\n\t'editor.BlockEdit',\n\t'core/editor/position/with-inspector-controls',\n\twithInspectorControls\n);\n"]}
@@ -1,4 +1,3 @@
1
- import _extends from "@babel/runtime/helpers/esm/extends";
2
1
  import { createElement, Fragment } from "@wordpress/element";
3
2
 
4
3
  /**
@@ -316,7 +315,12 @@ export function addEditProps(settings) {
316
315
  export const withBlockControls = createHigherOrderComponent(BlockEdit => props => {
317
316
  const shouldDisplayControls = useDisplayBlockControls();
318
317
  const blockEditingMode = useBlockEditingMode();
319
- return createElement(Fragment, null, shouldDisplayControls && blockEditingMode === 'default' && createElement(Fragment, null, createElement(ColorEdit, props), createElement(TypographyPanel, props), createElement(BorderPanel, props), createElement(DimensionsPanel, props)), createElement(BlockEdit, props));
318
+ return createElement(Fragment, null, shouldDisplayControls && blockEditingMode === 'default' && createElement(Fragment, null, createElement(ColorEdit, { ...props
319
+ }), createElement(TypographyPanel, { ...props
320
+ }), createElement(BorderPanel, { ...props
321
+ }), createElement(DimensionsPanel, { ...props
322
+ })), createElement(BlockEdit, { ...props
323
+ }));
320
324
  }, 'withToolbarControls');
321
325
  /**
322
326
  * Override the default block element to include elements styles.
@@ -360,9 +364,9 @@ const withElementsStyles = createHigherOrderComponent(BlockListBlock => props =>
360
364
  dangerouslySetInnerHTML: {
361
365
  __html: styles
362
366
  }
363
- }), element), createElement(BlockListBlock, _extends({}, props, {
367
+ }), element), createElement(BlockListBlock, { ...props,
364
368
  className: props.attributes.style?.elements ? classnames(props.className, blockElementsContainerIdentifier) : props.className
365
- })));
369
+ }));
366
370
  }, 'withElementsStyles');
367
371
  addFilter('blocks.registerBlockType', 'core/style/addAttribute', addAttribute);
368
372
  addFilter('blocks.getSaveContent.extraProps', 'core/style/addSaveProps', addSaveProps);