@wordpress/block-library 9.12.0 → 9.12.1-next.082ed6819.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/block-keyboard-shortcuts/index.js +7 -7
- package/build/block-keyboard-shortcuts/index.js.map +1 -1
- package/build/cover/edit/index.js +1 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/index.js +10 -10
- package/build/cover/index.js.map +1 -1
- package/build/cover/shared.js +6 -7
- package/build/cover/shared.js.map +1 -1
- package/build/details/index.js +19 -0
- package/build/details/index.js.map +1 -1
- package/build/file/edit.js +7 -3
- package/build/file/edit.js.map +1 -1
- package/build/freeform/modal.js +1 -1
- package/build/freeform/modal.js.map +1 -1
- package/build/heading/index.js +1 -7
- package/build/heading/index.js.map +1 -1
- package/build/home-link/edit.js +20 -36
- package/build/home-link/edit.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +6 -8
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/page-list/index.js +14 -0
- package/build/page-list/index.js.map +1 -1
- package/build/paragraph/edit.js +26 -25
- package/build/paragraph/edit.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -11
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/utils.js +6 -8
- package/build/query/utils.js.map +1 -1
- package/build/social-link/edit.js +22 -9
- package/build/social-link/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +2 -7
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/utils/get-template-part-icon.js +23 -0
- package/build/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build/template-part/edit/utils/hooks.js +1 -6
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/variations.js +6 -12
- package/build/template-part/variations.js.map +1 -1
- package/build/video/tracks-editor.js +135 -121
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/block-keyboard-shortcuts/index.js +7 -7
- package/build-module/block-keyboard-shortcuts/index.js.map +1 -1
- package/build-module/cover/edit/index.js +1 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/index.js +10 -10
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/shared.js +6 -7
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/details/index.js +20 -1
- package/build-module/details/index.js.map +1 -1
- package/build-module/file/edit.js +7 -3
- package/build-module/file/edit.js.map +1 -1
- package/build-module/freeform/modal.js +1 -1
- package/build-module/freeform/modal.js.map +1 -1
- package/build-module/heading/index.js +1 -7
- package/build-module/heading/index.js.map +1 -1
- package/build-module/home-link/edit.js +23 -39
- package/build-module/home-link/edit.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +6 -8
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/page-list/index.js +14 -0
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/paragraph/edit.js +26 -25
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +1 -3
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -11
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/utils.js +6 -8
- package/build-module/query/utils.js.map +1 -1
- package/build-module/social-link/edit.js +24 -11
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +3 -8
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/utils/get-template-part-icon.js +15 -0
- package/build-module/template-part/edit/utils/get-template-part-icon.js.map +1 -0
- package/build-module/template-part/edit/utils/hooks.js +1 -6
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/variations.js +5 -11
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/video/tracks-editor.js +136 -122
- package/build-module/video/tracks-editor.js.map +1 -1
- package/build-style/editor-rtl.css +12 -8
- package/build-style/editor.css +12 -8
- package/build-style/navigation/style-rtl.css +1 -1
- package/build-style/navigation/style.css +1 -1
- package/build-style/page-list/style-rtl.css +4 -0
- package/build-style/page-list/style.css +4 -0
- package/build-style/query/editor-rtl.css +0 -4
- package/build-style/query/editor.css +0 -4
- package/build-style/search/style-rtl.css +3 -3
- package/build-style/search/style.css +3 -3
- package/build-style/social-link/editor-rtl.css +4 -4
- package/build-style/social-link/editor.css +4 -4
- package/build-style/style-rtl.css +8 -4
- package/build-style/style.css +8 -4
- package/build-style/video/editor-rtl.css +8 -0
- package/build-style/video/editor.css +8 -0
- package/package.json +33 -33
- package/src/block-keyboard-shortcuts/index.js +25 -11
- package/src/cover/edit/index.js +1 -1
- package/src/cover/index.js +8 -8
- package/src/cover/shared.js +10 -10
- package/src/cover/test/edit.js +2 -2
- package/src/details/index.js +23 -1
- package/src/file/edit.js +8 -2
- package/src/freeform/modal.js +1 -1
- package/src/heading/block.json +1 -7
- package/src/home-link/edit.js +27 -45
- package/src/home-link/index.php +0 -3
- package/src/navigation/index.php +4 -150
- package/src/navigation/style.scss +1 -1
- package/src/navigation/use-template-part-area-label.js +10 -10
- package/src/page-list/block.json +14 -0
- package/src/page-list/style.scss +4 -0
- package/src/paragraph/edit.js +20 -17
- package/src/pattern/index.php +0 -7
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +3 -5
- package/src/query/edit/inspector-controls/index.js +0 -10
- package/src/query/editor.scss +0 -4
- package/src/query/index.php +1 -1
- package/src/query/utils.js +14 -15
- package/src/rss/index.php +11 -8
- package/src/search/style.scss +3 -5
- package/src/social-link/edit.js +47 -19
- package/src/social-link/editor.scss +6 -7
- package/src/template-part/edit/advanced-controls.js +13 -13
- package/src/template-part/edit/utils/get-template-part-icon.js +20 -0
- package/src/template-part/edit/utils/hooks.js +2 -7
- package/src/template-part/variations.js +4 -16
- package/src/video/editor.scss +9 -0
- package/src/video/tracks-editor.js +157 -139
- package/build/query/edit/inspector-controls/create-new-post-link.js +0 -40
- package/build/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/build-module/query/edit/inspector-controls/create-new-post-link.js +0 -33
- package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +0 -1
- package/src/query/edit/inspector-controls/create-new-post-link.js +0 -32
|
@@ -2558,7 +2558,7 @@ button.wp-block-navigation-item__content {
|
|
|
2558
2558
|
padding-top: clamp(1rem, var(--wp--style--root--padding-top), 20rem);
|
|
2559
2559
|
padding-left: clamp(1rem, var(--wp--style--root--padding-right), 20rem);
|
|
2560
2560
|
padding-bottom: clamp(1rem, var(--wp--style--root--padding-bottom), 20rem);
|
|
2561
|
-
padding-right: clamp(1rem, var(--wp--style--root--padding-left),
|
|
2561
|
+
padding-right: clamp(1rem, var(--wp--style--root--padding-left), 20rem);
|
|
2562
2562
|
overflow: auto;
|
|
2563
2563
|
z-index: 100000;
|
|
2564
2564
|
}
|
|
@@ -2767,6 +2767,10 @@ html.has-modal-open {
|
|
|
2767
2767
|
background-color: inherit;
|
|
2768
2768
|
}
|
|
2769
2769
|
|
|
2770
|
+
.wp-block-page-list {
|
|
2771
|
+
box-sizing: border-box;
|
|
2772
|
+
}
|
|
2773
|
+
|
|
2770
2774
|
.is-small-text {
|
|
2771
2775
|
font-size: 0.875em;
|
|
2772
2776
|
}
|
|
@@ -3342,9 +3346,9 @@ ul.wp-block-rss.is-grid li {
|
|
|
3342
3346
|
margin-right: 0;
|
|
3343
3347
|
flex-shrink: 0;
|
|
3344
3348
|
max-width: 100%;
|
|
3345
|
-
|
|
3346
|
-
|
|
3347
|
-
|
|
3349
|
+
box-sizing: border-box;
|
|
3350
|
+
display: flex;
|
|
3351
|
+
justify-content: center;
|
|
3348
3352
|
}
|
|
3349
3353
|
.wp-block-search.wp-block-search__button-only .wp-block-search__inside-wrapper {
|
|
3350
3354
|
transition-property: width;
|
package/build-style/style.css
CHANGED
|
@@ -2590,7 +2590,7 @@ button.wp-block-navigation-item__content {
|
|
|
2590
2590
|
padding-top: clamp(1rem, var(--wp--style--root--padding-top), 20rem);
|
|
2591
2591
|
padding-right: clamp(1rem, var(--wp--style--root--padding-right), 20rem);
|
|
2592
2592
|
padding-bottom: clamp(1rem, var(--wp--style--root--padding-bottom), 20rem);
|
|
2593
|
-
padding-left: clamp(1rem, var(--wp--style--root--padding-left),
|
|
2593
|
+
padding-left: clamp(1rem, var(--wp--style--root--padding-left), 20rem);
|
|
2594
2594
|
overflow: auto;
|
|
2595
2595
|
z-index: 100000;
|
|
2596
2596
|
}
|
|
@@ -2799,6 +2799,10 @@ html.has-modal-open {
|
|
|
2799
2799
|
background-color: inherit;
|
|
2800
2800
|
}
|
|
2801
2801
|
|
|
2802
|
+
.wp-block-page-list {
|
|
2803
|
+
box-sizing: border-box;
|
|
2804
|
+
}
|
|
2805
|
+
|
|
2802
2806
|
.is-small-text {
|
|
2803
2807
|
font-size: 0.875em;
|
|
2804
2808
|
}
|
|
@@ -3376,9 +3380,9 @@ ul.wp-block-rss.is-grid li {
|
|
|
3376
3380
|
margin-left: 0;
|
|
3377
3381
|
flex-shrink: 0;
|
|
3378
3382
|
max-width: 100%;
|
|
3379
|
-
|
|
3380
|
-
|
|
3381
|
-
|
|
3383
|
+
box-sizing: border-box;
|
|
3384
|
+
display: flex;
|
|
3385
|
+
justify-content: center;
|
|
3382
3386
|
}
|
|
3383
3387
|
.wp-block-search.wp-block-search__button-only .wp-block-search__inside-wrapper {
|
|
3384
3388
|
transition-property: width;
|
|
@@ -132,6 +132,7 @@
|
|
|
132
132
|
max-width: 240px;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
.block-library-video-tracks-editor__tracks-informative-message-title,
|
|
135
136
|
.block-library-video-tracks-editor__single-track-editor-edit-track-label {
|
|
136
137
|
margin-top: 4px;
|
|
137
138
|
color: #757575;
|
|
@@ -148,4 +149,11 @@
|
|
|
148
149
|
.block-library-video-tracks-editor__track-list .components-menu-group__label,
|
|
149
150
|
.block-library-video-tracks-editor__add-tracks-container .components-menu-group__label {
|
|
150
151
|
padding: 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.block-library-video-tracks-editor__tracks-informative-message {
|
|
155
|
+
padding: 8px;
|
|
156
|
+
}
|
|
157
|
+
.block-library-video-tracks-editor__tracks-informative-message-description {
|
|
158
|
+
margin-bottom: 0;
|
|
151
159
|
}
|
|
@@ -132,6 +132,7 @@
|
|
|
132
132
|
max-width: 240px;
|
|
133
133
|
}
|
|
134
134
|
|
|
135
|
+
.block-library-video-tracks-editor__tracks-informative-message-title,
|
|
135
136
|
.block-library-video-tracks-editor__single-track-editor-edit-track-label {
|
|
136
137
|
margin-top: 4px;
|
|
137
138
|
color: #757575;
|
|
@@ -148,4 +149,11 @@
|
|
|
148
149
|
.block-library-video-tracks-editor__track-list .components-menu-group__label,
|
|
149
150
|
.block-library-video-tracks-editor__add-tracks-container .components-menu-group__label {
|
|
150
151
|
padding: 0;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
.block-library-video-tracks-editor__tracks-informative-message {
|
|
155
|
+
padding: 8px;
|
|
156
|
+
}
|
|
157
|
+
.block-library-video-tracks-editor__tracks-informative-message-description {
|
|
158
|
+
margin-bottom: 0;
|
|
151
159
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "9.12.0",
|
|
3
|
+
"version": "9.12.1-next.082ed6819.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -40,39 +40,39 @@
|
|
|
40
40
|
],
|
|
41
41
|
"dependencies": {
|
|
42
42
|
"@babel/runtime": "7.25.7",
|
|
43
|
-
"@wordpress/a11y": "
|
|
44
|
-
"@wordpress/api-fetch": "
|
|
45
|
-
"@wordpress/autop": "
|
|
46
|
-
"@wordpress/blob": "
|
|
47
|
-
"@wordpress/block-editor": "
|
|
48
|
-
"@wordpress/blocks": "
|
|
43
|
+
"@wordpress/a11y": "^4.12.1-next.082ed6819.0",
|
|
44
|
+
"@wordpress/api-fetch": "^7.12.1-next.082ed6819.0",
|
|
45
|
+
"@wordpress/autop": "^4.12.1-next.082ed6819.0",
|
|
46
|
+
"@wordpress/blob": "^4.12.1-next.082ed6819.0",
|
|
47
|
+
"@wordpress/block-editor": "^14.7.1-next.082ed6819.0",
|
|
48
|
+
"@wordpress/blocks": "^14.1.1-next.082ed6819.0",
|
|
49
49
|
"@wordpress/components": "*",
|
|
50
|
-
"@wordpress/compose": "
|
|
51
|
-
"@wordpress/core-data": "
|
|
50
|
+
"@wordpress/compose": "^7.12.1-next.082ed6819.0",
|
|
51
|
+
"@wordpress/core-data": "^7.12.1-next.082ed6819.0",
|
|
52
52
|
"@wordpress/data": "*",
|
|
53
|
-
"@wordpress/date": "
|
|
54
|
-
"@wordpress/deprecated": "
|
|
55
|
-
"@wordpress/dom": "
|
|
56
|
-
"@wordpress/element": "
|
|
57
|
-
"@wordpress/escape-html": "
|
|
58
|
-
"@wordpress/hooks": "
|
|
59
|
-
"@wordpress/html-entities": "
|
|
60
|
-
"@wordpress/i18n": "
|
|
61
|
-
"@wordpress/icons": "
|
|
62
|
-
"@wordpress/interactivity": "
|
|
63
|
-
"@wordpress/interactivity-router": "
|
|
64
|
-
"@wordpress/keyboard-shortcuts": "
|
|
65
|
-
"@wordpress/keycodes": "
|
|
66
|
-
"@wordpress/notices": "
|
|
67
|
-
"@wordpress/patterns": "
|
|
68
|
-
"@wordpress/primitives": "
|
|
69
|
-
"@wordpress/private-apis": "
|
|
70
|
-
"@wordpress/reusable-blocks": "
|
|
71
|
-
"@wordpress/rich-text": "
|
|
72
|
-
"@wordpress/server-side-render": "
|
|
73
|
-
"@wordpress/url": "
|
|
74
|
-
"@wordpress/viewport": "
|
|
75
|
-
"@wordpress/wordcount": "
|
|
53
|
+
"@wordpress/date": "^5.12.1-next.082ed6819.0",
|
|
54
|
+
"@wordpress/deprecated": "^4.12.1-next.082ed6819.0",
|
|
55
|
+
"@wordpress/dom": "^4.12.1-next.082ed6819.0",
|
|
56
|
+
"@wordpress/element": "^6.12.1-next.082ed6819.0",
|
|
57
|
+
"@wordpress/escape-html": "^3.12.1-next.082ed6819.0",
|
|
58
|
+
"@wordpress/hooks": "^4.12.1-next.082ed6819.0",
|
|
59
|
+
"@wordpress/html-entities": "^4.12.1-next.082ed6819.0",
|
|
60
|
+
"@wordpress/i18n": "^5.12.1-next.082ed6819.0",
|
|
61
|
+
"@wordpress/icons": "^10.12.1-next.082ed6819.0",
|
|
62
|
+
"@wordpress/interactivity": "^6.12.1-next.082ed6819.0",
|
|
63
|
+
"@wordpress/interactivity-router": "^2.12.1-next.082ed6819.0",
|
|
64
|
+
"@wordpress/keyboard-shortcuts": "^5.12.1-next.082ed6819.0",
|
|
65
|
+
"@wordpress/keycodes": "^4.12.1-next.082ed6819.0",
|
|
66
|
+
"@wordpress/notices": "^5.12.1-next.082ed6819.0",
|
|
67
|
+
"@wordpress/patterns": "^2.12.1-next.082ed6819.0",
|
|
68
|
+
"@wordpress/primitives": "^4.12.1-next.082ed6819.0",
|
|
69
|
+
"@wordpress/private-apis": "^1.12.1-next.082ed6819.0",
|
|
70
|
+
"@wordpress/reusable-blocks": "^5.12.1-next.082ed6819.0",
|
|
71
|
+
"@wordpress/rich-text": "^7.12.1-next.082ed6819.0",
|
|
72
|
+
"@wordpress/server-side-render": "^5.12.1-next.082ed6819.0",
|
|
73
|
+
"@wordpress/url": "^4.12.1-next.082ed6819.0",
|
|
74
|
+
"@wordpress/viewport": "^6.12.1-next.082ed6819.0",
|
|
75
|
+
"@wordpress/wordcount": "^4.12.1-next.082ed6819.0",
|
|
76
76
|
"change-case": "^4.1.2",
|
|
77
77
|
"clsx": "^2.1.1",
|
|
78
78
|
"colord": "^2.7.0",
|
|
@@ -90,5 +90,5 @@
|
|
|
90
90
|
"publishConfig": {
|
|
91
91
|
"access": "public"
|
|
92
92
|
},
|
|
93
|
-
"gitHead": "
|
|
93
|
+
"gitHead": "2bb7bad15ddb8e88210fab7d4a1ef1565466e424"
|
|
94
94
|
}
|
|
@@ -90,22 +90,36 @@ function BlockKeyboardShortcuts() {
|
|
|
90
90
|
},
|
|
91
91
|
} );
|
|
92
92
|
} );
|
|
93
|
-
}, [] );
|
|
93
|
+
}, [ registerShortcut ] );
|
|
94
94
|
|
|
95
95
|
useShortcut(
|
|
96
96
|
'core/block-editor/transform-heading-to-paragraph',
|
|
97
97
|
( event ) => handleTransformHeadingAndParagraph( event, 0 )
|
|
98
98
|
);
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
99
|
+
useShortcut(
|
|
100
|
+
'core/block-editor/transform-paragraph-to-heading-1',
|
|
101
|
+
( event ) => handleTransformHeadingAndParagraph( event, 1 )
|
|
102
|
+
);
|
|
103
|
+
useShortcut(
|
|
104
|
+
'core/block-editor/transform-paragraph-to-heading-2',
|
|
105
|
+
( event ) => handleTransformHeadingAndParagraph( event, 2 )
|
|
106
|
+
);
|
|
107
|
+
useShortcut(
|
|
108
|
+
'core/block-editor/transform-paragraph-to-heading-3',
|
|
109
|
+
( event ) => handleTransformHeadingAndParagraph( event, 3 )
|
|
110
|
+
);
|
|
111
|
+
useShortcut(
|
|
112
|
+
'core/block-editor/transform-paragraph-to-heading-4',
|
|
113
|
+
( event ) => handleTransformHeadingAndParagraph( event, 4 )
|
|
114
|
+
);
|
|
115
|
+
useShortcut(
|
|
116
|
+
'core/block-editor/transform-paragraph-to-heading-5',
|
|
117
|
+
( event ) => handleTransformHeadingAndParagraph( event, 5 )
|
|
118
|
+
);
|
|
119
|
+
useShortcut(
|
|
120
|
+
'core/block-editor/transform-paragraph-to-heading-6',
|
|
121
|
+
( event ) => handleTransformHeadingAndParagraph( event, 6 )
|
|
122
|
+
);
|
|
109
123
|
|
|
110
124
|
return null;
|
|
111
125
|
}
|
package/src/cover/edit/index.js
CHANGED
|
@@ -201,7 +201,7 @@ function CoverEdit( {
|
|
|
201
201
|
averageBackgroundColor
|
|
202
202
|
);
|
|
203
203
|
|
|
204
|
-
if ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes
|
|
204
|
+
if ( backgroundType === IMAGE_BACKGROUND_TYPE && mediaAttributes?.id ) {
|
|
205
205
|
const { imageDefaultSize } = getSettings();
|
|
206
206
|
|
|
207
207
|
// Try to use the previous selected image size if it's available
|
package/src/cover/index.js
CHANGED
|
@@ -26,6 +26,14 @@ export const settings = {
|
|
|
26
26
|
customOverlayColor: '#065174',
|
|
27
27
|
dimRatio: 40,
|
|
28
28
|
url: 'https://s.w.org/images/core/5.3/Windbuchencom.jpg',
|
|
29
|
+
style: {
|
|
30
|
+
typography: {
|
|
31
|
+
fontSize: 48,
|
|
32
|
+
},
|
|
33
|
+
color: {
|
|
34
|
+
text: 'white',
|
|
35
|
+
},
|
|
36
|
+
},
|
|
29
37
|
},
|
|
30
38
|
innerBlocks: [
|
|
31
39
|
{
|
|
@@ -33,14 +41,6 @@ export const settings = {
|
|
|
33
41
|
attributes: {
|
|
34
42
|
content: __( '<strong>Snow Patrol</strong>' ),
|
|
35
43
|
align: 'center',
|
|
36
|
-
style: {
|
|
37
|
-
typography: {
|
|
38
|
-
fontSize: 48,
|
|
39
|
-
},
|
|
40
|
-
color: {
|
|
41
|
-
text: 'white',
|
|
42
|
-
},
|
|
43
|
-
},
|
|
44
44
|
},
|
|
45
45
|
},
|
|
46
46
|
],
|
package/src/cover/shared.js
CHANGED
|
@@ -35,7 +35,7 @@ export function dimRatioToClass( ratio ) {
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
export function attributesFromMedia( media ) {
|
|
38
|
-
if ( ! media || ! media.url ) {
|
|
38
|
+
if ( ! media || ( ! media.url && ! media.src ) ) {
|
|
39
39
|
return {
|
|
40
40
|
url: undefined,
|
|
41
41
|
id: undefined,
|
|
@@ -52,23 +52,23 @@ export function attributesFromMedia( media ) {
|
|
|
52
52
|
if ( media.media_type === IMAGE_BACKGROUND_TYPE ) {
|
|
53
53
|
mediaType = IMAGE_BACKGROUND_TYPE;
|
|
54
54
|
} else {
|
|
55
|
-
//
|
|
55
|
+
// Only images and videos are accepted so if the media_type is not an image we can assume it is a video.
|
|
56
56
|
// Videos contain the media type of 'file' in the object returned from the rest api.
|
|
57
57
|
mediaType = VIDEO_BACKGROUND_TYPE;
|
|
58
58
|
}
|
|
59
|
-
} else {
|
|
60
59
|
// For media selections originated from existing files in the media library.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
}
|
|
60
|
+
} else if (
|
|
61
|
+
media.type &&
|
|
62
|
+
( media.type === IMAGE_BACKGROUND_TYPE ||
|
|
63
|
+
media.type === VIDEO_BACKGROUND_TYPE )
|
|
64
|
+
) {
|
|
67
65
|
mediaType = media.type;
|
|
66
|
+
} else {
|
|
67
|
+
return;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
return {
|
|
71
|
-
url: media.url,
|
|
71
|
+
url: media.url || media.src,
|
|
72
72
|
id: media.id,
|
|
73
73
|
alt: media?.alt,
|
|
74
74
|
backgroundType: mediaType,
|
package/src/cover/test/edit.js
CHANGED
|
@@ -337,7 +337,7 @@ describe( 'Cover block', () => {
|
|
|
337
337
|
describe( 'when colors are disabled', () => {
|
|
338
338
|
test( 'does not render overlay control', async () => {
|
|
339
339
|
await setup( undefined, true, disabledColorSettings );
|
|
340
|
-
await
|
|
340
|
+
await selectBlock( 'Block: Cover' );
|
|
341
341
|
await userEvent.click(
|
|
342
342
|
screen.getByRole( 'tab', { name: 'Styles' } )
|
|
343
343
|
);
|
|
@@ -350,7 +350,7 @@ describe( 'Cover block', () => {
|
|
|
350
350
|
} );
|
|
351
351
|
test( 'does not render opacity control', async () => {
|
|
352
352
|
await setup( undefined, true, disabledColorSettings );
|
|
353
|
-
await
|
|
353
|
+
await selectBlock( 'Block: Cover' );
|
|
354
354
|
await userEvent.click(
|
|
355
355
|
screen.getByRole( 'tab', { name: 'Styles' } )
|
|
356
356
|
);
|
package/src/details/index.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { details as icon } from '@wordpress/icons';
|
|
5
|
-
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Internal dependencies
|
|
@@ -34,6 +34,28 @@ export const settings = {
|
|
|
34
34
|
},
|
|
35
35
|
],
|
|
36
36
|
},
|
|
37
|
+
__experimentalLabel( attributes, { context } ) {
|
|
38
|
+
const { summary } = attributes;
|
|
39
|
+
|
|
40
|
+
const customName = attributes?.metadata?.name;
|
|
41
|
+
const hasSummary = summary?.trim().length > 0;
|
|
42
|
+
|
|
43
|
+
// In the list view, use the block's summary as the label.
|
|
44
|
+
// If the summary is empty, fall back to the default label.
|
|
45
|
+
if ( context === 'list-view' && ( customName || hasSummary ) ) {
|
|
46
|
+
return customName || summary;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if ( context === 'accessibility' ) {
|
|
50
|
+
return ! hasSummary
|
|
51
|
+
? __( 'Details. Empty.' )
|
|
52
|
+
: sprintf(
|
|
53
|
+
/* translators: accessibility text; summary title. */
|
|
54
|
+
__( 'Details. %s' ),
|
|
55
|
+
summary
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
},
|
|
37
59
|
save,
|
|
38
60
|
edit,
|
|
39
61
|
transforms,
|
package/src/file/edit.js
CHANGED
|
@@ -128,15 +128,21 @@ function FileEdit( { attributes, isSelected, setAttributes, clientId } ) {
|
|
|
128
128
|
}
|
|
129
129
|
|
|
130
130
|
const isPdf = newMedia.url.endsWith( '.pdf' );
|
|
131
|
+
const pdfAttributes = {
|
|
132
|
+
displayPreview: isPdf
|
|
133
|
+
? attributes.displayPreview ?? true
|
|
134
|
+
: undefined,
|
|
135
|
+
previewHeight: isPdf ? attributes.previewHeight ?? 600 : undefined,
|
|
136
|
+
};
|
|
137
|
+
|
|
131
138
|
setAttributes( {
|
|
132
139
|
href: newMedia.url,
|
|
133
140
|
fileName: newMedia.title,
|
|
134
141
|
textLinkHref: newMedia.url,
|
|
135
142
|
id: newMedia.id,
|
|
136
|
-
displayPreview: isPdf ? true : undefined,
|
|
137
|
-
previewHeight: isPdf ? 600 : undefined,
|
|
138
143
|
fileId: `wp-block-file--media-${ clientId }`,
|
|
139
144
|
blob: undefined,
|
|
145
|
+
...pdfAttributes,
|
|
140
146
|
} );
|
|
141
147
|
setTemporaryURL();
|
|
142
148
|
}
|
package/src/freeform/modal.js
CHANGED
package/src/heading/block.json
CHANGED
package/src/home-link/edit.js
CHANGED
|
@@ -6,15 +6,10 @@ import clsx from 'clsx';
|
|
|
6
6
|
/**
|
|
7
7
|
* WordPress dependencies
|
|
8
8
|
*/
|
|
9
|
-
import {
|
|
10
|
-
RichText,
|
|
11
|
-
useBlockProps,
|
|
12
|
-
store as blockEditorStore,
|
|
13
|
-
} from '@wordpress/block-editor';
|
|
9
|
+
import { RichText, useBlockProps } from '@wordpress/block-editor';
|
|
14
10
|
import { __ } from '@wordpress/i18n';
|
|
15
|
-
import { useSelect
|
|
11
|
+
import { useSelect } from '@wordpress/data';
|
|
16
12
|
import { store as coreStore } from '@wordpress/core-data';
|
|
17
|
-
import { useEffect } from '@wordpress/element';
|
|
18
13
|
|
|
19
14
|
const preventDefault = ( event ) => event.preventDefault();
|
|
20
15
|
|
|
@@ -24,8 +19,6 @@ export default function HomeEdit( { attributes, setAttributes, context } ) {
|
|
|
24
19
|
return select( coreStore ).getEntityRecord( 'root', '__unstableBase' )
|
|
25
20
|
?.home;
|
|
26
21
|
}, [] );
|
|
27
|
-
const { __unstableMarkNextChangeAsNotPersistent } =
|
|
28
|
-
useDispatch( blockEditorStore );
|
|
29
22
|
|
|
30
23
|
const { textColor, backgroundColor, style } = context;
|
|
31
24
|
const blockProps = useBlockProps( {
|
|
@@ -41,42 +34,31 @@ export default function HomeEdit( { attributes, setAttributes, context } ) {
|
|
|
41
34
|
},
|
|
42
35
|
} );
|
|
43
36
|
|
|
44
|
-
const { label } = attributes;
|
|
45
|
-
|
|
46
|
-
useEffect( () => {
|
|
47
|
-
if ( label === undefined ) {
|
|
48
|
-
__unstableMarkNextChangeAsNotPersistent();
|
|
49
|
-
setAttributes( { label: __( 'Home' ) } );
|
|
50
|
-
}
|
|
51
|
-
}, [ label ] );
|
|
52
|
-
|
|
53
37
|
return (
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
</div>
|
|
80
|
-
</>
|
|
38
|
+
<div { ...blockProps }>
|
|
39
|
+
<a
|
|
40
|
+
className="wp-block-home-link__content wp-block-navigation-item__content"
|
|
41
|
+
href={ homeUrl }
|
|
42
|
+
onClick={ preventDefault }
|
|
43
|
+
>
|
|
44
|
+
<RichText
|
|
45
|
+
identifier="label"
|
|
46
|
+
className="wp-block-home-link__label"
|
|
47
|
+
value={ attributes.label ?? __( 'Home' ) }
|
|
48
|
+
onChange={ ( labelValue ) => {
|
|
49
|
+
setAttributes( { label: labelValue } );
|
|
50
|
+
} }
|
|
51
|
+
aria-label={ __( 'Home link text' ) }
|
|
52
|
+
placeholder={ __( 'Add home link' ) }
|
|
53
|
+
withoutInteractiveFormatting
|
|
54
|
+
allowedFormats={ [
|
|
55
|
+
'core/bold',
|
|
56
|
+
'core/italic',
|
|
57
|
+
'core/image',
|
|
58
|
+
'core/strikethrough',
|
|
59
|
+
] }
|
|
60
|
+
/>
|
|
61
|
+
</a>
|
|
62
|
+
</div>
|
|
81
63
|
);
|
|
82
64
|
}
|
package/src/home-link/index.php
CHANGED
|
@@ -137,9 +137,6 @@ function block_core_home_link_build_li_wrapper_attributes( $context ) {
|
|
|
137
137
|
*/
|
|
138
138
|
function render_block_core_home_link( $attributes, $content, $block ) {
|
|
139
139
|
if ( empty( $attributes['label'] ) ) {
|
|
140
|
-
// Using a fallback for the label attribute allows rendering the block even if no attributes have been set,
|
|
141
|
-
// e.g. when using the block as a hooked block.
|
|
142
|
-
// Note that the fallback value needs to be kept in sync with the one set in `edit.js` (upon first loading the block in the editor).
|
|
143
140
|
$attributes['label'] = __( 'Home' );
|
|
144
141
|
}
|
|
145
142
|
$aria_current = '';
|