@wordpress/block-library 8.21.0 → 8.21.1-next.f8d8eceb.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/build/avatar/index.js +5 -1
- package/build/avatar/index.js.map +1 -1
- package/build/block/edit-title.native.js +11 -3
- package/build/block/edit-title.native.js.map +1 -1
- package/build/column/edit.js +2 -1
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js +2 -1
- package/build/column/edit.native.js.map +1 -1
- package/build/columns/edit.native.js +2 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/cover/controls.native.js +2 -1
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/edit/index.js +2 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/file/view.js +1 -1
- package/build/file/view.js.map +1 -1
- package/build/form/edit.js +1 -1
- package/build/form/edit.js.map +1 -1
- package/build/form/variations.js +1 -1
- package/build/form/variations.js.map +1 -1
- package/build/form-input/index.js +1 -1
- package/build/form-input/variations.js +7 -7
- package/build/form-input/variations.js.map +1 -1
- package/build/form-submission-notification/variations.js +4 -4
- package/build/form-submission-notification/variations.js.map +1 -1
- package/build/form-submit-button/index.js +1 -1
- package/build/group/edit.js +2 -11
- package/build/group/edit.js.map +1 -1
- package/build/html/preview.js +2 -4
- package/build/html/preview.js.map +1 -1
- package/build/image/image.js +11 -5
- package/build/image/image.js.map +1 -1
- package/build/image/view.js +10 -20
- package/build/image/view.js.map +1 -1
- package/build/missing/edit.native.js +46 -8
- package/build/missing/edit.native.js.map +1 -1
- package/build/paragraph/edit.js +1 -1
- package/build/paragraph/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +2 -2
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +27 -13
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +15 -12
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/utils.js +29 -8
- package/build/query/utils.js.map +1 -1
- package/build/query/view.js +4 -2
- package/build/query/view.js.map +1 -1
- package/build/search/edit.js +1 -2
- package/build/search/edit.js.map +1 -1
- package/build/social-link/edit.native.js +7 -19
- package/build/social-link/edit.native.js.map +1 -1
- package/build/spacer/controls.js +3 -3
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/controls.native.js +2 -1
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/edit.js +1 -1
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/edit.native.js +5 -1
- package/build/spacer/edit.native.js.map +1 -1
- package/build/tag-cloud/edit.js +2 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +2 -2
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/term-description/index.js +0 -1
- package/build/term-description/index.js.map +1 -1
- package/build-module/avatar/index.js +5 -1
- package/build-module/avatar/index.js.map +1 -1
- package/build-module/block/edit-title.native.js +12 -4
- package/build-module/block/edit-title.native.js.map +1 -1
- package/build-module/column/edit.js +3 -2
- package/build-module/column/edit.js.map +1 -1
- package/build-module/column/edit.native.js +3 -2
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/columns/edit.native.js +3 -2
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/cover/controls.native.js +3 -2
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/edit/index.js +3 -2
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +3 -2
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/file/view.js +2 -2
- package/build-module/file/view.js.map +1 -1
- package/build-module/form/edit.js +1 -1
- package/build-module/form/edit.js.map +1 -1
- package/build-module/form/variations.js +1 -1
- package/build-module/form/variations.js.map +1 -1
- package/build-module/form-input/index.js +1 -1
- package/build-module/form-input/variations.js +7 -7
- package/build-module/form-input/variations.js.map +1 -1
- package/build-module/form-submission-notification/variations.js +4 -4
- package/build-module/form-submission-notification/variations.js.map +1 -1
- package/build-module/form-submit-button/index.js +1 -1
- package/build-module/group/edit.js +3 -12
- package/build-module/group/edit.js.map +1 -1
- package/build-module/html/preview.js +2 -4
- package/build-module/html/preview.js.map +1 -1
- package/build-module/image/image.js +12 -6
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/view.js +10 -20
- package/build-module/image/view.js.map +1 -1
- package/build-module/missing/edit.native.js +47 -9
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/paragraph/edit.js +2 -2
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +3 -3
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +28 -14
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +17 -14
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/utils.js +27 -5
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query/view.js +4 -2
- package/build-module/query/view.js.map +1 -1
- package/build-module/search/edit.js +2 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/social-link/edit.native.js +8 -20
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/spacer/controls.js +4 -4
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/controls.native.js +3 -2
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/spacer/edit.js +2 -2
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/edit.native.js +6 -2
- package/build-module/spacer/edit.native.js.map +1 -1
- package/build-module/tag-cloud/edit.js +3 -2
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +3 -3
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/term-description/index.js +0 -1
- package/build-module/term-description/index.js.map +1 -1
- package/build-style/file/style-rtl.css +0 -5
- package/build-style/file/style.css +0 -5
- package/build-style/navigation/style-rtl.css +5 -0
- package/build-style/navigation/style.css +5 -0
- package/build-style/style-rtl.css +5 -5
- package/build-style/style.css +5 -5
- package/package.json +32 -32
- package/src/avatar/block.json +5 -1
- package/src/block/edit-title.native.js +16 -13
- package/src/calendar/index.php +2 -6
- package/src/column/edit.js +3 -8
- package/src/column/edit.native.js +3 -8
- package/src/columns/edit.native.js +3 -8
- package/src/comment-author-avatar/index.php +1 -1
- package/src/cover/controls.native.js +3 -8
- package/src/cover/edit/index.js +3 -2
- package/src/cover/edit/inspector-controls.js +3 -8
- package/src/file/index.php +2 -1
- package/src/file/style.scss +0 -6
- package/src/file/view.js +2 -2
- package/src/form/edit.js +1 -1
- package/src/form/variations.js +1 -1
- package/src/form-input/block.json +1 -1
- package/src/form-input/variations.js +7 -7
- package/src/form-submission-notification/variations.js +4 -4
- package/src/form-submit-button/block.json +1 -1
- package/src/freeform/test/__snapshots__/index.native.js.snap +7 -0
- package/src/freeform/test/index.native.js +57 -0
- package/src/group/edit.js +2 -7
- package/src/html/preview.js +9 -4
- package/src/image/image.js +17 -6
- package/src/image/index.php +5 -6
- package/src/image/view.js +13 -19
- package/src/missing/edit.native.js +43 -6
- package/src/navigation/index.php +1 -1
- package/src/navigation/style.scss +6 -1
- package/src/paragraph/edit.js +2 -2
- package/src/post-featured-image/dimension-controls.js +3 -3
- package/src/query/edit/enhanced-pagination-modal.js +37 -21
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +18 -22
- package/src/query/index.php +97 -8
- package/src/query/utils.js +29 -8
- package/src/query/view.js +11 -2
- package/src/query-pagination-next/index.php +1 -1
- package/src/query-pagination-previous/index.php +1 -1
- package/src/search/edit.js +5 -3
- package/src/social-link/edit.native.js +12 -26
- package/src/social-link/editor.native.scss +0 -9
- package/src/social-link/index.php +2 -2
- package/src/spacer/controls.js +9 -12
- package/src/spacer/controls.native.js +3 -8
- package/src/spacer/edit.js +2 -2
- package/src/spacer/edit.native.js +6 -5
- package/src/tag-cloud/edit.js +3 -7
- package/src/template-part/edit/inner-blocks.js +3 -3
- package/src/term-description/block.json +0 -1
package/build-style/style.css
CHANGED
|
@@ -1145,11 +1145,6 @@ section.wp-block-cover-image > h2,
|
|
|
1145
1145
|
margin-bottom: 1em;
|
|
1146
1146
|
}
|
|
1147
1147
|
|
|
1148
|
-
@media (max-width: 768px) {
|
|
1149
|
-
.wp-block-file__embed {
|
|
1150
|
-
display: none;
|
|
1151
|
-
}
|
|
1152
|
-
}
|
|
1153
1148
|
:where(.wp-block-file__button) {
|
|
1154
1149
|
border-radius: 2em;
|
|
1155
1150
|
padding: 0.5em 1em;
|
|
@@ -2365,6 +2360,7 @@ button.wp-block-navigation-item__content {
|
|
|
2365
2360
|
}
|
|
2366
2361
|
|
|
2367
2362
|
.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle {
|
|
2363
|
+
padding-left: 0;
|
|
2368
2364
|
padding-right: 0.85em;
|
|
2369
2365
|
}
|
|
2370
2366
|
.wp-block-navigation-item.open-on-click .wp-block-navigation-submenu__toggle + .wp-block-navigation__submenu-icon {
|
|
@@ -2372,6 +2368,10 @@ button.wp-block-navigation-item__content {
|
|
|
2372
2368
|
pointer-events: none;
|
|
2373
2369
|
}
|
|
2374
2370
|
|
|
2371
|
+
.wp-block-navigation-item.open-on-click button.wp-block-navigation-item__content:not(.wp-block-navigation-submenu__toggle) {
|
|
2372
|
+
padding: 0;
|
|
2373
|
+
}
|
|
2374
|
+
|
|
2375
2375
|
/**
|
|
2376
2376
|
* Margins
|
|
2377
2377
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.21.0",
|
|
3
|
+
"version": "8.21.1-next.f8d8eceb.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -31,36 +31,36 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.44.0",
|
|
35
|
-
"@wordpress/api-fetch": "^6.41.0",
|
|
36
|
-
"@wordpress/autop": "^3.44.0",
|
|
37
|
-
"@wordpress/blob": "^3.44.0",
|
|
38
|
-
"@wordpress/block-editor": "^12.12.0",
|
|
39
|
-
"@wordpress/blocks": "^12.21.0",
|
|
40
|
-
"@wordpress/components": "^25.
|
|
41
|
-
"@wordpress/compose": "^6.21.0",
|
|
42
|
-
"@wordpress/core-data": "^6.21.0",
|
|
43
|
-
"@wordpress/data": "^9.14.0",
|
|
44
|
-
"@wordpress/date": "^4.44.0",
|
|
45
|
-
"@wordpress/deprecated": "^3.44.0",
|
|
46
|
-
"@wordpress/dom": "^3.44.0",
|
|
47
|
-
"@wordpress/element": "^5.21.0",
|
|
48
|
-
"@wordpress/escape-html": "^2.44.0",
|
|
49
|
-
"@wordpress/hooks": "^3.44.0",
|
|
50
|
-
"@wordpress/html-entities": "^3.44.0",
|
|
51
|
-
"@wordpress/i18n": "^4.44.0",
|
|
52
|
-
"@wordpress/icons": "^9.35.0",
|
|
53
|
-
"@wordpress/interactivity": "^2.5.0",
|
|
54
|
-
"@wordpress/keycodes": "^3.44.0",
|
|
55
|
-
"@wordpress/notices": "^4.12.0",
|
|
56
|
-
"@wordpress/primitives": "^3.42.0",
|
|
57
|
-
"@wordpress/private-apis": "^0.26.0",
|
|
58
|
-
"@wordpress/reusable-blocks": "^4.21.0",
|
|
59
|
-
"@wordpress/rich-text": "^6.21.0",
|
|
60
|
-
"@wordpress/server-side-render": "^4.21.0",
|
|
61
|
-
"@wordpress/url": "^3.45.0",
|
|
62
|
-
"@wordpress/viewport": "^5.21.0",
|
|
63
|
-
"@wordpress/wordcount": "^3.44.0",
|
|
34
|
+
"@wordpress/a11y": "^3.44.1-next.f8d8eceb.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.41.1-next.f8d8eceb.0",
|
|
36
|
+
"@wordpress/autop": "^3.44.1-next.f8d8eceb.0",
|
|
37
|
+
"@wordpress/blob": "^3.44.1-next.f8d8eceb.0",
|
|
38
|
+
"@wordpress/block-editor": "^12.12.2-next.f8d8eceb.0",
|
|
39
|
+
"@wordpress/blocks": "^12.21.1-next.f8d8eceb.0",
|
|
40
|
+
"@wordpress/components": "^25.11.1-next.f8d8eceb.0",
|
|
41
|
+
"@wordpress/compose": "^6.21.1-next.f8d8eceb.0",
|
|
42
|
+
"@wordpress/core-data": "^6.21.1-next.f8d8eceb.0",
|
|
43
|
+
"@wordpress/data": "^9.14.1-next.f8d8eceb.0",
|
|
44
|
+
"@wordpress/date": "^4.44.1-next.f8d8eceb.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.44.1-next.f8d8eceb.0",
|
|
46
|
+
"@wordpress/dom": "^3.44.1-next.f8d8eceb.0",
|
|
47
|
+
"@wordpress/element": "^5.21.1-next.f8d8eceb.0",
|
|
48
|
+
"@wordpress/escape-html": "^2.44.1-next.f8d8eceb.0",
|
|
49
|
+
"@wordpress/hooks": "^3.44.1-next.f8d8eceb.0",
|
|
50
|
+
"@wordpress/html-entities": "^3.44.1-next.f8d8eceb.0",
|
|
51
|
+
"@wordpress/i18n": "^4.44.1-next.f8d8eceb.0",
|
|
52
|
+
"@wordpress/icons": "^9.35.1-next.f8d8eceb.0",
|
|
53
|
+
"@wordpress/interactivity": "^2.5.2-next.f8d8eceb.0",
|
|
54
|
+
"@wordpress/keycodes": "^3.44.1-next.f8d8eceb.0",
|
|
55
|
+
"@wordpress/notices": "^4.12.1-next.f8d8eceb.0",
|
|
56
|
+
"@wordpress/primitives": "^3.42.1-next.f8d8eceb.0",
|
|
57
|
+
"@wordpress/private-apis": "^0.26.1-next.f8d8eceb.0",
|
|
58
|
+
"@wordpress/reusable-blocks": "^4.21.1-next.f8d8eceb.0",
|
|
59
|
+
"@wordpress/rich-text": "^6.21.1-next.f8d8eceb.0",
|
|
60
|
+
"@wordpress/server-side-render": "^4.21.1-next.f8d8eceb.0",
|
|
61
|
+
"@wordpress/url": "^3.45.1-next.f8d8eceb.0",
|
|
62
|
+
"@wordpress/viewport": "^5.21.1-next.f8d8eceb.0",
|
|
63
|
+
"@wordpress/wordcount": "^3.44.1-next.f8d8eceb.0",
|
|
64
64
|
"change-case": "^4.1.2",
|
|
65
65
|
"classnames": "^2.3.1",
|
|
66
66
|
"colord": "^2.7.0",
|
|
@@ -78,5 +78,5 @@
|
|
|
78
78
|
"publishConfig": {
|
|
79
79
|
"access": "public"
|
|
80
80
|
},
|
|
81
|
-
"gitHead": "
|
|
81
|
+
"gitHead": "8d8fd197e202b8104ffb1cb83048efd0a6c3faf4"
|
|
82
82
|
}
|
package/src/avatar/block.json
CHANGED
|
@@ -30,7 +30,11 @@
|
|
|
30
30
|
"alignWide": false,
|
|
31
31
|
"spacing": {
|
|
32
32
|
"margin": true,
|
|
33
|
-
"padding": true
|
|
33
|
+
"padding": true,
|
|
34
|
+
"__experimentalDefaultControls": {
|
|
35
|
+
"margin": false,
|
|
36
|
+
"padding": false
|
|
37
|
+
}
|
|
34
38
|
},
|
|
35
39
|
"__experimentalBorder": {
|
|
36
40
|
"__experimentalSkipSerialization": true,
|
|
@@ -6,7 +6,7 @@ import { Text, View } from 'react-native';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import { Icon } from '@wordpress/components';
|
|
9
|
+
import { Icon, useGlobalStyles } from '@wordpress/components';
|
|
10
10
|
import { __ } from '@wordpress/i18n';
|
|
11
11
|
import { withPreferredColorScheme } from '@wordpress/compose';
|
|
12
12
|
import { help, lock } from '@wordpress/icons';
|
|
@@ -17,18 +17,21 @@ import { help, lock } from '@wordpress/icons';
|
|
|
17
17
|
import styles from './editor.scss';
|
|
18
18
|
|
|
19
19
|
function EditTitle( { getStylesFromColorScheme, title } ) {
|
|
20
|
-
const
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
20
|
+
const globalStyles = useGlobalStyles();
|
|
21
|
+
const baseColors = globalStyles?.baseColors?.color;
|
|
22
|
+
|
|
23
|
+
const lockIconStyle = [
|
|
24
|
+
getStylesFromColorScheme( styles.lockIcon, styles.lockIconDark ),
|
|
25
|
+
baseColors && { color: baseColors.text },
|
|
26
|
+
];
|
|
27
|
+
const titleStyle = [
|
|
28
|
+
getStylesFromColorScheme( styles.title, styles.titleDark ),
|
|
29
|
+
baseColors && { color: baseColors.text },
|
|
30
|
+
];
|
|
31
|
+
const infoIconStyle = [
|
|
32
|
+
getStylesFromColorScheme( styles.infoIcon, styles.infoIconDark ),
|
|
33
|
+
baseColors && { color: baseColors.text },
|
|
34
|
+
];
|
|
32
35
|
const separatorStyle = getStylesFromColorScheme(
|
|
33
36
|
styles.separator,
|
|
34
37
|
styles.separatorDark
|
package/src/calendar/index.php
CHANGED
|
@@ -33,10 +33,8 @@ function render_block_core_calendar( $attributes ) {
|
|
|
33
33
|
str_contains( $permalink_structure, '%monthnum%' ) &&
|
|
34
34
|
str_contains( $permalink_structure, '%year%' )
|
|
35
35
|
) {
|
|
36
|
-
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
|
|
37
36
|
$monthnum = $attributes['month'];
|
|
38
|
-
|
|
39
|
-
$year = $attributes['year'];
|
|
37
|
+
$year = $attributes['year'];
|
|
40
38
|
}
|
|
41
39
|
}
|
|
42
40
|
|
|
@@ -70,10 +68,8 @@ function render_block_core_calendar( $attributes ) {
|
|
|
70
68
|
$calendar
|
|
71
69
|
);
|
|
72
70
|
|
|
73
|
-
// phpcs:ignore WordPress.WP.GlobalVariablesOverride.OverrideProhibited
|
|
74
71
|
$monthnum = $previous_monthnum;
|
|
75
|
-
|
|
76
|
-
$year = $previous_year;
|
|
72
|
+
$year = $previous_year;
|
|
77
73
|
|
|
78
74
|
return $output;
|
|
79
75
|
}
|
package/src/column/edit.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
BlockVerticalAlignmentToolbar,
|
|
13
13
|
InspectorControls,
|
|
14
14
|
useBlockProps,
|
|
15
|
-
|
|
15
|
+
useSettings,
|
|
16
16
|
useInnerBlocksProps,
|
|
17
17
|
store as blockEditorStore,
|
|
18
18
|
} from '@wordpress/block-editor';
|
|
@@ -33,14 +33,9 @@ function ColumnEdit( {
|
|
|
33
33
|
[ `is-vertically-aligned-${ verticalAlignment }` ]: verticalAlignment,
|
|
34
34
|
} );
|
|
35
35
|
|
|
36
|
+
const [ availableUnits ] = useSettings( 'spacing.units' );
|
|
36
37
|
const units = useCustomUnits( {
|
|
37
|
-
availableUnits:
|
|
38
|
-
'%',
|
|
39
|
-
'px',
|
|
40
|
-
'em',
|
|
41
|
-
'rem',
|
|
42
|
-
'vw',
|
|
43
|
-
],
|
|
38
|
+
availableUnits: availableUnits || [ '%', 'px', 'em', 'rem', 'vw' ],
|
|
44
39
|
} );
|
|
45
40
|
|
|
46
41
|
const { columnsIds, hasChildBlocks, rootClientId } = useSelect(
|
|
@@ -15,7 +15,7 @@ import {
|
|
|
15
15
|
BlockVerticalAlignmentToolbar,
|
|
16
16
|
InspectorControls,
|
|
17
17
|
store as blockEditorStore,
|
|
18
|
-
|
|
18
|
+
useSettings,
|
|
19
19
|
} from '@wordpress/block-editor';
|
|
20
20
|
import {
|
|
21
21
|
PanelBody,
|
|
@@ -60,14 +60,9 @@ function ColumnEdit( {
|
|
|
60
60
|
|
|
61
61
|
const [ widthUnit, setWidthUnit ] = useState( valueUnit || '%' );
|
|
62
62
|
|
|
63
|
+
const [ availableUnits ] = useSettings( 'spacing.units' );
|
|
63
64
|
const units = useCustomUnits( {
|
|
64
|
-
availableUnits:
|
|
65
|
-
'%',
|
|
66
|
-
'px',
|
|
67
|
-
'em',
|
|
68
|
-
'rem',
|
|
69
|
-
'vw',
|
|
70
|
-
],
|
|
65
|
+
availableUnits: availableUnits || [ '%', 'px', 'em', 'rem', 'vw' ],
|
|
71
66
|
} );
|
|
72
67
|
|
|
73
68
|
const updateAlignment = ( alignment ) => {
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
BlockControls,
|
|
24
24
|
BlockVerticalAlignmentToolbar,
|
|
25
25
|
BlockVariationPicker,
|
|
26
|
-
|
|
26
|
+
useSettings,
|
|
27
27
|
store as blockEditorStore,
|
|
28
28
|
} from '@wordpress/block-editor';
|
|
29
29
|
import { withDispatch, useSelect } from '@wordpress/data';
|
|
@@ -106,14 +106,9 @@ function ColumnsEditContainer( {
|
|
|
106
106
|
const { verticalAlignment, align } = attributes;
|
|
107
107
|
const { width } = sizes || {};
|
|
108
108
|
|
|
109
|
+
const [ availableUnits ] = useSettings( 'spacing.units' );
|
|
109
110
|
const units = useCustomUnits( {
|
|
110
|
-
availableUnits:
|
|
111
|
-
'%',
|
|
112
|
-
'px',
|
|
113
|
-
'em',
|
|
114
|
-
'rem',
|
|
115
|
-
'vw',
|
|
116
|
-
],
|
|
111
|
+
availableUnits: availableUnits || [ '%', 'px', 'em', 'rem', 'vw' ],
|
|
117
112
|
} );
|
|
118
113
|
|
|
119
114
|
useEffect( () => {
|
|
@@ -23,7 +23,7 @@ function render_block_core_comment_author_avatar( $attributes, $content, $block
|
|
|
23
23
|
return '';
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
-
// This is the only way to
|
|
26
|
+
// This is the only way to retrieve style and classes on different instances.
|
|
27
27
|
$wrapper_attributes = WP_Block_Supports::get_instance()->apply_block_supports();
|
|
28
28
|
|
|
29
29
|
/**
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
import { plus } from '@wordpress/icons';
|
|
23
23
|
import { useState, useCallback, useRef } from '@wordpress/element';
|
|
24
24
|
import { usePreferredColorSchemeStyle } from '@wordpress/compose';
|
|
25
|
-
import {
|
|
25
|
+
import { useSettings, MediaUpload } from '@wordpress/block-editor';
|
|
26
26
|
import { __ } from '@wordpress/i18n';
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -68,14 +68,9 @@ function Controls( {
|
|
|
68
68
|
[ minHeight ]
|
|
69
69
|
);
|
|
70
70
|
|
|
71
|
+
const [ availableUnits ] = useSettings( 'spacing.units' );
|
|
71
72
|
const units = useCustomUnits( {
|
|
72
|
-
availableUnits:
|
|
73
|
-
'px',
|
|
74
|
-
'em',
|
|
75
|
-
'rem',
|
|
76
|
-
'vw',
|
|
77
|
-
'vh',
|
|
78
|
-
],
|
|
73
|
+
availableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],
|
|
79
74
|
defaultValues: { px: 430, em: 20, rem: 20, vw: 20, vh: 50 },
|
|
80
75
|
} );
|
|
81
76
|
|
package/src/cover/edit/index.js
CHANGED
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
withColors,
|
|
15
15
|
ColorPalette,
|
|
16
16
|
useBlockProps,
|
|
17
|
-
|
|
17
|
+
useSettings,
|
|
18
18
|
useInnerBlocksProps,
|
|
19
19
|
__experimentalUseGradient,
|
|
20
20
|
store as blockEditorStore,
|
|
@@ -318,7 +318,8 @@ function CoverEdit( {
|
|
|
318
318
|
const blockProps = useBlockProps( { ref } );
|
|
319
319
|
|
|
320
320
|
// Check for fontSize support before we pass a fontSize attribute to the innerBlocks.
|
|
321
|
-
const
|
|
321
|
+
const [ fontSizes ] = useSettings( 'typography.fontSizes' );
|
|
322
|
+
const hasFontSizes = fontSizes?.length > 0;
|
|
322
323
|
const innerBlocksTemplate = getInnerBlocksTemplate( {
|
|
323
324
|
fontSize: hasFontSizes ? 'large' : undefined,
|
|
324
325
|
} );
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
import { useInstanceId } from '@wordpress/compose';
|
|
21
21
|
import {
|
|
22
22
|
InspectorControls,
|
|
23
|
-
|
|
23
|
+
useSettings,
|
|
24
24
|
__experimentalColorGradientSettingsDropdown as ColorGradientSettingsDropdown,
|
|
25
25
|
__experimentalUseGradient,
|
|
26
26
|
__experimentalUseMultipleOriginColorsAndGradients as useMultipleOriginColorsAndGradients,
|
|
@@ -42,14 +42,9 @@ function CoverHeightInput( {
|
|
|
42
42
|
const inputId = `block-cover-height-input-${ instanceId }`;
|
|
43
43
|
const isPx = unit === 'px';
|
|
44
44
|
|
|
45
|
+
const [ availableUnits ] = useSettings( 'spacing.units' );
|
|
45
46
|
const units = useCustomUnits( {
|
|
46
|
-
availableUnits:
|
|
47
|
-
'px',
|
|
48
|
-
'em',
|
|
49
|
-
'rem',
|
|
50
|
-
'vw',
|
|
51
|
-
'vh',
|
|
52
|
-
],
|
|
47
|
+
availableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],
|
|
53
48
|
defaultValues: { px: 430, '%': 20, em: 20, rem: 20, vw: 20, vh: 50 },
|
|
54
49
|
} );
|
|
55
50
|
|
package/src/file/index.php
CHANGED
|
@@ -59,7 +59,8 @@ function render_block_core_file( $attributes, $content, $block ) {
|
|
|
59
59
|
$processor->next_tag();
|
|
60
60
|
$processor->set_attribute( 'data-wp-interactive', '' );
|
|
61
61
|
$processor->next_tag( 'object' );
|
|
62
|
-
$processor->set_attribute( 'data-wp-
|
|
62
|
+
$processor->set_attribute( 'data-wp-bind--hidden', '!selectors.core.file.hasPdfPreview' );
|
|
63
|
+
$processor->set_attribute( 'hidden', true );
|
|
63
64
|
return $processor->get_updated_html();
|
|
64
65
|
}
|
|
65
66
|
|
package/src/file/style.scss
CHANGED
|
@@ -29,12 +29,6 @@
|
|
|
29
29
|
margin-bottom: 1em;
|
|
30
30
|
}
|
|
31
31
|
|
|
32
|
-
@media (max-width: 768px) {
|
|
33
|
-
.wp-block-file__embed {
|
|
34
|
-
display: none;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
32
|
//This needs a low specificity so it won't override the rules from the button element if defined in theme.json.
|
|
39
33
|
:where(.wp-block-file__button) {
|
|
40
34
|
border-radius: 2em;
|
package/src/file/view.js
CHANGED
|
@@ -5,13 +5,13 @@ import { store } from '@wordpress/interactivity';
|
|
|
5
5
|
/**
|
|
6
6
|
* Internal dependencies
|
|
7
7
|
*/
|
|
8
|
-
import { browserSupportsPdfs } from './utils';
|
|
8
|
+
import { browserSupportsPdfs as hasPdfPreview } from './utils';
|
|
9
9
|
|
|
10
10
|
store( {
|
|
11
11
|
selectors: {
|
|
12
12
|
core: {
|
|
13
13
|
file: {
|
|
14
|
-
hasPdfPreview
|
|
14
|
+
hasPdfPreview,
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
},
|
package/src/form/edit.js
CHANGED
|
@@ -107,7 +107,7 @@ const Edit = ( { attributes, setAttributes, clientId } ) => {
|
|
|
107
107
|
help={
|
|
108
108
|
submissionMethod === 'custom'
|
|
109
109
|
? __(
|
|
110
|
-
'Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "
|
|
110
|
+
'Select the method to use for form submissions. Additional options for the "custom" mode can be found in the "Advanced" section.'
|
|
111
111
|
)
|
|
112
112
|
: __(
|
|
113
113
|
'Select the method to use for form submissions.'
|
package/src/form/variations.js
CHANGED
|
@@ -63,7 +63,7 @@ const variations = [
|
|
|
63
63
|
name: 'wp-privacy-form',
|
|
64
64
|
title: __( 'Experimental privacy request form' ),
|
|
65
65
|
keywords: [ 'GDPR' ],
|
|
66
|
-
description: __( 'A form
|
|
66
|
+
description: __( 'A form to request data exports and/or deletion.' ),
|
|
67
67
|
attributes: {
|
|
68
68
|
submissionMethod: 'custom',
|
|
69
69
|
action: '',
|
|
@@ -6,7 +6,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
const variations = [
|
|
7
7
|
{
|
|
8
8
|
name: 'text',
|
|
9
|
-
title: __( 'Text
|
|
9
|
+
title: __( 'Text Input' ),
|
|
10
10
|
icon: 'edit-page',
|
|
11
11
|
description: __( 'A generic text input.' ),
|
|
12
12
|
attributes: { type: 'text' },
|
|
@@ -17,7 +17,7 @@ const variations = [
|
|
|
17
17
|
},
|
|
18
18
|
{
|
|
19
19
|
name: 'textarea',
|
|
20
|
-
title: __( 'Textarea
|
|
20
|
+
title: __( 'Textarea Input' ),
|
|
21
21
|
icon: 'testimonial',
|
|
22
22
|
description: __(
|
|
23
23
|
'A textarea input to allow entering multiple lines of text.'
|
|
@@ -29,7 +29,7 @@ const variations = [
|
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
31
|
name: 'checkbox',
|
|
32
|
-
title: __( 'Checkbox
|
|
32
|
+
title: __( 'Checkbox Input' ),
|
|
33
33
|
description: __( 'A simple checkbox input.' ),
|
|
34
34
|
icon: 'forms',
|
|
35
35
|
attributes: { type: 'checkbox', inlineLabel: true },
|
|
@@ -39,7 +39,7 @@ const variations = [
|
|
|
39
39
|
},
|
|
40
40
|
{
|
|
41
41
|
name: 'email',
|
|
42
|
-
title: __( 'Email
|
|
42
|
+
title: __( 'Email Input' ),
|
|
43
43
|
icon: 'email',
|
|
44
44
|
description: __( 'Used for email addresses.' ),
|
|
45
45
|
attributes: { type: 'email' },
|
|
@@ -49,7 +49,7 @@ const variations = [
|
|
|
49
49
|
},
|
|
50
50
|
{
|
|
51
51
|
name: 'url',
|
|
52
|
-
title: __( 'URL
|
|
52
|
+
title: __( 'URL Input' ),
|
|
53
53
|
icon: 'admin-site',
|
|
54
54
|
description: __( 'Used for URLs.' ),
|
|
55
55
|
attributes: { type: 'url' },
|
|
@@ -59,7 +59,7 @@ const variations = [
|
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
name: 'tel',
|
|
62
|
-
title: __( 'Telephone
|
|
62
|
+
title: __( 'Telephone Input' ),
|
|
63
63
|
icon: 'phone',
|
|
64
64
|
description: __( 'Used for phone numbers.' ),
|
|
65
65
|
attributes: { type: 'tel' },
|
|
@@ -69,7 +69,7 @@ const variations = [
|
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
name: 'number',
|
|
72
|
-
title: __( 'Number
|
|
72
|
+
title: __( 'Number Input' ),
|
|
73
73
|
icon: 'edit-page',
|
|
74
74
|
description: __( 'A numeric input.' ),
|
|
75
75
|
attributes: { type: 'number' },
|
|
@@ -6,8 +6,8 @@ import { __ } from '@wordpress/i18n';
|
|
|
6
6
|
const variations = [
|
|
7
7
|
{
|
|
8
8
|
name: 'form-submission-success',
|
|
9
|
-
title: __( 'Form
|
|
10
|
-
description: __( 'Success message for form submissions' ),
|
|
9
|
+
title: __( 'Form Submission Success' ),
|
|
10
|
+
description: __( 'Success message for form submissions.' ),
|
|
11
11
|
attributes: {
|
|
12
12
|
type: 'success',
|
|
13
13
|
},
|
|
@@ -31,8 +31,8 @@ const variations = [
|
|
|
31
31
|
},
|
|
32
32
|
{
|
|
33
33
|
name: 'form-submission-error',
|
|
34
|
-
title: __( 'Form
|
|
35
|
-
description: __( 'Error/failure message for form submissions' ),
|
|
34
|
+
title: __( 'Form Submission Error' ),
|
|
35
|
+
description: __( 'Error/failure message for form submissions.' ),
|
|
36
36
|
attributes: {
|
|
37
37
|
type: 'error',
|
|
38
38
|
},
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
fireEvent,
|
|
6
|
+
getBlock,
|
|
7
|
+
getEditorHtml,
|
|
8
|
+
initializeEditor,
|
|
9
|
+
screen,
|
|
10
|
+
setupCoreBlocks,
|
|
11
|
+
within,
|
|
12
|
+
} from 'test/helpers';
|
|
13
|
+
|
|
14
|
+
const CLASSIC_BLOCK_HTML = `<p>I'm classic!</p>`;
|
|
15
|
+
const DEFAULT_EDITOR_CAPABILITIES = {
|
|
16
|
+
unsupportedBlockEditor: true,
|
|
17
|
+
canEnableUnsupportedBlockEditor: true,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
setupCoreBlocks();
|
|
21
|
+
|
|
22
|
+
describe( 'Classic block', () => {
|
|
23
|
+
it( 'displays option to edit using web editor', async () => {
|
|
24
|
+
await initializeEditor( {
|
|
25
|
+
initialHtml: CLASSIC_BLOCK_HTML,
|
|
26
|
+
capabilities: DEFAULT_EDITOR_CAPABILITIES,
|
|
27
|
+
} );
|
|
28
|
+
|
|
29
|
+
const block = getBlock( screen, 'Classic' );
|
|
30
|
+
fireEvent.press( block );
|
|
31
|
+
|
|
32
|
+
// Tap the block to open the unsupported block details
|
|
33
|
+
fireEvent.press( within( block ).getByText( 'Unsupported' ) );
|
|
34
|
+
|
|
35
|
+
const actionButton = screen.getByText( 'Edit using web editor' );
|
|
36
|
+
expect( actionButton ).toBeVisible();
|
|
37
|
+
} );
|
|
38
|
+
|
|
39
|
+
it( 'converts content into blocks', async () => {
|
|
40
|
+
await initializeEditor( {
|
|
41
|
+
initialHtml: CLASSIC_BLOCK_HTML,
|
|
42
|
+
capabilities: DEFAULT_EDITOR_CAPABILITIES,
|
|
43
|
+
} );
|
|
44
|
+
|
|
45
|
+
const block = getBlock( screen, 'Classic' );
|
|
46
|
+
fireEvent.press( block );
|
|
47
|
+
|
|
48
|
+
// Tap the block to open the unsupported block details
|
|
49
|
+
fireEvent.press( within( block ).getByText( 'Unsupported' ) );
|
|
50
|
+
|
|
51
|
+
const actionButton = screen.getByText( 'Convert to blocks' );
|
|
52
|
+
expect( actionButton ).toBeVisible();
|
|
53
|
+
|
|
54
|
+
fireEvent.press( actionButton );
|
|
55
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
56
|
+
} );
|
|
57
|
+
} );
|
package/src/group/edit.js
CHANGED
|
@@ -7,7 +7,6 @@ import {
|
|
|
7
7
|
useBlockProps,
|
|
8
8
|
InspectorControls,
|
|
9
9
|
useInnerBlocksProps,
|
|
10
|
-
useSetting,
|
|
11
10
|
store as blockEditorStore,
|
|
12
11
|
} from '@wordpress/block-editor';
|
|
13
12
|
import { SelectControl } from '@wordpress/components';
|
|
@@ -98,11 +97,7 @@ function GroupEdit( {
|
|
|
98
97
|
} = attributes;
|
|
99
98
|
|
|
100
99
|
// Layout settings.
|
|
101
|
-
const
|
|
102
|
-
const usedLayout = ! layout?.type
|
|
103
|
-
? { ...defaultLayout, ...layout, type: 'default' }
|
|
104
|
-
: { ...defaultLayout, ...layout };
|
|
105
|
-
const { type = 'default' } = usedLayout;
|
|
100
|
+
const { type = 'default' } = layout;
|
|
106
101
|
const layoutSupportEnabled =
|
|
107
102
|
themeSupportsLayout || type === 'flex' || type === 'grid';
|
|
108
103
|
|
|
@@ -112,7 +107,7 @@ function GroupEdit( {
|
|
|
112
107
|
} );
|
|
113
108
|
const [ showPlaceholder, setShowPlaceholder ] = useShouldShowPlaceHolder( {
|
|
114
109
|
attributes,
|
|
115
|
-
usedLayoutType:
|
|
110
|
+
usedLayoutType: type,
|
|
116
111
|
hasInnerBlocks,
|
|
117
112
|
} );
|
|
118
113
|
|
package/src/html/preview.js
CHANGED
|
@@ -22,12 +22,17 @@ const DEFAULT_STYLES = `
|
|
|
22
22
|
`;
|
|
23
23
|
|
|
24
24
|
export default function HTMLEditPreview( { content, isSelected } ) {
|
|
25
|
-
const settingStyles = useSelect(
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
const settingStyles = useSelect(
|
|
26
|
+
( select ) => select( blockEditorStore ).getSettings().styles
|
|
27
|
+
);
|
|
28
28
|
|
|
29
29
|
const styles = useMemo(
|
|
30
|
-
() => [
|
|
30
|
+
() => [
|
|
31
|
+
DEFAULT_STYLES,
|
|
32
|
+
...transformStyles(
|
|
33
|
+
settingStyles.filter( ( style ) => style.css )
|
|
34
|
+
),
|
|
35
|
+
],
|
|
31
36
|
[ settingStyles ]
|
|
32
37
|
);
|
|
33
38
|
|