@wordpress/block-editor 16.0.0 → 16.1.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 (368) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +8 -0
  3. package/build/components/alignment-control/ui.cjs +2 -4
  4. package/build/components/alignment-control/ui.cjs.map +2 -2
  5. package/build/components/background-image-control/index.cjs +40 -10
  6. package/build/components/background-image-control/index.cjs.map +2 -2
  7. package/build/components/block-alignment-control/ui.cjs +5 -3
  8. package/build/components/block-alignment-control/ui.cjs.map +2 -2
  9. package/build/components/block-inspector/index.cjs +73 -46
  10. package/build/components/block-inspector/index.cjs.map +2 -2
  11. package/build/components/block-list/block-html.cjs +4 -1
  12. package/build/components/block-list/block-html.cjs.map +2 -2
  13. package/build/components/block-list/use-block-props/index.cjs +5 -2
  14. package/build/components/block-list/use-block-props/index.cjs.map +2 -2
  15. package/build/components/block-list/use-block-props/use-focus-handler.cjs +2 -3
  16. package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +2 -2
  17. package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs +48 -0
  18. package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs.map +7 -0
  19. package/build/components/block-parent-selector/index.cjs +2 -2
  20. package/build/components/block-parent-selector/index.cjs.map +2 -2
  21. package/build/components/block-toolbar/switch-section-style.cjs +4 -2
  22. package/build/components/block-toolbar/switch-section-style.cjs.map +3 -3
  23. package/build/components/block-tools/empty-block-inserter.cjs +2 -7
  24. package/build/components/block-tools/empty-block-inserter.cjs.map +2 -2
  25. package/build/components/block-vertical-alignment-control/ui.cjs +3 -5
  26. package/build/components/block-vertical-alignment-control/ui.cjs.map +2 -2
  27. package/build/components/border-radius-control/utils.cjs +8 -58
  28. package/build/components/border-radius-control/utils.cjs.map +2 -2
  29. package/build/components/colors-gradients/control.cjs +5 -3
  30. package/build/components/colors-gradients/control.cjs.map +2 -2
  31. package/build/components/dimension-control/index.cjs +30 -20
  32. package/build/components/dimension-control/index.cjs.map +3 -3
  33. package/build/components/dimensions-tool/aspect-ratio-tool.cjs +9 -2
  34. package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
  35. package/build/components/editor-styles/index.cjs +9 -1
  36. package/build/components/editor-styles/index.cjs.map +2 -2
  37. package/build/components/global-styles/background-panel.cjs +66 -25
  38. package/build/components/global-styles/background-panel.cjs.map +3 -3
  39. package/build/components/global-styles/border-panel.cjs +153 -55
  40. package/build/components/global-styles/border-panel.cjs.map +3 -3
  41. package/build/components/global-styles/color-gradient-dropdown-item.cjs +46 -14
  42. package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +3 -3
  43. package/build/components/global-styles/color-panel.cjs +63 -17
  44. package/build/components/global-styles/color-panel.cjs.map +2 -2
  45. package/build/components/global-styles/dimensions-panel.cjs +242 -64
  46. package/build/components/global-styles/dimensions-panel.cjs.map +3 -3
  47. package/build/components/global-styles/filters-panel.cjs +59 -20
  48. package/build/components/global-styles/filters-panel.cjs.map +3 -3
  49. package/build/components/global-styles/hooks.cjs +4 -1
  50. package/build/components/global-styles/hooks.cjs.map +2 -2
  51. package/build/components/global-styles/inheritance/index.cjs +142 -0
  52. package/build/components/global-styles/inheritance/index.cjs.map +7 -0
  53. package/build/components/global-styles/inherited-value-context.cjs +173 -0
  54. package/build/components/global-styles/inherited-value-context.cjs.map +7 -0
  55. package/build/components/global-styles/shadow-panel-components.cjs +38 -20
  56. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  57. package/build/components/global-styles/state-control.cjs +1 -1
  58. package/build/components/global-styles/state-control.cjs.map +2 -2
  59. package/build/components/global-styles/typography-panel.cjs +271 -78
  60. package/build/components/global-styles/typography-panel.cjs.map +3 -3
  61. package/build/components/inspector-controls-tabs/styles-tab.cjs +10 -1
  62. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  63. package/build/components/line-height-control/index.cjs +1 -1
  64. package/build/components/line-height-control/index.cjs.map +2 -2
  65. package/build/components/link-control/index.cjs +3 -1
  66. package/build/components/link-control/index.cjs.map +2 -2
  67. package/build/components/preset-input-control/index.cjs +2 -1
  68. package/build/components/preset-input-control/index.cjs.map +2 -2
  69. package/build/components/provider/block-refs-provider.cjs +8 -2
  70. package/build/components/provider/block-refs-provider.cjs.map +2 -2
  71. package/build/components/provider/index.cjs +1 -1
  72. package/build/components/provider/index.cjs.map +2 -2
  73. package/build/components/provider/use-block-sync.cjs +18 -6
  74. package/build/components/provider/use-block-sync.cjs.map +2 -2
  75. package/build/components/provider/use-media-upload-settings.cjs +3 -1
  76. package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
  77. package/build/components/rich-text/index.cjs +23 -13
  78. package/build/components/rich-text/index.cjs.map +2 -2
  79. package/build/components/spacing-sizes-control/utils.cjs +6 -19
  80. package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
  81. package/build/components/text-indent-control/index.cjs +8 -2
  82. package/build/components/text-indent-control/index.cjs.map +2 -2
  83. package/build/components/url-input/index.cjs +303 -344
  84. package/build/components/url-input/index.cjs.map +3 -3
  85. package/build/components/writing-flow/index.cjs +2 -0
  86. package/build/components/writing-flow/index.cjs.map +3 -3
  87. package/build/components/writing-flow/use-arrow-nav.cjs +24 -1
  88. package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
  89. package/build/components/writing-flow/use-click-selection.cjs +28 -2
  90. package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
  91. package/build/components/writing-flow/use-editable-root-event-handlers.cjs +179 -0
  92. package/build/components/writing-flow/use-editable-root-event-handlers.cjs.map +7 -0
  93. package/build/components/writing-flow/use-editable-root.cjs +5 -42
  94. package/build/components/writing-flow/use-editable-root.cjs.map +2 -2
  95. package/build/components/writing-flow/use-home-end.cjs +1 -1
  96. package/build/components/writing-flow/use-home-end.cjs.map +2 -2
  97. package/build/components/writing-flow/use-selection-observer.cjs +17 -13
  98. package/build/components/writing-flow/use-selection-observer.cjs.map +2 -2
  99. package/build/components/writing-flow/utils.cjs +3 -14
  100. package/build/components/writing-flow/utils.cjs.map +2 -2
  101. package/build/hooks/background.cjs +13 -10
  102. package/build/hooks/background.cjs.map +2 -2
  103. package/build/hooks/block-style-variation.cjs +4 -45
  104. package/build/hooks/block-style-variation.cjs.map +3 -3
  105. package/build/hooks/border.cjs +19 -4
  106. package/build/hooks/border.cjs.map +2 -2
  107. package/build/hooks/custom-css.cjs +6 -2
  108. package/build/hooks/custom-css.cjs.map +2 -2
  109. package/build/hooks/dimensions.cjs +15 -4
  110. package/build/hooks/dimensions.cjs.map +2 -2
  111. package/build/hooks/duotone.cjs +26 -14
  112. package/build/hooks/duotone.cjs.map +3 -3
  113. package/build/hooks/elements.cjs +14 -4
  114. package/build/hooks/elements.cjs.map +2 -2
  115. package/build/hooks/line-height.cjs +1 -2
  116. package/build/hooks/line-height.cjs.map +2 -2
  117. package/build/hooks/typography.cjs +13 -4
  118. package/build/hooks/typography.cjs.map +2 -2
  119. package/build/private-apis.cjs +9 -5
  120. package/build/private-apis.cjs.map +3 -3
  121. package/build/store/actions.cjs +9 -4
  122. package/build/store/actions.cjs.map +2 -2
  123. package/build/store/private-selectors.cjs +28 -1
  124. package/build/store/private-selectors.cjs.map +2 -2
  125. package/build/store/reducer.cjs +6 -6
  126. package/build/store/reducer.cjs.map +2 -2
  127. package/build/store/selectors.cjs +23 -0
  128. package/build/store/selectors.cjs.map +2 -2
  129. package/build/utils/native-undo.cjs +55 -0
  130. package/build/utils/native-undo.cjs.map +7 -0
  131. package/build-module/components/alignment-control/ui.mjs +2 -4
  132. package/build-module/components/alignment-control/ui.mjs.map +2 -2
  133. package/build-module/components/background-image-control/index.mjs +43 -10
  134. package/build-module/components/background-image-control/index.mjs.map +2 -2
  135. package/build-module/components/block-alignment-control/ui.mjs +5 -3
  136. package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
  137. package/build-module/components/block-inspector/index.mjs +74 -46
  138. package/build-module/components/block-inspector/index.mjs.map +2 -2
  139. package/build-module/components/block-list/block-html.mjs +4 -1
  140. package/build-module/components/block-list/block-html.mjs.map +2 -2
  141. package/build-module/components/block-list/use-block-props/index.mjs +5 -2
  142. package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
  143. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +2 -3
  144. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
  145. package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs +28 -0
  146. package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs.map +7 -0
  147. package/build-module/components/block-parent-selector/index.mjs +2 -2
  148. package/build-module/components/block-parent-selector/index.mjs.map +2 -2
  149. package/build-module/components/block-toolbar/switch-section-style.mjs +4 -2
  150. package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
  151. package/build-module/components/block-tools/empty-block-inserter.mjs +2 -7
  152. package/build-module/components/block-tools/empty-block-inserter.mjs.map +2 -2
  153. package/build-module/components/block-vertical-alignment-control/ui.mjs +4 -6
  154. package/build-module/components/block-vertical-alignment-control/ui.mjs.map +2 -2
  155. package/build-module/components/border-radius-control/utils.mjs +11 -53
  156. package/build-module/components/border-radius-control/utils.mjs.map +2 -2
  157. package/build-module/components/colors-gradients/control.mjs +5 -3
  158. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  159. package/build-module/components/dimension-control/index.mjs +30 -20
  160. package/build-module/components/dimension-control/index.mjs.map +2 -2
  161. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +10 -6
  162. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
  163. package/build-module/components/editor-styles/index.mjs +9 -1
  164. package/build-module/components/editor-styles/index.mjs.map +2 -2
  165. package/build-module/components/global-styles/background-panel.mjs +71 -29
  166. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  167. package/build-module/components/global-styles/border-panel.mjs +157 -56
  168. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  169. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +51 -15
  170. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
  171. package/build-module/components/global-styles/color-panel.mjs +63 -17
  172. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  173. package/build-module/components/global-styles/dimensions-panel.mjs +248 -66
  174. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  175. package/build-module/components/global-styles/filters-panel.mjs +64 -21
  176. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  177. package/build-module/components/global-styles/hooks.mjs +4 -1
  178. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  179. package/build-module/components/global-styles/inheritance/index.mjs +108 -0
  180. package/build-module/components/global-styles/inheritance/index.mjs.map +7 -0
  181. package/build-module/components/global-styles/inherited-value-context.mjs +141 -0
  182. package/build-module/components/global-styles/inherited-value-context.mjs.map +7 -0
  183. package/build-module/components/global-styles/shadow-panel-components.mjs +38 -20
  184. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  185. package/build-module/components/global-styles/state-control.mjs +1 -1
  186. package/build-module/components/global-styles/state-control.mjs.map +2 -2
  187. package/build-module/components/global-styles/typography-panel.mjs +276 -79
  188. package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
  189. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +6 -1
  190. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  191. package/build-module/components/line-height-control/index.mjs +1 -1
  192. package/build-module/components/line-height-control/index.mjs.map +2 -2
  193. package/build-module/components/link-control/index.mjs +4 -2
  194. package/build-module/components/link-control/index.mjs.map +2 -2
  195. package/build-module/components/preset-input-control/index.mjs +2 -1
  196. package/build-module/components/preset-input-control/index.mjs.map +2 -2
  197. package/build-module/components/provider/block-refs-provider.mjs +8 -2
  198. package/build-module/components/provider/block-refs-provider.mjs.map +2 -2
  199. package/build-module/components/provider/index.mjs +1 -1
  200. package/build-module/components/provider/index.mjs.map +2 -2
  201. package/build-module/components/provider/use-block-sync.mjs +18 -6
  202. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  203. package/build-module/components/provider/use-media-upload-settings.mjs +3 -1
  204. package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
  205. package/build-module/components/rich-text/index.mjs +28 -14
  206. package/build-module/components/rich-text/index.mjs.map +2 -2
  207. package/build-module/components/spacing-sizes-control/utils.mjs +6 -18
  208. package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
  209. package/build-module/components/text-indent-control/index.mjs +8 -2
  210. package/build-module/components/text-indent-control/index.mjs.map +2 -2
  211. package/build-module/components/url-input/index.mjs +306 -353
  212. package/build-module/components/url-input/index.mjs.map +2 -2
  213. package/build-module/components/writing-flow/index.mjs +2 -0
  214. package/build-module/components/writing-flow/index.mjs.map +2 -2
  215. package/build-module/components/writing-flow/use-arrow-nav.mjs +24 -1
  216. package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
  217. package/build-module/components/writing-flow/use-click-selection.mjs +28 -2
  218. package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
  219. package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs +154 -0
  220. package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs.map +7 -0
  221. package/build-module/components/writing-flow/use-editable-root.mjs +5 -37
  222. package/build-module/components/writing-flow/use-editable-root.mjs.map +2 -2
  223. package/build-module/components/writing-flow/use-home-end.mjs +1 -1
  224. package/build-module/components/writing-flow/use-home-end.mjs.map +2 -2
  225. package/build-module/components/writing-flow/use-selection-observer.mjs +18 -14
  226. package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
  227. package/build-module/components/writing-flow/utils.mjs +2 -11
  228. package/build-module/components/writing-flow/utils.mjs.map +2 -2
  229. package/build-module/hooks/background.mjs +13 -10
  230. package/build-module/hooks/background.mjs.map +2 -2
  231. package/build-module/hooks/block-style-variation.mjs +8 -44
  232. package/build-module/hooks/block-style-variation.mjs.map +2 -2
  233. package/build-module/hooks/border.mjs +19 -4
  234. package/build-module/hooks/border.mjs.map +2 -2
  235. package/build-module/hooks/custom-css.mjs +7 -3
  236. package/build-module/hooks/custom-css.mjs.map +2 -2
  237. package/build-module/hooks/dimensions.mjs +15 -4
  238. package/build-module/hooks/dimensions.mjs.map +2 -2
  239. package/build-module/hooks/duotone.mjs +20 -9
  240. package/build-module/hooks/duotone.mjs.map +2 -2
  241. package/build-module/hooks/elements.mjs +14 -4
  242. package/build-module/hooks/elements.mjs.map +2 -2
  243. package/build-module/hooks/line-height.mjs +1 -2
  244. package/build-module/hooks/line-height.mjs.map +2 -2
  245. package/build-module/hooks/typography.mjs +13 -4
  246. package/build-module/hooks/typography.mjs.map +2 -2
  247. package/build-module/private-apis.mjs +7 -3
  248. package/build-module/private-apis.mjs.map +2 -2
  249. package/build-module/store/actions.mjs +9 -4
  250. package/build-module/store/actions.mjs.map +2 -2
  251. package/build-module/store/private-selectors.mjs +29 -1
  252. package/build-module/store/private-selectors.mjs.map +2 -2
  253. package/build-module/store/reducer.mjs +6 -6
  254. package/build-module/store/reducer.mjs.map +2 -2
  255. package/build-module/store/selectors.mjs +23 -0
  256. package/build-module/store/selectors.mjs.map +2 -2
  257. package/build-module/utils/native-undo.mjs +29 -0
  258. package/build-module/utils/native-undo.mjs.map +7 -0
  259. package/build-style/content-rtl.css +10 -18
  260. package/build-style/content.css +10 -18
  261. package/build-style/style-rtl.css +150 -7
  262. package/build-style/style.css +150 -7
  263. package/package.json +40 -41
  264. package/src/components/alignment-control/test/__snapshots__/index.js.snap +1 -1
  265. package/src/components/alignment-control/ui.js +2 -4
  266. package/src/components/background-image-control/index.js +74 -37
  267. package/src/components/background-image-control/style.scss +13 -4
  268. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +3 -3
  269. package/src/components/block-alignment-control/test/index.js +1 -1
  270. package/src/components/block-alignment-control/ui.js +4 -2
  271. package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +1 -1
  272. package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
  273. package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -1
  274. package/src/components/block-inspector/index.js +60 -31
  275. package/src/components/block-list/block-html.js +5 -0
  276. package/src/components/block-list/content.scss +1 -11
  277. package/src/components/block-list/use-block-props/index.js +5 -1
  278. package/src/components/block-list/use-block-props/use-focus-handler.js +9 -8
  279. package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +45 -0
  280. package/src/components/block-parent-selector/index.js +5 -2
  281. package/src/components/block-toolbar/switch-section-style.js +5 -2
  282. package/src/components/block-tools/empty-block-inserter.js +3 -7
  283. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
  284. package/src/components/block-vertical-alignment-control/test/index.js +18 -2
  285. package/src/components/block-vertical-alignment-control/ui.js +3 -5
  286. package/src/components/border-radius-control/test/utils.js +0 -41
  287. package/src/components/border-radius-control/utils.js +16 -107
  288. package/src/components/button-block-appender/content.scss +6 -2
  289. package/src/components/color-palette/test/__snapshots__/control.js.snap +1 -1
  290. package/src/components/colors-gradients/control.js +6 -3
  291. package/src/components/default-block-appender/test/__snapshots__/index.js.snap +1 -1
  292. package/src/components/dimension-control/index.js +13 -1
  293. package/src/components/dimensions-tool/aspect-ratio-tool.js +13 -6
  294. package/src/components/editor-styles/index.js +16 -1
  295. package/src/components/global-styles/background-panel.js +107 -34
  296. package/src/components/global-styles/border-panel.js +219 -48
  297. package/src/components/global-styles/color-gradient-dropdown-item.js +93 -28
  298. package/src/components/global-styles/color-panel.js +92 -11
  299. package/src/components/global-styles/dimensions-panel.js +422 -71
  300. package/src/components/global-styles/filters-panel.js +88 -28
  301. package/src/components/global-styles/hooks.js +8 -1
  302. package/src/components/global-styles/inheritance/index.js +204 -0
  303. package/src/components/global-styles/inheritance/style.scss +184 -0
  304. package/src/components/global-styles/inheritance/test/index.js +281 -0
  305. package/src/components/global-styles/inherited-value-context.js +271 -0
  306. package/src/components/global-styles/shadow-panel-components.js +48 -26
  307. package/src/components/global-styles/state-control.js +2 -2
  308. package/src/components/global-styles/test/background-panel.js +338 -1
  309. package/src/components/global-styles/test/border-panel.js +441 -0
  310. package/src/components/global-styles/test/color-panel.js +182 -2
  311. package/src/components/global-styles/test/dimensions-panel.js +753 -0
  312. package/src/components/global-styles/test/filters-panel.js +194 -0
  313. package/src/components/global-styles/test/inherited-value-context-core.js +98 -0
  314. package/src/components/global-styles/test/inherited-value-context.js +454 -0
  315. package/src/components/global-styles/test/typography-panel-core.js +185 -0
  316. package/src/components/global-styles/test/typography-panel.js +849 -12
  317. package/src/components/global-styles/typography-panel.js +449 -100
  318. package/src/components/image-editor/style.scss +33 -0
  319. package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
  320. package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
  321. package/src/components/line-height-control/index.js +1 -1
  322. package/src/components/link-control/index.js +7 -2
  323. package/src/components/preset-input-control/index.js +4 -1
  324. package/src/components/provider/block-refs-provider.js +12 -2
  325. package/src/components/provider/index.js +2 -2
  326. package/src/components/provider/use-block-sync.js +18 -6
  327. package/src/components/provider/use-media-upload-settings.js +2 -0
  328. package/src/components/rich-text/index.js +37 -16
  329. package/src/components/spacing-sizes-control/test/utils.js +16 -5
  330. package/src/components/spacing-sizes-control/utils.js +11 -28
  331. package/src/components/text-indent-control/index.js +8 -0
  332. package/src/components/url-input/index.js +363 -431
  333. package/src/components/url-input/test/index.js +592 -0
  334. package/src/components/warning/test/__snapshots__/index.js.snap +1 -1
  335. package/src/components/writing-flow/index.js +2 -0
  336. package/src/components/writing-flow/use-arrow-nav.js +51 -1
  337. package/src/components/writing-flow/use-click-selection.js +54 -3
  338. package/src/components/writing-flow/use-editable-root-event-handlers.js +266 -0
  339. package/src/components/writing-flow/use-editable-root.js +7 -77
  340. package/src/components/writing-flow/use-home-end.js +17 -9
  341. package/src/components/writing-flow/use-selection-observer.js +32 -15
  342. package/src/components/writing-flow/utils.js +3 -24
  343. package/src/hooks/background.js +26 -21
  344. package/src/hooks/block-fields/rich-text/styles.scss +1 -1
  345. package/src/hooks/block-style-variation.js +8 -74
  346. package/src/hooks/border.js +19 -4
  347. package/src/hooks/custom-css.js +15 -6
  348. package/src/hooks/dimensions.js +17 -4
  349. package/src/hooks/duotone.js +26 -8
  350. package/src/hooks/elements.js +14 -3
  351. package/src/hooks/line-height.js +0 -1
  352. package/src/hooks/test/inherited-value-wiring.js +411 -0
  353. package/src/hooks/test/preset-round-trip.js +456 -0
  354. package/src/hooks/typography.js +35 -23
  355. package/src/private-apis.js +11 -2
  356. package/src/store/actions.js +10 -4
  357. package/src/store/private-selectors.js +57 -1
  358. package/src/store/reducer.js +9 -9
  359. package/src/store/selectors.js +56 -8
  360. package/src/store/test/private-selectors.js +160 -1
  361. package/src/style.scss +2 -0
  362. package/src/utils/native-undo.js +56 -0
  363. package/build/components/duotone/utils.cjs +0 -87
  364. package/build/components/duotone/utils.cjs.map +0 -7
  365. package/build-module/components/duotone/utils.mjs +0 -59
  366. package/build-module/components/duotone/utils.mjs.map +0 -7
  367. package/src/components/duotone/utils.js +0 -90
  368. package/src/hooks/test/get-variation-styles-with-ref-values.js +0 -91
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/global-styles/typography-panel.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tFontSizePicker,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalToolsPanelItem as ToolsPanelItem,\n\tNotice,\n\tToggleControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FontFamilyControl from '../font-family';\nimport FontAppearanceControl from '../font-appearance-control';\nimport LineHeightControl from '../line-height-control';\nimport LetterSpacingControl from '../letter-spacing-control';\nimport TextAlignmentControl from '../text-alignment-control';\nimport TextTransformControl from '../text-transform-control';\nimport TextDecorationControl from '../text-decoration-control';\nimport TextIndentControl from '../text-indent-control';\nimport WritingModeControl from '../writing-mode-control';\nimport ColorGradientDropdownItem from './color-gradient-dropdown-item';\nimport { useHasTextPanel } from './color-panel';\nimport { useColorGradientSettings } from './hooks';\nimport { useToolsPanelDropdownMenuProps } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport {\n\textractPresetSlug,\n\tencodeColorValueWithPalette,\n} from '../../utils/color-values';\nimport {\n\tgetMergedFontFamiliesAndFontFamilyFaces,\n\tfindNearestStyleAndWeight,\n} from './typography-utils';\nimport { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';\n\nconst MIN_TEXT_COLUMNS = 1;\nconst MAX_TEXT_COLUMNS = 6;\n\nexport function useHasTypographyPanel( settings ) {\n\tconst hasFontFamily = useHasFontFamilyControl( settings );\n\tconst hasLineHeight = useHasLineHeightControl( settings );\n\tconst hasFontAppearance = useHasAppearanceControl( settings );\n\tconst hasLetterSpacing = useHasLetterSpacingControl( settings );\n\tconst hasTextAlign = useHasTextAlignmentControl( settings );\n\tconst hasTextTransform = useHasTextTransformControl( settings );\n\tconst hasTextDecoration = useHasTextDecorationControl( settings );\n\tconst hasTextIndent = useHasTextIndentControl( settings );\n\tconst hasWritingMode = useHasWritingModeControl( settings );\n\tconst hasTextColumns = useHasTextColumnsControl( settings );\n\tconst hasFontSize = useHasFontSizeControl( settings );\n\tconst hasTextColor = useHasTextPanel( settings );\n\n\treturn (\n\t\thasFontFamily ||\n\t\thasLineHeight ||\n\t\thasFontAppearance ||\n\t\thasLetterSpacing ||\n\t\thasTextAlign ||\n\t\thasTextTransform ||\n\t\thasFontSize ||\n\t\thasTextDecoration ||\n\t\thasTextIndent ||\n\t\thasWritingMode ||\n\t\thasTextColumns ||\n\t\thasTextColor\n\t);\n}\n\nfunction useHasFontSizeControl( settings ) {\n\treturn (\n\t\t( settings?.typography?.defaultFontSizes !== false &&\n\t\t\tsettings?.typography?.fontSizes?.default?.length ) ||\n\t\tsettings?.typography?.fontSizes?.theme?.length ||\n\t\tsettings?.typography?.fontSizes?.custom?.length ||\n\t\tsettings?.typography?.customFontSize\n\t);\n}\n\nfunction useHasFontFamilyControl( settings ) {\n\treturn [ 'default', 'theme', 'custom' ].some(\n\t\t( key ) => settings?.typography?.fontFamilies?.[ key ]?.length\n\t);\n}\n\nfunction useHasLineHeightControl( settings ) {\n\treturn settings?.typography?.lineHeight;\n}\n\nfunction useHasAppearanceControl( settings ) {\n\treturn settings?.typography?.fontStyle || settings?.typography?.fontWeight;\n}\n\nfunction useAppearanceControlLabel( settings ) {\n\tif ( ! settings?.typography?.fontStyle ) {\n\t\treturn __( 'Font weight' );\n\t}\n\tif ( ! settings?.typography?.fontWeight ) {\n\t\treturn __( 'Font style' );\n\t}\n\treturn __( 'Appearance' );\n}\n\nfunction useHasLetterSpacingControl( settings ) {\n\treturn settings?.typography?.letterSpacing;\n}\n\nfunction useHasTextTransformControl( settings ) {\n\treturn settings?.typography?.textTransform;\n}\n\nfunction useHasTextAlignmentControl( settings ) {\n\treturn settings?.typography?.textAlign;\n}\n\nfunction useHasTextDecorationControl( settings ) {\n\treturn settings?.typography?.textDecoration;\n}\n\nfunction useHasWritingModeControl( settings ) {\n\treturn settings?.typography?.writingMode;\n}\n\nfunction useHasTextColumnsControl( settings ) {\n\treturn settings?.typography?.textColumns;\n}\n\nfunction useHasTextIndentControl( settings ) {\n\treturn settings?.typography?.textIndent;\n}\n\n/**\n * Concatenate all the font sizes into a single list for the font size picker.\n *\n * @param {Object} settings The global styles settings.\n *\n * @return {Array} The merged font sizes.\n */\nfunction getMergedFontSizes( settings ) {\n\tconst fontSizes = settings?.typography?.fontSizes;\n\tconst defaultFontSizesEnabled = !! settings?.typography?.defaultFontSizes;\n\treturn [\n\t\t...( fontSizes?.custom ?? [] ),\n\t\t...( fontSizes?.theme ?? [] ),\n\t\t...( defaultFontSizesEnabled ? fontSizes?.default ?? [] : [] ),\n\t];\n}\n\nexport function TypographyToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\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={ __( 'Typography' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\ttextColor: true,\n\tfontFamily: true,\n\tfontSize: true,\n\tfontAppearance: true,\n\tlineHeight: true,\n\tletterSpacing: true,\n\ttextAlign: true,\n\ttextTransform: true,\n\ttextDecoration: true,\n\ttextIndent: true,\n\twritingMode: true,\n\ttextColumns: true,\n};\n\nexport default function TypographyPanel( {\n\tas: Wrapper = TypographyToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tisGlobalStyles = false,\n\tcontrastWarning,\n} ) {\n\tconst { colors, allColors, areCustomSolidsEnabled, decodeValue } =\n\t\tuseColorGradientSettings( settings );\n\n\t// Text color. Writes to `color.text` (unchanged storage path). The\n\t// control is rendered here instead of the Color panel because text\n\t// color is a typographic concern.\n\tconst hasTextColorEnabled = useHasTextPanel( settings );\n\tconst textColor = decodeValue( inheritedValue?.color?.text );\n\tconst userTextColor = decodeValue( value?.color?.text );\n\tconst hasTextColorValue = () => !! value?.color?.text;\n\tconst setTextColor = ( newColor, newSlug ) => {\n\t\tconst encoded = encodeColorValueWithPalette(\n\t\t\tallColors,\n\t\t\tnewColor,\n\t\t\tnewSlug\n\t\t);\n\t\tlet changedObject = setImmutably( value, [ 'color', 'text' ], encoded );\n\t\t// Keep an in-sync link color following the text color (e.g. a\n\t\t// Button's link color tracks its text color). Compare raw encoded\n\t\t// references (e.g. `var:preset|color|slug`), not decoded hex values.\n\t\t// Two palette entries can share the same hex but carry different\n\t\t// slugs (e.g. `var:preset|color|dark-background` and\n\t\t// `var:preset|color|dark-text` both resolving to `#000`); comparing\n\t\t// decoded values would conflate them and incorrectly force the link\n\t\t// color to follow the text color even when the user deliberately\n\t\t// chose a different palette slot.\n\t\tif (\n\t\t\tinheritedValue?.color?.text ===\n\t\t\tinheritedValue?.elements?.link?.color?.text\n\t\t) {\n\t\t\tchangedObject = setImmutably(\n\t\t\t\tchangedObject,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencoded\n\t\t\t);\n\t\t}\n\t\tonChange( changedObject );\n\t};\n\tconst resetTextColor = () => setTextColor( undefined );\n\n\t// Font Family\n\tconst hasFontFamilyEnabled = useHasFontFamilyControl( settings );\n\tconst fontFamily = decodeValue( inheritedValue?.typography?.fontFamily );\n\tconst { fontFamilies, fontFamilyFaces } = useMemo( () => {\n\t\treturn getMergedFontFamiliesAndFontFamilyFaces( settings, fontFamily );\n\t}, [ settings, fontFamily ] );\n\n\tconst setFontFamily = ( newValue ) => {\n\t\tconst slug = fontFamilies?.find(\n\t\t\t( { fontFamily: f } ) => f === newValue\n\t\t)?.slug;\n\t\tlet updatedValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'typography', 'fontFamily' ],\n\t\t\tslug ? `var:preset|font-family|${ slug }` : newValue || undefined\n\t\t);\n\n\t\t// Check if current font style/weight are available in the new font family.\n\t\tconst newFontFamilyFaces =\n\t\t\tfontFamilies?.find( ( { fontFamily: f } ) => f === newValue )\n\t\t\t\t?.fontFace ?? [];\n\t\tconst { fontStyles, fontWeights } =\n\t\t\tgetFontStylesAndWeights( newFontFamilyFaces );\n\t\tconst hasFontStyle = fontStyles?.some(\n\t\t\t( { value: fs } ) => fs === fontStyle\n\t\t);\n\t\tconst hasFontWeight = fontWeights?.some(\n\t\t\t( { value: fw } ) => fw?.toString() === fontWeight?.toString()\n\t\t);\n\n\t\t// Find the nearest available font style/weight if not available.\n\t\tif ( ! hasFontStyle || ! hasFontWeight ) {\n\t\t\tconst { nearestFontStyle, nearestFontWeight } =\n\t\t\t\tfindNearestStyleAndWeight(\n\t\t\t\t\tnewFontFamilyFaces,\n\t\t\t\t\tfontStyle,\n\t\t\t\t\tfontWeight\n\t\t\t\t);\n\t\t\tif ( nearestFontStyle || nearestFontWeight ) {\n\t\t\t\t// Update to the nearest available font style/weight in the new font family.\n\t\t\t\tupdatedValue = {\n\t\t\t\t\t...updatedValue,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...updatedValue?.typography,\n\t\t\t\t\t\tfontStyle: nearestFontStyle || undefined,\n\t\t\t\t\t\tfontWeight: nearestFontWeight || undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else if ( fontStyle || fontWeight ) {\n\t\t\t\t// Reset if no available styles/weights found.\n\t\t\t\tupdatedValue = {\n\t\t\t\t\t...updatedValue,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...updatedValue?.typography,\n\t\t\t\t\t\tfontStyle: undefined,\n\t\t\t\t\t\tfontWeight: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tonChange( updatedValue );\n\t};\n\tconst hasFontFamily = () => !! value?.typography?.fontFamily;\n\tconst resetFontFamily = () => setFontFamily( undefined );\n\n\t// Font Size\n\tconst hasFontSizeEnabled = useHasFontSizeControl( settings );\n\tconst disableCustomFontSizes = ! settings?.typography?.customFontSize;\n\tconst mergedFontSizes = getMergedFontSizes( settings );\n\n\tconst fontSize = decodeValue( inheritedValue?.typography?.fontSize );\n\n\t// Extract the slug from the CSS custom property if it exists\n\tconst currentFontSizeSlug = ( () => {\n\t\tconst rawValue = inheritedValue?.typography?.fontSize;\n\t\tif ( ! rawValue || typeof rawValue !== 'string' ) {\n\t\t\treturn undefined;\n\t\t}\n\n\t\t// Block supports use `var:preset` format.\n\t\tif ( rawValue.startsWith( 'var:preset|font-size|' ) ) {\n\t\t\treturn rawValue.replace( 'var:preset|font-size|', '' );\n\t\t}\n\n\t\t// Global styles data uses `var(--wp--preset)` format.\n\t\tconst cssVarMatch = rawValue.match(\n\t\t\t/^var\\(--wp--preset--font-size--([^)]+)\\)$/\n\t\t);\n\t\tif ( cssVarMatch ) {\n\t\t\treturn cssVarMatch[ 1 ];\n\t\t}\n\n\t\treturn undefined;\n\t} )();\n\n\tconst setFontSize = ( newValue, metadata ) => {\n\t\tconst actualValue = !! metadata?.slug\n\t\t\t? `var:preset|font-size|${ metadata?.slug }`\n\t\t\t: newValue;\n\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'fontSize' ],\n\t\t\t\tactualValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasFontSize = () => !! value?.typography?.fontSize;\n\tconst resetFontSize = () => setFontSize( undefined );\n\n\t// Appearance\n\tconst hasAppearanceControl = useHasAppearanceControl( settings );\n\tconst appearanceControlLabel = useAppearanceControlLabel( settings );\n\tconst hasFontStyles = settings?.typography?.fontStyle;\n\tconst hasFontWeights = settings?.typography?.fontWeight;\n\tconst fontStyle = decodeValue( inheritedValue?.typography?.fontStyle );\n\tconst fontWeight = decodeValue( inheritedValue?.typography?.fontWeight );\n\tconst setFontAppearance = useCallback(\n\t\t( { fontStyle: newFontStyle, fontWeight: newFontWeight } ) => {\n\t\t\t// Only update the font style and weight if they have changed.\n\t\t\tif ( newFontStyle !== fontStyle || newFontWeight !== fontWeight ) {\n\t\t\t\tonChange( {\n\t\t\t\t\t...value,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...value?.typography,\n\t\t\t\t\t\tfontStyle: newFontStyle || undefined,\n\t\t\t\t\t\tfontWeight: newFontWeight || undefined,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ fontStyle, fontWeight, onChange, value ]\n\t);\n\tconst hasFontAppearance = () =>\n\t\t!! value?.typography?.fontStyle || !! value?.typography?.fontWeight;\n\tconst resetFontAppearance = useCallback( () => {\n\t\tsetFontAppearance( {} );\n\t}, [ setFontAppearance ] );\n\n\t// Line Height\n\tconst hasLineHeightEnabled = useHasLineHeightControl( settings );\n\tconst lineHeight = decodeValue( inheritedValue?.typography?.lineHeight );\n\tconst setLineHeight = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'lineHeight' ],\n\t\t\t\tnewValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLineHeight = () => value?.typography?.lineHeight !== undefined;\n\tconst resetLineHeight = () => setLineHeight( undefined );\n\n\t// Letter Spacing\n\tconst hasLetterSpacingControl = useHasLetterSpacingControl( settings );\n\tconst letterSpacing = decodeValue(\n\t\tinheritedValue?.typography?.letterSpacing\n\t);\n\tconst setLetterSpacing = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'letterSpacing' ],\n\t\t\t\tnewValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLetterSpacing = () => !! value?.typography?.letterSpacing;\n\tconst resetLetterSpacing = () => setLetterSpacing( undefined );\n\n\t// Text Indent\n\tconst hasTextIndentControl = useHasTextIndentControl( settings );\n\tconst textIndent = decodeValue( inheritedValue?.typography?.textIndent );\n\n\t// Get the setting value - can be 'subsequent' (default), 'all', or false.\n\t// The setting determines which CSS selector is used for the text-indent style.\n\tconst textIndentSetting = settings?.typography?.textIndent ?? 'subsequent';\n\tconst isTextIndentAll = textIndentSetting === 'all';\n\n\tconst setTextIndentValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textIndent' ],\n\t\t\t\tnewValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\n\tconst onToggleTextIndentAll = ( newValue ) => {\n\t\t// Toggle between 'all' and 'subsequent' for the setting.\n\t\t// Include the settings change so it can be handled atomically by the parent.\n\t\tonChange( {\n\t\t\t...value,\n\t\t\tsettings: {\n\t\t\t\ttypography: {\n\t\t\t\t\ttextIndent: newValue ? 'all' : 'subsequent',\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t};\n\n\tconst hasTextIndent = () => !! value?.typography?.textIndent;\n\tconst resetTextIndent = () => {\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'typography', 'textIndent' ], undefined )\n\t\t);\n\t};\n\tconst textIndentHelp = isTextIndentAll\n\t\t? __( 'Indents the first line of all paragraphs.' )\n\t\t: __( 'Indents the first line of each paragraph after the first one.' );\n\n\t// Text Columns\n\tconst hasTextColumnsControl = useHasTextColumnsControl( settings );\n\tconst textColumns = decodeValue( inheritedValue?.typography?.textColumns );\n\tconst setTextColumns = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textColumns' ],\n\t\t\t\tnewValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasTextColumns = () => !! value?.typography?.textColumns;\n\tconst resetTextColumns = () => setTextColumns( undefined );\n\n\t// Text Transform\n\tconst hasTextTransformControl = useHasTextTransformControl( settings );\n\tconst textTransform = decodeValue(\n\t\tinheritedValue?.typography?.textTransform\n\t);\n\tconst setTextTransform = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textTransform' ],\n\t\t\t\tnewValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasTextTransform = () => !! value?.typography?.textTransform;\n\tconst resetTextTransform = () => setTextTransform( undefined );\n\n\t// Text Decoration\n\tconst hasTextDecorationControl = useHasTextDecorationControl( settings );\n\tconst textDecoration = decodeValue(\n\t\tinheritedValue?.typography?.textDecoration\n\t);\n\tconst setTextDecoration = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textDecoration' ],\n\t\t\t\tnewValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasTextDecoration = () => !! value?.typography?.textDecoration;\n\tconst resetTextDecoration = () => setTextDecoration( undefined );\n\n\t// Text Orientation\n\tconst hasWritingModeControl = useHasWritingModeControl( settings );\n\tconst writingMode = decodeValue( inheritedValue?.typography?.writingMode );\n\tconst setWritingMode = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'writingMode' ],\n\t\t\t\tnewValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasWritingMode = () => !! value?.typography?.writingMode;\n\tconst resetWritingMode = () => setWritingMode( undefined );\n\n\t// Text Alignment\n\tconst hasTextAlignmentControl = useHasTextAlignmentControl( settings );\n\n\tconst textAlign = decodeValue( inheritedValue?.typography?.textAlign );\n\tconst setTextAlign = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textAlign' ],\n\t\t\t\tnewValue || undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasTextAlign = () => !! value?.typography?.textAlign;\n\tconst resetTextAlign = () => setTextAlign( undefined );\n\n\tconst resetAllFilter = useCallback(\n\t\t( previousValue ) => {\n\t\t\tif ( ! hasTextColorEnabled ) {\n\t\t\t\treturn {\n\t\t\t\t\t...previousValue,\n\t\t\t\t\ttypography: {},\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...previousValue,\n\t\t\t\ttypography: {},\n\t\t\t\tcolor: {\n\t\t\t\t\t...previousValue?.color,\n\t\t\t\t\ttext: undefined,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\t[ hasTextColorEnabled ]\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{ hasTextColorEnabled && (\n\t\t\t\t<ColorGradientDropdownItem\n\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\thasValue={ hasTextColorValue }\n\t\t\t\t\tresetValue={ resetTextColor }\n\t\t\t\t\tisShownByDefault={ defaultControls.textColor }\n\t\t\t\t\tindicators={ [ textColor ] }\n\t\t\t\t\tcontrastWarning={ contrastWarning }\n\t\t\t\t\ttabs={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'text',\n\t\t\t\t\t\t\tlabel: __( 'Color' ),\n\t\t\t\t\t\t\tinheritedValue: textColor,\n\t\t\t\t\t\t\tinheritedSlug: extractPresetSlug(\n\t\t\t\t\t\t\t\tinheritedValue?.color?.text,\n\t\t\t\t\t\t\t\t'color'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsetValue: setTextColor,\n\t\t\t\t\t\t\tuserValue: userTextColor,\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\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} }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasFontFamilyEnabled && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Font' ) }\n\t\t\t\t\thasValue={ hasFontFamily }\n\t\t\t\t\tonDeselect={ resetFontFamily }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontFamily }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontFamilyControl\n\t\t\t\t\t\tfontFamilies={ fontFamilies }\n\t\t\t\t\t\tvalue={ fontFamily }\n\t\t\t\t\t\tonChange={ setFontFamily }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasFontSizeEnabled && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\thasValue={ hasFontSize }\n\t\t\t\t\tonDeselect={ resetFontSize }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontSize }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontSizePicker\n\t\t\t\t\t\tvalue={ currentFontSizeSlug || fontSize }\n\t\t\t\t\t\tvalueMode={ currentFontSizeSlug ? 'slug' : 'literal' }\n\t\t\t\t\t\tonChange={ setFontSize }\n\t\t\t\t\t\tfontSizes={ mergedFontSizes }\n\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\twithReset={ false }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasAppearanceControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ appearanceControlLabel }\n\t\t\t\t\thasValue={ hasFontAppearance }\n\t\t\t\t\tonDeselect={ resetFontAppearance }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontAppearance }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontAppearanceControl\n\t\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ setFontAppearance }\n\t\t\t\t\t\thasFontStyles={ hasFontStyles }\n\t\t\t\t\t\thasFontWeights={ hasFontWeights }\n\t\t\t\t\t\tfontFamilyFaces={ fontFamilyFaces }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasLineHeightEnabled && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\tlabel={ __( 'Line height' ) }\n\t\t\t\t\thasValue={ hasLineHeight }\n\t\t\t\t\tonDeselect={ resetLineHeight }\n\t\t\t\t\tisShownByDefault={ defaultControls.lineHeight }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<LineHeightControl\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\tvalue={ lineHeight }\n\t\t\t\t\t\tonChange={ setLineHeight }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasLetterSpacingControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\tlabel={ __( 'Letter spacing' ) }\n\t\t\t\t\thasValue={ hasLetterSpacing }\n\t\t\t\t\tonDeselect={ resetLetterSpacing }\n\t\t\t\t\tisShownByDefault={ defaultControls.letterSpacing }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<LetterSpacingControl\n\t\t\t\t\t\tvalue={ letterSpacing }\n\t\t\t\t\t\tonChange={ setLetterSpacing }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextIndentControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Line indent' ) }\n\t\t\t\t\thasValue={ hasTextIndent }\n\t\t\t\t\tonDeselect={ resetTextIndent }\n\t\t\t\t\tisShownByDefault={ defaultControls.textIndent }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextIndentControl\n\t\t\t\t\t\tvalue={ textIndent }\n\t\t\t\t\t\tonChange={ setTextIndentValue }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\thasBottomMargin={ isGlobalStyles }\n\t\t\t\t\t/>\n\t\t\t\t\t{ isGlobalStyles && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Indent all paragraphs' ) }\n\t\t\t\t\t\t\tchecked={ isTextIndentAll }\n\t\t\t\t\t\t\tonChange={ onToggleTextIndentAll }\n\t\t\t\t\t\t\thelp={ textIndentHelp }\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\t{ hasTextColumnsControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\thasValue={ hasTextColumns }\n\t\t\t\t\tonDeselect={ resetTextColumns }\n\t\t\t\t\tisShownByDefault={ defaultControls.textColumns }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<NumberControl\n\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\tmax={ MAX_TEXT_COLUMNS }\n\t\t\t\t\t\tmin={ MIN_TEXT_COLUMNS }\n\t\t\t\t\t\tonChange={ setTextColumns }\n\t\t\t\t\t\tspinControls=\"custom\"\n\t\t\t\t\t\tvalue={ textColumns }\n\t\t\t\t\t\tinitialPosition={ 1 }\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextDecorationControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\tlabel={ __( 'Decoration' ) }\n\t\t\t\t\thasValue={ hasTextDecoration }\n\t\t\t\t\tonDeselect={ resetTextDecoration }\n\t\t\t\t\tisShownByDefault={ defaultControls.textDecoration }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextDecorationControl\n\t\t\t\t\t\tvalue={ textDecoration }\n\t\t\t\t\t\tonChange={ setTextDecoration }\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t/>\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasWritingModeControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tclassName=\"single-column\"\n\t\t\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\t\t\thasValue={ hasWritingMode }\n\t\t\t\t\tonDeselect={ resetWritingMode }\n\t\t\t\t\tisShownByDefault={ defaultControls.writingMode }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<WritingModeControl\n\t\t\t\t\t\tvalue={ writingMode }\n\t\t\t\t\t\tonChange={ setWritingMode }\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{ hasTextTransformControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Letter case' ) }\n\t\t\t\t\thasValue={ hasTextTransform }\n\t\t\t\t\tonDeselect={ resetTextTransform }\n\t\t\t\t\tisShownByDefault={ defaultControls.textTransform }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextTransformControl\n\t\t\t\t\t\tvalue={ textTransform }\n\t\t\t\t\t\tonChange={ setTextTransform }\n\t\t\t\t\t\tshowNone\n\t\t\t\t\t\tisBlock\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{ hasTextAlignmentControl && (\n\t\t\t\t<ToolsPanelItem\n\t\t\t\t\tlabel={ __( 'Text alignment' ) }\n\t\t\t\t\thasValue={ hasTextAlign }\n\t\t\t\t\tonDeselect={ resetTextAlign }\n\t\t\t\t\tisShownByDefault={ defaultControls.textAlign }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextAlignmentControl\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ setTextAlign }\n\t\t\t\t\t\toptions={ [ 'left', 'center', 'right', 'justify' ] }\n\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ textAlign === 'justify' && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Justified text can reduce readability. For better accessibility, use left-aligned text instead.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</ToolsPanelItem>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],
5
- "mappings": ";AAGA;AAAA,EACC;AAAA,EACA,+BAA+B;AAAA,EAC/B,4BAA4B;AAAA,EAC5B,gCAAgC;AAAA,EAChC;AAAA,EACA;AAAA,OACM;AACP,SAAS,UAAU;AACnB,SAAS,aAAa,eAAe;AAKrC,OAAO,uBAAuB;AAC9B,OAAO,2BAA2B;AAClC,OAAO,uBAAuB;AAC9B,OAAO,0BAA0B;AACjC,OAAO,0BAA0B;AACjC,OAAO,0BAA0B;AACjC,OAAO,2BAA2B;AAClC,OAAO,uBAAuB;AAC9B,OAAO,wBAAwB;AAC/B,OAAO,+BAA+B;AACtC,SAAS,uBAAuB;AAChC,SAAS,gCAAgC;AACzC,SAAS,sCAAsC;AAC/C,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,+BAA+B;AAgItC,cAmgBE,YAngBF;AA9HF,IAAM,mBAAmB;AACzB,IAAM,mBAAmB;AAElB,SAAS,sBAAuB,UAAW;AACjD,QAAM,gBAAgB,wBAAyB,QAAS;AACxD,QAAM,gBAAgB,wBAAyB,QAAS;AACxD,QAAM,oBAAoB,wBAAyB,QAAS;AAC5D,QAAM,mBAAmB,2BAA4B,QAAS;AAC9D,QAAM,eAAe,2BAA4B,QAAS;AAC1D,QAAM,mBAAmB,2BAA4B,QAAS;AAC9D,Q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AAAA;AAAA,YACtB;AAAA;AAAA,QACD;AAAA,QAEC,yBACD;AAAA,UAAC;AAAA;AAAA,YACA,WAAU;AAAA,YACV,OAAQ,GAAI,aAAc;AAAA,YAC1B,UAAW;AAAA,YACX,YAAa;AAAA,YACb,kBAAmB,gBAAgB;AAAA,YACnC;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACA,OAAQ;AAAA,gBACR,UAAW;AAAA,gBACX,MAAK;AAAA;AAAA,YACN;AAAA;AAAA,QACD;AAAA,QAEC,2BACD;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,aAAc;AAAA,YAC1B,UAAW;AAAA,YACX,YAAa;AAAA,YACb,kBAAmB,gBAAgB;AAAA,YACnC;AAAA,YAEA;AAAA,cAAC;AAAA;AAAA,gBACA,OAAQ;AAAA,gBACR,UAAW;AAAA,gBACX,UAAQ;AAAA,gBACR,SAAO;AAAA,gBACP,MAAK;AAAA;AAAA,YACN;AAAA;AAAA,QACD;AAAA,QAEC,2BACD;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,gBAAiB;AAAA,YAC7B,UAAW;AAAA,YACX,YAAa;AAAA,YACb,kBAAmB,gBAAgB;AAAA,YACnC;AAAA,YAEA;AAAA;AAAA,gBAAC;AAAA;AAAA,kBACA,OAAQ;AAAA,kBACR,UAAW;AAAA,kBACX,SAAU,CAAE,QAAQ,UAAU,SAAS,SAAU;AAAA,kBACjD,MAAK;AAAA;AAAA,cACN;AAAA,cAEE,cAAc,aACf,oBAAC,SACA,8BAAC,UAAO,QAAO,WAAU,eAAgB,OACtC;AAAA,gBACD;AAAA,cACD,GACD,GACD;AAAA;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EAEF;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tFontSizePicker,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalToolsPanel as ToolsPanel,\n\t__experimentalParseQuantityAndUnitFromRawValue as parseQuantityAndUnitFromRawValue,\n\tNotice,\n\tToggleControl,\n} from '@wordpress/components';\nimport { __ } from '@wordpress/i18n';\nimport { useCallback, useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport FontFamilyControl from '../font-family';\nimport FontAppearanceControl from '../font-appearance-control';\nimport LineHeightControl from '../line-height-control';\nimport LetterSpacingControl from '../letter-spacing-control';\nimport TextAlignmentControl from '../text-alignment-control';\nimport TextTransformControl from '../text-transform-control';\nimport TextDecorationControl from '../text-decoration-control';\nimport TextIndentControl from '../text-indent-control';\nimport WritingModeControl from '../writing-mode-control';\nimport ColorGradientDropdownItem from './color-gradient-dropdown-item';\nimport { useHasTextPanel } from './color-panel';\nimport { useColorGradientSettings } from './hooks';\nimport { useToolsPanelDropdownMenuProps } from './utils';\nimport { setImmutably } from '../../utils/object';\nimport {\n\textractPresetSlug,\n\tencodeColorValueWithPalette,\n} from '../../utils/color-values';\nimport {\n\tgetMergedFontFamiliesAndFontFamilyFaces,\n\tfindNearestStyleAndWeight,\n} from './typography-utils';\nimport { getFontStylesAndWeights } from '../../utils/get-font-styles-and-weights';\nimport {\n\tgetInheritanceProps,\n\tInheritanceToolsPanelItem,\n\tisGlobalStylesInheritanceEnabled,\n} from './inheritance';\n\nconst MIN_TEXT_COLUMNS = 1;\nconst MAX_TEXT_COLUMNS = 6;\n\n/**\n * Whether a link color should follow a text color change.\n *\n * A link color tracks the text color (e.g. a Button's) unless it was set\n * deliberately. Raw preset refs are compared rather than decoded hex, since\n * distinct slots can share a hex (`dark-background`/`dark-text` both `#000`).\n *\n * @param {Object} value Local block styles.\n * @param {Object} inheritedValue Styles inherited from Global Styles.\n * @return {boolean} Whether to sync the link color to the text color.\n */\nfunction shouldSyncLinkColor( value, inheritedValue ) {\n\tconst localLinkColor = value?.elements?.link?.color?.text;\n\t// A local link color keeps tracking only while it matches the text color;\n\t// once it differs it was set deliberately and is left alone.\n\tif ( localLinkColor !== undefined ) {\n\t\treturn localLinkColor === value?.color?.text;\n\t}\n\t// With none set, defer to the inherited values.\n\tconst inheritedLinkColor = inheritedValue?.elements?.link?.color?.text;\n\treturn (\n\t\tinheritedLinkColor === undefined ||\n\t\tinheritedValue?.color?.text === inheritedLinkColor\n\t);\n}\n\nexport function useHasTypographyPanel( settings ) {\n\tconst hasFontFamily = useHasFontFamilyControl( settings );\n\tconst hasLineHeight = useHasLineHeightControl( settings );\n\tconst hasFontAppearance = useHasAppearanceControl( settings );\n\tconst hasLetterSpacing = useHasLetterSpacingControl( settings );\n\tconst hasTextAlign = useHasTextAlignmentControl( settings );\n\tconst hasTextTransform = useHasTextTransformControl( settings );\n\tconst hasTextDecoration = useHasTextDecorationControl( settings );\n\tconst hasTextIndent = useHasTextIndentControl( settings );\n\tconst hasWritingMode = useHasWritingModeControl( settings );\n\tconst hasTextColumns = useHasTextColumnsControl( settings );\n\tconst hasFontSize = useHasFontSizeControl( settings );\n\tconst hasTextColor = useHasTextPanel( settings );\n\n\treturn (\n\t\thasFontFamily ||\n\t\thasLineHeight ||\n\t\thasFontAppearance ||\n\t\thasLetterSpacing ||\n\t\thasTextAlign ||\n\t\thasTextTransform ||\n\t\thasFontSize ||\n\t\thasTextDecoration ||\n\t\thasTextIndent ||\n\t\thasWritingMode ||\n\t\thasTextColumns ||\n\t\thasTextColor\n\t);\n}\n\nfunction useHasFontSizeControl( settings ) {\n\treturn (\n\t\t( settings?.typography?.defaultFontSizes !== false &&\n\t\t\tsettings?.typography?.fontSizes?.default?.length ) ||\n\t\tsettings?.typography?.fontSizes?.theme?.length ||\n\t\tsettings?.typography?.fontSizes?.custom?.length ||\n\t\tsettings?.typography?.customFontSize\n\t);\n}\n\nfunction useHasFontFamilyControl( settings ) {\n\treturn [ 'default', 'theme', 'custom' ].some(\n\t\t( key ) => settings?.typography?.fontFamilies?.[ key ]?.length\n\t);\n}\n\nfunction useHasLineHeightControl( settings ) {\n\treturn settings?.typography?.lineHeight;\n}\n\nfunction useHasAppearanceControl( settings ) {\n\treturn settings?.typography?.fontStyle || settings?.typography?.fontWeight;\n}\n\nfunction useAppearanceControlLabel( settings ) {\n\tif ( ! settings?.typography?.fontStyle ) {\n\t\treturn __( 'Font weight' );\n\t}\n\tif ( ! settings?.typography?.fontWeight ) {\n\t\treturn __( 'Font style' );\n\t}\n\treturn __( 'Appearance' );\n}\n\nfunction useHasLetterSpacingControl( settings ) {\n\treturn settings?.typography?.letterSpacing;\n}\n\nfunction useHasTextTransformControl( settings ) {\n\treturn settings?.typography?.textTransform;\n}\n\nfunction useHasTextAlignmentControl( settings ) {\n\treturn settings?.typography?.textAlign;\n}\n\nfunction useHasTextDecorationControl( settings ) {\n\treturn settings?.typography?.textDecoration;\n}\n\nfunction useHasWritingModeControl( settings ) {\n\treturn settings?.typography?.writingMode;\n}\n\nfunction useHasTextColumnsControl( settings ) {\n\treturn settings?.typography?.textColumns;\n}\n\nfunction useHasTextIndentControl( settings ) {\n\treturn settings?.typography?.textIndent;\n}\n\n/**\n * Concatenate all the font sizes into a single list for the font size picker.\n *\n * @param {Object} settings The global styles settings.\n *\n * @return {Array} The merged font sizes.\n */\nfunction getMergedFontSizes( settings ) {\n\tconst fontSizes = settings?.typography?.fontSizes;\n\tconst defaultFontSizesEnabled = !! settings?.typography?.defaultFontSizes;\n\treturn [\n\t\t...( fontSizes?.custom ?? [] ),\n\t\t...( fontSizes?.theme ?? [] ),\n\t\t...( defaultFontSizesEnabled ? fontSizes?.default ?? [] : [] ),\n\t];\n}\n\nexport function TypographyToolsPanel( {\n\tresetAllFilter,\n\tonChange,\n\tvalue,\n\tpanelId,\n\tchildren,\n} ) {\n\tconst dropdownMenuProps = useToolsPanelDropdownMenuProps();\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={ __( 'Typography' ) }\n\t\t\tresetAll={ resetAll }\n\t\t\tpanelId={ panelId }\n\t\t\t__experimentalFirstVisibleItemClass=\"first\"\n\t\t\tdropdownMenuProps={ dropdownMenuProps }\n\t\t>\n\t\t\t{ children }\n\t\t</ToolsPanel>\n\t);\n}\n\nconst DEFAULT_CONTROLS = {\n\ttextColor: true,\n\tfontFamily: true,\n\tfontSize: true,\n\tfontAppearance: true,\n\tlineHeight: true,\n\tletterSpacing: true,\n\ttextAlign: true,\n\ttextTransform: true,\n\ttextDecoration: true,\n\ttextIndent: true,\n\twritingMode: true,\n\ttextColumns: true,\n};\n\nconst EMPTY_VALUES = [ undefined, null, '' ];\n\nfunction hasValue( value ) {\n\treturn ! EMPTY_VALUES.includes( value );\n}\n\n/**\n * Extracts the numeric quantity from a raw CSS value so it can be used as a\n * unit-control placeholder. The control's unit selector already reflects the\n * inherited unit, so the placeholder must contain only the number (e.g.\n * `1.5em` -> `1.5`) rather than the full unit string.\n *\n * @param {string|number|undefined} rawValue Inherited value to parse.\n * @return {number|undefined} The numeric quantity, or `undefined` when absent.\n */\nfunction getNumericPlaceholder( rawValue ) {\n\tif ( ! hasValue( rawValue ) ) {\n\t\treturn undefined;\n\t}\n\tconst [ quantity ] = parseQuantityAndUnitFromRawValue( rawValue );\n\treturn quantity;\n}\n\nexport default function TypographyPanel( {\n\tas: Wrapper = TypographyToolsPanel,\n\tvalue,\n\tonChange,\n\tinheritedValue = value,\n\tsettings,\n\tpanelId,\n\tdefaultControls = DEFAULT_CONTROLS,\n\tisGlobalStyles = false,\n\tshowInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),\n\tcontrastWarning,\n} ) {\n\tconst { colors, allColors, areCustomSolidsEnabled, decodeValue } =\n\t\tuseColorGradientSettings( settings );\n\t// Always keep the layout className (e.g. `single-column`); only the\n\t// inheritance treatment is gated on `showInheritanceLabelIndicators`.\n\tconst inheritanceProps = ( isInherited, hasLocalOverride, className ) =>\n\t\tgetInheritanceProps(\n\t\t\tshowInheritanceLabelIndicators && isInherited,\n\t\t\tshowInheritanceLabelIndicators && hasLocalOverride,\n\t\t\tclassName\n\t\t);\n\n\t// Text color. Writes to `color.text` (unchanged storage path). The\n\t// control is rendered here instead of the Color panel because text\n\t// color is a typographic concern.\n\tconst hasTextColorEnabled = useHasTextPanel( settings );\n\tconst textColor = decodeValue( inheritedValue?.color?.text );\n\tconst userTextColor = decodeValue( value?.color?.text );\n\tconst hasTextColorValue = () => !! value?.color?.text;\n\tconst setTextColor = ( newColor, newSlug ) => {\n\t\tconst encoded = encodeColorValueWithPalette(\n\t\t\tallColors,\n\t\t\tnewColor,\n\t\t\tnewSlug\n\t\t);\n\t\tlet changedObject = setImmutably( value, [ 'color', 'text' ], encoded );\n\t\t// With the experiment off, keep the pre-inheritance comparison on\n\t\t// `inheritedValue`.\n\t\tconst syncLinkColor = isGlobalStylesInheritanceEnabled()\n\t\t\t? shouldSyncLinkColor( value, inheritedValue )\n\t\t\t: inheritedValue?.color?.text ===\n\t\t\t inheritedValue?.elements?.link?.color?.text;\n\t\tif ( syncLinkColor ) {\n\t\t\tchangedObject = setImmutably(\n\t\t\t\tchangedObject,\n\t\t\t\t[ 'elements', 'link', 'color', 'text' ],\n\t\t\t\tencoded\n\t\t\t);\n\t\t}\n\t\tonChange( changedObject );\n\t};\n\tconst resetTextColor = () => setTextColor( undefined );\n\n\t// Font Family\n\tconst hasFontFamilyEnabled = useHasFontFamilyControl( settings );\n\t// Render the local value when set, otherwise the inherited value\n\t// as the at-rest preselection. The placeholder boolean is computed\n\t// from `value` directly (not from the merged `fontFamily`) so a\n\t// locally-set value never trips the at-rest visual treatment, even\n\t// when it equals the inherited value.\n\tconst inheritedFontFamily = decodeValue(\n\t\tinheritedValue?.typography?.fontFamily\n\t);\n\tconst fontFamily =\n\t\tdecodeValue( value?.typography?.fontFamily ) ?? inheritedFontFamily;\n\tconst isFontFamilyPlaceholder =\n\t\t! hasValue( value?.typography?.fontFamily ) &&\n\t\thasValue( inheritedFontFamily );\n\tconst { fontFamilies, fontFamilyFaces } = useMemo( () => {\n\t\treturn getMergedFontFamiliesAndFontFamilyFaces( settings, fontFamily );\n\t}, [ settings, fontFamily ] );\n\n\tconst setFontFamily = ( newValue ) => {\n\t\tconst slug = fontFamilies?.find(\n\t\t\t( { fontFamily: f } ) => f === newValue\n\t\t)?.slug;\n\t\tconst nextFontFamily = slug\n\t\t\t? `var:preset|font-family|${ slug }`\n\t\t\t: newValue;\n\t\tlet updatedValue = setImmutably(\n\t\t\tvalue,\n\t\t\t[ 'typography', 'fontFamily' ],\n\t\t\thasValue( nextFontFamily ) ? nextFontFamily : undefined\n\t\t);\n\n\t\t// Check if current font style/weight are available in the new font family.\n\t\tconst newFontFamilyFaces =\n\t\t\tfontFamilies?.find( ( { fontFamily: f } ) => f === newValue )\n\t\t\t\t?.fontFace ?? [];\n\t\tconst { fontStyles, fontWeights } =\n\t\t\tgetFontStylesAndWeights( newFontFamilyFaces );\n\t\tconst hasFontStyle = fontStyles?.some(\n\t\t\t( { value: fs } ) => fs === fontStyle\n\t\t);\n\t\tconst hasFontWeight = fontWeights?.some(\n\t\t\t( { value: fw } ) => fw?.toString() === fontWeight?.toString()\n\t\t);\n\n\t\t// Find the nearest available font style/weight if not available.\n\t\tif ( ! hasFontStyle || ! hasFontWeight ) {\n\t\t\tconst { nearestFontStyle, nearestFontWeight } =\n\t\t\t\tfindNearestStyleAndWeight(\n\t\t\t\t\tnewFontFamilyFaces,\n\t\t\t\t\tfontStyle,\n\t\t\t\t\tfontWeight\n\t\t\t\t);\n\t\t\tif ( nearestFontStyle || nearestFontWeight ) {\n\t\t\t\t// Update to the nearest available font style/weight in the new font family.\n\t\t\t\tupdatedValue = {\n\t\t\t\t\t...updatedValue,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...updatedValue?.typography,\n\t\t\t\t\t\tfontStyle: hasValue( nearestFontStyle )\n\t\t\t\t\t\t\t? nearestFontStyle\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tfontWeight: hasValue( nearestFontWeight )\n\t\t\t\t\t\t\t? nearestFontWeight\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t} else if ( fontStyle || fontWeight ) {\n\t\t\t\t// Reset if no available styles/weights found.\n\t\t\t\tupdatedValue = {\n\t\t\t\t\t...updatedValue,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...updatedValue?.typography,\n\t\t\t\t\t\tfontStyle: undefined,\n\t\t\t\t\t\tfontWeight: undefined,\n\t\t\t\t\t},\n\t\t\t\t};\n\t\t\t}\n\t\t}\n\n\t\tonChange( updatedValue );\n\t};\n\tconst hasFontFamily = () => hasValue( value?.typography?.fontFamily );\n\tconst resetFontFamily = () => setFontFamily( undefined );\n\n\t// Font Size\n\tconst hasFontSizeEnabled = useHasFontSizeControl( settings );\n\tconst disableCustomFontSizes = ! settings?.typography?.customFontSize;\n\tconst mergedFontSizes = getMergedFontSizes( settings );\n\n\t// Local-then-inherited resolution for the rendered value. The slug\n\t// extraction reads the same composite raw value so an inherited\n\t// preset preselects its chip at rest while a local literal value\n\t// renders as a literal in the custom-size input.\n\tconst rawLocalFontSize = value?.typography?.fontSize;\n\tconst rawInheritedFontSize = inheritedValue?.typography?.fontSize;\n\tconst rawFontSizeForDisplay = rawLocalFontSize ?? rawInheritedFontSize;\n\tconst fontSize = decodeValue( rawFontSizeForDisplay );\n\tconst inheritedFontSizeDecoded = decodeValue( rawInheritedFontSize );\n\tconst isFontSizePlaceholder =\n\t\t! hasValue( rawLocalFontSize ) && hasValue( rawInheritedFontSize );\n\n\t// Extract the slug from the CSS custom property if it exists.\n\tconst extractSlug = ( rawValue ) => {\n\t\tif ( ! rawValue || typeof rawValue !== 'string' ) {\n\t\t\treturn undefined;\n\t\t}\n\t\t// Block supports use `var:preset` format.\n\t\tif ( rawValue.startsWith( 'var:preset|font-size|' ) ) {\n\t\t\treturn rawValue.replace( 'var:preset|font-size|', '' );\n\t\t}\n\t\t// Global styles data uses `var(--wp--preset)` format.\n\t\tconst cssVarMatch = rawValue.match(\n\t\t\t/^var\\(--wp--preset--font-size--([^)]+)\\)$/\n\t\t);\n\t\tif ( cssVarMatch ) {\n\t\t\treturn cssVarMatch[ 1 ];\n\t\t}\n\t\treturn undefined;\n\t};\n\tconst currentFontSizeSlug = extractSlug( rawFontSizeForDisplay );\n\tconst inheritedFontSizeSlug = extractSlug( rawInheritedFontSize );\n\n\tconst setFontSize = ( newValue, metadata ) => {\n\t\tconst actualValue = !! metadata?.slug\n\t\t\t? `var:preset|font-size|${ metadata?.slug }`\n\t\t\t: newValue;\n\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'fontSize' ],\n\t\t\t\thasValue( actualValue ) ? actualValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\t// Display-without-commit interceptor: at-rest, the inner\n\t// `FontSizePickerToggleGroup` fires `onChange( undefined )` when the\n\t// user activates the already-preselected (inherited) chip. Treat\n\t// that as the user's \"accept this inherited value\" affordance and\n\t// commit the inherited value to local. Once committed (no longer\n\t// at-rest), the same `undefined` payload represents a normal\n\t// deselect, so we let it pass through unchanged. The custom-size\n\t// input does not emit `undefined` on focus or activation, so this\n\t// hook is correctly scoped to the ToggleGroup activation path.\n\tconst setFontSizeWithInheritedCommit = ( newValue, metadata ) => {\n\t\tif ( isFontSizePlaceholder && newValue === undefined && ! metadata ) {\n\t\t\tif ( inheritedFontSizeSlug ) {\n\t\t\t\tsetFontSize( undefined, { slug: inheritedFontSizeSlug } );\n\t\t\t} else {\n\t\t\t\tsetFontSize( inheritedFontSizeDecoded );\n\t\t\t}\n\t\t\treturn;\n\t\t}\n\t\tsetFontSize( newValue, metadata );\n\t};\n\tconst hasFontSize = () => hasValue( value?.typography?.fontSize );\n\tconst resetFontSize = () => setFontSize( undefined );\n\n\t// Appearance\n\tconst hasAppearanceControl = useHasAppearanceControl( settings );\n\tconst appearanceControlLabel = useAppearanceControlLabel( settings );\n\tconst hasFontStyles = settings?.typography?.fontStyle;\n\tconst hasFontWeights = settings?.typography?.fontWeight;\n\t// Render local-then-inherited; placeholder fires only when both\n\t// local leaves are unset and at least one inherited leaf exists.\n\tconst inheritedFontStyle = decodeValue(\n\t\tinheritedValue?.typography?.fontStyle\n\t);\n\tconst inheritedFontWeight = decodeValue(\n\t\tinheritedValue?.typography?.fontWeight\n\t);\n\tconst fontStyle =\n\t\tdecodeValue( value?.typography?.fontStyle ) ?? inheritedFontStyle;\n\tconst fontWeight =\n\t\tdecodeValue( value?.typography?.fontWeight ) ?? inheritedFontWeight;\n\tconst isFontAppearancePlaceholder =\n\t\t! hasValue( value?.typography?.fontStyle ) &&\n\t\t! hasValue( value?.typography?.fontWeight ) &&\n\t\t( hasValue( inheritedFontStyle ) || hasValue( inheritedFontWeight ) );\n\tconst setFontAppearance = useCallback(\n\t\t( { fontStyle: newFontStyle, fontWeight: newFontWeight } ) => {\n\t\t\t// Only update the font style and weight if they have changed.\n\t\t\tif ( newFontStyle !== fontStyle || newFontWeight !== fontWeight ) {\n\t\t\t\tonChange( {\n\t\t\t\t\t...value,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...value?.typography,\n\t\t\t\t\t\tfontStyle: hasValue( newFontStyle )\n\t\t\t\t\t\t\t? newFontStyle\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tfontWeight: hasValue( newFontWeight )\n\t\t\t\t\t\t\t? newFontWeight\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t}\n\t\t},\n\t\t[ fontStyle, fontWeight, onChange, value ]\n\t);\n\t// Display-without-commit interceptor for FontAppearance: when the\n\t// control is at rest (no local override, displaying the inherited\n\t// font style/weight), activating the already-preselected option\n\t// would otherwise be swallowed by the equality short-circuit in\n\t// `setFontAppearance`. Treat that activation as the user's\n\t// \"accept this inherited value\" affordance and commit the\n\t// inherited values to local explicitly.\n\tconst setFontAppearanceWithInheritedCommit = useCallback(\n\t\t( next ) => {\n\t\t\tif (\n\t\t\t\tisFontAppearancePlaceholder &&\n\t\t\t\tnext.fontStyle === fontStyle &&\n\t\t\t\tnext.fontWeight === fontWeight\n\t\t\t) {\n\t\t\t\tonChange( {\n\t\t\t\t\t...value,\n\t\t\t\t\ttypography: {\n\t\t\t\t\t\t...value?.typography,\n\t\t\t\t\t\tfontStyle: hasValue( fontStyle )\n\t\t\t\t\t\t\t? fontStyle\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t\tfontWeight: hasValue( fontWeight )\n\t\t\t\t\t\t\t? fontWeight\n\t\t\t\t\t\t\t: undefined,\n\t\t\t\t\t},\n\t\t\t\t} );\n\t\t\t\treturn;\n\t\t\t}\n\t\t\tsetFontAppearance( next );\n\t\t},\n\t\t[\n\t\t\tisFontAppearancePlaceholder,\n\t\t\tfontStyle,\n\t\t\tfontWeight,\n\t\t\tonChange,\n\t\t\tvalue,\n\t\t\tsetFontAppearance,\n\t\t]\n\t);\n\tconst hasFontAppearance = () =>\n\t\thasValue( value?.typography?.fontStyle ) ||\n\t\thasValue( value?.typography?.fontWeight );\n\tconst resetFontAppearance = useCallback( () => {\n\t\tsetFontAppearance( {} );\n\t}, [ setFontAppearance ] );\n\n\t// Line Height\n\tconst hasLineHeightEnabled = useHasLineHeightControl( settings );\n\tconst localLineHeight = decodeValue( value?.typography?.lineHeight );\n\tconst inheritedLineHeight = decodeValue(\n\t\tinheritedValue?.typography?.lineHeight\n\t);\n\tconst isLineHeightPlaceholder =\n\t\t! hasValue( value?.typography?.lineHeight ) &&\n\t\thasValue( inheritedLineHeight );\n\tconst setLineHeight = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'lineHeight' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLineHeight = () => hasValue( value?.typography?.lineHeight );\n\tconst resetLineHeight = () => setLineHeight( undefined );\n\n\t// Letter Spacing\n\tconst hasLetterSpacingControl = useHasLetterSpacingControl( settings );\n\tconst localLetterSpacing = decodeValue( value?.typography?.letterSpacing );\n\tconst inheritedLetterSpacing = decodeValue(\n\t\tinheritedValue?.typography?.letterSpacing\n\t);\n\tconst isLetterSpacingPlaceholder =\n\t\t! hasValue( value?.typography?.letterSpacing ) &&\n\t\thasValue( inheritedLetterSpacing );\n\tconst setLetterSpacing = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'letterSpacing' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasLetterSpacing = () => hasValue( value?.typography?.letterSpacing );\n\tconst resetLetterSpacing = () => setLetterSpacing( undefined );\n\n\t// Text Indent\n\tconst hasTextIndentControl = useHasTextIndentControl( settings );\n\tconst localTextIndent = decodeValue( value?.typography?.textIndent );\n\tconst inheritedTextIndent = decodeValue(\n\t\tinheritedValue?.typography?.textIndent\n\t);\n\tconst isTextIndentPlaceholder =\n\t\t! hasValue( value?.typography?.textIndent ) &&\n\t\thasValue( inheritedTextIndent );\n\n\t// Get the setting value - can be 'subsequent' (default), 'all', or false.\n\t// The setting determines which CSS selector is used for the text-indent style.\n\tconst textIndentSetting = settings?.typography?.textIndent ?? 'subsequent';\n\tconst isTextIndentAll = textIndentSetting === 'all';\n\n\tconst setTextIndentValue = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textIndent' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\n\tconst onToggleTextIndentAll = ( newValue ) => {\n\t\t// Toggle between 'all' and 'subsequent' for the setting.\n\t\t// Include the settings change so it can be handled atomically by the parent.\n\t\tonChange( {\n\t\t\t...value,\n\t\t\tsettings: {\n\t\t\t\ttypography: {\n\t\t\t\t\ttextIndent: newValue ? 'all' : 'subsequent',\n\t\t\t\t},\n\t\t\t},\n\t\t} );\n\t};\n\n\tconst hasTextIndent = () => hasValue( value?.typography?.textIndent );\n\tconst resetTextIndent = () => {\n\t\tonChange(\n\t\t\tsetImmutably( value, [ 'typography', 'textIndent' ], undefined )\n\t\t);\n\t};\n\tconst textIndentHelp = isTextIndentAll\n\t\t? __( 'Indents the first line of all paragraphs.' )\n\t\t: __( 'Indents the first line of each paragraph after the first one.' );\n\n\t// Text Columns\n\tconst hasTextColumnsControl = useHasTextColumnsControl( settings );\n\tconst localTextColumns = decodeValue( value?.typography?.textColumns );\n\tconst inheritedTextColumns = decodeValue(\n\t\tinheritedValue?.typography?.textColumns\n\t);\n\tconst isTextColumnsPlaceholder =\n\t\t! hasValue( value?.typography?.textColumns ) &&\n\t\thasValue( inheritedTextColumns );\n\tconst setTextColumns = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textColumns' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst hasTextColumns = () => hasValue( value?.typography?.textColumns );\n\tconst resetTextColumns = () => setTextColumns( undefined );\n\n\t// Text Transform\n\tconst hasTextTransformControl = useHasTextTransformControl( settings );\n\tconst inheritedTextTransform = decodeValue(\n\t\tinheritedValue?.typography?.textTransform\n\t);\n\tconst textTransform =\n\t\tdecodeValue( value?.typography?.textTransform ) ??\n\t\tinheritedTextTransform;\n\tconst isTextTransformPlaceholder =\n\t\t! hasValue( value?.typography?.textTransform ) &&\n\t\thasValue( inheritedTextTransform );\n\tconst setTextTransform = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textTransform' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\t// Display-without-commit interceptor: when at-rest, the inner\n\t// `ToggleGroupControl` fires `onChange( undefined )` if the user\n\t// activates the already-preselected (inherited) option. We treat\n\t// that activation as the user's \"accept this inherited value\"\n\t// affordance and commit the inherited value to local. When\n\t// committed (no longer at-rest), the same `undefined` payload\n\t// represents a normal `isDeselectable` deselect, so we let it pass\n\t// through unchanged.\n\tconst setTextTransformWithInheritedCommit = ( newValue ) => {\n\t\tif ( isTextTransformPlaceholder && newValue === undefined ) {\n\t\t\tsetTextTransform( inheritedTextTransform );\n\t\t\treturn;\n\t\t}\n\t\tsetTextTransform( newValue );\n\t};\n\tconst hasTextTransform = () => hasValue( value?.typography?.textTransform );\n\tconst resetTextTransform = () => setTextTransform( undefined );\n\n\t// Text Decoration\n\tconst hasTextDecorationControl = useHasTextDecorationControl( settings );\n\tconst inheritedTextDecoration = decodeValue(\n\t\tinheritedValue?.typography?.textDecoration\n\t);\n\tconst textDecoration =\n\t\tdecodeValue( value?.typography?.textDecoration ) ??\n\t\tinheritedTextDecoration;\n\tconst isTextDecorationPlaceholder =\n\t\t! hasValue( value?.typography?.textDecoration ) &&\n\t\thasValue( inheritedTextDecoration );\n\tconst setTextDecoration = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textDecoration' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst setTextDecorationWithInheritedCommit = ( newValue ) => {\n\t\tif ( isTextDecorationPlaceholder && newValue === undefined ) {\n\t\t\tsetTextDecoration( inheritedTextDecoration );\n\t\t\treturn;\n\t\t}\n\t\tsetTextDecoration( newValue );\n\t};\n\tconst hasTextDecoration = () =>\n\t\thasValue( value?.typography?.textDecoration );\n\tconst resetTextDecoration = () => setTextDecoration( undefined );\n\n\t// Text Orientation\n\tconst hasWritingModeControl = useHasWritingModeControl( settings );\n\tconst inheritedWritingMode = decodeValue(\n\t\tinheritedValue?.typography?.writingMode\n\t);\n\tconst writingMode =\n\t\tdecodeValue( value?.typography?.writingMode ) ?? inheritedWritingMode;\n\tconst isWritingModePlaceholder =\n\t\t! hasValue( value?.typography?.writingMode ) &&\n\t\thasValue( inheritedWritingMode );\n\tconst setWritingMode = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'writingMode' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst setWritingModeWithInheritedCommit = ( newValue ) => {\n\t\tif ( isWritingModePlaceholder && newValue === undefined ) {\n\t\t\tsetWritingMode( inheritedWritingMode );\n\t\t\treturn;\n\t\t}\n\t\tsetWritingMode( newValue );\n\t};\n\tconst hasWritingMode = () => hasValue( value?.typography?.writingMode );\n\tconst resetWritingMode = () => setWritingMode( undefined );\n\n\t// Text Alignment\n\tconst hasTextAlignmentControl = useHasTextAlignmentControl( settings );\n\n\tconst inheritedTextAlign = decodeValue(\n\t\tinheritedValue?.typography?.textAlign\n\t);\n\tconst textAlign =\n\t\tdecodeValue( value?.typography?.textAlign ) ?? inheritedTextAlign;\n\tconst isTextAlignPlaceholder =\n\t\t! hasValue( value?.typography?.textAlign ) &&\n\t\thasValue( inheritedTextAlign );\n\tconst setTextAlign = ( newValue ) => {\n\t\tonChange(\n\t\t\tsetImmutably(\n\t\t\t\tvalue,\n\t\t\t\t[ 'typography', 'textAlign' ],\n\t\t\t\thasValue( newValue ) ? newValue : undefined\n\t\t\t)\n\t\t);\n\t};\n\tconst setTextAlignWithInheritedCommit = ( newValue ) => {\n\t\tif ( isTextAlignPlaceholder && newValue === undefined ) {\n\t\t\tsetTextAlign( inheritedTextAlign );\n\t\t\treturn;\n\t\t}\n\t\tsetTextAlign( newValue );\n\t};\n\tconst hasTextAlign = () => hasValue( value?.typography?.textAlign );\n\tconst resetTextAlign = () => setTextAlign( undefined );\n\n\tconst resetAllFilter = useCallback(\n\t\t( previousValue ) => {\n\t\t\tif ( ! hasTextColorEnabled ) {\n\t\t\t\treturn {\n\t\t\t\t\t...previousValue,\n\t\t\t\t\ttypography: {},\n\t\t\t\t};\n\t\t\t}\n\t\t\treturn {\n\t\t\t\t...previousValue,\n\t\t\t\ttypography: {},\n\t\t\t\tcolor: {\n\t\t\t\t\t...previousValue?.color,\n\t\t\t\t\ttext: undefined,\n\t\t\t\t},\n\t\t\t};\n\t\t},\n\t\t[ hasTextColorEnabled ]\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{ hasTextColorEnabled && (\n\t\t\t\t<ColorGradientDropdownItem\n\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\thasValue={ hasTextColorValue }\n\t\t\t\t\tresetValue={ resetTextColor }\n\t\t\t\t\tisShownByDefault={ defaultControls.textColor }\n\t\t\t\t\tindicators={ [ userTextColor ?? textColor ] }\n\t\t\t\t\tcontrastWarning={ contrastWarning }\n\t\t\t\t\tshowInheritanceLabelIndicators={\n\t\t\t\t\t\tshowInheritanceLabelIndicators\n\t\t\t\t\t}\n\t\t\t\t\tisPlaceholder={\n\t\t\t\t\t\tuserTextColor === undefined && textColor !== undefined\n\t\t\t\t\t}\n\t\t\t\t\thasInheritedValue={ textColor !== undefined }\n\t\t\t\t\ttabs={ [\n\t\t\t\t\t\t{\n\t\t\t\t\t\t\tkey: 'text',\n\t\t\t\t\t\t\tlabel: __( 'Color' ),\n\t\t\t\t\t\t\tinheritedValue: textColor,\n\t\t\t\t\t\t\tinheritedSlug: extractPresetSlug(\n\t\t\t\t\t\t\t\tinheritedValue?.color?.text,\n\t\t\t\t\t\t\t\t'color'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tuserSlug: extractPresetSlug(\n\t\t\t\t\t\t\t\tvalue?.color?.text,\n\t\t\t\t\t\t\t\t'color'\n\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\tsetValue: setTextColor,\n\t\t\t\t\t\t\tuserValue: userTextColor,\n\t\t\t\t\t\t\tisPlaceholder:\n\t\t\t\t\t\t\t\tuserTextColor === undefined &&\n\t\t\t\t\t\t\t\ttextColor !== undefined,\n\t\t\t\t\t\t},\n\t\t\t\t\t] }\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} }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ hasFontFamilyEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisFontFamilyPlaceholder,\n\t\t\t\t\t\thasFontFamily() && inheritedFontFamily !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Font' ) }\n\t\t\t\t\thasValue={ hasFontFamily }\n\t\t\t\t\tonDeselect={ resetFontFamily }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontFamily }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontFamilyControl\n\t\t\t\t\t\tfontFamilies={ fontFamilies }\n\t\t\t\t\t\tvalue={ fontFamily }\n\t\t\t\t\t\tonChange={ setFontFamily }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasFontSizeEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisFontSizePlaceholder,\n\t\t\t\t\t\thasFontSize() && rawInheritedFontSize !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Size' ) }\n\t\t\t\t\thasValue={ hasFontSize }\n\t\t\t\t\thasInlineEndToggle\n\t\t\t\t\tonDeselect={ resetFontSize }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontSize }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontSizePicker\n\t\t\t\t\t\tvalue={ currentFontSizeSlug || fontSize }\n\t\t\t\t\t\tvalueMode={ currentFontSizeSlug ? 'slug' : 'literal' }\n\t\t\t\t\t\tonChange={ setFontSizeWithInheritedCommit }\n\t\t\t\t\t\tfontSizes={ mergedFontSizes }\n\t\t\t\t\t\tdisableCustomFontSizes={ disableCustomFontSizes }\n\t\t\t\t\t\twithReset={ false }\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasAppearanceControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisFontAppearancePlaceholder,\n\t\t\t\t\t\thasFontAppearance() &&\n\t\t\t\t\t\t\t( inheritedFontStyle !== undefined ||\n\t\t\t\t\t\t\t\tinheritedFontWeight !== undefined )\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ appearanceControlLabel }\n\t\t\t\t\thasValue={ hasFontAppearance }\n\t\t\t\t\tonDeselect={ resetFontAppearance }\n\t\t\t\t\tisShownByDefault={ defaultControls.fontAppearance }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<FontAppearanceControl\n\t\t\t\t\t\tvalue={ {\n\t\t\t\t\t\t\tfontStyle,\n\t\t\t\t\t\t\tfontWeight,\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tonChange={ setFontAppearanceWithInheritedCommit }\n\t\t\t\t\t\thasFontStyles={ hasFontStyles }\n\t\t\t\t\t\thasFontWeights={ hasFontWeights }\n\t\t\t\t\t\tfontFamilyFaces={ fontFamilyFaces }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasLineHeightEnabled && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisLineHeightPlaceholder,\n\t\t\t\t\t\thasLineHeight() && inheritedLineHeight !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Line height' ) }\n\t\t\t\t\thasValue={ hasLineHeight }\n\t\t\t\t\tonDeselect={ resetLineHeight }\n\t\t\t\t\tisShownByDefault={ defaultControls.lineHeight }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<LineHeightControl\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\tvalue={ localLineHeight ?? inheritedLineHeight }\n\t\t\t\t\t\tonChange={ setLineHeight }\n\t\t\t\t\t\t// Only override the placeholder when there is an\n\t\t\t\t\t\t// inherited value to surface. Passing `undefined` would\n\t\t\t\t\t\t// clobber `LineHeightControl`'s own `BASE_DEFAULT_VALUE`\n\t\t\t\t\t\t// (1.5) placeholder.\n\t\t\t\t\t\t{ ...( isLineHeightPlaceholder\n\t\t\t\t\t\t\t? {\n\t\t\t\t\t\t\t\t\tplaceholder:\n\t\t\t\t\t\t\t\t\t\tgetNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\t\tinheritedLineHeight\n\t\t\t\t\t\t\t\t\t\t),\n\t\t\t\t\t\t\t }\n\t\t\t\t\t\t\t: {} ) }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasLetterSpacingControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisLetterSpacingPlaceholder,\n\t\t\t\t\t\thasLetterSpacing() &&\n\t\t\t\t\t\t\tinheritedLetterSpacing !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Letter spacing' ) }\n\t\t\t\t\thasValue={ hasLetterSpacing }\n\t\t\t\t\tonDeselect={ resetLetterSpacing }\n\t\t\t\t\tisShownByDefault={ defaultControls.letterSpacing }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<LetterSpacingControl\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as\n\t\t\t\t\t\t// the control's value at rest so the unit parses from\n\t\t\t\t\t\t// it (e.g. \"0.02em\" keeps the em unit rather than the\n\t\t\t\t\t\t// value string sitting behind a default px unit). It is\n\t\t\t\t\t\t// only written to local on user change. Matches the\n\t\t\t\t\t\t// ToggleGroup/FontSize controls rather than the\n\t\t\t\t\t\t// native-placeholder pattern.\n\t\t\t\t\t\tvalue={ localLetterSpacing ?? inheritedLetterSpacing }\n\t\t\t\t\t\tonChange={ setLetterSpacing }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisLetterSpacingPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder(\n\t\t\t\t\t\t\t\t\t\tinheritedLetterSpacing\n\t\t\t\t\t\t\t\t )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextIndentControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextIndentPlaceholder,\n\t\t\t\t\t\thasTextIndent() && inheritedTextIndent !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Line indent' ) }\n\t\t\t\t\thasValue={ hasTextIndent }\n\t\t\t\t\tonDeselect={ resetTextIndent }\n\t\t\t\t\tisShownByDefault={ defaultControls.textIndent }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextIndentControl\n\t\t\t\t\t\t// Local-then-inherited: render the inherited value as\n\t\t\t\t\t\t// the control's value at rest so the UnitControl parses\n\t\t\t\t\t\t// and shows the inherited unit (e.g. `1.5em` selects the\n\t\t\t\t\t\t// `em` unit) instead of a raw string in the placeholder\n\t\t\t\t\t\t// while the unit stays at the default `px`. Written to\n\t\t\t\t\t\t// local only on user change.\n\t\t\t\t\t\tvalue={ localTextIndent ?? inheritedTextIndent }\n\t\t\t\t\t\tonChange={ setTextIndentValue }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t\twithSlider\n\t\t\t\t\t\thasBottomMargin={ isGlobalStyles }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisTextIndentPlaceholder\n\t\t\t\t\t\t\t\t? getNumericPlaceholder( inheritedTextIndent )\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t/>\n\t\t\t\t\t{ isGlobalStyles && (\n\t\t\t\t\t\t<ToggleControl\n\t\t\t\t\t\t\tlabel={ __( 'Indent all paragraphs' ) }\n\t\t\t\t\t\t\tchecked={ isTextIndentAll }\n\t\t\t\t\t\t\tonChange={ onToggleTextIndentAll }\n\t\t\t\t\t\t\thelp={ textIndentHelp }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextColumnsControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextColumnsPlaceholder,\n\t\t\t\t\t\thasTextColumns() && inheritedTextColumns !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\thasValue={ hasTextColumns }\n\t\t\t\t\tonDeselect={ resetTextColumns }\n\t\t\t\t\tisShownByDefault={ defaultControls.textColumns }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<NumberControl\n\t\t\t\t\t\tlabel={ __( 'Columns' ) }\n\t\t\t\t\t\tmax={ MAX_TEXT_COLUMNS }\n\t\t\t\t\t\tmin={ MIN_TEXT_COLUMNS }\n\t\t\t\t\t\tonChange={ setTextColumns }\n\t\t\t\t\t\tplaceholder={\n\t\t\t\t\t\t\tisTextColumnsPlaceholder\n\t\t\t\t\t\t\t\t? inheritedTextColumns\n\t\t\t\t\t\t\t\t: undefined\n\t\t\t\t\t\t}\n\t\t\t\t\t\tspinControls=\"custom\"\n\t\t\t\t\t\tvalue={ localTextColumns }\n\t\t\t\t\t\tinitialPosition={ 1 }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextDecorationControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextDecorationPlaceholder,\n\t\t\t\t\t\thasTextDecoration() &&\n\t\t\t\t\t\t\tinheritedTextDecoration !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Decoration' ) }\n\t\t\t\t\thasValue={ hasTextDecoration }\n\t\t\t\t\tonDeselect={ resetTextDecoration }\n\t\t\t\t\tisShownByDefault={ defaultControls.textDecoration }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextDecorationControl\n\t\t\t\t\t\tvalue={ textDecoration }\n\t\t\t\t\t\tonChange={ setTextDecorationWithInheritedCommit }\n\t\t\t\t\t\t__unstableInputWidth=\"auto\"\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasWritingModeControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisWritingModePlaceholder,\n\t\t\t\t\t\thasWritingMode() && inheritedWritingMode !== undefined,\n\t\t\t\t\t\t'single-column'\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Orientation' ) }\n\t\t\t\t\thasValue={ hasWritingMode }\n\t\t\t\t\tonDeselect={ resetWritingMode }\n\t\t\t\t\tisShownByDefault={ defaultControls.writingMode }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<WritingModeControl\n\t\t\t\t\t\tvalue={ writingMode }\n\t\t\t\t\t\tonChange={ setWritingModeWithInheritedCommit }\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextTransformControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextTransformPlaceholder,\n\t\t\t\t\t\thasTextTransform() &&\n\t\t\t\t\t\t\tinheritedTextTransform !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Letter case' ) }\n\t\t\t\t\thasValue={ hasTextTransform }\n\t\t\t\t\tonDeselect={ resetTextTransform }\n\t\t\t\t\tisShownByDefault={ defaultControls.textTransform }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextTransformControl\n\t\t\t\t\t\tvalue={ textTransform }\n\t\t\t\t\t\tonChange={ setTextTransformWithInheritedCommit }\n\t\t\t\t\t\tshowNone\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t/>\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t\t{ hasTextAlignmentControl && (\n\t\t\t\t<InheritanceToolsPanelItem\n\t\t\t\t\t{ ...inheritanceProps(\n\t\t\t\t\t\tisTextAlignPlaceholder,\n\t\t\t\t\t\thasTextAlign() && inheritedTextAlign !== undefined\n\t\t\t\t\t) }\n\t\t\t\t\tlabel={ __( 'Text alignment' ) }\n\t\t\t\t\thasValue={ hasTextAlign }\n\t\t\t\t\tonDeselect={ resetTextAlign }\n\t\t\t\t\tisShownByDefault={ defaultControls.textAlign }\n\t\t\t\t\tpanelId={ panelId }\n\t\t\t\t>\n\t\t\t\t\t<TextAlignmentControl\n\t\t\t\t\t\tvalue={ textAlign }\n\t\t\t\t\t\tonChange={ setTextAlignWithInheritedCommit }\n\t\t\t\t\t\toptions={ [ 'left', 'center', 'right', 'justify' ] }\n\t\t\t\t\t/>\n\n\t\t\t\t\t{ textAlign === 'justify' && (\n\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t<Notice status=\"warning\" isDismissible={ false }>\n\t\t\t\t\t\t\t\t{ __(\n\t\t\t\t\t\t\t\t\t'Justified text can reduce readability. For better accessibility, use left-aligned text instead.'\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t</Notice>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t) }\n\t\t\t\t</InheritanceToolsPanelItem>\n\t\t\t) }\n\t\t</Wrapper>\n\t);\n}\n"],
5
+ "mappings": ";AAGA;AAAA,EACC;AAAA,EACA,+BAA+B;AAAA,EAC/B,4BAA4B;AAAA,EAC5B,kDAAkD;AAAA,EAClD;AAAA,EACA;AAAA,OACM;AACP,SAAS,UAAU;AACnB,SAAS,aAAa,eAAe;AAKrC,OAAO,uBAAuB;AAC9B,OAAO,2BAA2B;AAClC,OAAO,uBAAuB;AAC9B,OAAO,0BAA0B;AACjC,OAAO,0BAA0B;AACjC,OAAO,0BAA0B;AACjC,OAAO,2BAA2B;AAClC,OAAO,uBAAuB;AAC9B,OAAO,wBAAwB;AAC/B,OAAO,+BAA+B;AACtC,SAAS,uBAAuB;AAChC,SAAS,gCAAgC;AACzC,SAAS,sCAAsC;AAC/C,SAAS,oBAAoB;AAC7B;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP;AAAA,EACC;AAAA,EACA;AAAA,OACM;AACP,SAAS,+BAA+B;AACxC;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,OACM;AA0JL,cA2xBE,YA3xBF;AAxJF,IAAM,mBAAmB;AACzB,IAAM,mBAAmB;AAazB,SAAS,oBAAqB,OAAO,gBAAiB;AACrD,QAAM,iBAAiB,OAAO,UAAU,MAAM,OAAO;AAGrD,MAAK,mBAAmB,QAAY;AACnC,WAAO,mBAAmB,OAAO,OAAO;AAAA,EACzC;AAEA,QAAM,qBAAqB,gBAAgB,UAAU,MAAM,OAAO;AAClE,SACC,uBAAuB,UACvB,gBAAgB,OAAO,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"../global-styles/color-panel.mjs";
15
15
  import { TypographyToolsPanel } from "../global-styles/typography-panel.mjs";
16
16
  import { BackgroundToolsPanel } from "../global-styles/background-panel.mjs";
17
17
  import { Fragment, jsx, jsxs } from "react/jsx-runtime";
18
- function SectionStyleControls({ blockName, clientId, contentClientIds }) {
18
+ function SectionStyleControls({
19
+ blockName,
20
+ clientId,
21
+ contentClientIds
22
+ }) {
19
23
  const settings = useBlockSettings(blockName);
20
24
  const { updateBlockAttributes } = useDispatch(blockEditorStore);
21
25
  const { hasButtons, hasHeading } = useSelect(
@@ -165,6 +169,7 @@ var StylesTab = ({
165
169
  };
166
170
  var styles_tab_default = StylesTab;
167
171
  export {
172
+ SectionStyleControls,
168
173
  styles_tab_default as default
169
174
  };
170
175
  //# sourceMappingURL=styles-tab.mjs.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/inspector-controls-tabs/styles-tab.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockStyles from '../block-styles';\nimport InspectorControls from '../inspector-controls';\nimport PositionControls from './position-controls-panel';\nimport { useBorderPanelLabel } from '../../hooks/border';\nimport { useBlockSettings } from '../../hooks/utils';\nimport { store as blockEditorStore } from '../../store';\nimport { ElementsEdit } from '../../hooks/elements';\nimport { TypographyPanel } from '../../hooks/typography';\nimport { BackgroundImagePanel } from '../../hooks/background';\nimport { ColorToolsPanel } from '../global-styles/color-panel';\nimport { TypographyToolsPanel } from '../global-styles/typography-panel';\nimport { BackgroundToolsPanel } from '../global-styles/background-panel';\n\n// Section blocks present a curated subset of the normal block style panels.\n// Their block-support fills are gated off by editing mode (see\n// `BlockStyleControls` in hooks/style.js), so each panel is direct-rendered\n// here rather than via the inspector slots, with settings restricted to the\n// supports a section should expose:\n// - Typography: text color only (font controls disabled).\n// - Background: color + gradient only (image controls disabled).\n// - Elements: link/heading/button/caption colors (unchanged).\nfunction SectionStyleControls( { blockName, clientId, contentClientIds } ) {\n\tconst settings = useBlockSettings( blockName );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tconst { hasButtons, hasHeading } = useSelect(\n\t\t( select ) => {\n\t\t\tconst blockNames =\n\t\t\t\tselect( blockEditorStore ).getBlockNamesByClientId(\n\t\t\t\t\tcontentClientIds\n\t\t\t\t);\n\t\t\treturn {\n\t\t\t\thasButtons: blockNames.includes( 'core/buttons' ),\n\t\t\t\thasHeading: blockNames.includes( 'core/heading' ),\n\t\t\t};\n\t\t},\n\t\t[ contentClientIds ]\n\t);\n\n\tconst setAttributes = ( newAttributes ) => {\n\t\tupdateBlockAttributes( clientId, newAttributes );\n\t};\n\n\tconst typographySettings = useMemo(\n\t\t() => ( { ...settings, typography: {} } ),\n\t\t[ settings ]\n\t);\n\tconst backgroundSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tbackground: {\n\t\t\t\t...settings.background,\n\t\t\t\tbackgroundImage: false,\n\t\t\t\tbackgroundSize: false,\n\t\t\t},\n\t\t} ),\n\t\t[ settings ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TypographyPanel\n\t\t\t\tclientId={ clientId }\n\t\t\t\tname={ blockName }\n\t\t\t\tsettings={ typographySettings }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tasWrapper={ TypographyToolsPanel }\n\t\t\t/>\n\t\t\t<BackgroundImagePanel\n\t\t\t\tclientId={ clientId }\n\t\t\t\tname={ blockName }\n\t\t\t\tsettings={ backgroundSettings }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tasWrapper={ BackgroundToolsPanel }\n\t\t\t/>\n\t\t\t<ElementsEdit\n\t\t\t\tclientId={ clientId }\n\t\t\t\tname={ blockName }\n\t\t\t\tsettings={ settings }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tasWrapper={ ColorToolsPanel }\n\t\t\t\tlabel={ __( 'Elements' ) }\n\t\t\t\tdefaultControls={ {\n\t\t\t\t\tbutton: hasButtons,\n\t\t\t\t\theading: hasHeading,\n\t\t\t\t} }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst StylesTab = ( {\n\tblockName,\n\tclientId,\n\thasBlockStyles,\n\tisSectionBlock,\n\tcontentClientIds,\n} ) => {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\n\treturn (\n\t\t<>\n\t\t\t{ hasBlockStyles && <BlockStyles clientId={ clientId } /> }\n\t\t\t{ isSectionBlock && blockName !== 'core/template-part' && (\n\t\t\t\t<SectionStyleControls\n\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{\n\t\t\t\t// Extenders have in the past always been allowed to add controls to group\n\t\t\t\t// the restrictions are lessened for that block. Template parts are\n\t\t\t\t// excluded from the curated section controls above and fall through\n\t\t\t\t// to the full panel set here.\n\t\t\t }\n\t\t\t{ ( ! isSectionBlock || blockName === 'core/template-part' ) && (\n\t\t\t\t<>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"typography\"\n\t\t\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"color\"\n\t\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"background\"\n\t\t\t\t\t\tlabel={ __( 'Background' ) }\n\t\t\t\t\t\tclassName=\"background-block-support-panel__inner-wrapper\"\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot group=\"filter\" />\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"layout\"\n\t\t\t\t\t\tlabel={ __( 'Layout' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"dimensions\"\n\t\t\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"border\"\n\t\t\t\t\t\tlabel={ borderPanelLabel }\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"elements\"\n\t\t\t\t\t\tlabel={ __( 'Elements' ) }\n\t\t\t\t\t\tclassName=\"elements-block-support-panel__inner-wrapper\"\n\t\t\t\t\t/>\n\t\t\t\t\t<PositionControls />\n\t\t\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default StylesTab;\n"],
5
- "mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,aAAa,iBAAiB;AACvC,SAAS,eAAe;AAKxB,OAAO,iBAAiB;AACxB,OAAO,uBAAuB;AAC9B,OAAO,sBAAsB;AAC7B,SAAS,2BAA2B;AACpC,SAAS,wBAAwB;AACjC,SAAS,SAAS,wBAAwB;AAC1C,SAAS,oBAAoB;AAC7B,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,uBAAuB;AAChC,SAAS,4BAA4B;AACrC,SAAS,4BAA4B;AAiDnC,mBACC,KADD;AAvCF,SAAS,qBAAsB,EAAE,WAAW,UAAU,iBAAiB,GAAI;AAC1E,QAAM,WAAW,iBAAkB,SAAU;AAC7C,QAAM,EAAE,sBAAsB,IAAI,YAAa,gBAAiB;AAEhE,QAAM,EAAE,YAAY,WAAW,IAAI;AAAA,IAClC,CAAE,WAAY;AACb,YAAM,aACL,OAAQ,gBAAiB,EAAE;AAAA,QAC1B;AAAA,MACD;AACD,aAAO;AAAA,QACN,YAAY,WAAW,SAAU,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;AAAA;AAAA,IACD;AAAA,KAQG,CAAE,kBAAkB,cAAc,yBACrC,iCACC;AAAA;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACA,OAAM;AAAA,UACN,OAAQ,GAAI,YAAa;AAAA;AAAA,MAC1B;AAAA,MACA;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACA,OAAM;AAAA,UACN,OAAQ,GAAI,OAAQ;AAAA,UACpB,WAAU;AAAA;AAAA,MACX;AAAA,MACA;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACA,OAAM;AAAA,UACN,OAAQ,GAAI,YAAa;AAAA,UACzB,WAAU;AAAA;AAAA,MACX;AAAA,MACA,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,UAAS;AAAA,MACvC;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACA,OAAM;AAAA,UACN,OAAQ,GAAI,QAAS;AAAA;AAAA,MACtB;AAAA,MACA;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACA,OAAM;AAAA,UACN,OAAQ,GAAI,YAAa;AAAA;AAAA,MAC1B;AAAA,MACA;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACA,OAAM;AAAA,UACN,OAAQ;AAAA;AAAA,MACT;AAAA,MACA;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACA,OAAM;AAAA,UACN,OAAQ,GAAI,UAAW;AAAA,UACvB,WAAU;AAAA;AAAA,MACX;AAAA,MACA,oBAAC,oBAAiB;AAAA,MAClB,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,UAAS;AAAA,OACxC;AAAA,KAEF;AAEF;AAEA,IAAO,qBAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { useDispatch, useSelect } from '@wordpress/data';\nimport { useMemo } from '@wordpress/element';\n\n/**\n * Internal dependencies\n */\nimport BlockStyles from '../block-styles';\nimport InspectorControls from '../inspector-controls';\nimport PositionControls from './position-controls-panel';\nimport { useBorderPanelLabel } from '../../hooks/border';\nimport { useBlockSettings } from '../../hooks/utils';\nimport { store as blockEditorStore } from '../../store';\nimport { ElementsEdit } from '../../hooks/elements';\nimport { TypographyPanel } from '../../hooks/typography';\nimport { BackgroundImagePanel } from '../../hooks/background';\nimport { ColorToolsPanel } from '../global-styles/color-panel';\nimport { TypographyToolsPanel } from '../global-styles/typography-panel';\nimport { BackgroundToolsPanel } from '../global-styles/background-panel';\n\n// Section blocks present a curated subset of the normal block style panels.\n// Their block-support fills are gated off by editing mode (see\n// `BlockStyleControls` in hooks/style.js), so each panel is direct-rendered\n// here rather than via the inspector slots, with settings restricted to the\n// supports a section should expose:\n// - Typography: text color only (font controls disabled).\n// - Background: color + gradient only (image controls disabled).\n// - Elements: link/heading/button/caption colors (unchanged).\nexport function SectionStyleControls( {\n\tblockName,\n\tclientId,\n\tcontentClientIds,\n} ) {\n\tconst settings = useBlockSettings( blockName );\n\tconst { updateBlockAttributes } = useDispatch( blockEditorStore );\n\n\tconst { hasButtons, hasHeading } = useSelect(\n\t\t( select ) => {\n\t\t\tconst blockNames =\n\t\t\t\tselect( blockEditorStore ).getBlockNamesByClientId(\n\t\t\t\t\tcontentClientIds\n\t\t\t\t);\n\t\t\treturn {\n\t\t\t\thasButtons: blockNames.includes( 'core/buttons' ),\n\t\t\t\thasHeading: blockNames.includes( 'core/heading' ),\n\t\t\t};\n\t\t},\n\t\t[ contentClientIds ]\n\t);\n\n\tconst setAttributes = ( newAttributes ) => {\n\t\tupdateBlockAttributes( clientId, newAttributes );\n\t};\n\n\tconst typographySettings = useMemo(\n\t\t() => ( { ...settings, typography: {} } ),\n\t\t[ settings ]\n\t);\n\tconst backgroundSettings = useMemo(\n\t\t() => ( {\n\t\t\t...settings,\n\t\t\tbackground: {\n\t\t\t\t...settings.background,\n\t\t\t\tbackgroundImage: false,\n\t\t\t\tbackgroundSize: false,\n\t\t\t},\n\t\t} ),\n\t\t[ settings ]\n\t);\n\n\treturn (\n\t\t<>\n\t\t\t<TypographyPanel\n\t\t\t\tclientId={ clientId }\n\t\t\t\tname={ blockName }\n\t\t\t\tsettings={ typographySettings }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tasWrapper={ TypographyToolsPanel }\n\t\t\t/>\n\t\t\t<BackgroundImagePanel\n\t\t\t\tclientId={ clientId }\n\t\t\t\tname={ blockName }\n\t\t\t\tsettings={ backgroundSettings }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tasWrapper={ BackgroundToolsPanel }\n\t\t\t/>\n\t\t\t<ElementsEdit\n\t\t\t\tclientId={ clientId }\n\t\t\t\tname={ blockName }\n\t\t\t\tsettings={ settings }\n\t\t\t\tsetAttributes={ setAttributes }\n\t\t\t\tasWrapper={ ColorToolsPanel }\n\t\t\t\tlabel={ __( 'Elements' ) }\n\t\t\t\tdefaultControls={ {\n\t\t\t\t\tbutton: hasButtons,\n\t\t\t\t\theading: hasHeading,\n\t\t\t\t} }\n\t\t\t/>\n\t\t</>\n\t);\n}\n\nconst StylesTab = ( {\n\tblockName,\n\tclientId,\n\thasBlockStyles,\n\tisSectionBlock,\n\tcontentClientIds,\n} ) => {\n\tconst borderPanelLabel = useBorderPanelLabel( { blockName } );\n\n\treturn (\n\t\t<>\n\t\t\t{ hasBlockStyles && <BlockStyles clientId={ clientId } /> }\n\t\t\t{ isSectionBlock && blockName !== 'core/template-part' && (\n\t\t\t\t<SectionStyleControls\n\t\t\t\t\tblockName={ blockName }\n\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\tcontentClientIds={ contentClientIds }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{\n\t\t\t\t// Extenders have in the past always been allowed to add controls to group\n\t\t\t\t// the restrictions are lessened for that block. Template parts are\n\t\t\t\t// excluded from the curated section controls above and fall through\n\t\t\t\t// to the full panel set here.\n\t\t\t }\n\t\t\t{ ( ! isSectionBlock || blockName === 'core/template-part' ) && (\n\t\t\t\t<>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"typography\"\n\t\t\t\t\t\tlabel={ __( 'Typography' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"color\"\n\t\t\t\t\t\tlabel={ __( 'Color' ) }\n\t\t\t\t\t\tclassName=\"color-block-support-panel__inner-wrapper\"\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"background\"\n\t\t\t\t\t\tlabel={ __( 'Background' ) }\n\t\t\t\t\t\tclassName=\"background-block-support-panel__inner-wrapper\"\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot group=\"filter\" />\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"layout\"\n\t\t\t\t\t\tlabel={ __( 'Layout' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"dimensions\"\n\t\t\t\t\t\tlabel={ __( 'Dimensions' ) }\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"border\"\n\t\t\t\t\t\tlabel={ borderPanelLabel }\n\t\t\t\t\t/>\n\t\t\t\t\t<InspectorControls.Slot\n\t\t\t\t\t\tgroup=\"elements\"\n\t\t\t\t\t\tlabel={ __( 'Elements' ) }\n\t\t\t\t\t\tclassName=\"elements-block-support-panel__inner-wrapper\"\n\t\t\t\t\t/>\n\t\t\t\t\t<PositionControls />\n\t\t\t\t\t<InspectorControls.Slot group=\"styles\" />\n\t\t\t\t</>\n\t\t\t) }\n\t\t</>\n\t);\n};\n\nexport default StylesTab;\n"],
5
+ "mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,aAAa,iBAAiB;AACvC,SAAS,eAAe;AAKxB,OAAO,iBAAiB;AACxB,OAAO,uBAAuB;AAC9B,OAAO,sBAAsB;AAC7B,SAAS,2BAA2B;AACp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AAlB;AAAA,UACA,OAAM;AAAA,UACN,OAAQ;AAAA;AAAA,MACT;AAAA,MACA;AAAA,QAAC,kBAAkB;AAAA,QAAlB;AAAA,UACA,OAAM;AAAA,UACN,OAAQ,GAAI,UAAW;AAAA,UACvB,WAAU;AAAA;AAAA,MACX;AAAA,MACA,oBAAC,oBAAiB;AAAA,MAClB,oBAAC,kBAAkB,MAAlB,EAAuB,OAAM,UAAS;AAAA,OACxC;AAAA,KAEF;AAEF;AAEA,IAAO,qBAAQ;",
6
6
  "names": []
7
7
  }
@@ -64,12 +64,12 @@ var LineHeightControl = ({
64
64
  return /* @__PURE__ */ jsx("div", { className: "block-editor-line-height-control", children: /* @__PURE__ */ jsx(
65
65
  NumberControl,
66
66
  {
67
+ placeholder: BASE_DEFAULT_VALUE,
67
68
  ...otherProps,
68
69
  __unstableInputWidth,
69
70
  __unstableStateReducer: stateReducer,
70
71
  onChange: handleOnChange,
71
72
  label: __("Line height"),
72
- placeholder: BASE_DEFAULT_VALUE,
73
73
  step: STEP,
74
74
  spinFactor: SPIN_FACTOR,
75
75
  value,
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/line-height-control/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalNumberControl as NumberControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBASE_DEFAULT_VALUE,\n\tRESET_VALUE,\n\tSTEP,\n\tSPIN_FACTOR,\n\tisLineHeightDefined,\n} from './utils';\n\nconst LineHeightControl = ( {\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @deprecated Default behavior since WordPress 7.1. Prop can be safely removed.\n\t */\n\t__next40pxDefaultSize: _next40pxDefaultSize,\n\tvalue: lineHeight,\n\tonChange,\n\t__unstableInputWidth = '60px',\n\t...otherProps\n} ) => {\n\tconst isDefined = isLineHeightDefined( lineHeight );\n\n\tconst adjustNextValue = ( nextValue, wasTypedOrPasted ) => {\n\t\t// Set the next value without modification if lineHeight has been defined.\n\t\tif ( isDefined ) {\n\t\t\treturn nextValue;\n\t\t}\n\n\t\t/**\n\t\t * The following logic handles the initial spin up/down action\n\t\t * (from an undefined value state) so that the next values are better suited for\n\t\t * line-height rendering. For example, the first spin up should immediately\n\t\t * go to 1.6, rather than the normally expected 0.1.\n\t\t *\n\t\t * Spin up/down actions can be triggered by keydowns of the up/down arrow keys,\n\t\t * dragging the input or by clicking the spin buttons.\n\t\t */\n\t\tconst spin = STEP * SPIN_FACTOR;\n\t\tswitch ( `${ nextValue }` ) {\n\t\t\tcase `${ spin }`:\n\t\t\t\t// Increment by spin value.\n\t\t\t\treturn BASE_DEFAULT_VALUE + spin;\n\t\t\tcase '0': {\n\t\t\t\t// This means the user explicitly input '0', rather than using the\n\t\t\t\t// spin down action from an undefined value state.\n\t\t\t\tif ( wasTypedOrPasted ) {\n\t\t\t\t\treturn nextValue;\n\t\t\t\t}\n\t\t\t\t// Decrement by spin value.\n\t\t\t\treturn BASE_DEFAULT_VALUE - spin;\n\t\t\t}\n\t\t\tcase '':\n\t\t\t\treturn BASE_DEFAULT_VALUE;\n\t\t\tdefault:\n\t\t\t\treturn nextValue;\n\t\t}\n\t};\n\n\tconst stateReducer = ( state, action ) => {\n\t\t// Be careful when changing this — cross-browser behavior of the\n\t\t// `inputType` field in `input` events are inconsistent.\n\t\t// For example, Firefox emits an input event with inputType=\"insertReplacementText\"\n\t\t// on spin button clicks, while other browsers do not even emit an input event.\n\t\tconst wasTypedOrPasted = [ 'insertText', 'insertFromPaste' ].includes(\n\t\t\taction.payload.event.nativeEvent?.inputType\n\t\t);\n\t\tconst value = adjustNextValue( state.value, wasTypedOrPasted );\n\t\treturn { ...state, value };\n\t};\n\n\tconst value = isDefined ? lineHeight : RESET_VALUE;\n\n\tconst handleOnChange = ( nextValue, { event } ) => {\n\t\tif ( nextValue === '' ) {\n\t\t\tonChange();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.type === 'click' ) {\n\t\t\tonChange( adjustNextValue( `${ nextValue }`, false ) );\n\t\t\treturn;\n\t\t}\n\n\t\tonChange( `${ nextValue }` );\n\t};\n\n\treturn (\n\t\t<div className=\"block-editor-line-height-control\">\n\t\t\t<NumberControl\n\t\t\t\t{ ...otherProps }\n\t\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\t\t__unstableStateReducer={ stateReducer }\n\t\t\t\tonChange={ handleOnChange }\n\t\t\t\tlabel={ __( 'Line height' ) }\n\t\t\t\tplaceholder={ BASE_DEFAULT_VALUE }\n\t\t\t\tstep={ STEP }\n\t\t\t\tspinFactor={ SPIN_FACTOR }\n\t\t\t\tvalue={ value }\n\t\t\t\tmin={ 0 }\n\t\t\t\tspinControls=\"custom\"\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/line-height-control/README.md\n */\nexport default LineHeightControl;\n"],
5
- "mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,+BAA+B,qBAAqB;AAK7D;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAkFJ;AAhFH,IAAM,oBAAoB,CAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3B,uBAAuB;AAAA,EACvB,OAAO;AAAA,EACP;AAAA,EACA,uBAAuB;AAAA,EACvB,GAAG;AACJ,MAAO;AACN,QAAM,YAAY,oBAAqB,UAAW;AAElD,QAAM,kBAAkB,CAAE,WAAW,qBAAsB;AAE1D,QAAK,WAAY;AAChB,aAAO;AAAA,IACR;AAWA,UAAM,OAAO,OAAO;AACpB,YAAS,GAAI,SAAU,IAAK;AAAA,MAC3B,KAAK,GAAI,IAAK;AAEb,eAAO,qBAAqB;AAAA,MAC7B,KAAK,KAAK;AAGT,YAAK,kBAAmB;AACvB,iBAAO;AAAA,QACR;AAEA,eAAO,qBAAqB;AAAA,MAC7B;AAAA,MACA,KAAK;AACJ,eAAO;AAAA,MACR;AACC,eAAO;AAAA,IACT;AAAA,EACD;AAEA,QAAM,eAAe,CAAE,OAAO,WAAY;AAKzC,UAAM,mBAAmB,CAAE,cAAc,iBAAkB,EAAE;AAAA,MAC5D,OAAO,QAAQ,MAAM,aAAa;AAAA,IACnC;AACA,UAAMA,SAAQ,gBAAiB,MAAM,OAAO,gBAAiB;AAC7D,WAAO,EAAE,GAAG,OAAO,OAAAA,OAAM;AAAA,EAC1B;AAEA,QAAM,QAAQ,YAAY,aAAa;AAEvC,QAAM,iBAAiB,CAAE,WAAW,EAAE,MAAM,MAAO;AAClD,QAAK,cAAc,IAAK;AACvB,eAAS;AACT;AAAA,IACD;AAEA,QAAK,MAAM,SAAS,SAAU;AAC7B,eAAU,gBAAiB,GAAI,SAAU,IAAI,KAAM,CAAE;AACrD;AAAA,IACD;AAEA,aAAU,GAAI,SAAU,EAAG;AAAA,EAC5B;AAEA,SACC,oBAAC,SAAI,WAAU,oCACd;AAAA,IAAC;AAAA;AAAA,MACE,GAAG;AAAA,MACL;AAAA,MACA,wBAAyB;AAAA,MACzB,UAAW;AAAA,MACX,OAAQ,GAAI,aAAc;AAAA,MAC1B,aAAc;AAAA,MACd,MAAO;AAAA,MACP,YAAa;AAAA,MACb;AAAA,MACA,KAAM;AAAA,MACN,cAAa;AAAA;AAAA,EACd,GACD;AAEF;AAKA,IAAO,8BAAQ;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\nimport { __experimentalNumberControl as NumberControl } from '@wordpress/components';\n\n/**\n * Internal dependencies\n */\nimport {\n\tBASE_DEFAULT_VALUE,\n\tRESET_VALUE,\n\tSTEP,\n\tSPIN_FACTOR,\n\tisLineHeightDefined,\n} from './utils';\n\nconst LineHeightControl = ( {\n\t/**\n\t * Start opting into the larger default height that will become the default size in a future version.\n\t *\n\t * @deprecated Default behavior since WordPress 7.1. Prop can be safely removed.\n\t */\n\t__next40pxDefaultSize: _next40pxDefaultSize,\n\tvalue: lineHeight,\n\tonChange,\n\t__unstableInputWidth = '60px',\n\t...otherProps\n} ) => {\n\tconst isDefined = isLineHeightDefined( lineHeight );\n\n\tconst adjustNextValue = ( nextValue, wasTypedOrPasted ) => {\n\t\t// Set the next value without modification if lineHeight has been defined.\n\t\tif ( isDefined ) {\n\t\t\treturn nextValue;\n\t\t}\n\n\t\t/**\n\t\t * The following logic handles the initial spin up/down action\n\t\t * (from an undefined value state) so that the next values are better suited for\n\t\t * line-height rendering. For example, the first spin up should immediately\n\t\t * go to 1.6, rather than the normally expected 0.1.\n\t\t *\n\t\t * Spin up/down actions can be triggered by keydowns of the up/down arrow keys,\n\t\t * dragging the input or by clicking the spin buttons.\n\t\t */\n\t\tconst spin = STEP * SPIN_FACTOR;\n\t\tswitch ( `${ nextValue }` ) {\n\t\t\tcase `${ spin }`:\n\t\t\t\t// Increment by spin value.\n\t\t\t\treturn BASE_DEFAULT_VALUE + spin;\n\t\t\tcase '0': {\n\t\t\t\t// This means the user explicitly input '0', rather than using the\n\t\t\t\t// spin down action from an undefined value state.\n\t\t\t\tif ( wasTypedOrPasted ) {\n\t\t\t\t\treturn nextValue;\n\t\t\t\t}\n\t\t\t\t// Decrement by spin value.\n\t\t\t\treturn BASE_DEFAULT_VALUE - spin;\n\t\t\t}\n\t\t\tcase '':\n\t\t\t\treturn BASE_DEFAULT_VALUE;\n\t\t\tdefault:\n\t\t\t\treturn nextValue;\n\t\t}\n\t};\n\n\tconst stateReducer = ( state, action ) => {\n\t\t// Be careful when changing this — cross-browser behavior of the\n\t\t// `inputType` field in `input` events are inconsistent.\n\t\t// For example, Firefox emits an input event with inputType=\"insertReplacementText\"\n\t\t// on spin button clicks, while other browsers do not even emit an input event.\n\t\tconst wasTypedOrPasted = [ 'insertText', 'insertFromPaste' ].includes(\n\t\t\taction.payload.event.nativeEvent?.inputType\n\t\t);\n\t\tconst value = adjustNextValue( state.value, wasTypedOrPasted );\n\t\treturn { ...state, value };\n\t};\n\n\tconst value = isDefined ? lineHeight : RESET_VALUE;\n\n\tconst handleOnChange = ( nextValue, { event } ) => {\n\t\tif ( nextValue === '' ) {\n\t\t\tonChange();\n\t\t\treturn;\n\t\t}\n\n\t\tif ( event.type === 'click' ) {\n\t\t\tonChange( adjustNextValue( `${ nextValue }`, false ) );\n\t\t\treturn;\n\t\t}\n\n\t\tonChange( `${ nextValue }` );\n\t};\n\n\treturn (\n\t\t<div className=\"block-editor-line-height-control\">\n\t\t\t<NumberControl\n\t\t\t\tplaceholder={ BASE_DEFAULT_VALUE }\n\t\t\t\t{ ...otherProps }\n\t\t\t\t__unstableInputWidth={ __unstableInputWidth }\n\t\t\t\t__unstableStateReducer={ stateReducer }\n\t\t\t\tonChange={ handleOnChange }\n\t\t\t\tlabel={ __( 'Line height' ) }\n\t\t\t\tstep={ STEP }\n\t\t\t\tspinFactor={ SPIN_FACTOR }\n\t\t\t\tvalue={ value }\n\t\t\t\tmin={ 0 }\n\t\t\t\tspinControls=\"custom\"\n\t\t\t/>\n\t\t</div>\n\t);\n};\n\n/**\n * @see https://github.com/WordPress/gutenberg/blob/HEAD/packages/block-editor/src/components/line-height-control/README.md\n */\nexport default LineHeightControl;\n"],
5
+ "mappings": ";AAGA,SAAS,UAAU;AACnB,SAAS,+BAA+B,qBAAqB;AAK7D;AAAA,EACC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACM;AAkFJ;AAhFH,IAAM,oBAAoB,CAAE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAM3B,uBAAuB;AAAA,EACvB,OAAO;AAAA,EACP;AAAA,EACA,uBAAuB;AAAA,EACvB,GAAG;AACJ,MAAO;AACN,QAAM,YAAY,oBAAqB,UAAW;AAElD,QAAM,kBAAkB,CAAE,WAAW,qBAAsB;AAE1D,QAAK,WAAY;AAChB,aAAO;AAAA,IACR;AAWA,UAAM,OAAO,OAAO;AACpB,YAAS,GAAI,SAAU,IAAK;AAAA,MAC3B,KAAK,GAAI,IAAK;AAEb,eAAO,qBAAqB;AAAA,MAC7B,KAAK,KAAK;AAGT,YAAK,kBAAmB;AACvB,iBAAO;AAAA,QACR;AAEA,eAAO,qBAAqB;AAAA,MAC7B;AAAA,MACA,KAAK;AACJ,eAAO;AAAA,MACR;AACC,eAAO;AAAA,IACT;AAAA,EACD;AAEA,QAAM,eAAe,CAAE,OAAO,WAAY;AAKzC,UAAM,mBAAmB,CAAE,cAAc,iBAAkB,EAAE;AAAA,MAC5D,OAAO,QAAQ,MAAM,aAAa;AAAA,IACnC;AACA,UAAMA,SAAQ,gBAAiB,MAAM,OAAO,gBAAiB;AAC7D,WAAO,EAAE,GAAG,OAAO,OAAAA,OAAM;AAAA,EAC1B;AAEA,QAAM,QAAQ,YAAY,aAAa;AAEvC,QAAM,iBAAiB,CAAE,WAAW,EAAE,MAAM,MAAO;AAClD,QAAK,cAAc,IAAK;AACvB,eAAS;AACT;AAAA,IACD;AAEA,QAAK,MAAM,SAAS,SAAU;AAC7B,eAAU,gBAAiB,GAAI,SAAU,IAAI,KAAM,CAAE;AACrD;AAAA,IACD;AAEA,aAAU,GAAI,SAAU,EAAG;AAAA,EAC5B;AAEA,SACC,oBAAC,SAAI,WAAU,oCACd;AAAA,IAAC;AAAA;AAAA,MACA,aAAc;AAAA,MACZ,GAAG;AAAA,MACL;AAAA,MACA,wBAAyB;AAAA,MACzB,UAAW;AAAA,MACX,OAAQ,GAAI,aAAc;AAAA,MAC1B,MAAO;AAAA,MACP,YAAa;AAAA,MACb;AAAA,MACA,KAAM;AAAA,MACN,cAAa;AAAA;AAAA,EACd,GACD;AAEF;AAKA,IAAO,8BAAQ;",
6
6
  "names": ["value"]
7
7
  }
@@ -10,7 +10,7 @@ import {
10
10
  } from "@wordpress/components";
11
11
  import { __, sprintf } from "@wordpress/i18n";
12
12
  import { useRef, useState, useEffect, useMemo } from "@wordpress/element";
13
- import { useInstanceId } from "@wordpress/compose";
13
+ import { useInstanceId, useMergeRefs } from "@wordpress/compose";
14
14
  import { focus } from "@wordpress/dom";
15
15
  import { ENTER } from "@wordpress/keycodes";
16
16
  import { isShallowEqualObjects } from "@wordpress/is-shallow-equal";
@@ -19,6 +19,7 @@ import { store as preferencesStore } from "@wordpress/preferences";
19
19
  import { keyboardReturn, linkOff } from "@wordpress/icons";
20
20
  import deprecated from "@wordpress/deprecated";
21
21
  import { isURL, prependHTTPS } from "@wordpress/url";
22
+ import { useNativeUndo } from "../../utils/native-undo.mjs";
22
23
  import LinkControlSettingsDrawer from "./settings-drawer.mjs";
23
24
  import LinkControlSearchInput from "./search-input.mjs";
24
25
  import LinkPreview from "./link-preview.mjs";
@@ -78,6 +79,7 @@ function LinkControl({
78
79
  const isSettingsOpen = advancedSettingsPreference || settingsOpen;
79
80
  const isMountingRef = useRef(true);
80
81
  const wrapperNode = useRef();
82
+ const wrapperRef = useMergeRefs([wrapperNode, useNativeUndo()]);
81
83
  const textInputRef = useRef();
82
84
  const searchInputRef = useRef();
83
85
  const entityUrlFallbackRef = useRef();
@@ -302,7 +304,7 @@ function LinkControl({
302
304
  "div",
303
305
  {
304
306
  tabIndex: -1,
305
- ref: wrapperNode,
307
+ ref: wrapperRef,
306
308
  className: "block-editor-link-control",
307
309
  children: [
308
310
  isCreatingPage && /* @__PURE__ */ jsxs("div", { className: "block-editor-link-control__loading", children: [