@wordpress/block-library 8.22.0 → 8.24.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/block/edit.js +11 -13
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +3 -4
- package/build/block/edit.native.js.map +1 -1
- package/build/button/edit.js +61 -9
- package/build/button/edit.js.map +1 -1
- package/build/code/transforms.js +20 -7
- package/build/code/transforms.js.map +1 -1
- package/build/column/edit.js +1 -1
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js +1 -1
- package/build/column/edit.native.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +1 -0
- package/build/comments/edit/comments-inspector-controls.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 +1 -0
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/details/edit.js +1 -2
- package/build/details/edit.js.map +1 -1
- package/build/file/edit.js +8 -9
- package/build/file/edit.js.map +1 -1
- package/build/file/view.js +4 -6
- package/build/file/view.js.map +1 -1
- package/build/form/index.js +1 -1
- package/build/form/index.js.map +1 -1
- package/build/form-submit-button/edit.js +2 -1
- package/build/form-submit-button/edit.js.map +1 -1
- package/build/gallery/gap-styles.js +12 -7
- package/build/gallery/gap-styles.js.map +1 -1
- package/build/group/edit.js +4 -7
- package/build/group/edit.js.map +1 -1
- package/build/html/transforms.js +7 -2
- package/build/html/transforms.js.map +1 -1
- package/build/image/deprecated.js +8 -0
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +17 -18
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +22 -15
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +35 -27
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +2 -3
- package/build/image/index.js.map +1 -1
- package/build/image/view.js +234 -266
- package/build/image/view.js.map +1 -1
- package/build/missing/index.js +1 -1
- package/build/navigation/edit/overlay-menu-preview.js +1 -1
- package/build/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build/navigation/use-template-part-area-label.js +2 -1
- package/build/navigation/use-template-part-area-label.js.map +1 -1
- package/build/navigation/view.js +153 -176
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/index.js +2 -1
- package/build/navigation-link/index.js.map +1 -1
- package/build/pattern/edit.js +2 -4
- package/build/pattern/edit.js.map +1 -1
- package/build/post-author/edit.js +0 -1
- package/build/post-author/edit.js.map +1 -1
- package/build/post-featured-image/edit.js +21 -6
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-template/edit.js +2 -8
- package/build/post-template/edit.js.map +1 -1
- package/build/post-template/index.js +1 -1
- package/build/post-terms/edit.js +0 -2
- package/build/post-terms/edit.js.map +1 -1
- package/build/preformatted/transforms.js +1 -4
- package/build/preformatted/transforms.js.map +1 -1
- package/build/query/edit/query-content.js +1 -0
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/view.js +52 -60
- package/build/query/view.js.map +1 -1
- package/build/quote/index.js +6 -0
- package/build/quote/index.js.map +1 -1
- package/build/search/view.js +66 -74
- package/build/search/view.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +1 -0
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/index.js +3 -7
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/index.js +6 -2
- package/build/template-part/index.js.map +1 -1
- package/build/template-part/variations.js +5 -1
- package/build/template-part/variations.js.map +1 -1
- package/build/utils/remove-anchor-tag.js +17 -0
- package/build/utils/remove-anchor-tag.js.map +1 -0
- package/build-module/block/edit.js +11 -13
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +3 -4
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/button/edit.js +65 -13
- package/build-module/button/edit.js.map +1 -1
- package/build-module/code/transforms.js +20 -7
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/column/edit.js +1 -1
- package/build-module/column/edit.js.map +1 -1
- package/build-module/column/edit.native.js +1 -1
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +1 -0
- package/build-module/comments/edit/comments-inspector-controls.js.map +1 -1
- package/build-module/cover/edit/index.js +2 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +1 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/details/edit.js +1 -2
- package/build-module/details/edit.js.map +1 -1
- package/build-module/file/edit.js +8 -9
- package/build-module/file/edit.js.map +1 -1
- package/build-module/file/view.js +5 -7
- package/build-module/file/view.js.map +1 -1
- package/build-module/form/index.js +1 -1
- package/build-module/form/index.js.map +1 -1
- package/build-module/form-submit-button/edit.js +2 -1
- package/build-module/form-submit-button/edit.js.map +1 -1
- package/build-module/gallery/gap-styles.js +13 -8
- package/build-module/gallery/gap-styles.js.map +1 -1
- package/build-module/group/edit.js +4 -7
- package/build-module/group/edit.js.map +1 -1
- package/build-module/html/transforms.js +7 -2
- package/build-module/html/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +8 -0
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +18 -19
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +23 -16
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +36 -28
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +2 -3
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/view.js +235 -267
- package/build-module/image/view.js.map +1 -1
- package/build-module/missing/index.js +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js +1 -1
- package/build-module/navigation/edit/overlay-menu-preview.js.map +1 -1
- package/build-module/navigation/use-template-part-area-label.js +2 -1
- package/build-module/navigation/use-template-part-area-label.js.map +1 -1
- package/build-module/navigation/view.js +154 -177
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +2 -2
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/index.js +2 -1
- package/build-module/navigation-link/index.js.map +1 -1
- package/build-module/pattern/edit.js +2 -4
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-author/edit.js +0 -1
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-featured-image/edit.js +21 -6
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-template/edit.js +2 -8
- package/build-module/post-template/edit.js.map +1 -1
- package/build-module/post-template/index.js +1 -1
- package/build-module/post-terms/edit.js +0 -2
- package/build-module/post-terms/edit.js.map +1 -1
- package/build-module/preformatted/transforms.js +1 -4
- package/build-module/preformatted/transforms.js.map +1 -1
- package/build-module/query/edit/query-content.js +1 -0
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/view.js +53 -61
- package/build-module/query/view.js.map +1 -1
- package/build-module/quote/index.js +6 -0
- package/build-module/quote/index.js.map +1 -1
- package/build-module/search/view.js +67 -75
- package/build-module/search/view.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +1 -0
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/index.js +5 -9
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/index.js +6 -2
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/template-part/variations.js +5 -1
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/utils/remove-anchor-tag.js +11 -0
- package/build-module/utils/remove-anchor-tag.js.map +1 -0
- package/build-style/cover/style-rtl.css +14 -14
- package/build-style/cover/style.css +14 -14
- package/build-style/editor-rtl.css +15 -6
- package/build-style/editor.css +15 -6
- package/build-style/gallery/style-rtl.css +28 -0
- package/build-style/gallery/style.css +28 -0
- package/build-style/image/style-rtl.css +19 -13
- package/build-style/image/style.css +19 -13
- package/build-style/post-featured-image/editor-rtl.css +9 -0
- package/build-style/post-featured-image/editor.css +9 -0
- package/build-style/quote/style-rtl.css +3 -0
- package/build-style/quote/style.css +3 -0
- package/build-style/read-more/style-rtl.css +2 -2
- package/build-style/read-more/style.css +2 -2
- package/build-style/style-rtl.css +66 -29
- package/build-style/style.css +66 -29
- package/package.json +32 -32
- package/src/block/edit.js +20 -20
- package/src/block/edit.native.js +5 -13
- package/src/button/edit.js +76 -10
- package/src/buttons/test/__snapshots__/edit.native.js.snap +0 -6
- package/src/buttons/test/edit.native.js +0 -27
- package/src/code/transforms.js +14 -8
- package/src/column/edit.js +1 -1
- package/src/column/edit.native.js +1 -1
- package/src/comments/edit/comments-inspector-controls.js +1 -0
- package/src/cover/edit/index.js +1 -0
- package/src/cover/edit/inspector-controls.js +1 -0
- package/src/cover/style.scss +1 -1
- package/src/cover/test/edit.js +1 -1
- package/src/details/edit.js +0 -1
- package/src/editor.scss +6 -6
- package/src/file/edit.js +11 -10
- package/src/file/index.php +30 -11
- package/src/file/view.js +5 -7
- package/src/form/index.js +1 -1
- package/src/form-submit-button/edit.js +1 -0
- package/src/gallery/gap-styles.js +10 -9
- package/src/gallery/style.scss +1 -0
- package/src/group/edit.js +4 -11
- package/src/heading/test/__snapshots__/index.native.js.snap +6 -0
- package/src/heading/test/index.native.js +40 -0
- package/src/html/transforms.js +5 -2
- package/src/image/block.json +2 -3
- package/src/image/deprecated.js +8 -0
- package/src/image/edit.js +16 -21
- package/src/image/edit.native.js +17 -18
- package/src/image/image.js +48 -51
- package/src/image/index.php +57 -49
- package/src/image/style.scss +18 -13
- package/src/image/view.js +281 -324
- package/src/missing/block.json +1 -1
- package/src/navigation/edit/overlay-menu-preview.js +1 -1
- package/src/navigation/index.php +46 -402
- package/src/navigation/use-template-part-area-label.js +4 -2
- package/src/navigation/view.js +159 -192
- package/src/navigation-link/block.json +2 -1
- package/src/navigation-link/edit.js +2 -2
- package/src/navigation-link/index.php +57 -0
- package/src/paragraph/test/__snapshots__/transforms.native.js.snap +6 -0
- package/src/paragraph/test/edit.native.js +37 -1
- package/src/paragraph/test/transforms.native.js +1 -0
- package/src/pattern/edit.js +7 -4
- package/src/pattern/index.php +6 -1
- package/src/post-author/edit.js +0 -1
- package/src/post-featured-image/edit.js +38 -5
- package/src/post-featured-image/editor.scss +19 -0
- package/src/post-template/block.json +0 -1
- package/src/post-template/edit.js +1 -5
- package/src/post-terms/edit.js +0 -2
- package/src/preformatted/transforms.js +1 -4
- package/src/query/edit/query-content.js +1 -0
- package/src/query/index.php +42 -24
- package/src/query/view.js +58 -65
- package/src/query-pagination-next/index.php +3 -3
- package/src/query-pagination-numbers/index.php +1 -1
- package/src/query-pagination-previous/index.php +3 -3
- package/src/quote/block.json +6 -0
- package/src/quote/style.scss +4 -0
- package/src/read-more/style.scss +1 -1
- package/src/search/index.php +40 -40
- package/src/search/view.js +58 -63
- package/src/template-part/edit/advanced-controls.js +1 -0
- package/src/template-part/edit/index.js +7 -14
- package/src/template-part/index.js +4 -3
- package/src/template-part/index.php +4 -4
- package/src/template-part/variations.js +4 -2
- package/src/utils/remove-anchor-tag.js +10 -0
- package/tsconfig.json +1 -0
package/build-style/style.css
CHANGED
|
@@ -840,20 +840,20 @@
|
|
|
840
840
|
color: inherit;
|
|
841
841
|
/*rtl:raw: direction: rtl; */
|
|
842
842
|
}
|
|
843
|
-
.wp-block-cover-image p:not(.has-text-color),
|
|
844
|
-
.wp-block-cover-image h1:not(.has-text-color),
|
|
845
|
-
.wp-block-cover-image h2:not(.has-text-color),
|
|
846
|
-
.wp-block-cover-image h3:not(.has-text-color),
|
|
847
|
-
.wp-block-cover-image h4:not(.has-text-color),
|
|
848
|
-
.wp-block-cover-image h5:not(.has-text-color),
|
|
849
|
-
.wp-block-cover-image h6:not(.has-text-color),
|
|
850
|
-
.wp-block-cover p:not(.has-text-color),
|
|
851
|
-
.wp-block-cover h1:not(.has-text-color),
|
|
852
|
-
.wp-block-cover h2:not(.has-text-color),
|
|
853
|
-
.wp-block-cover h3:not(.has-text-color),
|
|
854
|
-
.wp-block-cover h4:not(.has-text-color),
|
|
855
|
-
.wp-block-cover h5:not(.has-text-color),
|
|
856
|
-
.wp-block-cover h6:not(.has-text-color) {
|
|
843
|
+
.wp-block-cover-image p:where(:not(.has-text-color)),
|
|
844
|
+
.wp-block-cover-image h1:where(:not(.has-text-color)),
|
|
845
|
+
.wp-block-cover-image h2:where(:not(.has-text-color)),
|
|
846
|
+
.wp-block-cover-image h3:where(:not(.has-text-color)),
|
|
847
|
+
.wp-block-cover-image h4:where(:not(.has-text-color)),
|
|
848
|
+
.wp-block-cover-image h5:where(:not(.has-text-color)),
|
|
849
|
+
.wp-block-cover-image h6:where(:not(.has-text-color)),
|
|
850
|
+
.wp-block-cover p:where(:not(.has-text-color)),
|
|
851
|
+
.wp-block-cover h1:where(:not(.has-text-color)),
|
|
852
|
+
.wp-block-cover h2:where(:not(.has-text-color)),
|
|
853
|
+
.wp-block-cover h3:where(:not(.has-text-color)),
|
|
854
|
+
.wp-block-cover h4:where(:not(.has-text-color)),
|
|
855
|
+
.wp-block-cover h5:where(:not(.has-text-color)),
|
|
856
|
+
.wp-block-cover h6:where(:not(.has-text-color)) {
|
|
857
857
|
color: inherit;
|
|
858
858
|
}
|
|
859
859
|
.wp-block-cover-image.is-position-top-left,
|
|
@@ -1439,6 +1439,34 @@ figure.wp-block-gallery.has-nested-images {
|
|
|
1439
1439
|
text-align: center;
|
|
1440
1440
|
width: 100%;
|
|
1441
1441
|
box-sizing: border-box;
|
|
1442
|
+
scrollbar-width: thin;
|
|
1443
|
+
scrollbar-gutter: stable both-edges;
|
|
1444
|
+
scrollbar-color: transparent transparent;
|
|
1445
|
+
will-change: transform;
|
|
1446
|
+
}
|
|
1447
|
+
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption::-webkit-scrollbar {
|
|
1448
|
+
width: 12px;
|
|
1449
|
+
height: 12px;
|
|
1450
|
+
}
|
|
1451
|
+
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption::-webkit-scrollbar-track {
|
|
1452
|
+
background-color: transparent;
|
|
1453
|
+
}
|
|
1454
|
+
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption::-webkit-scrollbar-thumb {
|
|
1455
|
+
background-color: transparent;
|
|
1456
|
+
border-radius: 8px;
|
|
1457
|
+
border: 3px solid transparent;
|
|
1458
|
+
background-clip: padding-box;
|
|
1459
|
+
}
|
|
1460
|
+
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption:hover::-webkit-scrollbar-thumb, .wp-block-gallery.has-nested-images figure.wp-block-image figcaption:focus::-webkit-scrollbar-thumb, .wp-block-gallery.has-nested-images figure.wp-block-image figcaption:focus-within::-webkit-scrollbar-thumb {
|
|
1461
|
+
background-color: rgba(255, 255, 255, 0.8);
|
|
1462
|
+
}
|
|
1463
|
+
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption:hover, .wp-block-gallery.has-nested-images figure.wp-block-image figcaption:focus, .wp-block-gallery.has-nested-images figure.wp-block-image figcaption:focus-within {
|
|
1464
|
+
scrollbar-color: rgba(255, 255, 255, 0.8) transparent;
|
|
1465
|
+
}
|
|
1466
|
+
@media (hover: none) {
|
|
1467
|
+
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
|
|
1468
|
+
scrollbar-color: rgba(255, 255, 255, 0.8) transparent;
|
|
1469
|
+
}
|
|
1442
1470
|
}
|
|
1443
1471
|
.wp-block-gallery.has-nested-images figure.wp-block-image figcaption img {
|
|
1444
1472
|
display: inline;
|
|
@@ -1686,22 +1714,28 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1686
1714
|
.wp-lightbox-container button {
|
|
1687
1715
|
opacity: 0;
|
|
1688
1716
|
border: none;
|
|
1689
|
-
background:
|
|
1717
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
1718
|
+
-webkit-backdrop-filter: blur(16px) saturate(180%);
|
|
1719
|
+
backdrop-filter: blur(16px) saturate(180%);
|
|
1690
1720
|
cursor: zoom-in;
|
|
1691
|
-
|
|
1692
|
-
|
|
1721
|
+
display: flex;
|
|
1722
|
+
justify-content: center;
|
|
1723
|
+
align-items: center;
|
|
1724
|
+
width: 20px;
|
|
1725
|
+
height: 20px;
|
|
1693
1726
|
position: absolute;
|
|
1694
1727
|
z-index: 100;
|
|
1695
|
-
top:
|
|
1696
|
-
right:
|
|
1728
|
+
top: 16px;
|
|
1729
|
+
right: 16px;
|
|
1697
1730
|
text-align: center;
|
|
1698
1731
|
padding: 0;
|
|
1699
|
-
border-radius:
|
|
1732
|
+
border-radius: 4px;
|
|
1733
|
+
transition: opacity 0.2s ease;
|
|
1700
1734
|
}
|
|
1701
1735
|
.wp-lightbox-container button:focus-visible {
|
|
1702
|
-
outline:
|
|
1703
|
-
outline:
|
|
1704
|
-
outline-offset:
|
|
1736
|
+
outline: 3px auto rgba(90, 90, 90, 0.25);
|
|
1737
|
+
outline: 3px auto -webkit-focus-ring-color;
|
|
1738
|
+
outline-offset: 3px;
|
|
1705
1739
|
}
|
|
1706
1740
|
.wp-lightbox-container button:hover {
|
|
1707
1741
|
cursor: pointer;
|
|
@@ -1711,7 +1745,7 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1711
1745
|
opacity: 1;
|
|
1712
1746
|
}
|
|
1713
1747
|
.wp-lightbox-container button:hover, .wp-lightbox-container button:focus, .wp-lightbox-container button:not(:hover):not(:active):not(.has-background) {
|
|
1714
|
-
background:
|
|
1748
|
+
background-color: rgba(90, 90, 90, 0.25);
|
|
1715
1749
|
border: none;
|
|
1716
1750
|
}
|
|
1717
1751
|
|
|
@@ -1721,7 +1755,7 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1721
1755
|
left: 0;
|
|
1722
1756
|
z-index: 100000;
|
|
1723
1757
|
overflow: hidden;
|
|
1724
|
-
width:
|
|
1758
|
+
width: 100%;
|
|
1725
1759
|
height: 100vh;
|
|
1726
1760
|
box-sizing: border-box;
|
|
1727
1761
|
visibility: hidden;
|
|
@@ -1854,7 +1888,7 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1854
1888
|
}
|
|
1855
1889
|
@keyframes lightbox-zoom-in {
|
|
1856
1890
|
0% {
|
|
1857
|
-
transform: translate(calc(-
|
|
1891
|
+
transform: translate(calc((-100vw + var(--wp--lightbox-scrollbar-width)) / 2 + var(--wp--lightbox-initial-left-position)), calc(-50vh + var(--wp--lightbox-initial-top-position))) scale(var(--wp--lightbox-scale));
|
|
1858
1892
|
}
|
|
1859
1893
|
100% {
|
|
1860
1894
|
transform: translate(-50%, -50%) scale(1, 1);
|
|
@@ -1870,7 +1904,7 @@ h6.has-text-align-left[style*=writing-mode]:where([style*="vertical-lr"]) {
|
|
|
1870
1904
|
}
|
|
1871
1905
|
100% {
|
|
1872
1906
|
visibility: hidden;
|
|
1873
|
-
transform: translate(calc(-
|
|
1907
|
+
transform: translate(calc((-100vw + var(--wp--lightbox-scrollbar-width)) / 2 + var(--wp--lightbox-initial-left-position)), calc(-50vh + var(--wp--lightbox-initial-top-position))) scale(var(--wp--lightbox-scale));
|
|
1874
1908
|
}
|
|
1875
1909
|
}
|
|
1876
1910
|
ol.wp-block-latest-comments {
|
|
@@ -3150,16 +3184,19 @@ p.has-text-align-left[style*="writing-mode:vertical-lr"] {
|
|
|
3150
3184
|
font-size: 1.125em;
|
|
3151
3185
|
text-align: right;
|
|
3152
3186
|
}
|
|
3187
|
+
.wp-block-quote > cite {
|
|
3188
|
+
display: block;
|
|
3189
|
+
}
|
|
3153
3190
|
|
|
3154
3191
|
.wp-block-read-more {
|
|
3155
3192
|
display: block;
|
|
3156
3193
|
width: -moz-fit-content;
|
|
3157
3194
|
width: fit-content;
|
|
3158
3195
|
}
|
|
3159
|
-
.wp-block-read-more:not([style*=text-decoration]) {
|
|
3196
|
+
.wp-block-read-more:where(:not([style*="text-decoration"])) {
|
|
3160
3197
|
text-decoration: none;
|
|
3161
3198
|
}
|
|
3162
|
-
.wp-block-read-more:not([style*=text-decoration]):focus, .wp-block-read-more:not([style*=text-decoration]):active {
|
|
3199
|
+
.wp-block-read-more:where(:not([style*="text-decoration"])):focus, .wp-block-read-more:where(:not([style*="text-decoration"])):active {
|
|
3163
3200
|
text-decoration: none;
|
|
3164
3201
|
}
|
|
3165
3202
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.24.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.
|
|
35
|
-
"@wordpress/api-fetch": "^6.
|
|
36
|
-
"@wordpress/autop": "^3.
|
|
37
|
-
"@wordpress/blob": "^3.
|
|
38
|
-
"@wordpress/block-editor": "^12.
|
|
39
|
-
"@wordpress/blocks": "^12.
|
|
40
|
-
"@wordpress/components": "^25.
|
|
41
|
-
"@wordpress/compose": "^6.
|
|
42
|
-
"@wordpress/core-data": "^6.
|
|
43
|
-
"@wordpress/data": "^9.
|
|
44
|
-
"@wordpress/date": "^4.
|
|
45
|
-
"@wordpress/deprecated": "^3.
|
|
46
|
-
"@wordpress/dom": "^3.
|
|
47
|
-
"@wordpress/element": "^5.
|
|
48
|
-
"@wordpress/escape-html": "^2.
|
|
49
|
-
"@wordpress/hooks": "^3.
|
|
50
|
-
"@wordpress/html-entities": "^3.
|
|
51
|
-
"@wordpress/i18n": "^4.
|
|
52
|
-
"@wordpress/icons": "^9.
|
|
53
|
-
"@wordpress/interactivity": "^
|
|
54
|
-
"@wordpress/keycodes": "^3.
|
|
55
|
-
"@wordpress/notices": "^4.
|
|
56
|
-
"@wordpress/primitives": "^3.
|
|
57
|
-
"@wordpress/private-apis": "^0.
|
|
58
|
-
"@wordpress/reusable-blocks": "^4.
|
|
59
|
-
"@wordpress/rich-text": "^6.
|
|
60
|
-
"@wordpress/server-side-render": "^4.
|
|
61
|
-
"@wordpress/url": "^3.
|
|
62
|
-
"@wordpress/viewport": "^5.
|
|
63
|
-
"@wordpress/wordcount": "^3.
|
|
34
|
+
"@wordpress/a11y": "^3.47.0",
|
|
35
|
+
"@wordpress/api-fetch": "^6.44.0",
|
|
36
|
+
"@wordpress/autop": "^3.47.0",
|
|
37
|
+
"@wordpress/blob": "^3.47.0",
|
|
38
|
+
"@wordpress/block-editor": "^12.15.0",
|
|
39
|
+
"@wordpress/blocks": "^12.24.0",
|
|
40
|
+
"@wordpress/components": "^25.13.0",
|
|
41
|
+
"@wordpress/compose": "^6.24.0",
|
|
42
|
+
"@wordpress/core-data": "^6.24.0",
|
|
43
|
+
"@wordpress/data": "^9.17.0",
|
|
44
|
+
"@wordpress/date": "^4.47.0",
|
|
45
|
+
"@wordpress/deprecated": "^3.47.0",
|
|
46
|
+
"@wordpress/dom": "^3.47.0",
|
|
47
|
+
"@wordpress/element": "^5.24.0",
|
|
48
|
+
"@wordpress/escape-html": "^2.47.0",
|
|
49
|
+
"@wordpress/hooks": "^3.47.0",
|
|
50
|
+
"@wordpress/html-entities": "^3.47.0",
|
|
51
|
+
"@wordpress/i18n": "^4.47.0",
|
|
52
|
+
"@wordpress/icons": "^9.38.0",
|
|
53
|
+
"@wordpress/interactivity": "^3.0.0",
|
|
54
|
+
"@wordpress/keycodes": "^3.47.0",
|
|
55
|
+
"@wordpress/notices": "^4.15.0",
|
|
56
|
+
"@wordpress/primitives": "^3.45.0",
|
|
57
|
+
"@wordpress/private-apis": "^0.29.0",
|
|
58
|
+
"@wordpress/reusable-blocks": "^4.24.0",
|
|
59
|
+
"@wordpress/rich-text": "^6.24.0",
|
|
60
|
+
"@wordpress/server-side-render": "^4.24.0",
|
|
61
|
+
"@wordpress/url": "^3.48.0",
|
|
62
|
+
"@wordpress/viewport": "^5.24.0",
|
|
63
|
+
"@wordpress/wordcount": "^3.47.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": "d98dff8ea96f29cfea045bf964269f46f040d539"
|
|
82
82
|
}
|
package/src/block/edit.js
CHANGED
|
@@ -114,33 +114,28 @@ export default function ReusableBlockEdit( {
|
|
|
114
114
|
: InnerBlocks.ButtonBlockAppender,
|
|
115
115
|
} );
|
|
116
116
|
|
|
117
|
+
let children = null;
|
|
117
118
|
if ( hasAlreadyRendered ) {
|
|
118
|
-
|
|
119
|
-
<
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
</Warning>
|
|
123
|
-
</div>
|
|
119
|
+
children = (
|
|
120
|
+
<Warning>
|
|
121
|
+
{ __( 'Block cannot be rendered inside itself.' ) }
|
|
122
|
+
</Warning>
|
|
124
123
|
);
|
|
125
124
|
}
|
|
126
125
|
|
|
127
126
|
if ( isMissing ) {
|
|
128
|
-
|
|
129
|
-
<
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
</Warning>
|
|
133
|
-
</div>
|
|
127
|
+
children = (
|
|
128
|
+
<Warning>
|
|
129
|
+
{ __( 'Block has been deleted or is unavailable.' ) }
|
|
130
|
+
</Warning>
|
|
134
131
|
);
|
|
135
132
|
}
|
|
136
133
|
|
|
137
134
|
if ( ! hasResolved ) {
|
|
138
|
-
|
|
139
|
-
<
|
|
140
|
-
<
|
|
141
|
-
|
|
142
|
-
</Placeholder>
|
|
143
|
-
</div>
|
|
135
|
+
children = (
|
|
136
|
+
<Placeholder>
|
|
137
|
+
<Spinner />
|
|
138
|
+
</Placeholder>
|
|
144
139
|
);
|
|
145
140
|
}
|
|
146
141
|
|
|
@@ -149,14 +144,19 @@ export default function ReusableBlockEdit( {
|
|
|
149
144
|
<InspectorControls>
|
|
150
145
|
<PanelBody>
|
|
151
146
|
<TextControl
|
|
152
|
-
__nextHasNoMarginBottom
|
|
153
147
|
label={ __( 'Name' ) }
|
|
154
148
|
value={ title }
|
|
155
149
|
onChange={ setTitle }
|
|
150
|
+
__nextHasNoMarginBottom
|
|
151
|
+
__next40pxDefaultSize
|
|
156
152
|
/>
|
|
157
153
|
</PanelBody>
|
|
158
154
|
</InspectorControls>
|
|
159
|
-
|
|
155
|
+
{ children === null ? (
|
|
156
|
+
<div { ...innerBlocksProps } />
|
|
157
|
+
) : (
|
|
158
|
+
<div { ...blockProps }>{ children }</div>
|
|
159
|
+
) }
|
|
160
160
|
</RecursionProvider>
|
|
161
161
|
);
|
|
162
162
|
}
|
package/src/block/edit.native.js
CHANGED
|
@@ -78,7 +78,7 @@ export default function ReusableBlockEdit( {
|
|
|
78
78
|
styles.spinnerDark
|
|
79
79
|
);
|
|
80
80
|
|
|
81
|
-
const { hasResolved, isEditing, isMissing
|
|
81
|
+
const { hasResolved, isEditing, isMissing } = useSelect(
|
|
82
82
|
( select ) => {
|
|
83
83
|
const persistedBlock = select( coreStore ).getEntityRecord(
|
|
84
84
|
'postType',
|
|
@@ -176,20 +176,12 @@ export default function ReusableBlockEdit( {
|
|
|
176
176
|
{ infoTitle }
|
|
177
177
|
</Text>
|
|
178
178
|
<Text style={ [ infoTextStyle, infoDescriptionStyle ] }>
|
|
179
|
-
{
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
)
|
|
183
|
-
: __(
|
|
184
|
-
'Alternatively, you can detach and edit this block separately by tapping “Detach pattern”.'
|
|
185
|
-
) }
|
|
179
|
+
{ __(
|
|
180
|
+
'Alternatively, you can detach and edit this block separately by tapping “Detach”.'
|
|
181
|
+
) }
|
|
186
182
|
</Text>
|
|
187
183
|
<TextControl
|
|
188
|
-
label={
|
|
189
|
-
innerBlockCount > 1
|
|
190
|
-
? __( 'Detach patterns' )
|
|
191
|
-
: __( 'Detach pattern' )
|
|
192
|
-
}
|
|
184
|
+
label={ __( 'Detach' ) }
|
|
193
185
|
separatorType="topFullWidth"
|
|
194
186
|
onPress={ onConvertToRegularBlocks }
|
|
195
187
|
labelStyle={ actionButtonStyle }
|
package/src/button/edit.js
CHANGED
|
@@ -8,6 +8,7 @@ import classnames from 'classnames';
|
|
|
8
8
|
*/
|
|
9
9
|
import { NEW_TAB_TARGET, NOFOLLOW_REL } from './constants';
|
|
10
10
|
import { getUpdatedLinkAttributes } from './get-updated-link-attributes';
|
|
11
|
+
import removeAnchorTag from '../utils/remove-anchor-tag';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* WordPress dependencies
|
|
@@ -33,11 +34,17 @@ import {
|
|
|
33
34
|
__experimentalGetSpacingClassesAndStyles as useSpacingProps,
|
|
34
35
|
__experimentalLinkControl as LinkControl,
|
|
35
36
|
__experimentalGetElementClassName,
|
|
37
|
+
store as blockEditorStore,
|
|
36
38
|
} from '@wordpress/block-editor';
|
|
37
|
-
import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
|
|
39
|
+
import { displayShortcut, isKeyboardEvent, ENTER } from '@wordpress/keycodes';
|
|
38
40
|
import { link, linkOff } from '@wordpress/icons';
|
|
39
|
-
import {
|
|
40
|
-
|
|
41
|
+
import {
|
|
42
|
+
createBlock,
|
|
43
|
+
cloneBlock,
|
|
44
|
+
getDefaultBlockName,
|
|
45
|
+
} from '@wordpress/blocks';
|
|
46
|
+
import { useMergeRefs, useRefEffect } from '@wordpress/compose';
|
|
47
|
+
import { useSelect, useDispatch } from '@wordpress/data';
|
|
41
48
|
|
|
42
49
|
const LINK_SETTINGS = [
|
|
43
50
|
...LinkControl.DEFAULT_LINK_SETTINGS,
|
|
@@ -47,6 +54,62 @@ const LINK_SETTINGS = [
|
|
|
47
54
|
},
|
|
48
55
|
];
|
|
49
56
|
|
|
57
|
+
function useEnter( props ) {
|
|
58
|
+
const { replaceBlocks, selectionChange } = useDispatch( blockEditorStore );
|
|
59
|
+
const { getBlock, getBlockRootClientId, getBlockIndex } =
|
|
60
|
+
useSelect( blockEditorStore );
|
|
61
|
+
const propsRef = useRef( props );
|
|
62
|
+
propsRef.current = props;
|
|
63
|
+
return useRefEffect( ( element ) => {
|
|
64
|
+
function onKeyDown( event ) {
|
|
65
|
+
if ( event.defaultPrevented || event.keyCode !== ENTER ) {
|
|
66
|
+
return;
|
|
67
|
+
}
|
|
68
|
+
const { content, clientId } = propsRef.current;
|
|
69
|
+
if ( content.length ) {
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
event.preventDefault();
|
|
73
|
+
const topParentListBlock = getBlock(
|
|
74
|
+
getBlockRootClientId( clientId )
|
|
75
|
+
);
|
|
76
|
+
const blockIndex = getBlockIndex( clientId );
|
|
77
|
+
const head = cloneBlock( {
|
|
78
|
+
...topParentListBlock,
|
|
79
|
+
innerBlocks: topParentListBlock.innerBlocks.slice(
|
|
80
|
+
0,
|
|
81
|
+
blockIndex
|
|
82
|
+
),
|
|
83
|
+
} );
|
|
84
|
+
const middle = createBlock( getDefaultBlockName() );
|
|
85
|
+
const after = topParentListBlock.innerBlocks.slice(
|
|
86
|
+
blockIndex + 1
|
|
87
|
+
);
|
|
88
|
+
const tail = after.length
|
|
89
|
+
? [
|
|
90
|
+
cloneBlock( {
|
|
91
|
+
...topParentListBlock,
|
|
92
|
+
innerBlocks: after,
|
|
93
|
+
} ),
|
|
94
|
+
]
|
|
95
|
+
: [];
|
|
96
|
+
replaceBlocks(
|
|
97
|
+
topParentListBlock.clientId,
|
|
98
|
+
[ head, middle, ...tail ],
|
|
99
|
+
1
|
|
100
|
+
);
|
|
101
|
+
// We manually change the selection here because we are replacing
|
|
102
|
+
// a different block than the selected one.
|
|
103
|
+
selectionChange( middle.clientId );
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
element.addEventListener( 'keydown', onKeyDown );
|
|
107
|
+
return () => {
|
|
108
|
+
element.removeEventListener( 'keydown', onKeyDown );
|
|
109
|
+
};
|
|
110
|
+
}, [] );
|
|
111
|
+
}
|
|
112
|
+
|
|
50
113
|
function WidthPanel( { selectedWidth, setAttributes } ) {
|
|
51
114
|
function handleChange( newWidth ) {
|
|
52
115
|
// Check if we are toggling the width off
|
|
@@ -88,6 +151,7 @@ function ButtonEdit( props ) {
|
|
|
88
151
|
isSelected,
|
|
89
152
|
onReplace,
|
|
90
153
|
mergeBlocks,
|
|
154
|
+
clientId,
|
|
91
155
|
} = props;
|
|
92
156
|
const {
|
|
93
157
|
tagName,
|
|
@@ -103,11 +167,6 @@ function ButtonEdit( props ) {
|
|
|
103
167
|
|
|
104
168
|
const TagName = tagName || 'a';
|
|
105
169
|
|
|
106
|
-
function setButtonText( newText ) {
|
|
107
|
-
// Remove anchor tags from button text content.
|
|
108
|
-
setAttributes( { text: newText.replace( /<\/?a[^>]*>/g, '' ) } );
|
|
109
|
-
}
|
|
110
|
-
|
|
111
170
|
function onKeyDown( event ) {
|
|
112
171
|
if ( isKeyboardEvent.primary( event, 'k' ) ) {
|
|
113
172
|
startEditing( event );
|
|
@@ -164,6 +223,9 @@ function ButtonEdit( props ) {
|
|
|
164
223
|
[ url, opensInNewTab, nofollow ]
|
|
165
224
|
);
|
|
166
225
|
|
|
226
|
+
const useEnterRef = useEnter( { content: text, clientId } );
|
|
227
|
+
const mergedRef = useMergeRefs( [ useEnterRef, richTextRef ] );
|
|
228
|
+
|
|
167
229
|
return (
|
|
168
230
|
<>
|
|
169
231
|
<div
|
|
@@ -175,11 +237,15 @@ function ButtonEdit( props ) {
|
|
|
175
237
|
} ) }
|
|
176
238
|
>
|
|
177
239
|
<RichText
|
|
178
|
-
ref={
|
|
240
|
+
ref={ mergedRef }
|
|
179
241
|
aria-label={ __( 'Button text' ) }
|
|
180
242
|
placeholder={ placeholder || __( 'Add text…' ) }
|
|
181
243
|
value={ text }
|
|
182
|
-
onChange={ ( value ) =>
|
|
244
|
+
onChange={ ( value ) =>
|
|
245
|
+
setAttributes( {
|
|
246
|
+
text: removeAnchorTag( value ),
|
|
247
|
+
} )
|
|
248
|
+
}
|
|
183
249
|
withoutInteractiveFormatting
|
|
184
250
|
className={ classnames(
|
|
185
251
|
className,
|
|
@@ -71,9 +71,3 @@ exports[`Buttons block when a button is shown removing button along with buttons
|
|
|
71
71
|
<p></p>
|
|
72
72
|
<!-- /wp:paragraph -->"
|
|
73
73
|
`;
|
|
74
|
-
|
|
75
|
-
exports[`Buttons block when a button is shown removing button along with buttons block removes the button and buttons block when deleting the block using the delete (backspace) key 1`] = `
|
|
76
|
-
"<!-- wp:paragraph -->
|
|
77
|
-
<p></p>
|
|
78
|
-
<!-- /wp:paragraph -->"
|
|
79
|
-
`;
|
|
@@ -18,7 +18,6 @@ import {
|
|
|
18
18
|
*/
|
|
19
19
|
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
|
|
20
20
|
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
21
|
-
import { BACKSPACE } from '@wordpress/keycodes';
|
|
22
21
|
|
|
23
22
|
const BUTTONS_HTML = `<!-- wp:buttons -->
|
|
24
23
|
<div class="wp-block-buttons"><!-- wp:button /--></div>
|
|
@@ -238,32 +237,6 @@ describe( 'Buttons block', () => {
|
|
|
238
237
|
|
|
239
238
|
expect( getEditorHtml() ).toMatchSnapshot();
|
|
240
239
|
} );
|
|
241
|
-
|
|
242
|
-
it( 'removes the button and buttons block when deleting the block using the delete (backspace) key', async () => {
|
|
243
|
-
const screen = await initializeEditor( {
|
|
244
|
-
initialHtml: BUTTONS_HTML,
|
|
245
|
-
} );
|
|
246
|
-
|
|
247
|
-
// Get block
|
|
248
|
-
const buttonsBlock = await getBlock( screen, 'Buttons' );
|
|
249
|
-
triggerBlockListLayout( buttonsBlock );
|
|
250
|
-
|
|
251
|
-
// Get inner button block
|
|
252
|
-
const buttonBlock = await getBlock( screen, 'Button' );
|
|
253
|
-
fireEvent.press( buttonBlock );
|
|
254
|
-
|
|
255
|
-
const buttonInput =
|
|
256
|
-
within( buttonBlock ).getByLabelText( 'Text input. Empty' );
|
|
257
|
-
|
|
258
|
-
// Delete block
|
|
259
|
-
fireEvent( buttonInput, 'onKeyDown', {
|
|
260
|
-
nativeEvent: {},
|
|
261
|
-
preventDefault() {},
|
|
262
|
-
keyCode: BACKSPACE,
|
|
263
|
-
} );
|
|
264
|
-
|
|
265
|
-
expect( getEditorHtml() ).toMatchSnapshot();
|
|
266
|
-
} );
|
|
267
240
|
} );
|
|
268
241
|
} );
|
|
269
242
|
|
package/src/code/transforms.js
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { createBlock } from '@wordpress/blocks';
|
|
5
|
+
import { create, toHTMLString } from '@wordpress/rich-text';
|
|
5
6
|
|
|
6
7
|
const transforms = {
|
|
7
8
|
from: [
|
|
@@ -12,10 +13,18 @@ const transforms = {
|
|
|
12
13
|
},
|
|
13
14
|
{
|
|
14
15
|
type: 'block',
|
|
15
|
-
blocks: [ 'core/
|
|
16
|
-
transform: ( { content } ) =>
|
|
16
|
+
blocks: [ 'core/paragraph' ],
|
|
17
|
+
transform: ( { content } ) =>
|
|
18
|
+
createBlock( 'core/code', { content } ),
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
type: 'block',
|
|
22
|
+
blocks: [ 'core/html' ],
|
|
23
|
+
transform: ( { content: text } ) => {
|
|
17
24
|
return createBlock( 'core/code', {
|
|
18
|
-
|
|
25
|
+
// The HTML is plain text (with plain line breaks), so
|
|
26
|
+
// convert it to rich text.
|
|
27
|
+
content: toHTMLString( { value: create( { text } ) } ),
|
|
19
28
|
} );
|
|
20
29
|
},
|
|
21
30
|
},
|
|
@@ -42,11 +51,8 @@ const transforms = {
|
|
|
42
51
|
{
|
|
43
52
|
type: 'block',
|
|
44
53
|
blocks: [ 'core/paragraph' ],
|
|
45
|
-
transform: ( { content } ) =>
|
|
46
|
-
|
|
47
|
-
content: content.replace( /\n/g, '<br>' ),
|
|
48
|
-
} );
|
|
49
|
-
},
|
|
54
|
+
transform: ( { content } ) =>
|
|
55
|
+
createBlock( 'core/paragraph', { content } ),
|
|
50
56
|
},
|
|
51
57
|
],
|
|
52
58
|
};
|
package/src/column/edit.js
CHANGED
|
@@ -22,6 +22,7 @@ export default function CommentsInspectorControls( {
|
|
|
22
22
|
<InspectorControls group="advanced">
|
|
23
23
|
<SelectControl
|
|
24
24
|
__nextHasNoMarginBottom
|
|
25
|
+
__next40pxDefaultSize
|
|
25
26
|
label={ __( 'HTML element' ) }
|
|
26
27
|
options={ [
|
|
27
28
|
{ label: __( 'Default (<div>)' ), value: 'div' },
|
package/src/cover/edit/index.js
CHANGED
|
@@ -319,6 +319,7 @@ export default function CoverInspectorControls( {
|
|
|
319
319
|
<InspectorControls group="advanced">
|
|
320
320
|
<SelectControl
|
|
321
321
|
__nextHasNoMarginBottom
|
|
322
|
+
__next40pxDefaultSize
|
|
322
323
|
label={ __( 'HTML element' ) }
|
|
323
324
|
options={ [
|
|
324
325
|
{ label: __( 'Default (<div>)' ), value: 'div' },
|
package/src/cover/style.scss
CHANGED
package/src/cover/test/edit.js
CHANGED