@wordpress/edit-site 4.0.1 → 4.1.0-next.e230fbab09.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 (174) hide show
  1. package/build/components/add-new-template/new-template-part.js +4 -1
  2. package/build/components/add-new-template/new-template-part.js.map +1 -1
  3. package/build/components/app/index.js +20 -0
  4. package/build/components/app/index.js.map +1 -1
  5. package/build/components/editor/global-styles-renderer.js +7 -3
  6. package/build/components/editor/global-styles-renderer.js.map +1 -1
  7. package/build/components/editor/index.js +3 -18
  8. package/build/components/editor/index.js.map +1 -1
  9. package/build/components/error-boundary/index.js +11 -27
  10. package/build/components/error-boundary/index.js.map +1 -1
  11. package/build/components/error-boundary/warning.js +70 -0
  12. package/build/components/error-boundary/warning.js.map +1 -0
  13. package/build/components/global-styles/navigation-button.js +7 -27
  14. package/build/components/global-styles/navigation-button.js.map +1 -1
  15. package/build/components/global-styles/screen-block-list.js +31 -1
  16. package/build/components/global-styles/screen-block-list.js.map +1 -1
  17. package/build/components/global-styles/screen-typography.js.map +1 -1
  18. package/build/components/global-styles/typography-panel.js +5 -2
  19. package/build/components/global-styles/typography-panel.js.map +1 -1
  20. package/build/components/global-styles/use-global-styles-output.js +21 -4
  21. package/build/components/global-styles/use-global-styles-output.js.map +1 -1
  22. package/build/components/global-styles/utils.js +2 -2
  23. package/build/components/global-styles/utils.js.map +1 -1
  24. package/build/components/header/index.js +1 -1
  25. package/build/components/header/index.js.map +1 -1
  26. package/build/components/header/more-menu/index.js +9 -21
  27. package/build/components/header/more-menu/index.js.map +1 -1
  28. package/build/components/header/more-menu/site-export.js +1 -1
  29. package/build/components/header/more-menu/site-export.js.map +1 -1
  30. package/build/components/header/more-menu/welcome-guide-menu-item.js +4 -8
  31. package/build/components/header/more-menu/welcome-guide-menu-item.js.map +1 -1
  32. package/build/components/keyboard-shortcuts/index.js +1 -1
  33. package/build/components/keyboard-shortcuts/index.js.map +1 -1
  34. package/build/components/list/table.js +9 -20
  35. package/build/components/list/table.js.map +1 -1
  36. package/build/components/navigation-sidebar/navigation-panel/index.js +9 -3
  37. package/build/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  38. package/build/components/navigation-sidebar/navigation-toggle/index.js +15 -4
  39. package/build/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  40. package/build/components/secondary-sidebar/list-view-sidebar.js +0 -11
  41. package/build/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  42. package/build/components/sidebar/global-styles-sidebar.js +5 -5
  43. package/build/components/sidebar/global-styles-sidebar.js.map +1 -1
  44. package/build/components/template-part-converter/convert-to-template-part.js +4 -1
  45. package/build/components/template-part-converter/convert-to-template-part.js.map +1 -1
  46. package/build/components/welcome-guide/editor.js +6 -6
  47. package/build/components/welcome-guide/editor.js.map +1 -1
  48. package/build/components/welcome-guide/styles.js +6 -4
  49. package/build/components/welcome-guide/styles.js.map +1 -1
  50. package/build/index.js +22 -7
  51. package/build/index.js.map +1 -1
  52. package/build/store/actions.js +203 -163
  53. package/build/store/actions.js.map +1 -1
  54. package/build/store/index.js +3 -9
  55. package/build/store/index.js.map +1 -1
  56. package/build/store/reducer.js +0 -44
  57. package/build/store/reducer.js.map +1 -1
  58. package/build/store/selectors.js +33 -10
  59. package/build/store/selectors.js.map +1 -1
  60. package/build-module/components/add-new-template/new-template-part.js +4 -1
  61. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  62. package/build-module/components/app/index.js +16 -0
  63. package/build-module/components/app/index.js.map +1 -1
  64. package/build-module/components/editor/global-styles-renderer.js +6 -3
  65. package/build-module/components/editor/global-styles-renderer.js.map +1 -1
  66. package/build-module/components/editor/index.js +4 -17
  67. package/build-module/components/editor/index.js.map +1 -1
  68. package/build-module/components/error-boundary/index.js +9 -26
  69. package/build-module/components/error-boundary/index.js.map +1 -1
  70. package/build-module/components/error-boundary/warning.js +60 -0
  71. package/build-module/components/error-boundary/warning.js.map +1 -0
  72. package/build-module/components/global-styles/navigation-button.js +8 -28
  73. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  74. package/build-module/components/global-styles/screen-block-list.js +31 -2
  75. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  76. package/build-module/components/global-styles/screen-typography.js.map +1 -1
  77. package/build-module/components/global-styles/typography-panel.js +6 -3
  78. package/build-module/components/global-styles/typography-panel.js.map +1 -1
  79. package/build-module/components/global-styles/use-global-styles-output.js +20 -4
  80. package/build-module/components/global-styles/use-global-styles-output.js.map +1 -1
  81. package/build-module/components/global-styles/utils.js +2 -2
  82. package/build-module/components/global-styles/utils.js.map +1 -1
  83. package/build-module/components/header/index.js +1 -1
  84. package/build-module/components/header/index.js.map +1 -1
  85. package/build-module/components/header/more-menu/index.js +11 -22
  86. package/build-module/components/header/more-menu/index.js.map +1 -1
  87. package/build-module/components/header/more-menu/site-export.js +1 -1
  88. package/build-module/components/header/more-menu/site-export.js.map +1 -1
  89. package/build-module/components/header/more-menu/welcome-guide-menu-item.js +4 -8
  90. package/build-module/components/header/more-menu/welcome-guide-menu-item.js.map +1 -1
  91. package/build-module/components/keyboard-shortcuts/index.js +1 -1
  92. package/build-module/components/keyboard-shortcuts/index.js.map +1 -1
  93. package/build-module/components/list/table.js +9 -21
  94. package/build-module/components/list/table.js.map +1 -1
  95. package/build-module/components/navigation-sidebar/navigation-panel/index.js +9 -3
  96. package/build-module/components/navigation-sidebar/navigation-panel/index.js.map +1 -1
  97. package/build-module/components/navigation-sidebar/navigation-toggle/index.js +12 -4
  98. package/build-module/components/navigation-sidebar/navigation-toggle/index.js.map +1 -1
  99. package/build-module/components/secondary-sidebar/list-view-sidebar.js +1 -12
  100. package/build-module/components/secondary-sidebar/list-view-sidebar.js.map +1 -1
  101. package/build-module/components/sidebar/global-styles-sidebar.js +4 -4
  102. package/build-module/components/sidebar/global-styles-sidebar.js.map +1 -1
  103. package/build-module/components/template-part-converter/convert-to-template-part.js +4 -1
  104. package/build-module/components/template-part-converter/convert-to-template-part.js.map +1 -1
  105. package/build-module/components/welcome-guide/editor.js +5 -5
  106. package/build-module/components/welcome-guide/editor.js.map +1 -1
  107. package/build-module/components/welcome-guide/styles.js +5 -4
  108. package/build-module/components/welcome-guide/styles.js.map +1 -1
  109. package/build-module/index.js +20 -7
  110. package/build-module/index.js.map +1 -1
  111. package/build-module/store/actions.js +181 -154
  112. package/build-module/store/actions.js.map +1 -1
  113. package/build-module/store/index.js +4 -9
  114. package/build-module/store/index.js.map +1 -1
  115. package/build-module/store/reducer.js +0 -40
  116. package/build-module/store/reducer.js.map +1 -1
  117. package/build-module/store/selectors.js +28 -10
  118. package/build-module/store/selectors.js.map +1 -1
  119. package/build-style/style-rtl.css +102 -39
  120. package/build-style/style.css +102 -39
  121. package/package.json +33 -27
  122. package/src/components/add-new-template/new-template-part.js +7 -1
  123. package/src/components/app/index.js +19 -0
  124. package/src/components/editor/global-styles-renderer.js +7 -1
  125. package/src/components/editor/index.js +2 -20
  126. package/src/components/error-boundary/index.js +11 -28
  127. package/src/components/error-boundary/warning.js +59 -0
  128. package/src/components/global-styles/navigation-button.js +6 -25
  129. package/src/components/global-styles/screen-block-list.js +27 -2
  130. package/src/components/global-styles/screen-typography.js +1 -2
  131. package/src/components/global-styles/typography-panel.js +12 -5
  132. package/src/components/global-styles/use-global-styles-output.js +19 -3
  133. package/src/components/global-styles/utils.js +2 -2
  134. package/src/components/header/index.js +1 -1
  135. package/src/components/header/more-menu/index.js +12 -29
  136. package/src/components/header/more-menu/site-export.js +1 -1
  137. package/src/components/header/more-menu/welcome-guide-menu-item.js +3 -7
  138. package/src/components/keyboard-shortcuts/index.js +1 -1
  139. package/src/components/list/table.js +18 -23
  140. package/src/components/navigation-sidebar/navigation-panel/index.js +16 -11
  141. package/src/components/navigation-sidebar/navigation-toggle/index.js +13 -4
  142. package/src/components/navigation-sidebar/navigation-toggle/style.scss +32 -31
  143. package/src/components/navigation-sidebar/navigation-toggle/test/index.js +1 -1
  144. package/src/components/secondary-sidebar/list-view-sidebar.js +1 -11
  145. package/src/components/sidebar/global-styles-sidebar.js +6 -3
  146. package/src/components/sidebar/style.scss +1 -1
  147. package/src/components/template-part-converter/convert-to-template-part.js +6 -1
  148. package/src/components/welcome-guide/editor.js +8 -4
  149. package/src/components/welcome-guide/styles.js +5 -3
  150. package/src/index.js +25 -7
  151. package/src/store/actions.js +180 -215
  152. package/src/store/index.js +2 -8
  153. package/src/store/reducer.js +0 -30
  154. package/src/store/selectors.js +37 -10
  155. package/src/store/test/actions.js +203 -92
  156. package/src/store/test/reducer.js +0 -22
  157. package/src/store/test/selectors.js +22 -53
  158. package/src/style.scss +0 -1
  159. package/build/components/header/feature-toggle/index.js +0 -66
  160. package/build/components/header/feature-toggle/index.js.map +0 -1
  161. package/build/components/routes/redirect-to-homepage.js +0 -87
  162. package/build/components/routes/redirect-to-homepage.js.map +0 -1
  163. package/build/store/defaults.js +0 -15
  164. package/build/store/defaults.js.map +0 -1
  165. package/build-module/components/header/feature-toggle/index.js +0 -52
  166. package/build-module/components/header/feature-toggle/index.js.map +0 -1
  167. package/build-module/components/routes/redirect-to-homepage.js +0 -75
  168. package/build-module/components/routes/redirect-to-homepage.js.map +0 -1
  169. package/build-module/store/defaults.js +0 -8
  170. package/build-module/store/defaults.js.map +0 -1
  171. package/src/components/header/feature-toggle/index.js +0 -55
  172. package/src/components/header/more-menu/style.scss +0 -29
  173. package/src/components/routes/redirect-to-homepage.js +0 -71
  174. package/src/store/defaults.js +0 -7
@@ -304,7 +304,7 @@ body.is-fullscreen-mode .interface-interface-skeleton {
304
304
  display: flex;
305
305
  flex-direction: column;
306
306
  overflow: auto;
307
- z-index: 20;
307
+ z-index: 91;
308
308
  }
309
309
 
310
310
  .interface-interface-skeleton__secondary-sidebar,
@@ -447,6 +447,95 @@ body.is-fullscreen-mode .interface-interface-skeleton {
447
447
  max-height: 24px;
448
448
  }
449
449
 
450
+ @media (min-width: 600px) {
451
+ .interface-preferences-modal {
452
+ width: calc(100% - 32px);
453
+ height: calc(100% - 120px);
454
+ }
455
+ }
456
+ @media (min-width: 782px) {
457
+ .interface-preferences-modal {
458
+ width: 750px;
459
+ }
460
+ }
461
+ @media (min-width: 960px) {
462
+ .interface-preferences-modal {
463
+ height: 70%;
464
+ }
465
+ }
466
+ @media (max-width: 781px) {
467
+ .interface-preferences-modal .components-modal__content {
468
+ padding: 0;
469
+ }
470
+ .interface-preferences-modal .components-modal__content::before {
471
+ content: none;
472
+ }
473
+ }
474
+
475
+ .interface-preferences__tabs .components-tab-panel__tabs {
476
+ position: absolute;
477
+ top: 84px;
478
+ left: 16px;
479
+ width: 160px;
480
+ }
481
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item {
482
+ border-radius: 2px;
483
+ font-weight: 400;
484
+ }
485
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item.is-active {
486
+ background: #f0f0f0;
487
+ box-shadow: none;
488
+ font-weight: 500;
489
+ }
490
+ .interface-preferences__tabs .components-tab-panel__tabs .components-tab-panel__tabs-item:focus:not(:disabled) {
491
+ box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
492
+ }
493
+ .interface-preferences__tabs .components-tab-panel__tab-content {
494
+ padding-left: 24px;
495
+ margin-left: 160px;
496
+ }
497
+
498
+ @media (max-width: 781px) {
499
+ .interface-preferences__provider {
500
+ height: 100%;
501
+ }
502
+ }
503
+ .interface-preferences-modal__section {
504
+ margin: 0 0 2.5rem 0;
505
+ }
506
+ .interface-preferences-modal__section:last-child {
507
+ margin: 0;
508
+ }
509
+
510
+ .interface-preferences-modal__section-title {
511
+ font-size: 0.9rem;
512
+ font-weight: 600;
513
+ margin-top: 0;
514
+ }
515
+
516
+ .interface-preferences-modal__section-description {
517
+ margin: -8px 0 8px 0;
518
+ font-size: 12px;
519
+ font-style: normal;
520
+ color: #757575;
521
+ }
522
+
523
+ .interface-preferences-modal__option .components-base-control .components-base-control__field {
524
+ align-items: center;
525
+ display: flex;
526
+ margin-bottom: 0;
527
+ }
528
+ .interface-preferences-modal__option .components-base-control .components-base-control__field > label {
529
+ flex-grow: 1;
530
+ padding: 0.6rem 0 0.6rem 10px;
531
+ }
532
+ .interface-preferences-modal__option .components-base-control__help {
533
+ margin: -8px 0 8px 58px;
534
+ font-size: 12px;
535
+ font-style: normal;
536
+ color: #757575;
537
+ }
538
+
450
539
  .edit-site-block-editor__editor-styles-wrapper .components-button {
451
540
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
452
541
  font-size: 13px;
@@ -916,33 +1005,6 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
916
1005
  min-width: 240px;
917
1006
  }
918
1007
 
919
- .edit-site-more-menu {
920
- margin-left: -4px;
921
- }
922
- .edit-site-more-menu .components-button {
923
- width: auto;
924
- padding: 0 2px;
925
- }
926
- @media (min-width: 600px) {
927
- .edit-site-more-menu {
928
- margin-left: 4px;
929
- }
930
- .edit-site-more-menu .components-button {
931
- padding: 0 4px;
932
- }
933
- }
934
-
935
- .edit-site-more-menu__content .components-popover__content {
936
- min-width: 260px;
937
- }
938
- .edit-site-more-menu__content .components-popover__content .components-dropdown-menu__menu {
939
- padding: 0;
940
- }
941
-
942
- .components-popover.edit-site-more-menu__content {
943
- z-index: 99998;
944
- }
945
-
946
1008
  .edit-site-navigation-toggle {
947
1009
  align-items: center;
948
1010
  background: #1e1e1e;
@@ -954,7 +1016,7 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
954
1016
  width: 60px;
955
1017
  }
956
1018
 
957
- .edit-site-navigation-toggle__button {
1019
+ .edit-site-navigation-toggle__button.components-button {
958
1020
  align-items: center;
959
1021
  background: #1e1e1e;
960
1022
  border-radius: 0;
@@ -963,17 +1025,15 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
963
1025
  width: 60px;
964
1026
  z-index: 1;
965
1027
  margin-bottom: -1px;
966
- }
967
- .edit-site-navigation-toggle__button.has-icon {
968
1028
  min-width: 60px;
969
1029
  }
970
- .edit-site-navigation-toggle__button.has-icon:hover, .edit-site-navigation-toggle__button.has-icon:active {
1030
+ .edit-site-navigation-toggle__button.components-button:hover, .edit-site-navigation-toggle__button.components-button:active {
971
1031
  color: #fff;
972
1032
  }
973
- .edit-site-navigation-toggle__button.has-icon:focus {
1033
+ .edit-site-navigation-toggle__button.components-button:focus {
974
1034
  box-shadow: none;
975
1035
  }
976
- .edit-site-navigation-toggle__button.has-icon::before {
1036
+ .edit-site-navigation-toggle__button.components-button::before {
977
1037
  transition: box-shadow 0.1s ease;
978
1038
  content: "";
979
1039
  display: block;
@@ -986,18 +1046,21 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
986
1046
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #1e1e1e;
987
1047
  }
988
1048
  @media (prefers-reduced-motion: reduce) {
989
- .edit-site-navigation-toggle__button.has-icon::before {
1049
+ .edit-site-navigation-toggle__button.components-button::before {
990
1050
  transition-duration: 0s;
991
1051
  transition-delay: 0s;
992
1052
  }
993
1053
  }
994
- .edit-site-navigation-toggle__button.has-icon:hover::before {
1054
+ .edit-site-navigation-toggle__button.components-button:hover::before {
995
1055
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) #757575;
996
1056
  }
997
- .edit-site-navigation-toggle__button.has-icon:focus::before {
1057
+ .edit-site-navigation-toggle__button.components-button.has-icon:hover::before {
1058
+ box-shadow: none;
1059
+ }
1060
+ .edit-site-navigation-toggle__button.components-button:focus::before {
998
1061
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) rgba(255, 255, 255, 0.1), inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
999
1062
  }
1000
- .edit-site-navigation-toggle__button .edit-site-navigation-toggle__site-icon {
1063
+ .edit-site-navigation-toggle__button.components-button .edit-site-navigation-toggle__site-icon {
1001
1064
  width: 36px;
1002
1065
  height: 36px;
1003
1066
  border-radius: 2px;
@@ -1383,7 +1446,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1383
1446
  .edit-site-global-styles-sidebar {
1384
1447
  display: flex;
1385
1448
  flex-direction: column;
1386
- height: 100%;
1449
+ min-height: 100%;
1387
1450
  }
1388
1451
  .edit-site-global-styles-sidebar__panel, .edit-site-global-styles-sidebar__navigator-provider {
1389
1452
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "4.0.1",
3
+ "version": "4.1.0-next.e230fbab09.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,31 +27,33 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.3.1",
31
- "@wordpress/api-fetch": "^6.0.1",
32
- "@wordpress/block-editor": "^8.1.2",
33
- "@wordpress/block-library": "^7.0.1",
34
- "@wordpress/blocks": "^11.2.1",
35
- "@wordpress/components": "^19.4.1",
36
- "@wordpress/compose": "^5.1.1",
37
- "@wordpress/core-data": "^4.1.1",
38
- "@wordpress/data": "^6.2.1",
39
- "@wordpress/data-controls": "^2.3.1",
40
- "@wordpress/editor": "^12.2.1",
41
- "@wordpress/element": "^4.1.1",
42
- "@wordpress/hooks": "^3.3.1",
43
- "@wordpress/html-entities": "^3.3.1",
44
- "@wordpress/i18n": "^4.3.1",
45
- "@wordpress/icons": "^7.0.0",
46
- "@wordpress/interface": "^4.2.2",
47
- "@wordpress/keyboard-shortcuts": "^3.1.1",
48
- "@wordpress/keycodes": "^3.3.1",
49
- "@wordpress/media-utils": "^3.1.1",
50
- "@wordpress/notices": "^3.3.1",
51
- "@wordpress/plugins": "^4.1.2",
52
- "@wordpress/reusable-blocks": "^3.1.2",
53
- "@wordpress/url": "^3.4.1",
54
- "@wordpress/viewport": "^4.1.1",
30
+ "@wordpress/a11y": "^3.4.0-next.e230fbab09.0",
31
+ "@wordpress/api-fetch": "^6.1.0-next.e230fbab09.0",
32
+ "@wordpress/block-editor": "^8.3.0-next.e230fbab09.0",
33
+ "@wordpress/block-library": "^7.1.0-next.e230fbab09.0",
34
+ "@wordpress/blocks": "^11.3.0-next.e230fbab09.0",
35
+ "@wordpress/components": "^19.7.0-next.e230fbab09.0",
36
+ "@wordpress/compose": "^5.2.0-next.e230fbab09.0",
37
+ "@wordpress/core-data": "^4.2.0-next.e230fbab09.0",
38
+ "@wordpress/data": "^6.4.0-next.e230fbab09.0",
39
+ "@wordpress/deprecated": "^3.4.0-next.e230fbab09.0",
40
+ "@wordpress/editor": "^12.4.0-next.e230fbab09.0",
41
+ "@wordpress/element": "^4.3.0-next.e230fbab09.0",
42
+ "@wordpress/hooks": "^3.4.0-next.e230fbab09.0",
43
+ "@wordpress/html-entities": "^3.4.0-next.e230fbab09.0",
44
+ "@wordpress/i18n": "^4.4.0-next.e230fbab09.0",
45
+ "@wordpress/icons": "^7.1.0-next.e230fbab09.0",
46
+ "@wordpress/interface": "^4.3.0-next.e230fbab09.0",
47
+ "@wordpress/keyboard-shortcuts": "^3.2.0-next.e230fbab09.0",
48
+ "@wordpress/keycodes": "^3.4.0-next.e230fbab09.0",
49
+ "@wordpress/media-utils": "^3.2.0-next.e230fbab09.0",
50
+ "@wordpress/notices": "^3.4.0-next.e230fbab09.0",
51
+ "@wordpress/plugins": "^4.2.0-next.e230fbab09.0",
52
+ "@wordpress/preferences": "^1.0.0-prerelease",
53
+ "@wordpress/reusable-blocks": "^3.2.0-next.e230fbab09.0",
54
+ "@wordpress/style-engine": "^0.3.0-next.e230fbab09.0",
55
+ "@wordpress/url": "^3.5.0-next.e230fbab09.0",
56
+ "@wordpress/viewport": "^4.2.0-next.e230fbab09.0",
55
57
  "classnames": "^2.3.1",
56
58
  "downloadjs": "^1.4.7",
57
59
  "history": "^5.1.0",
@@ -59,8 +61,12 @@
59
61
  "react-autosize-textarea": "^7.1.0",
60
62
  "rememo": "^3.0.0"
61
63
  },
64
+ "peerDependencies": {
65
+ "react": "^17.0.0",
66
+ "react-dom": "^17.0.0"
67
+ },
62
68
  "publishConfig": {
63
69
  "access": "public"
64
70
  },
65
- "gitHead": "0f838547f37472e46e6d5a9d2e84b6c61f4bd3f0"
71
+ "gitHead": "308df03e6a96ded732f9c4e32471b1b4f8dea54a"
66
72
  }
@@ -35,11 +35,17 @@ export default function NewTemplatePart( { postType } ) {
35
35
  }
36
36
 
37
37
  try {
38
+ // Currently template parts only allow latin chars.
39
+ // Fallback slug will receive suffix by default.
40
+ const cleanSlug =
41
+ kebabCase( title ).replace( /[^\w-]+/g, '' ) ||
42
+ 'wp-custom-part';
43
+
38
44
  const templatePart = await saveEntityRecord(
39
45
  'postType',
40
46
  'wp_template_part',
41
47
  {
42
- slug: kebabCase( title ),
48
+ slug: cleanSlug,
43
49
  title,
44
50
  content: '',
45
51
  area,
@@ -3,6 +3,10 @@
3
3
  */
4
4
  import { SlotFillProvider } from '@wordpress/components';
5
5
  import { UnsavedChangesWarning } from '@wordpress/editor';
6
+ import { store as noticesStore } from '@wordpress/notices';
7
+ import { useDispatch } from '@wordpress/data';
8
+ import { __, sprintf } from '@wordpress/i18n';
9
+ import { PluginArea } from '@wordpress/plugins';
6
10
 
7
11
  /**
8
12
  * Internal dependencies
@@ -14,6 +18,20 @@ import NavigationSidebar from '../navigation-sidebar';
14
18
  import getIsListPage from '../../utils/get-is-list-page';
15
19
 
16
20
  export default function EditSiteApp( { reboot } ) {
21
+ const { createErrorNotice } = useDispatch( noticesStore );
22
+
23
+ function onPluginAreaError( name ) {
24
+ createErrorNotice(
25
+ sprintf(
26
+ /* translators: %s: plugin name */
27
+ __(
28
+ 'The "%s" plugin has encountered an error and cannot be rendered.'
29
+ ),
30
+ name
31
+ )
32
+ );
33
+ }
34
+
17
35
  return (
18
36
  <SlotFillProvider>
19
37
  <UnsavedChangesWarning />
@@ -29,6 +47,7 @@ export default function EditSiteApp( { reboot } ) {
29
47
  ) : (
30
48
  <Editor onError={ reboot } />
31
49
  ) }
50
+ <PluginArea onError={ onPluginAreaError } />
32
51
  { /* Keep the instance of the sidebar to ensure focus will not be lost
33
52
  * when navigating to other pages. */ }
34
53
  <NavigationSidebar
@@ -1,3 +1,8 @@
1
+ /**
2
+ * External dependencies
3
+ */
4
+ import { filter } from 'lodash';
5
+
1
6
  /**
2
7
  * WordPress dependencies
3
8
  */
@@ -25,7 +30,8 @@ function useGlobalStylesRenderer() {
25
30
  }
26
31
 
27
32
  const currentStoreSettings = getSettings();
28
- const nonGlobalStyles = currentStoreSettings?.styles?.filter(
33
+ const nonGlobalStyles = filter(
34
+ currentStoreSettings.styles,
29
35
  ( style ) => ! style.isGlobalStyles
30
36
  );
31
37
  updateSettings( {
@@ -16,13 +16,11 @@ import {
16
16
  EditorSnackbars,
17
17
  EntitiesSavedStates,
18
18
  } from '@wordpress/editor';
19
- import { __, sprintf } from '@wordpress/i18n';
20
- import { PluginArea } from '@wordpress/plugins';
19
+ import { __ } from '@wordpress/i18n';
21
20
  import {
22
21
  ShortcutProvider,
23
22
  store as keyboardShortcutsStore,
24
23
  } from '@wordpress/keyboard-shortcuts';
25
- import { store as noticesStore } from '@wordpress/notices';
26
24
 
27
25
  /**
28
26
  * Internal dependencies
@@ -111,7 +109,6 @@ function Editor( { onError } ) {
111
109
  }, [] );
112
110
  const { setPage, setIsInserterOpened } = useDispatch( editSiteStore );
113
111
  const { enableComplementaryArea } = useDispatch( interfaceStore );
114
- const { createErrorNotice } = useDispatch( noticesStore );
115
112
 
116
113
  const [
117
114
  isEntitiesSavedStatesOpen,
@@ -167,7 +164,7 @@ function Editor( { onError } ) {
167
164
  [ enableComplementaryArea ]
168
165
  );
169
166
 
170
- // Don't render the Editor until the settings are set and loaded
167
+ // Don't render the Editor until the settings are set and loaded.
171
168
  const isReady =
172
169
  settings?.siteUrl &&
173
170
  templateType !== undefined &&
@@ -183,18 +180,6 @@ function Editor( { onError } ) {
183
180
  return null;
184
181
  };
185
182
 
186
- function onPluginAreaError( name ) {
187
- createErrorNotice(
188
- sprintf(
189
- /* translators: %s: plugin name */
190
- __(
191
- 'The "%s" plugin has encountered an error and cannot be rendered.'
192
- ),
193
- name
194
- )
195
- );
196
- }
197
-
198
183
  // Only announce the title once the editor is ready to prevent "Replace"
199
184
  // action in <URlQueryController> from double-announcing.
200
185
  useTitle( isReady && __( 'Editor (beta)' ) );
@@ -314,9 +299,6 @@ function Editor( { onError } ) {
314
299
  />
315
300
  <WelcomeGuide />
316
301
  <Popover.Slot />
317
- <PluginArea
318
- onError={ onPluginAreaError }
319
- />
320
302
  </ErrorBoundary>
321
303
  </BlockContextProvider>
322
304
  </GlobalStylesProvider>
@@ -3,18 +3,11 @@
3
3
  */
4
4
  import { Component } from '@wordpress/element';
5
5
  import { __ } from '@wordpress/i18n';
6
- import { Button } from '@wordpress/components';
7
- import { Warning } from '@wordpress/block-editor';
8
- import { useCopyToClipboard } from '@wordpress/compose';
9
6
 
10
- function CopyButton( { text, children } ) {
11
- const ref = useCopyToClipboard( text );
12
- return (
13
- <Button variant="secondary" ref={ ref }>
14
- { children }
15
- </Button>
16
- );
17
- }
7
+ /**
8
+ * Internal dependencies
9
+ */
10
+ import ErrorBoundaryWarning from './warning';
18
11
 
19
12
  export default class ErrorBoundary extends Component {
20
13
  constructor() {
@@ -42,23 +35,13 @@ export default class ErrorBoundary extends Component {
42
35
  }
43
36
 
44
37
  return (
45
- <Warning
46
- className="editor-error-boundary"
47
- actions={ [
48
- <Button
49
- key="recovery"
50
- onClick={ this.reboot }
51
- variant="secondary"
52
- >
53
- { __( 'Attempt Recovery' ) }
54
- </Button>,
55
- <CopyButton key="copy-error" text={ error.stack }>
56
- { __( 'Copy Error' ) }
57
- </CopyButton>,
58
- ] }
59
- >
60
- { __( 'The editor has encountered an unexpected error.' ) }
61
- </Warning>
38
+ <ErrorBoundaryWarning
39
+ message={ __(
40
+ 'The editor has encountered an unexpected error.'
41
+ ) }
42
+ error={ error }
43
+ reboot={ this.reboot }
44
+ />
62
45
  );
63
46
  }
64
47
  }
@@ -0,0 +1,59 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { __ } from '@wordpress/i18n';
5
+ import { Button } from '@wordpress/components';
6
+ import { Warning } from '@wordpress/block-editor';
7
+ import { useCopyToClipboard } from '@wordpress/compose';
8
+
9
+ function CopyButton( { text, children } ) {
10
+ const ref = useCopyToClipboard( text );
11
+ return (
12
+ <Button variant="secondary" ref={ ref }>
13
+ { children }
14
+ </Button>
15
+ );
16
+ }
17
+
18
+ export default function ErrorBoundaryWarning( {
19
+ message,
20
+ error,
21
+ reboot,
22
+ dashboardLink,
23
+ } ) {
24
+ const actions = [];
25
+
26
+ if ( reboot ) {
27
+ actions.push(
28
+ <Button key="recovery" onClick={ reboot } variant="secondary">
29
+ { __( 'Attempt Recovery' ) }
30
+ </Button>
31
+ );
32
+ }
33
+
34
+ if ( error ) {
35
+ actions.push(
36
+ <CopyButton key="copy-error" text={ error.stack }>
37
+ { __( 'Copy Error' ) }
38
+ </CopyButton>
39
+ );
40
+ }
41
+
42
+ if ( dashboardLink ) {
43
+ actions.push(
44
+ <Button
45
+ key="back-to-dashboard"
46
+ variant="secondary"
47
+ href={ dashboardLink }
48
+ >
49
+ { __( 'Back to dashboard' ) }
50
+ </Button>
51
+ );
52
+ }
53
+
54
+ return (
55
+ <Warning className="editor-error-boundary" actions={ actions }>
56
+ { message }
57
+ </Warning>
58
+ );
59
+ }
@@ -2,7 +2,8 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import {
5
- __experimentalUseNavigator as useNavigator,
5
+ __experimentalNavigatorButton as NavigatorButton,
6
+ __experimentalNavigatorBackButton as NavigatorBackButton,
6
7
  __experimentalItem as Item,
7
8
  FlexItem,
8
9
  __experimentalHStack as HStack,
@@ -25,32 +26,12 @@ function GenericNavigationButton( { icon, children, ...props } ) {
25
26
  );
26
27
  }
27
28
 
28
- function NavigationButton( { path, ...props } ) {
29
- const { goTo } = useNavigator();
30
-
31
- const dataAttrName = 'data-navigator-focusable-id';
32
- const dataAttrValue = path;
33
-
34
- const dataAttrCssSelector = `[${ dataAttrName }="${ dataAttrValue }"]`;
35
-
36
- const buttonProps = {
37
- ...props,
38
- [ dataAttrName ]: dataAttrValue,
39
- };
40
-
41
- return (
42
- <GenericNavigationButton
43
- onClick={ () =>
44
- goTo( path, { focusTargetSelector: dataAttrCssSelector } )
45
- }
46
- { ...buttonProps }
47
- />
48
- );
29
+ function NavigationButton( props ) {
30
+ return <NavigatorButton as={ GenericNavigationButton } { ...props } />;
49
31
  }
50
32
 
51
- function NavigationBackButton( { ...props } ) {
52
- const { goBack } = useNavigator();
53
- return <GenericNavigationButton onClick={ goBack } { ...props } />;
33
+ function NavigationBackButton( props ) {
34
+ return <NavigatorBackButton as={ GenericNavigationButton } { ...props } />;
54
35
  }
55
36
 
56
37
  export { NavigationButton, NavigationBackButton };
@@ -1,7 +1,8 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { getBlockTypes } from '@wordpress/blocks';
4
+ import { store as blocksStore } from '@wordpress/blocks';
5
+ import { useSelect } from '@wordpress/data';
5
6
  import { __ } from '@wordpress/i18n';
6
7
  import {
7
8
  FlexItem,
@@ -19,6 +20,29 @@ import { useHasTypographyPanel } from './typography-panel';
19
20
  import ScreenHeader from './header';
20
21
  import { NavigationButton } from './navigation-button';
21
22
 
23
+ function useSortedBlockTypes() {
24
+ const blockItems = useSelect(
25
+ ( select ) => select( blocksStore ).getBlockTypes(),
26
+ []
27
+ );
28
+ // Ensure core blocks are prioritized in the returned results,
29
+ // because third party blocks can be registered earlier than
30
+ // the core blocks (usually by using the `init` action),
31
+ // thus affecting the display order.
32
+ // We don't sort reusable blocks as they are handled differently.
33
+ const groupByType = ( blocks, block ) => {
34
+ const { core, noncore } = blocks;
35
+ const type = block.name.startsWith( 'core/' ) ? core : noncore;
36
+ type.push( block );
37
+ return blocks;
38
+ };
39
+ const {
40
+ core: coreItems,
41
+ noncore: nonCoreItems,
42
+ } = blockItems.reduce( groupByType, { core: [], noncore: [] } );
43
+ return [ ...coreItems, ...nonCoreItems ];
44
+ }
45
+
22
46
  function BlockMenuItem( { block } ) {
23
47
  const hasTypographyPanel = useHasTypographyPanel( block.name );
24
48
  const hasColorPanel = useHasColorPanel( block.name );
@@ -45,6 +69,7 @@ function BlockMenuItem( { block } ) {
45
69
  }
46
70
 
47
71
  function ScreenBlockList() {
72
+ const sortedBlockTypes = useSortedBlockTypes();
48
73
  return (
49
74
  <>
50
75
  <ScreenHeader
@@ -53,7 +78,7 @@ function ScreenBlockList() {
53
78
  'Customize the appearance of specific blocks and for the whole site.'
54
79
  ) }
55
80
  />
56
- { getBlockTypes().map( ( block ) => (
81
+ { sortedBlockTypes.map( ( block ) => (
57
82
  <BlockMenuItem
58
83
  block={ block }
59
84
  key={ 'menu-itemblock-' + block.name }
@@ -99,8 +99,7 @@ function ScreenTypography( { name } ) {
99
99
  </VStack>
100
100
  </div>
101
101
  ) }
102
-
103
- { /* no typography elements support yet for blocks */ }
102
+ { /* No typography elements support yet for blocks. */ }
104
103
  { !! name && <TypographyPanel name={ name } element="text" /> }
105
104
  </>
106
105
  );
@@ -7,7 +7,11 @@ import {
7
7
  __experimentalFontAppearanceControl as FontAppearanceControl,
8
8
  __experimentalLetterSpacingControl as LetterSpacingControl,
9
9
  } from '@wordpress/block-editor';
10
- import { PanelBody, FontSizePicker } from '@wordpress/components';
10
+ import {
11
+ PanelBody,
12
+ FontSizePicker,
13
+ __experimentalSpacer as Spacer,
14
+ } from '@wordpress/components';
11
15
 
12
16
  /**
13
17
  * Internal dependencies
@@ -143,10 +147,13 @@ export default function TypographyPanel( { name, element } ) {
143
147
  />
144
148
  ) }
145
149
  { hasLineHeightEnabled && (
146
- <LineHeightControl
147
- value={ lineHeight }
148
- onChange={ setLineHeight }
149
- />
150
+ <Spacer marginBottom={ 6 }>
151
+ <LineHeightControl
152
+ __nextHasNoMarginBottom={ true }
153
+ value={ lineHeight }
154
+ onChange={ setLineHeight }
155
+ />
156
+ </Spacer>
150
157
  ) }
151
158
  { hasAppearanceControl && (
152
159
  <FontAppearanceControl