@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.
Files changed (109) hide show
  1. package/CHANGELOG.md +4 -0
  2. package/build/form-input/edit.cjs +36 -29
  3. package/build/form-input/edit.cjs.map +2 -2
  4. package/build/form-input/variations.cjs +10 -0
  5. package/build/form-input/variations.cjs.map +2 -2
  6. package/build/group/block.json +3 -1
  7. package/build/html/modal.cjs +151 -229
  8. package/build/html/modal.cjs.map +2 -2
  9. package/build/image/image.cjs +13 -4
  10. package/build/image/image.cjs.map +2 -2
  11. package/build/latest-comments/deprecated.cjs +33 -0
  12. package/build/latest-comments/deprecated.cjs.map +2 -2
  13. package/build/list-item/block.json +1 -0
  14. package/build/navigation/edit/index.cjs +123 -119
  15. package/build/navigation/edit/index.cjs.map +3 -3
  16. package/build/navigation/edit/navigation-menu-selector.cjs +2 -1
  17. package/build/navigation/edit/navigation-menu-selector.cjs.map +2 -2
  18. package/build/post-date/block.json +1 -3
  19. package/build/post-date/deprecated.cjs +82 -6
  20. package/build/post-date/deprecated.cjs.map +3 -3
  21. package/build/post-date/edit.cjs +49 -62
  22. package/build/post-date/edit.cjs.map +3 -3
  23. package/build/site-logo/edit.cjs +19 -13
  24. package/build/site-logo/edit.cjs.map +3 -3
  25. package/build/site-tagline/deprecated.cjs +2 -1
  26. package/build/site-tagline/deprecated.cjs.map +2 -2
  27. package/build/site-title/index.cjs +5 -1
  28. package/build/site-title/index.cjs.map +2 -2
  29. package/build/tab/save.cjs +2 -4
  30. package/build/tab/save.cjs.map +2 -2
  31. package/build/tabs/save.cjs +2 -4
  32. package/build/tabs/save.cjs.map +2 -2
  33. package/build/utils/media-control.cjs +1 -1
  34. package/build/utils/media-control.cjs.map +2 -2
  35. package/build-module/form-input/edit.mjs +36 -29
  36. package/build-module/form-input/edit.mjs.map +2 -2
  37. package/build-module/form-input/variations.mjs +10 -0
  38. package/build-module/form-input/variations.mjs.map +2 -2
  39. package/build-module/group/block.json +3 -1
  40. package/build-module/html/modal.mjs +151 -229
  41. package/build-module/html/modal.mjs.map +2 -2
  42. package/build-module/image/image.mjs +13 -4
  43. package/build-module/image/image.mjs.map +2 -2
  44. package/build-module/latest-comments/deprecated.mjs +33 -0
  45. package/build-module/latest-comments/deprecated.mjs.map +2 -2
  46. package/build-module/list-item/block.json +1 -0
  47. package/build-module/navigation/edit/index.mjs +123 -119
  48. package/build-module/navigation/edit/index.mjs.map +2 -2
  49. package/build-module/navigation/edit/navigation-menu-selector.mjs +2 -1
  50. package/build-module/navigation/edit/navigation-menu-selector.mjs.map +2 -2
  51. package/build-module/post-date/block.json +1 -3
  52. package/build-module/post-date/deprecated.mjs +82 -6
  53. package/build-module/post-date/deprecated.mjs.map +2 -2
  54. package/build-module/post-date/edit.mjs +49 -63
  55. package/build-module/post-date/edit.mjs.map +2 -2
  56. package/build-module/site-logo/edit.mjs +21 -14
  57. package/build-module/site-logo/edit.mjs.map +2 -2
  58. package/build-module/site-tagline/deprecated.mjs +2 -1
  59. package/build-module/site-tagline/deprecated.mjs.map +2 -2
  60. package/build-module/site-title/index.mjs +5 -1
  61. package/build-module/site-title/index.mjs.map +2 -2
  62. package/build-module/tab/save.mjs +2 -4
  63. package/build-module/tab/save.mjs.map +2 -2
  64. package/build-module/tabs/save.mjs +2 -4
  65. package/build-module/tabs/save.mjs.map +2 -2
  66. package/build-module/utils/media-control.mjs +1 -1
  67. package/build-module/utils/media-control.mjs.map +2 -2
  68. package/build-style/editor-rtl.css +15 -5
  69. package/build-style/editor.css +15 -5
  70. package/build-style/form-input/editor-rtl.css +6 -5
  71. package/build-style/form-input/editor.css +6 -5
  72. package/build-style/icon/editor-rtl.css +5 -0
  73. package/build-style/icon/editor.css +5 -0
  74. package/build-style/image/editor-rtl.css +4 -0
  75. package/build-style/image/editor.css +4 -0
  76. package/build-style/navigation/style-rtl.css +4 -1
  77. package/build-style/navigation/style.css +4 -1
  78. package/build-style/style-rtl.css +4 -1
  79. package/build-style/style.css +4 -1
  80. package/package.json +38 -38
  81. package/src/form-input/edit.js +19 -15
  82. package/src/form-input/editor.scss +6 -6
  83. package/src/form-input/variations.js +10 -0
  84. package/src/group/block.json +3 -1
  85. package/src/home-link/index.php +14 -33
  86. package/src/html/modal.js +6 -77
  87. package/src/icon/editor.scss +5 -0
  88. package/src/image/editor.scss +5 -0
  89. package/src/image/image.js +18 -3
  90. package/src/latest-comments/deprecated.js +33 -0
  91. package/src/list-item/block.json +1 -0
  92. package/src/loginout/index.php +13 -0
  93. package/src/navigation/edit/index.js +134 -130
  94. package/src/navigation/edit/navigation-menu-selector.js +2 -1
  95. package/src/navigation/index.php +24 -6
  96. package/src/navigation/style.scss +5 -3
  97. package/src/navigation-link/index.php +10 -38
  98. package/src/navigation-link/shared/build-css-font-sizes.php +43 -0
  99. package/src/navigation-submenu/index.php +10 -38
  100. package/src/page-list/index.php +14 -41
  101. package/src/post-date/block.json +1 -3
  102. package/src/post-date/deprecated.js +86 -6
  103. package/src/post-date/edit.js +65 -82
  104. package/src/site-logo/edit.js +24 -13
  105. package/src/site-tagline/deprecated.js +1 -0
  106. package/src/site-title/index.js +5 -1
  107. package/src/tab/save.js +2 -6
  108. package/src/tabs/save.js +2 -6
  109. 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.41.1-next.v.202603161435.0+ab4981c4f",
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.41.1-next.v.202603161435.0+ab4981c4f",
99
- "@wordpress/api-fetch": "^7.41.1-next.v.202603161435.0+ab4981c4f",
100
- "@wordpress/autop": "^4.41.1-next.v.202603161435.0+ab4981c4f",
101
- "@wordpress/base-styles": "^6.17.1-next.v.202603161435.0+ab4981c4f",
102
- "@wordpress/blob": "^4.41.1-next.v.202603161435.0+ab4981c4f",
103
- "@wordpress/block-editor": "^15.14.1-next.v.202603161435.0+ab4981c4f",
104
- "@wordpress/blocks": "^15.14.1-next.v.202603161435.0+ab4981c4f",
105
- "@wordpress/components": "^32.4.1-next.v.202603161435.0+ab4981c4f",
106
- "@wordpress/compose": "^7.41.1-next.v.202603161435.0+ab4981c4f",
107
- "@wordpress/core-data": "^7.41.2-next.v.202603161435.0+ab4981c4f",
108
- "@wordpress/data": "^10.41.1-next.v.202603161435.0+ab4981c4f",
109
- "@wordpress/date": "^5.41.1-next.v.202603161435.0+ab4981c4f",
110
- "@wordpress/deprecated": "^4.41.1-next.v.202603161435.0+ab4981c4f",
111
- "@wordpress/dom": "^4.41.1-next.v.202603161435.0+ab4981c4f",
112
- "@wordpress/element": "^6.41.1-next.v.202603161435.0+ab4981c4f",
113
- "@wordpress/escape-html": "^3.41.1-next.v.202603161435.0+ab4981c4f",
114
- "@wordpress/hooks": "^4.41.1-next.v.202603161435.0+ab4981c4f",
115
- "@wordpress/html-entities": "^4.41.1-next.v.202603161435.0+ab4981c4f",
116
- "@wordpress/i18n": "^6.14.1-next.v.202603161435.0+ab4981c4f",
117
- "@wordpress/icons": "^12.0.1-next.v.202603161435.0+ab4981c4f",
118
- "@wordpress/interactivity": "^6.41.2-next.v.202603161435.0+ab4981c4f",
119
- "@wordpress/interactivity-router": "^2.41.2-next.v.202603161435.0+ab4981c4f",
120
- "@wordpress/keyboard-shortcuts": "^5.41.1-next.v.202603161435.0+ab4981c4f",
121
- "@wordpress/keycodes": "^4.41.1-next.v.202603161435.0+ab4981c4f",
122
- "@wordpress/latex-to-mathml": "^1.9.1-next.v.202603161435.0+ab4981c4f",
123
- "@wordpress/notices": "^5.41.1-next.v.202603161435.0+ab4981c4f",
124
- "@wordpress/patterns": "^2.41.1-next.v.202603161435.0+ab4981c4f",
125
- "@wordpress/primitives": "^4.41.1-next.v.202603161435.0+ab4981c4f",
126
- "@wordpress/private-apis": "^1.41.1-next.v.202603161435.0+ab4981c4f",
127
- "@wordpress/reusable-blocks": "^5.41.1-next.v.202603161435.0+ab4981c4f",
128
- "@wordpress/rich-text": "^7.41.1-next.v.202603161435.0+ab4981c4f",
129
- "@wordpress/server-side-render": "^6.17.1-next.v.202603161435.0+ab4981c4f",
130
- "@wordpress/upload-media": "^0.26.1-next.v.202603161435.0+ab4981c4f",
131
- "@wordpress/url": "^4.41.1-next.v.202603161435.0+ab4981c4f",
132
- "@wordpress/viewport": "^6.41.1-next.v.202603161435.0+ab4981c4f",
133
- "@wordpress/wordcount": "^4.41.1-next.v.202603161435.0+ab4981c4f",
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": "748f4e4564fcc0e6ae90200d90bb993a3cef5828"
154
+ "gitHead": "2cea90674d11aa521ec3f71652fb3a6a4c383969"
155
155
  }
@@ -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
- <input
139
- type="hidden"
140
- className={ clsx(
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
- input[type="text"] {
11
- background: transparent;
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;
@@ -28,8 +28,10 @@
28
28
  "background": {
29
29
  "backgroundImage": true,
30
30
  "backgroundSize": true,
31
+ "gradient": true,
31
32
  "__experimentalDefaultControls": {
32
- "backgroundImage": true
33
+ "backgroundImage": true,
34
+ "gradient": true
33
35
  }
34
36
  },
35
37
  "color": {
@@ -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 = block_core_home_link_build_css_colors( $context );
102
- $font_sizes = block_core_home_link_build_css_font_sizes( $context );
103
- $classes = array_merge(
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={ handleRequestClose }
84
+ onRequestClose={ onRequestClose }
118
85
  className="block-library-html__modal"
119
86
  size="large"
120
87
  isDismissible={ false }
121
- shouldCloseOnClickOutside={ ! isDirty }
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={ handleHtmlChange }
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={ handleCssChange }
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={ handleJsChange }
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={ handleCancel }
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
  }
@@ -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;
@@ -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;
@@ -70,7 +70,9 @@ import {
70
70
  } from './constants';
71
71
  import { evalAspectRatio, mediaPosition } from './utils';
72
72
 
73
- const { DimensionsTool, ResolutionTool } = unlock( blockEditorPrivateApis );
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 { canInsertCover, imageEditing, imageSizes, maxWidth } = useSelect(
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 = id && naturalWidth && naturalHeight && imageEditing;
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
  },
@@ -21,6 +21,7 @@
21
21
  },
22
22
  "supports": {
23
23
  "anchor": true,
24
+ "html": false,
24
25
  "className": false,
25
26
  "splitting": true,
26
27
  "__experimentalBorder": {
@@ -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 ) );