@wordpress/edit-site 4.1.0 → 4.3.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 (170) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/components/add-new-template/new-template-part.js +2 -9
  3. package/build/components/add-new-template/new-template-part.js.map +1 -1
  4. package/build/components/add-new-template/new-template.js +28 -12
  5. package/build/components/add-new-template/new-template.js.map +1 -1
  6. package/build/components/block-editor/index.js +53 -4
  7. package/build/components/block-editor/index.js.map +1 -1
  8. package/build/components/editor/index.js +9 -3
  9. package/build/components/editor/index.js.map +1 -1
  10. package/build/components/global-styles/border-panel.js +25 -24
  11. package/build/components/global-styles/border-panel.js.map +1 -1
  12. package/build/components/global-styles/color-indicator-wrapper.js +37 -0
  13. package/build/components/global-styles/color-indicator-wrapper.js.map +1 -0
  14. package/build/components/global-styles/dimensions-panel.js +6 -2
  15. package/build/components/global-styles/dimensions-panel.js.map +1 -1
  16. package/build/components/global-styles/header.js +1 -4
  17. package/build/components/global-styles/header.js.map +1 -1
  18. package/build/components/global-styles/icon-with-current-color.js +34 -0
  19. package/build/components/global-styles/icon-with-current-color.js.map +1 -0
  20. package/build/components/global-styles/navigation-button.js +7 -3
  21. package/build/components/global-styles/navigation-button.js.map +1 -1
  22. package/build/components/global-styles/palette.js +8 -5
  23. package/build/components/global-styles/palette.js.map +1 -1
  24. package/build/components/global-styles/preview.js +142 -26
  25. package/build/components/global-styles/preview.js.map +1 -1
  26. package/build/components/global-styles/screen-block-list.js +2 -2
  27. package/build/components/global-styles/screen-block-list.js.map +1 -1
  28. package/build/components/global-styles/screen-colors.js +11 -3
  29. package/build/components/global-styles/screen-colors.js.map +1 -1
  30. package/build/components/global-styles/screen-root.js +7 -5
  31. package/build/components/global-styles/screen-root.js.map +1 -1
  32. package/build/components/global-styles/screen-style-variations.js +12 -5
  33. package/build/components/global-styles/screen-style-variations.js.map +1 -1
  34. package/build/components/header/document-actions/index.js +13 -11
  35. package/build/components/header/document-actions/index.js.map +1 -1
  36. package/build/components/header/index.js +5 -3
  37. package/build/components/header/index.js.map +1 -1
  38. package/build/components/header/more-menu/index.js +9 -1
  39. package/build/components/header/more-menu/index.js.map +1 -1
  40. package/build/components/header/more-menu/site-export.js +5 -2
  41. package/build/components/header/more-menu/site-export.js.map +1 -1
  42. package/build/components/header/plugin-more-menu-item/index.js +5 -0
  43. package/build/components/header/plugin-more-menu-item/index.js.map +1 -1
  44. package/build/components/list/actions/rename-menu-item.js +3 -10
  45. package/build/components/list/actions/rename-menu-item.js.map +1 -1
  46. package/build/components/preferences-modal/enable-feature.js +40 -0
  47. package/build/components/preferences-modal/enable-feature.js.map +1 -0
  48. package/build/components/preferences-modal/index.js +68 -0
  49. package/build/components/preferences-modal/index.js.map +1 -0
  50. package/build/components/sidebar/index.js +12 -1
  51. package/build/components/sidebar/index.js.map +1 -1
  52. package/build/components/sidebar/navigation-menu-sidebar/index.js +40 -0
  53. package/build/components/sidebar/navigation-menu-sidebar/index.js.map +1 -0
  54. package/build/components/sidebar/navigation-menu-sidebar/navigation-inspector.js +185 -0
  55. package/build/components/sidebar/navigation-menu-sidebar/navigation-inspector.js.map +1 -0
  56. package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js +54 -0
  57. package/build/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -0
  58. package/build/components/template-part-converter/convert-to-regular.js +6 -0
  59. package/build/components/template-part-converter/convert-to-regular.js.map +1 -1
  60. package/build/index.js +1 -0
  61. package/build/index.js.map +1 -1
  62. package/build/store/actions.js +3 -3
  63. package/build/store/actions.js.map +1 -1
  64. package/build/store/selectors.js +3 -1
  65. package/build/store/selectors.js.map +1 -1
  66. package/build-module/components/add-new-template/new-template-part.js +3 -10
  67. package/build-module/components/add-new-template/new-template-part.js.map +1 -1
  68. package/build-module/components/add-new-template/new-template.js +27 -12
  69. package/build-module/components/add-new-template/new-template.js.map +1 -1
  70. package/build-module/components/block-editor/index.js +51 -6
  71. package/build-module/components/block-editor/index.js.map +1 -1
  72. package/build-module/components/editor/index.js +8 -3
  73. package/build-module/components/editor/index.js.map +1 -1
  74. package/build-module/components/global-styles/border-panel.js +27 -26
  75. package/build-module/components/global-styles/border-panel.js.map +1 -1
  76. package/build-module/components/global-styles/color-indicator-wrapper.js +25 -0
  77. package/build-module/components/global-styles/color-indicator-wrapper.js.map +1 -0
  78. package/build-module/components/global-styles/dimensions-panel.js +6 -2
  79. package/build-module/components/global-styles/dimensions-panel.js.map +1 -1
  80. package/build-module/components/global-styles/header.js +2 -5
  81. package/build-module/components/global-styles/header.js.map +1 -1
  82. package/build-module/components/global-styles/icon-with-current-color.js +22 -0
  83. package/build-module/components/global-styles/icon-with-current-color.js.map +1 -0
  84. package/build-module/components/global-styles/navigation-button.js +7 -3
  85. package/build-module/components/global-styles/navigation-button.js.map +1 -1
  86. package/build-module/components/global-styles/palette.js +8 -6
  87. package/build-module/components/global-styles/palette.js.map +1 -1
  88. package/build-module/components/global-styles/preview.js +141 -27
  89. package/build-module/components/global-styles/preview.js.map +1 -1
  90. package/build-module/components/global-styles/screen-block-list.js +2 -2
  91. package/build-module/components/global-styles/screen-block-list.js.map +1 -1
  92. package/build-module/components/global-styles/screen-colors.js +10 -3
  93. package/build-module/components/global-styles/screen-colors.js.map +1 -1
  94. package/build-module/components/global-styles/screen-root.js +8 -7
  95. package/build-module/components/global-styles/screen-root.js.map +1 -1
  96. package/build-module/components/global-styles/screen-style-variations.js +13 -6
  97. package/build-module/components/global-styles/screen-style-variations.js.map +1 -1
  98. package/build-module/components/header/document-actions/index.js +13 -11
  99. package/build-module/components/header/document-actions/index.js.map +1 -1
  100. package/build-module/components/header/index.js +5 -3
  101. package/build-module/components/header/index.js.map +1 -1
  102. package/build-module/components/header/more-menu/index.js +8 -1
  103. package/build-module/components/header/more-menu/index.js.map +1 -1
  104. package/build-module/components/header/more-menu/site-export.js +5 -2
  105. package/build-module/components/header/more-menu/site-export.js.map +1 -1
  106. package/build-module/components/header/plugin-more-menu-item/index.js +4 -0
  107. package/build-module/components/header/plugin-more-menu-item/index.js.map +1 -1
  108. package/build-module/components/list/actions/rename-menu-item.js +4 -11
  109. package/build-module/components/list/actions/rename-menu-item.js.map +1 -1
  110. package/build-module/components/preferences-modal/enable-feature.js +27 -0
  111. package/build-module/components/preferences-modal/enable-feature.js.map +1 -0
  112. package/build-module/components/preferences-modal/index.js +57 -0
  113. package/build-module/components/preferences-modal/index.js.map +1 -0
  114. package/build-module/components/sidebar/index.js +11 -1
  115. package/build-module/components/sidebar/index.js.map +1 -1
  116. package/build-module/components/sidebar/navigation-menu-sidebar/index.js +26 -0
  117. package/build-module/components/sidebar/navigation-menu-sidebar/index.js.map +1 -0
  118. package/build-module/components/sidebar/navigation-menu-sidebar/navigation-inspector.js +168 -0
  119. package/build-module/components/sidebar/navigation-menu-sidebar/navigation-inspector.js.map +1 -0
  120. package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js +45 -0
  121. package/build-module/components/sidebar/navigation-menu-sidebar/navigation-menu.js.map +1 -0
  122. package/build-module/components/template-part-converter/convert-to-regular.js +6 -0
  123. package/build-module/components/template-part-converter/convert-to-regular.js.map +1 -1
  124. package/build-module/index.js +1 -0
  125. package/build-module/index.js.map +1 -1
  126. package/build-module/store/actions.js +3 -3
  127. package/build-module/store/actions.js.map +1 -1
  128. package/build-module/store/selectors.js +3 -1
  129. package/build-module/store/selectors.js.map +1 -1
  130. package/build-style/style-rtl.css +86 -5
  131. package/build-style/style.css +86 -5
  132. package/package.json +29 -29
  133. package/src/components/add-new-template/new-template-part.js +3 -12
  134. package/src/components/add-new-template/new-template.js +49 -12
  135. package/src/components/block-editor/index.js +79 -9
  136. package/src/components/editor/index.js +13 -0
  137. package/src/components/global-styles/border-panel.js +32 -26
  138. package/src/components/global-styles/color-indicator-wrapper.js +23 -0
  139. package/src/components/global-styles/dimensions-panel.js +7 -2
  140. package/src/components/global-styles/header.js +2 -7
  141. package/src/components/global-styles/icon-with-current-color.js +21 -0
  142. package/src/components/global-styles/navigation-button.js +6 -4
  143. package/src/components/global-styles/palette.js +8 -11
  144. package/src/components/global-styles/preview.js +186 -29
  145. package/src/components/global-styles/screen-block-list.js +1 -3
  146. package/src/components/global-styles/screen-colors.js +7 -6
  147. package/src/components/global-styles/screen-root.js +15 -17
  148. package/src/components/global-styles/screen-style-variations.js +13 -4
  149. package/src/components/global-styles/style.scss +18 -6
  150. package/src/components/header/document-actions/index.js +14 -10
  151. package/src/components/header/index.js +6 -1
  152. package/src/components/header/more-menu/index.js +15 -0
  153. package/src/components/header/more-menu/site-export.js +13 -2
  154. package/src/components/header/plugin-more-menu-item/index.js +2 -0
  155. package/src/components/header/style.scss +45 -0
  156. package/src/components/list/actions/rename-menu-item.js +3 -13
  157. package/src/components/preferences-modal/enable-feature.js +24 -0
  158. package/src/components/preferences-modal/index.js +76 -0
  159. package/src/components/sidebar/index.js +12 -0
  160. package/src/components/sidebar/navigation-menu-sidebar/index.js +34 -0
  161. package/src/components/sidebar/navigation-menu-sidebar/navigation-inspector.js +224 -0
  162. package/src/components/sidebar/navigation-menu-sidebar/navigation-menu.js +62 -0
  163. package/src/components/sidebar/navigation-menu-sidebar/style.scss +42 -0
  164. package/src/components/sidebar/style.scss +1 -1
  165. package/src/components/template-part-converter/convert-to-regular.js +9 -0
  166. package/src/index.js +1 -0
  167. package/src/store/actions.js +4 -4
  168. package/src/store/selectors.js +10 -0
  169. package/src/store/test/selectors.js +4 -0
  170. package/src/style.scss +1 -0
@@ -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: 91;
307
+ z-index: 20;
308
308
  }
309
309
 
310
310
  .interface-interface-skeleton__secondary-sidebar,
@@ -773,20 +773,30 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
773
773
 
774
774
  .edit-site-global-styles-variations_item {
775
775
  box-sizing: border-box;
776
+ }
777
+ .edit-site-global-styles-variations_item .edit-site-global-styles-variations_item-preview {
776
778
  padding: 2px;
777
779
  border-radius: 2px;
778
780
  border: #e0e0e0 1px solid;
779
781
  }
780
- .edit-site-global-styles-variations_item.is-active {
782
+ .edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview {
781
783
  border: #1e1e1e 1px solid;
782
784
  }
783
- .edit-site-global-styles-variations_item:hover {
785
+ .edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview {
784
786
  border: var(--wp-admin-theme-color) 1px solid;
785
787
  }
786
- .edit-site-global-styles-variations_item:focus {
788
+ .edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview {
787
789
  border: var(--wp-admin-theme-color) 1px solid;
788
790
  }
789
791
 
792
+ .edit-site-global-styles-icon-with-current-color {
793
+ fill: currentColor;
794
+ }
795
+
796
+ .edit-site-global-styles__color-indicator-wrapper {
797
+ height: 24px;
798
+ }
799
+
790
800
  .edit-site-header {
791
801
  align-items: center;
792
802
  background-color: #fff;
@@ -944,6 +954,40 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
944
954
  }
945
955
  }
946
956
 
957
+ .show-icon-labels .edit-site-header .components-button.has-icon {
958
+ width: auto;
959
+ }
960
+ .show-icon-labels .edit-site-header .components-button.has-icon svg {
961
+ display: none;
962
+ }
963
+ .show-icon-labels .edit-site-header .components-button.has-icon::after {
964
+ content: attr(aria-label);
965
+ }
966
+ .show-icon-labels .edit-site-header .components-button.has-icon[aria-disabled=true] {
967
+ background-color: transparent;
968
+ }
969
+ .show-icon-labels .edit-site-header .is-tertiary:active {
970
+ box-shadow: 0 0 0 1.5px var(--wp-admin-theme-color);
971
+ background-color: transparent;
972
+ }
973
+ .show-icon-labels .edit-site-header .edit-site-save-button__button {
974
+ padding-right: 6px;
975
+ padding-left: 6px;
976
+ margin-left: 4px;
977
+ }
978
+ .show-icon-labels .edit-site-header .block-editor-post-preview__button-toggle {
979
+ margin-left: 4px;
980
+ }
981
+ .show-icon-labels .edit-site-header .edit-site-header-toolbar__inserter-toggle.edit-site-header-toolbar__inserter-toggle,
982
+ .show-icon-labels .edit-site-header .edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info {
983
+ height: 36px;
984
+ padding: 0 6px;
985
+ }
986
+ .show-icon-labels .edit-site-header .edit-site-header-toolbar__inserter-toggle.edit-site-header-toolbar__inserter-toggle::after,
987
+ .show-icon-labels .edit-site-header .edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info::after {
988
+ content: none;
989
+ }
990
+
947
991
  .edit-site-document-actions {
948
992
  display: flex;
949
993
  flex-direction: column;
@@ -1503,7 +1547,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1503
1547
  padding: 0 8px;
1504
1548
  height: 24px;
1505
1549
  border-radius: 2px;
1506
- background-color: #000;
1550
+ background-color: #1e1e1e;
1507
1551
  color: #fff;
1508
1552
  align-items: center;
1509
1553
  font-size: 12px;
@@ -1580,6 +1624,43 @@ body.is-fullscreen-mode .edit-site-list-header {
1580
1624
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -4px 0 0 var(--wp-admin-theme-color);
1581
1625
  }
1582
1626
 
1627
+ @keyframes loadingpulse {
1628
+ 0% {
1629
+ opacity: 1;
1630
+ }
1631
+ 50% {
1632
+ opacity: 0.5;
1633
+ }
1634
+ 100% {
1635
+ opacity: 1;
1636
+ }
1637
+ }
1638
+ .edit-site-navigation-inspector {
1639
+ padding: 16px;
1640
+ }
1641
+ .edit-site-navigation-inspector .block-editor-list-view-leaf .block-editor-list-view-block-contents {
1642
+ align-items: flex-start;
1643
+ white-space: normal;
1644
+ }
1645
+ .edit-site-navigation-inspector .block-editor-list-view-block__title {
1646
+ margin-top: 3px;
1647
+ }
1648
+ .edit-site-navigation-inspector .block-editor-list-view-block__menu-cell {
1649
+ padding-left: 0;
1650
+ }
1651
+
1652
+ .edit-site-navigation-inspector__placeholder {
1653
+ padding: 8px;
1654
+ margin: 8px;
1655
+ background-color: #f0f0f0;
1656
+ animation: loadingpulse 1s linear infinite;
1657
+ animation-delay: 0.5s;
1658
+ }
1659
+ .edit-site-navigation-inspector__placeholder.is-child {
1660
+ margin-right: 24px;
1661
+ width: 50%;
1662
+ }
1663
+
1583
1664
  .edit-site-template-card {
1584
1665
  display: flex;
1585
1666
  align-items: flex-start;
@@ -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: 91;
307
+ z-index: 20;
308
308
  }
309
309
 
310
310
  .interface-interface-skeleton__secondary-sidebar,
@@ -773,20 +773,30 @@ textarea.edit-site-code-editor-text-area.edit-site-code-editor-text-area:-ms-inp
773
773
 
774
774
  .edit-site-global-styles-variations_item {
775
775
  box-sizing: border-box;
776
+ }
777
+ .edit-site-global-styles-variations_item .edit-site-global-styles-variations_item-preview {
776
778
  padding: 2px;
777
779
  border-radius: 2px;
778
780
  border: #e0e0e0 1px solid;
779
781
  }
780
- .edit-site-global-styles-variations_item.is-active {
782
+ .edit-site-global-styles-variations_item.is-active .edit-site-global-styles-variations_item-preview {
781
783
  border: #1e1e1e 1px solid;
782
784
  }
783
- .edit-site-global-styles-variations_item:hover {
785
+ .edit-site-global-styles-variations_item:hover .edit-site-global-styles-variations_item-preview {
784
786
  border: var(--wp-admin-theme-color) 1px solid;
785
787
  }
786
- .edit-site-global-styles-variations_item:focus {
788
+ .edit-site-global-styles-variations_item:focus .edit-site-global-styles-variations_item-preview {
787
789
  border: var(--wp-admin-theme-color) 1px solid;
788
790
  }
789
791
 
792
+ .edit-site-global-styles-icon-with-current-color {
793
+ fill: currentColor;
794
+ }
795
+
796
+ .edit-site-global-styles__color-indicator-wrapper {
797
+ height: 24px;
798
+ }
799
+
790
800
  .edit-site-header {
791
801
  align-items: center;
792
802
  background-color: #fff;
@@ -944,6 +954,40 @@ body.is-navigation-sidebar-open .edit-site-header .edit-site-header_end .compone
944
954
  }
945
955
  }
946
956
 
957
+ .show-icon-labels .edit-site-header .components-button.has-icon {
958
+ width: auto;
959
+ }
960
+ .show-icon-labels .edit-site-header .components-button.has-icon svg {
961
+ display: none;
962
+ }
963
+ .show-icon-labels .edit-site-header .components-button.has-icon::after {
964
+ content: attr(aria-label);
965
+ }
966
+ .show-icon-labels .edit-site-header .components-button.has-icon[aria-disabled=true] {
967
+ background-color: transparent;
968
+ }
969
+ .show-icon-labels .edit-site-header .is-tertiary:active {
970
+ box-shadow: 0 0 0 1.5px var(--wp-admin-theme-color);
971
+ background-color: transparent;
972
+ }
973
+ .show-icon-labels .edit-site-header .edit-site-save-button__button {
974
+ padding-left: 6px;
975
+ padding-right: 6px;
976
+ margin-right: 4px;
977
+ }
978
+ .show-icon-labels .edit-site-header .block-editor-post-preview__button-toggle {
979
+ margin-right: 4px;
980
+ }
981
+ .show-icon-labels .edit-site-header .edit-site-header-toolbar__inserter-toggle.edit-site-header-toolbar__inserter-toggle,
982
+ .show-icon-labels .edit-site-header .edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info {
983
+ height: 36px;
984
+ padding: 0 6px;
985
+ }
986
+ .show-icon-labels .edit-site-header .edit-site-header-toolbar__inserter-toggle.edit-site-header-toolbar__inserter-toggle::after,
987
+ .show-icon-labels .edit-site-header .edit-site-document-actions__get-info.edit-site-document-actions__get-info.edit-site-document-actions__get-info::after {
988
+ content: none;
989
+ }
990
+
947
991
  .edit-site-document-actions {
948
992
  display: flex;
949
993
  flex-direction: column;
@@ -1503,7 +1547,7 @@ body.is-fullscreen-mode .edit-site-list-header {
1503
1547
  padding: 0 8px;
1504
1548
  height: 24px;
1505
1549
  border-radius: 2px;
1506
- background-color: #000;
1550
+ background-color: #1e1e1e;
1507
1551
  color: #fff;
1508
1552
  align-items: center;
1509
1553
  font-size: 12px;
@@ -1580,6 +1624,43 @@ body.is-fullscreen-mode .edit-site-list-header {
1580
1624
  box-shadow: inset 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color), inset 0 -4px 0 0 var(--wp-admin-theme-color);
1581
1625
  }
1582
1626
 
1627
+ @keyframes loadingpulse {
1628
+ 0% {
1629
+ opacity: 1;
1630
+ }
1631
+ 50% {
1632
+ opacity: 0.5;
1633
+ }
1634
+ 100% {
1635
+ opacity: 1;
1636
+ }
1637
+ }
1638
+ .edit-site-navigation-inspector {
1639
+ padding: 16px;
1640
+ }
1641
+ .edit-site-navigation-inspector .block-editor-list-view-leaf .block-editor-list-view-block-contents {
1642
+ align-items: flex-start;
1643
+ white-space: normal;
1644
+ }
1645
+ .edit-site-navigation-inspector .block-editor-list-view-block__title {
1646
+ margin-top: 3px;
1647
+ }
1648
+ .edit-site-navigation-inspector .block-editor-list-view-block__menu-cell {
1649
+ padding-right: 0;
1650
+ }
1651
+
1652
+ .edit-site-navigation-inspector__placeholder {
1653
+ padding: 8px;
1654
+ margin: 8px;
1655
+ background-color: #f0f0f0;
1656
+ animation: loadingpulse 1s linear infinite;
1657
+ animation-delay: 0.5s;
1658
+ }
1659
+ .edit-site-navigation-inspector__placeholder.is-child {
1660
+ margin-left: 24px;
1661
+ width: 50%;
1662
+ }
1663
+
1583
1664
  .edit-site-template-card {
1584
1665
  display: flex;
1585
1666
  align-items: flex-start;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "4.1.0",
3
+ "version": "4.3.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,33 +27,33 @@
27
27
  "react-native": "src/index",
28
28
  "dependencies": {
29
29
  "@babel/runtime": "^7.16.0",
30
- "@wordpress/a11y": "^3.4.0",
31
- "@wordpress/api-fetch": "^6.1.0",
32
- "@wordpress/block-editor": "^8.3.0",
33
- "@wordpress/block-library": "^7.1.0",
34
- "@wordpress/blocks": "^11.3.0",
35
- "@wordpress/components": "^19.6.0",
36
- "@wordpress/compose": "^5.2.0",
37
- "@wordpress/core-data": "^4.2.0",
38
- "@wordpress/data": "^6.4.0",
39
- "@wordpress/deprecated": "^3.4.0",
40
- "@wordpress/editor": "^12.3.0",
41
- "@wordpress/element": "^4.2.0",
42
- "@wordpress/hooks": "^3.4.0",
43
- "@wordpress/html-entities": "^3.4.0",
44
- "@wordpress/i18n": "^4.4.0",
45
- "@wordpress/icons": "^8.0.0",
46
- "@wordpress/interface": "^4.3.0",
47
- "@wordpress/keyboard-shortcuts": "^3.2.0",
48
- "@wordpress/keycodes": "^3.4.0",
49
- "@wordpress/media-utils": "^3.2.0",
50
- "@wordpress/notices": "^3.4.0",
51
- "@wordpress/plugins": "^4.2.0",
52
- "@wordpress/preferences": "^1.0.0-prerelease",
53
- "@wordpress/reusable-blocks": "^3.2.0",
54
- "@wordpress/style-engine": "^0.3.0",
55
- "@wordpress/url": "^3.5.0",
56
- "@wordpress/viewport": "^4.2.0",
30
+ "@wordpress/a11y": "^3.6.0",
31
+ "@wordpress/api-fetch": "^6.3.0",
32
+ "@wordpress/block-editor": "^8.5.0",
33
+ "@wordpress/block-library": "^7.3.0",
34
+ "@wordpress/blocks": "^11.5.0",
35
+ "@wordpress/components": "^19.8.0",
36
+ "@wordpress/compose": "^5.4.0",
37
+ "@wordpress/core-data": "^4.4.0",
38
+ "@wordpress/data": "^6.6.0",
39
+ "@wordpress/deprecated": "^3.6.0",
40
+ "@wordpress/editor": "^12.5.0",
41
+ "@wordpress/element": "^4.4.0",
42
+ "@wordpress/hooks": "^3.6.0",
43
+ "@wordpress/html-entities": "^3.6.0",
44
+ "@wordpress/i18n": "^4.6.0",
45
+ "@wordpress/icons": "^8.2.0",
46
+ "@wordpress/interface": "^4.5.0",
47
+ "@wordpress/keyboard-shortcuts": "^3.4.0",
48
+ "@wordpress/keycodes": "^3.6.0",
49
+ "@wordpress/media-utils": "^3.4.0",
50
+ "@wordpress/notices": "^3.6.0",
51
+ "@wordpress/plugins": "^4.4.0",
52
+ "@wordpress/preferences": "^1.2.0",
53
+ "@wordpress/reusable-blocks": "^3.4.0",
54
+ "@wordpress/style-engine": "^0.5.0",
55
+ "@wordpress/url": "^3.7.0",
56
+ "@wordpress/viewport": "^4.4.0",
57
57
  "classnames": "^2.3.1",
58
58
  "downloadjs": "^1.4.7",
59
59
  "history": "^5.1.0",
@@ -68,5 +68,5 @@
68
68
  "publishConfig": {
69
69
  "access": "public"
70
70
  },
71
- "gitHead": "c37fd7edbc3e379540d7b24fce75a6f640a434ae"
71
+ "gitHead": "11eb1241e63c9240018323551c6753f8a5fa96f9"
72
72
  }
@@ -7,7 +7,7 @@ import { kebabCase } from 'lodash';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { useState } from '@wordpress/element';
10
- import { useSelect, useDispatch } from '@wordpress/data';
10
+ import { useDispatch } from '@wordpress/data';
11
11
  import { Button } from '@wordpress/components';
12
12
  import { __ } from '@wordpress/i18n';
13
13
  import { store as noticesStore } from '@wordpress/notices';
@@ -24,7 +24,6 @@ export default function NewTemplatePart( { postType } ) {
24
24
  const [ isModalOpen, setIsModalOpen ] = useState( false );
25
25
  const { createErrorNotice } = useDispatch( noticesStore );
26
26
  const { saveEntityRecord } = useDispatch( coreStore );
27
- const { getLastEntitySaveError } = useSelect( coreStore );
28
27
 
29
28
  async function createTemplatePart( { title, area } ) {
30
29
  if ( ! title ) {
@@ -49,18 +48,10 @@ export default function NewTemplatePart( { postType } ) {
49
48
  title,
50
49
  content: '',
51
50
  area,
52
- }
51
+ },
52
+ { throwOnError: true }
53
53
  );
54
54
 
55
- const lastEntitySaveError = getLastEntitySaveError(
56
- 'postType',
57
- 'wp_template_part',
58
- templatePart.id
59
- );
60
- if ( lastEntitySaveError ) {
61
- throw lastEntitySaveError;
62
- }
63
-
64
55
  setIsModalOpen( false );
65
56
 
66
57
  // Navigate to the created template part editor.
@@ -15,6 +15,21 @@ import {
15
15
  import { useSelect, useDispatch } from '@wordpress/data';
16
16
  import { store as coreStore } from '@wordpress/core-data';
17
17
  import { store as editorStore } from '@wordpress/editor';
18
+ import {
19
+ archive,
20
+ blockMeta,
21
+ category,
22
+ home,
23
+ list,
24
+ media,
25
+ notFound,
26
+ page,
27
+ post,
28
+ postAuthor,
29
+ postDate,
30
+ search,
31
+ tag,
32
+ } from '@wordpress/icons';
18
33
  import { __ } from '@wordpress/i18n';
19
34
  import { store as noticesStore } from '@wordpress/notices';
20
35
 
@@ -27,12 +42,33 @@ const DEFAULT_TEMPLATE_SLUGS = [
27
42
  'front-page',
28
43
  'single-post',
29
44
  'page',
45
+ 'index',
30
46
  'archive',
47
+ 'author',
48
+ 'category',
49
+ 'date',
50
+ 'tag',
51
+ 'taxonomy',
31
52
  'search',
32
53
  '404',
33
- 'index',
34
54
  ];
35
55
 
56
+ const TEMPLATE_ICONS = {
57
+ 'front-page': home,
58
+ 'single-post': post,
59
+ page,
60
+ archive,
61
+ search,
62
+ 404: notFound,
63
+ index: list,
64
+ category,
65
+ author: postAuthor,
66
+ taxonomy: blockMeta,
67
+ date: postDate,
68
+ tag,
69
+ attachment: media,
70
+ };
71
+
36
72
  export default function NewTemplate( { postType } ) {
37
73
  const history = useHistory();
38
74
  const { templates, defaultTemplateTypes } = useSelect(
@@ -50,7 +86,6 @@ export default function NewTemplate( { postType } ) {
50
86
  );
51
87
  const { saveEntityRecord } = useDispatch( coreStore );
52
88
  const { createErrorNotice } = useDispatch( noticesStore );
53
- const { getLastEntitySaveError } = useSelect( coreStore );
54
89
 
55
90
  async function createTemplate( { slug } ) {
56
91
  try {
@@ -67,18 +102,10 @@ export default function NewTemplate( { postType } ) {
67
102
  slug: slug.toString(),
68
103
  status: 'publish',
69
104
  title,
70
- }
105
+ },
106
+ { throwOnError: true }
71
107
  );
72
108
 
73
- const lastEntitySaveError = getLastEntitySaveError(
74
- 'postType',
75
- 'wp_template',
76
- template.id
77
- );
78
- if ( lastEntitySaveError ) {
79
- throw lastEntitySaveError;
80
- }
81
-
82
109
  // Navigate to the created template editor.
83
110
  history.push( {
84
111
  postId: template.id,
@@ -111,6 +138,14 @@ export default function NewTemplate( { postType } ) {
111
138
  return null;
112
139
  }
113
140
 
141
+ // Update the sort order to match the DEFAULT_TEMPLATE_SLUGS order.
142
+ missingTemplates.sort( ( template1, template2 ) => {
143
+ return (
144
+ DEFAULT_TEMPLATE_SLUGS.indexOf( template1.slug ) -
145
+ DEFAULT_TEMPLATE_SLUGS.indexOf( template2.slug )
146
+ );
147
+ } );
148
+
114
149
  return (
115
150
  <DropdownMenu
116
151
  className="edit-site-new-template-dropdown"
@@ -131,6 +166,8 @@ export default function NewTemplate( { postType } ) {
131
166
  missingTemplates,
132
167
  ( { title, description, slug } ) => (
133
168
  <MenuItem
169
+ icon={ TEMPLATE_ICONS[ slug ] }
170
+ iconPosition="left"
134
171
  info={ description }
135
172
  key={ slug }
136
173
  onClick={ () => {
@@ -8,20 +8,26 @@ import classnames from 'classnames';
8
8
  */
9
9
  import { useSelect, useDispatch } from '@wordpress/data';
10
10
  import { useCallback, useRef } from '@wordpress/element';
11
- import { useEntityBlockEditor } from '@wordpress/core-data';
11
+ import { useEntityBlockEditor, store as coreStore } from '@wordpress/core-data';
12
12
  import {
13
13
  BlockList,
14
14
  BlockEditorProvider,
15
15
  __experimentalLinkControl,
16
16
  BlockInspector,
17
17
  BlockTools,
18
+ __unstableBlockToolbarLastItem,
18
19
  __unstableBlockSettingsMenuFirstItem,
19
20
  __unstableUseTypingObserver as useTypingObserver,
20
21
  BlockEditorKeyboardShortcuts,
21
22
  store as blockEditorStore,
23
+ __unstableBlockNameContext,
22
24
  } from '@wordpress/block-editor';
23
25
  import { useMergeRefs, useViewportMatch } from '@wordpress/compose';
24
26
  import { ReusableBlocksMenuItems } from '@wordpress/reusable-blocks';
27
+ import { listView } from '@wordpress/icons';
28
+ import { ToolbarButton, ToolbarGroup } from '@wordpress/components';
29
+ import { __ } from '@wordpress/i18n';
30
+ import { store as interfaceStore } from '@wordpress/interface';
25
31
 
26
32
  /**
27
33
  * Internal dependencies
@@ -42,17 +48,44 @@ const LAYOUT = {
42
48
  };
43
49
 
44
50
  export default function BlockEditor( { setIsInserterOpen } ) {
45
- const { settings, templateType, templateId, page } = useSelect(
51
+ const { settings } = useSelect(
46
52
  ( select ) => {
47
- const {
48
- getSettings,
49
- getEditedPostType,
50
- getEditedPostId,
51
- getPage,
52
- } = select( editSiteStore );
53
+ let storedSettings = select( editSiteStore ).getSettings(
54
+ setIsInserterOpen
55
+ );
56
+
57
+ if ( ! storedSettings.__experimentalBlockPatterns ) {
58
+ storedSettings = {
59
+ ...storedSettings,
60
+ __experimentalBlockPatterns: select(
61
+ coreStore
62
+ ).getBlockPatterns(),
63
+ };
64
+ }
65
+
66
+ if ( ! storedSettings.__experimentalBlockPatternCategories ) {
67
+ storedSettings = {
68
+ ...storedSettings,
69
+ __experimentalBlockPatternCategories: select(
70
+ coreStore
71
+ ).getBlockPatternCategories(),
72
+ };
73
+ }
74
+
75
+ return {
76
+ settings: storedSettings,
77
+ };
78
+ },
79
+ [ setIsInserterOpen ]
80
+ );
81
+
82
+ const { templateType, templateId, page } = useSelect(
83
+ ( select ) => {
84
+ const { getEditedPostType, getEditedPostId, getPage } = select(
85
+ editSiteStore
86
+ );
53
87
 
54
88
  return {
55
- settings: getSettings( setIsInserterOpen ),
56
89
  templateType: getEditedPostType(),
57
90
  templateId: getEditedPostId(),
58
91
  page: getPage(),
@@ -60,11 +93,19 @@ export default function BlockEditor( { setIsInserterOpen } ) {
60
93
  },
61
94
  [ setIsInserterOpen ]
62
95
  );
96
+
63
97
  const [ blocks, onInput, onChange ] = useEntityBlockEditor(
64
98
  'postType',
65
99
  templateType
66
100
  );
67
101
  const { setPage } = useDispatch( editSiteStore );
102
+ const { enableComplementaryArea } = useDispatch( interfaceStore );
103
+ const openNavigationSidebar = useCallback( () => {
104
+ enableComplementaryArea(
105
+ 'core/edit-site',
106
+ 'edit-site/navigation-menu'
107
+ );
108
+ }, [ enableComplementaryArea ] );
68
109
  const contentRef = useRef();
69
110
  const mergedRefs = useMergeRefs( [ contentRef, useTypingObserver() ] );
70
111
  const isMobileViewport = useViewportMatch( 'small', '<' );
@@ -72,6 +113,26 @@ export default function BlockEditor( { setIsInserterOpen } ) {
72
113
 
73
114
  const isTemplatePart = templateType === 'wp_template_part';
74
115
 
116
+ const NavMenuSidebarToggle = () => (
117
+ <ToolbarGroup>
118
+ <ToolbarButton
119
+ className="components-toolbar__control"
120
+ label={ __( 'Open list view' ) }
121
+ onClick={ openNavigationSidebar }
122
+ icon={ listView }
123
+ />
124
+ </ToolbarGroup>
125
+ );
126
+
127
+ // Conditionally include NavMenu sidebar in Plugin only.
128
+ // Optimise for dead code elimination.
129
+ // See https://github.com/WordPress/gutenberg/blob/trunk/docs/how-to-guides/feature-flags.md#dead-code-elimination.
130
+ let MaybeNavMenuSidebarToggle = 'Fragment';
131
+
132
+ if ( process.env.IS_GUTENBERG_PLUGIN ) {
133
+ MaybeNavMenuSidebarToggle = NavMenuSidebarToggle;
134
+ }
135
+
75
136
  return (
76
137
  <BlockEditorProvider
77
138
  settings={ settings }
@@ -133,6 +194,15 @@ export default function BlockEditor( { setIsInserterOpen } ) {
133
194
  <BlockInspectorButton onClick={ onClose } />
134
195
  ) }
135
196
  </__unstableBlockSettingsMenuFirstItem>
197
+ <__unstableBlockToolbarLastItem>
198
+ <__unstableBlockNameContext.Consumer>
199
+ { ( blockName ) =>
200
+ blockName === 'core/navigation' && (
201
+ <MaybeNavMenuSidebarToggle />
202
+ )
203
+ }
204
+ </__unstableBlockNameContext.Consumer>
205
+ </__unstableBlockToolbarLastItem>
136
206
  </BlockTools>
137
207
  <ReusableBlocksMenuItems />
138
208
  </BlockEditorProvider>
@@ -21,6 +21,7 @@ import {
21
21
  ShortcutProvider,
22
22
  store as keyboardShortcutsStore,
23
23
  } from '@wordpress/keyboard-shortcuts';
24
+ import { store as preferencesStore } from '@wordpress/preferences';
24
25
 
25
26
  /**
26
27
  * Internal dependencies
@@ -61,6 +62,7 @@ function Editor( { onError } ) {
61
62
  previousShortcut,
62
63
  nextShortcut,
63
64
  editorMode,
65
+ showIconLabels,
64
66
  } = useSelect( ( select ) => {
65
67
  const {
66
68
  isInserterOpened,
@@ -105,6 +107,10 @@ function Editor( { onError } ) {
105
107
  keyboardShortcutsStore
106
108
  ).getAllShortcutKeyCombinations( 'core/edit-site/next-region' ),
107
109
  editorMode: getEditorMode(),
110
+ showIconLabels: select( preferencesStore ).get(
111
+ 'core/edit-site',
112
+ 'showIconLabels'
113
+ ),
108
114
  };
109
115
  }, [] );
110
116
  const { setPage, setIsInserterOpened } = useDispatch( editSiteStore );
@@ -203,6 +209,10 @@ function Editor( { onError } ) {
203
209
  <SidebarComplementaryAreaFills />
204
210
  <InterfaceSkeleton
205
211
  labels={ interfaceLabels }
212
+ className={
213
+ showIconLabels &&
214
+ 'show-icon-labels'
215
+ }
206
216
  secondarySidebar={ secondarySidebar() }
207
217
  sidebar={
208
218
  sidebarIsOpened && (
@@ -217,6 +227,9 @@ function Editor( { onError } ) {
217
227
  openEntitiesSavedStates={
218
228
  openEntitiesSavedStates
219
229
  }
230
+ showIconLabels={
231
+ showIconLabels
232
+ }
220
233
  />
221
234
  }
222
235
  notices={ <EditorSnackbars /> }