@wordpress/edit-site 6.6.1 → 6.7.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 (175) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-template/add-custom-template-modal-content.js +6 -7
  3. package/build/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  4. package/build/components/add-new-template/index.js +7 -10
  5. package/build/components/add-new-template/index.js.map +1 -1
  6. package/build/components/block-editor/use-site-editor-settings.js +0 -24
  7. package/build/components/block-editor/use-site-editor-settings.js.map +1 -1
  8. package/build/components/editor/index.js +6 -3
  9. package/build/components/editor/index.js.map +1 -1
  10. package/build/components/editor-canvas-container/index.js +4 -1
  11. package/build/components/editor-canvas-container/index.js.map +1 -1
  12. package/build/components/error-boundary/warning.js +4 -1
  13. package/build/components/error-boundary/warning.js.map +1 -1
  14. package/build/components/global-styles/font-library-modal/font-card.js +5 -2
  15. package/build/components/global-styles/font-library-modal/font-card.js.map +1 -1
  16. package/build/components/global-styles/font-library-modal/font-collection.js +27 -19
  17. package/build/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  18. package/build/components/global-styles/font-library-modal/installed-fonts.js +21 -8
  19. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  20. package/build/components/global-styles/font-library-modal/upload-fonts.js +4 -1
  21. package/build/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  22. package/build/components/global-styles/font-sizes/font-size.js +10 -11
  23. package/build/components/global-styles/font-sizes/font-size.js.map +1 -1
  24. package/build/components/global-styles/font-sizes/font-sizes.js +4 -6
  25. package/build/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  26. package/build/components/global-styles/header.js +1 -8
  27. package/build/components/global-styles/header.js.map +1 -1
  28. package/build/components/global-styles/navigation-button.js +1 -1
  29. package/build/components/global-styles/navigation-button.js.map +1 -1
  30. package/build/components/global-styles/palette.js +4 -1
  31. package/build/components/global-styles/palette.js.map +1 -1
  32. package/build/components/global-styles/preset-colors.js +1 -1
  33. package/build/components/global-styles/preset-colors.js.map +1 -1
  34. package/build/components/global-styles/screen-revisions/revisions-buttons.js +4 -1
  35. package/build/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  36. package/build/components/global-styles/shadows-edit-panel.js +20 -10
  37. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  38. package/build/components/global-styles/typeset-button.js +5 -4
  39. package/build/components/global-styles/typeset-button.js.map +1 -1
  40. package/build/components/layout/index.js +1 -2
  41. package/build/components/layout/index.js.map +1 -1
  42. package/build/components/page-patterns/fields.js +5 -2
  43. package/build/components/page-patterns/fields.js.map +1 -1
  44. package/build/components/pagination/index.js +4 -4
  45. package/build/components/pagination/index.js.map +1 -1
  46. package/build/components/save-panel/index.js +4 -1
  47. package/build/components/save-panel/index.js.map +1 -1
  48. package/build/components/sidebar-button/index.js +4 -1
  49. package/build/components/sidebar-button/index.js.map +1 -1
  50. package/build/components/sidebar-dataviews/add-new-view.js +8 -2
  51. package/build/components/sidebar-dataviews/add-new-view.js.map +1 -1
  52. package/build/components/site-hub/index.js +30 -14
  53. package/build/components/site-hub/index.js.map +1 -1
  54. package/build/components/style-book/index.js +1 -5
  55. package/build/components/style-book/index.js.map +1 -1
  56. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -4
  57. package/build/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  58. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +12 -12
  59. package/build/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  60. package/build/components/welcome-guide/template.js +20 -9
  61. package/build/components/welcome-guide/template.js.map +1 -1
  62. package/build/hooks/commands/use-common-commands.js +2 -4
  63. package/build/hooks/commands/use-common-commands.js.map +1 -1
  64. package/build-module/components/add-new-template/add-custom-template-modal-content.js +6 -7
  65. package/build-module/components/add-new-template/add-custom-template-modal-content.js.map +1 -1
  66. package/build-module/components/add-new-template/index.js +7 -10
  67. package/build-module/components/add-new-template/index.js.map +1 -1
  68. package/build-module/components/block-editor/use-site-editor-settings.js +0 -23
  69. package/build-module/components/block-editor/use-site-editor-settings.js.map +1 -1
  70. package/build-module/components/editor/index.js +6 -3
  71. package/build-module/components/editor/index.js.map +1 -1
  72. package/build-module/components/editor-canvas-container/index.js +4 -1
  73. package/build-module/components/editor-canvas-container/index.js.map +1 -1
  74. package/build-module/components/error-boundary/warning.js +4 -1
  75. package/build-module/components/error-boundary/warning.js.map +1 -1
  76. package/build-module/components/global-styles/font-library-modal/font-card.js +7 -4
  77. package/build-module/components/global-styles/font-library-modal/font-card.js.map +1 -1
  78. package/build-module/components/global-styles/font-library-modal/font-collection.js +29 -21
  79. package/build-module/components/global-styles/font-library-modal/font-collection.js.map +1 -1
  80. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +24 -11
  81. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  82. package/build-module/components/global-styles/font-library-modal/upload-fonts.js +4 -1
  83. package/build-module/components/global-styles/font-library-modal/upload-fonts.js.map +1 -1
  84. package/build-module/components/global-styles/font-sizes/font-size.js +15 -16
  85. package/build-module/components/global-styles/font-sizes/font-size.js.map +1 -1
  86. package/build-module/components/global-styles/font-sizes/font-sizes.js +4 -6
  87. package/build-module/components/global-styles/font-sizes/font-sizes.js.map +1 -1
  88. package/build-module/components/global-styles/header.js +2 -9
  89. package/build-module/components/global-styles/header.js.map +1 -1
  90. package/build-module/components/global-styles/navigation-button.js +2 -2
  91. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  92. package/build-module/components/global-styles/palette.js +4 -1
  93. package/build-module/components/global-styles/palette.js.map +1 -1
  94. package/build-module/components/global-styles/preset-colors.js +1 -1
  95. package/build-module/components/global-styles/preset-colors.js.map +1 -1
  96. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js +4 -1
  97. package/build-module/components/global-styles/screen-revisions/revisions-buttons.js.map +1 -1
  98. package/build-module/components/global-styles/shadows-edit-panel.js +20 -10
  99. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  100. package/build-module/components/global-styles/typeset-button.js +6 -5
  101. package/build-module/components/global-styles/typeset-button.js.map +1 -1
  102. package/build-module/components/layout/index.js +1 -2
  103. package/build-module/components/layout/index.js.map +1 -1
  104. package/build-module/components/page-patterns/fields.js +5 -2
  105. package/build-module/components/page-patterns/fields.js.map +1 -1
  106. package/build-module/components/pagination/index.js +5 -5
  107. package/build-module/components/pagination/index.js.map +1 -1
  108. package/build-module/components/save-panel/index.js +4 -1
  109. package/build-module/components/save-panel/index.js.map +1 -1
  110. package/build-module/components/sidebar-button/index.js +4 -1
  111. package/build-module/components/sidebar-button/index.js.map +1 -1
  112. package/build-module/components/sidebar-dataviews/add-new-view.js +8 -2
  113. package/build-module/components/sidebar-dataviews/add-new-view.js.map +1 -1
  114. package/build-module/components/site-hub/index.js +30 -14
  115. package/build-module/components/site-hub/index.js.map +1 -1
  116. package/build-module/components/style-book/index.js +1 -5
  117. package/build-module/components/style-book/index.js.map +1 -1
  118. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -4
  119. package/build-module/components/sync-state-with-url/use-init-edited-entity-from-url.js.map +1 -1
  120. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +12 -12
  121. package/build-module/components/sync-state-with-url/use-sync-canvas-mode-with-url.js.map +1 -1
  122. package/build-module/components/welcome-guide/template.js +19 -9
  123. package/build-module/components/welcome-guide/template.js.map +1 -1
  124. package/build-module/hooks/commands/use-common-commands.js +2 -4
  125. package/build-module/hooks/commands/use-common-commands.js.map +1 -1
  126. package/build-style/posts-rtl.css +90 -83
  127. package/build-style/posts.css +90 -83
  128. package/build-style/style-rtl.css +94 -99
  129. package/build-style/style.css +94 -99
  130. package/package.json +41 -41
  131. package/src/components/add-new-template/add-custom-template-modal-content.js +6 -7
  132. package/src/components/add-new-template/index.js +6 -8
  133. package/src/components/add-new-template/style.scss +1 -2
  134. package/src/components/block-editor/use-site-editor-settings.js +0 -18
  135. package/src/components/editor/index.js +4 -2
  136. package/src/components/editor-canvas-container/index.js +2 -0
  137. package/src/components/editor-canvas-container/style.scss +1 -1
  138. package/src/components/error-boundary/warning.js +6 -1
  139. package/src/components/global-styles/font-library-modal/font-card.js +5 -3
  140. package/src/components/global-styles/font-library-modal/font-collection.js +45 -27
  141. package/src/components/global-styles/font-library-modal/installed-fonts.js +36 -14
  142. package/src/components/global-styles/font-library-modal/upload-fonts.js +2 -0
  143. package/src/components/global-styles/font-sizes/font-size.js +18 -18
  144. package/src/components/global-styles/font-sizes/font-sizes.js +9 -11
  145. package/src/components/global-styles/header.js +2 -7
  146. package/src/components/global-styles/navigation-button.js +2 -4
  147. package/src/components/global-styles/palette.js +2 -0
  148. package/src/components/global-styles/preset-colors.js +1 -1
  149. package/src/components/global-styles/screen-revisions/revisions-buttons.js +2 -0
  150. package/src/components/global-styles/screen-revisions/style.scss +1 -1
  151. package/src/components/global-styles/shadows-edit-panel.js +23 -13
  152. package/src/components/global-styles/style.scss +5 -5
  153. package/src/components/global-styles/typeset-button.js +10 -3
  154. package/src/components/global-styles/variations/style.scss +1 -2
  155. package/src/components/layout/index.js +0 -2
  156. package/src/components/layout/style.scss +2 -24
  157. package/src/components/page/style.scss +5 -1
  158. package/src/components/page-patterns/fields.js +3 -1
  159. package/src/components/page-patterns/style.scss +2 -11
  160. package/src/components/page-templates/style.scss +1 -2
  161. package/src/components/pagination/index.js +5 -5
  162. package/src/components/post-list/style.scss +1 -1
  163. package/src/components/save-panel/index.js +2 -0
  164. package/src/components/sidebar-button/index.js +2 -0
  165. package/src/components/sidebar-dataviews/add-new-view.js +4 -0
  166. package/src/components/sidebar-dataviews/style.scss +1 -1
  167. package/src/components/sidebar-navigation-item/style.scss +0 -1
  168. package/src/components/sidebar-navigation-screen/style.scss +0 -1
  169. package/src/components/site-hub/index.js +18 -12
  170. package/src/components/style-book/index.js +1 -4
  171. package/src/components/style-book/style.scss +2 -2
  172. package/src/components/sync-state-with-url/use-init-edited-entity-from-url.js +3 -4
  173. package/src/components/sync-state-with-url/use-sync-canvas-mode-with-url.js +15 -12
  174. package/src/components/welcome-guide/template.js +12 -18
  175. package/src/hooks/commands/use-common-commands.js +3 -5
@@ -136,6 +136,8 @@ function EditorCanvasContainer( {
136
136
  >
137
137
  { shouldShowCloseButton && (
138
138
  <Button
139
+ // TODO: Switch to `true` (40px size) if possible
140
+ __next40pxDefaultSize={ false }
139
141
  className="edit-site-editor-canvas-container__close-button"
140
142
  icon={ closeSmall }
141
143
  label={ closeButtonLabel || __( 'Close' ) }
@@ -16,7 +16,7 @@
16
16
 
17
17
  .edit-site-editor-canvas-container__section {
18
18
  background: $white; // Fallback color, overridden by JavaScript.
19
- border-radius: $radius-block-ui;
19
+ border-radius: $radius-large;
20
20
  bottom: 0;
21
21
  left: 0;
22
22
  overflow: hidden;
@@ -9,7 +9,12 @@ import { useCopyToClipboard } from '@wordpress/compose';
9
9
  function CopyButton( { text, children } ) {
10
10
  const ref = useCopyToClipboard( text );
11
11
  return (
12
- <Button variant="secondary" ref={ ref }>
12
+ <Button
13
+ // TODO: Switch to `true` (40px size) if possible
14
+ __next40pxDefaultSize={ false }
15
+ variant="secondary"
16
+ ref={ ref }
17
+ >
13
18
  { children }
14
19
  </Button>
15
20
  );
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { _n, sprintf } from '@wordpress/i18n';
4
+ import { _n, sprintf, isRTL } from '@wordpress/i18n';
5
5
  import {
6
6
  __experimentalUseNavigator as useNavigator,
7
7
  __experimentalText as Text,
@@ -15,7 +15,7 @@ import {
15
15
  * Internal dependencies
16
16
  */
17
17
  import FontDemo from './font-demo';
18
- import { chevronRight } from '@wordpress/icons';
18
+ import { chevronLeft, chevronRight } from '@wordpress/icons';
19
19
 
20
20
  function FontCard( { font, onClick, variantsText, navigatorPath } ) {
21
21
  const variantsCount = font.fontFace?.length || 1;
@@ -28,6 +28,8 @@ function FontCard( { font, onClick, variantsText, navigatorPath } ) {
28
28
 
29
29
  return (
30
30
  <Button
31
+ // TODO: Switch to `true` (40px size) if possible
32
+ __next40pxDefaultSize={ false }
31
33
  onClick={ () => {
32
34
  onClick();
33
35
  if ( navigatorPath ) {
@@ -55,7 +57,7 @@ function FontCard( { font, onClick, variantsText, navigatorPath } ) {
55
57
  </Text>
56
58
  </FlexItem>
57
59
  <FlexItem>
58
- <Icon icon={ chevronRight } />
60
+ <Icon icon={ isRTL() ? chevronLeft : chevronRight } />
59
61
  </FlexItem>
60
62
  </Flex>
61
63
  </Flex>
@@ -15,7 +15,7 @@ import {
15
15
  __experimentalVStack as VStack,
16
16
  __experimentalNavigatorProvider as NavigatorProvider,
17
17
  __experimentalNavigatorScreen as NavigatorScreen,
18
- __experimentalNavigatorToParentButton as NavigatorToParentButton,
18
+ __experimentalNavigatorBackButton as NavigatorBackButton,
19
19
  __experimentalHeading as Heading,
20
20
  Notice,
21
21
  SelectControl,
@@ -28,7 +28,7 @@ import {
28
28
  CheckboxControl,
29
29
  } from '@wordpress/components';
30
30
  import { debounce } from '@wordpress/compose';
31
- import { sprintf, __, _x } from '@wordpress/i18n';
31
+ import { sprintf, __, _x, isRTL } from '@wordpress/i18n';
32
32
  import { moreVertical, chevronLeft, chevronRight } from '@wordpress/icons';
33
33
 
34
34
  /**
@@ -376,14 +376,16 @@ function FontCollection( { slug } ) {
376
376
  </li>
377
377
  ) ) }
378
378
  </ul>
379
- { /* eslint-enable jsx-a11y/no-redundant-roles */ }{ ' ' }
379
+ { /* eslint-enable jsx-a11y/no-redundant-roles */ }
380
380
  </div>
381
381
  </NavigatorScreen>
382
382
 
383
383
  <NavigatorScreen path="/fontFamily">
384
384
  <Flex justify="flex-start">
385
- <NavigatorToParentButton
386
- icon={ chevronLeft }
385
+ <NavigatorBackButton
386
+ icon={
387
+ isRTL() ? chevronRight : chevronLeft
388
+ }
387
389
  size="small"
388
390
  onClick={ () => {
389
391
  setSelectedFont( null );
@@ -425,26 +427,40 @@ function FontCollection( { slug } ) {
425
427
  __nextHasNoMarginBottom
426
428
  />
427
429
  <VStack spacing={ 0 }>
428
- <Spacer margin={ 8 } />
429
- { getSortedFontFaces( selectedFont ).map(
430
- ( face, i ) => (
431
- <CollectionFontVariant
432
- font={ selectedFont }
433
- face={ face }
434
- key={ `face${ i }` }
435
- handleToggleVariant={
436
- handleToggleVariant
437
- }
438
- selected={ isFontFontFaceInOutline(
439
- selectedFont.slug,
440
- selectedFont.fontFace
441
- ? face
442
- : null, // If the font has no fontFace, we want to check if the font is in the outline
443
- fontToInstallOutline
444
- ) }
445
- />
446
- )
447
- ) }
430
+ { /*
431
+ * Disable reason: The `list` ARIA role is redundant but
432
+ * Safari+VoiceOver won't announce the list otherwise.
433
+ */
434
+ /* eslint-disable jsx-a11y/no-redundant-roles */ }
435
+ <ul
436
+ role="list"
437
+ className="font-library-modal__fonts-list"
438
+ >
439
+ { getSortedFontFaces( selectedFont ).map(
440
+ ( face, i ) => (
441
+ <li
442
+ key={ `face${ i }` }
443
+ className="font-library-modal__fonts-list-item"
444
+ >
445
+ <CollectionFontVariant
446
+ font={ selectedFont }
447
+ face={ face }
448
+ handleToggleVariant={
449
+ handleToggleVariant
450
+ }
451
+ selected={ isFontFontFaceInOutline(
452
+ selectedFont.slug,
453
+ selectedFont.fontFace
454
+ ? face
455
+ : null, // If the font has no fontFace, we want to check if the font is in the outline
456
+ fontToInstallOutline
457
+ ) }
458
+ />
459
+ </li>
460
+ )
461
+ ) }
462
+ </ul>
463
+ { /* eslint-enable jsx-a11y/no-redundant-roles */ }
448
464
  </VStack>
449
465
  <Spacer margin={ 16 } />
450
466
  </NavigatorScreen>
@@ -456,6 +472,8 @@ function FontCollection( { slug } ) {
456
472
  className="font-library-modal__footer"
457
473
  >
458
474
  <Button
475
+ // TODO: Switch to `true` (40px size) if possible
476
+ __next40pxDefaultSize={ false }
459
477
  variant="primary"
460
478
  onClick={ handleInstall }
461
479
  isBusy={ isInstalling }
@@ -482,7 +500,7 @@ function FontCollection( { slug } ) {
482
500
  disabled={ page === 1 }
483
501
  showTooltip
484
502
  accessibleWhenDisabled
485
- icon={ chevronLeft }
503
+ icon={ isRTL() ? chevronRight : chevronLeft }
486
504
  tooltipPosition="top"
487
505
  />
488
506
  <HStack
@@ -533,7 +551,7 @@ function FontCollection( { slug } ) {
533
551
  onClick={ () => setPage( page + 1 ) }
534
552
  disabled={ page === totalPages }
535
553
  accessibleWhenDisabled
536
- icon={ chevronRight }
554
+ icon={ isRTL() ? chevronLeft : chevronRight }
537
555
  tooltipPosition="top"
538
556
  />
539
557
  </HStack>
@@ -8,7 +8,7 @@ import {
8
8
  __experimentalHeading as Heading,
9
9
  __experimentalNavigatorProvider as NavigatorProvider,
10
10
  __experimentalNavigatorScreen as NavigatorScreen,
11
- __experimentalNavigatorToParentButton as NavigatorToParentButton,
11
+ __experimentalNavigatorBackButton as NavigatorBackButton,
12
12
  __experimentalUseNavigator as useNavigator,
13
13
  __experimentalSpacer as Spacer,
14
14
  __experimentalText as Text,
@@ -21,8 +21,8 @@ import {
21
21
  import { useEntityRecord, store as coreStore } from '@wordpress/core-data';
22
22
  import { useSelect } from '@wordpress/data';
23
23
  import { useContext, useEffect, useState } from '@wordpress/element';
24
- import { __, _x, sprintf } from '@wordpress/i18n';
25
- import { chevronLeft } from '@wordpress/icons';
24
+ import { __, _x, sprintf, isRTL } from '@wordpress/i18n';
25
+ import { chevronLeft, chevronRight } from '@wordpress/icons';
26
26
  import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
27
27
 
28
28
  /**
@@ -353,8 +353,10 @@ function InstalledFonts() {
353
353
  />
354
354
 
355
355
  <Flex justify="flex-start">
356
- <NavigatorToParentButton
357
- icon={ chevronLeft }
356
+ <NavigatorBackButton
357
+ icon={
358
+ isRTL() ? chevronRight : chevronLeft
359
+ }
358
360
  size="small"
359
361
  onClick={ () => {
360
362
  handleSetLibraryFontSelected( null );
@@ -399,15 +401,31 @@ function InstalledFonts() {
399
401
  __nextHasNoMarginBottom
400
402
  />
401
403
  <Spacer margin={ 8 } />
402
- { getFontFacesToDisplay(
403
- libraryFontSelected
404
- ).map( ( face, i ) => (
405
- <LibraryFontVariant
406
- font={ libraryFontSelected }
407
- face={ face }
408
- key={ `face${ i }` }
409
- />
410
- ) ) }
404
+ { /*
405
+ * Disable reason: The `list` ARIA role is redundant but
406
+ * Safari+VoiceOver won't announce the list otherwise.
407
+ */
408
+ /* eslint-disable jsx-a11y/no-redundant-roles */ }
409
+ <ul
410
+ role="list"
411
+ className="font-library-modal__fonts-list"
412
+ >
413
+ { getFontFacesToDisplay(
414
+ libraryFontSelected
415
+ ).map( ( face, i ) => (
416
+ <li
417
+ key={ `face${ i }` }
418
+ className="font-library-modal__fonts-list-item"
419
+ >
420
+ <LibraryFontVariant
421
+ font={ libraryFontSelected }
422
+ face={ face }
423
+ key={ `face${ i }` }
424
+ />
425
+ </li>
426
+ ) ) }
427
+ </ul>
428
+ { /* eslint-enable jsx-a11y/no-redundant-roles */ }
411
429
  </VStack>
412
430
  </NavigatorScreen>
413
431
  </NavigatorProvider>
@@ -419,6 +437,8 @@ function InstalledFonts() {
419
437
  { isInstalling && <ProgressBar /> }
420
438
  { shouldDisplayDeleteButton && (
421
439
  <Button
440
+ // TODO: Switch to `true` (40px size) if possible
441
+ __next40pxDefaultSize={ false }
422
442
  isDestructive
423
443
  variant="tertiary"
424
444
  onClick={ handleUninstallClick }
@@ -427,6 +447,8 @@ function InstalledFonts() {
427
447
  </Button>
428
448
  ) }
429
449
  <Button
450
+ // TODO: Switch to `true` (40px size) if possible
451
+ __next40pxDefaultSize={ false }
430
452
  variant="primary"
431
453
  onClick={ handleUpdate }
432
454
  disabled={ ! fontFamiliesHasChanges }
@@ -230,6 +230,8 @@ function UploadFonts() {
230
230
  onChange={ onFilesUpload }
231
231
  render={ ( { openFileDialog } ) => (
232
232
  <Button
233
+ // TODO: Switch to `true` (40px size) if possible
234
+ __next40pxDefaultSize={ false }
233
235
  className="font-library-modal__upload-area"
234
236
  onClick={ openFileDialog }
235
237
  >
@@ -21,18 +21,15 @@ import { useState } from '@wordpress/element';
21
21
  * Internal dependencies
22
22
  */
23
23
  import { unlock } from '../../../lock-unlock';
24
- const {
25
- DropdownMenuV2: DropdownMenu,
26
- DropdownMenuItemV2: DropdownMenuItem,
27
- DropdownMenuItemLabelV2: DropdownMenuItemLabel,
28
- } = unlock( componentsPrivateApis );
29
- const { useGlobalSetting } = unlock( blockEditorPrivateApis );
30
24
  import ScreenHeader from '../header';
31
25
  import FontSizePreview from './font-size-preview';
32
26
  import ConfirmDeleteFontSizeDialog from './confirm-delete-font-size-dialog';
33
27
  import RenameFontSizeDialog from './rename-font-size-dialog';
34
28
  import SizeControl from '../size-control';
35
29
 
30
+ const { DropdownMenuV2 } = unlock( componentsPrivateApis );
31
+ const { useGlobalSetting } = unlock( blockEditorPrivateApis );
32
+
36
33
  function FontSize() {
37
34
  const [ isDeleteConfirmOpen, setIsDeleteConfirmOpen ] = useState( false );
38
35
  const [ isRenameDialogOpen, setIsRenameDialogOpen ] = useState( false );
@@ -47,14 +44,17 @@ function FontSize() {
47
44
  'typography.fontSizes'
48
45
  );
49
46
 
47
+ const [ globalFluid ] = useGlobalSetting( 'typography.fluid' );
48
+
50
49
  // Get the font sizes from the origin, default to empty array.
51
50
  const sizes = fontSizes[ origin ] ?? [];
52
51
 
53
52
  // Get the font size by slug.
54
53
  const fontSize = sizes.find( ( size ) => size.slug === slug );
55
54
 
56
- // Whether fluid is true or an object, set it to true, otherwise false.
57
- const isFluid = !! fontSize.fluid ?? false;
55
+ // Whether the font size is fluid. If not defined, use the global fluid value of the theme.
56
+ const isFluid =
57
+ fontSize.fluid !== undefined ? !! fontSize.fluid : !! globalFluid;
58
58
 
59
59
  // Whether custom fluid values are used.
60
60
  const isCustomFluid = typeof fontSize.fluid === 'object';
@@ -160,7 +160,7 @@ function FontSize() {
160
160
  marginBottom={ 0 }
161
161
  paddingX={ 4 }
162
162
  >
163
- <DropdownMenu
163
+ <DropdownMenuV2
164
164
  trigger={
165
165
  <Button
166
166
  size="small"
@@ -169,21 +169,21 @@ function FontSize() {
169
169
  />
170
170
  }
171
171
  >
172
- <DropdownMenuItem
172
+ <DropdownMenuV2.Item
173
173
  onClick={ toggleRenameDialog }
174
174
  >
175
- <DropdownMenuItemLabel>
175
+ <DropdownMenuV2.ItemLabel>
176
176
  { __( 'Rename' ) }
177
- </DropdownMenuItemLabel>
178
- </DropdownMenuItem>
179
- <DropdownMenuItem
177
+ </DropdownMenuV2.ItemLabel>
178
+ </DropdownMenuV2.Item>
179
+ <DropdownMenuV2.Item
180
180
  onClick={ toggleDeleteConfirm }
181
181
  >
182
- <DropdownMenuItemLabel>
182
+ <DropdownMenuV2.ItemLabel>
183
183
  { __( 'Delete' ) }
184
- </DropdownMenuItemLabel>
185
- </DropdownMenuItem>
186
- </DropdownMenu>
184
+ </DropdownMenuV2.ItemLabel>
185
+ </DropdownMenuV2.Item>
186
+ </DropdownMenuV2>
187
187
  </Spacer>
188
188
  </FlexItem>
189
189
  ) }
@@ -27,11 +27,7 @@ import { useState } from '@wordpress/element';
27
27
  * Internal dependencies
28
28
  */
29
29
  import { unlock } from '../../../lock-unlock';
30
- const {
31
- DropdownMenuV2: DropdownMenu,
32
- DropdownMenuItemV2: DropdownMenuItem,
33
- DropdownMenuItemLabelV2: DropdownMenuItemLabel,
34
- } = unlock( componentsPrivateApis );
30
+ const { DropdownMenuV2 } = unlock( componentsPrivateApis );
35
31
  const { useGlobalSetting } = unlock( blockEditorPrivateApis );
36
32
  import Subtitle from '../subtitle';
37
33
  import { NavigationButtonAsItem } from '../navigation-button';
@@ -85,7 +81,7 @@ function FontSizeGroup( {
85
81
  />
86
82
  ) }
87
83
  { !! handleResetFontSizes && (
88
- <DropdownMenu
84
+ <DropdownMenuV2
89
85
  trigger={
90
86
  <Button
91
87
  size="small"
@@ -96,14 +92,16 @@ function FontSizeGroup( {
96
92
  />
97
93
  }
98
94
  >
99
- <DropdownMenuItem onClick={ toggleResetDialog }>
100
- <DropdownMenuItemLabel>
95
+ <DropdownMenuV2.Item
96
+ onClick={ toggleResetDialog }
97
+ >
98
+ <DropdownMenuV2.ItemLabel>
101
99
  { origin === 'custom'
102
100
  ? __( 'Remove font size presets' )
103
101
  : __( 'Reset font size presets' ) }
104
- </DropdownMenuItemLabel>
105
- </DropdownMenuItem>
106
- </DropdownMenu>
102
+ </DropdownMenuV2.ItemLabel>
103
+ </DropdownMenuV2.Item>
104
+ </DropdownMenuV2>
107
105
  ) }
108
106
  </FlexItem>
109
107
  </HStack>
@@ -7,7 +7,7 @@ import {
7
7
  __experimentalSpacer as Spacer,
8
8
  __experimentalHeading as Heading,
9
9
  __experimentalView as View,
10
- __experimentalNavigatorToParentButton as NavigatorToParentButton,
10
+ __experimentalNavigatorBackButton as NavigatorBackButton,
11
11
  } from '@wordpress/components';
12
12
  import { isRTL, __ } from '@wordpress/i18n';
13
13
  import { chevronRight, chevronLeft } from '@wordpress/icons';
@@ -18,12 +18,7 @@ function ScreenHeader( { title, description, onBack } ) {
18
18
  <View>
19
19
  <Spacer marginBottom={ 0 } paddingX={ 4 } paddingY={ 3 }>
20
20
  <HStack spacing={ 2 }>
21
- <NavigatorToParentButton
22
- style={
23
- // TODO: This style override is also used in ToolsPanelHeader.
24
- // It should be supported out-of-the-box by Button.
25
- { minWidth: 24, padding: 0 }
26
- }
21
+ <NavigatorBackButton
27
22
  icon={ isRTL() ? chevronRight : chevronLeft }
28
23
  size="small"
29
24
  label={ __( 'Back' ) }
@@ -3,7 +3,7 @@
3
3
  */
4
4
  import {
5
5
  __experimentalNavigatorButton as NavigatorButton,
6
- __experimentalNavigatorToParentButton as NavigatorToParentButton,
6
+ __experimentalNavigatorBackButton as NavigatorBackButton,
7
7
  __experimentalItem as Item,
8
8
  FlexItem,
9
9
  __experimentalHStack as HStack,
@@ -33,9 +33,7 @@ function NavigationButtonAsItem( props ) {
33
33
  }
34
34
 
35
35
  function NavigationBackButtonAsItem( props ) {
36
- return (
37
- <NavigatorToParentButton as={ GenericNavigationButton } { ...props } />
38
- );
36
+ return <NavigatorBackButton as={ GenericNavigationButton } { ...props } />;
39
37
  }
40
38
 
41
39
  export { NavigationButtonAsItem, NavigationBackButtonAsItem };
@@ -87,6 +87,8 @@ function Palette( { name } ) {
87
87
  { window.__experimentalEnableColorRandomizer &&
88
88
  themeColors?.length > 0 && (
89
89
  <Button
90
+ // TODO: Switch to `true` (40px size) if possible
91
+ __next40pxDefaultSize={ false }
90
92
  variant="secondary"
91
93
  icon={ shuffle }
92
94
  onClick={ randomizeThemeColors }
@@ -5,7 +5,7 @@ import { useStylesPreviewColors } from './hooks';
5
5
 
6
6
  export default function PresetColors() {
7
7
  const { paletteColors } = useStylesPreviewColors();
8
- return paletteColors.slice( 0, 5 ).map( ( { slug, color }, index ) => (
8
+ return paletteColors.slice( 0, 4 ).map( ( { slug, color }, index ) => (
9
9
  <div
10
10
  key={ `${ slug }-${ index }` }
11
11
  style={ {
@@ -162,6 +162,8 @@ function RevisionsButtons( {
162
162
  aria-current={ isSelected }
163
163
  >
164
164
  <Button
165
+ // TODO: Switch to `true` (40px size) if possible
166
+ __next40pxDefaultSize={ false }
165
167
  className="edit-site-global-styles-screen-revisions__revision-button"
166
168
  accessibleWhenDisabled
167
169
  disabled={ isSelected }
@@ -43,7 +43,7 @@
43
43
  }
44
44
 
45
45
  &.is-selected {
46
- border-radius: $radius-block-ui;
46
+ border-radius: $radius-small;
47
47
 
48
48
  // Only visible in Windows High Contrast mode.
49
49
  outline: 3px solid transparent;
@@ -55,11 +55,7 @@ import {
55
55
  } from './shadow-utils';
56
56
 
57
57
  const { useGlobalSetting } = unlock( blockEditorPrivateApis );
58
- const {
59
- DropdownMenuV2: DropdownMenu,
60
- DropdownMenuItemV2: DropdownMenuItem,
61
- DropdownMenuItemLabelV2: DropdownMenuItemLabel,
62
- } = unlock( componentsPrivateApis );
58
+ const { DropdownMenuV2 } = unlock( componentsPrivateApis );
63
59
 
64
60
  const customShadowMenuItems = [
65
61
  {
@@ -151,7 +147,7 @@ export default function ShadowsEditPanel() {
151
147
  <ScreenHeader title={ selectedShadow.name } />
152
148
  <FlexItem>
153
149
  <Spacer marginTop={ 2 } marginBottom={ 0 } paddingX={ 4 }>
154
- <DropdownMenu
150
+ <DropdownMenuV2
155
151
  trigger={
156
152
  <Button
157
153
  size="small"
@@ -164,7 +160,7 @@ export default function ShadowsEditPanel() {
164
160
  ? customShadowMenuItems
165
161
  : presetShadowMenuItems
166
162
  ).map( ( item ) => (
167
- <DropdownMenuItem
163
+ <DropdownMenuV2.Item
168
164
  key={ item.action }
169
165
  onClick={ () => onMenuClick( item.action ) }
170
166
  disabled={
@@ -173,12 +169,12 @@ export default function ShadowsEditPanel() {
173
169
  baseSelectedShadow.shadow
174
170
  }
175
171
  >
176
- <DropdownMenuItemLabel>
172
+ <DropdownMenuV2.ItemLabel>
177
173
  { item.label }
178
- </DropdownMenuItemLabel>
179
- </DropdownMenuItem>
174
+ </DropdownMenuV2.ItemLabel>
175
+ </DropdownMenuV2.Item>
180
176
  ) ) }
181
- </DropdownMenu>
177
+ </DropdownMenuV2>
182
178
  </Spacer>
183
179
  </FlexItem>
184
180
  </HStack>
@@ -238,6 +234,8 @@ export default function ShadowsEditPanel() {
238
234
  >
239
235
  <FlexItem>
240
236
  <Button
237
+ // TODO: Switch to `true` (40px size) if possible
238
+ __next40pxDefaultSize={ false }
241
239
  variant="tertiary"
242
240
  onClick={ () =>
243
241
  setIsRenameModalVisible( false )
@@ -247,7 +245,12 @@ export default function ShadowsEditPanel() {
247
245
  </Button>
248
246
  </FlexItem>
249
247
  <FlexItem>
250
- <Button variant="primary" type="submit">
248
+ <Button
249
+ // TODO: Switch to `true` (40px size) if possible
250
+ __next40pxDefaultSize={ false }
251
+ variant="primary"
252
+ type="submit"
253
+ >
251
254
  { __( 'Save' ) }
252
255
  </Button>
253
256
  </FlexItem>
@@ -377,7 +380,12 @@ function ShadowItem( { shadow, onChange, canRemove, onRemove } ) {
377
380
  return (
378
381
  <HStack align="center" justify="flex-start" spacing={ 0 }>
379
382
  <FlexItem style={ { flexGrow: 1 } }>
380
- <Button icon={ shadowIcon } { ...toggleProps }>
383
+ <Button
384
+ // TODO: Switch to `true` (40px size) if possible
385
+ __next40pxDefaultSize={ false }
386
+ icon={ shadowIcon }
387
+ { ...toggleProps }
388
+ >
381
389
  { shadowObj.inset
382
390
  ? __( 'Inner shadow' )
383
391
  : __( 'Drop shadow' ) }
@@ -386,6 +394,8 @@ function ShadowItem( { shadow, onChange, canRemove, onRemove } ) {
386
394
  { canRemove && (
387
395
  <FlexItem>
388
396
  <Button
397
+ // TODO: Switch to `true` (40px size) if possible
398
+ __next40pxDefaultSize={ false }
389
399
  icon={ reset }
390
400
  { ...removeButtonProps }
391
401
  />
@@ -19,7 +19,7 @@
19
19
  min-height: 100px;
20
20
  margin-bottom: $grid-unit-20;
21
21
  background: $gray-100;
22
- border-radius: $radius-block-ui;
22
+ border-radius: $radius-small;
23
23
  overflow: hidden;
24
24
  }
25
25
 
@@ -45,7 +45,7 @@
45
45
  display: flex !important;
46
46
  align-items: center;
47
47
  justify-content: center;
48
- border-radius: $radius-block-ui;
48
+ border-radius: $radius-x-small;
49
49
  }
50
50
 
51
51
  .edit-site-global-styles-screen-typography__font-variants-count {
@@ -113,14 +113,14 @@
113
113
  position: relative;
114
114
  width: 100%;
115
115
  border: $gray-200 $border-width solid;
116
- border-radius: $radius-block-ui;
116
+ border-radius: $radius-medium;
117
117
  overflow: hidden;
118
118
  }
119
119
 
120
120
  .edit-site-global-styles__shadow-preview-panel {
121
121
  height: $grid-unit-60 * 3;
122
122
  border: $gray-200 $border-width solid;
123
- border-radius: $radius-block-ui;
123
+ border-radius: $radius-medium;
124
124
  overflow: auto;
125
125
  background-image: repeating-linear-gradient(45deg, #f5f5f5 25%, #0000 0, #0000 75%, #f5f5f5 0, #f5f5f5), repeating-linear-gradient(45deg, #f5f5f5 25%, #0000 0, #0000 75%, #f5f5f5 0, #f5f5f5);
126
126
  background-position: 0 0, 8px 8px;
@@ -128,7 +128,7 @@
128
128
 
129
129
  .edit-site-global-styles__shadow-preview-block {
130
130
  border: $gray-200 $border-width solid;
131
- border-radius: $radius-block-ui;
131
+ border-radius: $radius-small;
132
132
  background-color: $white;
133
133
  width: 60%;
134
134
  height: 60px;