@wordpress/block-library 9.12.1-next.082ed6819.0 → 9.13.1-next.cd6172eb0.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 (141) hide show
  1. package/CHANGELOG.md +2 -0
  2. package/build/block/edit.js +2 -29
  3. package/build/block/edit.js.map +1 -1
  4. package/build/cover/edit/index.js +4 -2
  5. package/build/cover/edit/index.js.map +1 -1
  6. package/build/cover/edit/inspector-controls.js +6 -4
  7. package/build/cover/edit/inspector-controls.js.map +1 -1
  8. package/build/list-item/hooks/use-merge.js +2 -2
  9. package/build/list-item/hooks/use-merge.js.map +1 -1
  10. package/build/navigation/edit/deleted-navigation-warning.js +9 -2
  11. package/build/navigation/edit/deleted-navigation-warning.js.map +1 -1
  12. package/build/navigation-submenu/edit.js +3 -0
  13. package/build/navigation-submenu/edit.js.map +1 -1
  14. package/build/pattern/recursion-detector.js +0 -1
  15. package/build/pattern/recursion-detector.js.map +1 -1
  16. package/build/query/edit/index.js +2 -2
  17. package/build/query/edit/index.js.map +1 -1
  18. package/build/query/edit/inspector-controls/author-control.js +0 -1
  19. package/build/query/edit/inspector-controls/author-control.js.map +1 -1
  20. package/build/query/edit/inspector-controls/parent-control.js +0 -1
  21. package/build/query/edit/inspector-controls/parent-control.js.map +1 -1
  22. package/build/query/edit/inspector-controls/taxonomy-controls.js +0 -1
  23. package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  24. package/build/query/edit/{pattern-selection-modal.js → pattern-selection.js} +55 -36
  25. package/build/query/edit/pattern-selection.js.map +1 -0
  26. package/build/query/edit/query-content.js +5 -8
  27. package/build/query/edit/query-content.js.map +1 -1
  28. package/build/query/edit/query-placeholder.js +5 -11
  29. package/build/query/edit/query-placeholder.js.map +1 -1
  30. package/build/query/edit/query-toolbar.js +31 -11
  31. package/build/query/edit/query-toolbar.js.map +1 -1
  32. package/build/separator/deprecated.js +2 -1
  33. package/build/separator/deprecated.js.map +1 -1
  34. package/build/separator/edit.js +29 -4
  35. package/build/separator/edit.js.map +1 -1
  36. package/build/separator/index.js +5 -0
  37. package/build/separator/index.js.map +1 -1
  38. package/build/separator/save.js +3 -2
  39. package/build/separator/save.js.map +1 -1
  40. package/build/social-link/edit.js +35 -1
  41. package/build/social-link/edit.js.map +1 -1
  42. package/build/social-link/index.js +4 -2
  43. package/build/social-link/index.js.map +1 -1
  44. package/build/template-part/edit/import-controls.js +0 -1
  45. package/build/template-part/edit/import-controls.js.map +1 -1
  46. package/build-module/block/edit.js +3 -30
  47. package/build-module/block/edit.js.map +1 -1
  48. package/build-module/cover/edit/index.js +4 -2
  49. package/build-module/cover/edit/index.js.map +1 -1
  50. package/build-module/cover/edit/inspector-controls.js +6 -4
  51. package/build-module/cover/edit/inspector-controls.js.map +1 -1
  52. package/build-module/list-item/hooks/use-merge.js +2 -2
  53. package/build-module/list-item/hooks/use-merge.js.map +1 -1
  54. package/build-module/navigation/edit/deleted-navigation-warning.js +10 -3
  55. package/build-module/navigation/edit/deleted-navigation-warning.js.map +1 -1
  56. package/build-module/navigation-submenu/edit.js +3 -0
  57. package/build-module/navigation-submenu/edit.js.map +1 -1
  58. package/build-module/pattern/recursion-detector.js +0 -1
  59. package/build-module/pattern/recursion-detector.js.map +1 -1
  60. package/build-module/query/edit/index.js +1 -1
  61. package/build-module/query/edit/index.js.map +1 -1
  62. package/build-module/query/edit/inspector-controls/author-control.js +0 -1
  63. package/build-module/query/edit/inspector-controls/author-control.js.map +1 -1
  64. package/build-module/query/edit/inspector-controls/parent-control.js +0 -1
  65. package/build-module/query/edit/inspector-controls/parent-control.js.map +1 -1
  66. package/build-module/query/edit/inspector-controls/taxonomy-controls.js +0 -1
  67. package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
  68. package/build-module/query/edit/{pattern-selection-modal.js → pattern-selection.js} +53 -36
  69. package/build-module/query/edit/pattern-selection.js.map +1 -0
  70. package/build-module/query/edit/query-content.js +5 -8
  71. package/build-module/query/edit/query-content.js.map +1 -1
  72. package/build-module/query/edit/query-placeholder.js +6 -12
  73. package/build-module/query/edit/query-placeholder.js.map +1 -1
  74. package/build-module/query/edit/query-toolbar.js +31 -13
  75. package/build-module/query/edit/query-toolbar.js.map +1 -1
  76. package/build-module/separator/deprecated.js +2 -1
  77. package/build-module/separator/deprecated.js.map +1 -1
  78. package/build-module/separator/edit.js +32 -7
  79. package/build-module/separator/edit.js.map +1 -1
  80. package/build-module/separator/index.js +5 -0
  81. package/build-module/separator/index.js.map +1 -1
  82. package/build-module/separator/save.js +3 -2
  83. package/build-module/separator/save.js.map +1 -1
  84. package/build-module/social-link/edit.js +37 -3
  85. package/build-module/social-link/edit.js.map +1 -1
  86. package/build-module/social-link/index.js +4 -2
  87. package/build-module/social-link/index.js.map +1 -1
  88. package/build-module/template-part/edit/import-controls.js +0 -1
  89. package/build-module/template-part/edit/import-controls.js.map +1 -1
  90. package/build-style/comments-pagination/editor-rtl.css +1 -0
  91. package/build-style/comments-pagination/editor.css +1 -0
  92. package/build-style/comments-pagination/style-rtl.css +1 -0
  93. package/build-style/comments-pagination/style.css +1 -0
  94. package/build-style/editor-rtl.css +35 -0
  95. package/build-style/editor.css +35 -0
  96. package/build-style/image/style-rtl.css +3 -2
  97. package/build-style/image/style.css +3 -2
  98. package/build-style/pullquote/style-rtl.css +1 -0
  99. package/build-style/pullquote/style.css +1 -0
  100. package/build-style/query/editor-rtl.css +30 -0
  101. package/build-style/query/editor.css +30 -0
  102. package/build-style/social-link/editor-rtl.css +4 -0
  103. package/build-style/social-link/editor.css +4 -0
  104. package/build-style/style-rtl.css +5 -2
  105. package/build-style/style.css +5 -2
  106. package/build-types/lock-unlock.d.ts +1 -1
  107. package/build-types/lock-unlock.d.ts.map +1 -1
  108. package/package.json +34 -34
  109. package/src/block/edit.js +6 -51
  110. package/src/comments-pagination/editor.scss +1 -0
  111. package/src/comments-pagination/style.scss +1 -0
  112. package/src/cover/edit/index.js +4 -1
  113. package/src/cover/edit/inspector-controls.js +10 -3
  114. package/src/cover/index.php +2 -2
  115. package/src/image/style.scss +4 -3
  116. package/src/list-item/hooks/use-merge.js +2 -2
  117. package/src/missing/test/edit.native.js +0 -1
  118. package/src/navigation/README.md +1 -0
  119. package/src/navigation/edit/deleted-navigation-warning.js +11 -2
  120. package/src/navigation/index.php +9 -35
  121. package/src/navigation-submenu/edit.js +5 -0
  122. package/src/navigation-submenu/index.php +17 -1
  123. package/src/pullquote/style.scss +1 -0
  124. package/src/query/edit/index.js +1 -1
  125. package/src/query/edit/{pattern-selection-modal.js → pattern-selection.js} +53 -33
  126. package/src/query/edit/query-content.js +4 -10
  127. package/src/query/edit/query-placeholder.js +5 -14
  128. package/src/query/edit/query-toolbar.js +38 -17
  129. package/src/query/editor.scss +30 -0
  130. package/src/search/index.php +3 -3
  131. package/src/separator/block.json +5 -0
  132. package/src/separator/deprecated.js +1 -0
  133. package/src/separator/edit.js +28 -3
  134. package/src/separator/save.js +2 -2
  135. package/src/separator/test/edit.js +1 -0
  136. package/src/social-link/block.json +4 -2
  137. package/src/social-link/edit.js +40 -0
  138. package/src/social-link/editor.scss +5 -0
  139. package/tsconfig.tsbuildinfo +1 -1
  140. package/build/query/edit/pattern-selection-modal.js.map +0 -1
  141. package/build-module/query/edit/pattern-selection-modal.js.map +0 -1
@@ -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
  }
@@ -544,6 +544,7 @@
544
544
  .wp-block-comments-pagination > .wp-block-comments-pagination-numbers {
545
545
  margin-right: 0.5em;
546
546
  margin-bottom: 0.5em;
547
+ font-size: inherit;
547
548
  }
548
549
  .wp-block-comments-pagination > .wp-block-comments-pagination-next:last-child,
549
550
  .wp-block-comments-pagination > .wp-block-comments-pagination-previous:last-child,
@@ -1599,7 +1600,8 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1599
1600
  rotate: 180deg;
1600
1601
  }
1601
1602
 
1602
- .wp-block-image a {
1603
+ .wp-block-image > a,
1604
+ .wp-block-image > figure > a {
1603
1605
  display: inline-block;
1604
1606
  }
1605
1607
  .wp-block-image img {
@@ -1626,7 +1628,7 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1626
1628
  .wp-block-image.aligncenter {
1627
1629
  text-align: center;
1628
1630
  }
1629
- .wp-block-image.alignfull a, .wp-block-image.alignwide a {
1631
+ .wp-block-image.alignfull > a, .wp-block-image.alignwide > a {
1630
1632
  width: 100%;
1631
1633
  }
1632
1634
  .wp-block-image.alignfull img, .wp-block-image.alignwide img {
@@ -3127,6 +3129,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3127
3129
 
3128
3130
  .wp-block-pullquote cite {
3129
3131
  color: inherit;
3132
+ display: block;
3130
3133
  }
3131
3134
 
3132
3135
  .wp-block-post-template {
@@ -550,6 +550,7 @@
550
550
  /*rtl:ignore*/
551
551
  margin-right: 0.5em;
552
552
  margin-bottom: 0.5em;
553
+ font-size: inherit;
553
554
  }
554
555
  .wp-block-comments-pagination > .wp-block-comments-pagination-next:last-child,
555
556
  .wp-block-comments-pagination > .wp-block-comments-pagination-previous:last-child,
@@ -1609,7 +1610,8 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1609
1610
  rotate: 180deg;
1610
1611
  }
1611
1612
 
1612
- .wp-block-image a {
1613
+ .wp-block-image > a,
1614
+ .wp-block-image > figure > a {
1613
1615
  display: inline-block;
1614
1616
  }
1615
1617
  .wp-block-image img {
@@ -1636,7 +1638,7 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
1636
1638
  .wp-block-image.aligncenter {
1637
1639
  text-align: center;
1638
1640
  }
1639
- .wp-block-image.alignfull a, .wp-block-image.alignwide a {
1641
+ .wp-block-image.alignfull > a, .wp-block-image.alignwide > a {
1640
1642
  width: 100%;
1641
1643
  }
1642
1644
  .wp-block-image.alignfull img, .wp-block-image.alignwide img {
@@ -3159,6 +3161,7 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
3159
3161
 
3160
3162
  .wp-block-pullquote cite {
3161
3163
  color: inherit;
3164
+ display: block;
3162
3165
  }
3163
3166
 
3164
3167
  .wp-block-post-template {
@@ -1,2 +1,2 @@
1
- export declare const lock: (object: Record<symbol, WeakKey>, privateData: unknown) => void, unlock: (object: Record<symbol, WeakKey>) => any;
1
+ export declare const lock: (object: unknown, privateData: unknown) => void, unlock: <T = any>(object: unknown) => T;
2
2
  //# sourceMappingURL=lock-unlock.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lock-unlock.d.ts","sourceRoot":"","sources":["../src/lock-unlock.ts"],"names":[],"mappings":"AAKA,eAAO,MAAQ,IAAI,mEAAE,MAAM,0CAIzB,CAAC"}
1
+ {"version":3,"file":"lock-unlock.d.ts","sourceRoot":"","sources":["../src/lock-unlock.ts"],"names":[],"mappings":"AAKA,eAAO,MAAQ,IAAI,mDAAE,MAAM,iCAIzB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.12.1-next.082ed6819.0",
3
+ "version": "9.13.1-next.cd6172eb0.0",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -40,39 +40,39 @@
40
40
  ],
41
41
  "dependencies": {
42
42
  "@babel/runtime": "7.25.7",
43
- "@wordpress/a11y": "^4.12.1-next.082ed6819.0",
44
- "@wordpress/api-fetch": "^7.12.1-next.082ed6819.0",
45
- "@wordpress/autop": "^4.12.1-next.082ed6819.0",
46
- "@wordpress/blob": "^4.12.1-next.082ed6819.0",
47
- "@wordpress/block-editor": "^14.7.1-next.082ed6819.0",
48
- "@wordpress/blocks": "^14.1.1-next.082ed6819.0",
43
+ "@wordpress/a11y": "^4.13.1-next.cd6172eb0.0",
44
+ "@wordpress/api-fetch": "^7.13.1-next.cd6172eb0.0",
45
+ "@wordpress/autop": "^4.13.1-next.cd6172eb0.0",
46
+ "@wordpress/blob": "^4.13.1-next.cd6172eb0.0",
47
+ "@wordpress/block-editor": "^14.8.1-next.cd6172eb0.0",
48
+ "@wordpress/blocks": "^14.2.1-next.cd6172eb0.0",
49
49
  "@wordpress/components": "*",
50
- "@wordpress/compose": "^7.12.1-next.082ed6819.0",
51
- "@wordpress/core-data": "^7.12.1-next.082ed6819.0",
52
- "@wordpress/data": "*",
53
- "@wordpress/date": "^5.12.1-next.082ed6819.0",
54
- "@wordpress/deprecated": "^4.12.1-next.082ed6819.0",
55
- "@wordpress/dom": "^4.12.1-next.082ed6819.0",
56
- "@wordpress/element": "^6.12.1-next.082ed6819.0",
57
- "@wordpress/escape-html": "^3.12.1-next.082ed6819.0",
58
- "@wordpress/hooks": "^4.12.1-next.082ed6819.0",
59
- "@wordpress/html-entities": "^4.12.1-next.082ed6819.0",
60
- "@wordpress/i18n": "^5.12.1-next.082ed6819.0",
61
- "@wordpress/icons": "^10.12.1-next.082ed6819.0",
62
- "@wordpress/interactivity": "^6.12.1-next.082ed6819.0",
63
- "@wordpress/interactivity-router": "^2.12.1-next.082ed6819.0",
64
- "@wordpress/keyboard-shortcuts": "^5.12.1-next.082ed6819.0",
65
- "@wordpress/keycodes": "^4.12.1-next.082ed6819.0",
66
- "@wordpress/notices": "^5.12.1-next.082ed6819.0",
67
- "@wordpress/patterns": "^2.12.1-next.082ed6819.0",
68
- "@wordpress/primitives": "^4.12.1-next.082ed6819.0",
69
- "@wordpress/private-apis": "^1.12.1-next.082ed6819.0",
70
- "@wordpress/reusable-blocks": "^5.12.1-next.082ed6819.0",
71
- "@wordpress/rich-text": "^7.12.1-next.082ed6819.0",
72
- "@wordpress/server-side-render": "^5.12.1-next.082ed6819.0",
73
- "@wordpress/url": "^4.12.1-next.082ed6819.0",
74
- "@wordpress/viewport": "^6.12.1-next.082ed6819.0",
75
- "@wordpress/wordcount": "^4.12.1-next.082ed6819.0",
50
+ "@wordpress/compose": "^7.13.1-next.cd6172eb0.0",
51
+ "@wordpress/core-data": "^7.13.1-next.cd6172eb0.0",
52
+ "@wordpress/data": "^10.13.1-next.cd6172eb0.0",
53
+ "@wordpress/date": "^5.13.1-next.cd6172eb0.0",
54
+ "@wordpress/deprecated": "^4.13.1-next.cd6172eb0.0",
55
+ "@wordpress/dom": "^4.13.1-next.cd6172eb0.0",
56
+ "@wordpress/element": "^6.13.1-next.cd6172eb0.0",
57
+ "@wordpress/escape-html": "^3.13.1-next.cd6172eb0.0",
58
+ "@wordpress/hooks": "^4.13.1-next.cd6172eb0.0",
59
+ "@wordpress/html-entities": "^4.13.1-next.cd6172eb0.0",
60
+ "@wordpress/i18n": "^5.13.1-next.cd6172eb0.0",
61
+ "@wordpress/icons": "^10.13.1-next.cd6172eb0.0",
62
+ "@wordpress/interactivity": "^6.13.1-next.cd6172eb0.0",
63
+ "@wordpress/interactivity-router": "^2.13.1-next.cd6172eb0.0",
64
+ "@wordpress/keyboard-shortcuts": "^5.13.1-next.cd6172eb0.0",
65
+ "@wordpress/keycodes": "^4.13.1-next.cd6172eb0.0",
66
+ "@wordpress/notices": "^5.13.1-next.cd6172eb0.0",
67
+ "@wordpress/patterns": "^2.13.1-next.cd6172eb0.0",
68
+ "@wordpress/primitives": "^4.13.1-next.cd6172eb0.0",
69
+ "@wordpress/private-apis": "^1.13.1-next.cd6172eb0.0",
70
+ "@wordpress/reusable-blocks": "^5.13.1-next.cd6172eb0.0",
71
+ "@wordpress/rich-text": "^7.13.1-next.cd6172eb0.0",
72
+ "@wordpress/server-side-render": "^5.13.1-next.cd6172eb0.0",
73
+ "@wordpress/url": "^4.13.1-next.cd6172eb0.0",
74
+ "@wordpress/viewport": "^6.13.1-next.cd6172eb0.0",
75
+ "@wordpress/wordcount": "^4.13.1-next.cd6172eb0.0",
76
76
  "change-case": "^4.1.2",
77
77
  "clsx": "^2.1.1",
78
78
  "colord": "^2.7.0",
@@ -90,5 +90,5 @@
90
90
  "publishConfig": {
91
91
  "access": "public"
92
92
  },
93
- "gitHead": "2bb7bad15ddb8e88210fab7d4a1ef1565466e424"
93
+ "gitHead": "4cc93dc1781d8a7bc2bbde265913917920e2bd45"
94
94
  }
package/src/block/edit.js CHANGED
@@ -7,7 +7,7 @@ import clsx from 'clsx';
7
7
  * WordPress dependencies
8
8
  */
9
9
  import { useSelect, useDispatch } from '@wordpress/data';
10
- import { useRef, useMemo, useEffect } from '@wordpress/element';
10
+ import { useRef, useMemo } from '@wordpress/element';
11
11
  import {
12
12
  useEntityRecord,
13
13
  store as coreStore,
@@ -37,12 +37,10 @@ import { getBlockBindingsSource } from '@wordpress/blocks';
37
37
  /**
38
38
  * Internal dependencies
39
39
  */
40
- import { name as patternBlockName } from './index';
41
40
  import { unlock } from '../lock-unlock';
42
41
 
43
42
  const { useLayoutClasses } = unlock( blockEditorPrivateApis );
44
- const { isOverridableBlock, hasOverridableBlocks } =
45
- unlock( patternsPrivateApis );
43
+ const { hasOverridableBlocks } = unlock( patternsPrivateApis );
46
44
 
47
45
  const fullAlignments = [ 'full', 'wide', 'left', 'right' ];
48
46
 
@@ -75,22 +73,6 @@ const useInferredLayout = ( blocks, parentLayout ) => {
75
73
  }, [ blocks, parentLayout ] );
76
74
  };
77
75
 
78
- function setBlockEditMode( setEditMode, blocks, mode ) {
79
- blocks.forEach( ( block ) => {
80
- const editMode =
81
- mode ||
82
- ( isOverridableBlock( block ) ? 'contentOnly' : 'disabled' );
83
- setEditMode( block.clientId, editMode );
84
-
85
- setBlockEditMode(
86
- setEditMode,
87
- block.innerBlocks,
88
- // Disable editing for nested patterns.
89
- block.name === patternBlockName ? 'disabled' : mode
90
- );
91
- } );
92
- }
93
-
94
76
  function RecursionWarning() {
95
77
  const blockProps = useBlockProps();
96
78
  return (
@@ -171,7 +153,6 @@ function ReusableBlockEdit( {
171
153
  name,
172
154
  attributes: { ref, content },
173
155
  __unstableParentLayout: parentLayout,
174
- clientId: patternClientId,
175
156
  setAttributes,
176
157
  } ) {
177
158
  const { record, hasResolved } = useEntityRecord(
@@ -184,49 +165,24 @@ function ReusableBlockEdit( {
184
165
  } );
185
166
  const isMissing = hasResolved && ! record;
186
167
 
187
- const { setBlockEditingMode, __unstableMarkLastChangeAsPersistent } =
168
+ const { __unstableMarkLastChangeAsPersistent } =
188
169
  useDispatch( blockEditorStore );
189
170
 
190
- const {
191
- innerBlocks,
192
- onNavigateToEntityRecord,
193
- editingMode,
194
- hasPatternOverridesSource,
195
- } = useSelect(
171
+ const { onNavigateToEntityRecord, hasPatternOverridesSource } = useSelect(
196
172
  ( select ) => {
197
- const { getBlocks, getSettings, getBlockEditingMode } =
198
- select( blockEditorStore );
173
+ const { getSettings } = select( blockEditorStore );
199
174
  // For editing link to the site editor if the theme and user permissions support it.
200
175
  return {
201
- innerBlocks: getBlocks( patternClientId ),
202
176
  onNavigateToEntityRecord:
203
177
  getSettings().onNavigateToEntityRecord,
204
- editingMode: getBlockEditingMode( patternClientId ),
205
178
  hasPatternOverridesSource: !! getBlockBindingsSource(
206
179
  'core/pattern-overrides'
207
180
  ),
208
181
  };
209
182
  },
210
- [ patternClientId ]
183
+ []
211
184
  );
212
185
 
213
- // Sync the editing mode of the pattern block with the inner blocks.
214
- useEffect( () => {
215
- setBlockEditMode(
216
- setBlockEditingMode,
217
- innerBlocks,
218
- // Disable editing if the pattern itself is disabled.
219
- editingMode === 'disabled' || ! hasPatternOverridesSource
220
- ? 'disabled'
221
- : undefined
222
- );
223
- }, [
224
- editingMode,
225
- innerBlocks,
226
- setBlockEditingMode,
227
- hasPatternOverridesSource,
228
- ] );
229
-
230
186
  const canOverrideBlocks = useMemo(
231
187
  () => hasPatternOverridesSource && hasOverridableBlocks( blocks ),
232
188
  [ hasPatternOverridesSource, blocks ]
@@ -244,7 +200,6 @@ function ReusableBlockEdit( {
244
200
  } );
245
201
 
246
202
  const innerBlocksProps = useInnerBlocksProps( blockProps, {
247
- templateLock: 'all',
248
203
  layout,
249
204
  value: blocks,
250
205
  onInput: NOOP,
@@ -26,6 +26,7 @@ $pagination-margin: 0.5em;
26
26
  margin-right: $pagination-margin;
27
27
  margin-bottom: $pagination-margin;
28
28
 
29
+ font-size: inherit;
29
30
  &:last-child {
30
31
  /*rtl:ignore*/
31
32
  margin-right: 0;
@@ -8,6 +8,7 @@ $pagination-margin: 0.5em;
8
8
  margin-right: $pagination-margin;
9
9
  margin-bottom: $pagination-margin;
10
10
 
11
+ font-size: inherit;
11
12
  &:last-child {
12
13
  /*rtl:ignore*/
13
14
  margin-right: 0;
@@ -120,7 +120,9 @@ function CoverEdit( {
120
120
  select( coreStore ).getMedia( featuredImage, { context: 'view' } ),
121
121
  [ featuredImage ]
122
122
  );
123
- const mediaUrl = media?.source_url;
123
+ const mediaUrl =
124
+ media?.media_details?.sizes?.[ sizeSlug ]?.source_url ??
125
+ media?.source_url;
124
126
 
125
127
  // User can change the featured image outside of the block, but we still
126
128
  // need to update the block when that happens. This effect should only
@@ -451,6 +453,7 @@ function CoverEdit( {
451
453
  toggleUseFeaturedImage={ toggleUseFeaturedImage }
452
454
  updateDimRatio={ onUpdateDimRatio }
453
455
  onClearMedia={ onClearMedia }
456
+ featuredImage={ media }
454
457
  />
455
458
  );
456
459
 
@@ -96,6 +96,7 @@ export default function CoverInspectorControls( {
96
96
  coverRef,
97
97
  currentSettings,
98
98
  updateDimRatio,
99
+ featuredImage,
99
100
  } ) {
100
101
  const {
101
102
  useFeaturedImage,
@@ -132,8 +133,12 @@ export default function CoverInspectorControls( {
132
133
  [ id, isImageBackground ]
133
134
  );
134
135
 
136
+ const currentBackgroundImage = useFeaturedImage ? featuredImage : image;
137
+
135
138
  function updateImage( newSizeSlug ) {
136
- const newUrl = image?.media_details?.sizes?.[ newSizeSlug ]?.source_url;
139
+ const newUrl =
140
+ currentBackgroundImage?.media_details?.sizes?.[ newSizeSlug ]
141
+ ?.source_url;
137
142
  if ( ! newUrl ) {
138
143
  return null;
139
144
  }
@@ -146,7 +151,9 @@ export default function CoverInspectorControls( {
146
151
 
147
152
  const imageSizeOptions = imageSizes
148
153
  ?.filter(
149
- ( { slug } ) => image?.media_details?.sizes?.[ slug ]?.source_url
154
+ ( { slug } ) =>
155
+ currentBackgroundImage?.media_details?.sizes?.[ slug ]
156
+ ?.source_url
150
157
  )
151
158
  ?.map( ( { name, slug } ) => ( { value: slug, label: name } ) );
152
159
 
@@ -321,7 +328,7 @@ export default function CoverInspectorControls( {
321
328
  />
322
329
  </ToolsPanelItem>
323
330
  ) }
324
- { ! useFeaturedImage && !! imageSizeOptions?.length && (
331
+ { !! imageSizeOptions?.length && (
325
332
  <ResolutionTool
326
333
  value={ sizeSlug }
327
334
  onChange={ updateImage }
@@ -35,12 +35,12 @@ function render_block_core_cover( $attributes, $content ) {
35
35
  $attr['style'] = 'object-position:' . $object_position . ';';
36
36
  }
37
37
 
38
- $image = get_the_post_thumbnail( null, 'post-thumbnail', $attr );
38
+ $image = get_the_post_thumbnail( null, $attributes['sizeSlug'] ?? 'post-thumbnail', $attr );
39
39
  } else {
40
40
  if ( in_the_loop() ) {
41
41
  update_post_thumbnail_cache();
42
42
  }
43
- $current_featured_image = get_the_post_thumbnail_url();
43
+ $current_featured_image = get_the_post_thumbnail_url( null, $attributes['sizeSlug'] ?? null );
44
44
  if ( ! $current_featured_image ) {
45
45
  return $content;
46
46
  }
@@ -1,6 +1,7 @@
1
1
  .wp-block-image {
2
2
 
3
- a {
3
+ > a,
4
+ > figure > a {
4
5
  display: inline-block;
5
6
  }
6
7
 
@@ -42,8 +43,8 @@
42
43
  text-align: center;
43
44
  }
44
45
 
45
- &.alignfull a,
46
- &.alignwide a {
46
+ &.alignfull > a,
47
+ &.alignwide > a {
47
48
  width: 100%;
48
49
  }
49
50
 
@@ -49,7 +49,7 @@ export default function useMerge( clientId, onMerge ) {
49
49
  * return the next list item of the parent list item if it exists.
50
50
  *
51
51
  * @param {string} id A list item client ID.
52
- * @return {string?} The client ID of the next list item.
52
+ * @return {?string} The client ID of the next list item.
53
53
  */
54
54
  function _getNextId( id ) {
55
55
  const next = getNextBlockClientId( id );
@@ -68,7 +68,7 @@ export default function useMerge( clientId, onMerge ) {
68
68
  * line, regardless of indentation level.
69
69
  *
70
70
  * @param {string} id The client ID of the current list item.
71
- * @return {string?} The client ID of the next list item.
71
+ * @return {?string} The client ID of the next list item.
72
72
  */
73
73
  function getNextId( id ) {
74
74
  const order = getBlockOrder( id );
@@ -10,7 +10,6 @@ import { Text } from 'react-native';
10
10
  import { BottomSheet, Icon } from '@wordpress/components';
11
11
  import { help, plugins } from '@wordpress/icons';
12
12
  import { storeConfig } from '@wordpress/block-editor';
13
- jest.mock( '@wordpress/blocks' );
14
13
  jest.mock( '@wordpress/block-editor/src/store/selectors' );
15
14
 
16
15
  /**
@@ -10,4 +10,5 @@ The structural CSS for the navigation block targets generic classnames across me
10
10
  - `.wp-block-navigation-item` is applied to every menu item.
11
11
  - `.wp-block-navigation-item__content` is applied to the link inside a menu item.
12
12
  - `.wp-block-navigation-item__label` is applied to the innermost container around the menu item text label.
13
+ - `.wp-block-navigation-item__description` is applied to the innermost container around the menu item description.
13
14
  - `.wp-block-navigation__submenu-icon` is applied to the submenu indicator (chevron).
@@ -4,9 +4,16 @@
4
4
  import { Warning } from '@wordpress/block-editor';
5
5
  import { Button, Notice } from '@wordpress/components';
6
6
  import { __ } from '@wordpress/i18n';
7
- import { createInterpolateElement } from '@wordpress/element';
7
+ import { useState, createInterpolateElement } from '@wordpress/element';
8
8
 
9
9
  function DeletedNavigationWarning( { onCreateNew, isNotice = false } ) {
10
+ const [ isButtonDisabled, setIsButtonDisabled ] = useState( false );
11
+
12
+ const handleButtonClick = () => {
13
+ setIsButtonDisabled( true );
14
+ onCreateNew();
15
+ };
16
+
10
17
  const message = createInterpolateElement(
11
18
  __(
12
19
  'Navigation Menu has been deleted or is unavailable. <button>Create a new Menu?</button>'
@@ -15,8 +22,10 @@ function DeletedNavigationWarning( { onCreateNew, isNotice = false } ) {
15
22
  button: (
16
23
  <Button
17
24
  __next40pxDefaultSize
18
- onClick={ onCreateNew }
25
+ onClick={ handleButtonClick }
19
26
  variant="link"
27
+ disabled={ isButtonDisabled }
28
+ accessibleWhenDisabled
20
29
  />
21
30
  ),
22
31
  }
@@ -567,13 +567,14 @@ class WP_Navigation_Block_Renderer {
567
567
  $is_responsive_menu = static::is_responsive( $attributes );
568
568
  $style = static::get_styles( $attributes );
569
569
  $class = static::get_classes( $attributes );
570
- $wrapper_attributes = get_block_wrapper_attributes(
571
- array(
572
- 'class' => $class,
573
- 'style' => $style,
574
- 'aria-label' => $nav_menu_name,
575
- )
570
+ $extra_attributes = array(
571
+ 'class' => $class,
572
+ 'style' => $style,
576
573
  );
574
+ if ( ! empty( $nav_menu_name ) ) {
575
+ $extra_attributes['aria-label'] = $nav_menu_name;
576
+ }
577
+ $wrapper_attributes = get_block_wrapper_attributes( $extra_attributes );
577
578
 
578
579
  if ( $is_responsive_menu ) {
579
580
  $nav_element_directives = static::get_nav_element_directives( $is_interactive );
@@ -1436,20 +1437,6 @@ function block_core_navigation_get_most_recently_published_navigation() {
1436
1437
  return null;
1437
1438
  }
1438
1439
 
1439
- /**
1440
- * Accepts the serialized markup of a block and its inner blocks, and returns serialized markup of the inner blocks.
1441
- *
1442
- * @since 6.5.0
1443
- *
1444
- * @param string $serialized_block The serialized markup of a block and its inner blocks.
1445
- * @return string
1446
- */
1447
- function block_core_navigation_remove_serialized_parent_block( $serialized_block ) {
1448
- $start = strpos( $serialized_block, '-->' ) + strlen( '-->' );
1449
- $end = strrpos( $serialized_block, '<!--' );
1450
- return substr( $serialized_block, $start, $end - $start );
1451
- }
1452
-
1453
1440
  /**
1454
1441
  * Mock a parsed block for the Navigation block given its inner blocks and the `wp_navigation` post object.
1455
1442
  * The `wp_navigation` post's `_wp_ignored_hooked_blocks` meta is queried to add the `metadata.ignoredHookedBlocks` attribute.
@@ -1504,19 +1491,6 @@ function block_core_navigation_mock_parsed_block( $inner_blocks, $post ) {
1504
1491
  function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post ) {
1505
1492
  $mock_navigation_block = block_core_navigation_mock_parsed_block( $inner_blocks, $post );
1506
1493
 
1507
- if ( function_exists( 'apply_block_hooks_to_content' ) ) {
1508
- $mock_navigation_block_markup = serialize_block( $mock_navigation_block );
1509
- return apply_block_hooks_to_content( $mock_navigation_block_markup, $post, 'insert_hooked_blocks' );
1510
- }
1511
-
1512
- $hooked_blocks = get_hooked_blocks();
1513
- $before_block_visitor = null;
1514
- $after_block_visitor = null;
1515
-
1516
- if ( ! empty( $hooked_blocks ) || has_filter( 'hooked_block_types' ) ) {
1517
- $before_block_visitor = make_before_block_visitor( $hooked_blocks, $post, 'insert_hooked_blocks' );
1518
- $after_block_visitor = make_after_block_visitor( $hooked_blocks, $post, 'insert_hooked_blocks' );
1519
- }
1520
-
1521
- return traverse_and_serialize_block( $mock_navigation_block, $before_block_visitor, $after_block_visitor );
1494
+ $mock_navigation_block_markup = serialize_block( $mock_navigation_block );
1495
+ return apply_block_hooks_to_content( $mock_navigation_block_markup, $post, 'insert_hooked_blocks' );
1522
1496
  }
@@ -474,6 +474,11 @@ export default function NavigationSubmenuEdit( {
474
474
  }
475
475
  } }
476
476
  />
477
+ { description && (
478
+ <span className="wp-block-navigation-item__description">
479
+ { description }
480
+ </span>
481
+ ) }
477
482
  { ! openSubmenusOnClick && isLinkOpen && (
478
483
  <LinkUI
479
484
  clientId={ clientId }
@@ -159,7 +159,16 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
159
159
  $html .= '>';
160
160
  // End appending HTML attributes to anchor tag.
161
161
 
162
+ $html .= '<span class="wp-block-navigation-item__label">';
162
163
  $html .= $label;
164
+ $html .= '</span>';
165
+
166
+ // Add description if available.
167
+ if ( ! empty( $attributes['description'] ) ) {
168
+ $html .= '<span class="wp-block-navigation-item__description">';
169
+ $html .= wp_kses_post( $attributes['description'] );
170
+ $html .= '</span>';
171
+ }
163
172
 
164
173
  $html .= '</a>';
165
174
  // End anchor tag content.
@@ -180,6 +189,13 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
180
189
 
181
190
  $html .= '</span>';
182
191
 
192
+ // Add description if available.
193
+ if ( ! empty( $attributes['description'] ) ) {
194
+ $html .= '<span class="wp-block-navigation-item__description">';
195
+ $html .= wp_kses_post( $attributes['description'] );
196
+ $html .= '</span>';
197
+ }
198
+
183
199
  $html .= '</button>';
184
200
 
185
201
  $html .= '<span class="wp-block-navigation__submenu-icon">' . block_core_navigation_submenu_render_submenu_icon() . '</span>';
@@ -222,7 +238,7 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
222
238
 
223
239
  if ( strpos( $inner_blocks_html, 'current-menu-item' ) ) {
224
240
  $tag_processor = new WP_HTML_Tag_Processor( $html );
225
- while ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-navigation-item__content' ) ) ) {
241
+ while ( $tag_processor->next_tag( array( 'class_name' => 'wp-block-navigation-item' ) ) ) {
226
242
  $tag_processor->add_class( 'current-menu-ancestor' );
227
243
  }
228
244
  $html = $tag_processor->get_updated_html();
@@ -72,4 +72,5 @@
72
72
 
73
73
  .wp-block-pullquote cite {
74
74
  color: inherit;
75
+ display: block;
75
76
  }
@@ -10,7 +10,7 @@ import { store as blockEditorStore } from '@wordpress/block-editor';
10
10
  */
11
11
  import QueryContent from './query-content';
12
12
  import QueryPlaceholder from './query-placeholder';
13
- import PatternSelectionModal from './pattern-selection-modal';
13
+ import { PatternSelectionModal } from './pattern-selection';
14
14
 
15
15
  const QueryEdit = ( props ) => {
16
16
  const { clientId, attributes } = props;