@wordpress/block-editor 7.0.4 → 8.0.3

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 (1259) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/README.md +31 -0
  3. package/build/components/alignment-control/ui.js +12 -11
  4. package/build/components/alignment-control/ui.js.map +1 -1
  5. package/build/components/autocomplete/index.js +5 -4
  6. package/build/components/autocomplete/index.js.map +1 -1
  7. package/build/components/block-actions/index.js +12 -8
  8. package/build/components/block-actions/index.js.map +1 -1
  9. package/build/components/block-alignment-control/ui.js +21 -17
  10. package/build/components/block-alignment-control/ui.js.map +1 -1
  11. package/build/components/block-alignment-control/use-available-alignments.js +9 -4
  12. package/build/components/block-alignment-control/use-available-alignments.js.map +1 -1
  13. package/build/components/block-alignment-matrix-control/index.js +6 -4
  14. package/build/components/block-alignment-matrix-control/index.js.map +1 -1
  15. package/build/components/block-breadcrumb/index.js +4 -3
  16. package/build/components/block-breadcrumb/index.js.map +1 -1
  17. package/build/components/block-caption/index.native.js +34 -29
  18. package/build/components/block-caption/index.native.js.map +1 -1
  19. package/build/components/block-card/index.js +8 -6
  20. package/build/components/block-card/index.js.map +1 -1
  21. package/build/components/block-compare/block-view.js +9 -8
  22. package/build/components/block-compare/block-view.js.map +1 -1
  23. package/build/components/block-compare/index.js +9 -7
  24. package/build/components/block-compare/index.js.map +1 -1
  25. package/build/components/block-content-overlay/index.js +7 -6
  26. package/build/components/block-content-overlay/index.js.map +1 -1
  27. package/build/components/block-context/index.js +5 -4
  28. package/build/components/block-context/index.js.map +1 -1
  29. package/build/components/block-controls/fill.js +7 -6
  30. package/build/components/block-controls/fill.js.map +1 -1
  31. package/build/components/block-controls/slot.js +5 -4
  32. package/build/components/block-controls/slot.js.map +1 -1
  33. package/build/components/block-controls/slot.native.js +5 -4
  34. package/build/components/block-controls/slot.native.js.map +1 -1
  35. package/build/components/block-draggable/draggable-chip.js +5 -4
  36. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  37. package/build/components/block-draggable/index.js +13 -11
  38. package/build/components/block-draggable/index.js.map +1 -1
  39. package/build/components/block-edit/context.js +1 -1
  40. package/build/components/block-full-height-alignment-control/index.js +7 -6
  41. package/build/components/block-full-height-alignment-control/index.js.map +1 -1
  42. package/build/components/block-icon/index.js +12 -6
  43. package/build/components/block-icon/index.js.map +1 -1
  44. package/build/components/block-icon/index.native.js +8 -6
  45. package/build/components/block-icon/index.native.js.map +1 -1
  46. package/build/components/block-inspector/index.js +24 -15
  47. package/build/components/block-inspector/index.js.map +1 -1
  48. package/build/components/block-list/block-html.js +4 -3
  49. package/build/components/block-list/block-html.js.map +1 -1
  50. package/build/components/block-list/block-invalid-warning.js +28 -20
  51. package/build/components/block-list/block-invalid-warning.js.map +1 -1
  52. package/build/components/block-list/block-invalid-warning.native.js +5 -4
  53. package/build/components/block-list/block-invalid-warning.native.js.map +1 -1
  54. package/build/components/block-list/block-list-item.native.js +6 -5
  55. package/build/components/block-list/block-list-item.native.js.map +1 -1
  56. package/build/components/block-list/block-selection-button.native.js +11 -9
  57. package/build/components/block-list/block-selection-button.native.js.map +1 -1
  58. package/build/components/block-list/block.js +40 -33
  59. package/build/components/block-list/block.js.map +1 -1
  60. package/build/components/block-list/block.native.js +35 -29
  61. package/build/components/block-list/block.native.js.map +1 -1
  62. package/build/components/block-list/index.js +14 -12
  63. package/build/components/block-list/index.js.map +1 -1
  64. package/build/components/block-list/index.native.js +23 -18
  65. package/build/components/block-list/index.native.js.map +1 -1
  66. package/build/components/block-list/insertion-point.native.js +4 -3
  67. package/build/components/block-list/insertion-point.native.js.map +1 -1
  68. package/build/components/block-list/layout.js +8 -6
  69. package/build/components/block-list/layout.js.map +1 -1
  70. package/build/components/block-list/subdirectory-icon.js +13 -10
  71. package/build/components/block-list/subdirectory-icon.js.map +1 -1
  72. package/build/components/block-list/use-block-props/index.js +5 -3
  73. package/build/components/block-list/use-block-props/index.js.map +1 -1
  74. package/build/components/block-list/use-block-props/index.native.js +2 -1
  75. package/build/components/block-list/use-block-props/index.native.js.map +1 -1
  76. package/build/components/block-list/use-block-props/use-block-refs.js +2 -2
  77. package/build/components/block-list/use-block-props/use-multi-selection.js +30 -14
  78. package/build/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  79. package/build/components/block-list-appender/index.js +16 -13
  80. package/build/components/block-list-appender/index.js.map +1 -1
  81. package/build/components/block-list-appender/index.native.js +14 -11
  82. package/build/components/block-list-appender/index.native.js.map +1 -1
  83. package/build/components/block-media-update-progress/index.native.js +1 -1
  84. package/build/components/block-mobile-toolbar/block-actions-menu.native.js +46 -42
  85. package/build/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  86. package/build/components/block-mobile-toolbar/index.js +4 -3
  87. package/build/components/block-mobile-toolbar/index.js.map +1 -1
  88. package/build/components/block-mobile-toolbar/index.native.js +33 -25
  89. package/build/components/block-mobile-toolbar/index.native.js.map +1 -1
  90. package/build/components/block-mover/button.js +8 -7
  91. package/build/components/block-mover/button.js.map +1 -1
  92. package/build/components/block-mover/index.js +15 -13
  93. package/build/components/block-mover/index.js.map +1 -1
  94. package/build/components/block-mover/index.native.js +23 -20
  95. package/build/components/block-mover/index.native.js.map +1 -1
  96. package/build/components/block-mover/mover-description.native.js +10 -7
  97. package/build/components/block-mover/mover-description.native.js.map +1 -1
  98. package/build/components/block-navigation/dropdown.js +26 -22
  99. package/build/components/block-navigation/dropdown.js.map +1 -1
  100. package/build/components/block-pattern-setup/index.js +26 -22
  101. package/build/components/block-pattern-setup/index.js.map +1 -1
  102. package/build/components/block-pattern-setup/setup-toolbar.js +46 -39
  103. package/build/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  104. package/build/components/block-patterns-list/index.js +45 -47
  105. package/build/components/block-patterns-list/index.js.map +1 -1
  106. package/build/components/block-preview/auto.js +5 -4
  107. package/build/components/block-preview/auto.js.map +1 -1
  108. package/build/components/block-preview/index.js +8 -7
  109. package/build/components/block-preview/index.js.map +1 -1
  110. package/build/components/block-preview/live.js +4 -3
  111. package/build/components/block-preview/live.js.map +1 -1
  112. package/build/components/block-selection-clearer/index.js +1 -1
  113. package/build/components/block-settings/button.native.js +10 -7
  114. package/build/components/block-settings/button.native.js.map +1 -1
  115. package/build/components/block-settings/container.native.js +12 -8
  116. package/build/components/block-settings/container.native.js.map +1 -1
  117. package/build/components/block-settings/index.native.js +4 -2
  118. package/build/components/block-settings/index.native.js.map +1 -1
  119. package/build/components/block-settings-menu/block-convert-button.js +7 -5
  120. package/build/components/block-settings-menu/block-convert-button.js.map +1 -1
  121. package/build/components/block-settings-menu/block-html-convert-button.js +14 -10
  122. package/build/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  123. package/build/components/block-settings-menu/block-mode-toggle.js +25 -19
  124. package/build/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  125. package/build/components/block-settings-menu/block-settings-dropdown.js +96 -68
  126. package/build/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  127. package/build/components/block-settings-menu/index.js +5 -4
  128. package/build/components/block-settings-menu/index.js.map +1 -1
  129. package/build/components/block-settings-menu-controls/index.js +8 -6
  130. package/build/components/block-settings-menu-controls/index.js.map +1 -1
  131. package/build/components/block-styles/index.js +20 -17
  132. package/build/components/block-styles/index.js.map +1 -1
  133. package/build/components/block-styles/index.native.js +6 -4
  134. package/build/components/block-styles/index.native.js.map +1 -1
  135. package/build/components/block-styles/preview.native.js +9 -8
  136. package/build/components/block-styles/preview.native.js.map +1 -1
  137. package/build/components/block-switcher/block-styles-menu.js +5 -4
  138. package/build/components/block-switcher/block-styles-menu.js.map +1 -1
  139. package/build/components/block-switcher/block-transformations-menu.js +7 -6
  140. package/build/components/block-switcher/block-transformations-menu.js.map +1 -1
  141. package/build/components/block-switcher/block-transformations-menu.native.js +9 -8
  142. package/build/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  143. package/build/components/block-switcher/index.js +42 -34
  144. package/build/components/block-switcher/index.js.map +1 -1
  145. package/build/components/block-switcher/pattern-transformations-menu.js +22 -18
  146. package/build/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  147. package/build/components/block-switcher/preview-block-popover.js +4 -3
  148. package/build/components/block-switcher/preview-block-popover.js.map +1 -1
  149. package/build/components/block-switcher/use-transformed-patterns.js +1 -1
  150. package/build/components/block-switcher/utils.js +2 -1
  151. package/build/components/block-switcher/utils.js.map +1 -1
  152. package/build/components/block-title/index.js +4 -3
  153. package/build/components/block-title/index.js.map +1 -1
  154. package/build/components/block-toolbar/index.js +4 -3
  155. package/build/components/block-toolbar/index.js.map +1 -1
  156. package/build/components/block-toolbar/utils.js +13 -11
  157. package/build/components/block-toolbar/utils.js.map +1 -1
  158. package/build/components/block-tools/back-compat.js +8 -5
  159. package/build/components/block-tools/back-compat.js.map +1 -1
  160. package/build/components/block-tools/block-contextual-toolbar.js +6 -5
  161. package/build/components/block-tools/block-contextual-toolbar.js.map +1 -1
  162. package/build/components/block-tools/block-popover.js +15 -13
  163. package/build/components/block-tools/block-popover.js.map +1 -1
  164. package/build/components/block-tools/block-selection-button.js +6 -5
  165. package/build/components/block-tools/block-selection-button.js.map +1 -1
  166. package/build/components/block-tools/index.js +6 -5
  167. package/build/components/block-tools/index.js.map +1 -1
  168. package/build/components/block-tools/insertion-point.js +12 -10
  169. package/build/components/block-tools/insertion-point.js.map +1 -1
  170. package/build/components/block-types-list/index.js +9 -8
  171. package/build/components/block-types-list/index.js.map +1 -1
  172. package/build/components/block-types-list/index.native.js +19 -15
  173. package/build/components/block-types-list/index.native.js.map +1 -1
  174. package/build/components/block-variation-picker/index.js +9 -8
  175. package/build/components/block-variation-picker/index.js.map +1 -1
  176. package/build/components/block-variation-picker/index.native.js +9 -7
  177. package/build/components/block-variation-picker/index.native.js.map +1 -1
  178. package/build/components/block-variation-transforms/index.js +22 -15
  179. package/build/components/block-variation-transforms/index.js.map +1 -1
  180. package/build/components/block-vertical-alignment-control/ui.js +9 -7
  181. package/build/components/block-vertical-alignment-control/ui.js.map +1 -1
  182. package/build/components/border-radius-control/all-input-control.js +6 -5
  183. package/build/components/border-radius-control/all-input-control.js.map +1 -1
  184. package/build/components/border-radius-control/index.js +5 -4
  185. package/build/components/border-radius-control/index.js.map +1 -1
  186. package/build/components/border-radius-control/input-controls.js +16 -11
  187. package/build/components/border-radius-control/input-controls.js.map +1 -1
  188. package/build/components/border-radius-control/linked-button.js +5 -4
  189. package/build/components/border-radius-control/linked-button.js.map +1 -1
  190. package/build/components/border-radius-control/utils.js +10 -5
  191. package/build/components/border-radius-control/utils.js.map +1 -1
  192. package/build/components/border-style-control/index.js +5 -4
  193. package/build/components/border-style-control/index.js.map +1 -1
  194. package/build/components/button-block-appender/index.js +15 -13
  195. package/build/components/button-block-appender/index.js.map +1 -1
  196. package/build/components/button-block-appender/index.native.js +28 -24
  197. package/build/components/button-block-appender/index.native.js.map +1 -1
  198. package/build/components/caption/index.native.js +44 -41
  199. package/build/components/caption/index.native.js.map +1 -1
  200. package/build/components/color-palette/control.js +6 -5
  201. package/build/components/color-palette/control.js.map +1 -1
  202. package/build/components/color-style-selector/index.js +43 -34
  203. package/build/components/color-style-selector/index.js.map +1 -1
  204. package/build/components/colors/color-panel.js +21 -18
  205. package/build/components/colors/color-panel.js.map +1 -1
  206. package/build/components/colors/index.js +10 -8
  207. package/build/components/colors/index.js.map +1 -1
  208. package/build/components/colors/utils.js +7 -4
  209. package/build/components/colors/utils.js.map +1 -1
  210. package/build/components/colors/with-colors.js +17 -6
  211. package/build/components/colors/with-colors.js.map +1 -1
  212. package/build/components/colors-gradients/control.js +21 -59
  213. package/build/components/colors-gradients/control.js.map +1 -1
  214. package/build/components/colors-gradients/panel-color-gradient-settings.js +110 -30
  215. package/build/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  216. package/build/components/colors-gradients/panel-color-gradient-settings.native.js +28 -24
  217. package/build/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  218. package/build/components/contrast-checker/index.js +18 -15
  219. package/build/components/contrast-checker/index.js.map +1 -1
  220. package/build/components/convert-to-group-buttons/index.js +9 -8
  221. package/build/components/convert-to-group-buttons/index.js.map +1 -1
  222. package/build/components/copy-handler/index.js +6 -5
  223. package/build/components/copy-handler/index.js.map +1 -1
  224. package/build/components/default-block-appender/index.js +10 -8
  225. package/build/components/default-block-appender/index.js.map +1 -1
  226. package/build/components/default-block-appender/index.native.js +10 -8
  227. package/build/components/default-block-appender/index.native.js.map +1 -1
  228. package/build/components/default-style-picker/index.js +14 -10
  229. package/build/components/default-style-picker/index.js.map +1 -1
  230. package/build/components/duotone-control/index.js +20 -14
  231. package/build/components/duotone-control/index.js.map +1 -1
  232. package/build/components/editable-text/index.js +6 -5
  233. package/build/components/editable-text/index.js.map +1 -1
  234. package/build/components/editor-styles/index.js +4 -3
  235. package/build/components/editor-styles/index.js.map +1 -1
  236. package/build/components/floating-toolbar/index.native.js +8 -7
  237. package/build/components/floating-toolbar/index.native.js.map +1 -1
  238. package/build/components/font-appearance-control/index.js +53 -34
  239. package/build/components/font-appearance-control/index.js.map +1 -1
  240. package/build/components/font-family/index.js +12 -10
  241. package/build/components/font-family/index.js.map +1 -1
  242. package/build/components/font-sizes/index.js +6 -6
  243. package/build/components/font-sizes/index.native.js +6 -6
  244. package/build/components/font-sizes/utils.js +2 -2
  245. package/build/components/font-sizes/with-font-sizes.js +11 -5
  246. package/build/components/font-sizes/with-font-sizes.js.map +1 -1
  247. package/build/components/gradients/use-gradient.js +7 -6
  248. package/build/components/gradients/use-gradient.js.map +1 -1
  249. package/build/components/iframe/index.js +29 -23
  250. package/build/components/iframe/index.js.map +1 -1
  251. package/build/components/image-editor/aspect-ratio-dropdown.js +90 -82
  252. package/build/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  253. package/build/components/image-editor/constants.js +1 -1
  254. package/build/components/image-editor/context.js +11 -10
  255. package/build/components/image-editor/context.js.map +1 -1
  256. package/build/components/image-editor/cropper.js +9 -8
  257. package/build/components/image-editor/cropper.js.map +1 -1
  258. package/build/components/image-editor/index.js +10 -9
  259. package/build/components/image-editor/index.js.map +1 -1
  260. package/build/components/image-editor/use-save-image.js +12 -11
  261. package/build/components/image-editor/use-save-image.js.map +1 -1
  262. package/build/components/image-editor/use-transform-image.js +6 -5
  263. package/build/components/image-editor/use-transform-image.js.map +1 -1
  264. package/build/components/image-editor/zoom-dropdown.js +13 -10
  265. package/build/components/image-editor/zoom-dropdown.js.map +1 -1
  266. package/build/components/image-size-control/index.js +12 -11
  267. package/build/components/image-size-control/index.js.map +1 -1
  268. package/build/components/index.js +217 -197
  269. package/build/components/index.js.map +1 -1
  270. package/build/components/index.native.js +113 -111
  271. package/build/components/index.native.js.map +1 -1
  272. package/build/components/inner-blocks/button-block-appender.js +8 -7
  273. package/build/components/inner-blocks/button-block-appender.js.map +1 -1
  274. package/build/components/inner-blocks/default-block-appender.js +9 -7
  275. package/build/components/inner-blocks/default-block-appender.js.map +1 -1
  276. package/build/components/inner-blocks/index.js +9 -6
  277. package/build/components/inner-blocks/index.js.map +1 -1
  278. package/build/components/inner-blocks/index.native.js +8 -5
  279. package/build/components/inner-blocks/index.native.js.map +1 -1
  280. package/build/components/inserter/block-patterns-explorer/explorer.js +64 -0
  281. package/build/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
  282. package/build/components/inserter/block-patterns-explorer/patterns-list.js +114 -0
  283. package/build/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
  284. package/build/components/inserter/block-patterns-explorer/sidebar.js +82 -0
  285. package/build/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
  286. package/build/components/inserter/block-patterns-tab.js +92 -57
  287. package/build/components/inserter/block-patterns-tab.js.map +1 -1
  288. package/build/components/inserter/block-types-tab.js +9 -7
  289. package/build/components/inserter/block-types-tab.js.map +1 -1
  290. package/build/components/inserter/block-types-tab.native.js +9 -8
  291. package/build/components/inserter/block-types-tab.native.js.map +1 -1
  292. package/build/components/inserter/hooks/use-block-type-impressions.native.js +9 -10
  293. package/build/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  294. package/build/components/inserter/hooks/use-block-types-state.js +6 -5
  295. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  296. package/build/components/inserter/hooks/use-insertion-point.js +11 -9
  297. package/build/components/inserter/hooks/use-insertion-point.js.map +1 -1
  298. package/build/components/inserter/index.js +36 -28
  299. package/build/components/inserter/index.js.map +1 -1
  300. package/build/components/inserter/index.native.js +46 -37
  301. package/build/components/inserter/index.native.js.map +1 -1
  302. package/build/components/inserter/library.js +12 -11
  303. package/build/components/inserter/library.js.map +1 -1
  304. package/build/components/inserter/menu.js +12 -11
  305. package/build/components/inserter/menu.js.map +1 -1
  306. package/build/components/inserter/menu.native.js +31 -27
  307. package/build/components/inserter/menu.native.js.map +1 -1
  308. package/build/components/inserter/panel.js +6 -5
  309. package/build/components/inserter/panel.js.map +1 -1
  310. package/build/components/inserter/pattern-panel.js +25 -15
  311. package/build/components/inserter/pattern-panel.js.map +1 -1
  312. package/build/components/inserter/preview-panel.js +4 -3
  313. package/build/components/inserter/preview-panel.js.map +1 -1
  314. package/build/components/inserter/quick-inserter.js +7 -6
  315. package/build/components/inserter/quick-inserter.js.map +1 -1
  316. package/build/components/inserter/reusable-blocks-tab.js +18 -13
  317. package/build/components/inserter/reusable-blocks-tab.js.map +1 -1
  318. package/build/components/inserter/reusable-blocks-tab.native.js +6 -5
  319. package/build/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  320. package/build/components/inserter/search-items.js +23 -7
  321. package/build/components/inserter/search-items.js.map +1 -1
  322. package/build/components/inserter/search-results.js +15 -14
  323. package/build/components/inserter/search-results.js.map +1 -1
  324. package/build/components/inserter/search-results.native.js +11 -10
  325. package/build/components/inserter/search-results.native.js.map +1 -1
  326. package/build/components/inserter/tabs.js +7 -6
  327. package/build/components/inserter/tabs.js.map +1 -1
  328. package/build/components/inserter/tabs.native.js +55 -37
  329. package/build/components/inserter/tabs.native.js.map +1 -1
  330. package/build/components/inserter/utils.native.js +10 -8
  331. package/build/components/inserter/utils.native.js.map +1 -1
  332. package/build/components/inserter-draggable-blocks/index.js +12 -10
  333. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  334. package/build/components/inserter-list-item/index.js +79 -73
  335. package/build/components/inserter-list-item/index.js.map +1 -1
  336. package/build/components/inserter-listbox/index.js +8 -7
  337. package/build/components/inserter-listbox/index.js.map +1 -1
  338. package/build/components/inserter-listbox/item.js +7 -6
  339. package/build/components/inserter-listbox/item.js.map +1 -1
  340. package/build/components/inspector-controls/block-support-slot-container.js +5 -4
  341. package/build/components/inspector-controls/block-support-slot-container.js.map +1 -1
  342. package/build/components/inspector-controls/block-support-tools-panel.js +8 -6
  343. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  344. package/build/components/inspector-controls/fill.js +5 -4
  345. package/build/components/inspector-controls/fill.js.map +1 -1
  346. package/build/components/inspector-controls/fill.native.js +6 -5
  347. package/build/components/inspector-controls/fill.native.js.map +1 -1
  348. package/build/components/inspector-controls/groups.js +3 -1
  349. package/build/components/inspector-controls/groups.js.map +1 -1
  350. package/build/components/inspector-controls/slot.js +7 -6
  351. package/build/components/inspector-controls/slot.js.map +1 -1
  352. package/build/components/inspector-controls/slot.native.js +5 -4
  353. package/build/components/inspector-controls/slot.native.js.map +1 -1
  354. package/build/components/justify-content-control/ui.js +10 -8
  355. package/build/components/justify-content-control/ui.js.map +1 -1
  356. package/build/components/letter-spacing-control/index.js +13 -9
  357. package/build/components/letter-spacing-control/index.js.map +1 -1
  358. package/build/components/line-height-control/index.js +5 -4
  359. package/build/components/line-height-control/index.js.map +1 -1
  360. package/build/components/line-height-control/index.native.js +5 -4
  361. package/build/components/line-height-control/index.native.js.map +1 -1
  362. package/build/components/line-height-control/utils.js +1 -1
  363. package/build/components/link-control/index.js +107 -52
  364. package/build/components/link-control/index.js.map +1 -1
  365. package/build/components/link-control/link-preview.js +24 -10
  366. package/build/components/link-control/link-preview.js.map +1 -1
  367. package/build/components/link-control/search-create-button.js +9 -7
  368. package/build/components/link-control/search-create-button.js.map +1 -1
  369. package/build/components/link-control/search-input.js +31 -21
  370. package/build/components/link-control/search-input.js.map +1 -1
  371. package/build/components/link-control/search-item.js +10 -9
  372. package/build/components/link-control/search-item.js.map +1 -1
  373. package/build/components/link-control/search-results.js +15 -14
  374. package/build/components/link-control/search-results.js.map +1 -1
  375. package/build/components/link-control/settings-drawer.js +7 -5
  376. package/build/components/link-control/settings-drawer.js.map +1 -1
  377. package/build/components/link-control/use-search-handler.js +5 -4
  378. package/build/components/link-control/use-search-handler.js.map +1 -1
  379. package/build/components/link-control/viewer-slot.js +1 -1
  380. package/build/components/list-view/appender.js +27 -23
  381. package/build/components/list-view/appender.js.map +1 -1
  382. package/build/components/list-view/block-contents.js +32 -28
  383. package/build/components/list-view/block-contents.js.map +1 -1
  384. package/build/components/list-view/block-select-button.js +18 -17
  385. package/build/components/list-view/block-select-button.js.map +1 -1
  386. package/build/components/list-view/block.js +122 -83
  387. package/build/components/list-view/block.js.map +1 -1
  388. package/build/components/list-view/branch.js +92 -73
  389. package/build/components/list-view/branch.js.map +1 -1
  390. package/build/components/list-view/drop-indicator.js +5 -4
  391. package/build/components/list-view/drop-indicator.js.map +1 -1
  392. package/build/components/list-view/expander.js +4 -3
  393. package/build/components/list-view/expander.js.map +1 -1
  394. package/build/components/list-view/index.js +47 -23
  395. package/build/components/list-view/index.js.map +1 -1
  396. package/build/components/list-view/leaf.js +12 -11
  397. package/build/components/list-view/leaf.js.map +1 -1
  398. package/build/components/list-view/list-item.js +8 -7
  399. package/build/components/list-view/list-item.js.map +1 -1
  400. package/build/components/list-view/use-list-view-client-ids.js +8 -58
  401. package/build/components/list-view/use-list-view-client-ids.js.map +1 -1
  402. package/build/components/media-placeholder/index.js +86 -68
  403. package/build/components/media-placeholder/index.js.map +1 -1
  404. package/build/components/media-placeholder/index.native.js +5 -4
  405. package/build/components/media-placeholder/index.native.js.map +1 -1
  406. package/build/components/media-replace-flow/index.js +85 -72
  407. package/build/components/media-replace-flow/index.js.map +1 -1
  408. package/build/components/media-upload/check.js +5 -4
  409. package/build/components/media-upload/check.js.map +1 -1
  410. package/build/components/media-upload/index.native.js +1 -1
  411. package/build/components/media-upload-progress/index.native.js +1 -1
  412. package/build/components/multi-selection-inspector/index.js +4 -3
  413. package/build/components/multi-selection-inspector/index.js.map +1 -1
  414. package/build/components/navigable-toolbar/index.js +8 -7
  415. package/build/components/navigable-toolbar/index.js.map +1 -1
  416. package/build/components/observe-typing/index.js +5 -4
  417. package/build/components/observe-typing/index.js.map +1 -1
  418. package/build/components/panel-color-settings/index.js +16 -12
  419. package/build/components/panel-color-settings/index.js.map +1 -1
  420. package/build/components/plain-text/index.js +6 -4
  421. package/build/components/plain-text/index.js.map +1 -1
  422. package/build/components/preview-options/index.js +8 -7
  423. package/build/components/preview-options/index.js.map +1 -1
  424. package/build/components/provider/block-refs-provider.js +5 -4
  425. package/build/components/provider/block-refs-provider.js.map +1 -1
  426. package/build/components/provider/use-block-sync.js +8 -7
  427. package/build/components/provider/use-block-sync.js.map +1 -1
  428. package/build/components/provider/with-registry-provider.js +7 -5
  429. package/build/components/provider/with-registry-provider.js.map +1 -1
  430. package/build/components/responsive-block-control/label.js +6 -5
  431. package/build/components/responsive-block-control/label.js.map +1 -1
  432. package/build/components/rich-text/embed-handler-picker.native.js +8 -5
  433. package/build/components/rich-text/embed-handler-picker.native.js.map +1 -1
  434. package/build/components/rich-text/file-paste-handler.js +6 -3
  435. package/build/components/rich-text/file-paste-handler.js.map +1 -1
  436. package/build/components/rich-text/format-edit.js +36 -9
  437. package/build/components/rich-text/format-edit.js.map +1 -1
  438. package/build/components/rich-text/format-toolbar/index.js +20 -10
  439. package/build/components/rich-text/format-toolbar/index.js.map +1 -1
  440. package/build/components/rich-text/format-toolbar-container.js +6 -4
  441. package/build/components/rich-text/format-toolbar-container.js.map +1 -1
  442. package/build/components/rich-text/index.js +45 -41
  443. package/build/components/rich-text/index.js.map +1 -1
  444. package/build/components/rich-text/index.native.js +145 -122
  445. package/build/components/rich-text/index.native.js.map +1 -1
  446. package/build/components/rich-text/input-event.js +5 -4
  447. package/build/components/rich-text/input-event.js.map +1 -1
  448. package/build/components/rich-text/shortcut.js +6 -5
  449. package/build/components/rich-text/shortcut.js.map +1 -1
  450. package/build/components/rich-text/split-value.js +10 -8
  451. package/build/components/rich-text/split-value.js.map +1 -1
  452. package/build/components/rich-text/toolbar-button.js +7 -6
  453. package/build/components/rich-text/toolbar-button.js.map +1 -1
  454. package/build/components/rich-text/use-caret-in-format.js +4 -3
  455. package/build/components/rich-text/use-caret-in-format.js.map +1 -1
  456. package/build/components/rich-text/use-enter.js +6 -3
  457. package/build/components/rich-text/use-enter.js.map +1 -1
  458. package/build/components/rich-text/use-format-types.js +13 -10
  459. package/build/components/rich-text/use-format-types.js.map +1 -1
  460. package/build/components/rich-text/use-input-rules.js +15 -9
  461. package/build/components/rich-text/use-input-rules.js.map +1 -1
  462. package/build/components/rich-text/use-mark-persistent.js +5 -4
  463. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  464. package/build/components/rich-text/use-paste-handler.js +28 -4
  465. package/build/components/rich-text/use-paste-handler.js.map +1 -1
  466. package/build/components/rich-text/utils.js +9 -7
  467. package/build/components/rich-text/utils.js.map +1 -1
  468. package/build/components/skip-to-selected-block/index.js +4 -3
  469. package/build/components/skip-to-selected-block/index.js.map +1 -1
  470. package/build/components/text-decoration-control/index.js +5 -4
  471. package/build/components/text-decoration-control/index.js.map +1 -1
  472. package/build/components/text-transform-control/index.js +5 -4
  473. package/build/components/text-transform-control/index.js.map +1 -1
  474. package/build/components/tool-selector/index.js +16 -13
  475. package/build/components/tool-selector/index.js.map +1 -1
  476. package/build/components/typewriter/index.js +10 -7
  477. package/build/components/typewriter/index.js.map +1 -1
  478. package/build/components/ungroup-button/index.native.js +12 -9
  479. package/build/components/ungroup-button/index.native.js.map +1 -1
  480. package/build/components/unit-control/index.js +5 -4
  481. package/build/components/unit-control/index.js.map +1 -1
  482. package/build/components/url-input/index.js +23 -13
  483. package/build/components/url-input/index.js.map +1 -1
  484. package/build/components/url-input/index.native.js +8 -6
  485. package/build/components/url-input/index.native.js.map +1 -1
  486. package/build/components/url-popover/image-url-input-ui.js +12 -11
  487. package/build/components/url-popover/image-url-input-ui.js.map +1 -1
  488. package/build/components/url-popover/index.js +9 -8
  489. package/build/components/url-popover/index.js.map +1 -1
  490. package/build/components/url-popover/link-editor.js +8 -7
  491. package/build/components/url-popover/link-editor.js.map +1 -1
  492. package/build/components/url-popover/link-viewer-url.js +6 -5
  493. package/build/components/url-popover/link-viewer-url.js.map +1 -1
  494. package/build/components/url-popover/link-viewer.js +9 -8
  495. package/build/components/url-popover/link-viewer.js.map +1 -1
  496. package/build/components/use-block-drop-zone/index.js +9 -8
  497. package/build/components/use-block-drop-zone/index.js.map +1 -1
  498. package/build/components/use-moving-animation/index.js +17 -13
  499. package/build/components/use-moving-animation/index.js.map +1 -1
  500. package/build/components/use-no-recursive-renders/index.js +10 -6
  501. package/build/components/use-no-recursive-renders/index.js.map +1 -1
  502. package/build/components/use-on-block-drop/index.js +2 -2
  503. package/build/components/use-setting/index.js +48 -9
  504. package/build/components/use-setting/index.js.map +1 -1
  505. package/build/components/warning/index.js +7 -6
  506. package/build/components/warning/index.js.map +1 -1
  507. package/build/components/warning/index.native.js +10 -9
  508. package/build/components/warning/index.native.js.map +1 -1
  509. package/build/components/writing-flow/index.js +6 -5
  510. package/build/components/writing-flow/index.js.map +1 -1
  511. package/build/components/writing-flow/use-arrow-nav.js +2 -2
  512. package/build/hooks/align.js +12 -7
  513. package/build/hooks/align.js.map +1 -1
  514. package/build/hooks/border.js +9 -7
  515. package/build/hooks/border.js.map +1 -1
  516. package/build/hooks/color-panel.js +9 -7
  517. package/build/hooks/color-panel.js.map +1 -1
  518. package/build/hooks/color.js +4 -3
  519. package/build/hooks/color.js.map +1 -1
  520. package/build/hooks/dimensions.js +4 -2
  521. package/build/hooks/dimensions.js.map +1 -1
  522. package/build/hooks/duotone.js +29 -15
  523. package/build/hooks/duotone.js.map +1 -1
  524. package/build/hooks/font-appearance.js +60 -14
  525. package/build/hooks/font-appearance.js.map +1 -1
  526. package/build/hooks/font-family.js +62 -32
  527. package/build/hooks/font-family.js.map +1 -1
  528. package/build/hooks/font-size.js +57 -13
  529. package/build/hooks/font-size.js.map +1 -1
  530. package/build/hooks/gap.js +10 -8
  531. package/build/hooks/gap.js.map +1 -1
  532. package/build/hooks/index.js +16 -8
  533. package/build/hooks/index.js.map +1 -1
  534. package/build/hooks/index.native.js +16 -8
  535. package/build/hooks/index.native.js.map +1 -1
  536. package/build/hooks/layout.js +16 -13
  537. package/build/hooks/layout.js.map +1 -1
  538. package/build/hooks/letter-spacing.js +50 -11
  539. package/build/hooks/letter-spacing.js.map +1 -1
  540. package/build/hooks/line-height.js +51 -12
  541. package/build/hooks/line-height.js.map +1 -1
  542. package/build/hooks/margin.js +11 -9
  543. package/build/hooks/margin.js.map +1 -1
  544. package/build/hooks/padding.js +11 -9
  545. package/build/hooks/padding.js.map +1 -1
  546. package/build/hooks/style.js +9 -5
  547. package/build/hooks/style.js.map +1 -1
  548. package/build/hooks/text-decoration.js +48 -10
  549. package/build/hooks/text-decoration.js.map +1 -1
  550. package/build/hooks/text-transform.js +48 -10
  551. package/build/hooks/text-transform.js.map +1 -1
  552. package/build/hooks/typography.js +111 -10
  553. package/build/hooks/typography.js.map +1 -1
  554. package/build/hooks/typography.native.js +3 -2
  555. package/build/hooks/typography.native.js.map +1 -1
  556. package/build/hooks/use-border-props.js +5 -4
  557. package/build/hooks/use-border-props.js.map +1 -1
  558. package/build/hooks/use-cached-truthy.js +29 -0
  559. package/build/hooks/use-cached-truthy.js.map +1 -0
  560. package/build/index.js +21 -14
  561. package/build/index.js.map +1 -1
  562. package/build/layouts/flex.js +172 -52
  563. package/build/layouts/flex.js.map +1 -1
  564. package/build/layouts/flow.js +10 -8
  565. package/build/layouts/flow.js.map +1 -1
  566. package/build/layouts/index.js +2 -1
  567. package/build/layouts/index.js.map +1 -1
  568. package/build/layouts/utils.js +2 -1
  569. package/build/layouts/utils.js.map +1 -1
  570. package/build/store/actions.js +486 -369
  571. package/build/store/actions.js.map +1 -1
  572. package/build/store/array.js +2 -1
  573. package/build/store/array.js.map +1 -1
  574. package/build/store/index.js +6 -6
  575. package/build/store/index.js.map +1 -1
  576. package/build/store/reducer.js +145 -69
  577. package/build/store/reducer.js.map +1 -1
  578. package/build/store/selectors.js +259 -172
  579. package/build/store/selectors.js.map +1 -1
  580. package/build/utils/block-variation-transforms.js +4 -3
  581. package/build/utils/block-variation-transforms.js.map +1 -1
  582. package/build/utils/dom.js +1 -1
  583. package/build/utils/get-paste-event-data.js +10 -6
  584. package/build/utils/get-paste-event-data.js.map +1 -1
  585. package/build/utils/index.js +4 -4
  586. package/build/utils/math.js +2 -1
  587. package/build/utils/math.js.map +1 -1
  588. package/build/utils/parse-css-unit-to-px.js +6 -3
  589. package/build/utils/parse-css-unit-to-px.js.map +1 -1
  590. package/build/utils/transform-styles/index.js +8 -6
  591. package/build/utils/transform-styles/index.js.map +1 -1
  592. package/build/utils/transform-styles/transforms/wrap.js +31 -28
  593. package/build/utils/transform-styles/transforms/wrap.js.map +1 -1
  594. package/build-module/components/alignment-control/ui.js +12 -11
  595. package/build-module/components/alignment-control/ui.js.map +1 -1
  596. package/build-module/components/autocomplete/index.js +4 -3
  597. package/build-module/components/autocomplete/index.js.map +1 -1
  598. package/build-module/components/block-actions/index.js +12 -8
  599. package/build-module/components/block-actions/index.js.map +1 -1
  600. package/build-module/components/block-alignment-control/ui.js +21 -17
  601. package/build-module/components/block-alignment-control/ui.js.map +1 -1
  602. package/build-module/components/block-alignment-control/use-available-alignments.js +9 -4
  603. package/build-module/components/block-alignment-control/use-available-alignments.js.map +1 -1
  604. package/build-module/components/block-alignment-matrix-control/index.js +6 -4
  605. package/build-module/components/block-alignment-matrix-control/index.js.map +1 -1
  606. package/build-module/components/block-breadcrumb/index.js +4 -3
  607. package/build-module/components/block-breadcrumb/index.js.map +1 -1
  608. package/build-module/components/block-caption/index.native.js +34 -29
  609. package/build-module/components/block-caption/index.native.js.map +1 -1
  610. package/build-module/components/block-card/index.js +8 -6
  611. package/build-module/components/block-card/index.js.map +1 -1
  612. package/build-module/components/block-compare/block-view.js +9 -8
  613. package/build-module/components/block-compare/block-view.js.map +1 -1
  614. package/build-module/components/block-compare/index.js +9 -7
  615. package/build-module/components/block-compare/index.js.map +1 -1
  616. package/build-module/components/block-content-overlay/index.js +7 -6
  617. package/build-module/components/block-content-overlay/index.js.map +1 -1
  618. package/build-module/components/block-context/index.js +5 -4
  619. package/build-module/components/block-context/index.js.map +1 -1
  620. package/build-module/components/block-controls/fill.js +7 -6
  621. package/build-module/components/block-controls/fill.js.map +1 -1
  622. package/build-module/components/block-controls/slot.js +5 -4
  623. package/build-module/components/block-controls/slot.js.map +1 -1
  624. package/build-module/components/block-controls/slot.native.js +5 -4
  625. package/build-module/components/block-controls/slot.native.js.map +1 -1
  626. package/build-module/components/block-draggable/draggable-chip.js +5 -4
  627. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  628. package/build-module/components/block-draggable/index.js +13 -11
  629. package/build-module/components/block-draggable/index.js.map +1 -1
  630. package/build-module/components/block-full-height-alignment-control/index.js +7 -6
  631. package/build-module/components/block-full-height-alignment-control/index.js.map +1 -1
  632. package/build-module/components/block-icon/index.js +11 -5
  633. package/build-module/components/block-icon/index.js.map +1 -1
  634. package/build-module/components/block-icon/index.native.js +8 -6
  635. package/build-module/components/block-icon/index.native.js.map +1 -1
  636. package/build-module/components/block-inspector/index.js +20 -13
  637. package/build-module/components/block-inspector/index.js.map +1 -1
  638. package/build-module/components/block-list/block-html.js +4 -3
  639. package/build-module/components/block-list/block-html.js.map +1 -1
  640. package/build-module/components/block-list/block-invalid-warning.js +27 -19
  641. package/build-module/components/block-list/block-invalid-warning.js.map +1 -1
  642. package/build-module/components/block-list/block-invalid-warning.native.js +5 -4
  643. package/build-module/components/block-list/block-invalid-warning.native.js.map +1 -1
  644. package/build-module/components/block-list/block-list-item.native.js +6 -5
  645. package/build-module/components/block-list/block-list-item.native.js.map +1 -1
  646. package/build-module/components/block-list/block-selection-button.native.js +11 -9
  647. package/build-module/components/block-list/block-selection-button.native.js.map +1 -1
  648. package/build-module/components/block-list/block.js +40 -33
  649. package/build-module/components/block-list/block.js.map +1 -1
  650. package/build-module/components/block-list/block.native.js +35 -29
  651. package/build-module/components/block-list/block.native.js.map +1 -1
  652. package/build-module/components/block-list/index.js +13 -11
  653. package/build-module/components/block-list/index.js.map +1 -1
  654. package/build-module/components/block-list/index.native.js +22 -17
  655. package/build-module/components/block-list/index.native.js.map +1 -1
  656. package/build-module/components/block-list/insertion-point.native.js +4 -3
  657. package/build-module/components/block-list/insertion-point.native.js.map +1 -1
  658. package/build-module/components/block-list/layout.js +5 -4
  659. package/build-module/components/block-list/layout.js.map +1 -1
  660. package/build-module/components/block-list/subdirectory-icon.js +13 -10
  661. package/build-module/components/block-list/subdirectory-icon.js.map +1 -1
  662. package/build-module/components/block-list/use-block-props/index.js +5 -3
  663. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  664. package/build-module/components/block-list/use-block-props/index.native.js +2 -1
  665. package/build-module/components/block-list/use-block-props/index.native.js.map +1 -1
  666. package/build-module/components/block-list/use-block-props/use-multi-selection.js +30 -14
  667. package/build-module/components/block-list/use-block-props/use-multi-selection.js.map +1 -1
  668. package/build-module/components/block-list-appender/index.js +16 -13
  669. package/build-module/components/block-list-appender/index.js.map +1 -1
  670. package/build-module/components/block-list-appender/index.native.js +14 -11
  671. package/build-module/components/block-list-appender/index.native.js.map +1 -1
  672. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js +46 -42
  673. package/build-module/components/block-mobile-toolbar/block-actions-menu.native.js.map +1 -1
  674. package/build-module/components/block-mobile-toolbar/index.js +4 -3
  675. package/build-module/components/block-mobile-toolbar/index.js.map +1 -1
  676. package/build-module/components/block-mobile-toolbar/index.native.js +33 -25
  677. package/build-module/components/block-mobile-toolbar/index.native.js.map +1 -1
  678. package/build-module/components/block-mover/button.js +7 -6
  679. package/build-module/components/block-mover/button.js.map +1 -1
  680. package/build-module/components/block-mover/index.js +15 -13
  681. package/build-module/components/block-mover/index.js.map +1 -1
  682. package/build-module/components/block-mover/index.native.js +22 -19
  683. package/build-module/components/block-mover/index.native.js.map +1 -1
  684. package/build-module/components/block-mover/mover-description.native.js +10 -7
  685. package/build-module/components/block-mover/mover-description.native.js.map +1 -1
  686. package/build-module/components/block-navigation/dropdown.js +26 -22
  687. package/build-module/components/block-navigation/dropdown.js.map +1 -1
  688. package/build-module/components/block-pattern-setup/index.js +26 -22
  689. package/build-module/components/block-pattern-setup/index.js.map +1 -1
  690. package/build-module/components/block-pattern-setup/setup-toolbar.js +46 -39
  691. package/build-module/components/block-pattern-setup/setup-toolbar.js.map +1 -1
  692. package/build-module/components/block-patterns-list/index.js +45 -45
  693. package/build-module/components/block-patterns-list/index.js.map +1 -1
  694. package/build-module/components/block-preview/auto.js +5 -4
  695. package/build-module/components/block-preview/auto.js.map +1 -1
  696. package/build-module/components/block-preview/index.js +8 -7
  697. package/build-module/components/block-preview/index.js.map +1 -1
  698. package/build-module/components/block-preview/live.js +4 -3
  699. package/build-module/components/block-preview/live.js.map +1 -1
  700. package/build-module/components/block-settings/button.native.js +10 -7
  701. package/build-module/components/block-settings/button.native.js.map +1 -1
  702. package/build-module/components/block-settings/container.native.js +13 -9
  703. package/build-module/components/block-settings/container.native.js.map +1 -1
  704. package/build-module/components/block-settings-menu/block-convert-button.js +7 -5
  705. package/build-module/components/block-settings-menu/block-convert-button.js.map +1 -1
  706. package/build-module/components/block-settings-menu/block-html-convert-button.js +14 -10
  707. package/build-module/components/block-settings-menu/block-html-convert-button.js.map +1 -1
  708. package/build-module/components/block-settings-menu/block-mode-toggle.js +25 -19
  709. package/build-module/components/block-settings-menu/block-mode-toggle.js.map +1 -1
  710. package/build-module/components/block-settings-menu/block-settings-dropdown.js +98 -70
  711. package/build-module/components/block-settings-menu/block-settings-dropdown.js.map +1 -1
  712. package/build-module/components/block-settings-menu/index.js +5 -4
  713. package/build-module/components/block-settings-menu/index.js.map +1 -1
  714. package/build-module/components/block-settings-menu-controls/index.js +8 -6
  715. package/build-module/components/block-settings-menu-controls/index.js.map +1 -1
  716. package/build-module/components/block-styles/index.js +20 -17
  717. package/build-module/components/block-styles/index.js.map +1 -1
  718. package/build-module/components/block-styles/index.native.js +6 -4
  719. package/build-module/components/block-styles/index.native.js.map +1 -1
  720. package/build-module/components/block-styles/preview.native.js +9 -8
  721. package/build-module/components/block-styles/preview.native.js.map +1 -1
  722. package/build-module/components/block-switcher/block-styles-menu.js +5 -4
  723. package/build-module/components/block-switcher/block-styles-menu.js.map +1 -1
  724. package/build-module/components/block-switcher/block-transformations-menu.js +7 -6
  725. package/build-module/components/block-switcher/block-transformations-menu.js.map +1 -1
  726. package/build-module/components/block-switcher/block-transformations-menu.native.js +9 -8
  727. package/build-module/components/block-switcher/block-transformations-menu.native.js.map +1 -1
  728. package/build-module/components/block-switcher/index.js +41 -33
  729. package/build-module/components/block-switcher/index.js.map +1 -1
  730. package/build-module/components/block-switcher/pattern-transformations-menu.js +22 -18
  731. package/build-module/components/block-switcher/pattern-transformations-menu.js.map +1 -1
  732. package/build-module/components/block-switcher/preview-block-popover.js +4 -3
  733. package/build-module/components/block-switcher/preview-block-popover.js.map +1 -1
  734. package/build-module/components/block-switcher/utils.js +2 -1
  735. package/build-module/components/block-switcher/utils.js.map +1 -1
  736. package/build-module/components/block-title/index.js +4 -3
  737. package/build-module/components/block-title/index.js.map +1 -1
  738. package/build-module/components/block-toolbar/index.js +4 -3
  739. package/build-module/components/block-toolbar/index.js.map +1 -1
  740. package/build-module/components/block-toolbar/utils.js +13 -11
  741. package/build-module/components/block-toolbar/utils.js.map +1 -1
  742. package/build-module/components/block-tools/back-compat.js +4 -3
  743. package/build-module/components/block-tools/back-compat.js.map +1 -1
  744. package/build-module/components/block-tools/block-contextual-toolbar.js +6 -5
  745. package/build-module/components/block-tools/block-contextual-toolbar.js.map +1 -1
  746. package/build-module/components/block-tools/block-popover.js +15 -13
  747. package/build-module/components/block-tools/block-popover.js.map +1 -1
  748. package/build-module/components/block-tools/block-selection-button.js +6 -5
  749. package/build-module/components/block-tools/block-selection-button.js.map +1 -1
  750. package/build-module/components/block-tools/index.js +6 -5
  751. package/build-module/components/block-tools/index.js.map +1 -1
  752. package/build-module/components/block-tools/insertion-point.js +11 -9
  753. package/build-module/components/block-tools/insertion-point.js.map +1 -1
  754. package/build-module/components/block-types-list/index.js +9 -8
  755. package/build-module/components/block-types-list/index.js.map +1 -1
  756. package/build-module/components/block-types-list/index.native.js +19 -15
  757. package/build-module/components/block-types-list/index.native.js.map +1 -1
  758. package/build-module/components/block-variation-picker/index.js +9 -8
  759. package/build-module/components/block-variation-picker/index.js.map +1 -1
  760. package/build-module/components/block-variation-picker/index.native.js +9 -7
  761. package/build-module/components/block-variation-picker/index.native.js.map +1 -1
  762. package/build-module/components/block-variation-transforms/index.js +22 -15
  763. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  764. package/build-module/components/block-vertical-alignment-control/ui.js +9 -7
  765. package/build-module/components/block-vertical-alignment-control/ui.js.map +1 -1
  766. package/build-module/components/border-radius-control/all-input-control.js +6 -5
  767. package/build-module/components/border-radius-control/all-input-control.js.map +1 -1
  768. package/build-module/components/border-radius-control/index.js +5 -4
  769. package/build-module/components/border-radius-control/index.js.map +1 -1
  770. package/build-module/components/border-radius-control/input-controls.js +16 -11
  771. package/build-module/components/border-radius-control/input-controls.js.map +1 -1
  772. package/build-module/components/border-radius-control/linked-button.js +5 -4
  773. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  774. package/build-module/components/border-radius-control/utils.js +8 -3
  775. package/build-module/components/border-radius-control/utils.js.map +1 -1
  776. package/build-module/components/border-style-control/index.js +5 -4
  777. package/build-module/components/border-style-control/index.js.map +1 -1
  778. package/build-module/components/button-block-appender/index.js +15 -13
  779. package/build-module/components/button-block-appender/index.js.map +1 -1
  780. package/build-module/components/button-block-appender/index.native.js +28 -24
  781. package/build-module/components/button-block-appender/index.native.js.map +1 -1
  782. package/build-module/components/caption/index.native.js +44 -41
  783. package/build-module/components/caption/index.native.js.map +1 -1
  784. package/build-module/components/color-palette/control.js +6 -5
  785. package/build-module/components/color-palette/control.js.map +1 -1
  786. package/build-module/components/color-style-selector/index.js +43 -34
  787. package/build-module/components/color-style-selector/index.js.map +1 -1
  788. package/build-module/components/colors/color-panel.js +21 -18
  789. package/build-module/components/colors/color-panel.js.map +1 -1
  790. package/build-module/components/colors/utils.js +6 -3
  791. package/build-module/components/colors/utils.js.map +1 -1
  792. package/build-module/components/colors/with-colors.js +17 -6
  793. package/build-module/components/colors/with-colors.js.map +1 -1
  794. package/build-module/components/colors-gradients/control.js +25 -65
  795. package/build-module/components/colors-gradients/control.js.map +1 -1
  796. package/build-module/components/colors-gradients/panel-color-gradient-settings.js +111 -30
  797. package/build-module/components/colors-gradients/panel-color-gradient-settings.js.map +1 -1
  798. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js +28 -24
  799. package/build-module/components/colors-gradients/panel-color-gradient-settings.native.js.map +1 -1
  800. package/build-module/components/contrast-checker/index.js +18 -15
  801. package/build-module/components/contrast-checker/index.js.map +1 -1
  802. package/build-module/components/convert-to-group-buttons/index.js +9 -8
  803. package/build-module/components/convert-to-group-buttons/index.js.map +1 -1
  804. package/build-module/components/copy-handler/index.js +4 -3
  805. package/build-module/components/copy-handler/index.js.map +1 -1
  806. package/build-module/components/default-block-appender/index.js +10 -8
  807. package/build-module/components/default-block-appender/index.js.map +1 -1
  808. package/build-module/components/default-block-appender/index.native.js +10 -8
  809. package/build-module/components/default-block-appender/index.native.js.map +1 -1
  810. package/build-module/components/default-style-picker/index.js +14 -10
  811. package/build-module/components/default-style-picker/index.js.map +1 -1
  812. package/build-module/components/duotone-control/index.js +20 -14
  813. package/build-module/components/duotone-control/index.js.map +1 -1
  814. package/build-module/components/editable-text/index.js +6 -5
  815. package/build-module/components/editable-text/index.js.map +1 -1
  816. package/build-module/components/editor-styles/index.js +4 -3
  817. package/build-module/components/editor-styles/index.js.map +1 -1
  818. package/build-module/components/floating-toolbar/index.native.js +8 -7
  819. package/build-module/components/floating-toolbar/index.native.js.map +1 -1
  820. package/build-module/components/font-appearance-control/index.js +49 -34
  821. package/build-module/components/font-appearance-control/index.js.map +1 -1
  822. package/build-module/components/font-family/index.js +12 -10
  823. package/build-module/components/font-family/index.js.map +1 -1
  824. package/build-module/components/font-sizes/with-font-sizes.js +11 -5
  825. package/build-module/components/font-sizes/with-font-sizes.js.map +1 -1
  826. package/build-module/components/gradients/use-gradient.js +5 -4
  827. package/build-module/components/gradients/use-gradient.js.map +1 -1
  828. package/build-module/components/iframe/index.js +29 -23
  829. package/build-module/components/iframe/index.js.map +1 -1
  830. package/build-module/components/image-editor/aspect-ratio-dropdown.js +90 -82
  831. package/build-module/components/image-editor/aspect-ratio-dropdown.js.map +1 -1
  832. package/build-module/components/image-editor/context.js +11 -10
  833. package/build-module/components/image-editor/context.js.map +1 -1
  834. package/build-module/components/image-editor/cropper.js +9 -8
  835. package/build-module/components/image-editor/cropper.js.map +1 -1
  836. package/build-module/components/image-editor/index.js +9 -8
  837. package/build-module/components/image-editor/index.js.map +1 -1
  838. package/build-module/components/image-editor/use-save-image.js +12 -11
  839. package/build-module/components/image-editor/use-save-image.js.map +1 -1
  840. package/build-module/components/image-editor/use-transform-image.js +6 -5
  841. package/build-module/components/image-editor/use-transform-image.js.map +1 -1
  842. package/build-module/components/image-editor/zoom-dropdown.js +13 -10
  843. package/build-module/components/image-editor/zoom-dropdown.js.map +1 -1
  844. package/build-module/components/image-size-control/index.js +12 -11
  845. package/build-module/components/image-size-control/index.js.map +1 -1
  846. package/build-module/components/index.js +3 -1
  847. package/build-module/components/index.js.map +1 -1
  848. package/build-module/components/index.native.js +1 -1
  849. package/build-module/components/index.native.js.map +1 -1
  850. package/build-module/components/inner-blocks/button-block-appender.js +8 -7
  851. package/build-module/components/inner-blocks/button-block-appender.js.map +1 -1
  852. package/build-module/components/inner-blocks/default-block-appender.js +9 -7
  853. package/build-module/components/inner-blocks/default-block-appender.js.map +1 -1
  854. package/build-module/components/inner-blocks/index.js +9 -6
  855. package/build-module/components/inner-blocks/index.js.map +1 -1
  856. package/build-module/components/inner-blocks/index.native.js +8 -5
  857. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  858. package/build-module/components/inserter/block-patterns-explorer/explorer.js +52 -0
  859. package/build-module/components/inserter/block-patterns-explorer/explorer.js.map +1 -0
  860. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js +95 -0
  861. package/build-module/components/inserter/block-patterns-explorer/patterns-list.js.map +1 -0
  862. package/build-module/components/inserter/block-patterns-explorer/sidebar.js +73 -0
  863. package/build-module/components/inserter/block-patterns-explorer/sidebar.js.map +1 -0
  864. package/build-module/components/inserter/block-patterns-tab.js +93 -58
  865. package/build-module/components/inserter/block-patterns-tab.js.map +1 -1
  866. package/build-module/components/inserter/block-types-tab.js +9 -7
  867. package/build-module/components/inserter/block-types-tab.js.map +1 -1
  868. package/build-module/components/inserter/block-types-tab.native.js +9 -8
  869. package/build-module/components/inserter/block-types-tab.native.js.map +1 -1
  870. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js +9 -10
  871. package/build-module/components/inserter/hooks/use-block-type-impressions.native.js.map +1 -1
  872. package/build-module/components/inserter/hooks/use-block-types-state.js +6 -5
  873. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  874. package/build-module/components/inserter/hooks/use-insertion-point.js +11 -9
  875. package/build-module/components/inserter/hooks/use-insertion-point.js.map +1 -1
  876. package/build-module/components/inserter/index.js +36 -28
  877. package/build-module/components/inserter/index.js.map +1 -1
  878. package/build-module/components/inserter/index.native.js +46 -37
  879. package/build-module/components/inserter/index.native.js.map +1 -1
  880. package/build-module/components/inserter/library.js +12 -11
  881. package/build-module/components/inserter/library.js.map +1 -1
  882. package/build-module/components/inserter/menu.js +12 -11
  883. package/build-module/components/inserter/menu.js.map +1 -1
  884. package/build-module/components/inserter/menu.native.js +31 -27
  885. package/build-module/components/inserter/menu.native.js.map +1 -1
  886. package/build-module/components/inserter/panel.js +6 -5
  887. package/build-module/components/inserter/panel.js.map +1 -1
  888. package/build-module/components/inserter/pattern-panel.js +27 -18
  889. package/build-module/components/inserter/pattern-panel.js.map +1 -1
  890. package/build-module/components/inserter/preview-panel.js +4 -3
  891. package/build-module/components/inserter/preview-panel.js.map +1 -1
  892. package/build-module/components/inserter/quick-inserter.js +7 -6
  893. package/build-module/components/inserter/quick-inserter.js.map +1 -1
  894. package/build-module/components/inserter/reusable-blocks-tab.js +18 -13
  895. package/build-module/components/inserter/reusable-blocks-tab.js.map +1 -1
  896. package/build-module/components/inserter/reusable-blocks-tab.native.js +6 -5
  897. package/build-module/components/inserter/reusable-blocks-tab.native.js.map +1 -1
  898. package/build-module/components/inserter/search-items.js +23 -7
  899. package/build-module/components/inserter/search-items.js.map +1 -1
  900. package/build-module/components/inserter/search-results.js +15 -14
  901. package/build-module/components/inserter/search-results.js.map +1 -1
  902. package/build-module/components/inserter/search-results.native.js +11 -10
  903. package/build-module/components/inserter/search-results.native.js.map +1 -1
  904. package/build-module/components/inserter/tabs.js +7 -6
  905. package/build-module/components/inserter/tabs.js.map +1 -1
  906. package/build-module/components/inserter/tabs.native.js +55 -37
  907. package/build-module/components/inserter/tabs.native.js.map +1 -1
  908. package/build-module/components/inserter/utils.native.js +10 -8
  909. package/build-module/components/inserter/utils.native.js.map +1 -1
  910. package/build-module/components/inserter-draggable-blocks/index.js +12 -10
  911. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  912. package/build-module/components/inserter-list-item/index.js +75 -69
  913. package/build-module/components/inserter-list-item/index.js.map +1 -1
  914. package/build-module/components/inserter-listbox/index.js +4 -3
  915. package/build-module/components/inserter-listbox/index.js.map +1 -1
  916. package/build-module/components/inserter-listbox/item.js +7 -6
  917. package/build-module/components/inserter-listbox/item.js.map +1 -1
  918. package/build-module/components/inspector-controls/block-support-slot-container.js +5 -4
  919. package/build-module/components/inspector-controls/block-support-slot-container.js.map +1 -1
  920. package/build-module/components/inspector-controls/block-support-tools-panel.js +8 -6
  921. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  922. package/build-module/components/inspector-controls/fill.js +5 -4
  923. package/build-module/components/inspector-controls/fill.js.map +1 -1
  924. package/build-module/components/inspector-controls/fill.native.js +6 -5
  925. package/build-module/components/inspector-controls/fill.native.js.map +1 -1
  926. package/build-module/components/inspector-controls/groups.js +3 -1
  927. package/build-module/components/inspector-controls/groups.js.map +1 -1
  928. package/build-module/components/inspector-controls/slot.js +7 -6
  929. package/build-module/components/inspector-controls/slot.js.map +1 -1
  930. package/build-module/components/inspector-controls/slot.native.js +5 -4
  931. package/build-module/components/inspector-controls/slot.native.js.map +1 -1
  932. package/build-module/components/justify-content-control/ui.js +10 -8
  933. package/build-module/components/justify-content-control/ui.js.map +1 -1
  934. package/build-module/components/letter-spacing-control/index.js +13 -9
  935. package/build-module/components/letter-spacing-control/index.js.map +1 -1
  936. package/build-module/components/line-height-control/index.js +5 -4
  937. package/build-module/components/line-height-control/index.js.map +1 -1
  938. package/build-module/components/line-height-control/index.native.js +5 -4
  939. package/build-module/components/line-height-control/index.native.js.map +1 -1
  940. package/build-module/components/link-control/index.js +107 -53
  941. package/build-module/components/link-control/index.js.map +1 -1
  942. package/build-module/components/link-control/link-preview.js +24 -11
  943. package/build-module/components/link-control/link-preview.js.map +1 -1
  944. package/build-module/components/link-control/search-create-button.js +9 -7
  945. package/build-module/components/link-control/search-create-button.js.map +1 -1
  946. package/build-module/components/link-control/search-input.js +30 -21
  947. package/build-module/components/link-control/search-input.js.map +1 -1
  948. package/build-module/components/link-control/search-item.js +10 -9
  949. package/build-module/components/link-control/search-item.js.map +1 -1
  950. package/build-module/components/link-control/search-results.js +15 -14
  951. package/build-module/components/link-control/search-results.js.map +1 -1
  952. package/build-module/components/link-control/settings-drawer.js +7 -5
  953. package/build-module/components/link-control/settings-drawer.js.map +1 -1
  954. package/build-module/components/link-control/use-search-handler.js +4 -3
  955. package/build-module/components/link-control/use-search-handler.js.map +1 -1
  956. package/build-module/components/list-view/appender.js +27 -23
  957. package/build-module/components/list-view/appender.js.map +1 -1
  958. package/build-module/components/list-view/block-contents.js +32 -28
  959. package/build-module/components/list-view/block-contents.js.map +1 -1
  960. package/build-module/components/list-view/block-select-button.js +18 -17
  961. package/build-module/components/list-view/block-select-button.js.map +1 -1
  962. package/build-module/components/list-view/block.js +121 -83
  963. package/build-module/components/list-view/block.js.map +1 -1
  964. package/build-module/components/list-view/branch.js +92 -73
  965. package/build-module/components/list-view/branch.js.map +1 -1
  966. package/build-module/components/list-view/drop-indicator.js +5 -4
  967. package/build-module/components/list-view/drop-indicator.js.map +1 -1
  968. package/build-module/components/list-view/expander.js +4 -3
  969. package/build-module/components/list-view/expander.js.map +1 -1
  970. package/build-module/components/list-view/index.js +49 -25
  971. package/build-module/components/list-view/index.js.map +1 -1
  972. package/build-module/components/list-view/leaf.js +12 -11
  973. package/build-module/components/list-view/leaf.js.map +1 -1
  974. package/build-module/components/list-view/list-item.js +8 -7
  975. package/build-module/components/list-view/list-item.js.map +1 -1
  976. package/build-module/components/list-view/use-list-view-client-ids.js +8 -58
  977. package/build-module/components/list-view/use-list-view-client-ids.js.map +1 -1
  978. package/build-module/components/media-placeholder/index.js +86 -68
  979. package/build-module/components/media-placeholder/index.js.map +1 -1
  980. package/build-module/components/media-placeholder/index.native.js +5 -4
  981. package/build-module/components/media-placeholder/index.native.js.map +1 -1
  982. package/build-module/components/media-replace-flow/index.js +85 -72
  983. package/build-module/components/media-replace-flow/index.js.map +1 -1
  984. package/build-module/components/media-upload/check.js +5 -4
  985. package/build-module/components/media-upload/check.js.map +1 -1
  986. package/build-module/components/multi-selection-inspector/index.js +4 -3
  987. package/build-module/components/multi-selection-inspector/index.js.map +1 -1
  988. package/build-module/components/navigable-toolbar/index.js +8 -7
  989. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  990. package/build-module/components/observe-typing/index.js +4 -3
  991. package/build-module/components/observe-typing/index.js.map +1 -1
  992. package/build-module/components/panel-color-settings/index.js +16 -12
  993. package/build-module/components/panel-color-settings/index.js.map +1 -1
  994. package/build-module/components/plain-text/index.js +6 -4
  995. package/build-module/components/plain-text/index.js.map +1 -1
  996. package/build-module/components/preview-options/index.js +8 -7
  997. package/build-module/components/preview-options/index.js.map +1 -1
  998. package/build-module/components/provider/block-refs-provider.js +4 -3
  999. package/build-module/components/provider/block-refs-provider.js.map +1 -1
  1000. package/build-module/components/provider/use-block-sync.js +8 -7
  1001. package/build-module/components/provider/use-block-sync.js.map +1 -1
  1002. package/build-module/components/provider/with-registry-provider.js +7 -5
  1003. package/build-module/components/provider/with-registry-provider.js.map +1 -1
  1004. package/build-module/components/responsive-block-control/label.js +6 -5
  1005. package/build-module/components/responsive-block-control/label.js.map +1 -1
  1006. package/build-module/components/rich-text/embed-handler-picker.native.js +8 -5
  1007. package/build-module/components/rich-text/embed-handler-picker.native.js.map +1 -1
  1008. package/build-module/components/rich-text/file-paste-handler.js +6 -3
  1009. package/build-module/components/rich-text/file-paste-handler.js.map +1 -1
  1010. package/build-module/components/rich-text/format-edit.js +36 -10
  1011. package/build-module/components/rich-text/format-edit.js.map +1 -1
  1012. package/build-module/components/rich-text/format-toolbar/index.js +20 -10
  1013. package/build-module/components/rich-text/format-toolbar/index.js.map +1 -1
  1014. package/build-module/components/rich-text/format-toolbar-container.js +6 -4
  1015. package/build-module/components/rich-text/format-toolbar-container.js.map +1 -1
  1016. package/build-module/components/rich-text/index.js +44 -40
  1017. package/build-module/components/rich-text/index.js.map +1 -1
  1018. package/build-module/components/rich-text/index.native.js +145 -122
  1019. package/build-module/components/rich-text/index.native.js.map +1 -1
  1020. package/build-module/components/rich-text/input-event.js +5 -4
  1021. package/build-module/components/rich-text/input-event.js.map +1 -1
  1022. package/build-module/components/rich-text/shortcut.js +6 -5
  1023. package/build-module/components/rich-text/shortcut.js.map +1 -1
  1024. package/build-module/components/rich-text/split-value.js +10 -8
  1025. package/build-module/components/rich-text/split-value.js.map +1 -1
  1026. package/build-module/components/rich-text/toolbar-button.js +7 -6
  1027. package/build-module/components/rich-text/toolbar-button.js.map +1 -1
  1028. package/build-module/components/rich-text/use-caret-in-format.js +4 -3
  1029. package/build-module/components/rich-text/use-caret-in-format.js.map +1 -1
  1030. package/build-module/components/rich-text/use-enter.js +6 -3
  1031. package/build-module/components/rich-text/use-enter.js.map +1 -1
  1032. package/build-module/components/rich-text/use-format-types.js +13 -10
  1033. package/build-module/components/rich-text/use-format-types.js.map +1 -1
  1034. package/build-module/components/rich-text/use-input-rules.js +15 -9
  1035. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  1036. package/build-module/components/rich-text/use-mark-persistent.js +5 -4
  1037. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  1038. package/build-module/components/rich-text/use-paste-handler.js +28 -4
  1039. package/build-module/components/rich-text/use-paste-handler.js.map +1 -1
  1040. package/build-module/components/rich-text/utils.js +7 -5
  1041. package/build-module/components/rich-text/utils.js.map +1 -1
  1042. package/build-module/components/skip-to-selected-block/index.js +4 -3
  1043. package/build-module/components/skip-to-selected-block/index.js.map +1 -1
  1044. package/build-module/components/text-decoration-control/index.js +5 -4
  1045. package/build-module/components/text-decoration-control/index.js.map +1 -1
  1046. package/build-module/components/text-transform-control/index.js +5 -4
  1047. package/build-module/components/text-transform-control/index.js.map +1 -1
  1048. package/build-module/components/tool-selector/index.js +16 -13
  1049. package/build-module/components/tool-selector/index.js.map +1 -1
  1050. package/build-module/components/typewriter/index.js +9 -6
  1051. package/build-module/components/typewriter/index.js.map +1 -1
  1052. package/build-module/components/ungroup-button/index.native.js +12 -9
  1053. package/build-module/components/ungroup-button/index.native.js.map +1 -1
  1054. package/build-module/components/unit-control/index.js +5 -4
  1055. package/build-module/components/unit-control/index.js.map +1 -1
  1056. package/build-module/components/url-input/index.js +23 -13
  1057. package/build-module/components/url-input/index.js.map +1 -1
  1058. package/build-module/components/url-input/index.native.js +8 -6
  1059. package/build-module/components/url-input/index.native.js.map +1 -1
  1060. package/build-module/components/url-popover/image-url-input-ui.js +12 -11
  1061. package/build-module/components/url-popover/image-url-input-ui.js.map +1 -1
  1062. package/build-module/components/url-popover/index.js +9 -8
  1063. package/build-module/components/url-popover/index.js.map +1 -1
  1064. package/build-module/components/url-popover/link-editor.js +8 -7
  1065. package/build-module/components/url-popover/link-editor.js.map +1 -1
  1066. package/build-module/components/url-popover/link-viewer-url.js +6 -5
  1067. package/build-module/components/url-popover/link-viewer-url.js.map +1 -1
  1068. package/build-module/components/url-popover/link-viewer.js +9 -8
  1069. package/build-module/components/url-popover/link-viewer.js.map +1 -1
  1070. package/build-module/components/use-block-drop-zone/index.js +8 -7
  1071. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  1072. package/build-module/components/use-moving-animation/index.js +17 -13
  1073. package/build-module/components/use-moving-animation/index.js.map +1 -1
  1074. package/build-module/components/use-no-recursive-renders/index.js +10 -6
  1075. package/build-module/components/use-no-recursive-renders/index.js.map +1 -1
  1076. package/build-module/components/use-setting/index.js +48 -9
  1077. package/build-module/components/use-setting/index.js.map +1 -1
  1078. package/build-module/components/warning/index.js +7 -6
  1079. package/build-module/components/warning/index.js.map +1 -1
  1080. package/build-module/components/warning/index.native.js +10 -9
  1081. package/build-module/components/warning/index.native.js.map +1 -1
  1082. package/build-module/components/writing-flow/index.js +5 -4
  1083. package/build-module/components/writing-flow/index.js.map +1 -1
  1084. package/build-module/hooks/align.js +9 -4
  1085. package/build-module/hooks/align.js.map +1 -1
  1086. package/build-module/hooks/border.js +8 -6
  1087. package/build-module/hooks/border.js.map +1 -1
  1088. package/build-module/hooks/color-panel.js +9 -7
  1089. package/build-module/hooks/color-panel.js.map +1 -1
  1090. package/build-module/hooks/dimensions.js +2 -1
  1091. package/build-module/hooks/dimensions.js.map +1 -1
  1092. package/build-module/hooks/duotone.js +29 -15
  1093. package/build-module/hooks/duotone.js.map +1 -1
  1094. package/build-module/hooks/font-appearance.js +54 -12
  1095. package/build-module/hooks/font-appearance.js.map +1 -1
  1096. package/build-module/hooks/font-family.js +57 -31
  1097. package/build-module/hooks/font-family.js.map +1 -1
  1098. package/build-module/hooks/font-size.js +52 -12
  1099. package/build-module/hooks/font-size.js.map +1 -1
  1100. package/build-module/hooks/gap.js +9 -7
  1101. package/build-module/hooks/gap.js.map +1 -1
  1102. package/build-module/hooks/index.js +1 -0
  1103. package/build-module/hooks/index.js.map +1 -1
  1104. package/build-module/hooks/index.native.js +1 -0
  1105. package/build-module/hooks/index.native.js.map +1 -1
  1106. package/build-module/hooks/layout.js +16 -13
  1107. package/build-module/hooks/layout.js.map +1 -1
  1108. package/build-module/hooks/letter-spacing.js +45 -10
  1109. package/build-module/hooks/letter-spacing.js.map +1 -1
  1110. package/build-module/hooks/line-height.js +46 -11
  1111. package/build-module/hooks/line-height.js.map +1 -1
  1112. package/build-module/hooks/margin.js +10 -8
  1113. package/build-module/hooks/margin.js.map +1 -1
  1114. package/build-module/hooks/padding.js +10 -8
  1115. package/build-module/hooks/padding.js.map +1 -1
  1116. package/build-module/hooks/style.js +7 -3
  1117. package/build-module/hooks/style.js.map +1 -1
  1118. package/build-module/hooks/text-decoration.js +43 -9
  1119. package/build-module/hooks/text-decoration.js.map +1 -1
  1120. package/build-module/hooks/text-transform.js +43 -9
  1121. package/build-module/hooks/text-transform.js.map +1 -1
  1122. package/build-module/hooks/typography.js +119 -18
  1123. package/build-module/hooks/typography.js.map +1 -1
  1124. package/build-module/hooks/typography.native.js +2 -1
  1125. package/build-module/hooks/typography.native.js.map +1 -1
  1126. package/build-module/hooks/use-border-props.js +5 -4
  1127. package/build-module/hooks/use-border-props.js.map +1 -1
  1128. package/build-module/hooks/use-cached-truthy.js +21 -0
  1129. package/build-module/hooks/use-cached-truthy.js.map +1 -0
  1130. package/build-module/index.js +1 -1
  1131. package/build-module/index.js.map +1 -1
  1132. package/build-module/layouts/flex.js +176 -56
  1133. package/build-module/layouts/flex.js.map +1 -1
  1134. package/build-module/layouts/flow.js +10 -8
  1135. package/build-module/layouts/flow.js.map +1 -1
  1136. package/build-module/layouts/index.js +2 -1
  1137. package/build-module/layouts/index.js.map +1 -1
  1138. package/build-module/layouts/utils.js +2 -1
  1139. package/build-module/layouts/utils.js.map +1 -1
  1140. package/build-module/store/actions.js +410 -320
  1141. package/build-module/store/actions.js.map +1 -1
  1142. package/build-module/store/array.js +2 -1
  1143. package/build-module/store/array.js.map +1 -1
  1144. package/build-module/store/index.js +1 -2
  1145. package/build-module/store/index.js.map +1 -1
  1146. package/build-module/store/reducer.js +129 -54
  1147. package/build-module/store/reducer.js.map +1 -1
  1148. package/build-module/store/selectors.js +197 -117
  1149. package/build-module/store/selectors.js.map +1 -1
  1150. package/build-module/utils/block-variation-transforms.js +4 -3
  1151. package/build-module/utils/block-variation-transforms.js.map +1 -1
  1152. package/build-module/utils/get-paste-event-data.js +10 -6
  1153. package/build-module/utils/get-paste-event-data.js.map +1 -1
  1154. package/build-module/utils/math.js +2 -1
  1155. package/build-module/utils/math.js.map +1 -1
  1156. package/build-module/utils/parse-css-unit-to-px.js +5 -2
  1157. package/build-module/utils/parse-css-unit-to-px.js.map +1 -1
  1158. package/build-module/utils/transform-styles/index.js +8 -6
  1159. package/build-module/utils/transform-styles/index.js.map +1 -1
  1160. package/build-module/utils/transform-styles/transforms/wrap.js +28 -25
  1161. package/build-module/utils/transform-styles/transforms/wrap.js.map +1 -1
  1162. package/build-style/style-rtl.css +160 -57
  1163. package/build-style/style.css +160 -57
  1164. package/package.json +27 -28
  1165. package/src/components/alignment-control/test/__snapshots__/index.js.snap +0 -2
  1166. package/src/components/alignment-control/ui.js +1 -4
  1167. package/src/components/block-draggable/style.scss +19 -4
  1168. package/src/components/block-icon/index.js +4 -1
  1169. package/src/components/block-inspector/index.js +5 -0
  1170. package/src/components/block-list/index.native.js +1 -1
  1171. package/src/components/block-list/use-block-props/use-multi-selection.js +27 -7
  1172. package/src/components/block-navigation/dropdown.js +0 -1
  1173. package/src/components/block-patterns-list/index.js +1 -8
  1174. package/src/components/block-patterns-list/style.scss +22 -12
  1175. package/src/components/block-settings/container.native.js +7 -0
  1176. package/src/components/block-settings-menu/block-settings-dropdown.js +19 -7
  1177. package/src/components/block-styles/preview.native.js +2 -2
  1178. package/src/components/block-switcher/test/__snapshots__/index.js.snap +1 -1
  1179. package/src/components/color-palette/test/__snapshots__/control.js.snap +88 -63
  1180. package/src/components/colors-gradients/control.js +19 -62
  1181. package/src/components/colors-gradients/panel-color-gradient-settings.js +76 -6
  1182. package/src/components/colors-gradients/style.scss +3 -14
  1183. package/src/components/colors-gradients/test/control.js +0 -16
  1184. package/src/components/duotone-control/index.js +6 -0
  1185. package/src/components/duotone-control/style.scss +27 -12
  1186. package/src/components/font-appearance-control/index.js +22 -14
  1187. package/src/components/iframe/index.js +1 -1
  1188. package/src/components/index.js +3 -4
  1189. package/src/components/index.native.js +1 -4
  1190. package/src/components/inner-blocks/index.js +4 -4
  1191. package/src/components/inner-blocks/index.native.js +7 -4
  1192. package/src/components/inserter/block-patterns-explorer/explorer.js +50 -0
  1193. package/src/components/inserter/block-patterns-explorer/patterns-list.js +122 -0
  1194. package/src/components/inserter/block-patterns-explorer/sidebar.js +73 -0
  1195. package/src/components/inserter/block-patterns-tab.js +107 -80
  1196. package/src/components/inserter/hooks/use-block-type-impressions.native.js +14 -21
  1197. package/src/components/inserter/pattern-panel.js +33 -16
  1198. package/src/components/inserter/style.scss +64 -1
  1199. package/src/components/inserter/test/block-types-tab.native.js +1 -1
  1200. package/src/components/inserter/test/fixtures/index.native.js +12 -0
  1201. package/src/components/inspector-controls/groups.js +4 -0
  1202. package/src/components/letter-spacing-control/index.js +12 -6
  1203. package/src/components/link-control/README.md +7 -0
  1204. package/src/components/link-control/index.js +99 -34
  1205. package/src/components/link-control/link-preview.js +21 -9
  1206. package/src/components/link-control/search-input.js +9 -3
  1207. package/src/components/link-control/style.scss +32 -16
  1208. package/src/components/link-control/test/index.js +179 -4
  1209. package/src/components/list-view/block.js +67 -23
  1210. package/src/components/list-view/branch.js +113 -91
  1211. package/src/components/list-view/index.js +58 -19
  1212. package/src/components/list-view/leaf.js +1 -1
  1213. package/src/components/list-view/style.scss +14 -3
  1214. package/src/components/list-view/use-list-view-client-ids.js +7 -66
  1215. package/src/components/rich-text/embed-handler-picker.native.js +1 -0
  1216. package/src/components/rich-text/format-edit.js +36 -2
  1217. package/src/components/rich-text/format-toolbar/index.js +3 -0
  1218. package/src/components/rich-text/use-paste-handler.js +22 -0
  1219. package/src/components/url-input/index.js +14 -4
  1220. package/src/components/use-setting/index.js +49 -11
  1221. package/src/hooks/border.js +8 -11
  1222. package/src/hooks/color-panel.js +1 -0
  1223. package/src/hooks/duotone.js +21 -7
  1224. package/src/hooks/font-appearance.js +38 -7
  1225. package/src/hooks/font-family.js +29 -13
  1226. package/src/hooks/font-size.js +42 -6
  1227. package/src/hooks/index.js +1 -0
  1228. package/src/hooks/index.native.js +1 -0
  1229. package/src/hooks/layout.scss +3 -1
  1230. package/src/hooks/letter-spacing.js +35 -7
  1231. package/src/hooks/line-height.js +37 -9
  1232. package/src/hooks/margin.js +1 -1
  1233. package/src/hooks/padding.js +1 -1
  1234. package/src/hooks/text-decoration.js +34 -6
  1235. package/src/hooks/text-transform.js +34 -6
  1236. package/src/hooks/typography.js +165 -15
  1237. package/src/hooks/typography.scss +16 -0
  1238. package/src/hooks/use-cached-truthy.js +20 -0
  1239. package/src/index.js +1 -0
  1240. package/src/layouts/flex.js +155 -41
  1241. package/src/store/actions.js +223 -391
  1242. package/src/store/index.js +1 -2
  1243. package/src/store/reducer.js +36 -18
  1244. package/src/store/selectors.js +52 -47
  1245. package/src/store/test/actions.js +395 -694
  1246. package/src/store/test/selectors.js +79 -21
  1247. package/src/style.scss +1 -1
  1248. package/src/utils/test/parse-css-unit-to-px.js +127 -167
  1249. package/build/components/text-decoration-and-transform/index.js +0 -39
  1250. package/build/components/text-decoration-and-transform/index.js.map +0 -1
  1251. package/build/store/controls.js +0 -44
  1252. package/build/store/controls.js.map +0 -1
  1253. package/build-module/components/text-decoration-and-transform/index.js +0 -30
  1254. package/build-module/components/text-decoration-and-transform/index.js.map +0 -1
  1255. package/build-module/store/controls.js +0 -32
  1256. package/build-module/store/controls.js.map +0 -1
  1257. package/src/components/text-decoration-and-transform/index.js +0 -36
  1258. package/src/components/text-decoration-and-transform/style.scss +0 -3
  1259. package/src/store/controls.js +0 -39
@@ -100,10 +100,11 @@ function createColorHOC(colorTypes, withColorPalette) {
100
100
  };
101
101
  }
102
102
 
103
- static getDerivedStateFromProps({
104
- attributes,
105
- colors
106
- }, previousState) {
103
+ static getDerivedStateFromProps(_ref, previousState) {
104
+ let {
105
+ attributes,
106
+ colors
107
+ } = _ref;
107
108
  return reduce(colorMap, (newState, colorContext, colorAttributeName) => {
108
109
  const colorObject = getColorObjectByAttributeValues(colors, attributes[colorAttributeName], attributes[`custom${upperFirst(colorAttributeName)}`]);
109
110
  const previousColorObject = previousState[colorAttributeName];
@@ -162,8 +163,13 @@ function createColorHOC(colorTypes, withColorPalette) {
162
163
 
163
164
 
164
165
  export function createCustomColorsHOC(colorsArray) {
165
- return (...colorTypes) => {
166
+ return function () {
166
167
  const withColorPalette = withCustomColorPalette(colorsArray);
168
+
169
+ for (var _len = arguments.length, colorTypes = new Array(_len), _key = 0; _key < _len; _key++) {
170
+ colorTypes[_key] = arguments[_key];
171
+ }
172
+
167
173
  return createHigherOrderComponent(createColorHOC(colorTypes, withColorPalette), 'withCustomColors');
168
174
  };
169
175
  }
@@ -192,8 +198,13 @@ export function createCustomColorsHOC(colorsArray) {
192
198
  * @return {Function} Higher-order component.
193
199
  */
194
200
 
195
- export default function withColors(...colorTypes) {
201
+ export default function withColors() {
196
202
  const withColorPalette = withEditorColorPalette();
203
+
204
+ for (var _len2 = arguments.length, colorTypes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
205
+ colorTypes[_key2] = arguments[_key2];
206
+ }
207
+
197
208
  return createHigherOrderComponent(createColorHOC(colorTypes, withColorPalette), 'withColors');
198
209
  }
199
210
  //# sourceMappingURL=with-colors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"names":["isString","kebabCase","reduce","upperFirst","Component","compose","createHigherOrderComponent","getColorClassName","getColorObjectByColorValue","getColorObjectByAttributeValues","getMostReadableColor","useSetting","DEFAULT_COLORS","withCustomColorPalette","colorsArray","WrappedComponent","props","withEditorColorPalette","colors","createColorHOC","colorTypes","withColorPalette","colorMap","colorObject","colorType","constructor","setters","createSetters","colorUtils","bind","state","colorValue","settersAccumulator","colorContext","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","attributes","previousState","newState","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"mappings":";;;AAAA;AACA;AACA;AACA,SAASA,QAAT,EAAmBC,SAAnB,EAA8BC,MAA9B,EAAsCC,UAAtC,QAAwD,QAAxD;AAEA;AACA;AACA;;AACA,SAASC,SAAT,QAA0B,oBAA1B;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,MAAMC,cAAc,GAAG,EAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,sBAAsB,GAAKC,WAAF,IAC9BR,0BAA0B,CACvBS,gBAAF,IAA0BC,KAAF,IACvB,cAAC,gBAAD,eAAuBA,KAAvB;AAA+B,EAAA,MAAM,EAAGF;AAAxC,GAFwB,EAIzB,wBAJyB,CAD3B;AAQA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,sBAAsB,GAAG,MAC9BX,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C,UAAF,EAAcC,gBAAd,CADkB,EAEhC,YAFgC,CAAjC;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { isString, kebabCase, reduce, upperFirst } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { 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\nconst DEFAULT_COLORS = [];\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),\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\tconst colors = useSetting( 'color.palette' ) || DEFAULT_COLORS;\n\t\t\treturn <WrappedComponent { ...props } colors={ colors } />;\n\t\t},\n\t\t'withEditorColorPalette'\n\t);\n\n/**\n * Helper function used with `createHigherOrderComponent` to create\n * higher order components for managing color logic.\n *\n * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).\n * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.\n *\n * @return {WPComponent} The component that can be used as a HOC.\n */\nfunction createColorHOC( colorTypes, withColorPalette ) {\n\tconst colorMap = reduce(\n\t\tcolorTypes,\n\t\t( colorObject, colorType ) => {\n\t\t\treturn {\n\t\t\t\t...colorObject,\n\t\t\t\t...( isString( colorType )\n\t\t\t\t\t? { [ colorType ]: kebabCase( colorType ) }\n\t\t\t\t\t: colorType ),\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\treturn compose( [\n\t\twithColorPalette,\n\t\t( WrappedComponent ) => {\n\t\t\treturn class extends Component {\n\t\t\t\tconstructor( props ) {\n\t\t\t\t\tsuper( props );\n\n\t\t\t\t\tthis.setters = this.createSetters();\n\t\t\t\t\tthis.colorUtils = {\n\t\t\t\t\t\tgetMostReadableColor: this.getMostReadableColor.bind(\n\t\t\t\t\t\t\tthis\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.state = {};\n\t\t\t\t}\n\n\t\t\t\tgetMostReadableColor( colorValue ) {\n\t\t\t\t\tconst { colors } = this.props;\n\t\t\t\t\treturn getMostReadableColor( colors, colorValue );\n\t\t\t\t}\n\n\t\t\t\tcreateSetters() {\n\t\t\t\t\treturn reduce(\n\t\t\t\t\t\tcolorMap,\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tsettersAccumulator,\n\t\t\t\t\t\t\tcolorContext,\n\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tconst upperFirstColorAttributeName = upperFirst(\n\t\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst customColorAttributeName = `custom${ upperFirstColorAttributeName }`;\n\t\t\t\t\t\t\tsettersAccumulator[\n\t\t\t\t\t\t\t\t`set${ upperFirstColorAttributeName }`\n\t\t\t\t\t\t\t] = this.createSetColor(\n\t\t\t\t\t\t\t\tcolorAttributeName,\n\t\t\t\t\t\t\t\tcustomColorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn settersAccumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcreateSetColor( colorAttributeName, customColorAttributeName ) {\n\t\t\t\t\treturn ( colorValue ) => {\n\t\t\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\t\t\tthis.props.colors,\n\t\t\t\t\t\t\tcolorValue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.props.setAttributes( {\n\t\t\t\t\t\t\t[ colorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? colorObject.slug\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t[ customColorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: colorValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tstatic getDerivedStateFromProps(\n\t\t\t\t\t{ attributes, colors },\n\t\t\t\t\tpreviousState\n\t\t\t\t) {\n\t\t\t\t\treturn reduce(\n\t\t\t\t\t\tcolorMap,\n\t\t\t\t\t\t( newState, colorContext, colorAttributeName ) => {\n\t\t\t\t\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\t\tattributes[ colorAttributeName ],\n\t\t\t\t\t\t\t\tattributes[\n\t\t\t\t\t\t\t\t\t`custom${ upperFirst(\n\t\t\t\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t\t\t\t) }`\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tconst previousColorObject =\n\t\t\t\t\t\t\t\tpreviousState[ colorAttributeName ];\n\t\t\t\t\t\t\tconst previousColor = previousColorObject?.color;\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The \"and previousColorObject\" condition checks that a previous color object was already computed.\n\t\t\t\t\t\t\t * At the start previousColorObject and colorValue are both equal to undefined\n\t\t\t\t\t\t\t * bus as previousColorObject does not exist we should compute the object.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tpreviousColor === colorObject.color &&\n\t\t\t\t\t\t\t\tpreviousColorObject\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewState[\n\t\t\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t\t\t] = previousColorObject;\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":["isString","kebabCase","reduce","upperFirst","Component","compose","createHigherOrderComponent","getColorClassName","getColorObjectByColorValue","getColorObjectByAttributeValues","getMostReadableColor","useSetting","DEFAULT_COLORS","withCustomColorPalette","colorsArray","WrappedComponent","props","withEditorColorPalette","colors","createColorHOC","colorTypes","withColorPalette","colorMap","colorObject","colorType","constructor","setters","createSetters","colorUtils","bind","state","colorValue","settersAccumulator","colorContext","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","previousState","attributes","newState","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","with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A9Hc,CAAF,CAAd;AAgIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,OAAO,SAASsB,qBAAT,CAAgCpC,WAAhC,EAA8C;AACpD,SAAO,YAAqB;AAC3B,UAAMO,gBAAgB,GAAGR,sBAAsB,CAAEC,WAAF,CAA/C;;AAD2B,sCAAhBM,UAAgB;AAAhBA,MAAAA,UAAgB;AAAA;;AAE3B,WAAOd,0BAA0B,CAChCa,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,SAAS8B,UAAT,GAAqC;AACnD,QAAM9B,gBAAgB,GAAGJ,sBAAsB,EAA/C;;AADmD,qCAAbG,UAAa;AAAbA,IAAAA,UAAa;AAAA;;AAEnD,SAAOd,0BAA0B,CAChCa,cAAc,CAAEC,UAAF,EAAcC,gBAAd,CADkB,EAEhC,YAFgC,CAAjC;AAIA","sourcesContent":["/**\n * External dependencies\n */\nimport { isString, kebabCase, reduce, upperFirst } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { 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\nconst DEFAULT_COLORS = [];\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),\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\tconst colors = useSetting( 'color.palette' ) || DEFAULT_COLORS;\n\t\t\treturn <WrappedComponent { ...props } colors={ colors } />;\n\t\t},\n\t\t'withEditorColorPalette'\n\t);\n\n/**\n * Helper function used with `createHigherOrderComponent` to create\n * higher order components for managing color logic.\n *\n * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).\n * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.\n *\n * @return {WPComponent} The component that can be used as a HOC.\n */\nfunction createColorHOC( colorTypes, withColorPalette ) {\n\tconst colorMap = reduce(\n\t\tcolorTypes,\n\t\t( colorObject, colorType ) => {\n\t\t\treturn {\n\t\t\t\t...colorObject,\n\t\t\t\t...( isString( colorType )\n\t\t\t\t\t? { [ colorType ]: kebabCase( colorType ) }\n\t\t\t\t\t: colorType ),\n\t\t\t};\n\t\t},\n\t\t{}\n\t);\n\n\treturn compose( [\n\t\twithColorPalette,\n\t\t( WrappedComponent ) => {\n\t\t\treturn class extends Component {\n\t\t\t\tconstructor( props ) {\n\t\t\t\t\tsuper( props );\n\n\t\t\t\t\tthis.setters = this.createSetters();\n\t\t\t\t\tthis.colorUtils = {\n\t\t\t\t\t\tgetMostReadableColor: this.getMostReadableColor.bind(\n\t\t\t\t\t\t\tthis\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.state = {};\n\t\t\t\t}\n\n\t\t\t\tgetMostReadableColor( colorValue ) {\n\t\t\t\t\tconst { colors } = this.props;\n\t\t\t\t\treturn getMostReadableColor( colors, colorValue );\n\t\t\t\t}\n\n\t\t\t\tcreateSetters() {\n\t\t\t\t\treturn reduce(\n\t\t\t\t\t\tcolorMap,\n\t\t\t\t\t\t(\n\t\t\t\t\t\t\tsettersAccumulator,\n\t\t\t\t\t\t\tcolorContext,\n\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t) => {\n\t\t\t\t\t\t\tconst upperFirstColorAttributeName = upperFirst(\n\t\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tconst customColorAttributeName = `custom${ upperFirstColorAttributeName }`;\n\t\t\t\t\t\t\tsettersAccumulator[\n\t\t\t\t\t\t\t\t`set${ upperFirstColorAttributeName }`\n\t\t\t\t\t\t\t] = this.createSetColor(\n\t\t\t\t\t\t\t\tcolorAttributeName,\n\t\t\t\t\t\t\t\tcustomColorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn settersAccumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcreateSetColor( colorAttributeName, customColorAttributeName ) {\n\t\t\t\t\treturn ( colorValue ) => {\n\t\t\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\t\t\tthis.props.colors,\n\t\t\t\t\t\t\tcolorValue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.props.setAttributes( {\n\t\t\t\t\t\t\t[ colorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? colorObject.slug\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t[ customColorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: colorValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tstatic getDerivedStateFromProps(\n\t\t\t\t\t{ attributes, colors },\n\t\t\t\t\tpreviousState\n\t\t\t\t) {\n\t\t\t\t\treturn reduce(\n\t\t\t\t\t\tcolorMap,\n\t\t\t\t\t\t( newState, colorContext, colorAttributeName ) => {\n\t\t\t\t\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\t\tattributes[ colorAttributeName ],\n\t\t\t\t\t\t\t\tattributes[\n\t\t\t\t\t\t\t\t\t`custom${ upperFirst(\n\t\t\t\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t\t\t\t) }`\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tconst previousColorObject =\n\t\t\t\t\t\t\t\tpreviousState[ colorAttributeName ];\n\t\t\t\t\t\t\tconst previousColor = previousColorObject?.color;\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The \"and previousColorObject\" condition checks that a previous color object was already computed.\n\t\t\t\t\t\t\t * At the start previousColorObject and colorValue are both equal to undefined\n\t\t\t\t\t\t\t * bus as previousColorObject does not exist we should compute the object.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tpreviousColor === colorObject.color &&\n\t\t\t\t\t\t\t\tpreviousColorObject\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewState[\n\t\t\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t\t\t] = previousColorObject;\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,5 +1,5 @@
1
1
  import _extends from "@babel/runtime/helpers/esm/extends";
2
- import { createElement, Fragment } from "@wordpress/element";
2
+ import { createElement } from "@wordpress/element";
3
3
 
4
4
  /**
5
5
  * External dependencies
@@ -11,68 +11,31 @@ import { every, isEmpty } from 'lodash';
11
11
  */
12
12
 
13
13
  import { useState } from '@wordpress/element';
14
- import { BaseControl, __experimentalVStack as VStack, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, ColorIndicator, ColorPalette, GradientPicker } from '@wordpress/components';
15
- import { sprintf, __ } from '@wordpress/i18n';
14
+ import { BaseControl, __experimentalVStack as VStack, __experimentalToggleGroupControl as ToggleGroupControl, __experimentalToggleGroupControlOption as ToggleGroupControlOption, ColorPalette, GradientPicker } from '@wordpress/components';
15
+ import { __ } from '@wordpress/i18n';
16
16
  /**
17
17
  * Internal dependencies
18
18
  */
19
19
 
20
- import { getColorObjectByColorValue } from '../colors';
21
- import { __experimentalGetGradientObjectByGradientValue } from '../gradients';
22
- import useSetting from '../use-setting'; // translators: first %s: the color name or value (e.g. red or #ff0000)
23
-
24
- const colorIndicatorAriaLabel = __('(Color: %s)'); // translators: first %s: the gradient name or value (e.g. red to green or linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)
25
-
26
-
27
- const gradientIndicatorAriaLabel = __('(Gradient: %s)');
28
-
20
+ import useSetting from '../use-setting';
29
21
  const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
30
22
 
31
- function VisualLabel({
32
- colors,
33
- gradients,
34
- label,
35
- currentTab,
36
- colorValue,
37
- gradientValue
38
- }) {
39
- let value, ariaLabel;
40
-
41
- if (currentTab === 'color') {
42
- if (colorValue) {
43
- value = colorValue;
44
- const colorObject = getColorObjectByColorValue(colors, value);
45
- const colorName = colorObject && colorObject.name;
46
- ariaLabel = sprintf(colorIndicatorAriaLabel, colorName || value);
47
- }
48
- } else if (currentTab === 'gradient' && gradientValue) {
49
- value = gradientValue;
50
-
51
- const gradientObject = __experimentalGetGradientObjectByGradientValue(gradients, value);
52
-
53
- const gradientName = gradientObject && gradientObject.name;
54
- ariaLabel = sprintf(gradientIndicatorAriaLabel, gradientName || value);
55
- }
56
-
57
- return createElement(Fragment, null, label, !!value && createElement(ColorIndicator, {
58
- colorValue: value,
59
- "aria-label": ariaLabel
60
- }));
61
- }
62
-
63
- function ColorGradientControlInner({
64
- colors,
65
- gradients,
66
- disableCustomColors,
67
- disableCustomGradients,
68
- className,
69
- label,
70
- onColorChange,
71
- onGradientChange,
72
- colorValue,
73
- gradientValue,
74
- clearable
75
- }) {
23
+ function ColorGradientControlInner(_ref) {
24
+ let {
25
+ colors,
26
+ gradients,
27
+ disableCustomColors,
28
+ disableCustomGradients,
29
+ __experimentalHasMultipleOrigins,
30
+ className,
31
+ label,
32
+ onColorChange,
33
+ onGradientChange,
34
+ colorValue,
35
+ gradientValue,
36
+ clearable,
37
+ showTitle = true
38
+ } = _ref;
76
39
  const canChooseAColor = onColorChange && (!isEmpty(colors) || !disableCustomColors);
77
40
  const canChooseAGradient = onGradientChange && (!isEmpty(gradients) || !disableCustomGradients);
78
41
  const [currentTab, setCurrentTab] = useState(gradientValue ? 'gradient' : !!canChooseAColor && 'color');
@@ -84,15 +47,10 @@ function ColorGradientControlInner({
84
47
  return createElement(BaseControl, {
85
48
  className: classnames('block-editor-color-gradient-control', className)
86
49
  }, createElement("fieldset", null, createElement(VStack, {
87
- space: 3
88
- }, createElement("legend", null, createElement("div", {
50
+ spacing: 1
51
+ }, showTitle && createElement("legend", null, createElement("div", {
89
52
  className: "block-editor-color-gradient-control__color-indicator"
90
- }, createElement(BaseControl.VisualLabel, null, createElement(VisualLabel, {
91
- currentTab: currentTab,
92
- label: label,
93
- colorValue: colorValue,
94
- gradientValue: gradientValue
95
- })))), canChooseAColor && canChooseAGradient && createElement(ToggleGroupControl, {
53
+ }, createElement(BaseControl.VisualLabel, null, label))), canChooseAColor && canChooseAGradient && createElement(ToggleGroupControl, {
96
54
  value: currentTab,
97
55
  onChange: setCurrentTab,
98
56
  label: __('Select color type'),
@@ -112,6 +70,7 @@ function ColorGradientControlInner({
112
70
  } : onColorChange,
113
71
  colors,
114
72
  disableCustomColors,
73
+ __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
115
74
  clearable: clearable
116
75
  }), (currentTab === 'gradient' || !canChooseAColor) && createElement(GradientPicker, {
117
76
  value: gradientValue,
@@ -121,6 +80,7 @@ function ColorGradientControlInner({
121
80
  } : onGradientChange,
122
81
  gradients,
123
82
  disableCustomGradients,
83
+ __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
124
84
  clearable: clearable
125
85
  }))));
126
86
  }
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/control.js"],"names":["classnames","every","isEmpty","useState","BaseControl","__experimentalVStack","VStack","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","ColorIndicator","ColorPalette","GradientPicker","sprintf","__","getColorObjectByColorValue","__experimentalGetGradientObjectByGradientValue","useSetting","colorIndicatorAriaLabel","gradientIndicatorAriaLabel","colorsAndGradientKeys","VisualLabel","colors","gradients","label","currentTab","colorValue","gradientValue","value","ariaLabel","colorObject","colorName","name","gradientObject","gradientName","ColorGradientControlInner","disableCustomColors","disableCustomGradients","className","onColorChange","onGradientChange","clearable","canChooseAColor","canChooseAGradient","setCurrentTab","newColor","newGradient","ColorGradientControl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AACnBN,MAAAA,gBAAgB,CAAEM,WAAF,CAAhB;AACAP,MAAAA,aAAa;AACZ,KAJW,GAKZC,gBARL;AAUQjB,IAAAA,SAVR;AAUmBc,IAAAA,sBAVnB;AAWC,IAAA,SAAS,EAAGI;AAXb,IA/CF,CADD,CAND,CADD;AAyEA;;AAED,SAASM,0BAAT,CAAqCC,KAArC,EAA6C;AAC5C,QAAMC,qBAAqB,GAAG,EAA9B;AACAA,EAAAA,qBAAqB,CAAC3B,MAAtB,GAA+BL,UAAU,CAAE,eAAF,CAAzC;AACAgC,EAAAA,qBAAqB,CAAC1B,SAAtB,GAAkCN,UAAU,CAAE,iBAAF,CAA5C;AACAgC,EAAAA,qBAAqB,CAACb,mBAAtB,GAA4C,CAAEnB,UAAU,CAAE,cAAF,CAAxD;AACAgC,EAAAA,qBAAqB,CAACZ,sBAAtB,GAA+C,CAAEpB,UAAU,CAC1D,sBAD0D,CAA3D;AAIA,SACC,cAAC,yBAAD,eACWgC,qBADX,EACqCD,KADrC,EADD;AAKA;;AAED,SAASE,oBAAT,CAA+BF,KAA/B,EAAuC;AACtC,MACChD,KAAK,CAAEoB,qBAAF,EAA2B+B,GAAF,IAAWH,KAAK,CAACI,cAAN,CAAsBD,GAAtB,CAApC,CADN,EAEE;AACD,WAAO,cAAC,yBAAD,EAAgCH,KAAhC,CAAP;AACA;;AACD,SAAO,cAAC,0BAAD,EAAiCA,KAAjC,CAAP;AACA;;AAED,eAAeE,oBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { every, isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\tBaseControl,\n\t__experimentalVStack as VStack,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tColorIndicator,\n\tColorPalette,\n\tGradientPicker,\n} from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport { getColorObjectByColorValue } from '../colors';\nimport { __experimentalGetGradientObjectByGradientValue } from '../gradients';\nimport useSetting from '../use-setting';\n\n// translators: first %s: the color name or value (e.g. red or #ff0000)\nconst colorIndicatorAriaLabel = __( '(Color: %s)' );\n\n// translators: first %s: the gradient name or value (e.g. red to green or linear-gradient(135deg,rgba(6,147,227,1) 0%,rgb(155,81,224) 100%)\nconst gradientIndicatorAriaLabel = __( '(Gradient: %s)' );\n\nconst colorsAndGradientKeys = [\n\t'colors',\n\t'disableCustomColors',\n\t'gradients',\n\t'disableCustomGradients',\n];\n\nfunction VisualLabel( {\n\tcolors,\n\tgradients,\n\tlabel,\n\tcurrentTab,\n\tcolorValue,\n\tgradientValue,\n} ) {\n\tlet value, ariaLabel;\n\tif ( currentTab === 'color' ) {\n\t\tif ( colorValue ) {\n\t\t\tvalue = colorValue;\n\t\t\tconst colorObject = getColorObjectByColorValue( colors, value );\n\t\t\tconst colorName = colorObject && colorObject.name;\n\t\t\tariaLabel = sprintf( colorIndicatorAriaLabel, colorName || value );\n\t\t}\n\t} else if ( currentTab === 'gradient' && gradientValue ) {\n\t\tvalue = gradientValue;\n\t\tconst gradientObject = __experimentalGetGradientObjectByGradientValue(\n\t\t\tgradients,\n\t\t\tvalue\n\t\t);\n\t\tconst gradientName = gradientObject && gradientObject.name;\n\t\tariaLabel = sprintf(\n\t\t\tgradientIndicatorAriaLabel,\n\t\t\tgradientName || value\n\t\t);\n\t}\n\n\treturn (\n\t\t<>\n\t\t\t{ label }\n\t\t\t{ !! value && (\n\t\t\t\t<ColorIndicator colorValue={ value } aria-label={ ariaLabel } />\n\t\t\t) }\n\t\t</>\n\t);\n}\n\nfunction ColorGradientControlInner( {\n\tcolors,\n\tgradients,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\tclassName,\n\tlabel,\n\tonColorChange,\n\tonGradientChange,\n\tcolorValue,\n\tgradientValue,\n\tclearable,\n} ) {\n\tconst canChooseAColor =\n\t\tonColorChange && ( ! isEmpty( colors ) || ! disableCustomColors );\n\tconst canChooseAGradient =\n\t\tonGradientChange &&\n\t\t( ! isEmpty( gradients ) || ! disableCustomGradients );\n\tconst [ currentTab, setCurrentTab ] = useState(\n\t\tgradientValue ? 'gradient' : !! canChooseAColor && 'color'\n\t);\n\n\tif ( ! canChooseAColor && ! canChooseAGradient ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<BaseControl\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>\n\t\t\t\t<VStack space={ 3 }>\n\t\t\t\t\t<legend>\n\t\t\t\t\t\t<div className=\"block-editor-color-gradient-control__color-indicator\">\n\t\t\t\t\t\t\t<BaseControl.VisualLabel>\n\t\t\t\t\t\t\t\t<VisualLabel\n\t\t\t\t\t\t\t\t\tcurrentTab={ currentTab }\n\t\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t\t\tcolorValue={ colorValue }\n\t\t\t\t\t\t\t\t\tgradientValue={ gradientValue }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t</BaseControl.VisualLabel>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</legend>\n\t\t\t\t\t{ canChooseAColor && canChooseAGradient && (\n\t\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\t\tvalue={ currentTab }\n\t\t\t\t\t\t\tonChange={ setCurrentTab }\n\t\t\t\t\t\t\tlabel={ __( 'Select color type' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"color\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Solid' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"gradient\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Gradient' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ( currentTab === 'color' || ! canChooseAGradient ) && (\n\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\tvalue={ colorValue }\n\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\tcanChooseAGradient\n\t\t\t\t\t\t\t\t\t? ( newColor ) => {\n\t\t\t\t\t\t\t\t\t\t\tonColorChange( newColor );\n\t\t\t\t\t\t\t\t\t\t\tonGradientChange();\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t: onColorChange\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{ ...{ colors, disableCustomColors } }\n\t\t\t\t\t\t\tclearable={ clearable }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ( currentTab === 'gradient' || ! canChooseAColor ) && (\n\t\t\t\t\t\t<GradientPicker\n\t\t\t\t\t\t\tvalue={ gradientValue }\n\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\tcanChooseAColor\n\t\t\t\t\t\t\t\t\t? ( newGradient ) => {\n\t\t\t\t\t\t\t\t\t\t\tonGradientChange( newGradient );\n\t\t\t\t\t\t\t\t\t\t\tonColorChange();\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t: onGradientChange\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{ ...{ gradients, disableCustomGradients } }\n\t\t\t\t\t\t\tclearable={ clearable }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\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\tevery( colorsAndGradientKeys, ( 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","every","isEmpty","useState","BaseControl","__experimentalVStack","VStack","__experimentalToggleGroupControl","ToggleGroupControl","__experimentalToggleGroupControlOption","ToggleGroupControlOption","ColorPalette","GradientPicker","__","useSetting","colorsAndGradientKeys","ColorGradientControlInner","colors","gradients","disableCustomColors","disableCustomGradients","__experimentalHasMultipleOrigins","className","label","onColorChange","onGradientChange","colorValue","gradientValue","clearable","showTitle","canChooseAColor","canChooseAGradient","currentTab","setCurrentTab","newColor","newGradient","ColorGradientControlSelect","props","colorGradientSettings","ColorGradientControl","key","hasOwnProperty"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,KAAT,EAAgBC,OAAhB,QAA+B,QAA/B;AAEA;AACA;AACA;;AACA,SAASC,QAAT,QAAyB,oBAAzB;AACA,SACCC,WADD,EAECC,oBAAoB,IAAIC,MAFzB,EAGCC,gCAAgC,IAAIC,kBAHrC,EAICC,sCAAsC,IAAIC,wBAJ3C,EAKCC,YALD,EAMCC,cAND,QAOO,uBAPP;AAQA,SAASC,EAAT,QAAmB,iBAAnB;AAEA;AACA;AACA;;AACA,OAAOC,UAAP,MAAuB,gBAAvB;AAEA,MAAMC,qBAAqB,GAAG,CAC7B,QAD6B,EAE7B,qBAF6B,EAG7B,WAH6B,EAI7B,wBAJ6B,CAA9B;;A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AxD;AACAwB,EAAAA,qBAAqB,CAAClB,sBAAtB,GAA+C,CAAEN,UAAU,CAC1D,sBAD0D,CAA3D;AAIA,SACC,cAAC,yBAAD,eACWwB,qBADX,EACqCD,KADrC,EADD;AAKA;;AAED,SAASE,oBAAT,CAA+BF,KAA/B,EAAuC;AACtC,MACCpC,KAAK,CAAEc,qBAAF,EAA2ByB,GAAF,IAAWH,KAAK,CAACI,cAAN,CAAsBD,GAAtB,CAApC,CADN,EAEE;AACD,WAAO,cAAC,yBAAD,EAAgCH,KAAhC,CAAP;AACA;;AACD,SAAO,cAAC,0BAAD,EAAiCA,KAAjC,CAAP;AACA;;AAED,eAAeE,oBAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { every, isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { useState } from '@wordpress/element';\nimport {\n\tBaseControl,\n\t__experimentalVStack as VStack,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n\tColorPalette,\n\tGradientPicker,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\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\nfunction ColorGradientControlInner( {\n\tcolors,\n\tgradients,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\t__experimentalHasMultipleOrigins,\n\tclassName,\n\tlabel,\n\tonColorChange,\n\tonGradientChange,\n\tcolorValue,\n\tgradientValue,\n\tclearable,\n\tshowTitle = true,\n} ) {\n\tconst canChooseAColor =\n\t\tonColorChange && ( ! isEmpty( colors ) || ! disableCustomColors );\n\tconst canChooseAGradient =\n\t\tonGradientChange &&\n\t\t( ! isEmpty( gradients ) || ! disableCustomGradients );\n\tconst [ currentTab, setCurrentTab ] = useState(\n\t\tgradientValue ? 'gradient' : !! canChooseAColor && 'color'\n\t);\n\n\tif ( ! canChooseAColor && ! canChooseAGradient ) {\n\t\treturn null;\n\t}\n\treturn (\n\t\t<BaseControl\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>\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<ToggleGroupControl\n\t\t\t\t\t\t\tvalue={ currentTab }\n\t\t\t\t\t\t\tonChange={ setCurrentTab }\n\t\t\t\t\t\t\tlabel={ __( 'Select color type' ) }\n\t\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\t\tisBlock\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"color\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Solid' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\tvalue=\"gradient\"\n\t\t\t\t\t\t\t\tlabel={ __( 'Gradient' ) }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ( currentTab === 'color' || ! canChooseAGradient ) && (\n\t\t\t\t\t\t<ColorPalette\n\t\t\t\t\t\t\tvalue={ colorValue }\n\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\tcanChooseAGradient\n\t\t\t\t\t\t\t\t\t? ( newColor ) => {\n\t\t\t\t\t\t\t\t\t\t\tonColorChange( newColor );\n\t\t\t\t\t\t\t\t\t\t\tonGradientChange();\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t: onColorChange\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{ ...{ colors, disableCustomColors } }\n\t\t\t\t\t\t\t__experimentalHasMultipleOrigins={\n\t\t\t\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclearable={ clearable }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t\t{ ( currentTab === 'gradient' || ! canChooseAColor ) && (\n\t\t\t\t\t\t<GradientPicker\n\t\t\t\t\t\t\tvalue={ gradientValue }\n\t\t\t\t\t\t\tonChange={\n\t\t\t\t\t\t\t\tcanChooseAColor\n\t\t\t\t\t\t\t\t\t? ( newGradient ) => {\n\t\t\t\t\t\t\t\t\t\t\tonGradientChange( newGradient );\n\t\t\t\t\t\t\t\t\t\t\tonColorChange();\n\t\t\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t\t\t: onGradientChange\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t{ ...{ gradients, disableCustomGradients } }\n\t\t\t\t\t\t\t__experimentalHasMultipleOrigins={\n\t\t\t\t\t\t\t\t__experimentalHasMultipleOrigins\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tclearable={ clearable }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\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\tevery( colorsAndGradientKeys, ( key ) => props.hasOwnProperty( key ) )\n\t) {\n\t\treturn <ColorGradientControlInner { ...props } />;\n\t}\n\treturn <ColorGradientControlSelect { ...props } />;\n}\n\nexport default ColorGradientControl;\n"]}
@@ -12,6 +12,7 @@ import { every, isEmpty } from 'lodash';
12
12
 
13
13
  import { PanelBody, ColorIndicator } from '@wordpress/components';
14
14
  import { sprintf, __ } from '@wordpress/i18n';
15
+ import { useMemo } from '@wordpress/element';
15
16
  /**
16
17
  * Internal dependencies
17
18
  */
@@ -28,18 +29,21 @@ const gradientIndicatorAriaLabel = __('(%s: gradient %s)');
28
29
 
29
30
  const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
30
31
 
31
- const Indicators = ({
32
- colors,
33
- gradients,
34
- settings
35
- }) => {
36
- return settings.map(({
37
- colorValue,
38
- gradientValue,
39
- label,
40
- colors: availableColors,
41
- gradients: availableGradients
42
- }, index) => {
32
+ const Indicators = _ref => {
33
+ let {
34
+ colors,
35
+ gradients,
36
+ settings
37
+ } = _ref;
38
+ return settings.map((_ref2, index) => {
39
+ let {
40
+ colorValue,
41
+ gradientValue,
42
+ label,
43
+ colors: availableColors,
44
+ gradients: availableGradients
45
+ } = _ref2;
46
+
43
47
  if (!colorValue && !gradientValue) {
44
48
  return null;
45
49
  }
@@ -63,18 +67,21 @@ const Indicators = ({
63
67
  });
64
68
  };
65
69
 
66
- export const PanelColorGradientSettingsInner = ({
67
- className,
68
- colors,
69
- gradients,
70
- disableCustomColors,
71
- disableCustomGradients,
72
- children,
73
- settings,
74
- title,
75
- showTitle = true,
76
- ...props
77
- }) => {
70
+ export const PanelColorGradientSettingsInner = _ref3 => {
71
+ let {
72
+ className,
73
+ colors,
74
+ gradients,
75
+ disableCustomColors,
76
+ disableCustomGradients,
77
+ children,
78
+ settings,
79
+ title,
80
+ showTitle = true,
81
+ __experimentalHasMultipleOrigins,
82
+ ...props
83
+ } = _ref3;
84
+
78
85
  if (isEmpty(colors) && isEmpty(gradients) && disableCustomColors && disableCustomGradients && every(settings, setting => isEmpty(setting.colors) && isEmpty(setting.gradients) && (setting.disableCustomColors === undefined || setting.disableCustomColors) && (setting.disableCustomGradients === undefined || setting.disableCustomGradients))) {
79
86
  return null;
80
87
  }
@@ -90,20 +97,90 @@ export const PanelColorGradientSettingsInner = ({
90
97
  className: classnames('block-editor-panel-color-gradient-settings', className),
91
98
  title: showTitle ? titleElement : undefined
92
99
  }, props), settings.map((setting, index) => createElement(ColorGradientControl, _extends({
100
+ showTitle: showTitle,
93
101
  key: index,
94
102
  colors,
95
103
  gradients,
96
104
  disableCustomColors,
97
- disableCustomGradients
105
+ disableCustomGradients,
106
+ __experimentalHasMultipleOrigins
98
107
  }, setting))), children);
99
108
  };
100
109
 
101
- const PanelColorGradientSettingsSelect = props => {
102
- const colorGradientSettings = {};
110
+ function useCommonSingleMultipleSelects() {
111
+ return {
112
+ disableCustomColors: !useSetting('color.custom'),
113
+ disableCustomGradients: !useSetting('color.customGradient')
114
+ };
115
+ }
116
+
117
+ const PanelColorGradientSettingsSingleSelect = props => {
118
+ const colorGradientSettings = useCommonSingleMultipleSelects();
103
119
  colorGradientSettings.colors = useSetting('color.palette');
104
120
  colorGradientSettings.gradients = useSetting('color.gradients');
105
- colorGradientSettings.disableCustomColors = !useSetting('color.custom');
106
- colorGradientSettings.disableCustomGradients = !useSetting('color.customGradient');
121
+ return createElement(PanelColorGradientSettingsInner, _extends({}, colorGradientSettings, props));
122
+ };
123
+
124
+ const PanelColorGradientSettingsMultipleSelect = props => {
125
+ const colorGradientSettings = useCommonSingleMultipleSelects();
126
+ const userColors = useSetting('color.palette.user');
127
+ const themeColors = useSetting('color.palette.theme');
128
+ const coreColors = useSetting('color.palette.core');
129
+ colorGradientSettings.colors = useMemo(() => {
130
+ const result = [];
131
+
132
+ if (coreColors && coreColors.length) {
133
+ result.push({
134
+ name: __('Core'),
135
+ colors: coreColors
136
+ });
137
+ }
138
+
139
+ if (themeColors && themeColors.length) {
140
+ result.push({
141
+ name: __('Theme'),
142
+ colors: themeColors
143
+ });
144
+ }
145
+
146
+ if (userColors && userColors.length) {
147
+ result.push({
148
+ name: __('User'),
149
+ colors: userColors
150
+ });
151
+ }
152
+
153
+ return result;
154
+ }, [coreColors, themeColors, userColors]);
155
+ const userGradients = useSetting('color.gradients.user');
156
+ const themeGradients = useSetting('color.gradients.theme');
157
+ const coreGradients = useSetting('color.gradients.core');
158
+ colorGradientSettings.gradients = useMemo(() => {
159
+ const result = [];
160
+
161
+ if (coreGradients && coreGradients.length) {
162
+ result.push({
163
+ name: __('Core'),
164
+ gradients: coreGradients
165
+ });
166
+ }
167
+
168
+ if (themeGradients && themeGradients.length) {
169
+ result.push({
170
+ name: __('Theme'),
171
+ gradients: themeGradients
172
+ });
173
+ }
174
+
175
+ if (userGradients && userGradients.length) {
176
+ result.push({
177
+ name: __('User'),
178
+ gradients: userGradients
179
+ });
180
+ }
181
+
182
+ return result;
183
+ }, [userGradients, themeGradients, coreGradients]);
107
184
  return createElement(PanelColorGradientSettingsInner, _extends({}, colorGradientSettings, props));
108
185
  };
109
186
 
@@ -112,7 +189,11 @@ const PanelColorGradientSettings = props => {
112
189
  return createElement(PanelColorGradientSettingsInner, props);
113
190
  }
114
191
 
115
- return createElement(PanelColorGradientSettingsSelect, props);
192
+ if (props.__experimentalHasMultipleOrigins) {
193
+ return createElement(PanelColorGradientSettingsMultipleSelect, props);
194
+ }
195
+
196
+ return createElement(PanelColorGradientSettingsSingleSelect, props);
116
197
  };
117
198
 
118
199
  export default PanelColorGradientSettings;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/panel-color-gradient-settings.js"],"names":["classnames","every","isEmpty","PanelBody","ColorIndicator","sprintf","__","ColorGradientControl","getColorObjectByColorValue","__experimentalGetGradientObjectByGradientValue","useSetting","colorIndicatorAriaLabel","gradientIndicatorAriaLabel","colorsAndGradientKeys","Indicators","colors","gradients","settings","map","colorValue","gradientValue","label","availableColors","availableGradients","index","ariaLabel","colorObject","toLowerCase","name","gradientObject","PanelColorGradientSettingsInner","className","disableCustomColors","disableCustomGradients","children","title","showTitle","props","setting","undefined","titleElement","PanelColorGradientSettingsSelect","colorGradientSettings","PanelColorGradientSettings","key","hasOwnProperty"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,KAAT,EAAgBC,OAAhB,QAA+B,QAA/B;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,cAApB,QAA0C,uBAA1C;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,WAAjC;AACA,SAASC,0BAAT,QAA2C,WAA3C;AACA,SAASC,8CAAT,QAA+D,cAA/D;AACA,OAAOC,UAAP,MAAuB,gBAAvB,C,CAEA;;AACA,MAAMC,uBAAuB,GAAGL,EAAE,CAAE,gBAAF,CAAlC,C,CAEA;;;AACA,MAAMM,0BAA0B,GAAGN,EAAE,CAAE,mBAAF,CAArC;;AAEA,MAAMO,qBAAqB,GAAG,CAC7B,QAD6B,EAE7B,qBAF6B,EAG7B,WAH6B,EAI7B,wBAJ6B,CAA9B;;AAOA,MAAMC,UAAU,GAAG,CAAE;AAAEC,EAAAA,MAAF;AAAUC,EAAAA,SAAV;AAAqBC,EAAAA;AAArB,CAAF,KAAuC;AACzD,SAAOA,QAAQ,CAACC,GAAT,CACN,CACC;AACCC,IAAAA,UADD;AAECC,IAAAA,aAFD;AAGCC,IAAAA,KAHD;AAICN,IAAAA,MAAM,EAAEO,eAJT;AAKCN,IAAAA,SAAS,EAAEO;AALZ,GADD,EAQCC,KARD,KASK;AACJ,QAAK,CAAEL,UAAF,IAAgB,CAAEC,aAAvB,EAAuC;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;AAeA,MAAMM,0BAA0B,GAAKN,KAAF,IAAa;AAC/C,MACCpC,KAAK,CAAEY,qBAAF,EAA2B+B,GAAF,IAAWP,KAAK,CAACQ,cAAN,CAAsBD,GAAtB,CAApC,CADN,EAEE;AACD,WAAO,cAAC,+BAAD,EAAsCP,KAAtC,CAAP;AACA;;AACD,SAAO,cAAC,gCAAD,EAAuCA,KAAvC,CAAP;AACA,CAPD;;AASA,eAAeM,0BAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { every, isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { PanelBody, ColorIndicator } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from './control';\nimport { getColorObjectByColorValue } from '../colors';\nimport { __experimentalGetGradientObjectByGradientValue } from '../gradients';\nimport useSetting from '../use-setting';\n\n// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)\nconst colorIndicatorAriaLabel = __( '(%s: color %s)' );\n\n// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)\nconst gradientIndicatorAriaLabel = __( '(%s: gradient %s)' );\n\nconst colorsAndGradientKeys = [\n\t'colors',\n\t'disableCustomColors',\n\t'gradients',\n\t'disableCustomGradients',\n];\n\nconst Indicators = ( { colors, gradients, settings } ) => {\n\treturn settings.map(\n\t\t(\n\t\t\t{\n\t\t\t\tcolorValue,\n\t\t\t\tgradientValue,\n\t\t\t\tlabel,\n\t\t\t\tcolors: availableColors,\n\t\t\t\tgradients: availableGradients,\n\t\t\t},\n\t\t\tindex\n\t\t) => {\n\t\t\tif ( ! colorValue && ! gradientValue ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlet ariaLabel;\n\t\t\tif ( colorValue ) {\n\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\tavailableColors || colors,\n\t\t\t\t\tcolorValue\n\t\t\t\t);\n\t\t\t\tariaLabel = sprintf(\n\t\t\t\t\tcolorIndicatorAriaLabel,\n\t\t\t\t\tlabel.toLowerCase(),\n\t\t\t\t\t( colorObject && colorObject.name ) || colorValue\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst gradientObject = __experimentalGetGradientObjectByGradientValue(\n\t\t\t\t\tavailableGradients || gradients,\n\t\t\t\t\tcolorValue\n\t\t\t\t);\n\t\t\t\tariaLabel = sprintf(\n\t\t\t\t\tgradientIndicatorAriaLabel,\n\t\t\t\t\tlabel.toLowerCase(),\n\t\t\t\t\t( gradientObject && gradientObject.name ) || gradientValue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<ColorIndicator\n\t\t\t\t\tkey={ index }\n\t\t\t\t\tcolorValue={ colorValue || gradientValue }\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t);\n};\n\nexport const PanelColorGradientSettingsInner = ( {\n\tclassName,\n\tcolors,\n\tgradients,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\tchildren,\n\tsettings,\n\ttitle,\n\tshowTitle = true,\n\t...props\n} ) => {\n\tif (\n\t\tisEmpty( colors ) &&\n\t\tisEmpty( gradients ) &&\n\t\tdisableCustomColors &&\n\t\tdisableCustomGradients &&\n\t\tevery(\n\t\t\tsettings,\n\t\t\t( setting ) =>\n\t\t\t\tisEmpty( setting.colors ) &&\n\t\t\t\tisEmpty( setting.gradients ) &&\n\t\t\t\t( setting.disableCustomColors === undefined ||\n\t\t\t\t\tsetting.disableCustomColors ) &&\n\t\t\t\t( setting.disableCustomGradients === undefined ||\n\t\t\t\t\tsetting.disableCustomGradients )\n\t\t)\n\t) {\n\t\treturn null;\n\t}\n\n\tconst titleElement = (\n\t\t<span className=\"block-editor-panel-color-gradient-settings__panel-title\">\n\t\t\t{ title }\n\t\t\t<Indicators\n\t\t\t\tcolors={ colors }\n\t\t\t\tgradients={ gradients }\n\t\t\t\tsettings={ settings }\n\t\t\t/>\n\t\t</span>\n\t);\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-panel-color-gradient-settings',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\ttitle={ showTitle ? titleElement : undefined }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ settings.map( ( setting, index ) => (\n\t\t\t\t<ColorGradientControl\n\t\t\t\t\tkey={ index }\n\t\t\t\t\t{ ...{\n\t\t\t\t\t\tcolors,\n\t\t\t\t\t\tgradients,\n\t\t\t\t\t\tdisableCustomColors,\n\t\t\t\t\t\tdisableCustomGradients,\n\t\t\t\t\t\t...setting,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n};\n\nconst PanelColorGradientSettingsSelect = ( 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\treturn (\n\t\t<PanelColorGradientSettingsInner\n\t\t\t{ ...{ ...colorGradientSettings, ...props } }\n\t\t/>\n\t);\n};\n\nconst PanelColorGradientSettings = ( props ) => {\n\tif (\n\t\tevery( colorsAndGradientKeys, ( key ) => props.hasOwnProperty( key ) )\n\t) {\n\t\treturn <PanelColorGradientSettingsInner { ...props } />;\n\t}\n\treturn <PanelColorGradientSettingsSelect { ...props } />;\n};\n\nexport default PanelColorGradientSettings;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/panel-color-gradient-settings.js"],"names":["classnames","every","isEmpty","PanelBody","ColorIndicator","sprintf","__","useMemo","ColorGradientControl","getColorObjectByColorValue","__experimentalGetGradientObjectByGradientValue","useSetting","colorIndicatorAriaLabel","gradientIndicatorAriaLabel","colorsAndGradientKeys","Indicators","colors","gradients","settings","map","index","colorValue","gradientValue","label","availableColors","availableGradients","ariaLabel","colorObject","toLowerCase","name","gradientObject","PanelColorGradientSettingsInner","className","disableCustomColors","disableCustomGradients","children","title","showTitle","__experimentalHasMultipleOrigins","props","setting","undefined","titleElement","useCommonSingleMultipleSelects","PanelColorGradientSettingsSingleSelect","colorGradientSettings","PanelColorGradientSettingsMultipleSelect","userColors","themeColors","coreColors","result","length","push","userGradients","themeGradients","coreGradients","PanelColorGradientSettings","key","hasOwnProperty"],"mappings":";;;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,SAASC,KAAT,EAAgBC,OAAhB,QAA+B,QAA/B;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,cAApB,QAA0C,uBAA1C;AACA,SAASC,OAAT,EAAkBC,EAAlB,QAA4B,iBAA5B;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,OAAOC,oBAAP,MAAiC,WAAjC;AACA,SAASC,0BAAT,QAA2C,WAA3C;AACA,SAASC,8CAAT,QAA+D,cAA/D;AACA,OAAOC,UAAP,MAAuB,gBAAvB,C,CAEA;;AACA,MAAMC,uBAAuB,GAAGN,EAAE,CAAE,gBAAF,CAAlC,C,CAEA;;;AACA,MAAMO,0BAA0B,GAAGP,EAAE,CAAE,mBAAF,CAArC;;AAEA,MAAMQ,qBAAqB,GAAG,CAC7B,QAD6B,EAE7B,qBAF6B,EAG7B,WAH6B,EAI7B,wBAJ6B,CAA9B;;AAOA,MAAMC,UAAU,GAAG,QAAuC;AAAA,MAArC;AAAEC,IAAAA,MAAF;AAAUC,IAAAA,SAAV;AAAqBC,IAAAA;AAArB,GAAqC;AACzD,SAAOA,QAAQ,CAACC,GAAT,CACN,QAQCC,KARD,KASK;AAAA,QARJ;AACCC,MAAAA,UADD;AAECC,MAAAA,aAFD;AAGCC,MAAAA,KAHD;AAICP,MAA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,MAAKA,KAAK,CAACD,gCAAX,EAA8C;AAC7C,WAAO,cAAC,wCAAD,EAA+CC,KAA/C,CAAP;AACA;;AACD,SAAO,cAAC,sCAAD,EAA6CA,KAA7C,CAAP;AACA,CAVD;;AAYA,eAAeiB,0BAAf","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport { every, isEmpty } from 'lodash';\n\n/**\n * WordPress dependencies\n */\nimport { PanelBody, ColorIndicator } from '@wordpress/components';\nimport { sprintf, __ } from '@wordpress/i18n';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from './control';\nimport { getColorObjectByColorValue } from '../colors';\nimport { __experimentalGetGradientObjectByGradientValue } from '../gradients';\nimport useSetting from '../use-setting';\n\n// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)\nconst colorIndicatorAriaLabel = __( '(%s: color %s)' );\n\n// translators: first %s: The type of color or gradient (e.g. background, overlay...), second %s: the color name or value (e.g. red or #ff0000)\nconst gradientIndicatorAriaLabel = __( '(%s: gradient %s)' );\n\nconst colorsAndGradientKeys = [\n\t'colors',\n\t'disableCustomColors',\n\t'gradients',\n\t'disableCustomGradients',\n];\n\nconst Indicators = ( { colors, gradients, settings } ) => {\n\treturn settings.map(\n\t\t(\n\t\t\t{\n\t\t\t\tcolorValue,\n\t\t\t\tgradientValue,\n\t\t\t\tlabel,\n\t\t\t\tcolors: availableColors,\n\t\t\t\tgradients: availableGradients,\n\t\t\t},\n\t\t\tindex\n\t\t) => {\n\t\t\tif ( ! colorValue && ! gradientValue ) {\n\t\t\t\treturn null;\n\t\t\t}\n\t\t\tlet ariaLabel;\n\t\t\tif ( colorValue ) {\n\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\tavailableColors || colors,\n\t\t\t\t\tcolorValue\n\t\t\t\t);\n\t\t\t\tariaLabel = sprintf(\n\t\t\t\t\tcolorIndicatorAriaLabel,\n\t\t\t\t\tlabel.toLowerCase(),\n\t\t\t\t\t( colorObject && colorObject.name ) || colorValue\n\t\t\t\t);\n\t\t\t} else {\n\t\t\t\tconst gradientObject = __experimentalGetGradientObjectByGradientValue(\n\t\t\t\t\tavailableGradients || gradients,\n\t\t\t\t\tcolorValue\n\t\t\t\t);\n\t\t\t\tariaLabel = sprintf(\n\t\t\t\t\tgradientIndicatorAriaLabel,\n\t\t\t\t\tlabel.toLowerCase(),\n\t\t\t\t\t( gradientObject && gradientObject.name ) || gradientValue\n\t\t\t\t);\n\t\t\t}\n\n\t\t\treturn (\n\t\t\t\t<ColorIndicator\n\t\t\t\t\tkey={ index }\n\t\t\t\t\tcolorValue={ colorValue || gradientValue }\n\t\t\t\t\taria-label={ ariaLabel }\n\t\t\t\t/>\n\t\t\t);\n\t\t}\n\t);\n};\n\nexport const PanelColorGradientSettingsInner = ( {\n\tclassName,\n\tcolors,\n\tgradients,\n\tdisableCustomColors,\n\tdisableCustomGradients,\n\tchildren,\n\tsettings,\n\ttitle,\n\tshowTitle = true,\n\t__experimentalHasMultipleOrigins,\n\t...props\n} ) => {\n\tif (\n\t\tisEmpty( colors ) &&\n\t\tisEmpty( gradients ) &&\n\t\tdisableCustomColors &&\n\t\tdisableCustomGradients &&\n\t\tevery(\n\t\t\tsettings,\n\t\t\t( setting ) =>\n\t\t\t\tisEmpty( setting.colors ) &&\n\t\t\t\tisEmpty( setting.gradients ) &&\n\t\t\t\t( setting.disableCustomColors === undefined ||\n\t\t\t\t\tsetting.disableCustomColors ) &&\n\t\t\t\t( setting.disableCustomGradients === undefined ||\n\t\t\t\t\tsetting.disableCustomGradients )\n\t\t)\n\t) {\n\t\treturn null;\n\t}\n\n\tconst titleElement = (\n\t\t<span className=\"block-editor-panel-color-gradient-settings__panel-title\">\n\t\t\t{ title }\n\t\t\t<Indicators\n\t\t\t\tcolors={ colors }\n\t\t\t\tgradients={ gradients }\n\t\t\t\tsettings={ settings }\n\t\t\t/>\n\t\t</span>\n\t);\n\n\treturn (\n\t\t<PanelBody\n\t\t\tclassName={ classnames(\n\t\t\t\t'block-editor-panel-color-gradient-settings',\n\t\t\t\tclassName\n\t\t\t) }\n\t\t\ttitle={ showTitle ? titleElement : undefined }\n\t\t\t{ ...props }\n\t\t>\n\t\t\t{ settings.map( ( setting, index ) => (\n\t\t\t\t<ColorGradientControl\n\t\t\t\t\tshowTitle={ showTitle }\n\t\t\t\t\tkey={ index }\n\t\t\t\t\t{ ...{\n\t\t\t\t\t\tcolors,\n\t\t\t\t\t\tgradients,\n\t\t\t\t\t\tdisableCustomColors,\n\t\t\t\t\t\tdisableCustomGradients,\n\t\t\t\t\t\t__experimentalHasMultipleOrigins,\n\t\t\t\t\t\t...setting,\n\t\t\t\t\t} }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ children }\n\t\t</PanelBody>\n\t);\n};\n\nfunction useCommonSingleMultipleSelects() {\n\treturn {\n\t\tdisableCustomColors: ! useSetting( 'color.custom' ),\n\t\tdisableCustomGradients: ! useSetting( 'color.customGradient' ),\n\t};\n}\n\nconst PanelColorGradientSettingsSingleSelect = ( props ) => {\n\tconst colorGradientSettings = useCommonSingleMultipleSelects();\n\tcolorGradientSettings.colors = useSetting( 'color.palette' );\n\tcolorGradientSettings.gradients = useSetting( 'color.gradients' );\n\treturn (\n\t\t<PanelColorGradientSettingsInner\n\t\t\t{ ...{ ...colorGradientSettings, ...props } }\n\t\t/>\n\t);\n};\n\nconst PanelColorGradientSettingsMultipleSelect = ( props ) => {\n\tconst colorGradientSettings = useCommonSingleMultipleSelects();\n\tconst userColors = useSetting( 'color.palette.user' );\n\tconst themeColors = useSetting( 'color.palette.theme' );\n\tconst coreColors = useSetting( 'color.palette.core' );\n\tcolorGradientSettings.colors = useMemo( () => {\n\t\tconst result = [];\n\t\tif ( coreColors && coreColors.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: __( 'Core' ),\n\t\t\t\tcolors: coreColors,\n\t\t\t} );\n\t\t}\n\t\tif ( themeColors && themeColors.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: __( 'Theme' ),\n\t\t\t\tcolors: themeColors,\n\t\t\t} );\n\t\t}\n\t\tif ( userColors && userColors.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: __( 'User' ),\n\t\t\t\tcolors: userColors,\n\t\t\t} );\n\t\t}\n\t\treturn result;\n\t}, [ coreColors, themeColors, userColors ] );\n\n\tconst userGradients = useSetting( 'color.gradients.user' );\n\tconst themeGradients = useSetting( 'color.gradients.theme' );\n\tconst coreGradients = useSetting( 'color.gradients.core' );\n\tcolorGradientSettings.gradients = useMemo( () => {\n\t\tconst result = [];\n\t\tif ( coreGradients && coreGradients.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: __( 'Core' ),\n\t\t\t\tgradients: coreGradients,\n\t\t\t} );\n\t\t}\n\t\tif ( themeGradients && themeGradients.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: __( 'Theme' ),\n\t\t\t\tgradients: themeGradients,\n\t\t\t} );\n\t\t}\n\t\tif ( userGradients && userGradients.length ) {\n\t\t\tresult.push( {\n\t\t\t\tname: __( 'User' ),\n\t\t\t\tgradients: userGradients,\n\t\t\t} );\n\t\t}\n\t\treturn result;\n\t}, [ userGradients, themeGradients, coreGradients ] );\n\treturn (\n\t\t<PanelColorGradientSettingsInner\n\t\t\t{ ...{ ...colorGradientSettings, ...props } }\n\t\t/>\n\t);\n};\n\nconst PanelColorGradientSettings = ( props ) => {\n\tif (\n\t\tevery( colorsAndGradientKeys, ( key ) => props.hasOwnProperty( key ) )\n\t) {\n\t\treturn <PanelColorGradientSettingsInner { ...props } />;\n\t}\n\tif ( props.__experimentalHasMultipleOrigins ) {\n\t\treturn <PanelColorGradientSettingsMultipleSelect { ...props } />;\n\t}\n\treturn <PanelColorGradientSettingsSingleSelect { ...props } />;\n};\n\nexport default PanelColorGradientSettings;\n"]}
@@ -15,32 +15,36 @@ import { useMemo } from '@wordpress/element';
15
15
  */
16
16
 
17
17
  import { blockSettingsScreens } from '../block-settings';
18
- export default function PanelColorGradientSettings({
19
- settings,
20
- title
21
- }) {
18
+ export default function PanelColorGradientSettings(_ref) {
19
+ let {
20
+ settings,
21
+ title
22
+ } = _ref;
22
23
  const navigation = useNavigation();
23
24
  const mappedSettings = useMemo(() => {
24
- return settings.map(({
25
- onColorChange,
26
- colorValue,
27
- onGradientChange,
28
- gradientValue,
29
- label
30
- }) => createElement(ColorControl, {
31
- onPress: () => {
32
- navigation.navigate(blockSettingsScreens.color, {
33
- onColorChange,
34
- colorValue: gradientValue || colorValue,
35
- gradientValue,
36
- onGradientChange,
37
- label
38
- });
39
- },
40
- key: `color-setting-${label}`,
41
- label: label,
42
- color: gradientValue || colorValue
43
- }));
25
+ return settings.map(_ref2 => {
26
+ let {
27
+ onColorChange,
28
+ colorValue,
29
+ onGradientChange,
30
+ gradientValue,
31
+ label
32
+ } = _ref2;
33
+ return createElement(ColorControl, {
34
+ onPress: () => {
35
+ navigation.navigate(blockSettingsScreens.color, {
36
+ onColorChange,
37
+ colorValue: gradientValue || colorValue,
38
+ gradientValue,
39
+ onGradientChange,
40
+ label
41
+ });
42
+ },
43
+ key: `color-setting-${label}`,
44
+ label: label,
45
+ color: gradientValue || colorValue
46
+ });
47
+ });
44
48
  }, [settings]);
45
49
  return createElement(PanelBody, {
46
50
  title: title
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/panel-color-gradient-settings.native.js"],"names":["useNavigation","ColorControl","PanelBody","useMemo","blockSettingsScreens","PanelColorGradientSettings","settings","title","navigation","mappedSettings","map","onColorChange","colorValue","onGradientChange","gradientValue","label","navigate","color"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,0BAA9B;AAEA;AACA;AACA;;AACA,SAASC,YAAT,EAAuBC,SAAvB,QAAwC,uBAAxC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,mBAArC;AAEA,eAAe,SAASC,0BAAT,CAAqC;AAAEC,EAAAA,QAAF;AAAYC,EAAAA;AAAZ,CAArC,EAA2D;AACzE,QAAMC,UAAU,GAAGR,aAAa,EAAhC;AAEA,QAAMS,cAAc,GAAGN,OAAO,CAAE,MAAM;AACrC,WAAOG,QAAQ,CAACI,GAAT,CACN,CAAE;AACDC,MAAAA,aADC;AAEDC,MAAAA,UAFC;AAGDC,MAAAA,gBAHC;AAIDC,MAAAA,aAJC;AAKDC,MAAAA;AALC,KAAF,KAOC,cAAC,YAAD;AACC,MAAA,OAAO,EAAG,MAAM;AACfP,QAAAA,UAAU,CAACQ,QAAX,CAAqBZ,oBAAoB,CAACa,KAA1C,EAAiD;AAChDN,UAAAA,aADgD;AAEhDC,UAAAA,UAAU,EAAEE,aAAa,IAAIF,UAFmB;AAGhDE,UAAAA,aAHgD;AAIhDD,UAAAA,gBAJgD;AAKhDE,UAAAA;AALgD,SAAjD;AAOA,OATF;AAUC,MAAA,GAAG,EAAI,iBAAiBA,KAAO,EAVhC;AAWC,MAAA,KAAK,EAAGA,KAXT;AAYC,MAAA,KAAK,EAAGD,aAAa,IAAIF;AAZ1B,MARK,CAAP;AAwBA,GAzB6B,EAyB3B,CAAEN,QAAF,CAzB2B,CAA9B;AA2BA,SAAO,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGC;AAAnB,KAA6BE,cAA7B,CAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { ColorControl, PanelBody } from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { blockSettingsScreens } from '../block-settings';\n\nexport default function PanelColorGradientSettings( { settings, title } ) {\n\tconst navigation = useNavigation();\n\n\tconst mappedSettings = useMemo( () => {\n\t\treturn settings.map(\n\t\t\t( {\n\t\t\t\tonColorChange,\n\t\t\t\tcolorValue,\n\t\t\t\tonGradientChange,\n\t\t\t\tgradientValue,\n\t\t\t\tlabel,\n\t\t\t} ) => (\n\t\t\t\t<ColorControl\n\t\t\t\t\tonPress={ () => {\n\t\t\t\t\t\tnavigation.navigate( blockSettingsScreens.color, {\n\t\t\t\t\t\t\tonColorChange,\n\t\t\t\t\t\t\tcolorValue: gradientValue || colorValue,\n\t\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\t\tonGradientChange,\n\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tkey={ `color-setting-${ label }` }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tcolor={ gradientValue || colorValue }\n\t\t\t\t/>\n\t\t\t)\n\t\t);\n\t}, [ settings ] );\n\n\treturn <PanelBody title={ title }>{ mappedSettings }</PanelBody>;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors-gradients/panel-color-gradient-settings.native.js"],"names":["useNavigation","ColorControl","PanelBody","useMemo","blockSettingsScreens","PanelColorGradientSettings","settings","title","navigation","mappedSettings","map","onColorChange","colorValue","onGradientChange","gradientValue","label","navigate","color"],"mappings":";;AAAA;AACA;AACA;AACA,SAASA,aAAT,QAA8B,0BAA9B;AAEA;AACA;AACA;;AACA,SAASC,YAAT,EAAuBC,SAAvB,QAAwC,uBAAxC;AACA,SAASC,OAAT,QAAwB,oBAAxB;AAEA;AACA;AACA;;AACA,SAASC,oBAAT,QAAqC,mBAArC;AAEA,eAAe,SAASC,0BAAT,OAA2D;AAAA,MAAtB;AAAEC,IAAAA,QAAF;AAAYC,IAAAA;AAAZ,GAAsB;AACzE,QAAMC,UAAU,GAAGR,aAAa,EAAhC;AAEA,QAAMS,cAAc,GAAGN,OAAO,CAAE,MAAM;AACrC,WAAOG,QAAQ,CAACI,GAAT,CACN;AAAA,UAAE;AACDC,QAAAA,aADC;AAEDC,QAAAA,UAFC;AAGDC,QAAAA,gBAHC;AAIDC,QAAAA,aAJC;AAKDC,QAAAA;AALC,OAAF;AAAA,aAOC,cAAC,YAAD;AACC,QAAA,OAAO,EAAG,MAAM;AACfP,UAAAA,UAAU,CAACQ,QAAX,CAAqBZ,oBAAoB,CAACa,KAA1C,EAAiD;AAChDN,YAAAA,aADgD;AAEhDC,YAAAA,UAAU,EAAEE,aAAa,IAAIF,UAFmB;AAGhDE,YAAAA,aAHgD;AAIhDD,YAAAA,gBAJgD;AAKhDE,YAAAA;AALgD,WAAjD;AAOA,SATF;AAUC,QAAA,GAAG,EAAI,iBAAiBA,KAAO,EAVhC;AAWC,QAAA,KAAK,EAAGA,KAXT;AAYC,QAAA,KAAK,EAAGD,aAAa,IAAIF;AAZ1B,QAPD;AAAA,KADM,CAAP;AAwBA,GAzB6B,EAyB3B,CAAEN,QAAF,CAzB2B,CAA9B;AA2BA,SAAO,cAAC,SAAD;AAAW,IAAA,KAAK,EAAGC;AAAnB,KAA6BE,cAA7B,CAAP;AACA","sourcesContent":["/**\n * External dependencies\n */\nimport { useNavigation } from '@react-navigation/native';\n\n/**\n * WordPress dependencies\n */\nimport { ColorControl, PanelBody } from '@wordpress/components';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport { blockSettingsScreens } from '../block-settings';\n\nexport default function PanelColorGradientSettings( { settings, title } ) {\n\tconst navigation = useNavigation();\n\n\tconst mappedSettings = useMemo( () => {\n\t\treturn settings.map(\n\t\t\t( {\n\t\t\t\tonColorChange,\n\t\t\t\tcolorValue,\n\t\t\t\tonGradientChange,\n\t\t\t\tgradientValue,\n\t\t\t\tlabel,\n\t\t\t} ) => (\n\t\t\t\t<ColorControl\n\t\t\t\t\tonPress={ () => {\n\t\t\t\t\t\tnavigation.navigate( blockSettingsScreens.color, {\n\t\t\t\t\t\t\tonColorChange,\n\t\t\t\t\t\t\tcolorValue: gradientValue || colorValue,\n\t\t\t\t\t\t\tgradientValue,\n\t\t\t\t\t\t\tonGradientChange,\n\t\t\t\t\t\t\tlabel,\n\t\t\t\t\t\t} );\n\t\t\t\t\t} }\n\t\t\t\t\tkey={ `color-setting-${ label }` }\n\t\t\t\t\tlabel={ label }\n\t\t\t\t\tcolor={ gradientValue || colorValue }\n\t\t\t\t/>\n\t\t\t)\n\t\t);\n\t}, [ settings ] );\n\n\treturn <PanelBody title={ title }>{ mappedSettings }</PanelBody>;\n}\n"]}