@wordpress/block-library 6.0.18 → 6.0.24

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 (78) hide show
  1. package/build/gallery/deprecated.js +1 -5
  2. package/build/gallery/deprecated.js.map +1 -1
  3. package/build/gallery/edit.js +0 -7
  4. package/build/gallery/edit.js.map +1 -1
  5. package/build/navigation/edit/index.js +8 -2
  6. package/build/navigation/edit/index.js.map +1 -1
  7. package/build/navigation/edit/navigation-menu-selector.js +42 -4
  8. package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
  9. package/build/navigation/edit/placeholder/index.js +6 -41
  10. package/build/navigation/edit/placeholder/index.js.map +1 -1
  11. package/build/navigation/index.js +0 -1
  12. package/build/navigation/index.js.map +1 -1
  13. package/build/navigation/use-convert-classic-menu.js +59 -0
  14. package/build/navigation/use-convert-classic-menu.js.map +1 -0
  15. package/build/navigation/view.js +1 -1
  16. package/build/navigation/view.js.map +1 -1
  17. package/build/site-logo/edit.js +2 -2
  18. package/build/site-logo/edit.js.map +1 -1
  19. package/build/template-part/index.js +0 -8
  20. package/build/template-part/index.js.map +1 -1
  21. package/build-module/gallery/deprecated.js +2 -6
  22. package/build-module/gallery/deprecated.js.map +1 -1
  23. package/build-module/gallery/edit.js +0 -6
  24. package/build-module/gallery/edit.js.map +1 -1
  25. package/build-module/navigation/edit/index.js +7 -2
  26. package/build-module/navigation/edit/index.js.map +1 -1
  27. package/build-module/navigation/edit/navigation-menu-selector.js +39 -4
  28. package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
  29. package/build-module/navigation/edit/placeholder/index.js +5 -41
  30. package/build-module/navigation/edit/placeholder/index.js.map +1 -1
  31. package/build-module/navigation/index.js +0 -1
  32. package/build-module/navigation/index.js.map +1 -1
  33. package/build-module/navigation/use-convert-classic-menu.js +47 -0
  34. package/build-module/navigation/use-convert-classic-menu.js.map +1 -0
  35. package/build-module/navigation/view.js +1 -1
  36. package/build-module/navigation/view.js.map +1 -1
  37. package/build-module/site-logo/edit.js +2 -2
  38. package/build-module/site-logo/edit.js.map +1 -1
  39. package/build-module/template-part/index.js +0 -8
  40. package/build-module/template-part/index.js.map +1 -1
  41. package/build-style/common-rtl.css +2 -2
  42. package/build-style/common.css +2 -2
  43. package/build-style/editor-rtl.css +2 -2
  44. package/build-style/editor.css +2 -2
  45. package/build-style/navigation/style-rtl.css +1 -0
  46. package/build-style/navigation/style.css +1 -0
  47. package/build-style/page-list/style-rtl.css +4 -4
  48. package/build-style/page-list/style.css +4 -4
  49. package/build-style/post-template/style-rtl.css +2 -29
  50. package/build-style/post-template/style.css +2 -29
  51. package/build-style/style-rtl.css +9 -35
  52. package/build-style/style.css +9 -35
  53. package/package.json +8 -9
  54. package/src/common.scss +2 -2
  55. package/src/editor.scss +2 -2
  56. package/src/gallery/deprecated.js +2 -5
  57. package/src/gallery/edit.js +0 -7
  58. package/src/navigation/block.json +0 -1
  59. package/src/navigation/edit/index.js +9 -1
  60. package/src/navigation/edit/navigation-menu-selector.js +65 -15
  61. package/src/navigation/edit/placeholder/index.js +9 -44
  62. package/src/navigation/style.scss +1 -0
  63. package/src/navigation/use-convert-classic-menu.js +58 -0
  64. package/src/navigation/view.js +1 -1
  65. package/src/navigation-submenu/index.php +2 -2
  66. package/src/page-list/index.php +1 -1
  67. package/src/page-list/style.scss +4 -4
  68. package/src/post-content/index.php +5 -0
  69. package/src/post-template/style.scss +2 -13
  70. package/src/query-pagination-next/index.php +3 -2
  71. package/src/search/index.php +9 -9
  72. package/src/site-logo/edit.js +3 -2
  73. package/src/template-part/block.json +0 -8
  74. package/build/gallery/use-mobile-warning.js +0 -43
  75. package/build/gallery/use-mobile-warning.js.map +0 -1
  76. package/build-module/gallery/use-mobile-warning.js +0 -32
  77. package/build-module/gallery/use-mobile-warning.js.map +0 -1
  78. package/src/gallery/use-mobile-warning.js +0 -28
@@ -82,64 +82,37 @@
82
82
  list-style: none;
83
83
  padding: 0;
84
84
  }
85
- .wp-block-post-template li,
86
- .wp-block-query-loop li {
87
- clear: both;
88
- }
89
85
  .wp-block-post-template.is-flex-container,
90
86
  .wp-block-query-loop.is-flex-container {
91
87
  flex-direction: row;
92
88
  display: flex;
93
89
  flex-wrap: wrap;
90
+ gap: 1.25em;
94
91
  }
95
92
  .wp-block-post-template.is-flex-container li,
96
93
  .wp-block-query-loop.is-flex-container li {
97
- margin: 0 0 1.25em 0;
94
+ margin: 0;
98
95
  width: 100%;
99
96
  }
100
97
  @media (min-width: 600px) {
101
- .wp-block-post-template.is-flex-container li,
102
- .wp-block-query-loop.is-flex-container li {
103
- margin-right: 1.25em;
104
- }
105
98
  .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li,
106
99
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-2 > li {
107
100
  width: calc((100% / 2) - 1.25em + (1.25em / 2));
108
101
  }
109
- .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li:nth-child(2n),
110
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-2 > li:nth-child(2n) {
111
- margin-right: 0;
112
- }
113
102
  .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li,
114
103
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-3 > li {
115
104
  width: calc((100% / 3) - 1.25em + (1.25em / 3));
116
105
  }
117
- .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li:nth-child(3n),
118
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-3 > li:nth-child(3n) {
119
- margin-right: 0;
120
- }
121
106
  .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li,
122
107
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-4 > li {
123
108
  width: calc((100% / 4) - 1.25em + (1.25em / 4));
124
109
  }
125
- .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li:nth-child(4n),
126
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-4 > li:nth-child(4n) {
127
- margin-right: 0;
128
- }
129
110
  .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li,
130
111
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-5 > li {
131
112
  width: calc((100% / 5) - 1.25em + (1.25em / 5));
132
113
  }
133
- .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li:nth-child(5n),
134
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-5 > li:nth-child(5n) {
135
- margin-right: 0;
136
- }
137
114
  .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li,
138
115
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-6 > li {
139
116
  width: calc((100% / 6) - 1.25em + (1.25em / 6));
140
117
  }
141
- .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li:nth-child(6n),
142
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-6 > li:nth-child(6n) {
143
- margin-right: 0;
144
- }
145
118
  }
@@ -1557,6 +1557,7 @@ ul.has-background {
1557
1557
  .wp-block-navigation.is-vertical {
1558
1558
  --navigation-layout-direction: column;
1559
1559
  --navigation-layout-justify: initial;
1560
+ --navigation-layout-align: flex-start;
1560
1561
  }
1561
1562
  .wp-block-navigation.no-wrap {
1562
1563
  --navigation-layout-wrap: nowrap;
@@ -1959,10 +1960,10 @@ html.has-modal-open {
1959
1960
 
1960
1961
  .wp-block-navigation .wp-block-page-list {
1961
1962
  display: flex;
1962
- flex-direction: var(--layout-direction, initial);
1963
- justify-content: var(--layout-justify, initial);
1964
- align-items: var(--layout-align, initial);
1965
- flex-wrap: var(--layout-wrap, wrap);
1963
+ flex-direction: var(--navigation-layout-direction, initial);
1964
+ justify-content: var(--navigation-layout-justify, initial);
1965
+ align-items: var(--navigation-layout-align, initial);
1966
+ flex-wrap: var(--navigation-layout-wrap, wrap);
1966
1967
  background-color: inherit;
1967
1968
  }
1968
1969
  .wp-block-navigation .wp-block-navigation-item {
@@ -2264,66 +2265,39 @@ p.has-background {
2264
2265
  list-style: none;
2265
2266
  padding: 0;
2266
2267
  }
2267
- .wp-block-post-template li,
2268
- .wp-block-query-loop li {
2269
- clear: both;
2270
- }
2271
2268
  .wp-block-post-template.is-flex-container,
2272
2269
  .wp-block-query-loop.is-flex-container {
2273
2270
  flex-direction: row;
2274
2271
  display: flex;
2275
2272
  flex-wrap: wrap;
2273
+ gap: 1.25em;
2276
2274
  }
2277
2275
  .wp-block-post-template.is-flex-container li,
2278
2276
  .wp-block-query-loop.is-flex-container li {
2279
- margin: 0 0 1.25em 0;
2277
+ margin: 0;
2280
2278
  width: 100%;
2281
2279
  }
2282
2280
  @media (min-width: 600px) {
2283
- .wp-block-post-template.is-flex-container li,
2284
- .wp-block-query-loop.is-flex-container li {
2285
- margin-left: 1.25em;
2286
- }
2287
2281
  .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li,
2288
2282
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-2 > li {
2289
2283
  width: calc((100% / 2) - 1.25em + (1.25em / 2));
2290
2284
  }
2291
- .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li:nth-child(2n),
2292
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-2 > li:nth-child(2n) {
2293
- margin-left: 0;
2294
- }
2295
2285
  .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li,
2296
2286
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-3 > li {
2297
2287
  width: calc((100% / 3) - 1.25em + (1.25em / 3));
2298
2288
  }
2299
- .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li:nth-child(3n),
2300
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-3 > li:nth-child(3n) {
2301
- margin-left: 0;
2302
- }
2303
2289
  .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li,
2304
2290
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-4 > li {
2305
2291
  width: calc((100% / 4) - 1.25em + (1.25em / 4));
2306
2292
  }
2307
- .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li:nth-child(4n),
2308
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-4 > li:nth-child(4n) {
2309
- margin-left: 0;
2310
- }
2311
2293
  .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li,
2312
2294
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-5 > li {
2313
2295
  width: calc((100% / 5) - 1.25em + (1.25em / 5));
2314
2296
  }
2315
- .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li:nth-child(5n),
2316
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-5 > li:nth-child(5n) {
2317
- margin-left: 0;
2318
- }
2319
2297
  .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li,
2320
2298
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-6 > li {
2321
2299
  width: calc((100% / 6) - 1.25em + (1.25em / 6));
2322
2300
  }
2323
- .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li:nth-child(6n),
2324
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-6 > li:nth-child(6n) {
2325
- margin-left: 0;
2326
- }
2327
2301
  }
2328
2302
 
2329
2303
  .wp-block-query-pagination > .wp-block-query-pagination-next,
@@ -3122,11 +3096,11 @@ pre.wp-block-verse {
3122
3096
  }
3123
3097
 
3124
3098
  .has-normal-font-size {
3125
- font-size: var(--wp--preset--font-size--normal) !important;
3099
+ font-size: var(--wp--preset--font-size--normal);
3126
3100
  }
3127
3101
 
3128
3102
  .has-huge-font-size {
3129
- font-size: var(--wp--preset--font-size--huge) !important;
3103
+ font-size: var(--wp--preset--font-size--huge);
3130
3104
  }
3131
3105
 
3132
3106
  .has-text-align-center {
@@ -1579,6 +1579,7 @@ ul.has-background {
1579
1579
  .wp-block-navigation.is-vertical {
1580
1580
  --navigation-layout-direction: column;
1581
1581
  --navigation-layout-justify: initial;
1582
+ --navigation-layout-align: flex-start;
1582
1583
  }
1583
1584
  .wp-block-navigation.no-wrap {
1584
1585
  --navigation-layout-wrap: nowrap;
@@ -1981,10 +1982,10 @@ html.has-modal-open {
1981
1982
 
1982
1983
  .wp-block-navigation .wp-block-page-list {
1983
1984
  display: flex;
1984
- flex-direction: var(--layout-direction, initial);
1985
- justify-content: var(--layout-justify, initial);
1986
- align-items: var(--layout-align, initial);
1987
- flex-wrap: var(--layout-wrap, wrap);
1985
+ flex-direction: var(--navigation-layout-direction, initial);
1986
+ justify-content: var(--navigation-layout-justify, initial);
1987
+ align-items: var(--navigation-layout-align, initial);
1988
+ flex-wrap: var(--navigation-layout-wrap, wrap);
1988
1989
  background-color: inherit;
1989
1990
  }
1990
1991
  .wp-block-navigation .wp-block-navigation-item {
@@ -2286,66 +2287,39 @@ p.has-background {
2286
2287
  list-style: none;
2287
2288
  padding: 0;
2288
2289
  }
2289
- .wp-block-post-template li,
2290
- .wp-block-query-loop li {
2291
- clear: both;
2292
- }
2293
2290
  .wp-block-post-template.is-flex-container,
2294
2291
  .wp-block-query-loop.is-flex-container {
2295
2292
  flex-direction: row;
2296
2293
  display: flex;
2297
2294
  flex-wrap: wrap;
2295
+ gap: 1.25em;
2298
2296
  }
2299
2297
  .wp-block-post-template.is-flex-container li,
2300
2298
  .wp-block-query-loop.is-flex-container li {
2301
- margin: 0 0 1.25em 0;
2299
+ margin: 0;
2302
2300
  width: 100%;
2303
2301
  }
2304
2302
  @media (min-width: 600px) {
2305
- .wp-block-post-template.is-flex-container li,
2306
- .wp-block-query-loop.is-flex-container li {
2307
- margin-right: 1.25em;
2308
- }
2309
2303
  .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li,
2310
2304
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-2 > li {
2311
2305
  width: calc((100% / 2) - 1.25em + (1.25em / 2));
2312
2306
  }
2313
- .wp-block-post-template.is-flex-container.is-flex-container.columns-2 > li:nth-child(2n),
2314
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-2 > li:nth-child(2n) {
2315
- margin-right: 0;
2316
- }
2317
2307
  .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li,
2318
2308
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-3 > li {
2319
2309
  width: calc((100% / 3) - 1.25em + (1.25em / 3));
2320
2310
  }
2321
- .wp-block-post-template.is-flex-container.is-flex-container.columns-3 > li:nth-child(3n),
2322
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-3 > li:nth-child(3n) {
2323
- margin-right: 0;
2324
- }
2325
2311
  .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li,
2326
2312
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-4 > li {
2327
2313
  width: calc((100% / 4) - 1.25em + (1.25em / 4));
2328
2314
  }
2329
- .wp-block-post-template.is-flex-container.is-flex-container.columns-4 > li:nth-child(4n),
2330
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-4 > li:nth-child(4n) {
2331
- margin-right: 0;
2332
- }
2333
2315
  .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li,
2334
2316
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-5 > li {
2335
2317
  width: calc((100% / 5) - 1.25em + (1.25em / 5));
2336
2318
  }
2337
- .wp-block-post-template.is-flex-container.is-flex-container.columns-5 > li:nth-child(5n),
2338
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-5 > li:nth-child(5n) {
2339
- margin-right: 0;
2340
- }
2341
2319
  .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li,
2342
2320
  .wp-block-query-loop.is-flex-container.is-flex-container.columns-6 > li {
2343
2321
  width: calc((100% / 6) - 1.25em + (1.25em / 6));
2344
2322
  }
2345
- .wp-block-post-template.is-flex-container.is-flex-container.columns-6 > li:nth-child(6n),
2346
- .wp-block-query-loop.is-flex-container.is-flex-container.columns-6 > li:nth-child(6n) {
2347
- margin-right: 0;
2348
- }
2349
2323
  }
2350
2324
 
2351
2325
  .wp-block-query-pagination > .wp-block-query-pagination-next,
@@ -3149,11 +3123,11 @@ pre.wp-block-verse {
3149
3123
  }
3150
3124
 
3151
3125
  .has-normal-font-size {
3152
- font-size: var(--wp--preset--font-size--normal) !important;
3126
+ font-size: var(--wp--preset--font-size--normal);
3153
3127
  }
3154
3128
 
3155
3129
  .has-huge-font-size {
3156
- font-size: var(--wp--preset--font-size--huge) !important;
3130
+ font-size: var(--wp--preset--font-size--huge);
3157
3131
  }
3158
3132
 
3159
3133
  .has-text-align-center {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "6.0.18",
3
+ "version": "6.0.24",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -37,9 +37,9 @@
37
37
  "@wordpress/api-fetch": "^5.2.6",
38
38
  "@wordpress/autop": "^3.2.3",
39
39
  "@wordpress/blob": "^3.2.2",
40
- "@wordpress/block-editor": "^8.0.13",
40
+ "@wordpress/block-editor": "^8.0.15",
41
41
  "@wordpress/blocks": "^11.1.5",
42
- "@wordpress/components": "^19.2.0",
42
+ "@wordpress/components": "^19.2.2",
43
43
  "@wordpress/compose": "^5.0.7",
44
44
  "@wordpress/core-data": "^4.0.9",
45
45
  "@wordpress/data": "^6.1.5",
@@ -52,14 +52,13 @@
52
52
  "@wordpress/html-entities": "^3.2.3",
53
53
  "@wordpress/i18n": "^4.2.4",
54
54
  "@wordpress/icons": "^6.1.1",
55
- "@wordpress/interface": "^4.1.15",
56
55
  "@wordpress/is-shallow-equal": "^4.2.1",
57
56
  "@wordpress/keycodes": "^3.2.4",
58
57
  "@wordpress/notices": "^3.2.8",
59
58
  "@wordpress/primitives": "^3.0.4",
60
- "@wordpress/reusable-blocks": "^3.0.19",
61
- "@wordpress/rich-text": "^5.0.7",
62
- "@wordpress/server-side-render": "^3.0.17",
59
+ "@wordpress/reusable-blocks": "^3.0.21",
60
+ "@wordpress/rich-text": "^5.0.8",
61
+ "@wordpress/server-side-render": "^3.0.19",
63
62
  "@wordpress/url": "^3.3.1",
64
63
  "@wordpress/viewport": "^4.0.7",
65
64
  "classnames": "^2.3.1",
@@ -67,11 +66,11 @@
67
66
  "fast-average-color": "4.3.0",
68
67
  "lodash": "^4.17.21",
69
68
  "memize": "^1.1.0",
70
- "micromodal": "^0.4.9",
69
+ "micromodal": "^0.4.10",
71
70
  "moment": "^2.22.1"
72
71
  },
73
72
  "publishConfig": {
74
73
  "access": "public"
75
74
  },
76
- "gitHead": "f70f4664ac641bd107481c5c67ee6f5556a0a381"
75
+ "gitHead": "823b3225e81748f8febb808e780e2b71478bc854"
77
76
  }
package/src/common.scss CHANGED
@@ -22,11 +22,11 @@
22
22
  }
23
23
 
24
24
  .has-normal-font-size {
25
- font-size: var(--wp--preset--font-size--normal) !important;
25
+ font-size: var(--wp--preset--font-size--normal);
26
26
  }
27
27
 
28
28
  .has-huge-font-size {
29
- font-size: var(--wp--preset--font-size--huge) !important;
29
+ font-size: var(--wp--preset--font-size--huge);
30
30
  }
31
31
 
32
32
  // Text alignments.
package/src/editor.scss CHANGED
@@ -70,11 +70,11 @@
70
70
  }
71
71
 
72
72
  .editor-styles-wrapper .has-normal-font-size {
73
- font-size: var(--wp--preset--font-size--normal) !important;
73
+ font-size: var(--wp--preset--font-size--normal);
74
74
  }
75
75
 
76
76
  .editor-styles-wrapper .has-huge-font-size {
77
- font-size: var(--wp--preset--font-size--huge) !important;
77
+ font-size: var(--wp--preset--font-size--huge);
78
78
  }
79
79
 
80
80
  /**
@@ -2,7 +2,7 @@
2
2
  * External dependencies
3
3
  */
4
4
  import classnames from 'classnames';
5
- import { map, some } from 'lodash';
5
+ import { map, some, omit } from 'lodash';
6
6
 
7
7
  /**
8
8
  * WordPress dependencies
@@ -97,11 +97,8 @@ function runV2Migration( attributes ) {
97
97
 
98
98
  return [
99
99
  {
100
- caption: attributes.caption,
101
- columns: attributes.columns,
102
- imageCrop: attributes.imageCrop,
100
+ ...omit( attributes, [ 'images', 'ids' ] ),
103
101
  linkTo,
104
- sizeSlug: attributes.sizeSlug,
105
102
  allowResize: false,
106
103
  },
107
104
  imageBlocks,
@@ -53,11 +53,6 @@ import useShortCodeTransform from './use-short-code-transform';
53
53
  import useGetNewImages from './use-get-new-images';
54
54
  import useGetMedia from './use-get-media';
55
55
 
56
- /**
57
- * Internal dependencies
58
- */
59
- import useMobileWarning from './use-mobile-warning';
60
-
61
56
  const MAX_COLUMNS = 8;
62
57
  const linkOptions = [
63
58
  { value: LINK_DESTINATION_ATTACHMENT, label: __( 'Attachment Page' ) },
@@ -139,8 +134,6 @@ function GalleryEdit( props ) {
139
134
 
140
135
  const newImages = useGetNewImages( images, imageData );
141
136
 
142
- useMobileWarning( newImages );
143
-
144
137
  useEffect( () => {
145
138
  newImages?.forEach( ( newImage ) => {
146
139
  updateBlockAttributes( newImage.clientId, {
@@ -92,7 +92,6 @@
92
92
  "__experimentalFontWeight": true,
93
93
  "__experimentalTextTransform": true,
94
94
  "__experimentalFontFamily": true,
95
- "__experimentalTextDecoration": true,
96
95
  "__experimentalDefaultControls": {
97
96
  "fontSize": true
98
97
  }
@@ -45,6 +45,7 @@ import { __ } from '@wordpress/i18n';
45
45
  */
46
46
  import useListViewModal from './use-list-view-modal';
47
47
  import useNavigationMenu from '../use-navigation-menu';
48
+ import useNavigationEntities from '../use-navigation-entities';
48
49
  import Placeholder from './placeholder';
49
50
  import PlaceholderPreview from './placeholder/placeholder-preview';
50
51
  import ResponsiveWrapper from './responsive-wrapper';
@@ -151,6 +152,10 @@ function Navigation( {
151
152
  `navigationMenu/${ ref }`
152
153
  );
153
154
 
155
+ // Preload classic menus, so that they don't suddenly pop-in when viewing
156
+ // the Select Menu dropdown.
157
+ useNavigationEntities();
158
+
154
159
  const {
155
160
  hasUncontrolledInnerBlocks,
156
161
  uncontrolledInnerBlocks,
@@ -474,12 +479,15 @@ function Navigation( {
474
479
  >
475
480
  { ( { onClose } ) => (
476
481
  <NavigationMenuSelector
482
+ clientId={ clientId }
477
483
  onSelect={ ( { id } ) => {
478
484
  setRef( id );
479
485
  onClose();
480
486
  } }
481
487
  onCreateNew={ startWithEmptyMenu }
482
- showCreate={ canUserCreateNavigation }
488
+ canUserCreateNavigation={
489
+ canUserCreateNavigation
490
+ }
483
491
  />
484
492
  ) }
485
493
  </ToolbarDropdownMenu>
@@ -11,18 +11,47 @@ import { addQueryArgs } from '@wordpress/url';
11
11
  * Internal dependencies
12
12
  */
13
13
  import useNavigationMenu from '../use-navigation-menu';
14
+ import useNavigationEntities from '../use-navigation-entities';
15
+ import useConvertClassicMenu from '../use-convert-classic-menu';
16
+ import useCreateNavigationMenu from './use-create-navigation-menu';
14
17
 
15
18
  export default function NavigationMenuSelector( {
19
+ clientId,
16
20
  onSelect,
17
21
  onCreateNew,
18
- showCreate = false,
22
+ canUserCreateNavigation = false,
19
23
  } ) {
24
+ const {
25
+ menus: classicMenus,
26
+ hasMenus: hasClassicMenus,
27
+ } = useNavigationEntities();
20
28
  const { navigationMenus } = useNavigationMenu();
21
29
  const ref = useEntityId( 'postType', 'wp_navigation' );
22
30
 
31
+ const createNavigationMenu = useCreateNavigationMenu( clientId );
32
+
33
+ const onFinishMenuCreation = async (
34
+ blocks,
35
+ navigationMenuTitle = null
36
+ ) => {
37
+ if ( ! canUserCreateNavigation ) {
38
+ return;
39
+ }
40
+
41
+ const navigationMenu = await createNavigationMenu(
42
+ navigationMenuTitle,
43
+ blocks
44
+ );
45
+ onSelect( navigationMenu );
46
+ };
47
+
48
+ const convertClassicMenuToBlocks = useConvertClassicMenu(
49
+ onFinishMenuCreation
50
+ );
51
+
23
52
  return (
24
53
  <>
25
- <MenuGroup>
54
+ <MenuGroup label={ __( 'Menus' ) }>
26
55
  <MenuItemsChoice
27
56
  value={ ref }
28
57
  onSelect={ ( selectedId ) =>
@@ -46,19 +75,40 @@ export default function NavigationMenuSelector( {
46
75
  } ) }
47
76
  />
48
77
  </MenuGroup>
49
- { showCreate && (
50
- <MenuGroup>
51
- <MenuItem onClick={ onCreateNew }>
52
- { __( 'Create new menu' ) }
53
- </MenuItem>
54
- <MenuItem
55
- href={ addQueryArgs( 'edit.php', {
56
- post_type: 'wp_navigation',
57
- } ) }
58
- >
59
- { __( 'Manage menus' ) }
60
- </MenuItem>
61
- </MenuGroup>
78
+ { canUserCreateNavigation && (
79
+ <>
80
+ { hasClassicMenus && (
81
+ <MenuGroup label={ __( 'Classic Menus' ) }>
82
+ { classicMenus.map( ( menu ) => {
83
+ return (
84
+ <MenuItem
85
+ onClick={ () => {
86
+ convertClassicMenuToBlocks(
87
+ menu.id,
88
+ menu.name
89
+ );
90
+ } }
91
+ key={ menu.id }
92
+ >
93
+ { decodeEntities( menu.name ) }
94
+ </MenuItem>
95
+ );
96
+ } ) }
97
+ </MenuGroup>
98
+ ) }
99
+ <MenuGroup label={ __( 'Tools' ) }>
100
+ <MenuItem onClick={ onCreateNew }>
101
+ { __( 'Create new menu' ) }
102
+ </MenuItem>
103
+ <MenuItem
104
+ href={ addQueryArgs( 'edit.php', {
105
+ post_type: 'wp_navigation',
106
+ } ) }
107
+ >
108
+ { __( 'Manage menus' ) }
109
+ </MenuItem>
110
+ </MenuGroup>
111
+ </>
62
112
  ) }
63
113
  </>
64
114
  );
@@ -9,7 +9,6 @@ import {
9
9
  MenuGroup,
10
10
  MenuItem,
11
11
  } from '@wordpress/components';
12
- import { useCallback, useState, useEffect } from '@wordpress/element';
13
12
  import { __ } from '@wordpress/i18n';
14
13
  import { navigation, Icon } from '@wordpress/icons';
15
14
  import { decodeEntities } from '@wordpress/html-entities';
@@ -20,14 +19,13 @@ import { decodeEntities } from '@wordpress/html-entities';
20
19
 
21
20
  import useNavigationEntities from '../../use-navigation-entities';
22
21
  import PlaceholderPreview from './placeholder-preview';
23
- import menuItemsToBlocks from '../../menu-items-to-blocks';
24
22
  import useNavigationMenu from '../../use-navigation-menu';
25
23
  import useCreateNavigationMenu from '../use-create-navigation-menu';
24
+ import useConvertClassicMenu from '../../use-convert-classic-menu';
26
25
 
27
26
  const ExistingMenusDropdown = ( {
28
27
  canSwitchNavigationMenu,
29
28
  navigationMenus,
30
- setSelectedMenu,
31
29
  onFinish,
32
30
  menus,
33
31
  onCreateFromMenu,
@@ -53,7 +51,6 @@ const ExistingMenusDropdown = ( {
53
51
  return (
54
52
  <MenuItem
55
53
  onClick={ () => {
56
- setSelectedMenu( menu.id );
57
54
  onFinish( menu );
58
55
  } }
59
56
  onClose={ onClose }
@@ -72,8 +69,10 @@ const ExistingMenusDropdown = ( {
72
69
  return (
73
70
  <MenuItem
74
71
  onClick={ () => {
75
- setSelectedMenu( menu.id );
76
- onCreateFromMenu( menu.name );
72
+ onCreateFromMenu(
73
+ menu.id,
74
+ menu.name
75
+ );
77
76
  } }
78
77
  onClose={ onClose }
79
78
  key={ menu.id }
@@ -97,9 +96,6 @@ export default function NavigationPlaceholder( {
97
96
  hasResolvedNavigationMenus,
98
97
  canUserCreateNavigation = false,
99
98
  } ) {
100
- const [ selectedMenu, setSelectedMenu ] = useState();
101
- const [ isCreatingFromMenu, setIsCreatingFromMenu ] = useState( false );
102
- const [ menuName, setMenuName ] = useState( '' );
103
99
  const createNavigationMenu = useCreateNavigationMenu( clientId );
104
100
 
105
101
  const onFinishMenuCreation = async (
@@ -117,39 +113,18 @@ export default function NavigationPlaceholder( {
117
113
  onFinish( navigationMenu, blocks );
118
114
  };
119
115
 
116
+ const convertClassicMenu = useConvertClassicMenu( onFinishMenuCreation );
117
+
120
118
  const {
121
119
  isResolvingPages,
122
120
  menus,
123
121
  isResolvingMenus,
124
- menuItems,
125
- hasResolvedMenuItems,
126
122
  hasPages,
127
123
  hasMenus,
128
- } = useNavigationEntities( selectedMenu );
124
+ } = useNavigationEntities();
129
125
 
130
126
  const isStillLoading = isResolvingPages || isResolvingMenus;
131
127
 
132
- const createFromMenu = useCallback(
133
- ( name ) => {
134
- const { innerBlocks: blocks } = menuItemsToBlocks( menuItems );
135
- onFinishMenuCreation( blocks, name );
136
- },
137
- [ menuItems, menuItemsToBlocks, onFinish ]
138
- );
139
-
140
- const onCreateFromMenu = ( name ) => {
141
- // If we have menu items, create the block right away.
142
- if ( hasResolvedMenuItems ) {
143
- createFromMenu( name );
144
- return;
145
- }
146
-
147
- // Otherwise, create the block when resolution finishes.
148
- setIsCreatingFromMenu( true );
149
- // Store the name to use later.
150
- setMenuName( name );
151
- };
152
-
153
128
  const onCreateEmptyMenu = () => {
154
129
  onFinishMenuCreation( [] );
155
130
  };
@@ -159,15 +134,6 @@ export default function NavigationPlaceholder( {
159
134
  onFinishMenuCreation( block );
160
135
  };
161
136
 
162
- useEffect( () => {
163
- // If the user selected a menu but we had to wait for menu items to
164
- // finish resolving, then create the block once resolution finishes.
165
- if ( isCreatingFromMenu && hasResolvedMenuItems ) {
166
- createFromMenu( menuName );
167
- setIsCreatingFromMenu( false );
168
- }
169
- }, [ isCreatingFromMenu, hasResolvedMenuItems, menuName ] );
170
-
171
137
  const { navigationMenus } = useNavigationMenu();
172
138
 
173
139
  return (
@@ -194,10 +160,9 @@ export default function NavigationPlaceholder( {
194
160
  canSwitchNavigationMenu
195
161
  }
196
162
  navigationMenus={ navigationMenus }
197
- setSelectedMenu={ setSelectedMenu }
198
163
  onFinish={ onFinish }
199
164
  menus={ menus }
200
- onCreateFromMenu={ onCreateFromMenu }
165
+ onCreateFromMenu={ convertClassicMenu }
201
166
  showClassicMenus={
202
167
  canUserCreateNavigation
203
168
  }
@@ -117,6 +117,7 @@ $navigation-icon-size: 24px;
117
117
  &.is-vertical {
118
118
  --navigation-layout-direction: column;
119
119
  --navigation-layout-justify: initial;
120
+ --navigation-layout-align: flex-start;
120
121
  }
121
122
 
122
123
  &.no-wrap {