@wordpress/block-editor 12.16.0 → 12.17.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (646) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/LICENSE.md +1 -1
  3. package/README.md +3 -6
  4. package/build/components/block-canvas/index.js +0 -2
  5. package/build/components/block-canvas/index.js.map +1 -1
  6. package/build/components/block-card/index.js +1 -1
  7. package/build/components/block-card/index.js.map +1 -1
  8. package/build/components/block-draggable/draggable-chip.js +6 -1
  9. package/build/components/block-draggable/draggable-chip.js.map +1 -1
  10. package/build/components/block-draggable/index.js +76 -6
  11. package/build/components/block-draggable/index.js.map +1 -1
  12. package/build/components/block-draggable/index.native.js +0 -6
  13. package/build/components/block-draggable/index.native.js.map +1 -1
  14. package/build/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  15. package/build/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  16. package/build/components/block-editing-mode/index.js +2 -3
  17. package/build/components/block-editing-mode/index.js.map +1 -1
  18. package/build/components/block-inspector/index.js +1 -1
  19. package/build/components/block-inspector/index.js.map +1 -1
  20. package/build/components/block-list/block-list-item-cell.native.js +1 -0
  21. package/build/components/block-list/block-list-item-cell.native.js.map +1 -1
  22. package/build/components/block-list/block.js +245 -102
  23. package/build/components/block-list/block.js.map +1 -1
  24. package/build/components/block-list/block.native.js +46 -20
  25. package/build/components/block-list/block.native.js.map +1 -1
  26. package/build/components/block-list/index.native.js +3 -5
  27. package/build/components/block-list/index.native.js.map +1 -1
  28. package/build/components/block-list/private-block-context.js +14 -0
  29. package/build/components/block-list/private-block-context.js.map +1 -0
  30. package/build/components/block-list/use-block-props/index.js +33 -96
  31. package/build/components/block-list/use-block-props/index.js.map +1 -1
  32. package/build/components/block-list/use-in-between-inserter.js +3 -2
  33. package/build/components/block-list/use-in-between-inserter.js.map +1 -1
  34. package/build/components/block-list/use-scroll-upon-insertion.native.js +41 -0
  35. package/build/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
  36. package/build/components/block-lock/toolbar.js +15 -27
  37. package/build/components/block-lock/toolbar.js.map +1 -1
  38. package/build/components/block-mover/index.js +2 -1
  39. package/build/components/block-mover/index.js.map +1 -1
  40. package/build/components/block-patterns-list/index.js +4 -4
  41. package/build/components/block-patterns-list/index.js.map +1 -1
  42. package/build/components/block-switcher/index.js +4 -4
  43. package/build/components/block-switcher/index.js.map +1 -1
  44. package/build/components/block-toolbar/index.js +1 -2
  45. package/build/components/block-toolbar/index.js.map +1 -1
  46. package/build/components/block-tools/block-toolbar-popover.js +0 -2
  47. package/build/components/block-tools/block-toolbar-popover.js.map +1 -1
  48. package/build/components/block-variation-transforms/index.js +29 -2
  49. package/build/components/block-variation-transforms/index.js.map +1 -1
  50. package/build/components/border-radius-control/linked-button.js +1 -1
  51. package/build/components/border-radius-control/linked-button.js.map +1 -1
  52. package/build/components/colors/utils.js +10 -2
  53. package/build/components/colors/utils.js.map +1 -1
  54. package/build/components/colors/with-colors.js +6 -2
  55. package/build/components/colors/with-colors.js.map +1 -1
  56. package/build/components/font-sizes/utils.js +10 -2
  57. package/build/components/font-sizes/utils.js.map +1 -1
  58. package/build/components/global-styles/border-panel.js +2 -1
  59. package/build/components/global-styles/border-panel.js.map +1 -1
  60. package/build/components/global-styles/color-panel.js +2 -1
  61. package/build/components/global-styles/color-panel.js.map +1 -1
  62. package/build/components/global-styles/dimensions-panel.js +4 -3
  63. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  64. package/build/components/global-styles/effects-panel.js +2 -1
  65. package/build/components/global-styles/effects-panel.js.map +1 -1
  66. package/build/components/global-styles/filters-panel.js +1 -4
  67. package/build/components/global-styles/filters-panel.js.map +1 -1
  68. package/build/components/global-styles/get-global-styles-changes.js +192 -0
  69. package/build/components/global-styles/get-global-styles-changes.js.map +1 -0
  70. package/build/components/global-styles/hooks.js +1 -1
  71. package/build/components/global-styles/hooks.js.map +1 -1
  72. package/build/components/global-styles/image-settings-panel.js +7 -1
  73. package/build/components/global-styles/image-settings-panel.js.map +1 -1
  74. package/build/components/global-styles/index.js +7 -0
  75. package/build/components/global-styles/index.js.map +1 -1
  76. package/build/components/global-styles/typography-panel.js +2 -1
  77. package/build/components/global-styles/typography-panel.js.map +1 -1
  78. package/build/components/global-styles/use-global-styles-output.js +22 -8
  79. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  80. package/build/components/global-styles/utils.js +8 -1
  81. package/build/components/global-styles/utils.js.map +1 -1
  82. package/build/components/height-control/index.js +6 -2
  83. package/build/components/height-control/index.js.map +1 -1
  84. package/build/components/image-size-control/index.js +2 -2
  85. package/build/components/image-size-control/index.js.map +1 -1
  86. package/build/components/index.native.js +6 -5
  87. package/build/components/index.native.js.map +1 -1
  88. package/build/components/inner-blocks/index.js +61 -22
  89. package/build/components/inner-blocks/index.js.map +1 -1
  90. package/build/components/inner-blocks/index.native.js +18 -4
  91. package/build/components/inner-blocks/index.native.js.map +1 -1
  92. package/build/components/inner-blocks/use-inner-block-template-sync.js +5 -6
  93. package/build/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  94. package/build/components/inner-blocks/use-nested-settings-update.js +5 -9
  95. package/build/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  96. package/build/components/inserter/block-patterns-explorer/pattern-list.js +1 -1
  97. package/build/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  98. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js +10 -9
  99. package/build/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  100. package/build/components/inserter/block-patterns-tab/patterns-filter.js +10 -10
  101. package/build/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  102. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js +9 -9
  103. package/build/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  104. package/build/components/inserter/block-patterns-tab/utils.js +10 -14
  105. package/build/components/inserter/block-patterns-tab/utils.js.map +1 -1
  106. package/build/components/inserter/hooks/use-block-types-state.js +4 -14
  107. package/build/components/inserter/hooks/use-block-types-state.js.map +1 -1
  108. package/build/components/inserter/hooks/use-patterns-state.js +1 -1
  109. package/build/components/inserter/hooks/use-patterns-state.js.map +1 -1
  110. package/build/components/inserter/index.js +1 -2
  111. package/build/components/inserter/index.js.map +1 -1
  112. package/build/components/inserter/library.js +3 -7
  113. package/build/components/inserter/library.js.map +1 -1
  114. package/build/components/inserter/menu.js +14 -28
  115. package/build/components/inserter/menu.js.map +1 -1
  116. package/build/components/inserter/tabs.js +21 -21
  117. package/build/components/inserter/tabs.js.map +1 -1
  118. package/build/components/inserter-draggable-blocks/index.js +1 -1
  119. package/build/components/inserter-draggable-blocks/index.js.map +1 -1
  120. package/build/components/inserter-list-item/index.js +2 -4
  121. package/build/components/inserter-list-item/index.js.map +1 -1
  122. package/build/components/inspector-controls/block-support-tools-panel.js +3 -1
  123. package/build/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  124. package/build/components/inspector-controls-tabs/index.js +34 -23
  125. package/build/components/inspector-controls-tabs/index.js.map +1 -1
  126. package/build/components/list-view/block-select-button.js +4 -0
  127. package/build/components/list-view/block-select-button.js.map +1 -1
  128. package/build/components/list-view/block.js +57 -3
  129. package/build/components/list-view/block.js.map +1 -1
  130. package/build/components/media-upload-progress/constants.js +19 -0
  131. package/build/components/media-upload-progress/constants.js.map +1 -0
  132. package/build/components/media-upload-progress/index.native.js +42 -17
  133. package/build/components/media-upload-progress/index.native.js.map +1 -1
  134. package/build/components/navigable-toolbar/index.js +9 -14
  135. package/build/components/navigable-toolbar/index.js.map +1 -1
  136. package/build/components/plain-text/index.native.js +8 -3
  137. package/build/components/plain-text/index.native.js.map +1 -1
  138. package/build/components/provider/index.js +3 -1
  139. package/build/components/provider/index.js.map +1 -1
  140. package/build/components/provider/use-block-sync.js +7 -1
  141. package/build/components/provider/use-block-sync.js.map +1 -1
  142. package/build/components/rich-text/index.js +17 -7
  143. package/build/components/rich-text/index.js.map +1 -1
  144. package/build/components/rich-text/native/index.native.js +16 -24
  145. package/build/components/rich-text/native/index.native.js.map +1 -1
  146. package/build/components/rich-text/use-input-rules.js +2 -2
  147. package/build/components/rich-text/use-input-rules.js.map +1 -1
  148. package/build/components/rich-text/use-mark-persistent.js +1 -1
  149. package/build/components/rich-text/use-mark-persistent.js.map +1 -1
  150. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  151. package/build/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  152. package/build/components/url-input/index.js +9 -6
  153. package/build/components/url-input/index.js.map +1 -1
  154. package/build/components/use-block-commands/index.js +14 -18
  155. package/build/components/use-block-commands/index.js.map +1 -1
  156. package/build/components/use-block-drop-zone/index.js +51 -22
  157. package/build/components/use-block-drop-zone/index.js.map +1 -1
  158. package/build/components/use-moving-animation/index.js +100 -92
  159. package/build/components/use-moving-animation/index.js.map +1 -1
  160. package/build/components/use-on-block-drop/index.js +8 -11
  161. package/build/components/use-on-block-drop/index.js.map +1 -1
  162. package/build/components/writing-flow/index.js +0 -1
  163. package/build/components/writing-flow/index.js.map +1 -1
  164. package/build/components/writing-flow/use-drag-selection.js +15 -4
  165. package/build/components/writing-flow/use-drag-selection.js.map +1 -1
  166. package/build/components/writing-flow/use-selection-observer.js +73 -27
  167. package/build/components/writing-flow/use-selection-observer.js.map +1 -1
  168. package/build/components/writing-flow/use-tab-nav.js +7 -4
  169. package/build/components/writing-flow/use-tab-nav.js.map +1 -1
  170. package/build/hooks/align.js +1 -1
  171. package/build/hooks/align.js.map +1 -1
  172. package/build/hooks/anchor.js +1 -1
  173. package/build/hooks/anchor.js.map +1 -1
  174. package/build/hooks/aria-label.js +9 -1
  175. package/build/hooks/aria-label.js.map +1 -1
  176. package/build/hooks/background.js +185 -20
  177. package/build/hooks/background.js.map +1 -1
  178. package/build/hooks/border.js +5 -10
  179. package/build/hooks/border.js.map +1 -1
  180. package/build/hooks/color.js +13 -11
  181. package/build/hooks/color.js.map +1 -1
  182. package/build/hooks/custom-class-name.js +1 -1
  183. package/build/hooks/custom-class-name.js.map +1 -1
  184. package/build/hooks/custom-class-name.native.js +9 -1
  185. package/build/hooks/custom-class-name.native.js.map +1 -1
  186. package/build/hooks/dimensions.js +4 -9
  187. package/build/hooks/dimensions.js.map +1 -1
  188. package/build/hooks/font-family.js +7 -3
  189. package/build/hooks/font-family.js.map +1 -1
  190. package/build/hooks/font-size.js +1 -1
  191. package/build/hooks/font-size.js.map +1 -1
  192. package/build/hooks/index.js +4 -3
  193. package/build/hooks/index.js.map +1 -1
  194. package/build/hooks/index.native.js +5 -3
  195. package/build/hooks/index.native.js.map +1 -1
  196. package/build/hooks/layout.js +10 -4
  197. package/build/hooks/layout.js.map +1 -1
  198. package/build/hooks/style.js +1 -1
  199. package/build/hooks/style.js.map +1 -1
  200. package/build/hooks/typography.js +4 -9
  201. package/build/hooks/typography.js.map +1 -1
  202. package/build/hooks/typography.native.js +43 -18
  203. package/build/hooks/typography.native.js.map +1 -1
  204. package/build/hooks/use-typography-props.js +10 -2
  205. package/build/hooks/use-typography-props.js.map +1 -1
  206. package/build/hooks/utils.js +44 -4
  207. package/build/hooks/utils.js.map +1 -1
  208. package/build/private-apis.js +2 -4
  209. package/build/private-apis.js.map +1 -1
  210. package/build/private-apis.native.js +0 -2
  211. package/build/private-apis.native.js.map +1 -1
  212. package/build/store/actions.js +0 -16
  213. package/build/store/actions.js.map +1 -1
  214. package/build/store/private-actions.js +51 -5
  215. package/build/store/private-actions.js.map +1 -1
  216. package/build/store/private-selectors.js +12 -0
  217. package/build/store/private-selectors.js.map +1 -1
  218. package/build/store/reducer.js +14 -6
  219. package/build/store/reducer.js.map +1 -1
  220. package/build/store/selectors.js +1 -13
  221. package/build/store/selectors.js.map +1 -1
  222. package/build/store/undo-ignore.js +12 -0
  223. package/build/store/undo-ignore.js.map +1 -0
  224. package/build/store/utils.js +1 -1
  225. package/build/store/utils.js.map +1 -1
  226. package/build/utils/get-px-from-css-unit.js +16 -0
  227. package/build/utils/get-px-from-css-unit.js.map +1 -0
  228. package/build/utils/index.js +2 -2
  229. package/build/utils/index.js.map +1 -1
  230. package/build/utils/object.js +0 -38
  231. package/build/utils/object.js.map +1 -1
  232. package/build/utils/use-can-block-toolbar-be-focused.js +46 -0
  233. package/build/utils/use-can-block-toolbar-be-focused.js.map +1 -0
  234. package/build-module/components/block-canvas/index.js +0 -2
  235. package/build-module/components/block-canvas/index.js.map +1 -1
  236. package/build-module/components/block-card/index.js +1 -1
  237. package/build-module/components/block-card/index.js.map +1 -1
  238. package/build-module/components/block-draggable/draggable-chip.js +6 -1
  239. package/build-module/components/block-draggable/draggable-chip.js.map +1 -1
  240. package/build-module/components/block-draggable/index.js +76 -6
  241. package/build-module/components/block-draggable/index.js.map +1 -1
  242. package/build-module/components/block-draggable/index.native.js +1 -7
  243. package/build-module/components/block-draggable/index.native.js.map +1 -1
  244. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  245. package/build-module/components/block-draggable/use-scroll-when-dragging.native.js.map +1 -1
  246. package/build-module/components/block-editing-mode/index.js +3 -4
  247. package/build-module/components/block-editing-mode/index.js.map +1 -1
  248. package/build-module/components/block-inspector/index.js +1 -1
  249. package/build-module/components/block-inspector/index.js.map +1 -1
  250. package/build-module/components/block-list/block-list-item-cell.native.js +1 -0
  251. package/build-module/components/block-list/block-list-item-cell.native.js.map +1 -1
  252. package/build-module/components/block-list/block.js +249 -106
  253. package/build-module/components/block-list/block.js.map +1 -1
  254. package/build-module/components/block-list/block.native.js +48 -22
  255. package/build-module/components/block-list/block.native.js.map +1 -1
  256. package/build-module/components/block-list/index.native.js +3 -5
  257. package/build-module/components/block-list/index.native.js.map +1 -1
  258. package/build-module/components/block-list/private-block-context.js +6 -0
  259. package/build-module/components/block-list/private-block-context.js.map +1 -0
  260. package/build-module/components/block-list/use-block-props/index.js +34 -97
  261. package/build-module/components/block-list/use-block-props/index.js.map +1 -1
  262. package/build-module/components/block-list/use-in-between-inserter.js +3 -2
  263. package/build-module/components/block-list/use-in-between-inserter.js.map +1 -1
  264. package/build-module/components/block-list/use-scroll-upon-insertion.native.js +33 -0
  265. package/build-module/components/block-list/use-scroll-upon-insertion.native.js.map +1 -0
  266. package/build-module/components/block-lock/toolbar.js +16 -28
  267. package/build-module/components/block-lock/toolbar.js.map +1 -1
  268. package/build-module/components/block-mover/index.js +2 -1
  269. package/build-module/components/block-mover/index.js.map +1 -1
  270. package/build-module/components/block-patterns-list/index.js +5 -5
  271. package/build-module/components/block-patterns-list/index.js.map +1 -1
  272. package/build-module/components/block-switcher/index.js +4 -4
  273. package/build-module/components/block-switcher/index.js.map +1 -1
  274. package/build-module/components/block-toolbar/index.js +1 -2
  275. package/build-module/components/block-toolbar/index.js.map +1 -1
  276. package/build-module/components/block-tools/block-toolbar-popover.js +0 -2
  277. package/build-module/components/block-tools/block-toolbar-popover.js.map +1 -1
  278. package/build-module/components/block-variation-transforms/index.js +30 -3
  279. package/build-module/components/block-variation-transforms/index.js.map +1 -1
  280. package/build-module/components/border-radius-control/linked-button.js +1 -1
  281. package/build-module/components/border-radius-control/linked-button.js.map +1 -1
  282. package/build-module/components/colors/utils.js +9 -1
  283. package/build-module/components/colors/utils.js.map +1 -1
  284. package/build-module/components/colors/with-colors.js +5 -1
  285. package/build-module/components/colors/with-colors.js.map +1 -1
  286. package/build-module/components/font-sizes/utils.js +9 -1
  287. package/build-module/components/font-sizes/utils.js.map +1 -1
  288. package/build-module/components/global-styles/border-panel.js +3 -2
  289. package/build-module/components/global-styles/border-panel.js.map +1 -1
  290. package/build-module/components/global-styles/color-panel.js +3 -2
  291. package/build-module/components/global-styles/color-panel.js.map +1 -1
  292. package/build-module/components/global-styles/dimensions-panel.js +5 -4
  293. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  294. package/build-module/components/global-styles/effects-panel.js +3 -2
  295. package/build-module/components/global-styles/effects-panel.js.map +1 -1
  296. package/build-module/components/global-styles/filters-panel.js +2 -5
  297. package/build-module/components/global-styles/filters-panel.js.map +1 -1
  298. package/build-module/components/global-styles/get-global-styles-changes.js +184 -0
  299. package/build-module/components/global-styles/get-global-styles-changes.js.map +1 -0
  300. package/build-module/components/global-styles/hooks.js +1 -1
  301. package/build-module/components/global-styles/hooks.js.map +1 -1
  302. package/build-module/components/global-styles/image-settings-panel.js +7 -1
  303. package/build-module/components/global-styles/image-settings-panel.js.map +1 -1
  304. package/build-module/components/global-styles/index.js +1 -0
  305. package/build-module/components/global-styles/index.js.map +1 -1
  306. package/build-module/components/global-styles/typography-panel.js +3 -2
  307. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  308. package/build-module/components/global-styles/use-global-styles-output.js +15 -1
  309. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  310. package/build-module/components/global-styles/utils.js +7 -0
  311. package/build-module/components/global-styles/utils.js.map +1 -1
  312. package/build-module/components/height-control/index.js +6 -2
  313. package/build-module/components/height-control/index.js.map +1 -1
  314. package/build-module/components/image-size-control/index.js +2 -2
  315. package/build-module/components/image-size-control/index.js.map +1 -1
  316. package/build-module/components/index.native.js +2 -1
  317. package/build-module/components/index.native.js.map +1 -1
  318. package/build-module/components/inner-blocks/index.js +62 -23
  319. package/build-module/components/inner-blocks/index.js.map +1 -1
  320. package/build-module/components/inner-blocks/index.native.js +18 -4
  321. package/build-module/components/inner-blocks/index.native.js.map +1 -1
  322. package/build-module/components/inner-blocks/use-inner-block-template-sync.js +5 -6
  323. package/build-module/components/inner-blocks/use-inner-block-template-sync.js.map +1 -1
  324. package/build-module/components/inner-blocks/use-nested-settings-update.js +6 -10
  325. package/build-module/components/inner-blocks/use-nested-settings-update.js.map +1 -1
  326. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  327. package/build-module/components/inserter/block-patterns-explorer/pattern-list.js.map +1 -1
  328. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js +11 -10
  329. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.js.map +1 -1
  330. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js +11 -11
  331. package/build-module/components/inserter/block-patterns-tab/patterns-filter.js.map +1 -1
  332. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js +11 -11
  333. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.js.map +1 -1
  334. package/build-module/components/inserter/block-patterns-tab/utils.js +7 -11
  335. package/build-module/components/inserter/block-patterns-tab/utils.js.map +1 -1
  336. package/build-module/components/inserter/hooks/use-block-types-state.js +4 -14
  337. package/build-module/components/inserter/hooks/use-block-types-state.js.map +1 -1
  338. package/build-module/components/inserter/hooks/use-patterns-state.js +2 -2
  339. package/build-module/components/inserter/hooks/use-patterns-state.js.map +1 -1
  340. package/build-module/components/inserter/index.js +1 -2
  341. package/build-module/components/inserter/index.js.map +1 -1
  342. package/build-module/components/inserter/library.js +3 -7
  343. package/build-module/components/inserter/library.js.map +1 -1
  344. package/build-module/components/inserter/menu.js +14 -28
  345. package/build-module/components/inserter/menu.js.map +1 -1
  346. package/build-module/components/inserter/tabs.js +22 -22
  347. package/build-module/components/inserter/tabs.js.map +1 -1
  348. package/build-module/components/inserter-draggable-blocks/index.js +2 -2
  349. package/build-module/components/inserter-draggable-blocks/index.js.map +1 -1
  350. package/build-module/components/inserter-list-item/index.js +2 -4
  351. package/build-module/components/inserter-list-item/index.js.map +1 -1
  352. package/build-module/components/inspector-controls/block-support-tools-panel.js +3 -1
  353. package/build-module/components/inspector-controls/block-support-tools-panel.js.map +1 -1
  354. package/build-module/components/inspector-controls-tabs/index.js +35 -24
  355. package/build-module/components/inspector-controls-tabs/index.js.map +1 -1
  356. package/build-module/components/list-view/block-select-button.js +4 -0
  357. package/build-module/components/list-view/block-select-button.js.map +1 -1
  358. package/build-module/components/list-view/block.js +58 -4
  359. package/build-module/components/list-view/block.js.map +1 -1
  360. package/build-module/components/media-upload-progress/constants.js +7 -0
  361. package/build-module/components/media-upload-progress/constants.js.map +1 -0
  362. package/build-module/components/media-upload-progress/index.native.js +37 -8
  363. package/build-module/components/media-upload-progress/index.native.js.map +1 -1
  364. package/build-module/components/navigable-toolbar/index.js +9 -14
  365. package/build-module/components/navigable-toolbar/index.js.map +1 -1
  366. package/build-module/components/plain-text/index.native.js +6 -1
  367. package/build-module/components/plain-text/index.native.js.map +1 -1
  368. package/build-module/components/provider/index.js +3 -1
  369. package/build-module/components/provider/index.js.map +1 -1
  370. package/build-module/components/provider/use-block-sync.js +7 -1
  371. package/build-module/components/provider/use-block-sync.js.map +1 -1
  372. package/build-module/components/rich-text/index.js +17 -7
  373. package/build-module/components/rich-text/index.js.map +1 -1
  374. package/build-module/components/rich-text/native/index.native.js +16 -23
  375. package/build-module/components/rich-text/native/index.native.js.map +1 -1
  376. package/build-module/components/rich-text/use-input-rules.js +2 -2
  377. package/build-module/components/rich-text/use-input-rules.js.map +1 -1
  378. package/build-module/components/rich-text/use-mark-persistent.js +1 -1
  379. package/build-module/components/rich-text/use-mark-persistent.js.map +1 -1
  380. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  381. package/build-module/components/spacing-sizes-control/input-controls/spacing-input-control.js.map +1 -1
  382. package/build-module/components/url-input/index.js +9 -6
  383. package/build-module/components/url-input/index.js.map +1 -1
  384. package/build-module/components/use-block-commands/index.js +14 -18
  385. package/build-module/components/use-block-commands/index.js.map +1 -1
  386. package/build-module/components/use-block-drop-zone/index.js +51 -23
  387. package/build-module/components/use-block-drop-zone/index.js.map +1 -1
  388. package/build-module/components/use-moving-animation/index.js +102 -94
  389. package/build-module/components/use-moving-animation/index.js.map +1 -1
  390. package/build-module/components/use-on-block-drop/index.js +8 -11
  391. package/build-module/components/use-on-block-drop/index.js.map +1 -1
  392. package/build-module/components/writing-flow/index.js +0 -1
  393. package/build-module/components/writing-flow/index.js.map +1 -1
  394. package/build-module/components/writing-flow/use-drag-selection.js +15 -4
  395. package/build-module/components/writing-flow/use-drag-selection.js.map +1 -1
  396. package/build-module/components/writing-flow/use-selection-observer.js +73 -27
  397. package/build-module/components/writing-flow/use-selection-observer.js.map +1 -1
  398. package/build-module/components/writing-flow/use-tab-nav.js +7 -4
  399. package/build-module/components/writing-flow/use-tab-nav.js.map +1 -1
  400. package/build-module/hooks/align.js +1 -1
  401. package/build-module/hooks/align.js.map +1 -1
  402. package/build-module/hooks/anchor.js +1 -1
  403. package/build-module/hooks/anchor.js.map +1 -1
  404. package/build-module/hooks/aria-label.js +7 -1
  405. package/build-module/hooks/aria-label.js.map +1 -1
  406. package/build-module/hooks/background.js +181 -19
  407. package/build-module/hooks/background.js.map +1 -1
  408. package/build-module/hooks/border.js +2 -8
  409. package/build-module/hooks/border.js.map +1 -1
  410. package/build-module/hooks/color.js +11 -9
  411. package/build-module/hooks/color.js.map +1 -1
  412. package/build-module/hooks/custom-class-name.js +1 -1
  413. package/build-module/hooks/custom-class-name.js.map +1 -1
  414. package/build-module/hooks/custom-class-name.native.js +7 -1
  415. package/build-module/hooks/custom-class-name.native.js.map +1 -1
  416. package/build-module/hooks/dimensions.js +1 -7
  417. package/build-module/hooks/dimensions.js.map +1 -1
  418. package/build-module/hooks/font-family.js +6 -2
  419. package/build-module/hooks/font-family.js.map +1 -1
  420. package/build-module/hooks/font-size.js +1 -1
  421. package/build-module/hooks/font-size.js.map +1 -1
  422. package/build-module/hooks/index.js +5 -4
  423. package/build-module/hooks/index.js.map +1 -1
  424. package/build-module/hooks/index.native.js +6 -4
  425. package/build-module/hooks/index.native.js.map +1 -1
  426. package/build-module/hooks/layout.js +9 -3
  427. package/build-module/hooks/layout.js.map +1 -1
  428. package/build-module/hooks/style.js +1 -1
  429. package/build-module/hooks/style.js.map +1 -1
  430. package/build-module/hooks/typography.js +1 -7
  431. package/build-module/hooks/typography.js.map +1 -1
  432. package/build-module/hooks/typography.native.js +43 -17
  433. package/build-module/hooks/typography.native.js.map +1 -1
  434. package/build-module/hooks/use-typography-props.js +9 -1
  435. package/build-module/hooks/use-typography-props.js.map +1 -1
  436. package/build-module/hooks/utils.js +43 -4
  437. package/build-module/hooks/utils.js.map +1 -1
  438. package/build-module/private-apis.js +2 -4
  439. package/build-module/private-apis.js.map +1 -1
  440. package/build-module/private-apis.native.js +0 -2
  441. package/build-module/private-apis.native.js.map +1 -1
  442. package/build-module/store/actions.js +0 -15
  443. package/build-module/store/actions.js.map +1 -1
  444. package/build-module/store/private-actions.js +49 -4
  445. package/build-module/store/private-actions.js.map +1 -1
  446. package/build-module/store/private-selectors.js +11 -0
  447. package/build-module/store/private-selectors.js.map +1 -1
  448. package/build-module/store/reducer.js +14 -6
  449. package/build-module/store/reducer.js.map +1 -1
  450. package/build-module/store/selectors.js +1 -12
  451. package/build-module/store/selectors.js.map +1 -1
  452. package/build-module/store/undo-ignore.js +5 -0
  453. package/build-module/store/undo-ignore.js.map +1 -0
  454. package/build-module/store/utils.js +2 -2
  455. package/build-module/store/utils.js.map +1 -1
  456. package/build-module/utils/get-px-from-css-unit.js +9 -0
  457. package/build-module/utils/get-px-from-css-unit.js.map +1 -0
  458. package/build-module/utils/index.js +1 -1
  459. package/build-module/utils/index.js.map +1 -1
  460. package/build-module/utils/object.js +0 -37
  461. package/build-module/utils/object.js.map +1 -1
  462. package/build-module/utils/use-can-block-toolbar-be-focused.js +40 -0
  463. package/build-module/utils/use-can-block-toolbar-be-focused.js.map +1 -0
  464. package/build-style/content-rtl.css +7 -6
  465. package/build-style/content.css +7 -6
  466. package/build-style/style-rtl.css +51 -8
  467. package/build-style/style.css +51 -8
  468. package/package.json +31 -31
  469. package/src/components/alignment-control/README.md +0 -5
  470. package/src/components/block-alignment-control/README.md +0 -5
  471. package/src/components/block-alignment-matrix-control/README.md +0 -10
  472. package/src/components/block-breadcrumb/README.md +0 -5
  473. package/src/components/block-canvas/index.js +0 -2
  474. package/src/components/block-canvas/style.scss +6 -0
  475. package/src/components/block-caption/README.md +0 -5
  476. package/src/components/block-card/README.md +0 -5
  477. package/src/components/block-card/index.js +1 -1
  478. package/src/components/block-draggable/draggable-chip.js +11 -1
  479. package/src/components/block-draggable/index.js +116 -4
  480. package/src/components/block-draggable/index.native.js +0 -5
  481. package/src/components/block-draggable/style.scss +35 -0
  482. package/src/components/block-draggable/test/helpers.native.js +8 -7
  483. package/src/components/block-draggable/use-scroll-when-dragging.native.js +1 -1
  484. package/src/components/block-editing-mode/index.js +3 -3
  485. package/src/components/block-icon/README.md +0 -5
  486. package/src/components/block-inspector/README.md +0 -5
  487. package/src/components/block-inspector/index.js +3 -1
  488. package/src/components/block-list/block-list-item-cell.native.js +5 -1
  489. package/src/components/block-list/block.js +290 -119
  490. package/src/components/block-list/block.native.js +55 -21
  491. package/src/components/block-list/content.scss +14 -10
  492. package/src/components/block-list/index.native.js +3 -5
  493. package/src/components/block-list/{block-list-block-context.js → private-block-context.js} +1 -1
  494. package/src/components/block-list/use-block-props/index.js +32 -128
  495. package/src/components/block-list/use-in-between-inserter.js +4 -1
  496. package/src/components/block-list/use-scroll-upon-insertion.native.js +52 -0
  497. package/src/components/block-lock/toolbar.js +15 -34
  498. package/src/components/block-mover/README.md +0 -5
  499. package/src/components/block-mover/index.js +1 -1
  500. package/src/components/block-parent-selector/README.md +0 -5
  501. package/src/components/block-patterns-list/README.md +0 -5
  502. package/src/components/block-patterns-list/index.js +8 -5
  503. package/src/components/block-switcher/index.js +49 -59
  504. package/src/components/block-toolbar/README.md +0 -5
  505. package/src/components/block-toolbar/index.js +1 -2
  506. package/src/components/block-tools/block-toolbar-popover.js +4 -10
  507. package/src/components/block-types-list/README.md +0 -5
  508. package/src/components/block-variation-picker/README.md +0 -5
  509. package/src/components/block-variation-transforms/README.md +0 -5
  510. package/src/components/block-variation-transforms/index.js +49 -3
  511. package/src/components/border-radius-control/linked-button.js +1 -1
  512. package/src/components/caption/README.md +0 -5
  513. package/src/components/color-palette/test/__snapshots__/control.js.snap +0 -1
  514. package/src/components/colors/utils.js +8 -1
  515. package/src/components/colors/with-colors.js +3 -1
  516. package/src/components/contrast-checker/README.md +0 -4
  517. package/src/components/copy-handler/README.md +0 -10
  518. package/src/components/font-sizes/utils.js +7 -1
  519. package/src/components/global-styles/border-panel.js +2 -1
  520. package/src/components/global-styles/color-panel.js +2 -1
  521. package/src/components/global-styles/dimensions-panel.js +4 -3
  522. package/src/components/global-styles/effects-panel.js +2 -1
  523. package/src/components/global-styles/filters-panel.js +2 -5
  524. package/src/components/global-styles/get-global-styles-changes.js +210 -0
  525. package/src/components/global-styles/hooks.js +3 -0
  526. package/src/components/global-styles/image-settings-panel.js +6 -0
  527. package/src/components/global-styles/index.js +1 -0
  528. package/src/components/global-styles/test/get-global-styles-changes.js +234 -0
  529. package/src/components/global-styles/typography-panel.js +2 -1
  530. package/src/components/global-styles/use-global-styles-output.js +9 -5
  531. package/src/components/global-styles/utils.js +7 -0
  532. package/src/components/height-control/README.md +2 -7
  533. package/src/components/height-control/index.js +4 -0
  534. package/src/components/image-size-control/index.js +5 -2
  535. package/src/components/index.native.js +2 -2
  536. package/src/components/inner-blocks/index.js +68 -29
  537. package/src/components/inner-blocks/index.native.js +19 -7
  538. package/src/components/inner-blocks/use-inner-block-template-sync.js +5 -7
  539. package/src/components/inner-blocks/use-nested-settings-update.js +6 -13
  540. package/src/components/inserter/block-patterns-explorer/pattern-list.js +2 -2
  541. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +15 -15
  542. package/src/components/inserter/block-patterns-tab/patterns-filter.js +15 -13
  543. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +15 -18
  544. package/src/components/inserter/block-patterns-tab/utils.js +11 -12
  545. package/src/components/inserter/hooks/use-block-types-state.js +9 -11
  546. package/src/components/inserter/hooks/use-patterns-state.js +2 -2
  547. package/src/components/inserter/index.js +0 -1
  548. package/src/components/inserter/library.js +2 -8
  549. package/src/components/inserter/menu.js +13 -31
  550. package/src/components/inserter/style.scss +6 -4
  551. package/src/components/inserter/tabs.js +34 -25
  552. package/src/components/inserter-draggable-blocks/index.js +2 -2
  553. package/src/components/inserter-list-item/index.js +6 -6
  554. package/src/components/inspector-controls/block-support-tools-panel.js +2 -0
  555. package/src/components/inspector-controls-tabs/index.js +39 -28
  556. package/src/components/inspector-controls-tabs/style.scss +3 -2
  557. package/src/components/letter-spacing-control/README.md +0 -5
  558. package/src/components/line-height-control/README.md +0 -5
  559. package/src/components/list-view/README.md +0 -5
  560. package/src/components/list-view/block-select-button.js +4 -0
  561. package/src/components/list-view/block.js +73 -2
  562. package/src/components/list-view/style.scss +6 -0
  563. package/src/components/media-upload-progress/constants.js +6 -0
  564. package/src/components/media-upload-progress/index.native.js +66 -14
  565. package/src/components/media-upload-progress/test/index.native.js +2 -2
  566. package/src/components/multi-selection-inspector/README.md +0 -5
  567. package/src/components/navigable-toolbar/index.js +13 -11
  568. package/src/components/plain-text/index.native.js +6 -1
  569. package/src/components/provider/index.js +1 -1
  570. package/src/components/provider/test/use-block-sync.js +20 -17
  571. package/src/components/provider/use-block-sync.js +6 -0
  572. package/src/components/rich-text/index.js +18 -6
  573. package/src/components/rich-text/native/index.native.js +16 -24
  574. package/src/components/rich-text/native/test/__snapshots__/index.native.js.snap +3 -3
  575. package/src/components/rich-text/native/test/index.native.js +72 -5
  576. package/src/components/rich-text/use-input-rules.js +2 -2
  577. package/src/components/rich-text/use-mark-persistent.js +1 -2
  578. package/src/components/spacing-sizes-control/input-controls/spacing-input-control.js +1 -1
  579. package/src/components/text-decoration-control/README.md +40 -0
  580. package/src/components/text-transform-control/README.md +0 -4
  581. package/src/components/ungroup-button/README.md +0 -5
  582. package/src/components/unit-control/README.md +0 -4
  583. package/src/components/url-input/index.js +11 -11
  584. package/src/components/use-block-commands/index.js +18 -21
  585. package/src/components/use-block-drop-zone/index.js +85 -34
  586. package/src/components/use-moving-animation/index.js +107 -103
  587. package/src/components/use-on-block-drop/index.js +7 -23
  588. package/src/components/use-on-block-drop/test/index.js +12 -26
  589. package/src/components/use-resize-canvas/README.md +0 -4
  590. package/src/components/use-settings/README.md +0 -4
  591. package/src/components/writing-flow/index.js +0 -1
  592. package/src/components/writing-flow/use-drag-selection.js +18 -4
  593. package/src/components/writing-flow/use-selection-observer.js +99 -37
  594. package/src/components/writing-flow/use-tab-nav.js +7 -7
  595. package/src/hooks/align.js +1 -5
  596. package/src/hooks/anchor.js +1 -5
  597. package/src/hooks/aria-label.js +8 -5
  598. package/src/hooks/background.js +253 -21
  599. package/src/hooks/border.js +2 -13
  600. package/src/hooks/color.js +19 -14
  601. package/src/hooks/custom-class-name.js +1 -5
  602. package/src/hooks/custom-class-name.native.js +8 -5
  603. package/src/hooks/dimensions.js +1 -7
  604. package/src/hooks/font-family.js +4 -7
  605. package/src/hooks/font-size.js +1 -6
  606. package/src/hooks/index.js +19 -3
  607. package/src/hooks/index.native.js +17 -4
  608. package/src/hooks/layout.js +5 -2
  609. package/src/hooks/style.js +1 -6
  610. package/src/hooks/test/anchor.js +4 -9
  611. package/src/hooks/test/custom-class-name.js +3 -8
  612. package/src/hooks/test/style.js +4 -14
  613. package/src/hooks/typography.js +1 -7
  614. package/src/hooks/typography.native.js +31 -33
  615. package/src/hooks/use-typography-props.js +7 -1
  616. package/src/hooks/utils.js +60 -2
  617. package/src/private-apis.js +2 -4
  618. package/src/private-apis.native.js +0 -2
  619. package/src/store/actions.js +0 -15
  620. package/src/store/private-actions.js +44 -4
  621. package/src/store/private-selectors.js +11 -0
  622. package/src/store/reducer.js +16 -5
  623. package/src/store/selectors.js +5 -13
  624. package/src/store/undo-ignore.js +4 -0
  625. package/src/store/utils.js +2 -2
  626. package/src/style.scss +1 -0
  627. package/src/utils/get-px-from-css-unit.js +8 -0
  628. package/src/utils/index.js +1 -1
  629. package/src/utils/object.js +0 -35
  630. package/src/utils/test/object.js +1 -96
  631. package/src/utils/use-can-block-toolbar-be-focused.js +48 -0
  632. package/build/components/block-list/block-list-block-context.js +0 -14
  633. package/build/components/block-list/block-list-block-context.js.map +0 -1
  634. package/build/utils/parse-css-unit-to-px.js +0 -302
  635. package/build/utils/parse-css-unit-to-px.js.map +0 -1
  636. package/build/utils/use-should-contextual-toolbar-show.js +0 -63
  637. package/build/utils/use-should-contextual-toolbar-show.js.map +0 -1
  638. package/build-module/components/block-list/block-list-block-context.js +0 -6
  639. package/build-module/components/block-list/block-list-block-context.js.map +0 -1
  640. package/build-module/utils/parse-css-unit-to-px.js +0 -294
  641. package/build-module/utils/parse-css-unit-to-px.js.map +0 -1
  642. package/build-module/utils/use-should-contextual-toolbar-show.js +0 -57
  643. package/build-module/utils/use-should-contextual-toolbar-show.js.map +0 -1
  644. package/src/utils/parse-css-unit-to-px.js +0 -329
  645. package/src/utils/test/parse-css-unit-to-px.js +0 -172
  646. package/src/utils/use-should-contextual-toolbar-show.js +0 -85
@@ -1 +1 @@
1
- {"version":3,"names":["useMemo","Component","compose","createHigherOrderComponent","getColorClassName","getColorObjectByColorValue","getColorObjectByAttributeValues","getMostReadableColor","useSettings","kebabCase","upperFirst","firstLetter","rest","toUpperCase","join","withCustomColorPalette","colorsArray","WrappedComponent","props","createElement","colors","withEditorColorPalette","userPalette","themePalette","defaultPalette","allColors","createColorHOC","colorTypes","withColorPalette","colorMap","reduce","colorObject","colorType","constructor","setters","createSetters","colorUtils","bind","state","colorValue","Object","keys","settersAccumulator","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","attributes","previousState","entries","newState","colorContext","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, Component } from '@wordpress/element';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByColorValue,\n\tgetColorObjectByAttributeValues,\n\tgetMostReadableColor,\n} from './utils';\nimport { useSettings } from '../use-settings';\nimport { kebabCase } from '../../utils/object';\n\n/**\n * Capitalizes the first letter in a string.\n *\n * @param {string} str The string whose first letter the function will capitalize.\n *\n * @return {string} Capitalized string.\n */\nconst upperFirst = ( [ firstLetter, ...rest ] ) =>\n\tfirstLetter.toUpperCase() + rest.join( '' );\n\n/**\n * Higher order component factory for injecting the `colorsArray` argument as\n * the colors prop in the `withCustomColors` HOC.\n *\n * @param {Array} colorsArray An array of color objects.\n *\n * @return {Function} The higher order component.\n */\nconst withCustomColorPalette = ( colorsArray ) =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) => (\n\t\t\t<WrappedComponent { ...props } colors={ colorsArray } />\n\t\t),\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 [ userPalette, themePalette, defaultPalette ] = useSettings(\n\t\t\t\t'color.palette.custom',\n\t\t\t\t'color.palette.theme',\n\t\t\t\t'color.palette.default'\n\t\t\t);\n\t\t\tconst allColors = useMemo(\n\t\t\t\t() => [\n\t\t\t\t\t...( userPalette || [] ),\n\t\t\t\t\t...( themePalette || [] ),\n\t\t\t\t\t...( defaultPalette || [] ),\n\t\t\t\t],\n\t\t\t\t[ userPalette, themePalette, defaultPalette ]\n\t\t\t);\n\t\t\treturn <WrappedComponent { ...props } colors={ allColors } />;\n\t\t},\n\t\t'withEditorColorPalette'\n\t);\n\n/**\n * Helper function used with `createHigherOrderComponent` to create\n * higher order components for managing color logic.\n *\n * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).\n * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.\n *\n * @return {Component} The component that can be used as a HOC.\n */\nfunction createColorHOC( colorTypes, withColorPalette ) {\n\tconst colorMap = colorTypes.reduce( ( colorObject, colorType ) => {\n\t\treturn {\n\t\t\t...colorObject,\n\t\t\t...( typeof colorType === 'string'\n\t\t\t\t? { [ colorType ]: kebabCase( colorType ) }\n\t\t\t\t: colorType ),\n\t\t};\n\t}, {} );\n\n\treturn compose( [\n\t\twithColorPalette,\n\t\t( WrappedComponent ) => {\n\t\t\treturn class extends Component {\n\t\t\t\tconstructor( props ) {\n\t\t\t\t\tsuper( props );\n\n\t\t\t\t\tthis.setters = this.createSetters();\n\t\t\t\t\tthis.colorUtils = {\n\t\t\t\t\t\tgetMostReadableColor:\n\t\t\t\t\t\t\tthis.getMostReadableColor.bind( this ),\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.state = {};\n\t\t\t\t}\n\n\t\t\t\tgetMostReadableColor( colorValue ) {\n\t\t\t\t\tconst { colors } = this.props;\n\t\t\t\t\treturn getMostReadableColor( colors, colorValue );\n\t\t\t\t}\n\n\t\t\t\tcreateSetters() {\n\t\t\t\t\treturn Object.keys( colorMap ).reduce(\n\t\t\t\t\t\t( settersAccumulator, colorAttributeName ) => {\n\t\t\t\t\t\t\tconst upperFirstColorAttributeName =\n\t\t\t\t\t\t\t\tupperFirst( colorAttributeName );\n\t\t\t\t\t\t\tconst customColorAttributeName = `custom${ upperFirstColorAttributeName }`;\n\t\t\t\t\t\t\tsettersAccumulator[\n\t\t\t\t\t\t\t\t`set${ upperFirstColorAttributeName }`\n\t\t\t\t\t\t\t] = this.createSetColor(\n\t\t\t\t\t\t\t\tcolorAttributeName,\n\t\t\t\t\t\t\t\tcustomColorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn settersAccumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcreateSetColor( colorAttributeName, customColorAttributeName ) {\n\t\t\t\t\treturn ( colorValue ) => {\n\t\t\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\t\t\tthis.props.colors,\n\t\t\t\t\t\t\tcolorValue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.props.setAttributes( {\n\t\t\t\t\t\t\t[ colorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? colorObject.slug\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t[ customColorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: colorValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tstatic getDerivedStateFromProps(\n\t\t\t\t\t{ attributes, colors },\n\t\t\t\t\tpreviousState\n\t\t\t\t) {\n\t\t\t\t\treturn Object.entries( colorMap ).reduce(\n\t\t\t\t\t\t( newState, [ colorAttributeName, colorContext ] ) => {\n\t\t\t\t\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\t\tattributes[ colorAttributeName ],\n\t\t\t\t\t\t\t\tattributes[\n\t\t\t\t\t\t\t\t\t`custom${ upperFirst(\n\t\t\t\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t\t\t\t) }`\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tconst previousColorObject =\n\t\t\t\t\t\t\t\tpreviousState[ colorAttributeName ];\n\t\t\t\t\t\t\tconst previousColor = previousColorObject?.color;\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The \"and previousColorObject\" condition checks that a previous color object was already computed.\n\t\t\t\t\t\t\t * At the start previousColorObject and colorValue are both equal to undefined\n\t\t\t\t\t\t\t * bus as previousColorObject does not exist we should compute the object.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tpreviousColor === colorObject.color &&\n\t\t\t\t\t\t\t\tpreviousColorObject\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] =\n\t\t\t\t\t\t\t\t\tpreviousColorObject;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] = {\n\t\t\t\t\t\t\t\t\t...colorObject,\n\t\t\t\t\t\t\t\t\tclass: getColorClassName(\n\t\t\t\t\t\t\t\t\t\tcolorContext,\n\t\t\t\t\t\t\t\t\t\tcolorObject.slug\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn newState;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\trender() {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<WrappedComponent\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\t...this.props,\n\t\t\t\t\t\t\t\tcolors: undefined,\n\t\t\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\t\t\t...this.setters,\n\t\t\t\t\t\t\t\tcolorUtils: this.colorUtils,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t] );\n}\n\n/**\n * A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic\n * for class generation color value, retrieval and color attribute setting.\n *\n * Use this higher-order component to work with a custom set of colors.\n *\n * @example\n *\n * ```jsx\n * const CUSTOM_COLORS = [ { name: 'Red', slug: 'red', color: '#ff0000' }, { name: 'Blue', slug: 'blue', color: '#0000ff' } ];\n * const withCustomColors = createCustomColorsHOC( CUSTOM_COLORS );\n * // ...\n * export default compose(\n * withCustomColors( 'backgroundColor', 'borderColor' ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {Array} colorsArray The array of color objects (name, slug, color, etc... ).\n *\n * @return {Function} Higher-order component.\n */\nexport function createCustomColorsHOC( colorsArray ) {\n\treturn ( ...colorTypes ) => {\n\t\tconst withColorPalette = withCustomColorPalette( colorsArray );\n\t\treturn createHigherOrderComponent(\n\t\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t\t'withCustomColors'\n\t\t);\n\t};\n}\n\n/**\n * A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting.\n *\n * For use with the default editor/theme color palette.\n *\n * @example\n *\n * ```jsx\n * export default compose(\n * withColors( 'backgroundColor', { textColor: 'color' } ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object,\n * it should contain the color attribute name as key and the color context as value.\n * If the argument is a string the value should be the color attribute name,\n * the color context is computed by applying a kebab case transform to the value.\n * Color context represents the context/place where the color is going to be used.\n * The class name of the color is generated using 'has' followed by the color name\n * and ending with the color context all in kebab case e.g: has-green-background-color.\n *\n * @return {Function} Higher-order component.\n */\nexport default function withColors( ...colorTypes ) {\n\tconst withColorPalette = withEditorColorPalette();\n\treturn createHigherOrderComponent(\n\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t'withColors'\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,SAAS,QAAQ,oBAAoB;AACvD,SAASC,OAAO,EAAEC,0BAA0B,QAAQ,oBAAoB;;AAExE;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,oBAAoB,QACd,SAAS;AAChB,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAGA,CAAE,CAAEC,WAAW,EAAE,GAAGC,IAAI,CAAE,KAC5CD,WAAW,CAACE,WAAW,CAAC,CAAC,GAAGD,IAAI,CAACE,IAAI,CAAE,EAAG,CAAC;;AAE5C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,sBAAsB,GAAKC,WAAW,IAC3Cb,0BAA0B,CACvBc,gBAAgB,IAAQC,KAAK,IAC9BC,aAAA,CAACF,gBAAgB;EAAA,GAAMC,KAAK;EAAGE,MAAM,EAAGJ;AAAa,CAAE,CACv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BAAsB,CAAEC,WAAY,CAAC;IAC9D,OAAOb,0BAA0B,CAChCuB,cAAc,CAAEC,UAAU,EAAEC,gBAAiB,CAAC,EAC9C,kBACD,CAAC;EACF,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASkC,UAAUA,CAAE,GAAGnC,UAAU,EAAG;EACnD,MAAMC,gBAAgB,GAAGP,sBAAsB,CAAC,CAAC;EACjD,OAAOlB,0BAA0B,CAChCuB,cAAc,CAAEC,UAAU,EAAEC,gBAAiB,CAAC,EAC9C,YACD,CAAC;AACF"}
1
+ {"version":3,"names":["useMemo","Component","compose","createHigherOrderComponent","privateApis","componentsPrivateApis","getColorClassName","getColorObjectByColorValue","getColorObjectByAttributeValues","getMostReadableColor","useSettings","unlock","upperFirst","firstLetter","rest","toUpperCase","join","withCustomColorPalette","colorsArray","WrappedComponent","props","createElement","colors","withEditorColorPalette","userPalette","themePalette","defaultPalette","allColors","createColorHOC","colorTypes","withColorPalette","kebabCase","colorMap","reduce","colorObject","colorType","constructor","setters","createSetters","colorUtils","bind","state","colorValue","Object","keys","settersAccumulator","colorAttributeName","upperFirstColorAttributeName","customColorAttributeName","createSetColor","setAttributes","slug","undefined","getDerivedStateFromProps","attributes","previousState","entries","newState","colorContext","previousColorObject","previousColor","color","class","render","createCustomColorsHOC","withColors"],"sources":["@wordpress/block-editor/src/components/colors/with-colors.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { useMemo, Component } from '@wordpress/element';\nimport { compose, createHigherOrderComponent } from '@wordpress/compose';\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport {\n\tgetColorClassName,\n\tgetColorObjectByColorValue,\n\tgetColorObjectByAttributeValues,\n\tgetMostReadableColor,\n} from './utils';\nimport { useSettings } from '../use-settings';\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Capitalizes the first letter in a string.\n *\n * @param {string} str The string whose first letter the function will capitalize.\n *\n * @return {string} Capitalized string.\n */\nconst upperFirst = ( [ firstLetter, ...rest ] ) =>\n\tfirstLetter.toUpperCase() + rest.join( '' );\n\n/**\n * Higher order component factory for injecting the `colorsArray` argument as\n * the colors prop in the `withCustomColors` HOC.\n *\n * @param {Array} colorsArray An array of color objects.\n *\n * @return {Function} The higher order component.\n */\nconst withCustomColorPalette = ( colorsArray ) =>\n\tcreateHigherOrderComponent(\n\t\t( WrappedComponent ) => ( props ) => (\n\t\t\t<WrappedComponent { ...props } colors={ colorsArray } />\n\t\t),\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 [ userPalette, themePalette, defaultPalette ] = useSettings(\n\t\t\t\t'color.palette.custom',\n\t\t\t\t'color.palette.theme',\n\t\t\t\t'color.palette.default'\n\t\t\t);\n\t\t\tconst allColors = useMemo(\n\t\t\t\t() => [\n\t\t\t\t\t...( userPalette || [] ),\n\t\t\t\t\t...( themePalette || [] ),\n\t\t\t\t\t...( defaultPalette || [] ),\n\t\t\t\t],\n\t\t\t\t[ userPalette, themePalette, defaultPalette ]\n\t\t\t);\n\t\t\treturn <WrappedComponent { ...props } colors={ allColors } />;\n\t\t},\n\t\t'withEditorColorPalette'\n\t);\n\n/**\n * Helper function used with `createHigherOrderComponent` to create\n * higher order components for managing color logic.\n *\n * @param {Array} colorTypes An array of color types (e.g. 'backgroundColor, borderColor).\n * @param {Function} withColorPalette A HOC for injecting the 'colors' prop into the WrappedComponent.\n *\n * @return {Component} The component that can be used as a HOC.\n */\nfunction createColorHOC( colorTypes, withColorPalette ) {\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\tconst colorMap = colorTypes.reduce( ( colorObject, colorType ) => {\n\t\treturn {\n\t\t\t...colorObject,\n\t\t\t...( typeof colorType === 'string'\n\t\t\t\t? { [ colorType ]: kebabCase( colorType ) }\n\t\t\t\t: colorType ),\n\t\t};\n\t}, {} );\n\n\treturn compose( [\n\t\twithColorPalette,\n\t\t( WrappedComponent ) => {\n\t\t\treturn class extends Component {\n\t\t\t\tconstructor( props ) {\n\t\t\t\t\tsuper( props );\n\n\t\t\t\t\tthis.setters = this.createSetters();\n\t\t\t\t\tthis.colorUtils = {\n\t\t\t\t\t\tgetMostReadableColor:\n\t\t\t\t\t\t\tthis.getMostReadableColor.bind( this ),\n\t\t\t\t\t};\n\n\t\t\t\t\tthis.state = {};\n\t\t\t\t}\n\n\t\t\t\tgetMostReadableColor( colorValue ) {\n\t\t\t\t\tconst { colors } = this.props;\n\t\t\t\t\treturn getMostReadableColor( colors, colorValue );\n\t\t\t\t}\n\n\t\t\t\tcreateSetters() {\n\t\t\t\t\treturn Object.keys( colorMap ).reduce(\n\t\t\t\t\t\t( settersAccumulator, colorAttributeName ) => {\n\t\t\t\t\t\t\tconst upperFirstColorAttributeName =\n\t\t\t\t\t\t\t\tupperFirst( colorAttributeName );\n\t\t\t\t\t\t\tconst customColorAttributeName = `custom${ upperFirstColorAttributeName }`;\n\t\t\t\t\t\t\tsettersAccumulator[\n\t\t\t\t\t\t\t\t`set${ upperFirstColorAttributeName }`\n\t\t\t\t\t\t\t] = this.createSetColor(\n\t\t\t\t\t\t\t\tcolorAttributeName,\n\t\t\t\t\t\t\t\tcustomColorAttributeName\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\treturn settersAccumulator;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\tcreateSetColor( colorAttributeName, customColorAttributeName ) {\n\t\t\t\t\treturn ( colorValue ) => {\n\t\t\t\t\t\tconst colorObject = getColorObjectByColorValue(\n\t\t\t\t\t\t\tthis.props.colors,\n\t\t\t\t\t\t\tcolorValue\n\t\t\t\t\t\t);\n\t\t\t\t\t\tthis.props.setAttributes( {\n\t\t\t\t\t\t\t[ colorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? colorObject.slug\n\t\t\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\t\t[ customColorAttributeName ]:\n\t\t\t\t\t\t\t\tcolorObject && colorObject.slug\n\t\t\t\t\t\t\t\t\t? undefined\n\t\t\t\t\t\t\t\t\t: colorValue,\n\t\t\t\t\t\t} );\n\t\t\t\t\t};\n\t\t\t\t}\n\n\t\t\t\tstatic getDerivedStateFromProps(\n\t\t\t\t\t{ attributes, colors },\n\t\t\t\t\tpreviousState\n\t\t\t\t) {\n\t\t\t\t\treturn Object.entries( colorMap ).reduce(\n\t\t\t\t\t\t( newState, [ colorAttributeName, colorContext ] ) => {\n\t\t\t\t\t\t\tconst colorObject = getColorObjectByAttributeValues(\n\t\t\t\t\t\t\t\tcolors,\n\t\t\t\t\t\t\t\tattributes[ colorAttributeName ],\n\t\t\t\t\t\t\t\tattributes[\n\t\t\t\t\t\t\t\t\t`custom${ upperFirst(\n\t\t\t\t\t\t\t\t\t\tcolorAttributeName\n\t\t\t\t\t\t\t\t\t) }`\n\t\t\t\t\t\t\t\t]\n\t\t\t\t\t\t\t);\n\n\t\t\t\t\t\t\tconst previousColorObject =\n\t\t\t\t\t\t\t\tpreviousState[ colorAttributeName ];\n\t\t\t\t\t\t\tconst previousColor = previousColorObject?.color;\n\t\t\t\t\t\t\t/**\n\t\t\t\t\t\t\t * The \"and previousColorObject\" condition checks that a previous color object was already computed.\n\t\t\t\t\t\t\t * At the start previousColorObject and colorValue are both equal to undefined\n\t\t\t\t\t\t\t * bus as previousColorObject does not exist we should compute the object.\n\t\t\t\t\t\t\t */\n\t\t\t\t\t\t\tif (\n\t\t\t\t\t\t\t\tpreviousColor === colorObject.color &&\n\t\t\t\t\t\t\t\tpreviousColorObject\n\t\t\t\t\t\t\t) {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] =\n\t\t\t\t\t\t\t\t\tpreviousColorObject;\n\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\tnewState[ colorAttributeName ] = {\n\t\t\t\t\t\t\t\t\t...colorObject,\n\t\t\t\t\t\t\t\t\tclass: getColorClassName(\n\t\t\t\t\t\t\t\t\t\tcolorContext,\n\t\t\t\t\t\t\t\t\t\tcolorObject.slug\n\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t\t};\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\treturn newState;\n\t\t\t\t\t\t},\n\t\t\t\t\t\t{}\n\t\t\t\t\t);\n\t\t\t\t}\n\n\t\t\t\trender() {\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<WrappedComponent\n\t\t\t\t\t\t\t{ ...{\n\t\t\t\t\t\t\t\t...this.props,\n\t\t\t\t\t\t\t\tcolors: undefined,\n\t\t\t\t\t\t\t\t...this.state,\n\t\t\t\t\t\t\t\t...this.setters,\n\t\t\t\t\t\t\t\tcolorUtils: this.colorUtils,\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t);\n\t\t\t\t}\n\t\t\t};\n\t\t},\n\t] );\n}\n\n/**\n * A higher-order component factory for creating a 'withCustomColors' HOC, which handles color logic\n * for class generation color value, retrieval and color attribute setting.\n *\n * Use this higher-order component to work with a custom set of colors.\n *\n * @example\n *\n * ```jsx\n * const CUSTOM_COLORS = [ { name: 'Red', slug: 'red', color: '#ff0000' }, { name: 'Blue', slug: 'blue', color: '#0000ff' } ];\n * const withCustomColors = createCustomColorsHOC( CUSTOM_COLORS );\n * // ...\n * export default compose(\n * withCustomColors( 'backgroundColor', 'borderColor' ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {Array} colorsArray The array of color objects (name, slug, color, etc... ).\n *\n * @return {Function} Higher-order component.\n */\nexport function createCustomColorsHOC( colorsArray ) {\n\treturn ( ...colorTypes ) => {\n\t\tconst withColorPalette = withCustomColorPalette( colorsArray );\n\t\treturn createHigherOrderComponent(\n\t\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t\t'withCustomColors'\n\t\t);\n\t};\n}\n\n/**\n * A higher-order component, which handles color logic for class generation color value, retrieval and color attribute setting.\n *\n * For use with the default editor/theme color palette.\n *\n * @example\n *\n * ```jsx\n * export default compose(\n * withColors( 'backgroundColor', { textColor: 'color' } ),\n * MyColorfulComponent,\n * );\n * ```\n *\n * @param {...(Object|string)} colorTypes The arguments can be strings or objects. If the argument is an object,\n * it should contain the color attribute name as key and the color context as value.\n * If the argument is a string the value should be the color attribute name,\n * the color context is computed by applying a kebab case transform to the value.\n * Color context represents the context/place where the color is going to be used.\n * The class name of the color is generated using 'has' followed by the color name\n * and ending with the color context all in kebab case e.g: has-green-background-color.\n *\n * @return {Function} Higher-order component.\n */\nexport default function withColors( ...colorTypes ) {\n\tconst withColorPalette = withEditorColorPalette();\n\treturn createHigherOrderComponent(\n\t\tcreateColorHOC( colorTypes, withColorPalette ),\n\t\t'withColors'\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SAASA,OAAO,EAAEC,SAAS,QAAQ,oBAAoB;AACvD,SAASC,OAAO,EAAEC,0BAA0B,QAAQ,oBAAoB;AACxE,SAASC,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SACCC,iBAAiB,EACjBC,0BAA0B,EAC1BC,+BAA+B,EAC/BC,oBAAoB,QACd,SAAS;AAChB,SAASC,WAAW,QAAQ,iBAAiB;AAC7C,SAASC,MAAM,QAAQ,mBAAmB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA,MAAMC,UAAU,GAAGA,CAAE,CAAEC,WAAW,EAAE,GAAGC,IAAI,CAAE,KAC5CD,WAAW,CAACE,WAAW,CAAC,CAAC,GAAGD,IAAI,CAACE,IAAI,CAAE,EAAG,CAAC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E5B,CAAC;MAEJ;IACD,CAAC;EACF,CAAC,CACA,CAAC;AACJ;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASyB,qBAAqBA,CAAE9C,WAAW,EAAG;EACpD,OAAO,CAAE,GAAGW,UAAU,KAAM;IAC3B,MAAMC,gBAAgB,GAAGb,sBAAsB,CAAEC,WAAY,CAAC;IAC9D,OAAOf,0BAA0B,CAChCyB,cAAc,CAAEC,UAAU,EAAEC,gBAAiB,CAAC,EAC9C,kBACD,CAAC;EACF,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,eAAe,SAASmC,UAAUA,CAAE,GAAGpC,UAAU,EAAG;EACnD,MAAMC,gBAAgB,GAAGP,sBAAsB,CAAC,CAAC;EACjD,OAAOpB,0BAA0B,CAChCyB,cAAc,CAAEC,UAAU,EAAEC,gBAAiB,CAAC,EAC9C,YACD,CAAC;AACF"}
@@ -1,7 +1,12 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { privateApis as componentsPrivateApis } from '@wordpress/components';
5
+
1
6
  /**
2
7
  * Internal dependencies
3
8
  */
4
- import { kebabCase } from '../../utils/object';
9
+ import { unlock } from '../../lock-unlock';
5
10
 
6
11
  /**
7
12
  * Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values.
@@ -60,6 +65,9 @@ export function getFontSizeClass(fontSizeSlug) {
60
65
  if (!fontSizeSlug) {
61
66
  return;
62
67
  }
68
+ const {
69
+ kebabCase
70
+ } = unlock(componentsPrivateApis);
63
71
  return `has-${kebabCase(fontSizeSlug)}-font-size`;
64
72
  }
65
73
  //# sourceMappingURL=utils.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["kebabCase","getFontSize","fontSizes","fontSizeAttribute","customFontSizeAttribute","fontSizeObject","find","slug","size","getFontSizeObjectByValue","value","getFontSizeClass","fontSizeSlug"],"sources":["@wordpress/block-editor/src/components/font-sizes/utils.js"],"sourcesContent":["/**\n * Internal dependencies\n */\nimport { kebabCase } from '../../utils/object';\n\n/**\n * Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values.\n * \tIf namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned.\n *\n * @param {Array} fontSizes Array of font size objects containing at least the \"name\" and \"size\" values as properties.\n * @param {?string} fontSizeAttribute Content of the font size attribute (slug).\n * @param {?number} customFontSizeAttribute Contents of the custom font size attribute (value).\n *\n * @return {?Object} If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug.\n * \t\t\t\t\t Otherwise, an object with just the size value based on customFontSize is returned.\n */\nexport const getFontSize = (\n\tfontSizes,\n\tfontSizeAttribute,\n\tcustomFontSizeAttribute\n) => {\n\tif ( fontSizeAttribute ) {\n\t\tconst fontSizeObject = fontSizes?.find(\n\t\t\t( { slug } ) => slug === fontSizeAttribute\n\t\t);\n\t\tif ( fontSizeObject ) {\n\t\t\treturn fontSizeObject;\n\t\t}\n\t}\n\treturn {\n\t\tsize: customFontSizeAttribute,\n\t};\n};\n\n/**\n * Returns the corresponding font size object for a given value.\n *\n * @param {Array} fontSizes Array of font size objects.\n * @param {number} value Font size value.\n *\n * @return {Object} Font size object.\n */\nexport function getFontSizeObjectByValue( fontSizes, value ) {\n\tconst fontSizeObject = fontSizes?.find( ( { size } ) => size === value );\n\tif ( fontSizeObject ) {\n\t\treturn fontSizeObject;\n\t}\n\n\treturn {\n\t\tsize: value,\n\t};\n}\n\n/**\n * Returns a class based on fontSizeName.\n *\n * @param {string} fontSizeSlug Slug of the fontSize.\n *\n * @return {string | undefined} String with the class corresponding to the fontSize passed.\n * The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'.\n */\nexport function getFontSizeClass( fontSizeSlug ) {\n\tif ( ! fontSizeSlug ) {\n\t\treturn;\n\t}\n\n\treturn `has-${ kebabCase( fontSizeSlug ) }-font-size`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,SAAS,QAAQ,oBAAoB;;AAE9C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGA,CAC1BC,SAAS,EACTC,iBAAiB,EACjBC,uBAAuB,KACnB;EACJ,IAAKD,iBAAiB,EAAG;IACxB,MAAME,cAAc,GAAGH,SAAS,EAAEI,IAAI,CACrC,CAAE;MAAEC;IAAK,CAAC,KAAMA,IAAI,KAAKJ,iBAC1B,CAAC;IACD,IAAKE,cAAc,EAAG;MACrB,OAAOA,cAAc;IACtB;EACD;EACA,OAAO;IACNG,IAAI,EAAEJ;EACP,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,wBAAwBA,CAAEP,SAAS,EAAEQ,KAAK,EAAG;EAC5D,MAAML,cAAc,GAAGH,SAAS,EAAEI,IAAI,CAAE,CAAE;IAAEE;EAAK,CAAC,KAAMA,IAAI,KAAKE,KAAM,CAAC;EACxE,IAAKL,cAAc,EAAG;IACrB,OAAOA,cAAc;EACtB;EAEA,OAAO;IACNG,IAAI,EAAEE;EACP,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,YAAY,EAAG;EAChD,IAAK,CAAEA,YAAY,EAAG;IACrB;EACD;EAEA,OAAQ,OAAOZ,SAAS,CAAEY,YAAa,CAAG,YAAW;AACtD"}
1
+ {"version":3,"names":["privateApis","componentsPrivateApis","unlock","getFontSize","fontSizes","fontSizeAttribute","customFontSizeAttribute","fontSizeObject","find","slug","size","getFontSizeObjectByValue","value","getFontSizeClass","fontSizeSlug","kebabCase"],"sources":["@wordpress/block-editor/src/components/font-sizes/utils.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport { privateApis as componentsPrivateApis } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport { unlock } from '../../lock-unlock';\n\n/**\n * Returns the font size object based on an array of named font sizes and the namedFontSize and customFontSize values.\n * \tIf namedFontSize is undefined or not found in fontSizes an object with just the size value based on customFontSize is returned.\n *\n * @param {Array} fontSizes Array of font size objects containing at least the \"name\" and \"size\" values as properties.\n * @param {?string} fontSizeAttribute Content of the font size attribute (slug).\n * @param {?number} customFontSizeAttribute Contents of the custom font size attribute (value).\n *\n * @return {?Object} If fontSizeAttribute is set and an equal slug is found in fontSizes it returns the font size object for that slug.\n * \t\t\t\t\t Otherwise, an object with just the size value based on customFontSize is returned.\n */\nexport const getFontSize = (\n\tfontSizes,\n\tfontSizeAttribute,\n\tcustomFontSizeAttribute\n) => {\n\tif ( fontSizeAttribute ) {\n\t\tconst fontSizeObject = fontSizes?.find(\n\t\t\t( { slug } ) => slug === fontSizeAttribute\n\t\t);\n\t\tif ( fontSizeObject ) {\n\t\t\treturn fontSizeObject;\n\t\t}\n\t}\n\treturn {\n\t\tsize: customFontSizeAttribute,\n\t};\n};\n\n/**\n * Returns the corresponding font size object for a given value.\n *\n * @param {Array} fontSizes Array of font size objects.\n * @param {number} value Font size value.\n *\n * @return {Object} Font size object.\n */\nexport function getFontSizeObjectByValue( fontSizes, value ) {\n\tconst fontSizeObject = fontSizes?.find( ( { size } ) => size === value );\n\tif ( fontSizeObject ) {\n\t\treturn fontSizeObject;\n\t}\n\n\treturn {\n\t\tsize: value,\n\t};\n}\n\n/**\n * Returns a class based on fontSizeName.\n *\n * @param {string} fontSizeSlug Slug of the fontSize.\n *\n * @return {string | undefined} String with the class corresponding to the fontSize passed.\n * The class is generated by appending 'has-' followed by fontSizeSlug in kebabCase and ending with '-font-size'.\n */\nexport function getFontSizeClass( fontSizeSlug ) {\n\tif ( ! fontSizeSlug ) {\n\t\treturn;\n\t}\n\n\tconst { kebabCase } = unlock( componentsPrivateApis );\n\treturn `has-${ kebabCase( fontSizeSlug ) }-font-size`;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,WAAW,IAAIC,qBAAqB,QAAQ,uBAAuB;;AAE5E;AACA;AACA;AACA,SAASC,MAAM,QAAQ,mBAAmB;;AAE1C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,WAAW,GAAGA,CAC1BC,SAAS,EACTC,iBAAiB,EACjBC,uBAAuB,KACnB;EACJ,IAAKD,iBAAiB,EAAG;IACxB,MAAME,cAAc,GAAGH,SAAS,EAAEI,IAAI,CACrC,CAAE;MAAEC;IAAK,CAAC,KAAMA,IAAI,KAAKJ,iBAC1B,CAAC;IACD,IAAKE,cAAc,EAAG;MACrB,OAAOA,cAAc;IACtB;EACD;EACA,OAAO;IACNG,IAAI,EAAEJ;EACP,CAAC;AACF,CAAC;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASK,wBAAwBA,CAAEP,SAAS,EAAEQ,KAAK,EAAG;EAC5D,MAAML,cAAc,GAAGH,SAAS,EAAEI,IAAI,CAAE,CAAE;IAAEE;EAAK,CAAC,KAAMA,IAAI,KAAKE,KAAM,CAAC;EACxE,IAAKL,cAAc,EAAG;IACrB,OAAOA,cAAc;EACtB;EAEA,OAAO;IACNG,IAAI,EAAEE;EACP,CAAC;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,gBAAgBA,CAAEC,YAAY,EAAG;EAChD,IAAK,CAAEA,YAAY,EAAG;IACrB;EACD;EAEA,MAAM;IAAEC;EAAU,CAAC,GAAGb,MAAM,CAAED,qBAAsB,CAAC;EACrD,OAAQ,OAAOc,SAAS,CAAED,YAAa,CAAG,YAAW;AACtD"}
@@ -11,7 +11,7 @@ import { __ } from '@wordpress/i18n';
11
11
  */
12
12
  import BorderRadiusControl from '../border-radius-control';
13
13
  import { useColorsPerOrigin } from './hooks';
14
- import { getValueFromVariable } from './utils';
14
+ import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
15
15
  export function useHasBorderPanel(settings) {
16
16
  const controls = [useHasBorderColorControl(settings), useHasBorderRadiusControl(settings), useHasBorderStyleControl(settings), useHasBorderWidthControl(settings)];
17
17
  return controls.some(Boolean);
@@ -42,7 +42,8 @@ function BorderToolsPanel({
42
42
  return createElement(ToolsPanel, {
43
43
  label: __('Border'),
44
44
  resetAll: resetAll,
45
- panelId: panelId
45
+ panelId: panelId,
46
+ dropdownMenuProps: TOOLSPANEL_DROPDOWNMENU_PROPS
46
47
  }, children);
47
48
  }
48
49
  const DEFAULT_CONTROLS = {
@@ -1 +1 @@
1
- {"version":3,"names":["__experimentalBorderBoxControl","BorderBoxControl","__experimentalHasSplitBorders","hasSplitBorders","__experimentalIsDefinedBorder","isDefinedBorder","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","useCallback","useMemo","__","BorderRadiusControl","useColorsPerOrigin","getValueFromVariable","useHasBorderPanel","settings","controls","useHasBorderColorControl","useHasBorderRadiusControl","useHasBorderStyleControl","useHasBorderWidthControl","some","Boolean","border","color","radius","style","width","BorderToolsPanel","resetAllFilter","onChange","value","panelId","children","resetAll","updatedValue","createElement","label","DEFAULT_CONTROLS","BorderPanel","as","Wrapper","inheritedValue","defaultControls","colors","decodeValue","rawValue","encodeColorValue","colorValue","allColors","flatMap","originColors","colorObject","find","slug","decodeColorValue","borderValue","forEach","side","undefined","setBorder","newBorder","showBorderColor","showBorderStyle","showBorderWidth","showBorderRadius","borderRadiusValues","setBorderRadius","newBorderRadius","hasBorderRadius","borderValues","Object","entries","resetBorder","onBorderChange","updatedBorder","previousValue","showBorderByDefault","hasValue","onDeselect","isShownByDefault","enableAlpha","enableStyle","popoverOffset","popoverPlacement","__experimentalIsRenderedInSidebar","size","values","newValue"],"sources":["@wordpress/block-editor/src/components/global-styles/border-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalBorderBoxControl as BorderBoxControl,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n\t__experimentalIsDefinedBorder as isDefinedBorder,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BorderRadiusControl from '../border-radius-control';\nimport { useColorsPerOrigin } from './hooks';\nimport { getValueFromVariable } from './utils';\n\nexport function useHasBorderPanel( settings ) {\n\tconst controls = [\n\t\tuseHasBorderColorControl( settings ),\n\t\tuseHasBorderRadiusControl( settings ),\n\t\tuseHasBorderStyleControl( settings ),\n\t\tuseHasBorderWidthControl( settings ),\n\t];\n\n\treturn controls.some( Boolean );\n}\n\nfunction useHasBorderColorControl( settings ) {\n\treturn settings?.border?.color;\n}\n\nfunction useHasBorderRadiusControl( settings ) {\n\treturn settings?.border?.radius;\n}\n\nfunction useHasBorderStyleControl( settings ) {\n\treturn settings?.border?.style;\n}\n\nfunction useHasBorderWidthControl( settings ) {\n\treturn settings?.border?.width;\n}\n\nfunction BorderToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Border' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\tradius: true,\n\tcolor: true,\n\twidth: true,\n};\n\nexport default function BorderPanel( {\n\tas: Wrapper = BorderToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n} ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst decodeValue = ( rawValue ) =>\n\t\tgetValueFromVariable( { settings }, '', rawValue );\n\tconst encodeColorValue = ( colorValue ) => {\n\t\tconst allColors = colors.flatMap(\n\t\t\t( { colors: originColors } ) => originColors\n\t\t);\n\t\tconst colorObject = allColors.find(\n\t\t\t( { color } ) => color === colorValue\n\t\t);\n\t\treturn colorObject\n\t\t\t? 'var:preset|color|' + colorObject.slug\n\t\t\t: colorValue;\n\t};\n\tconst decodeColorValue = useCallback(\n\t\t( colorValue ) => {\n\t\t\tconst allColors = colors.flatMap(\n\t\t\t\t( { colors: originColors } ) => originColors\n\t\t\t);\n\t\t\tconst colorObject = allColors.find(\n\t\t\t\t( { slug } ) => colorValue === 'var:preset|color|' + slug\n\t\t\t);\n\t\t\treturn colorObject ? colorObject.color : colorValue;\n\t\t},\n\t\t[ colors ]\n\t);\n\tconst border = useMemo( () => {\n\t\tif ( hasSplitBorders( inheritedValue?.border ) ) {\n\t\t\tconst borderValue = { ...inheritedValue?.border };\n\t\t\t[ 'top', 'right', 'bottom', 'left' ].forEach( ( side ) => {\n\t\t\t\tborderValue[ side ] = {\n\t\t\t\t\t...borderValue[ side ],\n\t\t\t\t\tcolor: decodeColorValue( borderValue[ side ]?.color ),\n\t\t\t\t};\n\t\t\t} );\n\t\t\treturn borderValue;\n\t\t}\n\t\treturn {\n\t\t\t...inheritedValue?.border,\n\t\t\tcolor: inheritedValue?.border?.color\n\t\t\t\t? decodeColorValue( inheritedValue?.border?.color )\n\t\t\t\t: undefined,\n\t\t};\n\t}, [ inheritedValue?.border, decodeColorValue ] );\n\tconst setBorder = ( newBorder ) =>\n\t\tonChange( { ...value, border: newBorder } );\n\tconst showBorderColor = useHasBorderColorControl( settings );\n\tconst showBorderStyle = useHasBorderStyleControl( settings );\n\tconst showBorderWidth = useHasBorderWidthControl( settings );\n\n\t// Border radius.\n\tconst showBorderRadius = useHasBorderRadiusControl( settings );\n\tconst borderRadiusValues = decodeValue( border?.radius );\n\tconst setBorderRadius = ( newBorderRadius ) =>\n\t\tsetBorder( { ...border, radius: newBorderRadius } );\n\tconst hasBorderRadius = () => {\n\t\tconst borderValues = value?.border?.radius;\n\t\tif ( typeof borderValues === 'object' ) {\n\t\t\treturn Object.entries( borderValues ).some( Boolean );\n\t\t}\n\t\treturn !! borderValues;\n\t};\n\n\tconst resetBorder = () => {\n\t\tif ( hasBorderRadius() ) {\n\t\t\treturn setBorder( { radius: value?.border?.radius } );\n\t\t}\n\n\t\tsetBorder( undefined );\n\t};\n\n\tconst onBorderChange = ( newBorder ) => {\n\t\t// Ensure we have a visible border style when a border width or\n\t\t// color is being selected.\n\t\tconst updatedBorder = { ...newBorder };\n\n\t\tif ( hasSplitBorders( updatedBorder ) ) {\n\t\t\t[ 'top', 'right', 'bottom', 'left' ].forEach( ( side ) => {\n\t\t\t\tif ( updatedBorder[ side ] ) {\n\t\t\t\t\tupdatedBorder[ side ] = {\n\t\t\t\t\t\t...updatedBorder[ side ],\n\t\t\t\t\t\tcolor: encodeColorValue( updatedBorder[ side ]?.color ),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t} else if ( updatedBorder ) {\n\t\t\tupdatedBorder.color = encodeColorValue( updatedBorder.color );\n\t\t}\n\n\t\t// As radius is maintained separately to color, style, and width\n\t\t// maintain its value. Undefined values here will be cleaned when\n\t\t// global styles are saved.\n\t\tsetBorder( { radius: border?.radius, ...updatedBorder } );\n\t};\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tborder: undefined,\n\t\t};\n\t}, [] );\n\n\tconst showBorderByDefault =\n\t\tdefaultControls?.color || defaultControls?.width;\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ ( showBorderWidth || showBorderColor ) && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => isDefinedBorder( value?.border ) }\n\t\t\t\t\tlabel={ __( 'Border' ) }\n\t\t\t\t\tonDeselect={ () => resetBorder() }\n\t\t\t\t\tisShownByDefault={ showBorderByDefault }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<BorderBoxControl\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tenableAlpha={ true }\n\t\t\t\t\t\tenableStyle={ showBorderStyle }\n\t\t\t\t\t\tonChange={ onBorderChange }\n\t\t\t\t\t\tpopoverOffset={ 40 }\n\t\t\t\t\t\tpopoverPlacement=\"left-start\"\n\t\t\t\t\t\tvalue={ border }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={ true }\n\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showBorderRadius && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasBorderRadius }\n\t\t\t\t\tlabel={ __( 'Radius' ) }\n\t\t\t\t\tonDeselect={ () => setBorderRadius( undefined ) }\n\t\t\t\t\tisShownByDefault={ defaultControls.radius }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<BorderRadiusControl\n\t\t\t\t\t\tvalues={ borderRadiusValues }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tsetBorderRadius( newValue || undefined );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,8BAA8B,IAAIC,gBAAgB,EAClDC,6BAA6B,IAAIC,eAAe,EAChDC,6BAA6B,IAAIC,eAAe,EAChDC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAAS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O,EAAGA;EAAS,GAEnBI,aAAA,CAACzB,mBAAmB;IACnB4E,MAAM,EAAGrB,kBAAoB;IAC7BpC,QAAQ,EAAK0D,QAAQ,IAAM;MAC1BrB,eAAe,CAAEqB,QAAQ,IAAI7B,SAAU,CAAC;IACzC;EAAG,CACH,CACc,CAET,CAAC;AAEZ"}
1
+ {"version":3,"names":["__experimentalBorderBoxControl","BorderBoxControl","__experimentalHasSplitBorders","hasSplitBorders","__experimentalIsDefinedBorder","isDefinedBorder","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","useCallback","useMemo","__","BorderRadiusControl","useColorsPerOrigin","getValueFromVariable","TOOLSPANEL_DROPDOWNMENU_PROPS","useHasBorderPanel","settings","controls","useHasBorderColorControl","useHasBorderRadiusControl","useHasBorderStyleControl","useHasBorderWidthControl","some","Boolean","border","color","radius","style","width","BorderToolsPanel","resetAllFilter","onChange","value","panelId","children","resetAll","updatedValue","createElement","label","dropdownMenuProps","DEFAULT_CONTROLS","BorderPanel","as","Wrapper","inheritedValue","defaultControls","colors","decodeValue","rawValue","encodeColorValue","colorValue","allColors","flatMap","originColors","colorObject","find","slug","decodeColorValue","borderValue","forEach","side","undefined","setBorder","newBorder","showBorderColor","showBorderStyle","showBorderWidth","showBorderRadius","borderRadiusValues","setBorderRadius","newBorderRadius","hasBorderRadius","borderValues","Object","entries","resetBorder","onBorderChange","updatedBorder","previousValue","showBorderByDefault","hasValue","onDeselect","isShownByDefault","enableAlpha","enableStyle","popoverOffset","popoverPlacement","__experimentalIsRenderedInSidebar","size","values","newValue"],"sources":["@wordpress/block-editor/src/components/global-styles/border-panel.js"],"sourcesContent":["/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalBorderBoxControl as BorderBoxControl,\n\t__experimentalHasSplitBorders as hasSplitBorders,\n\t__experimentalIsDefinedBorder as isDefinedBorder,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n} from '@wordpress/components';\nimport { useCallback, useMemo } from '@wordpress/element';\nimport { __ } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport BorderRadiusControl from '../border-radius-control';\nimport { useColorsPerOrigin } from './hooks';\nimport { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';\n\nexport function useHasBorderPanel( settings ) {\n\tconst controls = [\n\t\tuseHasBorderColorControl( settings ),\n\t\tuseHasBorderRadiusControl( settings ),\n\t\tuseHasBorderStyleControl( settings ),\n\t\tuseHasBorderWidthControl( settings ),\n\t];\n\n\treturn controls.some( Boolean );\n}\n\nfunction useHasBorderColorControl( settings ) {\n\treturn settings?.border?.color;\n}\n\nfunction useHasBorderRadiusControl( settings ) {\n\treturn settings?.border?.radius;\n}\n\nfunction useHasBorderStyleControl( settings ) {\n\treturn settings?.border?.style;\n}\n\nfunction useHasBorderWidthControl( settings ) {\n\treturn settings?.border?.width;\n}\n\nfunction BorderToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Border' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\tdropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\tradius: true,\n\tcolor: true,\n\twidth: true,\n};\n\nexport default function BorderPanel( {\n\tas: Wrapper = BorderToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n} ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst decodeValue = ( rawValue ) =>\n\t\tgetValueFromVariable( { settings }, '', rawValue );\n\tconst encodeColorValue = ( colorValue ) => {\n\t\tconst allColors = colors.flatMap(\n\t\t\t( { colors: originColors } ) => originColors\n\t\t);\n\t\tconst colorObject = allColors.find(\n\t\t\t( { color } ) => color === colorValue\n\t\t);\n\t\treturn colorObject\n\t\t\t? 'var:preset|color|' + colorObject.slug\n\t\t\t: colorValue;\n\t};\n\tconst decodeColorValue = useCallback(\n\t\t( colorValue ) => {\n\t\t\tconst allColors = colors.flatMap(\n\t\t\t\t( { colors: originColors } ) => originColors\n\t\t\t);\n\t\t\tconst colorObject = allColors.find(\n\t\t\t\t( { slug } ) => colorValue === 'var:preset|color|' + slug\n\t\t\t);\n\t\t\treturn colorObject ? colorObject.color : colorValue;\n\t\t},\n\t\t[ colors ]\n\t);\n\tconst border = useMemo( () => {\n\t\tif ( hasSplitBorders( inheritedValue?.border ) ) {\n\t\t\tconst borderValue = { ...inheritedValue?.border };\n\t\t\t[ 'top', 'right', 'bottom', 'left' ].forEach( ( side ) => {\n\t\t\t\tborderValue[ side ] = {\n\t\t\t\t\t...borderValue[ side ],\n\t\t\t\t\tcolor: decodeColorValue( borderValue[ side ]?.color ),\n\t\t\t\t};\n\t\t\t} );\n\t\t\treturn borderValue;\n\t\t}\n\t\treturn {\n\t\t\t...inheritedValue?.border,\n\t\t\tcolor: inheritedValue?.border?.color\n\t\t\t\t? decodeColorValue( inheritedValue?.border?.color )\n\t\t\t\t: undefined,\n\t\t};\n\t}, [ inheritedValue?.border, decodeColorValue ] );\n\tconst setBorder = ( newBorder ) =>\n\t\tonChange( { ...value, border: newBorder } );\n\tconst showBorderColor = useHasBorderColorControl( settings );\n\tconst showBorderStyle = useHasBorderStyleControl( settings );\n\tconst showBorderWidth = useHasBorderWidthControl( settings );\n\n\t// Border radius.\n\tconst showBorderRadius = useHasBorderRadiusControl( settings );\n\tconst borderRadiusValues = decodeValue( border?.radius );\n\tconst setBorderRadius = ( newBorderRadius ) =>\n\t\tsetBorder( { ...border, radius: newBorderRadius } );\n\tconst hasBorderRadius = () => {\n\t\tconst borderValues = value?.border?.radius;\n\t\tif ( typeof borderValues === 'object' ) {\n\t\t\treturn Object.entries( borderValues ).some( Boolean );\n\t\t}\n\t\treturn !! borderValues;\n\t};\n\n\tconst resetBorder = () => {\n\t\tif ( hasBorderRadius() ) {\n\t\t\treturn setBorder( { radius: value?.border?.radius } );\n\t\t}\n\n\t\tsetBorder( undefined );\n\t};\n\n\tconst onBorderChange = ( newBorder ) => {\n\t\t// Ensure we have a visible border style when a border width or\n\t\t// color is being selected.\n\t\tconst updatedBorder = { ...newBorder };\n\n\t\tif ( hasSplitBorders( updatedBorder ) ) {\n\t\t\t[ 'top', 'right', 'bottom', 'left' ].forEach( ( side ) => {\n\t\t\t\tif ( updatedBorder[ side ] ) {\n\t\t\t\t\tupdatedBorder[ side ] = {\n\t\t\t\t\t\t...updatedBorder[ side ],\n\t\t\t\t\t\tcolor: encodeColorValue( updatedBorder[ side ]?.color ),\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t} );\n\t\t} else if ( updatedBorder ) {\n\t\t\tupdatedBorder.color = encodeColorValue( updatedBorder.color );\n\t\t}\n\n\t\t// As radius is maintained separately to color, style, and width\n\t\t// maintain its value. Undefined values here will be cleaned when\n\t\t// global styles are saved.\n\t\tsetBorder( { radius: border?.radius, ...updatedBorder } );\n\t};\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tborder: undefined,\n\t\t};\n\t}, [] );\n\n\tconst showBorderByDefault =\n\t\tdefaultControls?.color || defaultControls?.width;\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ ( showBorderWidth || showBorderColor ) && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ () => isDefinedBorder( value?.border ) }\n\t\t\t\t\tlabel={ __( 'Border' ) }\n\t\t\t\t\tonDeselect={ () => resetBorder() }\n\t\t\t\t\tisShownByDefault={ showBorderByDefault }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<BorderBoxControl\n\t\t\t\t\t\tcolors={ colors }\n\t\t\t\t\t\tenableAlpha={ true }\n\t\t\t\t\t\tenableStyle={ showBorderStyle }\n\t\t\t\t\t\tonChange={ onBorderChange }\n\t\t\t\t\t\tpopoverOffset={ 40 }\n\t\t\t\t\t\tpopoverPlacement=\"left-start\"\n\t\t\t\t\t\tvalue={ border }\n\t\t\t\t\t\t__experimentalIsRenderedInSidebar={ true }\n\t\t\t\t\t\tsize={ '__unstable-large' }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ showBorderRadius && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\thasValue={ hasBorderRadius }\n\t\t\t\t\tlabel={ __( 'Radius' ) }\n\t\t\t\t\tonDeselect={ () => setBorderRadius( undefined ) }\n\t\t\t\t\tisShownByDefault={ defaultControls.radius }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<BorderRadiusControl\n\t\t\t\t\t\tvalues={ borderRadiusValues }\n\t\t\t\t\t\tonChange={ ( newValue ) => {\n\t\t\t\t\t\t\tsetBorderRadius( newValue || undefined );\n\t\t\t\t\t\t} }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,SACCA,8BAA8B,IAAIC,gBAAgB,EAClDC,6BAA6B,IAAIC,eAAe,EAChDC,6BAA6B,IAAIC,eAAe,EAChDC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,QACxC,uBAAuB;AAC9B,SAASC,WAAW,EAAEC,OAAO,QAAQ,oBAAoB;AACzD,SAASC,EAAE,QAAQ,iBAAiB;;AAEpC;AACA;AACA;AACA,OAAO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ACnB8E,MAAM,EAAGrB,kBAAoB;IAC7BrC,QAAQ,EAAK2D,QAAQ,IAAM;MAC1BrB,eAAe,CAAEqB,QAAQ,IAAI7B,SAAU,CAAC;IACzC;EAAG,CACH,CACc,CAET,CAAC;AAEZ"}
@@ -16,7 +16,7 @@ import { __, sprintf } from '@wordpress/i18n';
16
16
  */
17
17
  import ColorGradientControl from '../colors-gradients/control';
18
18
  import { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';
19
- import { getValueFromVariable } from './utils';
19
+ import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
20
20
  import { setImmutably } from '../../utils/object';
21
21
  import { unlock } from '../../lock-unlock';
22
22
  export function useHasColorPanel(settings) {
@@ -73,7 +73,8 @@ function ColorToolsPanel({
73
73
  hasInnerWrapper: true,
74
74
  className: "color-block-support-panel",
75
75
  __experimentalFirstVisibleItemClass: "first",
76
- __experimentalLastVisibleItemClass: "last"
76
+ __experimentalLastVisibleItemClass: "last",
77
+ dropdownMenuProps: TOOLSPANEL_DROPDOWNMENU_PROPS
77
78
  }, createElement("div", {
78
79
  className: "color-block-support-panel__inner-wrapper"
79
80
  }, children));
@@ -1 +1 @@
1
- {"version":3,"names":["classnames","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalHStack","HStack","__experimentalZStack","ZStack","__experimentalDropdownContentWrapper","DropdownContentWrapper","ColorIndicator","Flex","FlexItem","Dropdown","Button","privateApis","componentsPrivateApis","useCallback","__","sprintf","ColorGradientControl","useColorsPerOrigin","useGradientsPerOrigin","getValueFromVariable","setImmutably","unlock","useHasColorPanel","settings","hasTextPanel","useHasTextPanel","hasBackgroundPanel","useHasBackgroundPanel","hasLinkPanel","useHasLinkPanel","hasHeadingPanel","useHasHeadingPanel","hasButtonPanel","useHasButtonPanel","hasCaptionPanel","useHasCaptionPanel","colors","color","text","length","custom","link","caption","gradients","heading","customGradient","button","background","ColorToolsPanel","resetAllFilter","onChange","value","panelId","children","resetAll","updatedValue","createElement","label","hasInnerWrapper","className","__experimentalFirstVisibleItemClass","__experimentalLastVisibleItemClass","DEFAULT_CONTROLS","popoverProps","placement","offset","shift","LabeledColorIndicators","indicators","justify","isLayered","map","indicator","index","key","expanded","colorValue","title","ColorPanelTab","isGradient","inheritedValue","userValue","setValue","colorGradientControlSettings","showTitle","enableAlpha","__experimentalIsRenderedInSidebar","undefined","gradientValue","onColorChange","onGradientChange","clearable","headingLevel","ColorPanelDropdown","hasValue","resetValue","isShownByDefault","tabs","currentTab","find","tab","Tabs","onDeselect","renderToggle","onToggle","isOpen","toggleProps","onClick","renderContent","paddingSize","initialTabId","TabList","Tab","tabId","TabPanel","focusable","ColorPanel","as","Wrapper","defaultControls","areCustomSolidsEnabled","areCustomGradientsEnabled","hasSolidColors","hasGradientColors","decodeValue","rawValue","encodeColorValue","allColors","flatMap","originColors","colorObject","slug","encodeGradientValue","allGradients","originGradients","gradientObject","gradient","showBackgroundPanel","backgroundColor","userBackgroundColor","userGradient","hasBackground","setBackgroundColor","newColor","newValue","setGradient","newGradient","resetBackground","showLinkPanel","linkColor","elements","userLinkColor","setLinkColor","hoverLinkColor","userHoverLinkColor","setHoverLinkColor","hasLink","resetLink","showTextPanel","textColor","userTextColor","hasTextColor","setTextColor","changedObject","resetTextColor","name","showPanel","previousValue","reduce","acc","element","items","filter","Boolean","forEach","elementBackgroundColor","elementGradient","elementTextColor","elementBackgroundUserColor","elementGradientUserColor","elementTextUserColor","hasElement","resetElement","setElementTextColor","newTextColor","setElementBackgroundColor","newBackgroundColor","setElementGradient","supportsTextColor","supportsBackground","push","item","disableCustomColors","disableCustomGradients"],"sources":["@wordpress/block-editor/src/components/global-styles/color-panel.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tColorIndicator,\n\tFlex,\n\tFlexItem,\n\tDropdown,\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useCallback } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from '../colors-gradients/control';\nimport { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';\nimport { getValueFromVariable } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport { unlock } from '../../lock-unlock';\n\nexport function useHasColorPanel( settings ) {\n\tconst hasTextPanel = useHasTextPanel( settings );\n\tconst hasBackgroundPanel = useHasBackgroundPanel( settings );\n\tconst hasLinkPanel = useHasLinkPanel( settings );\n\tconst hasHeadingPanel = useHasHeadingPanel( settings );\n\tconst hasButtonPanel = useHasButtonPanel( settings );\n\tconst hasCaptionPanel = useHasCaptionPanel( settings );\n\n\treturn (\n\t\thasTextPanel ||\n\t\thasBackgroundPanel ||\n\t\thasLinkPanel ||\n\t\thasHeadingPanel ||\n\t\thasButtonPanel ||\n\t\thasCaptionPanel\n\t);\n}\n\nexport function useHasTextPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.text &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasLinkPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.link &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasCaptionPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.caption &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasHeadingPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.heading &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nexport function useHasButtonPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.button &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nexport function useHasBackgroundPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.background &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nfunction ColorToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Color' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\thasInnerWrapper\n\t\t\tclassName=\"color-block-support-panel\"\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\t__experimentalLastVisibleItemClass=\"last\"\n\t\t>\n\t\t\t<div className=\"color-block-support-panel__inner-wrapper\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\ttext: true,\n\tbackground: true,\n\tlink: true,\n\theading: true,\n\tbutton: true,\n\tcaption: true,\n};\n\nconst popoverProps = {\n\tplacement: 'left-start',\n\toffset: 36,\n\tshift: true,\n};\n\nconst LabeledColorIndicators = ( { indicators, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t{ indicators.map( ( indicator, index ) => (\n\t\t\t\t<Flex key={ index } expanded={ false }>\n\t\t\t\t\t<ColorIndicator colorValue={ indicator } />\n\t\t\t\t</Flex>\n\t\t\t) ) }\n\t\t</ZStack>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-name\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\nfunction ColorPanelTab( {\n\tisGradient,\n\tinheritedValue,\n\tuserValue,\n\tsetValue,\n\tcolorGradientControlSettings,\n} ) {\n\treturn (\n\t\t<ColorGradientControl\n\t\t\t{ ...colorGradientControlSettings }\n\t\t\tshowTitle={ false }\n\t\t\tenableAlpha\n\t\t\t__experimentalIsRenderedInSidebar\n\t\t\tcolorValue={ isGradient ? undefined : inheritedValue }\n\t\t\tgradientValue={ isGradient ? inheritedValue : undefined }\n\t\t\tonColorChange={ isGradient ? undefined : setValue }\n\t\t\tonGradientChange={ isGradient ? setValue : undefined }\n\t\t\tclearable={ inheritedValue === userValue }\n\t\t\theadingLevel={ 3 }\n\t\t/>\n\t);\n}\n\nfunction ColorPanelDropdown( {\n\tlabel,\n\thasValue,\n\tresetValue,\n\tisShownByDefault,\n\tindicators,\n\ttabs,\n\tcolorGradientControlSettings,\n\tpanelId,\n} ) {\n\tconst currentTab = tabs.find( ( tab ) => tab.userValue !== undefined );\n\t// Unlocking `Tabs` too early causes the `unlock` method to receive an empty\n\t// object, due to circular dependencies.\n\t// See https://github.com/WordPress/gutenberg/issues/52692\n\tconst { Tabs } = unlock( componentsPrivateApis );\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\thasValue={ hasValue }\n\t\t\tlabel={ label }\n\t\t\tonDeselect={ resetValue }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__dropdown\"\n\t\t\t\trenderToggle={ ( { onToggle, isOpen } ) => {\n\t\t\t\t\tconst toggleProps = {\n\t\t\t\t\t\tonClick: onToggle,\n\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t\t\t\t{ 'is-open': isOpen }\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'aria-expanded': isOpen,\n\t\t\t\t\t\t'aria-label': sprintf(\n\t\t\t\t\t\t\t/* translators: %s is the type of color property, e.g., \"background\" */\n\t\t\t\t\t\t\t__( 'Color %s styles' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button { ...toggleProps }>\n\t\t\t\t\t\t\t<LabeledColorIndicators\n\t\t\t\t\t\t\t\tindicators={ indicators }\n\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\trenderContent={ () => (\n\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t<div className=\"block-editor-panel-color-gradient-settings__dropdown-content\">\n\t\t\t\t\t\t\t{ tabs.length === 1 && (\n\t\t\t\t\t\t\t\t<ColorPanelTab\n\t\t\t\t\t\t\t\t\t{ ...tabs[ 0 ] }\n\t\t\t\t\t\t\t\t\tcolorGradientControlSettings={\n\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings\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\t{ tabs.length > 1 && (\n\t\t\t\t\t\t\t\t<Tabs initialTabId={ currentTab?.key }>\n\t\t\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t\ttabId={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ tab.label }\n\t\t\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t\t</Tabs.TabList>\n\n\t\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t\ttabId={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ColorPanelTab\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ ...tab }\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t</Tabs>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n\nexport default function ColorPanel( {\n\tas: Wrapper = ColorToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tchildren,\n} ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\tconst areCustomSolidsEnabled = settings?.color?.custom;\n\tconst areCustomGradientsEnabled = settings?.color?.customGradient;\n\tconst hasSolidColors = colors.length > 0 || areCustomSolidsEnabled;\n\tconst hasGradientColors = gradients.length > 0 || areCustomGradientsEnabled;\n\tconst decodeValue = ( rawValue ) =>\n\t\tgetValueFromVariable( { settings }, '', rawValue );\n\tconst encodeColorValue = ( colorValue ) => {\n\t\tconst allColors = colors.flatMap(\n\t\t\t( { colors: originColors } ) => originColors\n\t\t);\n\t\tconst colorObject = allColors.find(\n\t\t\t( { color } ) => color === colorValue\n\t\t);\n\t\treturn colorObject\n\t\t\t? 'var:preset|color|' + colorObject.slug\n\t\t\t: colorValue;\n\t};\n\tconst encodeGradientValue = ( gradientValue ) => {\n\t\tconst allGradients = gradients.flatMap(\n\t\t\t( { gradients: originGradients } ) => originGradients\n\t\t);\n\t\tconst gradientObject = allGradients.find(\n\t\t\t( { gradient } ) => gradient === gradientValue\n\t\t);\n\t\treturn gradientObject\n\t\t\t? 'var:preset|gradient|' + gradientObject.slug\n\t\t\t: gradientValue;\n\t};\n\n\t// BackgroundColor\n\tconst showBackgroundPanel = useHasBackgroundPanel( settings );\n\tconst backgroundColor = decodeValue( inheritedValue?.color?.background );\n\tconst userBackgroundColor = decodeValue( value?.color?.background );\n\tconst gradient = decodeValue( inheritedValue?.color?.gradient );\n\tconst userGradient = decodeValue( value?.color?.gradient );\n\tconst hasBackground = () => !! userBackgroundColor || !! userGradient;\n\tconst setBackgroundColor = ( newColor ) => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'background' ],\n\t\t\tencodeColorValue( newColor )\n\t\t);\n\t\tnewValue.color.gradient = undefined;\n\t\tonChange( newValue );\n\t};\n\tconst setGradient = ( newGradient ) => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'gradient' ],\n\t\t\tencodeGradientValue( newGradient )\n\t\t);\n\t\tnewValue.color.background = undefined;\n\t\tonChange( newValue );\n\t};\n\tconst resetBackground = () => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'background' ],\n\t\t\tundefined\n\t\t);\n\t\tnewValue.color.gradient = undefined;\n\t\tonChange( newValue );\n\t};\n\n\t// Links\n\tconst showLinkPanel = useHasLinkPanel( settings );\n\tconst linkColor = decodeValue(\n\t\tinheritedValue?.elements?.link?.color?.text\n\t);\n\tconst userLinkColor = decodeValue( value?.elements?.link?.color?.text );\n\tconst setLinkColor = ( newColor ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t)\n\t\t);\n\t};\n\tconst hoverLinkColor = decodeValue(\n\t\tinheritedValue?.elements?.link?.[ ':hover' ]?.color?.text\n\t);\n\tconst userHoverLinkColor = decodeValue(\n\t\tvalue?.elements?.link?.[ ':hover' ]?.color?.text\n\t);\n\tconst setHoverLinkColor = ( newColor ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', 'link', ':hover', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLink = () => !! userLinkColor || !! userHoverLinkColor;\n\tconst resetLink = () => {\n\t\tlet newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'elements', 'link', ':hover', 'color', 'text' ],\n\t\t\tundefined\n\t\t);\n\t\tnewValue = setImmutably(\n\t\t\tnewValue,\n\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\tundefined\n\t\t);\n\t\tonChange( newValue );\n\t};\n\n\t// Text Color\n\tconst showTextPanel = useHasTextPanel( settings );\n\tconst textColor = decodeValue( inheritedValue?.color?.text );\n\tconst userTextColor = decodeValue( value?.color?.text );\n\tconst hasTextColor = () => !! userTextColor;\n\tconst setTextColor = ( newColor ) => {\n\t\tlet changedObject = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'text' ],\n\t\t\tencodeColorValue( newColor )\n\t\t);\n\t\tif ( textColor === linkColor ) {\n\t\t\tchangedObject = setImmutably(\n\t\t\t\tchangedObject,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t);\n\t\t}\n\n\t\tonChange( changedObject );\n\t};\n\tconst resetTextColor = () => setTextColor( undefined );\n\n\t// Elements\n\tconst elements = [\n\t\t{\n\t\t\tname: 'caption',\n\t\t\tlabel: __( 'Captions' ),\n\t\t\tshowPanel: useHasCaptionPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'button',\n\t\t\tlabel: __( 'Button' ),\n\t\t\tshowPanel: useHasButtonPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'heading',\n\t\t\tlabel: __( 'Heading' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h1',\n\t\t\tlabel: __( 'H1' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h2',\n\t\t\tlabel: __( 'H2' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h3',\n\t\t\tlabel: __( 'H3' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h4',\n\t\t\tlabel: __( 'H4' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h5',\n\t\t\tlabel: __( 'H5' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h6',\n\t\t\tlabel: __( 'H6' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t];\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tcolor: undefined,\n\t\t\telements: {\n\t\t\t\t...previousValue?.elements,\n\t\t\t\tlink: {\n\t\t\t\t\t...previousValue?.elements?.link,\n\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t':hover': {\n\t\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...elements.reduce( ( acc, element ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t[ element.name ]: {\n\t\t\t\t\t\t\t...previousValue?.elements?.[ element.name ],\n\t\t\t\t\t\t\tcolor: undefined,\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\tconst items = [\n\t\tshowTextPanel && {\n\t\t\tkey: 'text',\n\t\t\tlabel: __( 'Text' ),\n\t\t\thasValue: hasTextColor,\n\t\t\tresetValue: resetTextColor,\n\t\t\tisShownByDefault: defaultControls.text,\n\t\t\tindicators: [ textColor ],\n\t\t\ttabs: [\n\t\t\t\t{\n\t\t\t\t\tkey: 'text',\n\t\t\t\t\tlabel: __( 'Text' ),\n\t\t\t\t\tinheritedValue: textColor,\n\t\t\t\t\tsetValue: setTextColor,\n\t\t\t\t\tuserValue: userTextColor,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tshowBackgroundPanel && {\n\t\t\tkey: 'background',\n\t\t\tlabel: __( 'Background' ),\n\t\t\thasValue: hasBackground,\n\t\t\tresetValue: resetBackground,\n\t\t\tisShownByDefault: defaultControls.background,\n\t\t\tindicators: [ gradient ?? backgroundColor ],\n\t\t\ttabs: [\n\t\t\t\thasSolidColors && {\n\t\t\t\t\tkey: 'background',\n\t\t\t\t\tlabel: __( 'Solid' ),\n\t\t\t\t\tinheritedValue: backgroundColor,\n\t\t\t\t\tsetValue: setBackgroundColor,\n\t\t\t\t\tuserValue: userBackgroundColor,\n\t\t\t\t},\n\t\t\t\thasGradientColors && {\n\t\t\t\t\tkey: 'gradient',\n\t\t\t\t\tlabel: __( 'Gradient' ),\n\t\t\t\t\tinheritedValue: gradient,\n\t\t\t\t\tsetValue: setGradient,\n\t\t\t\t\tuserValue: userGradient,\n\t\t\t\t\tisGradient: true,\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t},\n\t\tshowLinkPanel && {\n\t\t\tkey: 'link',\n\t\t\tlabel: __( 'Link' ),\n\t\t\thasValue: hasLink,\n\t\t\tresetValue: resetLink,\n\t\t\tisShownByDefault: defaultControls.link,\n\t\t\tindicators: [ linkColor, hoverLinkColor ],\n\t\t\ttabs: [\n\t\t\t\t{\n\t\t\t\t\tkey: 'link',\n\t\t\t\t\tlabel: __( 'Default' ),\n\t\t\t\t\tinheritedValue: linkColor,\n\t\t\t\t\tsetValue: setLinkColor,\n\t\t\t\t\tuserValue: userLinkColor,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tkey: 'hover',\n\t\t\t\t\tlabel: __( 'Hover' ),\n\t\t\t\t\tinheritedValue: hoverLinkColor,\n\t\t\t\t\tsetValue: setHoverLinkColor,\n\t\t\t\t\tuserValue: userHoverLinkColor,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t].filter( Boolean );\n\n\telements.forEach( ( { name, label, showPanel } ) => {\n\t\tif ( ! showPanel ) return;\n\n\t\tconst elementBackgroundColor = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.background\n\t\t);\n\t\tconst elementGradient = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.gradient\n\t\t);\n\t\tconst elementTextColor = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.text\n\t\t);\n\t\tconst elementBackgroundUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.background\n\t\t);\n\t\tconst elementGradientUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.gradient\n\t\t);\n\t\tconst elementTextUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.text\n\t\t);\n\t\tconst hasElement = () =>\n\t\t\t!! (\n\t\t\t\telementTextUserColor ||\n\t\t\t\telementBackgroundUserColor ||\n\t\t\t\telementGradientUserColor\n\t\t\t);\n\t\tconst resetElement = () => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'background' ],\n\t\t\t\tundefined\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.gradient = undefined;\n\t\t\tnewValue.elements[ name ].color.text = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\n\t\tconst setElementTextColor = ( newTextColor ) => {\n\t\t\tonChange(\n\t\t\t\tsetImmutably(\n\t\t\t\t\tvalue,\n\t\t\t\t\t[ 'elements', name, 'color', 'text' ],\n\t\t\t\t\tencodeColorValue( newTextColor )\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tconst setElementBackgroundColor = ( newBackgroundColor ) => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'background' ],\n\t\t\t\tencodeColorValue( newBackgroundColor )\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.gradient = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\t\tconst setElementGradient = ( newGradient ) => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'gradient' ],\n\t\t\t\tencodeGradientValue( newGradient )\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.background = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\t\tconst supportsTextColor = true;\n\t\t// Background color is not supported for `caption`\n\t\t// as there isn't yet a way to set padding for the element.\n\t\tconst supportsBackground = name !== 'caption';\n\n\t\titems.push( {\n\t\t\tkey: name,\n\t\t\tlabel,\n\t\t\thasValue: hasElement,\n\t\t\tresetValue: resetElement,\n\t\t\tisShownByDefault: defaultControls[ name ],\n\t\t\tindicators:\n\t\t\t\tsupportsTextColor && supportsBackground\n\t\t\t\t\t? [\n\t\t\t\t\t\t\telementTextColor,\n\t\t\t\t\t\t\telementGradient ?? elementBackgroundColor,\n\t\t\t\t\t ]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\tsupportsTextColor\n\t\t\t\t\t\t\t\t? elementTextColor\n\t\t\t\t\t\t\t\t: elementGradient ?? elementBackgroundColor,\n\t\t\t\t\t ],\n\t\t\ttabs: [\n\t\t\t\thasSolidColors &&\n\t\t\t\t\tsupportsTextColor && {\n\t\t\t\t\t\tkey: 'text',\n\t\t\t\t\t\tlabel: __( 'Text' ),\n\t\t\t\t\t\tinheritedValue: elementTextColor,\n\t\t\t\t\t\tsetValue: setElementTextColor,\n\t\t\t\t\t\tuserValue: elementTextUserColor,\n\t\t\t\t\t},\n\t\t\t\thasSolidColors &&\n\t\t\t\t\tsupportsBackground && {\n\t\t\t\t\t\tkey: 'background',\n\t\t\t\t\t\tlabel: __( 'Background' ),\n\t\t\t\t\t\tinheritedValue: elementBackgroundColor,\n\t\t\t\t\t\tsetValue: setElementBackgroundColor,\n\t\t\t\t\t\tuserValue: elementBackgroundUserColor,\n\t\t\t\t\t},\n\t\t\t\thasGradientColors &&\n\t\t\t\t\tsupportsBackground && {\n\t\t\t\t\t\tkey: 'gradient',\n\t\t\t\t\t\tlabel: __( 'Gradient' ),\n\t\t\t\t\t\tinheritedValue: elementGradient,\n\t\t\t\t\t\tsetValue: setElementGradient,\n\t\t\t\t\t\tuserValue: elementGradientUserColor,\n\t\t\t\t\t\tisGradient: true,\n\t\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ items.map( ( item ) => (\n\t\t\t\t<ColorPanelDropdown\n\t\t\t\t\tkey={ item.key }\n\t\t\t\t\t{ ...item }\n\t\t\t\t\tcolorGradientControlSettings={ {\n\t\t\t\t\t\tcolors,\n\t\t\t\t\t\tdisableCustomColors: ! areCustomSolidsEnabled,\n\t\t\t\t\t\tgradients,\n\t\t\t\t\t\tdisableCustomGradients: ! areCustomGradientsEnabled,\n\t\t\t\t\t} }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ children }\n\t\t</Wrapper>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;AACA,SACCC,wBAAwB,IAAIC,UAAU,EACtCC,4BAA4B,IAAIC,cAAc,EAC9CC,oBAAoB,IAAIC,MAAM,EAC9BC,oBAAoB,IAAIC,MAAM,EAC9BC,oCAAoC,IAAIC,sBAAsB,EAC9DC,cAAc,EACdC,IAAI,EACJC,QAAQ,EACRC,QAAQ,EACRC,MAAM,EACNC,WAAW,IAAIC,qBAAqB,QAC9B,uBAAuB;AAC9B,SAASC,WAAW,QAAQ,oBAAoB;AAChD,SAASC,EAAE,EAAEC,OAAO,QAAQ,iBAAiB;;AAE7C;AACA;AACA;AACA,OAAOC,oBAAoB,MAAM,6BAA6B;AAC9D,SAASC,kBAAkB,EAAEC,qBAAqB,QAAQ,SAAS;AACnE,SAASC,oBAAoB,QAAQ,SAAS;AAC9C,SAASC,YAAY,QAAQ,oBAAoB;AACjD,SAASC,MAAM,QAAQ,mBAAmB;AAE1C,OAAO,SAASC,gBAAgBA,CAAEC,QAAQ,EAAG;EAC5C,MAAMC,YAAY,GAAGC,eAAe,CAAEF,QAAS,CAAC;EAChD,MAAMG,kBAAkB,GAAGC,qBAAqB,CAAEJ,QAAS,CAAC;EAC5D,MAAMK,YAAY,GAAGC,eAAe,CAAEN,QAAS,CAAC;EAChD,MAAMO,eAAe,GA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MACN4J,mBAAmB,EAAE,CAAExE,sBAAsB;MAC7C7E,SAAS;MACTsJ,sBAAsB,EAAE,CAAExE;IAC3B,CAAG;IACHrE,OAAO,EAAGA;EAAS,CACnB,CACA,CAAC,EACDC,QACM,CAAC;AAEZ"}
1
+ {"version":3,"names":["classnames","__experimentalToolsPanel","ToolsPanel","__experimentalToolsPanelItem","ToolsPanelItem","__experimentalHStack","HStack","__experimentalZStack","ZStack","__experimentalDropdownContentWrapper","DropdownContentWrapper","ColorIndicator","Flex","FlexItem","Dropdown","Button","privateApis","componentsPrivateApis","useCallback","__","sprintf","ColorGradientControl","useColorsPerOrigin","useGradientsPerOrigin","getValueFromVariable","TOOLSPANEL_DROPDOWNMENU_PROPS","setImmutably","unlock","useHasColorPanel","settings","hasTextPanel","useHasTextPanel","hasBackgroundPanel","useHasBackgroundPanel","hasLinkPanel","useHasLinkPanel","hasHeadingPanel","useHasHeadingPanel","hasButtonPanel","useHasButtonPanel","hasCaptionPanel","useHasCaptionPanel","colors","color","text","length","custom","link","caption","gradients","heading","customGradient","button","background","ColorToolsPanel","resetAllFilter","onChange","value","panelId","children","resetAll","updatedValue","createElement","label","hasInnerWrapper","className","__experimentalFirstVisibleItemClass","__experimentalLastVisibleItemClass","dropdownMenuProps","DEFAULT_CONTROLS","popoverProps","placement","offset","shift","LabeledColorIndicators","indicators","justify","isLayered","map","indicator","index","key","expanded","colorValue","title","ColorPanelTab","isGradient","inheritedValue","userValue","setValue","colorGradientControlSettings","showTitle","enableAlpha","__experimentalIsRenderedInSidebar","undefined","gradientValue","onColorChange","onGradientChange","clearable","headingLevel","ColorPanelDropdown","hasValue","resetValue","isShownByDefault","tabs","currentTab","find","tab","Tabs","onDeselect","renderToggle","onToggle","isOpen","toggleProps","onClick","renderContent","paddingSize","initialTabId","TabList","Tab","tabId","TabPanel","focusable","ColorPanel","as","Wrapper","defaultControls","areCustomSolidsEnabled","areCustomGradientsEnabled","hasSolidColors","hasGradientColors","decodeValue","rawValue","encodeColorValue","allColors","flatMap","originColors","colorObject","slug","encodeGradientValue","allGradients","originGradients","gradientObject","gradient","showBackgroundPanel","backgroundColor","userBackgroundColor","userGradient","hasBackground","setBackgroundColor","newColor","newValue","setGradient","newGradient","resetBackground","showLinkPanel","linkColor","elements","userLinkColor","setLinkColor","hoverLinkColor","userHoverLinkColor","setHoverLinkColor","hasLink","resetLink","showTextPanel","textColor","userTextColor","hasTextColor","setTextColor","changedObject","resetTextColor","name","showPanel","previousValue","reduce","acc","element","items","filter","Boolean","forEach","elementBackgroundColor","elementGradient","elementTextColor","elementBackgroundUserColor","elementGradientUserColor","elementTextUserColor","hasElement","resetElement","setElementTextColor","newTextColor","setElementBackgroundColor","newBackgroundColor","setElementGradient","supportsTextColor","supportsBackground","push","item","disableCustomColors","disableCustomGradients"],"sources":["@wordpress/block-editor/src/components/global-styles/color-panel.js"],"sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport {\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\t__experimentalHStack as HStack,\n\t__experimentalZStack as ZStack,\n\t__experimentalDropdownContentWrapper as DropdownContentWrapper,\n\tColorIndicator,\n\tFlex,\n\tFlexItem,\n\tDropdown,\n\tButton,\n\tprivateApis as componentsPrivateApis,\n} from '@wordpress/components';\nimport { useCallback } from '@wordpress/element';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport ColorGradientControl from '../colors-gradients/control';\nimport { useColorsPerOrigin, useGradientsPerOrigin } from './hooks';\nimport { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport { unlock } from '../../lock-unlock';\n\nexport function useHasColorPanel( settings ) {\n\tconst hasTextPanel = useHasTextPanel( settings );\n\tconst hasBackgroundPanel = useHasBackgroundPanel( settings );\n\tconst hasLinkPanel = useHasLinkPanel( settings );\n\tconst hasHeadingPanel = useHasHeadingPanel( settings );\n\tconst hasButtonPanel = useHasButtonPanel( settings );\n\tconst hasCaptionPanel = useHasCaptionPanel( settings );\n\n\treturn (\n\t\thasTextPanel ||\n\t\thasBackgroundPanel ||\n\t\thasLinkPanel ||\n\t\thasHeadingPanel ||\n\t\thasButtonPanel ||\n\t\thasCaptionPanel\n\t);\n}\n\nexport function useHasTextPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.text &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasLinkPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.link &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasCaptionPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.caption &&\n\t\t( colors?.length > 0 || settings?.color?.custom )\n\t);\n}\n\nexport function useHasHeadingPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.heading &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nexport function useHasButtonPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.button &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nexport function useHasBackgroundPanel( settings ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\treturn (\n\t\tsettings?.color?.background &&\n\t\t( colors?.length > 0 ||\n\t\t\tsettings?.color?.custom ||\n\t\t\tgradients?.length > 0 ||\n\t\t\tsettings?.color?.customGradient )\n\t);\n}\n\nfunction ColorToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst resetAll = () => {\n\t\tconst updatedValue = resetAllFilter( value );\n\t\tonChange( updatedValue );\n\t};\n\n\treturn (\n\t\t<ToolsPanel\n\t\t\tlabel={ __( 'Color' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\thasInnerWrapper\n\t\t\tclassName=\"color-block-support-panel\"\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\t__experimentalLastVisibleItemClass=\"last\"\n\t\t\tdropdownMenuProps={ TOOLSPANEL_DROPDOWNMENU_PROPS }\n\t\t>\n\t\t\t<div className=\"color-block-support-panel__inner-wrapper\">\n\t\t\t\t{ children }\n\t\t\t</div>\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\ttext: true,\n\tbackground: true,\n\tlink: true,\n\theading: true,\n\tbutton: true,\n\tcaption: true,\n};\n\nconst popoverProps = {\n\tplacement: 'left-start',\n\toffset: 36,\n\tshift: true,\n};\n\nconst LabeledColorIndicators = ( { indicators, label } ) => (\n\t<HStack justify=\"flex-start\">\n\t\t<ZStack isLayered={ false } offset={ -8 }>\n\t\t\t{ indicators.map( ( indicator, index ) => (\n\t\t\t\t<Flex key={ index } expanded={ false }>\n\t\t\t\t\t<ColorIndicator colorValue={ indicator } />\n\t\t\t\t</Flex>\n\t\t\t) ) }\n\t\t</ZStack>\n\t\t<FlexItem\n\t\t\tclassName=\"block-editor-panel-color-gradient-settings__color-name\"\n\t\t\ttitle={ label }\n\t\t>\n\t\t\t{ label }\n\t\t</FlexItem>\n\t</HStack>\n);\n\nfunction ColorPanelTab( {\n\tisGradient,\n\tinheritedValue,\n\tuserValue,\n\tsetValue,\n\tcolorGradientControlSettings,\n} ) {\n\treturn (\n\t\t<ColorGradientControl\n\t\t\t{ ...colorGradientControlSettings }\n\t\t\tshowTitle={ false }\n\t\t\tenableAlpha\n\t\t\t__experimentalIsRenderedInSidebar\n\t\t\tcolorValue={ isGradient ? undefined : inheritedValue }\n\t\t\tgradientValue={ isGradient ? inheritedValue : undefined }\n\t\t\tonColorChange={ isGradient ? undefined : setValue }\n\t\t\tonGradientChange={ isGradient ? setValue : undefined }\n\t\t\tclearable={ inheritedValue === userValue }\n\t\t\theadingLevel={ 3 }\n\t\t/>\n\t);\n}\n\nfunction ColorPanelDropdown( {\n\tlabel,\n\thasValue,\n\tresetValue,\n\tisShownByDefault,\n\tindicators,\n\ttabs,\n\tcolorGradientControlSettings,\n\tpanelId,\n} ) {\n\tconst currentTab = tabs.find( ( tab ) => tab.userValue !== undefined );\n\t// Unlocking `Tabs` too early causes the `unlock` method to receive an empty\n\t// object, due to circular dependencies.\n\t// See https://github.com/WordPress/gutenberg/issues/52692\n\tconst { Tabs } = unlock( componentsPrivateApis );\n\n\treturn (\n\t\t<ToolsPanelItem\n\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__item\"\n\t\t\thasValue={ hasValue }\n\t\t\tlabel={ label }\n\t\t\tonDeselect={ resetValue }\n\t\t\tisShownByDefault={ isShownByDefault }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t<Dropdown\n\t\t\t\tpopoverProps={ popoverProps }\n\t\t\t\tclassName=\"block-editor-tools-panel-color-gradient-settings__dropdown\"\n\t\t\t\trenderToggle={ ( { onToggle, isOpen } ) => {\n\t\t\t\t\tconst toggleProps = {\n\t\t\t\t\t\tonClick: onToggle,\n\t\t\t\t\t\tclassName: classnames(\n\t\t\t\t\t\t\t'block-editor-panel-color-gradient-settings__dropdown',\n\t\t\t\t\t\t\t{ 'is-open': isOpen }\n\t\t\t\t\t\t),\n\t\t\t\t\t\t'aria-expanded': isOpen,\n\t\t\t\t\t\t'aria-label': sprintf(\n\t\t\t\t\t\t\t/* translators: %s is the type of color property, e.g., \"background\" */\n\t\t\t\t\t\t\t__( 'Color %s styles' ),\n\t\t\t\t\t\t\tlabel\n\t\t\t\t\t\t),\n\t\t\t\t\t};\n\n\t\t\t\t\treturn (\n\t\t\t\t\t\t<Button { ...toggleProps }>\n\t\t\t\t\t\t\t<LabeledColorIndicators\n\t\t\t\t\t\t\t\tindicators={ indicators }\n\t\t\t\t\t\t\t\tlabel={ label }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Button>\n\t\t\t\t\t);\n\t\t\t\t} }\n\t\t\t\trenderContent={ () => (\n\t\t\t\t\t<DropdownContentWrapper paddingSize=\"none\">\n\t\t\t\t\t\t<div className=\"block-editor-panel-color-gradient-settings__dropdown-content\">\n\t\t\t\t\t\t\t{ tabs.length === 1 && (\n\t\t\t\t\t\t\t\t<ColorPanelTab\n\t\t\t\t\t\t\t\t\t{ ...tabs[ 0 ] }\n\t\t\t\t\t\t\t\t\tcolorGradientControlSettings={\n\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings\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\t{ tabs.length > 1 && (\n\t\t\t\t\t\t\t\t<Tabs initialTabId={ currentTab?.key }>\n\t\t\t\t\t\t\t\t\t<Tabs.TabList>\n\t\t\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => (\n\t\t\t\t\t\t\t\t\t\t\t<Tabs.Tab\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t\ttabId={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t{ tab.label }\n\t\t\t\t\t\t\t\t\t\t\t</Tabs.Tab>\n\t\t\t\t\t\t\t\t\t\t) ) }\n\t\t\t\t\t\t\t\t\t</Tabs.TabList>\n\n\t\t\t\t\t\t\t\t\t{ tabs.map( ( tab ) => {\n\t\t\t\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t\t\t\t<Tabs.TabPanel\n\t\t\t\t\t\t\t\t\t\t\t\tkey={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t\ttabId={ tab.key }\n\t\t\t\t\t\t\t\t\t\t\t\tfocusable={ false }\n\t\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t\t<ColorPanelTab\n\t\t\t\t\t\t\t\t\t\t\t\t\t{ ...tab }\n\t\t\t\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings={\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tcolorGradientControlSettings\n\t\t\t\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t\t\t\t\t</Tabs.TabPanel>\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} ) }\n\t\t\t\t\t\t\t\t</Tabs>\n\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</DropdownContentWrapper>\n\t\t\t\t) }\n\t\t\t/>\n\t\t</ToolsPanelItem>\n\t);\n}\n\nexport default function ColorPanel( {\n\tas: Wrapper = ColorToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tchildren,\n} ) {\n\tconst colors = useColorsPerOrigin( settings );\n\tconst gradients = useGradientsPerOrigin( settings );\n\tconst areCustomSolidsEnabled = settings?.color?.custom;\n\tconst areCustomGradientsEnabled = settings?.color?.customGradient;\n\tconst hasSolidColors = colors.length > 0 || areCustomSolidsEnabled;\n\tconst hasGradientColors = gradients.length > 0 || areCustomGradientsEnabled;\n\tconst decodeValue = ( rawValue ) =>\n\t\tgetValueFromVariable( { settings }, '', rawValue );\n\tconst encodeColorValue = ( colorValue ) => {\n\t\tconst allColors = colors.flatMap(\n\t\t\t( { colors: originColors } ) => originColors\n\t\t);\n\t\tconst colorObject = allColors.find(\n\t\t\t( { color } ) => color === colorValue\n\t\t);\n\t\treturn colorObject\n\t\t\t? 'var:preset|color|' + colorObject.slug\n\t\t\t: colorValue;\n\t};\n\tconst encodeGradientValue = ( gradientValue ) => {\n\t\tconst allGradients = gradients.flatMap(\n\t\t\t( { gradients: originGradients } ) => originGradients\n\t\t);\n\t\tconst gradientObject = allGradients.find(\n\t\t\t( { gradient } ) => gradient === gradientValue\n\t\t);\n\t\treturn gradientObject\n\t\t\t? 'var:preset|gradient|' + gradientObject.slug\n\t\t\t: gradientValue;\n\t};\n\n\t// BackgroundColor\n\tconst showBackgroundPanel = useHasBackgroundPanel( settings );\n\tconst backgroundColor = decodeValue( inheritedValue?.color?.background );\n\tconst userBackgroundColor = decodeValue( value?.color?.background );\n\tconst gradient = decodeValue( inheritedValue?.color?.gradient );\n\tconst userGradient = decodeValue( value?.color?.gradient );\n\tconst hasBackground = () => !! userBackgroundColor || !! userGradient;\n\tconst setBackgroundColor = ( newColor ) => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'background' ],\n\t\t\tencodeColorValue( newColor )\n\t\t);\n\t\tnewValue.color.gradient = undefined;\n\t\tonChange( newValue );\n\t};\n\tconst setGradient = ( newGradient ) => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'gradient' ],\n\t\t\tencodeGradientValue( newGradient )\n\t\t);\n\t\tnewValue.color.background = undefined;\n\t\tonChange( newValue );\n\t};\n\tconst resetBackground = () => {\n\t\tconst newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'background' ],\n\t\t\tundefined\n\t\t);\n\t\tnewValue.color.gradient = undefined;\n\t\tonChange( newValue );\n\t};\n\n\t// Links\n\tconst showLinkPanel = useHasLinkPanel( settings );\n\tconst linkColor = decodeValue(\n\t\tinheritedValue?.elements?.link?.color?.text\n\t);\n\tconst userLinkColor = decodeValue( value?.elements?.link?.color?.text );\n\tconst setLinkColor = ( newColor ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t)\n\t\t);\n\t};\n\tconst hoverLinkColor = decodeValue(\n\t\tinheritedValue?.elements?.link?.[ ':hover' ]?.color?.text\n\t);\n\tconst userHoverLinkColor = decodeValue(\n\t\tvalue?.elements?.link?.[ ':hover' ]?.color?.text\n\t);\n\tconst setHoverLinkColor = ( newColor ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', 'link', ':hover', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLink = () => !! userLinkColor || !! userHoverLinkColor;\n\tconst resetLink = () => {\n\t\tlet newValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'elements', 'link', ':hover', 'color', 'text' ],\n\t\t\tundefined\n\t\t);\n\t\tnewValue = setImmutably(\n\t\t\tnewValue,\n\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\tundefined\n\t\t);\n\t\tonChange( newValue );\n\t};\n\n\t// Text Color\n\tconst showTextPanel = useHasTextPanel( settings );\n\tconst textColor = decodeValue( inheritedValue?.color?.text );\n\tconst userTextColor = decodeValue( value?.color?.text );\n\tconst hasTextColor = () => !! userTextColor;\n\tconst setTextColor = ( newColor ) => {\n\t\tlet changedObject = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'color', 'text' ],\n\t\t\tencodeColorValue( newColor )\n\t\t);\n\t\tif ( textColor === linkColor ) {\n\t\t\tchangedObject = setImmutably(\n\t\t\t\tchangedObject,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencodeColorValue( newColor )\n\t\t\t);\n\t\t}\n\n\t\tonChange( changedObject );\n\t};\n\tconst resetTextColor = () => setTextColor( undefined );\n\n\t// Elements\n\tconst elements = [\n\t\t{\n\t\t\tname: 'caption',\n\t\t\tlabel: __( 'Captions' ),\n\t\t\tshowPanel: useHasCaptionPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'button',\n\t\t\tlabel: __( 'Button' ),\n\t\t\tshowPanel: useHasButtonPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'heading',\n\t\t\tlabel: __( 'Heading' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h1',\n\t\t\tlabel: __( 'H1' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h2',\n\t\t\tlabel: __( 'H2' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h3',\n\t\t\tlabel: __( 'H3' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h4',\n\t\t\tlabel: __( 'H4' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h5',\n\t\t\tlabel: __( 'H5' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t\t{\n\t\t\tname: 'h6',\n\t\t\tlabel: __( 'H6' ),\n\t\t\tshowPanel: useHasHeadingPanel( settings ),\n\t\t},\n\t];\n\n\tconst resetAllFilter = useCallback( ( previousValue ) => {\n\t\treturn {\n\t\t\t...previousValue,\n\t\t\tcolor: undefined,\n\t\t\telements: {\n\t\t\t\t...previousValue?.elements,\n\t\t\t\tlink: {\n\t\t\t\t\t...previousValue?.elements?.link,\n\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t':hover': {\n\t\t\t\t\t\tcolor: undefined,\n\t\t\t\t\t},\n\t\t\t\t},\n\t\t\t\t...elements.reduce( ( acc, element ) => {\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...acc,\n\t\t\t\t\t\t[ element.name ]: {\n\t\t\t\t\t\t\t...previousValue?.elements?.[ element.name ],\n\t\t\t\t\t\t\tcolor: undefined,\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\tconst items = [\n\t\tshowTextPanel && {\n\t\t\tkey: 'text',\n\t\t\tlabel: __( 'Text' ),\n\t\t\thasValue: hasTextColor,\n\t\t\tresetValue: resetTextColor,\n\t\t\tisShownByDefault: defaultControls.text,\n\t\t\tindicators: [ textColor ],\n\t\t\ttabs: [\n\t\t\t\t{\n\t\t\t\t\tkey: 'text',\n\t\t\t\t\tlabel: __( 'Text' ),\n\t\t\t\t\tinheritedValue: textColor,\n\t\t\t\t\tsetValue: setTextColor,\n\t\t\t\t\tuserValue: userTextColor,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t\tshowBackgroundPanel && {\n\t\t\tkey: 'background',\n\t\t\tlabel: __( 'Background' ),\n\t\t\thasValue: hasBackground,\n\t\t\tresetValue: resetBackground,\n\t\t\tisShownByDefault: defaultControls.background,\n\t\t\tindicators: [ gradient ?? backgroundColor ],\n\t\t\ttabs: [\n\t\t\t\thasSolidColors && {\n\t\t\t\t\tkey: 'background',\n\t\t\t\t\tlabel: __( 'Solid' ),\n\t\t\t\t\tinheritedValue: backgroundColor,\n\t\t\t\t\tsetValue: setBackgroundColor,\n\t\t\t\t\tuserValue: userBackgroundColor,\n\t\t\t\t},\n\t\t\t\thasGradientColors && {\n\t\t\t\t\tkey: 'gradient',\n\t\t\t\t\tlabel: __( 'Gradient' ),\n\t\t\t\t\tinheritedValue: gradient,\n\t\t\t\t\tsetValue: setGradient,\n\t\t\t\t\tuserValue: userGradient,\n\t\t\t\t\tisGradient: true,\n\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t},\n\t\tshowLinkPanel && {\n\t\t\tkey: 'link',\n\t\t\tlabel: __( 'Link' ),\n\t\t\thasValue: hasLink,\n\t\t\tresetValue: resetLink,\n\t\t\tisShownByDefault: defaultControls.link,\n\t\t\tindicators: [ linkColor, hoverLinkColor ],\n\t\t\ttabs: [\n\t\t\t\t{\n\t\t\t\t\tkey: 'link',\n\t\t\t\t\tlabel: __( 'Default' ),\n\t\t\t\t\tinheritedValue: linkColor,\n\t\t\t\t\tsetValue: setLinkColor,\n\t\t\t\t\tuserValue: userLinkColor,\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\tkey: 'hover',\n\t\t\t\t\tlabel: __( 'Hover' ),\n\t\t\t\t\tinheritedValue: hoverLinkColor,\n\t\t\t\t\tsetValue: setHoverLinkColor,\n\t\t\t\t\tuserValue: userHoverLinkColor,\n\t\t\t\t},\n\t\t\t],\n\t\t},\n\t].filter( Boolean );\n\n\telements.forEach( ( { name, label, showPanel } ) => {\n\t\tif ( ! showPanel ) return;\n\n\t\tconst elementBackgroundColor = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.background\n\t\t);\n\t\tconst elementGradient = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.gradient\n\t\t);\n\t\tconst elementTextColor = decodeValue(\n\t\t\tinheritedValue?.elements?.[ name ]?.color?.text\n\t\t);\n\t\tconst elementBackgroundUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.background\n\t\t);\n\t\tconst elementGradientUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.gradient\n\t\t);\n\t\tconst elementTextUserColor = decodeValue(\n\t\t\tvalue?.elements?.[ name ]?.color?.text\n\t\t);\n\t\tconst hasElement = () =>\n\t\t\t!! (\n\t\t\t\telementTextUserColor ||\n\t\t\t\telementBackgroundUserColor ||\n\t\t\t\telementGradientUserColor\n\t\t\t);\n\t\tconst resetElement = () => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'background' ],\n\t\t\t\tundefined\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.gradient = undefined;\n\t\t\tnewValue.elements[ name ].color.text = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\n\t\tconst setElementTextColor = ( newTextColor ) => {\n\t\t\tonChange(\n\t\t\t\tsetImmutably(\n\t\t\t\t\tvalue,\n\t\t\t\t\t[ 'elements', name, 'color', 'text' ],\n\t\t\t\t\tencodeColorValue( newTextColor )\n\t\t\t\t)\n\t\t\t);\n\t\t};\n\t\tconst setElementBackgroundColor = ( newBackgroundColor ) => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'background' ],\n\t\t\t\tencodeColorValue( newBackgroundColor )\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.gradient = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\t\tconst setElementGradient = ( newGradient ) => {\n\t\t\tconst newValue = setImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'elements', name, 'color', 'gradient' ],\n\t\t\t\tencodeGradientValue( newGradient )\n\t\t\t);\n\t\t\tnewValue.elements[ name ].color.background = undefined;\n\t\t\tonChange( newValue );\n\t\t};\n\t\tconst supportsTextColor = true;\n\t\t// Background color is not supported for `caption`\n\t\t// as there isn't yet a way to set padding for the element.\n\t\tconst supportsBackground = name !== 'caption';\n\n\t\titems.push( {\n\t\t\tkey: name,\n\t\t\tlabel,\n\t\t\thasValue: hasElement,\n\t\t\tresetValue: resetElement,\n\t\t\tisShownByDefault: defaultControls[ name ],\n\t\t\tindicators:\n\t\t\t\tsupportsTextColor && supportsBackground\n\t\t\t\t\t? [\n\t\t\t\t\t\t\telementTextColor,\n\t\t\t\t\t\t\telementGradient ?? elementBackgroundColor,\n\t\t\t\t\t ]\n\t\t\t\t\t: [\n\t\t\t\t\t\t\tsupportsTextColor\n\t\t\t\t\t\t\t\t? elementTextColor\n\t\t\t\t\t\t\t\t: elementGradient ?? elementBackgroundColor,\n\t\t\t\t\t ],\n\t\t\ttabs: [\n\t\t\t\thasSolidColors &&\n\t\t\t\t\tsupportsTextColor && {\n\t\t\t\t\t\tkey: 'text',\n\t\t\t\t\t\tlabel: __( 'Text' ),\n\t\t\t\t\t\tinheritedValue: elementTextColor,\n\t\t\t\t\t\tsetValue: setElementTextColor,\n\t\t\t\t\t\tuserValue: elementTextUserColor,\n\t\t\t\t\t},\n\t\t\t\thasSolidColors &&\n\t\t\t\t\tsupportsBackground && {\n\t\t\t\t\t\tkey: 'background',\n\t\t\t\t\t\tlabel: __( 'Background' ),\n\t\t\t\t\t\tinheritedValue: elementBackgroundColor,\n\t\t\t\t\t\tsetValue: setElementBackgroundColor,\n\t\t\t\t\t\tuserValue: elementBackgroundUserColor,\n\t\t\t\t\t},\n\t\t\t\thasGradientColors &&\n\t\t\t\t\tsupportsBackground && {\n\t\t\t\t\t\tkey: 'gradient',\n\t\t\t\t\t\tlabel: __( 'Gradient' ),\n\t\t\t\t\t\tinheritedValue: elementGradient,\n\t\t\t\t\t\tsetValue: setElementGradient,\n\t\t\t\t\t\tuserValue: elementGradientUserColor,\n\t\t\t\t\t\tisGradient: true,\n\t\t\t\t\t},\n\t\t\t].filter( Boolean ),\n\t\t} );\n\t} );\n\n\treturn (\n\t\t<Wrapper\n\t\t\tresetAllFilter={ resetAllFilter }\n\t\t\tvalue={ value }\n\t\t\tonChange={ onChange }\n\t\t\tpanelId={ panelId }\n\t\t>\n\t\t\t{ items.map( ( item ) => (\n\t\t\t\t<ColorPanelDropdown\n\t\t\t\t\tkey={ item.key }\n\t\t\t\t\t{ ...item }\n\t\t\t\t\tcolorGradientControlSettings={ {\n\t\t\t\t\t\tcolors,\n\t\t\t\t\t\tdisableCustomColors: ! areCustomSolidsEnabled,\n\t\t\t\t\t\tgradients,\n\t\t\t\t\t\tdisableCustomGradients: ! areCustomGradientsEnabled,\n\t\t\t\t\t} }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t/>\n\t\t\t) ) }\n\t\t\t{ children }\n\t\t</Wrapper>\n\t);\n}\n"],"mappings":";AAAA;AACA;AACA;AACA,OAAOA,UAAU,MAAM,YAAY;;AAEnC;AACA;AACA;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D,cAAc,IACbmE,kBAAkB,IAAI;QACrBnH,GAAG,EAAE,YAAY;QACjBlB,KAAK,EAAE5C,EAAE,CAAE,YAAa,CAAC;QACzBoE,cAAc,EAAE+F,sBAAsB;QACtC7F,QAAQ,EAAEuG,yBAAyB;QACnCxG,SAAS,EAAEiG;MACZ,CAAC,EACFvD,iBAAiB,IAChBkE,kBAAkB,IAAI;QACrBnH,GAAG,EAAE,UAAU;QACflB,KAAK,EAAE5C,EAAE,CAAE,UAAW,CAAC;QACvBoE,cAAc,EAAEgG,eAAe;QAC/B9F,QAAQ,EAAEyG,kBAAkB;QAC5B1G,SAAS,EAAEkG,wBAAwB;QACnCpG,UAAU,EAAE;MACb,CAAC,CACF,CAAC6F,MAAM,CAAEC,OAAQ;IACnB,CAAE,CAAC;EACJ,CAAE,CAAC;EAEH,OACCtH,aAAA,CAAC+D,OAAO;IACPtE,cAAc,EAAGA,cAAgB;IACjCE,KAAK,EAAGA,KAAO;IACfD,QAAQ,EAAGA,QAAU;IACrBE,OAAO,EAAGA;EAAS,GAEjBwH,KAAK,CAACpG,GAAG,CAAIwH,IAAI,IAClBxI,aAAA,CAACsC,kBAAkB;IAClBnB,GAAG,EAAGqH,IAAI,CAACrH,GAAK;IAAA,GACXqH,IAAI;IACT5G,4BAA4B,EAAG;MAC9BhD,MAAM;MACN6J,mBAAmB,EAAE,CAAExE,sBAAsB;MAC7C9E,SAAS;MACTuJ,sBAAsB,EAAE,CAAExE;IAC3B,CAAG;IACHtE,OAAO,EAAGA;EAAS,CACnB,CACA,CAAC,EACDC,QACM,CAAC;AAEZ"}
@@ -15,7 +15,7 @@ import { useCallback, Platform } from '@wordpress/element';
15
15
  /**
16
16
  * Internal dependencies
17
17
  */
18
- import { getValueFromVariable } from './utils';
18
+ import { getValueFromVariable, TOOLSPANEL_DROPDOWNMENU_PROPS } from './utils';
19
19
  import SpacingSizesControl from '../spacing-sizes-control';
20
20
  import HeightControl from '../height-control';
21
21
  import ChildLayoutControl from '../child-layout-control';
@@ -138,7 +138,8 @@ function DimensionsToolsPanel({
138
138
  return createElement(ToolsPanel, {
139
139
  label: __('Dimensions'),
140
140
  resetAll: resetAll,
141
- panelId: panelId
141
+ panelId: panelId,
142
+ dropdownMenuProps: TOOLSPANEL_DROPDOWNMENU_PROPS
142
143
  }, children);
143
144
  }
144
145
  const DEFAULT_CONTROLS = {
@@ -462,12 +463,12 @@ export default function DimensionsPanel({
462
463
  allowReset: false
463
464
  })), showMinHeightControl && createElement(ToolsPanelItem, {
464
465
  hasValue: hasMinHeightValue,
465
- label: __('Min. height'),
466
+ label: __('Minimum height'),
466
467
  onDeselect: resetMinHeightValue,
467
468
  isShownByDefault: (_defaultControls$minH = defaultControls.minHeight) !== null && _defaultControls$minH !== void 0 ? _defaultControls$minH : DEFAULT_CONTROLS.minHeight,
468
469
  panelId: panelId
469
470
  }, createElement(HeightControl, {
470
- label: __('Min. height'),
471
+ label: __('Minimum height'),
471
472
  value: minHeightValue,
472
473
  onChange: setMinHeightValue
473
474
  })), showChildLayoutControl && createElement(VStack, {