@wordpress/block-library 9.33.2-next.36001005c.0 → 9.33.3

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 (173) hide show
  1. package/build/accordion/block.json +1 -1
  2. package/build/accordion/edit.js +11 -9
  3. package/build/accordion/edit.js.map +2 -2
  4. package/build/accordion-heading/block.json +1 -1
  5. package/build/accordion-item/block.json +1 -1
  6. package/build/accordion-panel/block.json +1 -1
  7. package/build/buttons/transforms.js +1 -0
  8. package/build/buttons/transforms.js.map +2 -2
  9. package/build/code/transforms.js +2 -0
  10. package/build/code/transforms.js.map +2 -2
  11. package/build/freeform/block.json +5 -1
  12. package/build/home-link/block.json +2 -1
  13. package/build/image/view.js +4 -1
  14. package/build/image/view.js.map +2 -2
  15. package/build/math/deprecated.js +54 -0
  16. package/build/math/deprecated.js.map +7 -0
  17. package/build/math/edit.js +1 -0
  18. package/build/math/edit.js.map +2 -2
  19. package/build/math/index.js +3 -1
  20. package/build/math/index.js.map +3 -3
  21. package/build/math/save.js +2 -3
  22. package/build/math/save.js.map +2 -2
  23. package/build/missing/block.json +3 -0
  24. package/build/navigation/edit/menu-inspector-controls.js +1 -1
  25. package/build/navigation/edit/menu-inspector-controls.js.map +2 -2
  26. package/build/navigation/menu-items-to-blocks.js +8 -3
  27. package/build/navigation/menu-items-to-blocks.js.map +2 -2
  28. package/build/navigation/view.js +2 -2
  29. package/build/navigation/view.js.map +2 -2
  30. package/build/navigation-link/edit.js +1 -1
  31. package/build/navigation-link/edit.js.map +2 -2
  32. package/build/navigation-link/shared/controls.js +16 -36
  33. package/build/navigation-link/shared/controls.js.map +2 -2
  34. package/build/navigation-link/shared/use-entity-binding.js +1 -1
  35. package/build/navigation-link/shared/use-entity-binding.js.map +2 -2
  36. package/build/navigation-submenu/edit.js +1 -1
  37. package/build/navigation-submenu/edit.js.map +2 -2
  38. package/build/post-date/block.json +1 -1
  39. package/build/post-date/edit.js +11 -5
  40. package/build/post-date/edit.js.map +3 -3
  41. package/build/post-date/variations.js +4 -7
  42. package/build/post-date/variations.js.map +2 -2
  43. package/build/post-template/edit.js +13 -1
  44. package/build/post-template/edit.js.map +2 -2
  45. package/build/query/index.js +11 -1
  46. package/build/query/index.js.map +2 -2
  47. package/build/query/variations.js +16 -11
  48. package/build/query/variations.js.map +2 -2
  49. package/build/search/view.js +4 -4
  50. package/build/search/view.js.map +2 -2
  51. package/build/terms-query/edit/inspector-controls/index.js +1 -1
  52. package/build/terms-query/edit/inspector-controls/index.js.map +2 -2
  53. package/build/terms-query/edit/inspector-controls/inherit-control.js +2 -4
  54. package/build/terms-query/edit/inspector-controls/inherit-control.js.map +2 -2
  55. package/build/utils/get-transformed-attributes.js +1 -13
  56. package/build/utils/get-transformed-attributes.js.map +2 -2
  57. package/build-module/accordion/block.json +1 -1
  58. package/build-module/accordion/edit.js +11 -9
  59. package/build-module/accordion/edit.js.map +2 -2
  60. package/build-module/accordion-heading/block.json +1 -1
  61. package/build-module/accordion-item/block.json +1 -1
  62. package/build-module/accordion-panel/block.json +1 -1
  63. package/build-module/buttons/transforms.js +1 -0
  64. package/build-module/buttons/transforms.js.map +2 -2
  65. package/build-module/code/transforms.js +2 -0
  66. package/build-module/code/transforms.js.map +2 -2
  67. package/build-module/freeform/block.json +5 -1
  68. package/build-module/home-link/block.json +2 -1
  69. package/build-module/image/view.js +4 -1
  70. package/build-module/image/view.js.map +2 -2
  71. package/build-module/math/deprecated.js +34 -0
  72. package/build-module/math/deprecated.js.map +7 -0
  73. package/build-module/math/edit.js +1 -0
  74. package/build-module/math/edit.js.map +2 -2
  75. package/build-module/math/index.js +3 -1
  76. package/build-module/math/index.js.map +2 -2
  77. package/build-module/math/save.js +2 -3
  78. package/build-module/math/save.js.map +2 -2
  79. package/build-module/missing/block.json +3 -0
  80. package/build-module/navigation/edit/menu-inspector-controls.js +1 -1
  81. package/build-module/navigation/edit/menu-inspector-controls.js.map +2 -2
  82. package/build-module/navigation/menu-items-to-blocks.js +8 -3
  83. package/build-module/navigation/menu-items-to-blocks.js.map +2 -2
  84. package/build-module/navigation/view.js +2 -2
  85. package/build-module/navigation/view.js.map +2 -2
  86. package/build-module/navigation-link/edit.js +1 -1
  87. package/build-module/navigation-link/edit.js.map +2 -2
  88. package/build-module/navigation-link/shared/controls.js +17 -37
  89. package/build-module/navigation-link/shared/controls.js.map +2 -2
  90. package/build-module/navigation-link/shared/use-entity-binding.js +1 -1
  91. package/build-module/navigation-link/shared/use-entity-binding.js.map +2 -2
  92. package/build-module/navigation-submenu/edit.js +1 -1
  93. package/build-module/navigation-submenu/edit.js.map +2 -2
  94. package/build-module/post-date/block.json +1 -1
  95. package/build-module/post-date/edit.js +11 -5
  96. package/build-module/post-date/edit.js.map +2 -2
  97. package/build-module/post-date/variations.js +4 -7
  98. package/build-module/post-date/variations.js.map +2 -2
  99. package/build-module/post-template/edit.js +13 -1
  100. package/build-module/post-template/edit.js.map +2 -2
  101. package/build-module/query/index.js +11 -1
  102. package/build-module/query/index.js.map +2 -2
  103. package/build-module/query/variations.js +16 -11
  104. package/build-module/query/variations.js.map +2 -2
  105. package/build-module/search/view.js +4 -4
  106. package/build-module/search/view.js.map +2 -2
  107. package/build-module/terms-query/edit/inspector-controls/index.js +1 -1
  108. package/build-module/terms-query/edit/inspector-controls/index.js.map +2 -2
  109. package/build-module/terms-query/edit/inspector-controls/inherit-control.js +2 -4
  110. package/build-module/terms-query/edit/inspector-controls/inherit-control.js.map +2 -2
  111. package/build-module/utils/get-transformed-attributes.js +1 -13
  112. package/build-module/utils/get-transformed-attributes.js.map +2 -2
  113. package/build-style/editor-rtl.css +7 -2
  114. package/build-style/editor.css +8 -2
  115. package/build-style/math/editor-rtl.css +49 -0
  116. package/build-style/math/editor.css +50 -0
  117. package/build-style/math/style-rtl.css +4 -0
  118. package/build-style/math/style.css +4 -0
  119. package/build-style/navigation-link/editor-rtl.css +1 -1
  120. package/build-style/navigation-link/editor.css +1 -1
  121. package/build-style/style-rtl.css +5 -0
  122. package/build-style/style.css +5 -0
  123. package/build-style/video/editor-rtl.css +1 -1
  124. package/build-style/video/editor.css +1 -1
  125. package/package.json +37 -37
  126. package/src/accordion/block.json +1 -1
  127. package/src/accordion/edit.js +16 -16
  128. package/src/accordion-heading/block.json +1 -1
  129. package/src/accordion-item/block.json +1 -1
  130. package/src/accordion-panel/block.json +1 -1
  131. package/src/archives/index.php +53 -1
  132. package/src/buttons/transforms.js +1 -0
  133. package/src/categories/index.php +25 -7
  134. package/src/code/transforms.js +2 -0
  135. package/src/editor.scss +1 -0
  136. package/src/freeform/block.json +5 -1
  137. package/src/home-link/block.json +2 -1
  138. package/src/image/index.php +9 -9
  139. package/src/image/view.js +11 -1
  140. package/src/math/deprecated.js +44 -0
  141. package/src/math/edit.js +1 -0
  142. package/src/math/editor.scss +7 -0
  143. package/src/math/index.js +2 -0
  144. package/src/math/save.js +6 -5
  145. package/src/math/style.scss +4 -0
  146. package/src/missing/block.json +3 -0
  147. package/src/navigation/edit/menu-inspector-controls.js +1 -1
  148. package/src/navigation/index.php +7 -7
  149. package/src/navigation/menu-items-to-blocks.js +12 -2
  150. package/src/navigation/test/menu-items-to-blocks.js +144 -0
  151. package/src/navigation/view.js +2 -2
  152. package/src/navigation-link/edit.js +1 -1
  153. package/src/navigation-link/editor.scss +1 -1
  154. package/src/navigation-link/shared/controls.js +18 -58
  155. package/src/navigation-link/shared/test/controls.js +9 -14
  156. package/src/navigation-link/shared/use-entity-binding.js +1 -1
  157. package/src/navigation-submenu/edit.js +1 -1
  158. package/src/post-date/block.json +1 -1
  159. package/src/post-date/edit.js +15 -10
  160. package/src/post-date/variations.js +2 -5
  161. package/src/post-template/edit.js +13 -1
  162. package/src/query/index.js +10 -0
  163. package/src/query/variations.js +17 -11
  164. package/src/query-pagination-next/index.php +1 -1
  165. package/src/query-pagination-previous/index.php +1 -1
  166. package/src/search/index.php +2 -2
  167. package/src/search/view.js +4 -4
  168. package/src/style.scss +1 -0
  169. package/src/term-template/index.php +8 -2
  170. package/src/terms-query/edit/inspector-controls/index.js +2 -2
  171. package/src/terms-query/edit/inspector-controls/inherit-control.js +1 -3
  172. package/src/utils/get-transformed-attributes.js +5 -22
  173. package/src/video/editor.scss +1 -1
@@ -2187,6 +2187,11 @@ ul {
2187
2187
  box-sizing: border-box;
2188
2188
  }
2189
2189
 
2190
+ .wp-block-math {
2191
+ overflow-x: auto;
2192
+ overflow-y: hidden;
2193
+ }
2194
+
2190
2195
  .wp-block-media-text {
2191
2196
  direction: ltr;
2192
2197
  display: grid;
@@ -2207,6 +2207,11 @@ ul {
2207
2207
  box-sizing: border-box;
2208
2208
  }
2209
2209
 
2210
+ .wp-block-math {
2211
+ overflow-x: auto;
2212
+ overflow-y: hidden;
2213
+ }
2214
+
2210
2215
  .wp-block-media-text {
2211
2216
  /*!rtl:begin:ignore*/
2212
2217
  direction: ltr;
@@ -79,7 +79,7 @@
79
79
  color: #757575;
80
80
  text-transform: uppercase;
81
81
  font-size: 11px;
82
- font-weight: 499;
82
+ font-weight: 500;
83
83
  display: block;
84
84
  }
85
85
 
@@ -79,7 +79,7 @@
79
79
  color: #757575;
80
80
  text-transform: uppercase;
81
81
  font-size: 11px;
82
- font-weight: 499;
82
+ font-weight: 500;
83
83
  display: block;
84
84
  }
85
85
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wordpress/block-library",
3
- "version": "9.33.2-next.36001005c.0",
3
+ "version": "9.33.3",
4
4
  "description": "Block library for the WordPress editor.",
5
5
  "author": "The WordPress Contributors",
6
6
  "license": "GPL-2.0-or-later",
@@ -81,41 +81,41 @@
81
81
  "{src,build,build-module}/*/init.js"
82
82
  ],
83
83
  "dependencies": {
84
- "@wordpress/a11y": "^4.33.1-next.36001005c.0",
85
- "@wordpress/api-fetch": "^7.33.1-next.36001005c.0",
86
- "@wordpress/autop": "^4.33.1-next.36001005c.0",
87
- "@wordpress/base-styles": "^6.10.1-next.36001005c.0",
88
- "@wordpress/blob": "^4.33.1-next.36001005c.0",
89
- "@wordpress/block-editor": "^15.6.1-next.36001005c.0",
90
- "@wordpress/blocks": "^15.6.1-next.36001005c.0",
91
- "@wordpress/components": "^30.7.1-next.36001005c.0",
92
- "@wordpress/compose": "^7.33.1-next.36001005c.0",
93
- "@wordpress/core-data": "^7.33.1-next.36001005c.0",
94
- "@wordpress/data": "^10.33.1-next.36001005c.0",
95
- "@wordpress/date": "^5.33.1-next.36001005c.0",
96
- "@wordpress/deprecated": "^4.33.1-next.36001005c.0",
97
- "@wordpress/dom": "^4.33.1-next.36001005c.0",
98
- "@wordpress/element": "^6.33.1-next.36001005c.0",
99
- "@wordpress/escape-html": "^3.33.1-next.36001005c.0",
100
- "@wordpress/hooks": "^4.33.1-next.36001005c.0",
101
- "@wordpress/html-entities": "^4.33.1-next.36001005c.0",
102
- "@wordpress/i18n": "^6.6.1-next.36001005c.0",
103
- "@wordpress/icons": "^11.0.1-next.36001005c.0",
104
- "@wordpress/interactivity": "^6.33.1-next.36001005c.0",
105
- "@wordpress/interactivity-router": "^2.33.1-next.36001005c.0",
106
- "@wordpress/keyboard-shortcuts": "^5.33.1-next.36001005c.0",
107
- "@wordpress/keycodes": "^4.33.1-next.36001005c.0",
108
- "@wordpress/latex-to-mathml": "^1.1.1-next.36001005c.0",
109
- "@wordpress/notices": "^5.33.1-next.36001005c.0",
110
- "@wordpress/patterns": "^2.33.1-next.36001005c.0",
111
- "@wordpress/primitives": "^4.33.1-next.36001005c.0",
112
- "@wordpress/private-apis": "^1.33.1-next.36001005c.0",
113
- "@wordpress/reusable-blocks": "^5.33.1-next.36001005c.0",
114
- "@wordpress/rich-text": "^7.33.1-next.36001005c.0",
115
- "@wordpress/server-side-render": "^6.9.1-next.36001005c.0",
116
- "@wordpress/url": "^4.33.1-next.36001005c.0",
117
- "@wordpress/viewport": "^6.33.1-next.36001005c.0",
118
- "@wordpress/wordcount": "^4.33.1-next.36001005c.0",
84
+ "@wordpress/a11y": "^4.33.1",
85
+ "@wordpress/api-fetch": "^7.33.1",
86
+ "@wordpress/autop": "^4.33.1",
87
+ "@wordpress/base-styles": "^6.9.1",
88
+ "@wordpress/blob": "^4.33.1",
89
+ "@wordpress/block-editor": "^15.6.2",
90
+ "@wordpress/blocks": "^15.6.1",
91
+ "@wordpress/components": "^30.6.1",
92
+ "@wordpress/compose": "^7.33.1",
93
+ "@wordpress/core-data": "^7.33.2",
94
+ "@wordpress/data": "^10.33.1",
95
+ "@wordpress/date": "^5.33.1",
96
+ "@wordpress/deprecated": "^4.33.1",
97
+ "@wordpress/dom": "^4.33.1",
98
+ "@wordpress/element": "^6.33.1",
99
+ "@wordpress/escape-html": "^3.33.1",
100
+ "@wordpress/hooks": "^4.33.1",
101
+ "@wordpress/html-entities": "^4.33.1",
102
+ "@wordpress/i18n": "^6.6.1",
103
+ "@wordpress/icons": "^11.0.1",
104
+ "@wordpress/interactivity": "^6.33.1",
105
+ "@wordpress/interactivity-router": "^2.33.1",
106
+ "@wordpress/keyboard-shortcuts": "^5.33.1",
107
+ "@wordpress/keycodes": "^4.33.1",
108
+ "@wordpress/latex-to-mathml": "^1.1.1",
109
+ "@wordpress/notices": "^5.33.1",
110
+ "@wordpress/patterns": "^2.33.2",
111
+ "@wordpress/primitives": "^4.33.1",
112
+ "@wordpress/private-apis": "^1.33.1",
113
+ "@wordpress/reusable-blocks": "^5.33.2",
114
+ "@wordpress/rich-text": "^7.33.1",
115
+ "@wordpress/server-side-render": "^6.9.1",
116
+ "@wordpress/url": "^4.33.1",
117
+ "@wordpress/viewport": "^6.33.1",
118
+ "@wordpress/wordcount": "^4.33.1",
119
119
  "change-case": "^4.1.2",
120
120
  "clsx": "^2.1.1",
121
121
  "colord": "^2.7.0",
@@ -133,5 +133,5 @@
133
133
  "publishConfig": {
134
134
  "access": "public"
135
135
  },
136
- "gitHead": "b73a8a22e779c59efb8f911e32b681652f237d60"
136
+ "gitHead": "45005cc254bab59182927e35a68cd22f6320634d"
137
137
  }
@@ -4,7 +4,7 @@
4
4
  "name": "core/accordion",
5
5
  "title": "Accordion",
6
6
  "category": "design",
7
- "description": "Displays a group of accordion headings and associated expandable content.",
7
+ "description": "Displays a foldable layout that groups content in collapsible sections.",
8
8
  "example": {},
9
9
  "supports": {
10
10
  "anchor": true,
@@ -102,22 +102,22 @@ export default function Edit( {
102
102
  return (
103
103
  <>
104
104
  { isSingleSelected && ! isContentOnlyMode && (
105
- <BlockControls>
106
- <ToolbarGroup>
107
- <HeadingLevelDropdown
108
- value={ headingLevel }
109
- options={ levelOptions }
110
- onChange={ updateHeadingLevel }
111
- />
112
- </ToolbarGroup>
113
- </BlockControls>
114
- ) }
115
- { isSingleSelected && (
116
- <BlockControls group="other">
117
- <ToolbarButton onClick={ addAccordionItemBlock }>
118
- { __( 'Add' ) }
119
- </ToolbarButton>
120
- </BlockControls>
105
+ <>
106
+ <BlockControls>
107
+ <ToolbarGroup>
108
+ <HeadingLevelDropdown
109
+ value={ headingLevel }
110
+ options={ levelOptions }
111
+ onChange={ updateHeadingLevel }
112
+ />
113
+ </ToolbarGroup>
114
+ </BlockControls>
115
+ <BlockControls group="other">
116
+ <ToolbarButton onClick={ addAccordionItemBlock }>
117
+ { __( 'Add' ) }
118
+ </ToolbarButton>
119
+ </BlockControls>
120
+ </>
121
121
  ) }
122
122
  <InspectorControls key="setting">
123
123
  <ToolsPanel
@@ -4,7 +4,7 @@
4
4
  "name": "core/accordion-heading",
5
5
  "title": "Accordion Heading",
6
6
  "category": "design",
7
- "description": "Displays an accordion heading.",
7
+ "description": "Displays a heading that toggles the accordion panel.",
8
8
  "parent": [ "core/accordion-item" ],
9
9
  "usesContext": [
10
10
  "core/accordion-icon-position",
@@ -4,7 +4,7 @@
4
4
  "name": "core/accordion-item",
5
5
  "title": "Accordion Item",
6
6
  "category": "design",
7
- "description": "Displays a section of content in an accordion, including a heading and expandable content.",
7
+ "description": "Wraps the heading and panel in one unit.",
8
8
  "parent": [ "core/accordion" ],
9
9
  "allowedBlocks": [ "core/accordion-heading", "core/accordion-panel" ],
10
10
  "supports": {
@@ -4,7 +4,7 @@
4
4
  "name": "core/accordion-panel",
5
5
  "title": "Accordion Panel",
6
6
  "category": "design",
7
- "description": "Displays an accordion panel.",
7
+ "description": "Contains the hidden or revealed content beneath the heading.",
8
8
  "parent": [ "core/accordion-item" ],
9
9
  "supports": {
10
10
  "html": false,
@@ -66,9 +66,12 @@ function render_block_core_archives( $attributes ) {
66
66
  $show_label = empty( $attributes['showLabel'] ) ? ' screen-reader-text' : '';
67
67
 
68
68
  $block_content = '<label for="' . $dropdown_id . '" class="wp-block-archives__label' . $show_label . '">' . esc_html( $title ) . '</label>
69
- <select id="' . $dropdown_id . '" name="archive-dropdown" onchange="document.location.href=this.options[this.selectedIndex].value;">
69
+ <select id="' . esc_attr( $dropdown_id ) . '" name="archive-dropdown">
70
70
  <option value="">' . esc_html( $label ) . '</option>' . $archives . '</select>';
71
71
 
72
+ // Inject the dropdown script immediately after the select dropdown.
73
+ $block_content .= block_core_archives_build_dropdown_script( $dropdown_id );
74
+
72
75
  return sprintf(
73
76
  '<div %1$s>%2$s</div>',
74
77
  $wrapper_attributes,
@@ -106,6 +109,55 @@ function render_block_core_archives( $attributes ) {
106
109
  );
107
110
  }
108
111
 
112
+ /**
113
+ * Generates the inline script for an archives dropdown field.
114
+ *
115
+ * @since 6.9.0
116
+ *
117
+ * @param string $dropdown_id ID of the dropdown field.
118
+ *
119
+ * @return string Returns the dropdown onChange redirection script.
120
+ */
121
+ function block_core_archives_build_dropdown_script( $dropdown_id ) {
122
+ ob_start();
123
+
124
+ $exports = array( $dropdown_id, home_url() );
125
+ ?>
126
+ <script>
127
+ ( ( [ dropdownId, homeUrl ] ) => {
128
+ const dropdown = document.getElementById( dropdownId );
129
+ function onSelectChange() {
130
+ setTimeout( () => {
131
+ if ( 'escape' === dropdown.dataset.lastkey ) {
132
+ return;
133
+ }
134
+ if ( dropdown.value ) {
135
+ location.href = dropdown.value;
136
+ }
137
+ }, 250 );
138
+ }
139
+ function onKeyUp( event ) {
140
+ if ( 'Escape' === event.key ) {
141
+ dropdown.dataset.lastkey = 'escape';
142
+ } else {
143
+ delete dropdown.dataset.lastkey;
144
+ }
145
+ }
146
+ function onClick() {
147
+ delete dropdown.dataset.lastkey;
148
+ }
149
+ dropdown.addEventListener( 'keyup', onKeyUp );
150
+ dropdown.addEventListener( 'click', onClick );
151
+ dropdown.addEventListener( 'change', onSelectChange );
152
+ } )( <?php echo wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?> );
153
+ </script>
154
+ <?php
155
+ return wp_get_inline_script_tag(
156
+ trim( str_replace( array( '<script>', '</script>' ), '', ob_get_clean() ) ) .
157
+ "\n//# sourceURL=" . rawurlencode( __FUNCTION__ )
158
+ );
159
+ }
160
+
109
161
  /**
110
162
  * Register archives block.
111
163
  *
@@ -47,6 +47,7 @@ const transforms = {
47
47
  const url = link?.getAttribute( 'href' );
48
48
  // Create singular button in the buttons block.
49
49
  return createBlock( 'core/button', {
50
+ ...attributes,
50
51
  ...getTransformedAttributes(
51
52
  attributes,
52
53
  'core/button',
@@ -104,14 +104,32 @@ function build_dropdown_script_block_core_categories( $dropdown_id ) {
104
104
  ?>
105
105
  <script>
106
106
  ( ( [ dropdownId, homeUrl ] ) => {
107
- document.getElementById( dropdownId ).addEventListener( 'change', ( event ) => {
108
- const dropdown = /** @type {HTMLSelectElement} */ ( event.target );
109
- if ( dropdown.value && dropdown.value !== '-1' ) {
110
- const url = new URL( homeUrl );
111
- url.searchParams.set( dropdown.name, dropdown.value );
112
- location.href = url.href;
107
+ const dropdown = document.getElementById( dropdownId );
108
+ function onSelectChange() {
109
+ setTimeout( () => {
110
+ if ( 'escape' === dropdown.dataset.lastkey ) {
111
+ return;
112
+ }
113
+ if ( dropdown.value && dropdown instanceof HTMLSelectElement ) {
114
+ const url = new URL( homeUrl );
115
+ url.searchParams.set( dropdown.name, dropdown.value );
116
+ location.href = url.href;
117
+ }
118
+ }, 250 );
119
+ }
120
+ function onKeyUp( event ) {
121
+ if ( 'Escape' === event.key ) {
122
+ dropdown.dataset.lastkey = 'escape';
123
+ } else {
124
+ delete dropdown.dataset.lastkey;
113
125
  }
114
- } );
126
+ }
127
+ function onClick() {
128
+ delete dropdown.dataset.lastkey;
129
+ }
130
+ dropdown.addEventListener( 'keyup', onKeyUp );
131
+ dropdown.addEventListener( 'click', onClick );
132
+ dropdown.addEventListener( 'change', onSelectChange );
115
133
  } )( <?php echo wp_json_encode( $exports, JSON_HEX_TAG | JSON_UNESCAPED_SLASHES ); ?> );
116
134
  </script>
117
135
  <?php
@@ -22,6 +22,7 @@ const transforms = {
22
22
  transform: ( attributes ) => {
23
23
  const { content } = attributes;
24
24
  return createBlock( 'core/code', {
25
+ ...attributes,
25
26
  ...getTransformedAttributes( attributes, 'core/code' ),
26
27
  content,
27
28
  } );
@@ -33,6 +34,7 @@ const transforms = {
33
34
  transform: ( attributes ) => {
34
35
  const { content: text } = attributes;
35
36
  return createBlock( 'core/code', {
37
+ ...attributes,
36
38
  ...getTransformedAttributes( attributes, 'core/code' ),
37
39
  // The HTML is plain text (with plain line breaks), so
38
40
  // convert it to rich text.
package/src/editor.scss CHANGED
@@ -24,6 +24,7 @@
24
24
  @use "./html/editor.scss" as *;
25
25
  @use "./image/editor.scss" as *;
26
26
  @use "./latest-posts/editor.scss" as *;
27
+ @use "./math/editor.scss" as *;
27
28
  @use "./media-text/editor.scss" as *;
28
29
  @use "./more/editor.scss" as *;
29
30
  @use "./navigation/editor.scss" as *;
@@ -13,9 +13,13 @@
13
13
  }
14
14
  },
15
15
  "supports": {
16
+ "html": false,
16
17
  "className": false,
17
18
  "customClassName": false,
18
- "reusable": false
19
+ "lock": false,
20
+ "reusable": false,
21
+ "renaming": false,
22
+ "blockVisibility": false
19
23
  },
20
24
  "editorStyle": "wp-block-freeform-editor"
21
25
  }
@@ -9,7 +9,8 @@
9
9
  "textdomain": "default",
10
10
  "attributes": {
11
11
  "label": {
12
- "type": "string"
12
+ "type": "string",
13
+ "role": "content"
13
14
  }
14
15
  },
15
16
  "usesContext": [
@@ -250,12 +250,12 @@ function block_core_image_render_lightbox( $block_content, $block ) {
250
250
  // Image.
251
251
  $processor->next_tag( 'img' );
252
252
  $processor->set_attribute( 'data-wp-init', 'callbacks.setButtonStyles' );
253
- $processor->set_attribute( 'data-wp-on-async--load', 'callbacks.setButtonStyles' );
254
- $processor->set_attribute( 'data-wp-on-async-window--resize', 'callbacks.setButtonStyles' );
253
+ $processor->set_attribute( 'data-wp-on--load', 'callbacks.setButtonStyles' );
254
+ $processor->set_attribute( 'data-wp-on-window--resize', 'callbacks.setButtonStyles' );
255
255
  // Sets an event callback on the `img` because the `figure` element can also
256
256
  // contain a caption, and we don't want to trigger the lightbox when the
257
257
  // caption is clicked.
258
- $processor->set_attribute( 'data-wp-on-async--click', 'actions.showLightbox' );
258
+ $processor->set_attribute( 'data-wp-on--click', 'actions.showLightbox' );
259
259
  $processor->set_attribute( 'data-wp-class--hide', 'state.isContentHidden' );
260
260
  $processor->set_attribute( 'data-wp-class--show', 'state.isContentVisible' );
261
261
 
@@ -273,7 +273,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
273
273
  aria-haspopup="dialog"
274
274
  aria-label="' . esc_attr( $aria_label ) . '"
275
275
  data-wp-init="callbacks.initTriggerButton"
276
- data-wp-on-async--click="actions.showLightbox"
276
+ data-wp-on--click="actions.showLightbox"
277
277
  data-wp-style--right="state.imageButtonRight"
278
278
  data-wp-style--top="state.imageButtonTop"
279
279
  >
@@ -324,12 +324,12 @@ function block_core_image_print_lightbox_overlay() {
324
324
  data-wp-class--show-closing-animation="state.overlayOpened"
325
325
  data-wp-watch="callbacks.setOverlayFocus"
326
326
  data-wp-on--keydown="actions.handleKeydown"
327
- data-wp-on-async--touchstart="actions.handleTouchStart"
327
+ data-wp-on--touchstart="actions.handleTouchStart"
328
328
  data-wp-on--touchmove="actions.handleTouchMove"
329
- data-wp-on-async--touchend="actions.handleTouchEnd"
330
- data-wp-on-async--click="actions.hideLightbox"
331
- data-wp-on-async-window--resize="callbacks.setOverlayStyles"
332
- data-wp-on-async-window--scroll="actions.handleScroll"
329
+ data-wp-on--touchend="actions.handleTouchEnd"
330
+ data-wp-on--click="actions.hideLightbox"
331
+ data-wp-on-window--resize="callbacks.setOverlayStyles"
332
+ data-wp-on-window--scroll="actions.handleScroll"
333
333
  data-wp-bind--style="state.overlayStyles"
334
334
  tabindex="-1"
335
335
  >
package/src/image/view.js CHANGED
@@ -356,9 +356,19 @@ const { state, actions, callbacks } = store(
356
356
  `;
357
357
  },
358
358
  setButtonStyles() {
359
- const { imageId } = getContext();
360
359
  const { ref } = getElement();
361
360
 
361
+ // This guard prevents errors in images with the `srcset`
362
+ // attribute, which can dispatch `load` events even after DOM
363
+ // removal. Preact doesn't automatically clean up `load` event
364
+ // listeners on unmounted `img` elements (see
365
+ // https://github.com/preactjs/preact/issues/3141).
366
+ if ( ! ref ) {
367
+ return;
368
+ }
369
+
370
+ const { imageId } = getContext();
371
+
362
372
  state.metadata[ imageId ].imageRef = ref;
363
373
  state.metadata[ imageId ].currentSrc = ref.currentSrc;
364
374
 
@@ -0,0 +1,44 @@
1
+ /**
2
+ * WordPress dependencies
3
+ */
4
+ import { useBlockProps } from '@wordpress/block-editor';
5
+
6
+ // v1: Add a wrapper div around the math element.
7
+ const v1 = {
8
+ attributes: {
9
+ latex: {
10
+ type: 'string',
11
+ role: 'content',
12
+ },
13
+ mathML: {
14
+ type: 'string',
15
+ source: 'html',
16
+ selector: 'math',
17
+ },
18
+ },
19
+ save( { attributes } ) {
20
+ const { latex, mathML } = attributes;
21
+
22
+ if ( ! latex ) {
23
+ return null;
24
+ }
25
+
26
+ return (
27
+ <math
28
+ { ...useBlockProps.save() }
29
+ display="block"
30
+ dangerouslySetInnerHTML={ { __html: mathML } }
31
+ />
32
+ );
33
+ },
34
+ };
35
+
36
+ /**
37
+ * New deprecations need to be placed first
38
+ * for them to have higher priority.
39
+ *
40
+ * Old deprecations may need to be updated as well.
41
+ *
42
+ * See block-deprecation.md
43
+ */
44
+ export default [ v1 ];
package/src/math/edit.js CHANGED
@@ -82,6 +82,7 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
82
82
  label={ __( 'LaTeX math syntax' ) }
83
83
  hideLabelFromVision
84
84
  value={ latex }
85
+ className="wp-block-math__textarea-control"
85
86
  onChange={ ( newLatex ) => {
86
87
  if ( ! latexToMathML ) {
87
88
  setAttributes( { latex: newLatex } );
@@ -0,0 +1,7 @@
1
+ @use "@wordpress/base-styles/variables" as *;
2
+
3
+ .wp-block-math__textarea-control textarea {
4
+ font-family: $font-family-mono;
5
+ /*rtl:ignore*/
6
+ direction: ltr;
7
+ }
package/src/math/index.js CHANGED
@@ -10,6 +10,7 @@ import initBlock from '../utils/init-block';
10
10
  import edit from './edit';
11
11
  import metadata from './block.json';
12
12
  import save from './save';
13
+ import deprecated from './deprecated';
13
14
 
14
15
  const { name } = metadata;
15
16
 
@@ -26,6 +27,7 @@ export const settings = {
26
27
  },
27
28
  edit,
28
29
  save,
30
+ deprecated,
29
31
  };
30
32
 
31
33
  export const init = () => initBlock( { name, metadata, settings } );
package/src/math/save.js CHANGED
@@ -11,10 +11,11 @@ export default function save( { attributes } ) {
11
11
  }
12
12
 
13
13
  return (
14
- <math
15
- { ...useBlockProps.save() }
16
- display="block"
17
- dangerouslySetInnerHTML={ { __html: mathML } }
18
- />
14
+ <div { ...useBlockProps.save() }>
15
+ <math
16
+ display="block"
17
+ dangerouslySetInnerHTML={ { __html: mathML } }
18
+ />
19
+ </div>
19
20
  );
20
21
  }
@@ -0,0 +1,4 @@
1
+ .wp-block-math {
2
+ overflow-x: auto;
3
+ overflow-y: hidden;
4
+ }
@@ -23,7 +23,10 @@
23
23
  "customClassName": false,
24
24
  "inserter": false,
25
25
  "html": false,
26
+ "lock": false,
26
27
  "reusable": false,
28
+ "renaming": false,
29
+ "blockVisibility": false,
27
30
  "interactivity": {
28
31
  "clientNavigation": true
29
32
  }
@@ -124,7 +124,7 @@ function AdditionalBlockContent( { block, insertedBlock, setInsertedBlock } ) {
124
124
  if ( isEntityLink ) {
125
125
  createBinding( updatedAttributes );
126
126
  } else {
127
- clearBinding();
127
+ clearBinding( updatedAttributes );
128
128
  }
129
129
 
130
130
  setInsertedBlock( null );
@@ -497,7 +497,7 @@ class WP_Navigation_Block_Renderer {
497
497
  $close_button_directives = '';
498
498
  if ( $is_interactive ) {
499
499
  $open_button_directives = '
500
- data-wp-on-async--click="actions.openMenuOnClick"
500
+ data-wp-on--click="actions.openMenuOnClick"
501
501
  data-wp-on--keydown="actions.handleMenuKeydown"
502
502
  ';
503
503
  $responsive_container_directives = '
@@ -505,7 +505,7 @@ class WP_Navigation_Block_Renderer {
505
505
  data-wp-class--is-menu-open="state.isMenuOpen"
506
506
  data-wp-watch="callbacks.initMenu"
507
507
  data-wp-on--keydown="actions.handleMenuKeydown"
508
- data-wp-on-async--focusout="actions.handleMenuFocusout"
508
+ data-wp-on--focusout="actions.handleMenuFocusout"
509
509
  tabindex="-1"
510
510
  ';
511
511
  $responsive_dialog_directives = '
@@ -514,7 +514,7 @@ class WP_Navigation_Block_Renderer {
514
514
  data-wp-bind--role="state.roleAttribute"
515
515
  ';
516
516
  $close_button_directives = '
517
- data-wp-on-async--click="actions.closeMenuOnClick"
517
+ data-wp-on--click="actions.closeMenuOnClick"
518
518
  ';
519
519
  $responsive_container_content_directives = '
520
520
  data-wp-watch="callbacks.focusFirstElement"
@@ -830,8 +830,8 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
830
830
  $tags->set_attribute( 'tabindex', '-1' );
831
831
 
832
832
  if ( ! isset( $block_attributes['openSubmenusOnClick'] ) || false === $block_attributes['openSubmenusOnClick'] ) {
833
- $tags->set_attribute( 'data-wp-on-async--mouseenter', 'actions.openMenuOnHover' );
834
- $tags->set_attribute( 'data-wp-on-async--mouseleave', 'actions.closeMenuOnHover' );
833
+ $tags->set_attribute( 'data-wp-on--mouseenter', 'actions.openMenuOnHover' );
834
+ $tags->set_attribute( 'data-wp-on--mouseleave', 'actions.closeMenuOnHover' );
835
835
  }
836
836
 
837
837
  // Add directives to the toggle submenu button.
@@ -841,7 +841,7 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
841
841
  'class_name' => 'wp-block-navigation-submenu__toggle',
842
842
  )
843
843
  ) ) {
844
- $tags->set_attribute( 'data-wp-on-async--click', 'actions.toggleMenuOnClick' );
844
+ $tags->set_attribute( 'data-wp-on--click', 'actions.toggleMenuOnClick' );
845
845
  $tags->set_attribute( 'data-wp-bind--aria-expanded', 'state.isMenuOpen' );
846
846
  // The `aria-expanded` attribute for SSR is already added in the submenu block.
847
847
  }
@@ -852,7 +852,7 @@ function block_core_navigation_add_directives_to_submenu( $tags, $block_attribut
852
852
  'class_name' => 'wp-block-navigation__submenu-container',
853
853
  )
854
854
  ) ) {
855
- $tags->set_attribute( 'data-wp-on-async--focus', 'actions.openMenuOnFocus' );
855
+ $tags->set_attribute( 'data-wp-on--focus', 'actions.openMenuOnFocus' );
856
856
  }
857
857
 
858
858
  // Iterate through subitems if exist.