@wordpress/block-library 9.35.1-next.dc3f6d3c1.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 +12 -9
- package/build/audio/index.js.map +3 -3
- package/build/button/index.js +13 -10
- package/build/button/index.js.map +3 -3
- package/build/code/index.js +9 -6
- 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 +10 -4
- 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 +9 -6
- package/build/details/index.js.map +3 -3
- package/build/file/index.js +14 -14
- 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 +9 -6
- package/build/heading/index.js.map +3 -3
- package/build/html/modal.js +127 -118
- 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 +18 -18
- package/build/image/index.js.map +3 -3
- package/build/list-item/index.js +8 -6
- 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 +15 -8
- 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 +9 -6
- package/build/more/index.js.map +3 -3
- package/build/navigation-link/edit.js +36 -11
- package/build/navigation-link/edit.js.map +2 -2
- package/build/navigation-link/index.js +11 -8
- package/build/navigation-link/index.js.map +3 -3
- package/build/navigation-submenu/index.js +11 -8
- 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 +9 -6
- package/build/paragraph/index.js.map +3 -3
- package/build/pattern/block.json +1 -1
- package/build/preformatted/index.js +9 -6
- package/build/preformatted/index.js.map +3 -3
- package/build/pullquote/index.js +11 -11
- package/build/pullquote/index.js.map +3 -3
- package/build/search/index.js +14 -16
- package/build/search/index.js.map +3 -3
- package/build/social-link/index.js +11 -8
- package/build/social-link/index.js.map +3 -3
- 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 +9 -6
- package/build/verse/index.js.map +3 -3
- package/build/video/index.js +12 -9
- 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 +12 -9
- package/build-module/audio/index.js.map +2 -2
- package/build-module/button/index.js +13 -10
- package/build-module/button/index.js.map +2 -2
- package/build-module/code/index.js +9 -6
- 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 +10 -4
- 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 +9 -6
- package/build-module/details/index.js.map +2 -2
- package/build-module/file/index.js +14 -14
- 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 +9 -6
- package/build-module/heading/index.js.map +2 -2
- package/build-module/html/modal.js +128 -119
- 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 +18 -18
- package/build-module/image/index.js.map +2 -2
- package/build-module/list-item/index.js +8 -6
- 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 +15 -8
- 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 +9 -6
- package/build-module/more/index.js.map +2 -2
- package/build-module/navigation-link/edit.js +37 -12
- package/build-module/navigation-link/edit.js.map +2 -2
- package/build-module/navigation-link/index.js +11 -8
- package/build-module/navigation-link/index.js.map +2 -2
- package/build-module/navigation-submenu/index.js +11 -8
- 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 +9 -6
- package/build-module/paragraph/index.js.map +2 -2
- package/build-module/pattern/block.json +1 -1
- package/build-module/preformatted/index.js +9 -6
- package/build-module/preformatted/index.js.map +2 -2
- package/build-module/pullquote/index.js +11 -11
- package/build-module/pullquote/index.js.map +2 -2
- package/build-module/search/index.js +14 -16
- package/build-module/search/index.js.map +2 -2
- package/build-module/social-link/index.js +11 -8
- package/build-module/social-link/index.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 +9 -6
- package/build-module/verse/index.js.map +2 -2
- package/build-module/video/index.js +12 -9
- 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 +13 -9
- package/src/breadcrumbs/index.php +71 -82
- package/src/button/index.js +14 -10
- package/src/code/index.js +10 -6
- 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 +11 -4
- 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 +10 -6
- package/src/file/index.js +15 -14
- package/src/freeform/block.json +1 -1
- package/src/gallery/edit.js +0 -2
- package/src/heading/index.js +10 -6
- package/src/html/editor.scss +10 -15
- package/src/html/modal.js +15 -10
- package/src/image/edit.js +0 -1
- package/src/image/image.js +0 -1
- package/src/image/index.js +19 -18
- package/src/image/index.php +1 -0
- package/src/list-item/index.js +9 -6
- package/src/math/block.json +28 -1
- package/src/math/edit.js +4 -1
- package/src/media-text/index.js +16 -8
- 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 +10 -6
- package/src/navigation-link/edit.js +72 -26
- package/src/navigation-link/index.js +12 -8
- package/src/navigation-submenu/index.js +12 -8
- package/src/paragraph/deprecated-attributes.js +45 -0
- package/src/paragraph/edit.js +2 -0
- package/src/paragraph/index.js +10 -6
- package/src/pattern/block.json +1 -1
- package/src/preformatted/index.js +10 -6
- package/src/pullquote/index.js +12 -11
- package/src/search/index.js +14 -15
- package/src/social-link/index.js +12 -8
- package/src/style.scss +1 -0
- 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 +10 -6
- package/src/video/index.js +13 -9
package/src/gallery/edit.js
CHANGED
|
@@ -596,7 +596,6 @@ export default function GalleryEdit( props ) {
|
|
|
596
596
|
instructions: PLACEHOLDER_TEXT,
|
|
597
597
|
} }
|
|
598
598
|
onSelect={ updateImages }
|
|
599
|
-
accept="image/*"
|
|
600
599
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
601
600
|
multiple
|
|
602
601
|
onError={ onUploadError }
|
|
@@ -910,7 +909,6 @@ export default function GalleryEdit( props ) {
|
|
|
910
909
|
<BlockControls group="other">
|
|
911
910
|
<MediaReplaceFlow
|
|
912
911
|
allowedTypes={ ALLOWED_MEDIA_TYPES }
|
|
913
|
-
accept="image/*"
|
|
914
912
|
handleUpload={ false }
|
|
915
913
|
onSelect={ updateImages }
|
|
916
914
|
name={ __( 'Add' ) }
|
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
|
|
|
@@ -70,16 +74,16 @@ export const settings = {
|
|
|
70
74
|
};
|
|
71
75
|
|
|
72
76
|
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
73
|
-
settings
|
|
77
|
+
settings[ fieldsKey ] = [
|
|
74
78
|
{
|
|
79
|
+
id: 'content',
|
|
75
80
|
label: __( 'Content' ),
|
|
76
|
-
type: '
|
|
77
|
-
shownByDefault: true,
|
|
78
|
-
mapping: {
|
|
79
|
-
value: 'content',
|
|
80
|
-
},
|
|
81
|
+
type: 'richtext',
|
|
81
82
|
},
|
|
82
83
|
];
|
|
84
|
+
settings[ formKey ] = {
|
|
85
|
+
fields: [ 'content' ],
|
|
86
|
+
};
|
|
83
87
|
}
|
|
84
88
|
|
|
85
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
|
@@ -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';
|
|
@@ -117,8 +117,16 @@ export default function HTMLEditModal( {
|
|
|
117
117
|
__experimentalHideHeader
|
|
118
118
|
>
|
|
119
119
|
<Tabs orientation="horizontal" defaultTabId="html">
|
|
120
|
-
<
|
|
121
|
-
|
|
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
|
+
>
|
|
122
130
|
<div>
|
|
123
131
|
<Tabs.TabList>
|
|
124
132
|
<Tabs.Tab tabId="html">HTML</Tabs.Tab>
|
|
@@ -145,9 +153,8 @@ export default function HTMLEditModal( {
|
|
|
145
153
|
justify="flex-start"
|
|
146
154
|
spacing={ 4 }
|
|
147
155
|
className="block-library-html__modal-tabs"
|
|
148
|
-
style={ { flexGrow: 1 } }
|
|
149
156
|
>
|
|
150
|
-
<div
|
|
157
|
+
<div className="block-library-html__modal-content">
|
|
151
158
|
<Tabs.TabPanel
|
|
152
159
|
tabId="html"
|
|
153
160
|
focusable={ false }
|
|
@@ -192,10 +199,7 @@ export default function HTMLEditModal( {
|
|
|
192
199
|
</Tabs.TabPanel>
|
|
193
200
|
) }
|
|
194
201
|
</div>
|
|
195
|
-
<div
|
|
196
|
-
className="block-library-html__preview"
|
|
197
|
-
style={ { width: '50%' } }
|
|
198
|
-
>
|
|
202
|
+
<div className="block-library-html__preview">
|
|
199
203
|
<Preview
|
|
200
204
|
content={ serializeContent( {
|
|
201
205
|
html: editedHtml,
|
|
@@ -209,6 +213,7 @@ export default function HTMLEditModal( {
|
|
|
209
213
|
alignment="center"
|
|
210
214
|
justify="flex-end"
|
|
211
215
|
spacing={ 4 }
|
|
216
|
+
className="block-library-html__modal-footer"
|
|
212
217
|
>
|
|
213
218
|
<Button
|
|
214
219
|
__next40pxDefaultSize
|
|
@@ -225,7 +230,7 @@ export default function HTMLEditModal( {
|
|
|
225
230
|
{ __( 'Update' ) }
|
|
226
231
|
</Button>
|
|
227
232
|
</HStack>
|
|
228
|
-
</
|
|
233
|
+
</Grid>
|
|
229
234
|
</Tabs>
|
|
230
235
|
</Modal>
|
|
231
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
|
|
|
@@ -63,14 +67,14 @@ export const settings = {
|
|
|
63
67
|
};
|
|
64
68
|
|
|
65
69
|
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
66
|
-
settings
|
|
70
|
+
settings[ fieldsKey ] = [
|
|
67
71
|
{
|
|
72
|
+
id: 'image',
|
|
68
73
|
label: __( 'Image' ),
|
|
69
|
-
type: '
|
|
70
|
-
shownByDefault: true,
|
|
74
|
+
type: 'media',
|
|
71
75
|
mapping: {
|
|
72
76
|
id: 'id',
|
|
73
|
-
|
|
77
|
+
url: 'url',
|
|
74
78
|
caption: 'caption',
|
|
75
79
|
alt: 'alt',
|
|
76
80
|
},
|
|
@@ -80,33 +84,30 @@ if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
|
80
84
|
},
|
|
81
85
|
},
|
|
82
86
|
{
|
|
87
|
+
id: 'link',
|
|
83
88
|
label: __( 'Link' ),
|
|
84
|
-
type: '
|
|
85
|
-
shownByDefault: false,
|
|
89
|
+
type: 'link',
|
|
86
90
|
mapping: {
|
|
87
|
-
|
|
91
|
+
url: 'href',
|
|
88
92
|
rel: 'rel',
|
|
89
|
-
|
|
93
|
+
linkTarget: 'linkTarget',
|
|
90
94
|
destination: 'linkDestination',
|
|
91
95
|
},
|
|
92
96
|
},
|
|
93
97
|
{
|
|
98
|
+
id: 'caption',
|
|
94
99
|
label: __( 'Caption' ),
|
|
95
|
-
type: '
|
|
96
|
-
shownByDefault: false,
|
|
97
|
-
mapping: {
|
|
98
|
-
value: 'caption',
|
|
99
|
-
},
|
|
100
|
+
type: 'richtext',
|
|
100
101
|
},
|
|
101
102
|
{
|
|
103
|
+
id: 'alt',
|
|
102
104
|
label: __( 'Alt text' ),
|
|
103
|
-
type: '
|
|
104
|
-
shownByDefault: false,
|
|
105
|
-
mapping: {
|
|
106
|
-
value: 'alt',
|
|
107
|
-
},
|
|
105
|
+
type: 'text',
|
|
108
106
|
},
|
|
109
107
|
];
|
|
108
|
+
settings[ formKey ] = {
|
|
109
|
+
fields: [ 'image' ],
|
|
110
|
+
};
|
|
110
111
|
}
|
|
111
112
|
|
|
112
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
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { listItem as icon } from '@wordpress/icons';
|
|
6
6
|
import { privateApis } from '@wordpress/block-editor';
|
|
7
|
+
import { privateApis as blocksPrivateApis } from '@wordpress/blocks';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Internal dependencies
|
|
@@ -15,6 +16,8 @@ import save from './save';
|
|
|
15
16
|
import transforms from './transforms';
|
|
16
17
|
import { unlock } from '../lock-unlock';
|
|
17
18
|
|
|
19
|
+
const { fieldsKey, formKey } = unlock( blocksPrivateApis );
|
|
20
|
+
|
|
18
21
|
const { name } = metadata;
|
|
19
22
|
|
|
20
23
|
export { metadata, name };
|
|
@@ -34,16 +37,16 @@ export const settings = {
|
|
|
34
37
|
};
|
|
35
38
|
|
|
36
39
|
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
37
|
-
settings
|
|
40
|
+
settings[ fieldsKey ] = [
|
|
38
41
|
{
|
|
42
|
+
id: 'content',
|
|
39
43
|
label: __( 'Content' ),
|
|
40
|
-
type: '
|
|
41
|
-
shownByDefault: true,
|
|
42
|
-
mapping: {
|
|
43
|
-
value: 'content',
|
|
44
|
-
},
|
|
44
|
+
type: 'richtext',
|
|
45
45
|
},
|
|
46
46
|
];
|
|
47
|
+
settings[ formKey ] = {
|
|
48
|
+
fields: [ 'content' ],
|
|
49
|
+
};
|
|
47
50
|
}
|
|
48
51
|
|
|
49
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
|
|
|
@@ -51,15 +55,16 @@ export const settings = {
|
|
|
51
55
|
};
|
|
52
56
|
|
|
53
57
|
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
54
|
-
settings
|
|
58
|
+
settings[ fieldsKey ] = [
|
|
55
59
|
{
|
|
60
|
+
id: 'media',
|
|
56
61
|
label: __( 'Media' ),
|
|
57
|
-
type: '
|
|
58
|
-
shownByDefault: true,
|
|
62
|
+
type: 'media',
|
|
59
63
|
mapping: {
|
|
60
64
|
id: 'mediaId',
|
|
61
65
|
type: 'mediaType',
|
|
62
|
-
|
|
66
|
+
url: 'mediaUrl',
|
|
67
|
+
link: 'mediaLink',
|
|
63
68
|
},
|
|
64
69
|
args: {
|
|
65
70
|
allowedTypes: [ 'image', 'video' ],
|
|
@@ -67,16 +72,19 @@ if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
|
67
72
|
},
|
|
68
73
|
},
|
|
69
74
|
{
|
|
75
|
+
id: 'link',
|
|
70
76
|
label: __( 'Link' ),
|
|
71
|
-
type: '
|
|
72
|
-
shownByDefault: false,
|
|
77
|
+
type: 'link',
|
|
73
78
|
mapping: {
|
|
74
|
-
|
|
79
|
+
url: 'href',
|
|
75
80
|
rel: 'rel',
|
|
76
|
-
|
|
81
|
+
linkTarget: 'linkTarget',
|
|
77
82
|
},
|
|
78
83
|
},
|
|
79
84
|
];
|
|
85
|
+
settings[ formKey ] = {
|
|
86
|
+
fields: [ 'media' ],
|
|
87
|
+
};
|
|
80
88
|
}
|
|
81
89
|
|
|
82
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
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { more as icon } from '@wordpress/icons';
|
|
5
5
|
import { __ } from '@wordpress/i18n';
|
|
6
|
+
import { privateApis as blocksPrivateApis } from '@wordpress/blocks';
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Internal dependencies
|
|
@@ -12,6 +13,9 @@ import edit from './edit';
|
|
|
12
13
|
import metadata from './block.json';
|
|
13
14
|
import save from './save';
|
|
14
15
|
import transforms from './transforms';
|
|
16
|
+
import { unlock } from '../lock-unlock';
|
|
17
|
+
|
|
18
|
+
const { fieldsKey, formKey } = unlock( blocksPrivateApis );
|
|
15
19
|
|
|
16
20
|
const { name } = metadata;
|
|
17
21
|
|
|
@@ -37,16 +41,16 @@ export const settings = {
|
|
|
37
41
|
};
|
|
38
42
|
|
|
39
43
|
if ( window.__experimentalContentOnlyPatternInsertion ) {
|
|
40
|
-
settings
|
|
44
|
+
settings[ fieldsKey ] = [
|
|
41
45
|
{
|
|
46
|
+
id: 'customText',
|
|
42
47
|
label: __( 'Content' ),
|
|
43
|
-
type: '
|
|
44
|
-
shownByDefault: true,
|
|
45
|
-
mapping: {
|
|
46
|
-
value: 'customText',
|
|
47
|
-
},
|
|
48
|
+
type: 'richtext',
|
|
48
49
|
},
|
|
49
50
|
];
|
|
51
|
+
settings[ formKey ] = {
|
|
52
|
+
fields: [ 'customText' ],
|
|
53
|
+
};
|
|
50
54
|
}
|
|
51
55
|
|
|
52
56
|
export const init = () => initBlock( { name, metadata, settings } );
|