@wordpress/block-library 9.41.1-next.v.202603161435.0 → 9.43.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 +4 -0
- package/build/form-input/edit.cjs +36 -29
- package/build/form-input/edit.cjs.map +2 -2
- package/build/form-input/variations.cjs +10 -0
- package/build/form-input/variations.cjs.map +2 -2
- package/build/group/block.json +3 -1
- package/build/html/modal.cjs +151 -229
- package/build/html/modal.cjs.map +2 -2
- package/build/image/image.cjs +13 -4
- package/build/image/image.cjs.map +2 -2
- package/build/latest-comments/deprecated.cjs +33 -0
- package/build/latest-comments/deprecated.cjs.map +2 -2
- package/build/list-item/block.json +1 -0
- package/build/navigation/edit/index.cjs +123 -119
- package/build/navigation/edit/index.cjs.map +3 -3
- package/build/navigation/edit/navigation-menu-selector.cjs +2 -1
- package/build/navigation/edit/navigation-menu-selector.cjs.map +2 -2
- package/build/post-date/block.json +1 -3
- package/build/post-date/deprecated.cjs +82 -6
- package/build/post-date/deprecated.cjs.map +3 -3
- package/build/post-date/edit.cjs +49 -62
- package/build/post-date/edit.cjs.map +3 -3
- package/build/site-logo/edit.cjs +19 -13
- package/build/site-logo/edit.cjs.map +3 -3
- package/build/site-tagline/deprecated.cjs +2 -1
- package/build/site-tagline/deprecated.cjs.map +2 -2
- package/build/site-title/index.cjs +5 -1
- package/build/site-title/index.cjs.map +2 -2
- package/build/tab/save.cjs +2 -4
- package/build/tab/save.cjs.map +2 -2
- package/build/tabs/save.cjs +2 -4
- package/build/tabs/save.cjs.map +2 -2
- package/build/utils/media-control.cjs +1 -1
- package/build/utils/media-control.cjs.map +2 -2
- package/build-module/form-input/edit.mjs +36 -29
- package/build-module/form-input/edit.mjs.map +2 -2
- package/build-module/form-input/variations.mjs +10 -0
- package/build-module/form-input/variations.mjs.map +2 -2
- package/build-module/group/block.json +3 -1
- package/build-module/html/modal.mjs +151 -229
- package/build-module/html/modal.mjs.map +2 -2
- package/build-module/image/image.mjs +13 -4
- package/build-module/image/image.mjs.map +2 -2
- package/build-module/latest-comments/deprecated.mjs +33 -0
- package/build-module/latest-comments/deprecated.mjs.map +2 -2
- package/build-module/list-item/block.json +1 -0
- package/build-module/navigation/edit/index.mjs +123 -119
- package/build-module/navigation/edit/index.mjs.map +2 -2
- package/build-module/navigation/edit/navigation-menu-selector.mjs +2 -1
- package/build-module/navigation/edit/navigation-menu-selector.mjs.map +2 -2
- package/build-module/post-date/block.json +1 -3
- package/build-module/post-date/deprecated.mjs +82 -6
- package/build-module/post-date/deprecated.mjs.map +2 -2
- package/build-module/post-date/edit.mjs +49 -63
- package/build-module/post-date/edit.mjs.map +2 -2
- package/build-module/site-logo/edit.mjs +21 -14
- package/build-module/site-logo/edit.mjs.map +2 -2
- package/build-module/site-tagline/deprecated.mjs +2 -1
- package/build-module/site-tagline/deprecated.mjs.map +2 -2
- package/build-module/site-title/index.mjs +5 -1
- package/build-module/site-title/index.mjs.map +2 -2
- package/build-module/tab/save.mjs +2 -4
- package/build-module/tab/save.mjs.map +2 -2
- package/build-module/tabs/save.mjs +2 -4
- package/build-module/tabs/save.mjs.map +2 -2
- package/build-module/utils/media-control.mjs +1 -1
- package/build-module/utils/media-control.mjs.map +2 -2
- package/build-style/editor-rtl.css +15 -5
- package/build-style/editor.css +15 -5
- package/build-style/form-input/editor-rtl.css +6 -5
- package/build-style/form-input/editor.css +6 -5
- package/build-style/icon/editor-rtl.css +5 -0
- package/build-style/icon/editor.css +5 -0
- package/build-style/image/editor-rtl.css +4 -0
- package/build-style/image/editor.css +4 -0
- package/build-style/navigation/style-rtl.css +4 -1
- package/build-style/navigation/style.css +4 -1
- package/build-style/style-rtl.css +4 -1
- package/build-style/style.css +4 -1
- package/package.json +38 -38
- package/src/form-input/edit.js +19 -15
- package/src/form-input/editor.scss +6 -6
- package/src/form-input/variations.js +10 -0
- package/src/group/block.json +3 -1
- package/src/home-link/index.php +14 -33
- package/src/html/modal.js +6 -77
- package/src/icon/editor.scss +5 -0
- package/src/image/editor.scss +5 -0
- package/src/image/image.js +18 -3
- package/src/latest-comments/deprecated.js +33 -0
- package/src/list-item/block.json +1 -0
- package/src/loginout/index.php +13 -0
- package/src/navigation/edit/index.js +134 -130
- package/src/navigation/edit/navigation-menu-selector.js +2 -1
- package/src/navigation/index.php +24 -6
- package/src/navigation/style.scss +5 -3
- package/src/navigation-link/index.php +10 -38
- package/src/navigation-link/shared/build-css-font-sizes.php +43 -0
- package/src/navigation-submenu/index.php +10 -38
- package/src/page-list/index.php +14 -41
- package/src/post-date/block.json +1 -3
- package/src/post-date/deprecated.js +86 -6
- package/src/post-date/edit.js +65 -82
- package/src/site-logo/edit.js +24 -13
- package/src/site-tagline/deprecated.js +1 -0
- package/src/site-title/index.js +5 -1
- package/src/tab/save.js +2 -6
- package/src/tabs/save.js +2 -6
- package/src/utils/media-control.js +3 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.43.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -95,42 +95,42 @@
|
|
|
95
95
|
],
|
|
96
96
|
"dependencies": {
|
|
97
97
|
"@arraypress/waveform-player": "1.2.1",
|
|
98
|
-
"@wordpress/a11y": "^4.
|
|
99
|
-
"@wordpress/api-fetch": "^7.
|
|
100
|
-
"@wordpress/autop": "^4.
|
|
101
|
-
"@wordpress/base-styles": "^6.
|
|
102
|
-
"@wordpress/blob": "^4.
|
|
103
|
-
"@wordpress/block-editor": "^15.
|
|
104
|
-
"@wordpress/blocks": "^15.
|
|
105
|
-
"@wordpress/components": "^32.
|
|
106
|
-
"@wordpress/compose": "^7.
|
|
107
|
-
"@wordpress/core-data": "^7.
|
|
108
|
-
"@wordpress/data": "^10.
|
|
109
|
-
"@wordpress/date": "^5.
|
|
110
|
-
"@wordpress/deprecated": "^4.
|
|
111
|
-
"@wordpress/dom": "^4.
|
|
112
|
-
"@wordpress/element": "^6.
|
|
113
|
-
"@wordpress/escape-html": "^3.
|
|
114
|
-
"@wordpress/hooks": "^4.
|
|
115
|
-
"@wordpress/html-entities": "^4.
|
|
116
|
-
"@wordpress/i18n": "^6.
|
|
117
|
-
"@wordpress/icons": "^12.
|
|
118
|
-
"@wordpress/interactivity": "^6.
|
|
119
|
-
"@wordpress/interactivity-router": "^2.
|
|
120
|
-
"@wordpress/keyboard-shortcuts": "^5.
|
|
121
|
-
"@wordpress/keycodes": "^4.
|
|
122
|
-
"@wordpress/latex-to-mathml": "^1.
|
|
123
|
-
"@wordpress/notices": "^5.
|
|
124
|
-
"@wordpress/patterns": "^2.
|
|
125
|
-
"@wordpress/primitives": "^4.
|
|
126
|
-
"@wordpress/private-apis": "^1.
|
|
127
|
-
"@wordpress/reusable-blocks": "^5.
|
|
128
|
-
"@wordpress/rich-text": "^7.
|
|
129
|
-
"@wordpress/server-side-render": "^6.
|
|
130
|
-
"@wordpress/upload-media": "^0.
|
|
131
|
-
"@wordpress/url": "^4.
|
|
132
|
-
"@wordpress/viewport": "^6.
|
|
133
|
-
"@wordpress/wordcount": "^4.
|
|
98
|
+
"@wordpress/a11y": "^4.43.0",
|
|
99
|
+
"@wordpress/api-fetch": "^7.43.0",
|
|
100
|
+
"@wordpress/autop": "^4.43.0",
|
|
101
|
+
"@wordpress/base-styles": "^6.19.0",
|
|
102
|
+
"@wordpress/blob": "^4.43.0",
|
|
103
|
+
"@wordpress/block-editor": "^15.16.0",
|
|
104
|
+
"@wordpress/blocks": "^15.16.0",
|
|
105
|
+
"@wordpress/components": "^32.5.0",
|
|
106
|
+
"@wordpress/compose": "^7.43.0",
|
|
107
|
+
"@wordpress/core-data": "^7.43.0",
|
|
108
|
+
"@wordpress/data": "^10.43.0",
|
|
109
|
+
"@wordpress/date": "^5.43.0",
|
|
110
|
+
"@wordpress/deprecated": "^4.43.0",
|
|
111
|
+
"@wordpress/dom": "^4.43.0",
|
|
112
|
+
"@wordpress/element": "^6.43.0",
|
|
113
|
+
"@wordpress/escape-html": "^3.43.0",
|
|
114
|
+
"@wordpress/hooks": "^4.43.0",
|
|
115
|
+
"@wordpress/html-entities": "^4.43.0",
|
|
116
|
+
"@wordpress/i18n": "^6.16.0",
|
|
117
|
+
"@wordpress/icons": "^12.1.0",
|
|
118
|
+
"@wordpress/interactivity": "^6.43.0",
|
|
119
|
+
"@wordpress/interactivity-router": "^2.43.0",
|
|
120
|
+
"@wordpress/keyboard-shortcuts": "^5.43.0",
|
|
121
|
+
"@wordpress/keycodes": "^4.43.0",
|
|
122
|
+
"@wordpress/latex-to-mathml": "^1.11.0",
|
|
123
|
+
"@wordpress/notices": "^5.43.0",
|
|
124
|
+
"@wordpress/patterns": "^2.43.0",
|
|
125
|
+
"@wordpress/primitives": "^4.43.0",
|
|
126
|
+
"@wordpress/private-apis": "^1.43.0",
|
|
127
|
+
"@wordpress/reusable-blocks": "^5.43.0",
|
|
128
|
+
"@wordpress/rich-text": "^7.43.0",
|
|
129
|
+
"@wordpress/server-side-render": "^6.19.0",
|
|
130
|
+
"@wordpress/upload-media": "^0.28.0",
|
|
131
|
+
"@wordpress/url": "^4.43.0",
|
|
132
|
+
"@wordpress/viewport": "^6.43.0",
|
|
133
|
+
"@wordpress/wordcount": "^4.43.0",
|
|
134
134
|
"change-case": "^4.1.2",
|
|
135
135
|
"clsx": "^2.1.1",
|
|
136
136
|
"colord": "^2.7.0",
|
|
@@ -151,5 +151,5 @@
|
|
|
151
151
|
"publishConfig": {
|
|
152
152
|
"access": "public"
|
|
153
153
|
},
|
|
154
|
-
"gitHead": "
|
|
154
|
+
"gitHead": "2cea90674d11aa521ec3f71652fb3a6a4c383969"
|
|
155
155
|
}
|
package/src/form-input/edit.js
CHANGED
|
@@ -115,6 +115,20 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
|
|
|
115
115
|
'Affects the "name" attribute of the input element, and is used as a name for the form submission results.'
|
|
116
116
|
) }
|
|
117
117
|
/>
|
|
118
|
+
{ 'hidden' === type && (
|
|
119
|
+
<TextControl
|
|
120
|
+
__next40pxDefaultSize
|
|
121
|
+
autoComplete="off"
|
|
122
|
+
label={ __( 'Value' ) }
|
|
123
|
+
value={ value }
|
|
124
|
+
onChange={ ( newVal ) =>
|
|
125
|
+
setAttributes( { value: newVal } )
|
|
126
|
+
}
|
|
127
|
+
help={ __(
|
|
128
|
+
'Sets the stored value for this hidden field.'
|
|
129
|
+
) }
|
|
130
|
+
/>
|
|
131
|
+
) }
|
|
118
132
|
</InspectorControls>
|
|
119
133
|
</>
|
|
120
134
|
);
|
|
@@ -133,23 +147,13 @@ function InputFieldBlock( { attributes, setAttributes, className } ) {
|
|
|
133
147
|
|
|
134
148
|
if ( 'hidden' === type ) {
|
|
135
149
|
return (
|
|
136
|
-
|
|
150
|
+
<div { ...blockProps }>
|
|
137
151
|
{ controls }
|
|
138
|
-
<
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
className,
|
|
142
|
-
'wp-block-form-input__input',
|
|
143
|
-
colorProps.className,
|
|
144
|
-
borderProps.className
|
|
145
|
-
) }
|
|
146
|
-
aria-label={ __( 'Value' ) }
|
|
147
|
-
value={ value }
|
|
148
|
-
onChange={ ( event ) =>
|
|
149
|
-
setAttributes( { value: event.target.value } )
|
|
150
|
-
}
|
|
152
|
+
<span
|
|
153
|
+
className="wp-block-form-input__label is-input-hidden"
|
|
154
|
+
data-message={ __( 'Hidden field' ) }
|
|
151
155
|
/>
|
|
152
|
-
|
|
156
|
+
</div>
|
|
153
157
|
);
|
|
154
158
|
}
|
|
155
159
|
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
.wp-block-form-input {
|
|
2
2
|
.is-input-hidden {
|
|
3
|
+
display: flex;
|
|
4
|
+
position: relative;
|
|
3
5
|
font-size: 0.85em;
|
|
4
6
|
opacity: 0.3;
|
|
5
7
|
border: 1px dashed;
|
|
6
8
|
padding: 0.5em;
|
|
7
9
|
box-sizing: border-box;
|
|
8
10
|
background: repeating-linear-gradient(45deg, transparent, transparent 5px, currentColor 5px, currentColor 6px);
|
|
11
|
+
justify-content: center;
|
|
12
|
+
align-items: center;
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
|
|
14
|
+
&::after {
|
|
15
|
+
content: attr(data-message);
|
|
12
16
|
}
|
|
13
17
|
}
|
|
14
18
|
&.is-selected {
|
|
15
19
|
.is-input-hidden {
|
|
16
20
|
opacity: 1;
|
|
17
21
|
background: none;
|
|
18
|
-
|
|
19
|
-
input[type="text"] {
|
|
20
|
-
background: unset;
|
|
21
|
-
}
|
|
22
22
|
}
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -70,6 +70,16 @@ const variations = [
|
|
|
70
70
|
scope: [ 'inserter', 'transform' ],
|
|
71
71
|
isActive: ( blockAttributes ) => blockAttributes?.type === 'number',
|
|
72
72
|
},
|
|
73
|
+
{
|
|
74
|
+
name: 'hidden',
|
|
75
|
+
title: __( 'Hidden Input' ),
|
|
76
|
+
icon: 'visibility',
|
|
77
|
+
description: __( 'A hidden input field.' ),
|
|
78
|
+
attributes: { type: 'hidden' },
|
|
79
|
+
isDefault: true,
|
|
80
|
+
scope: [ 'inserter', 'transform' ],
|
|
81
|
+
isActive: ( blockAttributes ) => blockAttributes?.type === 'hidden',
|
|
82
|
+
},
|
|
73
83
|
];
|
|
74
84
|
|
|
75
85
|
export default variations;
|
package/src/group/block.json
CHANGED
package/src/home-link/index.php
CHANGED
|
@@ -5,6 +5,8 @@
|
|
|
5
5
|
* @package WordPress
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
require_once __DIR__ . '/navigation-link/shared/build-css-font-sizes.php';
|
|
9
|
+
|
|
8
10
|
/**
|
|
9
11
|
* Build an array with CSS classes and inline styles defining the colors
|
|
10
12
|
* which will be applied to the home link markup in the front-end.
|
|
@@ -59,36 +61,6 @@ function block_core_home_link_build_css_colors( $context ) {
|
|
|
59
61
|
return $colors;
|
|
60
62
|
}
|
|
61
63
|
|
|
62
|
-
/**
|
|
63
|
-
* Build an array with CSS classes and inline styles defining the font sizes
|
|
64
|
-
* which will be applied to the home link markup in the front-end.
|
|
65
|
-
*
|
|
66
|
-
* @since 6.0.0
|
|
67
|
-
*
|
|
68
|
-
* @param array $context Home link block context.
|
|
69
|
-
* @return array Font size CSS classes and inline styles.
|
|
70
|
-
*/
|
|
71
|
-
function block_core_home_link_build_css_font_sizes( $context ) {
|
|
72
|
-
// CSS classes.
|
|
73
|
-
$font_sizes = array(
|
|
74
|
-
'css_classes' => array(),
|
|
75
|
-
'inline_styles' => '',
|
|
76
|
-
);
|
|
77
|
-
|
|
78
|
-
$has_named_font_size = array_key_exists( 'fontSize', $context );
|
|
79
|
-
$has_custom_font_size = isset( $context['style']['typography']['fontSize'] );
|
|
80
|
-
|
|
81
|
-
if ( $has_named_font_size ) {
|
|
82
|
-
// Add the font size class.
|
|
83
|
-
$font_sizes['css_classes'][] = sprintf( 'has-%s-font-size', $context['fontSize'] );
|
|
84
|
-
} elseif ( $has_custom_font_size ) {
|
|
85
|
-
// Add the custom font size inline style.
|
|
86
|
-
$font_sizes['inline_styles'] = sprintf( 'font-size: %s;', $context['style']['typography']['fontSize'] );
|
|
87
|
-
}
|
|
88
|
-
|
|
89
|
-
return $font_sizes;
|
|
90
|
-
}
|
|
91
|
-
|
|
92
64
|
/**
|
|
93
65
|
* Builds an array with classes and style for the li wrapper
|
|
94
66
|
*
|
|
@@ -98,12 +70,21 @@ function block_core_home_link_build_css_font_sizes( $context ) {
|
|
|
98
70
|
* @return string The li wrapper attributes.
|
|
99
71
|
*/
|
|
100
72
|
function block_core_home_link_build_li_wrapper_attributes( $context ) {
|
|
101
|
-
$colors
|
|
102
|
-
|
|
103
|
-
|
|
73
|
+
$colors = block_core_home_link_build_css_colors( $context );
|
|
74
|
+
// The build system prefixes this function with "gutenberg_" to avoid
|
|
75
|
+
// collisions with the core version. Until this function is backported to
|
|
76
|
+
// core, we need to guard it's use and only call the prefixed name in
|
|
77
|
+
// the plugin.
|
|
78
|
+
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
|
79
|
+
$font_sizes = gutenberg_block_core_shared_navigation_build_css_font_sizes( $context );
|
|
80
|
+
} else {
|
|
81
|
+
$font_sizes = block_core_shared_navigation_build_css_font_sizes( $context );
|
|
82
|
+
}
|
|
83
|
+
$classes = array_merge(
|
|
104
84
|
$colors['css_classes'],
|
|
105
85
|
$font_sizes['css_classes']
|
|
106
86
|
);
|
|
87
|
+
|
|
107
88
|
$style_attribute = ( $colors['inline_styles'] . $font_sizes['inline_styles'] );
|
|
108
89
|
$classes[] = 'wp-block-navigation-item';
|
|
109
90
|
|
package/src/html/modal.js
CHANGED
|
@@ -37,8 +37,6 @@ export default function HTMLEditModal( {
|
|
|
37
37
|
const [ editedHtml, setEditedHtml ] = useState( html );
|
|
38
38
|
const [ editedCss, setEditedCss ] = useState( css );
|
|
39
39
|
const [ editedJs, setEditedJs ] = useState( js );
|
|
40
|
-
const [ isDirty, setIsDirty ] = useState( false );
|
|
41
|
-
const [ showUnsavedWarning, setShowUnsavedWarning ] = useState( false );
|
|
42
40
|
const [ isFullscreen, setIsFullscreen ] = useState( false );
|
|
43
41
|
|
|
44
42
|
const isMobileViewport = useViewportMatch( 'small', '<' );
|
|
@@ -60,18 +58,6 @@ export default function HTMLEditModal( {
|
|
|
60
58
|
return null;
|
|
61
59
|
}
|
|
62
60
|
|
|
63
|
-
const handleHtmlChange = ( value ) => {
|
|
64
|
-
setEditedHtml( value );
|
|
65
|
-
setIsDirty( true );
|
|
66
|
-
};
|
|
67
|
-
const handleCssChange = ( value ) => {
|
|
68
|
-
setEditedCss( value );
|
|
69
|
-
setIsDirty( true );
|
|
70
|
-
};
|
|
71
|
-
const handleJsChange = ( value ) => {
|
|
72
|
-
setEditedJs( value );
|
|
73
|
-
setIsDirty( true );
|
|
74
|
-
};
|
|
75
61
|
const handleUpdate = () => {
|
|
76
62
|
// For users without unfiltered_html capability, strip CSS and JS content
|
|
77
63
|
// to prevent kses from leaving broken content
|
|
@@ -82,25 +68,6 @@ export default function HTMLEditModal( {
|
|
|
82
68
|
js: canUserUseUnfilteredHTML ? editedJs : '',
|
|
83
69
|
} ),
|
|
84
70
|
} );
|
|
85
|
-
setIsDirty( false );
|
|
86
|
-
};
|
|
87
|
-
const handleCancel = () => {
|
|
88
|
-
setIsDirty( false );
|
|
89
|
-
onRequestClose();
|
|
90
|
-
};
|
|
91
|
-
const handleRequestClose = () => {
|
|
92
|
-
if ( isDirty ) {
|
|
93
|
-
setShowUnsavedWarning( true );
|
|
94
|
-
} else {
|
|
95
|
-
onRequestClose();
|
|
96
|
-
}
|
|
97
|
-
};
|
|
98
|
-
const handleDiscardChanges = () => {
|
|
99
|
-
setShowUnsavedWarning( false );
|
|
100
|
-
onRequestClose();
|
|
101
|
-
};
|
|
102
|
-
const handleContinueEditing = () => {
|
|
103
|
-
setShowUnsavedWarning( false );
|
|
104
71
|
};
|
|
105
72
|
const handleUpdateAndClose = () => {
|
|
106
73
|
handleUpdate();
|
|
@@ -114,12 +81,11 @@ export default function HTMLEditModal( {
|
|
|
114
81
|
<>
|
|
115
82
|
<Modal
|
|
116
83
|
title={ __( 'Edit HTML' ) }
|
|
117
|
-
onRequestClose={
|
|
84
|
+
onRequestClose={ onRequestClose }
|
|
118
85
|
className="block-library-html__modal"
|
|
119
86
|
size="large"
|
|
120
87
|
isDismissible={ false }
|
|
121
|
-
shouldCloseOnClickOutside={
|
|
122
|
-
shouldCloseOnEsc={ ! isDirty }
|
|
88
|
+
shouldCloseOnClickOutside={ false }
|
|
123
89
|
isFullScreen={ isFullscreen }
|
|
124
90
|
__experimentalHideHeader
|
|
125
91
|
>
|
|
@@ -183,7 +149,7 @@ export default function HTMLEditModal( {
|
|
|
183
149
|
>
|
|
184
150
|
<PlainText
|
|
185
151
|
value={ editedHtml }
|
|
186
|
-
onChange={
|
|
152
|
+
onChange={ setEditedHtml }
|
|
187
153
|
placeholder={ __( 'Write HTML…' ) }
|
|
188
154
|
aria-label={ __( 'HTML' ) }
|
|
189
155
|
className="block-library-html__modal-editor"
|
|
@@ -197,7 +163,7 @@ export default function HTMLEditModal( {
|
|
|
197
163
|
>
|
|
198
164
|
<PlainText
|
|
199
165
|
value={ editedCss }
|
|
200
|
-
onChange={
|
|
166
|
+
onChange={ setEditedCss }
|
|
201
167
|
placeholder={ __( 'Write CSS…' ) }
|
|
202
168
|
aria-label={ __( 'CSS' ) }
|
|
203
169
|
className="block-library-html__modal-editor"
|
|
@@ -212,7 +178,7 @@ export default function HTMLEditModal( {
|
|
|
212
178
|
>
|
|
213
179
|
<PlainText
|
|
214
180
|
value={ editedJs }
|
|
215
|
-
onChange={
|
|
181
|
+
onChange={ setEditedJs }
|
|
216
182
|
placeholder={ __(
|
|
217
183
|
'Write JavaScript…'
|
|
218
184
|
) }
|
|
@@ -241,7 +207,7 @@ export default function HTMLEditModal( {
|
|
|
241
207
|
<Button
|
|
242
208
|
__next40pxDefaultSize
|
|
243
209
|
variant="tertiary"
|
|
244
|
-
onClick={
|
|
210
|
+
onClick={ onRequestClose }
|
|
245
211
|
>
|
|
246
212
|
{ __( 'Cancel' ) }
|
|
247
213
|
</Button>
|
|
@@ -256,43 +222,6 @@ export default function HTMLEditModal( {
|
|
|
256
222
|
</VStack>
|
|
257
223
|
</Tabs>
|
|
258
224
|
</Modal>
|
|
259
|
-
|
|
260
|
-
{ showUnsavedWarning && (
|
|
261
|
-
<Modal
|
|
262
|
-
title={ __( 'Unsaved changes' ) }
|
|
263
|
-
onRequestClose={ handleContinueEditing }
|
|
264
|
-
size="medium"
|
|
265
|
-
>
|
|
266
|
-
<p>
|
|
267
|
-
{ __(
|
|
268
|
-
'You have unsaved changes. What would you like to do?'
|
|
269
|
-
) }
|
|
270
|
-
</p>
|
|
271
|
-
<Flex direction="row" justify="flex-end" gap={ 2 }>
|
|
272
|
-
<Button
|
|
273
|
-
__next40pxDefaultSize
|
|
274
|
-
variant="secondary"
|
|
275
|
-
onClick={ handleDiscardChanges }
|
|
276
|
-
>
|
|
277
|
-
{ __( 'Discard unsaved changes' ) }
|
|
278
|
-
</Button>
|
|
279
|
-
<Button
|
|
280
|
-
__next40pxDefaultSize
|
|
281
|
-
variant="secondary"
|
|
282
|
-
onClick={ handleContinueEditing }
|
|
283
|
-
>
|
|
284
|
-
{ __( 'Continue editing' ) }
|
|
285
|
-
</Button>
|
|
286
|
-
<Button
|
|
287
|
-
__next40pxDefaultSize
|
|
288
|
-
variant="primary"
|
|
289
|
-
onClick={ handleUpdateAndClose }
|
|
290
|
-
>
|
|
291
|
-
{ __( 'Update and close' ) }
|
|
292
|
-
</Button>
|
|
293
|
-
</Flex>
|
|
294
|
-
</Modal>
|
|
295
|
-
) }
|
|
296
225
|
</>
|
|
297
226
|
);
|
|
298
227
|
}
|
package/src/icon/editor.scss
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
@use "@wordpress/base-styles/variables" as *;
|
|
2
2
|
@use "@wordpress/base-styles/colors" as *;
|
|
3
3
|
|
|
4
|
+
.wp-block[data-align="center"] > .wp-block-icon {
|
|
5
|
+
display: flex;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
}
|
|
8
|
+
|
|
4
9
|
// Style for the icon library modal.
|
|
5
10
|
.wp-block-icon__inserter {
|
|
6
11
|
padding: 0 $grid-unit-30;
|
package/src/image/editor.scss
CHANGED
|
@@ -52,6 +52,11 @@ figure.wp-block-image:not(.wp-block) {
|
|
|
52
52
|
}
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
// Disable any duotone filter applied in the selected state.
|
|
56
|
+
.wp-block-image.is-selected .block-editor-media-placeholder {
|
|
57
|
+
filter: none !important;
|
|
58
|
+
}
|
|
59
|
+
|
|
55
60
|
.block-editor-block-list__block[data-type="core/image"] .block-editor-block-toolbar .block-editor-url-input__button-modal {
|
|
56
61
|
position: absolute;
|
|
57
62
|
left: 0;
|
package/src/image/image.js
CHANGED
|
@@ -70,7 +70,9 @@ import {
|
|
|
70
70
|
} from './constants';
|
|
71
71
|
import { evalAspectRatio, mediaPosition } from './utils';
|
|
72
72
|
|
|
73
|
-
const { DimensionsTool, ResolutionTool } = unlock(
|
|
73
|
+
const { DimensionsTool, ResolutionTool, mediaEditKey } = unlock(
|
|
74
|
+
blockEditorPrivateApis
|
|
75
|
+
);
|
|
74
76
|
|
|
75
77
|
const scaleOptions = [
|
|
76
78
|
{
|
|
@@ -342,7 +344,13 @@ export default function Image( {
|
|
|
342
344
|
[ id, isSingleSelected ]
|
|
343
345
|
);
|
|
344
346
|
|
|
345
|
-
const {
|
|
347
|
+
const {
|
|
348
|
+
canInsertCover,
|
|
349
|
+
imageEditing,
|
|
350
|
+
imageSizes,
|
|
351
|
+
maxWidth,
|
|
352
|
+
editMediaEntity,
|
|
353
|
+
} = useSelect(
|
|
346
354
|
( select ) => {
|
|
347
355
|
const { getBlockRootClientId, canInsertBlockType, getSettings } =
|
|
348
356
|
select( blockEditorStore );
|
|
@@ -354,6 +362,7 @@ export default function Image( {
|
|
|
354
362
|
imageEditing: settings.imageEditing,
|
|
355
363
|
imageSizes: settings.imageSizes,
|
|
356
364
|
maxWidth: settings.maxWidth,
|
|
365
|
+
editMediaEntity: settings?.[ mediaEditKey ],
|
|
357
366
|
canInsertCover: canInsertBlockType(
|
|
358
367
|
'core/cover',
|
|
359
368
|
rootClientId
|
|
@@ -550,7 +559,12 @@ export default function Image( {
|
|
|
550
559
|
}
|
|
551
560
|
}, [ isSingleSelected ] );
|
|
552
561
|
|
|
553
|
-
const canEditImage =
|
|
562
|
+
const canEditImage =
|
|
563
|
+
id &&
|
|
564
|
+
naturalWidth &&
|
|
565
|
+
naturalHeight &&
|
|
566
|
+
imageEditing &&
|
|
567
|
+
!! editMediaEntity;
|
|
554
568
|
const allowCrop =
|
|
555
569
|
isSingleSelected &&
|
|
556
570
|
canEditImage &&
|
|
@@ -762,6 +776,7 @@ export default function Image( {
|
|
|
762
776
|
id &&
|
|
763
777
|
isSingleSelected &&
|
|
764
778
|
canUserEdit &&
|
|
779
|
+
!! editMediaEntity &&
|
|
765
780
|
! isExternalImage( id, url ) &&
|
|
766
781
|
! isEditingImage &&
|
|
767
782
|
onNavigateToEntityRecord && (
|
|
@@ -23,6 +23,39 @@ const v1 = {
|
|
|
23
23
|
default: true,
|
|
24
24
|
},
|
|
25
25
|
},
|
|
26
|
+
supports: {
|
|
27
|
+
align: true,
|
|
28
|
+
color: {
|
|
29
|
+
gradients: true,
|
|
30
|
+
link: true,
|
|
31
|
+
__experimentalDefaultControls: {
|
|
32
|
+
background: true,
|
|
33
|
+
text: true,
|
|
34
|
+
link: true,
|
|
35
|
+
},
|
|
36
|
+
},
|
|
37
|
+
html: false,
|
|
38
|
+
spacing: {
|
|
39
|
+
margin: true,
|
|
40
|
+
padding: true,
|
|
41
|
+
},
|
|
42
|
+
typography: {
|
|
43
|
+
fontSize: true,
|
|
44
|
+
lineHeight: true,
|
|
45
|
+
__experimentalFontFamily: true,
|
|
46
|
+
__experimentalFontWeight: true,
|
|
47
|
+
__experimentalFontStyle: true,
|
|
48
|
+
__experimentalTextTransform: true,
|
|
49
|
+
__experimentalTextDecoration: true,
|
|
50
|
+
__experimentalLetterSpacing: true,
|
|
51
|
+
__experimentalDefaultControls: {
|
|
52
|
+
fontSize: true,
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
interactivity: {
|
|
56
|
+
clientNavigation: true,
|
|
57
|
+
},
|
|
58
|
+
},
|
|
26
59
|
isEligible( attributes ) {
|
|
27
60
|
return attributes?.displayExcerpt === false;
|
|
28
61
|
},
|
package/src/list-item/block.json
CHANGED
package/src/loginout/index.php
CHANGED
|
@@ -38,6 +38,19 @@ function render_block_core_loginout( $attributes ) {
|
|
|
38
38
|
|
|
39
39
|
// Get the form.
|
|
40
40
|
$contents = wp_login_form( array( 'echo' => false ) );
|
|
41
|
+
|
|
42
|
+
if ( wp_is_block_theme() ) {
|
|
43
|
+
$processor = new WP_HTML_Tag_Processor( $contents );
|
|
44
|
+
|
|
45
|
+
while ( $processor->next_tag( 'input' ) ) {
|
|
46
|
+
if ( 'submit' === $processor->get_attribute( 'type' ) && 'wp-submit' === $processor->get_attribute( 'name' ) ) {
|
|
47
|
+
$processor->add_class( 'wp-block-button__link' );
|
|
48
|
+
$processor->add_class( wp_theme_get_element_class_name( 'button' ) );
|
|
49
|
+
$contents = $processor->get_updated_html();
|
|
50
|
+
break;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
41
54
|
}
|
|
42
55
|
|
|
43
56
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $classes ) );
|