@wordpress/block-editor 17.0.2-next.v.202608281122.0 → 17.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 (382) hide show
  1. package/CHANGELOG.md +29 -1
  2. package/build/components/background-image-control/index.cjs +18 -1
  3. package/build/components/background-image-control/index.cjs.map +2 -2
  4. package/build/components/block-allowed-blocks/modal.cjs +2 -1
  5. package/build/components/block-allowed-blocks/modal.cjs.map +3 -3
  6. package/build/components/block-edit/edit.cjs.map +1 -1
  7. package/build/components/block-inspector/index.cjs +3 -12
  8. package/build/components/block-inspector/index.cjs.map +2 -2
  9. package/build/components/block-list/use-block-props/use-is-hovered.cjs +17 -4
  10. package/build/components/block-list/use-block-props/use-is-hovered.cjs.map +2 -2
  11. package/build/components/block-preview/index.cjs +1 -2
  12. package/build/components/block-preview/index.cjs.map +2 -2
  13. package/build/components/block-switcher/index.cjs +2 -1
  14. package/build/components/block-switcher/index.cjs.map +3 -3
  15. package/build/components/block-toolbar/pattern-overrides-dropdown.cjs +2 -1
  16. package/build/components/block-toolbar/pattern-overrides-dropdown.cjs.map +3 -3
  17. package/build/components/global-styles/border-panel.cjs +19 -42
  18. package/build/components/global-styles/border-panel.cjs.map +2 -2
  19. package/build/components/global-styles/image-settings-panel.cjs.map +1 -1
  20. package/build/components/iframe/index.cjs.map +1 -1
  21. package/build/components/inserter/hooks/use-patterns-paging.cjs.map +1 -1
  22. package/build/components/inserter-draggable-blocks/index.cjs.map +1 -1
  23. package/build/components/inspector-controls-tabs/content-tab.cjs +2 -3
  24. package/build/components/inspector-controls-tabs/content-tab.cjs.map +2 -2
  25. package/build/components/inspector-controls-tabs/styles-tab.cjs +1 -3
  26. package/build/components/inspector-controls-tabs/styles-tab.cjs.map +2 -2
  27. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs +1 -2
  28. package/build/components/inspector-controls-tabs/use-inspector-controls-tabs.cjs.map +2 -2
  29. package/build/components/inspector-popover-header/index.cjs +5 -4
  30. package/build/components/inspector-popover-header/index.cjs.map +3 -3
  31. package/build/components/link-control/index.cjs.map +2 -2
  32. package/build/components/link-control/search-input.cjs.map +1 -1
  33. package/build/components/list-view/block-select-button.cjs +9 -1
  34. package/build/components/list-view/block-select-button.cjs.map +2 -2
  35. package/build/components/list-view/block.cjs +2 -1
  36. package/build/components/list-view/block.cjs.map +2 -2
  37. package/build/components/list-view/use-list-view-drop-zone.cjs.map +1 -1
  38. package/build/components/media-replace-flow/index.cjs +4 -1
  39. package/build/components/media-replace-flow/index.cjs.map +2 -2
  40. package/build/components/navigable-toolbar/index.cjs +3 -0
  41. package/build/components/navigable-toolbar/index.cjs.map +2 -2
  42. package/build/components/rich-text/event-listeners/enter.cjs +23 -11
  43. package/build/components/rich-text/event-listeners/enter.cjs.map +2 -2
  44. package/build/components/rich-text/event-listeners/index.cjs +0 -2
  45. package/build/components/rich-text/event-listeners/index.cjs.map +3 -3
  46. package/build/components/rich-text/event-listeners/input-rules.cjs +4 -2
  47. package/build/components/rich-text/event-listeners/input-rules.cjs.map +2 -2
  48. package/build/components/use-block-drop-zone/index.cjs.map +1 -1
  49. package/build/components/writing-flow/index.cjs +5 -0
  50. package/build/components/writing-flow/index.cjs.map +3 -3
  51. package/build/components/writing-flow/use-arrow-nav.cjs.map +1 -1
  52. package/build/components/writing-flow/use-input.cjs +12 -2
  53. package/build/components/writing-flow/use-input.cjs.map +2 -2
  54. package/build/components/writing-flow/use-tab-nav.cjs +84 -41
  55. package/build/components/writing-flow/use-tab-nav.cjs.map +3 -3
  56. package/build/components/{rich-text/event-listeners/undo-automatic-change.cjs → writing-flow/use-undo-automatic-change.cjs} +18 -15
  57. package/build/components/writing-flow/use-undo-automatic-change.cjs.map +7 -0
  58. package/build/hooks/border.cjs +2 -46
  59. package/build/hooks/border.cjs.map +2 -2
  60. package/build/hooks/generate-fields-from-attributes.cjs.map +1 -1
  61. package/build/hooks/index.cjs +0 -2
  62. package/build/hooks/index.cjs.map +3 -3
  63. package/build/hooks/style.cjs +2 -2
  64. package/build/hooks/style.cjs.map +2 -2
  65. package/build/layouts/flex.cjs +3 -0
  66. package/build/layouts/flex.cjs.map +2 -2
  67. package/build/store/actions.cjs +12 -9
  68. package/build/store/actions.cjs.map +3 -3
  69. package/build-module/components/background-image-control/index.mjs +18 -1
  70. package/build-module/components/background-image-control/index.mjs.map +2 -2
  71. package/build-module/components/block-allowed-blocks/modal.mjs +2 -2
  72. package/build-module/components/block-allowed-blocks/modal.mjs.map +2 -2
  73. package/build-module/components/block-edit/edit.mjs.map +1 -1
  74. package/build-module/components/block-inspector/index.mjs +3 -12
  75. package/build-module/components/block-inspector/index.mjs.map +2 -2
  76. package/build-module/components/block-list/use-block-props/use-is-hovered.mjs +17 -4
  77. package/build-module/components/block-list/use-block-props/use-is-hovered.mjs.map +2 -2
  78. package/build-module/components/block-preview/index.mjs +1 -2
  79. package/build-module/components/block-preview/index.mjs.map +2 -2
  80. package/build-module/components/block-switcher/index.mjs +2 -2
  81. package/build-module/components/block-switcher/index.mjs.map +2 -2
  82. package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs +3 -6
  83. package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs.map +2 -2
  84. package/build-module/components/global-styles/border-panel.mjs +19 -42
  85. package/build-module/components/global-styles/border-panel.mjs.map +2 -2
  86. package/build-module/components/global-styles/image-settings-panel.mjs.map +1 -1
  87. package/build-module/components/iframe/index.mjs.map +1 -1
  88. package/build-module/components/inserter/hooks/use-patterns-paging.mjs.map +1 -1
  89. package/build-module/components/inserter-draggable-blocks/index.mjs.map +1 -1
  90. package/build-module/components/inspector-controls-tabs/content-tab.mjs +3 -4
  91. package/build-module/components/inspector-controls-tabs/content-tab.mjs.map +2 -2
  92. package/build-module/components/inspector-controls-tabs/styles-tab.mjs +1 -3
  93. package/build-module/components/inspector-controls-tabs/styles-tab.mjs.map +2 -2
  94. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs +1 -2
  95. package/build-module/components/inspector-controls-tabs/use-inspector-controls-tabs.mjs.map +2 -2
  96. package/build-module/components/inspector-popover-header/index.mjs +6 -7
  97. package/build-module/components/inspector-popover-header/index.mjs.map +2 -2
  98. package/build-module/components/link-control/index.mjs.map +2 -2
  99. package/build-module/components/link-control/search-input.mjs.map +1 -1
  100. package/build-module/components/list-view/block-select-button.mjs +9 -1
  101. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  102. package/build-module/components/list-view/block.mjs +2 -1
  103. package/build-module/components/list-view/block.mjs.map +2 -2
  104. package/build-module/components/list-view/use-list-view-drop-zone.mjs.map +1 -1
  105. package/build-module/components/media-replace-flow/index.mjs +4 -1
  106. package/build-module/components/media-replace-flow/index.mjs.map +2 -2
  107. package/build-module/components/navigable-toolbar/index.mjs +3 -0
  108. package/build-module/components/navigable-toolbar/index.mjs.map +2 -2
  109. package/build-module/components/rich-text/event-listeners/enter.mjs +23 -11
  110. package/build-module/components/rich-text/event-listeners/enter.mjs.map +2 -2
  111. package/build-module/components/rich-text/event-listeners/index.mjs +0 -2
  112. package/build-module/components/rich-text/event-listeners/index.mjs.map +2 -2
  113. package/build-module/components/rich-text/event-listeners/input-rules.mjs +4 -2
  114. package/build-module/components/rich-text/event-listeners/input-rules.mjs.map +2 -2
  115. package/build-module/components/use-block-drop-zone/index.mjs.map +1 -1
  116. package/build-module/components/writing-flow/index.mjs +5 -0
  117. package/build-module/components/writing-flow/index.mjs.map +2 -2
  118. package/build-module/components/writing-flow/use-arrow-nav.mjs.map +1 -1
  119. package/build-module/components/writing-flow/use-input.mjs +12 -2
  120. package/build-module/components/writing-flow/use-input.mjs.map +2 -2
  121. package/build-module/components/writing-flow/use-tab-nav.mjs +86 -43
  122. package/build-module/components/writing-flow/use-tab-nav.mjs.map +3 -3
  123. package/build-module/components/writing-flow/use-undo-automatic-change.mjs +36 -0
  124. package/build-module/components/writing-flow/use-undo-automatic-change.mjs.map +7 -0
  125. package/build-module/hooks/border.mjs +1 -45
  126. package/build-module/hooks/border.mjs.map +2 -2
  127. package/build-module/hooks/generate-fields-from-attributes.mjs.map +1 -1
  128. package/build-module/hooks/index.mjs +0 -2
  129. package/build-module/hooks/index.mjs.map +2 -2
  130. package/build-module/hooks/style.mjs +3 -2
  131. package/build-module/hooks/style.mjs.map +2 -2
  132. package/build-module/layouts/flex.mjs +3 -0
  133. package/build-module/layouts/flex.mjs.map +2 -2
  134. package/build-module/store/actions.mjs +12 -9
  135. package/build-module/store/actions.mjs.map +2 -2
  136. package/build-style/content-rtl.css +9 -20
  137. package/build-style/content.css +9 -20
  138. package/build-style/style-rtl.css +100 -221
  139. package/build-style/style.css +100 -221
  140. package/package.json +42 -41
  141. package/src/autocompleters/test/block.js +1 -0
  142. package/src/components/alignment-control/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +34 -16
  143. package/src/components/alignment-control/test/{index.jsx → index.jsdom.test.jsx} +2 -1
  144. package/src/components/background-image-control/index.jsx +32 -1
  145. package/src/components/background-image-control/style.scss +5 -3
  146. package/src/components/background-image-control/test/{index.js → index.jsdom.test.js} +1 -0
  147. package/src/components/block-alignment-control/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +68 -13
  148. package/src/components/block-alignment-control/test/{index.jsx → index.jsdom.test.jsx} +2 -1
  149. package/src/components/block-allowed-blocks/modal.jsx +3 -3
  150. package/src/components/block-bindings/test/{use-block-bindings-utils.js → use-block-bindings-utils.jsdom.test.js} +2 -1
  151. package/src/components/block-breadcrumb/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +2 -2
  152. package/src/components/block-breadcrumb/test/{index.jsx → index.jsdom.test.jsx} +1 -0
  153. package/src/components/block-compare/test/__snapshots__/{block-view.jsx.snap → block-view.jsdom.test.jsx.snap} +2 -2
  154. package/src/components/block-compare/test/{block-view.jsx → block-view.jsdom.test.jsx} +1 -0
  155. package/src/components/block-controls/test/{index.jsx → index.jsdom.test.jsx} +1 -0
  156. package/src/components/block-edit/edit.jsx +1 -1
  157. package/src/components/block-edit/test/{edit.jsx → edit.jsdom.test.jsx} +1 -0
  158. package/src/components/block-icon/content.scss +0 -6
  159. package/src/components/block-icon/style.scss +0 -6
  160. package/src/components/block-icon/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +6 -2
  161. package/src/components/block-inspector/index.jsx +3 -11
  162. package/src/components/block-list/content.scss +4 -1
  163. package/src/components/block-list/use-block-props/use-is-hovered.js +24 -5
  164. package/src/components/block-manager/style.scss +2 -0
  165. package/src/components/block-mover/test/mover-description.js +1 -0
  166. package/src/components/block-preview/index.jsx +1 -2
  167. package/src/components/block-preview/test/{index.jsx → index.jsdom.test.jsx} +10 -6
  168. package/src/components/block-selection-clearer/test/{index.jsx → index.jsdom.test.jsx} +24 -19
  169. package/src/components/block-settings-menu/test/{block-mode-toggle.jsx → block-mode-toggle.jsdom.test.jsx} +5 -1
  170. package/src/components/block-styles/test/utils.js +1 -0
  171. package/src/components/block-switcher/index.jsx +3 -3
  172. package/src/components/block-switcher/test/{index.jsx → index.jsdom.test.jsx} +8 -4
  173. package/src/components/block-switcher/test/use-transformed.patterns.js +1 -0
  174. package/src/components/block-switcher/test/utils.js +1 -0
  175. package/src/components/block-title/test/{index.jsx → index.jsdom.test.jsx} +7 -3
  176. package/src/components/block-toolbar/pattern-overrides-dropdown.jsx +3 -6
  177. package/src/components/block-toolbar/style.scss +1 -1
  178. package/src/components/block-toolbar/test/{block-toolbar-icon.jsx → block-toolbar-icon.jsdom.test.jsx} +25 -21
  179. package/src/components/block-variation-picker/content.scss +5 -3
  180. package/src/components/block-vertical-alignment-control/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +55 -11
  181. package/src/components/block-vertical-alignment-control/test/{index.jsx → index.jsdom.test.jsx} +2 -1
  182. package/src/components/block-visibility/test/{use-block-visibility.js → use-block-visibility.jsdom.test.js} +6 -5
  183. package/src/components/block-visibility/test/utils.js +2 -1
  184. package/src/components/border-radius-control/test/{index.jsx → index.jsdom.test.jsx} +8 -1
  185. package/src/components/border-radius-control/test/utils.js +1 -0
  186. package/src/components/button-block-appender/content.scss +1 -1
  187. package/src/components/child-layout-control/test/{index.jsx → index.jsdom.test.jsx} +18 -15
  188. package/src/components/color-palette/test/{control.jsx → control.jsdom.test.jsx} +15 -4
  189. package/src/components/colors/test/utils.js +1 -0
  190. package/src/components/colors/test/{with-colors.jsx → with-colors.jsdom.test.jsx} +4 -3
  191. package/src/components/colors-gradients/test/{control.jsx → control.jsdom.test.jsx} +8 -3
  192. package/src/components/contrast-checker/test/{index.jsx → index.jsdom.test.jsx} +2 -1
  193. package/src/components/default-block-appender/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +4 -4
  194. package/src/components/default-block-appender/test/{index.jsx → index.jsdom.test.jsx} +8 -7
  195. package/src/components/dimensions-tool/test/{index.jsx → index.jsdom.test.jsx} +27 -22
  196. package/src/components/dimensions-tool/test/utils.js +1 -0
  197. package/src/components/duotone-control/test/{index.jsx → index.jsdom.test.jsx} +6 -3
  198. package/src/components/font-sizes/test/fluid-utils.js +1 -0
  199. package/src/components/font-sizes/test/utils.js +1 -0
  200. package/src/components/global-styles/border-panel.jsx +17 -40
  201. package/src/components/global-styles/image-settings-panel.jsx +1 -1
  202. package/src/components/global-styles/inheritance/test/{index.jsx → index.jsdom.test.jsx} +5 -2
  203. package/src/components/global-styles/test/{background-panel.jsx → background-panel.jsdom.test.jsx} +10 -5
  204. package/src/components/global-styles/test/{border-panel.jsx → border-panel.jsdom.test.jsx} +113 -13
  205. package/src/components/global-styles/test/{color-panel.jsx → color-panel.jsdom.test.jsx} +5 -0
  206. package/src/components/global-styles/test/{dimensions-panel.jsx → dimensions-panel.jsdom.test.jsx} +14 -14
  207. package/src/components/global-styles/test/{filters-panel.jsx → filters-panel.jsdom.test.jsx} +7 -4
  208. package/src/components/global-styles/test/{inherited-value-context-core.js → inherited-value-context-core.jsdom.test.js} +10 -9
  209. package/src/components/global-styles/test/{inherited-value-context.jsx → inherited-value-context.jsdom.test.jsx} +18 -17
  210. package/src/components/global-styles/test/{state-control-badges.jsx → state-control-badges.jsdom.test.jsx} +3 -2
  211. package/src/components/global-styles/test/{typography-panel-core.jsx → typography-panel-core.jsdom.test.jsx} +5 -2
  212. package/src/components/global-styles/test/{typography-panel.jsx → typography-panel.jsdom.test.jsx} +17 -12
  213. package/src/components/global-styles/test/typography-utils.js +1 -0
  214. package/src/components/global-styles/test/utils.js +1 -0
  215. package/src/components/grid/style.scss +0 -10
  216. package/src/components/iframe/index.jsx +3 -3
  217. package/src/components/image-editor/test/index.js +1 -0
  218. package/src/components/image-size-control/test/{index.jsx → index.jsdom.test.jsx} +8 -3
  219. package/src/components/inner-blocks/test/__snapshots__/index.jsdom.test.jsx.snap +15 -0
  220. package/src/components/inner-blocks/test/{index.jsx → index.jsdom.test.jsx} +2 -0
  221. package/src/components/inner-content/test/{index.jsx → index.jsdom.test.jsx} +1 -0
  222. package/src/components/inserter/hooks/use-patterns-paging.js +1 -1
  223. package/src/components/inserter/media-tab/test/{hooks.js → hooks.jsdom.test.js} +12 -11
  224. package/src/components/inserter/media-tab/test/{media-panel.jsx → media-panel.jsdom.test.jsx} +15 -12
  225. package/src/components/inserter/style.scss +2 -2
  226. package/src/components/inserter/test/get-appender-label.js +12 -11
  227. package/src/components/inserter/test/search-items.js +1 -0
  228. package/src/components/inserter-draggable-blocks/index.jsx +1 -1
  229. package/src/components/inserter-list-item/style.scss +1 -0
  230. package/src/components/inspector-controls-tabs/content-tab.jsx +7 -14
  231. package/src/components/inspector-controls-tabs/styles-tab.jsx +1 -4
  232. package/src/components/inspector-controls-tabs/use-inspector-controls-tabs.js +1 -8
  233. package/src/components/inspector-popover-header/index.jsx +6 -7
  234. package/src/components/line-height-control/test/{index.jsx → index.jsdom.test.jsx} +3 -0
  235. package/src/components/link-control/index.jsx +3 -0
  236. package/src/components/link-control/search-input.jsx +1 -1
  237. package/src/components/link-control/style.scss +1 -1
  238. package/src/components/link-control/test/{index.jsx → index.jsdom.test.jsx} +52 -42
  239. package/src/components/link-control/test/is-url-like.js +1 -0
  240. package/src/components/link-control/test/{url-normalization.test.jsx → url-normalization.jsdom.test.jsx} +21 -20
  241. package/src/components/link-picker/test/{index.jsx → index.jsdom.test.jsx} +31 -30
  242. package/src/components/list-view/block-select-button.jsx +6 -1
  243. package/src/components/list-view/block.jsx +6 -4
  244. package/src/components/list-view/style.scss +55 -35
  245. package/src/components/list-view/test/use-list-view-drop-zone.js +1 -0
  246. package/src/components/list-view/test/utils.js +1 -0
  247. package/src/components/list-view/use-list-view-drop-zone.js +1 -1
  248. package/src/components/media-placeholder/test/get-computed-accept-attribute.js +1 -0
  249. package/src/components/media-placeholder/test/{index.jsx → index.jsdom.test.jsx} +8 -2
  250. package/src/components/media-replace-flow/index.jsx +6 -1
  251. package/src/components/media-replace-flow/test/{index.jsx → index.jsdom.test.jsx} +3 -0
  252. package/src/components/navigable-toolbar/index.jsx +4 -0
  253. package/src/components/navigable-toolbar/test/index.browser.test.js +50 -0
  254. package/src/components/panel-color-settings/test/{index.jsx → index.jsdom.test.jsx} +3 -0
  255. package/src/components/preset-input-control/test/{index.jsx → index.jsdom.test.jsx} +8 -2
  256. package/src/components/preset-input-control/test/utils.js +1 -0
  257. package/src/components/provider/test/{experimental-provider.jsx → experimental-provider.jsdom.test.jsx} +3 -2
  258. package/src/components/provider/test/{use-block-sync.jsx → use-block-sync.jsdom.test.jsx} +45 -44
  259. package/src/components/recursion-provider/test/{index.jsx → index.jsdom.test.jsx} +1 -0
  260. package/src/components/responsive-block-control/style.scss +1 -0
  261. package/src/components/responsive-block-control/test/{index.jsx → index.jsdom.test.jsx} +6 -3
  262. package/src/components/rich-text/event-listeners/enter.js +29 -14
  263. package/src/components/rich-text/event-listeners/index.js +0 -2
  264. package/src/components/rich-text/event-listeners/input-rules.js +7 -2
  265. package/src/components/spacing-sizes-control/test/{index.jsx → index.jsdom.test.jsx} +23 -20
  266. package/src/components/spacing-sizes-control/test/utils.js +1 -0
  267. package/src/components/url-input/test/{button.jsx → button.jsdom.test.jsx} +4 -1
  268. package/src/components/url-input/test/fixtures/validated-input-control-deprecation.js +2 -0
  269. package/src/components/url-input/test/{index.jsx → index.jsdom.test.jsx} +23 -13
  270. package/src/components/use-block-display-information/test/{index.jsx → index.jsdom.test.jsx} +14 -10
  271. package/src/components/use-block-drop-zone/index.js +2 -2
  272. package/src/components/use-block-drop-zone/test/index.js +1 -0
  273. package/src/components/use-on-block-drop/test/index.js +28 -31
  274. package/src/components/warning/test/__snapshots__/{index.jsx.snap → index.jsdom.test.jsx.snap} +2 -2
  275. package/src/components/warning/test/{index.jsx → index.jsdom.test.jsx} +1 -0
  276. package/src/components/writing-flow/index.jsx +5 -0
  277. package/src/components/writing-flow/style.scss +48 -0
  278. package/src/components/writing-flow/test/{index.js → index.jsdom.test.js} +1 -0
  279. package/src/components/writing-flow/use-arrow-nav.js +2 -2
  280. package/src/components/writing-flow/use-input.js +29 -2
  281. package/src/components/writing-flow/use-tab-nav.jsx +155 -70
  282. package/src/components/writing-flow/use-undo-automatic-change.js +40 -0
  283. package/src/elements/test/{index.js → index.jsdom.test.js} +1 -0
  284. package/src/hooks/border.jsx +0 -53
  285. package/src/hooks/generate-fields-from-attributes.js +1 -1
  286. package/src/hooks/index.js +0 -2
  287. package/src/hooks/style.jsx +3 -2
  288. package/src/hooks/test/{align.jsx → align.jsdom.test.jsx} +1 -0
  289. package/src/hooks/test/allowed-blocks.js +1 -0
  290. package/src/hooks/test/{anchor.js → anchor.jsdom.test.js} +1 -0
  291. package/src/hooks/test/{auto-inspector-controls.js → auto-inspector-controls.jsdom.test.js} +1 -0
  292. package/src/hooks/test/{background.jsx → background.jsdom.test.jsx} +5 -2
  293. package/src/hooks/test/{block-style-state.js → block-style-state.jsdom.test.js} +4 -3
  294. package/src/hooks/test/{cross-origin-isolation.js → cross-origin-isolation.jsdom.test.js} +18 -25
  295. package/src/hooks/test/{custom-class-name.jsx → custom-class-name.jsdom.test.jsx} +1 -0
  296. package/src/hooks/test/{dimensions.js → dimensions.jsdom.test.js} +1 -0
  297. package/src/hooks/test/{duotone.js → duotone.jsdom.test.js} +1 -0
  298. package/src/hooks/test/{font-size.js → font-size.jsdom.test.js} +1 -0
  299. package/src/hooks/test/gap.js +1 -0
  300. package/src/hooks/test/generate-fields-from-attributes.js +1 -0
  301. package/src/hooks/test/generated-class-name.js +1 -0
  302. package/src/hooks/test/{inherited-value-wiring.jsx → inherited-value-wiring.jsdom.test.jsx} +49 -51
  303. package/src/hooks/test/{layout-child.js → layout-child.jsdom.test.js} +1 -0
  304. package/src/hooks/test/{layout.js → layout.jsdom.test.js} +1 -0
  305. package/src/hooks/test/metadata.js +1 -0
  306. package/src/hooks/test/preset-round-trip.js +2 -0
  307. package/src/hooks/test/settings.jsx +1 -0
  308. package/src/hooks/test/state-utils.js +1 -0
  309. package/src/hooks/test/{style.jsx → style.jsdom.test.jsx} +1 -0
  310. package/src/hooks/test/{text-align.jsx → text-align.jsdom.test.jsx} +1 -0
  311. package/src/hooks/test/{use-typography-props.js → use-typography-props.jsdom.test.js} +1 -0
  312. package/src/hooks/test/{utils.js → utils.jsdom.test.js} +1 -0
  313. package/src/layouts/flex.jsx +7 -0
  314. package/src/layouts/test/{constrained.jsx → constrained.jsdom.test.jsx} +6 -3
  315. package/src/layouts/test/{flex.jsx → flex.jsdom.test.jsx} +52 -2
  316. package/src/layouts/test/{flow.js → flow.jsdom.test.js} +1 -0
  317. package/src/layouts/test/{grid.jsx → grid.jsdom.test.jsx} +5 -2
  318. package/src/layouts/test/utils.js +1 -0
  319. package/src/store/actions.js +14 -12
  320. package/src/store/test/{actions.js → actions.jsdom.test.js} +50 -49
  321. package/src/store/test/array.js +1 -0
  322. package/src/store/test/get-block-settings.js +1 -0
  323. package/src/store/test/performance.js +2 -1
  324. package/src/store/test/private-actions.js +1 -0
  325. package/src/store/test/private-selectors.js +13 -3
  326. package/src/store/test/reducer.js +37 -8
  327. package/src/store/test/{registry-selectors.js → registry-selectors.jsdom.test.js} +9 -0
  328. package/src/store/test/{selectors.jsx → selectors.jsdom.test.jsx} +13 -3
  329. package/src/style.scss +1 -1
  330. package/src/utils/test/block-bindings.js +1 -0
  331. package/src/utils/test/color-values.js +1 -0
  332. package/src/utils/test/{dom.jsx → dom.jsdom.test.jsx} +38 -43
  333. package/src/utils/test/format-font-style.js +1 -0
  334. package/src/utils/test/format-font-weight.js +1 -0
  335. package/src/utils/test/get-font-styles-and-weights.js +1 -0
  336. package/src/utils/test/math.js +1 -0
  337. package/src/utils/test/object.js +1 -0
  338. package/src/utils/test/pasting.js +1 -0
  339. package/src/utils/test/selection.js +1 -0
  340. package/src/utils/test/sorting.js +1 -0
  341. package/src/utils/test/transform-styles.js +2 -1
  342. package/build/components/rich-text/event-listeners/undo-automatic-change.cjs.map +0 -7
  343. package/build/hooks/block-fields/fields-dropdown-menu.cjs +0 -67
  344. package/build/hooks/block-fields/fields-dropdown-menu.cjs.map +0 -7
  345. package/build/hooks/block-fields/index.cjs +0 -238
  346. package/build/hooks/block-fields/index.cjs.map +0 -7
  347. package/build/hooks/block-fields/link/index.cjs +0 -174
  348. package/build/hooks/block-fields/link/index.cjs.map +0 -7
  349. package/build/hooks/block-fields/media/index.cjs +0 -262
  350. package/build/hooks/block-fields/media/index.cjs.map +0 -7
  351. package/build/hooks/block-fields/rich-text/index.cjs +0 -146
  352. package/build/hooks/block-fields/rich-text/index.cjs.map +0 -7
  353. package/build/hooks/block-fields/use-inspector-popover-placement.cjs +0 -41
  354. package/build/hooks/block-fields/use-inspector-popover-placement.cjs.map +0 -7
  355. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs +0 -33
  356. package/build-module/components/rich-text/event-listeners/undo-automatic-change.mjs.map +0 -7
  357. package/build-module/hooks/block-fields/fields-dropdown-menu.mjs +0 -46
  358. package/build-module/hooks/block-fields/fields-dropdown-menu.mjs.map +0 -7
  359. package/build-module/hooks/block-fields/index.mjs +0 -210
  360. package/build-module/hooks/block-fields/index.mjs.map +0 -7
  361. package/build-module/hooks/block-fields/link/index.mjs +0 -141
  362. package/build-module/hooks/block-fields/link/index.mjs.map +0 -7
  363. package/build-module/hooks/block-fields/media/index.mjs +0 -241
  364. package/build-module/hooks/block-fields/media/index.mjs.map +0 -7
  365. package/build-module/hooks/block-fields/rich-text/index.mjs +0 -115
  366. package/build-module/hooks/block-fields/rich-text/index.mjs.map +0 -7
  367. package/build-module/hooks/block-fields/use-inspector-popover-placement.mjs +0 -16
  368. package/build-module/hooks/block-fields/use-inspector-popover-placement.mjs.map +0 -7
  369. package/src/components/color-palette/test/__snapshots__/control.jsx.snap +0 -143
  370. package/src/components/inner-blocks/test/__snapshots__/index.jsx.snap +0 -15
  371. package/src/components/rich-text/event-listeners/undo-automatic-change.js +0 -39
  372. package/src/hooks/block-fields/fields-dropdown-menu.jsx +0 -47
  373. package/src/hooks/block-fields/index.jsx +0 -302
  374. package/src/hooks/block-fields/link/index.jsx +0 -155
  375. package/src/hooks/block-fields/link/styles.scss +0 -18
  376. package/src/hooks/block-fields/media/index.jsx +0 -269
  377. package/src/hooks/block-fields/media/styles.scss +0 -77
  378. package/src/hooks/block-fields/rich-text/index.jsx +0 -123
  379. package/src/hooks/block-fields/rich-text/styles.scss +0 -24
  380. package/src/hooks/block-fields/styles.scss +0 -33
  381. package/src/hooks/block-fields/use-inspector-popover-placement.js +0 -16
  382. /package/src/components/block-icon/test/{index.jsx → index.jsdom.test.jsx} +0 -0
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it, vi } from 'vitest';
1
2
  import {
2
3
  getStyleForState,
3
4
  scopeResetAllFilterToState,
@@ -153,7 +154,7 @@ describe( 'setStyleForState', () => {
153
154
 
154
155
  describe( 'scopeResetAllFilterToState', () => {
155
156
  it( 'passes only the selected state style to the reset filter', () => {
156
- const innerReset = jest.fn( ( attributes ) => ( {
157
+ const innerReset = vi.fn( ( attributes ) => ( {
157
158
  ...attributes,
158
159
  style: {
159
160
  ...attributes.style,
@@ -213,7 +214,7 @@ describe( 'scopeResetAllFilterToState', () => {
213
214
  } );
214
215
 
215
216
  it( 'calls the reset filter with an empty style when no state styles exist', () => {
216
- const innerReset = jest.fn( ( attributes ) => attributes );
217
+ const innerReset = vi.fn( ( attributes ) => attributes );
217
218
  const attributes = {
218
219
  style: { color: { text: '#000000' } },
219
220
  };
@@ -227,7 +228,7 @@ describe( 'scopeResetAllFilterToState', () => {
227
228
  } );
228
229
 
229
230
  it( 'passes only the selected viewport pseudo state style to the reset filter', () => {
230
- const innerReset = jest.fn( () => ( { style: undefined } ) );
231
+ const innerReset = vi.fn( () => ( { style: undefined } ) );
231
232
  const attributes = {
232
233
  style: {
233
234
  color: { text: '#000000' },
@@ -1,18 +1,22 @@
1
+ import { afterEach, beforeEach, describe, expect, it, vi } from 'vitest';
2
+
1
3
  describe( 'cross-origin-isolation', () => {
2
4
  let originalCrossOriginIsolated;
3
5
  let originalBody;
4
6
  let observeSpy;
5
7
 
6
8
  beforeEach( () => {
9
+ vi.resetModules();
10
+
7
11
  // Save original values
8
12
  originalCrossOriginIsolated = window.crossOriginIsolated;
9
13
  originalBody = document.body;
10
14
 
11
15
  // Clear any existing filters
12
- jest.clearAllMocks();
16
+ vi.clearAllMocks();
13
17
 
14
18
  // Spy on MutationObserver.observe
15
- observeSpy = jest.spyOn( window.MutationObserver.prototype, 'observe' );
19
+ observeSpy = vi.spyOn( window.MutationObserver.prototype, 'observe' );
16
20
  } );
17
21
 
18
22
  afterEach( () => {
@@ -34,10 +38,9 @@ describe( 'cross-origin-isolation', () => {
34
38
  }
35
39
 
36
40
  observeSpy.mockRestore();
37
- jest.resetModules();
38
41
  } );
39
42
 
40
- it( 'should not observe when crossOriginIsolated is false', () => {
43
+ it( 'should not observe when crossOriginIsolated is false', async () => {
41
44
  Object.defineProperty( window, 'crossOriginIsolated', {
42
45
  value: false,
43
46
  writable: true,
@@ -45,14 +48,12 @@ describe( 'cross-origin-isolation', () => {
45
48
  } );
46
49
 
47
50
  // Re-import the module to trigger the side effects
48
- jest.isolateModules( () => {
49
- require( '../cross-origin-isolation' );
50
- } );
51
+ await import( '../cross-origin-isolation' );
51
52
 
52
53
  expect( observeSpy ).not.toHaveBeenCalled();
53
54
  } );
54
55
 
55
- it( 'should observe document.body when crossOriginIsolated is true and body exists', () => {
56
+ it( 'should observe document.body when crossOriginIsolated is true and body exists', async () => {
56
57
  Object.defineProperty( window, 'crossOriginIsolated', {
57
58
  value: true,
58
59
  writable: true,
@@ -66,9 +67,7 @@ describe( 'cross-origin-isolation', () => {
66
67
  } );
67
68
 
68
69
  // Re-import the module to trigger the side effects
69
- jest.isolateModules( () => {
70
- require( '../cross-origin-isolation' );
71
- } );
70
+ await import( '../cross-origin-isolation' );
72
71
 
73
72
  expect( observeSpy ).toHaveBeenCalledWith( document.body, {
74
73
  childList: true,
@@ -77,7 +76,7 @@ describe( 'cross-origin-isolation', () => {
77
76
  } );
78
77
  } );
79
78
 
80
- it( 'should wait for DOMContentLoaded when body is not available and document is loading', () => {
79
+ it( 'should wait for DOMContentLoaded when body is not available and document is loading', async () => {
81
80
  Object.defineProperty( window, 'crossOriginIsolated', {
82
81
  value: true,
83
82
  writable: true,
@@ -98,12 +97,10 @@ describe( 'cross-origin-isolation', () => {
98
97
  configurable: true,
99
98
  } );
100
99
 
101
- const addEventListenerSpy = jest.spyOn( document, 'addEventListener' );
100
+ const addEventListenerSpy = vi.spyOn( document, 'addEventListener' );
102
101
 
103
102
  // Re-import the module to trigger the side effects
104
- jest.isolateModules( () => {
105
- require( '../cross-origin-isolation' );
106
- } );
103
+ await import( '../cross-origin-isolation' );
107
104
 
108
105
  // Should not observe immediately
109
106
  expect( observeSpy ).not.toHaveBeenCalled();
@@ -117,7 +114,7 @@ describe( 'cross-origin-isolation', () => {
117
114
  addEventListenerSpy.mockRestore();
118
115
  } );
119
116
 
120
- it( 'should not throw error when body is null and document is complete', () => {
117
+ it( 'should not throw error when body is null and document is complete', async () => {
121
118
  Object.defineProperty( window, 'crossOriginIsolated', {
122
119
  value: true,
123
120
  writable: true,
@@ -138,11 +135,9 @@ describe( 'cross-origin-isolation', () => {
138
135
  } );
139
136
 
140
137
  // This should not throw an error
141
- expect( () => {
142
- jest.isolateModules( () => {
143
- require( '../cross-origin-isolation' );
144
- } );
145
- } ).not.toThrow();
138
+ await expect(
139
+ import( '../cross-origin-isolation' )
140
+ ).resolves.toBeDefined();
146
141
 
147
142
  // Should not attempt to observe null
148
143
  expect( observeSpy ).not.toHaveBeenCalled();
@@ -156,9 +151,7 @@ describe( 'cross-origin-isolation', () => {
156
151
  } );
157
152
 
158
153
  // Re-import the module to trigger the side effects
159
- jest.isolateModules( () => {
160
- require( '../cross-origin-isolation' );
161
- } );
154
+ await import( '../cross-origin-isolation' );
162
155
 
163
156
  // Create an image and add it to the DOM
164
157
  const img = document.createElement( 'img' );
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import { applyFilters } from '@wordpress/hooks';
2
3
  import customClassName from '../custom-class-name';
3
4
 
@@ -1,3 +1,4 @@
1
+ import { afterEach, describe, expect, it } from 'vitest';
1
2
  import {
2
3
  getBlockType,
3
4
  registerBlockType,
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import {
2
3
  getColorsFromDuotonePreset,
3
4
  getDuotonePresetFromColors,
@@ -1,3 +1,4 @@
1
+ import { afterEach, describe, expect, it } from 'vitest';
1
2
  import { renderHook } from '@testing-library/react';
2
3
  import { addFilter, removeFilter } from '@wordpress/hooks';
3
4
  import {
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import {
2
3
  getGapCSSValue,
3
4
  getGapBoxControlValueFromStyle,
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import { generateFieldsFromAttributes } from '../generate-fields-from-attributes';
2
3
 
3
4
  /**
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import { applyFilters } from '@wordpress/hooks';
2
3
  import '../generated-class-name';
3
4
 
@@ -1,4 +1,12 @@
1
+ import { beforeEach, describe, expect, test, vi } from 'vitest';
1
2
  import { render } from '@testing-library/react';
3
+ import { getBlockSupport, hasBlockSupport } from '@wordpress/blocks';
4
+ import { useSelect } from '@wordpress/data';
5
+ import { TypographyPanel } from '../typography';
6
+ import { ElementsEdit } from '../elements';
7
+ import { BorderPanel } from '../border';
8
+ import { DimensionsPanel } from '../dimensions';
9
+ import { BackgroundImagePanel } from '../background';
2
10
 
3
11
  /**
4
12
  * Tests the wiring between inspector hook wrappers and shared
@@ -11,24 +19,31 @@ import { render } from '@testing-library/react';
11
19
  * intentionally mocked out so each test exercises only the wiring contract.
12
20
  */
13
21
 
14
- // Jest hoists `jest.mock` factories; proxies for spies need to satisfy
15
- // the `/^mock/i` naming convention.
22
+ // Vitest hoists `vi.mock` factories, so recorder values are exposed through
23
+ // mutable objects that the factories can close over safely.
16
24
  const mockHookRecorder = { calls: [] };
17
25
  const mockPanelRecorder = { calls: [] };
18
26
  const mockInheritedReturn = { value: {} };
19
27
 
20
- jest.mock( '../../components/global-styles/inherited-value-context', () => ( {
21
- __esModule: true,
22
- useResolvedStyle: ( blockName, className, selectedState ) => {
23
- mockHookRecorder.calls.push( { blockName, className, selectedState } );
24
- return {
25
- value: mockInheritedReturn.value,
26
- sources: {},
27
- };
28
- },
29
- } ) );
28
+ vi.mock(
29
+ import( '../../components/global-styles/inherited-value-context' ),
30
+ () => ( {
31
+ __esModule: true,
32
+ useResolvedStyle: ( blockName, className, selectedState ) => {
33
+ mockHookRecorder.calls.push( {
34
+ blockName,
35
+ className,
36
+ selectedState,
37
+ } );
38
+ return {
39
+ value: mockInheritedReturn.value,
40
+ sources: {},
41
+ };
42
+ },
43
+ } )
44
+ );
30
45
 
31
- jest.mock( '../../components/global-styles/typography-panel', () => ( {
46
+ vi.mock( import( '../../components/global-styles/typography-panel' ), () => ( {
32
47
  __esModule: true,
33
48
  default: ( props ) => {
34
49
  mockPanelRecorder.calls.push( [ 'typography', props ] );
@@ -36,7 +51,7 @@ jest.mock( '../../components/global-styles/typography-panel', () => ( {
36
51
  },
37
52
  useHasTypographyPanel: () => true,
38
53
  } ) );
39
- jest.mock( '../../components/global-styles/color-panel', () => ( {
54
+ vi.mock( import( '../../components/global-styles/color-panel' ), () => ( {
40
55
  __esModule: true,
41
56
  default: ( { children, ...rest } ) => {
42
57
  mockPanelRecorder.calls.push( [ 'color', rest ] );
@@ -44,7 +59,7 @@ jest.mock( '../../components/global-styles/color-panel', () => ( {
44
59
  },
45
60
  useHasColorPanel: () => true,
46
61
  } ) );
47
- jest.mock( '../../components/global-styles/border-panel', () => ( {
62
+ vi.mock( import( '../../components/global-styles/border-panel' ), () => ( {
48
63
  __esModule: true,
49
64
  default: ( props ) => {
50
65
  mockPanelRecorder.calls.push( [ 'border', props ] );
@@ -53,7 +68,7 @@ jest.mock( '../../components/global-styles/border-panel', () => ( {
53
68
  useHasBorderPanel: () => true,
54
69
  useHasBorderPanelControls: () => ( {} ),
55
70
  } ) );
56
- jest.mock( '../../components/global-styles/dimensions-panel', () => ( {
71
+ vi.mock( import( '../../components/global-styles/dimensions-panel' ), () => ( {
57
72
  __esModule: true,
58
73
  default: ( props ) => {
59
74
  mockPanelRecorder.calls.push( [ 'dimensions', props ] );
@@ -61,7 +76,7 @@ jest.mock( '../../components/global-styles/dimensions-panel', () => ( {
61
76
  },
62
77
  useHasDimensionsPanel: () => true,
63
78
  } ) );
64
- jest.mock( '../../components/global-styles/background-panel', () => ( {
79
+ vi.mock( import( '../../components/global-styles/background-panel' ), () => ( {
65
80
  __esModule: true,
66
81
  default: ( props ) => {
67
82
  mockPanelRecorder.calls.push( [ 'background', props ] );
@@ -75,7 +90,7 @@ jest.mock( '../../components/global-styles/background-panel', () => ( {
75
90
  // The Typography, Background and Elements wrappers now request a contrast
76
91
  // warning (relocated color controls). The hook pulls the data store into its
77
92
  // import graph, so stub it to a no-op for these wiring-only tests.
78
- jest.mock( '../contrast-checker', () => ( {
93
+ vi.mock( import( '../contrast-checker' ), () => ( {
79
94
  __esModule: true,
80
95
  default: () => undefined,
81
96
  } ) );
@@ -83,9 +98,9 @@ jest.mock( '../contrast-checker', () => ( {
83
98
  // Stub the minimal `@wordpress/data` surface the wrappers call into
84
99
  // directly. The real store + persistence machinery is intentionally
85
100
  // elided. The prop plumbing is testable with the mocked selector surface.
86
- jest.mock( '@wordpress/data', () => ( {
101
+ vi.mock( import( '@wordpress/data' ), () => ( {
87
102
  __esModule: true,
88
- useSelect: jest.fn(),
103
+ useSelect: vi.fn(),
89
104
  useDispatch: () => ( {} ),
90
105
  useRegistry: () => ( {} ),
91
106
  createSelector: ( fn ) => fn,
@@ -104,12 +119,12 @@ jest.mock( '@wordpress/data', () => ( {
104
119
  withDispatch: () => ( c ) => c,
105
120
  } ) );
106
121
 
107
- jest.mock( '@wordpress/blocks', () => ( {
122
+ vi.mock( import( '@wordpress/blocks' ), () => ( {
108
123
  __esModule: true,
109
- getBlockSupport: jest.fn( () => undefined ),
110
- hasBlockSupport: jest.fn( () => false ),
111
- getBlockType: jest.fn( () => null ),
112
- getBlockTypes: jest.fn( () => [] ),
124
+ getBlockSupport: vi.fn( () => undefined ),
125
+ hasBlockSupport: vi.fn( () => false ),
126
+ getBlockType: vi.fn( () => null ),
127
+ getBlockTypes: vi.fn( () => [] ),
113
128
  store: { name: 'core/blocks' },
114
129
  } ) );
115
130
 
@@ -119,14 +134,14 @@ jest.mock( '@wordpress/blocks', () => ( {
119
134
  // not carry the private-API marker. Short-circuit to a passthrough so
120
135
  // these tests can exercise the wrapper wiring without threading
121
136
  // the full private-API handshake through every stub.
122
- jest.mock( '@wordpress/private-apis', () => ( {
137
+ vi.mock( import( '@wordpress/private-apis' ), () => ( {
123
138
  __esModule: true,
124
139
  __dangerousOptInToUnstableAPIsOnlyForCoreModules: () => ( {
125
140
  lock: () => {},
126
- unlock: ( value ) =>
127
- new Proxy( value ?? {}, {
128
- get: () => () => undefined,
129
- } ),
141
+ unlock: () => ( {
142
+ hideBlockInterface: () => undefined,
143
+ showBlockInterface: () => undefined,
144
+ } ),
130
145
  } ),
131
146
  } ) );
132
147
 
@@ -135,12 +150,12 @@ jest.mock( '@wordpress/private-apis', () => ( {
135
150
  // is already mocked to a Proxy-driven stub and never actually touches
136
151
  // the store. Providing a stub avoids the private-APIs unlock that
137
152
  // the real `store/index.js` performs at module load.
138
- jest.mock( '../../store', () => ( {
153
+ vi.mock( import( '../../store' ), () => ( {
139
154
  __esModule: true,
140
155
  store: { name: 'core/block-editor' },
141
156
  } ) );
142
157
 
143
- jest.mock( '../../store/private-keys', () => ( {
158
+ vi.mock( import( '../../store/private-keys' ), () => ( {
144
159
  __esModule: true,
145
160
  globalStylesDataKey: Symbol( 'globalStylesDataKey' ),
146
161
  globalStylesLinksDataKey: Symbol( 'globalStylesLinksDataKey' ),
@@ -149,14 +164,11 @@ jest.mock( '../../store/private-keys', () => ( {
149
164
 
150
165
  // Short-circuit the block-editor components barrel (`../../components`),
151
166
  // which pulls the data store into its import graph transitively.
152
- jest.mock(
153
- '../../components',
154
- () => new Proxy( {}, { get: () => () => null } )
155
- );
167
+ vi.mock( import( '../../components' ), () => ( {} ) );
156
168
 
157
169
  // `InspectorControls` is a slot-fill component with registry dependencies.
158
170
  // Mock it to a passthrough div.
159
- jest.mock( '../../components/inspector-controls', () => ( {
171
+ vi.mock( import( '../../components/inspector-controls' ), () => ( {
160
172
  __esModule: true,
161
173
  default: ( { children } ) => (
162
174
  <div data-testid="inspector-controls">{ children }</div>
@@ -171,7 +183,6 @@ beforeEach( () => {
171
183
  mockPanelRecorder.calls = [];
172
184
  mockInheritedReturn.value = {};
173
185
  mockUseSelectImpl.fn = () => undefined;
174
- const { useSelect } = require( '@wordpress/data' );
175
186
  useSelect.mockImplementation( ( mapSelect ) => {
176
187
  // Feed mapSelect a synthetic `select()` that returns an object
177
188
  // whose methods all yield what the current test configured.
@@ -190,9 +201,6 @@ beforeEach( () => {
190
201
 
191
202
  describe( 'inspector hook wrappers thread inheritedValue into the panel', () => {
192
203
  test( 'TypographyPanel calls useResolvedStyle with the block name and threads inheritedValue', () => {
193
- // Imported inside the test so the `jest.mock` factories are
194
- // applied before the wrapper's module graph is resolved.
195
- const { TypographyPanel } = require( '../typography' );
196
204
  mockUseSelectImpl.fn = () => ( {
197
205
  style: { typography: { fontSize: '14px' } },
198
206
  fontFamily: undefined,
@@ -230,7 +238,6 @@ describe( 'inspector hook wrappers thread inheritedValue into the panel', () =>
230
238
  // and background color are wired through the Typography and Background
231
239
  // wrappers and covered above/below.
232
240
  test( 'ElementsEdit wires block-scoped Global Styles into the Color panel', () => {
233
- const { ElementsEdit } = require( '../elements' );
234
241
  mockUseSelectImpl.fn = () => ( {
235
242
  style: undefined,
236
243
  className: undefined,
@@ -258,7 +265,6 @@ describe( 'inspector hook wrappers thread inheritedValue into the panel', () =>
258
265
  } );
259
266
 
260
267
  test( 'BorderPanel threads a border-scoped inheritedValue into the panel', () => {
261
- const { BorderPanel } = require( '../border' );
262
268
  mockUseSelectImpl.fn = () => ( {
263
269
  style: undefined,
264
270
  borderColor: undefined,
@@ -286,7 +292,6 @@ describe( 'inspector hook wrappers thread inheritedValue into the panel', () =>
286
292
  } );
287
293
 
288
294
  test( 'DimensionsPanel threads spacing inheritedValue into the panel', () => {
289
- const { DimensionsPanel } = require( '../dimensions' );
290
295
  mockUseSelectImpl.fn = () => ( {
291
296
  value: undefined,
292
297
  className: undefined,
@@ -313,10 +318,6 @@ describe( 'inspector hook wrappers thread inheritedValue into the panel', () =>
313
318
  } );
314
319
 
315
320
  test( 'BackgroundImagePanel replaces its pre-feature partial wiring with a full inherited payload', () => {
316
- const {
317
- hasBlockSupport,
318
- getBlockSupport,
319
- } = require( '@wordpress/blocks' );
320
321
  getBlockSupport.mockImplementation( ( _n, key ) => {
321
322
  if ( key === 'background' ) {
322
323
  return { backgroundImage: true };
@@ -325,7 +326,6 @@ describe( 'inspector hook wrappers thread inheritedValue into the panel', () =>
325
326
  } );
326
327
  hasBlockSupport.mockReturnValue( true );
327
328
 
328
- const { BackgroundImagePanel } = require( '../background' );
329
329
  mockUseSelectImpl.fn = () => ( {
330
330
  style: undefined,
331
331
  className: undefined,
@@ -352,7 +352,6 @@ describe( 'inspector hook wrappers thread inheritedValue into the panel', () =>
352
352
  } );
353
353
 
354
354
  test( 'wrappers forward the block className to useResolvedStyle', () => {
355
- const { TypographyPanel } = require( '../typography' );
356
355
  mockUseSelectImpl.fn = () => ( {
357
356
  style: undefined,
358
357
  fontFamily: undefined,
@@ -378,7 +377,6 @@ describe( 'inspector hook wrappers thread inheritedValue into the panel', () =>
378
377
  } );
379
378
 
380
379
  test( 'wrappers fall back to empty inheritedValue during hydration', () => {
381
- const { TypographyPanel } = require( '../typography' );
382
380
  mockUseSelectImpl.fn = () => ( {
383
381
  style: undefined,
384
382
  fontFamily: undefined,
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import {
2
3
  getChildLayoutStyleRules,
3
4
  getChildLayoutStyles,
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import {
2
3
  getLayoutStateOverrides,
3
4
  getResetLayout,
@@ -1,3 +1,4 @@
1
+ import { afterEach, describe, expect, it } from 'vitest';
1
2
  import {
2
3
  getBlockTypes,
3
4
  registerBlockType,
@@ -6,6 +6,8 @@
6
6
  * preset references, clear the relevant reset surfaces, and treat explicit
7
7
  * empty values as non-contributing layers.
8
8
  */
9
+
10
+ import { describe, expect, it } from 'vitest';
9
11
  import {
10
12
  getValueFromVariable,
11
13
  getPresetVariableFromValue,
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import { applyFilters } from '@wordpress/hooks';
2
3
  import '../settings';
3
4
 
@@ -1,3 +1,4 @@
1
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
1
2
  import { registerBlockType, unregisterBlockType } from '@wordpress/blocks';
2
3
  import {
3
4
  getRelativeRootSelector,
@@ -1,3 +1,4 @@
1
+ import { afterEach, beforeEach, describe, expect, it } from 'vitest';
1
2
  import { registerBlockType, unregisterBlockType } from '@wordpress/blocks';
2
3
  import _style, {
3
4
  getCanvasStateStyleValue,
@@ -1,3 +1,4 @@
1
+ import { afterEach, describe, expect, it } from 'vitest';
1
2
  import {
2
3
  getBlockTypes,
3
4
  registerBlockType,
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import { getTypographyClassesAndStyles } from '../use-typography-props';
2
3
 
3
4
  describe( 'getTypographyClassesAndStyles', () => {
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import { cleanEmptyObject } from '../utils';
2
3
 
3
4
  describe( 'cleanEmptyObject', () => {
@@ -351,6 +351,13 @@ export default {
351
351
  }
352
352
 
353
353
  if ( orientation === 'horizontal' ) {
354
+ // `row` is the flex default, so the base layout never declares it.
355
+ // A viewport override that switches a vertical base layout to
356
+ // horizontal has to declare it explicitly, otherwise the base
357
+ // `flex-direction: column` keeps applying.
358
+ if ( hasViewportOverride( 'orientation' ) ) {
359
+ rules.push( 'flex-direction: row' );
360
+ }
354
361
  if ( shouldOutputFlexAlignment && verticalAlignment ) {
355
362
  rules.push( `align-items: ${ verticalAlignment }` );
356
363
  }
@@ -1,18 +1,21 @@
1
+ import { describe, expect, it, vi } from 'vitest';
1
2
  import { render, screen } from '@testing-library/react';
2
3
  import userEvent from '@testing-library/user-event';
3
4
  import { __experimentalToolsPanel as ToolsPanel } from '@wordpress/components';
4
5
  import constrained from '../constrained';
5
6
 
7
+ globalThis.wpVitest.mockMatchMedia();
8
+
6
9
  const ConstrainedLayoutInspectorControls = constrained.inspectorControls;
7
10
  const PANEL_ID = 'test-panel';
8
11
 
9
12
  function renderInspectorControls( props = {} ) {
10
13
  return render(
11
- <ToolsPanel label="Layout" resetAll={ jest.fn() } panelId={ PANEL_ID }>
14
+ <ToolsPanel label="Layout" resetAll={ vi.fn() } panelId={ PANEL_ID }>
12
15
  <ConstrainedLayoutInspectorControls
13
16
  clientId={ PANEL_ID }
14
17
  layout={ {} }
15
- onChange={ jest.fn() }
18
+ onChange={ vi.fn() }
16
19
  { ...props }
17
20
  />
18
21
  </ToolsPanel>
@@ -100,7 +103,7 @@ describe( 'ConstrainedLayoutInspectorControls', () => {
100
103
  'preserves a cleared %s value for viewport layout overrides',
101
104
  async ( label, layoutKey ) => {
102
105
  const user = userEvent.setup();
103
- const onChange = jest.fn();
106
+ const onChange = vi.fn();
104
107
  renderInspectorControls( {
105
108
  layout: { type: 'constrained', [ layoutKey ]: '800px' },
106
109
  resetLayout: { type: 'constrained', [ layoutKey ]: '800px' },
@@ -1,18 +1,23 @@
1
+ import { describe, expect, it, vi } from 'vitest';
1
2
  import { render, screen } from '@testing-library/react';
2
3
  import userEvent from '@testing-library/user-event';
3
4
  import { __experimentalToolsPanel as ToolsPanel } from '@wordpress/components';
4
5
  import flex from '../flex';
5
6
 
7
+ globalThis.wpVitest.mockMatchMedia();
8
+
9
+ globalThis.wpVitest.mockResizeObserver();
10
+
6
11
  const FlexLayoutInspectorControls = flex.inspectorControls;
7
12
  const PANEL_ID = 'test-panel';
8
13
 
9
14
  function renderInspectorControls( props = {} ) {
10
15
  return render(
11
- <ToolsPanel label="Layout" resetAll={ jest.fn() } panelId={ PANEL_ID }>
16
+ <ToolsPanel label="Layout" resetAll={ vi.fn() } panelId={ PANEL_ID }>
12
17
  <FlexLayoutInspectorControls
13
18
  clientId={ PANEL_ID }
14
19
  layout={ {} }
15
- onChange={ jest.fn() }
20
+ onChange={ vi.fn() }
16
21
  { ...props }
17
22
  />
18
23
  </ToolsPanel>
@@ -34,6 +39,51 @@ describe( 'getLayoutStyle', () => {
34
39
 
35
40
  expect( result ).toBe( expected );
36
41
  } );
42
+
43
+ it( 'should output flex-direction row when a viewport override switches a vertical layout to horizontal', () => {
44
+ const result = flex.getLayoutStyle( {
45
+ selector: '.my-container',
46
+ layout: {
47
+ type: 'flex',
48
+ orientation: 'vertical',
49
+ flexWrap: 'nowrap',
50
+ justifyContent: 'center',
51
+ },
52
+ viewportOverrides: {
53
+ orientation: 'horizontal',
54
+ justifyContent: 'left',
55
+ },
56
+ style: {},
57
+ blockName: 'test-block',
58
+ hasBlockGapSupport: false,
59
+ layoutDefinitions: undefined,
60
+ } );
61
+
62
+ expect( result ).toBe(
63
+ '.my-container {\n\t\t\t\tflex-direction: row; justify-content: flex-start;\n\t\t\t}'
64
+ );
65
+ } );
66
+
67
+ it( 'should keep flex-direction implicit when a viewport override does not change a horizontal orientation', () => {
68
+ const result = flex.getLayoutStyle( {
69
+ selector: '.my-container',
70
+ layout: {
71
+ type: 'flex',
72
+ orientation: 'horizontal',
73
+ justifyContent: 'left',
74
+ },
75
+ viewportOverrides: {
76
+ justifyContent: 'right',
77
+ },
78
+ style: {},
79
+ blockName: 'test-block',
80
+ hasBlockGapSupport: false,
81
+ layoutDefinitions: undefined,
82
+ } );
83
+
84
+ expect( result ).not.toContain( 'flex-direction' );
85
+ expect( result ).toContain( 'justify-content: flex-end' );
86
+ } );
37
87
  } );
38
88
 
39
89
  describe( 'FlexLayoutInspectorControls', () => {
@@ -1,3 +1,4 @@
1
+ import { describe, expect, it } from 'vitest';
1
2
  import flow from '../flow';
2
3
 
3
4
  describe( 'getLayoutStyle', () => {