@wordpress/block-editor 16.0.1-next.v.202607070741.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 (679) hide show
  1. package/CHANGELOG.md +27 -1
  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-canvas/index.cjs +6 -1
  10. package/build/components/block-canvas/index.cjs.map +2 -2
  11. package/build/components/block-controls/groups.cjs +3 -1
  12. package/build/components/block-controls/groups.cjs.map +2 -2
  13. package/build/components/block-edit/edit.cjs +10 -18
  14. package/build/components/block-edit/edit.cjs.map +2 -2
  15. package/build/components/block-inspector/index.cjs +73 -46
  16. package/build/components/block-inspector/index.cjs.map +2 -2
  17. package/build/components/block-list/block-html.cjs +4 -1
  18. package/build/components/block-list/block-html.cjs.map +2 -2
  19. package/build/components/block-list/block.cjs +9 -3
  20. package/build/components/block-list/block.cjs.map +3 -3
  21. package/build/components/block-list/index.cjs +1 -3
  22. package/build/components/block-list/index.cjs.map +2 -2
  23. package/build/components/block-list/use-block-props/index.cjs +7 -2
  24. package/build/components/block-list/use-block-props/index.cjs.map +2 -2
  25. package/build/components/block-list/use-block-props/use-focus-first-element.cjs +9 -4
  26. package/build/components/block-list/use-block-props/use-focus-first-element.cjs.map +2 -2
  27. package/build/components/block-list/use-block-props/use-focus-handler.cjs +11 -4
  28. package/build/components/block-list/use-block-props/use-focus-handler.cjs.map +2 -2
  29. package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs +48 -0
  30. package/build/components/block-list/use-block-props/use-register-block-event-handlers.cjs.map +7 -0
  31. package/build/components/block-parent-selector/index.cjs +2 -2
  32. package/build/components/block-parent-selector/index.cjs.map +2 -2
  33. package/build/components/block-toolbar/index.cjs +43 -24
  34. package/build/components/block-toolbar/index.cjs.map +2 -2
  35. package/build/components/block-toolbar/switch-section-style.cjs +4 -2
  36. package/build/components/block-toolbar/switch-section-style.cjs.map +3 -3
  37. package/build/components/block-tools/empty-block-inserter.cjs +2 -7
  38. package/build/components/block-tools/empty-block-inserter.cjs.map +2 -2
  39. package/build/components/block-tools/index.cjs +7 -2
  40. package/build/components/block-tools/index.cjs.map +2 -2
  41. package/build/components/block-vertical-alignment-control/ui.cjs +3 -5
  42. package/build/components/block-vertical-alignment-control/ui.cjs.map +2 -2
  43. package/build/components/block-visibility/modal.cjs +20 -6
  44. package/build/components/block-visibility/modal.cjs.map +2 -2
  45. package/build/components/block-visibility/use-block-visibility.cjs +16 -6
  46. package/build/components/block-visibility/use-block-visibility.cjs.map +3 -3
  47. package/build/components/block-visibility/utils.cjs +15 -2
  48. package/build/components/block-visibility/utils.cjs.map +3 -3
  49. package/build/components/block-visibility/viewport-menu-item.cjs +7 -1
  50. package/build/components/block-visibility/viewport-menu-item.cjs.map +2 -2
  51. package/build/components/block-visibility/viewport-toolbar.cjs +5 -0
  52. package/build/components/block-visibility/viewport-toolbar.cjs.map +2 -2
  53. package/build/components/block-visibility/viewport-visibility-info.cjs +5 -1
  54. package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
  55. package/build/components/border-radius-control/utils.cjs +8 -58
  56. package/build/components/border-radius-control/utils.cjs.map +2 -2
  57. package/build/components/child-layout-control/index.cjs +0 -4
  58. package/build/components/child-layout-control/index.cjs.map +2 -2
  59. package/build/components/colors-gradients/control.cjs +5 -3
  60. package/build/components/colors-gradients/control.cjs.map +2 -2
  61. package/build/components/dimension-control/index.cjs +30 -20
  62. package/build/components/dimension-control/index.cjs.map +3 -3
  63. package/build/components/dimensions-tool/aspect-ratio-tool.cjs +9 -2
  64. package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
  65. package/build/components/editor-styles/index.cjs +9 -1
  66. package/build/components/editor-styles/index.cjs.map +2 -2
  67. package/build/components/global-styles/background-panel.cjs +66 -25
  68. package/build/components/global-styles/background-panel.cjs.map +3 -3
  69. package/build/components/global-styles/border-panel.cjs +153 -55
  70. package/build/components/global-styles/border-panel.cjs.map +3 -3
  71. package/build/components/global-styles/color-gradient-dropdown-item.cjs +46 -14
  72. package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +3 -3
  73. package/build/components/global-styles/color-panel.cjs +63 -17
  74. package/build/components/global-styles/color-panel.cjs.map +2 -2
  75. package/build/components/global-styles/dimensions-panel.cjs +242 -64
  76. package/build/components/global-styles/dimensions-panel.cjs.map +3 -3
  77. package/build/components/global-styles/filters-panel.cjs +59 -20
  78. package/build/components/global-styles/filters-panel.cjs.map +3 -3
  79. package/build/components/global-styles/hooks.cjs +4 -1
  80. package/build/components/global-styles/hooks.cjs.map +2 -2
  81. package/build/components/global-styles/inheritance/index.cjs +142 -0
  82. package/build/components/global-styles/inheritance/index.cjs.map +7 -0
  83. package/build/components/global-styles/inherited-value-context.cjs +173 -0
  84. package/build/components/global-styles/inherited-value-context.cjs.map +7 -0
  85. package/build/components/global-styles/shadow-panel-components.cjs +38 -20
  86. package/build/components/global-styles/shadow-panel-components.cjs.map +2 -2
  87. package/build/components/global-styles/state-control-badges.cjs +39 -3
  88. package/build/components/global-styles/state-control-badges.cjs.map +2 -2
  89. package/build/components/global-styles/state-control.cjs +1 -1
  90. package/build/components/global-styles/state-control.cjs.map +2 -2
  91. package/build/components/global-styles/typography-panel.cjs +271 -79
  92. package/build/components/global-styles/typography-panel.cjs.map +3 -3
  93. package/build/components/image-size-control/index.cjs +2 -4
  94. package/build/components/image-size-control/index.cjs.map +2 -2
  95. package/build/components/inserter/media-tab/hooks.cjs +33 -6
  96. package/build/components/inserter/media-tab/hooks.cjs.map +2 -2
  97. package/build/components/inserter/media-tab/media-panel.cjs +78 -16
  98. package/build/components/inserter/media-tab/media-panel.cjs.map +3 -3
  99. package/build/components/inspector-controls-tabs/styles-tab.cjs +10 -1
  100. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  101. package/build/components/keyboard-shortcuts/index.cjs +19 -11
  102. package/build/components/keyboard-shortcuts/index.cjs.map +2 -2
  103. package/build/components/line-height-control/index.cjs +1 -2
  104. package/build/components/line-height-control/index.cjs.map +2 -2
  105. package/build/components/link-control/index.cjs +3 -1
  106. package/build/components/link-control/index.cjs.map +2 -2
  107. package/build/components/list-view/block.cjs +13 -4
  108. package/build/components/list-view/block.cjs.map +2 -2
  109. package/build/components/media-placeholder/index.cjs +0 -1
  110. package/build/components/media-placeholder/index.cjs.map +2 -2
  111. package/build/components/preset-input-control/index.cjs +2 -1
  112. package/build/components/preset-input-control/index.cjs.map +2 -2
  113. package/build/components/provider/block-refs-provider.cjs +8 -2
  114. package/build/components/provider/block-refs-provider.cjs.map +2 -2
  115. package/build/components/provider/index.cjs +1 -1
  116. package/build/components/provider/index.cjs.map +2 -2
  117. package/build/components/provider/use-block-sync.cjs +18 -6
  118. package/build/components/provider/use-block-sync.cjs.map +2 -2
  119. package/build/components/provider/use-media-upload-settings.cjs +3 -1
  120. package/build/components/provider/use-media-upload-settings.cjs.map +2 -2
  121. package/build/components/rich-text/event-listeners/before-input-rules.cjs +3 -4
  122. package/build/components/rich-text/event-listeners/before-input-rules.cjs.map +3 -3
  123. package/build/components/rich-text/event-listeners/delete.cjs +2 -3
  124. package/build/components/rich-text/event-listeners/delete.cjs.map +3 -3
  125. package/build/components/rich-text/event-listeners/enter.cjs +3 -2
  126. package/build/components/rich-text/event-listeners/enter.cjs.map +3 -3
  127. package/build/components/rich-text/event-listeners/input-events.cjs +3 -3
  128. package/build/components/rich-text/event-listeners/input-events.cjs.map +3 -3
  129. package/build/components/rich-text/event-listeners/input-rules.cjs +3 -4
  130. package/build/components/rich-text/event-listeners/input-rules.cjs.map +3 -3
  131. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs +3 -3
  132. package/build/components/rich-text/event-listeners/insert-replacement-text.cjs.map +3 -3
  133. package/build/components/rich-text/event-listeners/paste-handler.cjs +2 -1
  134. package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
  135. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs +3 -3
  136. package/build/components/rich-text/event-listeners/remove-browser-shortcuts.cjs.map +3 -3
  137. package/build/components/rich-text/event-listeners/shortcuts.cjs +3 -3
  138. package/build/components/rich-text/event-listeners/shortcuts.cjs.map +3 -3
  139. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs +3 -3
  140. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +3 -3
  141. package/build/components/rich-text/index.cjs +76 -17
  142. package/build/components/rich-text/index.cjs.map +2 -2
  143. package/build/components/spacing-sizes-control/utils.cjs +6 -19
  144. package/build/components/spacing-sizes-control/utils.cjs.map +2 -2
  145. package/build/components/text-indent-control/index.cjs +8 -2
  146. package/build/components/text-indent-control/index.cjs.map +2 -2
  147. package/build/components/typewriter/index.cjs +129 -136
  148. package/build/components/typewriter/index.cjs.map +3 -3
  149. package/build/components/url-input/index.cjs +303 -344
  150. package/build/components/url-input/index.cjs.map +3 -3
  151. package/build/components/use-block-commands/index.cjs +21 -17
  152. package/build/components/use-block-commands/index.cjs.map +2 -2
  153. package/build/components/use-on-block-drop/index.cjs +1 -1
  154. package/build/components/use-on-block-drop/index.cjs.map +2 -2
  155. package/build/components/writing-flow/index.cjs +14 -1
  156. package/build/components/writing-flow/index.cjs.map +3 -3
  157. package/build/components/writing-flow/use-arrow-nav.cjs +42 -6
  158. package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
  159. package/build/components/writing-flow/use-click-selection.cjs +29 -3
  160. package/build/components/writing-flow/use-click-selection.cjs.map +2 -2
  161. package/build/components/writing-flow/use-clipboard-handler.cjs +4 -1
  162. package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
  163. package/build/components/writing-flow/use-drag-selection.cjs +3 -8
  164. package/build/components/writing-flow/use-drag-selection.cjs.map +2 -2
  165. package/build/components/writing-flow/use-editable-root-event-handlers.cjs +179 -0
  166. package/build/components/writing-flow/use-editable-root-event-handlers.cjs.map +7 -0
  167. package/build/components/writing-flow/use-editable-root.cjs +75 -0
  168. package/build/components/writing-flow/use-editable-root.cjs.map +7 -0
  169. package/build/components/writing-flow/use-home-end.cjs +64 -0
  170. package/build/components/writing-flow/use-home-end.cjs.map +7 -0
  171. package/build/components/writing-flow/use-input.cjs +15 -5
  172. package/build/components/writing-flow/use-input.cjs.map +2 -2
  173. package/build/components/writing-flow/use-multi-selection.cjs +2 -2
  174. package/build/components/writing-flow/use-multi-selection.cjs.map +2 -2
  175. package/build/components/writing-flow/use-select-all.cjs +14 -2
  176. package/build/components/writing-flow/use-select-all.cjs.map +2 -2
  177. package/build/components/writing-flow/use-selection-observer.cjs +132 -22
  178. package/build/components/writing-flow/use-selection-observer.cjs.map +3 -3
  179. package/build/components/writing-flow/utils.cjs +28 -2
  180. package/build/components/writing-flow/utils.cjs.map +2 -2
  181. package/build/hooks/background.cjs +14 -10
  182. package/build/hooks/background.cjs.map +2 -2
  183. package/build/hooks/block-fields/rich-text/index.cjs +2 -3
  184. package/build/hooks/block-fields/rich-text/index.cjs.map +3 -3
  185. package/build/hooks/block-style-variation.cjs +4 -45
  186. package/build/hooks/block-style-variation.cjs.map +3 -3
  187. package/build/hooks/border.cjs +19 -4
  188. package/build/hooks/border.cjs.map +2 -2
  189. package/build/hooks/custom-css.cjs +6 -2
  190. package/build/hooks/custom-css.cjs.map +2 -2
  191. package/build/hooks/dimensions.cjs +15 -4
  192. package/build/hooks/dimensions.cjs.map +2 -2
  193. package/build/hooks/duotone.cjs +26 -14
  194. package/build/hooks/duotone.cjs.map +3 -3
  195. package/build/hooks/elements.cjs +15 -5
  196. package/build/hooks/elements.cjs.map +2 -2
  197. package/build/hooks/grid-visualizer.cjs +5 -3
  198. package/build/hooks/grid-visualizer.cjs.map +2 -2
  199. package/build/hooks/layout-child.cjs +22 -12
  200. package/build/hooks/layout-child.cjs.map +3 -3
  201. package/build/hooks/layout.cjs +28 -13
  202. package/build/hooks/layout.cjs.map +3 -3
  203. package/build/hooks/line-height.cjs +1 -2
  204. package/build/hooks/line-height.cjs.map +2 -2
  205. package/build/hooks/states.cjs +27 -7
  206. package/build/hooks/states.cjs.map +3 -3
  207. package/build/hooks/style.cjs +31 -9
  208. package/build/hooks/style.cjs.map +3 -3
  209. package/build/hooks/text-align.cjs +36 -6
  210. package/build/hooks/text-align.cjs.map +3 -3
  211. package/build/hooks/typography.cjs +14 -5
  212. package/build/hooks/typography.cjs.map +2 -2
  213. package/build/layouts/constrained.cjs +14 -6
  214. package/build/layouts/constrained.cjs.map +2 -2
  215. package/build/layouts/flex.cjs +27 -19
  216. package/build/layouts/flex.cjs.map +2 -2
  217. package/build/layouts/grid.cjs +0 -2
  218. package/build/layouts/grid.cjs.map +2 -2
  219. package/build/private-apis.cjs +9 -5
  220. package/build/private-apis.cjs.map +3 -3
  221. package/build/store/actions.cjs +11 -6
  222. package/build/store/actions.cjs.map +2 -2
  223. package/build/store/private-selectors.cjs +41 -3
  224. package/build/store/private-selectors.cjs.map +3 -3
  225. package/build/store/reducer.cjs +6 -6
  226. package/build/store/reducer.cjs.map +2 -2
  227. package/build/store/selectors.cjs +23 -0
  228. package/build/store/selectors.cjs.map +2 -2
  229. package/build/utils/block-bindings.cjs +29 -0
  230. package/build/utils/block-bindings.cjs.map +2 -2
  231. package/build/utils/dom.cjs +14 -0
  232. package/build/utils/dom.cjs.map +2 -2
  233. package/build/{components/rich-text/input-event.cjs → utils/native-undo.cjs} +29 -24
  234. package/build/utils/native-undo.cjs.map +7 -0
  235. package/build-module/components/alignment-control/ui.mjs +2 -4
  236. package/build-module/components/alignment-control/ui.mjs.map +2 -2
  237. package/build-module/components/background-image-control/index.mjs +43 -10
  238. package/build-module/components/background-image-control/index.mjs.map +2 -2
  239. package/build-module/components/block-alignment-control/ui.mjs +5 -3
  240. package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
  241. package/build-module/components/block-canvas/index.mjs +7 -2
  242. package/build-module/components/block-canvas/index.mjs.map +2 -2
  243. package/build-module/components/block-controls/groups.mjs +3 -1
  244. package/build-module/components/block-controls/groups.mjs.map +2 -2
  245. package/build-module/components/block-edit/edit.mjs +11 -18
  246. package/build-module/components/block-edit/edit.mjs.map +2 -2
  247. package/build-module/components/block-inspector/index.mjs +74 -46
  248. package/build-module/components/block-inspector/index.mjs.map +2 -2
  249. package/build-module/components/block-list/block-html.mjs +4 -1
  250. package/build-module/components/block-list/block-html.mjs.map +2 -2
  251. package/build-module/components/block-list/block.mjs +9 -3
  252. package/build-module/components/block-list/block.mjs.map +3 -3
  253. package/build-module/components/block-list/index.mjs +1 -3
  254. package/build-module/components/block-list/index.mjs.map +2 -2
  255. package/build-module/components/block-list/use-block-props/index.mjs +7 -2
  256. package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
  257. package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs +9 -4
  258. package/build-module/components/block-list/use-block-props/use-focus-first-element.mjs.map +2 -2
  259. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs +11 -4
  260. package/build-module/components/block-list/use-block-props/use-focus-handler.mjs.map +2 -2
  261. package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs +28 -0
  262. package/build-module/components/block-list/use-block-props/use-register-block-event-handlers.mjs.map +7 -0
  263. package/build-module/components/block-parent-selector/index.mjs +2 -2
  264. package/build-module/components/block-parent-selector/index.mjs.map +2 -2
  265. package/build-module/components/block-toolbar/index.mjs +43 -24
  266. package/build-module/components/block-toolbar/index.mjs.map +2 -2
  267. package/build-module/components/block-toolbar/switch-section-style.mjs +4 -2
  268. package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
  269. package/build-module/components/block-tools/empty-block-inserter.mjs +2 -7
  270. package/build-module/components/block-tools/empty-block-inserter.mjs.map +2 -2
  271. package/build-module/components/block-tools/index.mjs +7 -2
  272. package/build-module/components/block-tools/index.mjs.map +2 -2
  273. package/build-module/components/block-vertical-alignment-control/ui.mjs +4 -6
  274. package/build-module/components/block-vertical-alignment-control/ui.mjs.map +2 -2
  275. package/build-module/components/block-visibility/modal.mjs +22 -10
  276. package/build-module/components/block-visibility/modal.mjs.map +2 -2
  277. package/build-module/components/block-visibility/use-block-visibility.mjs +17 -7
  278. package/build-module/components/block-visibility/use-block-visibility.mjs.map +2 -2
  279. package/build-module/components/block-visibility/utils.mjs +18 -3
  280. package/build-module/components/block-visibility/utils.mjs.map +2 -2
  281. package/build-module/components/block-visibility/viewport-menu-item.mjs +7 -1
  282. package/build-module/components/block-visibility/viewport-menu-item.mjs.map +2 -2
  283. package/build-module/components/block-visibility/viewport-toolbar.mjs +5 -0
  284. package/build-module/components/block-visibility/viewport-toolbar.mjs.map +2 -2
  285. package/build-module/components/block-visibility/viewport-visibility-info.mjs +5 -1
  286. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
  287. package/build-module/components/border-radius-control/utils.mjs +11 -53
  288. package/build-module/components/border-radius-control/utils.mjs.map +2 -2
  289. package/build-module/components/child-layout-control/index.mjs +0 -4
  290. package/build-module/components/child-layout-control/index.mjs.map +2 -2
  291. package/build-module/components/colors-gradients/control.mjs +5 -3
  292. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  293. package/build-module/components/dimension-control/index.mjs +30 -20
  294. package/build-module/components/dimension-control/index.mjs.map +2 -2
  295. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +10 -6
  296. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
  297. package/build-module/components/editor-styles/index.mjs +9 -1
  298. package/build-module/components/editor-styles/index.mjs.map +2 -2
  299. package/build-module/components/global-styles/background-panel.mjs +71 -29
  300. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  301. package/build-module/components/global-styles/border-panel.mjs +157 -56
  302. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  303. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +51 -15
  304. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
  305. package/build-module/components/global-styles/color-panel.mjs +63 -17
  306. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  307. package/build-module/components/global-styles/dimensions-panel.mjs +248 -66
  308. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  309. package/build-module/components/global-styles/filters-panel.mjs +64 -21
  310. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  311. package/build-module/components/global-styles/hooks.mjs +4 -1
  312. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  313. package/build-module/components/global-styles/inheritance/index.mjs +108 -0
  314. package/build-module/components/global-styles/inheritance/index.mjs.map +7 -0
  315. package/build-module/components/global-styles/inherited-value-context.mjs +141 -0
  316. package/build-module/components/global-styles/inherited-value-context.mjs.map +7 -0
  317. package/build-module/components/global-styles/shadow-panel-components.mjs +38 -20
  318. package/build-module/components/global-styles/shadow-panel-components.mjs.map +2 -2
  319. package/build-module/components/global-styles/state-control-badges.mjs +41 -5
  320. package/build-module/components/global-styles/state-control-badges.mjs.map +2 -2
  321. package/build-module/components/global-styles/state-control.mjs +1 -1
  322. package/build-module/components/global-styles/state-control.mjs.map +2 -2
  323. package/build-module/components/global-styles/typography-panel.mjs +276 -80
  324. package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
  325. package/build-module/components/image-size-control/index.mjs +2 -4
  326. package/build-module/components/image-size-control/index.mjs.map +2 -2
  327. package/build-module/components/inserter/media-tab/hooks.mjs +33 -6
  328. package/build-module/components/inserter/media-tab/hooks.mjs.map +2 -2
  329. package/build-module/components/inserter/media-tab/media-panel.mjs +86 -18
  330. package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
  331. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +6 -1
  332. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  333. package/build-module/components/keyboard-shortcuts/index.mjs +19 -11
  334. package/build-module/components/keyboard-shortcuts/index.mjs.map +2 -2
  335. package/build-module/components/line-height-control/index.mjs +1 -2
  336. package/build-module/components/line-height-control/index.mjs.map +2 -2
  337. package/build-module/components/link-control/index.mjs +4 -2
  338. package/build-module/components/link-control/index.mjs.map +2 -2
  339. package/build-module/components/list-view/block.mjs +13 -4
  340. package/build-module/components/list-view/block.mjs.map +2 -2
  341. package/build-module/components/media-placeholder/index.mjs +0 -1
  342. package/build-module/components/media-placeholder/index.mjs.map +2 -2
  343. package/build-module/components/preset-input-control/index.mjs +2 -1
  344. package/build-module/components/preset-input-control/index.mjs.map +2 -2
  345. package/build-module/components/provider/block-refs-provider.mjs +8 -2
  346. package/build-module/components/provider/block-refs-provider.mjs.map +2 -2
  347. package/build-module/components/provider/index.mjs +1 -1
  348. package/build-module/components/provider/index.mjs.map +2 -2
  349. package/build-module/components/provider/use-block-sync.mjs +18 -6
  350. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  351. package/build-module/components/provider/use-media-upload-settings.mjs +3 -1
  352. package/build-module/components/provider/use-media-upload-settings.mjs.map +2 -2
  353. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs +8 -5
  354. package/build-module/components/rich-text/event-listeners/before-input-rules.mjs.map +2 -2
  355. package/build-module/components/rich-text/event-listeners/delete.mjs +7 -4
  356. package/build-module/components/rich-text/event-listeners/delete.mjs.map +2 -2
  357. package/build-module/components/rich-text/event-listeners/enter.mjs +8 -3
  358. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  359. package/build-module/components/rich-text/event-listeners/input-events.mjs +3 -3
  360. package/build-module/components/rich-text/event-listeners/input-events.mjs.map +2 -2
  361. package/build-module/components/rich-text/event-listeners/input-rules.mjs +8 -5
  362. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  363. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs +3 -3
  364. package/build-module/components/rich-text/event-listeners/insert-replacement-text.mjs.map +2 -2
  365. package/build-module/components/rich-text/event-listeners/paste-handler.mjs +8 -2
  366. package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
  367. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs +3 -3
  368. package/build-module/components/rich-text/event-listeners/remove-browser-shortcuts.mjs.map +2 -2
  369. package/build-module/components/rich-text/event-listeners/shortcuts.mjs +3 -3
  370. package/build-module/components/rich-text/event-listeners/shortcuts.mjs.map +2 -2
  371. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +3 -3
  372. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +2 -2
  373. package/build-module/components/rich-text/index.mjs +79 -14
  374. package/build-module/components/rich-text/index.mjs.map +2 -2
  375. package/build-module/components/spacing-sizes-control/utils.mjs +6 -18
  376. package/build-module/components/spacing-sizes-control/utils.mjs.map +2 -2
  377. package/build-module/components/text-indent-control/index.mjs +8 -2
  378. package/build-module/components/text-indent-control/index.mjs.map +2 -2
  379. package/build-module/components/typewriter/index.mjs +129 -136
  380. package/build-module/components/typewriter/index.mjs.map +2 -2
  381. package/build-module/components/url-input/index.mjs +306 -353
  382. package/build-module/components/url-input/index.mjs.map +2 -2
  383. package/build-module/components/use-block-commands/index.mjs +21 -17
  384. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  385. package/build-module/components/use-on-block-drop/index.mjs +2 -2
  386. package/build-module/components/use-on-block-drop/index.mjs.map +2 -2
  387. package/build-module/components/writing-flow/index.mjs +14 -1
  388. package/build-module/components/writing-flow/index.mjs.map +2 -2
  389. package/build-module/components/writing-flow/use-arrow-nav.mjs +43 -7
  390. package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
  391. package/build-module/components/writing-flow/use-click-selection.mjs +29 -3
  392. package/build-module/components/writing-flow/use-click-selection.mjs.map +2 -2
  393. package/build-module/components/writing-flow/use-clipboard-handler.mjs +5 -2
  394. package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
  395. package/build-module/components/writing-flow/use-drag-selection.mjs +1 -6
  396. package/build-module/components/writing-flow/use-drag-selection.mjs.map +2 -2
  397. package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs +154 -0
  398. package/build-module/components/writing-flow/use-editable-root-event-handlers.mjs.map +7 -0
  399. package/build-module/components/writing-flow/use-editable-root.mjs +54 -0
  400. package/build-module/components/writing-flow/use-editable-root.mjs.map +7 -0
  401. package/build-module/components/writing-flow/use-home-end.mjs +43 -0
  402. package/build-module/components/writing-flow/use-home-end.mjs.map +7 -0
  403. package/build-module/components/writing-flow/use-input.mjs +15 -5
  404. package/build-module/components/writing-flow/use-input.mjs.map +2 -2
  405. package/build-module/components/writing-flow/use-multi-selection.mjs +2 -2
  406. package/build-module/components/writing-flow/use-multi-selection.mjs.map +2 -2
  407. package/build-module/components/writing-flow/use-select-all.mjs +19 -3
  408. package/build-module/components/writing-flow/use-select-all.mjs.map +2 -2
  409. package/build-module/components/writing-flow/use-selection-observer.mjs +134 -21
  410. package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
  411. package/build-module/components/writing-flow/utils.mjs +26 -1
  412. package/build-module/components/writing-flow/utils.mjs.map +2 -2
  413. package/build-module/hooks/background.mjs +14 -10
  414. package/build-module/hooks/background.mjs.map +2 -2
  415. package/build-module/hooks/block-fields/rich-text/index.mjs +2 -6
  416. package/build-module/hooks/block-fields/rich-text/index.mjs.map +2 -2
  417. package/build-module/hooks/block-style-variation.mjs +8 -44
  418. package/build-module/hooks/block-style-variation.mjs.map +2 -2
  419. package/build-module/hooks/border.mjs +19 -4
  420. package/build-module/hooks/border.mjs.map +2 -2
  421. package/build-module/hooks/custom-css.mjs +7 -3
  422. package/build-module/hooks/custom-css.mjs.map +2 -2
  423. package/build-module/hooks/dimensions.mjs +15 -4
  424. package/build-module/hooks/dimensions.mjs.map +2 -2
  425. package/build-module/hooks/duotone.mjs +20 -9
  426. package/build-module/hooks/duotone.mjs.map +2 -2
  427. package/build-module/hooks/elements.mjs +15 -5
  428. package/build-module/hooks/elements.mjs.map +2 -2
  429. package/build-module/hooks/grid-visualizer.mjs +5 -3
  430. package/build-module/hooks/grid-visualizer.mjs.map +2 -2
  431. package/build-module/hooks/layout-child.mjs +22 -12
  432. package/build-module/hooks/layout-child.mjs.map +2 -2
  433. package/build-module/hooks/layout.mjs +28 -13
  434. package/build-module/hooks/layout.mjs.map +2 -2
  435. package/build-module/hooks/line-height.mjs +1 -2
  436. package/build-module/hooks/line-height.mjs.map +2 -2
  437. package/build-module/hooks/states.mjs +27 -7
  438. package/build-module/hooks/states.mjs.map +2 -2
  439. package/build-module/hooks/style.mjs +40 -11
  440. package/build-module/hooks/style.mjs.map +2 -2
  441. package/build-module/hooks/text-align.mjs +39 -10
  442. package/build-module/hooks/text-align.mjs.map +2 -2
  443. package/build-module/hooks/typography.mjs +14 -5
  444. package/build-module/hooks/typography.mjs.map +2 -2
  445. package/build-module/layouts/constrained.mjs +14 -6
  446. package/build-module/layouts/constrained.mjs.map +2 -2
  447. package/build-module/layouts/flex.mjs +27 -19
  448. package/build-module/layouts/flex.mjs.map +2 -2
  449. package/build-module/layouts/grid.mjs +0 -2
  450. package/build-module/layouts/grid.mjs.map +2 -2
  451. package/build-module/private-apis.mjs +7 -3
  452. package/build-module/private-apis.mjs.map +2 -2
  453. package/build-module/store/actions.mjs +12 -7
  454. package/build-module/store/actions.mjs.map +2 -2
  455. package/build-module/store/private-selectors.mjs +42 -3
  456. package/build-module/store/private-selectors.mjs.map +2 -2
  457. package/build-module/store/reducer.mjs +6 -6
  458. package/build-module/store/reducer.mjs.map +2 -2
  459. package/build-module/store/selectors.mjs +23 -0
  460. package/build-module/store/selectors.mjs.map +2 -2
  461. package/build-module/utils/block-bindings.mjs +28 -0
  462. package/build-module/utils/block-bindings.mjs.map +2 -2
  463. package/build-module/utils/dom.mjs +13 -0
  464. package/build-module/utils/dom.mjs.map +2 -2
  465. package/build-module/utils/native-undo.mjs +29 -0
  466. package/build-module/utils/native-undo.mjs.map +7 -0
  467. package/build-style/content-rtl.css +14 -27
  468. package/build-style/content.css +14 -27
  469. package/build-style/default-editor-styles-rtl.css +1 -1
  470. package/build-style/default-editor-styles.css +1 -1
  471. package/build-style/style-rtl.css +191 -61
  472. package/build-style/style.css +191 -61
  473. package/build-types/components/block-context/index.d.ts +7 -0
  474. package/build-types/components/block-context/index.d.ts.map +1 -1
  475. package/build-types/utils/block-bindings.d.ts +19 -0
  476. package/build-types/utils/block-bindings.d.ts.map +1 -1
  477. package/build-types/utils/dom.d.ts +11 -0
  478. package/build-types/utils/dom.d.ts.map +1 -1
  479. package/build-types/utils/get-px-from-css-unit.d.ts +2 -2
  480. package/build-types/utils/get-px-from-css-unit.d.ts.map +1 -1
  481. package/build-types/utils/pasting.d.ts +1 -1
  482. package/build-types/utils/pasting.d.ts.map +1 -1
  483. package/package.json +43 -44
  484. package/src/components/alignment-control/test/__snapshots__/index.js.snap +1 -1
  485. package/src/components/alignment-control/ui.js +2 -4
  486. package/src/components/background-image-control/index.js +74 -37
  487. package/src/components/background-image-control/style.scss +13 -4
  488. package/src/components/block-alignment-control/test/__snapshots__/index.js.snap +3 -3
  489. package/src/components/block-alignment-control/test/index.js +1 -1
  490. package/src/components/block-alignment-control/ui.js +4 -2
  491. package/src/components/block-breadcrumb/test/__snapshots__/index.js.snap +1 -1
  492. package/src/components/block-canvas/index.js +9 -2
  493. package/src/components/block-card/style.scss +1 -1
  494. package/src/components/block-compare/test/__snapshots__/block-view.js.snap +1 -1
  495. package/src/components/block-controls/groups.js +2 -0
  496. package/src/components/block-edit/edit.js +13 -31
  497. package/src/components/block-icon/test/__snapshots__/index.js.snap +1 -1
  498. package/src/components/block-inspector/index.js +60 -31
  499. package/src/components/block-list/block-html.js +5 -0
  500. package/src/components/block-list/block.js +6 -0
  501. package/src/components/block-list/content.scss +1 -11
  502. package/src/components/block-list/index.js +0 -2
  503. package/src/components/block-list/use-block-props/index.js +7 -1
  504. package/src/components/block-list/use-block-props/use-focus-first-element.js +23 -4
  505. package/src/components/block-list/use-block-props/use-focus-handler.js +35 -9
  506. package/src/components/block-list/use-block-props/use-register-block-event-handlers.js +45 -0
  507. package/src/components/block-lock/style.scss +1 -1
  508. package/src/components/block-manager/style.scss +1 -1
  509. package/src/components/block-navigation/style.scss +1 -1
  510. package/src/components/block-parent-selector/index.js +5 -2
  511. package/src/components/block-quick-navigation/style.scss +1 -3
  512. package/src/components/block-styles/style.scss +2 -2
  513. package/src/components/block-toolbar/index.js +41 -18
  514. package/src/components/block-toolbar/switch-section-style.js +5 -2
  515. package/src/components/block-tools/empty-block-inserter.js +3 -7
  516. package/src/components/block-tools/index.js +7 -0
  517. package/src/components/block-types-list/style.scss +0 -1
  518. package/src/components/block-vertical-alignment-control/test/__snapshots__/index.js.snap +3 -3
  519. package/src/components/block-vertical-alignment-control/test/index.js +18 -2
  520. package/src/components/block-vertical-alignment-control/ui.js +3 -5
  521. package/src/components/block-visibility/modal.js +24 -10
  522. package/src/components/block-visibility/style.scss +1 -1
  523. package/src/components/block-visibility/test/use-block-visibility.js +128 -35
  524. package/src/components/block-visibility/test/utils.js +11 -0
  525. package/src/components/block-visibility/use-block-visibility.js +33 -11
  526. package/src/components/block-visibility/utils.js +31 -6
  527. package/src/components/block-visibility/viewport-menu-item.js +10 -1
  528. package/src/components/block-visibility/viewport-toolbar.js +6 -0
  529. package/src/components/block-visibility/viewport-visibility-info.js +5 -1
  530. package/src/components/border-radius-control/test/utils.js +0 -41
  531. package/src/components/border-radius-control/utils.js +16 -107
  532. package/src/components/button-block-appender/content.scss +7 -9
  533. package/src/components/child-layout-control/index.js +0 -4
  534. package/src/components/color-palette/test/__snapshots__/control.js.snap +3 -3
  535. package/src/components/colors-gradients/control.js +6 -3
  536. package/src/components/default-block-appender/test/__snapshots__/index.js.snap +1 -1
  537. package/src/components/dimension-control/index.js +13 -1
  538. package/src/components/dimensions-tool/aspect-ratio-tool.js +13 -6
  539. package/src/components/editor-styles/index.js +16 -1
  540. package/src/components/font-family/stories/index.story.jsx +1 -1
  541. package/src/components/global-styles/background-panel.js +107 -34
  542. package/src/components/global-styles/border-panel.js +219 -48
  543. package/src/components/global-styles/color-gradient-dropdown-item.js +93 -28
  544. package/src/components/global-styles/color-panel.js +92 -11
  545. package/src/components/global-styles/dimensions-panel.js +422 -71
  546. package/src/components/global-styles/filters-panel.js +88 -28
  547. package/src/components/global-styles/hooks.js +8 -1
  548. package/src/components/global-styles/inheritance/index.js +204 -0
  549. package/src/components/global-styles/inheritance/style.scss +184 -0
  550. package/src/components/global-styles/inheritance/test/index.js +281 -0
  551. package/src/components/global-styles/inherited-value-context.js +271 -0
  552. package/src/components/global-styles/shadow-panel-components.js +48 -26
  553. package/src/components/global-styles/state-control-badges.js +45 -6
  554. package/src/components/global-styles/state-control.js +2 -2
  555. package/src/components/global-styles/style.scss +5 -0
  556. package/src/components/global-styles/test/background-panel.js +338 -1
  557. package/src/components/global-styles/test/border-panel.js +441 -0
  558. package/src/components/global-styles/test/color-panel.js +182 -2
  559. package/src/components/global-styles/test/dimensions-panel.js +753 -0
  560. package/src/components/global-styles/test/filters-panel.js +194 -0
  561. package/src/components/global-styles/test/inherited-value-context-core.js +98 -0
  562. package/src/components/global-styles/test/inherited-value-context.js +454 -0
  563. package/src/components/global-styles/test/state-control-badges.js +65 -0
  564. package/src/components/global-styles/test/typography-panel-core.js +185 -0
  565. package/src/components/global-styles/test/typography-panel.js +849 -12
  566. package/src/components/global-styles/typography-panel.js +449 -101
  567. package/src/components/image-editor/style.scss +33 -0
  568. package/src/components/image-size-control/index.js +0 -2
  569. package/src/components/inner-blocks/test/__snapshots__/index.js.snap +1 -1
  570. package/src/components/inserter/media-tab/hooks.js +55 -7
  571. package/src/components/inserter/media-tab/media-panel.js +117 -21
  572. package/src/components/inserter/media-tab/test/hooks.js +63 -0
  573. package/src/components/inserter/media-tab/test/media-panel.js +127 -0
  574. package/src/components/inserter/style.scss +19 -16
  575. package/src/components/inserter-list-item/style.scss +0 -15
  576. package/src/components/inspector-controls-tabs/styles-tab.js +5 -1
  577. package/src/components/keyboard-shortcuts/index.js +28 -11
  578. package/src/components/line-height-control/index.js +1 -2
  579. package/src/components/link-control/index.js +7 -2
  580. package/src/components/link-control/style.scss +2 -2
  581. package/src/components/link-control/test/index.js +6 -6
  582. package/src/components/link-picker/style.scss +1 -2
  583. package/src/components/list-view/block.js +13 -4
  584. package/src/components/list-view/style.scss +4 -5
  585. package/src/components/media-placeholder/index.js +0 -1
  586. package/src/components/multi-selection-inspector/style.scss +1 -1
  587. package/src/components/preset-input-control/index.js +4 -1
  588. package/src/components/provider/block-refs-provider.js +12 -2
  589. package/src/components/provider/index.js +2 -2
  590. package/src/components/provider/use-block-sync.js +18 -6
  591. package/src/components/provider/use-media-upload-settings.js +2 -0
  592. package/src/components/responsive-block-control/style.scss +1 -1
  593. package/src/components/rich-text/event-listeners/before-input-rules.js +8 -5
  594. package/src/components/rich-text/event-listeners/delete.js +7 -4
  595. package/src/components/rich-text/event-listeners/enter.js +10 -4
  596. package/src/components/rich-text/event-listeners/input-events.js +4 -3
  597. package/src/components/rich-text/event-listeners/input-rules.js +8 -5
  598. package/src/components/rich-text/event-listeners/insert-replacement-text.js +4 -3
  599. package/src/components/rich-text/event-listeners/paste-handler.js +15 -3
  600. package/src/components/rich-text/event-listeners/remove-browser-shortcuts.js +4 -3
  601. package/src/components/rich-text/event-listeners/shortcuts.js +4 -3
  602. package/src/components/rich-text/event-listeners/undo-automatic-change.js +4 -3
  603. package/src/components/rich-text/index.js +116 -26
  604. package/src/components/skip-to-selected-block/style.scss +1 -1
  605. package/src/components/spacing-sizes-control/test/utils.js +16 -5
  606. package/src/components/spacing-sizes-control/utils.js +11 -28
  607. package/src/components/text-indent-control/index.js +8 -0
  608. package/src/components/typewriter/index.js +228 -224
  609. package/src/components/url-input/index.js +363 -431
  610. package/src/components/url-input/test/index.js +592 -0
  611. package/src/components/use-block-commands/index.js +27 -17
  612. package/src/components/use-on-block-drop/index.js +2 -2
  613. package/src/components/warning/test/__snapshots__/index.js.snap +1 -1
  614. package/src/components/writing-flow/index.js +17 -1
  615. package/src/components/writing-flow/use-arrow-nav.js +90 -13
  616. package/src/components/writing-flow/use-click-selection.js +55 -5
  617. package/src/components/writing-flow/use-clipboard-handler.js +5 -2
  618. package/src/components/writing-flow/use-drag-selection.js +1 -14
  619. package/src/components/writing-flow/use-editable-root-event-handlers.js +266 -0
  620. package/src/components/writing-flow/use-editable-root.js +112 -0
  621. package/src/components/writing-flow/use-home-end.js +71 -0
  622. package/src/components/writing-flow/use-input.js +25 -8
  623. package/src/components/writing-flow/use-multi-selection.js +2 -3
  624. package/src/components/writing-flow/use-select-all.js +33 -3
  625. package/src/components/writing-flow/use-selection-observer.js +218 -42
  626. package/src/components/writing-flow/utils.js +62 -0
  627. package/src/hooks/background.js +27 -24
  628. package/src/hooks/block-fields/link/styles.scss +1 -6
  629. package/src/hooks/block-fields/media/styles.scss +1 -6
  630. package/src/hooks/block-fields/rich-text/index.js +6 -9
  631. package/src/hooks/block-fields/rich-text/styles.scss +1 -1
  632. package/src/hooks/block-style-variation.js +8 -74
  633. package/src/hooks/border.js +19 -4
  634. package/src/hooks/custom-css.js +15 -6
  635. package/src/hooks/dimensions.js +17 -4
  636. package/src/hooks/duotone.js +26 -8
  637. package/src/hooks/elements.js +14 -4
  638. package/src/hooks/grid-visualizer.js +40 -36
  639. package/src/hooks/layout-child.js +19 -9
  640. package/src/hooks/layout.js +48 -31
  641. package/src/hooks/line-height.js +0 -1
  642. package/src/hooks/states.js +38 -9
  643. package/src/hooks/style.js +67 -17
  644. package/src/hooks/test/inherited-value-wiring.js +411 -0
  645. package/src/hooks/test/preset-round-trip.js +456 -0
  646. package/src/hooks/test/style.js +29 -0
  647. package/src/hooks/test/text-align.js +34 -1
  648. package/src/hooks/text-align.js +41 -10
  649. package/src/hooks/typography.js +35 -24
  650. package/src/layouts/constrained.js +5 -1
  651. package/src/layouts/flex.js +5 -1
  652. package/src/layouts/grid.js +0 -2
  653. package/src/private-apis.js +11 -2
  654. package/src/store/actions.js +53 -19
  655. package/src/store/private-selectors.js +82 -6
  656. package/src/store/reducer.js +9 -9
  657. package/src/store/selectors.js +56 -8
  658. package/src/store/test/actions.js +1 -1
  659. package/src/store/test/private-selectors.js +271 -1
  660. package/src/style.scss +2 -0
  661. package/src/utils/block-bindings.ts +50 -0
  662. package/src/utils/dom.ts +33 -0
  663. package/src/utils/native-undo.js +56 -0
  664. package/src/utils/test/block-bindings.js +181 -0
  665. package/build/components/duotone/utils.cjs +0 -87
  666. package/build/components/duotone/utils.cjs.map +0 -7
  667. package/build/components/rich-text/input-event.cjs.map +0 -7
  668. package/build/components/rich-text/shortcut.cjs +0 -51
  669. package/build/components/rich-text/shortcut.cjs.map +0 -7
  670. package/build-module/components/duotone/utils.mjs +0 -59
  671. package/build-module/components/duotone/utils.mjs.map +0 -7
  672. package/build-module/components/rich-text/input-event.mjs +0 -25
  673. package/build-module/components/rich-text/input-event.mjs.map +0 -7
  674. package/build-module/components/rich-text/shortcut.mjs +0 -26
  675. package/build-module/components/rich-text/shortcut.mjs.map +0 -7
  676. package/src/components/duotone/utils.js +0 -90
  677. package/src/components/rich-text/input-event.js +0 -31
  678. package/src/components/rich-text/shortcut.js +0 -32
  679. 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\tsize=\"__unstable-large\"\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,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["/**\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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gBACD;AAAA,cACD,GACD,GACD;AAAA;AAAA;AAAA,QAEF;AAAA;AAAA;AAAA,EAEF;AAEF;",
6
6
  "names": []
7
7
  }
@@ -73,8 +73,7 @@ function ImageSizeControl({
73
73
  label: __("Width"),
74
74
  value: currentWidth,
75
75
  min: 1,
76
- onChange: (value) => updateDimension("width", value),
77
- size: "__unstable-large"
76
+ onChange: (value) => updateDimension("width", value)
78
77
  }
79
78
  ),
80
79
  /* @__PURE__ */ jsx(
@@ -83,8 +82,7 @@ function ImageSizeControl({
83
82
  label: __("Height"),
84
83
  value: currentHeight,
85
84
  min: 1,
86
- onChange: (value) => updateDimension("height", value),
87
- size: "__unstable-large"
85
+ onChange: (value) => updateDimension("height", value)
88
86
  }
89
87
  )
90
88
  ] }),
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../src/components/image-size-control/index.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tSelectControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDimensionHandler from './use-dimension-handler';\n\nconst IMAGE_SIZE_PRESETS = [ 25, 50, 75, 100 ];\nconst noop = () => {};\n\n/**\n * Get scaled width and height for the given scale.\n *\n * @param {number} scale The scale to get the scaled width and height for.\n * @param {number} imageWidth The image width.\n * @param {number} imageHeight The image height.\n *\n * @return {Object} The scaled width and height.\n */\nfunction getScaledWidthAndHeight( scale, imageWidth, imageHeight ) {\n\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\treturn {\n\t\tscaledWidth,\n\t\tscaledHeight,\n\t};\n}\n\nexport default function ImageSizeControl( {\n\timageSizeHelp,\n\timageWidth,\n\timageHeight,\n\timageSizeOptions = [],\n\tisResizable = true,\n\tslug,\n\twidth,\n\theight,\n\tonChange,\n\tonChangeImage = noop,\n} ) {\n\tconst { currentHeight, currentWidth, updateDimension, updateDimensions } =\n\t\tuseDimensionHandler( height, width, imageHeight, imageWidth, onChange );\n\n\t/**\n\t * Updates the dimensions for the given scale.\n\t * Handler for toggle group control change.\n\t *\n\t * @param {number} scale The scale to update the dimensions for.\n\t */\n\tconst handleUpdateDimensions = ( scale ) => {\n\t\tif ( undefined === scale ) {\n\t\t\tupdateDimensions();\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\tupdateDimensions( scaledHeight, scaledWidth );\n\t};\n\n\t/**\n\t * Add the stored image preset value to toggle group control.\n\t */\n\tconst selectedValue = IMAGE_SIZE_PRESETS.find( ( scale ) => {\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\treturn currentWidth === scaledWidth && currentHeight === scaledHeight;\n\t} );\n\n\treturn (\n\t\t<VStack className=\"block-editor-image-size-control\" spacing=\"4\">\n\t\t\t{ imageSizeOptions && imageSizeOptions.length > 0 && (\n\t\t\t\t<SelectControl\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tvalue={ slug }\n\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\tonChange={ onChangeImage }\n\t\t\t\t\thelp={ imageSizeHelp }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isResizable && (\n\t\t\t\t<>\n\t\t\t\t\t<HStack align=\"baseline\" spacing=\"4\">\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tvalue={ currentWidth }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'width', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\tvalue={ currentHeight }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'height', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tsize=\"__unstable-large\"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Image size presets' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tonChange={ handleUpdateDimensions }\n\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t>\n\t\t\t\t\t\t{ IMAGE_SIZE_PRESETS.map( ( scale ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\tvalue={ scale }\n\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %d: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\t\tscale\n\t\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t} ) }\n\t\t\t\t\t</ToggleGroupControl>\n\t\t\t\t</>\n\t\t\t) }\n\t\t</VStack>\n\t);\n}\n"],
5
- "mappings": ";AAGA;AAAA,EACC;AAAA,EACA,+BAA+B;AAAA,EAC/B,wBAAwB;AAAA,EACxB,w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ACR,SAAU;AAAA,QACV,UAAW;AAAA,QACX,MAAO;AAAA;AAAA,IACR;AAAA,IAEC,eACD,iCACC;AAAA,2BAAC,UAAO,OAAM,YAAW,SAAQ,KAChC;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,OAAQ;AAAA,YACpB,OAAQ;AAAA,YACR,KAAM;AAAA,YACN,UAAW,CAAE,UACZ,gBAAiB,SAAS,KAAM;AAAA,YAEjC,MAAK;AAAA;AAAA,QACN;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,QAAS;AAAA,YACrB,OAAQ;AAAA,YACR,KAAM;AAAA,YACN,UAAW,CAAE,UACZ,gBAAiB,UAAU,KAAM;AAAA,YAElC,MAAK;AAAA;AAAA,QACN;AAAA,SACD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ,GAAI,oBAAqB;AAAA,UACjC,qBAAmB;AAAA,UACnB,UAAW;AAAA,UACX,OAAQ;AAAA,UACR,SAAO;AAAA,UAEL,6BAAmB,IAAK,CAAE,UAAW;AACtC,mBACC;AAAA,cAAC;AAAA;AAAA,gBAEA,OAAQ;AAAA,gBACR,OAAQ;AAAA;AAAA,kBAEP,GAAI,MAAO;AAAA,kBACX;AAAA,gBACD;AAAA;AAAA,cANM;AAAA,YAOP;AAAA,UAEF,CAAE;AAAA;AAAA,MACH;AAAA,OACD;AAAA,KAEF;AAEF;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport {\n\tSelectControl,\n\t__experimentalNumberControl as NumberControl,\n\t__experimentalHStack as HStack,\n\t__experimentalVStack as VStack,\n\t__experimentalToggleGroupControl as ToggleGroupControl,\n\t__experimentalToggleGroupControlOption as ToggleGroupControlOption,\n} from '@wordpress/components';\nimport { __, sprintf } from '@wordpress/i18n';\n\n/**\n * Internal dependencies\n */\nimport useDimensionHandler from './use-dimension-handler';\n\nconst IMAGE_SIZE_PRESETS = [ 25, 50, 75, 100 ];\nconst noop = () => {};\n\n/**\n * Get scaled width and height for the given scale.\n *\n * @param {number} scale The scale to get the scaled width and height for.\n * @param {number} imageWidth The image width.\n * @param {number} imageHeight The image height.\n *\n * @return {Object} The scaled width and height.\n */\nfunction getScaledWidthAndHeight( scale, imageWidth, imageHeight ) {\n\tconst scaledWidth = Math.round( imageWidth * ( scale / 100 ) );\n\tconst scaledHeight = Math.round( imageHeight * ( scale / 100 ) );\n\n\treturn {\n\t\tscaledWidth,\n\t\tscaledHeight,\n\t};\n}\n\nexport default function ImageSizeControl( {\n\timageSizeHelp,\n\timageWidth,\n\timageHeight,\n\timageSizeOptions = [],\n\tisResizable = true,\n\tslug,\n\twidth,\n\theight,\n\tonChange,\n\tonChangeImage = noop,\n} ) {\n\tconst { currentHeight, currentWidth, updateDimension, updateDimensions } =\n\t\tuseDimensionHandler( height, width, imageHeight, imageWidth, onChange );\n\n\t/**\n\t * Updates the dimensions for the given scale.\n\t * Handler for toggle group control change.\n\t *\n\t * @param {number} scale The scale to update the dimensions for.\n\t */\n\tconst handleUpdateDimensions = ( scale ) => {\n\t\tif ( undefined === scale ) {\n\t\t\tupdateDimensions();\n\t\t\treturn;\n\t\t}\n\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\tupdateDimensions( scaledHeight, scaledWidth );\n\t};\n\n\t/**\n\t * Add the stored image preset value to toggle group control.\n\t */\n\tconst selectedValue = IMAGE_SIZE_PRESETS.find( ( scale ) => {\n\t\tconst { scaledWidth, scaledHeight } = getScaledWidthAndHeight(\n\t\t\tscale,\n\t\t\timageWidth,\n\t\t\timageHeight\n\t\t);\n\n\t\treturn currentWidth === scaledWidth && currentHeight === scaledHeight;\n\t} );\n\n\treturn (\n\t\t<VStack className=\"block-editor-image-size-control\" spacing=\"4\">\n\t\t\t{ imageSizeOptions && imageSizeOptions.length > 0 && (\n\t\t\t\t<SelectControl\n\t\t\t\t\tlabel={ __( 'Resolution' ) }\n\t\t\t\t\tvalue={ slug }\n\t\t\t\t\toptions={ imageSizeOptions }\n\t\t\t\t\tonChange={ onChangeImage }\n\t\t\t\t\thelp={ imageSizeHelp }\n\t\t\t\t/>\n\t\t\t) }\n\t\t\t{ isResizable && (\n\t\t\t\t<>\n\t\t\t\t\t<HStack align=\"baseline\" spacing=\"4\">\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Width' ) }\n\t\t\t\t\t\t\tvalue={ currentWidth }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'width', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t\t<NumberControl\n\t\t\t\t\t\t\tlabel={ __( 'Height' ) }\n\t\t\t\t\t\t\tvalue={ currentHeight }\n\t\t\t\t\t\t\tmin={ 1 }\n\t\t\t\t\t\t\tonChange={ ( value ) =>\n\t\t\t\t\t\t\t\tupdateDimension( 'height', value )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t/>\n\t\t\t\t\t</HStack>\n\t\t\t\t\t<ToggleGroupControl\n\t\t\t\t\t\tlabel={ __( 'Image size presets' ) }\n\t\t\t\t\t\thideLabelFromVision\n\t\t\t\t\t\tonChange={ handleUpdateDimensions }\n\t\t\t\t\t\tvalue={ selectedValue }\n\t\t\t\t\t\tisBlock\n\t\t\t\t\t>\n\t\t\t\t\t\t{ IMAGE_SIZE_PRESETS.map( ( scale ) => {\n\t\t\t\t\t\t\treturn (\n\t\t\t\t\t\t\t\t<ToggleGroupControlOption\n\t\t\t\t\t\t\t\t\tkey={ scale }\n\t\t\t\t\t\t\t\t\tvalue={ scale }\n\t\t\t\t\t\t\t\t\tlabel={ sprintf(\n\t\t\t\t\t\t\t\t\t\t/* translators: %d: Percentage value. */\n\t\t\t\t\t\t\t\t\t\t__( '%d%%' ),\n\t\t\t\t\t\t\t\t\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AAI;AAAA,MACrC;AAAA,MACA;AAAA,MACA;AAAA,IACD;AAEA,WAAO,iBAAiB,eAAe,kBAAkB;AAAA,EAC1D,CAAE;AAEF,SACC,qBAAC,UAAO,WAAU,mCAAkC,SAAQ,KACzD;AAAA,wBAAoB,iBAAiB,SAAS,KAC/C;AAAA,MAAC;AAAA;AAAA,QACA,OAAQ,GAAI,YAAa;AAAA,QACzB,OAAQ;AAAA,QACR,SAAU;AAAA,QACV,UAAW;AAAA,QACX,MAAO;AAAA;AAAA,IACR;AAAA,IAEC,eACD,iCACC;AAAA,2BAAC,UAAO,OAAM,YAAW,SAAQ,KAChC;AAAA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,OAAQ;AAAA,YACpB,OAAQ;AAAA,YACR,KAAM;AAAA,YACN,UAAW,CAAE,UACZ,gBAAiB,SAAS,KAAM;AAAA;AAAA,QAElC;AAAA,QACA;AAAA,UAAC;AAAA;AAAA,YACA,OAAQ,GAAI,QAAS;AAAA,YACrB,OAAQ;AAAA,YACR,KAAM;AAAA,YACN,UAAW,CAAE,UACZ,gBAAiB,UAAU,KAAM;AAAA;AAAA,QAEnC;AAAA,SACD;AAAA,MACA;AAAA,QAAC;AAAA;AAAA,UACA,OAAQ,GAAI,oBAAqB;AAAA,UACjC,qBAAmB;AAAA,UACnB,UAAW;AAAA,UACX,OAAQ;AAAA,UACR,SAAO;AAAA,UAEL,6BAAmB,IAAK,CAAE,UAAW;AACtC,mBACC;AAAA,cAAC;AAAA;AAAA,gBAEA,OAAQ;AAAA,gBACR,OAAQ;AAAA;AAAA,kBAEP,GAAI,MAAO;AAAA,kBACX;AAAA,gBACD;AAAA;AAAA,cANM;AAAA,YAOP;AAAA,UAEF,CAAE;AAAA;AAAA,MACH;AAAA,OACD;AAAA,KAEF;AAEF;",
6
6
  "names": []
7
7
  }
@@ -3,12 +3,24 @@ import { useEffect, useState, useRef } from "@wordpress/element";
3
3
  import { useSelect } from "@wordpress/data";
4
4
  import { store as blockEditorStore } from "../../../store/index.mjs";
5
5
  import { unlock } from "../../../lock-unlock.mjs";
6
+ function normalizeFetchResult(result) {
7
+ if (Array.isArray(result)) {
8
+ return { mediaItems: result };
9
+ }
10
+ return {
11
+ mediaItems: result?.mediaItems ?? [],
12
+ totalItems: result?.totalItems,
13
+ totalPages: result?.totalPages
14
+ };
15
+ }
6
16
  function useMediaResults(category, query = {}, refreshKey) {
7
17
  const [mediaList, setMediaList] = useState();
18
+ const [totals, setTotals] = useState({});
8
19
  const [isLoading, setIsLoading] = useState(false);
9
20
  const lastRequestRef = useRef();
10
21
  const lastQueryKeyRef = useRef();
11
22
  const lastFetchRef = useRef();
23
+ const lastSourceRef = useRef();
12
24
  useEffect(() => {
13
25
  (async () => {
14
26
  const key = JSON.stringify({
@@ -21,11 +33,20 @@ function useMediaResults(category, query = {}, refreshKey) {
21
33
  if (lastQueryKeyRef.current !== key || lastFetchRef.current !== category.fetch) {
22
34
  setMediaList([]);
23
35
  }
36
+ if (lastSourceRef.current !== category.name || lastFetchRef.current !== category.fetch) {
37
+ setTotals({});
38
+ }
24
39
  lastQueryKeyRef.current = key;
25
40
  lastFetchRef.current = category.fetch;
26
- const _media = await category.fetch?.(query);
41
+ lastSourceRef.current = category.name;
42
+ const { page, ...queryWithoutPage } = query;
43
+ const fetchQuery = page > 1 ? query : queryWithoutPage;
44
+ const { mediaItems, totalItems, totalPages } = normalizeFetchResult(
45
+ await category.fetch?.(fetchQuery)
46
+ );
27
47
  if (request === lastRequestRef.current) {
28
- setMediaList(_media);
48
+ setMediaList(mediaItems);
49
+ setTotals({ totalItems, totalPages });
29
50
  setIsLoading(false);
30
51
  }
31
52
  })();
@@ -35,7 +56,12 @@ function useMediaResults(category, query = {}, refreshKey) {
35
56
  ...Object.values(query),
36
57
  refreshKey
37
58
  ]);
38
- return { mediaList, isLoading };
59
+ return {
60
+ mediaList,
61
+ isLoading,
62
+ totalItems: totals.totalItems,
63
+ totalPages: totals.totalPages
64
+ };
39
65
  }
40
66
  function useDelayedLoading(isLoading, delay = 400) {
41
67
  const [showLoading, setShowLoading] = useState(false);
@@ -91,9 +117,10 @@ function useMediaCategories(rootClientId) {
91
117
  }
92
118
  let results = [];
93
119
  try {
94
- results = await category.fetch({
95
- per_page: 1
96
- });
120
+ const { mediaItems } = normalizeFetchResult(
121
+ await category.fetch({ per_page: 1 })
122
+ );
123
+ results = mediaItems;
97
124
  } catch {
98
125
  }
99
126
  return [category.name, !!results.length];
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/components/inserter/media-tab/hooks.js"],
4
- "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\n/** @typedef {import('../../../store/actions').InserterMediaRequest} InserterMediaRequest */\n/** @typedef {import('../../../store/actions').InserterMediaItem} InserterMediaItem */\n\n/**\n * Fetches media items based on the provided category.\n * Each media category is responsible for providing a `fetch` function.\n *\n * @param {Object} category The media category to fetch results for.\n * @param {InserterMediaRequest} query The query args to use for the request.\n * @param {any} refreshKey Optional value that, when changed, forces\n * a refetch (e.g. after attaching/detaching).\n * @return {InserterMediaItem[]} The media results.\n */\nexport function useMediaResults( category, query = {}, refreshKey ) {\n\tconst [ mediaList, setMediaList ] = useState();\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\t// We need to keep track of the last request made because\n\t// multiple request can be fired without knowing the order\n\t// of resolution, and we need to ensure we are showing\n\t// the results of the last request.\n\t// In the future we could use AbortController to cancel previous\n\t// requests, but we don't for now as it involves adding support\n\t// for this to `core-data` package.\n\tconst lastRequestRef = useRef();\n\tconst lastQueryKeyRef = useRef();\n\tconst lastFetchRef = useRef();\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tconst key = JSON.stringify( {\n\t\t\t\tcategory: category.name,\n\t\t\t\t...query,\n\t\t\t} );\n\t\t\t// Unique token so identical-query refreshes can't apply stale results.\n\t\t\tconst request = {};\n\t\t\tlastRequestRef.current = request;\n\t\t\tsetIsLoading( true );\n\t\t\t// Only clear the previous results when the category source or query\n\t\t\t// changes, not on a manual refresh (a `refreshKey` bump after\n\t\t\t// attach/detach). Keeping them lets the panel dim the existing grid\n\t\t\t// during the refetch instead of blanking it.\n\t\t\tif (\n\t\t\t\tlastQueryKeyRef.current !== key ||\n\t\t\t\tlastFetchRef.current !== category.fetch\n\t\t\t) {\n\t\t\t\tsetMediaList( [] );\n\t\t\t}\n\t\t\tlastQueryKeyRef.current = key;\n\t\t\tlastFetchRef.current = category.fetch;\n\t\t\tconst _media = await category.fetch?.( query );\n\t\t\tif ( request === lastRequestRef.current ) {\n\t\t\t\tsetMediaList( _media );\n\t\t\t\tsetIsLoading( false );\n\t\t\t}\n\t\t} )();\n\t}, [\n\t\tcategory.name,\n\t\tcategory.fetch,\n\t\t...Object.values( query ),\n\t\trefreshKey,\n\t] );\n\treturn { mediaList, isLoading };\n}\n\n/**\n * Delays surfacing a loading state until a request has been in flight for\n * `delay` ms, so brief operations (e.g. a quick attach/detach refetch) don't\n * flash a loading indicator at all. Mirrors the DataViews `useDelayedLoading`\n * hook.\n *\n * @param {boolean} isLoading Whether a request is currently in flight.\n * @param {number} delay Milliseconds to wait before showing the loader.\n * @return {boolean} Whether the loading state should be shown yet.\n */\nexport function useDelayedLoading( isLoading, delay = 400 ) {\n\tconst [ showLoading, setShowLoading ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( ! isLoading ) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst timeout = setTimeout( () => setShowLoading( true ), delay );\n\t\treturn () => {\n\t\t\tclearTimeout( timeout );\n\t\t\tsetShowLoading( false );\n\t\t};\n\t}, [ isLoading, delay ] );\n\treturn showLoading;\n}\n\nexport function useMediaCategories( rootClientId ) {\n\tconst [ categories, setCategories ] = useState( [] );\n\n\tconst inserterMediaCategories = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).getInserterMediaCategories(),\n\t\t[]\n\t);\n\tconst { canInsertImage, canInsertVideo, canInsertAudio } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tcanInsertImage: canInsertBlockType(\n\t\t\t\t\t'core/image',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tcanInsertVideo: canInsertBlockType(\n\t\t\t\t\t'core/video',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tcanInsertAudio: canInsertBlockType(\n\t\t\t\t\t'core/audio',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tconst _categories = [];\n\t\t\t// If `inserterMediaCategories` is not defined in\n\t\t\t// block editor settings, do not show any media categories.\n\t\t\tif ( ! inserterMediaCategories ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Loop through categories to check if they have at least one media item.\n\t\t\tconst categoriesHaveMedia = new Map(\n\t\t\t\tawait Promise.all(\n\t\t\t\t\tinserterMediaCategories.map( async ( category ) => {\n\t\t\t\t\t\t// Some sources are external and we don't need to make a request.\n\t\t\t\t\t\tif ( category.isExternalResource ) {\n\t\t\t\t\t\t\treturn [ category.name, true ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet results = [];\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tresults = await category.fetch( {\n\t\t\t\t\t\t\t\tper_page: 1,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// If the request fails, we shallow the error and just don't show\n\t\t\t\t\t\t\t// the category, in order to not break the media tab.\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn [ category.name, !! results.length ];\n\t\t\t\t\t} )\n\t\t\t\t)\n\t\t\t);\n\t\t\t// We need to filter out categories that don't have any media items or\n\t\t\t// whose corresponding block type is not allowed to be inserted, based\n\t\t\t// on the category's `mediaType`. A category that provides an\n\t\t\t// `emptyMessage` stays in the list even when empty, so it can show\n\t\t\t// that message (e.g. Attachments, to expose its \"Attach\" action).\n\t\t\tconst canInsertMediaType = {\n\t\t\t\timage: canInsertImage,\n\t\t\t\tvideo: canInsertVideo,\n\t\t\t\taudio: canInsertAudio,\n\t\t\t};\n\t\t\tinserterMediaCategories.forEach( ( category ) => {\n\t\t\t\tif (\n\t\t\t\t\tcanInsertMediaType[ category.mediaType ] &&\n\t\t\t\t\t( categoriesHaveMedia.get( category.name ) ||\n\t\t\t\t\t\tcategory.emptyMessage )\n\t\t\t\t) {\n\t\t\t\t\t_categories.push( category );\n\t\t\t\t}\n\t\t\t} );\n\t\t\tif ( !! _categories.length ) {\n\t\t\t\tsetCategories( _categories );\n\t\t\t}\n\t\t} )();\n\t}, [\n\t\tcanInsertImage,\n\t\tcanInsertVideo,\n\t\tcanInsertAudio,\n\t\tinserterMediaCategories,\n\t] );\n\treturn categories;\n}\n"],
5
- "mappings": ";AAGA,SAAS,WAAW,UAAU,cAAc;AAC5C,SAAS,iBAAiB;AAK1B,SAAS,SAAS,wBAAwB;AAC1C,SAAS,cAAc;AAehB,SAAS,gBAAiB,UAAU,QAAQ,CAAC,GAAG,YAAa;AACnE,QAAM,CAAE,WAAW,YAAa,IAAI,SAAS;AAC7C,QAAM,CAAE,WAAW,YAAa,IAAI,SAAU,KAAM;AAQpD,QAAM,iBAAiB,OAAO;AAC9B,QAAM,kBAAkB,OAAO;AAC/B,QAAM,eAAe,OAAO;AAC5B,YAAW,MAAM;AAChB,KAAE,YAAY;AACb,YAAM,MAAM,KAAK,UAAW;AAAA,QAC3B,UAAU,SAAS;AAAA,QACnB,GAAG;AAAA,MACJ,CAAE;AAEF,YAAM,UAAU,CAAC;AACjB,qBAAe,UAAU;AACzB,mBAAc,IAAK;AAKnB,UACC,gBAAgB,YAAY,OAC5B,aAA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IACD;AAAA,IACA,CAAE,YAAa;AAAA,EAChB;AACA,YAAW,MAAM;AAChB,KAAE,YAAY;AACb,YAAM,cAAc,CAAC;AAGrB,UAAK,CAAE,yBAA0B;AAChC;AAAA,MACD;AAEA,YAAM,sBAAsB,IAAI;AAAA,QAC/B,MAAM,QAAQ;AAAA,UACb,wBAAwB,IAAK,OAAQ,aAAc;AAElD,gBAAK,SAAS,oBAAqB;AAClC,qBAAO,CAAE,SAAS,MAAM,IAAK;AAAA,YAC9B;AACA,gBAAI,UAAU,CAAC;AACf,gBAAI;AACH,wBAAU,MAAM,SAAS,MAAO;AAAA,gBAC/B,UAAU;AAAA,cACX,CAAE;AAAA,YACH,QAAQ;AAAA,YAGR;AACA,mBAAO,CAAE,SAAS,MAAM,CAAC,CAAE,QAAQ,MAAO;AAAA,UAC3C,CAAE;AAAA,QACH;AAAA,MACD;AAMA,YAAM,qBAAqB;AAAA,QAC1B,OAAO;AAAA,QACP,OAAO;AAAA,QACP,OAAO;AAAA,MACR;AACA,8BAAwB,QAAS,CAAE,aAAc;AAChD,YACC,mBAAoB,SAAS,SAAU,MACrC,oBAAoB,IAAK,SAAS,IAAK,KACxC,SAAS,eACT;AACD,sBAAY,KAAM,QAAS;AAAA,QAC5B;AAAA,MACD,CAAE;AACF,UAAK,CAAC,CAAE,YAAY,QAAS;AAC5B,sBAAe,WAAY;AAAA,MAC5B;AAAA,IACD,GAAI;AAAA,EACL,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACF,SAAO;AACR;",
4
+ "sourcesContent": ["/**\n * WordPress dependencies\n */\nimport { useEffect, useState, useRef } from '@wordpress/element';\nimport { useSelect } from '@wordpress/data';\n\n/**\n * Internal dependencies\n */\nimport { store as blockEditorStore } from '../../../store';\nimport { unlock } from '../../../lock-unlock';\n\n/** @typedef {import('../../../store/actions').InserterMediaRequest} InserterMediaRequest */\n/** @typedef {import('../../../store/actions').InserterMediaItem} InserterMediaItem */\n/** @typedef {import('../../../store/actions').InserterMediaResponse} InserterMediaResponse */\n\n/**\n * Normalizes the result of a media category's `fetch`, which may be either a\n * plain array of media items or an `InserterMediaResponse` carrying pagination\n * totals. Sources that don't report totals leave them `undefined`, which is how\n * the panel knows to hide the pager.\n *\n * @param {InserterMediaItem[]|InserterMediaResponse|undefined} result The raw `fetch` result.\n * @return {{ mediaItems: InserterMediaItem[], totalItems: number|undefined, totalPages: number|undefined }} The normalized result.\n */\nfunction normalizeFetchResult( result ) {\n\tif ( Array.isArray( result ) ) {\n\t\treturn { mediaItems: result };\n\t}\n\treturn {\n\t\tmediaItems: result?.mediaItems ?? [],\n\t\ttotalItems: result?.totalItems,\n\t\ttotalPages: result?.totalPages,\n\t};\n}\n\n/**\n * Fetches media items based on the provided category.\n * Each media category is responsible for providing a `fetch` function.\n *\n * @param {Object} category The media category to fetch results for.\n * @param {InserterMediaRequest} query The query args to use for the request.\n * @param {any} refreshKey Optional value that, when changed, forces\n * a refetch (e.g. after attaching/detaching).\n * @return {{ mediaList: InserterMediaItem[], isLoading: boolean, totalItems: number|undefined, totalPages: number|undefined }} The media results and paging totals.\n */\nexport function useMediaResults( category, query = {}, refreshKey ) {\n\tconst [ mediaList, setMediaList ] = useState();\n\tconst [ totals, setTotals ] = useState( {} );\n\tconst [ isLoading, setIsLoading ] = useState( false );\n\t// We need to keep track of the last request made because\n\t// multiple request can be fired without knowing the order\n\t// of resolution, and we need to ensure we are showing\n\t// the results of the last request.\n\t// In the future we could use AbortController to cancel previous\n\t// requests, but we don't for now as it involves adding support\n\t// for this to `core-data` package.\n\tconst lastRequestRef = useRef();\n\tconst lastQueryKeyRef = useRef();\n\tconst lastFetchRef = useRef();\n\tconst lastSourceRef = useRef();\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tconst key = JSON.stringify( {\n\t\t\t\tcategory: category.name,\n\t\t\t\t...query,\n\t\t\t} );\n\t\t\t// Unique token so identical-query refreshes can't apply stale results.\n\t\t\tconst request = {};\n\t\t\tlastRequestRef.current = request;\n\t\t\tsetIsLoading( true );\n\t\t\t// Only clear the previous results when the category source or query\n\t\t\t// changes, not on a manual refresh (a `refreshKey` bump after\n\t\t\t// attach/detach). Keeping them lets the panel dim the existing grid\n\t\t\t// during the refetch instead of blanking it.\n\t\t\tif (\n\t\t\t\tlastQueryKeyRef.current !== key ||\n\t\t\t\tlastFetchRef.current !== category.fetch\n\t\t\t) {\n\t\t\t\tsetMediaList( [] );\n\t\t\t}\n\t\t\t// Reset paging totals only when the source (category or its `fetch`)\n\t\t\t// changes, so switching to an array-returning source doesn't leave a\n\t\t\t// stale pager showing. A mere page change keeps the previous totals,\n\t\t\t// which is what holds the footer mounted while the next page loads.\n\t\t\tif (\n\t\t\t\tlastSourceRef.current !== category.name ||\n\t\t\t\tlastFetchRef.current !== category.fetch\n\t\t\t) {\n\t\t\t\tsetTotals( {} );\n\t\t\t}\n\t\t\tlastQueryKeyRef.current = key;\n\t\t\tlastFetchRef.current = category.fetch;\n\t\t\tlastSourceRef.current = category.name;\n\t\t\t// Omit the default first page so sources that forward the query to a\n\t\t\t// strict external API don't receive an unexpected `page` arg.\n\t\t\tconst { page, ...queryWithoutPage } = query;\n\t\t\tconst fetchQuery = page > 1 ? query : queryWithoutPage;\n\t\t\tconst { mediaItems, totalItems, totalPages } = normalizeFetchResult(\n\t\t\t\tawait category.fetch?.( fetchQuery )\n\t\t\t);\n\t\t\tif ( request === lastRequestRef.current ) {\n\t\t\t\t// Set together so the grid and the pager never disagree.\n\t\t\t\tsetMediaList( mediaItems );\n\t\t\t\tsetTotals( { totalItems, totalPages } );\n\t\t\t\tsetIsLoading( false );\n\t\t\t}\n\t\t} )();\n\t}, [\n\t\tcategory.name,\n\t\tcategory.fetch,\n\t\t...Object.values( query ),\n\t\trefreshKey,\n\t] );\n\treturn {\n\t\tmediaList,\n\t\tisLoading,\n\t\ttotalItems: totals.totalItems,\n\t\ttotalPages: totals.totalPages,\n\t};\n}\n\n/**\n * Delays surfacing a loading state until a request has been in flight for\n * `delay` ms, so brief operations (e.g. a quick attach/detach refetch) don't\n * flash a loading indicator at all. Mirrors the DataViews `useDelayedLoading`\n * hook.\n *\n * @param {boolean} isLoading Whether a request is currently in flight.\n * @param {number} delay Milliseconds to wait before showing the loader.\n * @return {boolean} Whether the loading state should be shown yet.\n */\nexport function useDelayedLoading( isLoading, delay = 400 ) {\n\tconst [ showLoading, setShowLoading ] = useState( false );\n\tuseEffect( () => {\n\t\tif ( ! isLoading ) {\n\t\t\treturn undefined;\n\t\t}\n\t\tconst timeout = setTimeout( () => setShowLoading( true ), delay );\n\t\treturn () => {\n\t\t\tclearTimeout( timeout );\n\t\t\tsetShowLoading( false );\n\t\t};\n\t}, [ isLoading, delay ] );\n\treturn showLoading;\n}\n\nexport function useMediaCategories( rootClientId ) {\n\tconst [ categories, setCategories ] = useState( [] );\n\n\tconst inserterMediaCategories = useSelect(\n\t\t( select ) =>\n\t\t\tunlock( select( blockEditorStore ) ).getInserterMediaCategories(),\n\t\t[]\n\t);\n\tconst { canInsertImage, canInsertVideo, canInsertAudio } = useSelect(\n\t\t( select ) => {\n\t\t\tconst { canInsertBlockType } = select( blockEditorStore );\n\t\t\treturn {\n\t\t\t\tcanInsertImage: canInsertBlockType(\n\t\t\t\t\t'core/image',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tcanInsertVideo: canInsertBlockType(\n\t\t\t\t\t'core/video',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t\tcanInsertAudio: canInsertBlockType(\n\t\t\t\t\t'core/audio',\n\t\t\t\t\trootClientId\n\t\t\t\t),\n\t\t\t};\n\t\t},\n\t\t[ rootClientId ]\n\t);\n\tuseEffect( () => {\n\t\t( async () => {\n\t\t\tconst _categories = [];\n\t\t\t// If `inserterMediaCategories` is not defined in\n\t\t\t// block editor settings, do not show any media categories.\n\t\t\tif ( ! inserterMediaCategories ) {\n\t\t\t\treturn;\n\t\t\t}\n\t\t\t// Loop through categories to check if they have at least one media item.\n\t\t\tconst categoriesHaveMedia = new Map(\n\t\t\t\tawait Promise.all(\n\t\t\t\t\tinserterMediaCategories.map( async ( category ) => {\n\t\t\t\t\t\t// Some sources are external and we don't need to make a request.\n\t\t\t\t\t\tif ( category.isExternalResource ) {\n\t\t\t\t\t\t\treturn [ category.name, true ];\n\t\t\t\t\t\t}\n\t\t\t\t\t\tlet results = [];\n\t\t\t\t\t\ttry {\n\t\t\t\t\t\t\tconst { mediaItems } = normalizeFetchResult(\n\t\t\t\t\t\t\t\tawait category.fetch( { per_page: 1 } )\n\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\tresults = mediaItems;\n\t\t\t\t\t\t} catch {\n\t\t\t\t\t\t\t// If the request fails, we shallow the error and just don't show\n\t\t\t\t\t\t\t// the category, in order to not break the media tab.\n\t\t\t\t\t\t}\n\t\t\t\t\t\treturn [ category.name, !! results.length ];\n\t\t\t\t\t} )\n\t\t\t\t)\n\t\t\t);\n\t\t\t// We need to filter out categories that don't have any media items or\n\t\t\t// whose corresponding block type is not allowed to be inserted, based\n\t\t\t// on the category's `mediaType`. A category that provides an\n\t\t\t// `emptyMessage` stays in the list even when empty, so it can show\n\t\t\t// that message (e.g. Attachments, to expose its \"Attach\" action).\n\t\t\tconst canInsertMediaType = {\n\t\t\t\timage: canInsertImage,\n\t\t\t\tvideo: canInsertVideo,\n\t\t\t\taudio: canInsertAudio,\n\t\t\t};\n\t\t\tinserterMediaCategories.forEach( ( category ) => {\n\t\t\t\tif (\n\t\t\t\t\tcanInsertMediaType[ category.mediaType ] &&\n\t\t\t\t\t( categoriesHaveMedia.get( category.name ) ||\n\t\t\t\t\t\tcategory.emptyMessage )\n\t\t\t\t) {\n\t\t\t\t\t_categories.push( category );\n\t\t\t\t}\n\t\t\t} );\n\t\t\tif ( !! _categories.length ) {\n\t\t\t\tsetCategories( _categories );\n\t\t\t}\n\t\t} )();\n\t}, [\n\t\tcanInsertImage,\n\t\tcanInsertVideo,\n\t\tcanInsertAudio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UACA;AAAA,QACD;AAAA,MACD;AAAA,IACD;AAAA,IACA,CAAE,YAAa;AAAA,EAChB;AACA,YAAW,MAAM;AAChB,KAAE,YAAY;AACb,YAAM,cAAc,CAAC;AAGrB,UAAK,CAAE,yBAA0B;AAChC;AAAA,MACD;AAEA,YAAM,sBAAsB,IAAI;AAAA,QAC/B,MAAM,QAAQ;AAAA,UACb,wBAAwB,IAAK,OAAQ,aAAc;AAElD,gBAAK,SAAS,oBAAqB;AAClC,qBAAO,CAAE,SAAS,MAAM,IAAK;AAAA,YAC9B;AACA,gBAAI,UAAU,CAAC;AACf,gBAAI;AACH,oBAAM,EAAE,WAAW,IAAI;AAAA,gBACtB,MAAM,SAAS,MAAO,EAAE,UAAU,EAAE,CAAE;AAAA,cACvC;AACA,wBAAU;AAAA,YACX,QAAQ;AAAA,YAGR;AACA,mBAAO,CAAE,SAAS,MAAM,CAAC,CAAE,QAAQ,MAAO;AAAA,UAC3C,CAAE;AAAA,QACH;AAAA,MACD;AAMA,YAAM,qBAAqB;AAAA,QAC1B,OAAO;AAAA,QACP,OAAO;AAAA,QACP,OAAO;AAAA,MACR;AACA,8BAAwB,QAAS,CAAE,aAAc;AAChD,YACC,mBAAoB,SAAS,SAAU,MACrC,oBAAoB,IAAK,SAAS,IAAK,KACxC,SAAS,eACT;AACD,sBAAY,KAAM,QAAS;AAAA,QAC5B;AAAA,MACD,CAAE;AACF,UAAK,CAAC,CAAE,YAAY,QAAS;AAC5B,sBAAe,WAAY;AAAA,MAC5B;AAAA,IACD,GAAI;AAAA,EACL,GAAG;AAAA,IACF;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD,CAAE;AACF,SAAO;AACR;",
6
6
  "names": []
7
7
  }
@@ -2,17 +2,26 @@
2
2
  import clsx from "clsx";
3
3
  import { Button, Modal, Spinner, SearchControl } from "@wordpress/components";
4
4
  import { __, _n, sprintf } from "@wordpress/i18n";
5
- import { useCallback, useMemo, useState } from "@wordpress/element";
6
- import { useDebouncedInput } from "@wordpress/compose";
5
+ import {
6
+ useCallback,
7
+ useEffect,
8
+ useMemo,
9
+ useRef,
10
+ useState
11
+ } from "@wordpress/element";
12
+ import { useDebouncedInput, usePrevious } from "@wordpress/compose";
7
13
  import { useDispatch } from "@wordpress/data";
14
+ import { getScrollContainer } from "@wordpress/dom";
8
15
  import { store as noticesStore } from "@wordpress/notices";
16
+ import { Stack } from "@wordpress/ui";
9
17
  import MediaList from "./media-list.mjs";
10
18
  import MediaUpload from "../../media-upload/index.mjs";
11
19
  import MediaUploadCheck from "../../media-upload/check.mjs";
12
20
  import { useMediaResults, useDelayedLoading } from "./hooks.mjs";
13
21
  import InserterNoResults from "../no-results.mjs";
22
+ import BlockPatternsPaging from "../../block-patterns-paging/index.mjs";
14
23
  import { jsx, jsxs } from "react/jsx-runtime";
15
- var INITIAL_MEDIA_ITEMS_PER_PAGE = 10;
24
+ var MEDIA_ITEMS_PER_PAGE = 20;
16
25
  var ATTACH_ALLOWED_TYPES = ["image"];
17
26
  function AttachImagesButton({ onSelect }) {
18
27
  return /* @__PURE__ */ jsx(MediaUploadCheck, { children: /* @__PURE__ */ jsx(
@@ -41,29 +50,62 @@ function AttachImagesButton({ onSelect }) {
41
50
  }
42
51
  function MediaCategoryPanel({ rootClientId, onInsert, category }) {
43
52
  const [search, setSearch, debouncedSearch] = useDebouncedInput();
53
+ const [page, setPage] = useState(1);
54
+ const previousCategory = usePrevious(category.name);
55
+ const previousSearch = usePrevious(debouncedSearch);
56
+ if ((previousCategory !== category.name || previousSearch !== debouncedSearch) && page !== 1) {
57
+ setPage(1);
58
+ }
44
59
  const query = useMemo(
45
60
  () => ({
46
- per_page: !!debouncedSearch ? 20 : INITIAL_MEDIA_ITEMS_PER_PAGE,
61
+ per_page: MEDIA_ITEMS_PER_PAGE,
62
+ page,
47
63
  search: debouncedSearch
48
64
  }),
49
- [debouncedSearch]
65
+ [page, debouncedSearch]
50
66
  );
51
67
  const [refreshKey, setRefreshKey] = useState(0);
52
- const { mediaList, isLoading } = useMediaResults(
68
+ const { mediaList, isLoading, totalItems, totalPages } = useMediaResults(
53
69
  category,
54
70
  query,
55
71
  refreshKey
56
72
  );
73
+ const numPages = totalPages || 1;
74
+ if (typeof totalPages === "number" && page > numPages) {
75
+ setPage(numPages);
76
+ }
77
+ const supportsAttachments = !category.isExternalResource;
78
+ const attach = supportsAttachments ? category.attach : void 0;
79
+ const detach = supportsAttachments ? category.detach : void 0;
80
+ const subscribe = supportsAttachments ? category.subscribe : void 0;
81
+ const showPagination = numPages > 1;
82
+ const hasFooter = showPagination || !!attach;
83
+ const scrollContainerRef = useRef();
84
+ const changePage = useCallback((nextPage) => {
85
+ const scrollContainer = getScrollContainer(
86
+ scrollContainerRef.current
87
+ );
88
+ scrollContainer?.scrollTo(0, 0);
89
+ setPage(nextPage);
90
+ }, []);
57
91
  const { createErrorNotice, createSuccessNotice, createWarningNotice } = useDispatch(noticesStore);
58
92
  const showRefreshing = useDelayedLoading(isLoading);
59
93
  const refresh = useCallback(() => {
60
- category.invalidate?.(query);
94
+ if (supportsAttachments) {
95
+ category.invalidate?.(query);
96
+ }
61
97
  setRefreshKey((key) => key + 1);
62
- }, [category, query]);
98
+ }, [category, query, supportsAttachments]);
99
+ useEffect(() => {
100
+ if (!subscribe) {
101
+ return;
102
+ }
103
+ return subscribe(() => setRefreshKey((key) => key + 1), query);
104
+ }, [subscribe, query]);
63
105
  const handleAttach = useCallback(
64
106
  async (selectedMedia) => {
65
107
  try {
66
- const attachedCount = await category.attach(selectedMedia);
108
+ const attachedCount = await attach(selectedMedia);
67
109
  if (!attachedCount) {
68
110
  createWarningNotice(__("No images were attached."), {
69
111
  type: "snackbar",
@@ -101,6 +143,7 @@ function MediaCategoryPanel({ rootClientId, onInsert, category }) {
101
143
  }
102
144
  },
103
145
  [
146
+ attach,
104
147
  category,
105
148
  refresh,
106
149
  createErrorNotice,
@@ -111,7 +154,7 @@ function MediaCategoryPanel({ rootClientId, onInsert, category }) {
111
154
  const handleDetach = useCallback(
112
155
  async (media) => {
113
156
  try {
114
- await category.detach(media);
157
+ await detach(media);
115
158
  refresh();
116
159
  createSuccessNotice(
117
160
  category.postTypeLabel ? sprintf(
@@ -128,7 +171,7 @@ function MediaCategoryPanel({ rootClientId, onInsert, category }) {
128
171
  });
129
172
  }
130
173
  },
131
- [category, refresh, createErrorNotice, createSuccessNotice]
174
+ [detach, category, refresh, createErrorNotice, createSuccessNotice]
132
175
  );
133
176
  const [mediaPendingDetach, setMediaPendingDetach] = useState();
134
177
  const confirmDetach = useCallback(() => {
@@ -141,10 +184,11 @@ function MediaCategoryPanel({ rootClientId, onInsert, category }) {
141
184
  return /* @__PURE__ */ jsxs(
142
185
  "div",
143
186
  {
187
+ ref: scrollContainerRef,
144
188
  className: clsx(baseCssClass, {
145
- // The attach footer supplies the breathing room beneath the
146
- // grid, so the list drops its own bottom padding (see styles).
147
- "has-attach-footer": !!category.attach
189
+ // The footer supplies the breathing room beneath the grid, so the
190
+ // list drops its own bottom padding (see styles).
191
+ "has-footer": hasFooter
148
192
  }),
149
193
  children: [
150
194
  /* @__PURE__ */ jsx(
@@ -180,16 +224,40 @@ function MediaCategoryPanel({ rootClientId, onInsert, category }) {
180
224
  {
181
225
  rootClientId,
182
226
  onClick: onInsert,
183
- onDetach: category.detach ? setMediaPendingDetach : void 0,
227
+ onDetach: detach ? setMediaPendingDetach : void 0,
184
228
  mediaList,
185
229
  category
186
230
  }
187
231
  )
188
232
  }
189
233
  ),
190
- category.attach && // Pinned to the bottom of the panel as a fixed footer so it lines
191
- // up with the "Open Media Library" button in the adjacent column.
192
- /* @__PURE__ */ jsx(AttachImagesButton, { onSelect: handleAttach }),
234
+ hasFooter && // A single footer wrapper owns the top and horizontal breathing
235
+ // room, so the pager and attach button don't span the full width
236
+ // and sit clear of the grid above (see styles).
237
+ /* @__PURE__ */ jsxs(
238
+ Stack,
239
+ {
240
+ direction: "column",
241
+ gap: "sm",
242
+ className: `${baseCssClass}-footer`,
243
+ children: [
244
+ showPagination && // Reuse the Patterns tab pager (presentational only); only
245
+ // rendered for multi-page sources (see `showPagination`).
246
+ /* @__PURE__ */ jsx(
247
+ BlockPatternsPaging,
248
+ {
249
+ currentPage: page,
250
+ numPages,
251
+ changePage,
252
+ totalItems
253
+ }
254
+ ),
255
+ attach && // Lines up with the "Open Media Library" button in the
256
+ // adjacent column.
257
+ /* @__PURE__ */ jsx(AttachImagesButton, { onSelect: handleAttach })
258
+ ]
259
+ }
260
+ ),
193
261
  mediaPendingDetach && // A plain `Modal` (not `ConfirmDialog`) so we can pass
194
262
  // `overlayClassName` and stack it above the options dropdown that
195
263
  // opened it (see the z-index entry in `_z-index.scss`).