@wordpress/block-library 9.36.0 → 9.36.1-next.6deb34194.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 (175) hide show
  1. package/build/audio/index.js +1 -1
  2. package/build/audio/index.js.map +2 -2
  3. package/build/avatar/edit.js +13 -38
  4. package/build/avatar/edit.js.map +2 -2
  5. package/build/breadcrumbs/block.json +3 -2
  6. package/build/breadcrumbs/edit.js +18 -18
  7. package/build/breadcrumbs/edit.js.map +2 -2
  8. package/build/button/index.js +1 -1
  9. package/build/button/index.js.map +2 -2
  10. package/build/code/index.js +1 -1
  11. package/build/code/index.js.map +2 -2
  12. package/build/comments-pagination-numbers/block.json +7 -0
  13. package/build/cover/index.js +2 -2
  14. package/build/cover/index.js.map +2 -2
  15. package/build/details/index.js +1 -1
  16. package/build/details/index.js.map +2 -2
  17. package/build/file/index.js +1 -1
  18. package/build/file/index.js.map +2 -2
  19. package/build/gallery/edit.js +1 -1
  20. package/build/gallery/edit.js.map +2 -2
  21. package/build/gallery/transforms.js +7 -3
  22. package/build/gallery/transforms.js.map +2 -2
  23. package/build/heading/index.js +1 -1
  24. package/build/heading/index.js.map +2 -2
  25. package/build/html/modal.js +18 -7
  26. package/build/html/modal.js.map +2 -2
  27. package/build/image/index.js +1 -1
  28. package/build/image/index.js.map +2 -2
  29. package/build/index.js +9 -3
  30. package/build/index.js.map +2 -2
  31. package/build/list-item/index.js +1 -1
  32. package/build/list-item/index.js.map +2 -2
  33. package/build/math/edit.js +14 -2
  34. package/build/math/edit.js.map +2 -2
  35. package/build/media-text/index.js +1 -1
  36. package/build/media-text/index.js.map +2 -2
  37. package/build/more/index.js +1 -1
  38. package/build/more/index.js.map +2 -2
  39. package/build/navigation-link/index.js +1 -1
  40. package/build/navigation-link/index.js.map +2 -2
  41. package/build/navigation-submenu/index.js +1 -1
  42. package/build/navigation-submenu/index.js.map +2 -2
  43. package/build/page-list-item/edit.js +4 -3
  44. package/build/page-list-item/edit.js.map +2 -2
  45. package/build/paragraph/index.js +1 -1
  46. package/build/paragraph/index.js.map +2 -2
  47. package/build/post-title/edit.js +6 -4
  48. package/build/post-title/edit.js.map +2 -2
  49. package/build/preformatted/index.js +1 -1
  50. package/build/preformatted/index.js.map +2 -2
  51. package/build/pullquote/index.js +1 -1
  52. package/build/pullquote/index.js.map +2 -2
  53. package/build/search/index.js +1 -1
  54. package/build/search/index.js.map +2 -2
  55. package/build/social-link/index.js +1 -1
  56. package/build/social-link/index.js.map +2 -2
  57. package/build/template-part/edit/utils/get-template-part-icon.js +9 -4
  58. package/build/template-part/edit/utils/get-template-part-icon.js.map +3 -3
  59. package/build/verse/index.js +1 -1
  60. package/build/verse/index.js.map +2 -2
  61. package/build/video/index.js +1 -1
  62. package/build/video/index.js.map +2 -2
  63. package/build-module/audio/index.js +1 -1
  64. package/build-module/audio/index.js.map +2 -2
  65. package/build-module/avatar/edit.js +13 -38
  66. package/build-module/avatar/edit.js.map +2 -2
  67. package/build-module/breadcrumbs/block.json +3 -2
  68. package/build-module/breadcrumbs/edit.js +18 -18
  69. package/build-module/breadcrumbs/edit.js.map +2 -2
  70. package/build-module/button/index.js +1 -1
  71. package/build-module/button/index.js.map +2 -2
  72. package/build-module/code/index.js +1 -1
  73. package/build-module/code/index.js.map +2 -2
  74. package/build-module/comments-pagination-numbers/block.json +7 -0
  75. package/build-module/cover/index.js +2 -2
  76. package/build-module/cover/index.js.map +2 -2
  77. package/build-module/details/index.js +1 -1
  78. package/build-module/details/index.js.map +2 -2
  79. package/build-module/file/index.js +1 -1
  80. package/build-module/file/index.js.map +2 -2
  81. package/build-module/gallery/edit.js +1 -1
  82. package/build-module/gallery/edit.js.map +2 -2
  83. package/build-module/gallery/transforms.js +7 -3
  84. package/build-module/gallery/transforms.js.map +2 -2
  85. package/build-module/heading/index.js +1 -1
  86. package/build-module/heading/index.js.map +2 -2
  87. package/build-module/html/modal.js +19 -7
  88. package/build-module/html/modal.js.map +2 -2
  89. package/build-module/image/index.js +1 -1
  90. package/build-module/image/index.js.map +2 -2
  91. package/build-module/index.js +9 -3
  92. package/build-module/index.js.map +2 -2
  93. package/build-module/list-item/index.js +1 -1
  94. package/build-module/list-item/index.js.map +2 -2
  95. package/build-module/math/edit.js +15 -3
  96. package/build-module/math/edit.js.map +2 -2
  97. package/build-module/media-text/index.js +1 -1
  98. package/build-module/media-text/index.js.map +2 -2
  99. package/build-module/more/index.js +1 -1
  100. package/build-module/more/index.js.map +2 -2
  101. package/build-module/navigation-link/index.js +1 -1
  102. package/build-module/navigation-link/index.js.map +2 -2
  103. package/build-module/navigation-submenu/index.js +1 -1
  104. package/build-module/navigation-submenu/index.js.map +2 -2
  105. package/build-module/page-list-item/edit.js +4 -3
  106. package/build-module/page-list-item/edit.js.map +2 -2
  107. package/build-module/paragraph/index.js +1 -1
  108. package/build-module/paragraph/index.js.map +2 -2
  109. package/build-module/post-title/edit.js +6 -4
  110. package/build-module/post-title/edit.js.map +2 -2
  111. package/build-module/preformatted/index.js +1 -1
  112. package/build-module/preformatted/index.js.map +2 -2
  113. package/build-module/pullquote/index.js +1 -1
  114. package/build-module/pullquote/index.js.map +2 -2
  115. package/build-module/search/index.js +1 -1
  116. package/build-module/search/index.js.map +2 -2
  117. package/build-module/social-link/index.js +1 -1
  118. package/build-module/social-link/index.js.map +2 -2
  119. package/build-module/template-part/edit/utils/get-template-part-icon.js +10 -4
  120. package/build-module/template-part/edit/utils/get-template-part-icon.js.map +2 -2
  121. package/build-module/verse/index.js +1 -1
  122. package/build-module/verse/index.js.map +2 -2
  123. package/build-module/video/index.js +1 -1
  124. package/build-module/video/index.js.map +2 -2
  125. package/build-style/accordion-heading/style-rtl.css +2 -18
  126. package/build-style/accordion-heading/style.css +2 -18
  127. package/build-style/classic-rtl.css +24 -0
  128. package/build-style/classic.css +24 -0
  129. package/build-style/common-rtl.css +4 -4
  130. package/build-style/common.css +4 -0
  131. package/build-style/style-rtl.css +8 -22
  132. package/build-style/style.css +8 -18
  133. package/build-style/verse/style-rtl.css +2 -0
  134. package/build-style/verse/style.css +2 -0
  135. package/package.json +40 -38
  136. package/src/accordion-heading/style.scss +2 -30
  137. package/src/audio/index.js +1 -1
  138. package/src/avatar/edit.js +68 -83
  139. package/src/breadcrumbs/block.json +3 -2
  140. package/src/breadcrumbs/edit.js +18 -18
  141. package/src/breadcrumbs/index.php +38 -17
  142. package/src/button/index.js +1 -1
  143. package/src/classic.scss +38 -0
  144. package/src/code/index.js +1 -1
  145. package/src/comments-pagination-numbers/block.json +7 -0
  146. package/src/common.scss +4 -0
  147. package/src/cover/index.js +2 -2
  148. package/src/details/index.js +1 -1
  149. package/src/file/index.js +1 -1
  150. package/src/gallery/edit.js +4 -1
  151. package/src/gallery/transforms.js +6 -2
  152. package/src/heading/index.js +1 -1
  153. package/src/html/modal.js +39 -20
  154. package/src/image/index.js +1 -1
  155. package/src/index.js +9 -3
  156. package/src/list-item/index.js +1 -1
  157. package/src/math/edit.js +15 -3
  158. package/src/media-text/index.js +1 -1
  159. package/src/more/index.js +1 -1
  160. package/src/navigation-link/index.js +1 -1
  161. package/src/navigation-submenu/index.js +1 -1
  162. package/src/page-list/index.php +3 -4
  163. package/src/page-list-item/edit.js +4 -3
  164. package/src/paragraph/index.js +1 -1
  165. package/src/post-title/edit.js +8 -4
  166. package/src/post-title/index.php +1 -1
  167. package/src/preformatted/index.js +1 -1
  168. package/src/pullquote/index.js +1 -1
  169. package/src/search/index.js +1 -1
  170. package/src/social-link/index.js +1 -1
  171. package/src/template-part/edit/utils/get-template-part-icon.js +23 -4
  172. package/src/verse/index.js +1 -1
  173. package/src/verse/style.scss +4 -0
  174. package/src/video/index.js +1 -1
  175. package/tsconfig.tsbuildinfo +1 -1
package/src/classic.scss CHANGED
@@ -20,3 +20,41 @@
20
20
  background: #32373c;
21
21
  color: $white;
22
22
  }
23
+
24
+ // These rules are needed to enforce the default styling of
25
+ // the Accordion Heading block in the classic theme.
26
+ .wp-block-accordion-heading {
27
+ // Heading elements may have default margins applied, so those
28
+ // styles need to be reset.
29
+ margin: 0;
30
+ }
31
+
32
+ .wp-block-accordion-heading__toggle {
33
+ // Button elements can have colors applied with high CSS specificity,
34
+ // and since this specificity is impossible to predict, we use
35
+ // `!important` to reset the color.
36
+ background-color: inherit !important;
37
+ color: inherit !important;
38
+
39
+ &:not(:focus-visible) {
40
+ outline: none;
41
+ }
42
+
43
+ &:hover,
44
+ &:focus {
45
+ // Sometimes styles are applied when the button element is
46
+ // hovered over or focused. This isn't expected for accordion
47
+ // toggle buttons, so reset those styles here.
48
+ text-decoration: none;
49
+ background-color: inherit !important;
50
+ box-shadow: none;
51
+ color: inherit;
52
+ border: none;
53
+ padding: var(--wp--preset--spacing--20, 1em) 0;
54
+ }
55
+
56
+ &:focus-visible {
57
+ outline-offset: 0;
58
+ outline: auto;
59
+ }
60
+ }
package/src/code/index.js CHANGED
@@ -43,7 +43,7 @@ export const settings = {
43
43
  save,
44
44
  };
45
45
 
46
- if ( window.__experimentalContentOnlyPatternInsertion ) {
46
+ if ( window.__experimentalContentOnlyInspectorFields ) {
47
47
  settings[ fieldsKey ] = [
48
48
  {
49
49
  id: 'content',
@@ -33,6 +33,13 @@
33
33
  },
34
34
  "interactivity": {
35
35
  "clientNavigation": true
36
+ },
37
+ "spacing": {
38
+ "margin": true,
39
+ "padding": true,
40
+ "__experimentalDefaultControls": {
41
+ "padding": true
42
+ }
36
43
  }
37
44
  }
38
45
  }
package/src/common.scss CHANGED
@@ -128,12 +128,14 @@ html :where([style*="border-top-color"]) {
128
128
  border-top-style: solid;
129
129
  }
130
130
  html :where([style*="border-right-color"]) {
131
+ /*rtl:ignore*/
131
132
  border-right-style: solid;
132
133
  }
133
134
  html :where([style*="border-bottom-color"]) {
134
135
  border-bottom-style: solid;
135
136
  }
136
137
  html :where([style*="border-left-color"]) {
138
+ /*rtl:ignore*/
137
139
  border-left-style: solid;
138
140
  }
139
141
 
@@ -144,12 +146,14 @@ html :where([style*="border-top-width"]) {
144
146
  border-top-style: solid;
145
147
  }
146
148
  html :where([style*="border-right-width"]) {
149
+ /*rtl:ignore*/
147
150
  border-right-style: solid;
148
151
  }
149
152
  html :where([style*="border-bottom-width"]) {
150
153
  border-bottom-style: solid;
151
154
  }
152
155
  html :where([style*="border-left-width"]) {
156
+ /*rtl:ignore*/
153
157
  border-left-style: solid;
154
158
  }
155
159
 
@@ -56,7 +56,7 @@ export const settings = {
56
56
  variations,
57
57
  };
58
58
 
59
- if ( window.__experimentalContentOnlyPatternInsertion ) {
59
+ if ( window.__experimentalContentOnlyInspectorFields ) {
60
60
  settings[ fieldsKey ] = [
61
61
  {
62
62
  id: 'background',
@@ -78,7 +78,7 @@ if ( window.__experimentalContentOnlyPatternInsertion ) {
78
78
  },
79
79
  ];
80
80
  settings[ formKey ] = {
81
- fields: [ 'content' ],
81
+ fields: [ 'background' ],
82
82
  };
83
83
  }
84
84
 
@@ -65,7 +65,7 @@ export const settings = {
65
65
  transforms,
66
66
  };
67
67
 
68
- if ( window.__experimentalContentOnlyPatternInsertion ) {
68
+ if ( window.__experimentalContentOnlyInspectorFields ) {
69
69
  settings[ fieldsKey ] = [
70
70
  {
71
71
  id: 'summary',
package/src/file/index.js CHANGED
@@ -36,7 +36,7 @@ export const settings = {
36
36
  save,
37
37
  };
38
38
 
39
- if ( window.__experimentalContentOnlyPatternInsertion ) {
39
+ if ( window.__experimentalContentOnlyInspectorFields ) {
40
40
  settings[ fieldsKey ] = [
41
41
  {
42
42
  id: 'file',
@@ -290,7 +290,10 @@ export default function GalleryEdit( props ) {
290
290
  ...newLinkTarget,
291
291
  className: newClassName,
292
292
  sizeSlug,
293
- caption: imageAttributes.caption || image.caption?.raw,
293
+ caption:
294
+ imageAttributes.caption.length > 0
295
+ ? imageAttributes.caption
296
+ : image.caption?.raw,
294
297
  alt: imageAttributes.alt || image.alt_text,
295
298
  aspectRatio: aspectRatio === 'auto' ? undefined : aspectRatio,
296
299
  };
@@ -155,7 +155,7 @@ const transforms = {
155
155
  {
156
156
  type: 'shortcode',
157
157
  tag: 'gallery',
158
- transform( { named: { ids, columns = 3, link, orderby } } ) {
158
+ transform( { named: { ids, columns = 3, link, orderby, size } } ) {
159
159
  const imageIds = parseShortcodeIds( ids ).map( ( id ) =>
160
160
  parseInt( id, 10 )
161
161
  );
@@ -173,9 +173,13 @@ const transforms = {
173
173
  columns: parseInt( columns, 10 ),
174
174
  linkTo,
175
175
  randomOrder: orderby === 'rand',
176
+ ...( size && { sizeSlug: size } ),
176
177
  },
177
178
  imageIds.map( ( imageId ) =>
178
- createBlock( 'core/image', { id: imageId } )
179
+ createBlock( 'core/image', {
180
+ id: imageId,
181
+ ...( size && { sizeSlug: size } ),
182
+ } )
179
183
  )
180
184
  );
181
185
 
@@ -73,7 +73,7 @@ export const settings = {
73
73
  variations,
74
74
  };
75
75
 
76
- if ( window.__experimentalContentOnlyPatternInsertion ) {
76
+ if ( window.__experimentalContentOnlyInspectorFields ) {
77
77
  settings[ fieldsKey ] = [
78
78
  {
79
79
  id: 'content',
package/src/html/modal.js CHANGED
@@ -8,6 +8,7 @@ import {
8
8
  Modal,
9
9
  Button,
10
10
  Flex,
11
+ Notice,
11
12
  privateApis as componentsPrivateApis,
12
13
  __experimentalHStack as HStack,
13
14
  __experimentalGrid as Grid,
@@ -48,8 +49,9 @@ export default function HTMLEditModal( {
48
49
  };
49
50
  }, [] );
50
51
 
51
- // Show JS tab if user has permission OR if block contains JavaScript
52
- const shouldShowJsTab = canUserUseUnfilteredHTML || js.trim() !== '';
52
+ // Determine if we should show a warning about CSS/JS content being stripped
53
+ const hasRestrictedContent =
54
+ ! canUserUseUnfilteredHTML && ( css.trim() || js.trim() );
53
55
 
54
56
  if ( ! isOpen ) {
55
57
  return null;
@@ -68,11 +70,13 @@ export default function HTMLEditModal( {
68
70
  setIsDirty( true );
69
71
  };
70
72
  const handleUpdate = () => {
73
+ // For users without unfiltered_html capability, strip CSS and JS content
74
+ // to prevent kses from leaving broken content
71
75
  setAttributes( {
72
76
  content: serializeContent( {
73
77
  html: editedHtml,
74
- css: editedCss,
75
- js: editedJs,
78
+ css: canUserUseUnfilteredHTML ? editedCss : '',
79
+ js: canUserUseUnfilteredHTML ? editedJs : '',
76
80
  } ),
77
81
  } );
78
82
  setIsDirty( false );
@@ -130,8 +134,10 @@ export default function HTMLEditModal( {
130
134
  <div>
131
135
  <Tabs.TabList>
132
136
  <Tabs.Tab tabId="html">HTML</Tabs.Tab>
133
- <Tabs.Tab tabId="css">CSS</Tabs.Tab>
134
- { shouldShowJsTab && (
137
+ { canUserUseUnfilteredHTML && (
138
+ <Tabs.Tab tabId="css">CSS</Tabs.Tab>
139
+ ) }
140
+ { canUserUseUnfilteredHTML && (
135
141
  <Tabs.Tab tabId="js">
136
142
  { __( 'JavaScript' ) }
137
143
  </Tabs.Tab>
@@ -148,6 +154,17 @@ export default function HTMLEditModal( {
148
154
  />
149
155
  </div>
150
156
  </HStack>
157
+ { hasRestrictedContent && (
158
+ <Notice
159
+ status="warning"
160
+ isDismissible={ false }
161
+ className="block-library-html__modal-notice"
162
+ >
163
+ { __(
164
+ 'This block contains CSS or JavaScript that will be removed when you save because you do not have permission to use unfiltered HTML.'
165
+ ) }
166
+ </Notice>
167
+ ) }
151
168
  <HStack
152
169
  alignment="stretch"
153
170
  justify="flex-start"
@@ -168,20 +185,22 @@ export default function HTMLEditModal( {
168
185
  className="block-library-html__modal-editor"
169
186
  />
170
187
  </Tabs.TabPanel>
171
- <Tabs.TabPanel
172
- tabId="css"
173
- focusable={ false }
174
- className="block-library-html__modal-tab"
175
- >
176
- <PlainText
177
- value={ editedCss }
178
- onChange={ handleCssChange }
179
- placeholder={ __( 'Write CSS…' ) }
180
- aria-label={ __( 'CSS' ) }
181
- className="block-library-html__modal-editor"
182
- />
183
- </Tabs.TabPanel>
184
- { shouldShowJsTab && (
188
+ { canUserUseUnfilteredHTML && (
189
+ <Tabs.TabPanel
190
+ tabId="css"
191
+ focusable={ false }
192
+ className="block-library-html__modal-tab"
193
+ >
194
+ <PlainText
195
+ value={ editedCss }
196
+ onChange={ handleCssChange }
197
+ placeholder={ __( 'Write CSS' ) }
198
+ aria-label={ __( 'CSS' ) }
199
+ className="block-library-html__modal-editor"
200
+ />
201
+ </Tabs.TabPanel>
202
+ ) }
203
+ { canUserUseUnfilteredHTML && (
185
204
  <Tabs.TabPanel
186
205
  tabId="js"
187
206
  focusable={ false }
@@ -66,7 +66,7 @@ export const settings = {
66
66
  deprecated,
67
67
  };
68
68
 
69
- if ( window.__experimentalContentOnlyPatternInsertion ) {
69
+ if ( window.__experimentalContentOnlyInspectorFields ) {
70
70
  settings[ fieldsKey ] = [
71
71
  {
72
72
  id: 'image',
package/src/index.js CHANGED
@@ -334,11 +334,17 @@ export const registerCoreBlocks = (
334
334
  const bootstrappedBlockType = unlock(
335
335
  select( blocksStore )
336
336
  ).getBootstrappedBlockType( blockName );
337
- const bootstrappedApiVersion = bootstrappedBlockType.apiVersion;
338
337
 
339
338
  registerBlockType( blockName, {
340
- title: blockName,
341
- ...( bootstrappedApiVersion < 3 && { apiVersion: 3 } ),
339
+ // Use all metadata from PHP registration,
340
+ // but fall back title to block name if not provided,
341
+ // ensure minimum apiVersion 3 for block wrapper support,
342
+ // and override with a ServerSideRender-based edit function.
343
+ ...bootstrappedBlockType,
344
+ title: bootstrappedBlockType?.title || blockName,
345
+ ...( ( bootstrappedBlockType?.apiVersion ?? 0 ) < 3 && {
346
+ apiVersion: 3,
347
+ } ),
342
348
  edit: function Edit( { attributes } ) {
343
349
  const blockProps = useBlockProps();
344
350
  const { content, status, error } = useServerSideRender( {
@@ -36,7 +36,7 @@ export const settings = {
36
36
  [ unlock( privateApis ).requiresWrapperOnCopy ]: true,
37
37
  };
38
38
 
39
- if ( window.__experimentalContentOnlyPatternInsertion ) {
39
+ if ( window.__experimentalContentOnlyInspectorFields ) {
40
40
  settings[ fieldsKey ] = [
41
41
  {
42
42
  id: 'content',
package/src/math/edit.js CHANGED
@@ -1,7 +1,7 @@
1
1
  /**
2
2
  * WordPress dependencies
3
3
  */
4
- import { __ } from '@wordpress/i18n';
4
+ import { __, sprintf } from '@wordpress/i18n';
5
5
  import {
6
6
  useBlockProps,
7
7
  store as blockEditorStore,
@@ -98,7 +98,15 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
98
98
  setError( null );
99
99
  } catch ( err ) {
100
100
  setError( err.message );
101
- speak( err.message );
101
+ speak(
102
+ sprintf(
103
+ /* translators: %s: error message returned when parsing LaTeX. */
104
+ __(
105
+ 'Error parsing mathematical expression: %s'
106
+ ),
107
+ err.message
108
+ )
109
+ );
102
110
  }
103
111
  setAttributes( {
104
112
  mathML: newMathML,
@@ -113,7 +121,11 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
113
121
  intent="error"
114
122
  className="wp-block-math__error"
115
123
  >
116
- { error }
124
+ { sprintf(
125
+ /* translators: %s: error message returned when parsing LaTeX. */
126
+ __( 'Error: %s' ),
127
+ error
128
+ ) }
117
129
  </Badge>
118
130
  <style children=".wp-block-math__error .components-badge__content{white-space:normal}" />
119
131
  </>
@@ -54,7 +54,7 @@ export const settings = {
54
54
  deprecated,
55
55
  };
56
56
 
57
- if ( window.__experimentalContentOnlyPatternInsertion ) {
57
+ if ( window.__experimentalContentOnlyInspectorFields ) {
58
58
  settings[ fieldsKey ] = [
59
59
  {
60
60
  id: 'media',
package/src/more/index.js CHANGED
@@ -40,7 +40,7 @@ export const settings = {
40
40
  save,
41
41
  };
42
42
 
43
- if ( window.__experimentalContentOnlyPatternInsertion ) {
43
+ if ( window.__experimentalContentOnlyInspectorFields ) {
44
44
  settings[ fieldsKey ] = [
45
45
  {
46
46
  id: 'customText',
@@ -93,7 +93,7 @@ export const settings = {
93
93
  transforms,
94
94
  };
95
95
 
96
- if ( window.__experimentalContentOnlyPatternInsertion ) {
96
+ if ( window.__experimentalContentOnlyInspectorFields ) {
97
97
  settings[ fieldsKey ] = [
98
98
  {
99
99
  id: 'label',
@@ -52,7 +52,7 @@ export const settings = {
52
52
  transforms,
53
53
  };
54
54
 
55
- if ( window.__experimentalContentOnlyPatternInsertion ) {
55
+ if ( window.__experimentalContentOnlyInspectorFields ) {
56
56
  settings[ fieldsKey ] = [
57
57
  {
58
58
  id: 'label',
@@ -192,8 +192,7 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
192
192
  $css_class .= ' menu-item-home';
193
193
  }
194
194
 
195
- $title = wp_kses_post( $page['title'] );
196
- $title = $title ? $title : __( '(no title)' );
195
+ $title = $page['title'] ? $page['title'] : __( '(no title)' );
197
196
 
198
197
  $aria_label = sprintf(
199
198
  /* translators: Accessibility text. %s: Parent page title. */
@@ -204,10 +203,10 @@ function block_core_page_list_render_nested_page_list( $open_submenus_on_click,
204
203
  $markup .= '<li class="wp-block-pages-list__item' . esc_attr( $css_class ) . '"' . $style_attribute . '>';
205
204
 
206
205
  if ( isset( $page['children'] ) && $is_navigation_child && $open_submenus_on_click ) {
207
- $markup .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="' . esc_attr( $navigation_child_content_class ) . ' wp-block-navigation-submenu__toggle" aria-expanded="false">' . esc_html( $title ) .
206
+ $markup .= '<button aria-label="' . esc_attr( $aria_label ) . '" class="' . esc_attr( $navigation_child_content_class ) . ' wp-block-navigation-submenu__toggle" aria-expanded="false">' . wp_kses_post( $title ) .
208
207
  '</button><span class="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon"><svg xmlns="http://www.w3.org/2000/svg" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true" focusable="false"><path d="M1.50002 4L6.00002 8L10.5 4" stroke-width="1.5"></path></svg></span>';
209
208
  } else {
210
- $markup .= '<a class="wp-block-pages-list__item__link' . esc_attr( $navigation_child_content_class ) . '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . $title . '</a>';
209
+ $markup .= '<a class="wp-block-pages-list__item__link' . esc_attr( $navigation_child_content_class ) . '" href="' . esc_url( $page['link'] ) . '"' . $aria_current . '>' . wp_kses_post( $title ) . '</a>';
211
210
  }
212
211
 
213
212
  if ( isset( $page['children'] ) ) {
@@ -8,7 +8,8 @@ import clsx from 'clsx';
8
8
  import { useBlockProps, useInnerBlocksProps } from '@wordpress/block-editor';
9
9
  import { useSelect } from '@wordpress/data';
10
10
  import { store as coreStore } from '@wordpress/core-data';
11
- import { decodeEntities } from '@wordpress/html-entities';
11
+ import { RawHTML } from '@wordpress/element';
12
+ import { safeHTML } from '@wordpress/dom';
12
13
 
13
14
  /**
14
15
  * Internal dependencies
@@ -68,7 +69,7 @@ export default function PageListItemEdit( { context, attributes } ) {
68
69
  className="wp-block-navigation-item__content wp-block-navigation-submenu__toggle"
69
70
  aria-expanded="false"
70
71
  >
71
- { decodeEntities( label ) }
72
+ <RawHTML>{ safeHTML( label ) }</RawHTML>
72
73
  </button>
73
74
  <span className="wp-block-page-list__submenu-icon wp-block-navigation__submenu-icon">
74
75
  <ItemSubmenuIcon />
@@ -81,7 +82,7 @@ export default function PageListItemEdit( { context, attributes } ) {
81
82
  } ) }
82
83
  href={ link }
83
84
  >
84
- { decodeEntities( title ) }
85
+ <RawHTML>{ safeHTML( title ) }</RawHTML>
85
86
  </a>
86
87
  ) }
87
88
  { hasChildren && (
@@ -62,7 +62,7 @@ export const settings = {
62
62
  variations,
63
63
  };
64
64
 
65
- if ( window.__experimentalContentOnlyPatternInsertion ) {
65
+ if ( window.__experimentalContentOnlyInspectorFields ) {
66
66
  settings[ fieldsKey ] = [
67
67
  {
68
68
  id: 'content',
@@ -86,7 +86,7 @@ export default function PostTitleEdit( {
86
86
  titleElement = userCanEdit ? (
87
87
  <PlainText
88
88
  tagName={ TagName }
89
- placeholder={ __( 'No title' ) }
89
+ placeholder={ __( '(no title)' ) }
90
90
  value={ rawTitle }
91
91
  onChange={ setTitle }
92
92
  __experimentalVersion={ 2 }
@@ -96,7 +96,9 @@ export default function PostTitleEdit( {
96
96
  ) : (
97
97
  <TagName
98
98
  { ...blockProps }
99
- dangerouslySetInnerHTML={ { __html: fullTitle?.rendered } }
99
+ dangerouslySetInnerHTML={ {
100
+ __html: fullTitle?.rendered || __( '(no title)' ),
101
+ } }
100
102
  />
101
103
  );
102
104
  }
@@ -109,7 +111,9 @@ export default function PostTitleEdit( {
109
111
  href={ link }
110
112
  target={ linkTarget }
111
113
  rel={ rel }
112
- placeholder={ ! rawTitle.length ? __( 'No title' ) : null }
114
+ placeholder={
115
+ ! rawTitle.length ? __( '(no title)' ) : null
116
+ }
113
117
  value={ rawTitle }
114
118
  onChange={ setTitle }
115
119
  __experimentalVersion={ 2 }
@@ -124,7 +128,7 @@ export default function PostTitleEdit( {
124
128
  rel={ rel }
125
129
  onClick={ ( event ) => event.preventDefault() }
126
130
  dangerouslySetInnerHTML={ {
127
- __html: fullTitle?.rendered,
131
+ __html: fullTitle?.rendered || __( '(no title)' ),
128
132
  } }
129
133
  />
130
134
  </TagName>
@@ -27,7 +27,7 @@ function render_block_core_post_title( $attributes, $content, $block ) {
27
27
  */
28
28
  $title = get_the_title();
29
29
 
30
- if ( ! $title ) {
30
+ if ( ! strip_tags( $title ) ) {
31
31
  return '';
32
32
  }
33
33
 
@@ -43,7 +43,7 @@ export const settings = {
43
43
  },
44
44
  };
45
45
 
46
- if ( window.__experimentalContentOnlyPatternInsertion ) {
46
+ if ( window.__experimentalContentOnlyInspectorFields ) {
47
47
  settings[ fieldsKey ] = [
48
48
  {
49
49
  id: 'content',
@@ -40,7 +40,7 @@ export const settings = {
40
40
  deprecated,
41
41
  };
42
42
 
43
- if ( window.__experimentalContentOnlyPatternInsertion ) {
43
+ if ( window.__experimentalContentOnlyInspectorFields ) {
44
44
  settings[ fieldsKey ] = [
45
45
  {
46
46
  id: 'value',
@@ -30,7 +30,7 @@ export const settings = {
30
30
  edit,
31
31
  };
32
32
 
33
- if ( window.__experimentalContentOnlyPatternInsertion ) {
33
+ if ( window.__experimentalContentOnlyInspectorFields ) {
34
34
  settings[ fieldsKey ] = [
35
35
  {
36
36
  id: 'label',
@@ -26,7 +26,7 @@ export const settings = {
26
26
  variations,
27
27
  };
28
28
 
29
- if ( window.__experimentalContentOnlyPatternInsertion ) {
29
+ if ( window.__experimentalContentOnlyInspectorFields ) {
30
30
  settings[ fieldsKey ] = [
31
31
  {
32
32
  id: 'link',
@@ -5,16 +5,35 @@ import {
5
5
  header as headerIcon,
6
6
  footer as footerIcon,
7
7
  sidebar as sidebarIcon,
8
+ tableColumnAfter as overlayIcon,
8
9
  symbolFilled as symbolFilledIcon,
9
10
  } from '@wordpress/icons';
10
11
 
11
- export const getTemplatePartIcon = ( iconName ) => {
12
- if ( 'header' === iconName ) {
12
+ /**
13
+ * Helper function to retrieve the corresponding icon by area name or icon name.
14
+ *
15
+ * @param {string} areaOrIconName The area name (e.g., 'header', 'overlay') or icon name (e.g., 'menu').
16
+ *
17
+ * @return {Object} The corresponding icon.
18
+ */
19
+ export const getTemplatePartIcon = ( areaOrIconName ) => {
20
+ // Handle area names first
21
+ if ( 'header' === areaOrIconName ) {
13
22
  return headerIcon;
14
- } else if ( 'footer' === iconName ) {
23
+ } else if ( 'footer' === areaOrIconName ) {
15
24
  return footerIcon;
16
- } else if ( 'sidebar' === iconName ) {
25
+ } else if ( 'sidebar' === areaOrIconName ) {
17
26
  return sidebarIcon;
27
+ } else if ( 'overlay' === areaOrIconName ) {
28
+ // TODO: Replace with a proper overlay icon when available.
29
+ // Using tableColumnAfter as a placeholder.
30
+ return overlayIcon;
31
+ }
32
+ // Handle icon names for backwards compatibility
33
+ if ( 'menu' === areaOrIconName ) {
34
+ // TODO: Replace with a proper overlay icon when available.
35
+ // Using tableColumnAfter as a placeholder.
36
+ return overlayIcon;
18
37
  }
19
38
  return symbolFilledIcon;
20
39
  };
@@ -45,7 +45,7 @@ export const settings = {
45
45
  save,
46
46
  };
47
47
 
48
- if ( window.__experimentalContentOnlyPatternInsertion ) {
48
+ if ( window.__experimentalContentOnlyInspectorFields ) {
49
49
  settings[ fieldsKey ] = [
50
50
  {
51
51
  id: 'content',
@@ -1,6 +1,10 @@
1
1
  pre.wp-block-verse {
2
2
  overflow: auto;
3
3
  white-space: pre-wrap;
4
+
5
+ // Prevent text overflow off-screen when the previous block has float.
6
+ min-width: 1em;
7
+ word-break: break-word;
4
8
  }
5
9
 
6
10
  :where(pre.wp-block-verse) {
@@ -37,7 +37,7 @@ export const settings = {
37
37
  save,
38
38
  };
39
39
 
40
- if ( window.__experimentalContentOnlyPatternInsertion ) {
40
+ if ( window.__experimentalContentOnlyInspectorFields ) {
41
41
  settings[ fieldsKey ] = [
42
42
  {
43
43
  id: 'video',