@wordpress/block-library 8.3.2 → 8.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +2 -0
- package/build/button/edit.js +3 -1
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +17 -6
- package/build/button/index.js.map +1 -1
- package/build/cover/edit/index.js +3 -2
- package/build/cover/edit/index.js.map +1 -1
- package/build/file/index.js +10 -1
- package/build/file/index.js.map +1 -1
- package/build/image/image.js +21 -15
- package/build/image/image.js.map +1 -1
- package/build/latest-comments/edit.js +6 -2
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-comments/index.js +13 -0
- package/build/latest-comments/index.js.map +1 -1
- package/build/navigation/edit/index.js +2 -28
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +5 -6
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +14 -11
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +4 -5
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-create-navigation-menu.js +11 -2
- package/build/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build/navigation/use-navigation-menu.js +1 -1
- package/build/navigation/use-navigation-menu.js.map +1 -1
- package/build/navigation-link/edit.js +4 -0
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +1 -0
- package/build/navigation-link/link-ui.js.map +1 -1
- package/build/navigation-submenu/edit.js +4 -0
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +5 -4
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/use-convert-to-navigation-links.js +61 -5
- package/build/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build/post-excerpt/edit.js +49 -3
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-excerpt/index.js +4 -0
- package/build/post-excerpt/index.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +52 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +9 -4
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/index.js +3 -0
- package/build/post-featured-image/index.js.map +1 -1
- package/build/{experiments.js → private-apis.js} +3 -3
- package/build/private-apis.js.map +1 -0
- package/build/site-logo/edit.js +7 -11
- package/build/site-logo/edit.js.map +1 -1
- package/build/table/edit.js +3 -3
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/utils.js +1 -1
- package/build/table-of-contents/utils.js.map +1 -1
- package/build/verse/index.js +6 -0
- package/build/verse/index.js.map +1 -1
- package/build-module/button/edit.js +2 -1
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +17 -6
- package/build-module/button/index.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/file/index.js +10 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/image/image.js +21 -15
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-comments/edit.js +6 -2
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-comments/index.js +13 -0
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/navigation/edit/index.js +3 -29
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +5 -5
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +14 -10
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +4 -5
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-create-navigation-menu.js +11 -2
- package/build-module/navigation/edit/use-create-navigation-menu.js.map +1 -1
- package/build-module/navigation/use-navigation-menu.js +1 -1
- package/build-module/navigation/use-navigation-menu.js.map +1 -1
- package/build-module/navigation-link/edit.js +4 -0
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +1 -0
- package/build-module/navigation-link/link-ui.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +4 -0
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +5 -4
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/use-convert-to-navigation-links.js +61 -5
- package/build-module/page-list/use-convert-to-navigation-links.js.map +1 -1
- package/build-module/post-excerpt/edit.js +52 -5
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-excerpt/index.js +4 -0
- package/build-module/post-excerpt/index.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +52 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +9 -4
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/index.js +3 -0
- package/build-module/post-featured-image/index.js.map +1 -1
- package/build-module/{experiments.js → private-apis.js} +2 -2
- package/build-module/private-apis.js.map +1 -0
- package/build-module/site-logo/edit.js +7 -11
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/table/edit.js +3 -3
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/utils.js +1 -1
- package/build-module/table-of-contents/utils.js.map +1 -1
- package/build-module/verse/index.js +6 -0
- package/build-module/verse/index.js.map +1 -1
- package/build-style/avatar/style-rtl.css +3 -0
- package/build-style/avatar/style.css +3 -0
- package/build-style/button/editor-rtl.css +31 -0
- package/build-style/button/editor.css +31 -0
- package/build-style/button/style-rtl.css +31 -0
- package/build-style/button/style.css +31 -0
- package/build-style/classic-rtl.css +5 -0
- package/build-style/classic.css +5 -0
- package/build-style/editor-rtl.css +36 -1
- package/build-style/editor.css +36 -1
- package/build-style/file/style-rtl.css +1 -0
- package/build-style/file/style.css +1 -0
- package/build-style/image/editor-rtl.css +1 -0
- package/build-style/image/editor.css +1 -0
- package/build-style/image/style-rtl.css +6 -2
- package/build-style/image/style.css +6 -0
- package/build-style/latest-comments/style-rtl.css +18 -5
- package/build-style/latest-comments/style.css +18 -5
- package/build-style/quote/style-rtl.css +5 -5
- package/build-style/quote/style.css +5 -5
- package/build-style/style-rtl.css +64 -12
- package/build-style/style.css +64 -10
- package/build-types/table-of-contents/utils.d.ts +1 -1
- package/package.json +30 -30
- package/src/avatar/index.php +67 -63
- package/src/avatar/style.scss +3 -0
- package/src/button/block.json +17 -6
- package/src/button/edit.js +2 -1
- package/src/button/editor.scss +36 -0
- package/src/button/style.scss +37 -1
- package/src/classic.scss +5 -0
- package/src/cover/edit/index.js +4 -1
- package/src/editor.scss +5 -0
- package/src/file/block.json +10 -1
- package/src/file/style.scss +1 -0
- package/src/image/editor.scss +1 -0
- package/src/image/image.js +32 -27
- package/src/image/style.scss +13 -0
- package/src/latest-comments/block.json +13 -0
- package/src/latest-comments/edit.js +9 -2
- package/src/latest-comments/style.scss +25 -7
- package/src/navigation/edit/index.js +1 -30
- package/src/navigation/edit/menu-inspector-controls.js +3 -4
- package/src/navigation/edit/navigation-menu-selector.js +12 -26
- package/src/navigation/edit/test/navigation-menu-selector.js +638 -0
- package/src/navigation/edit/unsaved-inner-blocks.js +29 -36
- package/src/navigation/edit/use-create-navigation-menu.js +13 -1
- package/src/navigation/index.php +8 -6
- package/src/navigation/use-navigation-menu.js +1 -1
- package/src/navigation-link/edit.js +3 -0
- package/src/navigation-link/link-ui.js +1 -0
- package/src/navigation-submenu/edit.js +3 -0
- package/src/page-list/edit.js +6 -5
- package/src/page-list/index.php +4 -4
- package/src/page-list/test/convert-to-links-modal.js +134 -0
- package/src/page-list/use-convert-to-navigation-links.js +64 -4
- package/src/post-excerpt/block.json +4 -0
- package/src/post-excerpt/edit.js +72 -7
- package/src/post-excerpt/index.php +29 -5
- package/src/post-featured-image/block.json +3 -0
- package/src/post-featured-image/dimension-controls.js +64 -2
- package/src/post-featured-image/edit.js +18 -6
- package/src/post-featured-image/index.php +25 -9
- package/src/post-title/index.php +3 -3
- package/src/{experiments.js → private-apis.js} +1 -1
- package/src/quote/style.scss +2 -2
- package/src/site-logo/edit.js +3 -6
- package/src/table/edit.js +3 -3
- package/src/table-of-contents/utils.ts +1 -1
- package/src/template-part/index.php +1 -1
- package/src/verse/block.json +6 -0
- package/tsconfig.json +24 -1
- package/tsconfig.tsbuildinfo +1 -1
- package/build/experiments.js.map +0 -1
- package/build/navigation/leaf-more-menu.js +0 -95
- package/build/navigation/leaf-more-menu.js.map +0 -1
- package/build-module/experiments.js.map +0 -1
- package/build-module/navigation/leaf-more-menu.js +0 -76
- package/build-module/navigation/leaf-more-menu.js.map +0 -1
- package/src/navigation/leaf-more-menu.js +0 -93
package/build-style/style.css
CHANGED
|
@@ -98,6 +98,9 @@
|
|
|
98
98
|
.wp-block-avatar {
|
|
99
99
|
box-sizing: border-box;
|
|
100
100
|
}
|
|
101
|
+
.wp-block-avatar img {
|
|
102
|
+
box-sizing: border-box;
|
|
103
|
+
}
|
|
101
104
|
.wp-block-avatar.aligncenter {
|
|
102
105
|
text-align: center;
|
|
103
106
|
}
|
|
@@ -200,6 +203,37 @@
|
|
|
200
203
|
background-image: none;
|
|
201
204
|
}
|
|
202
205
|
|
|
206
|
+
.wp-block-button .wp-block-button__link:where(.has-border-color) {
|
|
207
|
+
border-width: initial;
|
|
208
|
+
}
|
|
209
|
+
.wp-block-button .wp-block-button__link:where([style*="border-top-color"]) {
|
|
210
|
+
border-top-width: initial;
|
|
211
|
+
}
|
|
212
|
+
.wp-block-button .wp-block-button__link:where([style*="border-right-color"]) {
|
|
213
|
+
border-right-width: initial;
|
|
214
|
+
}
|
|
215
|
+
.wp-block-button .wp-block-button__link:where([style*="border-bottom-color"]) {
|
|
216
|
+
border-bottom-width: initial;
|
|
217
|
+
}
|
|
218
|
+
.wp-block-button .wp-block-button__link:where([style*="border-left-color"]) {
|
|
219
|
+
border-left-width: initial;
|
|
220
|
+
}
|
|
221
|
+
.wp-block-button .wp-block-button__link:where([style*="border-style"]) {
|
|
222
|
+
border-width: initial;
|
|
223
|
+
}
|
|
224
|
+
.wp-block-button .wp-block-button__link:where([style*="border-top-style"]) {
|
|
225
|
+
border-top-width: initial;
|
|
226
|
+
}
|
|
227
|
+
.wp-block-button .wp-block-button__link:where([style*="border-right-style"]) {
|
|
228
|
+
border-right-width: initial;
|
|
229
|
+
}
|
|
230
|
+
.wp-block-button .wp-block-button__link:where([style*="border-bottom-style"]) {
|
|
231
|
+
border-bottom-width: initial;
|
|
232
|
+
}
|
|
233
|
+
.wp-block-button .wp-block-button__link:where([style*="border-left-style"]) {
|
|
234
|
+
border-left-width: initial;
|
|
235
|
+
}
|
|
236
|
+
|
|
203
237
|
.wp-block-buttons {
|
|
204
238
|
/* stylelint-disable indentation */
|
|
205
239
|
}
|
|
@@ -1073,6 +1107,7 @@ section.wp-block-cover-image > h2,
|
|
|
1073
1107
|
:where(.wp-block-file__button) {
|
|
1074
1108
|
border-radius: 2em;
|
|
1075
1109
|
padding: 0.5em 1em;
|
|
1110
|
+
display: inline-block;
|
|
1076
1111
|
}
|
|
1077
1112
|
:where(.wp-block-file__button):is(a):hover, :where(.wp-block-file__button):is(a):visited, :where(.wp-block-file__button):is(a):focus, :where(.wp-block-file__button):is(a):active {
|
|
1078
1113
|
box-shadow: none;
|
|
@@ -1422,6 +1457,10 @@ h6.has-background {
|
|
|
1422
1457
|
vertical-align: bottom;
|
|
1423
1458
|
box-sizing: border-box;
|
|
1424
1459
|
}
|
|
1460
|
+
.wp-block-image[style*=border-radius] > a,
|
|
1461
|
+
.wp-block-image[style*=border-radius] img {
|
|
1462
|
+
border-radius: inherit;
|
|
1463
|
+
}
|
|
1425
1464
|
.wp-block-image.has-custom-border img {
|
|
1426
1465
|
box-sizing: border-box;
|
|
1427
1466
|
}
|
|
@@ -1450,6 +1489,7 @@ h6.has-background {
|
|
|
1450
1489
|
float: left;
|
|
1451
1490
|
/*rtl:ignore*/
|
|
1452
1491
|
margin-left: 0;
|
|
1492
|
+
/*rtl:ignore*/
|
|
1453
1493
|
margin-right: 1em;
|
|
1454
1494
|
margin-top: 0.5em;
|
|
1455
1495
|
margin-bottom: 0.5em;
|
|
@@ -1459,6 +1499,7 @@ h6.has-background {
|
|
|
1459
1499
|
float: right;
|
|
1460
1500
|
/*rtl:ignore*/
|
|
1461
1501
|
margin-right: 0;
|
|
1502
|
+
/*rtl:ignore*/
|
|
1462
1503
|
margin-left: 1em;
|
|
1463
1504
|
margin-top: 0.5em;
|
|
1464
1505
|
margin-bottom: 0.5em;
|
|
@@ -1534,12 +1575,24 @@ ol.wp-block-latest-comments {
|
|
|
1534
1575
|
box-sizing: border-box;
|
|
1535
1576
|
}
|
|
1536
1577
|
|
|
1578
|
+
:where(.wp-block-latest-comments:not([style*="line-height"] .wp-block-latest-comments__comment)) {
|
|
1579
|
+
line-height: 1.1;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
:where(.wp-block-latest-comments:not([style*="line-height"] .wp-block-latest-comments__comment-excerpt p)) {
|
|
1583
|
+
line-height: 1.8;
|
|
1584
|
+
}
|
|
1585
|
+
|
|
1586
|
+
.has-dates :where(.wp-block-latest-comments:not([style*="line-height"])),
|
|
1587
|
+
.has-excerpts :where(.wp-block-latest-comments:not([style*="line-height"])) {
|
|
1588
|
+
line-height: 1.5;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1537
1591
|
.wp-block-latest-comments .wp-block-latest-comments {
|
|
1538
1592
|
padding-left: 0;
|
|
1539
1593
|
}
|
|
1540
1594
|
|
|
1541
1595
|
.wp-block-latest-comments__comment {
|
|
1542
|
-
line-height: 1.1;
|
|
1543
1596
|
list-style: none;
|
|
1544
1597
|
margin-bottom: 1em;
|
|
1545
1598
|
}
|
|
@@ -1551,13 +1604,9 @@ ol.wp-block-latest-comments {
|
|
|
1551
1604
|
.has-avatars .wp-block-latest-comments__comment .wp-block-latest-comments__comment-excerpt {
|
|
1552
1605
|
margin-left: 3.25em;
|
|
1553
1606
|
}
|
|
1554
|
-
.has-dates .wp-block-latest-comments__comment, .has-excerpts .wp-block-latest-comments__comment {
|
|
1555
|
-
line-height: 1.5;
|
|
1556
|
-
}
|
|
1557
1607
|
|
|
1558
1608
|
.wp-block-latest-comments__comment-excerpt p {
|
|
1559
1609
|
font-size: 0.875em;
|
|
1560
|
-
line-height: 1.8;
|
|
1561
1610
|
margin: 0.36em 0 1.4em;
|
|
1562
1611
|
}
|
|
1563
1612
|
|
|
@@ -1576,6 +1625,11 @@ ol.wp-block-latest-comments {
|
|
|
1576
1625
|
width: 2.5em;
|
|
1577
1626
|
}
|
|
1578
1627
|
|
|
1628
|
+
.wp-block-latest-comments[style*=font-size] a,
|
|
1629
|
+
.wp-block-latest-comments[class*=-font-size] a {
|
|
1630
|
+
font-size: inherit;
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1579
1633
|
.wp-block-latest-posts {
|
|
1580
1634
|
box-sizing: border-box;
|
|
1581
1635
|
}
|
|
@@ -2715,18 +2769,18 @@ p.has-background {
|
|
|
2715
2769
|
box-sizing: border-box;
|
|
2716
2770
|
overflow-wrap: break-word;
|
|
2717
2771
|
}
|
|
2718
|
-
.wp-block-quote.is-style-large:not(.is-style-plain), .wp-block-quote.is-large:not(.is-style-plain) {
|
|
2772
|
+
.wp-block-quote.is-style-large:where(:not(.is-style-plain)), .wp-block-quote.is-large:where(:not(.is-style-plain)) {
|
|
2719
2773
|
margin-bottom: 1em;
|
|
2720
2774
|
padding: 0 1em;
|
|
2721
2775
|
}
|
|
2722
|
-
.wp-block-quote.is-style-large:not(.is-style-plain) p, .wp-block-quote.is-large:not(.is-style-plain) p {
|
|
2776
|
+
.wp-block-quote.is-style-large:where(:not(.is-style-plain)) p, .wp-block-quote.is-large:where(:not(.is-style-plain)) p {
|
|
2723
2777
|
font-size: 1.5em;
|
|
2724
2778
|
font-style: italic;
|
|
2725
2779
|
line-height: 1.6;
|
|
2726
2780
|
}
|
|
2727
|
-
.wp-block-quote.is-style-large:not(.is-style-plain) cite,
|
|
2728
|
-
.wp-block-quote.is-style-large:not(.is-style-plain) footer, .wp-block-quote.is-large:not(.is-style-plain) cite,
|
|
2729
|
-
.wp-block-quote.is-large:not(.is-style-plain) footer {
|
|
2781
|
+
.wp-block-quote.is-style-large:where(:not(.is-style-plain)) cite,
|
|
2782
|
+
.wp-block-quote.is-style-large:where(:not(.is-style-plain)) footer, .wp-block-quote.is-large:where(:not(.is-style-plain)) cite,
|
|
2783
|
+
.wp-block-quote.is-large:where(:not(.is-style-plain)) footer {
|
|
2730
2784
|
font-size: 1.125em;
|
|
2731
2785
|
text-align: right;
|
|
2732
2786
|
}
|
|
@@ -16,7 +16,7 @@ export interface NestedHeadingData {
|
|
|
16
16
|
* Takes a flat list of heading parameters and nests them based on each header's
|
|
17
17
|
* immediate parent's level.
|
|
18
18
|
*
|
|
19
|
-
* @param
|
|
19
|
+
* @param headingList The flat list of headings to nest.
|
|
20
20
|
*
|
|
21
21
|
* @return The nested list of headings.
|
|
22
22
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.4.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,34 +31,34 @@
|
|
|
31
31
|
],
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@wordpress/a11y": "^3.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/autop": "^3.
|
|
37
|
-
"@wordpress/blob": "^3.
|
|
38
|
-
"@wordpress/block-editor": "^11.
|
|
39
|
-
"@wordpress/blocks": "^12.
|
|
40
|
-
"@wordpress/components": "^23.
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/core-data": "^6.
|
|
43
|
-
"@wordpress/data": "^8.
|
|
44
|
-
"@wordpress/date": "^4.
|
|
45
|
-
"@wordpress/deprecated": "^3.
|
|
46
|
-
"@wordpress/dom": "^3.
|
|
47
|
-
"@wordpress/element": "^5.
|
|
48
|
-
"@wordpress/escape-html": "^2.
|
|
49
|
-
"@wordpress/
|
|
50
|
-
"@wordpress/
|
|
51
|
-
"@wordpress/
|
|
52
|
-
"@wordpress/
|
|
53
|
-
"@wordpress/
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/reusable-blocks": "^4.
|
|
58
|
-
"@wordpress/rich-text": "^6.
|
|
59
|
-
"@wordpress/server-side-render": "^4.
|
|
60
|
-
"@wordpress/url": "^3.
|
|
61
|
-
"@wordpress/viewport": "^5.
|
|
34
|
+
"@wordpress/a11y": "^3.27.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.24.0",
|
|
36
|
+
"@wordpress/autop": "^3.27.0",
|
|
37
|
+
"@wordpress/blob": "^3.27.0",
|
|
38
|
+
"@wordpress/block-editor": "^11.4.0",
|
|
39
|
+
"@wordpress/blocks": "^12.4.0",
|
|
40
|
+
"@wordpress/components": "^23.4.0",
|
|
41
|
+
"@wordpress/compose": "^6.4.0",
|
|
42
|
+
"@wordpress/core-data": "^6.4.0",
|
|
43
|
+
"@wordpress/data": "^8.4.0",
|
|
44
|
+
"@wordpress/date": "^4.27.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.27.0",
|
|
46
|
+
"@wordpress/dom": "^3.27.0",
|
|
47
|
+
"@wordpress/element": "^5.4.0",
|
|
48
|
+
"@wordpress/escape-html": "^2.27.0",
|
|
49
|
+
"@wordpress/hooks": "^3.27.0",
|
|
50
|
+
"@wordpress/html-entities": "^3.27.0",
|
|
51
|
+
"@wordpress/i18n": "^4.27.0",
|
|
52
|
+
"@wordpress/icons": "^9.18.0",
|
|
53
|
+
"@wordpress/keycodes": "^3.27.0",
|
|
54
|
+
"@wordpress/notices": "^3.27.0",
|
|
55
|
+
"@wordpress/primitives": "^3.25.0",
|
|
56
|
+
"@wordpress/private-apis": "^0.9.0",
|
|
57
|
+
"@wordpress/reusable-blocks": "^4.4.0",
|
|
58
|
+
"@wordpress/rich-text": "^6.4.0",
|
|
59
|
+
"@wordpress/server-side-render": "^4.4.0",
|
|
60
|
+
"@wordpress/url": "^3.28.0",
|
|
61
|
+
"@wordpress/viewport": "^5.4.0",
|
|
62
62
|
"change-case": "^4.1.2",
|
|
63
63
|
"classnames": "^2.3.1",
|
|
64
64
|
"colord": "^2.7.0",
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
"publishConfig": {
|
|
78
78
|
"access": "public"
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "c25ff895413bad4354c55c0c2d732552618b0d56"
|
|
81
81
|
}
|
package/src/avatar/index.php
CHANGED
|
@@ -16,67 +16,19 @@
|
|
|
16
16
|
function render_block_core_avatar( $attributes, $content, $block ) {
|
|
17
17
|
$size = isset( $attributes['size'] ) ? $attributes['size'] : 96;
|
|
18
18
|
$wrapper_attributes = get_block_wrapper_attributes();
|
|
19
|
+
$border_attributes = get_block_core_avatar_border_attributes( $attributes );
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
// Class gets passed through `esc_attr` via `get_avatar`.
|
|
22
|
+
$image_classes = ! empty( $border_attributes['class'] )
|
|
23
|
+
? "wp-block-avatar__image {$border_attributes['class']}"
|
|
24
|
+
: 'wp-block-avatar__image';
|
|
21
25
|
|
|
22
|
-
//
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
// Add border radius styles.
|
|
31
|
-
$has_border_radius = ! empty( $attributes['style']['border']['radius'] );
|
|
32
|
-
|
|
33
|
-
if ( $has_border_radius ) {
|
|
34
|
-
$border_radius = $attributes['style']['border']['radius'];
|
|
35
|
-
|
|
36
|
-
if ( is_array( $border_radius ) ) {
|
|
37
|
-
// Apply styles for individual corner border radii.
|
|
38
|
-
foreach ( $border_radius as $key => $value ) {
|
|
39
|
-
if ( null !== $value ) {
|
|
40
|
-
$name = _wp_to_kebab_case( $key );
|
|
41
|
-
// Add shared styles for individual border radii.
|
|
42
|
-
$border_style = sprintf(
|
|
43
|
-
'border-%s-radius: %s;',
|
|
44
|
-
esc_attr( $name ),
|
|
45
|
-
esc_attr( $value )
|
|
46
|
-
);
|
|
47
|
-
$image_styles[] = $border_style;
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
} else {
|
|
51
|
-
$border_style = sprintf( 'border-radius: %s;', esc_attr( $border_radius ) );
|
|
52
|
-
$image_styles[] = $border_style;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
// Add border color styles.
|
|
57
|
-
$has_border_color = ! empty( $attributes['style']['border']['color'] );
|
|
58
|
-
|
|
59
|
-
if ( $has_border_color ) {
|
|
60
|
-
$border_color = $attributes['style']['border']['color'];
|
|
61
|
-
$image_styles[] = sprintf( 'border-color: %s;', esc_attr( $border_color ) );
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
// Add border style (solid, dashed, dotted ).
|
|
65
|
-
$has_border_style = ! empty( $attributes['style']['border']['style'] );
|
|
66
|
-
|
|
67
|
-
if ( $has_border_style ) {
|
|
68
|
-
$border_style = $attributes['style']['border']['style'];
|
|
69
|
-
$image_styles[] = sprintf( 'border-style: %s;', esc_attr( $border_style ) );
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
// Add border classes to the avatar image for both custom colors and palette colors.
|
|
73
|
-
$image_classes = '';
|
|
74
|
-
if ( $has_border_color || isset( $attributes['borderColor'] ) ) {
|
|
75
|
-
$image_classes .= 'has-border-color';
|
|
76
|
-
}
|
|
77
|
-
if ( isset( $attributes['borderColor'] ) ) {
|
|
78
|
-
$image_classes .= ' has-' . $attributes['borderColor'] . '-border-color';
|
|
79
|
-
}
|
|
26
|
+
// Unlike class, `get_avatar` doesn't filter the styles via `esc_attr`.
|
|
27
|
+
// The style engine does pass the border styles through
|
|
28
|
+
// `safecss_filter_attr` however.
|
|
29
|
+
$image_styles = ! empty( $border_attributes['style'] )
|
|
30
|
+
? sprintf( ' style="%s"', esc_attr( $border_attributes['style'] ) )
|
|
31
|
+
: '';
|
|
80
32
|
|
|
81
33
|
if ( ! isset( $block->context['commentId'] ) ) {
|
|
82
34
|
$author_id = isset( $attributes['userId'] ) ? $attributes['userId'] : get_post_field( 'post_author', $block->context['postId'] );
|
|
@@ -89,8 +41,8 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
89
41
|
'',
|
|
90
42
|
$alt,
|
|
91
43
|
array(
|
|
92
|
-
'extra_attr' =>
|
|
93
|
-
'class' =>
|
|
44
|
+
'extra_attr' => $image_styles,
|
|
45
|
+
'class' => $image_classes,
|
|
94
46
|
)
|
|
95
47
|
);
|
|
96
48
|
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] ) {
|
|
@@ -116,8 +68,8 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
116
68
|
'',
|
|
117
69
|
$alt,
|
|
118
70
|
array(
|
|
119
|
-
'extra_attr' =>
|
|
120
|
-
'class' =>
|
|
71
|
+
'extra_attr' => $image_styles,
|
|
72
|
+
'class' => $image_classes,
|
|
121
73
|
)
|
|
122
74
|
);
|
|
123
75
|
if ( isset( $attributes['isLink'] ) && $attributes['isLink'] && isset( $comment->comment_author_url ) && '' !== $comment->comment_author_url ) {
|
|
@@ -132,6 +84,58 @@ function render_block_core_avatar( $attributes, $content, $block ) {
|
|
|
132
84
|
return sprintf( '<div %1s>%2s</div>', $wrapper_attributes, $avatar_block );
|
|
133
85
|
}
|
|
134
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Generates class names and styles to apply the border support styles for
|
|
89
|
+
* the Avatar block.
|
|
90
|
+
*
|
|
91
|
+
* @param array $attributes The block attributes.
|
|
92
|
+
* @return array The border-related classnames and styles for the block.
|
|
93
|
+
*/
|
|
94
|
+
function get_block_core_avatar_border_attributes( $attributes ) {
|
|
95
|
+
$border_styles = array();
|
|
96
|
+
$sides = array( 'top', 'right', 'bottom', 'left' );
|
|
97
|
+
|
|
98
|
+
// Border radius.
|
|
99
|
+
if ( isset( $attributes['style']['border']['radius'] ) ) {
|
|
100
|
+
$border_styles['radius'] = $attributes['style']['border']['radius'];
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Border style.
|
|
104
|
+
if ( isset( $attributes['style']['border']['style'] ) ) {
|
|
105
|
+
$border_styles['style'] = $attributes['style']['border']['style'];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
// Border width.
|
|
109
|
+
if ( isset( $attributes['style']['border']['width'] ) ) {
|
|
110
|
+
$border_styles['width'] = $attributes['style']['border']['width'];
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
// Border color.
|
|
114
|
+
$preset_color = array_key_exists( 'borderColor', $attributes ) ? "var:preset|color|{$attributes['borderColor']}" : null;
|
|
115
|
+
$custom_color = _wp_array_get( $attributes, array( 'style', 'border', 'color' ), null );
|
|
116
|
+
$border_styles['color'] = $preset_color ? $preset_color : $custom_color;
|
|
117
|
+
|
|
118
|
+
// Individual border styles e.g. top, left etc.
|
|
119
|
+
foreach ( $sides as $side ) {
|
|
120
|
+
$border = _wp_array_get( $attributes, array( 'style', 'border', $side ), null );
|
|
121
|
+
$border_styles[ $side ] = array(
|
|
122
|
+
'color' => isset( $border['color'] ) ? $border['color'] : null,
|
|
123
|
+
'style' => isset( $border['style'] ) ? $border['style'] : null,
|
|
124
|
+
'width' => isset( $border['width'] ) ? $border['width'] : null,
|
|
125
|
+
);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
$styles = wp_style_engine_get_styles( array( 'border' => $border_styles ) );
|
|
129
|
+
$attributes = array();
|
|
130
|
+
if ( ! empty( $styles['classnames'] ) ) {
|
|
131
|
+
$attributes['class'] = $styles['classnames'];
|
|
132
|
+
}
|
|
133
|
+
if ( ! empty( $styles['css'] ) ) {
|
|
134
|
+
$attributes['style'] = $styles['css'];
|
|
135
|
+
}
|
|
136
|
+
return $attributes;
|
|
137
|
+
}
|
|
138
|
+
|
|
135
139
|
/**
|
|
136
140
|
* Registers the `core/avatar` block on the server.
|
|
137
141
|
*/
|
package/src/avatar/style.scss
CHANGED
package/src/button/block.json
CHANGED
|
@@ -16,30 +16,35 @@
|
|
|
16
16
|
"type": "string",
|
|
17
17
|
"source": "attribute",
|
|
18
18
|
"selector": "a",
|
|
19
|
-
"attribute": "href"
|
|
19
|
+
"attribute": "href",
|
|
20
|
+
"__experimentalRole": "content"
|
|
20
21
|
},
|
|
21
22
|
"title": {
|
|
22
23
|
"type": "string",
|
|
23
24
|
"source": "attribute",
|
|
24
25
|
"selector": "a",
|
|
25
|
-
"attribute": "title"
|
|
26
|
+
"attribute": "title",
|
|
27
|
+
"__experimentalRole": "content"
|
|
26
28
|
},
|
|
27
29
|
"text": {
|
|
28
30
|
"type": "string",
|
|
29
31
|
"source": "html",
|
|
30
|
-
"selector": "a"
|
|
32
|
+
"selector": "a",
|
|
33
|
+
"__experimentalRole": "content"
|
|
31
34
|
},
|
|
32
35
|
"linkTarget": {
|
|
33
36
|
"type": "string",
|
|
34
37
|
"source": "attribute",
|
|
35
38
|
"selector": "a",
|
|
36
|
-
"attribute": "target"
|
|
39
|
+
"attribute": "target",
|
|
40
|
+
"__experimentalRole": "content"
|
|
37
41
|
},
|
|
38
42
|
"rel": {
|
|
39
43
|
"type": "string",
|
|
40
44
|
"source": "attribute",
|
|
41
45
|
"selector": "a",
|
|
42
|
-
"attribute": "rel"
|
|
46
|
+
"attribute": "rel",
|
|
47
|
+
"__experimentalRole": "content"
|
|
43
48
|
},
|
|
44
49
|
"placeholder": {
|
|
45
50
|
"type": "string"
|
|
@@ -92,10 +97,16 @@
|
|
|
92
97
|
}
|
|
93
98
|
},
|
|
94
99
|
"__experimentalBorder": {
|
|
100
|
+
"color": true,
|
|
95
101
|
"radius": true,
|
|
102
|
+
"style": true,
|
|
103
|
+
"width": true,
|
|
96
104
|
"__experimentalSkipSerialization": true,
|
|
97
105
|
"__experimentalDefaultControls": {
|
|
98
|
-
"
|
|
106
|
+
"color": true,
|
|
107
|
+
"radius": true,
|
|
108
|
+
"style": true,
|
|
109
|
+
"width": true
|
|
99
110
|
}
|
|
100
111
|
},
|
|
101
112
|
"__experimentalSelector": ".wp-block-button .wp-block-button__link"
|
package/src/button/edit.js
CHANGED
|
@@ -32,6 +32,7 @@ import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
|
|
|
32
32
|
import { link, linkOff } from '@wordpress/icons';
|
|
33
33
|
import { createBlock } from '@wordpress/blocks';
|
|
34
34
|
import { useMergeRefs } from '@wordpress/compose';
|
|
35
|
+
import { prependHTTP } from '@wordpress/url';
|
|
35
36
|
|
|
36
37
|
const NEW_TAB_REL = 'noreferrer noopener';
|
|
37
38
|
|
|
@@ -240,7 +241,7 @@ function ButtonEdit( props ) {
|
|
|
240
241
|
url: newURL = '',
|
|
241
242
|
opensInNewTab: newOpensInNewTab,
|
|
242
243
|
} ) => {
|
|
243
|
-
setAttributes( { url: newURL } );
|
|
244
|
+
setAttributes( { url: prependHTTP( newURL ) } );
|
|
244
245
|
|
|
245
246
|
if ( opensInNewTab !== newOpensInNewTab ) {
|
|
246
247
|
onToggleOpenInNewTab( newOpensInNewTab );
|
package/src/button/editor.scss
CHANGED
|
@@ -79,3 +79,39 @@ div[data-type="core/button"] {
|
|
|
79
79
|
.editor-styles-wrapper .wp-block-button[style*="text-decoration"] .wp-block-button__link {
|
|
80
80
|
text-decoration: inherit;
|
|
81
81
|
}
|
|
82
|
+
|
|
83
|
+
.editor-styles-wrapper .wp-block-button .wp-block-button__link {
|
|
84
|
+
// The following styles ensure a default border is applied when the user selects only a border color or style in the editor,
|
|
85
|
+
// but no width. They override the `border-width: 0;` applied by core's theme.json via the Elements API button.
|
|
86
|
+
&:where(.has-border-color) {
|
|
87
|
+
border-width: initial;
|
|
88
|
+
}
|
|
89
|
+
&:where([style*="border-top-color"]) {
|
|
90
|
+
border-top-width: initial;
|
|
91
|
+
}
|
|
92
|
+
&:where([style*="border-right-color"]) {
|
|
93
|
+
border-right-width: initial;
|
|
94
|
+
}
|
|
95
|
+
&:where([style*="border-bottom-color"]) {
|
|
96
|
+
border-bottom-width: initial;
|
|
97
|
+
}
|
|
98
|
+
&:where([style*="border-left-color"]) {
|
|
99
|
+
border-left-width: initial;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
&:where([style*="border-style"]) {
|
|
103
|
+
border-width: initial;
|
|
104
|
+
}
|
|
105
|
+
&:where([style*="border-top-style"]) {
|
|
106
|
+
border-top-width: initial;
|
|
107
|
+
}
|
|
108
|
+
&:where([style*="border-right-style"]) {
|
|
109
|
+
border-right-width: initial;
|
|
110
|
+
}
|
|
111
|
+
&:where([style*="border-bottom-style"]) {
|
|
112
|
+
border-bottom-width: initial;
|
|
113
|
+
}
|
|
114
|
+
&:where([style*="border-left-style"]) {
|
|
115
|
+
border-left-width: initial;
|
|
116
|
+
}
|
|
117
|
+
}
|
package/src/button/style.scss
CHANGED
|
@@ -92,7 +92,6 @@ $blocks-block__margin: 0.5em;
|
|
|
92
92
|
border-radius: 0;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
|
-
|
|
96
95
|
// the first selector is required for old buttons markup
|
|
97
96
|
.wp-block-button.no-border-radius,
|
|
98
97
|
.wp-block-button__link.no-border-radius {
|
|
@@ -116,3 +115,40 @@ $blocks-block__margin: 0.5em;
|
|
|
116
115
|
// background-image is required to overwrite a gradient background
|
|
117
116
|
background-image: none;
|
|
118
117
|
}
|
|
118
|
+
|
|
119
|
+
.wp-block-button .wp-block-button__link {
|
|
120
|
+
// The following styles ensure a default border is applied when the user
|
|
121
|
+
// selects only a border color or style. This overcomes the zero border
|
|
122
|
+
// width applied by core's theme.json via the elements API.
|
|
123
|
+
&:where(.has-border-color) {
|
|
124
|
+
border-width: initial;
|
|
125
|
+
}
|
|
126
|
+
&:where([style*="border-top-color"]) {
|
|
127
|
+
border-top-width: initial;
|
|
128
|
+
}
|
|
129
|
+
&:where([style*="border-right-color"]) {
|
|
130
|
+
border-right-width: initial;
|
|
131
|
+
}
|
|
132
|
+
&:where([style*="border-bottom-color"]) {
|
|
133
|
+
border-bottom-width: initial;
|
|
134
|
+
}
|
|
135
|
+
&:where([style*="border-left-color"]) {
|
|
136
|
+
border-left-width: initial;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
&:where([style*="border-style"]) {
|
|
140
|
+
border-width: initial;
|
|
141
|
+
}
|
|
142
|
+
&:where([style*="border-top-style"]) {
|
|
143
|
+
border-top-width: initial;
|
|
144
|
+
}
|
|
145
|
+
&:where([style*="border-right-style"]) {
|
|
146
|
+
border-right-width: initial;
|
|
147
|
+
}
|
|
148
|
+
&:where([style*="border-bottom-style"]) {
|
|
149
|
+
border-bottom-width: initial;
|
|
150
|
+
}
|
|
151
|
+
&:where([style*="border-left-style"]) {
|
|
152
|
+
border-left-width: initial;
|
|
153
|
+
}
|
|
154
|
+
}
|
package/src/classic.scss
CHANGED
package/src/cover/edit/index.js
CHANGED
|
@@ -116,7 +116,10 @@ function CoverEdit( {
|
|
|
116
116
|
// we define the url and background type
|
|
117
117
|
// depending on the value of the useFeaturedImage flag
|
|
118
118
|
// to preview in edit the dynamic featured image
|
|
119
|
-
const url = useFeaturedImage
|
|
119
|
+
const url = useFeaturedImage
|
|
120
|
+
? mediaUrl
|
|
121
|
+
: // Ensure the url is not malformed due to sanitization through `wp_kses`.
|
|
122
|
+
attributes.url?.replaceAll( '&', '&' );
|
|
120
123
|
const backgroundType = useFeaturedImage
|
|
121
124
|
? IMAGE_BACKGROUND_TYPE
|
|
122
125
|
: attributes.backgroundType;
|
package/src/editor.scss
CHANGED
|
@@ -93,3 +93,8 @@
|
|
|
93
93
|
* These are only output in the editor, but styles here are NOT prefixed .editor-styles-wrapper.
|
|
94
94
|
* This allows us to create normalization styles that are easily overridden by editor styles.
|
|
95
95
|
*/
|
|
96
|
+
|
|
97
|
+
// Remove the browser default border for iframe in Custom HTML block, Embed block, etc.
|
|
98
|
+
.editor-styles-wrapper iframe:not([frameborder]) {
|
|
99
|
+
border: 0;
|
|
100
|
+
}
|
package/src/file/block.json
CHANGED
|
@@ -56,7 +56,16 @@
|
|
|
56
56
|
},
|
|
57
57
|
"supports": {
|
|
58
58
|
"anchor": true,
|
|
59
|
-
"align": true
|
|
59
|
+
"align": true,
|
|
60
|
+
"color": {
|
|
61
|
+
"gradients": true,
|
|
62
|
+
"link": true,
|
|
63
|
+
"text": false,
|
|
64
|
+
"__experimentalDefaultControls": {
|
|
65
|
+
"background": true,
|
|
66
|
+
"link": true
|
|
67
|
+
}
|
|
68
|
+
}
|
|
60
69
|
},
|
|
61
70
|
"viewScript": "file:./view.min.js",
|
|
62
71
|
"editorStyle": "wp-block-file-editor",
|
package/src/file/style.scss
CHANGED
package/src/image/editor.scss
CHANGED