@wordpress/block-library 9.35.1-next.16d95556a.0 → 9.36.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/accordion/view.js +46 -4
- package/build/accordion/view.js.map +2 -2
- package/build/accordion-heading/block.json +1 -1
- package/build/accordion-heading/deprecated.js +1 -1
- package/build/accordion-heading/deprecated.js.map +2 -2
- package/build/accordion-panel/block.json +1 -1
- package/build/audio/index.js +29 -0
- package/build/audio/index.js.map +3 -3
- package/build/breadcrumbs/edit.js +1 -1
- package/build/breadcrumbs/edit.js.map +2 -2
- package/build/button/index.js +25 -0
- package/build/button/index.js.map +3 -3
- package/build/code/index.js +15 -0
- package/build/code/index.js.map +3 -3
- package/build/cover/edit/block-controls.js +37 -3
- package/build/cover/edit/block-controls.js.map +3 -3
- package/build/cover/edit/cover-placeholder.js +0 -1
- package/build/cover/edit/cover-placeholder.js.map +2 -2
- package/build/cover/edit/embed-video-url-input.js +83 -0
- package/build/cover/edit/embed-video-url-input.js.map +7 -0
- package/build/cover/edit/index.js +60 -0
- package/build/cover/edit/index.js.map +2 -2
- package/build/cover/embed-video-utils.js +151 -0
- package/build/cover/embed-video-utils.js.map +7 -0
- package/build/cover/index.js +28 -0
- package/build/cover/index.js.map +3 -3
- package/build/cover/save.js +12 -0
- package/build/cover/save.js.map +2 -2
- package/build/cover/shared.js +3 -0
- package/build/cover/shared.js.map +2 -2
- package/build/details/index.js +15 -0
- package/build/details/index.js.map +3 -3
- package/build/file/index.js +33 -0
- package/build/file/index.js.map +3 -3
- package/build/freeform/block.json +1 -1
- package/build/gallery/edit.js +0 -2
- package/build/gallery/edit.js.map +2 -2
- package/build/heading/index.js +15 -0
- package/build/heading/index.js.map +3 -3
- package/build/html/modal.js +139 -148
- package/build/html/modal.js.map +3 -3
- package/build/image/edit.js +0 -1
- package/build/image/edit.js.map +2 -2
- package/build/image/image.js +0 -1
- package/build/image/image.js.map +2 -2
- package/build/image/index.js +46 -0
- package/build/image/index.js.map +3 -3
- package/build/list-item/index.js +15 -0
- package/build/list-item/index.js.map +3 -3
- package/build/math/block.json +28 -1
- package/build/math/edit.js +4 -1
- package/build/math/edit.js.map +2 -2
- package/build/media-text/index.js +35 -0
- package/build/media-text/index.js.map +3 -3
- package/build/media-text/media-container.js +0 -2
- package/build/media-text/media-container.js.map +2 -2
- package/build/missing/block.json +1 -1
- package/build/missing/edit.js +2 -2
- package/build/missing/edit.js.map +1 -1
- package/build/more/index.js +16 -0
- package/build/more/index.js.map +3 -3
- package/build/navigation/block.json +2 -2
- package/build/navigation-link/block.json +2 -1
- package/build/navigation-link/edit.js +42 -11
- package/build/navigation-link/edit.js.map +2 -2
- package/build/navigation-link/index.js +25 -0
- package/build/navigation-link/index.js.map +3 -3
- package/build/navigation-link/shared/controls.js +15 -19
- package/build/navigation-link/shared/controls.js.map +2 -2
- package/build/navigation-link/shared/index.js +4 -0
- package/build/navigation-link/shared/index.js.map +2 -2
- package/build/navigation-link/shared/use-entity-binding.js +3 -2
- package/build/navigation-link/shared/use-entity-binding.js.map +2 -2
- package/build/navigation-submenu/block.json +2 -1
- package/build/navigation-submenu/index.js +25 -0
- package/build/navigation-submenu/index.js.map +3 -3
- package/build/paragraph/deprecated-attributes.js +68 -0
- package/build/paragraph/deprecated-attributes.js.map +7 -0
- package/build/paragraph/edit.js +2 -0
- package/build/paragraph/edit.js.map +3 -3
- package/build/paragraph/index.js +15 -0
- package/build/paragraph/index.js.map +3 -3
- package/build/pattern/block.json +1 -1
- package/build/post-comments-count/edit.js +1 -2
- package/build/post-comments-count/edit.js.map +2 -2
- package/build/post-comments-link/edit.js +10 -7
- package/build/post-comments-link/edit.js.map +2 -2
- package/build/preformatted/index.js +15 -0
- package/build/preformatted/index.js.map +3 -3
- package/build/pullquote/index.js +20 -0
- package/build/pullquote/index.js.map +3 -3
- package/build/search/index.js +26 -0
- package/build/search/index.js.map +3 -3
- package/build/social-link/index.js +25 -0
- package/build/social-link/index.js.map +3 -3
- package/build/social-links/edit.js +1 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/tabs/view.js +17 -4
- package/build/tabs/view.js.map +2 -2
- package/build/template-part/edit/index.js +37 -7
- package/build/template-part/edit/index.js.map +2 -2
- package/build/template-part/edit/utils/hooks.js +2 -3
- package/build/template-part/edit/utils/hooks.js.map +2 -2
- package/build/term-count/index.js +1 -0
- package/build/term-count/index.js.map +2 -2
- package/build/term-name/index.js +1 -0
- package/build/term-name/index.js.map +2 -2
- package/build/verse/index.js +15 -0
- package/build/verse/index.js.map +3 -3
- package/build/video/index.js +30 -0
- package/build/video/index.js.map +3 -3
- package/build-module/accordion/view.js +46 -4
- package/build-module/accordion/view.js.map +2 -2
- package/build-module/accordion-heading/block.json +1 -1
- package/build-module/accordion-heading/deprecated.js +1 -1
- package/build-module/accordion-heading/deprecated.js.map +2 -2
- package/build-module/accordion-panel/block.json +1 -1
- package/build-module/audio/index.js +29 -0
- package/build-module/audio/index.js.map +2 -2
- package/build-module/breadcrumbs/edit.js +1 -1
- package/build-module/breadcrumbs/edit.js.map +2 -2
- package/build-module/button/index.js +25 -0
- package/build-module/button/index.js.map +2 -2
- package/build-module/code/index.js +15 -0
- package/build-module/code/index.js.map +2 -2
- package/build-module/cover/edit/block-controls.js +27 -3
- package/build-module/cover/edit/block-controls.js.map +2 -2
- package/build-module/cover/edit/cover-placeholder.js +0 -1
- package/build-module/cover/edit/cover-placeholder.js.map +2 -2
- package/build-module/cover/edit/embed-video-url-input.js +67 -0
- package/build-module/cover/edit/embed-video-url-input.js.map +7 -0
- package/build-module/cover/edit/index.js +61 -0
- package/build-module/cover/edit/index.js.map +2 -2
- package/build-module/cover/embed-video-utils.js +122 -0
- package/build-module/cover/embed-video-utils.js.map +7 -0
- package/build-module/cover/index.js +28 -0
- package/build-module/cover/index.js.map +2 -2
- package/build-module/cover/save.js +13 -0
- package/build-module/cover/save.js.map +2 -2
- package/build-module/cover/shared.js +2 -0
- package/build-module/cover/shared.js.map +2 -2
- package/build-module/details/index.js +15 -0
- package/build-module/details/index.js.map +2 -2
- package/build-module/file/index.js +34 -1
- package/build-module/file/index.js.map +2 -2
- package/build-module/freeform/block.json +1 -1
- package/build-module/gallery/edit.js +0 -2
- package/build-module/gallery/edit.js.map +2 -2
- package/build-module/heading/index.js +15 -0
- package/build-module/heading/index.js.map +2 -2
- package/build-module/html/modal.js +141 -150
- package/build-module/html/modal.js.map +2 -2
- package/build-module/image/edit.js +0 -1
- package/build-module/image/edit.js.map +2 -2
- package/build-module/image/image.js +0 -1
- package/build-module/image/image.js.map +2 -2
- package/build-module/image/index.js +46 -0
- package/build-module/image/index.js.map +2 -2
- package/build-module/list-item/index.js +15 -0
- package/build-module/list-item/index.js.map +2 -2
- package/build-module/math/block.json +28 -1
- package/build-module/math/edit.js +4 -1
- package/build-module/math/edit.js.map +2 -2
- package/build-module/media-text/index.js +35 -0
- package/build-module/media-text/index.js.map +2 -2
- package/build-module/media-text/media-container.js +0 -2
- package/build-module/media-text/media-container.js.map +2 -2
- package/build-module/missing/block.json +1 -1
- package/build-module/missing/edit.js +2 -2
- package/build-module/missing/edit.js.map +1 -1
- package/build-module/more/index.js +16 -0
- package/build-module/more/index.js.map +2 -2
- package/build-module/navigation/block.json +2 -2
- package/build-module/navigation-link/block.json +2 -1
- package/build-module/navigation-link/edit.js +56 -15
- package/build-module/navigation-link/edit.js.map +2 -2
- package/build-module/navigation-link/index.js +26 -1
- package/build-module/navigation-link/index.js.map +2 -2
- package/build-module/navigation-link/shared/controls.js +12 -18
- package/build-module/navigation-link/shared/controls.js.map +2 -2
- package/build-module/navigation-link/shared/index.js +3 -1
- package/build-module/navigation-link/shared/index.js.map +2 -2
- package/build-module/navigation-link/shared/use-entity-binding.js +3 -2
- package/build-module/navigation-link/shared/use-entity-binding.js.map +2 -2
- package/build-module/navigation-submenu/block.json +2 -1
- package/build-module/navigation-submenu/index.js +26 -1
- package/build-module/navigation-submenu/index.js.map +2 -2
- package/build-module/paragraph/deprecated-attributes.js +37 -0
- package/build-module/paragraph/deprecated-attributes.js.map +7 -0
- package/build-module/paragraph/edit.js +2 -0
- package/build-module/paragraph/edit.js.map +2 -2
- package/build-module/paragraph/index.js +15 -0
- package/build-module/paragraph/index.js.map +2 -2
- package/build-module/pattern/block.json +1 -1
- package/build-module/post-comments-count/edit.js +1 -3
- package/build-module/post-comments-count/edit.js.map +2 -2
- package/build-module/post-comments-link/edit.js +10 -8
- package/build-module/post-comments-link/edit.js.map +2 -2
- package/build-module/preformatted/index.js +15 -0
- package/build-module/preformatted/index.js.map +2 -2
- package/build-module/pullquote/index.js +20 -0
- package/build-module/pullquote/index.js.map +2 -2
- package/build-module/search/index.js +26 -0
- package/build-module/search/index.js.map +2 -2
- package/build-module/social-link/index.js +25 -0
- package/build-module/social-link/index.js.map +2 -2
- package/build-module/social-links/edit.js +1 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/tabs/view.js +17 -4
- package/build-module/tabs/view.js.map +2 -2
- package/build-module/template-part/edit/index.js +37 -7
- package/build-module/template-part/edit/index.js.map +2 -2
- package/build-module/template-part/edit/utils/hooks.js +2 -3
- package/build-module/template-part/edit/utils/hooks.js.map +2 -2
- package/build-module/term-count/index.js +1 -0
- package/build-module/term-count/index.js.map +2 -2
- package/build-module/term-name/index.js +1 -0
- package/build-module/term-name/index.js.map +2 -2
- package/build-module/verse/index.js +15 -0
- package/build-module/verse/index.js.map +2 -2
- package/build-module/video/index.js +30 -0
- package/build-module/video/index.js.map +2 -2
- package/build-style/accordion/style-rtl.css +3 -0
- package/build-style/accordion/style.css +3 -0
- package/build-style/accordion-heading/style-rtl.css +1 -2
- package/build-style/accordion-heading/style.css +1 -2
- package/build-style/accordion-item/style-rtl.css +0 -7
- package/build-style/accordion-item/style.css +0 -7
- package/build-style/accordion-panel/style-rtl.css +1 -4
- package/build-style/accordion-panel/style.css +1 -4
- package/build-style/cover/style-rtl.css +47 -0
- package/build-style/cover/style.css +47 -0
- package/build-style/editor-rtl.css +11 -13
- package/build-style/editor.css +11 -13
- package/build-style/html/editor-rtl.css +11 -13
- package/build-style/html/editor.css +11 -13
- package/build-style/style-rtl.css +52 -12
- package/build-style/style.css +52 -12
- package/package.json +37 -37
- package/src/accordion/style.scss +4 -0
- package/src/accordion/view.js +60 -3
- package/src/accordion-heading/block.json +1 -1
- package/src/accordion-heading/deprecated.js +1 -1
- package/src/accordion-heading/style.scss +1 -9
- package/src/accordion-item/index.php +1 -0
- package/src/accordion-item/style.scss +2 -9
- package/src/accordion-panel/block.json +1 -1
- package/src/accordion-panel/style.scss +1 -5
- package/src/audio/index.js +31 -0
- package/src/breadcrumbs/edit.js +4 -2
- package/src/breadcrumbs/index.php +171 -100
- package/src/button/index.js +27 -0
- package/src/code/index.js +17 -0
- package/src/cover/edit/block-controls.js +26 -2
- package/src/cover/edit/cover-placeholder.js +0 -1
- package/src/cover/edit/embed-video-url-input.js +74 -0
- package/src/cover/edit/index.js +81 -0
- package/src/cover/embed-video-utils.js +196 -0
- package/src/cover/index.js +30 -0
- package/src/cover/index.php +106 -0
- package/src/cover/save.js +14 -0
- package/src/cover/shared.js +1 -0
- package/src/cover/style.scss +47 -0
- package/src/details/index.js +17 -0
- package/src/file/index.js +36 -1
- package/src/freeform/block.json +1 -1
- package/src/gallery/edit.js +0 -2
- package/src/heading/index.js +17 -0
- package/src/html/editor.scss +10 -15
- package/src/html/modal.js +23 -38
- package/src/image/edit.js +0 -1
- package/src/image/image.js +0 -1
- package/src/image/index.js +48 -0
- package/src/image/index.php +1 -0
- package/src/list-item/index.js +17 -0
- package/src/math/block.json +28 -1
- package/src/math/edit.js +4 -1
- package/src/media-text/index.js +37 -0
- package/src/media-text/media-container.js +0 -2
- package/src/missing/block.json +1 -1
- package/src/missing/edit.js +2 -2
- package/src/more/index.js +18 -0
- package/src/navigation/block.json +2 -2
- package/src/navigation-link/block.json +2 -1
- package/src/navigation-link/edit.js +98 -29
- package/src/navigation-link/index.js +28 -1
- package/src/navigation-link/shared/controls.js +13 -17
- package/src/navigation-link/shared/index.js +1 -1
- package/src/navigation-link/shared/use-entity-binding.js +5 -2
- package/src/navigation-submenu/block.json +2 -1
- package/src/navigation-submenu/index.js +28 -1
- package/src/paragraph/deprecated-attributes.js +45 -0
- package/src/paragraph/edit.js +2 -0
- package/src/paragraph/index.js +17 -0
- package/src/pattern/block.json +1 -1
- package/src/post-comments-count/edit.js +1 -9
- package/src/post-comments-link/edit.js +8 -18
- package/src/preformatted/index.js +17 -0
- package/src/pullquote/index.js +22 -0
- package/src/search/index.js +28 -0
- package/src/social-link/index.js +27 -0
- package/src/social-links/edit.js +1 -1
- package/src/style.scss +1 -0
- package/src/tabs/view.js +19 -4
- package/src/template-part/edit/index.js +44 -6
- package/src/template-part/edit/utils/hooks.js +2 -4
- package/src/term-count/index.js +1 -0
- package/src/term-name/index.js +1 -0
- package/src/verse/index.js +17 -0
- package/src/video/index.js +32 -0
package/src/heading/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { heading as icon } from '@wordpress/icons';
|
|
5
5
|
import { __, sprintf } from '@wordpress/i18n';
|
|
6
|
+
import { privateApis as blocksPrivateApis } from '@wordpress/blocks';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -14,6 +15,9 @@ import metadata from './block.json';
|
|
|
14
15
|
import save from './save';
|
|
15
16
|
import transforms from './transforms';
|
|
16
17
|
import variations from './variations';
|
|
18
|
+
import { unlock } from '../lock-unlock';
|
|
19
|
+
|
|
20
|
+
const { fieldsKey, formKey } = unlock( blocksPrivateApis );
|
|
17
21
|
|
|
18
22
|
const { name } = metadata;
|
|
19
23
|
|
|
@@ -69,4 +73,17 @@ export const settings = {
|
|
|
69
73
|
variations,
|
|
70
74
|
};
|
|
71
75
|
|
|
76
|
+
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
77
|
+
settings[ fieldsKey ] = [
|
|
78
|
+
{
|
|
79
|
+
id: 'content',
|
|
80
|
+
label: __( 'Content' ),
|
|
81
|
+
type: 'richtext',
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
settings[ formKey ] = {
|
|
85
|
+
fields: [ 'content' ],
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
|
|
72
89
|
export const init = () => initBlock( { name, metadata, settings } );
|
package/src/html/editor.scss
CHANGED
|
@@ -14,22 +14,20 @@
|
|
|
14
14
|
|
|
15
15
|
// Modal styles
|
|
16
16
|
.block-library-html__modal {
|
|
17
|
-
|
|
18
|
-
.components-modal__content {
|
|
19
|
-
display: flex;
|
|
20
|
-
flex-direction: column;
|
|
21
|
-
padding: 0;
|
|
22
|
-
min-height: 70vh;
|
|
23
|
-
}
|
|
17
|
+
height: 100%;
|
|
24
18
|
|
|
25
19
|
.components-modal__children-container {
|
|
26
20
|
height: 100%;
|
|
27
|
-
padding: $grid-unit-20;
|
|
28
21
|
}
|
|
29
22
|
}
|
|
30
23
|
|
|
31
24
|
.block-library-html__modal-tabs {
|
|
32
|
-
|
|
25
|
+
overflow-y: auto;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
.block-library-html__modal-content {
|
|
29
|
+
flex: 1;
|
|
30
|
+
min-height: 0;
|
|
33
31
|
}
|
|
34
32
|
|
|
35
33
|
.block-library-html__modal-tab {
|
|
@@ -73,10 +71,7 @@
|
|
|
73
71
|
display: flex;
|
|
74
72
|
align-items: center;
|
|
75
73
|
justify-content: center;
|
|
76
|
-
padding: $grid-unit-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
.block-library-html__modal-actions {
|
|
80
|
-
margin-top: $grid-unit-20;
|
|
81
|
-
padding: 0 $grid-unit-40 $grid-unit-40;
|
|
74
|
+
padding: $grid-unit-20;
|
|
75
|
+
flex: 1;
|
|
76
|
+
min-height: 0;
|
|
82
77
|
}
|
package/src/html/modal.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
|
-
import { useState
|
|
5
|
+
import { useState } from '@wordpress/element';
|
|
6
6
|
import { useSelect } from '@wordpress/data';
|
|
7
7
|
import {
|
|
8
8
|
Modal,
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
Flex,
|
|
11
11
|
privateApis as componentsPrivateApis,
|
|
12
12
|
__experimentalHStack as HStack,
|
|
13
|
-
|
|
13
|
+
__experimentalGrid as Grid,
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
import { PlainText, store as blockEditorStore } from '@wordpress/block-editor';
|
|
16
16
|
import { fullscreen, square } from '@wordpress/icons';
|
|
@@ -40,32 +40,17 @@ export default function HTMLEditModal( {
|
|
|
40
40
|
const [ isFullscreen, setIsFullscreen ] = useState( false );
|
|
41
41
|
|
|
42
42
|
// Check if user has permission to save scripts and get editor styles
|
|
43
|
-
const { canUserUseUnfilteredHTML
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
};
|
|
51
|
-
},
|
|
52
|
-
[]
|
|
53
|
-
);
|
|
43
|
+
const { canUserUseUnfilteredHTML } = useSelect( ( select ) => {
|
|
44
|
+
const settings = select( blockEditorStore ).getSettings();
|
|
45
|
+
return {
|
|
46
|
+
canUserUseUnfilteredHTML:
|
|
47
|
+
settings.__experimentalCanUserUseUnfilteredHTML,
|
|
48
|
+
};
|
|
49
|
+
}, [] );
|
|
54
50
|
|
|
55
51
|
// Show JS tab if user has permission OR if block contains JavaScript
|
|
56
52
|
const shouldShowJsTab = canUserUseUnfilteredHTML || js.trim() !== '';
|
|
57
53
|
|
|
58
|
-
// Combine all editor styles to inject into modal
|
|
59
|
-
const styleContent = useMemo( () => {
|
|
60
|
-
if ( ! editorStyles ) {
|
|
61
|
-
return '';
|
|
62
|
-
}
|
|
63
|
-
return editorStyles
|
|
64
|
-
.filter( ( style ) => style.css )
|
|
65
|
-
.map( ( style ) => style.css )
|
|
66
|
-
.join( '\n' );
|
|
67
|
-
}, [ editorStyles ] );
|
|
68
|
-
|
|
69
54
|
if ( ! isOpen ) {
|
|
70
55
|
return null;
|
|
71
56
|
}
|
|
@@ -131,14 +116,17 @@ export default function HTMLEditModal( {
|
|
|
131
116
|
isFullScreen={ isFullscreen }
|
|
132
117
|
__experimentalHideHeader
|
|
133
118
|
>
|
|
134
|
-
{ styleContent && (
|
|
135
|
-
<style
|
|
136
|
-
dangerouslySetInnerHTML={ { __html: styleContent } }
|
|
137
|
-
/>
|
|
138
|
-
) }
|
|
139
119
|
<Tabs orientation="horizontal" defaultTabId="html">
|
|
140
|
-
<
|
|
141
|
-
|
|
120
|
+
<Grid
|
|
121
|
+
columns={ 1 }
|
|
122
|
+
templateRows="auto 1fr auto"
|
|
123
|
+
gap={ 4 }
|
|
124
|
+
style={ { height: '100%' } }
|
|
125
|
+
>
|
|
126
|
+
<HStack
|
|
127
|
+
justify="space-between"
|
|
128
|
+
className="block-library-html__modal-header"
|
|
129
|
+
>
|
|
142
130
|
<div>
|
|
143
131
|
<Tabs.TabList>
|
|
144
132
|
<Tabs.Tab tabId="html">HTML</Tabs.Tab>
|
|
@@ -165,9 +153,8 @@ export default function HTMLEditModal( {
|
|
|
165
153
|
justify="flex-start"
|
|
166
154
|
spacing={ 4 }
|
|
167
155
|
className="block-library-html__modal-tabs"
|
|
168
|
-
style={ { flexGrow: 1 } }
|
|
169
156
|
>
|
|
170
|
-
<div
|
|
157
|
+
<div className="block-library-html__modal-content">
|
|
171
158
|
<Tabs.TabPanel
|
|
172
159
|
tabId="html"
|
|
173
160
|
focusable={ false }
|
|
@@ -212,10 +199,7 @@ export default function HTMLEditModal( {
|
|
|
212
199
|
</Tabs.TabPanel>
|
|
213
200
|
) }
|
|
214
201
|
</div>
|
|
215
|
-
<div
|
|
216
|
-
className="block-library-html__preview"
|
|
217
|
-
style={ { width: '50%' } }
|
|
218
|
-
>
|
|
202
|
+
<div className="block-library-html__preview">
|
|
219
203
|
<Preview
|
|
220
204
|
content={ serializeContent( {
|
|
221
205
|
html: editedHtml,
|
|
@@ -229,6 +213,7 @@ export default function HTMLEditModal( {
|
|
|
229
213
|
alignment="center"
|
|
230
214
|
justify="flex-end"
|
|
231
215
|
spacing={ 4 }
|
|
216
|
+
className="block-library-html__modal-footer"
|
|
232
217
|
>
|
|
233
218
|
<Button
|
|
234
219
|
__next40pxDefaultSize
|
|
@@ -245,7 +230,7 @@ export default function HTMLEditModal( {
|
|
|
245
230
|
{ __( 'Update' ) }
|
|
246
231
|
</Button>
|
|
247
232
|
</HStack>
|
|
248
|
-
</
|
|
233
|
+
</Grid>
|
|
249
234
|
</Tabs>
|
|
250
235
|
</Modal>
|
|
251
236
|
|
package/src/image/edit.js
CHANGED
|
@@ -464,7 +464,6 @@ export function ImageEdit( {
|
|
|
464
464
|
onSelectURL={ onSelectURL }
|
|
465
465
|
onError={ onUploadError }
|
|
466
466
|
placeholder={ placeholder }
|
|
467
|
-
accept="image/*"
|
|
468
467
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
469
468
|
handleUpload={ ( files ) => files.length === 1 }
|
|
470
469
|
value={ { id, src } }
|
package/src/image/image.js
CHANGED
package/src/image/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { image as icon } from '@wordpress/icons';
|
|
6
|
+
import { privateApis as blocksPrivateApis } from '@wordpress/blocks';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -13,6 +14,9 @@ import edit from './edit';
|
|
|
13
14
|
import metadata from './block.json';
|
|
14
15
|
import save from './save';
|
|
15
16
|
import transforms from './transforms';
|
|
17
|
+
import { unlock } from '../lock-unlock';
|
|
18
|
+
|
|
19
|
+
const { fieldsKey, formKey } = unlock( blocksPrivateApis );
|
|
16
20
|
|
|
17
21
|
const { name } = metadata;
|
|
18
22
|
|
|
@@ -62,4 +66,48 @@ export const settings = {
|
|
|
62
66
|
deprecated,
|
|
63
67
|
};
|
|
64
68
|
|
|
69
|
+
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
70
|
+
settings[ fieldsKey ] = [
|
|
71
|
+
{
|
|
72
|
+
id: 'image',
|
|
73
|
+
label: __( 'Image' ),
|
|
74
|
+
type: 'media',
|
|
75
|
+
mapping: {
|
|
76
|
+
id: 'id',
|
|
77
|
+
url: 'url',
|
|
78
|
+
caption: 'caption',
|
|
79
|
+
alt: 'alt',
|
|
80
|
+
},
|
|
81
|
+
args: {
|
|
82
|
+
allowedTypes: [ 'image' ],
|
|
83
|
+
multiple: false,
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
id: 'link',
|
|
88
|
+
label: __( 'Link' ),
|
|
89
|
+
type: 'link',
|
|
90
|
+
mapping: {
|
|
91
|
+
url: 'href',
|
|
92
|
+
rel: 'rel',
|
|
93
|
+
linkTarget: 'linkTarget',
|
|
94
|
+
destination: 'linkDestination',
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
id: 'caption',
|
|
99
|
+
label: __( 'Caption' ),
|
|
100
|
+
type: 'richtext',
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: 'alt',
|
|
104
|
+
label: __( 'Alt text' ),
|
|
105
|
+
type: 'text',
|
|
106
|
+
},
|
|
107
|
+
];
|
|
108
|
+
settings[ formKey ] = {
|
|
109
|
+
fields: [ 'image' ],
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
|
|
65
113
|
export const init = () => initBlock( { name, metadata, settings } );
|
package/src/image/index.php
CHANGED
|
@@ -196,6 +196,7 @@ function block_core_image_render_lightbox( $block_content, $block ) {
|
|
|
196
196
|
$img_styles = $processor->get_attribute( 'style' );
|
|
197
197
|
$img_width = 'none';
|
|
198
198
|
$img_height = 'none';
|
|
199
|
+
$img_srcset = false;
|
|
199
200
|
$aria_label = __( 'Enlarge' );
|
|
200
201
|
$dialog_aria_label = __( 'Enlarged image' );
|
|
201
202
|
|
package/src/list-item/index.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
4
5
|
import { listItem as icon } from '@wordpress/icons';
|
|
5
6
|
import { privateApis } from '@wordpress/block-editor';
|
|
7
|
+
import { privateApis as blocksPrivateApis } from '@wordpress/blocks';
|
|
6
8
|
|
|
7
9
|
/**
|
|
8
10
|
* Internal dependencies
|
|
@@ -14,6 +16,8 @@ import save from './save';
|
|
|
14
16
|
import transforms from './transforms';
|
|
15
17
|
import { unlock } from '../lock-unlock';
|
|
16
18
|
|
|
19
|
+
const { fieldsKey, formKey } = unlock( blocksPrivateApis );
|
|
20
|
+
|
|
17
21
|
const { name } = metadata;
|
|
18
22
|
|
|
19
23
|
export { metadata, name };
|
|
@@ -32,4 +36,17 @@ export const settings = {
|
|
|
32
36
|
[ unlock( privateApis ).requiresWrapperOnCopy ]: true,
|
|
33
37
|
};
|
|
34
38
|
|
|
39
|
+
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
40
|
+
settings[ fieldsKey ] = [
|
|
41
|
+
{
|
|
42
|
+
id: 'content',
|
|
43
|
+
label: __( 'Content' ),
|
|
44
|
+
type: 'richtext',
|
|
45
|
+
},
|
|
46
|
+
];
|
|
47
|
+
settings[ formKey ] = {
|
|
48
|
+
fields: [ 'content' ],
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
35
52
|
export const init = () => initBlock( { name, metadata, settings } );
|
package/src/math/block.json
CHANGED
|
@@ -8,7 +8,34 @@
|
|
|
8
8
|
"keywords": [ "equation", "formula", "latex", "mathematics" ],
|
|
9
9
|
"textdomain": "default",
|
|
10
10
|
"supports": {
|
|
11
|
-
"html": false
|
|
11
|
+
"html": false,
|
|
12
|
+
"__experimentalBorder": {
|
|
13
|
+
"color": true,
|
|
14
|
+
"radius": true,
|
|
15
|
+
"style": true,
|
|
16
|
+
"width": true
|
|
17
|
+
},
|
|
18
|
+
"color": {
|
|
19
|
+
"gradients": true,
|
|
20
|
+
"__experimentalDefaultControls": {
|
|
21
|
+
"background": true,
|
|
22
|
+
"text": true
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"spacing": {
|
|
26
|
+
"margin": true,
|
|
27
|
+
"padding": true,
|
|
28
|
+
"__experimentalDefaultControls": {
|
|
29
|
+
"margin": false,
|
|
30
|
+
"padding": false
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"typography": {
|
|
34
|
+
"fontSize": true,
|
|
35
|
+
"__experimentalDefaultControls": {
|
|
36
|
+
"fontSize": true
|
|
37
|
+
}
|
|
38
|
+
}
|
|
12
39
|
},
|
|
13
40
|
"attributes": {
|
|
14
41
|
"latex": {
|
package/src/math/edit.js
CHANGED
|
@@ -14,6 +14,7 @@ import {
|
|
|
14
14
|
} from '@wordpress/components';
|
|
15
15
|
import { useState, useEffect, useRef } from '@wordpress/element';
|
|
16
16
|
import { useDispatch } from '@wordpress/data';
|
|
17
|
+
import { speak } from '@wordpress/a11y';
|
|
17
18
|
|
|
18
19
|
/**
|
|
19
20
|
* Internal dependencies
|
|
@@ -72,7 +73,8 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
|
72
73
|
placement="bottom-start"
|
|
73
74
|
offset={ 8 }
|
|
74
75
|
anchor={ blockRef }
|
|
75
|
-
focusOnMount=
|
|
76
|
+
focusOnMount={ false }
|
|
77
|
+
__unstableSlotName="__unstable-block-tools-after"
|
|
76
78
|
>
|
|
77
79
|
<div style={ { padding: '4px', minWidth: '300px' } }>
|
|
78
80
|
<VStack spacing={ 1 }>
|
|
@@ -96,6 +98,7 @@ export default function MathEdit( { attributes, setAttributes, isSelected } ) {
|
|
|
96
98
|
setError( null );
|
|
97
99
|
} catch ( err ) {
|
|
98
100
|
setError( err.message );
|
|
101
|
+
speak( err.message );
|
|
99
102
|
}
|
|
100
103
|
setAttributes( {
|
|
101
104
|
mathML: newMathML,
|
package/src/media-text/index.js
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { mediaAndText as icon } from '@wordpress/icons';
|
|
6
|
+
import { privateApis as blocksPrivateApis } from '@wordpress/blocks';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -13,6 +14,9 @@ import edit from './edit';
|
|
|
13
14
|
import metadata from './block.json';
|
|
14
15
|
import save from './save';
|
|
15
16
|
import transforms from './transforms';
|
|
17
|
+
import { unlock } from '../lock-unlock';
|
|
18
|
+
|
|
19
|
+
const { fieldsKey, formKey } = unlock( blocksPrivateApis );
|
|
16
20
|
|
|
17
21
|
const { name } = metadata;
|
|
18
22
|
|
|
@@ -50,4 +54,37 @@ export const settings = {
|
|
|
50
54
|
deprecated,
|
|
51
55
|
};
|
|
52
56
|
|
|
57
|
+
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
58
|
+
settings[ fieldsKey ] = [
|
|
59
|
+
{
|
|
60
|
+
id: 'media',
|
|
61
|
+
label: __( 'Media' ),
|
|
62
|
+
type: 'media',
|
|
63
|
+
mapping: {
|
|
64
|
+
id: 'mediaId',
|
|
65
|
+
type: 'mediaType',
|
|
66
|
+
url: 'mediaUrl',
|
|
67
|
+
link: 'mediaLink',
|
|
68
|
+
},
|
|
69
|
+
args: {
|
|
70
|
+
allowedTypes: [ 'image', 'video' ],
|
|
71
|
+
multiple: false,
|
|
72
|
+
},
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
id: 'link',
|
|
76
|
+
label: __( 'Link' ),
|
|
77
|
+
type: 'link',
|
|
78
|
+
mapping: {
|
|
79
|
+
url: 'href',
|
|
80
|
+
rel: 'rel',
|
|
81
|
+
linkTarget: 'linkTarget',
|
|
82
|
+
},
|
|
83
|
+
},
|
|
84
|
+
];
|
|
85
|
+
settings[ formKey ] = {
|
|
86
|
+
fields: [ 'media' ],
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
53
90
|
export const init = () => initBlock( { name, metadata, settings } );
|
|
@@ -61,7 +61,6 @@ function ToolbarEditButton( {
|
|
|
61
61
|
mediaId={ mediaId }
|
|
62
62
|
mediaURL={ mediaUrl }
|
|
63
63
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
64
|
-
accept="image/*,video/*"
|
|
65
64
|
onSelect={ onSelectMedia }
|
|
66
65
|
onToggleFeaturedImage={ toggleUseFeaturedImage }
|
|
67
66
|
useFeaturedImage={ useFeaturedImage }
|
|
@@ -91,7 +90,6 @@ function PlaceholderContainer( {
|
|
|
91
90
|
} }
|
|
92
91
|
className={ className }
|
|
93
92
|
onSelect={ onSelectMedia }
|
|
94
|
-
accept="image/*,video/*"
|
|
95
93
|
onToggleFeaturedImage={ toggleUseFeaturedImage }
|
|
96
94
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
97
95
|
onError={ onUploadError }
|
package/src/missing/block.json
CHANGED
package/src/missing/edit.js
CHANGED
|
@@ -66,12 +66,12 @@ export default function MissingEdit( { attributes, clientId } ) {
|
|
|
66
66
|
) {
|
|
67
67
|
if ( hasHTMLBlock ) {
|
|
68
68
|
messageHTML = __(
|
|
69
|
-
'It appears you are trying to use the deprecated Classic block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely. Alternatively, you can
|
|
69
|
+
'It appears you are trying to use the deprecated Classic block. You can leave this block intact, convert its content to a Custom HTML block, or remove it entirely. Alternatively, if you have unsaved changes, you can save them and refresh to use the Classic block.'
|
|
70
70
|
);
|
|
71
71
|
actions.push( convertToHtmlButton );
|
|
72
72
|
} else {
|
|
73
73
|
messageHTML = __(
|
|
74
|
-
'It appears you are trying to use the deprecated Classic block. You can leave this block intact, or remove it entirely. Alternatively, you can
|
|
74
|
+
'It appears you are trying to use the deprecated Classic block. You can leave this block intact, or remove it entirely. Alternatively, if you have unsaved changes, you can save them and refresh to use the Classic block.'
|
|
75
75
|
);
|
|
76
76
|
}
|
|
77
77
|
} else if ( hasContent && hasHTMLBlock ) {
|
package/src/more/index.js
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { more as icon } from '@wordpress/icons';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { privateApis as blocksPrivateApis } from '@wordpress/blocks';
|
|
5
7
|
|
|
6
8
|
/**
|
|
7
9
|
* Internal dependencies
|
|
@@ -11,6 +13,9 @@ import edit from './edit';
|
|
|
11
13
|
import metadata from './block.json';
|
|
12
14
|
import save from './save';
|
|
13
15
|
import transforms from './transforms';
|
|
16
|
+
import { unlock } from '../lock-unlock';
|
|
17
|
+
|
|
18
|
+
const { fieldsKey, formKey } = unlock( blocksPrivateApis );
|
|
14
19
|
|
|
15
20
|
const { name } = metadata;
|
|
16
21
|
|
|
@@ -35,4 +40,17 @@ export const settings = {
|
|
|
35
40
|
save,
|
|
36
41
|
};
|
|
37
42
|
|
|
43
|
+
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
44
|
+
settings[ fieldsKey ] = [
|
|
45
|
+
{
|
|
46
|
+
id: 'customText',
|
|
47
|
+
label: __( 'Content' ),
|
|
48
|
+
type: 'richtext',
|
|
49
|
+
},
|
|
50
|
+
];
|
|
51
|
+
settings[ formKey ] = {
|
|
52
|
+
fields: [ 'customText' ],
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
|
|
38
56
|
export const init = () => initBlock( { name, metadata, settings } );
|
|
@@ -105,6 +105,7 @@
|
|
|
105
105
|
"supports": {
|
|
106
106
|
"align": [ "wide", "full" ],
|
|
107
107
|
"ariaLabel": true,
|
|
108
|
+
"contentRole": true,
|
|
108
109
|
"html": false,
|
|
109
110
|
"inserter": true,
|
|
110
111
|
"typography": {
|
|
@@ -138,8 +139,7 @@
|
|
|
138
139
|
}
|
|
139
140
|
},
|
|
140
141
|
"interactivity": true,
|
|
141
|
-
"renaming": false
|
|
142
|
-
"contentRole": true
|
|
142
|
+
"renaming": false
|
|
143
143
|
},
|
|
144
144
|
"editorStyle": "wp-block-navigation-editor",
|
|
145
145
|
"style": "wp-block-navigation"
|