@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
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/caption/index.native.js"],"names":["Caption","accessibilityLabelCreator","accessible","inlineToolbar","isSelected","onBlur","onChange","onFocus","placeholder","placeholderTextColor","shouldDisplay","style","value","insertBlocksAfter","undefined","flex","display","fontSize"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,MAAMA,OAAO,GAAG,CAAE;AACjBC,EAAAA,yBADiB;AAEjBC,EAAAA,UAFiB;AAGjBC,EAAAA,aAHiB;AAIjBC,EAAAA,UAJiB;AAKjBC,EAAAA,MALiB;AAMjBC,EAAAA,QANiB;AAOjBC,EAAAA,OAPiB;AAQjBC,EAAAA,WAAW,GAAG,cAAI,aAAJ,CARG;AASjBC,EAAAA,oBATiB;AAUjBC,EAAAA,aAAa,GAAG,IAVC;AAWjBC,EAAAA,KAXiB;AAYjBC,EAAAA,KAZiB;AAajBC,EAAAA,iBAAiB,GAAG,MAAM,CAAE;AAbX,CAAF,KAef,4BAAC,iBAAD;AACC,EAAA,kBAAkB,EACjBZ,yBAAyB,GACtBA,yBAAyB,CAAEW,KAAF,CADH,GAEtBE,SAJL;AAMC,EAAA,iBAAiB,EAAC,QANnB;AAOC,EAAA,UAAU,EAAGZ,UAPd;AAQC,EAAA,KAAK,EAAG;AAAEa,IAAAA,IAAI,EAAE,CAAR;AAAWC,IAAAA,OAAO,EAAEN,aAAa,GAAG,MAAH,GAAY;AAA7C;AART,GAUC,4BAAC,qBAAD;AACC,EAAA,8BAA8B,MAD/B;AAEC,EAAA,QAAQ,EAAGC,KAAK,IAAIA,KAAK,CAACM,QAAf,GAA0BN,KAAK,CAACM,QAAhC,GAA2C,EAFvD;AAGC,EAAA,aAAa,EAAGd,aAHjB;AAIC,EAAA,UAAU,EAAGC,UAJd;AAKC,EAAA,MAAM,EAAGC,MALV;AAMC,EAAA,QAAQ,EAAGC,QANZ;AAOC,EAAA,WAAW,EAAGE,WAPf;AAQC,EAAA,oBAAoB,EAAGC,oBARxB;AASC,EAAA,mBAAmB,EAAG,CAAE,GAAF,CATvB;AAUC,EAAA,KAAK,EAAGE,KAVT;AAWC,EAAA,OAAO,EAAC,GAXT;AAYC,EAAA,SAAS,EAAC,QAZX;AAaC,EAAA,qBAAqB,EAAC,aAbvB;AAcC,EAAA,eAAe,EAAGJ,OAdnB;AAeC,EAAA,KAAK,EAAGK,KAfT;AAgBC,EAAA,sBAAsB,EAAG,MACxBC,iBAAiB,CAAE,yBAAa,gBAAb,CAAF,CAjBnB;AAmBC,EAAA,WAAW,EAAG;AAnBf,EAVD,CAfD;;eAiDeb,O","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { RichText } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\nconst Caption = ( {\n\taccessibilityLabelCreator,\n\taccessible,\n\tinlineToolbar,\n\tisSelected,\n\tonBlur,\n\tonChange,\n\tonFocus,\n\tplaceholder = __( 'Add caption' ),\n\tplaceholderTextColor,\n\tshouldDisplay = true,\n\tstyle,\n\tvalue,\n\tinsertBlocksAfter = () => {},\n} ) => (\n\t<View\n\t\taccessibilityLabel={\n\t\t\taccessibilityLabelCreator\n\t\t\t\t? accessibilityLabelCreator( value )\n\t\t\t\t: undefined\n\t\t}\n\t\taccessibilityRole=\"button\"\n\t\taccessible={ accessible }\n\t\tstyle={ { flex: 1, display: shouldDisplay ? 'flex' : 'none' } }\n\t>\n\t\t<RichText\n\t\t\t__unstableMobileNoFocusOnMount\n\t\t\tfontSize={ style && style.fontSize ? style.fontSize : 14 }\n\t\t\tinlineToolbar={ inlineToolbar }\n\t\t\tisSelected={ isSelected }\n\t\t\tonBlur={ onBlur }\n\t\t\tonChange={ onChange }\n\t\t\tplaceholder={ placeholder }\n\t\t\tplaceholderTextColor={ placeholderTextColor }\n\t\t\trootTagsToEliminate={ [ 'p' ] }\n\t\t\tstyle={ style }\n\t\t\ttagName=\"p\"\n\t\t\ttextAlign=\"center\"\n\t\t\tunderlineColorAndroid=\"transparent\"\n\t\t\tunstableOnFocus={ onFocus }\n\t\t\tvalue={ value }\n\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\tinsertBlocksAfter( createBlock( 'core/paragraph' ) )\n\t\t\t}\n\t\t\tdeleteEnter={ true }\n\t\t/>\n\t</View>\n);\n\nexport default Caption;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/caption/index.native.js"],"names":["Caption","accessibilityLabelCreator","accessible","inlineToolbar","isSelected","onBlur","onChange","onFocus","placeholder","placeholderTextColor","shouldDisplay","style","value","insertBlocksAfter","undefined","flex","display","fontSize"],"mappings":";;;;;;;;;AAGA;;AAKA;;AACA;;AACA;;AAVA;AACA;AACA;;AAGA;AACA;AACA;AAKA,MAAMA,OAAO,GAAG;AAAA,MAAE;AACjBC,IAAAA,yBADiB;AAEjBC,IAAAA,UAFiB;AAGjBC,IAAAA,aAHiB;AAIjBC,IAAAA,UAJiB;AAKjBC,IAAAA,MALiB;AAMjBC,IAAAA,QANiB;AAOjBC,IAAAA,OAPiB;AAQjBC,IAAAA,WAAW,GAAG,cAAI,aAAJ,CARG;AASjBC,IAAAA,oBATiB;AAUjBC,IAAAA,aAAa,GAAG,IAVC;AAWjBC,IAAAA,KAXiB;AAYjBC,IAAAA,KAZiB;AAajBC,IAAAA,iBAAiB,GAAG,MAAM,CAAE;AAbX,GAAF;AAAA,SAef,4BAAC,iBAAD;AACC,IAAA,kBAAkB,EACjBZ,yBAAyB,GACtBA,yBAAyB,CAAEW,KAAF,CADH,GAEtBE,SAJL;AAMC,IAAA,iBAAiB,EAAC,QANnB;AAOC,IAAA,UAAU,EAAGZ,UAPd;AAQC,IAAA,KAAK,EAAG;AAAEa,MAAAA,IAAI,EAAE,CAAR;AAAWC,MAAAA,OAAO,EAAEN,aAAa,GAAG,MAAH,GAAY;AAA7C;AART,KAUC,4BAAC,qBAAD;AACC,IAAA,8BAA8B,MAD/B;AAEC,IAAA,QAAQ,EAAGC,KAAK,IAAIA,KAAK,CAACM,QAAf,GAA0BN,KAAK,CAACM,QAAhC,GAA2C,EAFvD;AAGC,IAAA,aAAa,EAAGd,aAHjB;AAIC,IAAA,UAAU,EAAGC,UAJd;AAKC,IAAA,MAAM,EAAGC,MALV;AAMC,IAAA,QAAQ,EAAGC,QANZ;AAOC,IAAA,WAAW,EAAGE,WAPf;AAQC,IAAA,oBAAoB,EAAGC,oBARxB;AASC,IAAA,mBAAmB,EAAG,CAAE,GAAF,CATvB;AAUC,IAAA,KAAK,EAAGE,KAVT;AAWC,IAAA,OAAO,EAAC,GAXT;AAYC,IAAA,SAAS,EAAC,QAZX;AAaC,IAAA,qBAAqB,EAAC,aAbvB;AAcC,IAAA,eAAe,EAAGJ,OAdnB;AAeC,IAAA,KAAK,EAAGK,KAfT;AAgBC,IAAA,sBAAsB,EAAG,MACxBC,iBAAiB,CAAE,yBAAa,gBAAb,CAAF,CAjBnB;AAmBC,IAAA,WAAW,EAAG;AAnBf,IAVD,CAfe;AAAA,CAAhB;;eAiDeb,O","sourcesContent":["/**\n * External dependencies\n */\nimport { View } from 'react-native';\n\n/**\n * WordPress dependencies\n */\nimport { createBlock } from '@wordpress/blocks';\nimport { RichText } from '@wordpress/block-editor';\nimport { __ } from '@wordpress/i18n';\n\nconst Caption = ( {\n\taccessibilityLabelCreator,\n\taccessible,\n\tinlineToolbar,\n\tisSelected,\n\tonBlur,\n\tonChange,\n\tonFocus,\n\tplaceholder = __( 'Add caption' ),\n\tplaceholderTextColor,\n\tshouldDisplay = true,\n\tstyle,\n\tvalue,\n\tinsertBlocksAfter = () => {},\n} ) => (\n\t<View\n\t\taccessibilityLabel={\n\t\t\taccessibilityLabelCreator\n\t\t\t\t? accessibilityLabelCreator( value )\n\t\t\t\t: undefined\n\t\t}\n\t\taccessibilityRole=\"button\"\n\t\taccessible={ accessible }\n\t\tstyle={ { flex: 1, display: shouldDisplay ? 'flex' : 'none' } }\n\t>\n\t\t<RichText\n\t\t\t__unstableMobileNoFocusOnMount\n\t\t\tfontSize={ style && style.fontSize ? style.fontSize : 14 }\n\t\t\tinlineToolbar={ inlineToolbar }\n\t\t\tisSelected={ isSelected }\n\t\t\tonBlur={ onBlur }\n\t\t\tonChange={ onChange }\n\t\t\tplaceholder={ placeholder }\n\t\t\tplaceholderTextColor={ placeholderTextColor }\n\t\t\trootTagsToEliminate={ [ 'p' ] }\n\t\t\tstyle={ style }\n\t\t\ttagName=\"p\"\n\t\t\ttextAlign=\"center\"\n\t\t\tunderlineColorAndroid=\"transparent\"\n\t\t\tunstableOnFocus={ onFocus }\n\t\t\tvalue={ value }\n\t\t\t__unstableOnSplitAtEnd={ () =>\n\t\t\t\tinsertBlocksAfter( createBlock( 'core/paragraph' ) )\n\t\t\t}\n\t\t\tdeleteEnter={ true }\n\t\t/>\n\t</View>\n);\n\nexport default Caption;\n"]}
@@ -16,11 +16,12 @@ var _control = _interopRequireDefault(require("../colors-gradients/control"));
16
16
  /**
17
17
  * Internal dependencies
18
18
  */
19
- function ColorPaletteControl({
20
- onChange,
21
- value,
22
- ...otherProps
23
- }) {
19
+ function ColorPaletteControl(_ref) {
20
+ let {
21
+ onChange,
22
+ value,
23
+ ...otherProps
24
+ } = _ref;
24
25
  return (0, _element.createElement)(_control.default, (0, _extends2.default)({}, otherProps, {
25
26
  onColorChange: onChange,
26
27
  colorValue: value,
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/color-palette/control.js"],"names":["ColorPaletteControl","onChange","value","otherProps"],"mappings":";;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGe,SAASA,mBAAT,CAA8B;AAC5CC,EAAAA,QAD4C;AAE5CC,EAAAA,KAF4C;AAG5C,KAAGC;AAHyC,CAA9B,EAIX;AACH,SACC,4BAAC,gBAAD,6BACMA,UADN;AAEC,IAAA,aAAa,EAAGF,QAFjB;AAGC,IAAA,UAAU,EAAGC,KAHd;AAIC,IAAA,SAAS,EAAG,EAJb;AAKC,IAAA,sBAAsB,EAAG;AAL1B,KADD;AASA","sourcesContent":["/**\n * Internal dependencies\n */\nimport ColorGradientControl from '../colors-gradients/control';\n\nexport default function ColorPaletteControl( {\n\tonChange,\n\tvalue,\n\t...otherProps\n} ) {\n\treturn (\n\t\t<ColorGradientControl\n\t\t\t{ ...otherProps }\n\t\t\tonColorChange={ onChange }\n\t\t\tcolorValue={ value }\n\t\t\tgradients={ [] }\n\t\t\tdisableCustomGradients={ true }\n\t\t/>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/color-palette/control.js"],"names":["ColorPaletteControl","onChange","value","otherProps"],"mappings":";;;;;;;;;;;;;AAGA;;AAHA;AACA;AACA;AAGe,SAASA,mBAAT,OAIX;AAAA,MAJyC;AAC5CC,IAAAA,QAD4C;AAE5CC,IAAAA,KAF4C;AAG5C,OAAGC;AAHyC,GAIzC;AACH,SACC,4BAAC,gBAAD,6BACMA,UADN;AAEC,IAAA,aAAa,EAAGF,QAFjB;AAGC,IAAA,UAAU,EAAGC,KAHd;AAIC,IAAA,SAAS,EAAG,EAJb;AAKC,IAAA,sBAAsB,EAAG;AAL1B,KADD;AASA","sourcesContent":["/**\n * Internal dependencies\n */\nimport ColorGradientControl from '../colors-gradients/control';\n\nexport default function ColorPaletteControl( {\n\tonChange,\n\tvalue,\n\t...otherProps\n} ) {\n\treturn (\n\t\t<ColorGradientControl\n\t\t\t{ ...otherProps }\n\t\t\tonColorChange={ onChange }\n\t\t\tcolorValue={ value }\n\t\t\tgradients={ [] }\n\t\t\tdisableCustomGradients={ true }\n\t\t/>\n\t);\n}\n"]}
@@ -33,10 +33,11 @@ const ColorSelectorSVGIcon = () => (0, _element.createElement)(_components.SVG,
33
33
  */
34
34
 
35
35
 
36
- const ColorSelectorIcon = ({
37
- style,
38
- className
39
- }) => {
36
+ const ColorSelectorIcon = _ref => {
37
+ let {
38
+ style,
39
+ className
40
+ } = _ref;
40
41
  return (0, _element.createElement)("div", {
41
42
  className: "block-library-colors-selector__icon-container"
42
43
  }, (0, _element.createElement)("div", {
@@ -55,39 +56,47 @@ const ColorSelectorIcon = ({
55
56
  */
56
57
 
57
58
 
58
- const renderToggleComponent = ({
59
- TextColor,
60
- BackgroundColor
61
- }) => ({
62
- onToggle,
63
- isOpen
64
- }) => {
65
- const openOnArrowDown = event => {
66
- if (!isOpen && event.keyCode === _keycodes.DOWN) {
67
- event.preventDefault();
68
- onToggle();
69
- }
70
- };
59
+ const renderToggleComponent = _ref2 => {
60
+ let {
61
+ TextColor,
62
+ BackgroundColor
63
+ } = _ref2;
64
+ return _ref3 => {
65
+ let {
66
+ onToggle,
67
+ isOpen
68
+ } = _ref3;
69
+
70
+ const openOnArrowDown = event => {
71
+ if (!isOpen && event.keyCode === _keycodes.DOWN) {
72
+ event.preventDefault();
73
+ onToggle();
74
+ }
75
+ };
71
76
 
72
- return (0, _element.createElement)(_components.ToolbarGroup, null, (0, _element.createElement)(_components.ToolbarButton, {
73
- className: "components-toolbar__control block-library-colors-selector__toggle",
74
- label: (0, _i18n.__)('Open Colors Selector'),
75
- onClick: onToggle,
76
- onKeyDown: openOnArrowDown,
77
- icon: (0, _element.createElement)(BackgroundColor, null, (0, _element.createElement)(TextColor, null, (0, _element.createElement)(ColorSelectorIcon, null)))
78
- }));
77
+ return (0, _element.createElement)(_components.ToolbarGroup, null, (0, _element.createElement)(_components.ToolbarButton, {
78
+ className: "components-toolbar__control block-library-colors-selector__toggle",
79
+ label: (0, _i18n.__)('Open Colors Selector'),
80
+ onClick: onToggle,
81
+ onKeyDown: openOnArrowDown,
82
+ icon: (0, _element.createElement)(BackgroundColor, null, (0, _element.createElement)(TextColor, null, (0, _element.createElement)(ColorSelectorIcon, null)))
83
+ }));
84
+ };
79
85
  };
80
86
 
81
- const BlockColorsStyleSelector = ({
82
- children,
83
- ...other
84
- }) => (0, _element.createElement)(_components.Dropdown, {
85
- position: "bottom right",
86
- className: "block-library-colors-selector",
87
- contentClassName: "block-library-colors-selector__popover",
88
- renderToggle: renderToggleComponent(other),
89
- renderContent: () => children
90
- });
87
+ const BlockColorsStyleSelector = _ref4 => {
88
+ let {
89
+ children,
90
+ ...other
91
+ } = _ref4;
92
+ return (0, _element.createElement)(_components.Dropdown, {
93
+ position: "bottom right",
94
+ className: "block-library-colors-selector",
95
+ contentClassName: "block-library-colors-selector__popover",
96
+ renderToggle: renderToggleComponent(other),
97
+ renderContent: () => children
98
+ });
99
+ };
91
100
 
92
101
  var _default = BlockColorsStyleSelector;
93
102
  exports.default = _default;
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"names":["ColorSelectorSVGIcon","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","DOWN","preventDefault","BlockColorsStyleSelector","children","other"],"mappings":";;;;;;;;;AAGA;;AAOA;;AACA;;AAXA;AACA;AACA;AAWA,MAAMA,oBAAoB,GAAG,MAC5B,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,6BAAX;AAAyC,EAAA,OAAO,EAAC;AAAjD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADD;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,iBAAiB,GAAG,CAAE;AAAEC,EAAAA,KAAF;AAASC,EAAAA;AAAT,CAAF,KAA4B;AACrD,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AACC,IAAA,SAAS,EAAI,GAAGA,SAAW,iDAD5B;AAEC,IAAA,KAAK,EAAGD;AAFT,KAIC,4BAAC,oBAAD,OAJD,CADD,CADD;AAUA,CAXD;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,qBAAqB,GAAG,CAAE;AAAEC,EAAAA,SAAF;AAAaC,EAAAA;AAAb,CAAF,KAAsC,CAAE;AACrEC,EAAAA,QADqE;AAErEC,EAAAA;AAFqE,CAAF,KAG7D;AACN,QAAMC,eAAe,GAAKC,KAAF,IAAa;AACpC,QAAK,CAAEF,MAAF,IAAYE,KAAK,CAACC,OAAN,KAAkBC,cAAnC,EAA0C;AACzCF,MAAAA,KAAK,CAACG,cAAN;AACAN,MAAAA,QAAQ;AACR;AACD,GALD;;AAOA,SACC,4BAAC,wBAAD,QACC,4BAAC,yBAAD;AACC,IAAA,SAAS,EAAC,mEADX;AAEC,IAAA,KAAK,EAAG,cAAI,sBAAJ,CAFT;AAGC,IAAA,OAAO,EAAGA,QAHX;AAIC,IAAA,SAAS,EAAGE,eAJb;AAKC,IAAA,IAAI,EACH,4BAAC,eAAD,QACC,4BAAC,SAAD,QACC,4BAAC,iBAAD,OADD,CADD;AANF,IADD,CADD;AAiBA,CA5BD;;AA8BA,MAAMK,wBAAwB,GAAG,CAAE;AAAEC,EAAAA,QAAF;AAAY,KAAGC;AAAf,CAAF,KAChC,4BAAC,oBAAD;AACC,EAAA,QAAQ,EAAC,cADV;AAEC,EAAA,SAAS,EAAC,+BAFX;AAGC,EAAA,gBAAgB,EAAC,wCAHlB;AAIC,EAAA,YAAY,EAAGZ,qBAAqB,CAAEY,KAAF,CAJrC;AAKC,EAAA,aAAa,EAAG,MAAMD;AALvB,EADD;;eAUeD,wB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"https://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent = ( { TextColor, BackgroundColor } ) => ( {\n\tonToggle,\n\tisOpen,\n} ) => {\n\tconst openOnArrowDown = ( event ) => {\n\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\tevent.preventDefault();\n\t\t\tonToggle();\n\t\t}\n\t};\n\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\tonClick={ onToggle }\n\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\ticon={\n\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t</BackgroundColor>\n\t\t\t\t}\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => (\n\t<Dropdown\n\t\tposition=\"bottom right\"\n\t\tclassName=\"block-library-colors-selector\"\n\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\trenderToggle={ renderToggleComponent( other ) }\n\t\trenderContent={ () => children }\n\t/>\n);\n\nexport default BlockColorsStyleSelector;\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/color-style-selector/index.js"],"names":["ColorSelectorSVGIcon","ColorSelectorIcon","style","className","renderToggleComponent","TextColor","BackgroundColor","onToggle","isOpen","openOnArrowDown","event","keyCode","DOWN","preventDefault","BlockColorsStyleSelector","children","other"],"mappings":";;;;;;;;;AAGA;;AAOA;;AACA;;AAXA;AACA;AACA;AAWA,MAAMA,oBAAoB,GAAG,MAC5B,4BAAC,eAAD;AAAK,EAAA,KAAK,EAAC,6BAAX;AAAyC,EAAA,OAAO,EAAC;AAAjD,GACC,4BAAC,gBAAD;AAAM,EAAA,CAAC,EAAC;AAAR,EADD,CADD;AAMA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMC,iBAAiB,GAAG,QAA4B;AAAA,MAA1B;AAAEC,IAAAA,KAAF;AAASC,IAAAA;AAAT,GAA0B;AACrD,SACC;AAAK,IAAA,SAAS,EAAC;AAAf,KACC;AACC,IAAA,SAAS,EAAI,GAAGA,SAAW,iDAD5B;AAEC,IAAA,KAAK,EAAGD;AAFT,KAIC,4BAAC,oBAAD,OAJD,CADD,CADD;AAUA,CAXD;AAaA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAME,qBAAqB,GAAG;AAAA,MAAE;AAAEC,IAAAA,SAAF;AAAaC,IAAAA;AAAb,GAAF;AAAA,SAAsC,SAG7D;AAAA,QAH+D;AACrEC,MAAAA,QADqE;AAErEC,MAAAA;AAFqE,KAG/D;;AACN,UAAMC,eAAe,GAAKC,KAAF,IAAa;AACpC,UAAK,CAAEF,MAAF,IAAYE,KAAK,CAACC,OAAN,KAAkBC,cAAnC,EAA0C;AACzCF,QAAAA,KAAK,CAACG,cAAN;AACAN,QAAAA,QAAQ;AACR;AACD,KALD;;AAOA,WACC,4BAAC,wBAAD,QACC,4BAAC,yBAAD;AACC,MAAA,SAAS,EAAC,mEADX;AAEC,MAAA,KAAK,EAAG,cAAI,sBAAJ,CAFT;AAGC,MAAA,OAAO,EAAGA,QAHX;AAIC,MAAA,SAAS,EAAGE,eAJb;AAKC,MAAA,IAAI,EACH,4BAAC,eAAD,QACC,4BAAC,SAAD,QACC,4BAAC,iBAAD,OADD,CADD;AANF,MADD,CADD;AAiBA,GA5B6B;AAAA,CAA9B;;AA8BA,MAAMK,wBAAwB,GAAG;AAAA,MAAE;AAAEC,IAAAA,QAAF;AAAY,OAAGC;AAAf,GAAF;AAAA,SAChC,4BAAC,oBAAD;AACC,IAAA,QAAQ,EAAC,cADV;AAEC,IAAA,SAAS,EAAC,+BAFX;AAGC,IAAA,gBAAgB,EAAC,wCAHlB;AAIC,IAAA,YAAY,EAAGZ,qBAAqB,CAAEY,KAAF,CAJrC;AAKC,IAAA,aAAa,EAAG,MAAMD;AALvB,IADgC;AAAA,CAAjC;;eAUeD,wB","sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\tToolbarButton,\n\tDropdown,\n\tToolbarGroup,\n\tSVG,\n\tPath,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { DOWN } from '@wordpress/keycodes';\n\nconst ColorSelectorSVGIcon = () => (\n\t<SVG xmlns=\"https://www.w3.org/2000/svg\" viewBox=\"0 0 20 20\">\n\t\t<Path d=\"M7.434 5l3.18 9.16H8.538l-.692-2.184H4.628l-.705 2.184H2L5.18 5h2.254zm-1.13 1.904h-.115l-1.148 3.593H7.44L6.304 6.904zM14.348 7.006c1.853 0 2.9.876 2.9 2.374v4.78h-1.79v-.914h-.114c-.362.64-1.123 1.022-2.031 1.022-1.346 0-2.292-.826-2.292-2.108 0-1.27.972-2.006 2.71-2.107l1.696-.102V9.38c0-.584-.42-.914-1.18-.914-.667 0-1.112.228-1.264.647h-1.701c.12-1.295 1.307-2.107 3.066-2.107zm1.079 4.1l-1.416.09c-.793.056-1.18.342-1.18.844 0 .52.45.837 1.091.837.857 0 1.505-.545 1.505-1.256v-.515z\" />\n\t</SVG>\n);\n\n/**\n * Color Selector Icon component.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.style Style object.\n * @param {string} props.className Class name for component.\n *\n * @return {*} React Icon component.\n */\nconst ColorSelectorIcon = ( { style, className } ) => {\n\treturn (\n\t\t<div className=\"block-library-colors-selector__icon-container\">\n\t\t\t<div\n\t\t\t\tclassName={ `${ className } block-library-colors-selector__state-selection` }\n\t\t\t\tstyle={ style }\n\t\t\t>\n\t\t\t\t<ColorSelectorSVGIcon />\n\t\t\t</div>\n\t\t</div>\n\t);\n};\n\n/**\n * Renders the Colors Selector Toolbar with the icon button.\n *\n * @param {Object} props Component properties.\n * @param {Object} props.TextColor Text color component that wraps icon.\n * @param {Object} props.BackgroundColor Background color component that wraps icon.\n *\n * @return {*} React toggle button component.\n */\nconst renderToggleComponent = ( { TextColor, BackgroundColor } ) => ( {\n\tonToggle,\n\tisOpen,\n} ) => {\n\tconst openOnArrowDown = ( event ) => {\n\t\tif ( ! isOpen && event.keyCode === DOWN ) {\n\t\t\tevent.preventDefault();\n\t\t\tonToggle();\n\t\t}\n\t};\n\n\treturn (\n\t\t<ToolbarGroup>\n\t\t\t<ToolbarButton\n\t\t\t\tclassName=\"components-toolbar__control block-library-colors-selector__toggle\"\n\t\t\t\tlabel={ __( 'Open Colors Selector' ) }\n\t\t\t\tonClick={ onToggle }\n\t\t\t\tonKeyDown={ openOnArrowDown }\n\t\t\t\ticon={\n\t\t\t\t\t<BackgroundColor>\n\t\t\t\t\t\t<TextColor>\n\t\t\t\t\t\t\t<ColorSelectorIcon />\n\t\t\t\t\t\t</TextColor>\n\t\t\t\t\t</BackgroundColor>\n\t\t\t\t}\n\t\t\t/>\n\t\t</ToolbarGroup>\n\t);\n};\n\nconst BlockColorsStyleSelector = ( { children, ...other } ) => (\n\t<Dropdown\n\t\tposition=\"bottom right\"\n\t\tclassName=\"block-library-colors-selector\"\n\t\tcontentClassName=\"block-library-colors-selector__popover\"\n\t\trenderToggle={ renderToggleComponent( other ) }\n\t\trenderContent={ () => children }\n\t/>\n);\n\nexport default BlockColorsStyleSelector;\n"]}
@@ -34,25 +34,27 @@ const resolveContrastCheckerColor = (color, colorSettings, detectedColor) => {
34
34
  return color;
35
35
  };
36
36
 
37
- function ColorPanel({
38
- title,
39
- colorSettings,
40
- colorPanelProps,
41
- contrastCheckers,
42
- detectedBackgroundColor,
43
- detectedColor,
44
- panelChildren,
45
- initialOpen
46
- }) {
37
+ function ColorPanel(_ref) {
38
+ let {
39
+ title,
40
+ colorSettings,
41
+ colorPanelProps,
42
+ contrastCheckers,
43
+ detectedBackgroundColor,
44
+ detectedColor,
45
+ panelChildren,
46
+ initialOpen
47
+ } = _ref;
47
48
  return (0, _element.createElement)(_panelColorSettings.default, (0, _extends2.default)({
48
49
  title: title,
49
50
  initialOpen: initialOpen,
50
51
  colorSettings: Object.values(colorSettings)
51
- }, colorPanelProps), contrastCheckers && (Array.isArray(contrastCheckers) ? contrastCheckers.map(({
52
- backgroundColor,
53
- textColor,
54
- ...rest
55
- }) => {
52
+ }, colorPanelProps), contrastCheckers && (Array.isArray(contrastCheckers) ? contrastCheckers.map(_ref2 => {
53
+ let {
54
+ backgroundColor,
55
+ textColor,
56
+ ...rest
57
+ } = _ref2;
56
58
  backgroundColor = resolveContrastCheckerColor(backgroundColor, colorSettings, detectedBackgroundColor);
57
59
  textColor = resolveContrastCheckerColor(textColor, colorSettings, detectedColor);
58
60
  return (0, _element.createElement)(_contrastChecker.default, (0, _extends2.default)({
@@ -60,9 +62,10 @@ function ColorPanel({
60
62
  backgroundColor: backgroundColor,
61
63
  textColor: textColor
62
64
  }, rest));
63
- }) : (0, _lodash.map)(colorSettings, ({
64
- value
65
- }) => {
65
+ }) : (0, _lodash.map)(colorSettings, _ref3 => {
66
+ let {
67
+ value
68
+ } = _ref3;
66
69
  let {
67
70
  backgroundColor,
68
71
  textColor
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors/color-panel.js"],"names":["resolveContrastCheckerColor","color","colorSettings","detectedColor","ColorPanel","title","colorPanelProps","contrastCheckers","detectedBackgroundColor","panelChildren","initialOpen","Object","values","Array","isArray","map","backgroundColor","textColor","rest","value"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,2BAA2B,GAAG,CAAEC,KAAF,EAASC,aAAT,EAAwBC,aAAxB,KAA2C;AAC9E,MAAK,OAAOF,KAAP,KAAiB,UAAtB,EAAmC;AAClC,WAAOA,KAAK,CAAEC,aAAF,CAAZ;AACA,GAFD,MAEO,IAAKD,KAAK,KAAK,IAAf,EAAsB;AAC5B,WAAOE,aAAP;AACA;;AACD,SAAOF,KAAP;AACA,CAPD;;AASe,SAASG,UAAT,CAAqB;AACnCC,EAAAA,KADmC;AAEnCH,EAAAA,aAFmC;AAGnCI,EAAAA,eAHmC;AAInCC,EAAAA,gBAJmC;AAKnCC,EAAAA,uBALmC;AAMnCL,EAAAA,aANmC;AAOnCM,EAAAA,aAPmC;AAQnCC,EAAAA;AARmC,CAArB,EASX;AACH,SACC,4BAAC,2BAAD;AACC,IAAA,KAAK,EAAGL,KADT;AAEC,IAAA,WAAW,EAAGK,WAFf;AAGC,IAAA,aAAa,EAAGC,MAAM,CAACC,MAAP,CAAeV,aAAf;AAHjB,KAIMI,eAJN,GAMGC,gBAAgB,KACfM,KAAK,CAACC,OAAN,CAAeP,gBAAf,IACCA,gBAAgB,CAACQ,GAAjB,CACA,CAAE;AAAEC,IAAAA,eAAF;AAAmBC,IAAAA,SAAnB;AAA8B,OAAGC;AAAjC,GAAF,KAA+C;AAC9CF,IAAAA,eAAe,GAAGhB,2BAA2B,CAC5CgB,eAD4C,EAE5Cd,aAF4C,EAG5CM,uBAH4C,CAA7C;AAKAS,IAAAA,SAAS,GAAGjB,2BAA2B,CACtCiB,SADsC,EAEtCf,aAFsC,EAGtCC,aAHsC,CAAvC;AAKA,WACC,4BAAC,wBAAD;AACC,MAAA,GAAG,EAAI,GAAGa,eAAiB,IAAIC,SAAW,EAD3C;AAEC,MAAA,eAAe,EAAGD,eAFnB;AAGC,MAAA,SAAS,EAAGC;AAHb,OAIMC,IAJN,EADD;AAQA,GApBD,CADD,GAuBC,iBAAKhB,aAAL,EAAoB,CAAE;AAAEiB,IAAAA;AAAF,GAAF,KAAiB;AACrC,QAAI;AACHH,MAAAA,eADG;AAEHC,MAAAA;AAFG,QAGAV,gBAHJ;AAIAS,IAAAA,eAAe,GAAGhB,2BAA2B,CAC5CgB,eAAe,IAAIG,KADyB,EAE5CjB,aAF4C,EAG5CM,uBAH4C,CAA7C;AAKAS,IAAAA,SAAS,GAAGjB,2BAA2B,CACtCiB,SAAS,IAAIE,KADyB,EAEtCjB,aAFsC,EAGtCC,aAHsC,CAAvC;AAKA,WACC,4BAAC,wBAAD,6BACMI,gBADN;AAEC,MAAA,GAAG,EAAI,GAAGS,eAAiB,IAAIC,SAAW,EAF3C;AAGC,MAAA,eAAe,EAAGD,eAHnB;AAIC,MAAA,SAAS,EAAGC;AAJb,OADD;AAQC,GAvBD,CAxBc,CANnB,EAsDG,OAAOR,aAAP,KAAyB,UAAzB,GACCA,aAAa,CAAEP,aAAF,CADd,GAECO,aAxDJ,CADD;AA4DA","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport PanelColorSettings from '../panel-color-settings';\nimport ContrastChecker from '../contrast-checker';\n\nconst resolveContrastCheckerColor = ( color, colorSettings, detectedColor ) => {\n\tif ( typeof color === 'function' ) {\n\t\treturn color( colorSettings );\n\t} else if ( color === true ) {\n\t\treturn detectedColor;\n\t}\n\treturn color;\n};\n\nexport default function ColorPanel( {\n\ttitle,\n\tcolorSettings,\n\tcolorPanelProps,\n\tcontrastCheckers,\n\tdetectedBackgroundColor,\n\tdetectedColor,\n\tpanelChildren,\n\tinitialOpen,\n} ) {\n\treturn (\n\t\t<PanelColorSettings\n\t\t\ttitle={ title }\n\t\t\tinitialOpen={ initialOpen }\n\t\t\tcolorSettings={ Object.values( colorSettings ) }\n\t\t\t{ ...colorPanelProps }\n\t\t>\n\t\t\t{ contrastCheckers &&\n\t\t\t\t( Array.isArray( contrastCheckers )\n\t\t\t\t\t? contrastCheckers.map(\n\t\t\t\t\t\t\t( { backgroundColor, textColor, ...rest } ) => {\n\t\t\t\t\t\t\t\tbackgroundColor = resolveContrastCheckerColor(\n\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\tcolorSettings,\n\t\t\t\t\t\t\t\t\tdetectedBackgroundColor\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\ttextColor = resolveContrastCheckerColor(\n\t\t\t\t\t\t\t\t\ttextColor,\n\t\t\t\t\t\t\t\t\tcolorSettings,\n\t\t\t\t\t\t\t\t\tdetectedColor\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t\t\t\tkey={ `${ backgroundColor }-${ textColor }` }\n\t\t\t\t\t\t\t\t\t\tbackgroundColor={ backgroundColor }\n\t\t\t\t\t\t\t\t\t\ttextColor={ textColor }\n\t\t\t\t\t\t\t\t\t\t{ ...rest }\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 )\n\t\t\t\t\t: map( colorSettings, ( { value } ) => {\n\t\t\t\t\t\t\tlet {\n\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\ttextColor,\n\t\t\t\t\t\t\t} = contrastCheckers;\n\t\t\t\t\t\t\tbackgroundColor = resolveContrastCheckerColor(\n\t\t\t\t\t\t\t\tbackgroundColor || value,\n\t\t\t\t\t\t\t\tcolorSettings,\n\t\t\t\t\t\t\t\tdetectedBackgroundColor\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\ttextColor = resolveContrastCheckerColor(\n\t\t\t\t\t\t\t\ttextColor || value,\n\t\t\t\t\t\t\t\tcolorSettings,\n\t\t\t\t\t\t\t\tdetectedColor\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t\t\t{ ...contrastCheckers }\n\t\t\t\t\t\t\t\t\tkey={ `${ backgroundColor }-${ textColor }` }\n\t\t\t\t\t\t\t\t\tbackgroundColor={ backgroundColor }\n\t\t\t\t\t\t\t\t\ttextColor={ textColor }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t } ) ) }\n\t\t\t{ typeof panelChildren === 'function'\n\t\t\t\t? panelChildren( colorSettings )\n\t\t\t\t: panelChildren }\n\t\t</PanelColorSettings>\n\t);\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors/color-panel.js"],"names":["resolveContrastCheckerColor","color","colorSettings","detectedColor","ColorPanel","title","colorPanelProps","contrastCheckers","detectedBackgroundColor","panelChildren","initialOpen","Object","values","Array","isArray","map","backgroundColor","textColor","rest","value"],"mappings":";;;;;;;;;;;;;AAGA;;AAKA;;AACA;;AATA;AACA;AACA;;AAGA;AACA;AACA;AAIA,MAAMA,2BAA2B,GAAG,CAAEC,KAAF,EAASC,aAAT,EAAwBC,aAAxB,KAA2C;AAC9E,MAAK,OAAOF,KAAP,KAAiB,UAAtB,EAAmC;AAClC,WAAOA,KAAK,CAAEC,aAAF,CAAZ;AACA,GAFD,MAEO,IAAKD,KAAK,KAAK,IAAf,EAAsB;AAC5B,WAAOE,aAAP;AACA;;AACD,SAAOF,KAAP;AACA,CAPD;;AASe,SAASG,UAAT,OASX;AAAA,MATgC;AACnCC,IAAAA,KADmC;AAEnCH,IAAAA,aAFmC;AAGnCI,IAAAA,eAHmC;AAInCC,IAAAA,gBAJmC;AAKnCC,IAAAA,uBALmC;AAMnCL,IAAAA,aANmC;AAOnCM,IAAAA,aAPmC;AAQnCC,IAAAA;AARmC,GAShC;AACH,SACC,4BAAC,2BAAD;AACC,IAAA,KAAK,EAAGL,KADT;AAEC,IAAA,WAAW,EAAGK,WAFf;AAGC,IAAA,aAAa,EAAGC,MAAM,CAACC,MAAP,CAAeV,aAAf;AAHjB,KAIMI,eAJN,GAMGC,gBAAgB,KACfM,KAAK,CAACC,OAAN,CAAeP,gBAAf,IACCA,gBAAgB,CAACQ,GAAjB,CACA,SAA+C;AAAA,QAA7C;AAAEC,MAAAA,eAAF;AAAmBC,MAAAA,SAAnB;AAA8B,SAAGC;AAAjC,KAA6C;AAC9CF,IAAAA,eAAe,GAAGhB,2BAA2B,CAC5CgB,eAD4C,EAE5Cd,aAF4C,EAG5CM,uBAH4C,CAA7C;AAKAS,IAAAA,SAAS,GAAGjB,2BAA2B,CACtCiB,SADsC,EAEtCf,aAFsC,EAGtCC,aAHsC,CAAvC;AAKA,WACC,4BAAC,wBAAD;AACC,MAAA,GAAG,EAAI,GAAGa,eAAiB,IAAIC,SAAW,EAD3C;AAEC,MAAA,eAAe,EAAGD,eAFnB;AAGC,MAAA,SAAS,EAAGC;AAHb,OAIMC,IAJN,EADD;AAQA,GApBD,CADD,GAuBC,iBAAKhB,aAAL,EAAoB,SAAiB;AAAA,QAAf;AAAEiB,MAAAA;AAAF,KAAe;AACrC,QAAI;AACHH,MAAAA,eADG;AAEHC,MAAAA;AAFG,QAGAV,gBAHJ;AAIAS,IAAAA,eAAe,GAAGhB,2BAA2B,CAC5CgB,eAAe,IAAIG,KADyB,EAE5CjB,aAF4C,EAG5CM,uBAH4C,CAA7C;AAKAS,IAAAA,SAAS,GAAGjB,2BAA2B,CACtCiB,SAAS,IAAIE,KADyB,EAEtCjB,aAFsC,EAGtCC,aAHsC,CAAvC;AAKA,WACC,4BAAC,wBAAD,6BACMI,gBADN;AAEC,MAAA,GAAG,EAAI,GAAGS,eAAiB,IAAIC,SAAW,EAF3C;AAGC,MAAA,eAAe,EAAGD,eAHnB;AAIC,MAAA,SAAS,EAAGC;AAJb,OADD;AAQC,GAvBD,CAxBc,CANnB,EAsDG,OAAOR,aAAP,KAAyB,UAAzB,GACCA,aAAa,CAAEP,aAAF,CADd,GAECO,aAxDJ,CADD;AA4DA","sourcesContent":["/**\n * External dependencies\n */\nimport { map } from 'lodash';\n\n/**\n * Internal dependencies\n */\nimport PanelColorSettings from '../panel-color-settings';\nimport ContrastChecker from '../contrast-checker';\n\nconst resolveContrastCheckerColor = ( color, colorSettings, detectedColor ) => {\n\tif ( typeof color === 'function' ) {\n\t\treturn color( colorSettings );\n\t} else if ( color === true ) {\n\t\treturn detectedColor;\n\t}\n\treturn color;\n};\n\nexport default function ColorPanel( {\n\ttitle,\n\tcolorSettings,\n\tcolorPanelProps,\n\tcontrastCheckers,\n\tdetectedBackgroundColor,\n\tdetectedColor,\n\tpanelChildren,\n\tinitialOpen,\n} ) {\n\treturn (\n\t\t<PanelColorSettings\n\t\t\ttitle={ title }\n\t\t\tinitialOpen={ initialOpen }\n\t\t\tcolorSettings={ Object.values( colorSettings ) }\n\t\t\t{ ...colorPanelProps }\n\t\t>\n\t\t\t{ contrastCheckers &&\n\t\t\t\t( Array.isArray( contrastCheckers )\n\t\t\t\t\t? contrastCheckers.map(\n\t\t\t\t\t\t\t( { backgroundColor, textColor, ...rest } ) => {\n\t\t\t\t\t\t\t\tbackgroundColor = resolveContrastCheckerColor(\n\t\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\t\tcolorSettings,\n\t\t\t\t\t\t\t\t\tdetectedBackgroundColor\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\ttextColor = resolveContrastCheckerColor(\n\t\t\t\t\t\t\t\t\ttextColor,\n\t\t\t\t\t\t\t\t\tcolorSettings,\n\t\t\t\t\t\t\t\t\tdetectedColor\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t\t\t\tkey={ `${ backgroundColor }-${ textColor }` }\n\t\t\t\t\t\t\t\t\t\tbackgroundColor={ backgroundColor }\n\t\t\t\t\t\t\t\t\t\ttextColor={ textColor }\n\t\t\t\t\t\t\t\t\t\t{ ...rest }\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 )\n\t\t\t\t\t: map( colorSettings, ( { value } ) => {\n\t\t\t\t\t\t\tlet {\n\t\t\t\t\t\t\t\tbackgroundColor,\n\t\t\t\t\t\t\t\ttextColor,\n\t\t\t\t\t\t\t} = contrastCheckers;\n\t\t\t\t\t\t\tbackgroundColor = resolveContrastCheckerColor(\n\t\t\t\t\t\t\t\tbackgroundColor || value,\n\t\t\t\t\t\t\t\tcolorSettings,\n\t\t\t\t\t\t\t\tdetectedBackgroundColor\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\ttextColor = resolveContrastCheckerColor(\n\t\t\t\t\t\t\t\ttextColor || value,\n\t\t\t\t\t\t\t\tcolorSettings,\n\t\t\t\t\t\t\t\tdetectedColor\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ContrastChecker\n\t\t\t\t\t\t\t\t\t{ ...contrastCheckers }\n\t\t\t\t\t\t\t\t\tkey={ `${ backgroundColor }-${ textColor }` }\n\t\t\t\t\t\t\t\t\tbackgroundColor={ backgroundColor }\n\t\t\t\t\t\t\t\t\ttextColor={ textColor }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t } ) ) }\n\t\t\t{ typeof panelChildren === 'function'\n\t\t\t\t? panelChildren( colorSettings )\n\t\t\t\t: panelChildren }\n\t\t</PanelColorSettings>\n\t);\n}\n"]}
@@ -1,10 +1,14 @@
1
1
  "use strict";
2
2
 
3
- var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard");
4
-
5
3
  Object.defineProperty(exports, "__esModule", {
6
4
  value: true
7
5
  });
6
+ Object.defineProperty(exports, "createCustomColorsHOC", {
7
+ enumerable: true,
8
+ get: function () {
9
+ return _withColors.createCustomColorsHOC;
10
+ }
11
+ });
8
12
  Object.defineProperty(exports, "getColorClassName", {
9
13
  enumerable: true,
10
14
  get: function () {
@@ -23,12 +27,6 @@ Object.defineProperty(exports, "getColorObjectByColorValue", {
23
27
  return _utils.getColorObjectByColorValue;
24
28
  }
25
29
  });
26
- Object.defineProperty(exports, "createCustomColorsHOC", {
27
- enumerable: true,
28
- get: function () {
29
- return _withColors.createCustomColorsHOC;
30
- }
31
- });
32
30
  Object.defineProperty(exports, "withColors", {
33
31
  enumerable: true,
34
32
  get: function () {
@@ -39,4 +37,8 @@ Object.defineProperty(exports, "withColors", {
39
37
  var _utils = require("./utils");
40
38
 
41
39
  var _withColors = _interopRequireWildcard(require("./with-colors"));
40
+
41
+ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
42
+
43
+ function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
42
44
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAKA","sourcesContent":["export {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n\tgetColorObjectByColorValue,\n} from './utils';\nexport { createCustomColorsHOC, default as withColors } from './with-colors';\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors/index.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;AAKA","sourcesContent":["export {\n\tgetColorClassName,\n\tgetColorObjectByAttributeValues,\n\tgetColorObjectByColorValue,\n} from './utils';\nexport { createCustomColorsHOC, default as withColors } from './with-colors';\n"]}
@@ -6,8 +6,8 @@ Object.defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.getColorClassName = getColorClassName;
9
- exports.getMostReadableColor = getMostReadableColor;
10
9
  exports.getColorObjectByColorValue = exports.getColorObjectByAttributeValues = void 0;
10
+ exports.getMostReadableColor = getMostReadableColor;
11
11
 
12
12
  var _lodash = require("lodash");
13
13
 
@@ -99,8 +99,11 @@ function getColorClassName(colorContextName, colorSlug) {
99
99
 
100
100
  function getMostReadableColor(colors, colorValue) {
101
101
  const colordColor = (0, _colord.colord)(colorValue);
102
- return (0, _lodash.maxBy)(colors, ({
103
- color
104
- }) => colordColor.contrast(color)).color;
102
+ return (0, _lodash.maxBy)(colors, _ref => {
103
+ let {
104
+ color
105
+ } = _ref;
106
+ return colordColor.contrast(color);
107
+ }).color;
105
108
  }
106
109
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors/utils.js"],"names":["namesPlugin","a11yPlugin","getColorObjectByAttributeValues","colors","definedColor","customColor","colorObj","slug","color","getColorObjectByColorValue","colorValue","getColorClassName","colorContextName","colorSlug","undefined","getMostReadableColor","colordColor","contrast"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,oBAAQ,CAAEA,cAAF,EAAeC,aAAf,CAAR;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMC,+BAA+B,GAAG,CAC9CC,MAD8C,EAE9CC,YAF8C,EAG9CC,WAH8C,KAI1C;AACJ,MAAKD,YAAL,EAAoB;AACnB,UAAME,QAAQ,GAAG,kBAAMH,MAAN,EAAc;AAAEI,MAAAA,IAAI,EAAEH;AAAR,KAAd,CAAjB;;AAEA,QAAKE,QAAL,EAAgB;AACf,aAAOA,QAAP;AACA;AACD;;AACD,SAAO;AACNE,IAAAA,KAAK,EAAEH;AADD,GAAP;AAGA,CAfM;AAiBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMI,0BAA0B,GAAG,CAAEN,MAAF,EAAUO,UAAV,KAA0B;AACnE,SAAO,kBAAMP,MAAN,EAAc;AAAEK,IAAAA,KAAK,EAAEE;AAAT,GAAd,CAAP;AACA,CAFM;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASC,iBAAT,CAA4BC,gBAA5B,EAA8CC,SAA9C,EAA0D;AAChE,MAAK,CAAED,gBAAF,IAAsB,CAAEC,SAA7B,EAAyC;AACxC,WAAOC,SAAP;AACA;;AAED,SAAQ,OAAO,uBAAWD,SAAX,CAAwB,IAAID,gBAAkB,EAA7D;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,oBAAT,CAA+BZ,MAA/B,EAAuCO,UAAvC,EAAoD;AAC1D,QAAMM,WAAW,GAAG,oBAAQN,UAAR,CAApB;AACA,SAAO,mBAAOP,MAAP,EAAe,CAAE;AAAEK,IAAAA;AAAF,GAAF,KAAiBQ,WAAW,CAACC,QAAZ,CAAsBT,KAAtB,CAAhC,EACLA,KADF;AAEA","sourcesContent":["/**\n * External dependencies\n */\nimport { find, kebabCase, maxBy } from 'lodash';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults,\n * and the values of the defined color or custom color returns a color object describing the color.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} definedColor A string containing the color slug.\n * @param {?string} customColor A string containing the customColor value.\n *\n * @return {?Object} If definedColor is passed and the name is found in colors,\n * the color object exactly as set by the theme or editor defaults is returned.\n * Otherwise, an object that just sets the color is defined.\n */\nexport const getColorObjectByAttributeValues = (\n\tcolors,\n\tdefinedColor,\n\tcustomColor\n) => {\n\tif ( definedColor ) {\n\t\tconst colorObj = find( colors, { slug: definedColor } );\n\n\t\tif ( colorObj ) {\n\t\t\treturn colorObj;\n\t\t}\n\t}\n\treturn {\n\t\tcolor: customColor,\n\t};\n};\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {?Object} Color object included in the colors array whose color property equals colorValue.\n * Returns undefined if no color object matches this requirement.\n */\nexport const getColorObjectByColorValue = ( colors, colorValue ) => {\n\treturn find( colors, { color: colorValue } );\n};\n\n/**\n * Returns a class based on the context a color is being used and its slug.\n *\n * @param {string} colorContextName Context/place where color is being used e.g: background, text etc...\n * @param {string} colorSlug Slug of the color.\n *\n * @return {?string} String with the class corresponding to the color in the provided context.\n * Returns undefined if either colorContextName or colorSlug are not provided.\n */\nexport function getColorClassName( colorContextName, colorSlug ) {\n\tif ( ! colorContextName || ! colorSlug ) {\n\t\treturn undefined;\n\t}\n\n\treturn `has-${ kebabCase( colorSlug ) }-${ colorContextName }`;\n}\n\n/**\n * Given an array of color objects and a color value returns the color value of the most readable color in the array.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {string} String with the color value of the most readable color.\n */\nexport function getMostReadableColor( colors, colorValue ) {\n\tconst colordColor = colord( colorValue );\n\treturn maxBy( colors, ( { color } ) => colordColor.contrast( color ) )\n\t\t.color;\n}\n"]}
1
+ {"version":3,"sources":["@wordpress/block-editor/src/components/colors/utils.js"],"names":["namesPlugin","a11yPlugin","getColorObjectByAttributeValues","colors","definedColor","customColor","colorObj","slug","color","getColorObjectByColorValue","colorValue","getColorClassName","colorContextName","colorSlug","undefined","getMostReadableColor","colordColor","contrast"],"mappings":";;;;;;;;;;;AAGA;;AACA;;AACA;;AACA;;AANA;AACA;AACA;AAMA,oBAAQ,CAAEA,cAAF,EAAeC,aAAf,CAAR;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACO,MAAMC,+BAA+B,GAAG,CAC9CC,MAD8C,EAE9CC,YAF8C,EAG9CC,WAH8C,KAI1C;AACJ,MAAKD,YAAL,EAAoB;AACnB,UAAME,QAAQ,GAAG,kBAAMH,MAAN,EAAc;AAAEI,MAAAA,IAAI,EAAEH;AAAR,KAAd,CAAjB;;AAEA,QAAKE,QAAL,EAAgB;AACf,aAAOA,QAAP;AACA;AACD;;AACD,SAAO;AACNE,IAAAA,KAAK,EAAEH;AADD,GAAP;AAGA,CAfM;AAiBP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,MAAMI,0BAA0B,GAAG,CAAEN,MAAF,EAAUO,UAAV,KAA0B;AACnE,SAAO,kBAAMP,MAAN,EAAc;AAAEK,IAAAA,KAAK,EAAEE;AAAT,GAAd,CAAP;AACA,CAFM;AAIP;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;AACO,SAASC,iBAAT,CAA4BC,gBAA5B,EAA8CC,SAA9C,EAA0D;AAChE,MAAK,CAAED,gBAAF,IAAsB,CAAEC,SAA7B,EAAyC;AACxC,WAAOC,SAAP;AACA;;AAED,SAAQ,OAAO,uBAAWD,SAAX,CAAwB,IAAID,gBAAkB,EAA7D;AACA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASG,oBAAT,CAA+BZ,MAA/B,EAAuCO,UAAvC,EAAoD;AAC1D,QAAMM,WAAW,GAAG,oBAAQN,UAAR,CAApB;AACA,SAAO,mBAAOP,MAAP,EAAe;AAAA,QAAE;AAAEK,MAAAA;AAAF,KAAF;AAAA,WAAiBQ,WAAW,CAACC,QAAZ,CAAsBT,KAAtB,CAAjB;AAAA,GAAf,EACLA,KADF;AAEA","sourcesContent":["/**\n * External dependencies\n */\nimport { find, kebabCase, maxBy } from 'lodash';\nimport { colord, extend } from 'colord';\nimport namesPlugin from 'colord/plugins/names';\nimport a11yPlugin from 'colord/plugins/a11y';\n\nextend( [ namesPlugin, a11yPlugin ] );\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults,\n * and the values of the defined color or custom color returns a color object describing the color.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} definedColor A string containing the color slug.\n * @param {?string} customColor A string containing the customColor value.\n *\n * @return {?Object} If definedColor is passed and the name is found in colors,\n * the color object exactly as set by the theme or editor defaults is returned.\n * Otherwise, an object that just sets the color is defined.\n */\nexport const getColorObjectByAttributeValues = (\n\tcolors,\n\tdefinedColor,\n\tcustomColor\n) => {\n\tif ( definedColor ) {\n\t\tconst colorObj = find( colors, { slug: definedColor } );\n\n\t\tif ( colorObj ) {\n\t\t\treturn colorObj;\n\t\t}\n\t}\n\treturn {\n\t\tcolor: customColor,\n\t};\n};\n\n/**\n * Provided an array of color objects as set by the theme or by the editor defaults, and a color value returns the color object matching that value or undefined.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {?Object} Color object included in the colors array whose color property equals colorValue.\n * Returns undefined if no color object matches this requirement.\n */\nexport const getColorObjectByColorValue = ( colors, colorValue ) => {\n\treturn find( colors, { color: colorValue } );\n};\n\n/**\n * Returns a class based on the context a color is being used and its slug.\n *\n * @param {string} colorContextName Context/place where color is being used e.g: background, text etc...\n * @param {string} colorSlug Slug of the color.\n *\n * @return {?string} String with the class corresponding to the color in the provided context.\n * Returns undefined if either colorContextName or colorSlug are not provided.\n */\nexport function getColorClassName( colorContextName, colorSlug ) {\n\tif ( ! colorContextName || ! colorSlug ) {\n\t\treturn undefined;\n\t}\n\n\treturn `has-${ kebabCase( colorSlug ) }-${ colorContextName }`;\n}\n\n/**\n * Given an array of color objects and a color value returns the color value of the most readable color in the array.\n *\n * @param {Array} colors Array of color objects as set by the theme or by the editor defaults.\n * @param {?string} colorValue A string containing the color value.\n *\n * @return {string} String with the color value of the most readable color.\n */\nexport function getMostReadableColor( colors, colorValue ) {\n\tconst colordColor = colord( colorValue );\n\treturn maxBy( colors, ( { color } ) => colordColor.contrast( color ) )\n\t\t.color;\n}\n"]}
@@ -114,10 +114,11 @@ function createColorHOC(colorTypes, withColorPalette) {
114
114
  };
115
115
  }
116
116
 
117
- static getDerivedStateFromProps({
118
- attributes,
119
- colors
120
- }, previousState) {
117
+ static getDerivedStateFromProps(_ref, previousState) {
118
+ let {
119
+ attributes,
120
+ colors
121
+ } = _ref;
121
122
  return (0, _lodash.reduce)(colorMap, (newState, colorContext, colorAttributeName) => {
122
123
  const colorObject = (0, _utils.getColorObjectByAttributeValues)(colors, attributes[colorAttributeName], attributes[`custom${(0, _lodash.upperFirst)(colorAttributeName)}`]);
123
124
  const previousColorObject = previousState[colorAttributeName];
@@ -176,8 +177,13 @@ function createColorHOC(colorTypes, withColorPalette) {
176
177
 
177
178
 
178
179
  function createCustomColorsHOC(colorsArray) {
179
- return (...colorTypes) => {
180
+ return function () {
180
181
  const withColorPalette = withCustomColorPalette(colorsArray);
182
+
183
+ for (var _len = arguments.length, colorTypes = new Array(_len), _key = 0; _key < _len; _key++) {
184
+ colorTypes[_key] = arguments[_key];
185
+ }
186
+
181
187
  return (0, _compose.createHigherOrderComponent)(createColorHOC(colorTypes, withColorPalette), 'withCustomColors');
182
188
  };
183
189
  }
@@ -207,8 +213,13 @@ function createCustomColorsHOC(colorsArray) {
207
213
  */
208
214
 
209
215
 
210
- function withColors(...colorTypes) {
216
+ function withColors() {
211
217
  const withColorPalette = withEditorColorPalette();
218
+
219
+ for (var _len2 = arguments.length, colorTypes = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
220
+ colorTypes[_key2] = arguments[_key2];
221
+ }
222
+
212
223
  return (0, _compose.createHigherOrderComponent)(createColorHOC(colorTypes, withColorPalette), 'withColors');
213
224
  }
214
225
  //# sourceMappingURL=with-colors.js.map
@@ -1 +1 @@
1
- {"version":3,"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"names":["DEFAULT_COLORS","withCustomColorPalette","colorsArray","WrappedComponent","props","withEditorColorPalette","colors","createColorHOC","colorTypes","withColorPalette","colorMap","colorObject","colorType","Component","constructor","setters","createSetters","colorUtils","getMostReadableColor","bind","state","colorValue","settersAccumulator","colorContext","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","attributes","previousState","newState","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"mappings":"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","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":["DEFAULT_COLORS","withCustomColorPalette","colorsArray","WrappedComponent","props","withEditorColorPalette","colors","createColorHOC","colorTypes","withColorPalette","colorMap","colorObject","colorType","Component","constructor","setters","createSetters","colorUtils","getMostReadableColor","bind","state","colorValue","settersAccumulator","colorContext","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","previousState","attributes","newState","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"mappings":";;;;;;;;;;AAQA;;;;AALA;;AAMA;;AAKA;;AAMA;;AApBA;AACA;AACA;;AAGA;AACA;AACA;;AAIA;AACA;AACA;AASA,MAAMA,cAAc,GAAG,EAAvB;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AACA,MAAMC,sBAAsB,GAAKC,WAAF,IAC9B,yCACGC,gBAAF,IAA0BC,KAAF,IACvB,4BAAC,gBAAD,6BAAuBA,KAAvB;AAA+B,EAAA,MAAM,EAAGF;AAAxC,GAFF,EAIC,wBAJD,CADD;AAQA;AACA;AACA;AACA;AACA;AACA;;;AACA,MAAMG,sBAAsB,GAAG,MAC9B,yCACGF,gBAAF,IAA0BC,KAAF,IAAa;AACpC,QAAME,MAAM,GAAG,yBAAY,eAAZ,KAAiCN,cAAhD;AACA,SAAO,4BAAC,gBAAD,6BAAuBI,KAAvB;AAA+B,IAAA,MAAM,EAAGE;AAAxC,KAAP;AACA,CAJF,EAKC,wBALD,CADD;AASA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACA,SAASC,cAAT,CAAyBC,UAAzB,EAAqCC,gBAArC,EAAwD;AACvD,QAAMC,QAAQ,GAAG,oBAChBF,UADgB,EAEhB,CAAEG,WAAF,EAAeC,SAAf,KAA8B;AAC7B,WAAO,EACN,GAAGD,WADG;AAEN,UAAK,sBAAUC,SAAV,IACF;AAAE,SAAEA,SAAF,GAAe,uBAAWA,SAAX;AAAjB,OADE,GAEFA,SAFH;AAFM,KAAP;AAMA,GATe,EAUhB,EAVgB,CAAjB;AAaA,SAAO,sBAAS,CACfH,gBADe,EAEbN,gBAAF,IAAwB;AACvB,WAAO,cAAcU,kBAAd,CAAwB;AAC9BC,MAAAA,WAAW,CAAEV,KAAF,EAAU;AACpB,cAAOA,KAAP;AAEA,aAAKW,OAAL,GAAe,KAAKC,aAAL,EAAf;AACA,aAAKC,UAAL,GAAkB;AACjBC,UAAAA,oBAAoB,EAAE,KAAKA,oBAAL,CAA0BC,IAA1B,CACrB,IADqB;AADL,SAAlB;AAMA,aAAKC,KAAL,GAAa,EAAb;AACA;;AAEDF,MAAAA,oBAAoB,CAAEG,UAAF,EAAe;AAClC,cAAM;AAAEf,UAAAA;AAAF,YAAa,KAAKF,KAAxB;AACA,eAAO,iCAAsBE,MAAtB,EAA8Be,UAA9B,CAAP;AACA;;AAEDL,MAAAA,aAAa,GAAG;AACf,eAAO,oBACNN,QADM,EAEN,CACCY,kBADD,EAECC,YAFD,EAGCC,kBAHD,KAIK;AACJ,gBAAMC,4BAA4B,GAAG,wBACpCD,kBADoC,CAArC;AAGA,gBAAME,wBAAwB,GAAI,SAASD,4BAA8B,EAAzE;AACAH,UAAAA,kBAAkB,CAChB,MAAMG,4BAA8B,EADpB,CAAlB,GAEI,KAAKE,cAAL,CACHH,kBADG,EAEHE,wBAFG,CAFJ;AAMA,iBAAOJ,kBAAP;AACA,SAlBK,EAmBN,EAnBM,CAAP;AAqBA;;AAEDK,MAAAA,cAAc,CAAEH,kBAAF,EAAsBE,wBAAtB,EAAiD;AAC9D,eAASL,UAAF,IAAkB;AACxB,gBAAMV,WAAW,GAAG,uCACnB,KAAKP,KAAL,CAAWE,MADQ,EAEnBe,UAFmB,CAApB;AAIA,eAAKjB,KAAL,CAAWwB,aAAX,CAA0B;AACzB,aAAEJ,kBAAF,GACCb,WAAW,IAAIA,WAAW,CAACkB,IAA3B,GACGlB,WAAW,CAACkB,IADf,GAEGC,SAJqB;AAKzB,aAAEJ,wBAAF,GACCf,WAAW,IAAIA,WAAW,CAACkB,IAA3B,GACGC,SADH,GAEGT;AARqB,WAA1B;AAUA,SAfD;AAgBA;;AAE8B,aAAxBU,wBAAwB,OAE9BC,aAF8B,EAG7B;AAAA,YAFD;AAAEC,UAAAA,UAAF;AAAc3B,UAAAA;AAAd,SAEC;AACD,eAAO,oBACNI,QADM,EAEN,CAAEwB,QAAF,EAAYX,YAAZ,EAA0BC,kBAA1B,KAAkD;AACjD,gBAAMb,WAAW,GAAG,4CACnBL,MADmB,EAEnB2B,UAAU,CAAET,kBAAF,CAFS,EAGnBS,UAAU,CACR,SAAS,wBACTT,kBADS,CAEP,EAHM,CAHS,CAApB;AAUA,gBAAMW,mBAAmB,GACxBH,aAAa,CAAER,kBAAF,CADd;AAEA,gBAAMY,aAAa,GAAGD,mBAAH,aAAGA,mBAAH,uBAAGA,mBAAmB,CAAEE,KAA3C;AACA;AACP;AACA;AACA;AACA;;AACO,cACCD,aAAa,KAAKzB,WAAW,CAAC0B,KAA9B,IACAF,mBAFD,EAGE;AACDD,YAAAA,QAAQ,CACPV,kBADO,CAAR,GAEIW,mBAFJ;AAGA,WAPD,MAOO;AACND,YAAAA,QAAQ,CAAEV,kBAAF,CAAR,GAAiC,EAChC,GAAGb,WAD6B;AAEhC2B,cAAAA,KAAK,EAAE,8BACNf,YADM,EAENZ,WAAW,CAACkB,IAFN;AAFyB,aAAjC;AAOA;;AACD,iBAAOK,QAAP;AACA,SAtCK,EAuCN,EAvCM,CAAP;AAyCA;;AAEDK,MAAAA,MAAM,GAAG;AACR,eACC,4BAAC,gBAAD,6BAEK,KAAKnC,KAFV;AAGEE,UAAAA,MAAM,EAAEwB;AAHV,WAIK,KAAKV,KAJV,EAKK,KAAKL,OALV;AAMEE,UAAAA,UAAU,EAAE,KAAKA;AANnB,WADD;AAWA;;AAzH6B,KAA/B;AA2HA,GA9Hc,CAAT,CAAP;AAgIA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACO,SAASuB,qBAAT,CAAgCtC,WAAhC,EAA8C;AACpD,SAAO,YAAqB;AAC3B,UAAMO,gBAAgB,GAAGR,sBAAsB,CAAEC,WAAF,CAA/C;;AAD2B,sCAAhBM,UAAgB;AAAhBA,MAAAA,UAAgB;AAAA;;AAE3B,WAAO,yCACND,cAAc,CAAEC,UAAF,EAAcC,gBAAd,CADR,EAEN,kBAFM,CAAP;AAIA,GAND;AAOA;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;AACe,SAASgC,UAAT,GAAqC;AACnD,QAAMhC,gBAAgB,GAAGJ,sBAAsB,EAA/C;;AADmD,qCAAbG,UAAa;AAAbA,IAAAA,UAAa;AAAA;;AAEnD,SAAO,yCACND,cAAc,CAAEC,UAAF,EAAcC,gBAAd,CADR,EAEN,YAFM,CAAP;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"]}
@@ -19,10 +19,6 @@ var _components = require("@wordpress/components");
19
19
 
20
20
  var _i18n = require("@wordpress/i18n");
21
21
 
22
- var _colors = require("../colors");
23
-
24
- var _gradients = require("../gradients");
25
-
26
22
  var _useSetting = _interopRequireDefault(require("../use-setting"));
27
23
 
28
24
  /**
@@ -36,55 +32,24 @@ var _useSetting = _interopRequireDefault(require("../use-setting"));
36
32
  /**
37
33
  * Internal dependencies
38
34
  */
39
- // translators: first %s: the color name or value (e.g. red or #ff0000)
40
- const colorIndicatorAriaLabel = (0, _i18n.__)('(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%)
41
-
42
- const gradientIndicatorAriaLabel = (0, _i18n.__)('(Gradient: %s)');
43
35
  const colorsAndGradientKeys = ['colors', 'disableCustomColors', 'gradients', 'disableCustomGradients'];
44
36
 
45
- function VisualLabel({
46
- colors,
47
- gradients,
48
- label,
49
- currentTab,
50
- colorValue,
51
- gradientValue
52
- }) {
53
- let value, ariaLabel;
54
-
55
- if (currentTab === 'color') {
56
- if (colorValue) {
57
- value = colorValue;
58
- const colorObject = (0, _colors.getColorObjectByColorValue)(colors, value);
59
- const colorName = colorObject && colorObject.name;
60
- ariaLabel = (0, _i18n.sprintf)(colorIndicatorAriaLabel, colorName || value);
61
- }
62
- } else if (currentTab === 'gradient' && gradientValue) {
63
- value = gradientValue;
64
- const gradientObject = (0, _gradients.__experimentalGetGradientObjectByGradientValue)(gradients, value);
65
- const gradientName = gradientObject && gradientObject.name;
66
- ariaLabel = (0, _i18n.sprintf)(gradientIndicatorAriaLabel, gradientName || value);
67
- }
68
-
69
- return (0, _element.createElement)(_element.Fragment, null, label, !!value && (0, _element.createElement)(_components.ColorIndicator, {
70
- colorValue: value,
71
- "aria-label": ariaLabel
72
- }));
73
- }
74
-
75
- function ColorGradientControlInner({
76
- colors,
77
- gradients,
78
- disableCustomColors,
79
- disableCustomGradients,
80
- className,
81
- label,
82
- onColorChange,
83
- onGradientChange,
84
- colorValue,
85
- gradientValue,
86
- clearable
87
- }) {
37
+ function ColorGradientControlInner(_ref) {
38
+ let {
39
+ colors,
40
+ gradients,
41
+ disableCustomColors,
42
+ disableCustomGradients,
43
+ __experimentalHasMultipleOrigins,
44
+ className,
45
+ label,
46
+ onColorChange,
47
+ onGradientChange,
48
+ colorValue,
49
+ gradientValue,
50
+ clearable,
51
+ showTitle = true
52
+ } = _ref;
88
53
  const canChooseAColor = onColorChange && (!(0, _lodash.isEmpty)(colors) || !disableCustomColors);
89
54
  const canChooseAGradient = onGradientChange && (!(0, _lodash.isEmpty)(gradients) || !disableCustomGradients);
90
55
  const [currentTab, setCurrentTab] = (0, _element.useState)(gradientValue ? 'gradient' : !!canChooseAColor && 'color');
@@ -96,15 +61,10 @@ function ColorGradientControlInner({
96
61
  return (0, _element.createElement)(_components.BaseControl, {
97
62
  className: (0, _classnames.default)('block-editor-color-gradient-control', className)
98
63
  }, (0, _element.createElement)("fieldset", null, (0, _element.createElement)(_components.__experimentalVStack, {
99
- space: 3
100
- }, (0, _element.createElement)("legend", null, (0, _element.createElement)("div", {
64
+ spacing: 1
65
+ }, showTitle && (0, _element.createElement)("legend", null, (0, _element.createElement)("div", {
101
66
  className: "block-editor-color-gradient-control__color-indicator"
102
- }, (0, _element.createElement)(_components.BaseControl.VisualLabel, null, (0, _element.createElement)(VisualLabel, {
103
- currentTab: currentTab,
104
- label: label,
105
- colorValue: colorValue,
106
- gradientValue: gradientValue
107
- })))), canChooseAColor && canChooseAGradient && (0, _element.createElement)(_components.__experimentalToggleGroupControl, {
67
+ }, (0, _element.createElement)(_components.BaseControl.VisualLabel, null, label))), canChooseAColor && canChooseAGradient && (0, _element.createElement)(_components.__experimentalToggleGroupControl, {
108
68
  value: currentTab,
109
69
  onChange: setCurrentTab,
110
70
  label: (0, _i18n.__)('Select color type'),
@@ -124,6 +84,7 @@ function ColorGradientControlInner({
124
84
  } : onColorChange,
125
85
  colors,
126
86
  disableCustomColors,
87
+ __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
127
88
  clearable: clearable
128
89
  }), (currentTab === 'gradient' || !canChooseAColor) && (0, _element.createElement)(_components.GradientPicker, {
129
90
  value: gradientValue,
@@ -133,6 +94,7 @@ function ColorGradientControlInner({
133
94
  } : onGradientChange,
134
95
  gradients,
135
96
  disableCustomGradients,
97
+ __experimentalHasMultipleOrigins: __experimentalHasMultipleOrigins,
136
98
  clearable: clearable
137
99
  }))));
138
100
  }