@wordpress/block-library 7.14.8 → 7.14.10
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/embed/deprecated.js +43 -4
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/variations.js +1 -1
- package/build/embed/variations.js.map +1 -1
- package/build/file/deprecated.js +108 -4
- package/build/file/deprecated.js.map +1 -1
- package/build/gallery/deprecated.js +147 -22
- package/build/gallery/deprecated.js.map +1 -1
- package/build/table/deprecated.js +282 -27
- package/build/table/deprecated.js.map +1 -1
- package/build/video/deprecated.js +159 -0
- package/build/video/deprecated.js.map +1 -0
- package/build/video/index.js +3 -0
- package/build/video/index.js.map +1 -1
- package/build-module/embed/deprecated.js +44 -5
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/variations.js +1 -1
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/deprecated.js +108 -4
- package/build-module/file/deprecated.js.map +1 -1
- package/build-module/gallery/deprecated.js +145 -23
- package/build-module/gallery/deprecated.js.map +1 -1
- package/build-module/table/deprecated.js +282 -27
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/video/deprecated.js +147 -0
- package/build-module/video/deprecated.js.map +1 -0
- package/build-module/video/index.js +2 -0
- package/build-module/video/index.js.map +1 -1
- package/build-style/button/style-rtl.css +1 -0
- package/build-style/button/style.css +1 -0
- package/build-style/style-rtl.css +1 -0
- package/build-style/style.css +1 -0
- package/package.json +4 -4
- package/src/button/style.scss +2 -0
- package/src/embed/deprecated.js +53 -26
- package/src/embed/variations.js +1 -1
- package/src/file/deprecated.js +130 -2
- package/src/gallery/deprecated.js +127 -2
- package/src/post-featured-image/index.php +1 -1
- package/src/table/deprecated.js +587 -348
- package/src/video/deprecated.js +57 -0
- package/src/video/index.js +2 -0
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { RichText, useBlockProps } from '@wordpress/block-editor';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Internal dependencies
|
|
8
|
+
*/
|
|
9
|
+
import metadata from './block.json';
|
|
10
|
+
import Tracks from './tracks';
|
|
11
|
+
|
|
12
|
+
const { attributes: blockAttributes } = metadata;
|
|
13
|
+
|
|
14
|
+
// In #41140 support was added to global styles for caption elements which added a `wp-element-caption` classname
|
|
15
|
+
// to the video figcaption element.
|
|
16
|
+
const v1 = {
|
|
17
|
+
attributes: blockAttributes,
|
|
18
|
+
save( { attributes } ) {
|
|
19
|
+
const {
|
|
20
|
+
autoplay,
|
|
21
|
+
caption,
|
|
22
|
+
controls,
|
|
23
|
+
loop,
|
|
24
|
+
muted,
|
|
25
|
+
poster,
|
|
26
|
+
preload,
|
|
27
|
+
src,
|
|
28
|
+
playsInline,
|
|
29
|
+
tracks,
|
|
30
|
+
} = attributes;
|
|
31
|
+
return (
|
|
32
|
+
<figure { ...useBlockProps.save() }>
|
|
33
|
+
{ src && (
|
|
34
|
+
<video
|
|
35
|
+
autoPlay={ autoplay }
|
|
36
|
+
controls={ controls }
|
|
37
|
+
loop={ loop }
|
|
38
|
+
muted={ muted }
|
|
39
|
+
poster={ poster }
|
|
40
|
+
preload={ preload !== 'metadata' ? preload : undefined }
|
|
41
|
+
src={ src }
|
|
42
|
+
playsInline={ playsInline }
|
|
43
|
+
>
|
|
44
|
+
<Tracks tracks={ tracks } />
|
|
45
|
+
</video>
|
|
46
|
+
) }
|
|
47
|
+
{ ! RichText.isEmpty( caption ) && (
|
|
48
|
+
<RichText.Content tagName="figcaption" value={ caption } />
|
|
49
|
+
) }
|
|
50
|
+
</figure>
|
|
51
|
+
);
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
const deprecated = [ v1 ];
|
|
56
|
+
|
|
57
|
+
export default deprecated;
|
package/src/video/index.js
CHANGED
|
@@ -8,6 +8,7 @@ import { video as icon } from '@wordpress/icons';
|
|
|
8
8
|
* Internal dependencies
|
|
9
9
|
*/
|
|
10
10
|
import initBlock from '../utils/init-block';
|
|
11
|
+
import deprecated from './deprecated';
|
|
11
12
|
import edit from './edit';
|
|
12
13
|
import metadata from './block.json';
|
|
13
14
|
import save from './save';
|
|
@@ -27,6 +28,7 @@ export const settings = {
|
|
|
27
28
|
},
|
|
28
29
|
},
|
|
29
30
|
transforms,
|
|
31
|
+
deprecated,
|
|
30
32
|
edit,
|
|
31
33
|
save,
|
|
32
34
|
};
|