@wordpress/block-editor 12.2.0 → 12.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1673) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/autocompleters/block.js +1 -3
  3. package/build/autocompleters/block.js.map +1 -1
  4. package/build/components/alignment-control/ui.js +9 -11
  5. package/build/components/alignment-control/ui.js.map +1 -1
  6. package/build/components/autocomplete/index.js +3 -4
  7. package/build/components/autocomplete/index.js.map +1 -1
  8. package/build/components/block-actions/index.js +8 -12
  9. package/build/components/block-actions/index.js.map +1 -1
  10. package/build/components/block-alignment-control/ui.js +17 -21
  11. package/build/components/block-alignment-control/ui.js.map +1 -1
  12. package/build/components/block-alignment-control/ui.native.js +14 -17
  13. package/build/components/block-alignment-control/ui.native.js.map +1 -1
  14. package/build/components/block-alignment-control/use-available-alignments.js +5 -10
  15. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  16. package/build/components/block-alignment-matrix-control/index.js +4 -6
  17. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  18. package/build/components/block-breadcrumb/index.js +3 -4
  19. package/build/components/block-breadcrumb/index.js.map +1 -1
  20. package/build/components/block-caption/index.native.js +30 -35
  21. package/build/components/block-caption/index.native.js.map +1 -1
  22. package/build/components/block-card/index.js +7 -9
  23. package/build/components/block-card/index.js.map +1 -1
  24. package/build/components/block-compare/block-view.js +8 -9
  25. package/build/components/block-compare/block-view.js.map +1 -1
  26. package/build/components/block-compare/index.js +7 -9
  27. package/build/components/block-compare/index.js.map +1 -1
  28. package/build/components/block-context/index.js +4 -5
  29. package/build/components/block-context/index.js.map +1 -1
  30. package/build/components/block-controls/fill.js +15 -22
  31. package/build/components/block-controls/fill.js.map +1 -1
  32. package/build/components/block-controls/hook.js +1 -3
  33. package/build/components/block-controls/hook.js.map +1 -1
  34. package/build/components/block-controls/slot.js +28 -18
  35. package/build/components/block-controls/slot.js.map +1 -1
  36. package/build/components/block-controls/slot.native.js +7 -17
  37. package/build/components/block-controls/slot.native.js.map +1 -1
  38. package/build/components/block-draggable/draggable-chip.js +5 -6
  39. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  40. package/build/components/block-draggable/draggable-chip.native.js +3 -4
  41. package/build/components/block-draggable/draggable-chip.native.js.map +1 -1
  42. package/build/components/block-draggable/dropping-insertion-point.native.js +6 -7
  43. package/build/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  44. package/build/components/block-draggable/index.js +15 -16
  45. package/build/components/block-draggable/index.js.map +1 -1
  46. package/build/components/block-draggable/index.native.js +43 -58
  47. package/build/components/block-draggable/index.native.js.map +1 -1
  48. package/build/components/block-edit/edit.js +1 -4
  49. package/build/components/block-edit/edit.js.map +1 -1
  50. package/build/components/block-edit/edit.native.js +1 -4
  51. package/build/components/block-edit/edit.native.js.map +1 -1
  52. package/build/components/block-edit-visually-button/index.js +3 -4
  53. package/build/components/block-edit-visually-button/index.js.map +1 -1
  54. package/build/components/block-full-height-alignment-control/index.js +6 -7
  55. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  56. package/build/components/block-icon/index.js +7 -11
  57. package/build/components/block-icon/index.js.map +1 -1
  58. package/build/components/block-icon/index.native.js +9 -13
  59. package/build/components/block-icon/index.native.js.map +1 -1
  60. package/build/components/block-inspector/index.js +36 -46
  61. package/build/components/block-inspector/index.js.map +1 -1
  62. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
  63. package/build/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  64. package/build/components/block-list/block-html.js +3 -4
  65. package/build/components/block-list/block-html.js.map +1 -1
  66. package/build/components/block-list/block-invalid-warning.js +3 -4
  67. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  68. package/build/components/block-list/block-invalid-warning.native.js +10 -15
  69. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  70. package/build/components/block-list/block-list-context.native.js +5 -11
  71. package/build/components/block-list/block-list-context.native.js.map +1 -1
  72. package/build/components/block-list/block-list-item-cell.native.js +5 -6
  73. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  74. package/build/components/block-list/block-list-item.native.js +17 -18
  75. package/build/components/block-list/block-list-item.native.js.map +1 -1
  76. package/build/components/block-list/block-outline.native.js +8 -9
  77. package/build/components/block-list/block-outline.native.js.map +1 -1
  78. package/build/components/block-list/block-selection-button.native.js +10 -12
  79. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  80. package/build/components/block-list/block.js +39 -46
  81. package/build/components/block-list/block.js.map +1 -1
  82. package/build/components/block-list/block.native.js +55 -68
  83. package/build/components/block-list/block.native.js.map +1 -1
  84. package/build/components/block-list/index.js +12 -15
  85. package/build/components/block-list/index.js.map +1 -1
  86. package/build/components/block-list/index.native.js +77 -86
  87. package/build/components/block-list/index.native.js.map +1 -1
  88. package/build/components/block-list/insertion-point.native.js +4 -5
  89. package/build/components/block-list/insertion-point.native.js.map +1 -1
  90. package/build/components/block-list/layout.js +6 -9
  91. package/build/components/block-list/layout.js.map +1 -1
  92. package/build/components/block-list/subdirectory-icon.js +10 -13
  93. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  94. package/build/components/block-list/use-block-props/index.js +15 -11
  95. package/build/components/block-list/use-block-props/index.js.map +1 -1
  96. package/build/components/block-list/use-block-props/index.native.js +1 -2
  97. package/build/components/block-list/use-block-props/index.native.js.map +1 -1
  98. package/build/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
  99. package/build/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  100. package/build/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
  101. package/build/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  102. package/build/components/block-list/use-in-between-inserter.js +1 -3
  103. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  104. package/build/components/block-list-appender/index.js +16 -15
  105. package/build/components/block-list-appender/index.js.map +1 -1
  106. package/build/components/block-list-appender/index.native.js +9 -11
  107. package/build/components/block-list-appender/index.native.js.map +1 -1
  108. package/build/components/block-lock/menu-item.js +3 -4
  109. package/build/components/block-lock/menu-item.js.map +1 -1
  110. package/build/components/block-lock/modal.js +6 -9
  111. package/build/components/block-lock/modal.js.map +1 -1
  112. package/build/components/block-lock/toolbar.js +4 -10
  113. package/build/components/block-lock/toolbar.js.map +1 -1
  114. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +49 -67
  115. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  116. package/build/components/block-mobile-toolbar/index.native.js +26 -34
  117. package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
  118. package/build/components/block-mover/button.js +6 -7
  119. package/build/components/block-mover/button.js.map +1 -1
  120. package/build/components/block-mover/index.js +5 -8
  121. package/build/components/block-mover/index.js.map +1 -1
  122. package/build/components/block-mover/index.native.js +23 -46
  123. package/build/components/block-mover/index.native.js.map +1 -1
  124. package/build/components/block-mover/mover-description.native.js +7 -10
  125. package/build/components/block-mover/mover-description.native.js.map +1 -1
  126. package/build/components/block-navigation/dropdown.js +20 -25
  127. package/build/components/block-navigation/dropdown.js.map +1 -1
  128. package/build/components/block-parent-selector/index.js +2 -2
  129. package/build/components/block-parent-selector/index.js.map +1 -1
  130. package/build/components/block-pattern-setup/index.js +27 -31
  131. package/build/components/block-pattern-setup/index.js.map +1 -1
  132. package/build/components/block-pattern-setup/setup-toolbar.js +35 -42
  133. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  134. package/build/components/block-patterns-list/index.js +74 -81
  135. package/build/components/block-patterns-list/index.js.map +1 -1
  136. package/build/components/block-popover/drop-zone.js +4 -5
  137. package/build/components/block-popover/drop-zone.js.map +1 -1
  138. package/build/components/block-popover/inbetween.js +10 -15
  139. package/build/components/block-popover/inbetween.js.map +1 -1
  140. package/build/components/block-popover/index.js +14 -15
  141. package/build/components/block-popover/index.js.map +1 -1
  142. package/build/components/block-preview/auto.js +6 -8
  143. package/build/components/block-preview/auto.js.map +1 -1
  144. package/build/components/block-preview/index.js +15 -18
  145. package/build/components/block-preview/index.js.map +1 -1
  146. package/build/components/block-settings/button.native.js +7 -10
  147. package/build/components/block-settings/button.native.js.map +1 -1
  148. package/build/components/block-settings-menu/block-convert-button.js +5 -7
  149. package/build/components/block-settings-menu/block-convert-button.js.map +1 -1
  150. package/build/components/block-settings-menu/block-html-convert-button.js +10 -14
  151. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  152. package/build/components/block-settings-menu/block-mode-toggle.js +19 -25
  153. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  154. package/build/components/block-settings-menu/block-settings-dropdown.js +132 -111
  155. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  156. package/build/components/block-settings-menu/index.js +4 -5
  157. package/build/components/block-settings-menu/index.js.map +1 -1
  158. package/build/components/block-settings-menu-controls/index.js +14 -16
  159. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  160. package/build/components/block-styles/index.js +6 -7
  161. package/build/components/block-styles/index.js.map +1 -1
  162. package/build/components/block-styles/index.native.js +5 -7
  163. package/build/components/block-styles/index.native.js.map +1 -1
  164. package/build/components/block-styles/menu-items.js +4 -5
  165. package/build/components/block-styles/menu-items.js.map +1 -1
  166. package/build/components/block-styles/preview-panel.js +7 -10
  167. package/build/components/block-styles/preview-panel.js.map +1 -1
  168. package/build/components/block-styles/preview.native.js +6 -7
  169. package/build/components/block-styles/preview.native.js.map +1 -1
  170. package/build/components/block-styles/use-styles-for-block.js +7 -9
  171. package/build/components/block-styles/use-styles-for-block.js.map +1 -1
  172. package/build/components/block-styles/utils.js +4 -7
  173. package/build/components/block-styles/utils.js.map +1 -1
  174. package/build/components/block-switcher/block-styles-menu.js +4 -5
  175. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  176. package/build/components/block-switcher/block-transformations-menu.js +24 -29
  177. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  178. package/build/components/block-switcher/block-transformations-menu.native.js +9 -10
  179. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  180. package/build/components/block-switcher/block-variation-transformations.js +21 -30
  181. package/build/components/block-switcher/block-variation-transformations.js.map +1 -1
  182. package/build/components/block-switcher/index.js +47 -60
  183. package/build/components/block-switcher/index.js.map +1 -1
  184. package/build/components/block-switcher/pattern-transformations-menu.js +18 -22
  185. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  186. package/build/components/block-switcher/preview-block-popover.js +3 -4
  187. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  188. package/build/components/block-switcher/utils.js +2 -3
  189. package/build/components/block-switcher/utils.js.map +1 -1
  190. package/build/components/block-title/index.js +5 -6
  191. package/build/components/block-title/index.js.map +1 -1
  192. package/build/components/block-title/use-block-display-title.js +5 -6
  193. package/build/components/block-title/use-block-display-title.js.map +1 -1
  194. package/build/components/block-toolbar/index.js +4 -5
  195. package/build/components/block-toolbar/index.js.map +1 -1
  196. package/build/components/block-toolbar/utils.js +14 -16
  197. package/build/components/block-toolbar/utils.js.map +1 -1
  198. package/build/components/block-tools/back-compat.js +3 -4
  199. package/build/components/block-tools/back-compat.js.map +1 -1
  200. package/build/components/block-tools/block-contextual-toolbar.js +5 -6
  201. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  202. package/build/components/block-tools/block-selection-button.js +6 -9
  203. package/build/components/block-tools/block-selection-button.js.map +1 -1
  204. package/build/components/block-tools/index.js +6 -7
  205. package/build/components/block-tools/index.js.map +1 -1
  206. package/build/components/block-tools/insertion-point.js +7 -10
  207. package/build/components/block-tools/insertion-point.js.map +1 -1
  208. package/build/components/block-tools/selected-block-popover.js +19 -20
  209. package/build/components/block-tools/selected-block-popover.js.map +1 -1
  210. package/build/components/block-tools/use-block-toolbar-popover-props.js +9 -14
  211. package/build/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  212. package/build/components/block-tools/zoom-out-mode-inserters.js +3 -4
  213. package/build/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  214. package/build/components/block-types-list/index.js +8 -9
  215. package/build/components/block-types-list/index.js.map +1 -1
  216. package/build/components/block-types-list/index.native.js +22 -27
  217. package/build/components/block-types-list/index.native.js.map +1 -1
  218. package/build/components/block-variation-picker/index.js +8 -9
  219. package/build/components/block-variation-picker/index.js.map +1 -1
  220. package/build/components/block-variation-picker/index.native.js +7 -9
  221. package/build/components/block-variation-picker/index.native.js.map +1 -1
  222. package/build/components/block-variation-transforms/index.js +30 -41
  223. package/build/components/block-variation-transforms/index.js.map +1 -1
  224. package/build/components/block-vertical-alignment-control/ui.js +7 -9
  225. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  226. package/build/components/border-radius-control/all-input-control.js +7 -8
  227. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  228. package/build/components/border-radius-control/index.js +9 -10
  229. package/build/components/border-radius-control/index.js.map +1 -1
  230. package/build/components/border-radius-control/input-controls.js +8 -11
  231. package/build/components/border-radius-control/input-controls.js.map +1 -1
  232. package/build/components/border-radius-control/linked-button.js +4 -5
  233. package/build/components/border-radius-control/linked-button.js.map +1 -1
  234. package/build/components/border-radius-control/utils.js +3 -7
  235. package/build/components/border-radius-control/utils.js.map +1 -1
  236. package/build/components/button-block-appender/index.js +13 -15
  237. package/build/components/button-block-appender/index.js.map +1 -1
  238. package/build/components/button-block-appender/index.native.js +25 -29
  239. package/build/components/button-block-appender/index.native.js.map +1 -1
  240. package/build/components/caption/index.native.js +40 -43
  241. package/build/components/caption/index.native.js.map +1 -1
  242. package/build/components/child-layout-control/index.js +5 -6
  243. package/build/components/child-layout-control/index.js.map +1 -1
  244. package/build/components/color-palette/control.js +5 -6
  245. package/build/components/color-palette/control.js.map +1 -1
  246. package/build/components/color-palette/with-color-context.js +1 -7
  247. package/build/components/color-palette/with-color-context.js.map +1 -1
  248. package/build/components/color-style-selector/index.js +28 -35
  249. package/build/components/color-style-selector/index.js.map +1 -1
  250. package/build/components/colors/utils.js +5 -8
  251. package/build/components/colors/utils.js.map +1 -1
  252. package/build/components/colors/with-colors.js +9 -24
  253. package/build/components/colors/with-colors.js.map +1 -1
  254. package/build/components/colors-gradients/control.js +19 -22
  255. package/build/components/colors-gradients/control.js.map +1 -1
  256. package/build/components/colors-gradients/dropdown.js +32 -39
  257. package/build/components/colors-gradients/dropdown.js.map +1 -1
  258. package/build/components/colors-gradients/panel-color-gradient-settings.js +20 -25
  259. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  260. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +27 -31
  261. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  262. package/build/components/contrast-checker/index.js +12 -13
  263. package/build/components/contrast-checker/index.js.map +1 -1
  264. package/build/components/contrast-checker/index.native.js +16 -18
  265. package/build/components/contrast-checker/index.native.js.map +1 -1
  266. package/build/components/convert-to-group-buttons/index.js +9 -10
  267. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  268. package/build/components/convert-to-group-buttons/index.native.js +6 -7
  269. package/build/components/convert-to-group-buttons/index.native.js.map +1 -1
  270. package/build/components/convert-to-group-buttons/toolbar.js +6 -12
  271. package/build/components/convert-to-group-buttons/toolbar.js.map +1 -1
  272. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js +4 -6
  273. package/build/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  274. package/build/components/copy-handler/index.js +4 -7
  275. package/build/components/copy-handler/index.js.map +1 -1
  276. package/build/components/date-format-picker/index.js +12 -16
  277. package/build/components/date-format-picker/index.js.map +1 -1
  278. package/build/components/default-block-appender/index.js +7 -9
  279. package/build/components/default-block-appender/index.js.map +1 -1
  280. package/build/components/default-block-appender/index.native.js +8 -10
  281. package/build/components/default-block-appender/index.native.js.map +1 -1
  282. package/build/components/default-style-picker/index.js +14 -22
  283. package/build/components/default-style-picker/index.js.map +1 -1
  284. package/build/components/duotone/components.js +14 -18
  285. package/build/components/duotone/components.js.map +1 -1
  286. package/build/components/duotone/utils.js +1 -2
  287. package/build/components/duotone/utils.js.map +1 -1
  288. package/build/components/duotone-control/index.js +12 -15
  289. package/build/components/duotone-control/index.js.map +1 -1
  290. package/build/components/editable-text/index.js +5 -6
  291. package/build/components/editable-text/index.js.map +1 -1
  292. package/build/components/editor-styles/index.js +4 -5
  293. package/build/components/editor-styles/index.js.map +1 -1
  294. package/build/components/floating-toolbar/index.native.js +7 -8
  295. package/build/components/floating-toolbar/index.native.js.map +1 -1
  296. package/build/components/font-appearance-control/index.js +19 -26
  297. package/build/components/font-appearance-control/index.js.map +1 -1
  298. package/build/components/font-family/index.js +10 -12
  299. package/build/components/font-family/index.js.map +1 -1
  300. package/build/components/font-sizes/fluid-utils.js +17 -21
  301. package/build/components/font-sizes/fluid-utils.js.map +1 -1
  302. package/build/components/font-sizes/utils.js +6 -12
  303. package/build/components/font-sizes/utils.js.map +1 -1
  304. package/build/components/font-sizes/with-font-sizes.js +11 -30
  305. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  306. package/build/components/global-styles/advanced-panel.js +7 -10
  307. package/build/components/global-styles/advanced-panel.js.map +1 -1
  308. package/build/components/global-styles/border-panel.js +45 -78
  309. package/build/components/global-styles/border-panel.js.map +1 -1
  310. package/build/components/global-styles/color-panel.js +104 -147
  311. package/build/components/global-styles/color-panel.js.map +1 -1
  312. package/build/components/global-styles/color-panel.native.js +25 -42
  313. package/build/components/global-styles/color-panel.native.js.map +1 -1
  314. package/build/components/global-styles/dimensions-panel.js +78 -109
  315. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  316. package/build/components/global-styles/effects-panel.js +58 -72
  317. package/build/components/global-styles/effects-panel.js.map +1 -1
  318. package/build/components/global-styles/filters-panel.js +53 -71
  319. package/build/components/global-styles/filters-panel.js.map +1 -1
  320. package/build/components/global-styles/get-block-css-selector.js +4 -7
  321. package/build/components/global-styles/get-block-css-selector.js.map +1 -1
  322. package/build/components/global-styles/hooks.js +22 -37
  323. package/build/components/global-styles/hooks.js.map +1 -1
  324. package/build/components/global-styles/typography-panel.js +69 -125
  325. package/build/components/global-styles/typography-panel.js.map +1 -1
  326. package/build/components/global-styles/typography-utils.js +49 -26
  327. package/build/components/global-styles/typography-utils.js.map +1 -1
  328. package/build/components/global-styles/use-global-styles-output.js +140 -235
  329. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  330. package/build/components/global-styles/utils.js +11 -27
  331. package/build/components/global-styles/utils.js.map +1 -1
  332. package/build/components/gradients/use-gradient.js +6 -7
  333. package/build/components/gradients/use-gradient.js.map +1 -1
  334. package/build/components/height-control/index.js +9 -10
  335. package/build/components/height-control/index.js.map +1 -1
  336. package/build/components/iframe/index.js +50 -85
  337. package/build/components/iframe/index.js.map +1 -1
  338. package/build/components/iframe/use-compatibility-styles.js +29 -20
  339. package/build/components/iframe/use-compatibility-styles.js.map +1 -1
  340. package/build/components/image-editor/aspect-ratio-dropdown.js +83 -91
  341. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  342. package/build/components/image-editor/context.js +9 -10
  343. package/build/components/image-editor/context.js.map +1 -1
  344. package/build/components/image-editor/cropper.js +11 -12
  345. package/build/components/image-editor/cropper.js.map +1 -1
  346. package/build/components/image-editor/index.js +12 -13
  347. package/build/components/image-editor/index.js.map +1 -1
  348. package/build/components/image-editor/use-save-image.js +11 -12
  349. package/build/components/image-editor/use-save-image.js.map +1 -1
  350. package/build/components/image-editor/use-transform-image.js +5 -6
  351. package/build/components/image-editor/use-transform-image.js.map +1 -1
  352. package/build/components/image-editor/zoom-dropdown.js +10 -13
  353. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  354. package/build/components/image-size-control/index.js +12 -13
  355. package/build/components/image-size-control/index.js.map +1 -1
  356. package/build/components/inner-blocks/button-block-appender.js +7 -8
  357. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  358. package/build/components/inner-blocks/default-block-appender.js +6 -8
  359. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  360. package/build/components/inner-blocks/index.js +2 -6
  361. package/build/components/inner-blocks/index.js.map +1 -1
  362. package/build/components/inner-blocks/index.native.js +1 -3
  363. package/build/components/inner-blocks/index.native.js.map +1 -1
  364. package/build/components/inner-blocks/use-block-context.js +1 -4
  365. package/build/components/inner-blocks/use-block-context.js.map +1 -1
  366. package/build/components/inner-blocks/use-nested-settings-update.js +2 -4
  367. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  368. package/build/components/inserter/block-patterns-explorer/explorer.js +9 -11
  369. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  370. package/build/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
  371. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  372. package/build/components/inserter/block-patterns-explorer/sidebar.js +20 -24
  373. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  374. package/build/components/inserter/block-patterns-tab.js +29 -40
  375. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  376. package/build/components/inserter/block-types-tab.js +7 -9
  377. package/build/components/inserter/block-types-tab.js.map +1 -1
  378. package/build/components/inserter/block-types-tab.native.js +8 -9
  379. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  380. package/build/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
  381. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  382. package/build/components/inserter/hooks/use-block-types-state.js +5 -6
  383. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  384. package/build/components/inserter/hooks/use-clipboard-block.native.js +2 -2
  385. package/build/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  386. package/build/components/inserter/hooks/use-debounced-input.js +1 -2
  387. package/build/components/inserter/hooks/use-debounced-input.js.map +1 -1
  388. package/build/components/inserter/hooks/use-insertion-point.js +10 -12
  389. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  390. package/build/components/inserter/index.js +37 -51
  391. package/build/components/inserter/index.js.map +1 -1
  392. package/build/components/inserter/index.native.js +24 -31
  393. package/build/components/inserter/index.native.js.map +1 -1
  394. package/build/components/inserter/library.js +11 -12
  395. package/build/components/inserter/library.js.map +1 -1
  396. package/build/components/inserter/media-tab/hooks.js +2 -5
  397. package/build/components/inserter/media-tab/hooks.js.map +1 -1
  398. package/build/components/inserter/media-tab/media-list.js +6 -7
  399. package/build/components/inserter/media-tab/media-list.js.map +1 -1
  400. package/build/components/inserter/media-tab/media-panel.js +12 -14
  401. package/build/components/inserter/media-tab/media-panel.js.map +1 -1
  402. package/build/components/inserter/media-tab/media-preview.js +47 -58
  403. package/build/components/inserter/media-tab/media-preview.js.map +1 -1
  404. package/build/components/inserter/media-tab/media-tab.js +24 -28
  405. package/build/components/inserter/media-tab/media-tab.js.map +1 -1
  406. package/build/components/inserter/media-tab/utils.js +3 -5
  407. package/build/components/inserter/media-tab/utils.js.map +1 -1
  408. package/build/components/inserter/menu.js +15 -19
  409. package/build/components/inserter/menu.js.map +1 -1
  410. package/build/components/inserter/menu.native.js +27 -31
  411. package/build/components/inserter/menu.native.js.map +1 -1
  412. package/build/components/inserter/mobile-tab-navigation.js +7 -9
  413. package/build/components/inserter/mobile-tab-navigation.js.map +1 -1
  414. package/build/components/inserter/panel.js +5 -6
  415. package/build/components/inserter/panel.js.map +1 -1
  416. package/build/components/inserter/preview-panel.js +4 -5
  417. package/build/components/inserter/preview-panel.js.map +1 -1
  418. package/build/components/inserter/quick-inserter.js +8 -9
  419. package/build/components/inserter/quick-inserter.js.map +1 -1
  420. package/build/components/inserter/reusable-blocks-tab.js +13 -18
  421. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  422. package/build/components/inserter/reusable-blocks-tab.native.js +5 -6
  423. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  424. package/build/components/inserter/search-items.js +12 -40
  425. package/build/components/inserter/search-items.js.map +1 -1
  426. package/build/components/inserter/search-results.js +17 -18
  427. package/build/components/inserter/search-results.js.map +1 -1
  428. package/build/components/inserter/search-results.native.js +11 -12
  429. package/build/components/inserter/search-results.native.js.map +1 -1
  430. package/build/components/inserter/tabs.js +8 -9
  431. package/build/components/inserter/tabs.js.map +1 -1
  432. package/build/components/inserter/tabs.native.js +37 -55
  433. package/build/components/inserter/tabs.native.js.map +1 -1
  434. package/build/components/inserter/utils.native.js +13 -17
  435. package/build/components/inserter/utils.native.js.map +1 -1
  436. package/build/components/inserter-draggable-blocks/index.js +11 -13
  437. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  438. package/build/components/inserter-list-item/index.js +68 -72
  439. package/build/components/inserter-list-item/index.js.map +1 -1
  440. package/build/components/inserter-listbox/index.js +3 -4
  441. package/build/components/inserter-listbox/index.js.map +1 -1
  442. package/build/components/inserter-listbox/item.js +6 -7
  443. package/build/components/inserter-listbox/item.js.map +1 -1
  444. package/build/components/inspector-controls/block-support-slot-container.js +4 -5
  445. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  446. package/build/components/inspector-controls/block-support-tools-panel.js +6 -8
  447. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  448. package/build/components/inspector-controls/fill.js +13 -24
  449. package/build/components/inspector-controls/fill.js.map +1 -1
  450. package/build/components/inspector-controls/fill.native.js +7 -11
  451. package/build/components/inspector-controls/fill.native.js.map +1 -1
  452. package/build/components/inspector-controls/slot.js +9 -13
  453. package/build/components/inspector-controls/slot.js.map +1 -1
  454. package/build/components/inspector-controls/slot.native.js +6 -10
  455. package/build/components/inspector-controls/slot.native.js.map +1 -1
  456. package/build/components/inspector-controls-tabs/index.js +6 -7
  457. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  458. package/build/components/inspector-controls-tabs/position-controls-panel.js +3 -8
  459. package/build/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  460. package/build/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  461. package/build/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  462. package/build/components/inspector-controls-tabs/settings-tab.js +3 -6
  463. package/build/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  464. package/build/components/inspector-controls-tabs/styles-tab.js +5 -6
  465. package/build/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  466. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
  467. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  468. package/build/components/inspector-popover-header/index.js +18 -22
  469. package/build/components/inspector-popover-header/index.js.map +1 -1
  470. package/build/components/justify-content-control/ui.js +8 -10
  471. package/build/components/justify-content-control/ui.js.map +1 -1
  472. package/build/components/letter-spacing-control/index.js +6 -7
  473. package/build/components/letter-spacing-control/index.js.map +1 -1
  474. package/build/components/line-height-control/index.js +13 -18
  475. package/build/components/line-height-control/index.js.map +1 -1
  476. package/build/components/line-height-control/index.native.js +4 -5
  477. package/build/components/line-height-control/index.native.js.map +1 -1
  478. package/build/components/link-control/index.js +84 -63
  479. package/build/components/link-control/index.js.map +1 -1
  480. package/build/components/link-control/is-url-like.js +32 -2
  481. package/build/components/link-control/is-url-like.js.map +1 -1
  482. package/build/components/link-control/link-preview.js +24 -27
  483. package/build/components/link-control/link-preview.js.map +1 -1
  484. package/build/components/link-control/search-create-button.js +7 -9
  485. package/build/components/link-control/search-create-button.js.map +1 -1
  486. package/build/components/link-control/search-input.js +22 -27
  487. package/build/components/link-control/search-input.js.map +1 -1
  488. package/build/components/link-control/search-item.js +13 -15
  489. package/build/components/link-control/search-item.js.map +1 -1
  490. package/build/components/link-control/search-results.js +22 -28
  491. package/build/components/link-control/search-results.js.map +1 -1
  492. package/build/components/link-control/settings-drawer.js +6 -35
  493. package/build/components/link-control/settings-drawer.js.map +1 -1
  494. package/build/components/link-control/settings.js +6 -8
  495. package/build/components/link-control/settings.js.map +1 -1
  496. package/build/components/link-control/use-internal-value.js +54 -0
  497. package/build/components/link-control/use-internal-value.js.map +1 -0
  498. package/build/components/link-control/use-rich-url-data.js +1 -1
  499. package/build/components/link-control/use-rich-url-data.js.map +1 -1
  500. package/build/components/link-control/use-search-handler.js +10 -23
  501. package/build/components/link-control/use-search-handler.js.map +1 -1
  502. package/build/components/list-view/appender.js +12 -12
  503. package/build/components/list-view/appender.js.map +1 -1
  504. package/build/components/list-view/aria-referenced-text.js +44 -0
  505. package/build/components/list-view/aria-referenced-text.js.map +1 -0
  506. package/build/components/list-view/block-contents.js +38 -38
  507. package/build/components/list-view/block-contents.js.map +1 -1
  508. package/build/components/list-view/block-select-button.js +67 -21
  509. package/build/components/list-view/block-select-button.js.map +1 -1
  510. package/build/components/list-view/block.js +119 -101
  511. package/build/components/list-view/block.js.map +1 -1
  512. package/build/components/list-view/branch.js +5 -5
  513. package/build/components/list-view/branch.js.map +1 -1
  514. package/build/components/list-view/drop-indicator.js +4 -5
  515. package/build/components/list-view/drop-indicator.js.map +1 -1
  516. package/build/components/list-view/expander.js +3 -4
  517. package/build/components/list-view/expander.js.map +1 -1
  518. package/build/components/list-view/index.js +46 -43
  519. package/build/components/list-view/index.js.map +1 -1
  520. package/build/components/list-view/leaf.js +10 -11
  521. package/build/components/list-view/leaf.js.map +1 -1
  522. package/build/components/list-view/use-block-selection.js +4 -6
  523. package/build/components/list-view/use-block-selection.js.map +1 -1
  524. package/build/components/list-view/use-list-view-client-ids.js +9 -12
  525. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  526. package/build/components/list-view/use-list-view-drop-zone.js +25 -13
  527. package/build/components/list-view/use-list-view-drop-zone.js.map +1 -1
  528. package/build/components/list-view/use-list-view-expand-selected-item.js +4 -5
  529. package/build/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  530. package/build/components/list-view/use-list-view-scroll-into-view.js +5 -6
  531. package/build/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  532. package/build/components/media-placeholder/index.js +71 -92
  533. package/build/components/media-placeholder/index.js.map +1 -1
  534. package/build/components/media-placeholder/index.native.js +5 -6
  535. package/build/components/media-placeholder/index.native.js.map +1 -1
  536. package/build/components/media-replace-flow/index.js +94 -107
  537. package/build/components/media-replace-flow/index.js.map +1 -1
  538. package/build/components/media-upload/check.js +4 -5
  539. package/build/components/media-upload/check.js.map +1 -1
  540. package/build/components/media-upload/index.native.js +1 -1
  541. package/build/components/media-upload/index.native.js.map +1 -1
  542. package/build/components/multi-selection-inspector/index.js +3 -4
  543. package/build/components/multi-selection-inspector/index.js.map +1 -1
  544. package/build/components/navigable-toolbar/index.js +16 -15
  545. package/build/components/navigable-toolbar/index.js.map +1 -1
  546. package/build/components/observe-typing/index.js +3 -4
  547. package/build/components/observe-typing/index.js.map +1 -1
  548. package/build/components/panel-color-settings/index.js +4 -5
  549. package/build/components/panel-color-settings/index.js.map +1 -1
  550. package/build/components/plain-text/index.js +4 -6
  551. package/build/components/plain-text/index.js.map +1 -1
  552. package/build/components/plain-text/index.native.js +8 -14
  553. package/build/components/plain-text/index.native.js.map +1 -1
  554. package/build/components/preview-options/index.js +8 -9
  555. package/build/components/preview-options/index.js.map +1 -1
  556. package/build/components/provider/block-refs-provider.js +3 -4
  557. package/build/components/provider/block-refs-provider.js.map +1 -1
  558. package/build/components/provider/use-block-sync.js +7 -8
  559. package/build/components/provider/use-block-sync.js.map +1 -1
  560. package/build/components/provider/with-registry-provider.js +5 -7
  561. package/build/components/provider/with-registry-provider.js.map +1 -1
  562. package/build/components/publish-date-time-picker/index.js +6 -7
  563. package/build/components/publish-date-time-picker/index.js.map +1 -1
  564. package/build/components/recursion-provider/index.js +7 -11
  565. package/build/components/recursion-provider/index.js.map +1 -1
  566. package/build/components/resizable-box-popover/index.js +5 -6
  567. package/build/components/resizable-box-popover/index.js.map +1 -1
  568. package/build/components/responsive-block-control/label.js +5 -6
  569. package/build/components/responsive-block-control/label.js.map +1 -1
  570. package/build/components/rich-text/embed-handler-picker.native.js +6 -10
  571. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  572. package/build/components/rich-text/format-edit.js +7 -8
  573. package/build/components/rich-text/format-edit.js.map +1 -1
  574. package/build/components/rich-text/format-toolbar/index.js +9 -18
  575. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  576. package/build/components/rich-text/format-toolbar-container.js +13 -16
  577. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  578. package/build/components/rich-text/index.js +43 -47
  579. package/build/components/rich-text/index.js.map +1 -1
  580. package/build/components/rich-text/index.native.js +130 -157
  581. package/build/components/rich-text/index.native.js.map +1 -1
  582. package/build/components/rich-text/input-event.js +4 -5
  583. package/build/components/rich-text/input-event.js.map +1 -1
  584. package/build/components/rich-text/shortcut.js +5 -6
  585. package/build/components/rich-text/shortcut.js.map +1 -1
  586. package/build/components/rich-text/split-value.js +8 -10
  587. package/build/components/rich-text/split-value.js.map +1 -1
  588. package/build/components/rich-text/toolbar-button.js +6 -7
  589. package/build/components/rich-text/toolbar-button.js.map +1 -1
  590. package/build/components/rich-text/use-before-input-rules.js +1 -4
  591. package/build/components/rich-text/use-before-input-rules.js.map +1 -1
  592. package/build/components/rich-text/use-enter.js +3 -6
  593. package/build/components/rich-text/use-enter.js.map +1 -1
  594. package/build/components/rich-text/use-firefox-compat.js +32 -1
  595. package/build/components/rich-text/use-firefox-compat.js.map +1 -1
  596. package/build/components/rich-text/use-format-types.js +11 -17
  597. package/build/components/rich-text/use-format-types.js.map +1 -1
  598. package/build/components/rich-text/use-input-rules.js +9 -15
  599. package/build/components/rich-text/use-input-rules.js.map +1 -1
  600. package/build/components/rich-text/use-mark-persistent.js +4 -5
  601. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  602. package/build/components/rich-text/use-paste-handler.js +5 -7
  603. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  604. package/build/components/rich-text/utils.js +5 -7
  605. package/build/components/rich-text/utils.js.map +1 -1
  606. package/build/components/skip-to-selected-block/index.js +3 -4
  607. package/build/components/skip-to-selected-block/index.js.map +1 -1
  608. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js +38 -0
  609. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
  610. package/build/components/spacing-sizes-control/index.js +60 -62
  611. package/build/components/spacing-sizes-control/index.js.map +1 -1
  612. package/build/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
  613. package/build/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
  614. package/build/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +22 -22
  615. package/build/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
  616. package/build/components/spacing-sizes-control/input-controls/single.js +51 -0
  617. package/build/components/spacing-sizes-control/input-controls/single.js.map +1 -0
  618. package/build/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +51 -69
  619. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
  620. package/build/components/spacing-sizes-control/sides-dropdown/index.js +84 -0
  621. package/build/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
  622. package/build/components/spacing-sizes-control/utils.js +213 -31
  623. package/build/components/spacing-sizes-control/utils.js.map +1 -1
  624. package/build/components/text-decoration-control/index.js +5 -6
  625. package/build/components/text-decoration-control/index.js.map +1 -1
  626. package/build/components/text-transform-control/index.js +5 -6
  627. package/build/components/text-transform-control/index.js.map +1 -1
  628. package/build/components/tool-selector/index.js +13 -16
  629. package/build/components/tool-selector/index.js.map +1 -1
  630. package/build/components/typewriter/index.js +6 -9
  631. package/build/components/typewriter/index.js.map +1 -1
  632. package/build/components/ungroup-button/index.native.js +11 -16
  633. package/build/components/ungroup-button/index.native.js.map +1 -1
  634. package/build/components/unit-control/index.js +4 -5
  635. package/build/components/unit-control/index.js.map +1 -1
  636. package/build/components/url-input/index.js +15 -26
  637. package/build/components/url-input/index.js.map +1 -1
  638. package/build/components/url-input/index.native.js +6 -8
  639. package/build/components/url-input/index.native.js.map +1 -1
  640. package/build/components/url-popover/image-url-input-ui.js +12 -15
  641. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  642. package/build/components/url-popover/index.js +12 -14
  643. package/build/components/url-popover/index.js.map +1 -1
  644. package/build/components/url-popover/link-editor.js +7 -8
  645. package/build/components/url-popover/link-editor.js.map +1 -1
  646. package/build/components/url-popover/link-viewer-url.js +5 -6
  647. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  648. package/build/components/url-popover/link-viewer.js +8 -9
  649. package/build/components/url-popover/link-viewer.js.map +1 -1
  650. package/build/components/use-block-display-information/index.js +2 -2
  651. package/build/components/use-block-display-information/index.js.map +1 -1
  652. package/build/components/use-block-drop-zone/index.js +16 -23
  653. package/build/components/use-block-drop-zone/index.js.map +1 -1
  654. package/build/components/use-block-drop-zone/index.native.js +8 -11
  655. package/build/components/use-block-drop-zone/index.native.js.map +1 -1
  656. package/build/components/use-moving-animation/index.js +9 -12
  657. package/build/components/use-moving-animation/index.js.map +1 -1
  658. package/build/components/use-on-block-drop/index.js +2 -6
  659. package/build/components/use-on-block-drop/index.js.map +1 -1
  660. package/build/components/use-on-block-drop/index.native.js +8 -10
  661. package/build/components/use-on-block-drop/index.native.js.map +1 -1
  662. package/build/components/use-paste-styles/index.js +2 -6
  663. package/build/components/use-paste-styles/index.js.map +1 -1
  664. package/build/components/warning/index.js +6 -7
  665. package/build/components/warning/index.js.map +1 -1
  666. package/build/components/warning/index.native.js +9 -10
  667. package/build/components/warning/index.native.js.map +1 -1
  668. package/build/components/writing-flow/index.js +4 -5
  669. package/build/components/writing-flow/index.js.map +1 -1
  670. package/build/components/writing-flow/use-drag-selection.js +4 -6
  671. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  672. package/build/components/writing-flow/use-tab-nav.js +9 -6
  673. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  674. package/build/hooks/align.js +7 -14
  675. package/build/hooks/align.js.map +1 -1
  676. package/build/hooks/anchor.js +6 -3
  677. package/build/hooks/anchor.js.map +1 -1
  678. package/build/hooks/aria-label.js +1 -3
  679. package/build/hooks/aria-label.js.map +1 -1
  680. package/build/hooks/behaviors.js +91 -58
  681. package/build/hooks/behaviors.js.map +1 -1
  682. package/build/hooks/border.js +25 -38
  683. package/build/hooks/border.js.map +1 -1
  684. package/build/hooks/color.js +22 -37
  685. package/build/hooks/color.js.map +1 -1
  686. package/build/hooks/content-lock-ui.js +26 -30
  687. package/build/hooks/content-lock-ui.js.map +1 -1
  688. package/build/hooks/contrast-checker.js +4 -7
  689. package/build/hooks/contrast-checker.js.map +1 -1
  690. package/build/hooks/custom-class-name.js +5 -4
  691. package/build/hooks/custom-class-name.js.map +1 -1
  692. package/build/hooks/dimensions.js +6 -9
  693. package/build/hooks/dimensions.js.map +1 -1
  694. package/build/hooks/duotone.js +32 -44
  695. package/build/hooks/duotone.js.map +1 -1
  696. package/build/hooks/font-family.js +5 -6
  697. package/build/hooks/font-family.js.map +1 -1
  698. package/build/hooks/font-size.js +14 -21
  699. package/build/hooks/font-size.js.map +1 -1
  700. package/build/hooks/gap.js +5 -6
  701. package/build/hooks/gap.js.map +1 -1
  702. package/build/hooks/layout.js +42 -59
  703. package/build/hooks/layout.js.map +1 -1
  704. package/build/hooks/line-height.js +5 -8
  705. package/build/hooks/line-height.js.map +1 -1
  706. package/build/hooks/lock.js +2 -2
  707. package/build/hooks/lock.js.map +1 -1
  708. package/build/hooks/margin.js +6 -9
  709. package/build/hooks/margin.js.map +1 -1
  710. package/build/hooks/metadata-name.js +4 -5
  711. package/build/hooks/metadata-name.js.map +1 -1
  712. package/build/hooks/metadata.js +3 -7
  713. package/build/hooks/metadata.js.map +1 -1
  714. package/build/hooks/padding.js +6 -9
  715. package/build/hooks/padding.js.map +1 -1
  716. package/build/hooks/position.js +26 -40
  717. package/build/hooks/position.js.map +1 -1
  718. package/build/hooks/settings.js +1 -3
  719. package/build/hooks/settings.js.map +1 -1
  720. package/build/hooks/style.js +12 -19
  721. package/build/hooks/style.js.map +1 -1
  722. package/build/hooks/supports.js +3 -5
  723. package/build/hooks/supports.js.map +1 -1
  724. package/build/hooks/typography.js +18 -27
  725. package/build/hooks/typography.js.map +1 -1
  726. package/build/hooks/typography.native.js +1 -2
  727. package/build/hooks/typography.native.js.map +1 -1
  728. package/build/hooks/use-border-props.js +1 -3
  729. package/build/hooks/use-border-props.js.map +1 -1
  730. package/build/hooks/use-color-props.js +6 -8
  731. package/build/hooks/use-color-props.js.map +1 -1
  732. package/build/hooks/use-editor-wrapper-styles.native.js +34 -39
  733. package/build/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  734. package/build/hooks/use-spacing-props.js +1 -1
  735. package/build/hooks/use-spacing-props.js.map +1 -1
  736. package/build/hooks/use-typography-props.js +8 -12
  737. package/build/hooks/use-typography-props.js.map +1 -1
  738. package/build/hooks/utils.js +6 -18
  739. package/build/hooks/utils.js.map +1 -1
  740. package/build/layouts/constrained.js +22 -27
  741. package/build/layouts/constrained.js.map +1 -1
  742. package/build/layouts/flex.js +43 -54
  743. package/build/layouts/flex.js.map +1 -1
  744. package/build/layouts/flow.js +10 -13
  745. package/build/layouts/flow.js.map +1 -1
  746. package/build/layouts/grid.js +45 -25
  747. package/build/layouts/grid.js.map +1 -1
  748. package/build/layouts/index.js +1 -2
  749. package/build/layouts/index.js.map +1 -1
  750. package/build/layouts/utils.js +3 -9
  751. package/build/layouts/utils.js.map +1 -1
  752. package/build/store/actions.js +251 -334
  753. package/build/store/actions.js.map +1 -1
  754. package/build/store/array.js +1 -2
  755. package/build/store/array.js.map +1 -1
  756. package/build/store/private-actions.js +3 -7
  757. package/build/store/private-actions.js.map +1 -1
  758. package/build/store/private-selectors.js +41 -24
  759. package/build/store/private-selectors.js.map +1 -1
  760. package/build/store/reducer.js +67 -169
  761. package/build/store/reducer.js.map +1 -1
  762. package/build/store/selectors.js +145 -215
  763. package/build/store/selectors.js.map +1 -1
  764. package/build/utils/block-variation-transforms.js +4 -7
  765. package/build/utils/block-variation-transforms.js.map +1 -1
  766. package/build/utils/math.js +1 -2
  767. package/build/utils/math.js.map +1 -1
  768. package/build/utils/object.js +1 -4
  769. package/build/utils/object.js.map +1 -1
  770. package/build/utils/order-inserter-block-items.js +5 -7
  771. package/build/utils/order-inserter-block-items.js.map +1 -1
  772. package/build/utils/parse-css-unit-to-px.js +3 -6
  773. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  774. package/build/utils/pasting.js +5 -8
  775. package/build/utils/pasting.js.map +1 -1
  776. package/build/utils/pre-parse-patterns.js +1 -1
  777. package/build/utils/pre-parse-patterns.js.map +1 -1
  778. package/build/utils/sorting.js +1 -2
  779. package/build/utils/sorting.js.map +1 -1
  780. package/build/utils/transform-styles/index.js +5 -7
  781. package/build/utils/transform-styles/index.js.map +1 -1
  782. package/build/utils/transform-styles/transforms/wrap.js +28 -31
  783. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  784. package/build-module/autocompleters/block.js +1 -3
  785. package/build-module/autocompleters/block.js.map +1 -1
  786. package/build-module/components/alignment-control/ui.js +9 -11
  787. package/build-module/components/alignment-control/ui.js.map +1 -1
  788. package/build-module/components/autocomplete/index.js +3 -4
  789. package/build-module/components/autocomplete/index.js.map +1 -1
  790. package/build-module/components/block-actions/index.js +8 -12
  791. package/build-module/components/block-actions/index.js.map +1 -1
  792. package/build-module/components/block-alignment-control/ui.js +17 -21
  793. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  794. package/build-module/components/block-alignment-control/ui.native.js +14 -17
  795. package/build-module/components/block-alignment-control/ui.native.js.map +1 -1
  796. package/build-module/components/block-alignment-control/use-available-alignments.js +5 -10
  797. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  798. package/build-module/components/block-alignment-matrix-control/index.js +4 -6
  799. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  800. package/build-module/components/block-breadcrumb/index.js +3 -4
  801. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  802. package/build-module/components/block-caption/index.native.js +29 -34
  803. package/build-module/components/block-caption/index.native.js.map +1 -1
  804. package/build-module/components/block-card/index.js +7 -9
  805. package/build-module/components/block-card/index.js.map +1 -1
  806. package/build-module/components/block-compare/block-view.js +8 -9
  807. package/build-module/components/block-compare/block-view.js.map +1 -1
  808. package/build-module/components/block-compare/index.js +7 -9
  809. package/build-module/components/block-compare/index.js.map +1 -1
  810. package/build-module/components/block-context/index.js +4 -5
  811. package/build-module/components/block-context/index.js.map +1 -1
  812. package/build-module/components/block-controls/fill.js +17 -23
  813. package/build-module/components/block-controls/fill.js.map +1 -1
  814. package/build-module/components/block-controls/hook.js +1 -3
  815. package/build-module/components/block-controls/hook.js.map +1 -1
  816. package/build-module/components/block-controls/slot.js +29 -21
  817. package/build-module/components/block-controls/slot.js.map +1 -1
  818. package/build-module/components/block-controls/slot.native.js +8 -18
  819. package/build-module/components/block-controls/slot.native.js.map +1 -1
  820. package/build-module/components/block-draggable/draggable-chip.js +5 -7
  821. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  822. package/build-module/components/block-draggable/draggable-chip.native.js +3 -4
  823. package/build-module/components/block-draggable/draggable-chip.native.js.map +1 -1
  824. package/build-module/components/block-draggable/dropping-insertion-point.native.js +6 -7
  825. package/build-module/components/block-draggable/dropping-insertion-point.native.js.map +1 -1
  826. package/build-module/components/block-draggable/index.js +16 -17
  827. package/build-module/components/block-draggable/index.js.map +1 -1
  828. package/build-module/components/block-draggable/index.native.js +43 -58
  829. package/build-module/components/block-draggable/index.native.js.map +1 -1
  830. package/build-module/components/block-edit/edit.js +1 -4
  831. package/build-module/components/block-edit/edit.js.map +1 -1
  832. package/build-module/components/block-edit/edit.native.js +1 -4
  833. package/build-module/components/block-edit/edit.native.js.map +1 -1
  834. package/build-module/components/block-edit-visually-button/index.js +3 -4
  835. package/build-module/components/block-edit-visually-button/index.js.map +1 -1
  836. package/build-module/components/block-full-height-alignment-control/index.js +6 -7
  837. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  838. package/build-module/components/block-icon/index.js +7 -11
  839. package/build-module/components/block-icon/index.js.map +1 -1
  840. package/build-module/components/block-icon/index.native.js +9 -13
  841. package/build-module/components/block-icon/index.native.js.map +1 -1
  842. package/build-module/components/block-inspector/index.js +36 -46
  843. package/build-module/components/block-inspector/index.js.map +1 -1
  844. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js +2 -2
  845. package/build-module/components/block-inspector/useBlockInspectorAnimationSettings.js.map +1 -1
  846. package/build-module/components/block-list/block-html.js +3 -4
  847. package/build-module/components/block-list/block-html.js.map +1 -1
  848. package/build-module/components/block-list/block-invalid-warning.js +3 -4
  849. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  850. package/build-module/components/block-list/block-invalid-warning.native.js +10 -15
  851. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  852. package/build-module/components/block-list/block-list-context.native.js +5 -11
  853. package/build-module/components/block-list/block-list-context.native.js.map +1 -1
  854. package/build-module/components/block-list/block-list-item-cell.native.js +5 -6
  855. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  856. package/build-module/components/block-list/block-list-item.native.js +17 -18
  857. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  858. package/build-module/components/block-list/block-outline.native.js +8 -9
  859. package/build-module/components/block-list/block-outline.native.js.map +1 -1
  860. package/build-module/components/block-list/block-selection-button.native.js +10 -12
  861. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  862. package/build-module/components/block-list/block.js +39 -46
  863. package/build-module/components/block-list/block.js.map +1 -1
  864. package/build-module/components/block-list/block.native.js +55 -68
  865. package/build-module/components/block-list/block.native.js.map +1 -1
  866. package/build-module/components/block-list/index.js +12 -15
  867. package/build-module/components/block-list/index.js.map +1 -1
  868. package/build-module/components/block-list/index.native.js +77 -86
  869. package/build-module/components/block-list/index.native.js.map +1 -1
  870. package/build-module/components/block-list/insertion-point.native.js +4 -5
  871. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  872. package/build-module/components/block-list/layout.js +6 -9
  873. package/build-module/components/block-list/layout.js.map +1 -1
  874. package/build-module/components/block-list/subdirectory-icon.js +10 -13
  875. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  876. package/build-module/components/block-list/use-block-props/index.js +14 -11
  877. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  878. package/build-module/components/block-list/use-block-props/index.native.js +1 -2
  879. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  880. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js +2 -2
  881. package/build-module/components/block-list/use-block-props/use-block-custom-class-name.js.map +1 -1
  882. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js +1 -1
  883. package/build-module/components/block-list/use-block-props/use-block-default-class-name.js.map +1 -1
  884. package/build-module/components/block-list/use-in-between-inserter.js +1 -3
  885. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  886. package/build-module/components/block-list-appender/index.js +15 -15
  887. package/build-module/components/block-list-appender/index.js.map +1 -1
  888. package/build-module/components/block-list-appender/index.native.js +9 -11
  889. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  890. package/build-module/components/block-lock/menu-item.js +3 -4
  891. package/build-module/components/block-lock/menu-item.js.map +1 -1
  892. package/build-module/components/block-lock/modal.js +6 -9
  893. package/build-module/components/block-lock/modal.js.map +1 -1
  894. package/build-module/components/block-lock/toolbar.js +5 -10
  895. package/build-module/components/block-lock/toolbar.js.map +1 -1
  896. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +49 -67
  897. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  898. package/build-module/components/block-mobile-toolbar/index.native.js +26 -34
  899. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  900. package/build-module/components/block-mover/button.js +6 -7
  901. package/build-module/components/block-mover/button.js.map +1 -1
  902. package/build-module/components/block-mover/index.js +5 -8
  903. package/build-module/components/block-mover/index.js.map +1 -1
  904. package/build-module/components/block-mover/index.native.js +23 -46
  905. package/build-module/components/block-mover/index.native.js.map +1 -1
  906. package/build-module/components/block-mover/mover-description.native.js +7 -10
  907. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  908. package/build-module/components/block-navigation/dropdown.js +20 -25
  909. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  910. package/build-module/components/block-parent-selector/index.js +2 -2
  911. package/build-module/components/block-parent-selector/index.js.map +1 -1
  912. package/build-module/components/block-pattern-setup/index.js +27 -31
  913. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  914. package/build-module/components/block-pattern-setup/setup-toolbar.js +35 -42
  915. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  916. package/build-module/components/block-patterns-list/index.js +71 -78
  917. package/build-module/components/block-patterns-list/index.js.map +1 -1
  918. package/build-module/components/block-popover/drop-zone.js +4 -5
  919. package/build-module/components/block-popover/drop-zone.js.map +1 -1
  920. package/build-module/components/block-popover/inbetween.js +10 -15
  921. package/build-module/components/block-popover/inbetween.js.map +1 -1
  922. package/build-module/components/block-popover/index.js +14 -15
  923. package/build-module/components/block-popover/index.js.map +1 -1
  924. package/build-module/components/block-preview/auto.js +6 -8
  925. package/build-module/components/block-preview/auto.js.map +1 -1
  926. package/build-module/components/block-preview/index.js +15 -18
  927. package/build-module/components/block-preview/index.js.map +1 -1
  928. package/build-module/components/block-settings/button.native.js +7 -10
  929. package/build-module/components/block-settings/button.native.js.map +1 -1
  930. package/build-module/components/block-settings-menu/block-convert-button.js +5 -7
  931. package/build-module/components/block-settings-menu/block-convert-button.js.map +1 -1
  932. package/build-module/components/block-settings-menu/block-html-convert-button.js +10 -14
  933. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  934. package/build-module/components/block-settings-menu/block-mode-toggle.js +19 -25
  935. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  936. package/build-module/components/block-settings-menu/block-settings-dropdown.js +135 -113
  937. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  938. package/build-module/components/block-settings-menu/index.js +4 -5
  939. package/build-module/components/block-settings-menu/index.js.map +1 -1
  940. package/build-module/components/block-settings-menu-controls/index.js +14 -16
  941. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  942. package/build-module/components/block-styles/index.js +6 -7
  943. package/build-module/components/block-styles/index.js.map +1 -1
  944. package/build-module/components/block-styles/index.native.js +5 -7
  945. package/build-module/components/block-styles/index.native.js.map +1 -1
  946. package/build-module/components/block-styles/menu-items.js +4 -5
  947. package/build-module/components/block-styles/menu-items.js.map +1 -1
  948. package/build-module/components/block-styles/preview-panel.js +7 -10
  949. package/build-module/components/block-styles/preview-panel.js.map +1 -1
  950. package/build-module/components/block-styles/preview.native.js +6 -7
  951. package/build-module/components/block-styles/preview.native.js.map +1 -1
  952. package/build-module/components/block-styles/use-styles-for-block.js +7 -9
  953. package/build-module/components/block-styles/use-styles-for-block.js.map +1 -1
  954. package/build-module/components/block-styles/utils.js +4 -7
  955. package/build-module/components/block-styles/utils.js.map +1 -1
  956. package/build-module/components/block-switcher/block-styles-menu.js +4 -5
  957. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  958. package/build-module/components/block-switcher/block-transformations-menu.js +24 -29
  959. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  960. package/build-module/components/block-switcher/block-transformations-menu.native.js +9 -10
  961. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  962. package/build-module/components/block-switcher/block-variation-transformations.js +21 -30
  963. package/build-module/components/block-switcher/block-variation-transformations.js.map +1 -1
  964. package/build-module/components/block-switcher/index.js +47 -60
  965. package/build-module/components/block-switcher/index.js.map +1 -1
  966. package/build-module/components/block-switcher/pattern-transformations-menu.js +18 -22
  967. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  968. package/build-module/components/block-switcher/preview-block-popover.js +3 -4
  969. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  970. package/build-module/components/block-switcher/utils.js +2 -3
  971. package/build-module/components/block-switcher/utils.js.map +1 -1
  972. package/build-module/components/block-title/index.js +5 -6
  973. package/build-module/components/block-title/index.js.map +1 -1
  974. package/build-module/components/block-title/use-block-display-title.js +5 -6
  975. package/build-module/components/block-title/use-block-display-title.js.map +1 -1
  976. package/build-module/components/block-toolbar/index.js +4 -5
  977. package/build-module/components/block-toolbar/index.js.map +1 -1
  978. package/build-module/components/block-toolbar/utils.js +14 -16
  979. package/build-module/components/block-toolbar/utils.js.map +1 -1
  980. package/build-module/components/block-tools/back-compat.js +3 -4
  981. package/build-module/components/block-tools/back-compat.js.map +1 -1
  982. package/build-module/components/block-tools/block-contextual-toolbar.js +5 -6
  983. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  984. package/build-module/components/block-tools/block-selection-button.js +6 -9
  985. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  986. package/build-module/components/block-tools/index.js +6 -7
  987. package/build-module/components/block-tools/index.js.map +1 -1
  988. package/build-module/components/block-tools/insertion-point.js +7 -10
  989. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  990. package/build-module/components/block-tools/selected-block-popover.js +19 -20
  991. package/build-module/components/block-tools/selected-block-popover.js.map +1 -1
  992. package/build-module/components/block-tools/use-block-toolbar-popover-props.js +9 -14
  993. package/build-module/components/block-tools/use-block-toolbar-popover-props.js.map +1 -1
  994. package/build-module/components/block-tools/zoom-out-mode-inserters.js +3 -4
  995. package/build-module/components/block-tools/zoom-out-mode-inserters.js.map +1 -1
  996. package/build-module/components/block-types-list/index.js +8 -9
  997. package/build-module/components/block-types-list/index.js.map +1 -1
  998. package/build-module/components/block-types-list/index.native.js +22 -27
  999. package/build-module/components/block-types-list/index.native.js.map +1 -1
  1000. package/build-module/components/block-variation-picker/index.js +8 -9
  1001. package/build-module/components/block-variation-picker/index.js.map +1 -1
  1002. package/build-module/components/block-variation-picker/index.native.js +7 -9
  1003. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  1004. package/build-module/components/block-variation-transforms/index.js +30 -41
  1005. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  1006. package/build-module/components/block-vertical-alignment-control/ui.js +7 -9
  1007. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  1008. package/build-module/components/border-radius-control/all-input-control.js +7 -8
  1009. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  1010. package/build-module/components/border-radius-control/index.js +9 -10
  1011. package/build-module/components/border-radius-control/index.js.map +1 -1
  1012. package/build-module/components/border-radius-control/input-controls.js +8 -11
  1013. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  1014. package/build-module/components/border-radius-control/linked-button.js +4 -5
  1015. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  1016. package/build-module/components/border-radius-control/utils.js +3 -7
  1017. package/build-module/components/border-radius-control/utils.js.map +1 -1
  1018. package/build-module/components/button-block-appender/index.js +13 -15
  1019. package/build-module/components/button-block-appender/index.js.map +1 -1
  1020. package/build-module/components/button-block-appender/index.native.js +25 -29
  1021. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  1022. package/build-module/components/caption/index.native.js +40 -43
  1023. package/build-module/components/caption/index.native.js.map +1 -1
  1024. package/build-module/components/child-layout-control/index.js +5 -6
  1025. package/build-module/components/child-layout-control/index.js.map +1 -1
  1026. package/build-module/components/color-palette/control.js +5 -6
  1027. package/build-module/components/color-palette/control.js.map +1 -1
  1028. package/build-module/components/color-palette/with-color-context.js +1 -6
  1029. package/build-module/components/color-palette/with-color-context.js.map +1 -1
  1030. package/build-module/components/color-style-selector/index.js +28 -35
  1031. package/build-module/components/color-style-selector/index.js.map +1 -1
  1032. package/build-module/components/colors/utils.js +5 -8
  1033. package/build-module/components/colors/utils.js.map +1 -1
  1034. package/build-module/components/colors/with-colors.js +9 -24
  1035. package/build-module/components/colors/with-colors.js.map +1 -1
  1036. package/build-module/components/colors-gradients/control.js +19 -21
  1037. package/build-module/components/colors-gradients/control.js.map +1 -1
  1038. package/build-module/components/colors-gradients/dropdown.js +32 -39
  1039. package/build-module/components/colors-gradients/dropdown.js.map +1 -1
  1040. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +20 -24
  1041. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  1042. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +27 -31
  1043. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  1044. package/build-module/components/contrast-checker/index.js +12 -13
  1045. package/build-module/components/contrast-checker/index.js.map +1 -1
  1046. package/build-module/components/contrast-checker/index.native.js +16 -18
  1047. package/build-module/components/contrast-checker/index.native.js.map +1 -1
  1048. package/build-module/components/convert-to-group-buttons/index.js +9 -10
  1049. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  1050. package/build-module/components/convert-to-group-buttons/index.native.js +6 -7
  1051. package/build-module/components/convert-to-group-buttons/index.native.js.map +1 -1
  1052. package/build-module/components/convert-to-group-buttons/toolbar.js +6 -12
  1053. package/build-module/components/convert-to-group-buttons/toolbar.js.map +1 -1
  1054. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js +4 -6
  1055. package/build-module/components/convert-to-group-buttons/use-convert-to-group-button-props.js.map +1 -1
  1056. package/build-module/components/copy-handler/index.js +4 -7
  1057. package/build-module/components/copy-handler/index.js.map +1 -1
  1058. package/build-module/components/date-format-picker/index.js +12 -16
  1059. package/build-module/components/date-format-picker/index.js.map +1 -1
  1060. package/build-module/components/default-block-appender/index.js +7 -9
  1061. package/build-module/components/default-block-appender/index.js.map +1 -1
  1062. package/build-module/components/default-block-appender/index.native.js +8 -10
  1063. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  1064. package/build-module/components/default-style-picker/index.js +14 -22
  1065. package/build-module/components/default-style-picker/index.js.map +1 -1
  1066. package/build-module/components/duotone/components.js +14 -18
  1067. package/build-module/components/duotone/components.js.map +1 -1
  1068. package/build-module/components/duotone/utils.js +1 -2
  1069. package/build-module/components/duotone/utils.js.map +1 -1
  1070. package/build-module/components/duotone-control/index.js +12 -15
  1071. package/build-module/components/duotone-control/index.js.map +1 -1
  1072. package/build-module/components/editable-text/index.js +5 -6
  1073. package/build-module/components/editable-text/index.js.map +1 -1
  1074. package/build-module/components/editor-styles/index.js +4 -5
  1075. package/build-module/components/editor-styles/index.js.map +1 -1
  1076. package/build-module/components/floating-toolbar/index.native.js +7 -8
  1077. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  1078. package/build-module/components/font-appearance-control/index.js +19 -26
  1079. package/build-module/components/font-appearance-control/index.js.map +1 -1
  1080. package/build-module/components/font-family/index.js +10 -12
  1081. package/build-module/components/font-family/index.js.map +1 -1
  1082. package/build-module/components/font-sizes/fluid-utils.js +17 -21
  1083. package/build-module/components/font-sizes/fluid-utils.js.map +1 -1
  1084. package/build-module/components/font-sizes/utils.js +6 -12
  1085. package/build-module/components/font-sizes/utils.js.map +1 -1
  1086. package/build-module/components/font-sizes/with-font-sizes.js +11 -30
  1087. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  1088. package/build-module/components/global-styles/advanced-panel.js +7 -10
  1089. package/build-module/components/global-styles/advanced-panel.js.map +1 -1
  1090. package/build-module/components/global-styles/border-panel.js +45 -78
  1091. package/build-module/components/global-styles/border-panel.js.map +1 -1
  1092. package/build-module/components/global-styles/color-panel.js +104 -147
  1093. package/build-module/components/global-styles/color-panel.js.map +1 -1
  1094. package/build-module/components/global-styles/color-panel.native.js +25 -42
  1095. package/build-module/components/global-styles/color-panel.native.js.map +1 -1
  1096. package/build-module/components/global-styles/dimensions-panel.js +78 -109
  1097. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  1098. package/build-module/components/global-styles/effects-panel.js +58 -72
  1099. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  1100. package/build-module/components/global-styles/filters-panel.js +53 -71
  1101. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  1102. package/build-module/components/global-styles/get-block-css-selector.js +5 -8
  1103. package/build-module/components/global-styles/get-block-css-selector.js.map +1 -1
  1104. package/build-module/components/global-styles/hooks.js +22 -37
  1105. package/build-module/components/global-styles/hooks.js.map +1 -1
  1106. package/build-module/components/global-styles/typography-panel.js +69 -125
  1107. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  1108. package/build-module/components/global-styles/typography-utils.js +48 -26
  1109. package/build-module/components/global-styles/typography-utils.js.map +1 -1
  1110. package/build-module/components/global-styles/use-global-styles-output.js +142 -237
  1111. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  1112. package/build-module/components/global-styles/utils.js +12 -28
  1113. package/build-module/components/global-styles/utils.js.map +1 -1
  1114. package/build-module/components/gradients/use-gradient.js +6 -7
  1115. package/build-module/components/gradients/use-gradient.js.map +1 -1
  1116. package/build-module/components/height-control/index.js +9 -10
  1117. package/build-module/components/height-control/index.js.map +1 -1
  1118. package/build-module/components/iframe/index.js +51 -86
  1119. package/build-module/components/iframe/index.js.map +1 -1
  1120. package/build-module/components/iframe/use-compatibility-styles.js +29 -20
  1121. package/build-module/components/iframe/use-compatibility-styles.js.map +1 -1
  1122. package/build-module/components/image-editor/aspect-ratio-dropdown.js +83 -91
  1123. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  1124. package/build-module/components/image-editor/context.js +9 -10
  1125. package/build-module/components/image-editor/context.js.map +1 -1
  1126. package/build-module/components/image-editor/cropper.js +11 -12
  1127. package/build-module/components/image-editor/cropper.js.map +1 -1
  1128. package/build-module/components/image-editor/index.js +12 -13
  1129. package/build-module/components/image-editor/index.js.map +1 -1
  1130. package/build-module/components/image-editor/use-save-image.js +11 -12
  1131. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  1132. package/build-module/components/image-editor/use-transform-image.js +5 -6
  1133. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  1134. package/build-module/components/image-editor/zoom-dropdown.js +10 -13
  1135. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  1136. package/build-module/components/image-size-control/index.js +12 -13
  1137. package/build-module/components/image-size-control/index.js.map +1 -1
  1138. package/build-module/components/inner-blocks/button-block-appender.js +7 -8
  1139. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  1140. package/build-module/components/inner-blocks/default-block-appender.js +6 -8
  1141. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  1142. package/build-module/components/inner-blocks/index.js +2 -6
  1143. package/build-module/components/inner-blocks/index.js.map +1 -1
  1144. package/build-module/components/inner-blocks/index.native.js +1 -3
  1145. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  1146. package/build-module/components/inner-blocks/use-block-context.js +1 -4
  1147. package/build-module/components/inner-blocks/use-block-context.js.map +1 -1
  1148. package/build-module/components/inner-blocks/use-nested-settings-update.js +2 -4
  1149. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  1150. package/build-module/components/inserter/block-patterns-explorer/explorer.js +9 -11
  1151. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -1
  1152. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +11 -18
  1153. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -1
  1154. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +20 -24
  1155. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -1
  1156. package/build-module/components/inserter/block-patterns-tab.js +29 -40
  1157. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  1158. package/build-module/components/inserter/block-types-tab.js +7 -9
  1159. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  1160. package/build-module/components/inserter/block-types-tab.native.js +8 -9
  1161. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  1162. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +3 -5
  1163. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  1164. package/build-module/components/inserter/hooks/use-block-types-state.js +5 -6
  1165. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  1166. package/build-module/components/inserter/hooks/use-clipboard-block.native.js +2 -2
  1167. package/build-module/components/inserter/hooks/use-clipboard-block.native.js.map +1 -1
  1168. package/build-module/components/inserter/hooks/use-debounced-input.js +1 -2
  1169. package/build-module/components/inserter/hooks/use-debounced-input.js.map +1 -1
  1170. package/build-module/components/inserter/hooks/use-insertion-point.js +10 -12
  1171. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  1172. package/build-module/components/inserter/index.js +37 -51
  1173. package/build-module/components/inserter/index.js.map +1 -1
  1174. package/build-module/components/inserter/index.native.js +24 -31
  1175. package/build-module/components/inserter/index.native.js.map +1 -1
  1176. package/build-module/components/inserter/library.js +11 -12
  1177. package/build-module/components/inserter/library.js.map +1 -1
  1178. package/build-module/components/inserter/media-tab/hooks.js +2 -5
  1179. package/build-module/components/inserter/media-tab/hooks.js.map +1 -1
  1180. package/build-module/components/inserter/media-tab/media-list.js +6 -7
  1181. package/build-module/components/inserter/media-tab/media-list.js.map +1 -1
  1182. package/build-module/components/inserter/media-tab/media-panel.js +12 -14
  1183. package/build-module/components/inserter/media-tab/media-panel.js.map +1 -1
  1184. package/build-module/components/inserter/media-tab/media-preview.js +47 -58
  1185. package/build-module/components/inserter/media-tab/media-preview.js.map +1 -1
  1186. package/build-module/components/inserter/media-tab/media-tab.js +24 -28
  1187. package/build-module/components/inserter/media-tab/media-tab.js.map +1 -1
  1188. package/build-module/components/inserter/media-tab/utils.js +3 -5
  1189. package/build-module/components/inserter/media-tab/utils.js.map +1 -1
  1190. package/build-module/components/inserter/menu.js +15 -19
  1191. package/build-module/components/inserter/menu.js.map +1 -1
  1192. package/build-module/components/inserter/menu.native.js +27 -31
  1193. package/build-module/components/inserter/menu.native.js.map +1 -1
  1194. package/build-module/components/inserter/mobile-tab-navigation.js +7 -9
  1195. package/build-module/components/inserter/mobile-tab-navigation.js.map +1 -1
  1196. package/build-module/components/inserter/panel.js +5 -6
  1197. package/build-module/components/inserter/panel.js.map +1 -1
  1198. package/build-module/components/inserter/preview-panel.js +4 -5
  1199. package/build-module/components/inserter/preview-panel.js.map +1 -1
  1200. package/build-module/components/inserter/quick-inserter.js +8 -9
  1201. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  1202. package/build-module/components/inserter/reusable-blocks-tab.js +13 -18
  1203. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  1204. package/build-module/components/inserter/reusable-blocks-tab.native.js +5 -6
  1205. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  1206. package/build-module/components/inserter/search-items.js +12 -40
  1207. package/build-module/components/inserter/search-items.js.map +1 -1
  1208. package/build-module/components/inserter/search-results.js +17 -18
  1209. package/build-module/components/inserter/search-results.js.map +1 -1
  1210. package/build-module/components/inserter/search-results.native.js +11 -12
  1211. package/build-module/components/inserter/search-results.native.js.map +1 -1
  1212. package/build-module/components/inserter/tabs.js +8 -9
  1213. package/build-module/components/inserter/tabs.js.map +1 -1
  1214. package/build-module/components/inserter/tabs.native.js +37 -55
  1215. package/build-module/components/inserter/tabs.native.js.map +1 -1
  1216. package/build-module/components/inserter/utils.native.js +13 -17
  1217. package/build-module/components/inserter/utils.native.js.map +1 -1
  1218. package/build-module/components/inserter-draggable-blocks/index.js +11 -13
  1219. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  1220. package/build-module/components/inserter-list-item/index.js +65 -69
  1221. package/build-module/components/inserter-list-item/index.js.map +1 -1
  1222. package/build-module/components/inserter-listbox/index.js +3 -4
  1223. package/build-module/components/inserter-listbox/index.js.map +1 -1
  1224. package/build-module/components/inserter-listbox/item.js +6 -7
  1225. package/build-module/components/inserter-listbox/item.js.map +1 -1
  1226. package/build-module/components/inspector-controls/block-support-slot-container.js +4 -5
  1227. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  1228. package/build-module/components/inspector-controls/block-support-tools-panel.js +6 -8
  1229. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  1230. package/build-module/components/inspector-controls/fill.js +13 -23
  1231. package/build-module/components/inspector-controls/fill.js.map +1 -1
  1232. package/build-module/components/inspector-controls/fill.native.js +7 -11
  1233. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  1234. package/build-module/components/inspector-controls/slot.js +9 -13
  1235. package/build-module/components/inspector-controls/slot.js.map +1 -1
  1236. package/build-module/components/inspector-controls/slot.native.js +6 -10
  1237. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  1238. package/build-module/components/inspector-controls-tabs/index.js +6 -7
  1239. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  1240. package/build-module/components/inspector-controls-tabs/position-controls-panel.js +3 -8
  1241. package/build-module/components/inspector-controls-tabs/position-controls-panel.js.map +1 -1
  1242. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js +1 -1
  1243. package/build-module/components/inspector-controls-tabs/settings-tab-hint.js.map +1 -1
  1244. package/build-module/components/inspector-controls-tabs/settings-tab.js +3 -6
  1245. package/build-module/components/inspector-controls-tabs/settings-tab.js.map +1 -1
  1246. package/build-module/components/inspector-controls-tabs/styles-tab.js +5 -6
  1247. package/build-module/components/inspector-controls-tabs/styles-tab.js.map +1 -1
  1248. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -3
  1249. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.js.map +1 -1
  1250. package/build-module/components/inspector-popover-header/index.js +18 -22
  1251. package/build-module/components/inspector-popover-header/index.js.map +1 -1
  1252. package/build-module/components/justify-content-control/ui.js +8 -10
  1253. package/build-module/components/justify-content-control/ui.js.map +1 -1
  1254. package/build-module/components/letter-spacing-control/index.js +6 -7
  1255. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  1256. package/build-module/components/line-height-control/index.js +13 -18
  1257. package/build-module/components/line-height-control/index.js.map +1 -1
  1258. package/build-module/components/line-height-control/index.native.js +4 -5
  1259. package/build-module/components/line-height-control/index.native.js.map +1 -1
  1260. package/build-module/components/link-control/index.js +83 -64
  1261. package/build-module/components/link-control/index.js.map +1 -1
  1262. package/build-module/components/link-control/is-url-like.js +32 -3
  1263. package/build-module/components/link-control/is-url-like.js.map +1 -1
  1264. package/build-module/components/link-control/link-preview.js +24 -27
  1265. package/build-module/components/link-control/link-preview.js.map +1 -1
  1266. package/build-module/components/link-control/search-create-button.js +7 -9
  1267. package/build-module/components/link-control/search-create-button.js.map +1 -1
  1268. package/build-module/components/link-control/search-input.js +22 -27
  1269. package/build-module/components/link-control/search-input.js.map +1 -1
  1270. package/build-module/components/link-control/search-item.js +13 -15
  1271. package/build-module/components/link-control/search-item.js.map +1 -1
  1272. package/build-module/components/link-control/search-results.js +21 -27
  1273. package/build-module/components/link-control/search-results.js.map +1 -1
  1274. package/build-module/components/link-control/settings-drawer.js +7 -33
  1275. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  1276. package/build-module/components/link-control/settings.js +7 -9
  1277. package/build-module/components/link-control/settings.js.map +1 -1
  1278. package/build-module/components/link-control/use-internal-value.js +46 -0
  1279. package/build-module/components/link-control/use-internal-value.js.map +1 -0
  1280. package/build-module/components/link-control/use-rich-url-data.js +1 -1
  1281. package/build-module/components/link-control/use-rich-url-data.js.map +1 -1
  1282. package/build-module/components/link-control/use-search-handler.js +10 -23
  1283. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  1284. package/build-module/components/list-view/appender.js +11 -12
  1285. package/build-module/components/list-view/appender.js.map +1 -1
  1286. package/build-module/components/list-view/aria-referenced-text.js +35 -0
  1287. package/build-module/components/list-view/aria-referenced-text.js.map +1 -0
  1288. package/build-module/components/list-view/block-contents.js +38 -38
  1289. package/build-module/components/list-view/block-contents.js.map +1 -1
  1290. package/build-module/components/list-view/block-select-button.js +65 -22
  1291. package/build-module/components/list-view/block-select-button.js.map +1 -1
  1292. package/build-module/components/list-view/block.js +117 -101
  1293. package/build-module/components/list-view/block.js.map +1 -1
  1294. package/build-module/components/list-view/branch.js +5 -5
  1295. package/build-module/components/list-view/branch.js.map +1 -1
  1296. package/build-module/components/list-view/drop-indicator.js +4 -5
  1297. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  1298. package/build-module/components/list-view/expander.js +3 -4
  1299. package/build-module/components/list-view/expander.js.map +1 -1
  1300. package/build-module/components/list-view/index.js +46 -43
  1301. package/build-module/components/list-view/index.js.map +1 -1
  1302. package/build-module/components/list-view/leaf.js +10 -11
  1303. package/build-module/components/list-view/leaf.js.map +1 -1
  1304. package/build-module/components/list-view/use-block-selection.js +4 -6
  1305. package/build-module/components/list-view/use-block-selection.js.map +1 -1
  1306. package/build-module/components/list-view/use-list-view-client-ids.js +9 -12
  1307. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  1308. package/build-module/components/list-view/use-list-view-drop-zone.js +25 -13
  1309. package/build-module/components/list-view/use-list-view-drop-zone.js.map +1 -1
  1310. package/build-module/components/list-view/use-list-view-expand-selected-item.js +4 -5
  1311. package/build-module/components/list-view/use-list-view-expand-selected-item.js.map +1 -1
  1312. package/build-module/components/list-view/use-list-view-scroll-into-view.js +5 -6
  1313. package/build-module/components/list-view/use-list-view-scroll-into-view.js.map +1 -1
  1314. package/build-module/components/media-placeholder/index.js +71 -92
  1315. package/build-module/components/media-placeholder/index.js.map +1 -1
  1316. package/build-module/components/media-placeholder/index.native.js +5 -6
  1317. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  1318. package/build-module/components/media-replace-flow/index.js +94 -107
  1319. package/build-module/components/media-replace-flow/index.js.map +1 -1
  1320. package/build-module/components/media-upload/check.js +4 -5
  1321. package/build-module/components/media-upload/check.js.map +1 -1
  1322. package/build-module/components/media-upload/index.native.js +1 -1
  1323. package/build-module/components/media-upload/index.native.js.map +1 -1
  1324. package/build-module/components/multi-selection-inspector/index.js +3 -4
  1325. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  1326. package/build-module/components/navigable-toolbar/index.js +16 -15
  1327. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  1328. package/build-module/components/observe-typing/index.js +3 -4
  1329. package/build-module/components/observe-typing/index.js.map +1 -1
  1330. package/build-module/components/panel-color-settings/index.js +4 -5
  1331. package/build-module/components/panel-color-settings/index.js.map +1 -1
  1332. package/build-module/components/plain-text/index.js +4 -6
  1333. package/build-module/components/plain-text/index.js.map +1 -1
  1334. package/build-module/components/plain-text/index.native.js +8 -14
  1335. package/build-module/components/plain-text/index.native.js.map +1 -1
  1336. package/build-module/components/preview-options/index.js +8 -9
  1337. package/build-module/components/preview-options/index.js.map +1 -1
  1338. package/build-module/components/provider/block-refs-provider.js +3 -4
  1339. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  1340. package/build-module/components/provider/use-block-sync.js +7 -8
  1341. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1342. package/build-module/components/provider/with-registry-provider.js +5 -7
  1343. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  1344. package/build-module/components/publish-date-time-picker/index.js +6 -7
  1345. package/build-module/components/publish-date-time-picker/index.js.map +1 -1
  1346. package/build-module/components/recursion-provider/index.js +7 -11
  1347. package/build-module/components/recursion-provider/index.js.map +1 -1
  1348. package/build-module/components/resizable-box-popover/index.js +5 -6
  1349. package/build-module/components/resizable-box-popover/index.js.map +1 -1
  1350. package/build-module/components/responsive-block-control/label.js +5 -6
  1351. package/build-module/components/responsive-block-control/label.js.map +1 -1
  1352. package/build-module/components/rich-text/embed-handler-picker.native.js +6 -10
  1353. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  1354. package/build-module/components/rich-text/format-edit.js +7 -8
  1355. package/build-module/components/rich-text/format-edit.js.map +1 -1
  1356. package/build-module/components/rich-text/format-toolbar/index.js +9 -18
  1357. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  1358. package/build-module/components/rich-text/format-toolbar-container.js +13 -16
  1359. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  1360. package/build-module/components/rich-text/index.js +43 -47
  1361. package/build-module/components/rich-text/index.js.map +1 -1
  1362. package/build-module/components/rich-text/index.native.js +130 -157
  1363. package/build-module/components/rich-text/index.native.js.map +1 -1
  1364. package/build-module/components/rich-text/input-event.js +4 -5
  1365. package/build-module/components/rich-text/input-event.js.map +1 -1
  1366. package/build-module/components/rich-text/shortcut.js +5 -6
  1367. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1368. package/build-module/components/rich-text/split-value.js +8 -10
  1369. package/build-module/components/rich-text/split-value.js.map +1 -1
  1370. package/build-module/components/rich-text/toolbar-button.js +6 -7
  1371. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1372. package/build-module/components/rich-text/use-before-input-rules.js +1 -4
  1373. package/build-module/components/rich-text/use-before-input-rules.js.map +1 -1
  1374. package/build-module/components/rich-text/use-enter.js +3 -6
  1375. package/build-module/components/rich-text/use-enter.js.map +1 -1
  1376. package/build-module/components/rich-text/use-firefox-compat.js +29 -1
  1377. package/build-module/components/rich-text/use-firefox-compat.js.map +1 -1
  1378. package/build-module/components/rich-text/use-format-types.js +11 -17
  1379. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1380. package/build-module/components/rich-text/use-input-rules.js +9 -15
  1381. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  1382. package/build-module/components/rich-text/use-mark-persistent.js +4 -5
  1383. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1384. package/build-module/components/rich-text/use-paste-handler.js +5 -7
  1385. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1386. package/build-module/components/rich-text/utils.js +5 -7
  1387. package/build-module/components/rich-text/utils.js.map +1 -1
  1388. package/build-module/components/skip-to-selected-block/index.js +3 -4
  1389. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1390. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js +27 -0
  1391. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.js.map +1 -0
  1392. package/build-module/components/spacing-sizes-control/index.js +62 -63
  1393. package/build-module/components/spacing-sizes-control/index.js.map +1 -1
  1394. package/build-module/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +21 -22
  1395. package/build-module/components/spacing-sizes-control/input-controls/axial.js.map +1 -0
  1396. package/build-module/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +21 -21
  1397. package/build-module/components/spacing-sizes-control/input-controls/separated.js.map +1 -0
  1398. package/build-module/components/spacing-sizes-control/input-controls/single.js +40 -0
  1399. package/build-module/components/spacing-sizes-control/input-controls/single.js.map +1 -0
  1400. package/build-module/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +53 -70
  1401. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -0
  1402. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js +73 -0
  1403. package/build-module/components/spacing-sizes-control/sides-dropdown/index.js.map +1 -0
  1404. package/build-module/components/spacing-sizes-control/utils.js +196 -25
  1405. package/build-module/components/spacing-sizes-control/utils.js.map +1 -1
  1406. package/build-module/components/text-decoration-control/index.js +5 -6
  1407. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1408. package/build-module/components/text-transform-control/index.js +5 -6
  1409. package/build-module/components/text-transform-control/index.js.map +1 -1
  1410. package/build-module/components/tool-selector/index.js +13 -16
  1411. package/build-module/components/tool-selector/index.js.map +1 -1
  1412. package/build-module/components/typewriter/index.js +6 -9
  1413. package/build-module/components/typewriter/index.js.map +1 -1
  1414. package/build-module/components/ungroup-button/index.native.js +11 -14
  1415. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1416. package/build-module/components/unit-control/index.js +4 -5
  1417. package/build-module/components/unit-control/index.js.map +1 -1
  1418. package/build-module/components/url-input/index.js +15 -26
  1419. package/build-module/components/url-input/index.js.map +1 -1
  1420. package/build-module/components/url-input/index.native.js +6 -8
  1421. package/build-module/components/url-input/index.native.js.map +1 -1
  1422. package/build-module/components/url-popover/image-url-input-ui.js +12 -15
  1423. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1424. package/build-module/components/url-popover/index.js +12 -14
  1425. package/build-module/components/url-popover/index.js.map +1 -1
  1426. package/build-module/components/url-popover/link-editor.js +7 -8
  1427. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1428. package/build-module/components/url-popover/link-viewer-url.js +5 -6
  1429. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1430. package/build-module/components/url-popover/link-viewer.js +8 -9
  1431. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1432. package/build-module/components/use-block-display-information/index.js +2 -2
  1433. package/build-module/components/use-block-display-information/index.js.map +1 -1
  1434. package/build-module/components/use-block-drop-zone/index.js +16 -23
  1435. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1436. package/build-module/components/use-block-drop-zone/index.native.js +8 -11
  1437. package/build-module/components/use-block-drop-zone/index.native.js.map +1 -1
  1438. package/build-module/components/use-moving-animation/index.js +9 -12
  1439. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1440. package/build-module/components/use-on-block-drop/index.js +2 -6
  1441. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  1442. package/build-module/components/use-on-block-drop/index.native.js +8 -10
  1443. package/build-module/components/use-on-block-drop/index.native.js.map +1 -1
  1444. package/build-module/components/use-paste-styles/index.js +2 -6
  1445. package/build-module/components/use-paste-styles/index.js.map +1 -1
  1446. package/build-module/components/warning/index.js +6 -7
  1447. package/build-module/components/warning/index.js.map +1 -1
  1448. package/build-module/components/warning/index.native.js +9 -10
  1449. package/build-module/components/warning/index.native.js.map +1 -1
  1450. package/build-module/components/writing-flow/index.js +4 -5
  1451. package/build-module/components/writing-flow/index.js.map +1 -1
  1452. package/build-module/components/writing-flow/use-drag-selection.js +4 -6
  1453. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  1454. package/build-module/components/writing-flow/use-tab-nav.js +9 -6
  1455. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  1456. package/build-module/hooks/align.js +7 -14
  1457. package/build-module/hooks/align.js.map +1 -1
  1458. package/build-module/hooks/anchor.js +5 -3
  1459. package/build-module/hooks/anchor.js.map +1 -1
  1460. package/build-module/hooks/aria-label.js +1 -3
  1461. package/build-module/hooks/aria-label.js.map +1 -1
  1462. package/build-module/hooks/behaviors.js +90 -58
  1463. package/build-module/hooks/behaviors.js.map +1 -1
  1464. package/build-module/hooks/border.js +25 -38
  1465. package/build-module/hooks/border.js.map +1 -1
  1466. package/build-module/hooks/color.js +22 -37
  1467. package/build-module/hooks/color.js.map +1 -1
  1468. package/build-module/hooks/content-lock-ui.js +23 -27
  1469. package/build-module/hooks/content-lock-ui.js.map +1 -1
  1470. package/build-module/hooks/contrast-checker.js +4 -7
  1471. package/build-module/hooks/contrast-checker.js.map +1 -1
  1472. package/build-module/hooks/custom-class-name.js +4 -4
  1473. package/build-module/hooks/custom-class-name.js.map +1 -1
  1474. package/build-module/hooks/dimensions.js +6 -9
  1475. package/build-module/hooks/dimensions.js.map +1 -1
  1476. package/build-module/hooks/duotone.js +32 -44
  1477. package/build-module/hooks/duotone.js.map +1 -1
  1478. package/build-module/hooks/font-family.js +5 -6
  1479. package/build-module/hooks/font-family.js.map +1 -1
  1480. package/build-module/hooks/font-size.js +14 -21
  1481. package/build-module/hooks/font-size.js.map +1 -1
  1482. package/build-module/hooks/gap.js +5 -6
  1483. package/build-module/hooks/gap.js.map +1 -1
  1484. package/build-module/hooks/layout.js +42 -59
  1485. package/build-module/hooks/layout.js.map +1 -1
  1486. package/build-module/hooks/line-height.js +5 -8
  1487. package/build-module/hooks/line-height.js.map +1 -1
  1488. package/build-module/hooks/lock.js +2 -2
  1489. package/build-module/hooks/lock.js.map +1 -1
  1490. package/build-module/hooks/margin.js +6 -9
  1491. package/build-module/hooks/margin.js.map +1 -1
  1492. package/build-module/hooks/metadata-name.js +4 -5
  1493. package/build-module/hooks/metadata-name.js.map +1 -1
  1494. package/build-module/hooks/metadata.js +3 -7
  1495. package/build-module/hooks/metadata.js.map +1 -1
  1496. package/build-module/hooks/padding.js +6 -9
  1497. package/build-module/hooks/padding.js.map +1 -1
  1498. package/build-module/hooks/position.js +26 -40
  1499. package/build-module/hooks/position.js.map +1 -1
  1500. package/build-module/hooks/settings.js +1 -3
  1501. package/build-module/hooks/settings.js.map +1 -1
  1502. package/build-module/hooks/style.js +11 -19
  1503. package/build-module/hooks/style.js.map +1 -1
  1504. package/build-module/hooks/supports.js +3 -5
  1505. package/build-module/hooks/supports.js.map +1 -1
  1506. package/build-module/hooks/typography.js +18 -27
  1507. package/build-module/hooks/typography.js.map +1 -1
  1508. package/build-module/hooks/typography.native.js +1 -2
  1509. package/build-module/hooks/typography.native.js.map +1 -1
  1510. package/build-module/hooks/use-border-props.js +1 -3
  1511. package/build-module/hooks/use-border-props.js.map +1 -1
  1512. package/build-module/hooks/use-color-props.js +6 -8
  1513. package/build-module/hooks/use-color-props.js.map +1 -1
  1514. package/build-module/hooks/use-editor-wrapper-styles.native.js +34 -39
  1515. package/build-module/hooks/use-editor-wrapper-styles.native.js.map +1 -1
  1516. package/build-module/hooks/use-spacing-props.js +1 -1
  1517. package/build-module/hooks/use-spacing-props.js.map +1 -1
  1518. package/build-module/hooks/use-typography-props.js +8 -12
  1519. package/build-module/hooks/use-typography-props.js.map +1 -1
  1520. package/build-module/hooks/utils.js +7 -19
  1521. package/build-module/hooks/utils.js.map +1 -1
  1522. package/build-module/layouts/constrained.js +22 -27
  1523. package/build-module/layouts/constrained.js.map +1 -1
  1524. package/build-module/layouts/flex.js +43 -54
  1525. package/build-module/layouts/flex.js.map +1 -1
  1526. package/build-module/layouts/flow.js +10 -13
  1527. package/build-module/layouts/flow.js.map +1 -1
  1528. package/build-module/layouts/grid.js +45 -25
  1529. package/build-module/layouts/grid.js.map +1 -1
  1530. package/build-module/layouts/index.js +1 -2
  1531. package/build-module/layouts/index.js.map +1 -1
  1532. package/build-module/layouts/utils.js +3 -9
  1533. package/build-module/layouts/utils.js.map +1 -1
  1534. package/build-module/store/actions.js +253 -336
  1535. package/build-module/store/actions.js.map +1 -1
  1536. package/build-module/store/array.js +1 -2
  1537. package/build-module/store/array.js.map +1 -1
  1538. package/build-module/store/private-actions.js +3 -7
  1539. package/build-module/store/private-actions.js.map +1 -1
  1540. package/build-module/store/private-selectors.js +40 -25
  1541. package/build-module/store/private-selectors.js.map +1 -1
  1542. package/build-module/store/reducer.js +67 -169
  1543. package/build-module/store/reducer.js.map +1 -1
  1544. package/build-module/store/selectors.js +144 -215
  1545. package/build-module/store/selectors.js.map +1 -1
  1546. package/build-module/utils/block-variation-transforms.js +4 -7
  1547. package/build-module/utils/block-variation-transforms.js.map +1 -1
  1548. package/build-module/utils/math.js +1 -2
  1549. package/build-module/utils/math.js.map +1 -1
  1550. package/build-module/utils/object.js +1 -4
  1551. package/build-module/utils/object.js.map +1 -1
  1552. package/build-module/utils/order-inserter-block-items.js +5 -7
  1553. package/build-module/utils/order-inserter-block-items.js.map +1 -1
  1554. package/build-module/utils/parse-css-unit-to-px.js +3 -6
  1555. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  1556. package/build-module/utils/pasting.js +5 -8
  1557. package/build-module/utils/pasting.js.map +1 -1
  1558. package/build-module/utils/pre-parse-patterns.js +1 -1
  1559. package/build-module/utils/pre-parse-patterns.js.map +1 -1
  1560. package/build-module/utils/sorting.js +1 -2
  1561. package/build-module/utils/sorting.js.map +1 -1
  1562. package/build-module/utils/transform-styles/index.js +5 -7
  1563. package/build-module/utils/transform-styles/index.js.map +1 -1
  1564. package/build-module/utils/transform-styles/transforms/wrap.js +25 -28
  1565. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  1566. package/build-style/content-rtl.css +7 -10
  1567. package/build-style/content.css +7 -10
  1568. package/build-style/style-rtl.css +35 -101
  1569. package/build-style/style.css +35 -101
  1570. package/package.json +31 -31
  1571. package/src/components/block-controls/fill.js +15 -17
  1572. package/src/components/block-controls/slot.js +21 -18
  1573. package/src/components/block-controls/slot.native.js +3 -8
  1574. package/src/components/block-draggable/index.js +2 -1
  1575. package/src/components/block-edit/test/edit.js +1 -1
  1576. package/src/components/block-inspector/index.js +1 -0
  1577. package/src/components/block-list/content.scss +8 -12
  1578. package/src/components/block-list/use-block-props/index.js +6 -1
  1579. package/src/components/block-list-appender/index.js +4 -1
  1580. package/src/components/block-lock/toolbar.js +2 -8
  1581. package/src/components/block-settings-menu/block-settings-dropdown.js +81 -41
  1582. package/src/components/block-tools/selected-block-popover.js +6 -0
  1583. package/src/components/color-palette/test/__snapshots__/control.js.snap +66 -50
  1584. package/src/components/color-palette/with-color-context.js +2 -6
  1585. package/src/components/colors-gradients/control.js +3 -3
  1586. package/src/components/colors-gradients/panel-color-gradient-settings.js +4 -5
  1587. package/src/components/global-styles/dimensions-panel.js +14 -5
  1588. package/src/components/global-styles/get-block-css-selector.js +2 -2
  1589. package/src/components/global-styles/test/typography-utils.js +139 -1
  1590. package/src/components/global-styles/typography-utils.js +53 -28
  1591. package/src/components/global-styles/use-global-styles-output.js +18 -8
  1592. package/src/components/global-styles/utils.js +9 -3
  1593. package/src/components/iframe/index.js +46 -68
  1594. package/src/components/iframe/use-compatibility-styles.js +34 -18
  1595. package/src/components/inspector-controls/README.md +1 -1
  1596. package/src/components/inspector-controls/fill.js +2 -6
  1597. package/src/components/inspector-controls-tabs/index.js +0 -1
  1598. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +0 -1
  1599. package/src/components/link-control/index.js +71 -33
  1600. package/src/components/link-control/is-url-like.js +40 -3
  1601. package/src/components/link-control/search-results.js +4 -14
  1602. package/src/components/link-control/settings-drawer.js +2 -37
  1603. package/src/components/link-control/settings.js +2 -2
  1604. package/src/components/link-control/style.scss +5 -6
  1605. package/src/components/link-control/test/index.js +169 -61
  1606. package/src/components/link-control/test/is-url-like.js +66 -0
  1607. package/src/components/link-control/use-internal-value.js +60 -0
  1608. package/src/components/link-control/use-search-handler.js +10 -27
  1609. package/src/components/list-view/appender.js +3 -5
  1610. package/src/components/list-view/aria-referenced-text.js +30 -0
  1611. package/src/components/list-view/block-contents.js +9 -8
  1612. package/src/components/list-view/block-select-button.js +59 -1
  1613. package/src/components/list-view/block.js +40 -10
  1614. package/src/components/list-view/index.js +29 -19
  1615. package/src/components/list-view/style.scss +0 -5
  1616. package/src/components/list-view/test/use-list-view-drop-zone.js +38 -1
  1617. package/src/components/list-view/use-block-selection.js +2 -2
  1618. package/src/components/list-view/use-list-view-drop-zone.js +22 -4
  1619. package/src/components/media-replace-flow/test/index.js +1 -1
  1620. package/src/components/navigable-toolbar/index.js +7 -5
  1621. package/src/components/rich-text/index.js +1 -1
  1622. package/src/components/rich-text/use-firefox-compat.js +27 -1
  1623. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +26 -0
  1624. package/src/components/spacing-sizes-control/index.js +85 -71
  1625. package/src/components/spacing-sizes-control/{axial-input-controls.js → input-controls/axial.js} +14 -13
  1626. package/src/components/spacing-sizes-control/{input-controls.js → input-controls/separated.js} +15 -14
  1627. package/src/components/spacing-sizes-control/input-controls/single.js +40 -0
  1628. package/src/components/spacing-sizes-control/{spacing-input-control.js → input-controls/spacing-input-control.js} +55 -80
  1629. package/src/components/spacing-sizes-control/sides-dropdown/index.js +91 -0
  1630. package/src/components/spacing-sizes-control/style.scss +28 -100
  1631. package/src/components/spacing-sizes-control/test/utils.js +233 -4
  1632. package/src/components/spacing-sizes-control/utils.js +203 -20
  1633. package/src/components/ungroup-button/index.native.js +2 -2
  1634. package/src/components/writing-flow/use-tab-nav.js +14 -3
  1635. package/src/hooks/anchor.js +3 -1
  1636. package/src/hooks/behaviors.js +116 -60
  1637. package/src/hooks/custom-class-name.js +23 -19
  1638. package/src/hooks/layout.js +4 -1
  1639. package/src/hooks/style.js +3 -1
  1640. package/src/hooks/utils.js +8 -7
  1641. package/src/layouts/grid.js +29 -3
  1642. package/src/store/private-selectors.js +54 -32
  1643. package/src/store/reducer.js +6 -8
  1644. package/src/store/selectors.js +31 -20
  1645. package/src/store/test/private-selectors.js +237 -62
  1646. package/src/store/test/reducer.js +0 -7
  1647. package/src/store/test/selectors.js +99 -0
  1648. package/build/components/link-control/use-internal-input-value.js +0 -27
  1649. package/build/components/link-control/use-internal-input-value.js.map +0 -1
  1650. package/build/components/spacing-sizes-control/all-input-control.js +0 -57
  1651. package/build/components/spacing-sizes-control/all-input-control.js.map +0 -1
  1652. package/build/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
  1653. package/build/components/spacing-sizes-control/input-controls.js.map +0 -1
  1654. package/build/components/spacing-sizes-control/linked-button.js +0 -37
  1655. package/build/components/spacing-sizes-control/linked-button.js.map +0 -1
  1656. package/build/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
  1657. package/build/components/ungroup-button/icon.js +0 -31
  1658. package/build/components/ungroup-button/icon.js.map +0 -1
  1659. package/build-module/components/link-control/use-internal-input-value.js +0 -19
  1660. package/build-module/components/link-control/use-internal-input-value.js.map +0 -1
  1661. package/build-module/components/spacing-sizes-control/all-input-control.js +0 -45
  1662. package/build-module/components/spacing-sizes-control/all-input-control.js.map +0 -1
  1663. package/build-module/components/spacing-sizes-control/axial-input-controls.js.map +0 -1
  1664. package/build-module/components/spacing-sizes-control/input-controls.js.map +0 -1
  1665. package/build-module/components/spacing-sizes-control/linked-button.js +0 -27
  1666. package/build-module/components/spacing-sizes-control/linked-button.js.map +0 -1
  1667. package/build-module/components/spacing-sizes-control/spacing-input-control.js.map +0 -1
  1668. package/build-module/components/ungroup-button/icon.js +0 -22
  1669. package/build-module/components/ungroup-button/icon.js.map +0 -1
  1670. package/src/components/link-control/use-internal-input-value.js +0 -23
  1671. package/src/components/spacing-sizes-control/all-input-control.js +0 -44
  1672. package/src/components/spacing-sizes-control/linked-button.js +0 -24
  1673. package/src/components/ungroup-button/icon.js +0 -26
@@ -25,11 +25,10 @@ const ColorSelectorSVGIcon = () => createElement(SVG, {
25
25
  */
26
26
 
27
27
 
28
- const ColorSelectorIcon = _ref => {
29
- let {
30
- style,
31
- className
32
- } = _ref;
28
+ const ColorSelectorIcon = ({
29
+ style,
30
+ className
31
+ }) => {
33
32
  return createElement("div", {
34
33
  className: "block-library-colors-selector__icon-container"
35
34
  }, createElement("div", {
@@ -48,39 +47,33 @@ const ColorSelectorIcon = _ref => {
48
47
  */
49
48
 
50
49
 
51
- const renderToggleComponent = _ref2 => {
52
- let {
53
- TextColor,
54
- BackgroundColor
55
- } = _ref2;
56
- return _ref3 => {
57
- let {
58
- onToggle,
59
- isOpen
60
- } = _ref3;
61
-
62
- const openOnArrowDown = event => {
63
- if (!isOpen && event.keyCode === DOWN) {
64
- event.preventDefault();
65
- onToggle();
66
- }
67
- };
68
-
69
- return createElement(ToolbarGroup, null, createElement(ToolbarButton, {
70
- className: "components-toolbar__control block-library-colors-selector__toggle",
71
- label: __('Open Colors Selector'),
72
- onClick: onToggle,
73
- onKeyDown: openOnArrowDown,
74
- icon: createElement(BackgroundColor, null, createElement(TextColor, null, createElement(ColorSelectorIcon, null)))
75
- }));
50
+ const renderToggleComponent = ({
51
+ TextColor,
52
+ BackgroundColor
53
+ }) => ({
54
+ onToggle,
55
+ isOpen
56
+ }) => {
57
+ const openOnArrowDown = event => {
58
+ if (!isOpen && event.keyCode === DOWN) {
59
+ event.preventDefault();
60
+ onToggle();
61
+ }
76
62
  };
63
+
64
+ return createElement(ToolbarGroup, null, createElement(ToolbarButton, {
65
+ className: "components-toolbar__control block-library-colors-selector__toggle",
66
+ label: __('Open Colors Selector'),
67
+ onClick: onToggle,
68
+ onKeyDown: openOnArrowDown,
69
+ icon: createElement(BackgroundColor, null, createElement(TextColor, null, createElement(ColorSelectorIcon, null)))
70
+ }));
77
71
  };
78
72
 
79
- const BlockColorsStyleSelector = _ref4 => {
80
- let {
81
- children,
82
- ...other
83
- } = _ref4;
73
+ const BlockColorsStyleSelector = ({
74
+ children,
75
+ ...other
76
+ }) => {
84
77
  deprecated(`wp.blockEditor.BlockColorsStyleSelector`, {
85
78
  alternative: 'block supports API',
86
79
  since: '6.1',
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"names":["ToolbarButton","Dropdown","ToolbarGroup","SVG","Path","__","DOWN","deprecated","ColorSelectorSVGIcon","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","preventDefault","BlockColorsStyleSelector","children","other","alternative","since","version","placement"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,aADD,EAECC,QAFD,EAGCC,YAHD,EAICC,GAJD,EAKCC,IALD,QAMO,uBANP;AAOA,SAAS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,CADD;AAiBA,GA1BD;AAAA,CADD;;AA6BA,MAAMI,wBAAwB,GAAG,SAA8B;AAAA,MAA5B;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAA4B;AAC9DhB,EAAAA,UAAU,CAAG,yCAAH,EAA6C;AACtDiB,IAAAA,WAAW,EAAE,oBADyC;AAEtDC,IAAAA,KAAK,EAAE,KAF+C;AAGtDC,IAAAA,OAAO,EAAE;AAH6C,GAA7C,CAAV;AAMA,SACC,cAAC,QAAD;AACC,IAAA,YAAY,EAAG;AAAEC,MAAAA,SAAS,EAAE;AAAb,KADhB;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,IAAA,gBAAgB,EAAC,wCAHlB;AAIC,IAAA,YAAY,EAAGf,qBAAqB,CAAEW,KAAF,CAJrC;AAKC,IAAA,aAAa,EAAG,MAAMD;AALvB,IADD;AASA,CAhBD;;AAkBA,eAAeD,wBAAf","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport deprecated from '@wordpress/deprecated';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"https://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent =\n\t( { TextColor, BackgroundColor } ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst openOnArrowDown = ( event ) => {\n\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t\t</BackgroundColor>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => {\n\tdeprecated( `wp.blockEditor.BlockColorsStyleSelector`, {\n\t\talternative: 'block supports API',\n\t\tsince: '6.1',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\tclassName=\"block-library-colors-selector\"\n\t\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\t\trenderToggle={ renderToggleComponent( other ) }\n\t\t\trenderContent={ () => children }\n\t\t/>\n\t);\n};\n\nexport default BlockColorsStyleSelector;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"names":["ToolbarButton","Dropdown","ToolbarGroup","SVG","Path","__","DOWN","deprecated","ColorSelectorSVGIcon","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","preventDefault","BlockColorsStyleSelector","children","other","alternative","since","version","placement"],"mappings":";;AAAA;AACA;AACA;AACA,SACCA,aADD,EAECC,QAFD,EAGCC,YAHD,EAICC,GAJD,EAKCC,IALD,QAMO,uBANP;AAOA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SAASC,IAAT,QAAqB,qBAArB;AACA,OAAOC,UAAP,MAAuB,uBAAvB;;AAEA,MAAMC,oBAAoB,GAAG,MAC5B,cAAC,GAAD;AAAK,EAAA,KAAK,EAAC,6BAAX;AAAyC,EAAA,OAAO,EAAC;AAAjD,GACC,cAAC,IAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADD;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,iBAAiB,GAAG,CAAE;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAF,KAA4B;AACrD,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AACC,IAAA,SAAS,EAAI,GAAGA,SAAW,iDAD5B;AAEC,IAAA,KAAK,EAAGD;AAFT,KAIC,cAAC,oBAAD,OAJD,CADD,CADD;AAUA,CAXD;AAaA;AACA;AACA;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tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\nimport deprecated from '@wordpress/deprecated';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"https://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent =\n\t( { TextColor, BackgroundColor } ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst openOnArrowDown = ( event ) => {\n\t\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\t\tevent.preventDefault();\n\t\t\t\tonToggle();\n\t\t\t}\n\t\t};\n\n\t\treturn (\n\t\t\t<ToolbarGroup>\n\t\t\t\t<ToolbarButton\n\t\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\t\tonClick={ onToggle }\n\t\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\t\ticon={\n\t\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t\t</BackgroundColor>\n\t\t\t\t\t}\n\t\t\t\t/>\n\t\t\t</ToolbarGroup>\n\t\t);\n\t};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => {\n\tdeprecated( `wp.blockEditor.BlockColorsStyleSelector`, {\n\t\talternative: 'block supports API',\n\t\tsince: '6.1',\n\t\tversion: '6.3',\n\t} );\n\n\treturn (\n\t\t<Dropdown\n\t\t\tpopoverProps={ { placement: 'bottom-start' } }\n\t\t\tclassName=\"block-library-colors-selector\"\n\t\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\t\trenderToggle={ renderToggleComponent( other ) }\n\t\t\trenderContent={ () => children }\n\t\t/>\n\t);\n};\n\nexport default BlockColorsStyleSelector;\n"]}
@@ -21,7 +21,7 @@ extend([namesPlugin, a11yPlugin]);
21
21
 
22
22
  export const getColorObjectByAttributeValues = (colors, definedColor, customColor) => {
23
23
  if (definedColor) {
24
- const colorObj = colors === null || colors === void 0 ? void 0 : colors.find(color => color.slug === definedColor);
24
+ const colorObj = colors?.find(color => color.slug === definedColor);
25
25
 
26
26
  if (colorObj) {
27
27
  return colorObj;
@@ -43,7 +43,7 @@ export const getColorObjectByAttributeValues = (colors, definedColor, customColo
43
43
  */
44
44
 
45
45
  export const getColorObjectByColorValue = (colors, colorValue) => {
46
- return colors === null || colors === void 0 ? void 0 : colors.find(color => color.color === colorValue);
46
+ return colors?.find(color => color.color === colorValue);
47
47
  };
48
48
  /**
49
49
  * Returns a class based on the context a color is being used and its slug.
@@ -74,12 +74,9 @@ export function getColorClassName(colorContextName, colorSlug) {
74
74
  export function getMostReadableColor(colors, colorValue) {
75
75
  const colordColor = colord(colorValue);
76
76
 
77
- const getColorContrast = _ref => {
78
- let {
79
- color
80
- } = _ref;
81
- return colordColor.contrast(color);
82
- };
77
+ const getColorContrast = ({
78
+ color
79
+ }) => colordColor.contrast(color);
83
80
 
84
81
  const maxContrast = Math.max(...colors.map(getColorContrast));
85
82
  return colors.find(color => getColorContrast(color) === maxContrast).color;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors/utils.js"],"names":["kebabCase","colord","extend","namesPlugin","a11yPlugin","getColorObjectByAttributeValues","colors","definedColor","customColor","colorObj","find","color","slug","getColorObjectByColorValue","colorValue","getColorClassName","colorContextName","colorSlug","undefined","getMostReadableColor","colordColor","getColorContrast","contrast","maxContrast","Math","max","map"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AACA,SAASC,MAAT,EAAiBC,MAAjB,QAA+B,QAA/B;AACA,OAAOC,WAAP,MAAwB,sBAAxB;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AAEAF,MAAM,CAAE,CAAEC,WAAF,EAAeC,UAAf,CAAF,CAAN;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,+BAA+B,GAAG,CAC9CC,MAD8C,EAE9CC,YAF8C,EAG9CC,WAH8C,KAI1C;AACJ,MAAKD,YAAL,EAAoB;AACnB,UAAME,QAAQ,GAAGH,MAAH,aAAGA,MAAH,uBAAGA,MAAM,CAAEI,IAAR,CACdC,KAAF,IAAaA,KAAK,CAACC,IAAN,KAAeL,YADZ,CAAjB;;AAIA,QAAKE,QAAL,EAAgB;AACf,aAAOA,QAAP;AACA;AACD;;AACD,SAAO;AACNE,IAAAA,KAAK,EAAEH;AADD,GAAP;AAGA,CAjBM;AAmBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMK,0BAA0B,GAAG,CAAEP,MAAF,EAAUQ,UAAV,KAA0B;AACnE,SAAOR,MAAP,aAAOA,MAAP,uBAAOA,MAAM,CAAEI,IAAR,CAAgBC,KAAF,IAAaA,KAAK,CAACA,KAAN,KAAgBG,UAA3C,CAAP;AACA,CAFM;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,iBAAT,CAA4BC,gBAA5B,EAA8CC,SAA9C,EAA0D;AAChE,MAAK,CAAED,gBAAF,IAAsB,CAAEC,SAA7B,EAAyC;AACxC,WAAOC,SAAP;AACA;;AAED,SAAQ,OAAOlB,SAAS,CAAEiB,SAAF,CAAe,IAAID,gBAAkB,EAA7D;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,oBAAT,CAA+Bb,MAA/B,EAAuCQ,UAAvC,EAAoD;AAC1D,QAAMM,WAAW,GAAGnB,MAAM,CAAEa,UAAF,CAA1B;;AACA,QAAMO,gBAAgB,GAAG;AAAA,QAAE;AAAEV,MAAAA;AAAF,KAAF;AAAA,WAAiBS,WAAW,CAACE,QAAZ,CAAsBX,KAAtB,CAAjB;AAAA,GAAzB;;AAEA,QAAMY,WAAW,GAAGC,IAAI,CAACC,GAAL,CAAU,GAAGnB,MAAM,CAACoB,GAAP,CAAYL,gBAAZ,CAAb,CAApB;AACA,SAAOf,MAAM,CAACI,IAAP,CAAeC,KAAF,IAAaU,gBAAgB,CAAEV,KAAF,CAAhB,KAA8BY,WAAxD,EACLZ,KADF;AAEA","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults,\n * and the values of the defined color or custom color returns a color object describing the color.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} definedColor A string containing the color slug.\n * @param {?string} customColor A string containing the customColor value.\n *\n * @return {?Object} If definedColor is passed and the name is found in colors,\n * the color object exactly as set by the theme or editor defaults is returned.\n * Otherwise, an object that just sets the color is defined.\n */\nexport const getColorObjectByAttributeValues = (\n\tcolors,\n\tdefinedColor,\n\tcustomColor\n) => {\n\tif ( definedColor ) {\n\t\tconst colorObj = colors?.find(\n\t\t\t( color ) => color.slug === definedColor\n\t\t);\n\n\t\tif ( colorObj ) {\n\t\t\treturn colorObj;\n\t\t}\n\t}\n\treturn {\n\t\tcolor: customColor,\n\t};\n};\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {?Object} Color object included in the colors array whose color property equals colorValue.\n * Returns undefined if no color object matches this requirement.\n */\nexport const getColorObjectByColorValue = ( colors, colorValue ) => {\n\treturn colors?.find( ( color ) => color.color === colorValue );\n};\n\n/**\n * Returns a class based on the context a color is being used and its slug.\n *\n * @param {string} colorContextName Context/place where color is being used e.g: background, text etc...\n * @param {string} colorSlug Slug of the color.\n *\n * @return {?string} String with the class corresponding to the color in the provided context.\n * Returns undefined if either colorContextName or colorSlug are not provided.\n */\nexport function getColorClassName( colorContextName, colorSlug ) {\n\tif ( ! colorContextName || ! colorSlug ) {\n\t\treturn undefined;\n\t}\n\n\treturn `has-${ kebabCase( colorSlug ) }-${ colorContextName }`;\n}\n\n/**\n * Given an array of color objects and a color value returns the color value of the most readable color in the array.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {string} String with the color value of the most readable color.\n */\nexport function getMostReadableColor( colors, colorValue ) {\n\tconst colordColor = colord( colorValue );\n\tconst getColorContrast = ( { color } ) => colordColor.contrast( color );\n\n\tconst maxContrast = Math.max( ...colors.map( getColorContrast ) );\n\treturn colors.find( ( color ) => getColorContrast( color ) === maxContrast )\n\t\t.color;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors/utils.js"],"names":["kebabCase","colord","extend","namesPlugin","a11yPlugin","getColorObjectByAttributeValues","colors","definedColor","customColor","colorObj","find","color","slug","getColorObjectByColorValue","colorValue","getColorClassName","colorContextName","colorSlug","undefined","getMostReadableColor","colordColor","getColorContrast","contrast","maxContrast","Math","max","map"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AACA,SAASC,MAAT,EAAiBC,MAAjB,QAA+B,QAA/B;AACA,OAAOC,WAAP,MAAwB,sBAAxB;AACA,OAAOC,UAAP,MAAuB,qBAAvB;AAEAF,MAAM,CAAE,CAAEC,WAAF,EAAeC,UAAf,CAAF,CAAN;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMC,+BAA+B,GAAG,CAC9CC,MAD8C,EAE9CC,YAF8C,EAG9CC,WAH8C,KAI1C;AACJ,MAAKD,YAAL,EAAoB;AACnB,UAAME,QAAQ,GAAGH,MAAM,EAAEI,IAAR,CACdC,KAAF,IAAaA,KAAK,CAACC,IAAN,KAAeL,YADZ,CAAjB;;AAIA,QAAKE,QAAL,EAAgB;AACf,aAAOA,QAAP;AACA;AACD;;AACD,SAAO;AACNE,IAAAA,KAAK,EAAEH;AADD,GAAP;AAGA,CAjBM;AAmBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,MAAMK,0BAA0B,GAAG,CAAEP,MAAF,EAAUQ,UAAV,KAA0B;AACnE,SAAOR,MAAM,EAAEI,IAAR,CAAgBC,KAAF,IAAaA,KAAK,CAACA,KAAN,KAAgBG,UAA3C,CAAP;AACA,CAFM;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASC,iBAAT,CAA4BC,gBAA5B,EAA8CC,SAA9C,EAA0D;AAChE,MAAK,CAAED,gBAAF,IAAsB,CAAEC,SAA7B,EAAyC;AACxC,WAAOC,SAAP;AACA;;AAED,SAAQ,OAAOlB,SAAS,CAAEiB,SAAF,CAAe,IAAID,gBAAkB,EAA7D;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,OAAO,SAASG,oBAAT,CAA+Bb,MAA/B,EAAuCQ,UAAvC,EAAoD;AAC1D,QAAMM,WAAW,GAAGnB,MAAM,CAAEa,UAAF,CAA1B;;AACA,QAAMO,gBAAgB,GAAG,CAAE;AAAEV,IAAAA;AAAF,GAAF,KAAiBS,WAAW,CAACE,QAAZ,CAAsBX,KAAtB,CAA1C;;AAEA,QAAMY,WAAW,GAAGC,IAAI,CAACC,GAAL,CAAU,GAAGnB,MAAM,CAACoB,GAAP,CAAYL,gBAAZ,CAAb,CAApB;AACA,SAAOf,MAAM,CAACI,IAAP,CAAeC,KAAF,IAAaU,gBAAgB,CAAEV,KAAF,CAAhB,KAA8BY,WAAxD,EACLZ,KADF;AAEA","sourcesContent":["/**\n * External dependencies\n */\nimport { kebabCase } from 'lodash';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults,\n * and the values of the defined color or custom color returns a color object describing the color.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} definedColor A string containing the color slug.\n * @param {?string} customColor A string containing the customColor value.\n *\n * @return {?Object} If definedColor is passed and the name is found in colors,\n * the color object exactly as set by the theme or editor defaults is returned.\n * Otherwise, an object that just sets the color is defined.\n */\nexport const getColorObjectByAttributeValues = (\n\tcolors,\n\tdefinedColor,\n\tcustomColor\n) => {\n\tif ( definedColor ) {\n\t\tconst colorObj = colors?.find(\n\t\t\t( color ) => color.slug === definedColor\n\t\t);\n\n\t\tif ( colorObj ) {\n\t\t\treturn colorObj;\n\t\t}\n\t}\n\treturn {\n\t\tcolor: customColor,\n\t};\n};\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {?Object} Color object included in the colors array whose color property equals colorValue.\n * Returns undefined if no color object matches this requirement.\n */\nexport const getColorObjectByColorValue = ( colors, colorValue ) => {\n\treturn colors?.find( ( color ) => color.color === colorValue );\n};\n\n/**\n * Returns a class based on the context a color is being used and its slug.\n *\n * @param {string} colorContextName Context/place where color is being used e.g: background, text etc...\n * @param {string} colorSlug Slug of the color.\n *\n * @return {?string} String with the class corresponding to the color in the provided context.\n * Returns undefined if either colorContextName or colorSlug are not provided.\n */\nexport function getColorClassName( colorContextName, colorSlug ) {\n\tif ( ! colorContextName || ! colorSlug ) {\n\t\treturn undefined;\n\t}\n\n\treturn `has-${ kebabCase( colorSlug ) }-${ colorContextName }`;\n}\n\n/**\n * Given an array of color objects and a color value returns the color value of the most readable color in the array.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {string} String with the color value of the most readable color.\n */\nexport function getMostReadableColor( colors, colorValue ) {\n\tconst colordColor = colord( colorValue );\n\tconst getColorContrast = ( { color } ) => colordColor.contrast( color );\n\n\tconst maxContrast = Math.max( ...colors.map( getColorContrast ) );\n\treturn colors.find( ( color ) => getColorContrast( color ) === maxContrast )\n\t\t.color;\n}\n"]}
@@ -25,10 +25,7 @@ import useSetting from '../use-setting';
25
25
  * @return {string} Capitalized string.
26
26
  */
27
27
 
28
- const upperFirst = _ref => {
29
- let [firstLetter, ...rest] = _ref;
30
- return firstLetter.toUpperCase() + rest.join('');
31
- };
28
+ const upperFirst = ([firstLetter, ...rest]) => firstLetter.toUpperCase() + rest.join('');
32
29
  /**
33
30
  * Higher order component factory for injecting the `colorsArray` argument as
34
31
  * the colors prop in the `withCustomColors` HOC.
@@ -118,16 +115,14 @@ function createColorHOC(colorTypes, withColorPalette) {
118
115
  };
119
116
  }
120
117
 
121
- static getDerivedStateFromProps(_ref2, previousState) {
122
- let {
123
- attributes,
124
- colors
125
- } = _ref2;
126
- return Object.entries(colorMap).reduce((newState, _ref3) => {
127
- let [colorAttributeName, colorContext] = _ref3;
118
+ static getDerivedStateFromProps({
119
+ attributes,
120
+ colors
121
+ }, previousState) {
122
+ return Object.entries(colorMap).reduce((newState, [colorAttributeName, colorContext]) => {
128
123
  const colorObject = getColorObjectByAttributeValues(colors, attributes[colorAttributeName], attributes[`custom${upperFirst(colorAttributeName)}`]);
129
124
  const previousColorObject = previousState[colorAttributeName];
130
- const previousColor = previousColorObject === null || previousColorObject === void 0 ? void 0 : previousColorObject.color;
125
+ const previousColor = previousColorObject?.color;
131
126
  /**
132
127
  * The "and previousColorObject" condition checks that a previous color object was already computed.
133
128
  * At the start previousColorObject and colorValue are both equal to undefined
@@ -182,13 +177,8 @@ function createColorHOC(colorTypes, withColorPalette) {
182
177
 
183
178
 
184
179
  export function createCustomColorsHOC(colorsArray) {
185
- return function () {
180
+ return (...colorTypes) => {
186
181
  const withColorPalette = withCustomColorPalette(colorsArray);
187
-
188
- for (var _len = arguments.length, colorTypes = new Array(_len), _key = 0; _key < _len; _key++) {
189
- colorTypes[_key] = arguments[_key];
190
- }
191
-
192
182
  return createHigherOrderComponent(createColorHOC(colorTypes, withColorPalette), 'withCustomColors');
193
183
  };
194
184
  }
@@ -217,13 +207,8 @@ export function createCustomColorsHOC(colorsArray) {
217
207
  * @return {Function} Higher-order component.
218
208
  */
219
209
 
220
- export default function withColors() {
210
+ export default function withColors(...colorTypes) {
221
211
  const withColorPalette = withEditorColorPalette();
222
-
223
- for (var _len2 = arguments.length, colorTypes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
224
- colorTypes[_key2] = arguments[_key2];
225
- }
226
-
227
212
  return createHigherOrderComponent(createColorHOC(colorTypes, withColorPalette), 'withColors');
228
213
  }
229
214
  //# sourceMappingURL=with-colors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"names":["kebabCase","useMemo","Component","compose","createHigherOrderComponent","getColorClassName","getColorObjectByColorValue","getColorObjectByAttributeValues","getMostReadableColor","useSetting","upperFirst","firstLetter","rest","toUpperCase","join","withCustomColorPalette","colorsArray","WrappedComponent","props","withEditorColorPalette","userPalette","themePalette","defaultPalette","allColors","createColorHOC","colorTypes","withColorPalette","colorMap","reduce","colorObject","colorType","constructor","setters","createSetters","colorUtils","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":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AAEA;AACA;AACA;;AACA,SAASC,OAAT,EAAkBC,SAAlB,QAAmC,oBAAnC;AACA,SAASC,OAAT,EAAkBC,0BAAlB,QAAoD,oBAApD;AAEA;AACA;AACA;;AACA,SACCC,iBADD,EAECC,0BAFD,EAGCC,+BAHD,EAICC,oBAJD,QAKO,SALP;AAMA,OAAOC,UAAP,MAAuB,gBAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,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;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,KAA/B;AAkHA,GArHc,CAAF,CAAd;AAuHA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAAS0B,qBAAT,CAAgC5C,WAAhC,EAA8C;AACpD,SAAO,YAAqB;AAC3B,UAAMU,gBAAgB,GAAGX,sBAAsB,CAAEC,WAAF,CAA/C;;AAD2B,sCAAhBS,UAAgB;AAAhBA,MAAAA,UAAgB;AAAA;;AAE3B,WAAOrB,0BAA0B,CAChCoB,cAAc,CAAEC,UAAF,EAAcC,gBAAd,CADkB,EAEhC,kBAFgC,CAAjC;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;;AACA,eAAe,SAASmC,UAAT,GAAqC;AACnD,QAAMnC,gBAAgB,GAAGP,sBAAsB,EAA/C;;AADmD,qCAAbM,UAAa;AAAbA,IAAAA,UAAa;AAAA;;AAEnD,SAAOrB,0BAA0B,CAChCoB,cAAc,CAAEC,UAAF,EAAcC,gBAAd,CADkB,EAEhC,YAFgC,CAAjC;AAIA","sourcesContent":["/**\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"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"names":["kebabCase","useMemo","Component","compose","createHigherOrderComponent","getColorClassName","getColorObjectByColorValue","getColorObjectByAttributeValues","getMostReadableColor","useSetting","upperFirst","firstLetter","rest","toUpperCase","join","withCustomColorPalette","colorsArray","WrappedComponent","props","withEditorColorPalette","userPalette","themePalette","defaultPalette","allColors","createColorHOC","colorTypes","withColorPalette","colorMap","reduce","colorObject","colorType","constructor","setters","createSetters","colorUtils","bind","state","colorValue","colors","Object","keys","settersAccumulator","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","attributes","previousState","entries","newState","colorContext","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,SAAT,QAA0B,QAA1B;AAEA;AACA;AACA;;AACA,SAASC,OAAT,EAAkBC,SAAlB,QAAmC,oBAAnC;AACA,SAASC,OAAT,EAAkBC,0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zB,WAAW,CAACkB,IAFW;AAFQ,aAAjC;AAOA;;AACD,iBAAOM,QAAP;AACA,SApCK,EAqCN,EArCM,CAAP;AAuCA;;AAEDM,MAAAA,MAAM,GAAG;AACR,eACC,cAAC,gBAAD,eAEK,KAAKzC,KAFV;AAGEoB,UAAAA,MAAM,EAAEU;AAHV,WAIK,KAAKZ,KAJV,EAKK,KAAKJ,OALV;AAMEE,UAAAA,UAAU,EAAE,KAAKA;AANnB,WADD;AAWA;;AAhH6B,KAA/B;AAkHA,GArHc,CAAF,CAAd;AAuHA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAAS0B,qBAAT,CAAgC5C,WAAhC,EAA8C;AACpD,SAAO,CAAE,GAAGS,UAAL,KAAqB;AAC3B,UAAMC,gBAAgB,GAAGX,sBAAsB,CAAEC,WAAF,CAA/C;AACA,WAAOZ,0BAA0B,CAChCoB,cAAc,CAAEC,UAAF,EAAcC,gBAAd,CADkB,EAEhC,kBAFgC,CAAjC;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;;AACA,eAAe,SAASmC,UAAT,CAAqB,GAAGpC,UAAxB,EAAqC;AACnD,QAAMC,gBAAgB,GAAGP,sBAAsB,EAA/C;AACA,SAAOf,0BAA0B,CAChCoB,cAAc,CAAEC,UAAF,EAAcC,gBAAd,CADkB,EAEhC,YAFgC,CAAjC;AAIA","sourcesContent":["/**\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"]}
@@ -5,7 +5,6 @@ import { createElement } from "@wordpress/element";
5
5
  * External dependencies
6
6
  */
7
7
  import classnames from 'classnames';
8
- import { isEmpty } from 'lodash';
9
8
  /**
10
9
  * WordPress dependencies
11
10
  */
@@ -29,26 +28,25 @@ const TAB_GRADIENT = {
29
28
  };
30
29
  const TABS_SETTINGS = [TAB_COLOR, TAB_GRADIENT];
31
30
 
32
- function ColorGradientControlInner(_ref) {
33
- let {
34
- colors,
35
- gradients,
36
- disableCustomColors,
37
- disableCustomGradients,
38
- __experimentalIsRenderedInSidebar,
39
- className,
40
- label,
41
- onColorChange,
42
- onGradientChange,
43
- colorValue,
44
- gradientValue,
45
- clearable,
46
- showTitle = true,
47
- enableAlpha,
48
- headingLevel
49
- } = _ref;
50
- const canChooseAColor = onColorChange && (!isEmpty(colors) || !disableCustomColors);
51
- const canChooseAGradient = onGradientChange && (!isEmpty(gradients) || !disableCustomGradients);
31
+ function ColorGradientControlInner({
32
+ colors,
33
+ gradients,
34
+ disableCustomColors,
35
+ disableCustomGradients,
36
+ __experimentalIsRenderedInSidebar,
37
+ className,
38
+ label,
39
+ onColorChange,
40
+ onGradientChange,
41
+ colorValue,
42
+ gradientValue,
43
+ clearable,
44
+ showTitle = true,
45
+ enableAlpha,
46
+ headingLevel
47
+ }) {
48
+ const canChooseAColor = onColorChange && (colors && colors.length > 0 || !disableCustomColors);
49
+ const canChooseAGradient = onGradientChange && (gradients && gradients.length > 0 || !disableCustomGradients);
52
50
 
53
51
  if (!canChooseAColor && !canChooseAGradient) {
54
52
  return null;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/control.js"],"names":["classnames","isEmpty","BaseControl","__experimentalVStack","VStack","TabPanel","ColorPalette","GradientPicker","useSetting","colorsAndGradientKeys","TAB_COLOR","name","title","value","TAB_GRADIENT","TABS_SETTINGS","ColorGradientControlInner","colors","gradients","disableCustomColors","disableCustomGradients","__experimentalIsRenderedInSidebar","className","label","onColorChange","onGradientChange","colorValue","gradientValue","clearable","showTitle","enableAlpha","headingLevel","canChooseAColor","canChooseAGradient","tabPanels","newColor","newGradient","renderPanelType","type","tab","ColorGradientControlSelect","props","colorGradientSettings","ColorGradientControl","every","key","hasOwnProperty"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,OAAT,QAAwB,QAAxB;AAEA;AACA;AACA;;AACA,SACCC,WADD,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,QAHD,EAICC,YAJD,EAKCC,cALD,QAMO,uBANP;AAQA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB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AAGC,IAAA,cAAc,EACbY,aAAa,GACVb,YAAY,CAACD,KADH,GAEV,CAAC,CAAEmB,eAAH,IAAsBtB,SAAS,CAACG;AANrC,KASK0B,GAAF,IAAWF,eAAe,CAAEE,GAAG,CAAC1B,KAAN,CAT7B,CAXF,EAuBG,CAAEoB,kBAAF,IACDI,eAAe,CAAE3B,SAAS,CAACG,KAAZ,CAxBjB,EAyBG,CAAEmB,eAAF,IACDK,eAAe,CAAEvB,YAAY,CAACD,KAAf,CA1BjB,CADD,CAPD,CADD;AAwCA;;AAED,SAAS2B,0BAAT,CAAqCC,KAArC,EAA6C;AAC5C,QAAMC,qBAAqB,GAAG,EAA9B;AACAA,EAAAA,qBAAqB,CAACzB,MAAtB,GAA+BT,UAAU,CAAE,eAAF,CAAzC;AACAkC,EAAAA,qBAAqB,CAACxB,SAAtB,GAAkCV,UAAU,CAAE,iBAAF,CAA5C;AACAkC,EAAAA,qBAAqB,CAACvB,mBAAtB,GAA4C,CAAEX,UAAU,CAAE,cAAF,CAAxD;AACAkC,EAAAA,qBAAqB,CAACtB,sBAAtB,GAA+C,CAAEZ,UAAU,CAC1D,sBAD0D,CAA3D;AAIA,SACC,cAAC,yBAAD,eACWkC,qBADX,EACqCD,KADrC,EADD;AAKA;;AAED,SAASE,oBAAT,CAA+BF,KAA/B,EAAuC;AACtC,MACChC,qBAAqB,CAACmC,KAAtB,CAA+BC,GAAF,IAAWJ,KAAK,CAACK,cAAN,CAAsBD,GAAtB,CAAxC,CADD,EAEE;AACD,WAAO,cAAC,yBAAD,EAAgCJ,KAAhC,CAAP;AACA;;AACD,SAAO,cAAC,0BAAD,EAAiCA,KAAjC,CAAP;AACA;;AAED,eAAeE,oBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\t__experimentalVStack as VStack,\n\tTabPanel,\n\tColorPalette,\n\tGradientPicker,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../use-setting';\n\nconst colorsAndGradientKeys = [\n\t'colors',\n\t'disableCustomColors',\n\t'gradients',\n\t'disableCustomGradients',\n];\n\nconst TAB_COLOR = {\n\tname: 'color',\n\ttitle: 'Solid',\n\tvalue: 'color',\n};\nconst TAB_GRADIENT = {\n\tname: 'gradient',\n\ttitle: 'Gradient',\n\tvalue: 'gradient',\n};\n\nconst TABS_SETTINGS = [ TAB_COLOR, TAB_GRADIENT ];\n\nfunction ColorGradientControlInner( {\n\tcolors,\n\tgradients,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\t__experimentalIsRenderedInSidebar,\n\tclassName,\n\tlabel,\n\tonColorChange,\n\tonGradientChange,\n\tcolorValue,\n\tgradientValue,\n\tclearable,\n\tshowTitle = true,\n\tenableAlpha,\n\theadingLevel,\n} ) {\n\tconst canChooseAColor =\n\t\tonColorChange && ( ! isEmpty( colors ) || ! disableCustomColors );\n\tconst canChooseAGradient =\n\t\tonGradientChange &&\n\t\t( ! isEmpty( gradients ) || ! disableCustomGradients );\n\n\tif ( ! canChooseAColor && ! canChooseAGradient ) {\n\t\treturn null;\n\t}\n\n\tconst tabPanels = {\n\t\t[ TAB_COLOR.value ]: (\n\t\t\t<ColorPalette\n\t\t\t\tvalue={ colorValue }\n\t\t\t\tonChange={\n\t\t\t\t\tcanChooseAGradient\n\t\t\t\t\t\t? ( newColor ) => {\n\t\t\t\t\t\t\t\tonColorChange( newColor );\n\t\t\t\t\t\t\t\tonGradientChange();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: onColorChange\n\t\t\t\t}\n\t\t\t\t{ ...{ colors, disableCustomColors } }\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tclearable={ clearable }\n\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t),\n\t\t[ TAB_GRADIENT.value ]: (\n\t\t\t<GradientPicker\n\t\t\t\t__nextHasNoMargin\n\t\t\t\tvalue={ gradientValue }\n\t\t\t\tonChange={\n\t\t\t\t\tcanChooseAColor\n\t\t\t\t\t\t? ( newGradient ) => {\n\t\t\t\t\t\t\t\tonGradientChange( newGradient );\n\t\t\t\t\t\t\t\tonColorChange();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: onGradientChange\n\t\t\t\t}\n\t\t\t\t{ ...{ gradients, disableCustomGradients } }\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tclearable={ clearable }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t),\n\t};\n\n\tconst renderPanelType = ( type ) => (\n\t\t<div className=\"block-editor-color-gradient-control__panel\">\n\t\t\t{ tabPanels[ type ] }\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-color-gradient-control',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t<fieldset className=\"block-editor-color-gradient-control__fieldset\">\n\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t{ showTitle && (\n\t\t\t\t\t\t<legend>\n\t\t\t\t\t\t\t<div className=\"block-editor-color-gradient-control__color-indicator\">\n\t\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</legend>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canChooseAColor && canChooseAGradient && (\n\t\t\t\t\t\t<TabPanel\n\t\t\t\t\t\t\tclassName=\"block-editor-color-gradient-control__tabs\"\n\t\t\t\t\t\t\ttabs={ TABS_SETTINGS }\n\t\t\t\t\t\t\tinitialTabName={\n\t\t\t\t\t\t\t\tgradientValue\n\t\t\t\t\t\t\t\t\t? TAB_GRADIENT.value\n\t\t\t\t\t\t\t\t\t: !! canChooseAColor && TAB_COLOR.value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ ( tab ) => renderPanelType( tab.value ) }\n\t\t\t\t\t\t</TabPanel>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! canChooseAGradient &&\n\t\t\t\t\t\trenderPanelType( TAB_COLOR.value ) }\n\t\t\t\t\t{ ! canChooseAColor &&\n\t\t\t\t\t\trenderPanelType( TAB_GRADIENT.value ) }\n\t\t\t\t</VStack>\n\t\t\t</fieldset>\n\t\t</BaseControl>\n\t);\n}\n\nfunction ColorGradientControlSelect( props ) {\n\tconst colorGradientSettings = {};\n\tcolorGradientSettings.colors = useSetting( 'color.palette' );\n\tcolorGradientSettings.gradients = useSetting( 'color.gradients' );\n\tcolorGradientSettings.disableCustomColors = ! useSetting( 'color.custom' );\n\tcolorGradientSettings.disableCustomGradients = ! useSetting(\n\t\t'color.customGradient'\n\t);\n\n\treturn (\n\t\t<ColorGradientControlInner\n\t\t\t{ ...{ ...colorGradientSettings, ...props } }\n\t\t/>\n\t);\n}\n\nfunction ColorGradientControl( props ) {\n\tif (\n\t\tcolorsAndGradientKeys.every( ( key ) => props.hasOwnProperty( key ) )\n\t) {\n\t\treturn <ColorGradientControlInner { ...props } />;\n\t}\n\treturn <ColorGradientControlSelect { ...props } />;\n}\n\nexport default ColorGradientControl;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/control.js"],"names":["classnames","BaseControl","__experimentalVStack","VStack","TabPanel","ColorPalette","GradientPicker","useSetting","colorsAndGradientKeys","TAB_COLOR","name","title","value","TAB_GRADIENT","TABS_SETTINGS","ColorGradientControlInner","colors","gradients","disableCustomColors","disableCustomGradients","__experimentalIsRenderedInSidebar","className","label","onColorChange","onGradientChange","colorValue","gradientValue","clearable","showTitle","enableAlpha","headingLevel","canChooseAColor","length","canChooseAGradient","tabPanels","newColor","newGradient","renderPanelType","type","tab","ColorGradientControlSelect","props","colorGradientSettings","ColorGradientControl","every","key","hasOwnProperty"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,WADD,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,QAHD,EAICC,YAJD,EAKCC,cALD,QAMO,uBANP;AAQA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AAEA,MAAMC,qBAAqB,GAAG,CAC7B,QAD6B,EAE7B,qBAF6B,EAG7B,WAH6B,EAI7B,wBAJ6B,CAA9B;AAOA,MAAMC,SAAS,GAAG;AACjBC,EAAAA,IAAI,EAAE,OADW;AAEjBC,EAAAA,KAAK,EAAE,OAFU;AAGjBC,EAAAA,KAAK,EAAE;AAHU,CAAlB;AAKA,MAAMC,YAAY,GAAG;AACpBH,EAAAA,IAAI,EAAE,UADc;AAEpBC,EAAAA,KAAK,EAAE,UAFa;AAGpBC,EAAAA,KAAK,EAAE;AAHa,CAArB;AAMA,MAAME,aAAa,GAAG,CAAEL,SAAF,EAAaI,YAAb,CAAtB;;AAEA,SAASE,yBAAT,CAAoC;AACnCC,EAAAA,MADmC;AAEnCC,EAAAA,SAFmC;AAGnCC,EAAAA,mBAHmC;AAInCC,EAAAA,sBAJmC;AAKnCC,EAAAA,iCALmC;AAMnCC,EAAAA,SANmC;AAOnCC,EAAAA,KAPmC;AAQnCC,EAAAA,aARmC;AASnCC,EAAAA,gBATmC;AAUnCC,EAAAA,UAVmC;AAWnCC,EAAAA,aAXmC;AAYnCC,EAAAA,SAZmC;AAanCC,EAAAA,SAAS,GAAG,IAbuB;AAcnCC,EAAAA,WAdmC;AAenCC,EAAAA;AAfmC,CAApC,EAgBI;AACH,QAAMC,eAAe,GACpBR,aAAa,KACTP,MAAM,IAAIA,MAAM,CAACgB,MAAP,GAAgB,CAA5B,IAAmC,CAAEd,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ACK,cAAN,CAAsBD,GAAtB,CAAxC,CADD,EAEE;AACD,WAAO,cAAC,yBAAD,EAAgCJ,KAAhC,CAAP;AACA;;AACD,SAAO,cAAC,0BAAD,EAAiCA,KAAjC,CAAP;AACA;;AAED,eAAeE,oBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tBaseControl,\n\t__experimentalVStack as VStack,\n\tTabPanel,\n\tColorPalette,\n\tGradientPicker,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport useSetting from '../use-setting';\n\nconst colorsAndGradientKeys = [\n\t'colors',\n\t'disableCustomColors',\n\t'gradients',\n\t'disableCustomGradients',\n];\n\nconst TAB_COLOR = {\n\tname: 'color',\n\ttitle: 'Solid',\n\tvalue: 'color',\n};\nconst TAB_GRADIENT = {\n\tname: 'gradient',\n\ttitle: 'Gradient',\n\tvalue: 'gradient',\n};\n\nconst TABS_SETTINGS = [ TAB_COLOR, TAB_GRADIENT ];\n\nfunction ColorGradientControlInner( {\n\tcolors,\n\tgradients,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\t__experimentalIsRenderedInSidebar,\n\tclassName,\n\tlabel,\n\tonColorChange,\n\tonGradientChange,\n\tcolorValue,\n\tgradientValue,\n\tclearable,\n\tshowTitle = true,\n\tenableAlpha,\n\theadingLevel,\n} ) {\n\tconst canChooseAColor =\n\t\tonColorChange &&\n\t\t( ( colors && colors.length > 0 ) || ! disableCustomColors );\n\tconst canChooseAGradient =\n\t\tonGradientChange &&\n\t\t( ( gradients && gradients.length > 0 ) || ! disableCustomGradients );\n\n\tif ( ! canChooseAColor && ! canChooseAGradient ) {\n\t\treturn null;\n\t}\n\n\tconst tabPanels = {\n\t\t[ TAB_COLOR.value ]: (\n\t\t\t<ColorPalette\n\t\t\t\tvalue={ colorValue }\n\t\t\t\tonChange={\n\t\t\t\t\tcanChooseAGradient\n\t\t\t\t\t\t? ( newColor ) => {\n\t\t\t\t\t\t\t\tonColorChange( newColor );\n\t\t\t\t\t\t\t\tonGradientChange();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: onColorChange\n\t\t\t\t}\n\t\t\t\t{ ...{ colors, disableCustomColors } }\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tclearable={ clearable }\n\t\t\t\tenableAlpha={ enableAlpha }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t),\n\t\t[ TAB_GRADIENT.value ]: (\n\t\t\t<GradientPicker\n\t\t\t\t__nextHasNoMargin\n\t\t\t\tvalue={ gradientValue }\n\t\t\t\tonChange={\n\t\t\t\t\tcanChooseAColor\n\t\t\t\t\t\t? ( newGradient ) => {\n\t\t\t\t\t\t\t\tonGradientChange( newGradient );\n\t\t\t\t\t\t\t\tonColorChange();\n\t\t\t\t\t\t }\n\t\t\t\t\t\t: onGradientChange\n\t\t\t\t}\n\t\t\t\t{ ...{ gradients, disableCustomGradients } }\n\t\t\t\t__experimentalIsRenderedInSidebar={\n\t\t\t\t\t__experimentalIsRenderedInSidebar\n\t\t\t\t}\n\t\t\t\tclearable={ clearable }\n\t\t\t\theadingLevel={ headingLevel }\n\t\t\t/>\n\t\t),\n\t};\n\n\tconst renderPanelType = ( type ) => (\n\t\t<div className=\"block-editor-color-gradient-control__panel\">\n\t\t\t{ tabPanels[ type ] }\n\t\t</div>\n\t);\n\n\treturn (\n\t\t<BaseControl\n\t\t\t__nextHasNoMarginBottom\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-color-gradient-control',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t>\n\t\t\t<fieldset className=\"block-editor-color-gradient-control__fieldset\">\n\t\t\t\t<VStack spacing={ 1 }>\n\t\t\t\t\t{ showTitle && (\n\t\t\t\t\t\t<legend>\n\t\t\t\t\t\t\t<div className=\"block-editor-color-gradient-control__color-indicator\">\n\t\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t\t{ label }\n\t\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</legend>\n\t\t\t\t\t) }\n\t\t\t\t\t{ canChooseAColor && canChooseAGradient && (\n\t\t\t\t\t\t<TabPanel\n\t\t\t\t\t\t\tclassName=\"block-editor-color-gradient-control__tabs\"\n\t\t\t\t\t\t\ttabs={ TABS_SETTINGS }\n\t\t\t\t\t\t\tinitialTabName={\n\t\t\t\t\t\t\t\tgradientValue\n\t\t\t\t\t\t\t\t\t? TAB_GRADIENT.value\n\t\t\t\t\t\t\t\t\t: !! canChooseAColor && TAB_COLOR.value\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t{ ( tab ) => renderPanelType( tab.value ) }\n\t\t\t\t\t\t</TabPanel>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ! canChooseAGradient &&\n\t\t\t\t\t\trenderPanelType( TAB_COLOR.value ) }\n\t\t\t\t\t{ ! canChooseAColor &&\n\t\t\t\t\t\trenderPanelType( TAB_GRADIENT.value ) }\n\t\t\t\t</VStack>\n\t\t\t</fieldset>\n\t\t</BaseControl>\n\t);\n}\n\nfunction ColorGradientControlSelect( props ) {\n\tconst colorGradientSettings = {};\n\tcolorGradientSettings.colors = useSetting( 'color.palette' );\n\tcolorGradientSettings.gradients = useSetting( 'color.gradients' );\n\tcolorGradientSettings.disableCustomColors = ! useSetting( 'color.custom' );\n\tcolorGradientSettings.disableCustomGradients = ! useSetting(\n\t\t'color.customGradient'\n\t);\n\n\treturn (\n\t\t<ColorGradientControlInner\n\t\t\t{ ...{ ...colorGradientSettings, ...props } }\n\t\t/>\n\t);\n}\n\nfunction ColorGradientControl( props ) {\n\tif (\n\t\tcolorsAndGradientKeys.every( ( key ) => props.hasOwnProperty( key ) )\n\t) {\n\t\treturn <ColorGradientControlInner { ...props } />;\n\t}\n\treturn <ColorGradientControlSelect { ...props } />;\n}\n\nexport default ColorGradientControl;\n"]}
@@ -17,14 +17,12 @@ import { Button, ColorIndicator, Dropdown, FlexItem, __experimentalDropdownConte
17
17
  import ColorGradientControl from './control'; // When the `ColorGradientSettingsDropdown` controls are being rendered to a
18
18
  // `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.
19
19
 
20
- const WithToolsPanelItem = _ref => {
21
- let {
22
- setting,
23
- children,
24
- panelId,
25
- ...props
26
- } = _ref;
27
-
20
+ const WithToolsPanelItem = ({
21
+ setting,
22
+ children,
23
+ panelId,
24
+ ...props
25
+ }) => {
28
26
  const clearValue = () => {
29
27
  if (setting.colorValue) {
30
28
  setting.onColorChange();
@@ -49,30 +47,26 @@ const WithToolsPanelItem = _ref => {
49
47
  }), children);
50
48
  };
51
49
 
52
- const LabeledColorIndicator = _ref2 => {
53
- let {
54
- colorValue,
55
- label
56
- } = _ref2;
57
- return createElement(HStack, {
58
- justify: "flex-start"
59
- }, createElement(ColorIndicator, {
60
- className: "block-editor-panel-color-gradient-settings__color-indicator",
61
- colorValue: colorValue
62
- }), createElement(FlexItem, {
63
- className: "block-editor-panel-color-gradient-settings__color-name",
64
- title: label
65
- }, label));
66
- }; // Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`
50
+ const LabeledColorIndicator = ({
51
+ colorValue,
52
+ label
53
+ }) => createElement(HStack, {
54
+ justify: "flex-start"
55
+ }, createElement(ColorIndicator, {
56
+ className: "block-editor-panel-color-gradient-settings__color-indicator",
57
+ colorValue: colorValue
58
+ }), createElement(FlexItem, {
59
+ className: "block-editor-panel-color-gradient-settings__color-name",
60
+ title: label
61
+ }, label)); // Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`
67
62
  // or as a `Button` if it isn't e.g. the controls are being rendered in
68
63
  // a `ToolsPanel`.
69
64
 
70
65
 
71
- const renderToggle = settings => _ref3 => {
72
- let {
73
- onToggle,
74
- isOpen
75
- } = _ref3;
66
+ const renderToggle = settings => ({
67
+ onToggle,
68
+ isOpen
69
+ }) => {
76
70
  const {
77
71
  colorValue,
78
72
  label
@@ -97,17 +91,16 @@ const renderToggle = settings => _ref3 => {
97
91
  // For more context see: https://github.com/WordPress/gutenberg/pull/40084
98
92
 
99
93
 
100
- export default function ColorGradientSettingsDropdown(_ref4) {
101
- let {
102
- colors,
103
- disableCustomColors,
104
- disableCustomGradients,
105
- enableAlpha,
106
- gradients,
107
- settings,
108
- __experimentalIsRenderedInSidebar,
109
- ...props
110
- } = _ref4;
94
+ export default function ColorGradientSettingsDropdown({
95
+ colors,
96
+ disableCustomColors,
97
+ disableCustomGradients,
98
+ enableAlpha,
99
+ gradients,
100
+ settings,
101
+ __experimentalIsRenderedInSidebar,
102
+ ...props
103
+ }) {
111
104
  let popoverProps;
112
105
 
113
106
  if (__experimentalIsRenderedInSidebar) {
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/dropdown.js"],"names":["classnames","Button","ColorIndicator","Dropdown","FlexItem","__experimentalDropdownContentWrapper","DropdownContentWrapper","__experimentalHStack","HStack","__experimentalToolsPanelItem","ToolsPanelItem","ColorGradientControl","WithToolsPanelItem","setting","children","panelId","props","clearValue","colorValue","onColorChange","gradientValue","onGradientChange","label","isShownByDefault","undefined","resetAllFilter","LabeledColorIndicator","renderToggle","settings","onToggle","isOpen","toggleProps","onClick","className","ColorGradientSettingsDropdown","colors","disableCustomColors","disableCustomGradients","enableAlpha","gradients","__experimentalIsRenderedInSidebar","popoverProps","placement","offset","shift","map","index","controlProps","clearable","showTitle","toggleSettings"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,MADD,EAECC,cAFD,EAGCC,QAHD,EAICC,QAJD,EAKCC,oCAAoC,IAAIC,sBALzC,EAMCC,oBAAoB,IAAIC,MANzB,EAOCC,4BAA4B,IAAIC,cAPjC,QAQO,uBARP;AAUA;AACA;AACA;;AACA,OAAOC,oBA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lB,MAAAA,aAAa,EAAEP,OAAO,CAACO,aAPH;AAQpBmB,MAAAA,SARoB;AASpBjB,MAAAA,KAAK,EAAET,OAAO,CAACS,KATK;AAUpBH,MAAAA,aAAa,EAAEN,OAAO,CAACM,aAVH;AAWpBE,MAAAA,gBAAgB,EAAER,OAAO,CAACQ,gBAXN;AAYpB4B,MAAAA,SAAS,EAAE,KAZS;AAapBT,MAAAA,iCAboB;AAcpB,SAAG3B;AAdiB,KAArB;AAgBA,UAAMqC,cAAc,GAAG;AACtBhC,MAAAA,UAAU,2BAAEL,OAAO,CAACO,aAAV,yEAA2BP,OAAO,CAACK,UADvB;AAEtBI,MAAAA,KAAK,EAAET,OAAO,CAACS;AAFO,KAAvB;AAKA,WACCT,OAAO,IACN;AACA;AACA,kBAAC,kBAAD;AACC,MAAA,GAAG,EAAGiC,KADP;AAEC,MAAA,OAAO,EAAGjC;AAFX,OAGMG,KAHN,GAKC,cAAC,QAAD;AACC,MAAA,YAAY,EAAGyB,YADhB;AAEC,MAAA,SAAS,EAAC,4DAFX;AAGC,MAAA,YAAY,EAAGd,YAAY,CAAEuB,cAAF,CAH5B;AAIC,MAAA,aAAa,EAAG,MACf,cAAC,sBAAD;AAAwB,QAAA,WAAW,EAAC;AAApC,SACC;AAAK,QAAA,SAAS,EAAC;AAAf,SACC,cAAC,oBAAD,EACMH,YADN,CADD,CADD;AALF,MALD,CAJF;AA0BA,GAhDC,CADH,CADD;AAqDA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tColorIndicator,\n\tDropdown,\n\tFlexItem,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\t__experimentalHStack as HStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from './control';\n\n// When the `ColorGradientSettingsDropdown` controls are being rendered to a\n// `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.\nconst WithToolsPanelItem = ( { setting, children, panelId, ...props } ) => {\n\tconst clearValue = () => {\n\t\tif ( setting.colorValue ) {\n\t\t\tsetting.onColorChange();\n\t\t} else if ( setting.gradientValue ) {\n\t\t\tsetting.onGradientChange();\n\t\t}\n\t};\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => {\n\t\t\t\treturn !! setting.colorValue || !! setting.gradientValue;\n\t\t\t} }\n\t\t\tlabel={ setting.label }\n\t\t\tonDeselect={ clearValue }\n\t\t\tisShownByDefault={\n\t\t\t\tsetting.isShownByDefault !== undefined\n\t\t\t\t\t? setting.isShownByDefault\n\t\t\t\t\t: true\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\tpanelId={ panelId }\n\t\t\t// Pass resetAllFilter if supplied due to rendering via SlotFill\n\t\t\t// into parent ToolsPanel.\n\t\t\tresetAllFilter={ setting.resetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanelItem>\n\t);\n};\n\nconst LabeledColorIndicator = ( { colorValue, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ColorIndicator\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-indicator\"\n\t\t\tcolorValue={ colorValue }\n\t\t/>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-name\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\n// Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`\n// or as a `Button` if it isn't e.g. the controls are being rendered in\n// a `ToolsPanel`.\nconst renderToggle =\n\t( settings ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst { colorValue, label } = settings;\n\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: classnames(\n\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t{ 'is-open': isOpen }\n\t\t\t),\n\t\t\t'aria-expanded': isOpen,\n\t\t};\n\n\t\treturn (\n\t\t\t<Button { ...toggleProps }>\n\t\t\t\t<LabeledColorIndicator\n\t\t\t\t\tcolorValue={ colorValue }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t/>\n\t\t\t</Button>\n\t\t);\n\t};\n\n// Renders a collection of color controls as dropdowns. Depending upon the\n// context in which these dropdowns are being rendered, they may be wrapped\n// in an `ItemGroup` with each dropdown's toggle as an `Item`, or alternatively,\n// the may be individually wrapped in a `ToolsPanelItem` with the toggle as\n// a regular `Button`.\n//\n// For more context see: https://github.com/WordPress/gutenberg/pull/40084\nexport default function ColorGradientSettingsDropdown( {\n\tcolors,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\tenableAlpha,\n\tgradients,\n\tsettings,\n\t__experimentalIsRenderedInSidebar,\n\t...props\n} ) {\n\tlet popoverProps;\n\tif ( __experimentalIsRenderedInSidebar ) {\n\t\tpopoverProps = {\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t};\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ settings.map( ( setting, index ) => {\n\t\t\t\tconst controlProps = {\n\t\t\t\t\tclearable: false,\n\t\t\t\t\tcolorValue: setting.colorValue,\n\t\t\t\t\tcolors,\n\t\t\t\t\tdisableCustomColors,\n\t\t\t\t\tdisableCustomGradients,\n\t\t\t\t\tenableAlpha,\n\t\t\t\t\tgradientValue: setting.gradientValue,\n\t\t\t\t\tgradients,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t\tonColorChange: setting.onColorChange,\n\t\t\t\t\tonGradientChange: setting.onGradientChange,\n\t\t\t\t\tshowTitle: false,\n\t\t\t\t\t__experimentalIsRenderedInSidebar,\n\t\t\t\t\t...setting,\n\t\t\t\t};\n\t\t\t\tconst toggleSettings = {\n\t\t\t\t\tcolorValue: setting.gradientValue ?? setting.colorValue,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t};\n\n\t\t\t\treturn (\n\t\t\t\t\tsetting && (\n\t\t\t\t\t\t// If not in an `ItemGroup` wrap the dropdown in a\n\t\t\t\t\t\t// `ToolsPanelItem`\n\t\t\t\t\t\t<WithToolsPanelItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tsetting={ setting }\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__dropdown\"\n\t\t\t\t\t\t\t\trenderToggle={ renderToggle( toggleSettings ) }\n\t\t\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-panel-color-gradient-settings__dropdown-content\">\n\t\t\t\t\t\t\t\t\t\t\t<ColorGradientControl\n\t\t\t\t\t\t\t\t\t\t\t\t{ ...controlProps }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</WithToolsPanelItem>\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/dropdown.js"],"names":["classnames","Button","ColorIndicator","Dropdown","FlexItem","__experimentalDropdownContentWrapper","DropdownContentWrapper","__experimentalHStack","HStack","__experimentalToolsPanelItem","ToolsPanelItem","ColorGradientControl","WithToolsPanelItem","setting","children","panelId","props","clearValue","colorValue","onColorChange","gradientValue","onGradientChange","label","isShownByDefault","undefined","resetAllFilter","LabeledColorIndicator","renderToggle","settings","onToggle","isOpen","toggleProps","onClick","className","ColorGradientSettingsDropdown","colors","disableCustomColors","disableCustomGradients","enableAlpha","gradients","__experimentalIsRenderedInSidebar","popoverProps","placement","offset","shift","map","index","controlProps","clearable","showTitle","toggleSettings"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SACCC,MADD,EAECC,cAFD,EAGCC,QAHD,EAICC,QAJD,EAKCC,oCAAoC,IAAIC,sBALzC,EAMCC,oBAAoB,IAAIC,MANzB,EAOCC,4BAA4B,IAAIC,cAPjC,QAQO,uBARP;AAUA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,WAAjC,C,CAEA;AACA;;AACA,MAAMC,kBAAkB,GAAG,CAAE;AAAEC,EAAAA,OAAF;AAAWC,EAAAA,QAAX;AAAqBC,EAAAA,OAArB;AAA8B,KAAGC;AAAjC,CAAF,KAAgD;AAC1E,QAAMC,UAAU,GAAG,MAAM;AACxB,QAAKJ,OAAO,CAACK,UAAb,EAA0B;AACzBL,MAAAA,OAAO,CAACM,aAAR;AACA,KAFD,MAEO,IAAKN,OAAO,CAACO,aAAb,EAA6B;AACnCP,MAAAA,OAAO,CAACQ,gBAAR;AACA;AACD,GAND;;AAOA,SACC,cAAC,cAAD;AACC,IAAA,QAAQ,EAAG,MAAM;AAChB,aAAO,CAAC,CAAER,OAAO,CAACK,UAAX,IAAyB,CAAC,CAAEL,OAAO,CAACO,aAA3C;AACA,KAHF;AAIC,IAAA,KAAK,EAAGP,OAAO,CAACS,KAJjB;AAKC,IAAA,UAAU,EAAGL,UALd;AAMC,IAAA,gBAAgB,EACfJ,OAAO,CAACU,gBAAR,KAA6BC,SAA7B,GACGX,OAAO,CAACU,gBADX,GAEG;AATL,KAWMP,KAXN;AAYC,IAAA,SAAS,EAAC,wDAZX;AAaC,IAAA,OAAO,EAAGD,OAbX,CAcC;AACA;AAfD;AAgBC,IAAA,cAAc,EAAGF,OAAO,CAACY;AAhB1B,MAkBGX,QAlBH,CADD;AAsBA,C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esContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\tButton,\n\tColorIndicator,\n\tDropdown,\n\tFlexItem,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\t__experimentalHStack as HStack,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from './control';\n\n// When the `ColorGradientSettingsDropdown` controls are being rendered to a\n// `ToolsPanel` they must be wrapped in a `ToolsPanelItem`.\nconst WithToolsPanelItem = ( { setting, children, panelId, ...props } ) => {\n\tconst clearValue = () => {\n\t\tif ( setting.colorValue ) {\n\t\t\tsetting.onColorChange();\n\t\t} else if ( setting.gradientValue ) {\n\t\t\tsetting.onGradientChange();\n\t\t}\n\t};\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\thasValue={ () => {\n\t\t\t\treturn !! setting.colorValue || !! setting.gradientValue;\n\t\t\t} }\n\t\t\tlabel={ setting.label }\n\t\t\tonDeselect={ clearValue }\n\t\t\tisShownByDefault={\n\t\t\t\tsetting.isShownByDefault !== undefined\n\t\t\t\t\t? setting.isShownByDefault\n\t\t\t\t\t: true\n\t\t\t}\n\t\t\t{ ...props }\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\tpanelId={ panelId }\n\t\t\t// Pass resetAllFilter if supplied due to rendering via SlotFill\n\t\t\t// into parent ToolsPanel.\n\t\t\tresetAllFilter={ setting.resetAllFilter }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanelItem>\n\t);\n};\n\nconst LabeledColorIndicator = ( { colorValue, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ColorIndicator\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-indicator\"\n\t\t\tcolorValue={ colorValue }\n\t\t/>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-name\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\n// Renders a color dropdown's toggle as an `Item` if it is within an `ItemGroup`\n// or as a `Button` if it isn't e.g. the controls are being rendered in\n// a `ToolsPanel`.\nconst renderToggle =\n\t( settings ) =>\n\t( { onToggle, isOpen } ) => {\n\t\tconst { colorValue, label } = settings;\n\n\t\tconst toggleProps = {\n\t\t\tonClick: onToggle,\n\t\t\tclassName: classnames(\n\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t{ 'is-open': isOpen }\n\t\t\t),\n\t\t\t'aria-expanded': isOpen,\n\t\t};\n\n\t\treturn (\n\t\t\t<Button { ...toggleProps }>\n\t\t\t\t<LabeledColorIndicator\n\t\t\t\t\tcolorValue={ colorValue }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t/>\n\t\t\t</Button>\n\t\t);\n\t};\n\n// Renders a collection of color controls as dropdowns. Depending upon the\n// context in which these dropdowns are being rendered, they may be wrapped\n// in an `ItemGroup` with each dropdown's toggle as an `Item`, or alternatively,\n// the may be individually wrapped in a `ToolsPanelItem` with the toggle as\n// a regular `Button`.\n//\n// For more context see: https://github.com/WordPress/gutenberg/pull/40084\nexport default function ColorGradientSettingsDropdown( {\n\tcolors,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\tenableAlpha,\n\tgradients,\n\tsettings,\n\t__experimentalIsRenderedInSidebar,\n\t...props\n} ) {\n\tlet popoverProps;\n\tif ( __experimentalIsRenderedInSidebar ) {\n\t\tpopoverProps = {\n\t\t\tplacement: 'left-start',\n\t\t\toffset: 36,\n\t\t\tshift: true,\n\t\t};\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ settings.map( ( setting, index ) => {\n\t\t\t\tconst controlProps = {\n\t\t\t\t\tclearable: false,\n\t\t\t\t\tcolorValue: setting.colorValue,\n\t\t\t\t\tcolors,\n\t\t\t\t\tdisableCustomColors,\n\t\t\t\t\tdisableCustomGradients,\n\t\t\t\t\tenableAlpha,\n\t\t\t\t\tgradientValue: setting.gradientValue,\n\t\t\t\t\tgradients,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t\tonColorChange: setting.onColorChange,\n\t\t\t\t\tonGradientChange: setting.onGradientChange,\n\t\t\t\t\tshowTitle: false,\n\t\t\t\t\t__experimentalIsRenderedInSidebar,\n\t\t\t\t\t...setting,\n\t\t\t\t};\n\t\t\t\tconst toggleSettings = {\n\t\t\t\t\tcolorValue: setting.gradientValue ?? setting.colorValue,\n\t\t\t\t\tlabel: setting.label,\n\t\t\t\t};\n\n\t\t\t\treturn (\n\t\t\t\t\tsetting && (\n\t\t\t\t\t\t// If not in an `ItemGroup` wrap the dropdown in a\n\t\t\t\t\t\t// `ToolsPanelItem`\n\t\t\t\t\t\t<WithToolsPanelItem\n\t\t\t\t\t\t\tkey={ index }\n\t\t\t\t\t\t\tsetting={ setting }\n\t\t\t\t\t\t\t{ ...props }\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<Dropdown\n\t\t\t\t\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\t\t\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__dropdown\"\n\t\t\t\t\t\t\t\trenderToggle={ renderToggle( toggleSettings ) }\n\t\t\t\t\t\t\t\trenderContent={ () => (\n\t\t\t\t\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t\t\t\t\t<div className=\"block-editor-panel-color-gradient-settings__dropdown-content\">\n\t\t\t\t\t\t\t\t\t\t\t<ColorGradientControl\n\t\t\t\t\t\t\t\t\t\t\t\t{ ...controlProps }\n\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</WithToolsPanelItem>\n\t\t\t\t\t)\n\t\t\t\t);\n\t\t\t} ) }\n\t\t</>\n\t);\n}\n"]}