@wordpress/edit-site 6.0.1 → 6.1.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 (133) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/components/add-new-page/index.js +2 -1
  3. package/build/components/add-new-page/index.js.map +1 -1
  4. package/build/components/app/index.js +17 -1
  5. package/build/components/app/index.js.map +1 -1
  6. package/build/components/editor/index.js +3 -10
  7. package/build/components/editor/index.js.map +1 -1
  8. package/build/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  9. package/build/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  10. package/build/components/global-styles/screen-revisions/index.js +4 -23
  11. package/build/components/global-styles/screen-revisions/index.js.map +1 -1
  12. package/build/components/global-styles/shadows-edit-panel.js +1 -0
  13. package/build/components/global-styles/shadows-edit-panel.js.map +1 -1
  14. package/build/components/global-styles/variations/variation.js +11 -16
  15. package/build/components/global-styles/variations/variation.js.map +1 -1
  16. package/build/components/global-styles/variations/variations-color.js +1 -0
  17. package/build/components/global-styles/variations/variations-color.js.map +1 -1
  18. package/build/components/global-styles/variations/variations-typography.js +1 -0
  19. package/build/components/global-styles/variations/variations-typography.js.map +1 -1
  20. package/build/components/layout/index.js +8 -37
  21. package/build/components/layout/index.js.map +1 -1
  22. package/build/components/page/header.js +1 -0
  23. package/build/components/page/header.js.map +1 -1
  24. package/build/components/page-patterns/header.js +2 -1
  25. package/build/components/page-patterns/header.js.map +1 -1
  26. package/build/components/posts-app/index.js +50 -0
  27. package/build/components/posts-app/index.js.map +1 -0
  28. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
  29. package/build/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  30. package/build/hooks/commands/use-set-command-context.js +53 -0
  31. package/build/hooks/commands/use-set-command-context.js.map +1 -0
  32. package/build/hooks/push-changes-to-global-styles/index.js +2 -2
  33. package/build/hooks/push-changes-to-global-styles/index.js.map +1 -1
  34. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +20 -88
  35. package/build/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  36. package/build/index.js +15 -2
  37. package/build/index.js.map +1 -1
  38. package/build/posts.js +34 -0
  39. package/build/posts.js.map +1 -0
  40. package/build-module/components/add-new-page/index.js +2 -1
  41. package/build-module/components/add-new-page/index.js.map +1 -1
  42. package/build-module/components/app/index.js +17 -1
  43. package/build-module/components/app/index.js.map +1 -1
  44. package/build-module/components/editor/index.js +3 -10
  45. package/build-module/components/editor/index.js.map +1 -1
  46. package/build-module/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  47. package/build-module/components/global-styles/font-library-modal/installed-fonts.js.map +1 -1
  48. package/build-module/components/global-styles/screen-revisions/index.js +4 -23
  49. package/build-module/components/global-styles/screen-revisions/index.js.map +1 -1
  50. package/build-module/components/global-styles/shadows-edit-panel.js +1 -0
  51. package/build-module/components/global-styles/shadows-edit-panel.js.map +1 -1
  52. package/build-module/components/global-styles/variations/variation.js +11 -16
  53. package/build-module/components/global-styles/variations/variation.js.map +1 -1
  54. package/build-module/components/global-styles/variations/variations-color.js +1 -0
  55. package/build-module/components/global-styles/variations/variations-color.js.map +1 -1
  56. package/build-module/components/global-styles/variations/variations-typography.js +1 -0
  57. package/build-module/components/global-styles/variations/variations-typography.js.map +1 -1
  58. package/build-module/components/layout/index.js +10 -39
  59. package/build-module/components/layout/index.js.map +1 -1
  60. package/build-module/components/page/header.js +1 -0
  61. package/build-module/components/page/header.js.map +1 -1
  62. package/build-module/components/page-patterns/header.js +2 -1
  63. package/build-module/components/page-patterns/header.js.map +1 -1
  64. package/build-module/components/posts-app/index.js +43 -0
  65. package/build-module/components/posts-app/index.js.map +1 -0
  66. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
  67. package/build-module/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js.map +1 -1
  68. package/build-module/hooks/commands/use-set-command-context.js +46 -0
  69. package/build-module/hooks/commands/use-set-command-context.js.map +1 -0
  70. package/build-module/hooks/push-changes-to-global-styles/index.js +2 -2
  71. package/build-module/hooks/push-changes-to-global-styles/index.js.map +1 -1
  72. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +19 -86
  73. package/build-module/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js.map +1 -1
  74. package/build-module/index.js +8 -2
  75. package/build-module/index.js.map +1 -1
  76. package/build-module/posts.js +27 -0
  77. package/build-module/posts.js.map +1 -0
  78. package/build-style/posts-rtl.css +1707 -0
  79. package/build-style/posts.css +1707 -0
  80. package/build-style/style-rtl.css +16 -19
  81. package/build-style/style.css +16 -19
  82. package/package.json +41 -41
  83. package/src/components/add-new-page/index.js +2 -1
  84. package/src/components/app/index.js +17 -1
  85. package/src/components/editor/index.js +2 -8
  86. package/src/components/global-styles/font-library-modal/installed-fonts.js +1 -0
  87. package/src/components/global-styles/screen-revisions/index.js +4 -24
  88. package/src/components/global-styles/shadows-edit-panel.js +1 -0
  89. package/src/components/global-styles/style.scss +1 -7
  90. package/src/components/global-styles/variations/variation.js +14 -19
  91. package/src/components/global-styles/variations/variations-color.js +6 -1
  92. package/src/components/global-styles/variations/variations-typography.js +5 -1
  93. package/src/components/global-styles-sidebar/style.scss +0 -1
  94. package/src/components/layout/index.js +24 -70
  95. package/src/components/page/header.js +1 -0
  96. package/src/components/page/style.scss +6 -0
  97. package/src/components/page-patterns/header.js +8 -2
  98. package/src/components/page-patterns/style.scss +6 -0
  99. package/src/components/posts-app/index.js +39 -0
  100. package/src/components/sidebar/style.scss +4 -4
  101. package/src/components/sidebar-navigation-screen-navigation-menu/delete-confirm-dialog.js +1 -0
  102. package/src/hooks/commands/use-set-command-context.js +37 -0
  103. package/src/hooks/push-changes-to-global-styles/index.js +2 -2
  104. package/src/hooks/use-theme-style-variations/test/use-theme-style-variations-by-property.js +1 -875
  105. package/src/hooks/use-theme-style-variations/use-theme-style-variations-by-property.js +29 -117
  106. package/src/index.js +10 -2
  107. package/src/posts.js +29 -0
  108. package/src/posts.scss +46 -0
  109. package/build/components/block-editor/block-inspector-button.js +0 -57
  110. package/build/components/block-editor/block-inspector-button.js.map +0 -1
  111. package/build/components/block-editor/inserter-media-categories.js +0 -183
  112. package/build/components/block-editor/inserter-media-categories.js.map +0 -1
  113. package/build/components/template-part-converter/convert-to-regular.js +0 -38
  114. package/build/components/template-part-converter/convert-to-regular.js.map +0 -1
  115. package/build/components/template-part-converter/convert-to-template-part.js +0 -84
  116. package/build/components/template-part-converter/convert-to-template-part.js.map +0 -1
  117. package/build/components/template-part-converter/index.js +0 -67
  118. package/build/components/template-part-converter/index.js.map +0 -1
  119. package/build-module/components/block-editor/block-inspector-button.js +0 -50
  120. package/build-module/components/block-editor/block-inspector-button.js.map +0 -1
  121. package/build-module/components/block-editor/inserter-media-categories.js +0 -177
  122. package/build-module/components/block-editor/inserter-media-categories.js.map +0 -1
  123. package/build-module/components/template-part-converter/convert-to-regular.js +0 -31
  124. package/build-module/components/template-part-converter/convert-to-regular.js.map +0 -1
  125. package/build-module/components/template-part-converter/convert-to-template-part.js +0 -79
  126. package/build-module/components/template-part-converter/convert-to-template-part.js.map +0 -1
  127. package/build-module/components/template-part-converter/index.js +0 -59
  128. package/build-module/components/template-part-converter/index.js.map +0 -1
  129. package/src/components/block-editor/block-inspector-button.js +0 -60
  130. package/src/components/block-editor/inserter-media-categories.js +0 -225
  131. package/src/components/template-part-converter/convert-to-regular.js +0 -32
  132. package/src/components/template-part-converter/convert-to-template-part.js +0 -78
  133. package/src/components/template-part-converter/index.js +0 -59
@@ -459,8 +459,7 @@
459
459
  line-height: 16px;
460
460
  }
461
461
  .dataviews-view-grid .dataviews-view-grid__fields:not(:empty) {
462
- padding: 12px 0;
463
- padding-top: 0;
462
+ padding: 0 0 12px;
464
463
  }
465
464
  .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field {
466
465
  align-items: flex-start;
@@ -653,11 +652,6 @@
653
652
  margin: 0;
654
653
  }
655
654
 
656
- .dataviews-filters__custom-menu-radio-item-prefix {
657
- display: block;
658
- width: 24px;
659
- }
660
-
661
655
  .dataviews-bulk-edit-button.components-button {
662
656
  flex-shrink: 0;
663
657
  }
@@ -1187,11 +1181,6 @@
1187
1181
  overflow: hidden;
1188
1182
  }
1189
1183
 
1190
- .edit-site-typography-panel__full-width-control {
1191
- grid-column: 1/-1;
1192
- max-width: 100%;
1193
- }
1194
-
1195
1184
  .edit-site-global-styles-screen {
1196
1185
  margin: 12px 16px 16px;
1197
1186
  }
@@ -1246,8 +1235,7 @@
1246
1235
  color: #2f2f2f;
1247
1236
  font-weight: 600;
1248
1237
  line-height: 1.2;
1249
- padding: 16px;
1250
- padding-bottom: 0;
1238
+ padding: 16px 16px 0;
1251
1239
  margin: 0;
1252
1240
  }
1253
1241
 
@@ -1581,7 +1569,6 @@
1581
1569
  font-weight: 500;
1582
1570
  }
1583
1571
 
1584
- .edit-site-typography-panel,
1585
1572
  .edit-site-global-styles-sidebar .block-editor-panel-color-gradient-settings {
1586
1573
  border: 0;
1587
1574
  }
@@ -1656,6 +1643,11 @@
1656
1643
  .edit-site-page-header .edit-site-page-header__page-title {
1657
1644
  min-height: 40px;
1658
1645
  }
1646
+ .edit-site-page-header .edit-site-page-header__page-title .components-heading {
1647
+ flex-grow: 1;
1648
+ flex-basis: 0;
1649
+ white-space: nowrap;
1650
+ }
1659
1651
  .edit-site-page-header .edit-site-page-header__sub-title {
1660
1652
  margin-bottom: 8px;
1661
1653
  }
@@ -1823,6 +1815,11 @@
1823
1815
  .edit-site-page-patterns-dataviews .edit-site-patterns__section-header .edit-site-patterns__title {
1824
1816
  min-height: 40px;
1825
1817
  }
1818
+ .edit-site-page-patterns-dataviews .edit-site-patterns__section-header .edit-site-patterns__title .components-heading {
1819
+ flex-grow: 1;
1820
+ flex-basis: 0;
1821
+ white-space: nowrap;
1822
+ }
1826
1823
  .edit-site-page-patterns-dataviews .edit-site-patterns__section-header .edit-site-patterns__sub-title {
1827
1824
  margin-bottom: 8px;
1828
1825
  }
@@ -2346,7 +2343,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2346
2343
  overflow-y: auto;
2347
2344
  }
2348
2345
 
2349
- @keyframes slide-from-right {
2346
+ @keyframes _w89s1_slide-from-right {
2350
2347
  from {
2351
2348
  transform: translateX(-50px);
2352
2349
  opacity: 0;
@@ -2356,7 +2353,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2356
2353
  opacity: 1;
2357
2354
  }
2358
2355
  }
2359
- @keyframes slide-from-left {
2356
+ @keyframes _w89s1_slide-from-left {
2360
2357
  from {
2361
2358
  transform: translateX(50px);
2362
2359
  opacity: 0;
@@ -2412,10 +2409,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2412
2409
  }
2413
2410
  }
2414
2411
  .edit-site-sidebar__screen-wrapper.slide-from-left {
2415
- animation-name: slide-from-left;
2412
+ animation-name: _w89s1_slide-from-left;
2416
2413
  }
2417
2414
  .edit-site-sidebar__screen-wrapper.slide-from-right {
2418
- animation-name: slide-from-right;
2415
+ animation-name: _w89s1_slide-from-right;
2419
2416
  }
2420
2417
 
2421
2418
  .edit-site-sidebar-button {
@@ -459,8 +459,7 @@
459
459
  line-height: 16px;
460
460
  }
461
461
  .dataviews-view-grid .dataviews-view-grid__fields:not(:empty) {
462
- padding: 12px 0;
463
- padding-top: 0;
462
+ padding: 0 0 12px;
464
463
  }
465
464
  .dataviews-view-grid .dataviews-view-grid__fields .dataviews-view-grid__field {
466
465
  align-items: flex-start;
@@ -653,11 +652,6 @@
653
652
  margin: 0;
654
653
  }
655
654
 
656
- .dataviews-filters__custom-menu-radio-item-prefix {
657
- display: block;
658
- width: 24px;
659
- }
660
-
661
655
  .dataviews-bulk-edit-button.components-button {
662
656
  flex-shrink: 0;
663
657
  }
@@ -1187,11 +1181,6 @@
1187
1181
  overflow: hidden;
1188
1182
  }
1189
1183
 
1190
- .edit-site-typography-panel__full-width-control {
1191
- grid-column: 1/-1;
1192
- max-width: 100%;
1193
- }
1194
-
1195
1184
  .edit-site-global-styles-screen {
1196
1185
  margin: 12px 16px 16px;
1197
1186
  }
@@ -1246,8 +1235,7 @@
1246
1235
  color: #2f2f2f;
1247
1236
  font-weight: 600;
1248
1237
  line-height: 1.2;
1249
- padding: 16px;
1250
- padding-bottom: 0;
1238
+ padding: 16px 16px 0;
1251
1239
  margin: 0;
1252
1240
  }
1253
1241
 
@@ -1582,7 +1570,6 @@
1582
1570
  font-weight: 500;
1583
1571
  }
1584
1572
 
1585
- .edit-site-typography-panel,
1586
1573
  .edit-site-global-styles-sidebar .block-editor-panel-color-gradient-settings {
1587
1574
  border: 0;
1588
1575
  }
@@ -1657,6 +1644,11 @@
1657
1644
  .edit-site-page-header .edit-site-page-header__page-title {
1658
1645
  min-height: 40px;
1659
1646
  }
1647
+ .edit-site-page-header .edit-site-page-header__page-title .components-heading {
1648
+ flex-grow: 1;
1649
+ flex-basis: 0;
1650
+ white-space: nowrap;
1651
+ }
1660
1652
  .edit-site-page-header .edit-site-page-header__sub-title {
1661
1653
  margin-bottom: 8px;
1662
1654
  }
@@ -1824,6 +1816,11 @@
1824
1816
  .edit-site-page-patterns-dataviews .edit-site-patterns__section-header .edit-site-patterns__title {
1825
1817
  min-height: 40px;
1826
1818
  }
1819
+ .edit-site-page-patterns-dataviews .edit-site-patterns__section-header .edit-site-patterns__title .components-heading {
1820
+ flex-grow: 1;
1821
+ flex-basis: 0;
1822
+ white-space: nowrap;
1823
+ }
1827
1824
  .edit-site-page-patterns-dataviews .edit-site-patterns__section-header .edit-site-patterns__sub-title {
1828
1825
  margin-bottom: 8px;
1829
1826
  }
@@ -2347,7 +2344,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2347
2344
  overflow-y: auto;
2348
2345
  }
2349
2346
 
2350
- @keyframes slide-from-right {
2347
+ @keyframes _w89s1_slide-from-right {
2351
2348
  from {
2352
2349
  transform: translateX(50px);
2353
2350
  opacity: 0;
@@ -2357,7 +2354,7 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2357
2354
  opacity: 1;
2358
2355
  }
2359
2356
  }
2360
- @keyframes slide-from-left {
2357
+ @keyframes _w89s1_slide-from-left {
2361
2358
  from {
2362
2359
  transform: translateX(-50px);
2363
2360
  opacity: 0;
@@ -2413,10 +2410,10 @@ html.canvas-mode-edit-transition::view-transition-group(toggle) {
2413
2410
  }
2414
2411
  }
2415
2412
  .edit-site-sidebar__screen-wrapper.slide-from-left {
2416
- animation-name: slide-from-left;
2413
+ animation-name: _w89s1_slide-from-left;
2417
2414
  }
2418
2415
  .edit-site-sidebar__screen-wrapper.slide-from-right {
2419
- animation-name: slide-from-right;
2416
+ animation-name: _w89s1_slide-from-right;
2420
2417
  }
2421
2418
 
2422
2419
  .edit-site-sidebar-button {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/edit-site",
3
- "version": "6.0.1",
3
+ "version": "6.1.0",
4
4
  "description": "Edit Site Page module for WordPress.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -29,45 +29,45 @@
29
29
  "dependencies": {
30
30
  "@babel/runtime": "^7.16.0",
31
31
  "@react-spring/web": "^9.4.5",
32
- "@wordpress/a11y": "^4.0.1",
33
- "@wordpress/api-fetch": "^7.0.1",
34
- "@wordpress/blob": "^4.0.1",
35
- "@wordpress/block-editor": "^13.0.1",
36
- "@wordpress/block-library": "^9.0.1",
37
- "@wordpress/blocks": "^13.0.1",
38
- "@wordpress/commands": "^1.0.1",
39
- "@wordpress/components": "^28.0.1",
40
- "@wordpress/compose": "^7.0.1",
41
- "@wordpress/core-commands": "^1.0.1",
42
- "@wordpress/core-data": "^7.0.1",
43
- "@wordpress/data": "^10.0.1",
44
- "@wordpress/dataviews": "^2.0.1",
45
- "@wordpress/date": "^5.0.1",
46
- "@wordpress/deprecated": "^4.0.1",
47
- "@wordpress/dom": "^4.0.1",
48
- "@wordpress/editor": "^14.0.1",
49
- "@wordpress/element": "^6.0.1",
50
- "@wordpress/escape-html": "^3.0.1",
51
- "@wordpress/hooks": "^4.0.1",
52
- "@wordpress/html-entities": "^4.0.1",
53
- "@wordpress/i18n": "^5.0.1",
54
- "@wordpress/icons": "^10.0.1",
55
- "@wordpress/keyboard-shortcuts": "^5.0.1",
56
- "@wordpress/keycodes": "^4.0.1",
57
- "@wordpress/notices": "^5.0.1",
58
- "@wordpress/patterns": "^2.0.1",
59
- "@wordpress/plugins": "^7.0.1",
60
- "@wordpress/preferences": "^4.0.1",
61
- "@wordpress/primitives": "^4.0.1",
62
- "@wordpress/priority-queue": "^3.0.1",
63
- "@wordpress/private-apis": "^1.0.1",
64
- "@wordpress/reusable-blocks": "^5.0.1",
65
- "@wordpress/router": "^1.0.1",
66
- "@wordpress/style-engine": "^2.0.1",
67
- "@wordpress/url": "^4.0.1",
68
- "@wordpress/viewport": "^6.0.1",
69
- "@wordpress/widgets": "^4.0.1",
70
- "@wordpress/wordcount": "^4.0.1",
32
+ "@wordpress/a11y": "^4.1.0",
33
+ "@wordpress/api-fetch": "^7.1.0",
34
+ "@wordpress/blob": "^4.1.0",
35
+ "@wordpress/block-editor": "^13.1.0",
36
+ "@wordpress/block-library": "^9.1.0",
37
+ "@wordpress/blocks": "^13.1.0",
38
+ "@wordpress/commands": "^1.1.0",
39
+ "@wordpress/components": "^28.1.0",
40
+ "@wordpress/compose": "^7.1.0",
41
+ "@wordpress/core-commands": "^1.1.0",
42
+ "@wordpress/core-data": "^7.1.0",
43
+ "@wordpress/data": "^10.1.0",
44
+ "@wordpress/dataviews": "^2.1.0",
45
+ "@wordpress/date": "^5.1.0",
46
+ "@wordpress/deprecated": "^4.1.0",
47
+ "@wordpress/dom": "^4.1.0",
48
+ "@wordpress/editor": "^14.1.0",
49
+ "@wordpress/element": "^6.1.0",
50
+ "@wordpress/escape-html": "^3.1.0",
51
+ "@wordpress/hooks": "^4.1.0",
52
+ "@wordpress/html-entities": "^4.1.0",
53
+ "@wordpress/i18n": "^5.1.0",
54
+ "@wordpress/icons": "^10.1.0",
55
+ "@wordpress/keyboard-shortcuts": "^5.1.0",
56
+ "@wordpress/keycodes": "^4.1.0",
57
+ "@wordpress/notices": "^5.1.0",
58
+ "@wordpress/patterns": "^2.1.0",
59
+ "@wordpress/plugins": "^7.1.0",
60
+ "@wordpress/preferences": "^4.1.0",
61
+ "@wordpress/primitives": "^4.1.0",
62
+ "@wordpress/priority-queue": "^3.1.0",
63
+ "@wordpress/private-apis": "^1.1.0",
64
+ "@wordpress/reusable-blocks": "^5.1.0",
65
+ "@wordpress/router": "^1.1.0",
66
+ "@wordpress/style-engine": "^2.1.0",
67
+ "@wordpress/url": "^4.1.0",
68
+ "@wordpress/viewport": "^6.1.0",
69
+ "@wordpress/widgets": "^4.1.0",
70
+ "@wordpress/wordcount": "^4.1.0",
71
71
  "change-case": "^4.1.2",
72
72
  "clsx": "^2.1.1",
73
73
  "colord": "^2.9.2",
@@ -82,5 +82,5 @@
82
82
  "publishConfig": {
83
83
  "access": "public"
84
84
  },
85
- "gitHead": "0e973525f7787401b5a544e0727774d52a78639f"
85
+ "gitHead": "66d3bf12e67d16deddc4b4a9ec42e1d0bed3479a"
86
86
  }
@@ -13,6 +13,7 @@ import { useDispatch } from '@wordpress/data';
13
13
  import { useState } from '@wordpress/element';
14
14
  import { store as coreStore } from '@wordpress/core-data';
15
15
  import { store as noticesStore } from '@wordpress/notices';
16
+ import { decodeEntities } from '@wordpress/html-entities';
16
17
 
17
18
  export default function AddNewPageModal( { onSave, onClose } ) {
18
19
  const [ isCreatingPage, setIsCreatingPage ] = useState( false );
@@ -47,7 +48,7 @@ export default function AddNewPageModal( { onSave, onClose } ) {
47
48
  sprintf(
48
49
  // translators: %s: Title of the created template e.g: "Category".
49
50
  __( '"%s" successfully created.' ),
50
- newPage.title?.rendered || title
51
+ decodeEntities( newPage.title?.rendered || title )
51
52
  ),
52
53
  {
53
54
  type: 'snackbar',
@@ -17,10 +17,26 @@ import { privateApis as routerPrivateApis } from '@wordpress/router';
17
17
  */
18
18
  import Layout from '../layout';
19
19
  import { unlock } from '../../lock-unlock';
20
+ import { useCommonCommands } from '../../hooks/commands/use-common-commands';
21
+ import { useEditModeCommands } from '../../hooks/commands/use-edit-mode-commands';
22
+ import useInitEditedEntityFromURL from '../sync-state-with-url/use-init-edited-entity-from-url';
23
+ import useLayoutAreas from '../layout/router';
24
+ import useSetCommandContext from '../../hooks/commands/use-set-command-context';
20
25
 
21
26
  const { RouterProvider } = unlock( routerPrivateApis );
22
27
  const { GlobalStylesProvider } = unlock( editorPrivateApis );
23
28
 
29
+ function AppLayout() {
30
+ // This ensures the edited entity id and type are initialized properly.
31
+ useInitEditedEntityFromURL();
32
+ useEditModeCommands();
33
+ useCommonCommands();
34
+ useSetCommandContext();
35
+ const route = useLayoutAreas();
36
+
37
+ return <Layout route={ route } />;
38
+ }
39
+
24
40
  export default function App() {
25
41
  const { createErrorNotice } = useDispatch( noticesStore );
26
42
 
@@ -41,7 +57,7 @@ export default function App() {
41
57
  <GlobalStylesProvider>
42
58
  <UnsavedChangesWarning />
43
59
  <RouterProvider>
44
- <Layout />
60
+ <AppLayout />
45
61
  <PluginArea onError={ onPluginAreaError } />
46
62
  </RouterProvider>
47
63
  </GlobalStylesProvider>
@@ -21,6 +21,7 @@ import { useCallback, useMemo } from '@wordpress/element';
21
21
  import { store as noticesStore } from '@wordpress/notices';
22
22
  import { privateApis as routerPrivateApis } from '@wordpress/router';
23
23
  import { store as preferencesStore } from '@wordpress/preferences';
24
+ import { decodeEntities } from '@wordpress/html-entities';
24
25
 
25
26
  /**
26
27
  * Internal dependencies
@@ -30,7 +31,6 @@ import { store as editSiteStore } from '../../store';
30
31
  import { GlobalStylesRenderer } from '../global-styles-renderer';
31
32
  import CanvasLoader from '../canvas-loader';
32
33
  import { unlock } from '../../lock-unlock';
33
- import TemplatePartConverter from '../template-part-converter';
34
34
  import { useSpecificEditorSettings } from '../block-editor/use-site-editor-settings';
35
35
  import PluginTemplateSettingPanel from '../plugin-template-setting-panel';
36
36
  import GlobalStylesSidebar from '../global-styles-sidebar';
@@ -55,7 +55,6 @@ export default function EditSiteEditor( { isLoading } ) {
55
55
  editedPostId,
56
56
  contextPostType,
57
57
  contextPostId,
58
- editorMode,
59
58
  canvasMode,
60
59
  isEditingPage,
61
60
  supportsGlobalStyles,
@@ -72,7 +71,6 @@ export default function EditSiteEditor( { isLoading } ) {
72
71
  } = unlock( select( editSiteStore ) );
73
72
  const { get } = select( preferencesStore );
74
73
  const { getCurrentTheme } = select( coreDataStore );
75
- const { getEditorMode } = select( editorStore );
76
74
  const _context = getEditedPostContext();
77
75
 
78
76
  // The currently selected entity to display.
@@ -82,7 +80,6 @@ export default function EditSiteEditor( { isLoading } ) {
82
80
  editedPostId: getEditedPostId(),
83
81
  contextPostType: _context?.postId ? _context.postType : undefined,
84
82
  contextPostId: _context?.postId ? _context.postId : undefined,
85
- editorMode: getEditorMode(),
86
83
  canvasMode: getCanvasMode(),
87
84
  isEditingPage: isPage(),
88
85
  supportsGlobalStyles: getCurrentTheme()?.is_block_theme,
@@ -99,9 +96,7 @@ export default function EditSiteEditor( { isLoading } ) {
99
96
  const _isPreviewingTheme = isPreviewingTheme();
100
97
  const hasDefaultEditorCanvasView = ! useHasEditorCanvasContainer();
101
98
  const iframeProps = useEditorIframeProps();
102
- const isViewMode = canvasMode === 'view';
103
99
  const isEditMode = canvasMode === 'edit';
104
- const showVisualEditor = isViewMode || editorMode === 'visual';
105
100
  const postWithTemplate = !! contextPostId;
106
101
  const loadingProgressId = useInstanceId(
107
102
  CanvasLoader,
@@ -152,7 +147,7 @@ export default function EditSiteEditor( { isLoading } ) {
152
147
  sprintf(
153
148
  // translators: %s: Title of the created post e.g: "Post 1".
154
149
  __( '"%s" successfully created.' ),
155
- _title
150
+ decodeEntities( _title )
156
151
  ),
157
152
  {
158
153
  type: 'snackbar',
@@ -185,7 +180,6 @@ export default function EditSiteEditor( { isLoading } ) {
185
180
  <GlobalStylesRenderer />
186
181
  <EditorKeyboardShortcutsRegister />
187
182
  { isEditMode && <BlockKeyboardShortcuts /> }
188
- { showVisualEditor && <TemplatePartConverter /> }
189
183
  { ! isReady ? <CanvasLoader id={ loadingProgressId } /> : null }
190
184
  { isEditMode && <WelcomeGuide /> }
191
185
  { isReady && (
@@ -382,6 +382,7 @@ function ConfirmDeleteDialog( {
382
382
  confirmButtonText={ __( 'Delete' ) }
383
383
  onCancel={ handleCancelUninstall }
384
384
  onConfirm={ handleConfirmUninstall }
385
+ size="medium"
385
386
  >
386
387
  { font &&
387
388
  sprintf(
@@ -81,28 +81,11 @@ function ScreenRevisions() {
81
81
  };
82
82
 
83
83
  const restoreRevision = ( revision ) => {
84
- setUserConfig( () => ( {
85
- styles: revision?.styles,
86
- settings: revision?.settings,
87
- _links: revision?._links,
88
- } ) );
84
+ setUserConfig( () => revision );
89
85
  setIsLoadingRevisionWithUnsavedChanges( false );
90
86
  onCloseRevisions();
91
87
  };
92
88
 
93
- const selectRevision = ( revision ) => {
94
- setCurrentlySelectedRevision( {
95
- /*
96
- * The default must be an empty object so that
97
- * `mergeBaseAndUserConfigs()` can merge them correctly.
98
- */
99
- styles: revision?.styles || {},
100
- settings: revision?.settings || {},
101
- _links: revision?._links || {},
102
- id: revision?.id,
103
- } );
104
- };
105
-
106
89
  useEffect( () => {
107
90
  if (
108
91
  ! editorCanvasContainerView ||
@@ -134,11 +117,7 @@ function ScreenRevisions() {
134
117
  * See: https://github.com/WordPress/gutenberg/issues/55866
135
118
  */
136
119
  if ( shouldSelectFirstItem ) {
137
- setCurrentlySelectedRevision( {
138
- styles: firstRevision?.styles || {},
139
- settings: firstRevision?.settings || {},
140
- id: firstRevision?.id,
141
- } );
120
+ setCurrentlySelectedRevision( firstRevision );
142
121
  }
143
122
  }, [ shouldSelectFirstItem, firstRevision ] );
144
123
 
@@ -186,7 +165,7 @@ function ScreenRevisions() {
186
165
  />
187
166
  ) ) }
188
167
  <RevisionsButtons
189
- onChange={ selectRevision }
168
+ onChange={ setCurrentlySelectedRevision }
190
169
  selectedRevisionId={ currentlySelectedRevisionId }
191
170
  userRevisions={ currentRevisions }
192
171
  canApplyRevision={ isLoadButtonEnabled }
@@ -219,6 +198,7 @@ function ScreenRevisions() {
219
198
  onCancel={ () =>
220
199
  setIsLoadingRevisionWithUnsavedChanges( false )
221
200
  }
201
+ size="medium"
222
202
  >
223
203
  { __(
224
204
  'Are you sure you want to apply this revision? Any unsaved changes will be lost.'
@@ -201,6 +201,7 @@ export default function ShadowsEditPanel() {
201
201
  setIsConfirmDialogVisible( false );
202
202
  } }
203
203
  confirmButtonText={ __( 'Delete' ) }
204
+ size="medium"
204
205
  >
205
206
  { sprintf(
206
207
  // translators: %s: name of the shadow
@@ -23,11 +23,6 @@
23
23
  overflow: hidden;
24
24
  }
25
25
 
26
- .edit-site-typography-panel__full-width-control {
27
- grid-column: 1 / -1;
28
- max-width: 100%;
29
- }
30
-
31
26
  .edit-site-global-styles-screen {
32
27
  margin: $grid-unit-15 $grid-unit-20 $grid-unit-20;
33
28
  }
@@ -84,8 +79,7 @@
84
79
  color: $gray-800;
85
80
  font-weight: 600;
86
81
  line-height: 1.2;
87
- padding: $grid-unit-20;
88
- padding-bottom: 0;
82
+ padding: $grid-unit-20 $grid-unit-20 0;
89
83
  margin: 0;
90
84
  }
91
85
 
@@ -15,6 +15,7 @@ import { privateApis as editorPrivateApis } from '@wordpress/editor';
15
15
  /**
16
16
  * Internal dependencies
17
17
  */
18
+ import { filterObjectByProperty } from '../../../hooks/use-theme-style-variations/use-theme-style-variations-by-property';
18
19
  import { unlock } from '../../../lock-unlock';
19
20
 
20
21
  const { mergeBaseAndUserConfigs } = unlock( editorPrivateApis );
@@ -22,30 +23,24 @@ const { GlobalStylesContext, areGlobalStyleConfigsEqual } = unlock(
22
23
  blockEditorPrivateApis
23
24
  );
24
25
 
25
- export default function Variation( { variation, children, isPill } ) {
26
+ export default function Variation( { variation, children, isPill, property } ) {
26
27
  const [ isFocused, setIsFocused ] = useState( false );
27
28
  const { base, user, setUserConfig } = useContext( GlobalStylesContext );
28
- const context = useMemo(
29
- () => ( {
30
- user: {
31
- settings: variation.settings ?? {},
32
- styles: variation.styles ?? {},
33
- _links: variation._links ?? {},
34
- },
29
+
30
+ const context = useMemo( () => {
31
+ let merged = mergeBaseAndUserConfigs( base, variation );
32
+ if ( property ) {
33
+ merged = filterObjectByProperty( merged, property );
34
+ }
35
+ return {
36
+ user: variation,
35
37
  base,
36
- merged: mergeBaseAndUserConfigs( base, variation ),
38
+ merged,
37
39
  setUserConfig: () => {},
38
- } ),
39
- [ variation, base ]
40
- );
40
+ };
41
+ }, [ variation, base, property ] );
41
42
 
42
- const selectVariation = () => {
43
- setUserConfig( () => ( {
44
- settings: variation.settings,
45
- styles: variation.styles,
46
- _links: variation._links,
47
- } ) );
48
- };
43
+ const selectVariation = () => setUserConfig( variation );
49
44
 
50
45
  const selectOnEnter = ( event ) => {
51
46
  if ( event.keyCode === ENTER ) {
@@ -27,7 +27,12 @@ export default function ColorVariations( { title, gap = 2 } ) {
27
27
  { title && <Subtitle level={ 3 }>{ title }</Subtitle> }
28
28
  <Grid spacing={ gap }>
29
29
  { colorVariations.map( ( variation, index ) => (
30
- <Variation key={ index } variation={ variation } isPill>
30
+ <Variation
31
+ key={ index }
32
+ variation={ variation }
33
+ isPill
34
+ property="color"
35
+ >
31
36
  { () => <StylesPreviewColors /> }
32
37
  </Variation>
33
38
  ) ) }
@@ -35,7 +35,11 @@ export default function TypographyVariations( { title, gap = 2 } ) {
35
35
  { typographyVariations &&
36
36
  typographyVariations.length &&
37
37
  typographyVariations.map( ( variation, index ) => (
38
- <Variation key={ index } variation={ variation }>
38
+ <Variation
39
+ key={ index }
40
+ variation={ variation }
41
+ property="typography"
42
+ >
39
43
  { ( isFocused ) => (
40
44
  <PreviewIframe
41
45
  label={ variation?.title }
@@ -47,7 +47,6 @@
47
47
  font-weight: 500;
48
48
  }
49
49
 
50
- .edit-site-typography-panel,
51
50
  .edit-site-global-styles-sidebar .block-editor-panel-color-gradient-settings {
52
51
  border: 0;
53
52
  }