@wordpress/edit-site 3.0.17 → 3.0.18-next.33ec3857e2.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 (69) hide show
  1. package/build/components/block-editor/resizable-editor.js +1 -0
  2. package/build/components/block-editor/resizable-editor.js.map +1 -1
  3. package/build/components/global-styles/border-panel.js +81 -22
  4. package/build/components/global-styles/border-panel.js.map +1 -1
  5. package/build/components/global-styles/screen-background-color.js +9 -10
  6. package/build/components/global-styles/screen-background-color.js.map +1 -1
  7. package/build/components/global-styles/screen-colors.js +1 -1
  8. package/build/components/global-styles/screen-colors.js.map +1 -1
  9. package/build/components/global-styles/screen-link-color.js +6 -10
  10. package/build/components/global-styles/screen-link-color.js.map +1 -1
  11. package/build/components/global-styles/screen-text-color.js +6 -10
  12. package/build/components/global-styles/screen-text-color.js.map +1 -1
  13. package/build/components/global-styles/ui.js +27 -14
  14. package/build/components/global-styles/ui.js.map +1 -1
  15. package/build/components/list/actions/index.js +1 -0
  16. package/build/components/list/actions/index.js.map +1 -1
  17. package/build/components/navigation-sidebar/navigation-toggle/index.js +3 -1
  18. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  19. package/build/components/sidebar/default-sidebar.js +4 -2
  20. package/build/components/sidebar/default-sidebar.js.map +1 -1
  21. package/build/components/sidebar/global-styles-sidebar.js +1 -0
  22. package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
  23. package/build/plugins/site-export.js +7 -1
  24. package/build/plugins/site-export.js.map +1 -1
  25. package/build-module/components/block-editor/resizable-editor.js +1 -0
  26. package/build-module/components/block-editor/resizable-editor.js.map +1 -1
  27. package/build-module/components/global-styles/border-panel.js +82 -23
  28. package/build-module/components/global-styles/border-panel.js.map +1 -1
  29. package/build-module/components/global-styles/screen-background-color.js +9 -11
  30. package/build-module/components/global-styles/screen-background-color.js.map +1 -1
  31. package/build-module/components/global-styles/screen-colors.js +1 -1
  32. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  33. package/build-module/components/global-styles/screen-link-color.js +7 -11
  34. package/build-module/components/global-styles/screen-link-color.js.map +1 -1
  35. package/build-module/components/global-styles/screen-text-color.js +7 -11
  36. package/build-module/components/global-styles/screen-text-color.js.map +1 -1
  37. package/build-module/components/global-styles/ui.js +26 -14
  38. package/build-module/components/global-styles/ui.js.map +1 -1
  39. package/build-module/components/list/actions/index.js +1 -0
  40. package/build-module/components/list/actions/index.js.map +1 -1
  41. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +3 -1
  42. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  43. package/build-module/components/sidebar/default-sidebar.js +4 -2
  44. package/build-module/components/sidebar/default-sidebar.js.map +1 -1
  45. package/build-module/components/sidebar/global-styles-sidebar.js +1 -0
  46. package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
  47. package/build-module/plugins/site-export.js +7 -1
  48. package/build-module/plugins/site-export.js.map +1 -1
  49. package/build-style/style-rtl.css +35 -55
  50. package/build-style/style.css +35 -55
  51. package/package.json +28 -28
  52. package/src/components/block-editor/resizable-editor.js +1 -0
  53. package/src/components/block-editor/style.scss +10 -18
  54. package/src/components/global-styles/border-panel.js +106 -42
  55. package/src/components/global-styles/screen-background-color.js +7 -10
  56. package/src/components/global-styles/screen-colors.js +1 -1
  57. package/src/components/global-styles/screen-link-color.js +6 -14
  58. package/src/components/global-styles/screen-text-color.js +6 -14
  59. package/src/components/global-styles/style.scss +6 -17
  60. package/src/components/global-styles/test/use-global-styles-output.js +7 -1
  61. package/src/components/global-styles/ui.js +50 -25
  62. package/src/components/header/document-actions/style.scss +1 -9
  63. package/src/components/header/style.scss +2 -1
  64. package/src/components/list/actions/index.js +1 -0
  65. package/src/components/navigation-sidebar/navigation-toggle/index.js +2 -0
  66. package/src/components/sidebar/default-sidebar.js +2 -0
  67. package/src/components/sidebar/global-styles-sidebar.js +1 -0
  68. package/src/components/sidebar/style.scss +21 -14
  69. package/src/plugins/site-export.js +5 -1
@@ -468,10 +468,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
468
468
  border-radius: 2px;
469
469
  }
470
470
 
471
- .edit-site-visual-editor__editor-canvas {
472
- border-radius: 2px 2px 0 0;
473
- }
474
-
475
471
  .edit-site-visual-editor__back-button {
476
472
  position: absolute;
477
473
  top: 8px;
@@ -492,28 +488,24 @@ body.is-fullscreen-mode .interface-interface-skeleton {
492
488
  bottom: 0;
493
489
  padding: 0;
494
490
  margin: auto 0;
495
- width: 8px;
491
+ width: 4px;
496
492
  height: 100px;
497
493
  -webkit-appearance: none;
498
494
  appearance: none;
499
- cursor: grab;
495
+ cursor: ew-resize;
500
496
  outline: none;
501
- background: #757575;
502
- border-radius: 4px;
497
+ background: #949494;
498
+ border-radius: 2px;
503
499
  border: 0;
504
500
  }
505
501
  .resizable-editor__drag-handle.is-left {
506
- left: -28px;
502
+ left: -16px;
507
503
  }
508
504
  .resizable-editor__drag-handle.is-right {
509
- right: -28px;
505
+ right: -16px;
510
506
  }
511
- .resizable-editor__drag-handle:hover {
512
- background: #949494;
513
- }
514
- .resizable-editor__drag-handle:active {
515
- cursor: grabbing;
516
- background: #949494;
507
+ .resizable-editor__drag-handle:hover, .resizable-editor__drag-handle:active {
508
+ background: #ccc;
517
509
  }
518
510
  .resizable-editor__drag-handle:focus {
519
511
  box-shadow: 0 0 0 1px #2f2f2f, 0 0 0 calc(var(--wp-admin-border-width-focus) + 1px) var(--wp-admin-theme-color);
@@ -526,14 +518,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
526
518
  min-height: 152px;
527
519
  line-height: 1;
528
520
  }
529
- .edit-site-global-styles-preview .component-color-indicator {
530
- border-radius: 50%;
531
- border: 0;
532
- height: 36px;
533
- width: 36px;
534
- margin-left: 0;
535
- padding: 0;
536
- }
537
521
 
538
522
  .edit-site-typography-panel__preview {
539
523
  display: flex;
@@ -563,13 +547,6 @@ body.is-fullscreen-mode .interface-interface-skeleton {
563
547
  margin: 16px;
564
548
  }
565
549
  .edit-site-global-styles-screen-colors .component-color-indicator {
566
- margin-left: 0;
567
- display: block;
568
- border-radius: 50%;
569
- height: 24px;
570
- width: 24px;
571
- padding: 0;
572
- border: 1px solid #ddd;
573
550
  background: linear-gradient(-45deg, transparent 48%, #ddd 48%, #ddd 52%, transparent 52%);
574
551
  }
575
552
 
@@ -600,6 +577,12 @@ h2.edit-site-global-styles-gradient-palette-panel__duotone-heading.components-he
600
577
  margin-bottom: 8px;
601
578
  }
602
579
 
580
+ .edit-site-screen-text-color__control,
581
+ .edit-site-screen-link-color__control,
582
+ .edit-site-screen-background-color__control {
583
+ padding: 16px;
584
+ }
585
+
603
586
  .edit-site-header {
604
587
  align-items: center;
605
588
  background-color: #fff;
@@ -628,6 +611,8 @@ body.is-fullscreen-mode .edit-site-header {
628
611
  display: flex;
629
612
  align-items: center;
630
613
  height: 100%;
614
+ flex-grow: 1;
615
+ justify-content: center;
631
616
  min-width: 0;
632
617
  }
633
618
  .edit-site-header .edit-site-header_end {
@@ -705,7 +690,6 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
705
690
  .edit-site-header__actions {
706
691
  display: inline-flex;
707
692
  align-items: center;
708
- flex-wrap: wrap;
709
693
  padding-right: 4px;
710
694
  }
711
695
  .edit-site-header__actions .interface-pinned-items {
@@ -760,6 +744,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
760
744
  display: flex;
761
745
  flex-direction: column;
762
746
  justify-content: center;
747
+ padding: 0 8px;
763
748
  height: 100%;
764
749
  min-width: 0;
765
750
  }
@@ -786,17 +771,6 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
786
771
  white-space: nowrap;
787
772
  overflow: hidden;
788
773
  text-overflow: ellipsis;
789
- max-width: 120px;
790
- }
791
- @media (min-width: 782px) {
792
- .edit-site-document-actions .edit-site-document-actions__title {
793
- max-width: 75px;
794
- }
795
- }
796
- @media (min-width: 1080px) {
797
- .edit-site-document-actions .edit-site-document-actions__title {
798
- max-width: 180px;
799
- }
800
774
  }
801
775
  .edit-site-document-actions .edit-site-document-actions__secondary-item {
802
776
  white-space: nowrap;
@@ -1288,6 +1262,20 @@ body.is-fullscreen-mode .edit-site-list-header {
1288
1262
  margin: 0;
1289
1263
  }
1290
1264
 
1265
+ .edit-site-global-styles-sidebar {
1266
+ display: flex;
1267
+ flex-direction: column;
1268
+ height: 100%;
1269
+ }
1270
+ .edit-site-global-styles-sidebar__panel, .edit-site-global-styles-sidebar__navigator-provider {
1271
+ display: flex;
1272
+ flex-direction: column;
1273
+ flex: 1;
1274
+ }
1275
+ .edit-site-global-styles-sidebar__navigator-screen {
1276
+ flex: 1;
1277
+ }
1278
+
1291
1279
  .edit-site-global-styles-sidebar .interface-complementary-area-header .components-button.has-icon {
1292
1280
  margin-left: 0;
1293
1281
  }
@@ -1296,18 +1284,6 @@ body.is-fullscreen-mode .edit-site-list-header {
1296
1284
  margin-left: auto;
1297
1285
  }
1298
1286
 
1299
- .edit-site-global-styles-sidebar__border-controls-row {
1300
- display: flex;
1301
- justify-content: space-between;
1302
- margin-bottom: 12px;
1303
- }
1304
- .edit-site-global-styles-sidebar__border-controls-row > * {
1305
- width: calc(50% - 8px);
1306
- }
1307
- .edit-site-global-styles-sidebar__border-controls-row .components-border-style-control__buttons {
1308
- margin-bottom: 0;
1309
- }
1310
-
1311
1287
  .edit-site-global-styles-sidebar .components-navigation__menu-title-heading {
1312
1288
  font-size: 15.6px;
1313
1289
  font-weight: 500;
@@ -1322,6 +1298,10 @@ body.is-fullscreen-mode .edit-site-list-header {
1322
1298
  border: 0;
1323
1299
  }
1324
1300
 
1301
+ .edit-site-global-styles-sidebar .components-tools-panel-item.single-column {
1302
+ grid-column: span 1;
1303
+ }
1304
+
1325
1305
  .edit-site-global-styles-sidebar__blocks-group {
1326
1306
  padding-top: 24px;
1327
1307
  border-top: 1px solid #e0e0e0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "3.0.17",
3
+ "version": "3.0.18-next.33ec3857e2.0",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -27,32 +27,32 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.2.4",
31
- "@wordpress/api-fetch": "^5.2.6",
32
- "@wordpress/block-editor": "^8.0.11",
33
- "@wordpress/block-library": "^6.0.15",
34
- "@wordpress/blocks": "^11.1.4",
35
- "@wordpress/components": "^19.1.5",
36
- "@wordpress/compose": "^5.0.6",
37
- "@wordpress/core-data": "^4.0.8",
38
- "@wordpress/data": "^6.1.4",
39
- "@wordpress/data-controls": "^2.2.7",
40
- "@wordpress/editor": "^12.0.14",
41
- "@wordpress/element": "^4.0.4",
42
- "@wordpress/hooks": "^3.2.2",
43
- "@wordpress/html-entities": "^3.2.3",
44
- "@wordpress/i18n": "^4.2.4",
45
- "@wordpress/icons": "^6.1.1",
46
- "@wordpress/interface": "^4.1.13",
47
- "@wordpress/keyboard-shortcuts": "^3.0.6",
48
- "@wordpress/keycodes": "^3.2.4",
49
- "@wordpress/media-utils": "^3.0.5",
50
- "@wordpress/notices": "^3.2.7",
51
- "@wordpress/plugins": "^4.0.6",
52
- "@wordpress/primitives": "^3.0.4",
53
- "@wordpress/reusable-blocks": "^3.0.17",
54
- "@wordpress/url": "^3.3.1",
55
- "@wordpress/viewport": "^4.0.6",
30
+ "@wordpress/a11y": "^3.2.5-next.33ec3857e2.0",
31
+ "@wordpress/api-fetch": "^5.2.7-next.33ec3857e2.0",
32
+ "@wordpress/block-editor": "^8.0.12-next.33ec3857e2.0",
33
+ "@wordpress/block-library": "^6.0.17-next.33ec3857e2.0",
34
+ "@wordpress/blocks": "^11.1.5-next.33ec3857e2.0",
35
+ "@wordpress/components": "^19.2.1-next.33ec3857e2.0",
36
+ "@wordpress/compose": "^5.0.7-next.33ec3857e2.0",
37
+ "@wordpress/core-data": "^4.0.10-next.33ec3857e2.0",
38
+ "@wordpress/data": "^6.1.6-next.33ec3857e2.0",
39
+ "@wordpress/data-controls": "^2.2.8-next.33ec3857e2.0",
40
+ "@wordpress/editor": "^12.0.15-next.33ec3857e2.0",
41
+ "@wordpress/element": "^4.0.6-next.33ec3857e2.0",
42
+ "@wordpress/hooks": "^3.2.3-next.33ec3857e2.0",
43
+ "@wordpress/html-entities": "^3.2.4-next.33ec3857e2.0",
44
+ "@wordpress/i18n": "^4.2.5-next.33ec3857e2.0",
45
+ "@wordpress/icons": "^6.1.2-next.33ec3857e2.0",
46
+ "@wordpress/interface": "^4.1.14-next.33ec3857e2.0",
47
+ "@wordpress/keyboard-shortcuts": "^3.0.7-next.33ec3857e2.0",
48
+ "@wordpress/keycodes": "^3.2.5-next.33ec3857e2.0",
49
+ "@wordpress/media-utils": "^3.0.6-next.33ec3857e2.0",
50
+ "@wordpress/notices": "^3.2.8-next.33ec3857e2.0",
51
+ "@wordpress/plugins": "^4.0.7-next.33ec3857e2.0",
52
+ "@wordpress/primitives": "^3.0.5-next.33ec3857e2.0",
53
+ "@wordpress/reusable-blocks": "^3.0.18-next.33ec3857e2.0",
54
+ "@wordpress/url": "^3.3.2-next.33ec3857e2.0",
55
+ "@wordpress/viewport": "^4.0.7-next.33ec3857e2.0",
56
56
  "classnames": "^2.3.1",
57
57
  "downloadjs": "^1.4.7",
58
58
  "file-saver": "^2.0.2",
@@ -64,5 +64,5 @@
64
64
  "publishConfig": {
65
65
  "access": "public"
66
66
  },
67
- "gitHead": "3665e3e1b121046300d8b2fa35074d748f16dbc2"
67
+ "gitHead": "51c7917ea7fac72953702f24d6daac87d99e7617"
68
68
  }
@@ -137,6 +137,7 @@ function ResizableEditor( { enableResizing, settings, ...props } ) {
137
137
  }</style>
138
138
  </>
139
139
  }
140
+ assets={ settings.__unstableResolvedAssets }
140
141
  ref={ ref }
141
142
  name="editor-canvas"
142
143
  className="edit-site-visual-editor__editor-canvas"
@@ -19,18 +19,14 @@
19
19
  align-items: center;
20
20
 
21
21
  &.is-focus-mode {
22
- padding: 48px;
22
+ padding: $grid-unit-60;
23
23
 
24
24
  .edit-site-visual-editor__editor-canvas {
25
- border-radius: 2px;
25
+ border-radius: $radius-block-ui;
26
26
  }
27
27
  }
28
28
  }
29
29
 
30
- .edit-site-visual-editor__editor-canvas {
31
- border-radius: 2px 2px 0 0;
32
- }
33
-
34
30
  .edit-site-visual-editor__back-button {
35
31
  position: absolute;
36
32
  top: $grid-unit-10;
@@ -55,30 +51,26 @@
55
51
  bottom: 0;
56
52
  padding: 0;
57
53
  margin: auto 0;
58
- width: $grid-unit-10;
54
+ width: $grid-unit-05;
59
55
  height: $height;
60
56
  appearance: none;
61
- cursor: grab;
57
+ cursor: ew-resize;
62
58
  outline: none;
63
- background: $gray-700;
64
- border-radius: 4px;
59
+ background: $gray-600;
60
+ border-radius: 2px;
65
61
  border: 0;
66
62
 
67
63
  &.is-left {
68
- left: #{-$grid-unit-30 - $grid-unit-05};
64
+ left: -$grid-unit-20;
69
65
  }
70
66
 
71
67
  &.is-right {
72
- right: #{-$grid-unit-30 - $grid-unit-05};
73
- }
74
-
75
- &:hover {
76
- background: $gray-600;
68
+ right: -$grid-unit-20;
77
69
  }
78
70
 
71
+ &:hover,
79
72
  &:active {
80
- cursor: grabbing;
81
- background: $gray-600;
73
+ background: $gray-400;
82
74
  }
83
75
 
84
76
  &:focus {
@@ -7,7 +7,8 @@ import {
7
7
  __experimentalColorGradientControl as ColorGradientControl,
8
8
  } from '@wordpress/block-editor';
9
9
  import {
10
- PanelBody,
10
+ __experimentalToolsPanel as ToolsPanel,
11
+ __experimentalToolsPanelItem as ToolsPanelItem,
11
12
  __experimentalUnitControl as UnitControl,
12
13
  __experimentalUseCustomUnits as useCustomUnits,
13
14
  } from '@wordpress/components';
@@ -68,6 +69,18 @@ function useHasBorderWidthControl( name ) {
68
69
  }
69
70
 
70
71
  export default function BorderPanel( { name } ) {
72
+ // To better reflect if the user has customized a value we need to
73
+ // ensure the style value being checked is from the `user` origin.
74
+ const [ userBorderStyles ] = useStyle( 'border', name, 'user' );
75
+ const createHasValueCallback = ( feature ) => () =>
76
+ !! userBorderStyles?.[ feature ];
77
+
78
+ const createResetCallback = ( setStyle ) => () => setStyle( undefined );
79
+
80
+ const handleOnChange = ( setStyle ) => ( value ) => {
81
+ setStyle( value || undefined );
82
+ };
83
+
71
84
  const units = useCustomUnits( {
72
85
  availableUnits: useSetting( 'spacing.units' )[ 0 ] || [
73
86
  'px',
@@ -77,70 +90,121 @@ export default function BorderPanel( { name } ) {
77
90
  } );
78
91
 
79
92
  // Border width.
80
- const hasBorderWidth = useHasBorderWidthControl( name );
93
+ const showBorderWidth = useHasBorderWidthControl( name );
81
94
  const [ borderWidthValue, setBorderWidth ] = useStyle(
82
95
  'border.width',
83
96
  name
84
97
  );
85
98
 
86
99
  // Border style.
87
- const hasBorderStyle = useHasBorderStyleControl( name );
100
+ const showBorderStyle = useHasBorderStyleControl( name );
88
101
  const [ borderStyle, setBorderStyle ] = useStyle( 'border.style', name );
89
102
 
90
103
  // Border color.
104
+ const showBorderColor = useHasBorderColorControl( name );
105
+ const [ borderColor, setBorderColor ] = useStyle( 'border.color', name );
91
106
  const [ colors = EMPTY_ARRAY ] = useSetting( 'color.palette' );
92
107
  const disableCustomColors = ! useSetting( 'color.custom' )[ 0 ];
93
108
  const disableCustomGradients = ! useSetting( 'color.customGradient' )[ 0 ];
94
- const hasBorderColor = useHasBorderColorControl( name );
95
- const [ borderColor, setBorderColor ] = useStyle( 'border.color', name );
96
109
 
97
110
  // Border radius.
98
- const hasBorderRadius = useHasBorderRadiusControl( name );
111
+ const showBorderRadius = useHasBorderRadiusControl( name );
99
112
  const [ borderRadiusValues, setBorderRadius ] = useStyle(
100
113
  'border.radius',
101
114
  name
102
115
  );
116
+ const hasBorderRadius = () => {
117
+ const borderValues = userBorderStyles?.radius;
118
+ if ( typeof borderValues === 'object' ) {
119
+ return Object.entries( borderValues ).some( Boolean );
120
+ }
121
+ return !! borderValues;
122
+ };
123
+
124
+ const resetAll = () => {
125
+ setBorderColor( undefined );
126
+ setBorderRadius( undefined );
127
+ setBorderStyle( undefined );
128
+ setBorderWidth( undefined );
129
+ };
130
+
131
+ // When we set a border color or width ensure we have a style so the user
132
+ // can see a visible border.
133
+ const handleOnChangeWithStyle = ( setStyle ) => ( value ) => {
134
+ if ( !! value && ! borderStyle ) {
135
+ setBorderStyle( 'solid' );
136
+ }
137
+
138
+ setStyle( value || undefined );
139
+ };
103
140
 
104
141
  return (
105
- <PanelBody title={ __( 'Border' ) } initialOpen={ true }>
106
- { ( hasBorderWidth || hasBorderStyle ) && (
107
- <div className="edit-site-global-styles-sidebar__border-controls-row">
108
- { hasBorderWidth && (
109
- <UnitControl
110
- value={ borderWidthValue }
111
- label={ __( 'Width' ) }
112
- min={ MIN_BORDER_WIDTH }
113
- onChange={ ( value ) => {
114
- setBorderWidth( value || undefined );
115
- } }
116
- units={ units }
117
- />
118
- ) }
119
- { hasBorderStyle && (
120
- <BorderStyleControl
121
- value={ borderStyle }
122
- onChange={ setBorderStyle }
123
- />
124
- ) }
125
- </div>
142
+ <ToolsPanel label={ __( 'Border' ) } resetAll={ resetAll }>
143
+ { showBorderWidth && (
144
+ <ToolsPanelItem
145
+ className="single-column"
146
+ hasValue={ createHasValueCallback( 'width' ) }
147
+ label={ __( 'Width' ) }
148
+ onDeselect={ createResetCallback( setBorderWidth ) }
149
+ isShownByDefault={ true }
150
+ >
151
+ <UnitControl
152
+ value={ borderWidthValue }
153
+ label={ __( 'Width' ) }
154
+ min={ MIN_BORDER_WIDTH }
155
+ onChange={ handleOnChangeWithStyle( setBorderWidth ) }
156
+ units={ units }
157
+ />
158
+ </ToolsPanelItem>
159
+ ) }
160
+ { showBorderStyle && (
161
+ <ToolsPanelItem
162
+ className="single-column"
163
+ hasValue={ createHasValueCallback( 'style' ) }
164
+ label={ __( 'Style' ) }
165
+ onDeselect={ createResetCallback( setBorderStyle ) }
166
+ isShownByDefault={ true }
167
+ >
168
+ <BorderStyleControl
169
+ value={ borderStyle }
170
+ onChange={ handleOnChange( setBorderStyle ) }
171
+ />
172
+ </ToolsPanelItem>
126
173
  ) }
127
- { hasBorderColor && (
128
- <ColorGradientControl
174
+ { showBorderColor && (
175
+ <ToolsPanelItem
176
+ hasValue={ createHasValueCallback( 'color' ) }
129
177
  label={ __( 'Color' ) }
130
- colorValue={ borderColor }
131
- colors={ colors }
132
- gradients={ undefined }
133
- disableCustomColors={ disableCustomColors }
134
- disableCustomGradients={ disableCustomGradients }
135
- onColorChange={ setBorderColor }
136
- />
178
+ onDeselect={ createResetCallback( setBorderColor ) }
179
+ isShownByDefault={ true }
180
+ >
181
+ <ColorGradientControl
182
+ label={ __( 'Color' ) }
183
+ colorValue={ borderColor }
184
+ colors={ colors }
185
+ gradients={ undefined }
186
+ disableCustomColors={ disableCustomColors }
187
+ disableCustomGradients={ disableCustomGradients }
188
+ onColorChange={ handleOnChangeWithStyle(
189
+ setBorderColor
190
+ ) }
191
+ clearable={ false }
192
+ />
193
+ </ToolsPanelItem>
137
194
  ) }
138
- { hasBorderRadius && (
139
- <BorderRadiusControl
140
- values={ borderRadiusValues }
141
- onChange={ setBorderRadius }
142
- />
195
+ { showBorderRadius && (
196
+ <ToolsPanelItem
197
+ hasValue={ hasBorderRadius }
198
+ label={ __( 'Radius' ) }
199
+ onDeselect={ createResetCallback( setBorderRadius ) }
200
+ isShownByDefault={ true }
201
+ >
202
+ <BorderRadiusControl
203
+ values={ borderRadiusValues }
204
+ onChange={ handleOnChange( setBorderRadius ) }
205
+ />
206
+ </ToolsPanelItem>
143
207
  ) }
144
- </PanelBody>
208
+ </ToolsPanel>
145
209
  );
146
210
  }
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';
5
+ import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -55,7 +55,6 @@ function ScreenBackgroundColor( { name } ) {
55
55
  return null;
56
56
  }
57
57
 
58
- const settings = [];
59
58
  let backgroundSettings = {};
60
59
  if ( hasBackgroundColor ) {
61
60
  backgroundSettings = {
@@ -79,11 +78,10 @@ function ScreenBackgroundColor( { name } ) {
79
78
  }
80
79
  }
81
80
 
82
- settings.push( {
81
+ const controlProps = {
83
82
  ...backgroundSettings,
84
83
  ...gradientSettings,
85
- label: __( 'Background color' ),
86
- } );
84
+ };
87
85
 
88
86
  return (
89
87
  <>
@@ -91,13 +89,11 @@ function ScreenBackgroundColor( { name } ) {
91
89
  back={ parentMenu + '/colors' }
92
90
  title={ __( 'Background' ) }
93
91
  description={ __(
94
- 'Set a background color or gradient for the whole website.'
92
+ 'Set a background color or gradient for the whole site.'
95
93
  ) }
96
94
  />
97
-
98
- <PanelColorGradientSettings
99
- title={ __( 'Color' ) }
100
- settings={ settings }
95
+ <ColorGradientControl
96
+ className="edit-site-screen-background-color__control"
101
97
  colors={ colorsPerOrigin }
102
98
  gradients={ gradientsPerOrigin }
103
99
  disableCustomColors={ ! areCustomSolidsEnabled }
@@ -106,6 +102,7 @@ function ScreenBackgroundColor( { name } ) {
106
102
  showTitle={ false }
107
103
  enableAlpha
108
104
  __experimentalIsRenderedInSidebar
105
+ { ...controlProps }
109
106
  />
110
107
  </>
111
108
  );
@@ -96,7 +96,7 @@ function ScreenColors( { name } ) {
96
96
  back={ parentMenu ? parentMenu : '/' }
97
97
  title={ __( 'Colors' ) }
98
98
  description={ __(
99
- 'Manage palettes and the default color of different global elements on the website.'
99
+ 'Manage palettes and the default color of different global elements on the site.'
100
100
  ) }
101
101
  />
102
102
 
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';
5
+ import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -44,15 +44,6 @@ function ScreenLinkColor( { name } ) {
44
44
  return null;
45
45
  }
46
46
 
47
- const settings = [
48
- {
49
- colorValue: linkColor,
50
- onColorChange: setLinkColor,
51
- label: __( 'Link color' ),
52
- clearable: linkColor === userLinkColor,
53
- },
54
- ];
55
-
56
47
  return (
57
48
  <>
58
49
  <ScreenHeader
@@ -62,16 +53,17 @@ function ScreenLinkColor( { name } ) {
62
53
  'Set the default color used for links across the site.'
63
54
  ) }
64
55
  />
65
-
66
- <PanelColorGradientSettings
67
- title={ __( 'Color' ) }
68
- settings={ settings }
56
+ <ColorGradientControl
57
+ className="edit-site-screen-link-color__control"
69
58
  colors={ colorsPerOrigin }
70
59
  disableCustomColors={ ! areCustomSolidsEnabled }
71
60
  __experimentalHasMultipleOrigins
72
61
  showTitle={ false }
73
62
  enableAlpha
74
63
  __experimentalIsRenderedInSidebar
64
+ colorValue={ linkColor }
65
+ onColorChange={ setLinkColor }
66
+ clearable={ linkColor === userLinkColor }
75
67
  />
76
68
  </>
77
69
  );
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { __ } from '@wordpress/i18n';
5
- import { __experimentalPanelColorGradientSettings as PanelColorGradientSettings } from '@wordpress/block-editor';
5
+ import { __experimentalColorGradientControl as ColorGradientControl } from '@wordpress/block-editor';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -36,15 +36,6 @@ function ScreenTextColor( { name } ) {
36
36
  return null;
37
37
  }
38
38
 
39
- const settings = [
40
- {
41
- colorValue: color,
42
- onColorChange: setColor,
43
- label: __( 'Text color' ),
44
- clearable: color === userColor,
45
- },
46
- ];
47
-
48
39
  return (
49
40
  <>
50
41
  <ScreenHeader
@@ -54,16 +45,17 @@ function ScreenTextColor( { name } ) {
54
45
  'Set the default color used for text across the site.'
55
46
  ) }
56
47
  />
57
-
58
- <PanelColorGradientSettings
59
- title={ __( 'Color' ) }
60
- settings={ settings }
48
+ <ColorGradientControl
49
+ className="edit-site-screen-text-color__control"
61
50
  colors={ colorsPerOrigin }
62
51
  disableCustomColors={ ! areCustomSolidsEnabled }
63
52
  __experimentalHasMultipleOrigins
64
53
  showTitle={ false }
65
54
  enableAlpha
66
55
  __experimentalIsRenderedInSidebar
56
+ colorValue={ color }
57
+ onColorChange={ setColor }
58
+ clearable={ color === userColor }
67
59
  />
68
60
  </>
69
61
  );