@wordpress/block-editor 17.1.0 → 17.2.1-next.v.202609171837.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 (541) hide show
  1. package/CHANGELOG.md +32 -0
  2. package/README.md +214 -214
  3. package/build/autocompleters/block.cjs.map +2 -2
  4. package/build/components/alignment-control/ui.cjs.map +2 -2
  5. package/build/components/background-image-control/index.cjs +1 -1
  6. package/build/components/background-image-control/index.cjs.map +2 -2
  7. package/build/components/block-alignment-control/ui.cjs +21 -7
  8. package/build/components/block-alignment-control/ui.cjs.map +3 -3
  9. package/build/components/block-alignment-control/use-available-alignments.cjs +60 -13
  10. package/build/components/block-alignment-control/use-available-alignments.cjs.map +2 -2
  11. package/build/components/block-allowed-blocks/allowed-blocks-control.cjs.map +2 -2
  12. package/build/components/block-bindings/attribute-control.cjs +30 -30
  13. package/build/components/block-bindings/attribute-control.cjs.map +3 -3
  14. package/build/components/block-bindings/source-fields-list.cjs +27 -32
  15. package/build/components/block-bindings/source-fields-list.cjs.map +3 -3
  16. package/build/components/block-canvas/index.cjs.map +2 -2
  17. package/build/components/block-card/index.cjs +1 -2
  18. package/build/components/block-card/index.cjs.map +3 -3
  19. package/build/components/block-edit/edit.cjs.map +2 -2
  20. package/build/components/block-heading-level-dropdown/index.cjs.map +2 -2
  21. package/build/components/block-icon/index.cjs.map +2 -2
  22. package/build/components/block-inspector/edit-contents.cjs.map +2 -2
  23. package/build/components/block-inspector/index.cjs +27 -8
  24. package/build/components/block-inspector/index.cjs.map +3 -3
  25. package/build/components/block-keyboard-shortcuts/index.cjs.map +2 -2
  26. package/build/components/block-list/block-html.cjs +1 -12
  27. package/build/components/block-list/block-html.cjs.map +3 -3
  28. package/build/components/block-list/block.cjs +2 -4
  29. package/build/components/block-list/block.cjs.map +2 -2
  30. package/build/components/block-list/layout.cjs +1 -1
  31. package/build/components/block-list/layout.cjs.map +2 -2
  32. package/build/components/block-list/use-block-props/index.cjs.map +2 -2
  33. package/build/components/block-lock/modal.cjs +1 -3
  34. package/build/components/block-lock/modal.cjs.map +2 -2
  35. package/build/components/block-parent-selector/index.cjs +8 -5
  36. package/build/components/block-parent-selector/index.cjs.map +2 -2
  37. package/build/components/block-popover/index.cjs.map +2 -2
  38. package/build/components/block-rename/modal.cjs.map +2 -2
  39. package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +2 -2
  40. package/build/components/block-styles/utils.cjs.map +2 -2
  41. package/build/components/block-switcher/index.cjs.map +2 -2
  42. package/build/components/block-toolbar/edit-section-button.cjs.map +2 -2
  43. package/build/components/block-toolbar/index.cjs +6 -4
  44. package/build/components/block-toolbar/index.cjs.map +2 -2
  45. package/build/components/block-toolbar/switch-section-style.cjs.map +2 -2
  46. package/build/components/block-variation-transforms/index.cjs +28 -18
  47. package/build/components/block-variation-transforms/index.cjs.map +3 -3
  48. package/build/components/block-visibility/modal.cjs.map +2 -2
  49. package/build/components/block-visibility/viewport-visibility-info.cjs.map +2 -2
  50. package/build/components/border-radius-control/index.cjs.map +2 -2
  51. package/build/components/color-palette/with-color-context.cjs.map +2 -2
  52. package/build/components/colors/with-colors.cjs.map +2 -2
  53. package/build/components/colors-gradients/control.cjs.map +2 -2
  54. package/build/components/contrast-checker/index.cjs.map +2 -2
  55. package/build/components/date-format-picker/index.cjs.map +2 -2
  56. package/build/components/dimensions-tool/aspect-ratio-tool.cjs.map +3 -3
  57. package/build/components/dimensions-tool/width-height-tool.cjs.map +2 -2
  58. package/build/components/font-sizes/with-font-sizes.cjs.map +2 -2
  59. package/build/components/global-styles/background-panel.cjs +1 -1
  60. package/build/components/global-styles/background-panel.cjs.map +2 -2
  61. package/build/components/global-styles/border-panel.cjs +1 -1
  62. package/build/components/global-styles/border-panel.cjs.map +2 -2
  63. package/build/components/global-styles/color-gradient-dropdown-item.cjs +1 -1
  64. package/build/components/global-styles/color-gradient-dropdown-item.cjs.map +2 -2
  65. package/build/components/global-styles/color-panel.cjs +1 -1
  66. package/build/components/global-styles/color-panel.cjs.map +2 -2
  67. package/build/components/global-styles/dimensions-panel.cjs +1 -1
  68. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  69. package/build/components/global-styles/filters-panel.cjs +1 -1
  70. package/build/components/global-styles/filters-panel.cjs.map +2 -2
  71. package/build/components/global-styles/hooks.cjs +1 -0
  72. package/build/components/global-styles/hooks.cjs.map +2 -2
  73. package/build/components/global-styles/inheritance/index.cjs +3 -3
  74. package/build/components/global-styles/inheritance/index.cjs.map +2 -2
  75. package/build/components/global-styles/inherited-value-context.cjs +0 -5
  76. package/build/components/global-styles/inherited-value-context.cjs.map +2 -2
  77. package/build/components/global-styles/state-control-badges.cjs +0 -1
  78. package/build/components/global-styles/state-control-badges.cjs.map +2 -2
  79. package/build/components/global-styles/state-control.cjs +6 -4
  80. package/build/components/global-styles/state-control.cjs.map +2 -2
  81. package/build/components/global-styles/text-shadow-panel.cjs +254 -0
  82. package/build/components/global-styles/text-shadow-panel.cjs.map +7 -0
  83. package/build/components/global-styles/typography-panel.cjs +46 -5
  84. package/build/components/global-styles/typography-panel.cjs.map +2 -2
  85. package/build/components/global-styles/typography-utils.cjs.map +2 -2
  86. package/build/components/global-styles/utils.cjs.map +2 -2
  87. package/build/components/html-element-control/index.cjs.map +3 -3
  88. package/build/components/iframe/index.cjs.map +2 -2
  89. package/build/components/iframe/use-scale-canvas.cjs.map +2 -2
  90. package/build/components/image-size-control/index.cjs.map +3 -3
  91. package/build/components/inner-blocks/index.cjs +6 -1
  92. package/build/components/inner-blocks/index.cjs.map +2 -2
  93. package/build/components/inner-content/index.cjs.map +2 -2
  94. package/build/components/inserter/block-patterns-tab/use-pattern-categories.cjs +4 -23
  95. package/build/components/inserter/block-patterns-tab/use-pattern-categories.cjs.map +2 -2
  96. package/build/components/inserter/block-patterns-tab/utils.cjs +26 -0
  97. package/build/components/inserter/block-patterns-tab/utils.cjs.map +2 -2
  98. package/build/components/inserter/hooks/use-block-types-state.cjs.map +2 -2
  99. package/build/components/inserter/hooks/use-insertion-point.cjs.map +2 -2
  100. package/build/components/inserter/hooks/use-patterns-state.cjs.map +2 -2
  101. package/build/components/inserter/media-tab/media-panel.cjs.map +2 -2
  102. package/build/components/inserter/media-tab/media-preview.cjs.map +2 -2
  103. package/build/components/inserter-list-item/index.cjs.map +2 -2
  104. package/build/components/inspector-controls/list-view-content-popover.cjs.map +2 -2
  105. package/build/components/link-control/search-results.cjs.map +2 -2
  106. package/build/components/link-control/use-search-handler.cjs +3 -0
  107. package/build/components/link-control/use-search-handler.cjs.map +2 -2
  108. package/build/components/list-view/branch.cjs.map +2 -2
  109. package/build/components/list-view/drop-indicator.cjs.map +2 -2
  110. package/build/components/list-view/index.cjs.map +2 -2
  111. package/build/components/list-view/use-list-view-drop-zone.cjs.map +2 -2
  112. package/build/components/list-view/utils.cjs.map +2 -2
  113. package/build/components/media-replace-flow/index.cjs +4 -1
  114. package/build/components/media-replace-flow/index.cjs.map +2 -2
  115. package/build/components/plain-text/index.cjs +1 -2
  116. package/build/components/plain-text/index.cjs.map +3 -3
  117. package/build/components/preset-input-control/index.cjs.map +2 -2
  118. package/build/components/provider/index.cjs +3 -1
  119. package/build/components/provider/index.cjs.map +2 -2
  120. package/build/components/provider/use-block-sync.cjs.map +2 -2
  121. package/build/components/publish-date-time-picker/index.cjs.map +2 -2
  122. package/build/components/resizable-box-popover/index.cjs +1 -1
  123. package/build/components/resizable-box-popover/index.cjs.map +1 -1
  124. package/build/components/resolution-tool/index.cjs.map +3 -3
  125. package/build/components/rich-text/event-listeners/enter.cjs +8 -22
  126. package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
  127. package/build/components/rich-text/format-edit.cjs.map +2 -2
  128. package/build/components/rich-text/index.cjs +20 -0
  129. package/build/components/rich-text/index.cjs.map +2 -2
  130. package/build/components/rich-text/multiline.cjs +10 -2
  131. package/build/components/rich-text/multiline.cjs.map +2 -2
  132. package/build/components/spacing-sizes-control/hooks/use-spacing-sizes.cjs.map +2 -2
  133. package/build/components/typewriter/index.cjs.map +2 -2
  134. package/build/components/use-block-commands/index.cjs.map +2 -2
  135. package/build/components/writing-flow/index.cjs +3 -0
  136. package/build/components/writing-flow/index.cjs.map +2 -2
  137. package/build/components/writing-flow/use-clipboard-handler.cjs.map +2 -2
  138. package/build/components/writing-flow/use-selection-observer.cjs +5 -3
  139. package/build/components/writing-flow/use-selection-observer.cjs.map +2 -2
  140. package/build/hooks/align.cjs +3 -5
  141. package/build/hooks/align.cjs.map +2 -2
  142. package/build/hooks/background.cjs.map +2 -2
  143. package/build/hooks/block-bindings.cjs.map +2 -2
  144. package/build/hooks/border.cjs.map +2 -2
  145. package/build/hooks/contrast-checker.cjs.map +2 -2
  146. package/build/hooks/dimensions.cjs.map +2 -2
  147. package/build/hooks/duotone.cjs.map +2 -2
  148. package/build/hooks/elements.cjs.map +2 -2
  149. package/build/hooks/fit-text.cjs.map +2 -2
  150. package/build/hooks/gap.cjs +2 -1
  151. package/build/hooks/gap.cjs.map +3 -3
  152. package/build/hooks/index.cjs +4 -2
  153. package/build/hooks/index.cjs.map +3 -3
  154. package/build/hooks/layout-child.cjs.map +2 -2
  155. package/build/hooks/layout.cjs +15 -14
  156. package/build/hooks/layout.cjs.map +3 -3
  157. package/build/hooks/position.cjs +3 -31
  158. package/build/hooks/position.cjs.map +2 -2
  159. package/build/hooks/states.cjs +3 -2
  160. package/build/hooks/states.cjs.map +2 -2
  161. package/build/hooks/text-shadow.cjs +100 -0
  162. package/build/hooks/text-shadow.cjs.map +7 -0
  163. package/build/hooks/typography.cjs +30 -6
  164. package/build/hooks/typography.cjs.map +2 -2
  165. package/build/hooks/utils.cjs +24 -2
  166. package/build/hooks/utils.cjs.map +2 -2
  167. package/build/layouts/grid.cjs.map +2 -2
  168. package/build/layouts/utils.cjs +7 -2
  169. package/build/layouts/utils.cjs.map +2 -2
  170. package/build/private-apis.cjs +9 -6
  171. package/build/private-apis.cjs.map +2 -2
  172. package/build/store/actions.cjs +26 -4
  173. package/build/store/actions.cjs.map +3 -3
  174. package/build/store/private-selectors.cjs.map +2 -2
  175. package/build/store/reducer.cjs.map +2 -2
  176. package/build/store/selectors.cjs.map +2 -2
  177. package/build/utils/get-font-styles-and-weights.cjs.map +2 -2
  178. package/build/utils/transform-styles/index.cjs.map +1 -1
  179. package/build-module/autocompleters/block.mjs.map +2 -2
  180. package/build-module/components/alignment-control/ui.mjs.map +2 -2
  181. package/build-module/components/background-image-control/index.mjs +2 -2
  182. package/build-module/components/background-image-control/index.mjs.map +2 -2
  183. package/build-module/components/block-alignment-control/ui.mjs +21 -7
  184. package/build-module/components/block-alignment-control/ui.mjs.map +2 -2
  185. package/build-module/components/block-alignment-control/use-available-alignments.mjs +56 -13
  186. package/build-module/components/block-alignment-control/use-available-alignments.mjs.map +2 -2
  187. package/build-module/components/block-allowed-blocks/allowed-blocks-control.mjs.map +2 -2
  188. package/build-module/components/block-bindings/attribute-control.mjs +31 -32
  189. package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
  190. package/build-module/components/block-bindings/source-fields-list.mjs +25 -30
  191. package/build-module/components/block-bindings/source-fields-list.mjs.map +2 -2
  192. package/build-module/components/block-canvas/index.mjs.map +2 -2
  193. package/build-module/components/block-card/index.mjs +3 -8
  194. package/build-module/components/block-card/index.mjs.map +2 -2
  195. package/build-module/components/block-edit/edit.mjs.map +2 -2
  196. package/build-module/components/block-heading-level-dropdown/index.mjs.map +2 -2
  197. package/build-module/components/block-icon/index.mjs.map +2 -2
  198. package/build-module/components/block-inspector/edit-contents.mjs.map +2 -2
  199. package/build-module/components/block-inspector/index.mjs +29 -10
  200. package/build-module/components/block-inspector/index.mjs.map +2 -2
  201. package/build-module/components/block-keyboard-shortcuts/index.mjs.map +2 -2
  202. package/build-module/components/block-list/block-html.mjs +1 -2
  203. package/build-module/components/block-list/block-html.mjs.map +2 -2
  204. package/build-module/components/block-list/block.mjs +2 -4
  205. package/build-module/components/block-list/block.mjs.map +2 -2
  206. package/build-module/components/block-list/layout.mjs +1 -1
  207. package/build-module/components/block-list/layout.mjs.map +2 -2
  208. package/build-module/components/block-list/use-block-props/index.mjs.map +2 -2
  209. package/build-module/components/block-lock/modal.mjs +1 -3
  210. package/build-module/components/block-lock/modal.mjs.map +2 -2
  211. package/build-module/components/block-parent-selector/index.mjs +8 -5
  212. package/build-module/components/block-parent-selector/index.mjs.map +2 -2
  213. package/build-module/components/block-popover/index.mjs.map +2 -2
  214. package/build-module/components/block-rename/modal.mjs.map +2 -2
  215. package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
  216. package/build-module/components/block-styles/utils.mjs.map +2 -2
  217. package/build-module/components/block-switcher/index.mjs.map +2 -2
  218. package/build-module/components/block-toolbar/edit-section-button.mjs.map +2 -2
  219. package/build-module/components/block-toolbar/index.mjs +6 -4
  220. package/build-module/components/block-toolbar/index.mjs.map +2 -2
  221. package/build-module/components/block-toolbar/switch-section-style.mjs.map +2 -2
  222. package/build-module/components/block-variation-transforms/index.mjs +30 -21
  223. package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
  224. package/build-module/components/block-visibility/modal.mjs.map +2 -2
  225. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
  226. package/build-module/components/border-radius-control/index.mjs.map +2 -2
  227. package/build-module/components/color-palette/with-color-context.mjs.map +2 -2
  228. package/build-module/components/colors/with-colors.mjs.map +2 -2
  229. package/build-module/components/colors-gradients/control.mjs.map +2 -2
  230. package/build-module/components/contrast-checker/index.mjs.map +2 -2
  231. package/build-module/components/date-format-picker/index.mjs.map +2 -2
  232. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs +2 -2
  233. package/build-module/components/dimensions-tool/aspect-ratio-tool.mjs.map +2 -2
  234. package/build-module/components/dimensions-tool/width-height-tool.mjs.map +2 -2
  235. package/build-module/components/font-sizes/with-font-sizes.mjs.map +2 -2
  236. package/build-module/components/global-styles/background-panel.mjs +2 -2
  237. package/build-module/components/global-styles/background-panel.mjs.map +2 -2
  238. package/build-module/components/global-styles/border-panel.mjs +2 -2
  239. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  240. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs +2 -2
  241. package/build-module/components/global-styles/color-gradient-dropdown-item.mjs.map +2 -2
  242. package/build-module/components/global-styles/color-panel.mjs +2 -2
  243. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  244. package/build-module/components/global-styles/dimensions-panel.mjs +2 -2
  245. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  246. package/build-module/components/global-styles/filters-panel.mjs +2 -2
  247. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  248. package/build-module/components/global-styles/hooks.mjs +1 -0
  249. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  250. package/build-module/components/global-styles/inheritance/index.mjs +2 -2
  251. package/build-module/components/global-styles/inheritance/index.mjs.map +2 -2
  252. package/build-module/components/global-styles/inherited-value-context.mjs +0 -5
  253. package/build-module/components/global-styles/inherited-value-context.mjs.map +2 -2
  254. package/build-module/components/global-styles/state-control-badges.mjs +0 -1
  255. package/build-module/components/global-styles/state-control-badges.mjs.map +2 -2
  256. package/build-module/components/global-styles/state-control.mjs +6 -4
  257. package/build-module/components/global-styles/state-control.mjs.map +2 -2
  258. package/build-module/components/global-styles/text-shadow-panel.mjs +224 -0
  259. package/build-module/components/global-styles/text-shadow-panel.mjs.map +7 -0
  260. package/build-module/components/global-styles/typography-panel.mjs +47 -6
  261. package/build-module/components/global-styles/typography-panel.mjs.map +2 -2
  262. package/build-module/components/global-styles/typography-utils.mjs.map +2 -2
  263. package/build-module/components/global-styles/utils.mjs.map +2 -2
  264. package/build-module/components/html-element-control/index.mjs +2 -2
  265. package/build-module/components/html-element-control/index.mjs.map +2 -2
  266. package/build-module/components/iframe/index.mjs.map +2 -2
  267. package/build-module/components/iframe/use-scale-canvas.mjs.map +2 -2
  268. package/build-module/components/image-size-control/index.mjs +2 -2
  269. package/build-module/components/image-size-control/index.mjs.map +2 -2
  270. package/build-module/components/inner-blocks/index.mjs +6 -1
  271. package/build-module/components/inner-blocks/index.mjs.map +2 -2
  272. package/build-module/components/inner-content/index.mjs.map +2 -2
  273. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.mjs +6 -24
  274. package/build-module/components/inserter/block-patterns-tab/use-pattern-categories.mjs.map +2 -2
  275. package/build-module/components/inserter/block-patterns-tab/utils.mjs +25 -0
  276. package/build-module/components/inserter/block-patterns-tab/utils.mjs.map +2 -2
  277. package/build-module/components/inserter/hooks/use-block-types-state.mjs.map +2 -2
  278. package/build-module/components/inserter/hooks/use-insertion-point.mjs.map +2 -2
  279. package/build-module/components/inserter/hooks/use-patterns-state.mjs.map +2 -2
  280. package/build-module/components/inserter/media-tab/media-panel.mjs.map +2 -2
  281. package/build-module/components/inserter/media-tab/media-preview.mjs.map +2 -2
  282. package/build-module/components/inserter-list-item/index.mjs.map +2 -2
  283. package/build-module/components/inspector-controls/list-view-content-popover.mjs.map +2 -2
  284. package/build-module/components/link-control/search-results.mjs.map +2 -2
  285. package/build-module/components/link-control/use-search-handler.mjs +3 -0
  286. package/build-module/components/link-control/use-search-handler.mjs.map +2 -2
  287. package/build-module/components/list-view/branch.mjs.map +2 -2
  288. package/build-module/components/list-view/drop-indicator.mjs.map +2 -2
  289. package/build-module/components/list-view/index.mjs.map +2 -2
  290. package/build-module/components/list-view/use-list-view-drop-zone.mjs.map +2 -2
  291. package/build-module/components/list-view/utils.mjs.map +2 -2
  292. package/build-module/components/media-replace-flow/index.mjs +4 -1
  293. package/build-module/components/media-replace-flow/index.mjs.map +2 -2
  294. package/build-module/components/plain-text/index.mjs +1 -2
  295. package/build-module/components/plain-text/index.mjs.map +2 -2
  296. package/build-module/components/preset-input-control/index.mjs.map +2 -2
  297. package/build-module/components/provider/index.mjs +3 -1
  298. package/build-module/components/provider/index.mjs.map +2 -2
  299. package/build-module/components/provider/use-block-sync.mjs.map +2 -2
  300. package/build-module/components/publish-date-time-picker/index.mjs.map +2 -2
  301. package/build-module/components/resizable-box-popover/index.mjs +1 -1
  302. package/build-module/components/resizable-box-popover/index.mjs.map +1 -1
  303. package/build-module/components/resolution-tool/index.mjs +2 -2
  304. package/build-module/components/resolution-tool/index.mjs.map +2 -2
  305. package/build-module/components/rich-text/event-listeners/enter.mjs +8 -22
  306. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  307. package/build-module/components/rich-text/format-edit.mjs.map +2 -2
  308. package/build-module/components/rich-text/index.mjs +21 -0
  309. package/build-module/components/rich-text/index.mjs.map +2 -2
  310. package/build-module/components/rich-text/multiline.mjs +11 -3
  311. package/build-module/components/rich-text/multiline.mjs.map +2 -2
  312. package/build-module/components/spacing-sizes-control/hooks/use-spacing-sizes.mjs.map +2 -2
  313. package/build-module/components/typewriter/index.mjs.map +2 -2
  314. package/build-module/components/use-block-commands/index.mjs.map +2 -2
  315. package/build-module/components/writing-flow/index.mjs +3 -0
  316. package/build-module/components/writing-flow/index.mjs.map +2 -2
  317. package/build-module/components/writing-flow/use-clipboard-handler.mjs.map +2 -2
  318. package/build-module/components/writing-flow/use-selection-observer.mjs +5 -3
  319. package/build-module/components/writing-flow/use-selection-observer.mjs.map +2 -2
  320. package/build-module/hooks/align.mjs +6 -6
  321. package/build-module/hooks/align.mjs.map +2 -2
  322. package/build-module/hooks/background.mjs.map +2 -2
  323. package/build-module/hooks/block-bindings.mjs.map +2 -2
  324. package/build-module/hooks/border.mjs.map +2 -2
  325. package/build-module/hooks/contrast-checker.mjs.map +2 -2
  326. package/build-module/hooks/dimensions.mjs.map +2 -2
  327. package/build-module/hooks/duotone.mjs.map +2 -2
  328. package/build-module/hooks/elements.mjs.map +2 -2
  329. package/build-module/hooks/fit-text.mjs.map +2 -2
  330. package/build-module/hooks/gap.mjs +2 -1
  331. package/build-module/hooks/gap.mjs.map +2 -2
  332. package/build-module/hooks/index.mjs +4 -2
  333. package/build-module/hooks/index.mjs.map +2 -2
  334. package/build-module/hooks/layout-child.mjs.map +2 -2
  335. package/build-module/hooks/layout.mjs +6 -5
  336. package/build-module/hooks/layout.mjs.map +2 -2
  337. package/build-module/hooks/position.mjs +5 -33
  338. package/build-module/hooks/position.mjs.map +2 -2
  339. package/build-module/hooks/states.mjs +3 -2
  340. package/build-module/hooks/states.mjs.map +2 -2
  341. package/build-module/hooks/text-shadow.mjs +65 -0
  342. package/build-module/hooks/text-shadow.mjs.map +7 -0
  343. package/build-module/hooks/typography.mjs +30 -6
  344. package/build-module/hooks/typography.mjs.map +2 -2
  345. package/build-module/hooks/utils.mjs +24 -2
  346. package/build-module/hooks/utils.mjs.map +2 -2
  347. package/build-module/layouts/grid.mjs.map +2 -2
  348. package/build-module/layouts/utils.mjs +5 -1
  349. package/build-module/layouts/utils.mjs.map +2 -2
  350. package/build-module/private-apis.mjs +6 -2
  351. package/build-module/private-apis.mjs.map +2 -2
  352. package/build-module/store/actions.mjs +28 -5
  353. package/build-module/store/actions.mjs.map +3 -3
  354. package/build-module/store/private-selectors.mjs.map +2 -2
  355. package/build-module/store/reducer.mjs.map +2 -2
  356. package/build-module/store/selectors.mjs.map +2 -2
  357. package/build-module/utils/get-font-styles-and-weights.mjs.map +2 -2
  358. package/build-module/utils/transform-styles/index.mjs.map +1 -1
  359. package/build-style/content-rtl.css +7 -2
  360. package/build-style/content.css +7 -2
  361. package/build-style/style-rtl.css +90 -25
  362. package/build-style/style.css +92 -25
  363. package/package.json +42 -43
  364. package/src/autocompleters/block.jsx +4 -4
  365. package/src/components/alignment-control/ui.jsx +1 -1
  366. package/src/components/background-image-control/index.jsx +3 -3
  367. package/src/components/block-alignment-control/test/index.jsdom.test.jsx +267 -0
  368. package/src/components/block-alignment-control/ui.jsx +47 -9
  369. package/src/components/block-alignment-control/use-available-alignments.js +106 -20
  370. package/src/components/block-allowed-blocks/allowed-blocks-control.jsx +1 -1
  371. package/src/components/block-bindings/attribute-control.jsx +27 -29
  372. package/src/components/block-bindings/source-fields-list.jsx +22 -32
  373. package/src/components/block-bindings/test/attribute-control.jsdom.test.jsx +115 -0
  374. package/src/components/block-canvas/index.jsx +1 -1
  375. package/src/components/block-card/index.jsx +5 -11
  376. package/src/components/block-card/style.scss +1 -0
  377. package/src/components/block-edit/edit.jsx +1 -1
  378. package/src/components/block-heading-level-dropdown/index.jsx +1 -1
  379. package/src/components/block-icon/index.jsx +1 -1
  380. package/src/components/block-icon/test/index.browser.test.jsx +74 -0
  381. package/src/components/block-inspector/edit-contents.jsx +2 -2
  382. package/src/components/block-inspector/index.jsx +46 -15
  383. package/src/components/block-inspector/style.scss +16 -0
  384. package/src/components/block-keyboard-shortcuts/index.jsx +2 -2
  385. package/src/components/block-list/block-html.jsx +2 -3
  386. package/src/components/block-list/block.jsx +7 -5
  387. package/src/components/block-list/content.scss +3 -2
  388. package/src/components/block-list/layout.jsx +4 -1
  389. package/src/components/block-list/test/layout.jsdom.test.js +40 -0
  390. package/src/components/block-list/use-block-props/index.js +1 -1
  391. package/src/components/block-lock/modal.jsx +2 -3
  392. package/src/components/block-lock/style.scss +1 -1
  393. package/src/components/block-mover/style.scss +0 -13
  394. package/src/components/block-parent-selector/index.jsx +12 -6
  395. package/src/components/block-patterns-list/style.scss +1 -1
  396. package/src/components/block-popover/index.jsx +1 -1
  397. package/src/components/block-rename/modal.jsx +3 -3
  398. package/src/components/block-settings-menu/block-settings-dropdown.jsx +1 -1
  399. package/src/components/block-styles/utils.js +1 -1
  400. package/src/components/block-switcher/index.jsx +3 -3
  401. package/src/components/block-toolbar/edit-section-button.jsx +2 -2
  402. package/src/components/block-toolbar/index.jsx +8 -4
  403. package/src/components/block-toolbar/switch-section-style.jsx +1 -1
  404. package/src/components/block-variation-transforms/index.jsx +24 -23
  405. package/src/components/block-variation-transforms/test/index.jsdom.test.jsx +93 -0
  406. package/src/components/block-visibility/modal.jsx +7 -7
  407. package/src/components/block-visibility/style.scss +1 -1
  408. package/src/components/block-visibility/viewport-visibility-info.jsx +5 -7
  409. package/src/components/border-radius-control/index.jsx +2 -2
  410. package/src/components/border-radius-control/test/index.jsdom.test.jsx +0 -22
  411. package/src/components/border-radius-control/test/select.browser.test.js +30 -0
  412. package/src/components/color-palette/with-color-context.jsx +1 -1
  413. package/src/components/colors/with-colors.jsx +1 -1
  414. package/src/components/colors-gradients/control.jsx +2 -2
  415. package/src/components/colors-gradients/test/{control.jsdom.test.jsx → control.browser.test.jsx} +6 -9
  416. package/src/components/contrast-checker/index.jsx +2 -2
  417. package/src/components/date-format-picker/index.jsx +2 -2
  418. package/src/components/dimensions-tool/aspect-ratio-tool.jsx +4 -4
  419. package/src/components/dimensions-tool/test/index.jsdom.test.jsx +17 -11
  420. package/src/components/dimensions-tool/width-height-tool.jsx +2 -2
  421. package/src/components/font-sizes/with-font-sizes.jsx +2 -3
  422. package/src/components/global-styles/background-panel.jsx +2 -2
  423. package/src/components/global-styles/border-panel.jsx +2 -2
  424. package/src/components/global-styles/color-gradient-dropdown-item.jsx +3 -3
  425. package/src/components/global-styles/color-panel.jsx +3 -3
  426. package/src/components/global-styles/dimensions-panel.jsx +6 -6
  427. package/src/components/global-styles/filters-panel.jsx +2 -2
  428. package/src/components/global-styles/hooks.js +1 -0
  429. package/src/components/global-styles/inheritance/index.jsx +9 -6
  430. package/src/components/global-styles/inheritance/test/{index.jsdom.test.jsx → index.browser.test.jsx} +34 -28
  431. package/src/components/global-styles/inherited-value-context.js +1 -9
  432. package/src/components/global-styles/state-control-badges.jsx +0 -1
  433. package/src/components/global-styles/state-control.jsx +12 -3
  434. package/src/components/global-styles/style.scss +68 -0
  435. package/src/components/global-styles/test/{color-panel.jsdom.test.jsx → color-panel.browser.test.jsx} +53 -54
  436. package/src/components/global-styles/test/inherited-value-context-core.jsdom.test.js +17 -26
  437. package/src/components/global-styles/test/{typography-panel-core.jsdom.test.jsx → typography-panel-core.browser.test.jsx} +84 -39
  438. package/src/components/global-styles/test/{typography-panel.jsdom.test.jsx → typography-panel.browser.test.jsx} +80 -122
  439. package/src/components/global-styles/text-shadow-panel.tsx +257 -0
  440. package/src/components/global-styles/typography-panel.jsx +52 -13
  441. package/src/components/global-styles/typography-utils.js +2 -2
  442. package/src/components/global-styles/utils.js +1 -1
  443. package/src/components/html-element-control/index.jsx +2 -2
  444. package/src/components/iframe/index.jsx +1 -1
  445. package/src/components/iframe/use-scale-canvas.js +1 -1
  446. package/src/components/image-size-control/index.jsx +2 -2
  447. package/src/components/inner-blocks/index.jsx +9 -1
  448. package/src/components/inner-content/index.jsx +1 -1
  449. package/src/components/inserter/block-patterns-tab/use-pattern-categories.js +7 -33
  450. package/src/components/inserter/block-patterns-tab/utils.js +44 -0
  451. package/src/components/inserter/hooks/use-block-types-state.js +2 -2
  452. package/src/components/inserter/hooks/use-insertion-point.js +1 -1
  453. package/src/components/inserter/hooks/use-patterns-state.js +1 -1
  454. package/src/components/inserter/media-tab/media-panel.jsx +9 -9
  455. package/src/components/inserter/media-tab/media-preview.jsx +1 -1
  456. package/src/components/inserter-list-item/index.jsx +1 -1
  457. package/src/components/inserter-list-item/style.scss +2 -2
  458. package/src/components/inspector-controls/list-view-content-popover.jsx +1 -1
  459. package/src/components/link-control/search-results.jsx +1 -1
  460. package/src/components/link-control/style.scss +1 -1
  461. package/src/components/link-control/test/index.jsdom.test.jsx +38 -110
  462. package/src/components/link-control/test/keyboard-selection.browser.test.js +110 -0
  463. package/src/components/link-control/use-search-handler.js +8 -3
  464. package/src/components/list-view/branch.jsx +1 -1
  465. package/src/components/list-view/drop-indicator.jsx +3 -3
  466. package/src/components/list-view/index.jsx +1 -1
  467. package/src/components/list-view/style.scss +1 -9
  468. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  469. package/src/components/list-view/utils.js +1 -1
  470. package/src/components/media-replace-flow/index.jsx +4 -1
  471. package/src/components/navigable-toolbar/test/index.browser.test.js +6 -7
  472. package/src/components/plain-text/README.md +3 -2
  473. package/src/components/plain-text/content.scss +0 -1
  474. package/src/components/plain-text/index.jsx +2 -3
  475. package/src/components/plain-text/style.scss +4 -0
  476. package/src/components/preset-input-control/index.jsx +2 -2
  477. package/src/components/preset-input-control/test/index.jsdom.test.jsx +0 -56
  478. package/src/components/preset-input-control/test/interaction.browser.test.js +63 -0
  479. package/src/components/provider/index.jsx +5 -3
  480. package/src/components/provider/use-block-sync.js +5 -5
  481. package/src/components/publish-date-time-picker/index.jsx +1 -1
  482. package/src/components/resizable-box-popover/index.jsx +1 -1
  483. package/src/components/resolution-tool/index.jsx +2 -2
  484. package/src/components/responsive-block-control/style.scss +1 -2
  485. package/src/components/responsive-block-control/test/index.jsdom.test.jsx +2 -2
  486. package/src/components/rich-text/event-listeners/enter.js +16 -23
  487. package/src/components/rich-text/format-edit.jsx +1 -1
  488. package/src/components/rich-text/index.jsx +39 -2
  489. package/src/components/rich-text/multiline.jsx +11 -3
  490. package/src/components/spacing-sizes-control/hooks/use-spacing-sizes.js +1 -1
  491. package/src/components/spacing-sizes-control/test/index.jsdom.test.jsx +0 -21
  492. package/src/components/spacing-sizes-control/test/select.browser.test.js +58 -0
  493. package/src/components/typewriter/index.jsx +1 -1
  494. package/src/components/url-input/test/fixtures/validated-input-control-deprecation.js +1 -1
  495. package/src/components/use-block-commands/index.js +1 -1
  496. package/src/components/use-block-drop-zone/test/index.js +2 -2
  497. package/src/components/writing-flow/index.jsx +8 -0
  498. package/src/components/writing-flow/use-clipboard-handler.js +1 -1
  499. package/src/components/writing-flow/use-selection-observer.js +15 -6
  500. package/src/content.scss +1 -0
  501. package/src/hooks/align.jsx +22 -6
  502. package/src/hooks/background.jsx +1 -1
  503. package/src/hooks/block-bindings.jsx +1 -1
  504. package/src/hooks/block-hooks.scss +0 -6
  505. package/src/hooks/border.jsx +2 -2
  506. package/src/hooks/contrast-checker.js +1 -1
  507. package/src/hooks/dimensions.jsx +2 -2
  508. package/src/hooks/duotone.jsx +3 -3
  509. package/src/hooks/elements.jsx +3 -3
  510. package/src/hooks/fit-text.jsx +1 -1
  511. package/src/hooks/gap.js +2 -4
  512. package/src/hooks/index.js +3 -1
  513. package/src/hooks/layout-child.jsx +3 -4
  514. package/src/hooks/layout.jsx +17 -18
  515. package/src/hooks/position.jsx +5 -36
  516. package/src/hooks/states.jsx +6 -2
  517. package/src/hooks/test/layout.jsdom.test.js +44 -1
  518. package/src/hooks/text-shadow.ts +105 -0
  519. package/src/hooks/typography.jsx +58 -30
  520. package/src/hooks/utils.jsx +23 -1
  521. package/src/layouts/grid.jsx +2 -2
  522. package/src/layouts/test/flex.jsdom.test.jsx +4 -3
  523. package/src/layouts/test/utils.js +48 -1
  524. package/src/layouts/utils.js +19 -0
  525. package/src/private-apis.js +4 -0
  526. package/src/store/actions.js +50 -10
  527. package/src/store/private-selectors.js +5 -5
  528. package/src/store/reducer.js +6 -6
  529. package/src/store/selectors.js +3 -3
  530. package/src/store/test/actions.jsdom.test.js +60 -0
  531. package/src/style.scss +1 -0
  532. package/src/utils/get-font-styles-and-weights.ts +1 -1
  533. package/src/utils/transform-styles/index.ts +1 -1
  534. package/build/hooks/cross-origin-isolation.cjs +0 -56
  535. package/build/hooks/cross-origin-isolation.cjs.map +0 -7
  536. package/build-module/hooks/cross-origin-isolation.mjs +0 -54
  537. package/build-module/hooks/cross-origin-isolation.mjs.map +0 -7
  538. package/src/components/block-icon/test/__snapshots__/index.jsdom.test.jsx.snap +0 -27
  539. package/src/components/block-icon/test/index.jsdom.test.jsx +0 -67
  540. package/src/hooks/cross-origin-isolation.js +0 -73
  541. package/src/hooks/test/cross-origin-isolation.jsdom.test.js +0 -173
@@ -0,0 +1,93 @@
1
+ import { beforeEach, describe, expect, it, vi } from 'vitest';
2
+ import { render, screen, waitFor } from '@testing-library/react';
3
+ import userEvent from '@testing-library/user-event';
4
+ import { useDispatch, useSelect } from '@wordpress/data';
5
+ import BlockVariationTransforms from '../';
6
+
7
+ globalThis.wpVitest.mockPointerEvent();
8
+ globalThis.wpVitest.mockScrollIntoView();
9
+
10
+ vi.mock( import( '@wordpress/data' ), async ( importOriginal ) => ( {
11
+ ...( await importOriginal() ),
12
+ useDispatch: vi.fn(),
13
+ useSelect: vi.fn(),
14
+ } ) );
15
+
16
+ const updateBlockAttributes = vi.fn();
17
+ const variations = [
18
+ {
19
+ name: 'plain',
20
+ title: 'Plain',
21
+ attributes: { className: 'is-style-plain' },
22
+ },
23
+ {
24
+ name: 'decorated',
25
+ title: 'Decorated',
26
+ attributes: { className: 'is-style-decorated' },
27
+ },
28
+ ];
29
+
30
+ describe( 'BlockVariationTransforms', () => {
31
+ beforeEach( () => {
32
+ updateBlockAttributes.mockReset();
33
+ useDispatch.mockReturnValue( { updateBlockAttributes } );
34
+ useSelect.mockReturnValue( {
35
+ activeBlockVariation: variations[ 0 ],
36
+ variations,
37
+ canEdit: true,
38
+ isContentOnly: false,
39
+ isSection: false,
40
+ } );
41
+ } );
42
+
43
+ it( 'selects a variation', async () => {
44
+ const user = userEvent.setup();
45
+ render( <BlockVariationTransforms blockClientId="client-id" /> );
46
+
47
+ await user.click(
48
+ screen.getByRole( 'button', { name: 'Transform to variation' } )
49
+ );
50
+
51
+ const decoratedVariation = await screen.findByRole( 'menuitemradio', {
52
+ name: 'Decorated',
53
+ } );
54
+ await user.click( decoratedVariation );
55
+
56
+ expect( updateBlockAttributes ).toHaveBeenCalledWith( 'client-id', {
57
+ className: 'is-style-decorated',
58
+ } );
59
+ } );
60
+
61
+ it( 'reflects a variation that becomes active after the first render', async () => {
62
+ const user = userEvent.setup();
63
+ useSelect.mockReturnValue( {
64
+ activeBlockVariation: undefined,
65
+ variations,
66
+ canEdit: true,
67
+ isContentOnly: false,
68
+ isSection: false,
69
+ } );
70
+ const { rerender } = render(
71
+ <BlockVariationTransforms blockClientId="client-id" />
72
+ );
73
+
74
+ await user.click(
75
+ screen.getByRole( 'button', { name: 'Transform to variation' } )
76
+ );
77
+ const plainVariation = await screen.findByRole( 'menuitemradio', {
78
+ name: 'Plain',
79
+ } );
80
+ expect( plainVariation ).not.toBeChecked();
81
+
82
+ useSelect.mockReturnValue( {
83
+ activeBlockVariation: variations[ 0 ],
84
+ variations,
85
+ canEdit: true,
86
+ isContentOnly: false,
87
+ isSection: false,
88
+ } );
89
+ rerender( <BlockVariationTransforms blockClientId="client-id" /> );
90
+
91
+ await waitFor( () => expect( plainVariation ).toBeChecked() );
92
+ } );
93
+ } );
@@ -123,13 +123,13 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
123
123
  const message =
124
124
  blocks?.length > 1
125
125
  ? // translators: %s: The shortcut key to access the List View.
126
- __(
126
+ __(
127
127
  'Blocks hidden. You can access them via the List View (%s).'
128
- )
128
+ )
129
129
  : // translators: %s: The shortcut key to access the List View.
130
- __(
130
+ __(
131
131
  'Block hidden. You can access it via the List View (%s).'
132
- );
132
+ );
133
133
 
134
134
  return sprintf( message, listViewShortcut );
135
135
  }, [ hideEverywhere, blocks?.length, listViewShortcut ] );
@@ -185,7 +185,7 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
185
185
  },
186
186
  {}
187
187
  ),
188
- };
188
+ };
189
189
  const attributesByClientId = Object.fromEntries(
190
190
  blocks.map( ( { clientId, attributes } ) => [
191
191
  clientId,
@@ -239,10 +239,10 @@ export default function BlockVisibilityModal( { clientIds, onClose } ) {
239
239
  { hasMultipleBlocks
240
240
  ? __(
241
241
  'Select the viewport sizes for which you want to hide the blocks. Changes will apply to all selected blocks.'
242
- )
242
+ )
243
243
  : __(
244
244
  'Select the viewport size for which you want to hide the block.'
245
- ) }
245
+ ) }
246
246
  </legend>
247
247
  <ul className="block-editor-block-visibility-modal__options">
248
248
  <li className="block-editor-block-visibility-modal__options-item block-editor-block-visibility-modal__options-item--everywhere">
@@ -33,7 +33,7 @@
33
33
  }
34
34
 
35
35
  &-icon--checked {
36
- fill: $gray-300;
36
+ color: $gray-300;
37
37
  }
38
38
  }
39
39
 
@@ -82,13 +82,11 @@ export default function ViewportVisibilityInfo( { clientId } ) {
82
82
  [ clientId, currentViewport ]
83
83
  );
84
84
 
85
- if (
86
- ! (
87
- isBlockCurrentlyHidden ||
88
- hasParentHiddenEverywhere ||
89
- isBlockParentHiddenAtViewport
90
- )
91
- ) {
85
+ if ( ! (
86
+ isBlockCurrentlyHidden ||
87
+ hasParentHiddenEverywhere ||
88
+ isBlockParentHiddenAtViewport
89
+ ) ) {
92
90
  return null;
93
91
  }
94
92
 
@@ -40,7 +40,7 @@ function useBorderRadiusSizes( presets ) {
40
40
  size: undefined,
41
41
  },
42
42
  ...sizes,
43
- ]
43
+ ]
44
44
  : sizes;
45
45
  }, [ customSizes, themeSizes, defaultSizes ] );
46
46
  }
@@ -110,7 +110,7 @@ function createCornerChangeHandler( corner, values, onChange ) {
110
110
  topRight: values,
111
111
  bottomLeft: values,
112
112
  bottomRight: values,
113
- };
113
+ };
114
114
 
115
115
  onChange( {
116
116
  ...currentValues,
@@ -25,7 +25,6 @@ import BorderRadiusControl from '../index';
25
25
 
26
26
  globalThis.wpVitest.mockMatchMedia();
27
27
 
28
- globalThis.wpVitest.mockVisibleElements();
29
28
  globalThis.wpVitest.mockScrollIntoView();
30
29
 
31
30
  describe( 'BorderRadiusControl', () => {
@@ -483,27 +482,6 @@ describe( 'BorderRadiusControl', () => {
483
482
  expect( combobox ).toHaveTextContent( 'Default' );
484
483
  } );
485
484
  } );
486
-
487
- it( 'can interact with select dropdown options', async () => {
488
- const user = userEvent.setup();
489
-
490
- render(
491
- <BorderRadiusControl
492
- onChange={ mockOnChange }
493
- values={ undefined }
494
- presets={ largePresetSet }
495
- />
496
- );
497
-
498
- // Click on the combobox to open dropdown
499
- const combobox = screen.getByRole( 'combobox' );
500
- await user.click( combobox );
501
-
502
- // Should show preset options in the dropdown
503
- await waitFor( () => {
504
- expect( screen.getByText( 'Size 1' ) ).toBeInTheDocument();
505
- } );
506
- } );
507
485
  } );
508
486
 
509
487
  describe( 'Edge Cases and Error Handling', () => {
@@ -0,0 +1,30 @@
1
+ import { describe, expect, it, vi } from 'vitest';
2
+ import { page, userEvent } from 'vitest/browser';
3
+ import { render } from 'vitest-browser-react';
4
+ import { createElement } from '@wordpress/element';
5
+ import BorderRadiusControl from '../index';
6
+
7
+ describe( 'BorderRadiusControl large preset sets', () => {
8
+ it( 'can interact with select dropdown options', async () => {
9
+ const user = userEvent.setup();
10
+ const presets = {
11
+ default: Array.from( { length: 15 }, ( _, index ) => ( {
12
+ name: `Size ${ index }`,
13
+ slug: `size-${ index }`,
14
+ size: `${ index * 2 }px`,
15
+ } ) ),
16
+ };
17
+
18
+ await render(
19
+ createElement( BorderRadiusControl, {
20
+ onChange: vi.fn(),
21
+ values: undefined,
22
+ presets,
23
+ } )
24
+ );
25
+
26
+ await user.click( page.getByRole( 'combobox' ) );
27
+
28
+ await expect.element( page.getByText( 'Size 1' ) ).toBeVisible();
29
+ } );
30
+ } );
@@ -23,7 +23,7 @@ export default createHigherOrderComponent( ( WrappedComponent ) => {
23
23
  ...( themeColors || [] ),
24
24
  ...( defaultColors || [] ),
25
25
  ...( customColors || [] ),
26
- ]
26
+ ]
27
27
  : [ ...( themeColors || [] ), ...( customColors || [] ) ];
28
28
 
29
29
  const { colors = _colors, disableCustomColors = ! enableCustomColors } =
@@ -123,7 +123,7 @@ function createColorHOC( colorTypes, withColorPalette ) {
123
123
  colorContext,
124
124
  colorObject.slug
125
125
  ),
126
- };
126
+ };
127
127
 
128
128
  const setter = ( newColorValue ) => {
129
129
  const resolvedColorObject =
@@ -56,7 +56,7 @@ function ColorGradientControlInner( {
56
56
  ? ( newColor, _index, newSlug ) => {
57
57
  onColorChange( newColor, newSlug );
58
58
  onGradientChange();
59
- }
59
+ }
60
60
  : ( newColor, _index, newSlug ) => onColorChange( newColor, newSlug );
61
61
 
62
62
  const colorPalette = (
@@ -98,7 +98,7 @@ function ColorGradientControlInner( {
98
98
  ? ( newGradient, _index, newSlug ) => {
99
99
  onGradientChange( newGradient, newSlug );
100
100
  onColorChange();
101
- }
101
+ }
102
102
  : ( newGradient, _index, newSlug ) =>
103
103
  onGradientChange( newGradient, newSlug )
104
104
  }
@@ -1,12 +1,9 @@
1
1
  import { describe, expect, it, vi } from 'vitest';
2
+ import { userEvent } from 'vitest/browser';
2
3
  import { screen } from '@testing-library/react';
3
- import { click, render } from '@ariakit/test/react';
4
+ import { render } from 'vitest-browser-react';
4
5
  import ColorGradientControl from '../control';
5
6
 
6
- globalThis.wpVitest.mockMatchMedia();
7
-
8
- globalThis.wpVitest.mockResizeObserver();
9
-
10
7
  const noop = () => {};
11
8
 
12
9
  describe( 'ColorPaletteControl', () => {
@@ -53,7 +50,7 @@ describe( 'ColorPaletteControl', () => {
53
50
  } );
54
51
 
55
52
  it( 'renders the color picker and does not render tabs if it is only possible to select a color', async () => {
56
- render(
53
+ await render(
57
54
  <ColorGradientControl
58
55
  label="Test Color Gradient"
59
56
  colorValue="#f00"
@@ -82,7 +79,7 @@ describe( 'ColorPaletteControl', () => {
82
79
  } );
83
80
 
84
81
  it( 'renders the gradient picker and does not render tabs if it is only possible to select a gradient', async () => {
85
- render(
82
+ await render(
86
83
  <ColorGradientControl
87
84
  label="Test Color Gradient"
88
85
  colorValue="#f00"
@@ -182,7 +179,7 @@ describe( 'ColorPaletteControl', () => {
182
179
 
183
180
  const options = screen.getAllByRole( 'option' );
184
181
  // Click the second swatch: color='#000', slug='dark-text'.
185
- await click( options[ 1 ] );
182
+ await userEvent.click( options[ 1 ] );
186
183
 
187
184
  expect( onColorChange ).toHaveBeenCalledWith( '#000', 'dark-text' );
188
185
  } );
@@ -214,7 +211,7 @@ describe( 'ColorPaletteControl', () => {
214
211
  // When both colors and gradients are available the color tab is shown
215
212
  // by default (no gradientValue). Click the first color swatch.
216
213
  const options = screen.getAllByRole( 'option' );
217
- await click( options[ 0 ] );
214
+ await userEvent.click( options[ 0 ] );
218
215
 
219
216
  // First entry: color='#000', slug='dark-background'.
220
217
  expect( onColorChange ).toHaveBeenCalledWith(
@@ -111,14 +111,14 @@ export function getContrastWarning( {
111
111
  'This color combination may be hard for people to read. Try using a darker background color and/or a brighter %s.'
112
112
  ),
113
113
  item.description
114
- )
114
+ )
115
115
  : sprintf(
116
116
  // translators: %s is a type of text color, e.g., "text color" or "link color".
117
117
  __(
118
118
  'This color combination may be hard for people to read. Try using a brighter background color and/or a darker %s.'
119
119
  ),
120
120
  item.description
121
- );
121
+ );
122
122
  speakMessage = __(
123
123
  'This color combination may be hard for people to read.'
124
124
  );
@@ -125,9 +125,9 @@ function NonDefaultControls( { format, onChange } ) {
125
125
  value={
126
126
  isCustom
127
127
  ? customOption
128
- : suggestedOptions.find(
128
+ : ( suggestedOptions.find(
129
129
  ( option ) => option.format === format
130
- ) ?? customOption
130
+ ) ?? customOption )
131
131
  }
132
132
  onChange={ ( { selectedItem } ) => {
133
133
  if ( selectedItem === customOption ) {
@@ -1,4 +1,4 @@
1
- import { SelectControl } from '@wordpress/components';
1
+ import { SelectControl as WCSelectControl } from '@wordpress/components';
2
2
  import { __, _x } from '@wordpress/i18n';
3
3
  import { useSettings } from '../use-settings';
4
4
  import { InheritanceToolsPanelItem } from '../global-styles/inheritance';
@@ -84,8 +84,8 @@ export default function AspectRatioTool( {
84
84
  const displayValue =
85
85
  value === undefined || value === null || value === 'auto'
86
86
  ? 'auto'
87
- : findAspectRatioOption( value, resolvedOptions )?.value ??
88
- 'custom';
87
+ : ( findAspectRatioOption( value, resolvedOptions )?.value ??
88
+ 'custom' );
89
89
 
90
90
  return (
91
91
  <InheritanceToolsPanelItem
@@ -100,7 +100,7 @@ export default function AspectRatioTool( {
100
100
  isShownByDefault={ isShownByDefault }
101
101
  panelId={ panelId }
102
102
  >
103
- <SelectControl
103
+ <WCSelectControl
104
104
  label={ __( 'Aspect ratio' ) }
105
105
  value={ displayValue }
106
106
  options={ resolvedOptions }
@@ -1,5 +1,5 @@
1
1
  import { describe, expect, it, vi } from 'vitest';
2
- import { act, render, screen } from '@testing-library/react';
2
+ import { act, render, screen, waitFor } from '@testing-library/react';
3
3
  import userEvent from '@testing-library/user-event';
4
4
  import { __experimentalToolsPanel as ToolsPanel } from '@wordpress/components';
5
5
  import { useEffect, useState } from '@wordpress/element';
@@ -135,7 +135,7 @@ describe( 'DimensionsTool', () => {
135
135
  expect( aspectRatioSelect ).toHaveValue( 'auto' );
136
136
  } );
137
137
 
138
- it( 'displays an aspect ratio that is written differently to the option with the same ratio', () => {
138
+ it( 'displays an aspect ratio that is written differently to the option with the same ratio', async () => {
139
139
  const onChange = vi.fn();
140
140
  const { rerender } = render(
141
141
  <ControlledExample
@@ -155,10 +155,12 @@ describe( 'DimensionsTool', () => {
155
155
  onChange={ onChange }
156
156
  />
157
157
  );
158
- expect( aspectRatioSelect ).toHaveValue( '16/9' );
158
+ await waitFor( () =>
159
+ expect( aspectRatioSelect ).toHaveValue( '16/9' )
160
+ );
159
161
  } );
160
162
 
161
- it( 'displays an aspect ratio without a matching option as custom', () => {
163
+ it( 'displays an aspect ratio without a matching option as custom', async () => {
162
164
  const onChange = vi.fn();
163
165
  render(
164
166
  <ControlledExample
@@ -167,12 +169,14 @@ describe( 'DimensionsTool', () => {
167
169
  />
168
170
  );
169
171
 
170
- expect(
171
- screen.getByRole( 'combobox', { name: 'Aspect ratio' } )
172
- ).toHaveValue( 'custom' );
172
+ await waitFor( () =>
173
+ expect(
174
+ screen.getByRole( 'combobox', { name: 'Aspect ratio' } )
175
+ ).toHaveValue( 'custom' )
176
+ );
173
177
  } );
174
178
 
175
- it( 'updates the scale control when the value prop changes', () => {
179
+ it( 'updates the scale control when the value prop changes', async () => {
176
180
  const onChange = vi.fn();
177
181
  const { rerender } = render(
178
182
  <ControlledExample
@@ -192,9 +196,11 @@ describe( 'DimensionsTool', () => {
192
196
  />
193
197
  );
194
198
 
195
- expect(
196
- screen.getByRole( 'radio', { name: 'Contain' } )
197
- ).toBeChecked();
199
+ await waitFor( () =>
200
+ expect(
201
+ screen.getByRole( 'radio', { name: 'Contain' } )
202
+ ).toBeChecked()
203
+ );
198
204
  } );
199
205
  } );
200
206
 
@@ -44,8 +44,8 @@ export default function WidthHeightTool( {
44
44
  isShownByDefault = true,
45
45
  } ) {
46
46
  // null, undefined, and 'auto' all represent the default value.
47
- const width = value.width === 'auto' ? '' : value.width ?? '';
48
- const height = value.height === 'auto' ? '' : value.height ?? '';
47
+ const width = value.width === 'auto' ? '' : ( value.width ?? '' );
48
+ const height = value.height === 'auto' ? '' : ( value.height ?? '' );
49
49
 
50
50
  const onDimensionChange = ( dimension ) => ( nextDimension ) => {
51
51
  const nextValue = { ...value };
@@ -33,9 +33,8 @@ export default ( ...fontSizeNames ) => {
33
33
  */
34
34
  const fontSizeAttributeNames = fontSizeNames.reduce(
35
35
  ( fontSizeAttributeNamesAccumulator, fontSizeAttributeName ) => {
36
- fontSizeAttributeNamesAccumulator[
37
- fontSizeAttributeName
38
- ] = `custom${ upperFirst( fontSizeAttributeName ) }`;
36
+ fontSizeAttributeNamesAccumulator[ fontSizeAttributeName ] =
37
+ `custom${ upperFirst( fontSizeAttributeName ) }`;
39
38
  return fontSizeAttributeNamesAccumulator;
40
39
  },
41
40
  {}
@@ -14,7 +14,7 @@ import {
14
14
  import {
15
15
  getInheritanceProps,
16
16
  InheritanceToolsPanelItem,
17
- isGlobalStylesInheritanceEnabled,
17
+ isGlobalStylesInheritanceIndicatorUIEnabled,
18
18
  } from './inheritance';
19
19
 
20
20
  const DEFAULT_CONTROLS = {
@@ -163,7 +163,7 @@ export default function BackgroundImagePanel( {
163
163
  defaultValues = {},
164
164
  headerLabel = __( 'Background' ),
165
165
  contrastWarning,
166
- showInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),
166
+ showInheritanceLabelIndicators = isGlobalStylesInheritanceIndicatorUIEnabled(),
167
167
  } ) {
168
168
  const {
169
169
  colors,
@@ -16,7 +16,7 @@ import { ShadowPopover, useShadowPresets } from './shadow-panel-components';
16
16
  import {
17
17
  getInheritanceProps,
18
18
  InheritanceToolsPanelItem,
19
- isGlobalStylesInheritanceEnabled,
19
+ isGlobalStylesInheritanceIndicatorUIEnabled,
20
20
  } from './inheritance';
21
21
 
22
22
  export function useHasBorderPanel( settings ) {
@@ -98,7 +98,7 @@ export default function BorderPanel( {
98
98
  settings,
99
99
  panelId,
100
100
  defaultControls = DEFAULT_CONTROLS,
101
- showInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),
101
+ showInheritanceLabelIndicators = isGlobalStylesInheritanceIndicatorUIEnabled(),
102
102
  } ) {
103
103
  const colors = useColorsPerOrigin( settings );
104
104
  const areCustomSolidsEnabled = settings?.color?.custom;
@@ -19,7 +19,7 @@ import {
19
19
  getInheritanceProps,
20
20
  InheritanceResetButton,
21
21
  InheritanceToolsPanelItem,
22
- isGlobalStylesInheritanceEnabled,
22
+ isGlobalStylesInheritanceIndicatorUIEnabled,
23
23
  } from './inheritance';
24
24
 
25
25
  const { Tabs } = unlock( componentsPrivateApis );
@@ -180,7 +180,7 @@ function ColorGradientTab( {
180
180
  spokenMessage: null,
181
181
  className:
182
182
  'block-editor-panel-color-gradient-settings__contrast-notice',
183
- }
183
+ }
184
184
  : undefined
185
185
  }
186
186
  />
@@ -203,7 +203,7 @@ export default function ColorGradientDropdownItem( {
203
203
  className = 'block-editor-tools-panel-color-gradient-settings__item',
204
204
  isPlaceholder = false,
205
205
  hasInheritedValue = false,
206
- showInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),
206
+ showInheritanceLabelIndicators = isGlobalStylesInheritanceIndicatorUIEnabled(),
207
207
  } ) {
208
208
  const colorGradientDropdownButtonRef = useRef( undefined );
209
209
  const itemClassName = clsx( 'block-editor-color-gradient-item', className );
@@ -14,7 +14,7 @@ import {
14
14
  extractPresetSlug,
15
15
  encodeColorValueWithPalette,
16
16
  } from '../../utils/color-values';
17
- import { isGlobalStylesInheritanceEnabled } from './inheritance';
17
+ import { isGlobalStylesInheritanceIndicatorUIEnabled } from './inheritance';
18
18
 
19
19
  // Despite the "ColorPanel" name, this gates only the element-level color
20
20
  // controls (link, heading, button, caption, h1–h6) — surfaced as the
@@ -143,7 +143,7 @@ export default function ColorPanel( {
143
143
  children,
144
144
  contrastWarning,
145
145
  additionalElements,
146
- showInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),
146
+ showInheritanceLabelIndicators = isGlobalStylesInheritanceIndicatorUIEnabled(),
147
147
  } ) {
148
148
  const {
149
149
  colors,
@@ -477,7 +477,7 @@ export default function ColorPanel( {
477
477
  elementGradient ??
478
478
  elementBackgroundUserColor ??
479
479
  elementBackgroundColor,
480
- ]
480
+ ]
481
481
  : [ elementTextUserColor ?? elementTextColor ],
482
482
  isPlaceholder: isElementPlaceholder,
483
483
  hasInheritedValue: hasElementInheritedValue,
@@ -25,7 +25,7 @@ import {
25
25
  import {
26
26
  getInheritanceProps,
27
27
  InheritanceToolsPanelItem,
28
- isGlobalStylesInheritanceEnabled,
28
+ isGlobalStylesInheritanceIndicatorUIEnabled,
29
29
  } from './inheritance';
30
30
 
31
31
  const AXIAL_SIDES = [ 'horizontal', 'vertical' ];
@@ -349,7 +349,7 @@ export default function DimensionsPanel( {
349
349
  includeLayoutControls = false,
350
350
  allowAxialBlockGap = true,
351
351
  styleState = DEFAULT_BLOCK_STYLE_STATE,
352
- showInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),
352
+ showInheritanceLabelIndicators = isGlobalStylesInheritanceIndicatorUIEnabled(),
353
353
  } ) {
354
354
  const { dimensions, spacing } = settings;
355
355
 
@@ -789,7 +789,7 @@ export default function DimensionsPanel( {
789
789
  isContentSizePlaceholder
790
790
  ? getNumericPlaceholder(
791
791
  inheritedContentSizeValue
792
- )
792
+ )
793
793
  : undefined
794
794
  }
795
795
  onChange={ ( nextContentSize ) => {
@@ -832,7 +832,7 @@ export default function DimensionsPanel( {
832
832
  isWideSizePlaceholder
833
833
  ? getNumericPlaceholder(
834
834
  inheritedWideSizeValue
835
- )
835
+ )
836
836
  : undefined
837
837
  }
838
838
  onChange={ ( nextWideSize ) => {
@@ -1069,7 +1069,7 @@ export default function DimensionsPanel( {
1069
1069
  isMinHeightPlaceholder
1070
1070
  ? getNumericPlaceholder(
1071
1071
  inheritedMinHeightValue
1072
- )
1072
+ )
1073
1073
  : undefined
1074
1074
  }
1075
1075
  dimensionSizes={ dimensions?.dimensionSizes }
@@ -1103,7 +1103,7 @@ export default function DimensionsPanel( {
1103
1103
  isMinWidthPlaceholder
1104
1104
  ? getNumericPlaceholder(
1105
1105
  inheritedMinWidthValue
1106
- )
1106
+ )
1107
1107
  : undefined
1108
1108
  }
1109
1109
  dimensionSizes={ dimensions?.dimensionSizes }
@@ -26,7 +26,7 @@ import {
26
26
  getInheritanceProps,
27
27
  InheritanceToolsPanelItem,
28
28
  InheritanceResetButton,
29
- isGlobalStylesInheritanceEnabled,
29
+ isGlobalStylesInheritanceIndicatorUIEnabled,
30
30
  } from './inheritance';
31
31
 
32
32
  const EMPTY_ARRAY = [];
@@ -179,7 +179,7 @@ export default function FiltersPanel( {
179
179
  settings,
180
180
  panelId,
181
181
  defaultControls = DEFAULT_CONTROLS,
182
- showInheritanceLabelIndicators = isGlobalStylesInheritanceEnabled(),
182
+ showInheritanceLabelIndicators = isGlobalStylesInheritanceIndicatorUIEnabled(),
183
183
  } ) {
184
184
  const decodeValue = ( rawValue ) =>
185
185
  getValueFromVariable( { settings }, '', rawValue );
@@ -99,6 +99,7 @@ export function useSettingsForBlockElement(
99
99
  'textTransform',
100
100
  'textDecoration',
101
101
  'textIndent',
102
+ 'textShadow',
102
103
  'writingMode',
103
104
  ].forEach( ( key ) => {
104
105
  if ( ! supportedStyles.includes( key ) ) {