@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.
- package/build/accordion/block.json +1 -1
- package/build/accordion/edit.js +11 -9
- package/build/accordion/edit.js.map +2 -2
- package/build/accordion-heading/block.json +1 -1
- package/build/accordion-item/block.json +1 -1
- package/build/accordion-panel/block.json +1 -1
- package/build/buttons/transforms.js +1 -0
- package/build/buttons/transforms.js.map +2 -2
- package/build/code/transforms.js +2 -0
- package/build/code/transforms.js.map +2 -2
- package/build/freeform/block.json +5 -1
- package/build/home-link/block.json +2 -1
- package/build/image/view.js +4 -1
- package/build/image/view.js.map +2 -2
- package/build/math/deprecated.js +54 -0
- package/build/math/deprecated.js.map +7 -0
- package/build/math/edit.js +1 -0
- package/build/math/edit.js.map +2 -2
- package/build/math/index.js +3 -1
- package/build/math/index.js.map +3 -3
- package/build/math/save.js +2 -3
- package/build/math/save.js.map +2 -2
- package/build/missing/block.json +3 -0
- package/build/navigation/edit/menu-inspector-controls.js +1 -1
- package/build/navigation/edit/menu-inspector-controls.js.map +2 -2
- package/build/navigation/menu-items-to-blocks.js +8 -3
- package/build/navigation/menu-items-to-blocks.js.map +2 -2
- package/build/navigation/view.js +2 -2
- package/build/navigation/view.js.map +2 -2
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +2 -2
- package/build/navigation-link/shared/controls.js +16 -36
- package/build/navigation-link/shared/controls.js.map +2 -2
- package/build/navigation-link/shared/use-entity-binding.js +1 -1
- package/build/navigation-link/shared/use-entity-binding.js.map +2 -2
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +2 -2
- package/build/post-date/block.json +1 -1
- package/build/post-date/edit.js +11 -5
- package/build/post-date/edit.js.map +3 -3
- package/build/post-date/variations.js +4 -7
- package/build/post-date/variations.js.map +2 -2
- package/build/post-template/edit.js +13 -1
- package/build/post-template/edit.js.map +2 -2
- package/build/query/index.js +11 -1
- package/build/query/index.js.map +2 -2
- package/build/query/variations.js +16 -11
- package/build/query/variations.js.map +2 -2
- package/build/search/view.js +4 -4
- package/build/search/view.js.map +2 -2
- package/build/terms-query/edit/inspector-controls/index.js +1 -1
- package/build/terms-query/edit/inspector-controls/index.js.map +2 -2
- package/build/terms-query/edit/inspector-controls/inherit-control.js +2 -4
- package/build/terms-query/edit/inspector-controls/inherit-control.js.map +2 -2
- package/build/utils/get-transformed-attributes.js +1 -13
- package/build/utils/get-transformed-attributes.js.map +2 -2
- package/build-module/accordion/block.json +1 -1
- package/build-module/accordion/edit.js +11 -9
- package/build-module/accordion/edit.js.map +2 -2
- package/build-module/accordion-heading/block.json +1 -1
- package/build-module/accordion-item/block.json +1 -1
- package/build-module/accordion-panel/block.json +1 -1
- package/build-module/buttons/transforms.js +1 -0
- package/build-module/buttons/transforms.js.map +2 -2
- package/build-module/code/transforms.js +2 -0
- package/build-module/code/transforms.js.map +2 -2
- package/build-module/freeform/block.json +5 -1
- package/build-module/home-link/block.json +2 -1
- package/build-module/image/view.js +4 -1
- package/build-module/image/view.js.map +2 -2
- package/build-module/math/deprecated.js +34 -0
- package/build-module/math/deprecated.js.map +7 -0
- package/build-module/math/edit.js +1 -0
- package/build-module/math/edit.js.map +2 -2
- package/build-module/math/index.js +3 -1
- package/build-module/math/index.js.map +2 -2
- package/build-module/math/save.js +2 -3
- package/build-module/math/save.js.map +2 -2
- package/build-module/missing/block.json +3 -0
- package/build-module/navigation/edit/menu-inspector-controls.js +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js.map +2 -2
- package/build-module/navigation/menu-items-to-blocks.js +8 -3
- package/build-module/navigation/menu-items-to-blocks.js.map +2 -2
- package/build-module/navigation/view.js +2 -2
- package/build-module/navigation/view.js.map +2 -2
- package/build-module/navigation-link/edit.js +1 -1
- package/build-module/navigation-link/edit.js.map +2 -2
- package/build-module/navigation-link/shared/controls.js +17 -37
- package/build-module/navigation-link/shared/controls.js.map +2 -2
- package/build-module/navigation-link/shared/use-entity-binding.js +1 -1
- package/build-module/navigation-link/shared/use-entity-binding.js.map +2 -2
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +2 -2
- package/build-module/post-date/block.json +1 -1
- package/build-module/post-date/edit.js +11 -5
- package/build-module/post-date/edit.js.map +2 -2
- package/build-module/post-date/variations.js +4 -7
- package/build-module/post-date/variations.js.map +2 -2
- package/build-module/post-template/edit.js +13 -1
- package/build-module/post-template/edit.js.map +2 -2
- package/build-module/query/index.js +11 -1
- package/build-module/query/index.js.map +2 -2
- package/build-module/query/variations.js +16 -11
- package/build-module/query/variations.js.map +2 -2
- package/build-module/search/view.js +4 -4
- package/build-module/search/view.js.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/index.js +1 -1
- package/build-module/terms-query/edit/inspector-controls/index.js.map +2 -2
- package/build-module/terms-query/edit/inspector-controls/inherit-control.js +2 -4
- package/build-module/terms-query/edit/inspector-controls/inherit-control.js.map +2 -2
- package/build-module/utils/get-transformed-attributes.js +1 -13
- package/build-module/utils/get-transformed-attributes.js.map +2 -2
- package/build-style/editor-rtl.css +7 -2
- package/build-style/editor.css +8 -2
- package/build-style/math/editor-rtl.css +49 -0
- package/build-style/math/editor.css +50 -0
- package/build-style/math/style-rtl.css +4 -0
- package/build-style/math/style.css +4 -0
- package/build-style/navigation-link/editor-rtl.css +1 -1
- package/build-style/navigation-link/editor.css +1 -1
- package/build-style/style-rtl.css +5 -0
- package/build-style/style.css +5 -0
- package/build-style/video/editor-rtl.css +1 -1
- package/build-style/video/editor.css +1 -1
- package/package.json +37 -37
- package/src/accordion/block.json +1 -1
- package/src/accordion/edit.js +16 -16
- package/src/accordion-heading/block.json +1 -1
- package/src/accordion-item/block.json +1 -1
- package/src/accordion-panel/block.json +1 -1
- package/src/archives/index.php +53 -1
- package/src/buttons/transforms.js +1 -0
- package/src/categories/index.php +25 -7
- package/src/code/transforms.js +2 -0
- package/src/editor.scss +1 -0
- package/src/freeform/block.json +5 -1
- package/src/home-link/block.json +2 -1
- package/src/image/index.php +9 -9
- package/src/image/view.js +11 -1
- package/src/math/deprecated.js +44 -0
- package/src/math/edit.js +1 -0
- package/src/math/editor.scss +7 -0
- package/src/math/index.js +2 -0
- package/src/math/save.js +6 -5
- package/src/math/style.scss +4 -0
- package/src/missing/block.json +3 -0
- package/src/navigation/edit/menu-inspector-controls.js +1 -1
- package/src/navigation/index.php +7 -7
- package/src/navigation/menu-items-to-blocks.js +12 -2
- package/src/navigation/test/menu-items-to-blocks.js +144 -0
- package/src/navigation/view.js +2 -2
- package/src/navigation-link/edit.js +1 -1
- package/src/navigation-link/editor.scss +1 -1
- package/src/navigation-link/shared/controls.js +18 -58
- package/src/navigation-link/shared/test/controls.js +9 -14
- package/src/navigation-link/shared/use-entity-binding.js +1 -1
- package/src/navigation-submenu/edit.js +1 -1
- package/src/post-date/block.json +1 -1
- package/src/post-date/edit.js +15 -10
- package/src/post-date/variations.js +2 -5
- package/src/post-template/edit.js +13 -1
- package/src/query/index.js +10 -0
- package/src/query/variations.js +17 -11
- package/src/query-pagination-next/index.php +1 -1
- package/src/query-pagination-previous/index.php +1 -1
- package/src/search/index.php +2 -2
- package/src/search/view.js +4 -4
- package/src/style.scss +1 -0
- package/src/term-template/index.php +8 -2
- package/src/terms-query/edit/inspector-controls/index.js +2 -2
- package/src/terms-query/edit/inspector-controls/inherit-control.js +1 -3
- package/src/utils/get-transformed-attributes.js +5 -22
- package/src/video/editor.scss +1 -1
package/build-style/style.css
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.33.
|
|
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
|
|
85
|
-
"@wordpress/api-fetch": "^7.33.1
|
|
86
|
-
"@wordpress/autop": "^4.33.1
|
|
87
|
-
"@wordpress/base-styles": "^6.
|
|
88
|
-
"@wordpress/blob": "^4.33.1
|
|
89
|
-
"@wordpress/block-editor": "^15.6.
|
|
90
|
-
"@wordpress/blocks": "^15.6.1
|
|
91
|
-
"@wordpress/components": "^30.
|
|
92
|
-
"@wordpress/compose": "^7.33.1
|
|
93
|
-
"@wordpress/core-data": "^7.33.
|
|
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.
|
|
111
|
-
"@wordpress/primitives": "^4.33.1
|
|
112
|
-
"@wordpress/private-apis": "^1.33.1
|
|
113
|
-
"@wordpress/reusable-blocks": "^5.33.
|
|
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
|
|
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": "
|
|
136
|
+
"gitHead": "45005cc254bab59182927e35a68cd22f6320634d"
|
|
137
137
|
}
|
package/src/accordion/block.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/accordion",
|
|
5
5
|
"title": "Accordion",
|
|
6
6
|
"category": "design",
|
|
7
|
-
"description": "Displays a
|
|
7
|
+
"description": "Displays a foldable layout that groups content in collapsible sections.",
|
|
8
8
|
"example": {},
|
|
9
9
|
"supports": {
|
|
10
10
|
"anchor": true,
|
package/src/accordion/edit.js
CHANGED
|
@@ -102,22 +102,22 @@ export default function Edit( {
|
|
|
102
102
|
return (
|
|
103
103
|
<>
|
|
104
104
|
{ isSingleSelected && ! isContentOnlyMode && (
|
|
105
|
-
|
|
106
|
-
<
|
|
107
|
-
<
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
</
|
|
120
|
-
|
|
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
|
|
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": "
|
|
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": "
|
|
7
|
+
"description": "Contains the hidden or revealed content beneath the heading.",
|
|
8
8
|
"parent": [ "core/accordion-item" ],
|
|
9
9
|
"supports": {
|
|
10
10
|
"html": false,
|
package/src/archives/index.php
CHANGED
|
@@ -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"
|
|
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
|
*
|
package/src/categories/index.php
CHANGED
|
@@ -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 )
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
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
|
package/src/code/transforms.js
CHANGED
|
@@ -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 *;
|
package/src/freeform/block.json
CHANGED
|
@@ -13,9 +13,13 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"supports": {
|
|
16
|
+
"html": false,
|
|
16
17
|
"className": false,
|
|
17
18
|
"customClassName": false,
|
|
18
|
-
"
|
|
19
|
+
"lock": false,
|
|
20
|
+
"reusable": false,
|
|
21
|
+
"renaming": false,
|
|
22
|
+
"blockVisibility": false
|
|
19
23
|
},
|
|
20
24
|
"editorStyle": "wp-block-freeform-editor"
|
|
21
25
|
}
|
package/src/home-link/block.json
CHANGED
package/src/image/index.php
CHANGED
|
@@ -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
|
|
254
|
-
$processor->set_attribute( 'data-wp-on-
|
|
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
|
|
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
|
|
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
|
|
327
|
+
data-wp-on--touchstart="actions.handleTouchStart"
|
|
328
328
|
data-wp-on--touchmove="actions.handleTouchMove"
|
|
329
|
-
data-wp-on
|
|
330
|
-
data-wp-on
|
|
331
|
-
data-wp-on-
|
|
332
|
-
data-wp-on-
|
|
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 } );
|
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
|
-
<
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
14
|
+
<div { ...useBlockProps.save() }>
|
|
15
|
+
<math
|
|
16
|
+
display="block"
|
|
17
|
+
dangerouslySetInnerHTML={ { __html: mathML } }
|
|
18
|
+
/>
|
|
19
|
+
</div>
|
|
19
20
|
);
|
|
20
21
|
}
|
package/src/missing/block.json
CHANGED
|
@@ -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 );
|
package/src/navigation/index.php
CHANGED
|
@@ -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
|
|
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
|
|
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
|
|
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
|
|
834
|
-
$tags->set_attribute( 'data-wp-on
|
|
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
|
|
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
|
|
855
|
+
$tags->set_attribute( 'data-wp-on--focus', 'actions.openMenuOnFocus' );
|
|
856
856
|
}
|
|
857
857
|
|
|
858
858
|
// Iterate through subitems if exist.
|