@wordpress/block-library 8.19.2 → 8.19.4

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 (79) hide show
  1. package/CHANGELOG.md +7 -0
  2. package/build/cover/edit/inspector-controls.js +1 -1
  3. package/build/cover/edit/inspector-controls.js.map +1 -1
  4. package/build/embed/edit.js +17 -0
  5. package/build/embed/edit.js.map +1 -1
  6. package/build/embed/edit.native.js +17 -0
  7. package/build/embed/edit.native.js.map +1 -1
  8. package/build/image/image.js +2 -2
  9. package/build/image/image.js.map +1 -1
  10. package/build/image/view.js +142 -31
  11. package/build/image/view.js.map +1 -1
  12. package/build/latest-posts/edit.js +6 -2
  13. package/build/latest-posts/edit.js.map +1 -1
  14. package/build/media-text/edit.js +1 -1
  15. package/build/media-text/edit.js.map +1 -1
  16. package/build/navigation/edit/deleted-navigation-warning.js +6 -4
  17. package/build/navigation/edit/deleted-navigation-warning.js.map +1 -1
  18. package/build/navigation/edit/index.js +3 -2
  19. package/build/navigation/edit/index.js.map +1 -1
  20. package/build/navigation/edit/inner-blocks.js +2 -1
  21. package/build/navigation/edit/inner-blocks.js.map +1 -1
  22. package/build/paragraph/edit.js +1 -1
  23. package/build/paragraph/edit.js.map +1 -1
  24. package/build/search/edit.js +12 -10
  25. package/build/search/edit.js.map +1 -1
  26. package/build-module/cover/edit/inspector-controls.js +1 -1
  27. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  28. package/build-module/embed/edit.js +17 -0
  29. package/build-module/embed/edit.js.map +1 -1
  30. package/build-module/embed/edit.native.js +17 -0
  31. package/build-module/embed/edit.native.js.map +1 -1
  32. package/build-module/image/image.js +2 -2
  33. package/build-module/image/image.js.map +1 -1
  34. package/build-module/image/view.js +142 -31
  35. package/build-module/image/view.js.map +1 -1
  36. package/build-module/latest-posts/edit.js +6 -2
  37. package/build-module/latest-posts/edit.js.map +1 -1
  38. package/build-module/media-text/edit.js +1 -1
  39. package/build-module/media-text/edit.js.map +1 -1
  40. package/build-module/navigation/edit/deleted-navigation-warning.js +7 -4
  41. package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -1
  42. package/build-module/navigation/edit/index.js +3 -2
  43. package/build-module/navigation/edit/index.js.map +1 -1
  44. package/build-module/navigation/edit/inner-blocks.js +2 -1
  45. package/build-module/navigation/edit/inner-blocks.js.map +1 -1
  46. package/build-module/paragraph/edit.js +1 -1
  47. package/build-module/paragraph/edit.js.map +1 -1
  48. package/build-module/search/edit.js +12 -10
  49. package/build-module/search/edit.js.map +1 -1
  50. package/build-style/image/style-rtl.css +17 -6
  51. package/build-style/image/style.css +17 -6
  52. package/build-style/navigation-link/style-rtl.css +0 -1
  53. package/build-style/navigation-link/style.css +0 -1
  54. package/build-style/post-featured-image/style-rtl.css +3 -0
  55. package/build-style/post-featured-image/style.css +3 -0
  56. package/build-style/post-template/style-rtl.css +25 -0
  57. package/build-style/post-template/style.css +25 -0
  58. package/build-style/style-rtl.css +46 -7
  59. package/build-style/style.css +46 -7
  60. package/package.json +32 -32
  61. package/src/cover/edit/inspector-controls.js +1 -1
  62. package/src/embed/edit.js +15 -0
  63. package/src/embed/edit.native.js +15 -0
  64. package/src/footnotes/index.php +13 -179
  65. package/src/image/image.js +2 -2
  66. package/src/image/index.php +73 -48
  67. package/src/image/style.scss +23 -6
  68. package/src/image/view.js +151 -48
  69. package/src/latest-posts/edit.js +10 -2
  70. package/src/latest-posts/index.php +18 -8
  71. package/src/media-text/edit.js +1 -1
  72. package/src/navigation/edit/deleted-navigation-warning.js +9 -4
  73. package/src/navigation/edit/index.js +26 -17
  74. package/src/navigation/edit/inner-blocks.js +1 -0
  75. package/src/navigation-link/style.scss +0 -1
  76. package/src/paragraph/edit.js +1 -1
  77. package/src/post-featured-image/style.scss +4 -0
  78. package/src/post-template/style.scss +20 -0
  79. package/src/search/edit.js +16 -10
@@ -201,6 +201,8 @@
201
201
 
202
202
  .wp-lightbox-container {
203
203
  position: relative;
204
+ display: flex;
205
+ flex-direction: column;
204
206
  }
205
207
  .wp-lightbox-container button {
206
208
  border: none;
@@ -216,6 +218,10 @@
216
218
  outline: 5px auto -webkit-focus-ring-color;
217
219
  outline-offset: 5px;
218
220
  }
221
+ .wp-lightbox-container button:hover, .wp-lightbox-container button:focus, .wp-lightbox-container button:not(:hover):not(:active):not(.has-background) {
222
+ background: none;
223
+ border: none;
224
+ }
219
225
 
220
226
  .wp-lightbox-overlay {
221
227
  position: fixed;
@@ -231,11 +237,20 @@
231
237
  }
232
238
  .wp-lightbox-overlay .close-button {
233
239
  position: absolute;
234
- top: calc(env(safe-area-inset-top) + 12.5px);
235
- left: calc(env(safe-area-inset-left) + 12.5px);
240
+ top: calc(env(safe-area-inset-top) + 16px);
241
+ left: calc(env(safe-area-inset-left) + 16px);
236
242
  padding: 0;
237
243
  cursor: pointer;
238
244
  z-index: 5000000;
245
+ min-width: 40px;
246
+ min-height: 40px;
247
+ display: flex;
248
+ align-items: center;
249
+ justify-content: center;
250
+ }
251
+ .wp-lightbox-overlay .close-button:hover, .wp-lightbox-overlay .close-button:focus, .wp-lightbox-overlay .close-button:not(:hover):not(:active):not(.has-background) {
252
+ background: none;
253
+ border: none;
239
254
  }
240
255
  .wp-lightbox-overlay .lightbox-image-container {
241
256
  position: absolute;
@@ -323,10 +338,6 @@
323
338
  }
324
339
  }
325
340
 
326
- html.wp-has-lightbox-open {
327
- overflow: hidden;
328
- }
329
-
330
341
  @keyframes turn-on-visibility {
331
342
  0% {
332
343
  opacity: 0;
@@ -207,6 +207,8 @@
207
207
 
208
208
  .wp-lightbox-container {
209
209
  position: relative;
210
+ display: flex;
211
+ flex-direction: column;
210
212
  }
211
213
  .wp-lightbox-container button {
212
214
  border: none;
@@ -222,6 +224,10 @@
222
224
  outline: 5px auto -webkit-focus-ring-color;
223
225
  outline-offset: 5px;
224
226
  }
227
+ .wp-lightbox-container button:hover, .wp-lightbox-container button:focus, .wp-lightbox-container button:not(:hover):not(:active):not(.has-background) {
228
+ background: none;
229
+ border: none;
230
+ }
225
231
 
226
232
  .wp-lightbox-overlay {
227
233
  position: fixed;
@@ -237,11 +243,20 @@
237
243
  }
238
244
  .wp-lightbox-overlay .close-button {
239
245
  position: absolute;
240
- top: calc(env(safe-area-inset-top) + 12.5px);
241
- right: calc(env(safe-area-inset-right) + 12.5px);
246
+ top: calc(env(safe-area-inset-top) + 16px);
247
+ right: calc(env(safe-area-inset-right) + 16px);
242
248
  padding: 0;
243
249
  cursor: pointer;
244
250
  z-index: 5000000;
251
+ min-width: 40px;
252
+ min-height: 40px;
253
+ display: flex;
254
+ align-items: center;
255
+ justify-content: center;
256
+ }
257
+ .wp-lightbox-overlay .close-button:hover, .wp-lightbox-overlay .close-button:focus, .wp-lightbox-overlay .close-button:not(:hover):not(:active):not(.has-background) {
258
+ background: none;
259
+ border: none;
245
260
  }
246
261
  .wp-lightbox-overlay .lightbox-image-container {
247
262
  position: absolute;
@@ -329,10 +344,6 @@
329
344
  }
330
345
  }
331
346
 
332
- html.wp-has-lightbox-open {
333
- overflow: hidden;
334
- }
335
-
336
347
  @keyframes turn-on-visibility {
337
348
  0% {
338
349
  opacity: 0;
@@ -87,7 +87,6 @@
87
87
  * Reset the WP Admin page styles for Gutenberg-like pages.
88
88
  */
89
89
  .wp-block-navigation .wp-block-navigation-item__label {
90
- word-break: normal;
91
90
  overflow-wrap: break-word;
92
91
  }
93
92
  .wp-block-navigation .wp-block-navigation-item__description {
@@ -87,7 +87,6 @@
87
87
  * Reset the WP Admin page styles for Gutenberg-like pages.
88
88
  */
89
89
  .wp-block-navigation .wp-block-navigation-item__label {
90
- word-break: normal;
91
90
  overflow-wrap: break-word;
92
91
  }
93
92
  .wp-block-navigation .wp-block-navigation-item__description {
@@ -148,4 +148,7 @@
148
148
  }
149
149
  .wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100 {
150
150
  opacity: 1;
151
+ }
152
+ .wp-block-post-featured-image:where(.alignleft, .alignright) {
153
+ width: 100%;
151
154
  }
@@ -148,4 +148,7 @@
148
148
  }
149
149
  .wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100 {
150
150
  opacity: 1;
151
+ }
152
+ .wp-block-post-featured-image:where(.alignleft, .alignright) {
153
+ width: 100%;
151
154
  }
@@ -128,4 +128,29 @@
128
128
  .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
129
129
  grid-template-columns: 1fr;
130
130
  }
131
+ }
132
+ .wp-block-post-template-is-layout-constrained > li > .alignright,
133
+ .wp-block-post-template-is-layout-flow > li > .alignright {
134
+ float: left;
135
+ -webkit-margin-start: 2em;
136
+ margin-inline-start: 2em;
137
+ -webkit-margin-end: 0;
138
+ margin-inline-end: 0;
139
+ }
140
+
141
+ .wp-block-post-template-is-layout-constrained > li > .alignleft,
142
+ .wp-block-post-template-is-layout-flow > li > .alignleft {
143
+ float: right;
144
+ -webkit-margin-start: 0;
145
+ margin-inline-start: 0;
146
+ -webkit-margin-end: 2em;
147
+ margin-inline-end: 2em;
148
+ }
149
+
150
+ .wp-block-post-template-is-layout-constrained > li > .aligncenter,
151
+ .wp-block-post-template-is-layout-flow > li > .aligncenter {
152
+ -webkit-margin-start: auto;
153
+ margin-inline-start: auto;
154
+ -webkit-margin-end: auto;
155
+ margin-inline-end: auto;
131
156
  }
@@ -128,4 +128,29 @@
128
128
  .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid {
129
129
  grid-template-columns: 1fr;
130
130
  }
131
+ }
132
+ .wp-block-post-template-is-layout-constrained > li > .alignright,
133
+ .wp-block-post-template-is-layout-flow > li > .alignright {
134
+ float: right;
135
+ -webkit-margin-start: 2em;
136
+ margin-inline-start: 2em;
137
+ -webkit-margin-end: 0;
138
+ margin-inline-end: 0;
139
+ }
140
+
141
+ .wp-block-post-template-is-layout-constrained > li > .alignleft,
142
+ .wp-block-post-template-is-layout-flow > li > .alignleft {
143
+ float: left;
144
+ -webkit-margin-start: 0;
145
+ margin-inline-start: 0;
146
+ -webkit-margin-end: 2em;
147
+ margin-inline-end: 2em;
148
+ }
149
+
150
+ .wp-block-post-template-is-layout-constrained > li > .aligncenter,
151
+ .wp-block-post-template-is-layout-flow > li > .aligncenter {
152
+ -webkit-margin-start: auto;
153
+ margin-inline-start: auto;
154
+ -webkit-margin-end: auto;
155
+ margin-inline-end: auto;
131
156
  }
@@ -1614,6 +1614,8 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1614
1614
 
1615
1615
  .wp-lightbox-container {
1616
1616
  position: relative;
1617
+ display: flex;
1618
+ flex-direction: column;
1617
1619
  }
1618
1620
  .wp-lightbox-container button {
1619
1621
  border: none;
@@ -1629,6 +1631,10 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1629
1631
  outline: 5px auto -webkit-focus-ring-color;
1630
1632
  outline-offset: 5px;
1631
1633
  }
1634
+ .wp-lightbox-container button:hover, .wp-lightbox-container button:focus, .wp-lightbox-container button:not(:hover):not(:active):not(.has-background) {
1635
+ background: none;
1636
+ border: none;
1637
+ }
1632
1638
 
1633
1639
  .wp-lightbox-overlay {
1634
1640
  position: fixed;
@@ -1644,11 +1650,20 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1644
1650
  }
1645
1651
  .wp-lightbox-overlay .close-button {
1646
1652
  position: absolute;
1647
- top: calc(env(safe-area-inset-top) + 12.5px);
1648
- left: calc(env(safe-area-inset-left) + 12.5px);
1653
+ top: calc(env(safe-area-inset-top) + 16px);
1654
+ left: calc(env(safe-area-inset-left) + 16px);
1649
1655
  padding: 0;
1650
1656
  cursor: pointer;
1651
1657
  z-index: 5000000;
1658
+ min-width: 40px;
1659
+ min-height: 40px;
1660
+ display: flex;
1661
+ align-items: center;
1662
+ justify-content: center;
1663
+ }
1664
+ .wp-lightbox-overlay .close-button:hover, .wp-lightbox-overlay .close-button:focus, .wp-lightbox-overlay .close-button:not(:hover):not(:active):not(.has-background) {
1665
+ background: none;
1666
+ border: none;
1652
1667
  }
1653
1668
  .wp-lightbox-overlay .lightbox-image-container {
1654
1669
  position: absolute;
@@ -1736,10 +1751,6 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1736
1751
  }
1737
1752
  }
1738
1753
 
1739
- html.wp-has-lightbox-open {
1740
- overflow: hidden;
1741
- }
1742
-
1743
1754
  @keyframes turn-on-visibility {
1744
1755
  0% {
1745
1756
  opacity: 0;
@@ -2568,7 +2579,6 @@ html.has-modal-open {
2568
2579
  }
2569
2580
 
2570
2581
  .wp-block-navigation .wp-block-navigation-item__label {
2571
- word-break: normal;
2572
2582
  overflow-wrap: break-word;
2573
2583
  }
2574
2584
  .wp-block-navigation .wp-block-navigation-item__description {
@@ -2811,6 +2821,9 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2811
2821
  .wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100 {
2812
2822
  opacity: 1;
2813
2823
  }
2824
+ .wp-block-post-featured-image:where(.alignleft, .alignright) {
2825
+ width: 100%;
2826
+ }
2814
2827
 
2815
2828
  .wp-block-post-navigation-link .wp-block-post-navigation-link__arrow-previous {
2816
2829
  display: inline-block;
@@ -2957,6 +2970,32 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2957
2970
  grid-template-columns: 1fr;
2958
2971
  }
2959
2972
  }
2973
+ .wp-block-post-template-is-layout-constrained > li > .alignright,
2974
+ .wp-block-post-template-is-layout-flow > li > .alignright {
2975
+ float: left;
2976
+ -webkit-margin-start: 2em;
2977
+ margin-inline-start: 2em;
2978
+ -webkit-margin-end: 0;
2979
+ margin-inline-end: 0;
2980
+ }
2981
+
2982
+ .wp-block-post-template-is-layout-constrained > li > .alignleft,
2983
+ .wp-block-post-template-is-layout-flow > li > .alignleft {
2984
+ float: right;
2985
+ -webkit-margin-start: 0;
2986
+ margin-inline-start: 0;
2987
+ -webkit-margin-end: 2em;
2988
+ margin-inline-end: 2em;
2989
+ }
2990
+
2991
+ .wp-block-post-template-is-layout-constrained > li > .aligncenter,
2992
+ .wp-block-post-template-is-layout-flow > li > .aligncenter {
2993
+ -webkit-margin-start: auto;
2994
+ margin-inline-start: auto;
2995
+ -webkit-margin-end: auto;
2996
+ margin-inline-end: auto;
2997
+ }
2998
+
2960
2999
  .wp-block-query-pagination > .wp-block-query-pagination-next,
2961
3000
  .wp-block-query-pagination > .wp-block-query-pagination-previous,
2962
3001
  .wp-block-query-pagination > .wp-block-query-pagination-numbers {
@@ -1628,6 +1628,8 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1628
1628
 
1629
1629
  .wp-lightbox-container {
1630
1630
  position: relative;
1631
+ display: flex;
1632
+ flex-direction: column;
1631
1633
  }
1632
1634
  .wp-lightbox-container button {
1633
1635
  border: none;
@@ -1643,6 +1645,10 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1643
1645
  outline: 5px auto -webkit-focus-ring-color;
1644
1646
  outline-offset: 5px;
1645
1647
  }
1648
+ .wp-lightbox-container button:hover, .wp-lightbox-container button:focus, .wp-lightbox-container button:not(:hover):not(:active):not(.has-background) {
1649
+ background: none;
1650
+ border: none;
1651
+ }
1646
1652
 
1647
1653
  .wp-lightbox-overlay {
1648
1654
  position: fixed;
@@ -1658,11 +1664,20 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1658
1664
  }
1659
1665
  .wp-lightbox-overlay .close-button {
1660
1666
  position: absolute;
1661
- top: calc(env(safe-area-inset-top) + 12.5px);
1662
- right: calc(env(safe-area-inset-right) + 12.5px);
1667
+ top: calc(env(safe-area-inset-top) + 16px);
1668
+ right: calc(env(safe-area-inset-right) + 16px);
1663
1669
  padding: 0;
1664
1670
  cursor: pointer;
1665
1671
  z-index: 5000000;
1672
+ min-width: 40px;
1673
+ min-height: 40px;
1674
+ display: flex;
1675
+ align-items: center;
1676
+ justify-content: center;
1677
+ }
1678
+ .wp-lightbox-overlay .close-button:hover, .wp-lightbox-overlay .close-button:focus, .wp-lightbox-overlay .close-button:not(:hover):not(:active):not(.has-background) {
1679
+ background: none;
1680
+ border: none;
1666
1681
  }
1667
1682
  .wp-lightbox-overlay .lightbox-image-container {
1668
1683
  position: absolute;
@@ -1750,10 +1765,6 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1750
1765
  }
1751
1766
  }
1752
1767
 
1753
- html.wp-has-lightbox-open {
1754
- overflow: hidden;
1755
- }
1756
-
1757
1768
  @keyframes turn-on-visibility {
1758
1769
  0% {
1759
1770
  opacity: 0;
@@ -2598,7 +2609,6 @@ html.has-modal-open {
2598
2609
  }
2599
2610
 
2600
2611
  .wp-block-navigation .wp-block-navigation-item__label {
2601
- word-break: normal;
2602
2612
  overflow-wrap: break-word;
2603
2613
  }
2604
2614
  .wp-block-navigation .wp-block-navigation-item__description {
@@ -2841,6 +2851,9 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2841
2851
  .wp-block-post-featured-image .wp-block-post-featured-image__overlay.has-background-dim-100 {
2842
2852
  opacity: 1;
2843
2853
  }
2854
+ .wp-block-post-featured-image:where(.alignleft, .alignright) {
2855
+ width: 100%;
2856
+ }
2844
2857
 
2845
2858
  .wp-block-post-navigation-link .wp-block-post-navigation-link__arrow-previous {
2846
2859
  display: inline-block;
@@ -2987,6 +3000,32 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
2987
3000
  grid-template-columns: 1fr;
2988
3001
  }
2989
3002
  }
3003
+ .wp-block-post-template-is-layout-constrained > li > .alignright,
3004
+ .wp-block-post-template-is-layout-flow > li > .alignright {
3005
+ float: right;
3006
+ -webkit-margin-start: 2em;
3007
+ margin-inline-start: 2em;
3008
+ -webkit-margin-end: 0;
3009
+ margin-inline-end: 0;
3010
+ }
3011
+
3012
+ .wp-block-post-template-is-layout-constrained > li > .alignleft,
3013
+ .wp-block-post-template-is-layout-flow > li > .alignleft {
3014
+ float: left;
3015
+ -webkit-margin-start: 0;
3016
+ margin-inline-start: 0;
3017
+ -webkit-margin-end: 2em;
3018
+ margin-inline-end: 2em;
3019
+ }
3020
+
3021
+ .wp-block-post-template-is-layout-constrained > li > .aligncenter,
3022
+ .wp-block-post-template-is-layout-flow > li > .aligncenter {
3023
+ -webkit-margin-start: auto;
3024
+ margin-inline-start: auto;
3025
+ -webkit-margin-end: auto;
3026
+ margin-inline-end: auto;
3027
+ }
3028
+
2990
3029
  .wp-block-query-pagination > .wp-block-query-pagination-next,
2991
3030
  .wp-block-query-pagination > .wp-block-query-pagination-previous,
2992
3031
  .wp-block-query-pagination > .wp-block-query-pagination-numbers {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "8.19.2",
3
+ "version": "8.19.4",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -31,36 +31,36 @@
31
31
  ],
32
32
  "dependencies": {
33
33
  "@babel/runtime": "^7.16.0",
34
- "@wordpress/a11y": "^3.42.2",
35
- "@wordpress/api-fetch": "^6.39.2",
36
- "@wordpress/autop": "^3.42.2",
37
- "@wordpress/blob": "^3.42.2",
38
- "@wordpress/block-editor": "^12.10.2",
39
- "@wordpress/blocks": "^12.19.2",
40
- "@wordpress/components": "^25.8.2",
41
- "@wordpress/compose": "^6.19.2",
42
- "@wordpress/core-data": "^6.19.2",
43
- "@wordpress/data": "^9.12.2",
44
- "@wordpress/date": "^4.42.2",
45
- "@wordpress/deprecated": "^3.42.2",
46
- "@wordpress/dom": "^3.42.2",
47
- "@wordpress/element": "^5.19.2",
48
- "@wordpress/escape-html": "^2.42.2",
49
- "@wordpress/hooks": "^3.42.2",
50
- "@wordpress/html-entities": "^3.42.2",
51
- "@wordpress/i18n": "^4.42.2",
52
- "@wordpress/icons": "^9.33.2",
53
- "@wordpress/interactivity": "^2.3.2",
54
- "@wordpress/keycodes": "^3.42.2",
55
- "@wordpress/notices": "^4.10.2",
56
- "@wordpress/primitives": "^3.40.2",
57
- "@wordpress/private-apis": "^0.24.2",
58
- "@wordpress/reusable-blocks": "^4.19.2",
59
- "@wordpress/rich-text": "^6.19.2",
60
- "@wordpress/server-side-render": "^4.19.2",
61
- "@wordpress/url": "^3.43.2",
62
- "@wordpress/viewport": "^5.19.2",
63
- "@wordpress/wordcount": "^3.42.2",
34
+ "@wordpress/a11y": "^3.42.4",
35
+ "@wordpress/api-fetch": "^6.39.4",
36
+ "@wordpress/autop": "^3.42.4",
37
+ "@wordpress/blob": "^3.42.4",
38
+ "@wordpress/block-editor": "^12.10.4",
39
+ "@wordpress/blocks": "^12.19.4",
40
+ "@wordpress/components": "^25.8.4",
41
+ "@wordpress/compose": "^6.19.4",
42
+ "@wordpress/core-data": "^6.19.4",
43
+ "@wordpress/data": "^9.12.4",
44
+ "@wordpress/date": "^4.42.4",
45
+ "@wordpress/deprecated": "^3.42.4",
46
+ "@wordpress/dom": "^3.42.4",
47
+ "@wordpress/element": "^5.19.4",
48
+ "@wordpress/escape-html": "^2.42.4",
49
+ "@wordpress/hooks": "^3.42.4",
50
+ "@wordpress/html-entities": "^3.42.4",
51
+ "@wordpress/i18n": "^4.42.4",
52
+ "@wordpress/icons": "^9.33.4",
53
+ "@wordpress/interactivity": "^2.3.4",
54
+ "@wordpress/keycodes": "^3.42.4",
55
+ "@wordpress/notices": "^4.10.4",
56
+ "@wordpress/primitives": "^3.40.4",
57
+ "@wordpress/private-apis": "^0.24.4",
58
+ "@wordpress/reusable-blocks": "^4.19.4",
59
+ "@wordpress/rich-text": "^6.19.4",
60
+ "@wordpress/server-side-render": "^4.19.4",
61
+ "@wordpress/url": "^3.43.4",
62
+ "@wordpress/viewport": "^5.19.4",
63
+ "@wordpress/wordcount": "^3.42.4",
64
64
  "change-case": "^4.1.2",
65
65
  "classnames": "^2.3.1",
66
66
  "colord": "^2.7.0",
@@ -78,5 +78,5 @@
78
78
  "publishConfig": {
79
79
  "access": "public"
80
80
  },
81
- "gitHead": "5d2e3d07cc97af8090fc32c1e5d5013a2967e752"
81
+ "gitHead": "d1072bbcaf037a18d414da7865ebaf366a0e7062"
82
82
  }
@@ -149,7 +149,7 @@ export default function CoverInspectorControls( {
149
149
  'The <header> element should represent introductory content, typically a group of introductory or navigational aids.'
150
150
  ),
151
151
  main: __(
152
- 'The <main> element should be used for the primary content of your document only. '
152
+ 'The <main> element should be used for the primary content of your document only.'
153
153
  ),
154
154
  section: __(
155
155
  "The <section> element should represent a standalone portion of the document that can't be better represented by another element."
package/src/embed/edit.js CHANGED
@@ -29,6 +29,7 @@ import { useDispatch, useSelect } from '@wordpress/data';
29
29
  import { useBlockProps } from '@wordpress/block-editor';
30
30
  import { store as coreStore } from '@wordpress/core-data';
31
31
  import { View } from '@wordpress/primitives';
32
+ import { getAuthority } from '@wordpress/url';
32
33
 
33
34
  const EmbedEdit = ( props ) => {
34
35
  const {
@@ -137,6 +138,20 @@ const EmbedEdit = ( props ) => {
137
138
  setAttributes( { url: newURL } );
138
139
  }, [ preview?.html, attributesUrl, cannotEmbed, fetching ] );
139
140
 
141
+ // Try a different provider in case the embed url is not supported.
142
+ useEffect( () => {
143
+ if ( ! cannotEmbed || fetching || ! url ) {
144
+ return;
145
+ }
146
+
147
+ // Until X provider is supported in WordPress, as a workaround we use Twitter provider.
148
+ if ( getAuthority( url ) === 'x.com' ) {
149
+ const newURL = new URL( url );
150
+ newURL.host = 'twitter.com';
151
+ setAttributes( { url: newURL.toString() } );
152
+ }
153
+ }, [ url, cannotEmbed, fetching, setAttributes ] );
154
+
140
155
  // Handle incoming preview.
141
156
  useEffect( () => {
142
157
  if ( preview && ! isEditingURL ) {
@@ -33,6 +33,7 @@ import {
33
33
  } from '@wordpress/block-editor';
34
34
  import { store as coreStore } from '@wordpress/core-data';
35
35
  import { View } from '@wordpress/primitives';
36
+ import { getAuthority } from '@wordpress/url';
36
37
 
37
38
  // The inline preview feature will be released progressible, for this reason
38
39
  // the embed will only be considered previewable for the following providers list.
@@ -160,6 +161,20 @@ const EmbedEdit = ( props ) => {
160
161
  setAttributes( { url: newURL } );
161
162
  }, [ preview?.html, url, cannotEmbed, fetching ] );
162
163
 
164
+ // Try a different provider in case the embed url is not supported.
165
+ useEffect( () => {
166
+ if ( ! cannotEmbed || fetching || ! url ) {
167
+ return;
168
+ }
169
+
170
+ // Until X provider is supported in WordPress, as a workaround we use Twitter provider.
171
+ if ( getAuthority( url ) === 'x.com' ) {
172
+ const newURL = new URL( url );
173
+ newURL.host = 'twitter.com';
174
+ setAttributes( { url: newURL.toString() } );
175
+ }
176
+ }, [ url, cannotEmbed, fetching, setAttributes ] );
177
+
163
178
  // Handle incoming preview.
164
179
  useEffect( () => {
165
180
  if ( preview && ! isEditingURL ) {