@wordpress/block-editor 10.3.0 → 10.5.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 (460) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/README.md +0 -1
  3. package/build/components/alignment-control/ui.js +1 -1
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/block-alignment-control/constants.js +1 -1
  6. package/build/components/block-alignment-control/constants.js.map +1 -1
  7. package/build/components/block-alignment-matrix-control/index.js +1 -1
  8. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  9. package/build/components/block-compare/index.js +1 -3
  10. package/build/components/block-compare/index.js.map +1 -1
  11. package/build/components/block-edit/index.js +4 -2
  12. package/build/components/block-edit/index.js.map +1 -1
  13. package/build/components/block-list/block.js +3 -1
  14. package/build/components/block-list/block.js.map +1 -1
  15. package/build/components/block-lock/menu-item.js +1 -1
  16. package/build/components/block-lock/menu-item.js.map +1 -1
  17. package/build/components/block-lock/modal.js +16 -9
  18. package/build/components/block-lock/modal.js.map +1 -1
  19. package/build/components/block-popover/inbetween.js +2 -1
  20. package/build/components/block-popover/inbetween.js.map +1 -1
  21. package/build/components/block-popover/index.js +2 -1
  22. package/build/components/block-popover/index.js.map +1 -1
  23. package/build/components/block-preview/index.js +2 -4
  24. package/build/components/block-preview/index.js.map +1 -1
  25. package/build/components/block-settings-menu/block-settings-dropdown.js +2 -8
  26. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  27. package/build/components/block-styles/utils.js +3 -3
  28. package/build/components/block-styles/utils.js.map +1 -1
  29. package/build/components/block-switcher/index.js +21 -12
  30. package/build/components/block-switcher/index.js.map +1 -1
  31. package/build/components/block-switcher/preview-block-popover.js +1 -1
  32. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  33. package/build/components/block-tools/insertion-point.js +12 -2
  34. package/build/components/block-tools/insertion-point.js.map +1 -1
  35. package/build/components/block-tools/selected-block-popover.js +27 -4
  36. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  37. package/build/components/block-vertical-alignment-control/ui.js +1 -1
  38. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  39. package/build/components/border-radius-control/all-input-control.js +2 -1
  40. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  41. package/build/components/border-radius-control/index.js +2 -1
  42. package/build/components/border-radius-control/index.js.map +1 -1
  43. package/build/components/border-radius-control/input-controls.js +2 -1
  44. package/build/components/border-radius-control/input-controls.js.map +1 -1
  45. package/build/components/colors/with-colors.js +4 -3
  46. package/build/components/colors/with-colors.js.map +1 -1
  47. package/build/components/duotone-control/index.js +1 -1
  48. package/build/components/duotone-control/index.js.map +1 -1
  49. package/build/components/font-sizes/fluid-utils.js +24 -40
  50. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  51. package/build/components/font-sizes/with-font-sizes.js +8 -6
  52. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  53. package/build/components/iframe/index.js +1 -1
  54. package/build/components/iframe/index.js.map +1 -1
  55. package/build/components/image-editor/constants.js +1 -1
  56. package/build/components/image-editor/constants.js.map +1 -1
  57. package/build/components/index.js +9 -0
  58. package/build/components/index.js.map +1 -1
  59. package/build/components/inner-blocks/index.js +10 -4
  60. package/build/components/inner-blocks/index.js.map +1 -1
  61. package/build/components/inserter/hooks/use-insertion-point.js +2 -7
  62. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  63. package/build/components/inserter/reusable-blocks-tab.js +4 -1
  64. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  65. package/build/components/inserter/search-items.js +23 -2
  66. package/build/components/inserter/search-items.js.map +1 -1
  67. package/build/components/line-height-control/index.js +2 -1
  68. package/build/components/line-height-control/index.js.map +1 -1
  69. package/build/components/link-control/index.js +18 -34
  70. package/build/components/link-control/index.js.map +1 -1
  71. package/build/components/link-control/search-input.js +1 -1
  72. package/build/components/link-control/search-input.js.map +1 -1
  73. package/build/components/link-control/use-internal-input-value.js +26 -0
  74. package/build/components/link-control/use-internal-input-value.js.map +1 -0
  75. package/build/components/list-view/block.js +5 -3
  76. package/build/components/list-view/block.js.map +1 -1
  77. package/build/components/list-view/branch.js +9 -3
  78. package/build/components/list-view/branch.js.map +1 -1
  79. package/build/components/list-view/drop-indicator.js +2 -1
  80. package/build/components/list-view/drop-indicator.js.map +1 -1
  81. package/build/components/media-replace-flow/index.js +1 -1
  82. package/build/components/media-replace-flow/index.js.map +1 -1
  83. package/build/components/off-canvas-editor/block-contents.js +100 -0
  84. package/build/components/off-canvas-editor/block-contents.js.map +1 -0
  85. package/build/components/off-canvas-editor/block-select-button.js +119 -0
  86. package/build/components/off-canvas-editor/block-select-button.js.map +1 -0
  87. package/build/components/off-canvas-editor/block.js +292 -0
  88. package/build/components/off-canvas-editor/block.js.map +1 -0
  89. package/build/components/off-canvas-editor/branch.js +181 -0
  90. package/build/components/off-canvas-editor/branch.js.map +1 -0
  91. package/build/components/off-canvas-editor/context.js +19 -0
  92. package/build/components/off-canvas-editor/context.js.map +1 -0
  93. package/build/components/off-canvas-editor/drop-indicator.js +118 -0
  94. package/build/components/off-canvas-editor/drop-indicator.js.map +1 -0
  95. package/build/components/off-canvas-editor/expander.js +41 -0
  96. package/build/components/off-canvas-editor/expander.js.map +1 -0
  97. package/build/components/off-canvas-editor/index.js +204 -0
  98. package/build/components/off-canvas-editor/index.js.map +1 -0
  99. package/build/components/off-canvas-editor/leaf.js +60 -0
  100. package/build/components/off-canvas-editor/leaf.js.map +1 -0
  101. package/build/components/off-canvas-editor/use-block-selection.js +139 -0
  102. package/build/components/off-canvas-editor/use-block-selection.js.map +1 -0
  103. package/build/components/off-canvas-editor/use-list-view-client-ids.js +33 -0
  104. package/build/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
  105. package/build/components/off-canvas-editor/use-list-view-drop-zone.js +235 -0
  106. package/build/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
  107. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js +60 -0
  108. package/build/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
  109. package/build/components/off-canvas-editor/utils.js +60 -0
  110. package/build/components/off-canvas-editor/utils.js.map +1 -0
  111. package/build/components/rich-text/format-toolbar/index.js +1 -1
  112. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  113. package/build/components/rich-text/format-toolbar-container.js +1 -1
  114. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  115. package/build/components/rich-text/use-paste-handler.js +1 -1
  116. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  117. package/build/components/spacing-sizes-control/all-input-control.js +6 -2
  118. package/build/components/spacing-sizes-control/all-input-control.js.map +1 -1
  119. package/build/components/spacing-sizes-control/axial-input-controls.js +6 -2
  120. package/build/components/spacing-sizes-control/axial-input-controls.js.map +1 -1
  121. package/build/components/spacing-sizes-control/index.js +6 -2
  122. package/build/components/spacing-sizes-control/index.js.map +1 -1
  123. package/build/components/spacing-sizes-control/input-controls.js +6 -2
  124. package/build/components/spacing-sizes-control/input-controls.js.map +1 -1
  125. package/build/components/spacing-sizes-control/spacing-input-control.js +12 -5
  126. package/build/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  127. package/build/components/url-input/index.js +1 -1
  128. package/build/components/url-input/index.js.map +1 -1
  129. package/build/components/url-popover/index.js +31 -2
  130. package/build/components/url-popover/index.js.map +1 -1
  131. package/build/components/use-setting/index.js +1 -1
  132. package/build/components/use-setting/index.js.map +1 -1
  133. package/build/hooks/border.js +1 -0
  134. package/build/hooks/border.js.map +1 -1
  135. package/build/hooks/color-panel.js +17 -1
  136. package/build/hooks/color-panel.js.map +1 -1
  137. package/build/hooks/color.js +1 -1
  138. package/build/hooks/color.js.map +1 -1
  139. package/build/hooks/content-lock-ui.js +13 -6
  140. package/build/hooks/content-lock-ui.js.map +1 -1
  141. package/build/hooks/dimensions.js +72 -13
  142. package/build/hooks/dimensions.js.map +1 -1
  143. package/build/hooks/font-size.js +1 -0
  144. package/build/hooks/font-size.js.map +1 -1
  145. package/build/hooks/layout.js +5 -4
  146. package/build/hooks/layout.js.map +1 -1
  147. package/build/hooks/margin.js +26 -18
  148. package/build/hooks/margin.js.map +1 -1
  149. package/build/hooks/min-height.js +145 -0
  150. package/build/hooks/min-height.js.map +1 -0
  151. package/build/hooks/padding.js +22 -13
  152. package/build/hooks/padding.js.map +1 -1
  153. package/build/hooks/style.js +3 -2
  154. package/build/hooks/style.js.map +1 -1
  155. package/build/hooks/utils.js +7 -6
  156. package/build/hooks/utils.js.map +1 -1
  157. package/build/layouts/constrained.js +0 -1
  158. package/build/layouts/constrained.js.map +1 -1
  159. package/build/layouts/flex.js +23 -22
  160. package/build/layouts/flex.js.map +1 -1
  161. package/build/store/actions.js +30 -0
  162. package/build/store/actions.js.map +1 -1
  163. package/build/store/array.js +1 -7
  164. package/build/store/array.js.map +1 -1
  165. package/build/store/reducer.js +46 -14
  166. package/build/store/reducer.js.map +1 -1
  167. package/build/store/selectors.js +62 -31
  168. package/build/store/selectors.js.map +1 -1
  169. package/build-module/components/alignment-control/ui.js +1 -1
  170. package/build-module/components/alignment-control/ui.js.map +1 -1
  171. package/build-module/components/block-alignment-control/constants.js +1 -1
  172. package/build-module/components/block-alignment-control/constants.js.map +1 -1
  173. package/build-module/components/block-alignment-matrix-control/index.js +1 -1
  174. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  175. package/build-module/components/block-compare/index.js +2 -3
  176. package/build-module/components/block-compare/index.js.map +1 -1
  177. package/build-module/components/block-edit/index.js +4 -2
  178. package/build-module/components/block-edit/index.js.map +1 -1
  179. package/build-module/components/block-list/block.js +3 -1
  180. package/build-module/components/block-list/block.js.map +1 -1
  181. package/build-module/components/block-lock/menu-item.js +2 -2
  182. package/build-module/components/block-lock/menu-item.js.map +1 -1
  183. package/build-module/components/block-lock/modal.js +17 -10
  184. package/build-module/components/block-lock/modal.js.map +1 -1
  185. package/build-module/components/block-popover/inbetween.js +2 -1
  186. package/build-module/components/block-popover/inbetween.js.map +1 -1
  187. package/build-module/components/block-popover/index.js +2 -1
  188. package/build-module/components/block-popover/index.js.map +1 -1
  189. package/build-module/components/block-preview/index.js +2 -3
  190. package/build-module/components/block-preview/index.js.map +1 -1
  191. package/build-module/components/block-settings-menu/block-settings-dropdown.js +2 -7
  192. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  193. package/build-module/components/block-styles/utils.js +3 -3
  194. package/build-module/components/block-styles/utils.js.map +1 -1
  195. package/build-module/components/block-switcher/index.js +21 -11
  196. package/build-module/components/block-switcher/index.js.map +1 -1
  197. package/build-module/components/block-switcher/preview-block-popover.js +1 -1
  198. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  199. package/build-module/components/block-tools/insertion-point.js +12 -2
  200. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  201. package/build-module/components/block-tools/selected-block-popover.js +27 -5
  202. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  203. package/build-module/components/block-vertical-alignment-control/ui.js +1 -1
  204. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  205. package/build-module/components/border-radius-control/all-input-control.js +2 -1
  206. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  207. package/build-module/components/border-radius-control/index.js +2 -1
  208. package/build-module/components/border-radius-control/index.js.map +1 -1
  209. package/build-module/components/border-radius-control/input-controls.js +2 -1
  210. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  211. package/build-module/components/colors/with-colors.js +5 -4
  212. package/build-module/components/colors/with-colors.js.map +1 -1
  213. package/build-module/components/duotone-control/index.js +1 -1
  214. package/build-module/components/duotone-control/index.js.map +1 -1
  215. package/build-module/components/font-sizes/fluid-utils.js +24 -40
  216. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  217. package/build-module/components/font-sizes/with-font-sizes.js +9 -7
  218. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  219. package/build-module/components/iframe/index.js +1 -1
  220. package/build-module/components/iframe/index.js.map +1 -1
  221. package/build-module/components/image-editor/constants.js +1 -1
  222. package/build-module/components/image-editor/constants.js.map +1 -1
  223. package/build-module/components/index.js +1 -0
  224. package/build-module/components/index.js.map +1 -1
  225. package/build-module/components/inner-blocks/index.js +10 -4
  226. package/build-module/components/inner-blocks/index.js.map +1 -1
  227. package/build-module/components/inserter/hooks/use-insertion-point.js +2 -6
  228. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  229. package/build-module/components/inserter/reusable-blocks-tab.js +3 -1
  230. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  231. package/build-module/components/inserter/search-items.js +23 -3
  232. package/build-module/components/inserter/search-items.js.map +1 -1
  233. package/build-module/components/line-height-control/index.js +2 -1
  234. package/build-module/components/line-height-control/index.js.map +1 -1
  235. package/build-module/components/link-control/index.js +17 -34
  236. package/build-module/components/link-control/index.js.map +1 -1
  237. package/build-module/components/link-control/search-input.js +1 -1
  238. package/build-module/components/link-control/search-input.js.map +1 -1
  239. package/build-module/components/link-control/use-internal-input-value.js +18 -0
  240. package/build-module/components/link-control/use-internal-input-value.js.map +1 -0
  241. package/build-module/components/list-view/block.js +5 -3
  242. package/build-module/components/list-view/block.js.map +1 -1
  243. package/build-module/components/list-view/branch.js +9 -3
  244. package/build-module/components/list-view/branch.js.map +1 -1
  245. package/build-module/components/list-view/drop-indicator.js +2 -1
  246. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  247. package/build-module/components/media-replace-flow/index.js +1 -1
  248. package/build-module/components/media-replace-flow/index.js.map +1 -1
  249. package/build-module/components/off-canvas-editor/block-contents.js +85 -0
  250. package/build-module/components/off-canvas-editor/block-contents.js.map +1 -0
  251. package/build-module/components/off-canvas-editor/block-select-button.js +101 -0
  252. package/build-module/components/off-canvas-editor/block-select-button.js.map +1 -0
  253. package/build-module/components/off-canvas-editor/block.js +268 -0
  254. package/build-module/components/off-canvas-editor/block.js.map +1 -0
  255. package/build-module/components/off-canvas-editor/branch.js +165 -0
  256. package/build-module/components/off-canvas-editor/branch.js.map +1 -0
  257. package/build-module/components/off-canvas-editor/context.js +7 -0
  258. package/build-module/components/off-canvas-editor/context.js.map +1 -0
  259. package/build-module/components/off-canvas-editor/drop-indicator.js +111 -0
  260. package/build-module/components/off-canvas-editor/drop-indicator.js.map +1 -0
  261. package/build-module/components/off-canvas-editor/expander.js +32 -0
  262. package/build-module/components/off-canvas-editor/expander.js.map +1 -0
  263. package/build-module/components/off-canvas-editor/index.js +181 -0
  264. package/build-module/components/off-canvas-editor/index.js.map +1 -0
  265. package/build-module/components/off-canvas-editor/leaf.js +45 -0
  266. package/build-module/components/off-canvas-editor/leaf.js.map +1 -0
  267. package/build-module/components/off-canvas-editor/use-block-selection.js +124 -0
  268. package/build-module/components/off-canvas-editor/use-block-selection.js.map +1 -0
  269. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js +24 -0
  270. package/build-module/components/off-canvas-editor/use-list-view-client-ids.js.map +1 -0
  271. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js +220 -0
  272. package/build-module/components/off-canvas-editor/use-list-view-drop-zone.js.map +1 -0
  273. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js +50 -0
  274. package/build-module/components/off-canvas-editor/use-list-view-expand-selected-item.js.map +1 -0
  275. package/build-module/components/off-canvas-editor/utils.js +44 -0
  276. package/build-module/components/off-canvas-editor/utils.js.map +1 -0
  277. package/build-module/components/rich-text/format-toolbar/index.js +1 -1
  278. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  279. package/build-module/components/rich-text/format-toolbar-container.js +1 -1
  280. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  281. package/build-module/components/rich-text/use-paste-handler.js +1 -1
  282. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  283. package/build-module/components/spacing-sizes-control/all-input-control.js +6 -2
  284. package/build-module/components/spacing-sizes-control/all-input-control.js.map +1 -1
  285. package/build-module/components/spacing-sizes-control/axial-input-controls.js +6 -2
  286. package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +1 -1
  287. package/build-module/components/spacing-sizes-control/index.js +6 -2
  288. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  289. package/build-module/components/spacing-sizes-control/input-controls.js +6 -2
  290. package/build-module/components/spacing-sizes-control/input-controls.js.map +1 -1
  291. package/build-module/components/spacing-sizes-control/spacing-input-control.js +12 -5
  292. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +1 -1
  293. package/build-module/components/url-input/index.js +1 -1
  294. package/build-module/components/url-input/index.js.map +1 -1
  295. package/build-module/components/url-popover/index.js +30 -3
  296. package/build-module/components/url-popover/index.js.map +1 -1
  297. package/build-module/components/use-setting/index.js +1 -1
  298. package/build-module/components/use-setting/index.js.map +1 -1
  299. package/build-module/hooks/border.js +1 -0
  300. package/build-module/hooks/border.js.map +1 -1
  301. package/build-module/hooks/color-panel.js +17 -1
  302. package/build-module/hooks/color-panel.js.map +1 -1
  303. package/build-module/hooks/color.js +1 -1
  304. package/build-module/hooks/color.js.map +1 -1
  305. package/build-module/hooks/content-lock-ui.js +15 -8
  306. package/build-module/hooks/content-lock-ui.js.map +1 -1
  307. package/build-module/hooks/dimensions.js +67 -12
  308. package/build-module/hooks/dimensions.js.map +1 -1
  309. package/build-module/hooks/font-size.js +1 -0
  310. package/build-module/hooks/font-size.js.map +1 -1
  311. package/build-module/hooks/layout.js +6 -5
  312. package/build-module/hooks/layout.js.map +1 -1
  313. package/build-module/hooks/margin.js +27 -19
  314. package/build-module/hooks/margin.js.map +1 -1
  315. package/build-module/hooks/min-height.js +122 -0
  316. package/build-module/hooks/min-height.js.map +1 -0
  317. package/build-module/hooks/padding.js +23 -14
  318. package/build-module/hooks/padding.js.map +1 -1
  319. package/build-module/hooks/style.js +4 -3
  320. package/build-module/hooks/style.js.map +1 -1
  321. package/build-module/hooks/utils.js +7 -7
  322. package/build-module/hooks/utils.js.map +1 -1
  323. package/build-module/layouts/constrained.js +0 -1
  324. package/build-module/layouts/constrained.js.map +1 -1
  325. package/build-module/layouts/flex.js +24 -23
  326. package/build-module/layouts/flex.js.map +1 -1
  327. package/build-module/store/actions.js +26 -0
  328. package/build-module/store/actions.js.map +1 -1
  329. package/build-module/store/array.js +1 -6
  330. package/build-module/store/array.js.map +1 -1
  331. package/build-module/store/reducer.js +44 -14
  332. package/build-module/store/reducer.js.map +1 -1
  333. package/build-module/store/selectors.js +59 -31
  334. package/build-module/store/selectors.js.map +1 -1
  335. package/build-style/style-rtl.css +88 -88
  336. package/build-style/style.css +84 -84
  337. package/package.json +29 -28
  338. package/src/components/alignment-control/README.md +1 -1
  339. package/src/components/alignment-control/ui.js +1 -1
  340. package/src/components/block-alignment-control/constants.js +1 -1
  341. package/src/components/block-alignment-control/test/index.native.js +4 -4
  342. package/src/components/block-alignment-matrix-control/index.js +1 -1
  343. package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +13 -11
  344. package/src/components/block-breadcrumb/test/index.js +1 -1
  345. package/src/components/block-compare/index.js +3 -2
  346. package/src/components/block-draggable/test/helpers.native.js +3 -3
  347. package/src/components/block-draggable/test/index.native.js +27 -27
  348. package/src/components/block-edit/index.js +2 -1
  349. package/src/components/block-list/block.js +2 -0
  350. package/src/components/block-list/style.scss +11 -6
  351. package/src/components/block-lock/menu-item.js +5 -2
  352. package/src/components/block-lock/modal.js +19 -36
  353. package/src/components/block-lock/style.scss +8 -17
  354. package/src/components/block-mover/stories/index.js +1 -1
  355. package/src/components/block-mover/style.scss +35 -1
  356. package/src/components/block-popover/inbetween.js +1 -0
  357. package/src/components/block-popover/index.js +1 -0
  358. package/src/components/block-popover/style.scss +1 -5
  359. package/src/components/block-preview/index.js +8 -3
  360. package/src/components/block-settings-menu/block-settings-dropdown.js +4 -7
  361. package/src/components/block-styles/utils.js +3 -3
  362. package/src/components/block-switcher/index.js +21 -11
  363. package/src/components/block-switcher/preview-block-popover.js +1 -1
  364. package/src/components/block-tools/insertion-point.js +10 -1
  365. package/src/components/block-tools/selected-block-popover.js +80 -34
  366. package/src/components/block-tools/style.scss +15 -0
  367. package/src/components/block-variation-picker/README.md +1 -1
  368. package/src/components/block-vertical-alignment-control/ui.js +1 -1
  369. package/src/components/border-radius-control/all-input-control.js +1 -0
  370. package/src/components/border-radius-control/index.js +1 -0
  371. package/src/components/border-radius-control/input-controls.js +1 -0
  372. package/src/components/border-radius-control/style.scss +15 -24
  373. package/src/components/color-palette/test/__snapshots__/control.js.snap +85 -83
  374. package/src/components/color-palette/test/control.js +1 -1
  375. package/src/components/colors/with-colors.js +13 -23
  376. package/src/components/default-block-appender/style.scss +1 -0
  377. package/src/components/duotone-control/index.js +1 -1
  378. package/src/components/font-sizes/fluid-utils.js +37 -64
  379. package/src/components/font-sizes/test/fluid-utils.js +5 -5
  380. package/src/components/font-sizes/with-font-sizes.js +15 -13
  381. package/src/components/iframe/index.js +1 -1
  382. package/src/components/image-editor/constants.js +1 -1
  383. package/src/components/index.js +1 -0
  384. package/src/components/inner-blocks/index.js +11 -4
  385. package/src/components/inner-blocks/test/index.js +4 -0
  386. package/src/components/inserter/hooks/use-insertion-point.js +3 -11
  387. package/src/components/inserter/reusable-blocks-tab.js +4 -2
  388. package/src/components/inserter/search-items.js +23 -3
  389. package/src/components/inserter/style.scss +8 -7
  390. package/src/components/inserter/test/reusable-blocks-tab.js +14 -57
  391. package/src/components/inserter/test/search-items.js +6 -0
  392. package/src/components/inserter-list-item/style.scss +2 -0
  393. package/src/components/letter-spacing-control/README.md +55 -0
  394. package/src/components/line-height-control/index.js +1 -0
  395. package/src/components/link-control/README.md +3 -3
  396. package/src/components/link-control/index.js +23 -39
  397. package/src/components/link-control/search-input.js +1 -1
  398. package/src/components/link-control/test/index.js +272 -241
  399. package/src/components/link-control/use-internal-input-value.js +22 -0
  400. package/src/components/list-view/block.js +4 -3
  401. package/src/components/list-view/branch.js +11 -6
  402. package/src/components/list-view/drop-indicator.js +1 -0
  403. package/src/components/list-view/style.scss +1 -36
  404. package/src/components/media-replace-flow/index.js +1 -1
  405. package/src/components/media-replace-flow/test/index.js +69 -51
  406. package/src/components/off-canvas-editor/README.md +5 -0
  407. package/src/components/off-canvas-editor/block-contents.js +89 -0
  408. package/src/components/off-canvas-editor/block-select-button.js +113 -0
  409. package/src/components/off-canvas-editor/block.js +335 -0
  410. package/src/components/off-canvas-editor/branch.js +210 -0
  411. package/src/components/off-canvas-editor/context.js +8 -0
  412. package/src/components/off-canvas-editor/drop-indicator.js +126 -0
  413. package/src/components/off-canvas-editor/expander.js +26 -0
  414. package/src/components/off-canvas-editor/index.js +216 -0
  415. package/src/components/off-canvas-editor/leaf.js +48 -0
  416. package/src/components/off-canvas-editor/style.scss +397 -0
  417. package/src/components/off-canvas-editor/test/utils.js +50 -0
  418. package/src/components/off-canvas-editor/use-block-selection.js +169 -0
  419. package/src/components/off-canvas-editor/use-list-view-client-ids.js +29 -0
  420. package/src/components/off-canvas-editor/use-list-view-drop-zone.js +260 -0
  421. package/src/components/off-canvas-editor/use-list-view-expand-selected-item.js +58 -0
  422. package/src/components/off-canvas-editor/utils.js +58 -0
  423. package/src/components/responsive-block-control/test/index.js +69 -92
  424. package/src/components/rich-text/format-toolbar/index.js +1 -1
  425. package/src/components/rich-text/format-toolbar-container.js +1 -1
  426. package/src/components/rich-text/use-paste-handler.js +1 -1
  427. package/src/components/spacing-sizes-control/all-input-control.js +4 -0
  428. package/src/components/spacing-sizes-control/axial-input-controls.js +4 -0
  429. package/src/components/spacing-sizes-control/index.js +4 -0
  430. package/src/components/spacing-sizes-control/input-controls.js +4 -0
  431. package/src/components/spacing-sizes-control/spacing-input-control.js +10 -1
  432. package/src/components/spacing-sizes-control/style.scss +1 -0
  433. package/src/components/url-input/index.js +1 -1
  434. package/src/components/url-popover/README.md +12 -3
  435. package/src/components/url-popover/index.js +33 -3
  436. package/src/components/use-setting/index.js +7 -1
  437. package/src/hooks/border.js +1 -0
  438. package/src/hooks/color-panel.js +13 -1
  439. package/src/hooks/color.js +2 -0
  440. package/src/hooks/content-lock-ui.js +46 -34
  441. package/src/hooks/dimensions.js +106 -19
  442. package/src/hooks/font-size.js +1 -0
  443. package/src/hooks/layout.js +8 -11
  444. package/src/hooks/margin.js +23 -17
  445. package/src/hooks/min-height.js +121 -0
  446. package/src/hooks/padding.js +23 -19
  447. package/src/hooks/style.js +10 -2
  448. package/src/hooks/test/align.js +96 -72
  449. package/src/hooks/test/style.js +4 -0
  450. package/src/hooks/test/use-typography-props.js +1 -1
  451. package/src/hooks/utils.js +5 -6
  452. package/src/layouts/constrained.js +0 -1
  453. package/src/layouts/flex.js +44 -39
  454. package/src/store/actions.js +26 -0
  455. package/src/store/array.js +1 -6
  456. package/src/store/reducer.js +50 -40
  457. package/src/store/selectors.js +43 -29
  458. package/src/store/test/actions.js +18 -0
  459. package/src/store/test/reducer.js +40 -0
  460. package/src/store/test/selectors.js +20 -1
@@ -33,6 +33,8 @@ var _blockPopover = _interopRequireDefault(require("../block-popover"));
33
33
 
34
34
  var _useBlockToolbarPopoverProps = _interopRequireDefault(require("./use-block-toolbar-popover-props"));
35
35
 
36
+ var _inserter = _interopRequireDefault(require("../inserter"));
37
+
36
38
  /**
37
39
  * External dependencies
38
40
  */
@@ -50,6 +52,7 @@ function selector(select) {
50
52
  isMultiSelecting,
51
53
  hasMultiSelection,
52
54
  isTyping,
55
+ __experimentalIsBlockInterfaceHidden: isBlockInterfaceHidden,
53
56
  getSettings,
54
57
  getLastMultiSelectedBlockClientId
55
58
  } = select(_store.store);
@@ -57,6 +60,7 @@ function selector(select) {
57
60
  editorMode: __unstableGetEditorMode(),
58
61
  isMultiSelecting: isMultiSelecting(),
59
62
  isTyping: isTyping(),
63
+ isBlockInterfaceHidden: isBlockInterfaceHidden(),
60
64
  hasFixedToolbar: getSettings().hasFixedToolbar,
61
65
  isDistractionFree: getSettings().isDistractionFree,
62
66
  lastClientId: hasMultiSelection() ? getLastMultiSelectedBlockClientId() : null
@@ -78,6 +82,7 @@ function SelectedBlockPopover(_ref) {
78
82
  editorMode,
79
83
  isMultiSelecting,
80
84
  isTyping,
85
+ isBlockInterfaceHidden,
81
86
  hasFixedToolbar,
82
87
  isDistractionFree,
83
88
  lastClientId
@@ -104,7 +109,7 @@ function SelectedBlockPopover(_ref) {
104
109
  } = (0, _data.useDispatch)(_store.store);
105
110
  const showEmptyBlockSideInserter = !isTyping && editorMode === 'edit' && isEmptyDefaultBlock;
106
111
  const shouldShowBreadcrumb = editorMode === 'navigation' || editorMode === 'zoom-out';
107
- const shouldShowContextualToolbar = editorMode === 'edit' && !hasFixedToolbar && isLargeViewport && !isMultiSelecting && !showEmptyBlockSideInserter && !isTyping;
112
+ const shouldShowContextualToolbar = editorMode === 'edit' && !hasFixedToolbar && isLargeViewport && !isMultiSelecting && !showEmptyBlockSideInserter && !isTyping && !isBlockInterfaceHidden;
108
113
  const canFocusHiddenToolbar = editorMode === 'edit' && !shouldShowContextualToolbar && !hasFixedToolbar && !isDistractionFree && !isEmptyDefaultBlock;
109
114
  (0, _keyboardShortcuts.useShortcut)('core/block-editor/focus-toolbar', () => {
110
115
  isToolbarForced.current = true;
@@ -123,11 +128,29 @@ function SelectedBlockPopover(_ref) {
123
128
  clientId
124
129
  });
125
130
 
126
- if (!shouldShowBreadcrumb && !shouldShowContextualToolbar) {
131
+ if (!shouldShowBreadcrumb && !shouldShowContextualToolbar && !showEmptyBlockSideInserter) {
127
132
  return null;
128
133
  }
129
134
 
130
- return (0, _element.createElement)(_blockPopover.default, (0, _extends2.default)({
135
+ return (0, _element.createElement)(_element.Fragment, null, showEmptyBlockSideInserter && (0, _element.createElement)(_blockPopover.default, (0, _extends2.default)({
136
+ clientId: capturingClientId || clientId,
137
+ __unstableCoverTarget: true,
138
+ bottomClientId: lastClientId,
139
+ className: (0, _classnames.default)('block-editor-block-list__block-side-inserter-popover', {
140
+ 'is-insertion-point-visible': isInsertionPointVisible
141
+ }),
142
+ __unstablePopoverSlot: __unstablePopoverSlot,
143
+ __unstableContentRef: __unstableContentRef,
144
+ resize: false,
145
+ shift: false
146
+ }, popoverProps), (0, _element.createElement)("div", {
147
+ className: "block-editor-block-list__empty-block-inserter"
148
+ }, (0, _element.createElement)(_inserter.default, {
149
+ position: "bottom right",
150
+ rootClientId: rootClientId,
151
+ clientId: clientId,
152
+ __experimentalIsQuick: true
153
+ }))), (shouldShowBreadcrumb || shouldShowContextualToolbar) && (0, _element.createElement)(_blockPopover.default, (0, _extends2.default)({
131
154
  clientId: capturingClientId || clientId,
132
155
  bottomClientId: lastClientId,
133
156
  className: (0, _classnames.default)('block-editor-block-list__block-popover', {
@@ -150,7 +173,7 @@ function SelectedBlockPopover(_ref) {
150
173
  }), shouldShowBreadcrumb && (0, _element.createElement)(_blockSelectionButton.default, {
151
174
  clientId: clientId,
152
175
  rootClientId: rootClientId
153
- }));
176
+ })));
154
177
  }
155
178
 
156
179
  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","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","parentClientId","__experimentalCaptureToolbars","settings","WrappedBlockPopover","selected"],"mappings":";;;;;;;;;AASA;;;;AANA;;AACA;;AAMA;;AACA;;AACA;;AAC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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 { find } from 'lodash';\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';\n\nfunction selector( select ) {\n\tconst {\n\t\t__unstableGetEditorMode,\n\t\tisMultiSelecting,\n\t\thasMultiSelection,\n\t\tisTyping,\n\t\tgetSettings,\n\t\tgetLastMultiSelectedBlockClientId,\n\t} = select( blockEditorStore );\n\treturn {\n\t\teditorMode: __unstableGetEditorMode(),\n\t\tisMultiSelecting: isMultiSelecting(),\n\t\tisTyping: isTyping(),\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\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\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 ( ! shouldShowBreadcrumb && ! shouldShowContextualToolbar ) {\n\t\treturn null;\n\t}\n\n\treturn (\n\t\t<BlockPopover\n\t\t\tclientId={ capturingClientId || clientId }\n\t\t\tbottomClientId={ lastClientId }\n\t\t\tclassName={ classnames( 'block-editor-block-list__block-popover', {\n\t\t\t\t'is-insertion-point-visible': isInsertionPointVisible,\n\t\t\t} ) }\n\t\t\t__unstablePopoverSlot={ __unstablePopoverSlot }\n\t\t\t__unstableContentRef={ __unstableContentRef }\n\t\t\tresize={ false }\n\t\t\t{ ...popoverProps }\n\t\t>\n\t\t\t{ shouldShowContextualToolbar && showContents && (\n\t\t\t\t<BlockContextualToolbar\n\t\t\t\t\t// If the toolbar is being shown because of being forced\n\t\t\t\t\t// it should focus the toolbar right after the mount.\n\t\t\t\t\tfocusOnMount={ isToolbarForced.current }\n\t\t\t\t\t__experimentalInitialIndex={\n\t\t\t\t\t\tinitialToolbarItemIndexRef.current\n\t\t\t\t\t}\n\t\t\t\t\t__experimentalOnIndexChange={ ( index ) => {\n\t\t\t\t\t\tinitialToolbarItemIndexRef.current = index;\n\t\t\t\t\t} }\n\t\t\t\t\t// Resets the index whenever the active block changes so\n\t\t\t\t\t// this is not persisted. See https://github.com/WordPress/gutenberg/pull/25760#issuecomment-717906169\n\t\t\t\t\tkey={ clientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ shouldShowBreadcrumb && (\n\t\t\t\t<BlockSelectionButton\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\trootClientId={ rootClientId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t</BlockPopover>\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 = find(\n\t\tblockParentsClientIds,\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","__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","parentClientId","__experimentalCaptureToolbars","settings","WrappedBlockPopover","selected"],"mappings":";;;;;;;;;AASA;;;;AANA;;AACA;;AAMA;;AACA;;AACA;;AACA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AACA;;AAvBA;AACA;AACA;;AAIA;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;A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QNhC,IAAAA;AARM,GAAP;AAUA;;AAEc,SAASsC,mBAAT,QAGX;AAAA,MAHyC;AAC5CrC,IAAAA,qBAD4C;AAE5CC,IAAAA;AAF4C,GAGzC;AACH,QAAMqC,QAAQ,GAAG,qBAAWjB,eAAX,EAA4B,EAA5B,CAAjB;;AAEA,MAAK,CAAEiB,QAAP,EAAkB;AACjB,WAAO,IAAP;AACA;;AAED,QAAM;AACL3C,IAAAA,QADK;AAELC,IAAAA,YAFK;AAGLkC,IAAAA,IAHK;AAILjC,IAAAA,mBAJK;AAKLE,IAAAA,iBALK;AAMLP,IAAAA,iBANK;AAOLmC,IAAAA;AAPK,MAQFW,QARJ;;AAUA,MAAK,CAAER,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 { find } from 'lodash';\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';\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 = find(\n\t\tblockParentsClientIds,\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"]}
@@ -41,7 +41,7 @@ const BLOCK_ALIGNMENTS_CONTROLS = {
41
41
  const DEFAULT_CONTROLS = ['top', 'center', 'bottom'];
42
42
  const DEFAULT_CONTROL = 'top';
43
43
  const POPOVER_PROPS = {
44
- isAlternate: true
44
+ variant: 'toolbar'
45
45
  };
46
46
 
47
47
  function BlockVerticalAlignmentUI(_ref) {
@@ -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","isAlternate","BlockVerticalAlignmentUI","value","onChange","controls","isCollapsed","isToolbar","applyOrUnset","align","undefined","activeAlignment","defaultAlignmentControl","UIComponent","ToolbarGroup","ToolbarDropdownM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,IAAAA;AAAF,GADyB,GAEzB;AAAEW,IAAAA,YAAY,EAAE;AAAEjB,MAAAA;AAAF;AAAhB,GAFH;AAIA,SACC,4BAAC,WAAD;AACC,IAAA,IAAI,EACHW,eAAe,GACZA,eAAe,CAACpB,IADJ,GAEZqB,uBAAuB,CAACrB,IAJ7B;AAMC,IAAA,KAAK,EAAG,cACP,2BADO,EAEP,wCAFO,CANT;AAUC,IAAA,QAAQ,EAAGc,QAAQ,CAACa,GAAT,CAAgBC,OAAF,IAAe;AACvC,aAAO,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\tisAlternate: true,\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","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","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AEW,IAAAA,YAAY,EAAE;AAAEjB,MAAAA;AAAF;AAAhB,GAFH;AAIA,SACC,4BAAC,WAAD;AACC,IAAA,IAAI,EACHW,eAAe,GACZA,eAAe,CAACpB,IADJ,GAEZqB,uBAAuB,CAACrB,IAJ7B;AAMC,IAAA,KAAK,EAAG,cACP,2BADO,EAEP,wCAFO,CANT;AAUC,IAAA,QAAQ,EAAGc,QAAQ,CAACa,GAAT,CAAgBC,OAAF,IAAe;AACvC,aAAO,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"]}
@@ -68,7 +68,8 @@ function AllInputControl(_ref) {
68
68
  value: allValue,
69
69
  onChange: handleOnChange,
70
70
  onUnitChange: handleOnUnitChange,
71
- placeholder: allPlaceholder
71
+ placeholder: allPlaceholder,
72
+ size: '__unstable-large'
72
73
  }));
73
74
  }
74
75
  //# sourceMappingURL=all-input-control.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/border-radius-control/all-input-control.js"],"names":["AllInputControl","onChange","selectedUnits","setSelectedUnits","values","props","allValue","undefined","hasValues","isMixed","allPlaceholder","handleOnChange","next","isNumeric","isNaN","parseFloat","nextValue","handleOnUnitChange","unit","topLeft","topRight","bottomLeft","bottomRight"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAQe,SAASA,eAAT,OAMX;AAAA,MANqC;AACxCC,IAAAA,QADwC;AAExCC,IAAAA,aAFwC;AAGxCC,IAAAA,gBAHwC;AAIxCC,IAAAA,MAJwC;AAKxC,OAAGC;AALqC,GAMrC;AACH,MAAIC,QAAQ,GAAG,wBAAaF,MAAb,CAAf;;AAEA,MAAKE,QAAQ,KAAKC,SAAlB,EAA8B;AAC7B;AACA;AACAD,IAAAA,QAAQ,GAAG,uBAAYJ,aAAZ,CAAX;AACA;;AAED,QAAMM,SAAS,GAAG,6BAAkBJ,MAAlB,CAAlB;AACA,QAAMK,OAAO,GAAGD,SAAS,IAAI,2BAAgBJ,MAAhB,CAA7B;AACA,QAAMM,cAAc,GAAGD,OAAO,GAAG,cAAI,OAAJ,CAAH,GAAmB,IAAjD,CAXG,CAaH;;AACA,QAAME,cAAc,GAAKC,IAAF,IAAY;AAClC,UAAMC,SAAS,GAAG,CAAEC,KAAK,CAAEC,UAAU,CAAEH,IAAF,CAAZ,CAAzB;AACA,UAAMI,SAAS,GAAGH,SAAS,GAAGD,IAAH,GAAUL,SAArC;AACAN,IAAAA,QAAQ,CAAEe,SAAF,CAAR;AACA,GAJD,CAdG,CAoBH;AACA;;;AACA,QAAMC,kBAAkB,GAAKC,IAAF,IAAY;AACtCf,IAAAA,gBAAgB,CAAE;AACjBgB,MAAAA,OAAO,EAAED,IADQ;AAEjBE,MAAAA,QAAQ,EAAEF,IAFO;AAGjBG,MAAAA,UAAU,EAAEH,IAHK;AAIjBI,MAAAA,WAAW,EAAEJ;AAJI,KAAF,CAAhB;AAMA,GAPD;;AASA,SACC,4BAAC,qCAAD,6BACMb,KADN;AAEC,kBAAa,cAAI,eAAJ,CAFd;AAGC,IAAA,YAAY,EAAGI,OAHhB;AAIC,IAAA,MAAM,MAJP;AAKC,IAAA,KAAK,EAAGH,QALT;AAMC,IAAA,QAAQ,EAAGK,cANZ;AAOC,IAAA,YAAY,EAAGM,kBAPhB;AAQC,IAAA,WAAW,EAAGP;AARf,KADD;AAYA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUnitControl as UnitControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetAllValue,\n\tgetAllUnit,\n\thasMixedValues,\n\thasDefinedValues,\n} from './utils';\n\nexport default function AllInputControl( {\n\tonChange,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tvalues,\n\t...props\n} ) {\n\tlet allValue = getAllValue( values );\n\n\tif ( allValue === undefined ) {\n\t\t// If we don't have any value set the unit to any current selection\n\t\t// or the most common unit from the individual radii values.\n\t\tallValue = getAllUnit( selectedUnits );\n\t}\n\n\tconst hasValues = hasDefinedValues( values );\n\tconst isMixed = hasValues && hasMixedValues( values );\n\tconst allPlaceholder = isMixed ? __( 'Mixed' ) : null;\n\n\t// Filter out CSS-unit-only values to prevent invalid styles.\n\tconst handleOnChange = ( next ) => {\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tonChange( nextValue );\n\t};\n\n\t// Store current unit selection for use as fallback for individual\n\t// radii controls.\n\tconst handleOnUnitChange = ( unit ) => {\n\t\tsetSelectedUnits( {\n\t\t\ttopLeft: unit,\n\t\t\ttopRight: unit,\n\t\t\tbottomLeft: unit,\n\t\t\tbottomRight: unit,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<UnitControl\n\t\t\t{ ...props }\n\t\t\taria-label={ __( 'Border radius' ) }\n\t\t\tdisableUnits={ isMixed }\n\t\t\tisOnly\n\t\t\tvalue={ allValue }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\tplaceholder={ allPlaceholder }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/border-radius-control/all-input-control.js"],"names":["AllInputControl","onChange","selectedUnits","setSelectedUnits","values","props","allValue","undefined","hasValues","isMixed","allPlaceholder","handleOnChange","next","isNumeric","isNaN","parseFloat","nextValue","handleOnUnitChange","unit","topLeft","topRight","bottomLeft","bottomRight"],"mappings":";;;;;;;;;;;;;AAGA;;AACA;;AAKA;;AATA;AACA;AACA;;AAIA;AACA;AACA;AAQe,SAASA,eAAT,OAMX;AAAA,MANqC;AACxCC,IAAAA,QADwC;AAExCC,IAAAA,aAFwC;AAGxCC,IAAAA,gBAHwC;AAIxCC,IAAAA,MAJwC;AAKxC,OAAGC;AALqC,GAMrC;AACH,MAAIC,QAAQ,GAAG,wBAAaF,MAAb,CAAf;;AAEA,MAAKE,QAAQ,KAAKC,SAAlB,EAA8B;AAC7B;AACA;AACAD,IAAAA,QAAQ,GAAG,uBAAYJ,aAAZ,CAAX;AACA;;AAED,QAAMM,SAAS,GAAG,6BAAkBJ,MAAlB,CAAlB;AACA,QAAMK,OAAO,GAAGD,SAAS,IAAI,2BAAgBJ,MAAhB,CAA7B;AACA,QAAMM,cAAc,GAAGD,OAAO,GAAG,cAAI,OAAJ,CAAH,GAAmB,IAAjD,CAXG,CAaH;;AACA,QAAME,cAAc,GAAKC,IAAF,IAAY;AAClC,UAAMC,SAAS,GAAG,CAAEC,KAAK,CAAEC,UAAU,CAAEH,IAAF,CAAZ,CAAzB;AACA,UAAMI,SAAS,GAAGH,SAAS,GAAGD,IAAH,GAAUL,SAArC;AACAN,IAAAA,QAAQ,CAAEe,SAAF,CAAR;AACA,GAJD,CAdG,CAoBH;AACA;;;AACA,QAAMC,kBAAkB,GAAKC,IAAF,IAAY;AACtCf,IAAAA,gBAAgB,CAAE;AACjBgB,MAAAA,OAAO,EAAED,IADQ;AAEjBE,MAAAA,QAAQ,EAAEF,IAFO;AAGjBG,MAAAA,UAAU,EAAEH,IAHK;AAIjBI,MAAAA,WAAW,EAAEJ;AAJI,KAAF,CAAhB;AAMA,GAPD;;AASA,SACC,4BAAC,qCAAD,6BACMb,KADN;AAEC,kBAAa,cAAI,eAAJ,CAFd;AAGC,IAAA,YAAY,EAAGI,OAHhB;AAIC,IAAA,MAAM,MAJP;AAKC,IAAA,KAAK,EAAGH,QALT;AAMC,IAAA,QAAQ,EAAGK,cANZ;AAOC,IAAA,YAAY,EAAGM,kBAPhB;AAQC,IAAA,WAAW,EAAGP,cARf;AASC,IAAA,IAAI,EAAG;AATR,KADD;AAaA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __experimentalUnitControl as UnitControl } from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetAllValue,\n\tgetAllUnit,\n\thasMixedValues,\n\thasDefinedValues,\n} from './utils';\n\nexport default function AllInputControl( {\n\tonChange,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tvalues,\n\t...props\n} ) {\n\tlet allValue = getAllValue( values );\n\n\tif ( allValue === undefined ) {\n\t\t// If we don't have any value set the unit to any current selection\n\t\t// or the most common unit from the individual radii values.\n\t\tallValue = getAllUnit( selectedUnits );\n\t}\n\n\tconst hasValues = hasDefinedValues( values );\n\tconst isMixed = hasValues && hasMixedValues( values );\n\tconst allPlaceholder = isMixed ? __( 'Mixed' ) : null;\n\n\t// Filter out CSS-unit-only values to prevent invalid styles.\n\tconst handleOnChange = ( next ) => {\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\t\tonChange( nextValue );\n\t};\n\n\t// Store current unit selection for use as fallback for individual\n\t// radii controls.\n\tconst handleOnUnitChange = ( unit ) => {\n\t\tsetSelectedUnits( {\n\t\t\ttopLeft: unit,\n\t\t\ttopRight: unit,\n\t\t\tbottomLeft: unit,\n\t\t\tbottomRight: unit,\n\t\t} );\n\t};\n\n\treturn (\n\t\t<UnitControl\n\t\t\t{ ...props }\n\t\t\taria-label={ __( 'Border radius' ) }\n\t\t\tdisableUnits={ isMixed }\n\t\t\tisOnly\n\t\t\tvalue={ allValue }\n\t\t\tonChange={ handleOnChange }\n\t\t\tonUnitChange={ handleOnUnitChange }\n\t\t\tplaceholder={ allPlaceholder }\n\t\t\tsize={ '__unstable-large' }\n\t\t/>\n\t);\n}\n"]}
@@ -106,7 +106,8 @@ function BorderRadiusControl(_ref) {
106
106
  initialPosition: 0,
107
107
  withInputField: false,
108
108
  onChange: handleSliderChange,
109
- step: step
109
+ step: step,
110
+ __nextHasNoMarginBottom: true
110
111
  })) : (0, _element.createElement)(_inputControls.default, {
111
112
  min: MIN_BORDER_RADIUS_VALUE,
112
113
  onChange: onChange,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/border-radius-control/index.js"],"names":["DEFAULT_VALUES","topLeft","undefined","topRight","bottomLeft","bottomRight","MIN_BORDER_RADIUS_VALUE","MAX_BORDER_RADIUS_VALUES","px","em","rem","BorderRadiusControl","onChange","values","isLinked","setIsLinked","selectedUnits","setSelectedUnits","flat","units","availableUnits","unit","unitConfig","find","item","value","step","allValue","toggleLinked","handleSliderChange","next"],"mappings":";;;;;;;;;AASA;;AANA;;AAOA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAUA;AACA;AACA;AAYA,MAAMA,cAAc,GAAG;AACtBC,EAAAA,OAAO,EAAEC,SADa;AAEtBC,EAAAA,QAAQ,EAAED,SAFY;AAGtBE,EAAAA,UAAU,EAAEF,SAHU;AAItBG,EAAAA,WAAW,EAAEH;AAJS,CAAvB;AAMA,MAAMI,uBAAuB,GAAG,CAAhC;AACA,MAAMC,wBAAwB,GAAG;AAChCC,EAAAA,EAAE,EAAE,GAD4B;AAEhCC,EAAAA,EAAE,EAAE,EAF4B;AAGhCC,EAAAA,GAAG,EAAE;AAH2B,CAAjC;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACe,SAASC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Q,EAAGM,QAFZ;AAGC,IAAA,aAAa,EAAGI,aAHjB;AAIC,IAAA,gBAAgB,EAAGC,gBAJpB;AAKC,IAAA,MAAM,EAAGJ,MAAM,IAAIb,cALpB;AAMC,IAAA,KAAK,EAAGmB;AANT,IA1BF,EAmCC,4BAAC,qBAAD;AAAc,IAAA,OAAO,EAAGS,YAAxB;AAAuC,IAAA,QAAQ,EAAGd;AAAlD,IAnCD,CAJD,CADD;AA4CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tRangeControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalUseCustomUnits as useCustomUnits,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport LinkedButton from './linked-button';\nimport useSetting from '../use-setting';\nimport {\n\tgetAllValue,\n\tgetAllUnit,\n\thasDefinedValues,\n\thasMixedValues,\n} from './utils';\n\nconst DEFAULT_VALUES = {\n\ttopLeft: undefined,\n\ttopRight: undefined,\n\tbottomLeft: undefined,\n\tbottomRight: undefined,\n};\nconst MIN_BORDER_RADIUS_VALUE = 0;\nconst MAX_BORDER_RADIUS_VALUES = {\n\tpx: 100,\n\tem: 20,\n\trem: 20,\n};\n\n/**\n * Control to display border radius options.\n *\n * @param {Object} props Component props.\n * @param {Function} props.onChange Callback to handle onChange.\n * @param {Object} props.values Border radius values.\n *\n * @return {WPElement} Custom border radius control.\n */\nexport default function BorderRadiusControl( { onChange, values } ) {\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasDefinedValues( values ) || ! hasMixedValues( values )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS unit only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\tflat:\n\t\t\ttypeof values === 'string'\n\t\t\t\t? parseQuantityAndUnitFromRawValue( values )[ 1 ]\n\t\t\t\t: undefined,\n\t\ttopLeft: parseQuantityAndUnitFromRawValue( values?.topLeft )[ 1 ],\n\t\ttopRight: parseQuantityAndUnitFromRawValue( values?.topRight )[ 1 ],\n\t\tbottomLeft: parseQuantityAndUnitFromRawValue( values?.bottomLeft )[ 1 ],\n\t\tbottomRight: parseQuantityAndUnitFromRawValue(\n\t\t\tvalues?.bottomRight\n\t\t)[ 1 ],\n\t} );\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useSetting( 'spacing.units' ) || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tconst unit = getAllUnit( selectedUnits );\n\tconst unitConfig = units && units.find( ( item ) => item.value === unit );\n\tconst step = unitConfig?.step || 1;\n\n\tconst [ allValue ] = parseQuantityAndUnitFromRawValue(\n\t\tgetAllValue( values )\n\t);\n\n\tconst toggleLinked = () => setIsLinked( ! isLinked );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( next !== undefined ? `${ next }${ unit }` : undefined );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"components-border-radius-control\">\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Radius' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<div className=\"components-border-radius-control__wrapper\">\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__unit-control\"\n\t\t\t\t\t\t\tvalues={ values }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Border radius' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__range-control\"\n\t\t\t\t\t\t\tvalue={ allValue ?? '' }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tmax={ MAX_BORDER_RADIUS_VALUES[ unit ] }\n\t\t\t\t\t\t\tinitialPosition={ 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<InputControls\n\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\tvalues={ values || DEFAULT_VALUES }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<LinkedButton onClick={ toggleLinked } isLinked={ isLinked } />\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/border-radius-control/index.js"],"names":["DEFAULT_VALUES","topLeft","undefined","topRight","bottomLeft","bottomRight","MIN_BORDER_RADIUS_VALUE","MAX_BORDER_RADIUS_VALUES","px","em","rem","BorderRadiusControl","onChange","values","isLinked","setIsLinked","selectedUnits","setSelectedUnits","flat","units","availableUnits","unit","unitConfig","find","item","value","step","allValue","toggleLinked","handleSliderChange","next"],"mappings":";;;;;;;;;AASA;;AANA;;AAOA;;AAKA;;AACA;;AACA;;AACA;;AACA;;AAnBA;AACA;AACA;;AAUA;AACA;AACA;AAYA,MAAMA,cAAc,GAAG;AACtBC,EAAAA,OAAO,EAAEC,SADa;AAEtBC,EAAAA,QAAQ,EAAED,SAF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GAAe,EAJrB;AAKC,IAAA,GAAG,EAAGrB,uBALP;AAMC,IAAA,GAAG,EAAGC,wBAAwB,CAAEc,IAAF,CAN/B;AAOC,IAAA,eAAe,EAAG,CAPnB;AAQC,IAAA,cAAc,EAAG,KARlB;AASC,IAAA,QAAQ,EAAGQ,kBATZ;AAUC,IAAA,IAAI,EAAGH,IAVR;AAWC,IAAA,uBAAuB;AAXxB,IAVD,CADS,GA0BT,4BAAC,sBAAD;AACC,IAAA,GAAG,EAAGpB,uBADP;AAEC,IAAA,QAAQ,EAAGM,QAFZ;AAGC,IAAA,aAAa,EAAGI,aAHjB;AAIC,IAAA,gBAAgB,EAAGC,gBAJpB;AAKC,IAAA,MAAM,EAAGJ,MAAM,IAAIb,cALpB;AAMC,IAAA,KAAK,EAAGmB;AANT,IA3BF,EAoCC,4BAAC,qBAAD;AAAc,IAAA,OAAO,EAAGS,YAAxB;AAAuC,IAAA,QAAQ,EAAGd;AAAlD,IApCD,CAJD,CADD;AA6CA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\tRangeControl,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalUseCustomUnits as useCustomUnits,\n} from '@wordpress/components';\nimport { useState } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport AllInputControl from './all-input-control';\nimport InputControls from './input-controls';\nimport LinkedButton from './linked-button';\nimport useSetting from '../use-setting';\nimport {\n\tgetAllValue,\n\tgetAllUnit,\n\thasDefinedValues,\n\thasMixedValues,\n} from './utils';\n\nconst DEFAULT_VALUES = {\n\ttopLeft: undefined,\n\ttopRight: undefined,\n\tbottomLeft: undefined,\n\tbottomRight: undefined,\n};\nconst MIN_BORDER_RADIUS_VALUE = 0;\nconst MAX_BORDER_RADIUS_VALUES = {\n\tpx: 100,\n\tem: 20,\n\trem: 20,\n};\n\n/**\n * Control to display border radius options.\n *\n * @param {Object} props Component props.\n * @param {Function} props.onChange Callback to handle onChange.\n * @param {Object} props.values Border radius values.\n *\n * @return {WPElement} Custom border radius control.\n */\nexport default function BorderRadiusControl( { onChange, values } ) {\n\tconst [ isLinked, setIsLinked ] = useState(\n\t\t! hasDefinedValues( values ) || ! hasMixedValues( values )\n\t);\n\n\t// Tracking selected units via internal state allows filtering of CSS unit\n\t// only values from being saved while maintaining preexisting unit selection\n\t// behaviour. Filtering CSS unit only values prevents invalid style values.\n\tconst [ selectedUnits, setSelectedUnits ] = useState( {\n\t\tflat:\n\t\t\ttypeof values === 'string'\n\t\t\t\t? parseQuantityAndUnitFromRawValue( values )[ 1 ]\n\t\t\t\t: undefined,\n\t\ttopLeft: parseQuantityAndUnitFromRawValue( values?.topLeft )[ 1 ],\n\t\ttopRight: parseQuantityAndUnitFromRawValue( values?.topRight )[ 1 ],\n\t\tbottomLeft: parseQuantityAndUnitFromRawValue( values?.bottomLeft )[ 1 ],\n\t\tbottomRight: parseQuantityAndUnitFromRawValue(\n\t\t\tvalues?.bottomRight\n\t\t)[ 1 ],\n\t} );\n\n\tconst units = useCustomUnits( {\n\t\tavailableUnits: useSetting( 'spacing.units' ) || [ 'px', 'em', 'rem' ],\n\t} );\n\n\tconst unit = getAllUnit( selectedUnits );\n\tconst unitConfig = units && units.find( ( item ) => item.value === unit );\n\tconst step = unitConfig?.step || 1;\n\n\tconst [ allValue ] = parseQuantityAndUnitFromRawValue(\n\t\tgetAllValue( values )\n\t);\n\n\tconst toggleLinked = () => setIsLinked( ! isLinked );\n\n\tconst handleSliderChange = ( next ) => {\n\t\tonChange( next !== undefined ? `${ next }${ unit }` : undefined );\n\t};\n\n\treturn (\n\t\t<fieldset className=\"components-border-radius-control\">\n\t\t\t<BaseControl.VisualLabel as=\"legend\">\n\t\t\t\t{ __( 'Radius' ) }\n\t\t\t</BaseControl.VisualLabel>\n\t\t\t<div className=\"components-border-radius-control__wrapper\">\n\t\t\t\t{ isLinked ? (\n\t\t\t\t\t<>\n\t\t\t\t\t\t<AllInputControl\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__unit-control\"\n\t\t\t\t\t\t\tvalues={ values }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<RangeControl\n\t\t\t\t\t\t\tlabel={ __( 'Border radius' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tclassName=\"components-border-radius-control__range-control\"\n\t\t\t\t\t\t\tvalue={ allValue ?? '' }\n\t\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\t\tmax={ MAX_BORDER_RADIUS_VALUES[ unit ] }\n\t\t\t\t\t\t\tinitialPosition={ 0 }\n\t\t\t\t\t\t\twithInputField={ false }\n\t\t\t\t\t\t\tonChange={ handleSliderChange }\n\t\t\t\t\t\t\tstep={ step }\n\t\t\t\t\t\t\t__nextHasNoMarginBottom\n\t\t\t\t\t\t/>\n\t\t\t\t\t</>\n\t\t\t\t) : (\n\t\t\t\t\t<InputControls\n\t\t\t\t\t\tmin={ MIN_BORDER_RADIUS_VALUE }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t\tselectedUnits={ selectedUnits }\n\t\t\t\t\t\tsetSelectedUnits={ setSelectedUnits }\n\t\t\t\t\t\tvalues={ values || DEFAULT_VALUES }\n\t\t\t\t\t\tunits={ units }\n\t\t\t\t\t/>\n\t\t\t\t) }\n\t\t\t\t<LinkedButton onClick={ toggleLinked } isLinked={ isLinked } />\n\t\t\t</div>\n\t\t</fieldset>\n\t);\n}\n"]}
@@ -80,7 +80,8 @@ function BoxInputControls(_ref) {
80
80
  "aria-label": label,
81
81
  value: [parsedQuantity, computedUnit].join(''),
82
82
  onChange: createHandleOnChange(corner),
83
- onUnitChange: createHandleOnUnitChange(corner)
83
+ onUnitChange: createHandleOnUnitChange(corner),
84
+ size: '__unstable-large'
84
85
  }))));
85
86
  }));
86
87
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/border-radius-control/input-controls.js"],"names":["CORNERS","topLeft","topRight","bottomLeft","bottomRight","BoxInputControls","onChange","selectedUnits","setSelectedUnits","values","valuesProp","props","createHandleOnChange","corner","next","isNumeric","isNaN","parseFloat","nextValue","undefined","createHandleOnUnitChange","side","newUnits","Object","entries","map","label","parsedQuantity","parsedUnit","computedUnit","flat","join"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;AAQA,MAAMA,OAAO,GAAG;AACfC,EAAAA,OAAO,EAAE,cAAI,UAAJ,CADM;AAEfC,EAAAA,QAAQ,EAAE,cAAI,WAAJ,CAFK;AAGfC,EAAAA,UAAU,EAAE,cAAI,aAAJ,CAHG;AAIfC,EAAAA,WAAW,EAAE,cAAI,cAAJ;AAJE,CAAhB;;AAOe,SAASC,gBAAT,OAMX;AAAA,MANsC;AACzCC,IAAAA,QADyC;AAEzCC,IAAAA,aAFyC;AAGzCC,IAAAA,gBAHyC;AAIzCC,IAAAA,MAAM,EAAEC,UAJiC;AAKzC,OAAGC;AALsC,GAMtC;;AACH,QAAMC,oBAAoB,GAAKC,MAAF,IAAgBC,IAAF,IAAY;AACtD,QAAK,CAAER,QAAP,EAAkB;AACjB;AACA,KAHqD,CAKtD;;;AACA,UAAMS,SAAS,GAAG,CAAEC,KAAK,CAAEC,UAAU,CAAEH,IAAF,CAAZ,CAAzB;AACA,UAAMI,SAAS,GAAGH,SAAS,GAAGD,IAAH,GAAUK,SAArC;AAEAb,IAAAA,QAAQ,CAAE,EACT,GAAGG,MADM;AAET,OAAEI,MAAF,GAAYK;AAFH,KAAF,CAAR;AAIA,GAbD;;AAeA,QAAME,wBAAwB,GAAKC,IAAF,IAAcP,IAAF,IAA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CADD;AA8BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalUnitControl as UnitControl,\n\tTooltip,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst CORNERS = {\n\ttopLeft: __( 'Top left' ),\n\ttopRight: __( 'Top right' ),\n\tbottomLeft: __( 'Bottom left' ),\n\tbottomRight: __( 'Bottom right' ),\n};\n\nexport default function BoxInputControls( {\n\tonChange,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tvalues: valuesProp,\n\t...props\n} ) {\n\tconst createHandleOnChange = ( corner ) => ( next ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Filter out CSS-unit-only values to prevent invalid styles.\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tonChange( {\n\t\t\t...values,\n\t\t\t[ corner ]: nextValue,\n\t\t} );\n\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\t\tnewUnits[ side ] = next;\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// For shorthand style & backwards compatibility, handle flat string value.\n\tconst values =\n\t\ttypeof valuesProp !== 'string'\n\t\t\t? valuesProp\n\t\t\t: {\n\t\t\t\t\ttopLeft: valuesProp,\n\t\t\t\t\ttopRight: valuesProp,\n\t\t\t\t\tbottomLeft: valuesProp,\n\t\t\t\t\tbottomRight: valuesProp,\n\t\t\t };\n\n\t// Controls are wrapped in tooltips as visible labels aren't desired here.\n\t// Tooltip rendering also requires the UnitControl to be wrapped. See:\n\t// https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026\n\treturn (\n\t\t<div className=\"components-border-radius-control__input-controls-wrapper\">\n\t\t\t{ Object.entries( CORNERS ).map( ( [ corner, label ] ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue( values[ corner ] );\n\n\t\t\t\tconst computedUnit = values[ corner ]\n\t\t\t\t\t? parsedUnit\n\t\t\t\t\t: selectedUnits[ corner ] || selectedUnits.flat;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Tooltip text={ label } position=\"top\" key={ corner }>\n\t\t\t\t\t\t<div className=\"components-border-radius-control__tooltip-wrapper\">\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\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\tonChange={ createHandleOnChange( corner ) }\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tcorner\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/border-radius-control/input-controls.js"],"names":["CORNERS","topLeft","topRight","bottomLeft","bottomRight","BoxInputControls","onChange","selectedUnits","setSelectedUnits","values","valuesProp","props","createHandleOnChange","corner","next","isNumeric","isNaN","parseFloat","nextValue","undefined","createHandleOnUnitChange","side","newUnits","Object","entries","map","label","parsedQuantity","parsedUnit","computedUnit","flat","join"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AARA;AACA;AACA;AAQA,MAAMA,OAAO,GAAG;AACfC,EAAAA,OAAO,EAAE,cAAI,UAAJ,CADM;AAEfC,EAAAA,QAAQ,EAAE,cAAI,WAAJ,CAFK;AAGfC,EAAAA,UAAU,EAAE,cAAI,aAAJ,CAHG;AAIfC,EAAAA,WAAW,EAAE,cAAI,cAAJ;AAJE,CAAhB;;AA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AGA,UAAMgB,YAAY,GAAGpB,MAAM,CAAEI,MAAF,CAAN,GAClBe,UADkB,GAElBrB,aAAa,CAAEM,MAAF,CAAb,IAA2BN,aAAa,CAACuB,IAF5C;AAIA,WACC,4BAAC,mBAAD;AAAS,MAAA,IAAI,EAAGJ,KAAhB;AAAwB,MAAA,QAAQ,EAAC,KAAjC;AAAuC,MAAA,GAAG,EAAGb;AAA7C,OACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACC,4BAAC,qCAAD,6BACMF,KADN;AAEC,oBAAae,KAFd;AAGC,MAAA,KAAK,EAAG,CAAEC,cAAF,EAAkBE,YAAlB,EAAiCE,IAAjC,CACP,EADO,CAHT;AAMC,MAAA,QAAQ,EAAGnB,oBAAoB,CAAEC,MAAF,CANhC;AAOC,MAAA,YAAY,EAAGO,wBAAwB,CACtCP,MADsC,CAPxC;AAUC,MAAA,IAAI,EAAG;AAVR,OADD,CADD,CADD;AAkBA,GA1BC,CADH,CADD;AA+BA","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\t__experimentalUnitControl as UnitControl,\n\tTooltip,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\n\nconst CORNERS = {\n\ttopLeft: __( 'Top left' ),\n\ttopRight: __( 'Top right' ),\n\tbottomLeft: __( 'Bottom left' ),\n\tbottomRight: __( 'Bottom right' ),\n};\n\nexport default function BoxInputControls( {\n\tonChange,\n\tselectedUnits,\n\tsetSelectedUnits,\n\tvalues: valuesProp,\n\t...props\n} ) {\n\tconst createHandleOnChange = ( corner ) => ( next ) => {\n\t\tif ( ! onChange ) {\n\t\t\treturn;\n\t\t}\n\n\t\t// Filter out CSS-unit-only values to prevent invalid styles.\n\t\tconst isNumeric = ! isNaN( parseFloat( next ) );\n\t\tconst nextValue = isNumeric ? next : undefined;\n\n\t\tonChange( {\n\t\t\t...values,\n\t\t\t[ corner ]: nextValue,\n\t\t} );\n\t};\n\n\tconst createHandleOnUnitChange = ( side ) => ( next ) => {\n\t\tconst newUnits = { ...selectedUnits };\n\t\tnewUnits[ side ] = next;\n\t\tsetSelectedUnits( newUnits );\n\t};\n\n\t// For shorthand style & backwards compatibility, handle flat string value.\n\tconst values =\n\t\ttypeof valuesProp !== 'string'\n\t\t\t? valuesProp\n\t\t\t: {\n\t\t\t\t\ttopLeft: valuesProp,\n\t\t\t\t\ttopRight: valuesProp,\n\t\t\t\t\tbottomLeft: valuesProp,\n\t\t\t\t\tbottomRight: valuesProp,\n\t\t\t };\n\n\t// Controls are wrapped in tooltips as visible labels aren't desired here.\n\t// Tooltip rendering also requires the UnitControl to be wrapped. See:\n\t// https://github.com/WordPress/gutenberg/pull/24966#issuecomment-685875026\n\treturn (\n\t\t<div className=\"components-border-radius-control__input-controls-wrapper\">\n\t\t\t{ Object.entries( CORNERS ).map( ( [ corner, label ] ) => {\n\t\t\t\tconst [ parsedQuantity, parsedUnit ] =\n\t\t\t\t\tparseQuantityAndUnitFromRawValue( values[ corner ] );\n\n\t\t\t\tconst computedUnit = values[ corner ]\n\t\t\t\t\t? parsedUnit\n\t\t\t\t\t: selectedUnits[ corner ] || selectedUnits.flat;\n\n\t\t\t\treturn (\n\t\t\t\t\t<Tooltip text={ label } position=\"top\" key={ corner }>\n\t\t\t\t\t\t<div className=\"components-border-radius-control__tooltip-wrapper\">\n\t\t\t\t\t\t\t<UnitControl\n\t\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t\t\taria-label={ label }\n\t\t\t\t\t\t\t\tvalue={ [ parsedQuantity, computedUnit ].join(\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\tonChange={ createHandleOnChange( corner ) }\n\t\t\t\t\t\t\t\tonUnitChange={ createHandleOnUnitChange(\n\t\t\t\t\t\t\t\t\tcorner\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</Tooltip>\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</div>\n\t);\n}\n"]}
@@ -88,7 +88,7 @@ const withEditorColorPalette = () => (0, _compose.createHigherOrderComponent)(Wr
88
88
 
89
89
 
90
90
  function createColorHOC(colorTypes, withColorPalette) {
91
- const colorMap = (0, _lodash.reduce)(colorTypes, (colorObject, colorType) => {
91
+ const colorMap = colorTypes.reduce((colorObject, colorType) => {
92
92
  return { ...colorObject,
93
93
  ...(typeof colorType === 'string' ? {
94
94
  [colorType]: (0, _lodash.kebabCase)(colorType)
@@ -114,7 +114,7 @@ function createColorHOC(colorTypes, withColorPalette) {
114
114
  }
115
115
 
116
116
  createSetters() {
117
- return (0, _lodash.reduce)(colorMap, (settersAccumulator, colorContext, colorAttributeName) => {
117
+ return Object.keys(colorMap).reduce((settersAccumulator, colorAttributeName) => {
118
118
  const upperFirstColorAttributeName = upperFirst(colorAttributeName);
119
119
  const customColorAttributeName = `custom${upperFirstColorAttributeName}`;
120
120
  settersAccumulator[`set${upperFirstColorAttributeName}`] = this.createSetColor(colorAttributeName, customColorAttributeName);
@@ -137,7 +137,8 @@ function createColorHOC(colorTypes, withColorPalette) {
137
137
  attributes,
138
138
  colors
139
139
  } = _ref2;
140
- return (0, _lodash.reduce)(colorMap, (newState, colorContext, colorAttributeName) => {
140
+ return Object.entries(colorMap).reduce((newState, _ref3) => {
141
+ let [colorAttributeName, colorContext] = _ref3;
141
142
  const colorObject = (0, _utils.getColorObjectByAttributeValues)(colors, attributes[colorAttributeName], attributes[`custom${upperFirst(colorAttributeName)}`]);
142
143
  const previousColorObject = previousState[colorAttributeName];
143
144
  const previousColor = previousColorObject === null || previousColorObject === void 0 ? void 0 : previousColorObject.color;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"names":["upperFirst","firstLetter","rest","toUpperCase","join","withCustomColorPalette","colorsArray","WrappedComponent","props","withEditorColorPalette","userPalette","themePalette","defaultPalette","allColors","createColorHOC","colorTypes","withColorPalette","colorMap","colorObject","colorType","Component","constructor","setters","createSetters","colorUtils","getMostReadableColor","bind","state","colorValue","colors","settersAccumulator","colorContext","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","previousState","attributes","newState","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"mappings":";;;;;;;;;;AAQA;;;;AALA;;AAMA;;AAKA;;AAMA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG;AAAA,MAAE,CAAEC,WAAF,EAAe,GAAGC,IAAlB,CAAF;AAAA,SAClBD,WAAW,CAACE,WAAZ,KAA4BD,IAAI,CAACE,IAAL,CAAW,EAAX,CADV;AAAA,CAAnB;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,sBAAsB,GAAKC,WAAF,IAC9B,yCACGC,gBAAF,IAA0BC,KAAF,IACvB,4BAAC,gBAAD,6BAAuBA,KAAvB;AAA+B,EAAA,MAAM,EAAGF;AAAxC,GAFF,EAGC,wBAHD,CADD;AAOA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,sBAAsB,GAAG,MAC9B,yCACGF,gBAAF,IAA0BC,KAAF,IAAa;AACpC;AACA;AACA;AACA,QAAME,WAAW,GAAG,yBAAY,sBAAZ,CAApB;AACA,QAAMC,YAAY,GAAG,yBAAY,qBAAZ,CAArB;AACA,QAAMC,cAAc,GAAG,yBAAY,uBAAZ,CAAvB;AACA,QAAMC,SAAS,GAAG,sBACjB,MAAM,CACL,IAAKH,WAAW,IAAI,EAApB,CADK,EAEL,IAAKC,YAAY,IAAI,EAArB,CAFK,EAGL,IAAKC,cAAc,IAAI,EAAvB,CAHK,CADW,EAMjB,CAAEF,WAAF,EAAeC,YAAf,E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,CAAEV,kBAAF,CAAR,GAAiC,EAChC,GAAGd,WAD6B;AAEhC4B,cAAAA,KAAK,EAAE,8BACNf,YADM,EAENb,WAAW,CAACmB,IAFN;AAFyB,aAAjC;AAOA;;AACD,iBAAOK,QAAP;AACA,SArCK,EAsCN,EAtCM,CAAP;AAwCA;;AAEDK,MAAAA,MAAM,GAAG;AACR,eACC,4BAAC,gBAAD,6BAEK,KAAKvC,KAFV;AAGEqB,UAAAA,MAAM,EAAES;AAHV,WAIK,KAAKX,KAJV,EAKK,KAAKL,OALV;AAMEE,UAAAA,UAAU,EAAE,KAAKA;AANnB,WADD;AAWA;;AAtH6B,KAA/B;AAwHA,GA3Hc,CAAT,CAAP;AA6HA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASwB,qBAAT,CAAgC1C,WAAhC,EAA8C;AACpD,SAAO,YAAqB;AAC3B,UAAMU,gBAAgB,GAAGX,sBAAsB,CAAEC,WAAF,CAA/C;;AAD2B,sCAAhBS,UAAgB;AAAhBA,MAAAA,UAAgB;AAAA;;AAE3B,WAAO,yCACND,cAAc,CAAEC,UAAF,EAAcC,gBAAd,CADR,EAEN,kBAFM,CAAP;AAIA,GAND;AAOA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACe,SAASiC,UAAT,GAAqC;AACnD,QAAMjC,gBAAgB,GAAGP,sBAAsB,EAA/C;;AADmD,qCAAbM,UAAa;AAAbA,IAAAA,UAAa;AAAA;;AAEnD,SAAO,yCACND,cAAc,CAAEC,UAAF,EAAcC,gBAAd,CADR,EAEN,YAFM,CAAP;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase, reduce } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, Component } from '@wordpress/element';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByColorValue,\n\tgetColorObjectByAttributeValues,\n\tgetMostReadableColor,\n} from './utils';\nimport useSetting from '../use-setting';\n\n/**\n * Capitalizes the first letter in a string.\n *\n * @param {string} str The string whose first letter the function will capitalize.\n *\n * @return {string} Capitalized string.\n */\nconst upperFirst = ( [ firstLetter, ...rest ] ) =>\n\tfirstLetter.toUpperCase() + rest.join( '' );\n\n/**\n * Higher order component factory for injecting the `colorsArray` argument as\n * the colors prop in the `withCustomColors` HOC.\n *\n * @param {Array} colorsArray An array of color objects.\n *\n * @return {Function} The higher order component.\n */\nconst withCustomColorPalette = ( colorsArray ) =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) =>\n\t\t\t<WrappedComponent { ...props } colors={ colorsArray } />,\n\t\t'withCustomColorPalette'\n\t);\n\n/**\n * Higher order component factory for injecting the editor colors as the\n * `colors` prop in the `withColors` HOC.\n *\n * @return {Function} The higher order component.\n */\nconst withEditorColorPalette = () =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) => {\n\t\t\t// Some color settings have a special handling for deprecated flags in `useSetting`,\n\t\t\t// so we can't unwrap them by doing const { ... } = useSetting('color')\n\t\t\t// until https://github.com/WordPress/gutenberg/issues/37094 is fixed.\n\t\t\tconst userPalette = useSetting( 'color.palette.custom' );\n\t\t\tconst themePalette = useSetting( 'color.palette.theme' );\n\t\t\tconst defaultPalette = useSetting( 'color.palette.default' );\n\t\t\tconst allColors = useMemo(\n\t\t\t\t() => [\n\t\t\t\t\t...( userPalette || [] ),\n\t\t\t\t\t...( themePalette || [] ),\n\t\t\t\t\t...( defaultPalette || [] ),\n\t\t\t\t],\n\t\t\t\t[ userPalette, themePalette, defaultPalette ]\n\t\t\t);\n\t\t\treturn <WrappedComponent { ...props } colors={ allColors } />;\n\t\t},\n\t\t'withEditorColorPalette'\n\t);\n\n/**\n * Helper function used with `createHigherOrderComponent` to create\n * higher order components for managing color logic.\n *\n * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).\n * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.\n *\n * @return {WPComponent} The component that can be used as a HOC.\n */\nfunction createColorHOC( colorTypes, withColorPalette ) {\n\tconst colorMap = reduce(\n\t\tcolorTypes,\n\t\t( colorObject, colorType ) => {\n\t\t\treturn {\n\t\t\t\t...colorObject,\n\t\t\t\t...( typeof colorType === 'string'\n\t\t\t\t\t? { [ colorType ]: kebabCase( colorType ) }\n\t\t\t\t\t: colorType ),\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\treturn compose( [\n\t\twithColorPalette,\n\t\t( WrappedComponent ) => {\n\t\t\treturn class extends Component {\n\t\t\t\tconstructor( props ) {\n\t\t\t\t\tsuper( props );\n\n\t\t\t\t\tthis.setters = this.createSetters();\n\t\t\t\t\tthis.colorUtils = {\n\t\t\t\t\t\tgetMostReadableColor:\n\t\t\t\t\t\t\tthis.getMostReadableColor.bind( this ),\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.state = {};\n\t\t\t\t}\n\n\t\t\t\tgetMostReadableColor( colorValue ) {\n\t\t\t\t\tconst { colors } = this.props;\n\t\t\t\t\treturn getMostReadableColor( colors, colorValue );\n\t\t\t\t}\n\n\t\t\t\tcreateSetters() {\n\t\t\t\t\treturn reduce(\n\t\t\t\t\t\tcolorMap,\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tsettersAccumulator,\n\t\t\t\t\t\t\tcolorContext,\n\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tconst upperFirstColorAttributeName =\n\t\t\t\t\t\t\t\tupperFirst( colorAttributeName );\n\t\t\t\t\t\t\tconst customColorAttributeName = `custom${ upperFirstColorAttributeName }`;\n\t\t\t\t\t\t\tsettersAccumulator[\n\t\t\t\t\t\t\t\t`set${ upperFirstColorAttributeName }`\n\t\t\t\t\t\t\t] = this.createSetColor(\n\t\t\t\t\t\t\t\tcolorAttributeName,\n\t\t\t\t\t\t\t\tcustomColorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn settersAccumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcreateSetColor( colorAttributeName, customColorAttributeName ) {\n\t\t\t\t\treturn ( colorValue ) => {\n\t\t\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\t\t\tthis.props.colors,\n\t\t\t\t\t\t\tcolorValue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.props.setAttributes( {\n\t\t\t\t\t\t\t[ colorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? colorObject.slug\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t[ customColorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: colorValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tstatic getDerivedStateFromProps(\n\t\t\t\t\t{ attributes, colors },\n\t\t\t\t\tpreviousState\n\t\t\t\t) {\n\t\t\t\t\treturn reduce(\n\t\t\t\t\t\tcolorMap,\n\t\t\t\t\t\t( newState, colorContext, colorAttributeName ) => {\n\t\t\t\t\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\t\tattributes[ colorAttributeName ],\n\t\t\t\t\t\t\t\tattributes[\n\t\t\t\t\t\t\t\t\t`custom${ upperFirst(\n\t\t\t\t\t\t\t\t\t\tcolorAttributeName\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\n\t\t\t\t\t\t\tconst previousColorObject =\n\t\t\t\t\t\t\t\tpreviousState[ colorAttributeName ];\n\t\t\t\t\t\t\tconst previousColor = previousColorObject?.color;\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The \"and previousColorObject\" condition checks that a previous color object was already computed.\n\t\t\t\t\t\t\t * At the start previousColorObject and colorValue are both equal to undefined\n\t\t\t\t\t\t\t * bus as previousColorObject does not exist we should compute the object.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tpreviousColor === colorObject.color &&\n\t\t\t\t\t\t\t\tpreviousColorObject\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] =\n\t\t\t\t\t\t\t\t\tpreviousColorObject;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] = {\n\t\t\t\t\t\t\t\t\t...colorObject,\n\t\t\t\t\t\t\t\t\tclass: getColorClassName(\n\t\t\t\t\t\t\t\t\t\tcolorContext,\n\t\t\t\t\t\t\t\t\t\tcolorObject.slug\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\treturn newState;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\trender() {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<WrappedComponent\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\t...this.props,\n\t\t\t\t\t\t\t\tcolors: undefined,\n\t\t\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\t\t\t...this.setters,\n\t\t\t\t\t\t\t\tcolorUtils: this.colorUtils,\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}\n\t\t\t};\n\t\t},\n\t] );\n}\n\n/**\n * A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic\n * for class generation color value, retrieval and color attribute setting.\n *\n * Use this higher-order component to work with a custom set of colors.\n *\n * @example\n *\n * ```jsx\n * const CUSTOM_COLORS = [ { name: 'Red', slug: 'red', color: '#ff0000' }, { name: 'Blue', slug: 'blue', color: '#0000ff' } ];\n * const withCustomColors = createCustomColorsHOC( CUSTOM_COLORS );\n * // ...\n * export default compose(\n * withCustomColors( 'backgroundColor', 'borderColor' ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {Array} colorsArray The array of color objects (name, slug, color, etc... ).\n *\n * @return {Function} Higher-order component.\n */\nexport function createCustomColorsHOC( colorsArray ) {\n\treturn ( ...colorTypes ) => {\n\t\tconst withColorPalette = withCustomColorPalette( colorsArray );\n\t\treturn createHigherOrderComponent(\n\t\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t\t'withCustomColors'\n\t\t);\n\t};\n}\n\n/**\n * A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting.\n *\n * For use with the default editor/theme color palette.\n *\n * @example\n *\n * ```jsx\n * export default compose(\n * withColors( 'backgroundColor', { textColor: 'color' } ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object,\n * it should contain the color attribute name as key and the color context as value.\n * If the argument is a string the value should be the color attribute name,\n * the color context is computed by applying a kebab case transform to the value.\n * Color context represents the context/place where the color is going to be used.\n * The class name of the color is generated using 'has' followed by the color name\n * and ending with the color context all in kebab case e.g: has-green-background-color.\n *\n * @return {Function} Higher-order component.\n */\nexport default function withColors( ...colorTypes ) {\n\tconst withColorPalette = withEditorColorPalette();\n\treturn createHigherOrderComponent(\n\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t'withColors'\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"names":["upperFirst","firstLetter","rest","toUpperCase","join","withCustomColorPalette","colorsArray","WrappedComponent","props","withEditorColorPalette","userPalette","themePalette","defaultPalette","allColors","createColorHOC","colorTypes","withColorPalette","colorMap","reduce","colorObject","colorType","Component","constructor","setters","createSetters","colorUtils","getMostReadableColor","bind","state","colorValue","colors","Object","keys","settersAccumulator","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","previousState","attributes","entries","newState","colorContext","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"mappings":";;;;;;;;;;AAQA;;;;AALA;;AAMA;;AAKA;;AAMA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMA,UAAU,GAAG;AAAA,MAAE,CAAEC,WAAF,EAAe,GAAGC,IAAlB,CAAF;AAAA,SAClBD,WAAW,CAACE,WAAZ,KAA4BD,IAAI,CAACE,IAAL,CAAW,EAAX,CADV;AAAA,CAAnB;AAGA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,sBAAsB,GAAKC,WAAF,IAC9B,yCACGC,gBAAF,IAA0BC,KAAF,IACvB,4BAAC,gBAAD,6BAAuBA,KAAvB;AAA+B,EAAA,MAAM,EAAGF;AAAxC,GAFF,EAGC,wBAHD,CADD;AAOA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,sBAAsB,GAAG,MAC9B,yCACGF,gBAAF,IAA0BC,KAAF,IAAa;AACpC;AACA;AACA;AACA,QAAME,WAAW,GAAG,yBAAY,sBAAZ,CAApB;AACA,QAAMC,YAAY,GAAG,yBAAY,qBAAZ,CAArB;AACA,QAAMC,cAAc,GAAG,yBAAY,uBAAZ,CAAvB;AACA,QAAMC,SAAS,GAAG,sBACjB,MAAM,CACL,IAAKH,WAAW,IAAI,EAApB,CADK,EAEL,IAAKC,YAAY,IAAI,EAArB,CAFK,EAGL,IAAKC,cAAc,IAAI,EAAvB,CAHK,CADW,EAMjB,CAAEF,WAAF,EAAeC,YAAf,EAA6BC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ent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useMemo, Component } from '@wordpress/element';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByColorValue,\n\tgetColorObjectByAttributeValues,\n\tgetMostReadableColor,\n} from './utils';\nimport useSetting from '../use-setting';\n\n/**\n * Capitalizes the first letter in a string.\n *\n * @param {string} str The string whose first letter the function will capitalize.\n *\n * @return {string} Capitalized string.\n */\nconst upperFirst = ( [ firstLetter, ...rest ] ) =>\n\tfirstLetter.toUpperCase() + rest.join( '' );\n\n/**\n * Higher order component factory for injecting the `colorsArray` argument as\n * the colors prop in the `withCustomColors` HOC.\n *\n * @param {Array} colorsArray An array of color objects.\n *\n * @return {Function} The higher order component.\n */\nconst withCustomColorPalette = ( colorsArray ) =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) =>\n\t\t\t<WrappedComponent { ...props } colors={ colorsArray } />,\n\t\t'withCustomColorPalette'\n\t);\n\n/**\n * Higher order component factory for injecting the editor colors as the\n * `colors` prop in the `withColors` HOC.\n *\n * @return {Function} The higher order component.\n */\nconst withEditorColorPalette = () =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) => {\n\t\t\t// Some color settings have a special handling for deprecated flags in `useSetting`,\n\t\t\t// so we can't unwrap them by doing const { ... } = useSetting('color')\n\t\t\t// until https://github.com/WordPress/gutenberg/issues/37094 is fixed.\n\t\t\tconst userPalette = useSetting( 'color.palette.custom' );\n\t\t\tconst themePalette = useSetting( 'color.palette.theme' );\n\t\t\tconst defaultPalette = useSetting( 'color.palette.default' );\n\t\t\tconst allColors = useMemo(\n\t\t\t\t() => [\n\t\t\t\t\t...( userPalette || [] ),\n\t\t\t\t\t...( themePalette || [] ),\n\t\t\t\t\t...( defaultPalette || [] ),\n\t\t\t\t],\n\t\t\t\t[ userPalette, themePalette, defaultPalette ]\n\t\t\t);\n\t\t\treturn <WrappedComponent { ...props } colors={ allColors } />;\n\t\t},\n\t\t'withEditorColorPalette'\n\t);\n\n/**\n * Helper function used with `createHigherOrderComponent` to create\n * higher order components for managing color logic.\n *\n * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).\n * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.\n *\n * @return {WPComponent} The component that can be used as a HOC.\n */\nfunction createColorHOC( colorTypes, withColorPalette ) {\n\tconst colorMap = colorTypes.reduce( ( colorObject, colorType ) => {\n\t\treturn {\n\t\t\t...colorObject,\n\t\t\t...( typeof colorType === 'string'\n\t\t\t\t? { [ colorType ]: kebabCase( colorType ) }\n\t\t\t\t: colorType ),\n\t\t};\n\t}, {} );\n\n\treturn compose( [\n\t\twithColorPalette,\n\t\t( WrappedComponent ) => {\n\t\t\treturn class extends Component {\n\t\t\t\tconstructor( props ) {\n\t\t\t\t\tsuper( props );\n\n\t\t\t\t\tthis.setters = this.createSetters();\n\t\t\t\t\tthis.colorUtils = {\n\t\t\t\t\t\tgetMostReadableColor:\n\t\t\t\t\t\t\tthis.getMostReadableColor.bind( this ),\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.state = {};\n\t\t\t\t}\n\n\t\t\t\tgetMostReadableColor( colorValue ) {\n\t\t\t\t\tconst { colors } = this.props;\n\t\t\t\t\treturn getMostReadableColor( colors, colorValue );\n\t\t\t\t}\n\n\t\t\t\tcreateSetters() {\n\t\t\t\t\treturn Object.keys( colorMap ).reduce(\n\t\t\t\t\t\t( settersAccumulator, colorAttributeName ) => {\n\t\t\t\t\t\t\tconst upperFirstColorAttributeName =\n\t\t\t\t\t\t\t\tupperFirst( colorAttributeName );\n\t\t\t\t\t\t\tconst customColorAttributeName = `custom${ upperFirstColorAttributeName }`;\n\t\t\t\t\t\t\tsettersAccumulator[\n\t\t\t\t\t\t\t\t`set${ upperFirstColorAttributeName }`\n\t\t\t\t\t\t\t] = this.createSetColor(\n\t\t\t\t\t\t\t\tcolorAttributeName,\n\t\t\t\t\t\t\t\tcustomColorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn settersAccumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcreateSetColor( colorAttributeName, customColorAttributeName ) {\n\t\t\t\t\treturn ( colorValue ) => {\n\t\t\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\t\t\tthis.props.colors,\n\t\t\t\t\t\t\tcolorValue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.props.setAttributes( {\n\t\t\t\t\t\t\t[ colorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? colorObject.slug\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t[ customColorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: colorValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tstatic getDerivedStateFromProps(\n\t\t\t\t\t{ attributes, colors },\n\t\t\t\t\tpreviousState\n\t\t\t\t) {\n\t\t\t\t\treturn Object.entries( colorMap ).reduce(\n\t\t\t\t\t\t( newState, [ colorAttributeName, colorContext ] ) => {\n\t\t\t\t\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\t\tattributes[ colorAttributeName ],\n\t\t\t\t\t\t\t\tattributes[\n\t\t\t\t\t\t\t\t\t`custom${ upperFirst(\n\t\t\t\t\t\t\t\t\t\tcolorAttributeName\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\n\t\t\t\t\t\t\tconst previousColorObject =\n\t\t\t\t\t\t\t\tpreviousState[ colorAttributeName ];\n\t\t\t\t\t\t\tconst previousColor = previousColorObject?.color;\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The \"and previousColorObject\" condition checks that a previous color object was already computed.\n\t\t\t\t\t\t\t * At the start previousColorObject and colorValue are both equal to undefined\n\t\t\t\t\t\t\t * bus as previousColorObject does not exist we should compute the object.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tpreviousColor === colorObject.color &&\n\t\t\t\t\t\t\t\tpreviousColorObject\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] =\n\t\t\t\t\t\t\t\t\tpreviousColorObject;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] = {\n\t\t\t\t\t\t\t\t\t...colorObject,\n\t\t\t\t\t\t\t\t\tclass: getColorClassName(\n\t\t\t\t\t\t\t\t\t\tcolorContext,\n\t\t\t\t\t\t\t\t\t\tcolorObject.slug\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\treturn newState;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\trender() {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<WrappedComponent\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\t...this.props,\n\t\t\t\t\t\t\t\tcolors: undefined,\n\t\t\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\t\t\t...this.setters,\n\t\t\t\t\t\t\t\tcolorUtils: this.colorUtils,\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}\n\t\t\t};\n\t\t},\n\t] );\n}\n\n/**\n * A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic\n * for class generation color value, retrieval and color attribute setting.\n *\n * Use this higher-order component to work with a custom set of colors.\n *\n * @example\n *\n * ```jsx\n * const CUSTOM_COLORS = [ { name: 'Red', slug: 'red', color: '#ff0000' }, { name: 'Blue', slug: 'blue', color: '#0000ff' } ];\n * const withCustomColors = createCustomColorsHOC( CUSTOM_COLORS );\n * // ...\n * export default compose(\n * withCustomColors( 'backgroundColor', 'borderColor' ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {Array} colorsArray The array of color objects (name, slug, color, etc... ).\n *\n * @return {Function} Higher-order component.\n */\nexport function createCustomColorsHOC( colorsArray ) {\n\treturn ( ...colorTypes ) => {\n\t\tconst withColorPalette = withCustomColorPalette( colorsArray );\n\t\treturn createHigherOrderComponent(\n\t\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t\t'withCustomColors'\n\t\t);\n\t};\n}\n\n/**\n * A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting.\n *\n * For use with the default editor/theme color palette.\n *\n * @example\n *\n * ```jsx\n * export default compose(\n * withColors( 'backgroundColor', { textColor: 'color' } ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object,\n * it should contain the color attribute name as key and the color context as value.\n * If the argument is a string the value should be the color attribute name,\n * the color context is computed by applying a kebab case transform to the value.\n * Color context represents the context/place where the color is going to be used.\n * The class name of the color is generated using 'has' followed by the color name\n * and ending with the color context all in kebab case e.g: has-green-background-color.\n *\n * @return {Function} Higher-order component.\n */\nexport default function withColors( ...colorTypes ) {\n\tconst withColorPalette = withEditorColorPalette();\n\treturn createHigherOrderComponent(\n\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t'withColors'\n\t);\n}\n"]}
@@ -47,7 +47,7 @@ function DuotoneControl(_ref) {
47
47
  popoverProps: {
48
48
  className: 'block-editor-duotone-control__popover',
49
49
  headerTitle: (0, _i18n.__)('Duotone'),
50
- isAlternate: true
50
+ variant: 'toolbar'
51
51
  },
52
52
  renderToggle: _ref2 => {
53
53
  let {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/duotone-control/index.js"],"names":["DuotoneControl","colorPalette","duotonePalette","disableCustomColors","disableCustomDuotone","value","onChange","toolbarIcon","filter","className","headerTitle","isAlternate","isOpen","onToggle","openOnArrowDown","event","keyCode","DOWN","preventDefault"],"mappings":";;;;;;;;;AAGA;;AAQA;;AACA;;AACA;;AAbA;AACA;AACA;AAaA,SAASA,cAAT,OAOI;AAAA,MAPqB;AACxBC,IAAAA,YADwB;AAExBC,IAAAA,cAFwB;AAGxBC,IAAAA,mBAHwB;AAIxBC,IAAAA,oBAJwB;AAKxBC,IAAAA,KALwB;AAMxBC,IAAAA;AANwB,GAOrB;AACH,MAAIC,WAAJ;;AACA,MAAKF,KAAK,KAAK,OAAf,EAAyB;AACxBE,IAAAA,WAAW,GACV,4BAAC,0BAAD;AAAgB,MAAA,SAAS,EAAC;AAA1B,MADD;AAGA,GAJD,MAIO,IAAKF,KAAL,EAAa;AACnBE,IAAAA,WAAW,GAAG,4BAAC,yBAAD;AAAe,MAAA,MAAM,EAAGF;AAAxB,MAAd;AACA,GAFM,MAEA;AACNE,IAAAA,WAAW,GAAG,4BAAC,WAAD;AAAM,MAAA,IAAI,EAAGC;AAAb,MAAd;AACA;;AACD,SACC,4BAAC,oBAAD;AACC,IAAA,YAAY,EAAG;AACdC,MAAAA,SAAS,EAAE,uCADG;AAEdC,MAAAA,WAAW,EAAE,cAAI,SAAJ,CAFC;AAGdC,MAAAA,WAAW,EAAE;AAHC,KADhB;AAMC,IAAA,YAAY,EAAG,SAA4B;AAAA,UAA1B;AAAEC,QAAAA,MAAF;AAAUC,QAAAA;AAAV,OAA0B;;AAC1C,YAAMC,eAAe,GAAKC,KAAF,IAAa;AACpC,YAAK,CAAEH,MAAF,IAAYG,KAAK,CAACC,OAAN,KAAkBC,cAAnC,EAA0C;AACzCF,UAAAA,KAAK,CAACG,cAAN;AACAL,UAAAA,QAAQ;AACR;AACD,OALD;;AAMA,aACC,4BAAC,yBAAD;AACC,QAAA,WAAW,MADZ;AAEC,QAAA,OAAO,EAAGA,QAFX;AAGC,yBAAc,MAHf;AAIC,yBAAgBD,MAJjB;AAKC,QAAA,SAAS,EAAGE,eALb;AAMC,QAAA,KAAK,EAAG,cAAI,sBAAJ,CANT;AAOC,QAAA,IAAI,EAAGP;AAPR,QADD;AAWA,KAxBF;AAyBC,IAAA,aAAa,EAAG,MACf,4BAAC,qBAAD;AAAW,MAAA,KAAK,EAAG,cAAI,SAAJ;AAAnB,OACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACG,cACD,oEADC,CADH,CADD,EAMC,4BAAC,yBAAD;AACC,MAAA,YAAY,EAAGN,YADhB;AAEC,MAAA,cAAc,EAAGC,cAFlB;AAGC,MAAA,mBAAmB,EAAGC,mBAHvB;AAIC,MAAA,oBAAoB,EAAGC,oBAJxB;AAKC,MAAA,KAAK,EAAGC,KALT;AAMC,MAAA,QAAQ,EAAGC;AANZ,MAND;AA1BF,IADD;AA6CA;;eAEcN,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tColorIndicator,\n\tDropdown,\n\tDuotonePicker,\n\tDuotoneSwatch,\n\tMenuGroup,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport { Icon, filter } from '@wordpress/icons';\n\nfunction DuotoneControl( {\n\tcolorPalette,\n\tduotonePalette,\n\tdisableCustomColors,\n\tdisableCustomDuotone,\n\tvalue,\n\tonChange,\n} ) {\n\tlet toolbarIcon;\n\tif ( value === 'unset' ) {\n\t\ttoolbarIcon = (\n\t\t\t<ColorIndicator className=\"block-editor-duotone-control__unset-indicator\" />\n\t\t);\n\t} else if ( value ) {\n\t\ttoolbarIcon = <DuotoneSwatch values={ value } />;\n\t} else {\n\t\ttoolbarIcon = <Icon icon={ filter } />;\n\t}\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tclassName: 'block-editor-duotone-control__popover',\n\t\t\t\theaderTitle: __( 'Duotone' ),\n\t\t\t\tisAlternate: true,\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst openOnArrowDown = ( event ) => {\n\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treturn (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\t\tlabel={ __( 'Apply duotone filter' ) }\n\t\t\t\t\t\ticon={ toolbarIcon }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ () => (\n\t\t\t\t<MenuGroup label={ __( 'Duotone' ) }>\n\t\t\t\t\t<div className=\"block-editor-duotone-control__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Create a two-tone color effect without losing your original image.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t\t<DuotonePicker\n\t\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tdisableCustomDuotone={ disableCustomDuotone }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default DuotoneControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/duotone-control/index.js"],"names":["DuotoneControl","colorPalette","duotonePalette","disableCustomColors","disableCustomDuotone","value","onChange","toolbarIcon","filter","className","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;AAMC,QAAA,KAAK,EAAG,cAAI,sBAAJ,CANT;AAOC,QAAA,IAAI,EAAGP;AAPR,QADD;AAWA,KAxBF;AAyBC,IAAA,aAAa,EAAG,MACf,4BAAC,qBAAD;AAAW,MAAA,KAAK,EAAG,cAAI,SAAJ;AAAnB,OACC;AAAK,MAAA,SAAS,EAAC;AAAf,OACG,cACD,oEADC,CADH,CADD,EAMC,4BAAC,yBAAD;AACC,MAAA,YAAY,EAAGN,YADhB;AAEC,MAAA,cAAc,EAAGC,cAFlB;AAGC,MAAA,mBAAmB,EAAGC,mBAHvB;AAIC,MAAA,oBAAoB,EAAGC,oBAJxB;AAKC,MAAA,KAAK,EAAGC,KALT;AAMC,MAAA,QAAQ,EAAGC;AANZ,MAND;AA1BF,IADD;AA6CA;;eAEcN,c","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tColorIndicator,\n\tDropdown,\n\tDuotonePicker,\n\tDuotoneSwatch,\n\tMenuGroup,\n\tToolbarButton,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport { Icon, filter } from '@wordpress/icons';\n\nfunction DuotoneControl( {\n\tcolorPalette,\n\tduotonePalette,\n\tdisableCustomColors,\n\tdisableCustomDuotone,\n\tvalue,\n\tonChange,\n} ) {\n\tlet toolbarIcon;\n\tif ( value === 'unset' ) {\n\t\ttoolbarIcon = (\n\t\t\t<ColorIndicator className=\"block-editor-duotone-control__unset-indicator\" />\n\t\t);\n\t} else if ( value ) {\n\t\ttoolbarIcon = <DuotoneSwatch values={ value } />;\n\t} else {\n\t\ttoolbarIcon = <Icon icon={ filter } />;\n\t}\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ {\n\t\t\t\tclassName: 'block-editor-duotone-control__popover',\n\t\t\t\theaderTitle: __( 'Duotone' ),\n\t\t\t\tvariant: 'toolbar',\n\t\t\t} }\n\t\t\trenderToggle={ ( { isOpen, onToggle } ) => {\n\t\t\t\tconst openOnArrowDown = ( event ) => {\n\t\t\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\t\t\tevent.preventDefault();\n\t\t\t\t\t\tonToggle();\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t\treturn (\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tshowTooltip\n\t\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\t\taria-haspopup=\"true\"\n\t\t\t\t\t\taria-expanded={ isOpen }\n\t\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\t\tlabel={ __( 'Apply duotone filter' ) }\n\t\t\t\t\t\ticon={ toolbarIcon }\n\t\t\t\t\t/>\n\t\t\t\t);\n\t\t\t} }\n\t\t\trenderContent={ () => (\n\t\t\t\t<MenuGroup label={ __( 'Duotone' ) }>\n\t\t\t\t\t<div className=\"block-editor-duotone-control__description\">\n\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t'Create a two-tone color effect without losing your original image.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t</div>\n\t\t\t\t\t<DuotonePicker\n\t\t\t\t\t\tcolorPalette={ colorPalette }\n\t\t\t\t\t\tduotonePalette={ duotonePalette }\n\t\t\t\t\t\tdisableCustomColors={ disableCustomColors }\n\t\t\t\t\t\tdisableCustomDuotone={ disableCustomDuotone }\n\t\t\t\t\t\tvalue={ value }\n\t\t\t\t\t\tonChange={ onChange }\n\t\t\t\t\t/>\n\t\t\t\t</MenuGroup>\n\t\t\t) }\n\t\t/>\n\t);\n}\n\nexport default DuotoneControl;\n"]}
@@ -17,7 +17,6 @@ const DEFAULT_MAXIMUM_VIEWPORT_WIDTH = '1600px';
17
17
  const DEFAULT_MINIMUM_VIEWPORT_WIDTH = '768px';
18
18
  const DEFAULT_SCALE_FACTOR = 1;
19
19
  const DEFAULT_MINIMUM_FONT_SIZE_FACTOR = 0.75;
20
- const DEFAULT_MAXIMUM_FONT_SIZE_FACTOR = 1.5;
21
20
  const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
22
21
  /**
23
22
  * Computes a fluid font-size value that uses clamp(). A minimum and maxinmum
@@ -48,7 +47,6 @@ const DEFAULT_MINIMUM_FONT_SIZE_LIMIT = '14px';
48
47
  * @param {?string} args.minimumFontSize Minimum font size for any clamp() calculation. Optional.
49
48
  * @param {?number} args.scaleFactor A scale factor to determine how fast a font scales within boundaries. Optional.
50
49
  * @param {?number} args.minimumFontSizeFactor How much to scale defaultFontSize by to derive minimumFontSize. Optional.
51
- * @param {?number} args.maximumFontSizeFactor How much to scale defaultFontSize by to derive maximumFontSize. Optional.
52
50
  *
53
51
  * @return {string|null} A font-size value using clamp().
54
52
  */
@@ -62,74 +60,60 @@ function getComputedFluidTypographyValue(_ref) {
62
60
  maximumViewPortWidth = DEFAULT_MAXIMUM_VIEWPORT_WIDTH,
63
61
  scaleFactor = DEFAULT_SCALE_FACTOR,
64
62
  minimumFontSizeFactor = DEFAULT_MINIMUM_FONT_SIZE_FACTOR,
65
- maximumFontSizeFactor = DEFAULT_MAXIMUM_FONT_SIZE_FACTOR,
66
63
  minimumFontSizeLimit = DEFAULT_MINIMUM_FONT_SIZE_LIMIT
67
64
  } = _ref;
68
65
 
69
- /*
70
- * Caches minimumFontSize in minimumFontSizeValue
71
- * so we can check if minimumFontSize exists later.
72
- */
73
- let minimumFontSizeValue = minimumFontSize;
74
66
  /*
75
67
  * Calculates missing minimumFontSize and maximumFontSize from
76
68
  * defaultFontSize if provided.
77
69
  */
78
-
79
70
  if (fontSize) {
80
71
  // Parses default font size.
81
72
  const fontSizeParsed = getTypographyValueAndUnit(fontSize); // Protect against invalid units.
82
73
 
83
74
  if (!(fontSizeParsed !== null && fontSizeParsed !== void 0 && fontSizeParsed.unit)) {
84
75
  return null;
85
- } // If no minimumFontSize is provided, derive using min scale factor.
86
-
87
-
88
- if (!minimumFontSizeValue) {
89
- minimumFontSizeValue = roundToPrecision(fontSizeParsed.value * minimumFontSizeFactor, 3) + fontSizeParsed.unit;
90
76
  } // Parses the minimum font size limit, so we can perform checks using it.
91
77
 
92
78
 
93
79
  const minimumFontSizeLimitParsed = getTypographyValueAndUnit(minimumFontSizeLimit, {
94
80
  coerceTo: fontSizeParsed.unit
95
- });
81
+ }); // Don't enforce minimum font size if a font size has explicitly set a min and max value.
96
82
 
97
- if (!!(minimumFontSizeLimitParsed !== null && minimumFontSizeLimitParsed !== void 0 && minimumFontSizeLimitParsed.value)) {
83
+ if (!!(minimumFontSizeLimitParsed !== null && minimumFontSizeLimitParsed !== void 0 && minimumFontSizeLimitParsed.value) && !minimumFontSize && !maximumFontSize) {
98
84
  /*
99
85
  * If a minimum size was not passed to this function
100
- * and the user-defined font size is lower than `minimumFontSizeLimit`,
101
- * then uses the user-defined font size as the minimum font-size.
86
+ * and the user-defined font size is lower than $minimum_font_size_limit,
87
+ * do not calculate a fluid value.
102
88
  */
103
- if (!minimumFontSize && (fontSizeParsed === null || fontSizeParsed === void 0 ? void 0 : fontSizeParsed.value) < (minimumFontSizeLimitParsed === null || minimumFontSizeLimitParsed === void 0 ? void 0 : minimumFontSizeLimitParsed.value)) {
104
- minimumFontSizeValue = `${fontSizeParsed.value}${fontSizeParsed.unit}`;
105
- } else {
106
- const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSizeValue, {
107
- coerceTo: fontSizeParsed.unit
108
- });
109
- /*
110
- * Otherwise, if the passed or calculated minimum font size is lower than `minimumFontSizeLimit`
111
- * use `minimumFontSizeLimit` instead.
112
- */
113
-
114
- if (!!(minimumFontSizeParsed !== null && minimumFontSizeParsed !== void 0 && minimumFontSizeParsed.value) && minimumFontSizeParsed.value < minimumFontSizeLimitParsed.value) {
115
- minimumFontSizeValue = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`;
116
- }
89
+ if ((fontSizeParsed === null || fontSizeParsed === void 0 ? void 0 : fontSizeParsed.value) <= (minimumFontSizeLimitParsed === null || minimumFontSizeLimitParsed === void 0 ? void 0 : minimumFontSizeLimitParsed.value)) {
90
+ return null;
117
91
  }
118
- } // If no maximumFontSize is provided, derive using max scale factor.
92
+ } // If no fluid max font size is available use the incoming value.
119
93
 
120
94
 
121
95
  if (!maximumFontSize) {
122
- maximumFontSize = roundToPrecision(fontSizeParsed.value * maximumFontSizeFactor, 3) + fontSizeParsed.unit;
96
+ maximumFontSize = `${fontSizeParsed.value}${fontSizeParsed.unit}`;
123
97
  }
124
- } // Return early if one of the provided inputs is not provided.
98
+ /*
99
+ * If no minimumFontSize is provided, create one using
100
+ * the given font size multiplied by the min font size scale factor.
101
+ */
125
102
 
126
103
 
127
- if (!minimumFontSizeValue || !maximumFontSize) {
128
- return null;
104
+ if (!minimumFontSize) {
105
+ const calculatedMinimumFontSize = roundToPrecision(fontSizeParsed.value * minimumFontSizeFactor, 3); // Only use calculated min font size if it's > $minimum_font_size_limit value.
106
+
107
+ if (!!(minimumFontSizeLimitParsed !== null && minimumFontSizeLimitParsed !== void 0 && minimumFontSizeLimitParsed.value) && calculatedMinimumFontSize < (minimumFontSizeLimitParsed === null || minimumFontSizeLimitParsed === void 0 ? void 0 : minimumFontSizeLimitParsed.value)) {
108
+ minimumFontSize = `${minimumFontSizeLimitParsed.value}${minimumFontSizeLimitParsed.unit}`;
109
+ } else {
110
+ minimumFontSize = `${calculatedMinimumFontSize}${fontSizeParsed.unit}`;
111
+ }
112
+ }
129
113
  } // Grab the minimum font size and normalize it in order to use the value for calculations.
130
114
 
131
115
 
132
- const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSizeValue); // We get a 'preferred' unit to keep units consistent when calculating,
116
+ const minimumFontSizeParsed = getTypographyValueAndUnit(minimumFontSize); // We get a 'preferred' unit to keep units consistent when calculating,
133
117
  // otherwise the result will not be accurate.
134
118
 
135
119
  const fontSizeUnit = (minimumFontSizeParsed === null || minimumFontSizeParsed === void 0 ? void 0 : minimumFontSizeParsed.unit) || 'rem'; // Grabs the maximum font size and normalize it in order to use the value for calculations.
@@ -143,7 +127,7 @@ function getComputedFluidTypographyValue(_ref) {
143
127
  } // Uses rem for accessible fluid target font scaling.
144
128
 
145
129
 
146
- const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSizeValue, {
130
+ const minimumFontSizeRem = getTypographyValueAndUnit(minimumFontSize, {
147
131
  coerceTo: 'rem'
148
132
  }); // Viewport widths defined for fluid typography. Normalize units
149
133
 
@@ -165,7 +149,7 @@ function getComputedFluidTypographyValue(_ref) {
165
149
  const linearFactor = 100 * ((maximumFontSizeParsed.value - minimumFontSizeParsed.value) / (maximumViewPortWidthParsed.value - minumumViewPortWidthParsed.value));
166
150
  const linearFactorScaled = roundToPrecision((linearFactor || 1) * scaleFactor, 3);
167
151
  const fluidTargetFontSize = `${minimumFontSizeRem.value}${minimumFontSizeRem.unit} + ((1vw - ${viewPortWidthOffset}) * ${linearFactorScaled})`;
168
- return `clamp(${minimumFontSizeValue}, ${fluidTargetFontSize}, ${maximumFontSize})`;
152
+ return `clamp(${minimumFontSize}, ${fluidTargetFontSize}, ${maximumFontSize})`;
169
153
  }
170
154
  /**
171
155
  * Internal method that checks a string for a unit and value and returns an array consisting of `'value'` and `'unit'`, e.g., [ '42', 'rem' ].