@wordpress/block-library 9.16.0 → 9.17.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/CHANGELOG.md +2 -0
- package/build/archives/edit.js +2 -2
- package/build/archives/edit.js.map +1 -1
- package/build/categories/edit.js +115 -37
- package/build/categories/edit.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +6 -5
- package/build/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build/comments-pagination/index.js +5 -0
- package/build/comments-pagination/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -9
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/details/edit.js +16 -2
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +9 -0
- package/build/details/index.js.map +1 -1
- package/build/details/save.js +2 -0
- package/build/details/save.js.map +1 -1
- package/build/embed/transforms.js +5 -2
- package/build/embed/transforms.js.map +1 -1
- package/build/form/variations.js +1 -1
- package/build/form/variations.js.map +1 -1
- package/build/group/edit.js +2 -9
- package/build/group/edit.js.map +1 -1
- package/build/home-link/edit.js +1 -2
- package/build/home-link/edit.js.map +1 -1
- package/build/latest-comments/edit.js +73 -26
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-posts/constants.js +2 -1
- package/build/latest-posts/constants.js.map +1 -1
- package/build/latest-posts/edit.js +91 -38
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list-item/index.js +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/edit/use-generate-default-navigation-title.js +4 -4
- package/build/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build/navigation-link/edit.js +14 -19
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/index.js +7 -0
- package/build/navigation-submenu/index.js.map +1 -1
- package/build/page-list/edit.js +1 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/paragraph/edit.js +4 -14
- package/build/paragraph/edit.js.map +1 -1
- package/build/pattern/index.js +1 -1
- package/build/post-content/index.js +1 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-date/edit.js +1 -1
- package/build/post-date/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +0 -6
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-navigation-link/variations.js +2 -2
- package/build/post-navigation-link/variations.js.map +1 -1
- package/build/post-terms/edit.js +1 -0
- package/build/post-terms/edit.js.map +1 -1
- package/build/post-time-to-read/index.js +1 -1
- package/build/query/edit/query-content.js +2 -6
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query-no-results/index.js +1 -1
- package/build/query-pagination-numbers/edit.js +1 -1
- package/build/query-pagination-numbers/edit.js.map +1 -1
- package/build/query-title/edit.js +1 -0
- package/build/query-title/edit.js.map +1 -1
- package/build/read-more/edit.js +25 -7
- package/build/read-more/edit.js.map +1 -1
- package/build/search/edit.js +67 -49
- package/build/search/edit.js.map +1 -1
- package/build/separator/edit.js +2 -4
- package/build/separator/edit.js.map +1 -1
- package/build/spacer/controls.js +13 -9
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/edit.js +23 -21
- package/build/spacer/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -9
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/utils/messages.js +22 -0
- package/build/utils/messages.js.map +1 -0
- package/build/video/edit-common-settings.js +1 -1
- package/build/video/edit-common-settings.js.map +1 -1
- package/build-module/archives/edit.js +2 -2
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/categories/edit.js +116 -38
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +5 -4
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/comments-pagination/index.js +5 -0
- package/build-module/comments-pagination/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +1 -8
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/details/edit.js +17 -3
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +9 -0
- package/build-module/details/index.js.map +1 -1
- package/build-module/details/save.js +2 -0
- package/build-module/details/save.js.map +1 -1
- package/build-module/embed/transforms.js +5 -2
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/form/variations.js +1 -1
- package/build-module/form/variations.js.map +1 -1
- package/build-module/group/edit.js +1 -8
- package/build-module/group/edit.js.map +1 -1
- package/build-module/home-link/edit.js +1 -2
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/latest-comments/edit.js +74 -27
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-posts/constants.js +1 -0
- package/build-module/latest-posts/constants.js.map +1 -1
- package/build-module/latest-posts/edit.js +93 -40
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list-item/index.js +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/edit/use-generate-default-navigation-title.js +4 -4
- package/build-module/navigation/edit/use-generate-default-navigation-title.js.map +1 -1
- package/build-module/navigation-link/edit.js +15 -20
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/index.js +7 -0
- package/build-module/navigation-submenu/index.js.map +1 -1
- package/build-module/page-list/edit.js +1 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +5 -15
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/pattern/index.js +1 -1
- package/build-module/post-content/index.js +1 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-date/edit.js +1 -1
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +0 -6
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-navigation-link/variations.js +2 -2
- package/build-module/post-navigation-link/variations.js.map +1 -1
- package/build-module/post-terms/edit.js +1 -0
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/post-time-to-read/index.js +1 -1
- package/build-module/query/edit/query-content.js +1 -5
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query-no-results/index.js +1 -1
- package/build-module/query-pagination-numbers/edit.js +1 -1
- package/build-module/query-pagination-numbers/edit.js.map +1 -1
- package/build-module/query-title/edit.js +1 -0
- package/build-module/query-title/edit.js.map +1 -1
- package/build-module/read-more/edit.js +26 -8
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/search/edit.js +68 -50
- package/build-module/search/edit.js.map +1 -1
- package/build-module/separator/edit.js +1 -3
- package/build-module/separator/edit.js.map +1 -1
- package/build-module/spacer/controls.js +13 -9
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/edit.js +24 -22
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +1 -8
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/utils/messages.js +15 -0
- package/build-module/utils/messages.js.map +1 -0
- package/build-module/video/edit-common-settings.js +1 -1
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-style/editor-rtl.css +8 -45
- package/build-style/editor.css +8 -45
- package/build-style/gallery/editor-rtl.css +0 -44
- package/build-style/gallery/editor.css +0 -44
- package/build-style/navigation-link/editor-rtl.css +3 -0
- package/build-style/navigation-link/editor.css +3 -0
- package/build-style/paragraph/editor-rtl.css +4 -0
- package/build-style/paragraph/editor.css +4 -0
- package/build-style/post-featured-image/editor-rtl.css +1 -1
- package/build-style/post-featured-image/editor.css +1 -1
- package/package.json +35 -35
- package/src/archives/edit.js +2 -2
- package/src/categories/edit.js +133 -45
- package/src/comments/edit/comments-inspector-controls.js +5 -8
- package/src/comments-pagination/block.json +5 -0
- package/src/cover/edit/inspector-controls.js +1 -21
- package/src/details/block.json +9 -0
- package/src/details/edit.js +18 -2
- package/src/details/save.js +6 -2
- package/src/embed/transforms.js +3 -1
- package/src/form/variations.js +1 -1
- package/src/gallery/editor.scss +0 -56
- package/src/group/edit.js +1 -20
- package/src/home-link/edit.js +0 -6
- package/src/latest-comments/edit.js +93 -33
- package/src/latest-posts/constants.js +1 -0
- package/src/latest-posts/edit.js +119 -44
- package/src/list/test/edit.native.js +9 -9
- package/src/list-item/block.json +1 -1
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +4 -4
- package/src/navigation/edit/use-generate-default-navigation-title.js +4 -4
- package/src/navigation-link/edit.js +25 -29
- package/src/navigation-link/editor.scss +27 -18
- package/src/navigation-submenu/index.js +7 -0
- package/src/navigation-submenu/index.php +21 -4
- package/src/page-list/edit.js +52 -50
- package/src/paragraph/edit.js +3 -18
- package/src/paragraph/editor.scss +7 -0
- package/src/pattern/block.json +1 -1
- package/src/post-content/block.json +1 -0
- package/src/post-date/edit.js +1 -3
- package/src/post-featured-image/edit.js +2 -15
- package/src/post-featured-image/editor.scss +2 -2
- package/src/post-navigation-link/variations.js +2 -2
- package/src/post-terms/edit.js +1 -0
- package/src/post-time-to-read/block.json +1 -1
- package/src/query/edit/query-content.js +1 -11
- package/src/query-no-results/block.json +1 -1
- package/src/query-pagination-numbers/edit.js +1 -1
- package/src/query-title/edit.js +1 -0
- package/src/read-more/edit.js +35 -11
- package/src/search/edit.js +99 -74
- package/src/separator/edit.js +1 -6
- package/src/spacer/controls.js +10 -9
- package/src/spacer/edit.js +25 -23
- package/src/template-part/edit/advanced-controls.js +1 -21
- package/src/utils/messages.js +31 -0
- package/src/video/edit-common-settings.js +1 -1
|
@@ -80,24 +80,33 @@
|
|
|
80
80
|
background-image: none !important;
|
|
81
81
|
|
|
82
82
|
// Draw a wavy underline.
|
|
83
|
-
.wp-block-navigation-link__placeholder-text
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
83
|
+
.wp-block-navigation-link__placeholder-text {
|
|
84
|
+
span {
|
|
85
|
+
$blur: 10%;
|
|
86
|
+
$width: 6%;
|
|
87
|
+
$stop1: 30%;
|
|
88
|
+
$stop2: 64%;
|
|
89
|
+
|
|
90
|
+
--wp-underline-color: var(--wp-admin-theme-color);
|
|
91
|
+
|
|
92
|
+
background-image:
|
|
93
|
+
linear-gradient(45deg, transparent ($stop1 - $blur), var(--wp-underline-color) $stop1, var(--wp-underline-color) ($stop1 + $width), transparent ($stop1 + $width + $blur)),
|
|
94
|
+
linear-gradient(135deg, transparent ($stop2 - $blur), var(--wp-underline-color) $stop2, var(--wp-underline-color) ($stop2 + $width), transparent ($stop2 + $width + $blur));
|
|
95
|
+
background-position: 0 100%;
|
|
96
|
+
background-size: 6px 3px;
|
|
97
|
+
background-repeat: repeat-x;
|
|
98
|
+
|
|
99
|
+
// Since applied to a span, it doesn't change the footprint of the item,
|
|
100
|
+
// but it does vertically shift the underline to better align.
|
|
101
|
+
padding-bottom: 0.1em;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
&.is-invalid,
|
|
105
|
+
&.is-draft {
|
|
106
|
+
span {
|
|
107
|
+
--wp-underline-color: var(--wp--preset--color--vivid-red);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
101
110
|
}
|
|
102
111
|
|
|
103
112
|
// This needs extra specificity.
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { page, addSubmenu } from '@wordpress/icons';
|
|
5
|
+
import { _x } from '@wordpress/i18n';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
@@ -37,6 +38,12 @@ export const settings = {
|
|
|
37
38
|
return label;
|
|
38
39
|
},
|
|
39
40
|
edit,
|
|
41
|
+
example: {
|
|
42
|
+
attributes: {
|
|
43
|
+
label: _x( 'About', 'Example link text for Navigation Submenu' ),
|
|
44
|
+
type: 'page',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
40
47
|
save,
|
|
41
48
|
transforms,
|
|
42
49
|
};
|
|
@@ -82,7 +82,6 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
|
82
82
|
$font_sizes = block_core_navigation_submenu_build_css_font_sizes( $block->context );
|
|
83
83
|
$style_attribute = $font_sizes['inline_styles'];
|
|
84
84
|
|
|
85
|
-
$css_classes = trim( implode( ' ', $font_sizes['css_classes'] ) );
|
|
86
85
|
$has_submenu = count( $block->inner_blocks ) > 0;
|
|
87
86
|
$kind = empty( $attributes['kind'] ) ? 'post_type' : str_replace( '-', '_', $attributes['kind'] );
|
|
88
87
|
$is_active = ! empty( $attributes['id'] ) && get_queried_object_id() === (int) $attributes['id'] && ! empty( get_queried_object()->$kind );
|
|
@@ -99,11 +98,29 @@ function render_block_core_navigation_submenu( $attributes, $content, $block ) {
|
|
|
99
98
|
$open_on_hover_and_click = isset( $block->context['openSubmenusOnClick'] ) && ! $block->context['openSubmenusOnClick'] &&
|
|
100
99
|
$show_submenu_indicators;
|
|
101
100
|
|
|
101
|
+
$classes = array(
|
|
102
|
+
'wp-block-navigation-item',
|
|
103
|
+
);
|
|
104
|
+
$classes = array_merge(
|
|
105
|
+
$classes,
|
|
106
|
+
$font_sizes['css_classes']
|
|
107
|
+
);
|
|
108
|
+
if ( $has_submenu ) {
|
|
109
|
+
$classes[] = 'has-child';
|
|
110
|
+
}
|
|
111
|
+
if ( $open_on_click ) {
|
|
112
|
+
$classes[] = 'open-on-click';
|
|
113
|
+
}
|
|
114
|
+
if ( $open_on_hover_and_click ) {
|
|
115
|
+
$classes[] = 'open-on-hover-click';
|
|
116
|
+
}
|
|
117
|
+
if ( $is_active ) {
|
|
118
|
+
$classes[] = 'current-menu-item';
|
|
119
|
+
}
|
|
120
|
+
|
|
102
121
|
$wrapper_attributes = get_block_wrapper_attributes(
|
|
103
122
|
array(
|
|
104
|
-
'class' =>
|
|
105
|
-
( $open_on_click ? ' open-on-click' : '' ) . ( $open_on_hover_and_click ? ' open-on-hover-click' : '' ) .
|
|
106
|
-
( $is_active ? ' current-menu-item' : '' ),
|
|
123
|
+
'class' => implode( ' ', $classes ),
|
|
107
124
|
'style' => $style_attribute,
|
|
108
125
|
)
|
|
109
126
|
);
|
package/src/page-list/edit.js
CHANGED
|
@@ -322,58 +322,60 @@ export default function PageListEdit( {
|
|
|
322
322
|
|
|
323
323
|
return (
|
|
324
324
|
<>
|
|
325
|
-
|
|
326
|
-
<
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
isShownByDefault
|
|
341
|
-
>
|
|
342
|
-
<ComboboxControl
|
|
343
|
-
__nextHasNoMarginBottom
|
|
344
|
-
__next40pxDefaultSize
|
|
345
|
-
className="editor-page-attributes__parent"
|
|
346
|
-
label={ __( 'Parent' ) }
|
|
347
|
-
value={ parentPageID }
|
|
348
|
-
options={ pagesTree }
|
|
349
|
-
onChange={ ( value ) =>
|
|
350
|
-
setAttributes( {
|
|
351
|
-
parentPageID: value ?? 0,
|
|
352
|
-
} )
|
|
325
|
+
{ ( pagesTree.length > 0 || allowConvertToLinks ) && (
|
|
326
|
+
<InspectorControls>
|
|
327
|
+
<ToolsPanel
|
|
328
|
+
label={ __( 'Settings' ) }
|
|
329
|
+
resetAll={ () => {
|
|
330
|
+
setAttributes( { parentPageID: 0 } );
|
|
331
|
+
} }
|
|
332
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
333
|
+
>
|
|
334
|
+
{ pagesTree.length > 0 && (
|
|
335
|
+
<ToolsPanelItem
|
|
336
|
+
label={ __( 'Parent Page' ) }
|
|
337
|
+
hasValue={ () => parentPageID !== 0 }
|
|
338
|
+
onDeselect={ () =>
|
|
339
|
+
setAttributes( { parentPageID: 0 } )
|
|
353
340
|
}
|
|
354
|
-
|
|
355
|
-
'Choose a page to show only its subpages.'
|
|
356
|
-
) }
|
|
357
|
-
/>
|
|
358
|
-
</ToolsPanelItem>
|
|
359
|
-
) }
|
|
360
|
-
|
|
361
|
-
{ allowConvertToLinks && (
|
|
362
|
-
<div style={ { gridColumn: '1 / -1' } }>
|
|
363
|
-
<p>{ convertDescription }</p>
|
|
364
|
-
<Button
|
|
365
|
-
__next40pxDefaultSize
|
|
366
|
-
variant="primary"
|
|
367
|
-
accessibleWhenDisabled
|
|
368
|
-
disabled={ ! hasResolvedPages }
|
|
369
|
-
onClick={ convertToNavigationLinks }
|
|
341
|
+
isShownByDefault
|
|
370
342
|
>
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
343
|
+
<ComboboxControl
|
|
344
|
+
__nextHasNoMarginBottom
|
|
345
|
+
__next40pxDefaultSize
|
|
346
|
+
className="editor-page-attributes__parent"
|
|
347
|
+
label={ __( 'Parent' ) }
|
|
348
|
+
value={ parentPageID }
|
|
349
|
+
options={ pagesTree }
|
|
350
|
+
onChange={ ( value ) =>
|
|
351
|
+
setAttributes( {
|
|
352
|
+
parentPageID: value ?? 0,
|
|
353
|
+
} )
|
|
354
|
+
}
|
|
355
|
+
help={ __(
|
|
356
|
+
'Choose a page to show only its subpages.'
|
|
357
|
+
) }
|
|
358
|
+
/>
|
|
359
|
+
</ToolsPanelItem>
|
|
360
|
+
) }
|
|
361
|
+
|
|
362
|
+
{ allowConvertToLinks && (
|
|
363
|
+
<div style={ { gridColumn: '1 / -1' } }>
|
|
364
|
+
<p>{ convertDescription }</p>
|
|
365
|
+
<Button
|
|
366
|
+
__next40pxDefaultSize
|
|
367
|
+
variant="primary"
|
|
368
|
+
accessibleWhenDisabled
|
|
369
|
+
disabled={ ! hasResolvedPages }
|
|
370
|
+
onClick={ convertToNavigationLinks }
|
|
371
|
+
>
|
|
372
|
+
{ __( 'Edit' ) }
|
|
373
|
+
</Button>
|
|
374
|
+
</div>
|
|
375
|
+
) }
|
|
376
|
+
</ToolsPanel>
|
|
377
|
+
</InspectorControls>
|
|
378
|
+
) }
|
|
377
379
|
{ allowConvertToLinks && (
|
|
378
380
|
<>
|
|
379
381
|
<BlockControls group="other">
|
package/src/paragraph/edit.js
CHANGED
|
@@ -20,16 +20,13 @@ import {
|
|
|
20
20
|
useBlockProps,
|
|
21
21
|
useSettings,
|
|
22
22
|
useBlockEditingMode,
|
|
23
|
-
store as blockEditorStore,
|
|
24
23
|
} from '@wordpress/block-editor';
|
|
25
|
-
import { useSelect } from '@wordpress/data';
|
|
26
24
|
import { getBlockSupport } from '@wordpress/blocks';
|
|
27
25
|
import { formatLtr } from '@wordpress/icons';
|
|
28
26
|
/**
|
|
29
27
|
* Internal dependencies
|
|
30
28
|
*/
|
|
31
29
|
import { useOnEnter } from './use-enter';
|
|
32
|
-
import { unlock } from '../lock-unlock';
|
|
33
30
|
|
|
34
31
|
function ParagraphRTLControl( { direction, setDirection } ) {
|
|
35
32
|
return (
|
|
@@ -111,11 +108,7 @@ function ParagraphBlock( {
|
|
|
111
108
|
isSelected: isSingleSelected,
|
|
112
109
|
name,
|
|
113
110
|
} ) {
|
|
114
|
-
const
|
|
115
|
-
unlock( select( blockEditorStore ) ).isZoomOut()
|
|
116
|
-
);
|
|
117
|
-
|
|
118
|
-
const { align, content, direction, dropCap } = attributes;
|
|
111
|
+
const { align, content, direction, dropCap, placeholder } = attributes;
|
|
119
112
|
const blockProps = useBlockProps( {
|
|
120
113
|
ref: useOnEnter( { clientId, content } ),
|
|
121
114
|
className: clsx( {
|
|
@@ -125,12 +118,6 @@ function ParagraphBlock( {
|
|
|
125
118
|
style: { direction },
|
|
126
119
|
} );
|
|
127
120
|
const blockEditingMode = useBlockEditingMode();
|
|
128
|
-
let { placeholder } = attributes;
|
|
129
|
-
if ( isZoomOut ) {
|
|
130
|
-
placeholder = '';
|
|
131
|
-
} else if ( ! placeholder ) {
|
|
132
|
-
placeholder = __( 'Type / to choose a block' );
|
|
133
|
-
}
|
|
134
121
|
|
|
135
122
|
return (
|
|
136
123
|
<>
|
|
@@ -182,10 +169,8 @@ function ParagraphBlock( {
|
|
|
182
169
|
: __( 'Block: Paragraph' )
|
|
183
170
|
}
|
|
184
171
|
data-empty={ RichText.isEmpty( content ) }
|
|
185
|
-
placeholder={ placeholder }
|
|
186
|
-
data-custom-placeholder={
|
|
187
|
-
placeholder && ! isZoomOut ? true : undefined
|
|
188
|
-
}
|
|
172
|
+
placeholder={ placeholder || __( 'Type / to choose a block' ) }
|
|
173
|
+
data-custom-placeholder={ placeholder ? true : undefined }
|
|
189
174
|
__unstableEmbedURLOnPaste
|
|
190
175
|
__unstableAllowPrefixTransformations
|
|
191
176
|
/>
|
|
@@ -22,3 +22,10 @@
|
|
|
22
22
|
.block-editor-block-list__block[data-type="core/paragraph"].has-text-align-left[style*="writing-mode: vertical-lr"] {
|
|
23
23
|
rotate: 180deg;
|
|
24
24
|
}
|
|
25
|
+
|
|
26
|
+
// Hide the placeholder when the editor is in zoomed out mode.
|
|
27
|
+
.is-zoomed-out .block-editor-block-list__block[data-empty="true"] {
|
|
28
|
+
[data-rich-text-placeholder] {
|
|
29
|
+
opacity: 0;
|
|
30
|
+
}
|
|
31
|
+
}
|
package/src/pattern/block.json
CHANGED
package/src/post-date/edit.js
CHANGED
|
@@ -179,9 +179,7 @@ export default function PostDateEdit( {
|
|
|
179
179
|
dropdownMenuProps={ dropdownMenuProps }
|
|
180
180
|
>
|
|
181
181
|
<ToolsPanelItem
|
|
182
|
-
hasValue={ () =>
|
|
183
|
-
format !== undefined && format !== siteFormat
|
|
184
|
-
}
|
|
182
|
+
hasValue={ () => !! format }
|
|
185
183
|
label={ __( 'Date Format' ) }
|
|
186
184
|
onDeselect={ () =>
|
|
187
185
|
setAttributes( { format: undefined } )
|
|
@@ -49,11 +49,6 @@ function getMediaSourceUrlBySizeSlug( media, slug ) {
|
|
|
49
49
|
);
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
-
const disabledClickProps = {
|
|
53
|
-
onClick: ( event ) => event.preventDefault(),
|
|
54
|
-
'aria-disabled': true,
|
|
55
|
-
};
|
|
56
|
-
|
|
57
52
|
export default function PostFeaturedImageEdit( {
|
|
58
53
|
clientId,
|
|
59
54
|
attributes,
|
|
@@ -318,11 +313,7 @@ export default function PostFeaturedImageEdit( {
|
|
|
318
313
|
{ controls }
|
|
319
314
|
<div { ...blockProps }>
|
|
320
315
|
{ !! isLink ? (
|
|
321
|
-
<a
|
|
322
|
-
href={ postPermalink }
|
|
323
|
-
target={ linkTarget }
|
|
324
|
-
{ ...disabledClickProps }
|
|
325
|
-
>
|
|
316
|
+
<a href={ postPermalink } target={ linkTarget }>
|
|
326
317
|
{ placeholder() }
|
|
327
318
|
</a>
|
|
328
319
|
) : (
|
|
@@ -430,11 +421,7 @@ export default function PostFeaturedImageEdit( {
|
|
|
430
421
|
<figure { ...blockProps }>
|
|
431
422
|
{ /* If the featured image is linked, wrap in an <a /> tag to trigger any inherited link element styles */ }
|
|
432
423
|
{ !! isLink ? (
|
|
433
|
-
<a
|
|
434
|
-
href={ postPermalink }
|
|
435
|
-
target={ linkTarget }
|
|
436
|
-
{ ...disabledClickProps }
|
|
437
|
-
>
|
|
424
|
+
<a href={ postPermalink } target={ linkTarget }>
|
|
438
425
|
{ image }
|
|
439
426
|
</a>
|
|
440
427
|
) : (
|
|
@@ -100,9 +100,9 @@
|
|
|
100
100
|
|
|
101
101
|
// When the Post Featured Image block is linked,
|
|
102
102
|
// it's wrapped with a disabled <a /> tag.
|
|
103
|
-
//
|
|
103
|
+
// Ensure that the link is not clickable.
|
|
104
104
|
> a {
|
|
105
|
-
|
|
105
|
+
pointer-events: none;
|
|
106
106
|
}
|
|
107
107
|
|
|
108
108
|
// When the Post Featured Image block is linked,
|
|
@@ -8,7 +8,7 @@ const variations = [
|
|
|
8
8
|
{
|
|
9
9
|
isDefault: true,
|
|
10
10
|
name: 'post-next',
|
|
11
|
-
title: __( 'Next
|
|
11
|
+
title: __( 'Next Post' ),
|
|
12
12
|
description: __(
|
|
13
13
|
'Displays the post link that follows the current post.'
|
|
14
14
|
),
|
|
@@ -24,7 +24,7 @@ const variations = [
|
|
|
24
24
|
},
|
|
25
25
|
{
|
|
26
26
|
name: 'post-previous',
|
|
27
|
-
title: __( 'Previous
|
|
27
|
+
title: __( 'Previous Post' ),
|
|
28
28
|
description: __(
|
|
29
29
|
'Displays the post link that precedes the current post.'
|
|
30
30
|
),
|
package/src/post-terms/edit.js
CHANGED
|
@@ -23,6 +23,7 @@ import QueryInspectorControls from './inspector-controls';
|
|
|
23
23
|
import EnhancedPaginationModal from './enhanced-pagination-modal';
|
|
24
24
|
import { getQueryContextFromTemplate } from '../utils';
|
|
25
25
|
import QueryToolbar from './query-toolbar';
|
|
26
|
+
import { htmlElementMessages } from '../../utils/messages';
|
|
26
27
|
|
|
27
28
|
const DEFAULTS_POSTS_PER_PAGE = 3;
|
|
28
29
|
|
|
@@ -132,17 +133,6 @@ export default function QueryContent( {
|
|
|
132
133
|
setAttributes( {
|
|
133
134
|
displayLayout: { ...displayLayout, ...newDisplayLayout },
|
|
134
135
|
} );
|
|
135
|
-
const htmlElementMessages = {
|
|
136
|
-
main: __(
|
|
137
|
-
'The <main> element should be used for the primary content of your document only.'
|
|
138
|
-
),
|
|
139
|
-
section: __(
|
|
140
|
-
"The <section> element should represent a standalone portion of the document that can't be better represented by another element."
|
|
141
|
-
),
|
|
142
|
-
aside: __(
|
|
143
|
-
"The <aside> element should represent a portion of a document whose content is only indirectly related to the document's main content."
|
|
144
|
-
),
|
|
145
|
-
};
|
|
146
136
|
|
|
147
137
|
return (
|
|
148
138
|
<>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"$schema": "https://schemas.wp.org/trunk/block.json",
|
|
3
3
|
"apiVersion": 3,
|
|
4
4
|
"name": "core/query-no-results",
|
|
5
|
-
"title": "No
|
|
5
|
+
"title": "No Results",
|
|
6
6
|
"category": "theme",
|
|
7
7
|
"description": "Contains the block elements used to render content when no query results are found.",
|
|
8
8
|
"ancestor": [ "core/query" ],
|
|
@@ -67,7 +67,7 @@ export default function QueryPaginationNumbersEdit( {
|
|
|
67
67
|
>
|
|
68
68
|
<ToolsPanelItem
|
|
69
69
|
label={ __( 'Number of links' ) }
|
|
70
|
-
hasValue={ () => midSize !==
|
|
70
|
+
hasValue={ () => midSize !== 2 }
|
|
71
71
|
onDeselect={ () => setAttributes( { midSize: 2 } ) }
|
|
72
72
|
isShownByDefault
|
|
73
73
|
>
|
package/src/query-title/edit.js
CHANGED
package/src/read-more/edit.js
CHANGED
|
@@ -6,31 +6,55 @@ import {
|
|
|
6
6
|
RichText,
|
|
7
7
|
useBlockProps,
|
|
8
8
|
} from '@wordpress/block-editor';
|
|
9
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
ToggleControl,
|
|
11
|
+
__experimentalToolsPanel as ToolsPanel,
|
|
12
|
+
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
13
|
+
} from '@wordpress/components';
|
|
10
14
|
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
11
15
|
import { __ } from '@wordpress/i18n';
|
|
12
16
|
|
|
17
|
+
/**
|
|
18
|
+
* Internal dependencies
|
|
19
|
+
*/
|
|
20
|
+
import { useToolsPanelDropdownMenuProps } from '../utils/hooks';
|
|
21
|
+
|
|
13
22
|
export default function ReadMore( {
|
|
14
23
|
attributes: { content, linkTarget },
|
|
15
24
|
setAttributes,
|
|
16
25
|
insertBlocksAfter,
|
|
17
26
|
} ) {
|
|
18
27
|
const blockProps = useBlockProps();
|
|
28
|
+
const dropdownMenuProps = useToolsPanelDropdownMenuProps();
|
|
29
|
+
|
|
19
30
|
return (
|
|
20
31
|
<>
|
|
21
32
|
<InspectorControls>
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
33
|
+
<ToolsPanel
|
|
34
|
+
label={ __( 'Settings' ) }
|
|
35
|
+
resetAll={ () => setAttributes( { linkTarget: '_self' } ) }
|
|
36
|
+
dropdownMenuProps={ dropdownMenuProps }
|
|
37
|
+
>
|
|
38
|
+
<ToolsPanelItem
|
|
25
39
|
label={ __( 'Open in new tab' ) }
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
} )
|
|
40
|
+
isShownByDefault
|
|
41
|
+
hasValue={ () => linkTarget !== '_self' }
|
|
42
|
+
onDeselect={ () =>
|
|
43
|
+
setAttributes( { linkTarget: '_self' } )
|
|
30
44
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
45
|
+
>
|
|
46
|
+
<ToggleControl
|
|
47
|
+
__nextHasNoMarginBottom
|
|
48
|
+
label={ __( 'Open in new tab' ) }
|
|
49
|
+
onChange={ ( value ) =>
|
|
50
|
+
setAttributes( {
|
|
51
|
+
linkTarget: value ? '_blank' : '_self',
|
|
52
|
+
} )
|
|
53
|
+
}
|
|
54
|
+
checked={ linkTarget === '_blank' }
|
|
55
|
+
/>
|
|
56
|
+
</ToolsPanelItem>
|
|
57
|
+
</ToolsPanel>
|
|
34
58
|
</InspectorControls>
|
|
35
59
|
<RichText
|
|
36
60
|
identifier="content"
|