@wordpress/block-library 9.8.2 → 9.8.4
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/audio/index.js +4 -4
- package/build/audio/index.js.map +1 -1
- package/build/button/edit.js +2 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +5 -5
- package/build/button/index.js.map +1 -1
- package/build/categories/index.js +1 -1
- package/build/categories/index.js.map +1 -1
- package/build/embed/deprecated.js +6 -6
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/index.js +6 -6
- package/build/embed/index.js.map +1 -1
- package/build/embed/transforms.js +6 -6
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +6 -6
- package/build/embed/util.js.map +1 -1
- package/build/file/index.js +1 -1
- package/build/file/index.js.map +1 -1
- package/build/form-input/deprecated.js +4 -4
- package/build/form-input/deprecated.js.map +1 -1
- package/build/form-input/index.js +2 -2
- package/build/form-input/index.js.map +1 -1
- package/build/heading/deprecated.js +1 -1
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/index.js +1 -1
- package/build/heading/index.js.map +1 -1
- package/build/image/deprecated.js +18 -18
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +2 -1
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +4 -3
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -7
- package/build/image/index.js.map +1 -1
- package/build/list/deprecated.js +8 -8
- package/build/list/deprecated.js.map +1 -1
- package/build/list/index.js +2 -2
- package/build/list/index.js.map +1 -1
- package/build/list-item/index.js +1 -1
- package/build/list-item/index.js.map +1 -1
- package/build/media-text/deprecated.js +5 -5
- package/build/media-text/deprecated.js.map +1 -1
- package/build/media-text/index.js +5 -5
- package/build/media-text/index.js.map +1 -1
- package/build/paragraph/index.js +1 -1
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +1 -1
- package/build/paragraph/transforms.js.map +1 -1
- package/build/preformatted/index.js +1 -1
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/deprecated.js +2 -2
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/pullquote/index.js +2 -2
- package/build/pullquote/index.js.map +1 -1
- package/build/query/edit/inspector-controls/format-controls.js +1 -1
- package/build/query/edit/inspector-controls/format-controls.js.map +1 -1
- package/build/quote/deprecated.js +4 -4
- package/build/quote/deprecated.js.map +1 -1
- package/build/quote/index.js +2 -2
- package/build/quote/index.js.map +1 -1
- package/build/search/edit.js +4 -3
- package/build/search/edit.js.map +1 -1
- package/build/search/index.js +3 -3
- package/build/search/index.js.map +1 -1
- package/build/verse/deprecated.js +1 -1
- package/build/verse/deprecated.js.map +1 -1
- package/build/verse/index.js +1 -1
- package/build/verse/index.js.map +1 -1
- package/build/video/deprecated.js +5 -5
- package/build/video/deprecated.js.map +1 -1
- package/build/video/index.js +5 -5
- package/build/video/index.js.map +1 -1
- package/build-module/audio/index.js +4 -4
- package/build-module/audio/index.js.map +1 -1
- package/build-module/button/edit.js +3 -2
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +5 -5
- package/build-module/button/index.js.map +1 -1
- package/build-module/categories/index.js +1 -1
- package/build-module/categories/index.js.map +1 -1
- package/build-module/embed/deprecated.js +6 -6
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/index.js +6 -6
- package/build-module/embed/index.js.map +1 -1
- package/build-module/embed/transforms.js +6 -6
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +6 -6
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/index.js +1 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/form-input/deprecated.js +4 -4
- package/build-module/form-input/deprecated.js.map +1 -1
- package/build-module/form-input/index.js +2 -2
- package/build-module/form-input/index.js.map +1 -1
- package/build-module/heading/deprecated.js +1 -1
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/index.js +1 -1
- package/build-module/heading/index.js.map +1 -1
- package/build-module/image/deprecated.js +18 -18
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +3 -2
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +5 -4
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -7
- package/build-module/image/index.js.map +1 -1
- package/build-module/list/deprecated.js +8 -8
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/index.js +2 -2
- package/build-module/list/index.js.map +1 -1
- package/build-module/list-item/index.js +1 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/media-text/deprecated.js +5 -5
- package/build-module/media-text/deprecated.js.map +1 -1
- package/build-module/media-text/index.js +5 -5
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/paragraph/index.js +1 -1
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +1 -1
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/preformatted/index.js +1 -1
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js +2 -2
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/pullquote/index.js +2 -2
- package/build-module/pullquote/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/format-controls.js +1 -1
- package/build-module/query/edit/inspector-controls/format-controls.js.map +1 -1
- package/build-module/quote/deprecated.js +4 -4
- package/build-module/quote/deprecated.js.map +1 -1
- package/build-module/quote/index.js +2 -2
- package/build-module/quote/index.js.map +1 -1
- package/build-module/search/edit.js +4 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/index.js +3 -3
- package/build-module/search/index.js.map +1 -1
- package/build-module/verse/deprecated.js +1 -1
- package/build-module/verse/deprecated.js.map +1 -1
- package/build-module/verse/index.js +1 -1
- package/build-module/verse/index.js.map +1 -1
- package/build-module/video/deprecated.js +5 -5
- package/build-module/video/deprecated.js.map +1 -1
- package/build-module/video/index.js +5 -5
- package/build-module/video/index.js.map +1 -1
- package/package.json +25 -25
- package/src/audio/block.json +4 -4
- package/src/button/block.json +5 -5
- package/src/button/edit.js +3 -2
- package/src/categories/block.json +1 -1
- package/src/embed/block.json +6 -6
- package/src/file/block.json +1 -1
- package/src/file/index.php +1 -12
- package/src/form-input/block.json +2 -2
- package/src/form-input/deprecated.js +4 -4
- package/src/heading/block.json +1 -1
- package/src/heading/deprecated.js +1 -1
- package/src/image/block.json +7 -7
- package/src/image/deprecated.js +18 -18
- package/src/image/edit.js +3 -2
- package/src/image/image.js +5 -4
- package/src/image/index.php +1 -13
- package/src/list/block.json +2 -2
- package/src/list/deprecated.js +8 -8
- package/src/list-item/block.json +1 -1
- package/src/media-text/block.json +5 -5
- package/src/media-text/deprecated.js +5 -5
- package/src/navigation/index.php +10 -15
- package/src/paragraph/block.json +1 -1
- package/src/post-template/index.php +0 -5
- package/src/preformatted/block.json +1 -1
- package/src/pullquote/block.json +2 -2
- package/src/pullquote/deprecated.js +2 -2
- package/src/query/edit/inspector-controls/format-controls.js +1 -1
- package/src/query/index.php +1 -21
- package/src/quote/block.json +2 -2
- package/src/quote/deprecated.js +4 -4
- package/src/search/block.json +3 -3
- package/src/search/edit.js +10 -7
- package/src/search/index.php +1 -12
- package/src/verse/block.json +1 -1
- package/src/verse/deprecated.js +1 -1
- package/src/video/block.json +5 -5
package/src/image/deprecated.js
CHANGED
|
@@ -559,7 +559,7 @@ const v6 = {
|
|
|
559
559
|
source: 'attribute',
|
|
560
560
|
selector: 'img',
|
|
561
561
|
attribute: 'src',
|
|
562
|
-
|
|
562
|
+
role: 'content',
|
|
563
563
|
},
|
|
564
564
|
alt: {
|
|
565
565
|
type: 'string',
|
|
@@ -567,27 +567,27 @@ const v6 = {
|
|
|
567
567
|
selector: 'img',
|
|
568
568
|
attribute: 'alt',
|
|
569
569
|
default: '',
|
|
570
|
-
|
|
570
|
+
role: 'content',
|
|
571
571
|
},
|
|
572
572
|
caption: {
|
|
573
573
|
type: 'string',
|
|
574
574
|
source: 'html',
|
|
575
575
|
selector: 'figcaption',
|
|
576
|
-
|
|
576
|
+
role: 'content',
|
|
577
577
|
},
|
|
578
578
|
title: {
|
|
579
579
|
type: 'string',
|
|
580
580
|
source: 'attribute',
|
|
581
581
|
selector: 'img',
|
|
582
582
|
attribute: 'title',
|
|
583
|
-
|
|
583
|
+
role: 'content',
|
|
584
584
|
},
|
|
585
585
|
href: {
|
|
586
586
|
type: 'string',
|
|
587
587
|
source: 'attribute',
|
|
588
588
|
selector: 'figure > a',
|
|
589
589
|
attribute: 'href',
|
|
590
|
-
|
|
590
|
+
role: 'content',
|
|
591
591
|
},
|
|
592
592
|
rel: {
|
|
593
593
|
type: 'string',
|
|
@@ -603,7 +603,7 @@ const v6 = {
|
|
|
603
603
|
},
|
|
604
604
|
id: {
|
|
605
605
|
type: 'number',
|
|
606
|
-
|
|
606
|
+
role: 'content',
|
|
607
607
|
},
|
|
608
608
|
width: {
|
|
609
609
|
type: 'number',
|
|
@@ -762,7 +762,7 @@ const v7 = {
|
|
|
762
762
|
source: 'attribute',
|
|
763
763
|
selector: 'img',
|
|
764
764
|
attribute: 'src',
|
|
765
|
-
|
|
765
|
+
role: 'content',
|
|
766
766
|
},
|
|
767
767
|
alt: {
|
|
768
768
|
type: 'string',
|
|
@@ -770,27 +770,27 @@ const v7 = {
|
|
|
770
770
|
selector: 'img',
|
|
771
771
|
attribute: 'alt',
|
|
772
772
|
default: '',
|
|
773
|
-
|
|
773
|
+
role: 'content',
|
|
774
774
|
},
|
|
775
775
|
caption: {
|
|
776
776
|
type: 'string',
|
|
777
777
|
source: 'html',
|
|
778
778
|
selector: 'figcaption',
|
|
779
|
-
|
|
779
|
+
role: 'content',
|
|
780
780
|
},
|
|
781
781
|
title: {
|
|
782
782
|
type: 'string',
|
|
783
783
|
source: 'attribute',
|
|
784
784
|
selector: 'img',
|
|
785
785
|
attribute: 'title',
|
|
786
|
-
|
|
786
|
+
role: 'content',
|
|
787
787
|
},
|
|
788
788
|
href: {
|
|
789
789
|
type: 'string',
|
|
790
790
|
source: 'attribute',
|
|
791
791
|
selector: 'figure > a',
|
|
792
792
|
attribute: 'href',
|
|
793
|
-
|
|
793
|
+
role: 'content',
|
|
794
794
|
},
|
|
795
795
|
rel: {
|
|
796
796
|
type: 'string',
|
|
@@ -806,7 +806,7 @@ const v7 = {
|
|
|
806
806
|
},
|
|
807
807
|
id: {
|
|
808
808
|
type: 'number',
|
|
809
|
-
|
|
809
|
+
role: 'content',
|
|
810
810
|
},
|
|
811
811
|
width: {
|
|
812
812
|
type: 'number',
|
|
@@ -962,7 +962,7 @@ const v8 = {
|
|
|
962
962
|
source: 'attribute',
|
|
963
963
|
selector: 'img',
|
|
964
964
|
attribute: 'src',
|
|
965
|
-
|
|
965
|
+
role: 'content',
|
|
966
966
|
},
|
|
967
967
|
alt: {
|
|
968
968
|
type: 'string',
|
|
@@ -970,27 +970,27 @@ const v8 = {
|
|
|
970
970
|
selector: 'img',
|
|
971
971
|
attribute: 'alt',
|
|
972
972
|
default: '',
|
|
973
|
-
|
|
973
|
+
role: 'content',
|
|
974
974
|
},
|
|
975
975
|
caption: {
|
|
976
976
|
type: 'string',
|
|
977
977
|
source: 'html',
|
|
978
978
|
selector: 'figcaption',
|
|
979
|
-
|
|
979
|
+
role: 'content',
|
|
980
980
|
},
|
|
981
981
|
title: {
|
|
982
982
|
type: 'string',
|
|
983
983
|
source: 'attribute',
|
|
984
984
|
selector: 'img',
|
|
985
985
|
attribute: 'title',
|
|
986
|
-
|
|
986
|
+
role: 'content',
|
|
987
987
|
},
|
|
988
988
|
href: {
|
|
989
989
|
type: 'string',
|
|
990
990
|
source: 'attribute',
|
|
991
991
|
selector: 'figure > a',
|
|
992
992
|
attribute: 'href',
|
|
993
|
-
|
|
993
|
+
role: 'content',
|
|
994
994
|
},
|
|
995
995
|
rel: {
|
|
996
996
|
type: 'string',
|
|
@@ -1006,7 +1006,7 @@ const v8 = {
|
|
|
1006
1006
|
},
|
|
1007
1007
|
id: {
|
|
1008
1008
|
type: 'number',
|
|
1009
|
-
|
|
1009
|
+
role: 'content',
|
|
1010
1010
|
},
|
|
1011
1011
|
width: {
|
|
1012
1012
|
type: 'string',
|
package/src/image/edit.js
CHANGED
|
@@ -9,7 +9,7 @@ import clsx from 'clsx';
|
|
|
9
9
|
import { isBlobURL, createBlobURL } from '@wordpress/blob';
|
|
10
10
|
import { store as blocksStore, createBlock } from '@wordpress/blocks';
|
|
11
11
|
import { Placeholder } from '@wordpress/components';
|
|
12
|
-
import { useDispatch, useSelect } from '@wordpress/data';
|
|
12
|
+
import { useDispatch, useSelect, useRegistry } from '@wordpress/data';
|
|
13
13
|
import {
|
|
14
14
|
BlockIcon,
|
|
15
15
|
useBlockProps,
|
|
@@ -113,6 +113,7 @@ export function ImageEdit( {
|
|
|
113
113
|
|
|
114
114
|
const [ temporaryURL, setTemporaryURL ] = useState( attributes.blob );
|
|
115
115
|
|
|
116
|
+
const registry = useRegistry();
|
|
116
117
|
const containerRef = useRef();
|
|
117
118
|
// Only observe the max width from the parent container when the parent layout is not flex nor grid.
|
|
118
119
|
// This won't work for them because the container width changes with the image.
|
|
@@ -380,7 +381,7 @@ export function ImageEdit( {
|
|
|
380
381
|
lockUrlControls:
|
|
381
382
|
!! metadata?.bindings?.url &&
|
|
382
383
|
! blockBindingsSource?.canUserEditValue?.( {
|
|
383
|
-
|
|
384
|
+
registry,
|
|
384
385
|
context,
|
|
385
386
|
args: metadata?.bindings?.url?.args,
|
|
386
387
|
} ),
|
package/src/image/image.js
CHANGED
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
Placeholder,
|
|
18
18
|
} from '@wordpress/components';
|
|
19
19
|
import { useViewportMatch } from '@wordpress/compose';
|
|
20
|
-
import { useSelect, useDispatch } from '@wordpress/data';
|
|
20
|
+
import { useSelect, useDispatch, useRegistry } from '@wordpress/data';
|
|
21
21
|
import {
|
|
22
22
|
BlockControls,
|
|
23
23
|
InspectorControls,
|
|
@@ -134,6 +134,7 @@ export default function Image( {
|
|
|
134
134
|
const numericWidth = width ? parseInt( width, 10 ) : undefined;
|
|
135
135
|
const numericHeight = height ? parseInt( height, 10 ) : undefined;
|
|
136
136
|
|
|
137
|
+
const registry = useRegistry();
|
|
137
138
|
const imageRef = useRef();
|
|
138
139
|
const { allowResize = true } = context;
|
|
139
140
|
const { getBlock, getSettings } = useSelect( blockEditorStore );
|
|
@@ -496,7 +497,7 @@ export default function Image( {
|
|
|
496
497
|
lockUrlControls:
|
|
497
498
|
!! urlBinding &&
|
|
498
499
|
! urlBindingSource?.canUserEditValue?.( {
|
|
499
|
-
|
|
500
|
+
registry,
|
|
500
501
|
context,
|
|
501
502
|
args: urlBinding?.args,
|
|
502
503
|
} ),
|
|
@@ -511,7 +512,7 @@ export default function Image( {
|
|
|
511
512
|
lockAltControls:
|
|
512
513
|
!! altBinding &&
|
|
513
514
|
! altBindingSource?.canUserEditValue?.( {
|
|
514
|
-
|
|
515
|
+
registry,
|
|
515
516
|
context,
|
|
516
517
|
args: altBinding?.args,
|
|
517
518
|
} ),
|
|
@@ -525,7 +526,7 @@ export default function Image( {
|
|
|
525
526
|
lockTitleControls:
|
|
526
527
|
!! titleBinding &&
|
|
527
528
|
! titleBindingSource?.canUserEditValue?.( {
|
|
528
|
-
|
|
529
|
+
registry,
|
|
529
530
|
context,
|
|
530
531
|
args: titleBinding?.args,
|
|
531
532
|
} ),
|
package/src/image/index.php
CHANGED
|
@@ -70,19 +70,7 @@ function render_block_core_image( $attributes, $content, $block ) {
|
|
|
70
70
|
isset( $lightbox_settings['enabled'] ) &&
|
|
71
71
|
true === $lightbox_settings['enabled']
|
|
72
72
|
) {
|
|
73
|
-
|
|
74
|
-
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
|
75
|
-
$module_url = gutenberg_url( '/build-module/block-library/image/view.min.js' );
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
wp_register_script_module(
|
|
79
|
-
'@wordpress/block-library/image',
|
|
80
|
-
isset( $module_url ) ? $module_url : includes_url( "blocks/image/view{$suffix}.js" ),
|
|
81
|
-
array( '@wordpress/interactivity' ),
|
|
82
|
-
defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
|
|
83
|
-
);
|
|
84
|
-
|
|
85
|
-
wp_enqueue_script_module( '@wordpress/block-library/image' );
|
|
73
|
+
wp_enqueue_script_module( '@wordpress/block-library/image/view' );
|
|
86
74
|
|
|
87
75
|
/*
|
|
88
76
|
* This render needs to happen in a filter with priority 15 to ensure that
|
package/src/list/block.json
CHANGED
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"ordered": {
|
|
13
13
|
"type": "boolean",
|
|
14
14
|
"default": false,
|
|
15
|
-
"
|
|
15
|
+
"role": "content"
|
|
16
16
|
},
|
|
17
17
|
"values": {
|
|
18
18
|
"type": "string",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"multiline": "li",
|
|
22
22
|
"__unstableMultilineWrapperTags": [ "ol", "ul" ],
|
|
23
23
|
"default": "",
|
|
24
|
-
"
|
|
24
|
+
"role": "content"
|
|
25
25
|
},
|
|
26
26
|
"type": {
|
|
27
27
|
"type": "string"
|
package/src/list/deprecated.js
CHANGED
|
@@ -14,7 +14,7 @@ const v0 = {
|
|
|
14
14
|
ordered: {
|
|
15
15
|
type: 'boolean',
|
|
16
16
|
default: false,
|
|
17
|
-
|
|
17
|
+
role: 'content',
|
|
18
18
|
},
|
|
19
19
|
values: {
|
|
20
20
|
type: 'string',
|
|
@@ -23,7 +23,7 @@ const v0 = {
|
|
|
23
23
|
multiline: 'li',
|
|
24
24
|
__unstableMultilineWrapperTags: [ 'ol', 'ul' ],
|
|
25
25
|
default: '',
|
|
26
|
-
|
|
26
|
+
role: 'content',
|
|
27
27
|
},
|
|
28
28
|
type: {
|
|
29
29
|
type: 'string',
|
|
@@ -74,7 +74,7 @@ const v1 = {
|
|
|
74
74
|
ordered: {
|
|
75
75
|
type: 'boolean',
|
|
76
76
|
default: false,
|
|
77
|
-
|
|
77
|
+
role: 'content',
|
|
78
78
|
},
|
|
79
79
|
values: {
|
|
80
80
|
type: 'string',
|
|
@@ -83,7 +83,7 @@ const v1 = {
|
|
|
83
83
|
multiline: 'li',
|
|
84
84
|
__unstableMultilineWrapperTags: [ 'ol', 'ul' ],
|
|
85
85
|
default: '',
|
|
86
|
-
|
|
86
|
+
role: 'content',
|
|
87
87
|
},
|
|
88
88
|
type: {
|
|
89
89
|
type: 'string',
|
|
@@ -144,7 +144,7 @@ const v2 = {
|
|
|
144
144
|
ordered: {
|
|
145
145
|
type: 'boolean',
|
|
146
146
|
default: false,
|
|
147
|
-
|
|
147
|
+
role: 'content',
|
|
148
148
|
},
|
|
149
149
|
values: {
|
|
150
150
|
type: 'string',
|
|
@@ -153,7 +153,7 @@ const v2 = {
|
|
|
153
153
|
multiline: 'li',
|
|
154
154
|
__unstableMultilineWrapperTags: [ 'ol', 'ul' ],
|
|
155
155
|
default: '',
|
|
156
|
-
|
|
156
|
+
role: 'content',
|
|
157
157
|
},
|
|
158
158
|
type: {
|
|
159
159
|
type: 'string',
|
|
@@ -225,7 +225,7 @@ const v3 = {
|
|
|
225
225
|
ordered: {
|
|
226
226
|
type: 'boolean',
|
|
227
227
|
default: false,
|
|
228
|
-
|
|
228
|
+
role: 'content',
|
|
229
229
|
},
|
|
230
230
|
values: {
|
|
231
231
|
type: 'string',
|
|
@@ -234,7 +234,7 @@ const v3 = {
|
|
|
234
234
|
multiline: 'li',
|
|
235
235
|
__unstableMultilineWrapperTags: [ 'ol', 'ul' ],
|
|
236
236
|
default: '',
|
|
237
|
-
|
|
237
|
+
role: 'content',
|
|
238
238
|
},
|
|
239
239
|
type: {
|
|
240
240
|
type: 'string',
|
package/src/list-item/block.json
CHANGED
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"selector": "figure img",
|
|
19
19
|
"attribute": "alt",
|
|
20
20
|
"default": "",
|
|
21
|
-
"
|
|
21
|
+
"role": "content"
|
|
22
22
|
},
|
|
23
23
|
"mediaPosition": {
|
|
24
24
|
"type": "string",
|
|
@@ -26,14 +26,14 @@
|
|
|
26
26
|
},
|
|
27
27
|
"mediaId": {
|
|
28
28
|
"type": "number",
|
|
29
|
-
"
|
|
29
|
+
"role": "content"
|
|
30
30
|
},
|
|
31
31
|
"mediaUrl": {
|
|
32
32
|
"type": "string",
|
|
33
33
|
"source": "attribute",
|
|
34
34
|
"selector": "figure video,figure img",
|
|
35
35
|
"attribute": "src",
|
|
36
|
-
"
|
|
36
|
+
"role": "content"
|
|
37
37
|
},
|
|
38
38
|
"mediaLink": {
|
|
39
39
|
"type": "string"
|
|
@@ -52,7 +52,7 @@
|
|
|
52
52
|
"source": "attribute",
|
|
53
53
|
"selector": "figure a",
|
|
54
54
|
"attribute": "href",
|
|
55
|
-
"
|
|
55
|
+
"role": "content"
|
|
56
56
|
},
|
|
57
57
|
"rel": {
|
|
58
58
|
"type": "string",
|
|
@@ -68,7 +68,7 @@
|
|
|
68
68
|
},
|
|
69
69
|
"mediaType": {
|
|
70
70
|
"type": "string",
|
|
71
|
-
"
|
|
71
|
+
"role": "content"
|
|
72
72
|
},
|
|
73
73
|
"mediaWidth": {
|
|
74
74
|
"type": "number",
|
|
@@ -172,29 +172,29 @@ const v6Attributes = {
|
|
|
172
172
|
selector: 'figure img',
|
|
173
173
|
attribute: 'alt',
|
|
174
174
|
default: '',
|
|
175
|
-
|
|
175
|
+
role: 'content',
|
|
176
176
|
},
|
|
177
177
|
mediaId: {
|
|
178
178
|
type: 'number',
|
|
179
|
-
|
|
179
|
+
role: 'content',
|
|
180
180
|
},
|
|
181
181
|
mediaUrl: {
|
|
182
182
|
type: 'string',
|
|
183
183
|
source: 'attribute',
|
|
184
184
|
selector: 'figure video,figure img',
|
|
185
185
|
attribute: 'src',
|
|
186
|
-
|
|
186
|
+
role: 'content',
|
|
187
187
|
},
|
|
188
188
|
href: {
|
|
189
189
|
type: 'string',
|
|
190
190
|
source: 'attribute',
|
|
191
191
|
selector: 'figure a',
|
|
192
192
|
attribute: 'href',
|
|
193
|
-
|
|
193
|
+
role: 'content',
|
|
194
194
|
},
|
|
195
195
|
mediaType: {
|
|
196
196
|
type: 'string',
|
|
197
|
-
|
|
197
|
+
role: 'content',
|
|
198
198
|
},
|
|
199
199
|
};
|
|
200
200
|
|
package/src/navigation/index.php
CHANGED
|
@@ -622,18 +622,7 @@ class WP_Navigation_Block_Renderer {
|
|
|
622
622
|
*/
|
|
623
623
|
private static function handle_view_script_module_loading( $attributes, $block, $inner_blocks ) {
|
|
624
624
|
if ( static::is_interactive( $attributes, $inner_blocks ) ) {
|
|
625
|
-
|
|
626
|
-
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
|
627
|
-
$module_url = gutenberg_url( '/build-module/block-library/navigation/view.min.js' );
|
|
628
|
-
}
|
|
629
|
-
|
|
630
|
-
wp_register_script_module(
|
|
631
|
-
'@wordpress/block-library/navigation',
|
|
632
|
-
isset( $module_url ) ? $module_url : includes_url( "blocks/navigation/view{$suffix}.js" ),
|
|
633
|
-
array( '@wordpress/interactivity' ),
|
|
634
|
-
defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
|
|
635
|
-
);
|
|
636
|
-
wp_enqueue_script_module( '@wordpress/block-library/navigation' );
|
|
625
|
+
wp_enqueue_script_module( '@wordpress/block-library/navigation/view' );
|
|
637
626
|
}
|
|
638
627
|
}
|
|
639
628
|
|
|
@@ -1510,9 +1499,15 @@ function block_core_navigation_mock_parsed_block( $inner_blocks, $post ) {
|
|
|
1510
1499
|
*/
|
|
1511
1500
|
function block_core_navigation_insert_hooked_blocks( $inner_blocks, $post ) {
|
|
1512
1501
|
$mock_navigation_block = block_core_navigation_mock_parsed_block( $inner_blocks, $post );
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1502
|
+
|
|
1503
|
+
if ( function_exists( 'apply_block_hooks_to_content' ) ) {
|
|
1504
|
+
$mock_navigation_block_markup = serialize_block( $mock_navigation_block );
|
|
1505
|
+
return apply_block_hooks_to_content( $mock_navigation_block_markup, $post, 'insert_hooked_blocks' );
|
|
1506
|
+
}
|
|
1507
|
+
|
|
1508
|
+
$hooked_blocks = get_hooked_blocks();
|
|
1509
|
+
$before_block_visitor = null;
|
|
1510
|
+
$after_block_visitor = null;
|
|
1516
1511
|
|
|
1517
1512
|
if ( ! empty( $hooked_blocks ) || has_filter( 'hooked_block_types' ) ) {
|
|
1518
1513
|
$before_block_visitor = make_before_block_visitor( $hooked_blocks, $post, 'insert_hooked_blocks' );
|
package/src/paragraph/block.json
CHANGED
|
@@ -64,11 +64,6 @@ function render_block_core_post_template( $attributes, $content, $block ) {
|
|
|
64
64
|
if ( in_the_loop() ) {
|
|
65
65
|
$query = clone $wp_query;
|
|
66
66
|
$query->rewind_posts();
|
|
67
|
-
|
|
68
|
-
// If in a single post of any post type, default to the 'post' post type.
|
|
69
|
-
if ( is_singular() ) {
|
|
70
|
-
query_posts( array( 'post_type' => 'post' ) );
|
|
71
|
-
}
|
|
72
67
|
} else {
|
|
73
68
|
$query = $wp_query;
|
|
74
69
|
}
|
package/src/pullquote/block.json
CHANGED
|
@@ -11,13 +11,13 @@
|
|
|
11
11
|
"type": "rich-text",
|
|
12
12
|
"source": "rich-text",
|
|
13
13
|
"selector": "p",
|
|
14
|
-
"
|
|
14
|
+
"role": "content"
|
|
15
15
|
},
|
|
16
16
|
"citation": {
|
|
17
17
|
"type": "rich-text",
|
|
18
18
|
"source": "rich-text",
|
|
19
19
|
"selector": "cite",
|
|
20
|
-
"
|
|
20
|
+
"role": "content"
|
|
21
21
|
},
|
|
22
22
|
"textAlign": {
|
|
23
23
|
"type": "string"
|
|
@@ -75,14 +75,14 @@ const v5 = {
|
|
|
75
75
|
source: 'html',
|
|
76
76
|
selector: 'blockquote',
|
|
77
77
|
multiline: 'p',
|
|
78
|
-
|
|
78
|
+
role: 'content',
|
|
79
79
|
},
|
|
80
80
|
citation: {
|
|
81
81
|
type: 'string',
|
|
82
82
|
source: 'html',
|
|
83
83
|
selector: 'cite',
|
|
84
84
|
default: '',
|
|
85
|
-
|
|
85
|
+
role: 'content',
|
|
86
86
|
},
|
|
87
87
|
textAlign: {
|
|
88
88
|
type: 'string',
|
|
@@ -68,7 +68,7 @@ export default function FormatControls( { onChange, query: { format } } ) {
|
|
|
68
68
|
.filter( Boolean );
|
|
69
69
|
|
|
70
70
|
const suggestions = formats
|
|
71
|
-
.filter( ( item ) => !
|
|
71
|
+
.filter( ( item ) => ! normalizedFormats.includes( item.value ) )
|
|
72
72
|
.map( ( item ) => item.label );
|
|
73
73
|
|
|
74
74
|
return (
|
package/src/query/index.php
CHANGED
|
@@ -24,27 +24,7 @@ function render_block_core_query( $attributes, $content, $block ) {
|
|
|
24
24
|
// Enqueue the script module and add the necessary directives if the block is
|
|
25
25
|
// interactive.
|
|
26
26
|
if ( $is_interactive ) {
|
|
27
|
-
|
|
28
|
-
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN ) {
|
|
29
|
-
$module_url = gutenberg_url( '/build-module/block-library/query/view.min.js' );
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
wp_register_script_module(
|
|
33
|
-
'@wordpress/block-library/query',
|
|
34
|
-
isset( $module_url ) ? $module_url : includes_url( "blocks/query/view{$suffix}.js" ),
|
|
35
|
-
array(
|
|
36
|
-
array(
|
|
37
|
-
'id' => '@wordpress/interactivity',
|
|
38
|
-
'import' => 'static',
|
|
39
|
-
),
|
|
40
|
-
array(
|
|
41
|
-
'id' => '@wordpress/interactivity-router',
|
|
42
|
-
'import' => 'dynamic',
|
|
43
|
-
),
|
|
44
|
-
),
|
|
45
|
-
defined( 'GUTENBERG_VERSION' ) ? GUTENBERG_VERSION : get_bloginfo( 'version' )
|
|
46
|
-
);
|
|
47
|
-
wp_enqueue_script_module( '@wordpress/block-library/query' );
|
|
27
|
+
wp_enqueue_script_module( '@wordpress/block-library/query/view' );
|
|
48
28
|
|
|
49
29
|
$p = new WP_HTML_Tag_Processor( $content );
|
|
50
30
|
if ( $p->next_tag() ) {
|
package/src/quote/block.json
CHANGED
|
@@ -14,13 +14,13 @@
|
|
|
14
14
|
"selector": "blockquote",
|
|
15
15
|
"multiline": "p",
|
|
16
16
|
"default": "",
|
|
17
|
-
"
|
|
17
|
+
"role": "content"
|
|
18
18
|
},
|
|
19
19
|
"citation": {
|
|
20
20
|
"type": "rich-text",
|
|
21
21
|
"source": "rich-text",
|
|
22
22
|
"selector": "cite",
|
|
23
|
-
"
|
|
23
|
+
"role": "content"
|
|
24
24
|
},
|
|
25
25
|
"textAlign": {
|
|
26
26
|
"type": "string"
|
package/src/quote/deprecated.js
CHANGED
|
@@ -70,14 +70,14 @@ const v4 = {
|
|
|
70
70
|
selector: 'blockquote',
|
|
71
71
|
multiline: 'p',
|
|
72
72
|
default: '',
|
|
73
|
-
|
|
73
|
+
role: 'content',
|
|
74
74
|
},
|
|
75
75
|
citation: {
|
|
76
76
|
type: 'string',
|
|
77
77
|
source: 'html',
|
|
78
78
|
selector: 'cite',
|
|
79
79
|
default: '',
|
|
80
|
-
|
|
80
|
+
role: 'content',
|
|
81
81
|
},
|
|
82
82
|
align: {
|
|
83
83
|
type: 'string',
|
|
@@ -138,14 +138,14 @@ const v3 = {
|
|
|
138
138
|
selector: 'blockquote',
|
|
139
139
|
multiline: 'p',
|
|
140
140
|
default: '',
|
|
141
|
-
|
|
141
|
+
role: 'content',
|
|
142
142
|
},
|
|
143
143
|
citation: {
|
|
144
144
|
type: 'string',
|
|
145
145
|
source: 'html',
|
|
146
146
|
selector: 'cite',
|
|
147
147
|
default: '',
|
|
148
|
-
|
|
148
|
+
role: 'content',
|
|
149
149
|
},
|
|
150
150
|
align: {
|
|
151
151
|
type: 'string',
|
package/src/search/block.json
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"attributes": {
|
|
11
11
|
"label": {
|
|
12
12
|
"type": "string",
|
|
13
|
-
"
|
|
13
|
+
"role": "content"
|
|
14
14
|
},
|
|
15
15
|
"showLabel": {
|
|
16
16
|
"type": "boolean",
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
"placeholder": {
|
|
20
20
|
"type": "string",
|
|
21
21
|
"default": "",
|
|
22
|
-
"
|
|
22
|
+
"role": "content"
|
|
23
23
|
},
|
|
24
24
|
"width": {
|
|
25
25
|
"type": "number"
|
|
@@ -29,7 +29,7 @@
|
|
|
29
29
|
},
|
|
30
30
|
"buttonText": {
|
|
31
31
|
"type": "string",
|
|
32
|
-
"
|
|
32
|
+
"role": "content"
|
|
33
33
|
},
|
|
34
34
|
"buttonPosition": {
|
|
35
35
|
"type": "string",
|
package/src/search/edit.js
CHANGED
|
@@ -424,13 +424,12 @@ export default function SearchEdit( {
|
|
|
424
424
|
}
|
|
425
425
|
step={ 1 }
|
|
426
426
|
onChange={ ( newWidth ) => {
|
|
427
|
-
const
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
: newWidth;
|
|
427
|
+
const parsedNewWidth =
|
|
428
|
+
newWidth === ''
|
|
429
|
+
? undefined
|
|
430
|
+
: parseInt( newWidth, 10 );
|
|
432
431
|
setAttributes( {
|
|
433
|
-
width:
|
|
432
|
+
width: parsedNewWidth,
|
|
434
433
|
} );
|
|
435
434
|
} }
|
|
436
435
|
onUnitChange={ ( newUnit ) => {
|
|
@@ -566,7 +565,11 @@ export default function SearchEdit( {
|
|
|
566
565
|
|
|
567
566
|
<ResizableBox
|
|
568
567
|
size={ {
|
|
569
|
-
width:
|
|
568
|
+
width:
|
|
569
|
+
width === undefined
|
|
570
|
+
? 'auto'
|
|
571
|
+
: `${ width }${ widthUnit }`,
|
|
572
|
+
height: 'auto',
|
|
570
573
|
} }
|
|
571
574
|
className={ clsx(
|
|
572
575
|
'wp-block-search__inside-wrapper',
|