@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.
- package/build/audio/index.js +1 -1
- package/build/audio/index.js.map +2 -2
- package/build/avatar/edit.js +13 -38
- package/build/avatar/edit.js.map +2 -2
- package/build/breadcrumbs/block.json +3 -2
- package/build/breadcrumbs/edit.js +18 -18
- package/build/breadcrumbs/edit.js.map +2 -2
- package/build/button/index.js +1 -1
- package/build/button/index.js.map +2 -2
- package/build/code/index.js +1 -1
- package/build/code/index.js.map +2 -2
- package/build/comments-pagination-numbers/block.json +7 -0
- package/build/cover/index.js +2 -2
- package/build/cover/index.js.map +2 -2
- package/build/details/index.js +1 -1
- package/build/details/index.js.map +2 -2
- package/build/file/index.js +1 -1
- package/build/file/index.js.map +2 -2
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +2 -2
- package/build/gallery/transforms.js +7 -3
- package/build/gallery/transforms.js.map +2 -2
- package/build/heading/index.js +1 -1
- package/build/heading/index.js.map +2 -2
- package/build/html/modal.js +18 -7
- package/build/html/modal.js.map +2 -2
- package/build/image/index.js +1 -1
- package/build/image/index.js.map +2 -2
- package/build/index.js +9 -3
- package/build/index.js.map +2 -2
- package/build/list-item/index.js +1 -1
- package/build/list-item/index.js.map +2 -2
- package/build/math/edit.js +14 -2
- package/build/math/edit.js.map +2 -2
- package/build/media-text/index.js +1 -1
- package/build/media-text/index.js.map +2 -2
- package/build/more/index.js +1 -1
- package/build/more/index.js.map +2 -2
- package/build/navigation-link/index.js +1 -1
- package/build/navigation-link/index.js.map +2 -2
- package/build/navigation-submenu/index.js +1 -1
- package/build/navigation-submenu/index.js.map +2 -2
- package/build/page-list-item/edit.js +4 -3
- package/build/page-list-item/edit.js.map +2 -2
- package/build/paragraph/index.js +1 -1
- package/build/paragraph/index.js.map +2 -2
- package/build/post-title/edit.js +6 -4
- package/build/post-title/edit.js.map +2 -2
- package/build/preformatted/index.js +1 -1
- package/build/preformatted/index.js.map +2 -2
- package/build/pullquote/index.js +1 -1
- package/build/pullquote/index.js.map +2 -2
- package/build/search/index.js +1 -1
- package/build/search/index.js.map +2 -2
- package/build/social-link/index.js +1 -1
- package/build/social-link/index.js.map +2 -2
- package/build/template-part/edit/utils/get-template-part-icon.js +9 -4
- package/build/template-part/edit/utils/get-template-part-icon.js.map +3 -3
- package/build/verse/index.js +1 -1
- package/build/verse/index.js.map +2 -2
- package/build/video/index.js +1 -1
- package/build/video/index.js.map +2 -2
- package/build-module/audio/index.js +1 -1
- package/build-module/audio/index.js.map +2 -2
- package/build-module/avatar/edit.js +13 -38
- package/build-module/avatar/edit.js.map +2 -2
- package/build-module/breadcrumbs/block.json +3 -2
- package/build-module/breadcrumbs/edit.js +18 -18
- package/build-module/breadcrumbs/edit.js.map +2 -2
- package/build-module/button/index.js +1 -1
- package/build-module/button/index.js.map +2 -2
- package/build-module/code/index.js +1 -1
- package/build-module/code/index.js.map +2 -2
- package/build-module/comments-pagination-numbers/block.json +7 -0
- package/build-module/cover/index.js +2 -2
- package/build-module/cover/index.js.map +2 -2
- package/build-module/details/index.js +1 -1
- package/build-module/details/index.js.map +2 -2
- package/build-module/file/index.js +1 -1
- package/build-module/file/index.js.map +2 -2
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +2 -2
- package/build-module/gallery/transforms.js +7 -3
- package/build-module/gallery/transforms.js.map +2 -2
- package/build-module/heading/index.js +1 -1
- package/build-module/heading/index.js.map +2 -2
- package/build-module/html/modal.js +19 -7
- package/build-module/html/modal.js.map +2 -2
- package/build-module/image/index.js +1 -1
- package/build-module/image/index.js.map +2 -2
- package/build-module/index.js +9 -3
- package/build-module/index.js.map +2 -2
- package/build-module/list-item/index.js +1 -1
- package/build-module/list-item/index.js.map +2 -2
- package/build-module/math/edit.js +15 -3
- package/build-module/math/edit.js.map +2 -2
- package/build-module/media-text/index.js +1 -1
- package/build-module/media-text/index.js.map +2 -2
- package/build-module/more/index.js +1 -1
- package/build-module/more/index.js.map +2 -2
- package/build-module/navigation-link/index.js +1 -1
- package/build-module/navigation-link/index.js.map +2 -2
- package/build-module/navigation-submenu/index.js +1 -1
- package/build-module/navigation-submenu/index.js.map +2 -2
- package/build-module/page-list-item/edit.js +4 -3
- package/build-module/page-list-item/edit.js.map +2 -2
- package/build-module/paragraph/index.js +1 -1
- package/build-module/paragraph/index.js.map +2 -2
- package/build-module/post-title/edit.js +6 -4
- package/build-module/post-title/edit.js.map +2 -2
- package/build-module/preformatted/index.js +1 -1
- package/build-module/preformatted/index.js.map +2 -2
- package/build-module/pullquote/index.js +1 -1
- package/build-module/pullquote/index.js.map +2 -2
- package/build-module/search/index.js +1 -1
- package/build-module/search/index.js.map +2 -2
- package/build-module/social-link/index.js +1 -1
- package/build-module/social-link/index.js.map +2 -2
- package/build-module/template-part/edit/utils/get-template-part-icon.js +10 -4
- package/build-module/template-part/edit/utils/get-template-part-icon.js.map +2 -2
- package/build-module/verse/index.js +1 -1
- package/build-module/verse/index.js.map +2 -2
- package/build-module/video/index.js +1 -1
- package/build-module/video/index.js.map +2 -2
- package/build-style/accordion-heading/style-rtl.css +2 -18
- package/build-style/accordion-heading/style.css +2 -18
- package/build-style/classic-rtl.css +24 -0
- package/build-style/classic.css +24 -0
- package/build-style/common-rtl.css +4 -4
- package/build-style/common.css +4 -0
- package/build-style/style-rtl.css +8 -22
- package/build-style/style.css +8 -18
- package/build-style/verse/style-rtl.css +2 -0
- package/build-style/verse/style.css +2 -0
- package/package.json +40 -38
- package/src/accordion-heading/style.scss +2 -30
- package/src/audio/index.js +1 -1
- package/src/avatar/edit.js +68 -83
- package/src/breadcrumbs/block.json +3 -2
- package/src/breadcrumbs/edit.js +18 -18
- package/src/breadcrumbs/index.php +38 -17
- package/src/button/index.js +1 -1
- package/src/classic.scss +38 -0
- package/src/code/index.js +1 -1
- package/src/comments-pagination-numbers/block.json +7 -0
- package/src/common.scss +4 -0
- package/src/cover/index.js +2 -2
- package/src/details/index.js +1 -1
- package/src/file/index.js +1 -1
- package/src/gallery/edit.js +4 -1
- package/src/gallery/transforms.js +6 -2
- package/src/heading/index.js +1 -1
- package/src/html/modal.js +39 -20
- package/src/image/index.js +1 -1
- package/src/index.js +9 -3
- package/src/list-item/index.js +1 -1
- package/src/math/edit.js +15 -3
- package/src/media-text/index.js +1 -1
- package/src/more/index.js +1 -1
- package/src/navigation-link/index.js +1 -1
- package/src/navigation-submenu/index.js +1 -1
- package/src/page-list/index.php +3 -4
- package/src/page-list-item/edit.js +4 -3
- package/src/paragraph/index.js +1 -1
- package/src/post-title/edit.js +8 -4
- package/src/post-title/index.php +1 -1
- package/src/preformatted/index.js +1 -1
- package/src/pullquote/index.js +1 -1
- package/src/search/index.js +1 -1
- package/src/social-link/index.js +1 -1
- package/src/template-part/edit/utils/get-template-part-icon.js +23 -4
- package/src/verse/index.js +1 -1
- package/src/verse/style.scss +4 -0
- package/src/video/index.js +1 -1
- 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
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
|
|
package/src/cover/index.js
CHANGED
|
@@ -56,7 +56,7 @@ export const settings = {
|
|
|
56
56
|
variations,
|
|
57
57
|
};
|
|
58
58
|
|
|
59
|
-
if ( window.
|
|
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: [ '
|
|
81
|
+
fields: [ 'background' ],
|
|
82
82
|
};
|
|
83
83
|
}
|
|
84
84
|
|
package/src/details/index.js
CHANGED
package/src/file/index.js
CHANGED
package/src/gallery/edit.js
CHANGED
|
@@ -290,7 +290,10 @@ export default function GalleryEdit( props ) {
|
|
|
290
290
|
...newLinkTarget,
|
|
291
291
|
className: newClassName,
|
|
292
292
|
sizeSlug,
|
|
293
|
-
caption:
|
|
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', {
|
|
179
|
+
createBlock( 'core/image', {
|
|
180
|
+
id: imageId,
|
|
181
|
+
...( size && { sizeSlug: size } ),
|
|
182
|
+
} )
|
|
179
183
|
)
|
|
180
184
|
);
|
|
181
185
|
|
package/src/heading/index.js
CHANGED
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
|
-
//
|
|
52
|
-
const
|
|
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
|
-
|
|
134
|
-
|
|
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
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
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 }
|
package/src/image/index.js
CHANGED
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
|
-
|
|
341
|
-
|
|
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( {
|
package/src/list-item/index.js
CHANGED
|
@@ -36,7 +36,7 @@ export const settings = {
|
|
|
36
36
|
[ unlock( privateApis ).requiresWrapperOnCopy ]: true,
|
|
37
37
|
};
|
|
38
38
|
|
|
39
|
-
if ( window.
|
|
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(
|
|
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
|
-
{
|
|
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
|
</>
|
package/src/media-text/index.js
CHANGED
package/src/more/index.js
CHANGED
package/src/page-list/index.php
CHANGED
|
@@ -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 =
|
|
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">' .
|
|
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 {
|
|
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
|
-
{
|
|
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
|
-
{
|
|
85
|
+
<RawHTML>{ safeHTML( title ) }</RawHTML>
|
|
85
86
|
</a>
|
|
86
87
|
) }
|
|
87
88
|
{ hasChildren && (
|
package/src/paragraph/index.js
CHANGED
package/src/post-title/edit.js
CHANGED
|
@@ -86,7 +86,7 @@ export default function PostTitleEdit( {
|
|
|
86
86
|
titleElement = userCanEdit ? (
|
|
87
87
|
<PlainText
|
|
88
88
|
tagName={ TagName }
|
|
89
|
-
placeholder={ __( '
|
|
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={ {
|
|
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={
|
|
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>
|
package/src/post-title/index.php
CHANGED
package/src/pullquote/index.js
CHANGED
package/src/search/index.js
CHANGED
package/src/social-link/index.js
CHANGED
|
@@ -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
|
-
|
|
12
|
-
|
|
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' ===
|
|
23
|
+
} else if ( 'footer' === areaOrIconName ) {
|
|
15
24
|
return footerIcon;
|
|
16
|
-
} else if ( 'sidebar' ===
|
|
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
|
};
|
package/src/verse/index.js
CHANGED
package/src/verse/style.scss
CHANGED