@wordpress/block-library 9.12.0 → 9.13.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 (145) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/block-keyboard-shortcuts/index.js +7 -7
  3. package/build/block-keyboard-shortcuts/index.js.map +1 -1
  4. package/build/cover/edit/index.js +1 -1
  5. package/build/cover/edit/index.js.map +1 -1
  6. package/build/cover/index.js +10 -10
  7. package/build/cover/index.js.map +1 -1
  8. package/build/cover/shared.js +6 -7
  9. package/build/cover/shared.js.map +1 -1
  10. package/build/details/index.js +19 -0
  11. package/build/details/index.js.map +1 -1
  12. package/build/file/edit.js +7 -3
  13. package/build/file/edit.js.map +1 -1
  14. package/build/freeform/modal.js +1 -1
  15. package/build/freeform/modal.js.map +1 -1
  16. package/build/heading/index.js +1 -7
  17. package/build/heading/index.js.map +1 -1
  18. package/build/home-link/edit.js +20 -36
  19. package/build/home-link/edit.js.map +1 -1
  20. package/build/navigation/use-template-part-area-label.js +6 -8
  21. package/build/navigation/use-template-part-area-label.js.map +1 -1
  22. package/build/page-list/index.js +14 -0
  23. package/build/page-list/index.js.map +1 -1
  24. package/build/paragraph/edit.js +26 -25
  25. package/build/paragraph/edit.js.map +1 -1
  26. package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
  27. package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  28. package/build/query/edit/inspector-controls/index.js +1 -11
  29. package/build/query/edit/inspector-controls/index.js.map +1 -1
  30. package/build/query/utils.js +6 -8
  31. package/build/query/utils.js.map +1 -1
  32. package/build/social-link/edit.js +57 -10
  33. package/build/social-link/edit.js.map +1 -1
  34. package/build/social-link/index.js +4 -2
  35. package/build/social-link/index.js.map +1 -1
  36. package/build/template-part/edit/advanced-controls.js +2 -7
  37. package/build/template-part/edit/advanced-controls.js.map +1 -1
  38. package/build/template-part/edit/utils/get-template-part-icon.js +23 -0
  39. package/build/template-part/edit/utils/get-template-part-icon.js.map +1 -0
  40. package/build/template-part/edit/utils/hooks.js +1 -6
  41. package/build/template-part/edit/utils/hooks.js.map +1 -1
  42. package/build/template-part/variations.js +6 -12
  43. package/build/template-part/variations.js.map +1 -1
  44. package/build/video/tracks-editor.js +135 -121
  45. package/build/video/tracks-editor.js.map +1 -1
  46. package/build-module/block-keyboard-shortcuts/index.js +7 -7
  47. package/build-module/block-keyboard-shortcuts/index.js.map +1 -1
  48. package/build-module/cover/edit/index.js +1 -1
  49. package/build-module/cover/edit/index.js.map +1 -1
  50. package/build-module/cover/index.js +10 -10
  51. package/build-module/cover/index.js.map +1 -1
  52. package/build-module/cover/shared.js +6 -7
  53. package/build-module/cover/shared.js.map +1 -1
  54. package/build-module/details/index.js +20 -1
  55. package/build-module/details/index.js.map +1 -1
  56. package/build-module/file/edit.js +7 -3
  57. package/build-module/file/edit.js.map +1 -1
  58. package/build-module/freeform/modal.js +1 -1
  59. package/build-module/freeform/modal.js.map +1 -1
  60. package/build-module/heading/index.js +1 -7
  61. package/build-module/heading/index.js.map +1 -1
  62. package/build-module/home-link/edit.js +23 -39
  63. package/build-module/home-link/edit.js.map +1 -1
  64. package/build-module/navigation/use-template-part-area-label.js +6 -8
  65. package/build-module/navigation/use-template-part-area-label.js.map +1 -1
  66. package/build-module/page-list/index.js +14 -0
  67. package/build-module/page-list/index.js.map +1 -1
  68. package/build-module/paragraph/edit.js +26 -25
  69. package/build-module/paragraph/edit.js.map +1 -1
  70. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
  71. package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
  72. package/build-module/query/edit/inspector-controls/index.js +1 -11
  73. package/build-module/query/edit/inspector-controls/index.js.map +1 -1
  74. package/build-module/query/utils.js +6 -8
  75. package/build-module/query/utils.js.map +1 -1
  76. package/build-module/social-link/edit.js +61 -14
  77. package/build-module/social-link/edit.js.map +1 -1
  78. package/build-module/social-link/index.js +4 -2
  79. package/build-module/social-link/index.js.map +1 -1
  80. package/build-module/template-part/edit/advanced-controls.js +3 -8
  81. package/build-module/template-part/edit/advanced-controls.js.map +1 -1
  82. package/build-module/template-part/edit/utils/get-template-part-icon.js +15 -0
  83. package/build-module/template-part/edit/utils/get-template-part-icon.js.map +1 -0
  84. package/build-module/template-part/edit/utils/hooks.js +1 -6
  85. package/build-module/template-part/edit/utils/hooks.js.map +1 -1
  86. package/build-module/template-part/variations.js +5 -11
  87. package/build-module/template-part/variations.js.map +1 -1
  88. package/build-module/video/tracks-editor.js +136 -122
  89. package/build-module/video/tracks-editor.js.map +1 -1
  90. package/build-style/editor-rtl.css +16 -8
  91. package/build-style/editor.css +16 -8
  92. package/build-style/navigation/style-rtl.css +1 -1
  93. package/build-style/navigation/style.css +1 -1
  94. package/build-style/page-list/style-rtl.css +4 -0
  95. package/build-style/page-list/style.css +4 -0
  96. package/build-style/query/editor-rtl.css +0 -4
  97. package/build-style/query/editor.css +0 -4
  98. package/build-style/search/style-rtl.css +3 -3
  99. package/build-style/search/style.css +3 -3
  100. package/build-style/social-link/editor-rtl.css +8 -4
  101. package/build-style/social-link/editor.css +8 -4
  102. package/build-style/style-rtl.css +8 -4
  103. package/build-style/style.css +8 -4
  104. package/build-style/video/editor-rtl.css +8 -0
  105. package/build-style/video/editor.css +8 -0
  106. package/package.json +2 -2
  107. package/src/block-keyboard-shortcuts/index.js +25 -11
  108. package/src/cover/edit/index.js +1 -1
  109. package/src/cover/index.js +8 -8
  110. package/src/cover/shared.js +10 -10
  111. package/src/cover/test/edit.js +2 -2
  112. package/src/details/index.js +23 -1
  113. package/src/file/edit.js +8 -2
  114. package/src/freeform/modal.js +1 -1
  115. package/src/heading/block.json +1 -7
  116. package/src/home-link/edit.js +27 -45
  117. package/src/home-link/index.php +0 -3
  118. package/src/navigation/index.php +4 -150
  119. package/src/navigation/style.scss +1 -1
  120. package/src/navigation/use-template-part-area-label.js +10 -10
  121. package/src/page-list/block.json +14 -0
  122. package/src/page-list/style.scss +4 -0
  123. package/src/paragraph/edit.js +20 -17
  124. package/src/pattern/index.php +0 -7
  125. package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -5
  126. package/src/query/edit/inspector-controls/index.js +0 -10
  127. package/src/query/editor.scss +0 -4
  128. package/src/query/index.php +1 -1
  129. package/src/query/utils.js +14 -15
  130. package/src/rss/index.php +11 -8
  131. package/src/search/style.scss +3 -5
  132. package/src/social-link/block.json +4 -2
  133. package/src/social-link/edit.js +87 -19
  134. package/src/social-link/editor.scss +11 -7
  135. package/src/template-part/edit/advanced-controls.js +13 -13
  136. package/src/template-part/edit/utils/get-template-part-icon.js +20 -0
  137. package/src/template-part/edit/utils/hooks.js +2 -7
  138. package/src/template-part/variations.js +4 -16
  139. package/src/video/editor.scss +9 -0
  140. package/src/video/tracks-editor.js +157 -139
  141. package/build/query/edit/inspector-controls/create-new-post-link.js +0 -40
  142. package/build/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
  143. package/build-module/query/edit/inspector-controls/create-new-post-link.js +0 -33
  144. package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
  145. package/src/query/edit/inspector-controls/create-new-post-link.js +0 -32
@@ -2411,13 +2411,13 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2411
2411
  font-size: inherit;
2412
2412
  color: currentColor;
2413
2413
  height: auto;
2414
+ font-weight: inherit;
2415
+ font-family: inherit;
2414
2416
  opacity: 1;
2415
2417
  padding: 0.25em;
2416
2418
  }
2417
- .wp-block-social-link-anchor:focus:not(:disabled) {
2418
- border-radius: 2px;
2419
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
2420
- outline: 3px solid transparent;
2419
+ .wp-block-social-link-anchor:hover {
2420
+ transform: none;
2421
2421
  }
2422
2422
 
2423
2423
  :root :where(.wp-block-social-links.is-style-pill-shape .wp-social-link button) {
@@ -2429,6 +2429,10 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2429
2429
  padding: 0;
2430
2430
  }
2431
2431
 
2432
+ .wp-block-social-link__toolbar_content_text {
2433
+ width: 250px;
2434
+ }
2435
+
2432
2436
  .wp-block-social-links div.block-editor-url-input {
2433
2437
  display: inline-block;
2434
2438
  margin-left: 8px;
@@ -2706,6 +2710,7 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2706
2710
  max-width: 240px;
2707
2711
  }
2708
2712
 
2713
+ .block-library-video-tracks-editor__tracks-informative-message-title,
2709
2714
  .block-library-video-tracks-editor__single-track-editor-edit-track-label {
2710
2715
  margin-top: 4px;
2711
2716
  color: #757575;
@@ -2724,6 +2729,13 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2724
2729
  padding: 0;
2725
2730
  }
2726
2731
 
2732
+ .block-library-video-tracks-editor__tracks-informative-message {
2733
+ padding: 8px;
2734
+ }
2735
+ .block-library-video-tracks-editor__tracks-informative-message-description {
2736
+ margin-bottom: 0;
2737
+ }
2738
+
2727
2739
  .editor-styles-wrapper ul.wp-block-post-template {
2728
2740
  padding-left: 0;
2729
2741
  margin-left: 0;
@@ -2737,10 +2749,6 @@ body.editor-styles-wrapper .wp-block-navigation__responsive-container.is-menu-op
2737
2749
  margin-bottom: 8px;
2738
2750
  }
2739
2751
 
2740
- .wp-block-query__create-new-link {
2741
- padding: 0 16px 16px 52px;
2742
- }
2743
-
2744
2752
  .block-library-query__pattern-selection-content .block-editor-block-patterns-list {
2745
2753
  display: grid;
2746
2754
  grid-template-columns: 1fr 1fr 1fr;
@@ -448,7 +448,7 @@ button.wp-block-navigation-item__content {
448
448
  padding-top: clamp(1rem, var(--wp--style--root--padding-top), 20rem);
449
449
  padding-left: clamp(1rem, var(--wp--style--root--padding-right), 20rem);
450
450
  padding-bottom: clamp(1rem, var(--wp--style--root--padding-bottom), 20rem);
451
- padding-right: clamp(1rem, var(--wp--style--root--padding-left), 20em);
451
+ padding-right: clamp(1rem, var(--wp--style--root--padding-left), 20rem);
452
452
  overflow: auto;
453
453
  z-index: 100000;
454
454
  }
@@ -448,7 +448,7 @@ button.wp-block-navigation-item__content {
448
448
  padding-top: clamp(1rem, var(--wp--style--root--padding-top), 20rem);
449
449
  padding-right: clamp(1rem, var(--wp--style--root--padding-right), 20rem);
450
450
  padding-bottom: clamp(1rem, var(--wp--style--root--padding-bottom), 20rem);
451
- padding-left: clamp(1rem, var(--wp--style--root--padding-left), 20em);
451
+ padding-left: clamp(1rem, var(--wp--style--root--padding-left), 20rem);
452
452
  overflow: auto;
453
453
  z-index: 100000;
454
454
  }
@@ -108,4 +108,8 @@
108
108
  }
109
109
  .wp-block-navigation .wp-block-navigation-item {
110
110
  background-color: inherit;
111
+ }
112
+
113
+ .wp-block-page-list {
114
+ box-sizing: border-box;
111
115
  }
@@ -108,4 +108,8 @@
108
108
  }
109
109
  .wp-block-navigation .wp-block-navigation-item {
110
110
  background-color: inherit;
111
+ }
112
+
113
+ .wp-block-page-list {
114
+ box-sizing: border-box;
111
115
  }
@@ -105,10 +105,6 @@
105
105
  margin-bottom: 8px;
106
106
  }
107
107
 
108
- .wp-block-query__create-new-link {
109
- padding: 0 52px 16px 16px;
110
- }
111
-
112
108
  .block-library-query__pattern-selection-content .block-editor-block-patterns-list {
113
109
  display: grid;
114
110
  grid-template-columns: 1fr 1fr 1fr;
@@ -105,10 +105,6 @@
105
105
  margin-bottom: 8px;
106
106
  }
107
107
 
108
- .wp-block-query__create-new-link {
109
- padding: 0 16px 16px 52px;
110
- }
111
-
112
108
  .block-library-query__pattern-selection-content .block-editor-block-patterns-list {
113
109
  display: grid;
114
110
  grid-template-columns: 1fr 1fr 1fr;
@@ -145,9 +145,9 @@
145
145
  margin-right: 0;
146
146
  flex-shrink: 0;
147
147
  max-width: 100%;
148
- }
149
- .wp-block-search.wp-block-search__button-only .wp-block-search__button[aria-expanded=true] {
150
- max-width: calc(100% - 100px);
148
+ box-sizing: border-box;
149
+ display: flex;
150
+ justify-content: center;
151
151
  }
152
152
  .wp-block-search.wp-block-search__button-only .wp-block-search__inside-wrapper {
153
153
  transition-property: width;
@@ -145,9 +145,9 @@
145
145
  margin-left: 0;
146
146
  flex-shrink: 0;
147
147
  max-width: 100%;
148
- }
149
- .wp-block-search.wp-block-search__button-only .wp-block-search__button[aria-expanded=true] {
150
- max-width: calc(100% - 100px);
148
+ box-sizing: border-box;
149
+ display: flex;
150
+ justify-content: center;
151
151
  }
152
152
  .wp-block-search.wp-block-search__button-only .wp-block-search__inside-wrapper {
153
153
  transition-property: width;
@@ -112,13 +112,13 @@
112
112
  font-size: inherit;
113
113
  color: currentColor;
114
114
  height: auto;
115
+ font-weight: inherit;
116
+ font-family: inherit;
115
117
  opacity: 1;
116
118
  padding: 0.25em;
117
119
  }
118
- .wp-block-social-link-anchor:focus:not(:disabled) {
119
- border-radius: 2px;
120
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
121
- outline: 3px solid transparent;
120
+ .wp-block-social-link-anchor:hover {
121
+ transform: none;
122
122
  }
123
123
 
124
124
  :root :where(.wp-block-social-links.is-style-pill-shape .wp-social-link button) {
@@ -128,4 +128,8 @@
128
128
 
129
129
  :root :where(.wp-block-social-links.is-style-logos-only .wp-social-link button) {
130
130
  padding: 0;
131
+ }
132
+
133
+ .wp-block-social-link__toolbar_content_text {
134
+ width: 250px;
131
135
  }
@@ -112,13 +112,13 @@
112
112
  font-size: inherit;
113
113
  color: currentColor;
114
114
  height: auto;
115
+ font-weight: inherit;
116
+ font-family: inherit;
115
117
  opacity: 1;
116
118
  padding: 0.25em;
117
119
  }
118
- .wp-block-social-link-anchor:focus:not(:disabled) {
119
- border-radius: 2px;
120
- box-shadow: 0 0 0 var(--wp-admin-border-width-focus) var(--wp-admin-theme-color);
121
- outline: 3px solid transparent;
120
+ .wp-block-social-link-anchor:hover {
121
+ transform: none;
122
122
  }
123
123
 
124
124
  :root :where(.wp-block-social-links.is-style-pill-shape .wp-social-link button) {
@@ -128,4 +128,8 @@
128
128
 
129
129
  :root :where(.wp-block-social-links.is-style-logos-only .wp-social-link button) {
130
130
  padding: 0;
131
+ }
132
+
133
+ .wp-block-social-link__toolbar_content_text {
134
+ width: 250px;
131
135
  }
@@ -2558,7 +2558,7 @@ button.wp-block-navigation-item__content {
2558
2558
  padding-top: clamp(1rem, var(--wp--style--root--padding-top), 20rem);
2559
2559
  padding-left: clamp(1rem, var(--wp--style--root--padding-right), 20rem);
2560
2560
  padding-bottom: clamp(1rem, var(--wp--style--root--padding-bottom), 20rem);
2561
- padding-right: clamp(1rem, var(--wp--style--root--padding-left), 20em);
2561
+ padding-right: clamp(1rem, var(--wp--style--root--padding-left), 20rem);
2562
2562
  overflow: auto;
2563
2563
  z-index: 100000;
2564
2564
  }
@@ -2767,6 +2767,10 @@ html.has-modal-open {
2767
2767
  background-color: inherit;
2768
2768
  }
2769
2769
 
2770
+ .wp-block-page-list {
2771
+ box-sizing: border-box;
2772
+ }
2773
+
2770
2774
  .is-small-text {
2771
2775
  font-size: 0.875em;
2772
2776
  }
@@ -3342,9 +3346,9 @@ ul.wp-block-rss.is-grid li {
3342
3346
  margin-right: 0;
3343
3347
  flex-shrink: 0;
3344
3348
  max-width: 100%;
3345
- }
3346
- .wp-block-search.wp-block-search__button-only .wp-block-search__button[aria-expanded=true] {
3347
- max-width: calc(100% - 100px);
3349
+ box-sizing: border-box;
3350
+ display: flex;
3351
+ justify-content: center;
3348
3352
  }
3349
3353
  .wp-block-search.wp-block-search__button-only .wp-block-search__inside-wrapper {
3350
3354
  transition-property: width;
@@ -2590,7 +2590,7 @@ button.wp-block-navigation-item__content {
2590
2590
  padding-top: clamp(1rem, var(--wp--style--root--padding-top), 20rem);
2591
2591
  padding-right: clamp(1rem, var(--wp--style--root--padding-right), 20rem);
2592
2592
  padding-bottom: clamp(1rem, var(--wp--style--root--padding-bottom), 20rem);
2593
- padding-left: clamp(1rem, var(--wp--style--root--padding-left), 20em);
2593
+ padding-left: clamp(1rem, var(--wp--style--root--padding-left), 20rem);
2594
2594
  overflow: auto;
2595
2595
  z-index: 100000;
2596
2596
  }
@@ -2799,6 +2799,10 @@ html.has-modal-open {
2799
2799
  background-color: inherit;
2800
2800
  }
2801
2801
 
2802
+ .wp-block-page-list {
2803
+ box-sizing: border-box;
2804
+ }
2805
+
2802
2806
  .is-small-text {
2803
2807
  font-size: 0.875em;
2804
2808
  }
@@ -3376,9 +3380,9 @@ ul.wp-block-rss.is-grid li {
3376
3380
  margin-left: 0;
3377
3381
  flex-shrink: 0;
3378
3382
  max-width: 100%;
3379
- }
3380
- .wp-block-search.wp-block-search__button-only .wp-block-search__button[aria-expanded=true] {
3381
- max-width: calc(100% - 100px);
3383
+ box-sizing: border-box;
3384
+ display: flex;
3385
+ justify-content: center;
3382
3386
  }
3383
3387
  .wp-block-search.wp-block-search__button-only .wp-block-search__inside-wrapper {
3384
3388
  transition-property: width;
@@ -132,6 +132,7 @@
132
132
  max-width: 240px;
133
133
  }
134
134
 
135
+ .block-library-video-tracks-editor__tracks-informative-message-title,
135
136
  .block-library-video-tracks-editor__single-track-editor-edit-track-label {
136
137
  margin-top: 4px;
137
138
  color: #757575;
@@ -148,4 +149,11 @@
148
149
  .block-library-video-tracks-editor__track-list .components-menu-group__label,
149
150
  .block-library-video-tracks-editor__add-tracks-container .components-menu-group__label {
150
151
  padding: 0;
152
+ }
153
+
154
+ .block-library-video-tracks-editor__tracks-informative-message {
155
+ padding: 8px;
156
+ }
157
+ .block-library-video-tracks-editor__tracks-informative-message-description {
158
+ margin-bottom: 0;
151
159
  }
@@ -132,6 +132,7 @@
132
132
  max-width: 240px;
133
133
  }
134
134
 
135
+ .block-library-video-tracks-editor__tracks-informative-message-title,
135
136
  .block-library-video-tracks-editor__single-track-editor-edit-track-label {
136
137
  margin-top: 4px;
137
138
  color: #757575;
@@ -148,4 +149,11 @@
148
149
  .block-library-video-tracks-editor__track-list .components-menu-group__label,
149
150
  .block-library-video-tracks-editor__add-tracks-container .components-menu-group__label {
150
151
  padding: 0;
152
+ }
153
+
154
+ .block-library-video-tracks-editor__tracks-informative-message {
155
+ padding: 8px;
156
+ }
157
+ .block-library-video-tracks-editor__tracks-informative-message-description {
158
+ margin-bottom: 0;
151
159
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.12.0",
3
+ "version": "9.13.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -90,5 +90,5 @@
90
90
  "publishConfig": {
91
91
  "access": "public"
92
92
  },
93
- "gitHead": "510540d99f3d222a96f08d3d7b66c9e7a726f705"
93
+ "gitHead": "cce81c13739c2a8b53d91df90c4f037cb68c2665"
94
94
  }
@@ -90,22 +90,36 @@ function BlockKeyboardShortcuts() {
90
90
  },
91
91
  } );
92
92
  } );
93
- }, [] );
93
+ }, [ registerShortcut ] );
94
94
 
95
95
  useShortcut(
96
96
  'core/block-editor/transform-heading-to-paragraph',
97
97
  ( event ) => handleTransformHeadingAndParagraph( event, 0 )
98
98
  );
99
-
100
- [ 1, 2, 3, 4, 5, 6 ].forEach( ( level ) => {
101
- //the loop is based off on a constant therefore
102
- //the hook will execute the same way every time
103
- //eslint-disable-next-line react-hooks/rules-of-hooks
104
- useShortcut(
105
- `core/block-editor/transform-paragraph-to-heading-${ level }`,
106
- ( event ) => handleTransformHeadingAndParagraph( event, level )
107
- );
108
- } );
99
+ useShortcut(
100
+ 'core/block-editor/transform-paragraph-to-heading-1',
101
+ ( event ) => handleTransformHeadingAndParagraph( event, 1 )
102
+ );
103
+ useShortcut(
104
+ 'core/block-editor/transform-paragraph-to-heading-2',
105
+ ( event ) => handleTransformHeadingAndParagraph( event, 2 )
106
+ );
107
+ useShortcut(
108
+ 'core/block-editor/transform-paragraph-to-heading-3',
109
+ ( event ) => handleTransformHeadingAndParagraph( event, 3 )
110
+ );
111
+ useShortcut(
112
+ 'core/block-editor/transform-paragraph-to-heading-4',
113
+ ( event ) => handleTransformHeadingAndParagraph( event, 4 )
114
+ );
115
+ useShortcut(
116
+ 'core/block-editor/transform-paragraph-to-heading-5',
117
+ ( event ) => handleTransformHeadingAndParagraph( event, 5 )
118
+ );
119
+ useShortcut(
120
+ 'core/block-editor/transform-paragraph-to-heading-6',
121
+ ( event ) => handleTransformHeadingAndParagraph( event, 6 )
122
+ );
109
123
 
110
124
  return null;
111
125
  }
@@ -201,7 +201,7 @@ function CoverEdit( {
201
201
  averageBackgroundColor
202
202
  );
203
203
 
204
- if ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes.id ) {
204
+ if ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id ) {
205
205
  const { imageDefaultSize } = getSettings();
206
206
 
207
207
  // Try to use the previous selected image size if it's available
@@ -26,6 +26,14 @@ export const settings = {
26
26
  customOverlayColor: '#065174',
27
27
  dimRatio: 40,
28
28
  url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',
29
+ style: {
30
+ typography: {
31
+ fontSize: 48,
32
+ },
33
+ color: {
34
+ text: 'white',
35
+ },
36
+ },
29
37
  },
30
38
  innerBlocks: [
31
39
  {
@@ -33,14 +41,6 @@ export const settings = {
33
41
  attributes: {
34
42
  content: __( '<strong>Snow Patrol</strong>' ),
35
43
  align: 'center',
36
- style: {
37
- typography: {
38
- fontSize: 48,
39
- },
40
- color: {
41
- text: 'white',
42
- },
43
- },
44
44
  },
45
45
  },
46
46
  ],
@@ -35,7 +35,7 @@ export function dimRatioToClass( ratio ) {
35
35
  }
36
36
 
37
37
  export function attributesFromMedia( media ) {
38
- if ( ! media || ! media.url ) {
38
+ if ( ! media || ( ! media.url && ! media.src ) ) {
39
39
  return {
40
40
  url: undefined,
41
41
  id: undefined,
@@ -52,23 +52,23 @@ export function attributesFromMedia( media ) {
52
52
  if ( media.media_type === IMAGE_BACKGROUND_TYPE ) {
53
53
  mediaType = IMAGE_BACKGROUND_TYPE;
54
54
  } else {
55
- // only images and videos are accepted so if the media_type is not an image we can assume it is a video.
55
+ // Only images and videos are accepted so if the media_type is not an image we can assume it is a video.
56
56
  // Videos contain the media type of 'file' in the object returned from the rest api.
57
57
  mediaType = VIDEO_BACKGROUND_TYPE;
58
58
  }
59
- } else {
60
59
  // For media selections originated from existing files in the media library.
61
- if (
62
- media.type !== IMAGE_BACKGROUND_TYPE &&
63
- media.type !== VIDEO_BACKGROUND_TYPE
64
- ) {
65
- return;
66
- }
60
+ } else if (
61
+ media.type &&
62
+ ( media.type === IMAGE_BACKGROUND_TYPE ||
63
+ media.type === VIDEO_BACKGROUND_TYPE )
64
+ ) {
67
65
  mediaType = media.type;
66
+ } else {
67
+ return;
68
68
  }
69
69
 
70
70
  return {
71
- url: media.url,
71
+ url: media.url || media.src,
72
72
  id: media.id,
73
73
  alt: media?.alt,
74
74
  backgroundType: mediaType,
@@ -337,7 +337,7 @@ describe( 'Cover block', () => {
337
337
  describe( 'when colors are disabled', () => {
338
338
  test( 'does not render overlay control', async () => {
339
339
  await setup( undefined, true, disabledColorSettings );
340
- await createAndSelectBlock();
340
+ await selectBlock( 'Block: Cover' );
341
341
  await userEvent.click(
342
342
  screen.getByRole( 'tab', { name: 'Styles' } )
343
343
  );
@@ -350,7 +350,7 @@ describe( 'Cover block', () => {
350
350
  } );
351
351
  test( 'does not render opacity control', async () => {
352
352
  await setup( undefined, true, disabledColorSettings );
353
- await createAndSelectBlock();
353
+ await selectBlock( 'Block: Cover' );
354
354
  await userEvent.click(
355
355
  screen.getByRole( 'tab', { name: 'Styles' } )
356
356
  );
@@ -2,7 +2,7 @@
2
2
  * WordPress dependencies
3
3
  */
4
4
  import { details as icon } from '@wordpress/icons';
5
- import { __ } from '@wordpress/i18n';
5
+ import { __, sprintf } from '@wordpress/i18n';
6
6
 
7
7
  /**
8
8
  * Internal dependencies
@@ -34,6 +34,28 @@ export const settings = {
34
34
  },
35
35
  ],
36
36
  },
37
+ __experimentalLabel( attributes, { context } ) {
38
+ const { summary } = attributes;
39
+
40
+ const customName = attributes?.metadata?.name;
41
+ const hasSummary = summary?.trim().length > 0;
42
+
43
+ // In the list view, use the block's summary as the label.
44
+ // If the summary is empty, fall back to the default label.
45
+ if ( context === 'list-view' && ( customName || hasSummary ) ) {
46
+ return customName || summary;
47
+ }
48
+
49
+ if ( context === 'accessibility' ) {
50
+ return ! hasSummary
51
+ ? __( 'Details. Empty.' )
52
+ : sprintf(
53
+ /* translators: accessibility text; summary title. */
54
+ __( 'Details. %s' ),
55
+ summary
56
+ );
57
+ }
58
+ },
37
59
  save,
38
60
  edit,
39
61
  transforms,
package/src/file/edit.js CHANGED
@@ -128,15 +128,21 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
128
128
  }
129
129
 
130
130
  const isPdf = newMedia.url.endsWith( '.pdf' );
131
+ const pdfAttributes = {
132
+ displayPreview: isPdf
133
+ ? attributes.displayPreview ?? true
134
+ : undefined,
135
+ previewHeight: isPdf ? attributes.previewHeight ?? 600 : undefined,
136
+ };
137
+
131
138
  setAttributes( {
132
139
  href: newMedia.url,
133
140
  fileName: newMedia.title,
134
141
  textLinkHref: newMedia.url,
135
142
  id: newMedia.id,
136
- displayPreview: isPdf ? true : undefined,
137
- previewHeight: isPdf ? 600 : undefined,
138
143
  fileId: `wp-block-file--media-${ clientId }`,
139
144
  blob: undefined,
145
+ ...pdfAttributes,
140
146
  } );
141
147
  setTemporaryURL();
142
148
  }
@@ -25,7 +25,7 @@ function ModalAuxiliaryActions( { onClick, isModalFullScreen } ) {
25
25
 
26
26
  return (
27
27
  <Button
28
- size="small"
28
+ size="compact"
29
29
  onClick={ onClick }
30
30
  icon={ fullscreen }
31
31
  isPressed={ isModalFullScreen }
@@ -37,13 +37,7 @@
37
37
  "color": true,
38
38
  "radius": true,
39
39
  "style": true,
40
- "width": true,
41
- "__experimentalDefaultControls": {
42
- "color": true,
43
- "radius": true,
44
- "style": true,
45
- "width": true
46
- }
40
+ "width": true
47
41
  },
48
42
  "color": {
49
43
  "gradients": true,
@@ -6,15 +6,10 @@ import clsx from 'clsx';
6
6
  /**
7
7
  * WordPress dependencies
8
8
  */
9
- import {
10
- RichText,
11
- useBlockProps,
12
- store as blockEditorStore,
13
- } from '@wordpress/block-editor';
9
+ import { RichText, useBlockProps } from '@wordpress/block-editor';
14
10
  import { __ } from '@wordpress/i18n';
15
- import { useSelect, useDispatch } from '@wordpress/data';
11
+ import { useSelect } from '@wordpress/data';
16
12
  import { store as coreStore } from '@wordpress/core-data';
17
- import { useEffect } from '@wordpress/element';
18
13
 
19
14
  const preventDefault = ( event ) => event.preventDefault();
20
15
 
@@ -24,8 +19,6 @@ export default function HomeEdit( { attributes, setAttributes, context } ) {
24
19
  return select( coreStore ).getEntityRecord( 'root', '__unstableBase' )
25
20
  ?.home;
26
21
  }, [] );
27
- const { __unstableMarkNextChangeAsNotPersistent } =
28
- useDispatch( blockEditorStore );
29
22
 
30
23
  const { textColor, backgroundColor, style } = context;
31
24
  const blockProps = useBlockProps( {
@@ -41,42 +34,31 @@ export default function HomeEdit( { attributes, setAttributes, context } ) {
41
34
  },
42
35
  } );
43
36
 
44
- const { label } = attributes;
45
-
46
- useEffect( () => {
47
- if ( label === undefined ) {
48
- __unstableMarkNextChangeAsNotPersistent();
49
- setAttributes( { label: __( 'Home' ) } );
50
- }
51
- }, [ label ] );
52
-
53
37
  return (
54
- <>
55
- <div { ...blockProps }>
56
- <a
57
- className="wp-block-home-link__content wp-block-navigation-item__content"
58
- href={ homeUrl }
59
- onClick={ preventDefault }
60
- >
61
- <RichText
62
- identifier="label"
63
- className="wp-block-home-link__label"
64
- value={ label }
65
- onChange={ ( labelValue ) => {
66
- setAttributes( { label: labelValue } );
67
- } }
68
- aria-label={ __( 'Home link text' ) }
69
- placeholder={ __( 'Add home link' ) }
70
- withoutInteractiveFormatting
71
- allowedFormats={ [
72
- 'core/bold',
73
- 'core/italic',
74
- 'core/image',
75
- 'core/strikethrough',
76
- ] }
77
- />
78
- </a>
79
- </div>
80
- </>
38
+ <div { ...blockProps }>
39
+ <a
40
+ className="wp-block-home-link__content wp-block-navigation-item__content"
41
+ href={ homeUrl }
42
+ onClick={ preventDefault }
43
+ >
44
+ <RichText
45
+ identifier="label"
46
+ className="wp-block-home-link__label"
47
+ value={ attributes.label ?? __( 'Home' ) }
48
+ onChange={ ( labelValue ) => {
49
+ setAttributes( { label: labelValue } );
50
+ } }
51
+ aria-label={ __( 'Home link text' ) }
52
+ placeholder={ __( 'Add home link' ) }
53
+ withoutInteractiveFormatting
54
+ allowedFormats={ [
55
+ 'core/bold',
56
+ 'core/italic',
57
+ 'core/image',
58
+ 'core/strikethrough',
59
+ ] }
60
+ />
61
+ </a>
62
+ </div>
81
63
  );
82
64
  }