@wordpress/block-editor 15.17.0 → 15.18.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 (276) hide show
  1. package/CHANGELOG.md +6 -0
  2. package/build/components/autocomplete/index.cjs.map +3 -3
  3. package/build/components/background-image-control/index.cjs +2 -1
  4. package/build/components/background-image-control/index.cjs.map +2 -2
  5. package/build/components/block-allowed-blocks/modal.cjs.map +2 -2
  6. package/build/components/block-bindings/attribute-control.cjs.map +3 -3
  7. package/build/components/block-card/index.cjs +2 -2
  8. package/build/components/block-card/index.cjs.map +3 -3
  9. package/build/components/block-mover/button.cjs +9 -3
  10. package/build/components/block-mover/button.cjs.map +2 -2
  11. package/build/components/block-pattern-setup/index.cjs +3 -2
  12. package/build/components/block-pattern-setup/index.cjs.map +2 -2
  13. package/build/components/block-patterns-list/index.cjs +2 -1
  14. package/build/components/block-patterns-list/index.cjs.map +2 -2
  15. package/build/components/block-patterns-paging/index.cjs.map +3 -3
  16. package/build/components/block-settings-menu/block-settings-dropdown.cjs +2 -2
  17. package/build/components/block-settings-menu/block-settings-dropdown.cjs.map +3 -3
  18. package/build/components/block-settings-menu/index.cjs +2 -2
  19. package/build/components/block-settings-menu/index.cjs.map +3 -3
  20. package/build/components/block-styles/menu-items.cjs.map +3 -3
  21. package/build/components/block-switcher/index.cjs.map +3 -3
  22. package/build/components/block-switcher/pattern-transformations-menu.cjs +2 -1
  23. package/build/components/block-switcher/pattern-transformations-menu.cjs.map +2 -2
  24. package/build/components/block-toolbar/pattern-overrides-dropdown.cjs.map +3 -3
  25. package/build/components/block-variation-transforms/index.cjs +2 -1
  26. package/build/components/block-variation-transforms/index.cjs.map +2 -2
  27. package/build/components/block-visibility/viewport-visibility-info.cjs +4 -4
  28. package/build/components/block-visibility/viewport-visibility-info.cjs.map +3 -3
  29. package/build/components/collab/{block-comment-icon-slot.cjs → note-icon-slot.cjs} +8 -8
  30. package/build/components/collab/note-icon-slot.cjs.map +7 -0
  31. package/build/components/collab/{block-comment-icon-toolbar-slot.cjs → note-icon-toolbar-slot.cjs} +9 -9
  32. package/build/components/collab/note-icon-toolbar-slot.cjs.map +7 -0
  33. package/build/components/date-format-picker/index.cjs +2 -1
  34. package/build/components/date-format-picker/index.cjs.map +2 -2
  35. package/build/components/global-styles/color-panel.cjs.map +2 -2
  36. package/build/components/global-styles/dimensions-panel.cjs +87 -62
  37. package/build/components/global-styles/dimensions-panel.cjs.map +2 -2
  38. package/build/components/global-styles/filters-panel.cjs.map +2 -2
  39. package/build/components/global-styles/hooks.cjs +9 -7
  40. package/build/components/global-styles/hooks.cjs.map +2 -2
  41. package/build/components/grid/grid-item-movers.cjs +2 -1
  42. package/build/components/grid/grid-item-movers.cjs.map +2 -2
  43. package/build/components/inserter/block-patterns-tab/pattern-category-previews.cjs.map +2 -2
  44. package/build/components/inserter/menu.cjs +2 -1
  45. package/build/components/inserter/menu.cjs.map +2 -2
  46. package/build/components/inserter/search-results.cjs +3 -3
  47. package/build/components/inserter/search-results.cjs.map +2 -2
  48. package/build/components/inspector-popover-header/index.cjs.map +3 -3
  49. package/build/components/link-control/link-preview.cjs +2 -2
  50. package/build/components/link-control/link-preview.cjs.map +2 -2
  51. package/build/components/link-control/settings.cjs +2 -1
  52. package/build/components/link-control/settings.cjs.map +2 -2
  53. package/build/components/link-picker/link-picker.cjs +3 -2
  54. package/build/components/link-picker/link-picker.cjs.map +2 -2
  55. package/build/components/link-picker/link-preview.cjs +2 -2
  56. package/build/components/link-picker/link-preview.cjs.map +2 -2
  57. package/build/components/list-view/block-select-button.cjs +2 -2
  58. package/build/components/list-view/block-select-button.cjs.map +2 -2
  59. package/build/components/list-view/index.cjs +2 -1
  60. package/build/components/list-view/index.cjs.map +2 -2
  61. package/build/components/provider/index.cjs +80 -7
  62. package/build/components/provider/index.cjs.map +2 -2
  63. package/build/components/responsive-block-control/label.cjs +9 -2
  64. package/build/components/responsive-block-control/label.cjs.map +2 -2
  65. package/build/components/rich-text/event-listeners/paste-handler.cjs +12 -5
  66. package/build/components/rich-text/event-listeners/paste-handler.cjs.map +3 -3
  67. package/build/components/url-popover/image-url-input-ui.cjs +1 -1
  68. package/build/components/url-popover/image-url-input-ui.cjs.map +2 -2
  69. package/build/components/writing-flow/use-arrow-nav.cjs +1 -1
  70. package/build/components/writing-flow/use-arrow-nav.cjs.map +2 -2
  71. package/build/hooks/block-bindings.cjs.map +3 -3
  72. package/build/hooks/block-fields/link/index.cjs +1 -1
  73. package/build/hooks/block-fields/link/index.cjs.map +1 -1
  74. package/build/hooks/custom-css.cjs +21 -0
  75. package/build/hooks/custom-css.cjs.map +3 -3
  76. package/build/hooks/dimensions.cjs +5 -1
  77. package/build/hooks/dimensions.cjs.map +2 -2
  78. package/build/hooks/grid-visualizer.cjs +1 -1
  79. package/build/hooks/grid-visualizer.cjs.map +1 -1
  80. package/build/hooks/layout-child.cjs +1 -1
  81. package/build/hooks/layout-child.cjs.map +1 -1
  82. package/build/hooks/utils.cjs +4 -0
  83. package/build/hooks/utils.cjs.map +2 -2
  84. package/build/layouts/flex.cjs +5 -8
  85. package/build/layouts/flex.cjs.map +3 -3
  86. package/build/layouts/grid.cjs +5 -5
  87. package/build/layouts/grid.cjs.map +2 -2
  88. package/build/private-apis.cjs +5 -4
  89. package/build/private-apis.cjs.map +3 -3
  90. package/build/store/private-keys.cjs +3 -0
  91. package/build/store/private-keys.cjs.map +2 -2
  92. package/build/utils/dom.cjs +3 -1
  93. package/build/utils/dom.cjs.map +2 -2
  94. package/build-module/components/autocomplete/index.mjs +2 -2
  95. package/build-module/components/autocomplete/index.mjs.map +2 -2
  96. package/build-module/components/background-image-control/index.mjs +2 -2
  97. package/build-module/components/background-image-control/index.mjs.map +2 -2
  98. package/build-module/components/block-allowed-blocks/modal.mjs +2 -2
  99. package/build-module/components/block-allowed-blocks/modal.mjs.map +2 -2
  100. package/build-module/components/block-bindings/attribute-control.mjs +3 -3
  101. package/build-module/components/block-bindings/attribute-control.mjs.map +2 -2
  102. package/build-module/components/block-card/index.mjs +4 -4
  103. package/build-module/components/block-card/index.mjs.map +2 -2
  104. package/build-module/components/block-mover/button.mjs +11 -5
  105. package/build-module/components/block-mover/button.mjs.map +2 -2
  106. package/build-module/components/block-pattern-setup/index.mjs +2 -1
  107. package/build-module/components/block-pattern-setup/index.mjs.map +2 -2
  108. package/build-module/components/block-patterns-list/index.mjs +1 -1
  109. package/build-module/components/block-patterns-list/index.mjs.map +2 -2
  110. package/build-module/components/block-patterns-paging/index.mjs +3 -3
  111. package/build-module/components/block-patterns-paging/index.mjs.map +2 -2
  112. package/build-module/components/block-settings-menu/block-settings-dropdown.mjs +2 -2
  113. package/build-module/components/block-settings-menu/block-settings-dropdown.mjs.map +2 -2
  114. package/build-module/components/block-settings-menu/index.mjs +2 -2
  115. package/build-module/components/block-settings-menu/index.mjs.map +2 -2
  116. package/build-module/components/block-styles/menu-items.mjs +2 -2
  117. package/build-module/components/block-styles/menu-items.mjs.map +2 -2
  118. package/build-module/components/block-switcher/index.mjs +2 -2
  119. package/build-module/components/block-switcher/index.mjs.map +2 -2
  120. package/build-module/components/block-switcher/pattern-transformations-menu.mjs +2 -7
  121. package/build-module/components/block-switcher/pattern-transformations-menu.mjs.map +2 -2
  122. package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs +2 -2
  123. package/build-module/components/block-toolbar/pattern-overrides-dropdown.mjs.map +2 -2
  124. package/build-module/components/block-variation-transforms/index.mjs +2 -2
  125. package/build-module/components/block-variation-transforms/index.mjs.map +2 -2
  126. package/build-module/components/block-visibility/viewport-visibility-info.mjs +6 -6
  127. package/build-module/components/block-visibility/viewport-visibility-info.mjs.map +2 -2
  128. package/build-module/components/collab/note-icon-slot.mjs +8 -0
  129. package/build-module/components/collab/note-icon-slot.mjs.map +7 -0
  130. package/build-module/components/collab/note-icon-toolbar-slot.mjs +10 -0
  131. package/build-module/components/collab/note-icon-toolbar-slot.mjs.map +7 -0
  132. package/build-module/components/date-format-picker/index.mjs +2 -2
  133. package/build-module/components/date-format-picker/index.mjs.map +2 -2
  134. package/build-module/components/global-styles/color-panel.mjs.map +2 -2
  135. package/build-module/components/global-styles/dimensions-panel.mjs +87 -62
  136. package/build-module/components/global-styles/dimensions-panel.mjs.map +2 -2
  137. package/build-module/components/global-styles/filters-panel.mjs.map +2 -2
  138. package/build-module/components/global-styles/hooks.mjs +9 -7
  139. package/build-module/components/global-styles/hooks.mjs.map +2 -2
  140. package/build-module/components/grid/grid-item-movers.mjs +2 -5
  141. package/build-module/components/grid/grid-item-movers.mjs.map +2 -2
  142. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs +3 -3
  143. package/build-module/components/inserter/block-patterns-tab/pattern-category-previews.mjs.map +1 -1
  144. package/build-module/components/inserter/menu.mjs +3 -2
  145. package/build-module/components/inserter/menu.mjs.map +2 -2
  146. package/build-module/components/inserter/search-results.mjs +1 -1
  147. package/build-module/components/inserter/search-results.mjs.map +1 -1
  148. package/build-module/components/inspector-popover-header/index.mjs +2 -2
  149. package/build-module/components/inspector-popover-header/index.mjs.map +2 -2
  150. package/build-module/components/link-control/link-preview.mjs +2 -2
  151. package/build-module/components/link-control/link-preview.mjs.map +2 -2
  152. package/build-module/components/link-control/settings.mjs +3 -2
  153. package/build-module/components/link-control/settings.mjs.map +2 -2
  154. package/build-module/components/link-picker/link-picker.mjs +1 -1
  155. package/build-module/components/link-picker/link-picker.mjs.map +2 -2
  156. package/build-module/components/link-picker/link-preview.mjs +2 -2
  157. package/build-module/components/link-picker/link-preview.mjs.map +2 -2
  158. package/build-module/components/list-view/block-select-button.mjs +2 -2
  159. package/build-module/components/list-view/block-select-button.mjs.map +2 -2
  160. package/build-module/components/list-view/index.mjs +2 -4
  161. package/build-module/components/list-view/index.mjs.map +2 -2
  162. package/build-module/components/provider/index.mjs +82 -8
  163. package/build-module/components/provider/index.mjs.map +2 -2
  164. package/build-module/components/responsive-block-control/label.mjs +9 -2
  165. package/build-module/components/responsive-block-control/label.mjs.map +2 -2
  166. package/build-module/components/rich-text/event-listeners/paste-handler.mjs +12 -5
  167. package/build-module/components/rich-text/event-listeners/paste-handler.mjs.map +2 -2
  168. package/build-module/components/url-popover/image-url-input-ui.mjs +1 -1
  169. package/build-module/components/url-popover/image-url-input-ui.mjs.map +2 -2
  170. package/build-module/components/writing-flow/use-arrow-nav.mjs +1 -1
  171. package/build-module/components/writing-flow/use-arrow-nav.mjs.map +2 -2
  172. package/build-module/hooks/block-bindings.mjs +2 -2
  173. package/build-module/hooks/block-bindings.mjs.map +2 -2
  174. package/build-module/hooks/block-fields/link/index.mjs +1 -1
  175. package/build-module/hooks/block-fields/link/index.mjs.map +1 -1
  176. package/build-module/hooks/custom-css.mjs +23 -2
  177. package/build-module/hooks/custom-css.mjs.map +2 -2
  178. package/build-module/hooks/dimensions.mjs +5 -1
  179. package/build-module/hooks/dimensions.mjs.map +2 -2
  180. package/build-module/hooks/grid-visualizer.mjs +1 -1
  181. package/build-module/hooks/grid-visualizer.mjs.map +1 -1
  182. package/build-module/hooks/layout-child.mjs +1 -1
  183. package/build-module/hooks/layout-child.mjs.map +1 -1
  184. package/build-module/hooks/utils.mjs +4 -0
  185. package/build-module/hooks/utils.mjs.map +2 -2
  186. package/build-module/layouts/flex.mjs +4 -7
  187. package/build-module/layouts/flex.mjs.map +2 -2
  188. package/build-module/layouts/grid.mjs +4 -4
  189. package/build-module/layouts/grid.mjs.map +2 -2
  190. package/build-module/private-apis.mjs +7 -5
  191. package/build-module/private-apis.mjs.map +2 -2
  192. package/build-module/store/private-keys.mjs +2 -0
  193. package/build-module/store/private-keys.mjs.map +2 -2
  194. package/build-module/utils/dom.mjs +2 -1
  195. package/build-module/utils/dom.mjs.map +2 -2
  196. package/build-style/content-rtl.css +1 -4
  197. package/build-style/content.css +1 -4
  198. package/build-style/style-rtl.css +12 -12
  199. package/build-style/style.css +12 -12
  200. package/build-types/utils/dom.d.ts +7 -0
  201. package/build-types/utils/dom.d.ts.map +1 -1
  202. package/package.json +39 -38
  203. package/src/components/autocomplete/index.js +4 -2
  204. package/src/components/background-image-control/index.js +2 -2
  205. package/src/components/background-image-control/style.scss +1 -1
  206. package/src/components/block-allowed-blocks/modal.js +3 -3
  207. package/src/components/block-bindings/attribute-control.js +4 -4
  208. package/src/components/block-card/index.js +5 -5
  209. package/src/components/block-list/content.scss +0 -4
  210. package/src/components/block-mover/button.js +17 -7
  211. package/src/components/block-pattern-setup/index.js +2 -1
  212. package/src/components/block-pattern-setup/style.scss +2 -2
  213. package/src/components/block-patterns-list/index.js +1 -1
  214. package/src/components/block-patterns-list/style.scss +1 -1
  215. package/src/components/block-patterns-paging/index.js +5 -6
  216. package/src/components/block-settings-menu/block-settings-dropdown.js +2 -2
  217. package/src/components/block-settings-menu/index.js +2 -2
  218. package/src/components/block-styles/menu-items.js +3 -3
  219. package/src/components/block-switcher/index.js +3 -3
  220. package/src/components/block-switcher/pattern-transformations-menu.js +2 -7
  221. package/src/components/block-switcher/style.scss +2 -2
  222. package/src/components/block-toolbar/pattern-overrides-dropdown.js +2 -2
  223. package/src/components/block-variation-transforms/index.js +2 -2
  224. package/src/components/block-visibility/viewport-visibility-info.js +7 -7
  225. package/src/components/collab/note-icon-slot.js +8 -0
  226. package/src/components/collab/note-icon-toolbar-slot.js +10 -0
  227. package/src/components/date-format-picker/index.js +4 -2
  228. package/src/components/global-styles/color-panel.js +0 -2
  229. package/src/components/global-styles/dimensions-panel.js +100 -73
  230. package/src/components/global-styles/filters-panel.js +0 -2
  231. package/src/components/global-styles/hooks.js +9 -7
  232. package/src/components/global-styles/style.scss +1 -1
  233. package/src/components/grid/grid-item-movers.js +2 -5
  234. package/src/components/inserter/block-patterns-tab/pattern-category-previews.js +5 -5
  235. package/src/components/inserter/menu.js +3 -2
  236. package/src/components/inserter/search-results.js +1 -1
  237. package/src/components/inserter/style.scss +2 -2
  238. package/src/components/inserter-list-item/style.scss +1 -1
  239. package/src/components/inspector-popover-header/index.js +2 -2
  240. package/src/components/link-control/link-preview.js +3 -3
  241. package/src/components/link-control/settings.js +3 -2
  242. package/src/components/link-picker/link-picker.js +1 -1
  243. package/src/components/link-picker/link-preview.js +3 -3
  244. package/src/components/list-view/block-select-button.js +3 -3
  245. package/src/components/list-view/index.js +2 -4
  246. package/src/components/list-view/style.scss +1 -1
  247. package/src/components/media-placeholder/content.scss +1 -1
  248. package/src/components/provider/index.js +149 -8
  249. package/src/components/responsive-block-control/label.js +5 -2
  250. package/src/components/rich-text/event-listeners/paste-handler.js +18 -4
  251. package/src/components/url-input/style.scss +1 -1
  252. package/src/components/url-popover/image-url-input-ui.js +1 -1
  253. package/src/components/writing-flow/use-arrow-nav.js +9 -2
  254. package/src/hooks/block-bindings.js +3 -3
  255. package/src/hooks/block-fields/link/index.js +1 -1
  256. package/src/hooks/custom-css.js +30 -9
  257. package/src/hooks/dimensions.js +6 -1
  258. package/src/hooks/grid-visualizer.js +1 -1
  259. package/src/hooks/layout-child.js +1 -1
  260. package/src/hooks/test/dimensions.js +16 -0
  261. package/src/hooks/test/style.js +2 -0
  262. package/src/hooks/utils.js +4 -0
  263. package/src/layouts/flex.js +7 -9
  264. package/src/layouts/grid.js +7 -4
  265. package/src/private-apis.js +6 -4
  266. package/src/store/private-keys.js +1 -0
  267. package/src/utils/dom.js +3 -3
  268. package/src/utils/test/dom.js +47 -4
  269. package/build/components/collab/block-comment-icon-slot.cjs.map +0 -7
  270. package/build/components/collab/block-comment-icon-toolbar-slot.cjs.map +0 -7
  271. package/build-module/components/collab/block-comment-icon-slot.mjs +0 -8
  272. package/build-module/components/collab/block-comment-icon-slot.mjs.map +0 -7
  273. package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs +0 -10
  274. package/build-module/components/collab/block-comment-icon-toolbar-slot.mjs.map +0 -7
  275. package/src/components/collab/block-comment-icon-slot.js +0 -8
  276. package/src/components/collab/block-comment-icon-toolbar-slot.js +0 -10
@@ -4,7 +4,7 @@
4
4
  import {
5
5
  __experimentalVStack as VStack,
6
6
  __experimentalHStack as HStack,
7
- __experimentalText as Text,
7
+ __experimentalText as WCText,
8
8
  Button,
9
9
  } from '@wordpress/components';
10
10
  import { __, _x, _n, sprintf } from '@wordpress/i18n';
@@ -17,14 +17,13 @@ export default function Pagination( {
17
17
  } ) {
18
18
  return (
19
19
  <VStack className="block-editor-patterns__grid-pagination-wrapper">
20
- <Text variant="muted">
20
+ <WCText variant="muted">
21
21
  { sprintf(
22
22
  // translators: %s: Total number of patterns.
23
23
  _n( '%s item', '%s items', totalItems ),
24
24
  totalItems
25
25
  ) }
26
- </Text>
27
-
26
+ </WCText>
28
27
  { numPages > 1 && (
29
28
  <HStack
30
29
  expanded={ false }
@@ -60,14 +59,14 @@ export default function Pagination( {
60
59
  <span>‹</span>
61
60
  </Button>
62
61
  </HStack>
63
- <Text variant="muted">
62
+ <WCText variant="muted">
64
63
  { sprintf(
65
64
  // translators: 1: Current page number. 2: Total number of pages.
66
65
  _x( '%1$s of %2$s', 'paging' ),
67
66
  currentPage,
68
67
  numPages
69
68
  ) }
70
- </Text>
69
+ </WCText>
71
70
  <HStack
72
71
  expanded={ false }
73
72
  spacing={ 1 }
@@ -18,7 +18,7 @@ import { pipe, useCopyToClipboard } from '@wordpress/compose';
18
18
  * Internal dependencies
19
19
  */
20
20
  import BlockActions from '../block-actions';
21
- import CommentIconSlotFill from '../../components/collab/block-comment-icon-slot';
21
+ import NoteIconSlotFill from '../../components/collab/note-icon-slot';
22
22
  import BlockHTMLConvertButton from './block-html-convert-button';
23
23
  import __unstableBlockSettingsMenuFirstItem from './block-settings-menu-first-item';
24
24
  import BlockSettingsMenuControls from '../block-settings-menu-controls';
@@ -349,7 +349,7 @@ export function BlockSettingsDropdown( {
349
349
  </>
350
350
  ) }
351
351
  { canEdit && count === 1 && (
352
- <CommentIconSlotFill.Slot
352
+ <NoteIconSlotFill.Slot
353
353
  fillProps={ {
354
354
  clientId: firstBlockClientId,
355
355
  onClose,
@@ -7,12 +7,12 @@ import { ToolbarGroup, ToolbarItem } from '@wordpress/components';
7
7
  * Internal dependencies
8
8
  */
9
9
  import BlockSettingsDropdown from './block-settings-dropdown';
10
- import CommentIconToolbarSlotFill from '../../components/collab/block-comment-icon-toolbar-slot';
10
+ import NoteIconToolbarSlotFill from '../../components/collab/note-icon-toolbar-slot';
11
11
 
12
12
  export function BlockSettingsMenu( { clientIds, ...props } ) {
13
13
  return (
14
14
  <ToolbarGroup>
15
- <CommentIconToolbarSlotFill.Slot />
15
+ <NoteIconToolbarSlotFill.Slot />
16
16
 
17
17
  <ToolbarItem>
18
18
  { ( toggleProps ) => (
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { MenuItem, __experimentalText as Text } from '@wordpress/components';
4
+ import { MenuItem, __experimentalText as WCText } from '@wordpress/components';
5
5
  import { check } from '@wordpress/icons';
6
6
 
7
7
  const noop = () => {};
@@ -29,14 +29,14 @@ export default function BlockStylesMenuItems( {
29
29
  onMouseEnter={ () => onHoverStyle( style ) }
30
30
  onMouseLeave={ () => onHoverStyle( null ) }
31
31
  >
32
- <Text
32
+ <WCText
33
33
  as="span"
34
34
  limit={ 18 }
35
35
  ellipsizeMode="tail"
36
36
  truncate
37
37
  >
38
38
  { menuItemText }
39
- </Text>
39
+ </WCText>
40
40
  </MenuItem>
41
41
  );
42
42
  } ) }
@@ -6,7 +6,7 @@ import {
6
6
  DropdownMenu,
7
7
  ToolbarGroup,
8
8
  ToolbarItem,
9
- __experimentalText as Text,
9
+ __experimentalText as WCText,
10
10
  MenuGroup,
11
11
  } from '@wordpress/components';
12
12
  import {
@@ -184,9 +184,9 @@ function BlockSwitcherDropdownMenuContents( { onClose, clientIds } ) {
184
184
  ) }
185
185
  { isUsingBindings && (
186
186
  <MenuGroup>
187
- <Text className="block-editor-block-switcher__binding-indicator">
187
+ <WCText className="block-editor-block-switcher__binding-indicator">
188
188
  { connectedBlockDescription }
189
- </Text>
189
+ </WCText>
190
190
  </MenuGroup>
191
191
  ) }
192
192
  </div>
@@ -6,13 +6,8 @@ import { useState } from '@wordpress/element';
6
6
  import { useInstanceId, useViewportMatch } from '@wordpress/compose';
7
7
  import { chevronRight } from '@wordpress/icons';
8
8
 
9
- import {
10
- Composite,
11
- MenuGroup,
12
- MenuItem,
13
- Popover,
14
- VisuallyHidden,
15
- } from '@wordpress/components';
9
+ import { Composite, MenuGroup, MenuItem, Popover } from '@wordpress/components';
10
+ import { VisuallyHidden } from '@wordpress/ui';
16
11
 
17
12
  /**
18
13
  * Internal dependencies
@@ -48,7 +48,7 @@
48
48
  margin-top: $grid-unit-20;
49
49
 
50
50
  .block-editor-block-preview__container {
51
- cursor: pointer;
51
+ cursor: var(--wpds-cursor-control);
52
52
  }
53
53
 
54
54
  .block-editor-block-switcher__preview-patterns-container-list__item {
@@ -76,7 +76,7 @@
76
76
  padding: $grid-unit-05;
77
77
  font-size: 12px;
78
78
  text-align: center;
79
- cursor: pointer;
79
+ cursor: var(--wpds-cursor-control);
80
80
  }
81
81
  }
82
82
  }
@@ -4,7 +4,7 @@
4
4
  import {
5
5
  Popover,
6
6
  ToolbarButton,
7
- __experimentalText as Text,
7
+ __experimentalText as WCText,
8
8
  } from '@wordpress/components';
9
9
  import { __, sprintf } from '@wordpress/i18n';
10
10
  import { useState, useRef } from '@wordpress/element';
@@ -48,7 +48,7 @@ function PatternOverridesPopoverContent( { clientIds, blockTitle } ) {
48
48
  description = __( 'These blocks are editable using overrides.' );
49
49
  }
50
50
 
51
- return <Text>{ description }</Text>;
51
+ return <WCText>{ description }</WCText>;
52
52
  }
53
53
 
54
54
  /**
@@ -7,9 +7,9 @@ import {
7
7
  Button,
8
8
  __experimentalToggleGroupControl as ToggleGroupControl,
9
9
  __experimentalToggleGroupControlOptionIcon as ToggleGroupControlOptionIcon,
10
- VisuallyHidden,
11
10
  privateApis as componentsPrivateApis,
12
11
  } from '@wordpress/components';
12
+ import { VisuallyHidden } from '@wordpress/ui';
13
13
  import { useSelect, useDispatch } from '@wordpress/data';
14
14
  import { useMemo } from '@wordpress/element';
15
15
 
@@ -30,7 +30,7 @@ function VariationsButtons( {
30
30
  } ) {
31
31
  return (
32
32
  <fieldset className={ className }>
33
- <VisuallyHidden as="legend">
33
+ <VisuallyHidden render={ <legend /> }>
34
34
  { __( 'Transform to variation' ) }
35
35
  </VisuallyHidden>
36
36
  { variations.map( ( variation ) => (
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import {
5
5
  Icon,
6
- __experimentalText as Text,
6
+ __experimentalText as WCText,
7
7
  __experimentalHStack as HStack,
8
8
  privateApis as componentsPrivateApis,
9
9
  } from '@wordpress/components';
@@ -21,11 +21,11 @@ import { useBlockElement } from '../block-list/use-block-props/use-block-refs';
21
21
  import { deviceTypeKey } from '../../store/private-keys';
22
22
  import { BLOCK_VISIBILITY_VIEWPORTS } from './constants';
23
23
 
24
- const { Badge } = unlock( componentsPrivateApis );
24
+ const { Badge: WCBadge } = unlock( componentsPrivateApis );
25
25
  const DEFAULT_VISIBILITY_STATE = {
26
26
  currentBlockVisibility: undefined,
27
27
  hasParentHiddenEverywhere: false,
28
- selectedDeviceType: BLOCK_VISIBILITY_VIEWPORTS.desktop.value,
28
+ selectedDeviceType: BLOCK_VISIBILITY_VIEWPORTS.desktop.key,
29
29
  };
30
30
 
31
31
  export default function ViewportVisibilityInfo( { clientId } ) {
@@ -49,7 +49,7 @@ export default function ViewportVisibilityInfo( { clientId } ) {
49
49
  getBlockAttributes( clientId )?.metadata?.blockVisibility,
50
50
  selectedDeviceType:
51
51
  getSettings()?.[ deviceTypeKey ]?.toLowerCase() ||
52
- BLOCK_VISIBILITY_VIEWPORTS.desktop.value,
52
+ BLOCK_VISIBILITY_VIEWPORTS.desktop.key,
53
53
  hasParentHiddenEverywhere:
54
54
  isBlockParentHiddenEverywhere( clientId ),
55
55
  };
@@ -128,11 +128,11 @@ export default function ViewportVisibilityInfo( { clientId } ) {
128
128
  }
129
129
 
130
130
  return (
131
- <Badge className="block-editor-block-visibility-info">
131
+ <WCBadge className="block-editor-block-visibility-info">
132
132
  <HStack spacing={ 2 } justify="start">
133
133
  <Icon icon={ unseen } />
134
- <Text>{ label }</Text>
134
+ <WCText>{ label }</WCText>
135
135
  </HStack>
136
- </Badge>
136
+ </WCBadge>
137
137
  );
138
138
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { createSlotFill } from '@wordpress/components';
5
+
6
+ const NoteIconSlotFill = createSlotFill( Symbol( 'NoteIconSlotFill' ) );
7
+
8
+ export default NoteIconSlotFill;
@@ -0,0 +1,10 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { createSlotFill } from '@wordpress/components';
5
+
6
+ const NoteIconToolbarSlotFill = createSlotFill(
7
+ Symbol( 'NoteIconToolbarSlotFill' )
8
+ );
9
+
10
+ export default NoteIconToolbarSlotFill;
@@ -7,11 +7,11 @@ import { useState, createInterpolateElement } from '@wordpress/element';
7
7
  import {
8
8
  TextControl,
9
9
  ExternalLink,
10
- VisuallyHidden,
11
10
  ToggleControl,
12
11
  __experimentalVStack as VStack,
13
12
  CustomSelectControl,
14
13
  } from '@wordpress/components';
14
+ import { VisuallyHidden } from '@wordpress/ui';
15
15
 
16
16
  // So that we illustrate the different formats in the dropdown properly, show a date that is
17
17
  // somewhat recent, has a day greater than 12, and a month with more than three letters.
@@ -45,7 +45,9 @@ export default function DateFormatPicker( {
45
45
  spacing={ 4 }
46
46
  className="block-editor-date-format-picker"
47
47
  >
48
- <VisuallyHidden as="legend">{ __( 'Date format' ) }</VisuallyHidden>
48
+ <VisuallyHidden render={ <legend /> }>
49
+ { __( 'Date format' ) }
50
+ </VisuallyHidden>
49
51
  <ToggleControl
50
52
  label={ __( 'Default format' ) }
51
53
  help={ `${ __( 'Example:' ) } ${ dateI18n(
@@ -10,8 +10,6 @@ import {
10
10
  __experimentalToolsPanel as ToolsPanel,
11
11
  __experimentalToolsPanelItem as ToolsPanelItem,
12
12
  __experimentalHStack as HStack,
13
- // TODO: Replace this ZStack with ad hoc CSS.
14
- // eslint-disable-next-line @wordpress/use-recommended-components
15
13
  __experimentalZStack as ZStack,
16
14
  __experimentalDropdownContentWrapper as DropdownContentWrapper,
17
15
  ColorIndicator,
@@ -33,69 +33,63 @@ import { setImmutably } from '../../utils/object';
33
33
  const AXIAL_SIDES = [ 'horizontal', 'vertical' ];
34
34
 
35
35
  export function useHasDimensionsPanel( settings ) {
36
- const hasContentSize = useHasContentSize( settings );
37
- const hasWideSize = useHasWideSize( settings );
38
- const hasPadding = useHasPadding( settings );
39
- const hasMargin = useHasMargin( settings );
40
- const hasGap = useHasGap( settings );
41
- const hasHeight = useHasHeight( settings );
42
- const hasMinHeight = useHasMinHeight( settings );
43
- const hasWidth = useHasWidth( settings );
44
- const hasAspectRatio = useHasAspectRatio( settings );
45
- const hasChildLayout = useHasChildLayout( settings );
46
-
47
36
  return (
48
37
  Platform.OS === 'web' &&
49
- ( hasContentSize ||
50
- hasWideSize ||
51
- hasPadding ||
52
- hasMargin ||
53
- hasGap ||
54
- hasHeight ||
55
- hasMinHeight ||
56
- hasWidth ||
57
- hasAspectRatio ||
58
- hasChildLayout )
38
+ ( hasContentSize( settings ) ||
39
+ hasWideSize( settings ) ||
40
+ hasPadding( settings ) ||
41
+ hasMargin( settings ) ||
42
+ hasGap( settings ) ||
43
+ hasHeight( settings ) ||
44
+ hasMinHeight( settings ) ||
45
+ hasMinWidth( settings ) ||
46
+ hasWidth( settings ) ||
47
+ hasAspectRatio( settings ) ||
48
+ hasChildLayout( settings ) )
59
49
  );
60
50
  }
61
51
 
62
- function useHasContentSize( settings ) {
52
+ function hasContentSize( settings ) {
63
53
  return settings?.layout?.contentSize;
64
54
  }
65
55
 
66
- function useHasWideSize( settings ) {
56
+ function hasWideSize( settings ) {
67
57
  return settings?.layout?.wideSize;
68
58
  }
69
59
 
70
- function useHasPadding( settings ) {
60
+ function hasPadding( settings ) {
71
61
  return settings?.spacing?.padding;
72
62
  }
73
63
 
74
- function useHasMargin( settings ) {
64
+ function hasMargin( settings ) {
75
65
  return settings?.spacing?.margin;
76
66
  }
77
67
 
78
- function useHasGap( settings ) {
68
+ function hasGap( settings ) {
79
69
  return settings?.spacing?.blockGap;
80
70
  }
81
71
 
82
- function useHasHeight( settings ) {
72
+ function hasHeight( settings ) {
83
73
  return settings?.dimensions?.height;
84
74
  }
85
75
 
86
- function useHasMinHeight( settings ) {
76
+ function hasMinHeight( settings ) {
87
77
  return settings?.dimensions?.minHeight;
88
78
  }
89
79
 
90
- function useHasWidth( settings ) {
80
+ function hasMinWidth( settings ) {
81
+ return settings?.dimensions?.minWidth;
82
+ }
83
+
84
+ function hasWidth( settings ) {
91
85
  return settings?.dimensions?.width;
92
86
  }
93
87
 
94
- function useHasAspectRatio( settings ) {
88
+ function hasAspectRatio( settings ) {
95
89
  return settings?.dimensions?.aspectRatio;
96
90
  }
97
91
 
98
- function useHasChildLayout( settings ) {
92
+ function hasChildLayout( settings ) {
99
93
  const {
100
94
  type: parentLayoutType = 'default',
101
95
  default: { type: defaultParentLayoutType = 'default' } = {},
@@ -111,7 +105,7 @@ function useHasChildLayout( settings ) {
111
105
  return !! settings?.layout && support;
112
106
  }
113
107
 
114
- function useHasSpacingPresets( settings ) {
108
+ function hasSpacingPresets( settings ) {
115
109
  const { defaultSpacingSizes, spacingSizes } = settings?.spacing || {};
116
110
  return (
117
111
  ( defaultSpacingSizes !== false &&
@@ -219,6 +213,7 @@ const DEFAULT_CONTROLS = {
219
213
  blockGap: true,
220
214
  height: true,
221
215
  minHeight: true,
216
+ minWidth: true,
222
217
  width: true,
223
218
  aspectRatio: true,
224
219
  childLayout: true,
@@ -257,7 +252,7 @@ export default function DimensionsPanel( {
257
252
  );
258
253
  };
259
254
 
260
- const showSpacingPresetsControl = useHasSpacingPresets( settings );
255
+ const showSpacingPresetsControl = hasSpacingPresets( settings );
261
256
  const units = useCustomUnits( {
262
257
  availableUnits: settings?.spacing?.units || [
263
258
  '%',
@@ -272,9 +267,40 @@ export default function DimensionsPanel( {
272
267
  const minimumMargin = -Infinity;
273
268
  const [ minMarginValue, setMinMarginValue ] = useState( minimumMargin );
274
269
 
270
+ const resetAllFilter = useCallback( ( previousValue ) => {
271
+ return {
272
+ ...previousValue,
273
+ layout: cleanEmptyObject( {
274
+ ...previousValue?.layout,
275
+ contentSize: undefined,
276
+ wideSize: undefined,
277
+ selfStretch: undefined,
278
+ flexSize: undefined,
279
+ columnStart: undefined,
280
+ rowStart: undefined,
281
+ columnSpan: undefined,
282
+ rowSpan: undefined,
283
+ } ),
284
+ spacing: {
285
+ ...previousValue?.spacing,
286
+ padding: undefined,
287
+ margin: undefined,
288
+ blockGap: undefined,
289
+ },
290
+ dimensions: {
291
+ ...previousValue?.dimensions,
292
+ height: undefined,
293
+ minHeight: undefined,
294
+ minWidth: undefined,
295
+ aspectRatio: undefined,
296
+ width: undefined,
297
+ },
298
+ };
299
+ }, [] );
300
+
275
301
  // Content Width
276
302
  const showContentSizeControl =
277
- useHasContentSize( settings ) && includeLayoutControls;
303
+ hasContentSize( settings ) && includeLayoutControls;
278
304
  const contentSizeValue = decodeValue( inheritedValue?.layout?.contentSize );
279
305
  const setContentSizeValue = ( newValue ) => {
280
306
  onChange(
@@ -290,7 +316,7 @@ export default function DimensionsPanel( {
290
316
 
291
317
  // Wide Width
292
318
  const showWideSizeControl =
293
- useHasWideSize( settings ) && includeLayoutControls;
319
+ hasWideSize( settings ) && includeLayoutControls;
294
320
  const wideSizeValue = decodeValue( inheritedValue?.layout?.wideSize );
295
321
  const setWideSizeValue = ( newValue ) => {
296
322
  onChange(
@@ -305,7 +331,7 @@ export default function DimensionsPanel( {
305
331
  const resetWideSizeValue = () => setWideSizeValue( undefined );
306
332
 
307
333
  // Padding
308
- const showPaddingControl = useHasPadding( settings );
334
+ const showPaddingControl = hasPadding( settings );
309
335
  const rawPadding = decodeValue( inheritedValue?.spacing?.padding );
310
336
  const paddingValues = splitStyleValue( rawPadding );
311
337
  const paddingSides = Array.isArray( settings?.spacing?.padding )
@@ -325,7 +351,7 @@ export default function DimensionsPanel( {
325
351
  const onMouseOverPadding = () => onVisualize( 'padding' );
326
352
 
327
353
  // Margin
328
- const showMarginControl = useHasMargin( settings );
354
+ const showMarginControl = hasMargin( settings );
329
355
  const rawMargin = decodeValue( inheritedValue?.spacing?.margin );
330
356
  const marginValues = splitStyleValue( rawMargin );
331
357
  const marginSides = Array.isArray( settings?.spacing?.margin )
@@ -345,7 +371,7 @@ export default function DimensionsPanel( {
345
371
  const onMouseOverMargin = () => onVisualize( 'margin' );
346
372
 
347
373
  // Block Gap
348
- const showGapControl = useHasGap( settings );
374
+ const showGapControl = hasGap( settings );
349
375
  const gapSides = Array.isArray( settings?.spacing?.blockGap )
350
376
  ? settings?.spacing?.blockGap
351
377
  : settings?.spacing?.blockGap?.sides;
@@ -376,7 +402,7 @@ export default function DimensionsPanel( {
376
402
  const hasGapValue = () => !! value?.spacing?.blockGap;
377
403
 
378
404
  // Min Height
379
- const showMinHeightControl = useHasMinHeight( settings );
405
+ const showMinHeightControl = hasMinHeight( settings );
380
406
  const minHeightValue = decodeValue( inheritedValue?.dimensions?.minHeight );
381
407
  const setMinHeightValue = ( newValue ) => {
382
408
  const tempValue = setImmutably(
@@ -399,7 +425,7 @@ export default function DimensionsPanel( {
399
425
  const hasMinHeightValue = () => !! value?.dimensions?.minHeight;
400
426
 
401
427
  // Height
402
- const showHeightControl = useHasHeight( settings );
428
+ const showHeightControl = hasHeight( settings );
403
429
  const heightValue = decodeValue( inheritedValue?.dimensions?.height );
404
430
  const setHeightValue = ( newValue ) => {
405
431
  const tempValue = setImmutably(
@@ -421,8 +447,21 @@ export default function DimensionsPanel( {
421
447
  };
422
448
  const hasHeightValue = () => !! value?.dimensions?.height;
423
449
 
450
+ // Min Width
451
+ const showMinWidthControl = hasMinWidth( settings );
452
+ const minWidthValue = decodeValue( inheritedValue?.dimensions?.minWidth );
453
+ const setMinWidthValue = ( newValue ) => {
454
+ onChange(
455
+ setImmutably( value, [ 'dimensions', 'minWidth' ], newValue )
456
+ );
457
+ };
458
+ const resetMinWidthValue = () => {
459
+ setMinWidthValue( undefined );
460
+ };
461
+ const hasMinWidthValue = () => !! value?.dimensions?.minWidth;
462
+
424
463
  // Width
425
- const showWidthControl = useHasWidth( settings );
464
+ const showWidthControl = hasWidth( settings );
426
465
  const widthValue = decodeValue( inheritedValue?.dimensions?.width );
427
466
  const setWidthValue = ( newValue ) => {
428
467
  onChange( setImmutably( value, [ 'dimensions', 'width' ], newValue ) );
@@ -433,7 +472,7 @@ export default function DimensionsPanel( {
433
472
  const hasWidthValue = () => !! value?.dimensions?.width;
434
473
 
435
474
  // Aspect Ratio
436
- const showAspectRatioControl = useHasAspectRatio( settings );
475
+ const showAspectRatioControl = hasAspectRatio( settings );
437
476
  const aspectRatioValue = decodeValue(
438
477
  inheritedValue?.dimensions?.aspectRatio
439
478
  );
@@ -451,7 +490,7 @@ export default function DimensionsPanel( {
451
490
  const hasAspectRatioValue = () => !! value?.dimensions?.aspectRatio;
452
491
 
453
492
  // Child Layout
454
- const showChildLayoutControl = useHasChildLayout( settings );
493
+ const showChildLayoutControl = hasChildLayout( settings );
455
494
  const childLayout = inheritedValue?.layout;
456
495
 
457
496
  const setChildLayout = ( newChildLayout ) => {
@@ -463,36 +502,6 @@ export default function DimensionsPanel( {
463
502
  } );
464
503
  };
465
504
 
466
- const resetAllFilter = useCallback( ( previousValue ) => {
467
- return {
468
- ...previousValue,
469
- layout: cleanEmptyObject( {
470
- ...previousValue?.layout,
471
- contentSize: undefined,
472
- wideSize: undefined,
473
- selfStretch: undefined,
474
- flexSize: undefined,
475
- columnStart: undefined,
476
- rowStart: undefined,
477
- columnSpan: undefined,
478
- rowSpan: undefined,
479
- } ),
480
- spacing: {
481
- ...previousValue?.spacing,
482
- padding: undefined,
483
- margin: undefined,
484
- blockGap: undefined,
485
- },
486
- dimensions: {
487
- ...previousValue?.dimensions,
488
- height: undefined,
489
- minHeight: undefined,
490
- aspectRatio: undefined,
491
- width: undefined,
492
- },
493
- };
494
- }, [] );
495
-
496
505
  const onMouseLeaveControls = () => onVisualize( false );
497
506
 
498
507
  return (
@@ -739,6 +748,24 @@ export default function DimensionsPanel( {
739
748
  />
740
749
  </ToolsPanelItem>
741
750
  ) }
751
+ { showMinWidthControl && (
752
+ <ToolsPanelItem
753
+ hasValue={ hasMinWidthValue }
754
+ label={ __( 'Minimum width' ) }
755
+ onDeselect={ resetMinWidthValue }
756
+ isShownByDefault={
757
+ defaultControls.minWidth ?? DEFAULT_CONTROLS.minWidth
758
+ }
759
+ panelId={ panelId }
760
+ >
761
+ <DimensionControl
762
+ label={ __( 'Minimum width' ) }
763
+ value={ minWidthValue }
764
+ onChange={ setMinWidthValue }
765
+ dimensionSizes={ dimensions?.dimensionSizes }
766
+ />
767
+ </ToolsPanelItem>
768
+ ) }
742
769
  { showHeightControl && (
743
770
  <ToolsPanelItem
744
771
  hasValue={ hasHeightValue }
@@ -10,8 +10,6 @@ import {
10
10
  __experimentalToolsPanel as ToolsPanel,
11
11
  __experimentalToolsPanelItem as ToolsPanelItem,
12
12
  __experimentalHStack as HStack,
13
- // TODO: Replace this ZStack with ad hoc CSS.
14
- // eslint-disable-next-line @wordpress/use-recommended-components
15
13
  __experimentalZStack as ZStack,
16
14
  __experimentalDropdownContentWrapper as DropdownContentWrapper,
17
15
  MenuGroup,
@@ -166,14 +166,16 @@ export function useSettingsForBlockElement(
166
166
  }
167
167
  } );
168
168
 
169
- [ 'aspectRatio', 'height', 'minHeight', 'width' ].forEach( ( key ) => {
170
- if ( ! supportedStyles.includes( key ) ) {
171
- updatedSettings.dimensions = {
172
- ...updatedSettings.dimensions,
173
- [ key ]: false,
174
- };
169
+ [ 'aspectRatio', 'height', 'minHeight', 'minWidth', 'width' ].forEach(
170
+ ( key ) => {
171
+ if ( ! supportedStyles.includes( key ) ) {
172
+ updatedSettings.dimensions = {
173
+ ...updatedSettings.dimensions,
174
+ [ key ]: false,
175
+ };
176
+ }
175
177
  }
176
- } );
178
+ );
177
179
 
178
180
  [ 'radius', 'color', 'style', 'width' ].forEach( ( key ) => {
179
181
  if (
@@ -71,7 +71,7 @@
71
71
  color: $gray-800;
72
72
  border: $gray-200 $border-width solid;
73
73
  border-radius: $radius-small;
74
- cursor: pointer;
74
+ cursor: var(--wpds-cursor-control);
75
75
  display: inline-flex;
76
76
  align-items: center;
77
77
 
@@ -7,11 +7,8 @@ import clsx from 'clsx';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { __, isRTL } from '@wordpress/i18n';
10
- import {
11
- VisuallyHidden,
12
- ToolbarButton,
13
- ToolbarGroup,
14
- } from '@wordpress/components';
10
+ import { ToolbarButton, ToolbarGroup } from '@wordpress/components';
11
+ import { VisuallyHidden } from '@wordpress/ui';
15
12
  import {
16
13
  chevronLeft,
17
14
  chevronUp,