@wordpress/block-library 8.30.0 → 8.32.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 +4 -0
- package/build/block/edit.js +22 -16
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.native.js +1 -1
- package/build/button/edit.native.js.map +1 -1
- package/build/code/save.js +3 -1
- package/build/code/save.js.map +1 -1
- package/build/cover/edit/index.js +2 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/details/edit.js +1 -0
- package/build/details/edit.js.map +1 -1
- package/build/file/edit.js +2 -0
- package/build/file/edit.js.map +1 -1
- package/build/heading/index.js +4 -3
- package/build/heading/index.js.map +1 -1
- package/build/image/edit.js +10 -39
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +27 -6
- package/build/image/image.js.map +1 -1
- package/build/media-text/edit.js +33 -9
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/index.js +5 -0
- package/build/media-text/index.js.map +1 -1
- package/build/media-text/media-container.js +30 -11
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/save.js +2 -2
- package/build/media-text/save.js.map +1 -1
- package/build/navigation/edit/index.js +23 -29
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/navigation-menu-delete-control.js +12 -20
- package/build/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +24 -23
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/placeholder/index.js +4 -4
- package/build/navigation/edit/placeholder/index.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +15 -12
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation/view.js +12 -2
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +52 -27
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +31 -9
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/pattern/edit.js +3 -1
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js +1 -0
- package/build/post-author/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +1 -0
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +16 -4
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +13 -2
- package/build/post-featured-image/index.js.map +1 -1
- package/build/post-featured-image/overlay-controls.js +82 -0
- package/build/post-featured-image/overlay-controls.js.map +1 -0
- package/build/post-featured-image/overlay.js +5 -54
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-navigation-link/edit.js +1 -0
- package/build/post-navigation-link/edit.js.map +1 -1
- package/build/post-terms/edit.js +2 -0
- package/build/post-terms/edit.js.map +1 -1
- package/build/quote/edit.js +18 -23
- package/build/quote/edit.js.map +1 -1
- package/build/read-more/edit.js +1 -0
- package/build/read-more/edit.js.map +1 -1
- package/build/search/edit.js +2 -0
- package/build/search/edit.js.map +1 -1
- package/build/search/edit.native.js +2 -2
- package/build/search/edit.native.js.map +1 -1
- package/build/site-tagline/edit.js +13 -4
- package/build/site-tagline/edit.js.map +1 -1
- package/build/site-tagline/index.js +4 -0
- package/build/site-tagline/index.js.map +1 -1
- package/build/social-link/edit.js +1 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-link/icons/medium.js +1 -1
- package/build/social-link/icons/medium.js.map +1 -1
- package/build/social-link/icons/reddit.js +1 -1
- package/build/social-link/icons/reddit.js.map +1 -1
- package/build/table/deprecated.js +285 -175
- package/build/table/deprecated.js.map +1 -1
- package/build/table/index.js +1 -1
- package/build/template-part/edit/index.js +55 -47
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +106 -10
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +1 -9
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/utils/caption.js +19 -13
- package/build/utils/caption.js.map +1 -1
- package/build/utils/hooks.js +1 -0
- package/build/utils/hooks.js.map +1 -1
- package/build/video/edit.native.js +1 -1
- package/build/video/edit.native.js.map +1 -1
- package/build-module/block/edit.js +23 -17
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.native.js +1 -1
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/code/save.js +3 -1
- package/build-module/code/save.js.map +1 -1
- package/build-module/cover/edit/index.js +2 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/details/edit.js +1 -0
- package/build-module/details/edit.js.map +1 -1
- package/build-module/file/edit.js +2 -0
- package/build-module/file/edit.js.map +1 -1
- package/build-module/heading/index.js +4 -3
- package/build-module/heading/index.js.map +1 -1
- package/build-module/image/edit.js +11 -40
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +27 -6
- package/build-module/image/image.js.map +1 -1
- package/build-module/media-text/edit.js +34 -10
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/index.js +5 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/media-text/media-container.js +31 -12
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/save.js +2 -2
- package/build-module/media-text/save.js.map +1 -1
- package/build-module/navigation/edit/index.js +24 -30
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-delete-control.js +15 -23
- package/build-module/navigation/edit/navigation-menu-delete-control.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +24 -23
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/placeholder/index.js +4 -4
- package/build-module/navigation/edit/placeholder/index.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +15 -12
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation/view.js +12 -2
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +55 -30
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +31 -9
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/pattern/edit.js +3 -1
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-author/edit.js +1 -0
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +1 -0
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +17 -5
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +13 -2
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/post-featured-image/overlay-controls.js +75 -0
- package/build-module/post-featured-image/overlay-controls.js.map +1 -0
- package/build-module/post-featured-image/overlay.js +7 -56
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-navigation-link/edit.js +1 -0
- package/build-module/post-navigation-link/edit.js.map +1 -1
- package/build-module/post-terms/edit.js +2 -0
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/quote/edit.js +20 -25
- package/build-module/quote/edit.js.map +1 -1
- package/build-module/read-more/edit.js +1 -0
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/search/edit.js +2 -0
- package/build-module/search/edit.js.map +1 -1
- package/build-module/search/edit.native.js +2 -2
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/site-tagline/edit.js +14 -5
- package/build-module/site-tagline/edit.js.map +1 -1
- package/build-module/site-tagline/index.js +4 -0
- package/build-module/site-tagline/index.js.map +1 -1
- package/build-module/social-link/edit.js +1 -1
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-link/icons/medium.js +1 -1
- package/build-module/social-link/icons/medium.js.map +1 -1
- package/build-module/social-link/icons/reddit.js +1 -1
- package/build-module/social-link/icons/reddit.js.map +1 -1
- package/build-module/table/deprecated.js +286 -176
- package/build-module/table/deprecated.js.map +1 -1
- package/build-module/table/index.js +1 -1
- package/build-module/template-part/edit/index.js +58 -50
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +108 -12
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +2 -10
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/utils/caption.js +19 -13
- package/build-module/utils/caption.js.map +1 -1
- package/build-module/utils/hooks.js +1 -0
- package/build-module/utils/hooks.js.map +1 -1
- package/build-module/video/edit.native.js +1 -1
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/audio/theme-rtl.css +1 -1
- package/build-style/audio/theme.css +1 -1
- package/build-style/cover/style-rtl.css +5 -2
- package/build-style/cover/style.css +5 -2
- package/build-style/editor-rtl.css +22 -12
- package/build-style/editor.css +22 -12
- package/build-style/embed/theme-rtl.css +1 -1
- package/build-style/embed/theme.css +1 -1
- package/build-style/file/editor-rtl.css +3 -0
- package/build-style/file/editor.css +3 -0
- package/build-style/image/editor-rtl.css +0 -3
- package/build-style/image/editor.css +0 -3
- package/build-style/image/theme-rtl.css +1 -1
- package/build-style/image/theme.css +1 -1
- package/build-style/media-text/editor-rtl.css +7 -1
- package/build-style/media-text/editor.css +7 -1
- package/build-style/pullquote/theme-rtl.css +2 -1
- package/build-style/pullquote/theme.css +2 -1
- package/build-style/quote/theme-rtl.css +6 -6
- package/build-style/quote/theme.css +6 -6
- package/build-style/search/style-rtl.css +10 -0
- package/build-style/search/style.css +10 -0
- package/build-style/social-links/editor-rtl.css +0 -4
- package/build-style/social-links/editor.css +0 -4
- package/build-style/social-links/style-rtl.css +2 -2
- package/build-style/social-links/style.css +2 -2
- package/build-style/style-rtl.css +17 -4
- package/build-style/style.css +17 -4
- package/build-style/table/theme-rtl.css +4 -3
- package/build-style/table/theme.css +4 -3
- package/build-style/template-part/editor-rtl.css +12 -4
- package/build-style/template-part/editor.css +12 -4
- package/build-style/template-part/theme-rtl.css +1 -1
- package/build-style/template-part/theme.css +1 -1
- package/build-style/theme-rtl.css +17 -15
- package/build-style/theme.css +17 -15
- package/build-style/video/theme-rtl.css +1 -1
- package/build-style/video/theme.css +1 -1
- package/package.json +34 -34
- package/src/archives/index.php +4 -0
- package/src/audio/theme.scss +1 -1
- package/src/avatar/index.php +6 -0
- package/src/block/edit.js +43 -32
- package/src/block/index.php +4 -0
- package/src/block/test/edit.native.js +67 -0
- package/src/button/edit.native.js +1 -1
- package/src/calendar/index.php +12 -0
- package/src/categories/index.php +6 -0
- package/src/code/save.js +7 -1
- package/src/comment-author-name/index.php +4 -0
- package/src/comment-content/index.php +4 -0
- package/src/comment-date/index.php +4 -0
- package/src/comment-edit-link/index.php +4 -0
- package/src/comment-reply-link/index.php +4 -0
- package/src/comment-template/index.php +4 -0
- package/src/comments/index.php +10 -0
- package/src/comments-pagination/index.php +4 -0
- package/src/comments-pagination-next/index.php +4 -0
- package/src/comments-pagination-numbers/index.php +4 -0
- package/src/comments-pagination-previous/index.php +4 -0
- package/src/comments-title/index.php +4 -0
- package/src/cover/edit/index.js +4 -1
- package/src/cover/index.php +4 -0
- package/src/cover/style.scss +6 -2
- package/src/details/edit.js +1 -0
- package/src/embed/theme.scss +1 -1
- package/src/file/edit.js +2 -0
- package/src/file/editor.scss +3 -0
- package/src/file/index.php +4 -0
- package/src/gallery/editor.scss +1 -1
- package/src/gallery/index.php +7 -1
- package/src/heading/index.js +4 -3
- package/src/heading/index.php +4 -0
- package/src/home-link/index.php +10 -0
- package/src/image/edit.js +11 -40
- package/src/image/editor.scss +2 -7
- package/src/image/image.js +25 -7
- package/src/image/index.php +12 -1
- package/src/image/theme.scss +1 -1
- package/src/latest-comments/index.php +4 -0
- package/src/latest-posts/index.php +8 -0
- package/src/loginout/index.php +4 -0
- package/src/media-text/block.json +5 -0
- package/src/media-text/edit.js +70 -19
- package/src/media-text/editor.scss +7 -1
- package/src/media-text/index.php +70 -0
- package/src/media-text/media-container.js +49 -9
- package/src/media-text/save.js +2 -2
- package/src/navigation/edit/index.js +67 -71
- package/src/navigation/edit/navigation-menu-delete-control.js +22 -49
- package/src/navigation/edit/navigation-menu-selector.js +39 -21
- package/src/navigation/edit/placeholder/index.js +4 -4
- package/src/navigation/edit/test/navigation-menu-selector.js +75 -53
- package/src/navigation/index.php +109 -26
- package/src/navigation/test/use-navigation-menu.js +21 -21
- package/src/navigation/use-navigation-menu.js +23 -9
- package/src/navigation/view.js +11 -2
- package/src/navigation-link/edit.js +64 -39
- package/src/navigation-link/index.php +14 -0
- package/src/navigation-submenu/edit.js +34 -10
- package/src/navigation-submenu/index.php +8 -0
- package/src/page-list/index.php +12 -0
- package/src/page-list-item/index.php +2 -0
- package/src/pattern/edit.js +4 -0
- package/src/pattern/index.php +2 -0
- package/src/post-author/edit.js +1 -0
- package/src/post-author/index.php +4 -0
- package/src/post-author-biography/index.php +4 -0
- package/src/post-author-name/index.php +4 -0
- package/src/post-comments-form/index.php +6 -0
- package/src/post-content/index.php +4 -0
- package/src/post-date/index.php +4 -0
- package/src/post-excerpt/edit.js +1 -0
- package/src/post-excerpt/index.php +4 -0
- package/src/post-featured-image/block.json +13 -2
- package/src/post-featured-image/edit.js +16 -1
- package/src/post-featured-image/editor.scss +1 -1
- package/src/post-featured-image/index.php +15 -0
- package/src/post-featured-image/overlay-controls.js +88 -0
- package/src/post-featured-image/overlay.js +17 -84
- package/src/post-navigation-link/edit.js +1 -0
- package/src/post-navigation-link/index.php +4 -0
- package/src/post-template/index.php +4 -0
- package/src/post-terms/edit.js +2 -0
- package/src/post-terms/index.php +6 -0
- package/src/post-title/index.php +2 -0
- package/src/pullquote/theme.scss +3 -1
- package/src/query/index.php +2 -0
- package/src/query-no-results/index.php +6 -0
- package/src/query-pagination/index.php +4 -0
- package/src/query-pagination-next/index.php +6 -0
- package/src/query-pagination-numbers/index.php +6 -0
- package/src/query-pagination-previous/index.php +4 -0
- package/src/query-title/index.php +4 -0
- package/src/quote/edit.js +27 -37
- package/src/quote/test/edit.native.js +4 -6
- package/src/quote/theme.scss +1 -2
- package/src/read-more/edit.js +1 -0
- package/src/read-more/index.php +4 -0
- package/src/rss/index.php +4 -0
- package/src/search/edit.js +2 -0
- package/src/search/edit.native.js +2 -2
- package/src/search/index.php +19 -1
- package/src/search/style.scss +11 -0
- package/src/shortcode/index.php +4 -0
- package/src/site-logo/editor.scss +2 -2
- package/src/site-logo/index.php +20 -0
- package/src/site-tagline/block.json +4 -0
- package/src/site-tagline/edit.js +16 -3
- package/src/site-tagline/index.php +13 -1
- package/src/site-title/index.php +4 -0
- package/src/social-link/edit.js +1 -1
- package/src/social-link/icons/medium.js +1 -1
- package/src/social-link/icons/reddit.js +1 -1
- package/src/social-link/index.php +22 -9
- package/src/social-link/socials-with-bg.scss +1 -1
- package/src/social-link/socials-without-bg.scss +1 -1
- package/src/social-links/editor.scss +1 -9
- package/src/table/block.json +1 -1
- package/src/table/deprecated.js +308 -175
- package/src/table/theme.scss +4 -2
- package/src/tag-cloud/index.php +4 -0
- package/src/template-part/edit/index.js +87 -79
- package/src/template-part/edit/inner-blocks.js +126 -13
- package/src/template-part/edit/selection-modal.js +1 -22
- package/src/template-part/editor.scss +11 -3
- package/src/template-part/index.php +12 -0
- package/src/template-part/theme.scss +1 -1
- package/src/term-description/index.php +4 -0
- package/src/utils/caption.js +19 -16
- package/src/utils/hooks.js +1 -0
- package/src/video/edit.native.js +2 -0
- package/src/video/editor.scss +2 -2
- package/src/video/theme.scss +1 -1
- package/tsconfig.json +1 -0
|
@@ -7,7 +7,7 @@ import classnames from 'classnames';
|
|
|
7
7
|
/**
|
|
8
8
|
* WordPress dependencies
|
|
9
9
|
*/
|
|
10
|
-
import { RichText, getColorClassName, useBlockProps, __experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles, __experimentalGetColorClassesAndStyles as getColorClassesAndStyles } from '@wordpress/block-editor';
|
|
10
|
+
import { RichText, getColorClassName, useBlockProps, __experimentalGetBorderClassesAndStyles as getBorderClassesAndStyles, __experimentalGetColorClassesAndStyles as getColorClassesAndStyles, __experimentalGetElementClassName } from '@wordpress/block-editor';
|
|
11
11
|
|
|
12
12
|
// As the previous arbitrary colors won't match theme color palettes, the hex
|
|
13
13
|
// value will be mapped to the style.color.background attribute as if it was
|
|
@@ -19,8 +19,246 @@ const oldColors = {
|
|
|
19
19
|
'subtle-pale-pink': '#fcf0ef'
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
+
// Fixed width table cells on by default.
|
|
23
|
+
const v4Query = {
|
|
24
|
+
content: {
|
|
25
|
+
type: 'rich-text',
|
|
26
|
+
source: 'rich-text'
|
|
27
|
+
},
|
|
28
|
+
tag: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
default: 'td',
|
|
31
|
+
source: 'tag'
|
|
32
|
+
},
|
|
33
|
+
scope: {
|
|
34
|
+
type: 'string',
|
|
35
|
+
source: 'attribute',
|
|
36
|
+
attribute: 'scope'
|
|
37
|
+
},
|
|
38
|
+
align: {
|
|
39
|
+
type: 'string',
|
|
40
|
+
source: 'attribute',
|
|
41
|
+
attribute: 'data-align'
|
|
42
|
+
},
|
|
43
|
+
colspan: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
source: 'attribute',
|
|
46
|
+
attribute: 'colspan'
|
|
47
|
+
},
|
|
48
|
+
rowspan: {
|
|
49
|
+
type: 'string',
|
|
50
|
+
source: 'attribute',
|
|
51
|
+
attribute: 'rowspan'
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
const v4 = {
|
|
55
|
+
attributes: {
|
|
56
|
+
hasFixedLayout: {
|
|
57
|
+
type: 'boolean',
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
caption: {
|
|
61
|
+
type: 'rich-text',
|
|
62
|
+
source: 'rich-text',
|
|
63
|
+
selector: 'figcaption'
|
|
64
|
+
},
|
|
65
|
+
head: {
|
|
66
|
+
type: 'array',
|
|
67
|
+
default: [],
|
|
68
|
+
source: 'query',
|
|
69
|
+
selector: 'thead tr',
|
|
70
|
+
query: {
|
|
71
|
+
cells: {
|
|
72
|
+
type: 'array',
|
|
73
|
+
default: [],
|
|
74
|
+
source: 'query',
|
|
75
|
+
selector: 'td,th',
|
|
76
|
+
query: v4Query
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
body: {
|
|
81
|
+
type: 'array',
|
|
82
|
+
default: [],
|
|
83
|
+
source: 'query',
|
|
84
|
+
selector: 'tbody tr',
|
|
85
|
+
query: {
|
|
86
|
+
cells: {
|
|
87
|
+
type: 'array',
|
|
88
|
+
default: [],
|
|
89
|
+
source: 'query',
|
|
90
|
+
selector: 'td,th',
|
|
91
|
+
query: v4Query
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
foot: {
|
|
96
|
+
type: 'array',
|
|
97
|
+
default: [],
|
|
98
|
+
source: 'query',
|
|
99
|
+
selector: 'tfoot tr',
|
|
100
|
+
query: {
|
|
101
|
+
cells: {
|
|
102
|
+
type: 'array',
|
|
103
|
+
default: [],
|
|
104
|
+
source: 'query',
|
|
105
|
+
selector: 'td,th',
|
|
106
|
+
query: v4Query
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
supports: {
|
|
112
|
+
anchor: true,
|
|
113
|
+
align: true,
|
|
114
|
+
color: {
|
|
115
|
+
__experimentalSkipSerialization: true,
|
|
116
|
+
gradients: true,
|
|
117
|
+
__experimentalDefaultControls: {
|
|
118
|
+
background: true,
|
|
119
|
+
text: true
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
spacing: {
|
|
123
|
+
margin: true,
|
|
124
|
+
padding: true,
|
|
125
|
+
__experimentalDefaultControls: {
|
|
126
|
+
margin: false,
|
|
127
|
+
padding: false
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
typography: {
|
|
131
|
+
fontSize: true,
|
|
132
|
+
lineHeight: true,
|
|
133
|
+
__experimentalFontFamily: true,
|
|
134
|
+
__experimentalFontStyle: true,
|
|
135
|
+
__experimentalFontWeight: true,
|
|
136
|
+
__experimentalLetterSpacing: true,
|
|
137
|
+
__experimentalTextTransform: true,
|
|
138
|
+
__experimentalTextDecoration: true,
|
|
139
|
+
__experimentalDefaultControls: {
|
|
140
|
+
fontSize: true
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
__experimentalBorder: {
|
|
144
|
+
__experimentalSkipSerialization: true,
|
|
145
|
+
color: true,
|
|
146
|
+
style: true,
|
|
147
|
+
width: true,
|
|
148
|
+
__experimentalDefaultControls: {
|
|
149
|
+
color: true,
|
|
150
|
+
style: true,
|
|
151
|
+
width: true
|
|
152
|
+
}
|
|
153
|
+
},
|
|
154
|
+
__experimentalSelector: '.wp-block-table > table',
|
|
155
|
+
interactivity: {
|
|
156
|
+
clientNavigation: true
|
|
157
|
+
}
|
|
158
|
+
},
|
|
159
|
+
save({
|
|
160
|
+
attributes
|
|
161
|
+
}) {
|
|
162
|
+
const {
|
|
163
|
+
hasFixedLayout,
|
|
164
|
+
head,
|
|
165
|
+
body,
|
|
166
|
+
foot,
|
|
167
|
+
caption
|
|
168
|
+
} = attributes;
|
|
169
|
+
const isEmpty = !head.length && !body.length && !foot.length;
|
|
170
|
+
if (isEmpty) {
|
|
171
|
+
return null;
|
|
172
|
+
}
|
|
173
|
+
const colorProps = getColorClassesAndStyles(attributes);
|
|
174
|
+
const borderProps = getBorderClassesAndStyles(attributes);
|
|
175
|
+
const classes = classnames(colorProps.className, borderProps.className, {
|
|
176
|
+
'has-fixed-layout': hasFixedLayout
|
|
177
|
+
});
|
|
178
|
+
const hasCaption = !RichText.isEmpty(caption);
|
|
179
|
+
const Section = ({
|
|
180
|
+
type,
|
|
181
|
+
rows
|
|
182
|
+
}) => {
|
|
183
|
+
if (!rows.length) {
|
|
184
|
+
return null;
|
|
185
|
+
}
|
|
186
|
+
const Tag = `t${type}`;
|
|
187
|
+
return createElement(Tag, null, rows.map(({
|
|
188
|
+
cells
|
|
189
|
+
}, rowIndex) => createElement("tr", {
|
|
190
|
+
key: rowIndex
|
|
191
|
+
}, cells.map(({
|
|
192
|
+
content,
|
|
193
|
+
tag,
|
|
194
|
+
scope,
|
|
195
|
+
align,
|
|
196
|
+
colspan,
|
|
197
|
+
rowspan
|
|
198
|
+
}, cellIndex) => {
|
|
199
|
+
const cellClasses = classnames({
|
|
200
|
+
[`has-text-align-${align}`]: align
|
|
201
|
+
});
|
|
202
|
+
return createElement(RichText.Content, {
|
|
203
|
+
className: cellClasses ? cellClasses : undefined,
|
|
204
|
+
"data-align": align,
|
|
205
|
+
tagName: tag,
|
|
206
|
+
value: content,
|
|
207
|
+
key: cellIndex,
|
|
208
|
+
scope: tag === 'th' ? scope : undefined,
|
|
209
|
+
colSpan: colspan,
|
|
210
|
+
rowSpan: rowspan
|
|
211
|
+
});
|
|
212
|
+
}))));
|
|
213
|
+
};
|
|
214
|
+
return createElement("figure", {
|
|
215
|
+
...useBlockProps.save()
|
|
216
|
+
}, createElement("table", {
|
|
217
|
+
className: classes === '' ? undefined : classes,
|
|
218
|
+
style: {
|
|
219
|
+
...colorProps.style,
|
|
220
|
+
...borderProps.style
|
|
221
|
+
}
|
|
222
|
+
}, createElement(Section, {
|
|
223
|
+
type: "head",
|
|
224
|
+
rows: head
|
|
225
|
+
}), createElement(Section, {
|
|
226
|
+
type: "body",
|
|
227
|
+
rows: body
|
|
228
|
+
}), createElement(Section, {
|
|
229
|
+
type: "foot",
|
|
230
|
+
rows: foot
|
|
231
|
+
})), hasCaption && createElement(RichText.Content, {
|
|
232
|
+
tagName: "figcaption",
|
|
233
|
+
value: caption,
|
|
234
|
+
className: __experimentalGetElementClassName('caption')
|
|
235
|
+
}));
|
|
236
|
+
}
|
|
237
|
+
};
|
|
238
|
+
|
|
22
239
|
// In #41140 support was added to global styles for caption elements which
|
|
23
240
|
// added a `wp-element-caption` classname to the embed figcaption element.
|
|
241
|
+
const v3Query = {
|
|
242
|
+
content: {
|
|
243
|
+
type: 'string',
|
|
244
|
+
source: 'html'
|
|
245
|
+
},
|
|
246
|
+
tag: {
|
|
247
|
+
type: 'string',
|
|
248
|
+
default: 'td',
|
|
249
|
+
source: 'tag'
|
|
250
|
+
},
|
|
251
|
+
scope: {
|
|
252
|
+
type: 'string',
|
|
253
|
+
source: 'attribute',
|
|
254
|
+
attribute: 'scope'
|
|
255
|
+
},
|
|
256
|
+
align: {
|
|
257
|
+
type: 'string',
|
|
258
|
+
source: 'attribute',
|
|
259
|
+
attribute: 'data-align'
|
|
260
|
+
}
|
|
261
|
+
};
|
|
24
262
|
const v3 = {
|
|
25
263
|
attributes: {
|
|
26
264
|
hasFixedLayout: {
|
|
@@ -44,27 +282,7 @@ const v3 = {
|
|
|
44
282
|
default: [],
|
|
45
283
|
source: 'query',
|
|
46
284
|
selector: 'td,th',
|
|
47
|
-
query:
|
|
48
|
-
content: {
|
|
49
|
-
type: 'string',
|
|
50
|
-
source: 'html'
|
|
51
|
-
},
|
|
52
|
-
tag: {
|
|
53
|
-
type: 'string',
|
|
54
|
-
default: 'td',
|
|
55
|
-
source: 'tag'
|
|
56
|
-
},
|
|
57
|
-
scope: {
|
|
58
|
-
type: 'string',
|
|
59
|
-
source: 'attribute',
|
|
60
|
-
attribute: 'scope'
|
|
61
|
-
},
|
|
62
|
-
align: {
|
|
63
|
-
type: 'string',
|
|
64
|
-
source: 'attribute',
|
|
65
|
-
attribute: 'data-align'
|
|
66
|
-
}
|
|
67
|
-
}
|
|
285
|
+
query: v3Query
|
|
68
286
|
}
|
|
69
287
|
}
|
|
70
288
|
},
|
|
@@ -79,27 +297,7 @@ const v3 = {
|
|
|
79
297
|
default: [],
|
|
80
298
|
source: 'query',
|
|
81
299
|
selector: 'td,th',
|
|
82
|
-
query:
|
|
83
|
-
content: {
|
|
84
|
-
type: 'string',
|
|
85
|
-
source: 'html'
|
|
86
|
-
},
|
|
87
|
-
tag: {
|
|
88
|
-
type: 'string',
|
|
89
|
-
default: 'td',
|
|
90
|
-
source: 'tag'
|
|
91
|
-
},
|
|
92
|
-
scope: {
|
|
93
|
-
type: 'string',
|
|
94
|
-
source: 'attribute',
|
|
95
|
-
attribute: 'scope'
|
|
96
|
-
},
|
|
97
|
-
align: {
|
|
98
|
-
type: 'string',
|
|
99
|
-
source: 'attribute',
|
|
100
|
-
attribute: 'data-align'
|
|
101
|
-
}
|
|
102
|
-
}
|
|
300
|
+
query: v3Query
|
|
103
301
|
}
|
|
104
302
|
}
|
|
105
303
|
},
|
|
@@ -114,27 +312,7 @@ const v3 = {
|
|
|
114
312
|
default: [],
|
|
115
313
|
source: 'query',
|
|
116
314
|
selector: 'td,th',
|
|
117
|
-
query:
|
|
118
|
-
content: {
|
|
119
|
-
type: 'string',
|
|
120
|
-
source: 'html'
|
|
121
|
-
},
|
|
122
|
-
tag: {
|
|
123
|
-
type: 'string',
|
|
124
|
-
default: 'td',
|
|
125
|
-
source: 'tag'
|
|
126
|
-
},
|
|
127
|
-
scope: {
|
|
128
|
-
type: 'string',
|
|
129
|
-
source: 'attribute',
|
|
130
|
-
attribute: 'scope'
|
|
131
|
-
},
|
|
132
|
-
align: {
|
|
133
|
-
type: 'string',
|
|
134
|
-
source: 'attribute',
|
|
135
|
-
attribute: 'data-align'
|
|
136
|
-
}
|
|
137
|
-
}
|
|
315
|
+
query: v3Query
|
|
138
316
|
}
|
|
139
317
|
}
|
|
140
318
|
}
|
|
@@ -256,6 +434,27 @@ const v3 = {
|
|
|
256
434
|
};
|
|
257
435
|
|
|
258
436
|
// Deprecation migrating table block to use colors block support feature.
|
|
437
|
+
const v2Query = {
|
|
438
|
+
content: {
|
|
439
|
+
type: 'string',
|
|
440
|
+
source: 'html'
|
|
441
|
+
},
|
|
442
|
+
tag: {
|
|
443
|
+
type: 'string',
|
|
444
|
+
default: 'td',
|
|
445
|
+
source: 'tag'
|
|
446
|
+
},
|
|
447
|
+
scope: {
|
|
448
|
+
type: 'string',
|
|
449
|
+
source: 'attribute',
|
|
450
|
+
attribute: 'scope'
|
|
451
|
+
},
|
|
452
|
+
align: {
|
|
453
|
+
type: 'string',
|
|
454
|
+
source: 'attribute',
|
|
455
|
+
attribute: 'data-align'
|
|
456
|
+
}
|
|
457
|
+
};
|
|
259
458
|
const v2 = {
|
|
260
459
|
attributes: {
|
|
261
460
|
hasFixedLayout: {
|
|
@@ -282,27 +481,7 @@ const v2 = {
|
|
|
282
481
|
default: [],
|
|
283
482
|
source: 'query',
|
|
284
483
|
selector: 'td,th',
|
|
285
|
-
query:
|
|
286
|
-
content: {
|
|
287
|
-
type: 'string',
|
|
288
|
-
source: 'html'
|
|
289
|
-
},
|
|
290
|
-
tag: {
|
|
291
|
-
type: 'string',
|
|
292
|
-
default: 'td',
|
|
293
|
-
source: 'tag'
|
|
294
|
-
},
|
|
295
|
-
scope: {
|
|
296
|
-
type: 'string',
|
|
297
|
-
source: 'attribute',
|
|
298
|
-
attribute: 'scope'
|
|
299
|
-
},
|
|
300
|
-
align: {
|
|
301
|
-
type: 'string',
|
|
302
|
-
source: 'attribute',
|
|
303
|
-
attribute: 'data-align'
|
|
304
|
-
}
|
|
305
|
-
}
|
|
484
|
+
query: v2Query
|
|
306
485
|
}
|
|
307
486
|
}
|
|
308
487
|
},
|
|
@@ -317,27 +496,7 @@ const v2 = {
|
|
|
317
496
|
default: [],
|
|
318
497
|
source: 'query',
|
|
319
498
|
selector: 'td,th',
|
|
320
|
-
query:
|
|
321
|
-
content: {
|
|
322
|
-
type: 'string',
|
|
323
|
-
source: 'html'
|
|
324
|
-
},
|
|
325
|
-
tag: {
|
|
326
|
-
type: 'string',
|
|
327
|
-
default: 'td',
|
|
328
|
-
source: 'tag'
|
|
329
|
-
},
|
|
330
|
-
scope: {
|
|
331
|
-
type: 'string',
|
|
332
|
-
source: 'attribute',
|
|
333
|
-
attribute: 'scope'
|
|
334
|
-
},
|
|
335
|
-
align: {
|
|
336
|
-
type: 'string',
|
|
337
|
-
source: 'attribute',
|
|
338
|
-
attribute: 'data-align'
|
|
339
|
-
}
|
|
340
|
-
}
|
|
499
|
+
query: v2Query
|
|
341
500
|
}
|
|
342
501
|
}
|
|
343
502
|
},
|
|
@@ -352,27 +511,7 @@ const v2 = {
|
|
|
352
511
|
default: [],
|
|
353
512
|
source: 'query',
|
|
354
513
|
selector: 'td,th',
|
|
355
|
-
query:
|
|
356
|
-
content: {
|
|
357
|
-
type: 'string',
|
|
358
|
-
source: 'html'
|
|
359
|
-
},
|
|
360
|
-
tag: {
|
|
361
|
-
type: 'string',
|
|
362
|
-
default: 'td',
|
|
363
|
-
source: 'tag'
|
|
364
|
-
},
|
|
365
|
-
scope: {
|
|
366
|
-
type: 'string',
|
|
367
|
-
source: 'attribute',
|
|
368
|
-
attribute: 'scope'
|
|
369
|
-
},
|
|
370
|
-
align: {
|
|
371
|
-
type: 'string',
|
|
372
|
-
source: 'attribute',
|
|
373
|
-
attribute: 'data-align'
|
|
374
|
-
}
|
|
375
|
-
}
|
|
514
|
+
query: v2Query
|
|
376
515
|
}
|
|
377
516
|
}
|
|
378
517
|
}
|
|
@@ -469,6 +608,22 @@ const v2 = {
|
|
|
469
608
|
};
|
|
470
609
|
}
|
|
471
610
|
};
|
|
611
|
+
const v1Query = {
|
|
612
|
+
content: {
|
|
613
|
+
type: 'string',
|
|
614
|
+
source: 'html'
|
|
615
|
+
},
|
|
616
|
+
tag: {
|
|
617
|
+
type: 'string',
|
|
618
|
+
default: 'td',
|
|
619
|
+
source: 'tag'
|
|
620
|
+
},
|
|
621
|
+
scope: {
|
|
622
|
+
type: 'string',
|
|
623
|
+
source: 'attribute',
|
|
624
|
+
attribute: 'scope'
|
|
625
|
+
}
|
|
626
|
+
};
|
|
472
627
|
const v1 = {
|
|
473
628
|
attributes: {
|
|
474
629
|
hasFixedLayout: {
|
|
@@ -489,22 +644,7 @@ const v1 = {
|
|
|
489
644
|
default: [],
|
|
490
645
|
source: 'query',
|
|
491
646
|
selector: 'td,th',
|
|
492
|
-
query:
|
|
493
|
-
content: {
|
|
494
|
-
type: 'string',
|
|
495
|
-
source: 'html'
|
|
496
|
-
},
|
|
497
|
-
tag: {
|
|
498
|
-
type: 'string',
|
|
499
|
-
default: 'td',
|
|
500
|
-
source: 'tag'
|
|
501
|
-
},
|
|
502
|
-
scope: {
|
|
503
|
-
type: 'string',
|
|
504
|
-
source: 'attribute',
|
|
505
|
-
attribute: 'scope'
|
|
506
|
-
}
|
|
507
|
-
}
|
|
647
|
+
query: v1Query
|
|
508
648
|
}
|
|
509
649
|
}
|
|
510
650
|
},
|
|
@@ -519,22 +659,7 @@ const v1 = {
|
|
|
519
659
|
default: [],
|
|
520
660
|
source: 'query',
|
|
521
661
|
selector: 'td,th',
|
|
522
|
-
query:
|
|
523
|
-
content: {
|
|
524
|
-
type: 'string',
|
|
525
|
-
source: 'html'
|
|
526
|
-
},
|
|
527
|
-
tag: {
|
|
528
|
-
type: 'string',
|
|
529
|
-
default: 'td',
|
|
530
|
-
source: 'tag'
|
|
531
|
-
},
|
|
532
|
-
scope: {
|
|
533
|
-
type: 'string',
|
|
534
|
-
source: 'attribute',
|
|
535
|
-
attribute: 'scope'
|
|
536
|
-
}
|
|
537
|
-
}
|
|
662
|
+
query: v1Query
|
|
538
663
|
}
|
|
539
664
|
}
|
|
540
665
|
},
|
|
@@ -549,22 +674,7 @@ const v1 = {
|
|
|
549
674
|
default: [],
|
|
550
675
|
source: 'query',
|
|
551
676
|
selector: 'td,th',
|
|
552
|
-
query:
|
|
553
|
-
content: {
|
|
554
|
-
type: 'string',
|
|
555
|
-
source: 'html'
|
|
556
|
-
},
|
|
557
|
-
tag: {
|
|
558
|
-
type: 'string',
|
|
559
|
-
default: 'td',
|
|
560
|
-
source: 'tag'
|
|
561
|
-
},
|
|
562
|
-
scope: {
|
|
563
|
-
type: 'string',
|
|
564
|
-
source: 'attribute',
|
|
565
|
-
attribute: 'scope'
|
|
566
|
-
}
|
|
567
|
-
}
|
|
677
|
+
query: v1Query
|
|
568
678
|
}
|
|
569
679
|
}
|
|
570
680
|
}
|
|
@@ -637,5 +747,5 @@ const v1 = {
|
|
|
637
747
|
*
|
|
638
748
|
* See block-deprecation.md
|
|
639
749
|
*/
|
|
640
|
-
export default [v3, v2, v1];
|
|
750
|
+
export default [v4, v3, v2, v1];
|
|
641
751
|
//# sourceMappingURL=deprecated.js.map
|