@wordpress/block-editor 11.1.0 → 11.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (765) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +28 -4
  4. package/build/components/alignment-control/ui.js +1 -1
  5. package/build/components/alignment-control/ui.js.map +1 -1
  6. package/build/components/autocomplete/index.js +2 -7
  7. package/build/components/autocomplete/index.js.map +1 -1
  8. package/build/components/block-actions/index.js +9 -0
  9. package/build/components/block-actions/index.js.map +1 -1
  10. package/build/components/block-alignment-matrix-control/index.js +2 -2
  11. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  12. package/build/components/block-card/index.js +2 -4
  13. package/build/components/block-card/index.js.map +1 -1
  14. package/build/components/block-edit/index.js +8 -0
  15. package/build/components/block-edit/index.js.map +1 -1
  16. package/build/components/block-inspector/index.js +18 -15
  17. package/build/components/block-inspector/index.js.map +1 -1
  18. package/build/components/block-list/use-in-between-inserter.js +5 -0
  19. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  20. package/build/components/block-lock/modal.js +0 -1
  21. package/build/components/block-lock/modal.js.map +1 -1
  22. package/build/components/block-mover/mover-description.js +2 -2
  23. package/build/components/block-mover/mover-description.js.map +1 -1
  24. package/build/components/block-navigation/dropdown.js +3 -1
  25. package/build/components/block-navigation/dropdown.js.map +1 -1
  26. package/build/components/block-pattern-setup/index.js +1 -1
  27. package/build/components/block-pattern-setup/index.js.map +1 -1
  28. package/build/components/block-pattern-setup/use-patterns-setup.js +2 -2
  29. package/build/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  30. package/build/components/block-patterns-list/index.js +31 -3
  31. package/build/components/block-patterns-list/index.js.map +1 -1
  32. package/build/components/block-preview/auto.js +9 -14
  33. package/build/components/block-preview/auto.js.map +1 -1
  34. package/build/components/block-preview/index.js +32 -8
  35. package/build/components/block-preview/index.js.map +1 -1
  36. package/build/components/block-selection-clearer/index.js +1 -1
  37. package/build/components/block-selection-clearer/index.js.map +1 -1
  38. package/build/components/block-settings/container.native.js +7 -33
  39. package/build/components/block-settings/container.native.js.map +1 -1
  40. package/build/components/block-settings-menu/block-settings-dropdown.js +12 -3
  41. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  42. package/build/components/block-settings-menu-controls/index.js +2 -8
  43. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  44. package/build/components/block-styles/index.js +3 -1
  45. package/build/components/block-styles/index.js.map +1 -1
  46. package/build/components/block-switcher/utils.js +1 -1
  47. package/build/components/block-switcher/utils.js.map +1 -1
  48. package/build/components/block-tools/selected-block-popover.js +55 -47
  49. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  50. package/build/components/block-tools/use-block-toolbar-popover-props.js +43 -10
  51. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  52. package/build/components/block-vertical-alignment-control/icons.js +15 -1
  53. package/build/components/block-vertical-alignment-control/icons.js.map +1 -1
  54. package/build/components/block-vertical-alignment-control/ui.js +9 -4
  55. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  56. package/build/components/color-style-selector/index.js +3 -1
  57. package/build/components/color-style-selector/index.js.map +1 -1
  58. package/build/components/date-format-picker/index.js +3 -4
  59. package/build/components/date-format-picker/index.js.map +1 -1
  60. package/build/components/default-style-picker/index.js +1 -0
  61. package/build/components/default-style-picker/index.js.map +1 -1
  62. package/build/components/font-family/index.js +1 -7
  63. package/build/components/font-family/index.js.map +1 -1
  64. package/build/components/font-sizes/fluid-utils.js +1 -1
  65. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  66. package/build/components/font-sizes/utils.js +1 -1
  67. package/build/components/font-sizes/utils.js.map +1 -1
  68. package/build/components/font-sizes/with-font-sizes.js +5 -8
  69. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  70. package/build/components/global-styles/context.js +22 -0
  71. package/build/components/global-styles/context.js.map +1 -0
  72. package/build/components/global-styles/hooks.js +142 -0
  73. package/build/components/global-styles/hooks.js.map +1 -0
  74. package/build/components/global-styles/index.js +42 -0
  75. package/build/components/global-styles/index.js.map +1 -0
  76. package/build/components/global-styles/typography-utils.js +92 -0
  77. package/build/components/global-styles/typography-utils.js.map +1 -0
  78. package/build/components/global-styles/use-global-styles-output.js +974 -0
  79. package/build/components/global-styles/use-global-styles-output.js.map +1 -0
  80. package/build/components/global-styles/utils.js +340 -0
  81. package/build/components/global-styles/utils.js.map +1 -0
  82. package/build/components/height-control/index.js +13 -1
  83. package/build/components/height-control/index.js.map +1 -1
  84. package/build/components/iframe/index.js +37 -8
  85. package/build/components/iframe/index.js.map +1 -1
  86. package/build/components/iframe/use-compatibility-styles.js +6 -1
  87. package/build/components/iframe/use-compatibility-styles.js.map +1 -1
  88. package/build/components/image-editor/constants.js +1 -1
  89. package/build/components/image-editor/constants.js.map +1 -1
  90. package/build/components/image-editor/context.js +1 -2
  91. package/build/components/image-editor/context.js.map +1 -1
  92. package/build/components/image-editor/cropper.js +3 -1
  93. package/build/components/image-editor/cropper.js.map +1 -1
  94. package/build/components/image-editor/index.js +13 -9
  95. package/build/components/image-editor/index.js.map +1 -1
  96. package/build/components/image-editor/use-transform-image.js +11 -35
  97. package/build/components/image-editor/use-transform-image.js.map +1 -1
  98. package/build/components/image-size-control/index.js +2 -7
  99. package/build/components/image-size-control/index.js.map +1 -1
  100. package/build/components/index.js +8 -24
  101. package/build/components/index.js.map +1 -1
  102. package/build/components/inner-blocks/index.js +22 -32
  103. package/build/components/inner-blocks/index.js.map +1 -1
  104. package/build/components/inner-blocks/index.native.js +8 -23
  105. package/build/components/inner-blocks/index.native.js.map +1 -1
  106. package/build/components/inner-blocks/use-block-context.js +53 -0
  107. package/build/components/inner-blocks/use-block-context.js.map +1 -0
  108. package/build/components/inserter/block-patterns-explorer/explorer.js +0 -1
  109. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  110. package/build/components/inserter/block-patterns-tab.js +11 -5
  111. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  112. package/build/components/inserter/block-types-tab.js +2 -2
  113. package/build/components/inserter/block-types-tab.js.map +1 -1
  114. package/build/components/inserter/hooks/use-patterns-state.js +1 -7
  115. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  116. package/build/components/inserter/index.js +8 -6
  117. package/build/components/inserter/index.js.map +1 -1
  118. package/build/components/inserter/media-tab/hooks.js +142 -56
  119. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  120. package/build/components/inserter/media-tab/media-list.js +74 -21
  121. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  122. package/build/components/inserter/media-tab/media-panel.js +11 -13
  123. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  124. package/build/components/inserter/media-tab/media-tab.js +6 -3
  125. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  126. package/build/components/inserter/media-tab/utils.js +26 -15
  127. package/build/components/inserter/media-tab/utils.js.map +1 -1
  128. package/build/components/inserter/menu.js +12 -5
  129. package/build/components/inserter/menu.js.map +1 -1
  130. package/build/components/inserter/preview-panel.js +5 -3
  131. package/build/components/inserter/preview-panel.js.map +1 -1
  132. package/build/components/inserter/search-results.js +2 -7
  133. package/build/components/inserter/search-results.js.map +1 -1
  134. package/build/components/inserter-list-item/index.js +1 -9
  135. package/build/components/inserter-list-item/index.js.map +1 -1
  136. package/build/components/inspector-controls/fill.js +15 -2
  137. package/build/components/inspector-controls/fill.js.map +1 -1
  138. package/build/components/inspector-controls/fill.native.js +14 -1
  139. package/build/components/inspector-controls/fill.native.js.map +1 -1
  140. package/build/components/inspector-controls/groups.js +7 -1
  141. package/build/components/inspector-controls/groups.js.map +1 -1
  142. package/build/components/inspector-controls/index.js +2 -2
  143. package/build/components/inspector-controls/index.js.map +1 -1
  144. package/build/components/inspector-controls/slot.js +14 -1
  145. package/build/components/inspector-controls/slot.js.map +1 -1
  146. package/build/components/inspector-controls/slot.native.js +14 -1
  147. package/build/components/inspector-controls/slot.native.js.map +1 -1
  148. package/build/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  149. package/build/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  150. package/build/components/inspector-controls-tabs/index.js +2 -2
  151. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  152. package/build/components/inspector-controls-tabs/position-controls-panel.js +46 -0
  153. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -0
  154. package/build/components/inspector-controls-tabs/settings-tab.js +3 -1
  155. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  156. package/build/components/inspector-controls-tabs/styles-tab.js +6 -4
  157. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  158. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +20 -22
  159. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  160. package/build/components/justify-content-control/ui.js +8 -1
  161. package/build/components/justify-content-control/ui.js.map +1 -1
  162. package/build/components/link-control/index.js +45 -17
  163. package/build/components/link-control/index.js.map +1 -1
  164. package/build/components/link-control/search-input.js +1 -0
  165. package/build/components/link-control/search-input.js.map +1 -1
  166. package/build/components/list-view/block.js +1 -1
  167. package/build/components/list-view/block.js.map +1 -1
  168. package/build/components/list-view/use-list-view-drop-zone.js +1 -1
  169. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  170. package/build/components/media-upload/index.native.js +4 -1
  171. package/build/components/media-upload/index.native.js.map +1 -1
  172. package/build/components/off-canvas-editor/appender.js +49 -38
  173. package/build/components/off-canvas-editor/appender.js.map +1 -1
  174. package/build/components/off-canvas-editor/block-contents.js +38 -5
  175. package/build/components/off-canvas-editor/block-contents.js.map +1 -1
  176. package/build/components/off-canvas-editor/block-select-button.js +10 -4
  177. package/build/components/off-canvas-editor/block-select-button.js.map +1 -1
  178. package/build/components/off-canvas-editor/block.js +13 -52
  179. package/build/components/off-canvas-editor/block.js.map +1 -1
  180. package/build/components/off-canvas-editor/branch.js +25 -10
  181. package/build/components/off-canvas-editor/branch.js.map +1 -1
  182. package/build/components/off-canvas-editor/index.js +15 -17
  183. package/build/components/off-canvas-editor/index.js.map +1 -1
  184. package/build/components/off-canvas-editor/link-ui.js +2 -2
  185. package/build/components/off-canvas-editor/link-ui.js.map +1 -1
  186. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
  187. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -1
  188. package/build/components/provider/index.js +22 -8
  189. package/build/components/provider/index.js.map +1 -1
  190. package/build/components/provider/index.native.js +5 -6
  191. package/build/components/provider/index.native.js.map +1 -1
  192. package/build/components/rich-text/use-before-input-rules.js +11 -3
  193. package/build/components/rich-text/use-before-input-rules.js.map +1 -1
  194. package/build/components/rich-text/use-enter.js +4 -5
  195. package/build/components/rich-text/use-enter.js.map +1 -1
  196. package/build/components/rich-text/utils.js +1 -1
  197. package/build/components/rich-text/utils.js.map +1 -1
  198. package/build/components/spacing-sizes-control/utils.js +2 -8
  199. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  200. package/build/components/tool-selector/index.js +3 -1
  201. package/build/components/tool-selector/index.js.map +1 -1
  202. package/build/components/url-input/button.js +1 -0
  203. package/build/components/url-input/button.js.map +1 -1
  204. package/build/components/url-input/index.js +15 -1
  205. package/build/components/url-input/index.js.map +1 -1
  206. package/build/components/url-popover/image-url-input-ui.js +7 -8
  207. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  208. package/build/components/url-popover/link-editor.js +1 -0
  209. package/build/components/url-popover/link-editor.js.map +1 -1
  210. package/build/components/use-block-display-information/index.js +1 -1
  211. package/build/components/use-block-display-information/index.js.map +1 -1
  212. package/build/components/use-paste-styles/index.js +188 -0
  213. package/build/components/use-paste-styles/index.js.map +1 -0
  214. package/build/components/writing-flow/use-arrow-nav.js +22 -29
  215. package/build/components/writing-flow/use-arrow-nav.js.map +1 -1
  216. package/build/experiments.js +45 -0
  217. package/build/experiments.js.map +1 -0
  218. package/build/experiments.native.js +40 -0
  219. package/build/experiments.native.js.map +1 -0
  220. package/build/hooks/anchor.js +2 -1
  221. package/build/hooks/anchor.js.map +1 -1
  222. package/build/hooks/border.js +1 -1
  223. package/build/hooks/border.js.map +1 -1
  224. package/build/hooks/child-layout.js +5 -1
  225. package/build/hooks/child-layout.js.map +1 -1
  226. package/build/hooks/color-panel.js +1 -1
  227. package/build/hooks/color-panel.js.map +1 -1
  228. package/build/hooks/color.js +3 -3
  229. package/build/hooks/color.js.map +1 -1
  230. package/build/hooks/custom-class-name.js +2 -1
  231. package/build/hooks/custom-class-name.js.map +1 -1
  232. package/build/hooks/dimensions.js +7 -5
  233. package/build/hooks/dimensions.js.map +1 -1
  234. package/build/hooks/index.js +2 -0
  235. package/build/hooks/index.js.map +1 -1
  236. package/build/hooks/margin.js +1 -0
  237. package/build/hooks/margin.js.map +1 -1
  238. package/build/hooks/metadata.js +1 -1
  239. package/build/hooks/metadata.js.map +1 -1
  240. package/build/hooks/padding.js +1 -0
  241. package/build/hooks/padding.js.map +1 -1
  242. package/build/hooks/position.js +395 -0
  243. package/build/hooks/position.js.map +1 -0
  244. package/build/hooks/supports.js +328 -0
  245. package/build/hooks/supports.js.map +1 -0
  246. package/build/hooks/typography.js +1 -1
  247. package/build/hooks/typography.js.map +1 -1
  248. package/build/hooks/use-color-props.js +3 -3
  249. package/build/hooks/use-color-props.js.map +1 -1
  250. package/build/hooks/utils.js +69 -3
  251. package/build/hooks/utils.js.map +1 -1
  252. package/build/index.js +10 -1
  253. package/build/index.js.map +1 -1
  254. package/build/layouts/constrained.js +3 -0
  255. package/build/layouts/constrained.js.map +1 -1
  256. package/build/layouts/flex.js +59 -9
  257. package/build/layouts/flex.js.map +1 -1
  258. package/build/layouts/flow.js +0 -18
  259. package/build/layouts/flow.js.map +1 -1
  260. package/build/store/actions.js +3 -30
  261. package/build/store/actions.js.map +1 -1
  262. package/build/store/defaults.js +5 -2
  263. package/build/store/defaults.js.map +1 -1
  264. package/build/store/index.js +11 -2
  265. package/build/store/index.js.map +1 -1
  266. package/build/store/private-actions.js +78 -0
  267. package/build/store/private-actions.js.map +1 -0
  268. package/build/store/private-selectors.js +18 -0
  269. package/build/store/private-selectors.js.map +1 -0
  270. package/build/store/reducer.js +7 -3
  271. package/build/store/reducer.js.map +1 -1
  272. package/build/store/selectors.js +68 -40
  273. package/build/store/selectors.js.map +1 -1
  274. package/build/utils/block-variation-transforms.js +1 -1
  275. package/build/utils/block-variation-transforms.js.map +1 -1
  276. package/build/utils/parse-css-unit-to-px.js +1 -1
  277. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  278. package/build/utils/transform-styles/index.js +1 -7
  279. package/build/utils/transform-styles/index.js.map +1 -1
  280. package/build-module/components/alignment-control/ui.js +1 -1
  281. package/build-module/components/alignment-control/ui.js.map +1 -1
  282. package/build-module/components/autocomplete/index.js +2 -6
  283. package/build-module/components/autocomplete/index.js.map +1 -1
  284. package/build-module/components/block-actions/index.js +6 -0
  285. package/build-module/components/block-actions/index.js.map +1 -1
  286. package/build-module/components/block-alignment-matrix-control/index.js +2 -2
  287. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  288. package/build-module/components/block-card/index.js +2 -4
  289. package/build-module/components/block-card/index.js.map +1 -1
  290. package/build-module/components/block-edit/index.js +7 -0
  291. package/build-module/components/block-edit/index.js.map +1 -1
  292. package/build-module/components/block-inspector/index.js +17 -15
  293. package/build-module/components/block-inspector/index.js.map +1 -1
  294. package/build-module/components/block-list/use-in-between-inserter.js +5 -0
  295. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  296. package/build-module/components/block-lock/modal.js +0 -1
  297. package/build-module/components/block-lock/modal.js.map +1 -1
  298. package/build-module/components/block-mover/mover-description.js +2 -2
  299. package/build-module/components/block-mover/mover-description.js.map +1 -1
  300. package/build-module/components/block-navigation/dropdown.js +3 -1
  301. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  302. package/build-module/components/block-pattern-setup/index.js +1 -1
  303. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  304. package/build-module/components/block-pattern-setup/use-patterns-setup.js +2 -2
  305. package/build-module/components/block-pattern-setup/use-patterns-setup.js.map +1 -1
  306. package/build-module/components/block-patterns-list/index.js +32 -3
  307. package/build-module/components/block-patterns-list/index.js.map +1 -1
  308. package/build-module/components/block-preview/auto.js +9 -14
  309. package/build-module/components/block-preview/auto.js.map +1 -1
  310. package/build-module/components/block-preview/index.js +31 -8
  311. package/build-module/components/block-preview/index.js.map +1 -1
  312. package/build-module/components/block-selection-clearer/index.js +1 -1
  313. package/build-module/components/block-selection-clearer/index.js.map +1 -1
  314. package/build-module/components/block-settings/container.native.js +6 -30
  315. package/build-module/components/block-settings/container.native.js.map +1 -1
  316. package/build-module/components/block-settings-menu/block-settings-dropdown.js +12 -3
  317. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  318. package/build-module/components/block-settings-menu-controls/index.js +2 -7
  319. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  320. package/build-module/components/block-styles/index.js +2 -1
  321. package/build-module/components/block-styles/index.js.map +1 -1
  322. package/build-module/components/block-switcher/utils.js +1 -1
  323. package/build-module/components/block-switcher/utils.js.map +1 -1
  324. package/build-module/components/block-tools/selected-block-popover.js +55 -48
  325. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  326. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +42 -11
  327. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  328. package/build-module/components/block-vertical-alignment-control/icons.js +12 -0
  329. package/build-module/components/block-vertical-alignment-control/icons.js.map +1 -1
  330. package/build-module/components/block-vertical-alignment-control/ui.js +10 -5
  331. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  332. package/build-module/components/color-style-selector/index.js +3 -1
  333. package/build-module/components/color-style-selector/index.js.map +1 -1
  334. package/build-module/components/date-format-picker/index.js +4 -5
  335. package/build-module/components/date-format-picker/index.js.map +1 -1
  336. package/build-module/components/default-style-picker/index.js +1 -0
  337. package/build-module/components/default-style-picker/index.js.map +1 -1
  338. package/build-module/components/font-family/index.js +1 -6
  339. package/build-module/components/font-family/index.js.map +1 -1
  340. package/build-module/components/font-sizes/fluid-utils.js +1 -1
  341. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  342. package/build-module/components/font-sizes/utils.js +1 -1
  343. package/build-module/components/font-sizes/utils.js.map +1 -1
  344. package/build-module/components/font-sizes/with-font-sizes.js +5 -7
  345. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  346. package/build-module/components/global-styles/context.js +12 -0
  347. package/build-module/components/global-styles/context.js.map +1 -0
  348. package/build-module/components/global-styles/hooks.js +121 -0
  349. package/build-module/components/global-styles/hooks.js.map +1 -0
  350. package/build-module/components/global-styles/index.js +4 -0
  351. package/build-module/components/global-styles/index.js.map +1 -0
  352. package/build-module/components/global-styles/typography-utils.js +84 -0
  353. package/build-module/components/global-styles/typography-utils.js.map +1 -0
  354. package/build-module/components/global-styles/use-global-styles-output.js +930 -0
  355. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -0
  356. package/build-module/components/global-styles/utils.js +321 -0
  357. package/build-module/components/global-styles/utils.js.map +1 -0
  358. package/build-module/components/height-control/index.js +14 -1
  359. package/build-module/components/height-control/index.js.map +1 -1
  360. package/build-module/components/iframe/index.js +36 -9
  361. package/build-module/components/iframe/index.js.map +1 -1
  362. package/build-module/components/iframe/use-compatibility-styles.js +6 -1
  363. package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
  364. package/build-module/components/image-editor/constants.js +1 -1
  365. package/build-module/components/image-editor/constants.js.map +1 -1
  366. package/build-module/components/image-editor/context.js +1 -2
  367. package/build-module/components/image-editor/context.js.map +1 -1
  368. package/build-module/components/image-editor/cropper.js +3 -1
  369. package/build-module/components/image-editor/cropper.js.map +1 -1
  370. package/build-module/components/image-editor/index.js +13 -3
  371. package/build-module/components/image-editor/index.js.map +1 -1
  372. package/build-module/components/image-editor/use-transform-image.js +12 -37
  373. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  374. package/build-module/components/image-size-control/index.js +2 -6
  375. package/build-module/components/image-size-control/index.js.map +1 -1
  376. package/build-module/components/index.js +2 -3
  377. package/build-module/components/index.js.map +1 -1
  378. package/build-module/components/inner-blocks/index.js +21 -32
  379. package/build-module/components/inner-blocks/index.js.map +1 -1
  380. package/build-module/components/inner-blocks/index.native.js +9 -22
  381. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  382. package/build-module/components/inner-blocks/use-block-context.js +43 -0
  383. package/build-module/components/inner-blocks/use-block-context.js.map +1 -0
  384. package/build-module/components/inserter/block-patterns-explorer/explorer.js +0 -1
  385. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  386. package/build-module/components/inserter/block-patterns-tab.js +11 -5
  387. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  388. package/build-module/components/inserter/block-types-tab.js +3 -3
  389. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  390. package/build-module/components/inserter/hooks/use-patterns-state.js +1 -6
  391. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  392. package/build-module/components/inserter/index.js +8 -6
  393. package/build-module/components/inserter/index.js.map +1 -1
  394. package/build-module/components/inserter/media-tab/hooks.js +145 -56
  395. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  396. package/build-module/components/inserter/media-tab/media-list.js +74 -24
  397. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  398. package/build-module/components/inserter/media-tab/media-panel.js +14 -14
  399. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  400. package/build-module/components/inserter/media-tab/media-tab.js +7 -4
  401. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  402. package/build-module/components/inserter/media-tab/utils.js +27 -15
  403. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  404. package/build-module/components/inserter/menu.js +12 -5
  405. package/build-module/components/inserter/menu.js.map +1 -1
  406. package/build-module/components/inserter/preview-panel.js +5 -3
  407. package/build-module/components/inserter/preview-panel.js.map +1 -1
  408. package/build-module/components/inserter/search-results.js +2 -6
  409. package/build-module/components/inserter/search-results.js.map +1 -1
  410. package/build-module/components/inserter-list-item/index.js +1 -9
  411. package/build-module/components/inserter-list-item/index.js.map +1 -1
  412. package/build-module/components/inspector-controls/fill.js +14 -2
  413. package/build-module/components/inspector-controls/fill.js.map +1 -1
  414. package/build-module/components/inspector-controls/fill.native.js +13 -1
  415. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  416. package/build-module/components/inspector-controls/groups.js +7 -1
  417. package/build-module/components/inspector-controls/groups.js.map +1 -1
  418. package/build-module/components/inspector-controls/index.js +2 -2
  419. package/build-module/components/inspector-controls/index.js.map +1 -1
  420. package/build-module/components/inspector-controls/slot.js +13 -1
  421. package/build-module/components/inspector-controls/slot.js.map +1 -1
  422. package/build-module/components/inspector-controls/slot.native.js +13 -1
  423. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  424. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  425. package/build-module/components/inspector-controls-tabs/advanced-controls-panel.js.map +1 -1
  426. package/build-module/components/inspector-controls-tabs/index.js +2 -2
  427. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  428. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +33 -0
  429. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -0
  430. package/build-module/components/inspector-controls-tabs/settings-tab.js +2 -1
  431. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  432. package/build-module/components/inspector-controls-tabs/styles-tab.js +6 -4
  433. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  434. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +20 -22
  435. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  436. package/build-module/components/justify-content-control/ui.js +9 -2
  437. package/build-module/components/justify-content-control/ui.js.map +1 -1
  438. package/build-module/components/link-control/index.js +45 -16
  439. package/build-module/components/link-control/index.js.map +1 -1
  440. package/build-module/components/link-control/search-input.js +1 -0
  441. package/build-module/components/link-control/search-input.js.map +1 -1
  442. package/build-module/components/list-view/block.js +1 -1
  443. package/build-module/components/list-view/block.js.map +1 -1
  444. package/build-module/components/list-view/use-list-view-drop-zone.js +1 -1
  445. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  446. package/build-module/components/media-upload/index.native.js +4 -1
  447. package/build-module/components/media-upload/index.native.js.map +1 -1
  448. package/build-module/components/off-canvas-editor/appender.js +46 -36
  449. package/build-module/components/off-canvas-editor/appender.js.map +1 -1
  450. package/build-module/components/off-canvas-editor/block-contents.js +37 -7
  451. package/build-module/components/off-canvas-editor/block-contents.js.map +1 -1
  452. package/build-module/components/off-canvas-editor/block-select-button.js +9 -4
  453. package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -1
  454. package/build-module/components/off-canvas-editor/block.js +15 -52
  455. package/build-module/components/off-canvas-editor/block.js.map +1 -1
  456. package/build-module/components/off-canvas-editor/branch.js +23 -11
  457. package/build-module/components/off-canvas-editor/branch.js.map +1 -1
  458. package/build-module/components/off-canvas-editor/index.js +15 -16
  459. package/build-module/components/off-canvas-editor/index.js.map +1 -1
  460. package/build-module/components/off-canvas-editor/link-ui.js +2 -2
  461. package/build-module/components/off-canvas-editor/link-ui.js.map +1 -1
  462. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
  463. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -1
  464. package/build-module/components/provider/index.js +17 -8
  465. package/build-module/components/provider/index.js.map +1 -1
  466. package/build-module/components/provider/index.native.js +4 -4
  467. package/build-module/components/provider/index.native.js.map +1 -1
  468. package/build-module/components/rich-text/use-before-input-rules.js +10 -2
  469. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
  470. package/build-module/components/rich-text/use-enter.js +4 -5
  471. package/build-module/components/rich-text/use-enter.js.map +1 -1
  472. package/build-module/components/rich-text/utils.js +1 -1
  473. package/build-module/components/rich-text/utils.js.map +1 -1
  474. package/build-module/components/spacing-sizes-control/utils.js +2 -7
  475. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  476. package/build-module/components/tool-selector/index.js +3 -1
  477. package/build-module/components/tool-selector/index.js.map +1 -1
  478. package/build-module/components/url-input/button.js +1 -0
  479. package/build-module/components/url-input/button.js.map +1 -1
  480. package/build-module/components/url-input/index.js +14 -1
  481. package/build-module/components/url-input/index.js.map +1 -1
  482. package/build-module/components/url-popover/image-url-input-ui.js +8 -8
  483. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  484. package/build-module/components/url-popover/link-editor.js +1 -0
  485. package/build-module/components/url-popover/link-editor.js.map +1 -1
  486. package/build-module/components/use-block-display-information/index.js +1 -1
  487. package/build-module/components/use-block-display-information/index.js.map +1 -1
  488. package/build-module/components/use-paste-styles/index.js +174 -0
  489. package/build-module/components/use-paste-styles/index.js.map +1 -0
  490. package/build-module/components/writing-flow/use-arrow-nav.js +22 -29
  491. package/build-module/components/writing-flow/use-arrow-nav.js.map +1 -1
  492. package/build-module/experiments.js +25 -0
  493. package/build-module/experiments.js.map +1 -0
  494. package/build-module/experiments.native.js +23 -0
  495. package/build-module/experiments.native.js.map +1 -0
  496. package/build-module/hooks/anchor.js +2 -1
  497. package/build-module/hooks/anchor.js.map +1 -1
  498. package/build-module/hooks/border.js +1 -1
  499. package/build-module/hooks/border.js.map +1 -1
  500. package/build-module/hooks/child-layout.js +5 -1
  501. package/build-module/hooks/child-layout.js.map +1 -1
  502. package/build-module/hooks/color-panel.js +1 -1
  503. package/build-module/hooks/color-panel.js.map +1 -1
  504. package/build-module/hooks/color.js +3 -3
  505. package/build-module/hooks/color.js.map +1 -1
  506. package/build-module/hooks/custom-class-name.js +2 -1
  507. package/build-module/hooks/custom-class-name.js.map +1 -1
  508. package/build-module/hooks/dimensions.js +6 -5
  509. package/build-module/hooks/dimensions.js.map +1 -1
  510. package/build-module/hooks/index.js +1 -0
  511. package/build-module/hooks/index.js.map +1 -1
  512. package/build-module/hooks/margin.js +1 -0
  513. package/build-module/hooks/margin.js.map +1 -1
  514. package/build-module/hooks/metadata.js +1 -1
  515. package/build-module/hooks/metadata.js.map +1 -1
  516. package/build-module/hooks/padding.js +1 -0
  517. package/build-module/hooks/padding.js.map +1 -1
  518. package/build-module/hooks/position.js +354 -0
  519. package/build-module/hooks/position.js.map +1 -0
  520. package/build-module/hooks/supports.js +257 -0
  521. package/build-module/hooks/supports.js.map +1 -0
  522. package/build-module/hooks/typography.js +1 -1
  523. package/build-module/hooks/typography.js.map +1 -1
  524. package/build-module/hooks/use-color-props.js +3 -3
  525. package/build-module/hooks/use-color-props.js.map +1 -1
  526. package/build-module/hooks/utils.js +70 -4
  527. package/build-module/hooks/utils.js.map +1 -1
  528. package/build-module/index.js +1 -0
  529. package/build-module/index.js.map +1 -1
  530. package/build-module/layouts/constrained.js +3 -0
  531. package/build-module/layouts/constrained.js.map +1 -1
  532. package/build-module/layouts/flex.js +60 -10
  533. package/build-module/layouts/flex.js.map +1 -1
  534. package/build-module/layouts/flow.js +0 -18
  535. package/build-module/layouts/flow.js.map +1 -1
  536. package/build-module/store/actions.js +2 -26
  537. package/build-module/store/actions.js.map +1 -1
  538. package/build-module/store/defaults.js +5 -2
  539. package/build-module/store/defaults.js.map +1 -1
  540. package/build-module/store/index.js +8 -2
  541. package/build-module/store/index.js.map +1 -1
  542. package/build-module/store/private-actions.js +66 -0
  543. package/build-module/store/private-actions.js.map +1 -0
  544. package/build-module/store/private-selectors.js +11 -0
  545. package/build-module/store/private-selectors.js.map +1 -0
  546. package/build-module/store/reducer.js +7 -3
  547. package/build-module/store/reducer.js.map +1 -1
  548. package/build-module/store/selectors.js +55 -30
  549. package/build-module/store/selectors.js.map +1 -1
  550. package/build-module/utils/block-variation-transforms.js +1 -1
  551. package/build-module/utils/block-variation-transforms.js.map +1 -1
  552. package/build-module/utils/parse-css-unit-to-px.js +1 -1
  553. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  554. package/build-module/utils/transform-styles/index.js +1 -6
  555. package/build-module/utils/transform-styles/index.js.map +1 -1
  556. package/build-style/content-rtl.css +340 -3
  557. package/build-style/content.css +340 -3
  558. package/build-style/style-rtl.css +125 -272
  559. package/build-style/style.css +125 -272
  560. package/package.json +30 -29
  561. package/src/components/alignment-control/test/__snapshots__/index.js.snap +3 -3
  562. package/src/components/alignment-control/test/index.js +5 -15
  563. package/src/components/alignment-control/ui.js +1 -1
  564. package/src/components/autocomplete/index.js +3 -6
  565. package/src/components/block-actions/index.js +5 -0
  566. package/src/components/block-alignment-control/test/index.js +3 -11
  567. package/src/components/block-alignment-matrix-control/index.js +1 -2
  568. package/src/components/block-card/index.js +1 -4
  569. package/src/components/block-content-overlay/content.scss +4 -4
  570. package/src/components/block-edit/index.js +15 -1
  571. package/src/components/block-icon/content.scss +31 -0
  572. package/src/components/block-inspector/index.js +15 -17
  573. package/src/components/block-list/use-in-between-inserter.js +5 -0
  574. package/src/components/block-lock/modal.js +0 -1
  575. package/src/components/block-mover/mover-description.js +2 -2
  576. package/src/components/block-mover/stories/index.js +3 -3
  577. package/src/components/block-navigation/dropdown.js +1 -1
  578. package/src/components/block-pattern-setup/index.js +1 -4
  579. package/src/components/block-pattern-setup/use-patterns-setup.js +2 -5
  580. package/src/components/block-patterns-list/index.js +29 -3
  581. package/src/components/block-preview/README.md +9 -9
  582. package/src/components/block-preview/auto.js +10 -14
  583. package/src/components/block-preview/content.scss +23 -0
  584. package/src/components/block-preview/index.js +40 -10
  585. package/src/components/block-preview/style.scss +0 -23
  586. package/src/components/block-selection-clearer/index.js +1 -1
  587. package/src/components/block-selection-clearer/test/index.js +6 -6
  588. package/src/components/block-settings/container.native.js +7 -26
  589. package/src/components/block-settings-menu/block-settings-dropdown.js +14 -2
  590. package/src/components/block-settings-menu-controls/index.js +2 -10
  591. package/src/components/block-styles/index.js +4 -1
  592. package/src/components/block-switcher/test/index.js +43 -44
  593. package/src/components/block-switcher/utils.js +1 -1
  594. package/src/components/block-tools/selected-block-popover.js +77 -80
  595. package/src/components/block-tools/style.scss +0 -1
  596. package/src/components/block-tools/use-block-toolbar-popover-props.js +68 -12
  597. package/src/components/block-variation-picker/{style.scss → content.scss} +0 -0
  598. package/src/components/block-vertical-alignment-control/icons.js +12 -0
  599. package/src/components/block-vertical-alignment-control/test/index.js +3 -11
  600. package/src/components/block-vertical-alignment-control/ui.js +16 -6
  601. package/src/components/button-block-appender/{style.scss → content.scss} +0 -0
  602. package/src/components/color-style-selector/index.js +1 -1
  603. package/src/components/colors/test/with-colors.js +2 -8
  604. package/src/components/date-format-picker/index.js +23 -24
  605. package/src/components/date-format-picker/style.scss +0 -6
  606. package/src/components/default-block-appender/content.scss +18 -0
  607. package/src/components/default-block-appender/test/index.js +2 -8
  608. package/src/components/default-style-picker/index.js +1 -0
  609. package/src/components/font-family/index.js +1 -6
  610. package/src/components/font-sizes/fluid-utils.js +1 -1
  611. package/src/components/font-sizes/utils.js +1 -1
  612. package/src/components/font-sizes/with-font-sizes.js +33 -33
  613. package/src/components/global-styles/README.md +77 -0
  614. package/src/components/global-styles/context.js +15 -0
  615. package/src/components/global-styles/hooks.js +145 -0
  616. package/src/components/global-styles/index.js +7 -0
  617. package/src/components/global-styles/test/typography-utils.js +393 -0
  618. package/src/components/global-styles/test/use-global-styles-output.js +814 -0
  619. package/src/components/global-styles/test/utils.js +206 -0
  620. package/src/components/global-styles/typography-utils.js +87 -0
  621. package/src/components/global-styles/use-global-styles-output.js +1088 -0
  622. package/src/components/global-styles/utils.js +373 -0
  623. package/src/components/height-control/README.md +55 -0
  624. package/src/components/height-control/index.js +13 -1
  625. package/src/components/iframe/index.js +52 -19
  626. package/src/components/iframe/use-compatibility-styles.js +6 -0
  627. package/src/components/image-editor/constants.js +1 -1
  628. package/src/components/image-editor/context.js +5 -9
  629. package/src/components/image-editor/cropper.js +3 -1
  630. package/src/components/image-editor/index.js +13 -4
  631. package/src/components/image-editor/use-transform-image.js +14 -55
  632. package/src/components/image-size-control/index.js +2 -6
  633. package/src/components/index.js +2 -6
  634. package/src/components/inner-blocks/index.js +29 -33
  635. package/src/components/inner-blocks/index.native.js +27 -47
  636. package/src/components/inner-blocks/use-block-context.js +47 -0
  637. package/src/components/inserter/block-patterns-explorer/explorer.js +0 -1
  638. package/src/components/inserter/block-patterns-tab.js +14 -4
  639. package/src/components/inserter/block-types-tab.js +3 -4
  640. package/src/components/inserter/hooks/use-patterns-state.js +1 -6
  641. package/src/components/inserter/index.js +46 -42
  642. package/src/components/inserter/media-tab/hooks.js +167 -65
  643. package/src/components/inserter/media-tab/media-list.js +94 -26
  644. package/src/components/inserter/media-tab/media-panel.js +9 -20
  645. package/src/components/inserter/media-tab/media-tab.js +12 -4
  646. package/src/components/inserter/media-tab/utils.js +20 -10
  647. package/src/components/inserter/menu.js +9 -4
  648. package/src/components/inserter/preview-panel.js +4 -2
  649. package/src/components/inserter/search-results.js +2 -6
  650. package/src/components/inserter/stories/index.js +9 -9
  651. package/src/components/inserter/style.scss +58 -11
  652. package/src/components/inserter/test/__snapshots__/index.native.js.snap +117 -0
  653. package/src/components/inserter/test/index.native.js +255 -1
  654. package/src/components/inserter-list-item/index.js +0 -7
  655. package/src/components/inspector-controls/README.md +3 -7
  656. package/src/components/inspector-controls/fill.js +15 -1
  657. package/src/components/inspector-controls/fill.native.js +14 -1
  658. package/src/components/inspector-controls/groups.js +5 -0
  659. package/src/components/inspector-controls/index.js +2 -6
  660. package/src/components/inspector-controls/slot.js +14 -1
  661. package/src/components/inspector-controls/slot.native.js +14 -1
  662. package/src/components/inspector-controls-tabs/advanced-controls-panel.js +1 -1
  663. package/src/components/inspector-controls-tabs/index.js +2 -4
  664. package/src/components/inspector-controls-tabs/position-controls-panel.js +37 -0
  665. package/src/components/inspector-controls-tabs/settings-tab.js +2 -0
  666. package/src/components/inspector-controls-tabs/style.scss +15 -0
  667. package/src/components/inspector-controls-tabs/styles-tab.js +5 -7
  668. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +24 -18
  669. package/src/components/justify-content-control/ui.js +9 -0
  670. package/src/components/link-control/index.js +59 -23
  671. package/src/components/link-control/search-input.js +1 -0
  672. package/src/components/link-control/style.scss +8 -24
  673. package/src/components/link-control/test/index.js +134 -5
  674. package/src/components/list-view/block.js +1 -1
  675. package/src/components/list-view/style.scss +13 -3
  676. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  677. package/src/components/media-replace-flow/test/index.js +4 -12
  678. package/src/components/media-upload/index.native.js +2 -2
  679. package/src/components/off-canvas-editor/README.md +2 -2
  680. package/src/components/off-canvas-editor/appender.js +82 -76
  681. package/src/components/off-canvas-editor/block-contents.js +84 -23
  682. package/src/components/off-canvas-editor/block-select-button.js +12 -1
  683. package/src/components/off-canvas-editor/block.js +31 -102
  684. package/src/components/off-canvas-editor/branch.js +32 -5
  685. package/src/components/off-canvas-editor/index.js +19 -24
  686. package/src/components/off-canvas-editor/link-ui.js +2 -2
  687. package/src/components/off-canvas-editor/style.scss +5 -1
  688. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +1 -1
  689. package/src/components/provider/index.js +33 -11
  690. package/src/components/provider/index.native.js +4 -3
  691. package/src/components/provider/test/experimental-provider.js +94 -0
  692. package/src/components/provider/test/use-block-sync.js +10 -0
  693. package/src/components/responsive-block-control/test/index.js +1 -5
  694. package/src/components/rich-text/use-before-input-rules.js +10 -2
  695. package/src/components/rich-text/use-enter.js +4 -4
  696. package/src/components/rich-text/utils.js +1 -1
  697. package/src/components/spacing-sizes-control/utils.js +2 -7
  698. package/src/components/tool-selector/index.js +1 -1
  699. package/src/components/url-input/README.md +5 -0
  700. package/src/components/url-input/button.js +1 -0
  701. package/src/components/url-input/index.js +15 -1
  702. package/src/components/url-input/test/button.js +24 -24
  703. package/src/components/url-popover/image-url-input-ui.js +7 -8
  704. package/src/components/url-popover/link-editor.js +1 -0
  705. package/src/components/url-popover/style.scss +0 -10
  706. package/src/components/use-block-display-information/index.js +1 -1
  707. package/src/components/use-paste-styles/index.js +230 -0
  708. package/src/components/warning/{style.scss → content.scss} +0 -0
  709. package/src/components/warning/test/index.js +1 -5
  710. package/src/components/writing-flow/use-arrow-nav.js +20 -28
  711. package/src/content.scss +8 -0
  712. package/src/experiments.js +27 -0
  713. package/src/experiments.native.js +25 -0
  714. package/src/hooks/anchor.js +2 -1
  715. package/src/hooks/border.js +1 -1
  716. package/src/hooks/child-layout.js +6 -1
  717. package/src/hooks/color-panel.js +1 -1
  718. package/src/hooks/color.js +3 -3
  719. package/src/hooks/custom-class-name.js +2 -1
  720. package/src/hooks/dimensions.js +6 -6
  721. package/src/hooks/index.js +1 -0
  722. package/src/hooks/layout.scss +4 -0
  723. package/src/hooks/margin.js +1 -0
  724. package/src/hooks/metadata.js +1 -2
  725. package/src/hooks/padding.js +1 -0
  726. package/src/hooks/position.js +391 -0
  727. package/src/hooks/position.scss +18 -0
  728. package/src/hooks/supports.js +302 -0
  729. package/src/hooks/test/__snapshots__/align.native.js.snap +73 -0
  730. package/src/hooks/test/align.native.js +133 -0
  731. package/src/hooks/test/utils.js +104 -0
  732. package/src/hooks/typography.js +1 -1
  733. package/src/hooks/use-color-props.js +3 -3
  734. package/src/hooks/utils.js +68 -2
  735. package/src/index.js +1 -0
  736. package/src/layouts/constrained.js +3 -0
  737. package/src/layouts/flex.js +66 -14
  738. package/src/layouts/flow.js +0 -9
  739. package/src/store/actions.js +2 -26
  740. package/src/store/defaults.js +7 -2
  741. package/src/store/index.js +8 -2
  742. package/src/store/private-actions.js +65 -0
  743. package/src/store/private-selectors.js +10 -0
  744. package/src/store/reducer.js +8 -3
  745. package/src/store/selectors.js +108 -57
  746. package/src/store/test/actions.js +0 -18
  747. package/src/store/test/private-actions.js +22 -0
  748. package/src/store/test/private-selectors.js +24 -0
  749. package/src/store/test/reducer.js +45 -3
  750. package/src/store/test/selectors.js +64 -39
  751. package/src/style.scss +5 -6
  752. package/src/utils/block-variation-transforms.js +1 -1
  753. package/src/utils/parse-css-unit-to-px.js +3 -1
  754. package/src/utils/test/parse-css-unit-to-px.js +16 -24
  755. package/src/utils/transform-styles/index.js +1 -6
  756. package/build/components/inner-blocks/get-block-context.js +0 -45
  757. package/build/components/inner-blocks/get-block-context.js.map +0 -1
  758. package/build/components/off-canvas-editor/block-edit-button.js +0 -50
  759. package/build/components/off-canvas-editor/block-edit-button.js.map +0 -1
  760. package/build-module/components/inner-blocks/get-block-context.js +0 -37
  761. package/build-module/components/inner-blocks/get-block-context.js.map +0 -1
  762. package/build-module/components/off-canvas-editor/block-edit-button.js +0 -35
  763. package/build-module/components/off-canvas-editor/block-edit-button.js.map +0 -1
  764. package/src/components/inner-blocks/get-block-context.js +0 -39
  765. package/src/components/off-canvas-editor/block-edit-button.js +0 -27
@@ -33,6 +33,8 @@ var _useBlockToolbarPopoverProps = _interopRequireDefault(require("./use-block-t
33
33
 
34
34
  var _inserter = _interopRequireDefault(require("../inserter"));
35
35
 
36
+ var _experiments = require("../../experiments");
37
+
36
38
  /**
37
39
  * External dependencies
38
40
  */
@@ -50,12 +52,13 @@ function selector(select) {
50
52
  isMultiSelecting,
51
53
  hasMultiSelection,
52
54
  isTyping,
53
- __experimentalIsBlockInterfaceHidden: isBlockInterfaceHidden,
55
+ isBlockInterfaceHidden,
54
56
  getSettings,
55
57
  getLastMultiSelectedBlockClientId
56
- } = select(_store.store);
58
+ } = (0, _experiments.unlock)(select(_store.store));
57
59
  return {
58
60
  editorMode: __unstableGetEditorMode(),
61
+ hasMultiSelection: hasMultiSelection(),
59
62
  isMultiSelecting: isMultiSelecting(),
60
63
  isTyping: isTyping(),
61
64
  isBlockInterfaceHidden: isBlockInterfaceHidden(),
@@ -78,6 +81,7 @@ function SelectedBlockPopover(_ref) {
78
81
  } = _ref;
79
82
  const {
80
83
  editorMode,
84
+ hasMultiSelection,
81
85
  isMultiSelecting,
82
86
  isTyping,
83
87
  isBlockInterfaceHidden,
@@ -106,7 +110,7 @@ function SelectedBlockPopover(_ref) {
106
110
  stopTyping
107
111
  } = (0, _data.useDispatch)(_store.store);
108
112
  const showEmptyBlockSideInserter = !isTyping && editorMode === 'edit' && isEmptyDefaultBlock;
109
- const shouldShowBreadcrumb = editorMode === 'navigation' || editorMode === 'zoom-out';
113
+ const shouldShowBreadcrumb = !hasMultiSelection && (editorMode === 'navigation' || editorMode === 'zoom-out');
110
114
  const shouldShowContextualToolbar = editorMode === 'edit' && !hasFixedToolbar && isLargeViewport && !isMultiSelecting && !showEmptyBlockSideInserter && !isTyping && !isBlockInterfaceHidden;
111
115
  const canFocusHiddenToolbar = editorMode === 'edit' && !shouldShowContextualToolbar && !hasFixedToolbar && !isDistractionFree && !isEmptyDefaultBlock;
112
116
  (0, _keyboardShortcuts.useShortcut)('core/block-editor/focus-toolbar', () => {
@@ -126,52 +130,56 @@ function SelectedBlockPopover(_ref) {
126
130
  clientId
127
131
  });
128
132
 
129
- if (!shouldShowBreadcrumb && !shouldShowContextualToolbar && !showEmptyBlockSideInserter) {
130
- return null;
133
+ if (showEmptyBlockSideInserter) {
134
+ return (0, _element.createElement)(_blockPopover.default, (0, _extends2.default)({
135
+ clientId: capturingClientId || clientId,
136
+ __unstableCoverTarget: true,
137
+ bottomClientId: lastClientId,
138
+ className: (0, _classnames.default)('block-editor-block-list__block-side-inserter-popover', {
139
+ 'is-insertion-point-visible': isInsertionPointVisible
140
+ }),
141
+ __unstablePopoverSlot: __unstablePopoverSlot,
142
+ __unstableContentRef: __unstableContentRef,
143
+ resize: false,
144
+ shift: false
145
+ }, popoverProps), (0, _element.createElement)("div", {
146
+ className: "block-editor-block-list__empty-block-inserter"
147
+ }, (0, _element.createElement)(_inserter.default, {
148
+ position: "bottom right",
149
+ rootClientId: rootClientId,
150
+ clientId: clientId,
151
+ __experimentalIsQuick: true
152
+ })));
131
153
  }
132
154
 
133
- return (0, _element.createElement)(_element.Fragment, null, showEmptyBlockSideInserter && (0, _element.createElement)(_blockPopover.default, (0, _extends2.default)({
134
- clientId: capturingClientId || clientId,
135
- __unstableCoverTarget: true,
136
- bottomClientId: lastClientId,
137
- className: (0, _classnames.default)('block-editor-block-list__block-side-inserter-popover', {
138
- 'is-insertion-point-visible': isInsertionPointVisible
139
- }),
140
- __unstablePopoverSlot: __unstablePopoverSlot,
141
- __unstableContentRef: __unstableContentRef,
142
- resize: false,
143
- shift: false
144
- }, popoverProps), (0, _element.createElement)("div", {
145
- className: "block-editor-block-list__empty-block-inserter"
146
- }, (0, _element.createElement)(_inserter.default, {
147
- position: "bottom right",
148
- rootClientId: rootClientId,
149
- clientId: clientId,
150
- __experimentalIsQuick: true
151
- }))), (shouldShowBreadcrumb || shouldShowContextualToolbar) && (0, _element.createElement)(_blockPopover.default, (0, _extends2.default)({
152
- clientId: capturingClientId || clientId,
153
- bottomClientId: lastClientId,
154
- className: (0, _classnames.default)('block-editor-block-list__block-popover', {
155
- 'is-insertion-point-visible': isInsertionPointVisible
156
- }),
157
- __unstablePopoverSlot: __unstablePopoverSlot,
158
- __unstableContentRef: __unstableContentRef,
159
- resize: false
160
- }, popoverProps), shouldShowContextualToolbar && showContents && (0, _element.createElement)(_blockContextualToolbar.default // If the toolbar is being shown because of being forced
161
- // it should focus the toolbar right after the mount.
162
- , {
163
- focusOnMount: isToolbarForced.current,
164
- __experimentalInitialIndex: initialToolbarItemIndexRef.current,
165
- __experimentalOnIndexChange: index => {
166
- initialToolbarItemIndexRef.current = index;
167
- } // Resets the index whenever the active block changes so
168
- // this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
169
- ,
170
- key: clientId
171
- }), shouldShowBreadcrumb && (0, _element.createElement)(_blockSelectionButton.default, {
172
- clientId: clientId,
173
- rootClientId: rootClientId
174
- })));
155
+ if (shouldShowBreadcrumb || shouldShowContextualToolbar) {
156
+ return (0, _element.createElement)(_blockPopover.default, (0, _extends2.default)({
157
+ clientId: capturingClientId || clientId,
158
+ bottomClientId: lastClientId,
159
+ className: (0, _classnames.default)('block-editor-block-list__block-popover', {
160
+ 'is-insertion-point-visible': isInsertionPointVisible
161
+ }),
162
+ __unstablePopoverSlot: __unstablePopoverSlot,
163
+ __unstableContentRef: __unstableContentRef,
164
+ resize: false
165
+ }, popoverProps), shouldShowContextualToolbar && showContents && (0, _element.createElement)(_blockContextualToolbar.default // If the toolbar is being shown because of being forced
166
+ // it should focus the toolbar right after the mount.
167
+ , {
168
+ focusOnMount: isToolbarForced.current,
169
+ __experimentalInitialIndex: initialToolbarItemIndexRef.current,
170
+ __experimentalOnIndexChange: index => {
171
+ initialToolbarItemIndexRef.current = index;
172
+ } // Resets the index whenever the active block changes so
173
+ // this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169
174
+ ,
175
+ key: clientId
176
+ }), shouldShowBreadcrumb && (0, _element.createElement)(_blockSelectionButton.default, {
177
+ clientId: clientId,
178
+ rootClientId: rootClientId
179
+ }));
180
+ }
181
+
182
+ return null;
175
183
  }
176
184
 
177
185
  function wrapperSelector(select) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/selected-block-popover.js"],"names":["selector","select","__unstableGetEditorMode","isMultiSelecting","hasMultiSelection","isTyping","__experimentalIsBlockInterfaceHidden","isBlockInterfaceHidden","getSettings","getLastMultiSelectedBlockClientId","blockEditorStore","editorMode","hasFixedToolbar","isDistractionFree","lastClientId","SelectedBlockPopover","clientId","rootClientId","isEmptyDefaultBlock","showContents","capturingClientId","__unstablePopoverSlot","__unstableContentRef","isInsertionPointVisible","isBlockInsertionPointVisible","getBlockInsertionPoint","getBlockOrder","insertionPoint","order","index","isLargeViewport","isToolbarForced","stopTyping","showEmptyBlockSideInserter","shouldShowBreadcrumb","shouldShowContextualToolbar","canFocusHiddenToolbar","current","isDisabled","initialToolbarItemIndexRef","popoverProps","contentElement","wrapperSelector","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlockRootClientId","getBlock","getBlockParents","isNavigationMode","_isNavigationMode","__experimentalGetBlockListSettingsForBlocks","name","attributes","blockParentsClientIds","parentBlockListSettings","find","parentClientId","__experimentalCaptureToolbars","settings","WrappedBlockPopover","selected"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAtBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AAQA,SAASA,QAAT,CAAmBC,MAAnB,EAA4B;AAC3B,QAAM;AACLC,IAAAA,uBADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA,iBAHK;AAILC,IAAAA,QAJK;AAKLC,IAAAA,oCAAoC,EAAEC,sBALjC;AAMLC,IAAAA,WANK;AAOLC,IAAAA;AAPK,MAQFR,MAAM,CAAES,YAAF,CARV;AAUA,SAAO;AACNC,IAAAA,UAAU,EAAET,uBAAuB,EAD7B;AAENC,IAAAA,gBAAgB,EAAEA,gBAAgB,EAF5B;AAGNE,IAAAA,QAAQ,EAAEA,QAAQ,EAHZ;AAINE,IAAAA,sBAAsB,EAAEA,sBAAsB,EAJxC;AAKNK,IAAAA,eAAe,EAAEJ,WAAW,GAAGI,eALzB;AAMNC,IAAAA,iBAAiB,EAAEL,WAAW,GAAGK,iBAN3B;AAONC,IAAAA,YAAY,EAAEV,iBAAiB,KAC5BK,iCAAiC,EADL,GAE5B;AATG,GAAP;AAWA;;AAED,SAASM,oBAAT,OAQI;AAAA,MAR2B;AAC9BC,IAAAA,QAD8B;AAE9BC,IAAAA,YAF8B;AAG9BC,IAAAA,mBAH8B;AAI9BC,IAAAA,YAJ8B;AAIhB;AACdC,IAAAA,iBAL8B;AAM9BC,IAAAA,qBAN8B;AAO9BC,IAAAA;AAP8B,GAQ3B;AACH,QAAM;AACLX,IAAAA,UADK;AAELR,IAAAA,gBAFK;AAGLE,IAAAA,QAHK;AAILE,IAAAA,sBAJK;AAKLK,IAAAA,eALK;AAMLC,IAAAA,iBANK;AAOLC,IAAAA;AAPK,MAQF,qBAAWd,QAAX,EAAqB,EAArB,CARJ;AASA,QAA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Press dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockSelectionButton from './block-selection-button';\nimport BlockContextualToolbar from './block-contextual-toolbar';\nimport { store as blockEditorStore } from '../../store';\nimport BlockPopover from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport Inserter from '../inserter';\n\nfunction selector( select ) {\n\tconst {\n\t\t__unstableGetEditorMode,\n\t\tisMultiSelecting,\n\t\thasMultiSelection,\n\t\tisTyping,\n\t\t__experimentalIsBlockInterfaceHidden: isBlockInterfaceHidden,\n\t\tgetSettings,\n\t\tgetLastMultiSelectedBlockClientId,\n\t} = select( blockEditorStore );\n\n\treturn {\n\t\teditorMode: __unstableGetEditorMode(),\n\t\tisMultiSelecting: isMultiSelecting(),\n\t\tisTyping: isTyping(),\n\t\tisBlockInterfaceHidden: isBlockInterfaceHidden(),\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tisDistractionFree: getSettings().isDistractionFree,\n\t\tlastClientId: hasMultiSelection()\n\t\t\t? getLastMultiSelectedBlockClientId()\n\t\t\t: null,\n\t};\n}\n\nfunction SelectedBlockPopover( {\n\tclientId,\n\trootClientId,\n\tisEmptyDefaultBlock,\n\tshowContents, // we may need to mount an empty popover because we reuse\n\tcapturingClientId,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst {\n\t\teditorMode,\n\t\tisMultiSelecting,\n\t\tisTyping,\n\t\tisBlockInterfaceHidden,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tlastClientId,\n\t} = useSelect( selector, [] );\n\tconst isInsertionPointVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif ( ! isBlockInsertionPointVisible() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\t\t\treturn order[ insertionPoint.index ] === clientId;\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isToolbarForced = useRef( false );\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\tconst showEmptyBlockSideInserter =\n\t\t! isTyping && editorMode === 'edit' && isEmptyDefaultBlock;\n\tconst shouldShowBreadcrumb =\n\t\teditorMode === 'navigation' || editorMode === 'zoom-out';\n\tconst shouldShowContextualToolbar =\n\t\teditorMode === 'edit' &&\n\t\t! hasFixedToolbar &&\n\t\tisLargeViewport &&\n\t\t! isMultiSelecting &&\n\t\t! showEmptyBlockSideInserter &&\n\t\t! isTyping &&\n\t\t! isBlockInterfaceHidden;\n\tconst canFocusHiddenToolbar =\n\t\teditorMode === 'edit' &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! hasFixedToolbar &&\n\t\t! isDistractionFree &&\n\t\t! isEmptyDefaultBlock;\n\n\tuseShortcut(\n\t\t'core/block-editor/focus-toolbar',\n\t\t() => {\n\t\t\tisToolbarForced.current = true;\n\t\t\tstopTyping( true );\n\t\t},\n\t\t{\n\t\t\tisDisabled: ! canFocusHiddenToolbar,\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tisToolbarForced.current = false;\n\t} );\n\n\t// Stores the active toolbar item index so the block toolbar can return focus\n\t// to it when re-mounting.\n\tconst initialToolbarItemIndexRef = useRef();\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\tif (\n\t\t! shouldShowBreadcrumb &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! showEmptyBlockSideInserter\n\t) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ showEmptyBlockSideInserter && (\n\t\t\t\t<BlockPopover\n\t\t\t\t\tclientId={ capturingClientId || clientId }\n\t\t\t\t\t__unstableCoverTarget\n\t\t\t\t\tbottomClientId={ lastClientId }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-list__block-side-inserter-popover',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-insertion-point-visible':\n\t\t\t\t\t\t\t\tisInsertionPointVisible,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\tresize={ false }\n\t\t\t\t\tshift={ false }\n\t\t\t\t\t{ ...popoverProps }\n\t\t\t\t>\n\t\t\t\t\t<div className=\"block-editor-block-list__empty-block-inserter\">\n\t\t\t\t\t\t<Inserter\n\t\t\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t\t/>\n\t\t\t\t\t</div>\n\t\t\t\t</BlockPopover>\n\t\t\t) }\n\t\t\t{ ( shouldShowBreadcrumb || shouldShowContextualToolbar ) && (\n\t\t\t\t<BlockPopover\n\t\t\t\t\tclientId={ capturingClientId || clientId }\n\t\t\t\t\tbottomClientId={ lastClientId }\n\t\t\t\t\tclassName={ classnames(\n\t\t\t\t\t\t'block-editor-block-list__block-popover',\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\t'is-insertion-point-visible':\n\t\t\t\t\t\t\t\tisInsertionPointVisible,\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\t\tresize={ false }\n\t\t\t\t\t{ ...popoverProps }\n\t\t\t\t>\n\t\t\t\t\t{ shouldShowContextualToolbar && showContents && (\n\t\t\t\t\t\t<BlockContextualToolbar\n\t\t\t\t\t\t\t// If the toolbar is being shown because of being forced\n\t\t\t\t\t\t\t// it should focus the toolbar right after the mount.\n\t\t\t\t\t\t\tfocusOnMount={ isToolbarForced.current }\n\t\t\t\t\t\t\t__experimentalInitialIndex={\n\t\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t__experimentalOnIndexChange={ ( index ) => {\n\t\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current = index;\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t// Resets the index whenever the active block changes so\n\t\t\t\t\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\t\t\t\t\tkey={ clientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ shouldShowBreadcrumb && (\n\t\t\t\t\t\t<BlockSelectionButton\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</BlockPopover>\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction wrapperSelector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlock,\n\t\tgetBlockParents,\n\t\tgetSettings,\n\t\tisNavigationMode: _isNavigationMode,\n\t\t__experimentalGetBlockListSettingsForBlocks,\n\t} = select( blockEditorStore );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\tif ( ! clientId ) {\n\t\treturn;\n\t}\n\n\tconst { name, attributes = {} } = getBlock( clientId ) || {};\n\tconst blockParentsClientIds = getBlockParents( clientId );\n\n\t// Get Block List Settings for all ancestors of the current Block clientId.\n\tconst parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(\n\t\tblockParentsClientIds\n\t);\n\n\t// Get the clientId of the topmost parent with the capture toolbars setting.\n\tconst capturingClientId = blockParentsClientIds.find(\n\t\t( parentClientId ) =>\n\t\t\tparentBlockListSettings[ parentClientId ]\n\t\t\t\t?.__experimentalCaptureToolbars\n\t);\n\n\tconst settings = getSettings();\n\n\treturn {\n\t\tclientId,\n\t\trootClientId: getBlockRootClientId( clientId ),\n\t\tname,\n\t\tisDistractionFree: settings.isDistractionFree,\n\t\tisNavigationMode: _isNavigationMode(),\n\t\tisEmptyDefaultBlock:\n\t\t\tname && isUnmodifiedDefaultBlock( { name, attributes } ),\n\t\tcapturingClientId,\n\t};\n}\n\nexport default function WrappedBlockPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst selected = useSelect( wrapperSelector, [] );\n\n\tif ( ! selected ) {\n\t\treturn null;\n\t}\n\n\tconst {\n\t\tclientId,\n\t\trootClientId,\n\t\tname,\n\t\tisEmptyDefaultBlock,\n\t\tcapturingClientId,\n\t\tisDistractionFree,\n\t\tisNavigationMode,\n\t} = selected;\n\n\tif ( ! name ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectedBlockPopover\n\t\t\tclientId={ clientId }\n\t\t\trootClientId={ rootClientId }\n\t\t\tisEmptyDefaultBlock={ isEmptyDefaultBlock }\n\t\t\tshowContents={ ! isDistractionFree || isNavigationMode }\n\t\t\tcapturingClientId={ capturingClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/selected-block-popover.js"],"names":["selector","select","__unstableGetEditorMode","isMultiSelecting","hasMultiSelection","isTyping","isBlockInterfaceHidden","getSettings","getLastMultiSelectedBlockClientId","blockEditorStore","editorMode","hasFixedToolbar","isDistractionFree","lastClientId","SelectedBlockPopover","clientId","rootClientId","isEmptyDefaultBlock","showContents","capturingClientId","__unstablePopoverSlot","__unstableContentRef","isInsertionPointVisible","isBlockInsertionPointVisible","getBlockInsertionPoint","getBlockOrder","insertionPoint","order","index","isLargeViewport","isToolbarForced","stopTyping","showEmptyBlockSideInserter","shouldShowBreadcrumb","shouldShowContextualToolbar","canFocusHiddenToolbar","current","isDisabled","initialToolbarItemIndexRef","popoverProps","contentElement","wrapperSelector","getSelectedBlockClientId","getFirstMultiSelectedBlockClientId","getBlockRootClientId","getBlock","getBlockParents","isNavigationMode","_isNavigationMode","__experimentalGetBlockListSettingsForBlocks","name","attributes","blockParentsClientIds","parentBlockListSettings","find","parentClientId","__experimentalCaptureToolbars","settings","WrappedBlockPopover","selected"],"mappings":";;;;;;;;;AAQA;;;;AALA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAGA;AACA;AACA;;AAOA;AACA;AACA;AASA,SAASA,QAAT,CAAmBC,MAAnB,EAA4B;AAC3B,QAAM;AACLC,IAAAA,uBADK;AAELC,IAAAA,gBAFK;AAGLC,IAAAA,iBAHK;AAILC,IAAAA,QAJK;AAKLC,IAAAA,sBALK;AAMLC,IAAAA,WANK;AAOLC,IAAAA;AAPK,MAQF,yBAAQP,MAAM,CAAEQ,YAAF,CAAd,CARJ;AAUA,SAAO;AACNC,IAAAA,UAAU,EAAER,uBAAuB,EAD7B;AAENE,IAAAA,iBAAiB,EAAEA,iBAAiB,EAF9B;AAGND,IAAAA,gBAAgB,EAAEA,gBAAgB,EAH5B;AAINE,IAAAA,QAAQ,EAAEA,QAAQ,EAJZ;AAKNC,IAAAA,sBAAsB,EAAEA,sBAAsB,EALxC;AAMNK,IAAAA,eAAe,EAAEJ,WAAW,GAAGI,eANzB;AAONC,IAAAA,iBAAiB,EAAEL,WAAW,GAAGK,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AAILjC,IAAAA,mBAJK;AAKLE,IAAAA,iBALK;AAMLP,IAAAA,iBANK;AAOLmC,IAAAA;AAPK,MAQFY,QARJ;;AAUA,MAAK,CAAET,IAAP,EAAc;AACb,WAAO,IAAP;AACA;;AAED,SACC,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAGnC,QADZ;AAEC,IAAA,YAAY,EAAGC,YAFhB;AAGC,IAAA,mBAAmB,EAAGC,mBAHvB;AAIC,IAAA,YAAY,EAAG,CAAEL,iBAAF,IAAuBmC,gBAJvC;AAKC,IAAA,iBAAiB,EAAG5B,iBALrB;AAMC,IAAA,qBAAqB,EAAGC,qBANzB;AAOC,IAAA,oBAAoB,EAAGC;AAPxB,IADD;AAWA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useRef, useEffect } from '@wordpress/element';\nimport { isUnmodifiedDefaultBlock } from '@wordpress/blocks';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useShortcut } from '@wordpress/keyboard-shortcuts';\nimport { useViewportMatch } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport BlockSelectionButton from './block-selection-button';\nimport BlockContextualToolbar from './block-contextual-toolbar';\nimport { store as blockEditorStore } from '../../store';\nimport BlockPopover from '../block-popover';\nimport useBlockToolbarPopoverProps from './use-block-toolbar-popover-props';\nimport Inserter from '../inserter';\nimport { unlock } from '../../experiments';\n\nfunction selector( select ) {\n\tconst {\n\t\t__unstableGetEditorMode,\n\t\tisMultiSelecting,\n\t\thasMultiSelection,\n\t\tisTyping,\n\t\tisBlockInterfaceHidden,\n\t\tgetSettings,\n\t\tgetLastMultiSelectedBlockClientId,\n\t} = unlock( select( blockEditorStore ) );\n\n\treturn {\n\t\teditorMode: __unstableGetEditorMode(),\n\t\thasMultiSelection: hasMultiSelection(),\n\t\tisMultiSelecting: isMultiSelecting(),\n\t\tisTyping: isTyping(),\n\t\tisBlockInterfaceHidden: isBlockInterfaceHidden(),\n\t\thasFixedToolbar: getSettings().hasFixedToolbar,\n\t\tisDistractionFree: getSettings().isDistractionFree,\n\t\tlastClientId: hasMultiSelection()\n\t\t\t? getLastMultiSelectedBlockClientId()\n\t\t\t: null,\n\t};\n}\n\nfunction SelectedBlockPopover( {\n\tclientId,\n\trootClientId,\n\tisEmptyDefaultBlock,\n\tshowContents, // we may need to mount an empty popover because we reuse\n\tcapturingClientId,\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst {\n\t\teditorMode,\n\t\thasMultiSelection,\n\t\tisMultiSelecting,\n\t\tisTyping,\n\t\tisBlockInterfaceHidden,\n\t\thasFixedToolbar,\n\t\tisDistractionFree,\n\t\tlastClientId,\n\t} = useSelect( selector, [] );\n\tconst isInsertionPointVisible = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\tisBlockInsertionPointVisible,\n\t\t\t\tgetBlockInsertionPoint,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tif ( ! isBlockInsertionPointVisible() ) {\n\t\t\t\treturn false;\n\t\t\t}\n\n\t\t\tconst insertionPoint = getBlockInsertionPoint();\n\t\t\tconst order = getBlockOrder( insertionPoint.rootClientId );\n\t\t\treturn order[ insertionPoint.index ] === clientId;\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst isLargeViewport = useViewportMatch( 'medium' );\n\tconst isToolbarForced = useRef( false );\n\tconst { stopTyping } = useDispatch( blockEditorStore );\n\n\tconst showEmptyBlockSideInserter =\n\t\t! isTyping && editorMode === 'edit' && isEmptyDefaultBlock;\n\tconst shouldShowBreadcrumb =\n\t\t! hasMultiSelection &&\n\t\t( editorMode === 'navigation' || editorMode === 'zoom-out' );\n\tconst shouldShowContextualToolbar =\n\t\teditorMode === 'edit' &&\n\t\t! hasFixedToolbar &&\n\t\tisLargeViewport &&\n\t\t! isMultiSelecting &&\n\t\t! showEmptyBlockSideInserter &&\n\t\t! isTyping &&\n\t\t! isBlockInterfaceHidden;\n\tconst canFocusHiddenToolbar =\n\t\teditorMode === 'edit' &&\n\t\t! shouldShowContextualToolbar &&\n\t\t! hasFixedToolbar &&\n\t\t! isDistractionFree &&\n\t\t! isEmptyDefaultBlock;\n\n\tuseShortcut(\n\t\t'core/block-editor/focus-toolbar',\n\t\t() => {\n\t\t\tisToolbarForced.current = true;\n\t\t\tstopTyping( true );\n\t\t},\n\t\t{\n\t\t\tisDisabled: ! canFocusHiddenToolbar,\n\t\t}\n\t);\n\n\tuseEffect( () => {\n\t\tisToolbarForced.current = false;\n\t} );\n\n\t// Stores the active toolbar item index so the block toolbar can return focus\n\t// to it when re-mounting.\n\tconst initialToolbarItemIndexRef = useRef();\n\n\tconst popoverProps = useBlockToolbarPopoverProps( {\n\t\tcontentElement: __unstableContentRef?.current,\n\t\tclientId,\n\t} );\n\n\tif ( showEmptyBlockSideInserter ) {\n\t\treturn (\n\t\t\t<BlockPopover\n\t\t\t\tclientId={ capturingClientId || clientId }\n\t\t\t\t__unstableCoverTarget\n\t\t\t\tbottomClientId={ lastClientId }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-block-list__block-side-inserter-popover',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\tresize={ false }\n\t\t\t\tshift={ false }\n\t\t\t\t{ ...popoverProps }\n\t\t\t>\n\t\t\t\t<div className=\"block-editor-block-list__empty-block-inserter\">\n\t\t\t\t\t<Inserter\n\t\t\t\t\t\tposition=\"bottom right\"\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t__experimentalIsQuick\n\t\t\t\t\t/>\n\t\t\t\t</div>\n\t\t\t</BlockPopover>\n\t\t);\n\t}\n\n\tif ( shouldShowBreadcrumb || shouldShowContextualToolbar ) {\n\t\treturn (\n\t\t\t<BlockPopover\n\t\t\t\tclientId={ capturingClientId || clientId }\n\t\t\t\tbottomClientId={ lastClientId }\n\t\t\t\tclassName={ classnames(\n\t\t\t\t\t'block-editor-block-list__block-popover',\n\t\t\t\t\t{\n\t\t\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t\t\t}\n\t\t\t\t) }\n\t\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\t\tresize={ false }\n\t\t\t\t{ ...popoverProps }\n\t\t\t>\n\t\t\t\t{ shouldShowContextualToolbar && showContents && (\n\t\t\t\t\t<BlockContextualToolbar\n\t\t\t\t\t\t// If the toolbar is being shown because of being forced\n\t\t\t\t\t\t// it should focus the toolbar right after the mount.\n\t\t\t\t\t\tfocusOnMount={ isToolbarForced.current }\n\t\t\t\t\t\t__experimentalInitialIndex={\n\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current\n\t\t\t\t\t\t}\n\t\t\t\t\t\t__experimentalOnIndexChange={ ( index ) => {\n\t\t\t\t\t\t\tinitialToolbarItemIndexRef.current = index;\n\t\t\t\t\t\t} }\n\t\t\t\t\t\t// Resets the index whenever the active block changes so\n\t\t\t\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\t\t\t\tkey={ clientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t{ shouldShowBreadcrumb && (\n\t\t\t\t\t<BlockSelectionButton\n\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t</BlockPopover>\n\t\t);\n\t}\n\n\treturn null;\n}\n\nfunction wrapperSelector( select ) {\n\tconst {\n\t\tgetSelectedBlockClientId,\n\t\tgetFirstMultiSelectedBlockClientId,\n\t\tgetBlockRootClientId,\n\t\tgetBlock,\n\t\tgetBlockParents,\n\t\tgetSettings,\n\t\tisNavigationMode: _isNavigationMode,\n\t\t__experimentalGetBlockListSettingsForBlocks,\n\t} = select( blockEditorStore );\n\n\tconst clientId =\n\t\tgetSelectedBlockClientId() || getFirstMultiSelectedBlockClientId();\n\n\tif ( ! clientId ) {\n\t\treturn;\n\t}\n\n\tconst { name, attributes = {} } = getBlock( clientId ) || {};\n\tconst blockParentsClientIds = getBlockParents( clientId );\n\n\t// Get Block List Settings for all ancestors of the current Block clientId.\n\tconst parentBlockListSettings = __experimentalGetBlockListSettingsForBlocks(\n\t\tblockParentsClientIds\n\t);\n\n\t// Get the clientId of the topmost parent with the capture toolbars setting.\n\tconst capturingClientId = blockParentsClientIds.find(\n\t\t( parentClientId ) =>\n\t\t\tparentBlockListSettings[ parentClientId ]\n\t\t\t\t?.__experimentalCaptureToolbars\n\t);\n\n\tconst settings = getSettings();\n\n\treturn {\n\t\tclientId,\n\t\trootClientId: getBlockRootClientId( clientId ),\n\t\tname,\n\t\tisDistractionFree: settings.isDistractionFree,\n\t\tisNavigationMode: _isNavigationMode(),\n\t\tisEmptyDefaultBlock:\n\t\t\tname && isUnmodifiedDefaultBlock( { name, attributes } ),\n\t\tcapturingClientId,\n\t};\n}\n\nexport default function WrappedBlockPopover( {\n\t__unstablePopoverSlot,\n\t__unstableContentRef,\n} ) {\n\tconst selected = useSelect( wrapperSelector, [] );\n\n\tif ( ! selected ) {\n\t\treturn null;\n\t}\n\n\tconst {\n\t\tclientId,\n\t\trootClientId,\n\t\tname,\n\t\tisEmptyDefaultBlock,\n\t\tcapturingClientId,\n\t\tisDistractionFree,\n\t\tisNavigationMode,\n\t} = selected;\n\n\tif ( ! name ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<SelectedBlockPopover\n\t\t\tclientId={ clientId }\n\t\t\trootClientId={ rootClientId }\n\t\t\tisEmptyDefaultBlock={ isEmptyDefaultBlock }\n\t\t\tshowContents={ ! isDistractionFree || isNavigationMode }\n\t\t\tcapturingClientId={ capturingClientId }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t/>\n\t);\n}\n"]}
@@ -9,12 +9,16 @@ var _compose = require("@wordpress/compose");
9
9
 
10
10
  var _data = require("@wordpress/data");
11
11
 
12
+ var _dom = require("@wordpress/dom");
13
+
12
14
  var _element = require("@wordpress/element");
13
15
 
14
16
  var _store = require("../../store");
15
17
 
16
18
  var _useBlockRefs = require("../block-list/use-block-props/use-block-refs");
17
19
 
20
+ var _position = require("../../hooks/position");
21
+
18
22
  /**
19
23
  * WordPress dependencies
20
24
  */
@@ -46,24 +50,34 @@ const RESTRICTED_HEIGHT_PROPS = { ...COMMON_PROPS,
46
50
  *
47
51
  * @param {Element} contentElement The DOM element that represents the editor content or canvas.
48
52
  * @param {Element} selectedBlockElement The outer DOM element of the first selected block.
53
+ * @param {Element} scrollContainer The scrollable container for the contentElement.
49
54
  * @param {number} toolbarHeight The height of the toolbar in pixels.
55
+ * @param {boolean} isSticky Whether or not the selected block is sticky or fixed.
50
56
  *
51
57
  * @return {Object} The popover props used to determine the position of the toolbar.
52
58
  */
53
59
 
54
- function getProps(contentElement, selectedBlockElement, toolbarHeight) {
60
+ function getProps(contentElement, selectedBlockElement, scrollContainer, toolbarHeight, isSticky) {
55
61
  if (!contentElement || !selectedBlockElement) {
56
62
  return DEFAULT_PROPS;
57
- }
63
+ } // Get how far the content area has been scrolled.
58
64
 
65
+
66
+ const scrollTop = (scrollContainer === null || scrollContainer === void 0 ? void 0 : scrollContainer.scrollTop) || 0;
59
67
  const blockRect = selectedBlockElement.getBoundingClientRect();
60
- const contentRect = contentElement.getBoundingClientRect(); // The document element's clientHeight represents the viewport height.
68
+ const contentRect = contentElement.getBoundingClientRect(); // Get the vertical position of top of the visible content area.
69
+
70
+ const topOfContentElementInViewport = scrollTop + contentRect.top; // The document element's clientHeight represents the viewport height.
61
71
 
62
- const viewportHeight = contentElement.ownerDocument.documentElement.clientHeight;
63
- const hasSpaceForToolbarAbove = blockRect.top - contentRect.top > toolbarHeight;
64
- const isBlockTallerThanViewport = blockRect.height > viewportHeight - toolbarHeight;
72
+ const viewportHeight = contentElement.ownerDocument.documentElement.clientHeight; // The restricted height area is calculated as the sum of the
73
+ // vertical position of the visible content area, plus the height
74
+ // of the block toolbar.
65
75
 
66
- if (hasSpaceForToolbarAbove || isBlockTallerThanViewport) {
76
+ const restrictedTopArea = topOfContentElementInViewport + toolbarHeight;
77
+ const hasSpaceForToolbarAbove = blockRect.top > restrictedTopArea;
78
+ const isBlockTallerThanViewport = blockRect.height > viewportHeight - toolbarHeight; // Sticky blocks are treated as if they will never have enough space for the toolbar above.
79
+
80
+ if (!isSticky && (hasSpaceForToolbarAbove || isBlockTallerThanViewport)) {
67
81
  return DEFAULT_PROPS;
68
82
  }
69
83
 
@@ -87,12 +101,31 @@ function useBlockToolbarPopoverProps(_ref) {
87
101
  } = _ref;
88
102
  const selectedBlockElement = (0, _useBlockRefs.__unstableUseBlockElement)(clientId);
89
103
  const [toolbarHeight, setToolbarHeight] = (0, _element.useState)(0);
90
- const [props, setProps] = (0, _element.useState)(() => getProps(contentElement, selectedBlockElement, toolbarHeight));
91
- const blockIndex = (0, _data.useSelect)(select => select(_store.store).getBlockIndex(clientId), [clientId]);
104
+ const {
105
+ blockIndex,
106
+ isSticky
107
+ } = (0, _data.useSelect)(select => {
108
+ const {
109
+ getBlockIndex,
110
+ getBlockAttributes
111
+ } = select(_store.store);
112
+ return {
113
+ blockIndex: getBlockIndex(clientId),
114
+ isSticky: (0, _position.hasStickyOrFixedPositionValue)(getBlockAttributes(clientId))
115
+ };
116
+ }, [clientId]);
117
+ const scrollContainer = (0, _element.useMemo)(() => {
118
+ if (!contentElement) {
119
+ return;
120
+ }
121
+
122
+ return (0, _dom.getScrollContainer)(contentElement);
123
+ }, [contentElement]);
124
+ const [props, setProps] = (0, _element.useState)(() => getProps(contentElement, selectedBlockElement, scrollContainer, toolbarHeight, isSticky));
92
125
  const popoverRef = (0, _compose.useRefEffect)(popoverNode => {
93
126
  setToolbarHeight(popoverNode.offsetHeight);
94
127
  }, []);
95
- const updateProps = (0, _element.useCallback)(() => setProps(getProps(contentElement, selectedBlockElement, toolbarHeight)), [contentElement, selectedBlockElement, toolbarHeight]); // Update props when the block is moved. This also ensures the props are
128
+ const updateProps = (0, _element.useCallback)(() => setProps(getProps(contentElement, selectedBlockElement, scrollContainer, toolbarHeight, isSticky)), [contentElement, selectedBlockElement, scrollContainer, toolbarHeight]); // Update props when the block is moved. This also ensures the props are
96
129
  // correct on initial mount, and when the selected block or content element
97
130
  // changes (since the callback ref will update).
98
131
 
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/use-block-toolbar-popover-props.js"],"names":["COMMON_PROPS","placement","DEFAULT_PROPS","flip","shift","RESTRICTED_HEIGHT_PROPS","getProps","contentElement","selectedBlockElement","toolbarHeight","blockRect","getBoundingClientRect","contentRect","viewportHeight","ownerDocument","documentElement","clientHeight","hasSpaceForToolbarAbove","top","isBlockTallerThanViewport","height","useBlockToolbarPopoverProps","clientId","setToolbarHeight","props","setProps","blockIndex","select","blockEditorStore","getBlockIndex","popoverRef","popoverNode","offsetHeight","updateProps","contentView","defaultView","addEventHandler","resizeObserver","blockView","ResizeObserver","observe","removeEventHandler","disconnect","ref"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AAKA;;AACA;;AAXA;AACA;AACA;;AAKA;AACA;AACA;AAIA,MAAMA,YAAY,GAAG;AACpBC,EAAAA,SAAS,EAAE;AADS,CAArB,C,CAIA;AACA;AACA;;AACA,MAAMC,aAAa,GAAG,EACrB,GAAGF,YADkB;AAErBG,EAAAA,IAAI,EAAE,KAFe;AAGrBC,EAAAA,KAAK,EAAE;AAHc,CAAtB,C,CAMA;AACA;AACA;AACA;AACA;;AACA,MAAMC,uBAAuB,GAAG,EAC/B,GAAGL,YAD4B;AAE/BG,EAAAA,IAAI,EA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AAL,EAAsB;AACrBA,QAAAA,cAAc,CAACK,UAAf;AACA;AACD,KAND;AAOA,GAxBD,EAwBG,CAAET,WAAF,EAAe1B,cAAf,EAA+BC,oBAA/B,CAxBH;AA0BA,SAAO,EACN,GAAGgB,KADG;AAENmB,IAAAA,GAAG,EAAEb;AAFC,GAAP;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { useCallback, useLayoutEffect, useState } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\n\nconst COMMON_PROPS = {\n\tplacement: 'top-start',\n};\n\n// By default the toolbar sets the `shift` prop. If the user scrolls the page\n// down the toolbar will stay on screen by adopting a sticky position at the\n// top of the viewport.\nconst DEFAULT_PROPS = {\n\t...COMMON_PROPS,\n\tflip: false,\n\tshift: true,\n};\n\n// When there isn't enough height between the top of the block and the editor\n// canvas, the `shift` prop is set to `false`, as it will cause the block to be\n// obscured. The `flip` behavior is enabled, which positions the toolbar below\n// the block. This only happens if the block is smaller than the viewport, as\n// otherwise the toolbar will be off-screen.\nconst RESTRICTED_HEIGHT_PROPS = {\n\t...COMMON_PROPS,\n\tflip: true,\n\tshift: false,\n};\n\n/**\n * Get the popover props for the block toolbar, determined by the space at the top of the canvas and the toolbar height.\n *\n * @param {Element} contentElement The DOM element that represents the editor content or canvas.\n * @param {Element} selectedBlockElement The outer DOM element of the first selected block.\n * @param {number} toolbarHeight The height of the toolbar in pixels.\n *\n * @return {Object} The popover props used to determine the position of the toolbar.\n */\nfunction getProps( contentElement, selectedBlockElement, toolbarHeight ) {\n\tif ( ! contentElement || ! selectedBlockElement ) {\n\t\treturn DEFAULT_PROPS;\n\t}\n\n\tconst blockRect = selectedBlockElement.getBoundingClientRect();\n\tconst contentRect = contentElement.getBoundingClientRect();\n\n\t// The document element's clientHeight represents the viewport height.\n\tconst viewportHeight =\n\t\tcontentElement.ownerDocument.documentElement.clientHeight;\n\n\tconst hasSpaceForToolbarAbove =\n\t\tblockRect.top - contentRect.top > toolbarHeight;\n\tconst isBlockTallerThanViewport =\n\t\tblockRect.height > viewportHeight - toolbarHeight;\n\n\tif ( hasSpaceForToolbarAbove || isBlockTallerThanViewport ) {\n\t\treturn DEFAULT_PROPS;\n\t}\n\n\treturn RESTRICTED_HEIGHT_PROPS;\n}\n\n/**\n * Determines the desired popover positioning behavior, returning a set of appropriate props.\n *\n * @param {Object} elements\n * @param {Element} elements.contentElement The DOM element that represents the editor content or canvas.\n * @param {string} elements.clientId The clientId of the first selected block.\n *\n * @return {Object} The popover props used to determine the position of the toolbar.\n */\nexport default function useBlockToolbarPopoverProps( {\n\tcontentElement,\n\tclientId,\n} ) {\n\tconst selectedBlockElement = useBlockElement( clientId );\n\tconst [ toolbarHeight, setToolbarHeight ] = useState( 0 );\n\tconst [ props, setProps ] = useState( () =>\n\t\tgetProps( contentElement, selectedBlockElement, toolbarHeight )\n\t);\n\tconst blockIndex = useSelect(\n\t\t( select ) => select( blockEditorStore ).getBlockIndex( clientId ),\n\t\t[ clientId ]\n\t);\n\n\tconst popoverRef = useRefEffect( ( popoverNode ) => {\n\t\tsetToolbarHeight( popoverNode.offsetHeight );\n\t}, [] );\n\n\tconst updateProps = useCallback(\n\t\t() =>\n\t\t\tsetProps(\n\t\t\t\tgetProps( contentElement, selectedBlockElement, toolbarHeight )\n\t\t\t),\n\t\t[ contentElement, selectedBlockElement, toolbarHeight ]\n\t);\n\n\t// Update props when the block is moved. This also ensures the props are\n\t// correct on initial mount, and when the selected block or content element\n\t// changes (since the callback ref will update).\n\tuseLayoutEffect( updateProps, [ blockIndex, updateProps ] );\n\n\t// Update props when the viewport is resized or the block is resized.\n\tuseLayoutEffect( () => {\n\t\tif ( ! contentElement || ! selectedBlockElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update the toolbar props on viewport resize.\n\t\tconst contentView = contentElement?.ownerDocument?.defaultView;\n\t\tcontentView?.addEventHandler?.( 'resize', updateProps );\n\n\t\t// Update the toolbar props on block resize.\n\t\tlet resizeObserver;\n\t\tconst blockView = selectedBlockElement?.ownerDocument?.defaultView;\n\t\tif ( blockView.ResizeObserver ) {\n\t\t\tresizeObserver = new blockView.ResizeObserver( updateProps );\n\t\t\tresizeObserver.observe( selectedBlockElement );\n\t\t}\n\n\t\treturn () => {\n\t\t\tcontentView?.removeEventHandler?.( 'resize', updateProps );\n\n\t\t\tif ( resizeObserver ) {\n\t\t\t\tresizeObserver.disconnect();\n\t\t\t}\n\t\t};\n\t}, [ updateProps, contentElement, selectedBlockElement ] );\n\n\treturn {\n\t\t...props,\n\t\tref: popoverRef,\n\t};\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-tools/use-block-toolbar-popover-props.js"],"names":["COMMON_PROPS","placement","DEFAULT_PROPS","flip","shift","RESTRICTED_HEIGHT_PROPS","getProps","contentElement","selectedBlockElement","scrollContainer","toolbarHeight","isSticky","scrollTop","blockRect","getBoundingClientRect","contentRect","topOfContentElementInViewport","top","viewportHeight","ownerDocument","documentElement","clientHeight","restrictedTopArea","hasSpaceForToolbarAbove","isBlockTallerThanViewport","height","useBlockToolbarPopoverProps","clientId","setToolbarHeight","blockIndex","select","getBlockIndex","getBlockAttributes","blockEditorStore","props","setProps","popoverRef","popoverNode","offsetHeight","updateProps","contentView","defaultView","addEventHandler","resizeObserver","blockView","ResizeObserver","observe","removeEventHandler","disconnect","ref"],"mappings":";;;;;;;AAGA;;AACA;;AACA;;AACA;;AAUA;;AACA;;AACA;;AAlBA;AACA;AACA;;AAWA;AACA;AACA;AAKA,MAAMA,YAAY,GAAG;AACpBC,EAAAA,SAAS,EAAE;AADS,CAArB,C,CAIA;AACA;AACA;;AACA,MAAMC,aAAa,GAAG,EACrB,GAAGF,YADkB;AAErBG,EAAAA,IAAI,EAAE,KAFe;AAGrBC,EAAAA,KAAK,E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AcU,WAAd,CAA9B,EArDG,CAuDH;;AACA,gCAAiB,MAAM;AAAA;;AACtB,QAAK,CAAEhC,cAAF,IAAoB,CAAEC,oBAA3B,EAAkD;AACjD;AACA,KAHqB,CAKtB;;;AACA,UAAMgC,WAAW,GAAGjC,cAAH,aAAGA,cAAH,gDAAGA,cAAc,CAAEY,aAAnB,0DAAG,sBAA+BsB,WAAnD;AACAD,IAAAA,WAAW,SAAX,IAAAA,WAAW,WAAX,qCAAAA,WAAW,CAAEE,eAAb,qFAAAF,WAAW,EAAqB,QAArB,EAA+BD,WAA/B,CAAX,CAPsB,CAStB;;AACA,QAAII,cAAJ;AACA,UAAMC,SAAS,GAAGpC,oBAAH,aAAGA,oBAAH,gDAAGA,oBAAoB,CAAEW,aAAzB,0DAAG,sBAAqCsB,WAAvD;;AACA,QAAKG,SAAS,CAACC,cAAf,EAAgC;AAC/BF,MAAAA,cAAc,GAAG,IAAIC,SAAS,CAACC,cAAd,CAA8BN,WAA9B,CAAjB;AACAI,MAAAA,cAAc,CAACG,OAAf,CAAwBtC,oBAAxB;AACA;;AAED,WAAO,MAAM;AAAA;;AACZgC,MAAAA,WAAW,SAAX,IAAAA,WAAW,WAAX,qCAAAA,WAAW,CAAEO,kBAAb,qFAAAP,WAAW,EAAwB,QAAxB,EAAkCD,WAAlC,CAAX;;AAEA,UAAKI,cAAL,EAAsB;AACrBA,QAAAA,cAAc,CAACK,UAAf;AACA;AACD,KAND;AAOA,GAxBD,EAwBG,CAAET,WAAF,EAAehC,cAAf,EAA+BC,oBAA/B,CAxBH;AA0BA,SAAO,EACN,GAAG0B,KADG;AAENe,IAAAA,GAAG,EAAEb;AAFC,GAAP;AAIA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useRefEffect } from '@wordpress/compose';\nimport { useSelect } from '@wordpress/data';\nimport { getScrollContainer } from '@wordpress/dom';\nimport {\n\tuseCallback,\n\tuseLayoutEffect,\n\tuseMemo,\n\tuseState,\n} from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../store';\nimport { __unstableUseBlockElement as useBlockElement } from '../block-list/use-block-props/use-block-refs';\nimport { hasStickyOrFixedPositionValue } from '../../hooks/position';\n\nconst COMMON_PROPS = {\n\tplacement: 'top-start',\n};\n\n// By default the toolbar sets the `shift` prop. If the user scrolls the page\n// down the toolbar will stay on screen by adopting a sticky position at the\n// top of the viewport.\nconst DEFAULT_PROPS = {\n\t...COMMON_PROPS,\n\tflip: false,\n\tshift: true,\n};\n\n// When there isn't enough height between the top of the block and the editor\n// canvas, the `shift` prop is set to `false`, as it will cause the block to be\n// obscured. The `flip` behavior is enabled, which positions the toolbar below\n// the block. This only happens if the block is smaller than the viewport, as\n// otherwise the toolbar will be off-screen.\nconst RESTRICTED_HEIGHT_PROPS = {\n\t...COMMON_PROPS,\n\tflip: true,\n\tshift: false,\n};\n\n/**\n * Get the popover props for the block toolbar, determined by the space at the top of the canvas and the toolbar height.\n *\n * @param {Element} contentElement The DOM element that represents the editor content or canvas.\n * @param {Element} selectedBlockElement The outer DOM element of the first selected block.\n * @param {Element} scrollContainer The scrollable container for the contentElement.\n * @param {number} toolbarHeight The height of the toolbar in pixels.\n * @param {boolean} isSticky Whether or not the selected block is sticky or fixed.\n *\n * @return {Object} The popover props used to determine the position of the toolbar.\n */\nfunction getProps(\n\tcontentElement,\n\tselectedBlockElement,\n\tscrollContainer,\n\ttoolbarHeight,\n\tisSticky\n) {\n\tif ( ! contentElement || ! selectedBlockElement ) {\n\t\treturn DEFAULT_PROPS;\n\t}\n\n\t// Get how far the content area has been scrolled.\n\tconst scrollTop = scrollContainer?.scrollTop || 0;\n\n\tconst blockRect = selectedBlockElement.getBoundingClientRect();\n\tconst contentRect = contentElement.getBoundingClientRect();\n\n\t// Get the vertical position of top of the visible content area.\n\tconst topOfContentElementInViewport = scrollTop + contentRect.top;\n\n\t// The document element's clientHeight represents the viewport height.\n\tconst viewportHeight =\n\t\tcontentElement.ownerDocument.documentElement.clientHeight;\n\n\t// The restricted height area is calculated as the sum of the\n\t// vertical position of the visible content area, plus the height\n\t// of the block toolbar.\n\tconst restrictedTopArea = topOfContentElementInViewport + toolbarHeight;\n\tconst hasSpaceForToolbarAbove = blockRect.top > restrictedTopArea;\n\n\tconst isBlockTallerThanViewport =\n\t\tblockRect.height > viewportHeight - toolbarHeight;\n\n\t// Sticky blocks are treated as if they will never have enough space for the toolbar above.\n\tif (\n\t\t! isSticky &&\n\t\t( hasSpaceForToolbarAbove || isBlockTallerThanViewport )\n\t) {\n\t\treturn DEFAULT_PROPS;\n\t}\n\n\treturn RESTRICTED_HEIGHT_PROPS;\n}\n\n/**\n * Determines the desired popover positioning behavior, returning a set of appropriate props.\n *\n * @param {Object} elements\n * @param {Element} elements.contentElement The DOM element that represents the editor content or canvas.\n * @param {string} elements.clientId The clientId of the first selected block.\n *\n * @return {Object} The popover props used to determine the position of the toolbar.\n */\nexport default function useBlockToolbarPopoverProps( {\n\tcontentElement,\n\tclientId,\n} ) {\n\tconst selectedBlockElement = useBlockElement( clientId );\n\tconst [ toolbarHeight, setToolbarHeight ] = useState( 0 );\n\tconst { blockIndex, isSticky } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { getBlockIndex, getBlockAttributes } =\n\t\t\t\tselect( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tblockIndex: getBlockIndex( clientId ),\n\t\t\t\tisSticky: hasStickyOrFixedPositionValue(\n\t\t\t\t\tgetBlockAttributes( clientId )\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\tconst scrollContainer = useMemo( () => {\n\t\tif ( ! contentElement ) {\n\t\t\treturn;\n\t\t}\n\t\treturn getScrollContainer( contentElement );\n\t}, [ contentElement ] );\n\tconst [ props, setProps ] = useState( () =>\n\t\tgetProps(\n\t\t\tcontentElement,\n\t\t\tselectedBlockElement,\n\t\t\tscrollContainer,\n\t\t\ttoolbarHeight,\n\t\t\tisSticky\n\t\t)\n\t);\n\n\tconst popoverRef = useRefEffect( ( popoverNode ) => {\n\t\tsetToolbarHeight( popoverNode.offsetHeight );\n\t}, [] );\n\n\tconst updateProps = useCallback(\n\t\t() =>\n\t\t\tsetProps(\n\t\t\t\tgetProps(\n\t\t\t\t\tcontentElement,\n\t\t\t\t\tselectedBlockElement,\n\t\t\t\t\tscrollContainer,\n\t\t\t\t\ttoolbarHeight,\n\t\t\t\t\tisSticky\n\t\t\t\t)\n\t\t\t),\n\t\t[ contentElement, selectedBlockElement, scrollContainer, toolbarHeight ]\n\t);\n\n\t// Update props when the block is moved. This also ensures the props are\n\t// correct on initial mount, and when the selected block or content element\n\t// changes (since the callback ref will update).\n\tuseLayoutEffect( updateProps, [ blockIndex, updateProps ] );\n\n\t// Update props when the viewport is resized or the block is resized.\n\tuseLayoutEffect( () => {\n\t\tif ( ! contentElement || ! selectedBlockElement ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Update the toolbar props on viewport resize.\n\t\tconst contentView = contentElement?.ownerDocument?.defaultView;\n\t\tcontentView?.addEventHandler?.( 'resize', updateProps );\n\n\t\t// Update the toolbar props on block resize.\n\t\tlet resizeObserver;\n\t\tconst blockView = selectedBlockElement?.ownerDocument?.defaultView;\n\t\tif ( blockView.ResizeObserver ) {\n\t\t\tresizeObserver = new blockView.ResizeObserver( updateProps );\n\t\t\tresizeObserver.observe( selectedBlockElement );\n\t\t}\n\n\t\treturn () => {\n\t\t\tcontentView?.removeEventHandler?.( 'resize', updateProps );\n\n\t\t\tif ( resizeObserver ) {\n\t\t\t\tresizeObserver.disconnect();\n\t\t\t}\n\t\t};\n\t}, [ updateProps, contentElement, selectedBlockElement ] );\n\n\treturn {\n\t\t...props,\n\t\tref: popoverRef,\n\t};\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.alignTop = exports.alignCenter = exports.alignBottom = void 0;
6
+ exports.spaceBetween = exports.alignTop = exports.alignStretch = exports.alignCenter = exports.alignBottom = void 0;
7
7
 
8
8
  var _element = require("@wordpress/element");
9
9
 
@@ -33,4 +33,18 @@ const alignTop = (0, _element.createElement)(_components.SVG, {
33
33
  d: "M9 20h6V9H9v11zM4 4v1.5h16V4H4z"
34
34
  }));
35
35
  exports.alignTop = alignTop;
36
+ const alignStretch = (0, _element.createElement)(_components.SVG, {
37
+ xmlns: "http://www.w3.org/2000/svg",
38
+ viewBox: "0 0 24 24"
39
+ }, (0, _element.createElement)(_components.Path, {
40
+ d: "M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z"
41
+ }));
42
+ exports.alignStretch = alignStretch;
43
+ const spaceBetween = (0, _element.createElement)(_components.SVG, {
44
+ xmlns: "http://www.w3.org/2000/svg",
45
+ viewBox: "0 0 24 24"
46
+ }, (0, _element.createElement)(_components.Path, {
47
+ d: "M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z"
48
+ }));
49
+ exports.spaceBetween = spaceBetween;
36
50
  //# sourceMappingURL=icons.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-vertical-alignment-control/icons.js"],"names":["alignBottom","alignCenter","alignTop"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,WAAW,GACvB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM;;AAMA,MAAMC,WAAW,GACvB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM;;AAMA,MAAMC,QAAQ,GACpB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nexport const alignBottom = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z\" />\n\t</SVG>\n);\n\nexport const alignCenter = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z\" />\n\t</SVG>\n);\n\nexport const alignTop = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9 20h6V9H9v11zM4 4v1.5h16V4H4z\" />\n\t</SVG>\n);\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-vertical-alignment-control/icons.js"],"names":["alignBottom","alignCenter","alignTop","alignStretch","spaceBetween"],"mappings":";;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGO,MAAMA,WAAW,GACvB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM;;AAMA,MAAMC,WAAW,GACvB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM;;AAMA,MAAMC,QAAQ,GACpB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM;;AAMA,MAAMC,YAAY,GACxB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM;;AAMA,MAAMC,YAAY,GACxB,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,4BAAX;AAAwC,EAAA,OAAO,EAAC;AAAhD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADM","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { Path, SVG } from '@wordpress/components';\n\nexport const alignBottom = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M15 4H9v11h6V4zM4 18.5V20h16v-1.5H4z\" />\n\t</SVG>\n);\n\nexport const alignCenter = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M20 11h-5V4H9v7H4v1.5h5V20h6v-7.5h5z\" />\n\t</SVG>\n);\n\nexport const alignTop = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M9 20h6V9H9v11zM4 4v1.5h16V4H4z\" />\n\t</SVG>\n);\n\nexport const alignStretch = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M4 4L20 4L20 5.5L4 5.5L4 4ZM10 7L14 7L14 17L10 17L10 7ZM20 18.5L4 18.5L4 20L20 20L20 18.5Z\" />\n\t</SVG>\n);\n\nexport const spaceBetween = (\n\t<SVG xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\">\n\t\t<Path d=\"M7 4H17V8L7 8V4ZM7 16L17 16V20L7 20V16ZM20 11.25H4V12.75H20V11.25Z\" />\n\t</SVG>\n);\n"]}
@@ -36,13 +36,18 @@ const BLOCK_ALIGNMENTS_CONTROLS = {
36
36
  bottom: {
37
37
  icon: _icons.alignBottom,
38
38
  title: (0, _i18n._x)('Align bottom', 'Block vertical alignment setting')
39
+ },
40
+ stretch: {
41
+ icon: _icons.alignStretch,
42
+ title: (0, _i18n._x)('Stretch to fill', 'Block vertical alignment setting')
43
+ },
44
+ 'space-between': {
45
+ icon: _icons.spaceBetween,
46
+ title: (0, _i18n._x)('Space between', 'Block vertical alignment setting')
39
47
  }
40
48
  };
41
49
  const DEFAULT_CONTROLS = ['top', 'center', 'bottom'];
42
50
  const DEFAULT_CONTROL = 'top';
43
- const POPOVER_PROPS = {
44
- variant: 'toolbar'
45
- };
46
51
 
47
52
  function BlockVerticalAlignmentUI(_ref) {
48
53
  let {
@@ -64,7 +69,7 @@ function BlockVerticalAlignmentUI(_ref) {
64
69
  isCollapsed
65
70
  } : {
66
71
  popoverProps: {
67
- POPOVER_PROPS
72
+ variant: 'toolbar'
68
73
  }
69
74
  };
70
75
  return (0, _element.createElement)(UIComponent, (0, _extends2.default)({
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/block-vertical-alignment-control/ui.js"],"names":["BLOCK_ALIGNMENTS_CONTROLS","top","icon","alignTop","title","center","alignCenter","bottom","alignBottom","DEFAULT_CONTROLS","DEFAULT_CONTROL","POPOVER_PROPS","variant","BlockVerticalAlignmentUI","value","onChange","controls","isCollapsed","isToolbar","applyOrUnset","align","undefined","activeAlignment","defaultAlignmentControl","UIComponent","ToolbarGroup","ToolbarDropdownMenu","extraProps","popoverProps","map","control","isActive","role","onClick"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAGA,MAAMA,yBAAyB,GAAG;AACjCC,EAAAA,GAAG,EAAE;AACJC,IAAAA,IAAI,EAAEC,eADF;AAEJC,IAAAA,KAAK,EAAE,cAAI,WAAJ,EAAiB,kCAAjB;AAFH,GAD4B;AAKjCC,EAAAA,MAAM,EAAE;AACPH,IAAAA,IAAI,EAAEI,kBADC;AA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AAO,EACN,GAAG9B,yBAAyB,CAAE8B,OAAF,CADtB;AAENC,QAAAA,QAAQ,EAAEjB,KAAK,KAAKgB,OAFd;AAGNE,QAAAA,IAAI,EAAEf,WAAW,GAAG,eAAH,GAAqBI,SAHhC;AAINY,QAAAA,OAAO,EAAEd,YAAY,CAAEW,OAAF;AAJf,OAAP;AAMA,KAPU;AAVZ,KAkBMH,UAlBN,EADD;AAsBA;AAED;AACA;AACA;;;eACed,wB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { ToolbarGroup, ToolbarDropdownMenu } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { alignTop, alignCenter, alignBottom } from './icons';\n\nconst BLOCK_ALIGNMENTS_CONTROLS = {\n\ttop: {\n\t\ticon: alignTop,\n\t\ttitle: _x( 'Align top', 'Block vertical alignment setting' ),\n\t},\n\tcenter: {\n\t\ticon: alignCenter,\n\t\ttitle: _x( 'Align middle', 'Block vertical alignment setting' ),\n\t},\n\tbottom: {\n\t\ticon: alignBottom,\n\t\ttitle: _x( 'Align bottom', 'Block vertical alignment setting' ),\n\t},\n};\n\nconst DEFAULT_CONTROLS = [ 'top', 'center', 'bottom' ];\nconst DEFAULT_CONTROL = 'top';\n\nconst POPOVER_PROPS = {\n\tvariant: 'toolbar',\n};\n\nfunction BlockVerticalAlignmentUI( {\n\tvalue,\n\tonChange,\n\tcontrols = DEFAULT_CONTROLS,\n\tisCollapsed = true,\n\tisToolbar,\n} ) {\n\tfunction applyOrUnset( align ) {\n\t\treturn () => onChange( value === align ? undefined : align );\n\t}\n\n\tconst activeAlignment = BLOCK_ALIGNMENTS_CONTROLS[ value ];\n\tconst defaultAlignmentControl =\n\t\tBLOCK_ALIGNMENTS_CONTROLS[ DEFAULT_CONTROL ];\n\n\tconst UIComponent = isToolbar ? ToolbarGroup : ToolbarDropdownMenu;\n\tconst extraProps = isToolbar\n\t\t? { isCollapsed }\n\t\t: { popoverProps: { POPOVER_PROPS } };\n\n\treturn (\n\t\t<UIComponent\n\t\t\ticon={\n\t\t\t\tactiveAlignment\n\t\t\t\t\t? activeAlignment.icon\n\t\t\t\t\t: defaultAlignmentControl.icon\n\t\t\t}\n\t\t\tlabel={ _x(\n\t\t\t\t'Change vertical alignment',\n\t\t\t\t'Block vertical alignment setting label'\n\t\t\t) }\n\t\t\tcontrols={ controls.map( ( control ) => {\n\t\t\t\treturn {\n\t\t\t\t\t...BLOCK_ALIGNMENTS_CONTROLS[ control ],\n\t\t\t\t\tisActive: value === control,\n\t\t\t\t\trole: isCollapsed ? 'menuitemradio' : undefined,\n\t\t\t\t\tonClick: applyOrUnset( control ),\n\t\t\t\t};\n\t\t\t} ) }\n\t\t\t{ ...extraProps }\n\t\t/>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-toolbar/README.md\n */\nexport default BlockVerticalAlignmentUI;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/block-vertical-alignment-control/ui.js"],"names":["BLOCK_ALIGNMENTS_CONTROLS","top","icon","alignTop","title","center","alignCenter","bottom","alignBottom","stretch","alignStretch","spaceBetween","DEFAULT_CONTROLS","DEFAULT_CONTROL","BlockVerticalAlignmentUI","value","onChange","controls","isCollapsed","isToolbar","applyOrUnset","align","undefined","activeAlignment","defaultAlignmentControl","UIComponent","ToolbarGroup","ToolbarDropdownMenu","extraProps","popoverProps","variant","map","control","isActive","role","onClick"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,yBAAyB,GAAG;AACjCC,EAAAA,GAAG,EAAE;AACJC,IAAAA,IAAI,EAAEC,eADF;AAEJC,IAAAA,KAAK,EAAE,cAAI,WAAJ,EAAiB,kCAAjB;AAFH,GAD4B;AAKjCC,EAAAA,MAAM,EAAE;AACPH,IAAAA,IAAI,EAAEI,kBADC;AAEPF,IAAAA,KAAK,EA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Ae,CAACrB,IADJ,GAEZsB,uBAAuB,CAACtB,IAJ7B;AAMC,IAAA,KAAK,EAAG,cACP,2BADO,EAEP,wCAFO,CANT;AAUC,IAAA,QAAQ,EAAGe,QAAQ,CAACc,GAAT,CAAgBC,OAAF,IAAe;AACvC,aAAO,EACN,GAAGhC,yBAAyB,CAAEgC,OAAF,CADtB;AAENC,QAAAA,QAAQ,EAAElB,KAAK,KAAKiB,OAFd;AAGNE,QAAAA,IAAI,EAAEhB,WAAW,GAAG,eAAH,GAAqBI,SAHhC;AAINa,QAAAA,OAAO,EAAEf,YAAY,CAAEY,OAAF;AAJf,OAAP;AAMA,KAPU;AAVZ,KAkBMJ,UAlBN,EADD;AAsBA;AAED;AACA;AACA;;;eACed,wB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x } from '@wordpress/i18n';\nimport { ToolbarGroup, ToolbarDropdownMenu } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport {\n\talignTop,\n\talignCenter,\n\talignBottom,\n\talignStretch,\n\tspaceBetween,\n} from './icons';\n\nconst BLOCK_ALIGNMENTS_CONTROLS = {\n\ttop: {\n\t\ticon: alignTop,\n\t\ttitle: _x( 'Align top', 'Block vertical alignment setting' ),\n\t},\n\tcenter: {\n\t\ticon: alignCenter,\n\t\ttitle: _x( 'Align middle', 'Block vertical alignment setting' ),\n\t},\n\tbottom: {\n\t\ticon: alignBottom,\n\t\ttitle: _x( 'Align bottom', 'Block vertical alignment setting' ),\n\t},\n\tstretch: {\n\t\ticon: alignStretch,\n\t\ttitle: _x( 'Stretch to fill', 'Block vertical alignment setting' ),\n\t},\n\t'space-between': {\n\t\ticon: spaceBetween,\n\t\ttitle: _x( 'Space between', 'Block vertical alignment setting' ),\n\t},\n};\n\nconst DEFAULT_CONTROLS = [ 'top', 'center', 'bottom' ];\nconst DEFAULT_CONTROL = 'top';\n\nfunction BlockVerticalAlignmentUI( {\n\tvalue,\n\tonChange,\n\tcontrols = DEFAULT_CONTROLS,\n\tisCollapsed = true,\n\tisToolbar,\n} ) {\n\tfunction applyOrUnset( align ) {\n\t\treturn () => onChange( value === align ? undefined : align );\n\t}\n\n\tconst activeAlignment = BLOCK_ALIGNMENTS_CONTROLS[ value ];\n\tconst defaultAlignmentControl =\n\t\tBLOCK_ALIGNMENTS_CONTROLS[ DEFAULT_CONTROL ];\n\n\tconst UIComponent = isToolbar ? ToolbarGroup : ToolbarDropdownMenu;\n\tconst extraProps = isToolbar\n\t\t? { isCollapsed }\n\t\t: { popoverProps: { variant: 'toolbar' } };\n\n\treturn (\n\t\t<UIComponent\n\t\t\ticon={\n\t\t\t\tactiveAlignment\n\t\t\t\t\t? activeAlignment.icon\n\t\t\t\t\t: defaultAlignmentControl.icon\n\t\t\t}\n\t\t\tlabel={ _x(\n\t\t\t\t'Change vertical alignment',\n\t\t\t\t'Block vertical alignment setting label'\n\t\t\t) }\n\t\t\tcontrols={ controls.map( ( control ) => {\n\t\t\t\treturn {\n\t\t\t\t\t...BLOCK_ALIGNMENTS_CONTROLS[ control ],\n\t\t\t\t\tisActive: value === control,\n\t\t\t\t\trole: isCollapsed ? 'menuitemradio' : undefined,\n\t\t\t\t\tonClick: applyOrUnset( control ),\n\t\t\t\t};\n\t\t\t} ) }\n\t\t\t{ ...extraProps }\n\t\t/>\n\t);\n}\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/block-vertical-alignment-toolbar/README.md\n */\nexport default BlockVerticalAlignmentUI;\n"]}
@@ -99,7 +99,9 @@ const BlockColorsStyleSelector = _ref4 => {
99
99
  version: '6.3'
100
100
  });
101
101
  return (0, _element.createElement)(_components.Dropdown, {
102
- position: "bottom right",
102
+ popoverProps: {
103
+ placement: 'bottom-start'
104
+ },
103
105
  className: "block-library-colors-selector",
104
106
  contentClassName: "block-library-colors-selector__popover",
105
107
  renderToggle: renderToggleComponent(other),
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"names":["ColorSelectorSVGIcon","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","DOWN","preventDefault","BlockColorsStyleSelector","children","other","alternative","since","version"],"mappings":";;;;;;;;;;;AAGA;;AAOA;;AACA;;AACA;;AAZA;AACA;AACA;AAYA,MAAMA,oBAAoB,GAAG,MAC5B,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,6BAAX;AAAyC,EAAA,OAAO,EAAC;AAAjD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADD;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,iBAAiB,GAAG,QAA4B;AAAA,MAA1B;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA0B;AACrD,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AACC,IAAA,SAAS,EAAI,GAAGA,SAAW,iDAD5B;AAEC,IAAA,KAAK,EAAGD;AAFT,KAIC,4BAAC,oBAAD,OAJD,CADD,CADD;AAUA,CAXD;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,qBAAqB,GAC1B;AAAA,MAAE;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAAF;AAAA,SACA,SAA4B;AAAA,QAA1B;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,KAA0B;;AAC3B,UAAMC,eAAe,GAAKC,KAAF,IAAa;AACpC,UAAK,CAAEF,MAAF,IAAYE,KAAK,CAACC,OAAN,KAAkBC,cAAnC,EAA0C;AACzCF,QAAAA,KAAK,CAACG,cAAN;AACAN,QAAAA,QAAQ;AACR;AACD,KALD;;AAOA,WACC,4BAAC,wBAAD,QACC,4BAAC,yBAAD;AACC,MAAA,SAAS,EAAC,mEADX;AAEC,MAAA,KAAK,EAAG,cAAI,sBAAJ,CAFT;AAGC,MAAA,OAAO,EAAGA,QAHX;AAIC,MAAA,SAAS,EAAGE,eAJb;AAKC,MAAA,IAAI,EACH,4BAAC,eAAD,QACC,4BAAC,SAAD,QACC,4BAAC,iBAAD,OADD,CADD;AANF,MADD,CADD;AAiBA,GA1BD;AAAA,CADD;;AA6BA,MAAMK,wBAAwB,GAAG,SAA8B;AAAA,MAA5B;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAA4B;AAC9D,2BAAa,yCAAb,EAAuD;AACtDC,IAAAA,WAAW,EAAE,oBADyC;AAEtDC,IAAAA,KAAK,EAAE,KAF+C;AAGtDC,IAAAA,OAAO,EAAE;AAH6C,GAAvD;AAMA,SACC,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAC,cADV;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,IAAA,gBAAgB,EAAC,wCAHlB;AAIC,IAAA,YAAY,EAAGf,qBAAqB,CAAEY,KAAF,CAJrC;AAKC,IAAA,aAAa,EAAG,MAAMD;AALvB,IADD;AASA,CAhBD;;eAkBeD,wB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport deprecated from '@wordpress/deprecated';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"https://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent =\n\t( { TextColor, BackgroundColor } ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst openOnArrowDown = ( event ) => {\n\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t\t</BackgroundColor>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => {\n\tdeprecated( `wp.blockEditor.BlockColorsStyleSelector`, {\n\t\talternative: 'block supports API',\n\t\tsince: '6.1',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tposition=\"bottom right\"\n\t\t\tclassName=\"block-library-colors-selector\"\n\t\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\t\trenderToggle={ renderToggleComponent( other ) }\n\t\t\trenderContent={ () => children }\n\t\t/>\n\t);\n};\n\nexport default BlockColorsStyleSelector;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"names":["ColorSelectorSVGIcon","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","DOWN","preventDefault","BlockColorsStyleSelector","children","other","alternative","since","version","placement"],"mappings":";;;;;;;;;;;AAGA;;AAOA;;AACA;;AACA;;AAZA;AACA;AACA;AAYA,MAAMA,oBAAoB,GAAG,MAC5B,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,6BAAX;AAAyC,EAAA,OAAO,EAAC;AAAjD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADD;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,iBAAiB,GAAG,QAA4B;AAAA,MAA1B;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA0B;AACrD,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AACC,IAAA,SAAS,EAAI,GAAGA,SAAW,iDAD5B;AAEC,IAAA,KAAK,EAAGD;AAFT,KAIC,4BAAC,oBAAD,OAJD,CADD,CADD;AAUA,CAXD;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,qBAAqB,GAC1B;AAAA,MAAE;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAAF;AAAA,SACA,SAA4B;AAAA,QAA1B;AAAEC,MAAAA,QAAF;AAAYC,MAAAA;AAAZ,KAA0B;;AAC3B,UAAMC,eAAe,GAAKC,KAAF,IAAa;AACpC,UAAK,CAAEF,MAAF,IAAYE,KAAK,CAACC,OAAN,KAAkBC,cAAnC,EAA0C;AACzCF,QAAAA,KAAK,CAACG,cAAN;AACAN,QAAAA,QAAQ;AACR;AACD,KALD;;AAOA,WACC,4BAAC,wBAAD,QACC,4BAAC,yBAAD;AACC,MAAA,SAAS,EAAC,mEADX;AAEC,MAAA,KAAK,EAAG,cAAI,sBAAJ,CAFT;AAGC,MAAA,OAAO,EAAGA,QAHX;AAIC,MAAA,SAAS,EAAGE,eAJb;AAKC,MAAA,IAAI,EACH,4BAAC,eAAD,QACC,4BAAC,SAAD,QACC,4BAAC,iBAAD,OADD,CADD;AANF,MADD,CADD;AAiBA,GA1BD;AAAA,CADD;;AA6BA,MAAMK,wBAAwB,GAAG,SAA8B;AAAA,MAA5B;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAA4B;AAC9D,2BAAa,yCAAb,EAAuD;AACtDC,IAAAA,WAAW,EAAE,oBADyC;AAEtDC,IAAAA,KAAK,EAAE,KAF+C;AAGtDC,IAAAA,OAAO,EAAE;AAH6C,GAAvD;AAMA,SACC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAG;AAAEC,MAAAA,SAAS,EAAE;AAAb,KADhB;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,IAAA,gBAAgB,EAAC,wCAHlB;AAIC,IAAA,YAAY,EAAGhB,qBAAqB,CAAEY,KAAF,CAJrC;AAKC,IAAA,aAAa,EAAG,MAAMD;AALvB,IADD;AASA,CAhBD;;eAkBeD,wB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport deprecated from '@wordpress/deprecated';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"https://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent =\n\t( { TextColor, BackgroundColor } ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst openOnArrowDown = ( event ) => {\n\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t\t</BackgroundColor>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => {\n\tdeprecated( `wp.blockEditor.BlockColorsStyleSelector`, {\n\t\talternative: 'block supports API',\n\t\tsince: '6.1',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\tclassName=\"block-library-colors-selector\"\n\t\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\t\trenderToggle={ renderToggleComponent( other ) }\n\t\t\trenderContent={ () => children }\n\t\t/>\n\t);\n};\n\nexport default BlockColorsStyleSelector;\n"]}
@@ -93,9 +93,7 @@ function NonDefaultControls(_ref2) {
93
93
  __experimentalHint: (0, _i18n.__)('Enter your own date format')
94
94
  };
95
95
  const [isCustom, setIsCustom] = (0, _element.useState)(() => !!format && !suggestedFormats.includes(format));
96
- return (0, _element.createElement)(_element.Fragment, null, (0, _element.createElement)(_components.BaseControl, {
97
- className: "block-editor-date-format-picker__custom-format-select-control"
98
- }, (0, _element.createElement)(_components.CustomSelectControl, {
96
+ return (0, _element.createElement)(_components.__experimentalVStack, null, (0, _element.createElement)(_components.CustomSelectControl, {
99
97
  __nextUnconstrainedWidth: true,
100
98
  label: (0, _i18n.__)('Choose a format'),
101
99
  options: [...suggestedOptions, customOption],
@@ -112,7 +110,8 @@ function NonDefaultControls(_ref2) {
112
110
  onChange(selectedItem.format);
113
111
  }
114
112
  }
115
- })), isCustom && (0, _element.createElement)(_components.TextControl, {
113
+ }), isCustom && (0, _element.createElement)(_components.TextControl, {
114
+ __nextHasNoMarginBottom: true,
116
115
  label: (0, _i18n.__)('Custom format'),
117
116
  hideLabelFromVision: true,
118
117
  help: (0, _element.createInterpolateElement)((0, _i18n.__)('Enter a date or time <Link>format string</Link>.'), {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/date-format-picker/index.js"],"names":["EXAMPLE_DATE","Date","DateFormatPicker","format","defaultFormat","onChange","checked","NonDefaultControls","suggestedFormats","Set","suggestedOptions","map","suggestedFormat","index","key","name","customOption","className","__experimentalHint","isCustom","setIsCustom","includes","find","option","selectedItem","Link","value"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AANA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,IAAIC,IAAJ,CAAU,IAAV,EAAgB,CAAhB,EAAmB,EAAnB,CAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASC,gBAAT,OAIX;AAAA,MAJsC;AACzCC,IAAAA,MADyC;AAEzCC,IAAAA,aAFyC;AAGzCC,IAAAA;AAHyC,GAItC;AACH,SACC;AAAU,IAAA,SAAS,EAAC;AAApB,KACC,4BAAC,0BAAD;AAAgB,IAAA,EAAE,EAAC;AAAnB,KAA8B,cAAI,aAAJ,CAA9B,CADD,EAEC,4BAAC,yBAAD;AACC,IAAA,KAAK,EACJ,qDACG,cAAI,gBAAJ,CADH,EAEC;AAAM,MAAA,SAAS,EAAC;AAAhB,OACG,oBAAUD,aAAV,EAAyBJ,YAAzB,CADH,CAFD,CAFF;AASC,IAAA,OAAO,EAAG,CAAEG,MATb;AAUC,IAAA,QAAQ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AA3B,CADY,CAAlC;AAIA,SACC,qDACC,4BAAC,uBAAD;AAAa,IAAA,SAAS,EAAC;AAAvB,KACC,4BAAC,+BAAD;AACC,IAAA,wBAAwB,MADzB;AAEC,IAAA,KAAK,EAAG,cAAI,iBAAJ,CAFT;AAGC,IAAA,OAAO,EAAG,CAAE,GAAGO,gBAAL,EAAuBM,YAAvB,CAHX;AAIC,IAAA,KAAK,EACJG,QAAQ,GACLH,YADK,4BAELN,gBAAgB,CAACY,IAAjB,CACEC,MAAF,IAAcA,MAAM,CAACpB,MAAP,KAAkBA,MADhC,CAFK,yEAIAa,YATV;AAWC,IAAA,QAAQ,EAAG,SAAwB;AAAA,UAAtB;AAAEQ,QAAAA;AAAF,OAAsB;;AAClC,UAAKA,YAAY,KAAKR,YAAtB,EAAqC;AACpCI,QAAAA,WAAW,CAAE,IAAF,CAAX;AACA,OAFD,MAEO;AACNA,QAAAA,WAAW,CAAE,KAAF,CAAX;AACAf,QAAAA,QAAQ,CAAEmB,YAAY,CAACrB,MAAf,CAAR;AACA;AACD;AAlBF,IADD,CADD,EAuBGgB,QAAQ,IACT,4BAAC,uBAAD;AACC,IAAA,KAAK,EAAG,cAAI,eAAJ,CADT;AAEC,IAAA,mBAAmB,MAFpB;AAGC,IAAA,IAAI,EAAG,uCACN,cACC,kDADD,CADM,EAIN;AACCM,MAAAA,IAAI,EACH,4BAAC,wBAAD;AACC,QAAA,IAAI,EAAG,cACN,iEADM;AADR;AAFF,KAJM,CAHR;AAiBC,IAAA,KAAK,EAAGtB,MAjBT;AAkBC,IAAA,QAAQ,EAAKuB,KAAF,IAAarB,QAAQ,CAAEqB,KAAF;AAlBjC,IAxBF,CADD;AAgDA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, __ } from '@wordpress/i18n';\nimport { dateI18n } from '@wordpress/date';\nimport { useState, createInterpolateElement } from '@wordpress/element';\nimport {\n\tTextControl,\n\tExternalLink,\n\tVisuallyHidden,\n\tCustomSelectControl,\n\tBaseControl,\n\tToggleControl,\n} from '@wordpress/components';\n\n// So that we can illustrate the different formats in the dropdown properly,\n// show a date that has a day greater than 12 and a month with more than three\n// letters. Here we're using 2022-01-25 which is when WordPress 5.9 was\n// released.\nconst EXAMPLE_DATE = new Date( 2022, 0, 25 );\n\n/**\n * The `DateFormatPicker` component renders controls that let the user choose a\n * _date format_. That is, how they want their dates to be formatted.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/date-format-picker/README.md\n *\n * @param {Object} props\n * @param {string|null} props.format The selected date\n * format. If\n * `null`,\n * _Default_ is\n * selected.\n * @param {string} props.defaultFormat The date format that\n * will be used if the\n * user selects\n * 'Default'.\n * @param {( format: string|null ) => void} props.onChange Called when a\n * selection is\n * made. If `null`,\n * _Default_ is\n * selected.\n */\nexport default function DateFormatPicker( {\n\tformat,\n\tdefaultFormat,\n\tonChange,\n} ) {\n\treturn (\n\t\t<fieldset className=\"block-editor-date-format-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Date format' ) }</VisuallyHidden>\n\t\t\t<ToggleControl\n\t\t\t\tlabel={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ __( 'Default format' ) }\n\t\t\t\t\t\t<span className=\"block-editor-date-format-picker__default-format-toggle-control__hint\">\n\t\t\t\t\t\t\t{ dateI18n( defaultFormat, EXAMPLE_DATE ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tchecked={ ! format }\n\t\t\t\tonChange={ ( checked ) =>\n\t\t\t\t\tonChange( checked ? null : defaultFormat )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ format && (\n\t\t\t\t<NonDefaultControls format={ format } onChange={ onChange } />\n\t\t\t) }\n\t\t</fieldset>\n\t);\n}\n\nfunction NonDefaultControls( { format, onChange } ) {\n\t// Suggest a short format, medium format, long format, and a standardised\n\t// (YYYY-MM-DD) format. The short, medium, and long formats are localised as\n\t// different languages have different ways of writing these. For example, 'F\n\t// j, Y' (April 20, 2022) in American English (en_US) is 'j. F Y' (20. April\n\t// 2022) in German (de). The resultant array is de-duplicated as some\n\t// languages will use the same format string for short, medium, and long\n\t// formats.\n\tconst suggestedFormats = [\n\t\t...new Set( [\n\t\t\t'Y-m-d',\n\t\t\t_x( 'n/j/Y', 'short date format' ),\n\t\t\t_x( 'n/j/Y g:i A', 'short date format with time' ),\n\t\t\t_x( 'M j, Y', 'medium date format' ),\n\t\t\t_x( 'M j, Y g:i A', 'medium date format with time' ),\n\t\t\t_x( 'F j, Y', 'long date format' ),\n\t\t\t_x( 'M j', 'short date format without the year' ),\n\t\t] ),\n\t];\n\n\tconst suggestedOptions = suggestedFormats.map(\n\t\t( suggestedFormat, index ) => ( {\n\t\t\tkey: `suggested-${ index }`,\n\t\t\tname: dateI18n( suggestedFormat, EXAMPLE_DATE ),\n\t\t\tformat: suggestedFormat,\n\t\t} )\n\t);\n\tconst customOption = {\n\t\tkey: 'custom',\n\t\tname: __( 'Custom' ),\n\t\tclassName:\n\t\t\t'block-editor-date-format-picker__custom-format-select-control__custom-option',\n\t\t__experimentalHint: __( 'Enter your own date format' ),\n\t};\n\n\tconst [ isCustom, setIsCustom ] = useState(\n\t\t() => !! format && ! suggestedFormats.includes( format )\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<BaseControl className=\"block-editor-date-format-picker__custom-format-select-control\">\n\t\t\t\t<CustomSelectControl\n\t\t\t\t\t__nextUnconstrainedWidth\n\t\t\t\t\tlabel={ __( 'Choose a format' ) }\n\t\t\t\t\toptions={ [ ...suggestedOptions, customOption ] }\n\t\t\t\t\tvalue={\n\t\t\t\t\t\tisCustom\n\t\t\t\t\t\t\t? customOption\n\t\t\t\t\t\t\t: suggestedOptions.find(\n\t\t\t\t\t\t\t\t\t( option ) => option.format === format\n\t\t\t\t\t\t\t ) ?? customOption\n\t\t\t\t\t}\n\t\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\t\tif ( selectedItem === customOption ) {\n\t\t\t\t\t\t\tsetIsCustom( true );\n\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\tsetIsCustom( false );\n\t\t\t\t\t\t\tonChange( selectedItem.format );\n\t\t\t\t\t\t}\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t</BaseControl>\n\t\t\t{ isCustom && (\n\t\t\t\t<TextControl\n\t\t\t\t\tlabel={ __( 'Custom format' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\thelp={ createInterpolateElement(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Enter a date or time <Link>format string</Link>.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLink: (\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/formatting-date-and-time/'\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),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvalue={ format }\n\t\t\t\t\tonChange={ ( value ) => onChange( value ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/date-format-picker/index.js"],"names":["EXAMPLE_DATE","Date","DateFormatPicker","format","defaultFormat","onChange","checked","NonDefaultControls","suggestedFormats","Set","suggestedOptions","map","suggestedFormat","index","key","name","customOption","className","__experimentalHint","isCustom","setIsCustom","includes","find","option","selectedItem","Link","value"],"mappings":";;;;;;;AAKA;;AAFA;;AACA;;AAEA;;AANA;AACA;AACA;AAaA;AACA;AACA;AACA;AACA,MAAMA,YAAY,GAAG,IAAIC,IAAJ,CAAU,IAAV,EAAgB,CAAhB,EAAmB,EAAnB,CAArB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;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IAAI,EAAG,uCACN,cACC,kDADD,CADM,EAIN;AACCM,MAAAA,IAAI,EACH,4BAAC,wBAAD;AACC,QAAA,IAAI,EAAG,cACN,iEADM;AADR;AAFF,KAJM,CAJR;AAkBC,IAAA,KAAK,EAAGtB,MAlBT;AAmBC,IAAA,QAAQ,EAAKuB,KAAF,IAAarB,QAAQ,CAAEqB,KAAF;AAnBjC,IAtBF,CADD;AA+CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { _x, __ } from '@wordpress/i18n';\nimport { dateI18n } from '@wordpress/date';\nimport { useState, createInterpolateElement } from '@wordpress/element';\nimport {\n\tTextControl,\n\tExternalLink,\n\tVisuallyHidden,\n\tCustomSelectControl,\n\tToggleControl,\n\t__experimentalVStack as VStack,\n} from '@wordpress/components';\n\n// So that we can illustrate the different formats in the dropdown properly,\n// show a date that has a day greater than 12 and a month with more than three\n// letters. Here we're using 2022-01-25 which is when WordPress 5.9 was\n// released.\nconst EXAMPLE_DATE = new Date( 2022, 0, 25 );\n\n/**\n * The `DateFormatPicker` component renders controls that let the user choose a\n * _date format_. That is, how they want their dates to be formatted.\n *\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/date-format-picker/README.md\n *\n * @param {Object} props\n * @param {string|null} props.format The selected date\n * format. If\n * `null`,\n * _Default_ is\n * selected.\n * @param {string} props.defaultFormat The date format that\n * will be used if the\n * user selects\n * 'Default'.\n * @param {( format: string|null ) => void} props.onChange Called when a\n * selection is\n * made. If `null`,\n * _Default_ is\n * selected.\n */\nexport default function DateFormatPicker( {\n\tformat,\n\tdefaultFormat,\n\tonChange,\n} ) {\n\treturn (\n\t\t<fieldset className=\"block-editor-date-format-picker\">\n\t\t\t<VisuallyHidden as=\"legend\">{ __( 'Date format' ) }</VisuallyHidden>\n\t\t\t<ToggleControl\n\t\t\t\tlabel={\n\t\t\t\t\t<>\n\t\t\t\t\t\t{ __( 'Default format' ) }\n\t\t\t\t\t\t<span className=\"block-editor-date-format-picker__default-format-toggle-control__hint\">\n\t\t\t\t\t\t\t{ dateI18n( defaultFormat, EXAMPLE_DATE ) }\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</>\n\t\t\t\t}\n\t\t\t\tchecked={ ! format }\n\t\t\t\tonChange={ ( checked ) =>\n\t\t\t\t\tonChange( checked ? null : defaultFormat )\n\t\t\t\t}\n\t\t\t/>\n\t\t\t{ format && (\n\t\t\t\t<NonDefaultControls format={ format } onChange={ onChange } />\n\t\t\t) }\n\t\t</fieldset>\n\t);\n}\n\nfunction NonDefaultControls( { format, onChange } ) {\n\t// Suggest a short format, medium format, long format, and a standardised\n\t// (YYYY-MM-DD) format. The short, medium, and long formats are localised as\n\t// different languages have different ways of writing these. For example, 'F\n\t// j, Y' (April 20, 2022) in American English (en_US) is 'j. F Y' (20. April\n\t// 2022) in German (de). The resultant array is de-duplicated as some\n\t// languages will use the same format string for short, medium, and long\n\t// formats.\n\tconst suggestedFormats = [\n\t\t...new Set( [\n\t\t\t'Y-m-d',\n\t\t\t_x( 'n/j/Y', 'short date format' ),\n\t\t\t_x( 'n/j/Y g:i A', 'short date format with time' ),\n\t\t\t_x( 'M j, Y', 'medium date format' ),\n\t\t\t_x( 'M j, Y g:i A', 'medium date format with time' ),\n\t\t\t_x( 'F j, Y', 'long date format' ),\n\t\t\t_x( 'M j', 'short date format without the year' ),\n\t\t] ),\n\t];\n\n\tconst suggestedOptions = suggestedFormats.map(\n\t\t( suggestedFormat, index ) => ( {\n\t\t\tkey: `suggested-${ index }`,\n\t\t\tname: dateI18n( suggestedFormat, EXAMPLE_DATE ),\n\t\t\tformat: suggestedFormat,\n\t\t} )\n\t);\n\tconst customOption = {\n\t\tkey: 'custom',\n\t\tname: __( 'Custom' ),\n\t\tclassName:\n\t\t\t'block-editor-date-format-picker__custom-format-select-control__custom-option',\n\t\t__experimentalHint: __( 'Enter your own date format' ),\n\t};\n\n\tconst [ isCustom, setIsCustom ] = useState(\n\t\t() => !! format && ! suggestedFormats.includes( format )\n\t);\n\n\treturn (\n\t\t<VStack>\n\t\t\t<CustomSelectControl\n\t\t\t\t__nextUnconstrainedWidth\n\t\t\t\tlabel={ __( 'Choose a format' ) }\n\t\t\t\toptions={ [ ...suggestedOptions, customOption ] }\n\t\t\t\tvalue={\n\t\t\t\t\tisCustom\n\t\t\t\t\t\t? customOption\n\t\t\t\t\t\t: suggestedOptions.find(\n\t\t\t\t\t\t\t\t( option ) => option.format === format\n\t\t\t\t\t\t ) ?? customOption\n\t\t\t\t}\n\t\t\t\tonChange={ ( { selectedItem } ) => {\n\t\t\t\t\tif ( selectedItem === customOption ) {\n\t\t\t\t\t\tsetIsCustom( true );\n\t\t\t\t\t} else {\n\t\t\t\t\t\tsetIsCustom( false );\n\t\t\t\t\t\tonChange( selectedItem.format );\n\t\t\t\t\t}\n\t\t\t\t} }\n\t\t\t/>\n\t\t\t{ isCustom && (\n\t\t\t\t<TextControl\n\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\tlabel={ __( 'Custom format' ) }\n\t\t\t\t\thideLabelFromVision\n\t\t\t\t\thelp={ createInterpolateElement(\n\t\t\t\t\t\t__(\n\t\t\t\t\t\t\t'Enter a date or time <Link>format string</Link>.'\n\t\t\t\t\t\t),\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tLink: (\n\t\t\t\t\t\t\t\t<ExternalLink\n\t\t\t\t\t\t\t\t\thref={ __(\n\t\t\t\t\t\t\t\t\t\t'https://wordpress.org/support/article/formatting-date-and-time/'\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),\n\t\t\t\t\t\t}\n\t\t\t\t\t) }\n\t\t\t\t\tvalue={ format }\n\t\t\t\t\tonChange={ ( value ) => onChange( value ) }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"]}
@@ -75,6 +75,7 @@ function DefaultStylePicker(_ref) {
75
75
  return onUpdatePreferredStyleVariations && (0, _element.createElement)("div", {
76
76
  className: "default-style-picker__default-switcher"
77
77
  }, (0, _element.createElement)(_components.SelectControl, {
78
+ __nextHasNoMarginBottom: true,
78
79
  options: selectOptions,
79
80
  value: preferredStyle || '',
80
81
  label: (0, _i18n.__)('Default Style'),