@wordpress/block-library 8.18.1-next.5a1d1283.0 → 8.19.1
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/README.md +1 -1
- package/build/block/edit.js +53 -2
- package/build/block/edit.js.map +1 -1
- package/build/button/edit.js +7 -4
- package/build/button/edit.js.map +1 -1
- package/build/button/index.js +11 -2
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +10 -4
- package/build/button/save.js.map +1 -1
- package/build/buttons/edit.js +12 -3
- package/build/buttons/edit.js.map +1 -1
- package/build/code/edit.js +8 -2
- package/build/code/edit.js.map +1 -1
- package/build/code/index.js +7 -1
- package/build/code/index.js.map +1 -1
- package/build/column/index.js +1 -0
- package/build/column/index.js.map +1 -1
- package/build/columns/index.js +2 -0
- package/build/columns/index.js.map +1 -1
- package/build/file/edit.native.js +1 -1
- package/build/file/edit.native.js.map +1 -1
- package/build/file/index.js +2 -1
- package/build/file/index.js.map +1 -1
- package/build/file/utils/index.js +1 -15
- package/build/file/utils/index.js.map +1 -1
- package/build/file/view.js +14 -1
- package/build/file/view.js.map +1 -1
- package/build/footnotes/edit.js +12 -2
- package/build/footnotes/edit.js.map +1 -1
- package/build/gallery/edit.js +1 -1
- package/build/gallery/edit.js.map +1 -1
- package/build/group/edit.js +0 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +4 -0
- package/build/group/index.js.map +1 -1
- package/build/heading/edit.js +0 -1
- package/build/heading/edit.js.map +1 -1
- package/build/heading/index.js +2 -0
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +3 -6
- package/build/heading/transforms.js.map +1 -1
- package/build/image/deprecated.js +191 -7
- package/build/image/deprecated.js.map +1 -1
- package/build/image/edit.js +27 -12
- package/build/image/edit.js.map +1 -1
- package/build/image/image.js +75 -40
- package/build/image/image.js.map +1 -1
- package/build/image/index.js +7 -4
- package/build/image/index.js.map +1 -1
- package/build/image/{view-interactivity.js → view.js} +1 -1
- package/build/image/view.js.map +1 -0
- package/build/list/deprecated.js +93 -1
- package/build/list/deprecated.js.map +1 -1
- package/build/list/edit.js +10 -10
- package/build/list/edit.js.map +1 -1
- package/build/list/ordered-list-settings.js +10 -10
- package/build/list/ordered-list-settings.js.map +1 -1
- package/build/list/save.js +4 -2
- package/build/list/save.js.map +1 -1
- package/build/list/utils.js +21 -2
- package/build/list/utils.js.map +1 -1
- package/build/navigation/constants.js +1 -1
- package/build/navigation/constants.js.map +1 -1
- package/build/navigation/index.js +4 -2
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/view.js +168 -82
- package/build/navigation/view.js.map +1 -1
- package/build/navigation-link/edit.js +3 -9
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/transforms.js +24 -0
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/page-list/edit.js +2 -1
- package/build/page-list/edit.js.map +1 -1
- package/build/pattern/edit.js +2 -0
- package/build/pattern/edit.js.map +1 -1
- package/build/post-comments-form/edit.js +10 -2
- package/build/post-comments-form/edit.js.map +1 -1
- package/build/post-comments-form/form.js +5 -3
- package/build/post-comments-form/form.js.map +1 -1
- package/build/post-content/edit.js +8 -7
- package/build/post-content/edit.js.map +1 -1
- package/build/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-featured-image/overlay.js +2 -1
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/preformatted/edit.js +4 -1
- package/build/preformatted/edit.js.map +1 -1
- package/build/preformatted/index.js +1 -1
- package/build/preformatted/index.js.map +1 -1
- package/build/pullquote/deprecated.js +6 -7
- package/build/pullquote/deprecated.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +56 -0
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -0
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +42 -0
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -0
- package/build/query/edit/inspector-controls/index.js +8 -25
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-content.js +8 -2
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/utils.js +19 -0
- package/build/query/utils.js.map +1 -1
- package/build/query/view.js +21 -6
- package/build/query/view.js.map +1 -1
- package/build/search/index.js +1 -0
- package/build/search/index.js.map +1 -1
- package/build/search/view.js +81 -150
- package/build/search/view.js.map +1 -1
- package/build/social-link/edit.native.js +3 -1
- package/build/social-link/edit.native.js.map +1 -1
- package/build/table/edit.js +7 -7
- package/build/table/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +2 -130
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/table-of-contents/hooks.js +145 -0
- package/build/table-of-contents/hooks.js.map +1 -0
- package/build/table-of-contents/index.js +2 -1
- package/build/table-of-contents/index.js.map +1 -1
- package/build/verse/edit.js +4 -1
- package/build/verse/edit.js.map +1 -1
- package/build/verse/index.js +1 -1
- package/build/verse/index.js.map +1 -1
- package/build-module/block/edit.js +54 -3
- package/build-module/block/edit.js.map +1 -1
- package/build-module/button/edit.js +7 -4
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/index.js +11 -2
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +10 -4
- package/build-module/button/save.js.map +1 -1
- package/build-module/buttons/edit.js +12 -3
- package/build-module/buttons/edit.js.map +1 -1
- package/build-module/code/edit.js +8 -2
- package/build-module/code/edit.js.map +1 -1
- package/build-module/code/index.js +7 -1
- package/build-module/code/index.js.map +1 -1
- package/build-module/column/index.js +1 -0
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/index.js +2 -0
- package/build-module/columns/index.js.map +1 -1
- package/build-module/file/edit.native.js +1 -1
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/file/index.js +2 -1
- package/build-module/file/index.js.map +1 -1
- package/build-module/file/utils/index.js +0 -13
- package/build-module/file/utils/index.js.map +1 -1
- package/build-module/file/view.js +14 -2
- package/build-module/file/view.js.map +1 -1
- package/build-module/footnotes/edit.js +12 -2
- package/build-module/footnotes/edit.js.map +1 -1
- package/build-module/gallery/edit.js +1 -1
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/group/edit.js +0 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +4 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/edit.js +0 -1
- package/build-module/heading/edit.js.map +1 -1
- package/build-module/heading/index.js +2 -0
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +3 -6
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/image/deprecated.js +191 -7
- package/build-module/image/deprecated.js.map +1 -1
- package/build-module/image/edit.js +27 -12
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/image.js +77 -42
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/index.js +7 -4
- package/build-module/image/index.js.map +1 -1
- package/build-module/image/{view-interactivity.js → view.js} +1 -1
- package/build-module/image/view.js.map +1 -0
- package/build-module/list/deprecated.js +95 -3
- package/build-module/list/deprecated.js.map +1 -1
- package/build-module/list/edit.js +10 -10
- package/build-module/list/edit.js.map +1 -1
- package/build-module/list/ordered-list-settings.js +10 -10
- package/build-module/list/ordered-list-settings.js.map +1 -1
- package/build-module/list/save.js +4 -2
- package/build-module/list/save.js.map +1 -1
- package/build-module/list/utils.js +20 -2
- package/build-module/list/utils.js.map +1 -1
- package/build-module/navigation/constants.js +1 -1
- package/build-module/navigation/constants.js.map +1 -1
- package/build-module/navigation/index.js +4 -2
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/view.js +168 -83
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/navigation-link/edit.js +3 -9
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/transforms.js +24 -0
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/page-list/edit.js +2 -1
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/pattern/edit.js +2 -0
- package/build-module/pattern/edit.js.map +1 -1
- package/build-module/post-comments-form/edit.js +10 -2
- package/build-module/post-comments-form/edit.js.map +1 -1
- package/build-module/post-comments-form/form.js +5 -3
- package/build-module/post-comments-form/form.js.map +1 -1
- package/build-module/post-content/edit.js +8 -7
- package/build-module/post-content/edit.js.map +1 -1
- package/build-module/post-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +2 -1
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/preformatted/edit.js +4 -1
- package/build-module/preformatted/edit.js.map +1 -1
- package/build-module/preformatted/index.js +1 -1
- package/build-module/preformatted/index.js.map +1 -1
- package/build-module/pullquote/deprecated.js +6 -7
- package/build-module/pullquote/deprecated.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +50 -0
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -0
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +35 -0
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -0
- package/build-module/query/edit/inspector-controls/index.js +9 -26
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-content.js +8 -2
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/utils.js +17 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query/view.js +21 -6
- package/build-module/query/view.js.map +1 -1
- package/build-module/search/index.js +1 -0
- package/build-module/search/index.js.map +1 -1
- package/build-module/search/view.js +81 -151
- package/build-module/search/view.js.map +1 -1
- package/build-module/social-link/edit.native.js +3 -1
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/table/edit.js +7 -7
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +3 -131
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/table-of-contents/hooks.js +137 -0
- package/build-module/table-of-contents/hooks.js.map +1 -0
- package/build-module/table-of-contents/index.js +2 -1
- package/build-module/table-of-contents/index.js.map +1 -1
- package/build-module/verse/edit.js +4 -1
- package/build-module/verse/edit.js.map +1 -1
- package/build-module/verse/index.js +1 -1
- package/build-module/verse/index.js.map +1 -1
- package/build-style/cover/style-rtl.css +9 -0
- package/build-style/cover/style.css +9 -0
- package/build-style/editor-rtl.css +15 -9
- package/build-style/editor.css +15 -9
- package/build-style/file/style-rtl.css +5 -0
- package/build-style/file/style.css +5 -0
- package/build-style/heading/style-rtl.css +13 -0
- package/build-style/heading/style.css +13 -0
- package/build-style/navigation-link/editor-rtl.css +0 -9
- package/build-style/navigation-link/editor.css +0 -9
- package/build-style/paragraph/editor-rtl.css +5 -0
- package/build-style/paragraph/editor.css +5 -0
- package/build-style/paragraph/style-rtl.css +5 -0
- package/build-style/paragraph/style.css +5 -0
- package/build-style/post-navigation-link/style-rtl.css +3 -0
- package/build-style/post-navigation-link/style.css +3 -0
- package/build-style/query/editor-rtl.css +10 -0
- package/build-style/query/editor.css +10 -0
- package/build-style/query/style-rtl.css +1 -1
- package/build-style/query/style.css +1 -1
- package/build-style/reset-rtl.css +27 -27
- package/build-style/reset.css +27 -27
- package/build-style/style-rtl.css +35 -0
- package/build-style/style.css +35 -0
- package/package.json +33 -34
- package/src/audio/test/__snapshots__/edit.native.js.snap +78 -106
- package/src/avatar/index.php +2 -2
- package/src/block/edit.js +58 -2
- package/src/block/test/edit.native.js +2 -3
- package/src/button/block.json +11 -2
- package/src/button/edit.js +27 -11
- package/src/button/save.js +10 -4
- package/src/buttons/edit.js +13 -3
- package/src/buttons/test/edit.native.js +28 -24
- package/src/calendar/index.php +2 -2
- package/src/code/block.json +2 -1
- package/src/code/edit.js +13 -1
- package/src/code/index.js +5 -0
- package/src/column/block.json +1 -0
- package/src/columns/block.json +2 -0
- package/src/comment-template/index.php +1 -1
- package/src/comments-pagination-next/index.php +1 -1
- package/src/comments-pagination-previous/index.php +1 -1
- package/src/cover/style.scss +12 -1
- package/src/cover/test/edit.js +10 -10
- package/src/cover/test/edit.native.js +18 -27
- package/src/embed/test/index.native.js +30 -45
- package/src/file/block.json +2 -1
- package/src/file/edit.native.js +1 -1
- package/src/file/index.php +21 -21
- package/src/file/style.scss +6 -1
- package/src/file/test/__snapshots__/edit.native.js.snap +162 -218
- package/src/file/utils/index.js +0 -15
- package/src/file/view.js +14 -5
- package/src/footnotes/edit.js +13 -1
- package/src/gallery/edit.js +1 -1
- package/src/gallery/index.php +1 -1
- package/src/group/block.json +4 -0
- package/src/group/edit.js +0 -1
- package/src/heading/block.json +2 -0
- package/src/heading/edit.js +0 -1
- package/src/heading/style.scss +4 -0
- package/src/heading/transforms.js +1 -6
- package/src/image/block.json +7 -4
- package/src/image/deprecated.js +210 -7
- package/src/image/edit.js +43 -29
- package/src/image/image.js +86 -43
- package/src/image/index.php +253 -28
- package/src/latest-posts/index.php +1 -1
- package/src/list/deprecated.js +84 -3
- package/src/list/edit.js +6 -3
- package/src/list/ordered-list-settings.js +20 -5
- package/src/list/save.js +10 -1
- package/src/list/test/edit.native.js +2 -4
- package/src/list/utils.js +22 -1
- package/src/navigation/block.json +4 -2
- package/src/navigation/constants.js +1 -0
- package/src/navigation/index.php +87 -123
- package/src/navigation/view.js +192 -96
- package/src/navigation-link/edit.js +21 -36
- package/src/navigation-link/editor.scss +0 -8
- package/src/navigation-link/transforms.js +22 -0
- package/src/page-list/edit.js +2 -1
- package/src/paragraph/editor.scss +5 -0
- package/src/paragraph/style.scss +5 -0
- package/src/pattern/edit.js +1 -0
- package/src/pattern/index.php +5 -5
- package/src/post-comments-form/edit.js +10 -0
- package/src/post-comments-form/form.js +7 -1
- package/src/post-content/block.json +3 -0
- package/src/post-content/edit.js +14 -6
- package/src/post-excerpt/index.php +2 -2
- package/src/post-featured-image/index.php +2 -2
- package/src/post-featured-image/overlay.js +1 -0
- package/src/post-navigation-link/index.php +0 -5
- package/src/post-navigation-link/style.scss +4 -0
- package/src/post-template/index.php +1 -1
- package/src/post-terms/index.php +5 -2
- package/src/preformatted/edit.js +5 -0
- package/src/preformatted/index.js +1 -1
- package/src/pullquote/deprecated.js +8 -13
- package/src/query/edit/enhanced-pagination-modal.js +65 -0
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +49 -0
- package/src/query/edit/inspector-controls/index.js +9 -45
- package/src/query/edit/query-content.js +8 -0
- package/src/query/editor.scss +10 -0
- package/src/query/index.php +31 -16
- package/src/query/style.scss +2 -2
- package/src/query/utils.js +22 -0
- package/src/query/view.js +19 -10
- package/src/query-pagination-next/index.php +2 -1
- package/src/query-pagination-previous/index.php +2 -1
- package/src/reset.scss +1 -1
- package/src/search/block.json +1 -0
- package/src/search/index.php +47 -4
- package/src/search/test/__snapshots__/edit.native.js.snap +265 -363
- package/src/search/view.js +70 -169
- package/src/social-link/edit.native.js +1 -1
- package/src/social-link/editor.native.scss +4 -0
- package/src/table/edit.js +21 -19
- package/src/table-of-contents/block.json +2 -1
- package/src/table-of-contents/edit.js +5 -162
- package/src/table-of-contents/hooks.js +156 -0
- package/src/verse/edit.js +5 -0
- package/src/verse/index.js +1 -1
- package/src/verse/test/edit.native.js +2 -3
- package/build/file/view-interactivity.js +0 -22
- package/build/file/view-interactivity.js.map +0 -1
- package/build/image/view-interactivity.js.map +0 -1
- package/build/navigation/view-interactivity.js +0 -172
- package/build/navigation/view-interactivity.js.map +0 -1
- package/build/navigation/view-modal.js +0 -115
- package/build/navigation/view-modal.js.map +0 -1
- package/build-module/file/view-interactivity.js +0 -18
- package/build-module/file/view-interactivity.js.map +0 -1
- package/build-module/image/view-interactivity.js.map +0 -1
- package/build-module/navigation/view-interactivity.js +0 -169
- package/build-module/navigation/view-interactivity.js.map +0 -1
- package/build-module/navigation/view-modal.js +0 -112
- package/build-module/navigation/view-modal.js.map +0 -1
- package/src/file/view-interactivity.js +0 -18
- package/src/navigation/view-interactivity.js +0 -196
- package/src/navigation/view-modal.js +0 -127
- /package/src/image/{view-interactivity.js → view.js} +0 -0
|
@@ -486,13 +486,8 @@ export default function NavigationLinkEdit( {
|
|
|
486
486
|
{ /* eslint-enable */ }
|
|
487
487
|
{ ! url ? (
|
|
488
488
|
<div className="wp-block-navigation-link__placeholder-text">
|
|
489
|
-
<Tooltip
|
|
490
|
-
|
|
491
|
-
<span>{ missingText }</span>
|
|
492
|
-
<span className="wp-block-navigation-link__missing_text-tooltip">
|
|
493
|
-
{ tooltipText }
|
|
494
|
-
</span>
|
|
495
|
-
</>
|
|
489
|
+
<Tooltip text={ tooltipText }>
|
|
490
|
+
<span>{ missingText }</span>
|
|
496
491
|
</Tooltip>
|
|
497
492
|
</div>
|
|
498
493
|
) : (
|
|
@@ -548,35 +543,25 @@ export default function NavigationLinkEdit( {
|
|
|
548
543
|
isDraft ||
|
|
549
544
|
isLabelFieldFocused ) && (
|
|
550
545
|
<div className="wp-block-navigation-link__placeholder-text wp-block-navigation-link__label">
|
|
551
|
-
<Tooltip
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
isInvalid || isDraft
|
|
571
|
-
? placeholderText
|
|
572
|
-
: ''
|
|
573
|
-
}`.trim()
|
|
574
|
-
}
|
|
575
|
-
</span>
|
|
576
|
-
<span className="wp-block-navigation-link__missing_text-tooltip">
|
|
577
|
-
{ tooltipText }
|
|
578
|
-
</span>
|
|
579
|
-
</>
|
|
546
|
+
<Tooltip text={ tooltipText }>
|
|
547
|
+
<span
|
|
548
|
+
aria-label={ __(
|
|
549
|
+
'Navigation link text'
|
|
550
|
+
) }
|
|
551
|
+
>
|
|
552
|
+
{
|
|
553
|
+
// Some attributes are stored in an escaped form. It's a legacy issue.
|
|
554
|
+
// Ideally they would be stored in a raw, unescaped form.
|
|
555
|
+
// Unescape is used here to "recover" the escaped characters
|
|
556
|
+
// so they display without encoding.
|
|
557
|
+
// See `updateAttributes` for more details.
|
|
558
|
+
`${ decodeEntities( label ) } ${
|
|
559
|
+
isInvalid || isDraft
|
|
560
|
+
? placeholderText
|
|
561
|
+
: ''
|
|
562
|
+
}`.trim()
|
|
563
|
+
}
|
|
564
|
+
</span>
|
|
580
565
|
</Tooltip>
|
|
581
566
|
</div>
|
|
582
567
|
) }
|
|
@@ -67,14 +67,6 @@
|
|
|
67
67
|
color: #000;
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
.wp-block-navigation-link__missing_text-tooltip {
|
|
71
|
-
position: absolute;
|
|
72
|
-
width: 1px;
|
|
73
|
-
height: 1px;
|
|
74
|
-
padding: 0;
|
|
75
|
-
margin: -1px;
|
|
76
|
-
overflow: hidden;
|
|
77
|
-
}
|
|
78
70
|
/**
|
|
79
71
|
* Menu item setup state. Is shown when a menu item has no URL configured.
|
|
80
72
|
*/
|
|
@@ -47,6 +47,13 @@ const transforms = {
|
|
|
47
47
|
return createBlock( 'core/navigation-link' );
|
|
48
48
|
},
|
|
49
49
|
},
|
|
50
|
+
{
|
|
51
|
+
type: 'block',
|
|
52
|
+
blocks: [ 'core/buttons' ],
|
|
53
|
+
transform: () => {
|
|
54
|
+
return createBlock( 'core/navigation-link' );
|
|
55
|
+
},
|
|
56
|
+
},
|
|
50
57
|
],
|
|
51
58
|
to: [
|
|
52
59
|
{
|
|
@@ -105,6 +112,21 @@ const transforms = {
|
|
|
105
112
|
return createBlock( 'core/page-list' );
|
|
106
113
|
},
|
|
107
114
|
},
|
|
115
|
+
{
|
|
116
|
+
type: 'block',
|
|
117
|
+
blocks: [ 'core/buttons' ],
|
|
118
|
+
transform: ( { label, url, rel, title, opensInNewTab } ) => {
|
|
119
|
+
return createBlock( 'core/buttons', {}, [
|
|
120
|
+
createBlock( 'core/button', {
|
|
121
|
+
text: label,
|
|
122
|
+
url,
|
|
123
|
+
rel,
|
|
124
|
+
title,
|
|
125
|
+
linkTarget: opensInNewTab ? '_blank' : undefined,
|
|
126
|
+
} ),
|
|
127
|
+
] );
|
|
128
|
+
},
|
|
129
|
+
},
|
|
108
130
|
],
|
|
109
131
|
};
|
|
110
132
|
|
package/src/page-list/edit.js
CHANGED
|
@@ -320,8 +320,9 @@ export default function PageListEdit( {
|
|
|
320
320
|
{ pagesTree.length > 0 && (
|
|
321
321
|
<PanelBody>
|
|
322
322
|
<ComboboxControl
|
|
323
|
+
__next40pxDefaultSize
|
|
323
324
|
className="editor-page-attributes__parent"
|
|
324
|
-
label={ __( 'Parent
|
|
325
|
+
label={ __( 'Parent' ) }
|
|
325
326
|
value={ parentPageID }
|
|
326
327
|
options={ pagesTree }
|
|
327
328
|
onChange={ ( value ) =>
|
|
@@ -17,3 +17,8 @@
|
|
|
17
17
|
}
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
|
+
|
|
21
|
+
.block-editor-block-list__block[data-type="core/paragraph"].has-text-align-right[style*="writing-mode: vertical-rl"],
|
|
22
|
+
.block-editor-block-list__block[data-type="core/paragraph"].has-text-align-left[style*="writing-mode: vertical-lr"] {
|
|
23
|
+
rotate: 180deg;
|
|
24
|
+
}
|
package/src/paragraph/style.scss
CHANGED
package/src/pattern/edit.js
CHANGED
|
@@ -29,6 +29,7 @@ const PatternEdit = ( { attributes, clientId } ) => {
|
|
|
29
29
|
const { getBlockRootClientId, getBlockEditingMode } =
|
|
30
30
|
useSelect( blockEditorStore );
|
|
31
31
|
|
|
32
|
+
// Duplicated in packages/edit-site/src/components/start-template-options/index.js.
|
|
32
33
|
function injectThemeAttributeInBlockTemplateContent( block ) {
|
|
33
34
|
if (
|
|
34
35
|
block.innerBlocks.find(
|
package/src/pattern/index.php
CHANGED
|
@@ -41,12 +41,12 @@ function render_block_core_pattern( $attributes ) {
|
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
$pattern = $registry->get_registered( $slug );
|
|
44
|
-
$content =
|
|
44
|
+
$content = $pattern['content'];
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
// Backward compatibility for handling Block Hooks and injecting the theme attribute in the Gutenberg plugin.
|
|
47
|
+
// This can be removed when the minimum supported WordPress is >= 6.4.
|
|
48
|
+
if ( defined( 'IS_GUTENBERG_PLUGIN' ) && IS_GUTENBERG_PLUGIN && ! function_exists( 'traverse_and_serialize_blocks' ) ) {
|
|
49
|
+
$content = _inject_theme_attribute_in_block_template_content( $content );
|
|
50
50
|
$blocks = parse_blocks( $content );
|
|
51
51
|
$content = gutenberg_serialize_blocks( $blocks );
|
|
52
52
|
}
|
|
@@ -11,6 +11,9 @@ import {
|
|
|
11
11
|
BlockControls,
|
|
12
12
|
useBlockProps,
|
|
13
13
|
} from '@wordpress/block-editor';
|
|
14
|
+
import { VisuallyHidden } from '@wordpress/components';
|
|
15
|
+
import { useInstanceId } from '@wordpress/compose';
|
|
16
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
14
17
|
|
|
15
18
|
/**
|
|
16
19
|
* Internal dependencies
|
|
@@ -25,10 +28,14 @@ export default function PostCommentsFormEdit( {
|
|
|
25
28
|
const { textAlign } = attributes;
|
|
26
29
|
const { postId, postType } = context;
|
|
27
30
|
|
|
31
|
+
const instanceId = useInstanceId( PostCommentsFormEdit );
|
|
32
|
+
const instanceIdDesc = sprintf( 'comments-form-edit-%d-desc', instanceId );
|
|
33
|
+
|
|
28
34
|
const blockProps = useBlockProps( {
|
|
29
35
|
className: classnames( {
|
|
30
36
|
[ `has-text-align-${ textAlign }` ]: textAlign,
|
|
31
37
|
} ),
|
|
38
|
+
'aria-describedby': instanceIdDesc,
|
|
32
39
|
} );
|
|
33
40
|
|
|
34
41
|
return (
|
|
@@ -43,6 +50,9 @@ export default function PostCommentsFormEdit( {
|
|
|
43
50
|
</BlockControls>
|
|
44
51
|
<div { ...blockProps }>
|
|
45
52
|
<CommentsForm postId={ postId } postType={ postType } />
|
|
53
|
+
<VisuallyHidden id={ instanceIdDesc }>
|
|
54
|
+
{ __( 'Comments form disabled in editor.' ) }
|
|
55
|
+
</VisuallyHidden>
|
|
46
56
|
</div>
|
|
47
57
|
</>
|
|
48
58
|
);
|
|
@@ -23,7 +23,11 @@ const CommentsFormPlaceholder = () => {
|
|
|
23
23
|
return (
|
|
24
24
|
<div className="comment-respond">
|
|
25
25
|
<h3 className="comment-reply-title">{ __( 'Leave a Reply' ) }</h3>
|
|
26
|
-
<form
|
|
26
|
+
<form
|
|
27
|
+
noValidate
|
|
28
|
+
className="comment-form"
|
|
29
|
+
onSubmit={ ( event ) => event.preventDefault() }
|
|
30
|
+
>
|
|
27
31
|
<p>
|
|
28
32
|
<label htmlFor={ `comment-${ instanceId }` }>
|
|
29
33
|
{ __( 'Comment' ) }
|
|
@@ -33,6 +37,7 @@ const CommentsFormPlaceholder = () => {
|
|
|
33
37
|
name="comment"
|
|
34
38
|
cols="45"
|
|
35
39
|
rows="8"
|
|
40
|
+
readOnly
|
|
36
41
|
/>
|
|
37
42
|
</p>
|
|
38
43
|
<p className="form-submit wp-block-button">
|
|
@@ -45,6 +50,7 @@ const CommentsFormPlaceholder = () => {
|
|
|
45
50
|
) }
|
|
46
51
|
label={ __( 'Post Comment' ) }
|
|
47
52
|
value={ __( 'Post Comment' ) }
|
|
53
|
+
aria-disabled="true"
|
|
48
54
|
/>
|
|
49
55
|
</p>
|
|
50
56
|
</form>
|
package/src/post-content/edit.js
CHANGED
|
@@ -20,14 +20,19 @@ import { useSelect } from '@wordpress/data';
|
|
|
20
20
|
*/
|
|
21
21
|
import { useCanEditEntity } from '../utils/hooks';
|
|
22
22
|
|
|
23
|
-
function ReadOnlyContent( {
|
|
23
|
+
function ReadOnlyContent( {
|
|
24
|
+
layoutClassNames,
|
|
25
|
+
userCanEdit,
|
|
26
|
+
postType,
|
|
27
|
+
postId,
|
|
28
|
+
} ) {
|
|
24
29
|
const [ , , content ] = useEntityProp(
|
|
25
30
|
'postType',
|
|
26
31
|
postType,
|
|
27
32
|
'content',
|
|
28
33
|
postId
|
|
29
34
|
);
|
|
30
|
-
const blockProps = useBlockProps();
|
|
35
|
+
const blockProps = useBlockProps( { className: layoutClassNames } );
|
|
31
36
|
return content?.protected && ! userCanEdit ? (
|
|
32
37
|
<div { ...blockProps }>
|
|
33
38
|
<Warning>{ __( 'This content is password protected.' ) }</Warning>
|
|
@@ -77,7 +82,8 @@ function EditableContent( { context = {} } ) {
|
|
|
77
82
|
}
|
|
78
83
|
|
|
79
84
|
function Content( props ) {
|
|
80
|
-
const { context: { queryId, postType, postId } = {} } =
|
|
85
|
+
const { context: { queryId, postType, postId } = {}, layoutClassNames } =
|
|
86
|
+
props;
|
|
81
87
|
const userCanEdit = useCanEditEntity( 'postType', postType, postId );
|
|
82
88
|
if ( userCanEdit === undefined ) {
|
|
83
89
|
return null;
|
|
@@ -90,6 +96,7 @@ function Content( props ) {
|
|
|
90
96
|
<EditableContent { ...props } />
|
|
91
97
|
) : (
|
|
92
98
|
<ReadOnlyContent
|
|
99
|
+
layoutClassNames={ layoutClassNames }
|
|
93
100
|
userCanEdit={ userCanEdit }
|
|
94
101
|
postType={ postType }
|
|
95
102
|
postId={ postId }
|
|
@@ -133,11 +140,9 @@ function RecursionError() {
|
|
|
133
140
|
|
|
134
141
|
export default function PostContentEdit( {
|
|
135
142
|
context,
|
|
136
|
-
attributes,
|
|
137
143
|
__unstableLayoutClassNames: layoutClassNames,
|
|
138
144
|
} ) {
|
|
139
145
|
const { postId: contextPostId, postType: contextPostType } = context;
|
|
140
|
-
const { layout = {} } = attributes;
|
|
141
146
|
const hasAlreadyRendered = useHasRecursion( contextPostId );
|
|
142
147
|
|
|
143
148
|
if ( contextPostId && contextPostType && hasAlreadyRendered ) {
|
|
@@ -147,7 +152,10 @@ export default function PostContentEdit( {
|
|
|
147
152
|
return (
|
|
148
153
|
<RecursionProvider uniqueId={ contextPostId }>
|
|
149
154
|
{ contextPostId && contextPostType ? (
|
|
150
|
-
<Content
|
|
155
|
+
<Content
|
|
156
|
+
context={ context }
|
|
157
|
+
layoutClassNames={ layoutClassNames }
|
|
158
|
+
/>
|
|
151
159
|
) : (
|
|
152
160
|
<Placeholder layoutClassNames={ layoutClassNames } />
|
|
153
161
|
) }
|
|
@@ -31,7 +31,7 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
|
|
|
31
31
|
}
|
|
32
32
|
|
|
33
33
|
$more_text = ! empty( $attributes['moreText'] ) ? '<a class="wp-block-post-excerpt__more-link" href="' . esc_url( get_the_permalink( $block->context['postId'] ) ) . '">' . wp_kses_post( $attributes['moreText'] ) . '</a>' : '';
|
|
34
|
-
$filter_excerpt_more = static function( $more ) use ( $more_text ) {
|
|
34
|
+
$filter_excerpt_more = static function ( $more ) use ( $more_text ) {
|
|
35
35
|
return empty( $more_text ) ? $more : '';
|
|
36
36
|
};
|
|
37
37
|
/**
|
|
@@ -87,7 +87,7 @@ if ( is_admin() ||
|
|
|
87
87
|
defined( 'REST_REQUEST' ) && REST_REQUEST ) {
|
|
88
88
|
add_filter(
|
|
89
89
|
'excerpt_length',
|
|
90
|
-
static function() {
|
|
90
|
+
static function () {
|
|
91
91
|
return 100;
|
|
92
92
|
},
|
|
93
93
|
PHP_INT_MAX
|
|
@@ -184,12 +184,12 @@ function get_block_core_post_featured_image_border_attributes( $attributes ) {
|
|
|
184
184
|
|
|
185
185
|
// Border color.
|
|
186
186
|
$preset_color = array_key_exists( 'borderColor', $attributes ) ? "var:preset|color|{$attributes['borderColor']}" : null;
|
|
187
|
-
$custom_color =
|
|
187
|
+
$custom_color = $attributes['style']['border']['color'] ?? null;
|
|
188
188
|
$border_styles['color'] = $preset_color ? $preset_color : $custom_color;
|
|
189
189
|
|
|
190
190
|
// Individual border styles e.g. top, left etc.
|
|
191
191
|
foreach ( $sides as $side ) {
|
|
192
|
-
$border =
|
|
192
|
+
$border = $attributes['style']['border'][ $side ] ?? null;
|
|
193
193
|
$border_styles[ $side ] = array(
|
|
194
194
|
'color' => isset( $border['color'] ) ? $border['color'] : null,
|
|
195
195
|
'style' => isset( $border['style'] ) ? $border['style'] : null,
|
|
@@ -28,14 +28,9 @@ function render_block_core_post_navigation_link( $attributes, $content ) {
|
|
|
28
28
|
if ( isset( $attributes['textAlign'] ) ) {
|
|
29
29
|
$classes .= " has-text-align-{$attributes['textAlign']}";
|
|
30
30
|
}
|
|
31
|
-
$styles = '';
|
|
32
|
-
if ( isset( $attributes['style']['typography']['writingMode'] ) ) {
|
|
33
|
-
$styles = "writing-mode:{$attributes['style']['typography']['writingMode']};";
|
|
34
|
-
}
|
|
35
31
|
$wrapper_attributes = get_block_wrapper_attributes(
|
|
36
32
|
array(
|
|
37
33
|
'class' => $classes,
|
|
38
|
-
'style' => $styles,
|
|
39
34
|
)
|
|
40
35
|
);
|
|
41
36
|
// Set default values.
|
|
@@ -106,7 +106,7 @@ function render_block_core_post_template( $attributes, $content, $block ) {
|
|
|
106
106
|
|
|
107
107
|
$post_id = get_the_ID();
|
|
108
108
|
$post_type = get_post_type();
|
|
109
|
-
$filter_block_context = static function( $context ) use ( $post_id, $post_type ) {
|
|
109
|
+
$filter_block_context = static function ( $context ) use ( $post_id, $post_type ) {
|
|
110
110
|
$context['postType'] = $post_type;
|
|
111
111
|
$context['postId'] = $post_id;
|
|
112
112
|
return $context;
|
package/src/post-terms/index.php
CHANGED
|
@@ -81,8 +81,11 @@ function register_block_core_post_terms() {
|
|
|
81
81
|
$variation = array(
|
|
82
82
|
'name' => $taxonomy->name,
|
|
83
83
|
'title' => $taxonomy->label,
|
|
84
|
-
|
|
85
|
-
|
|
84
|
+
'description' => sprintf(
|
|
85
|
+
/* translators: %s: taxonomy's label */
|
|
86
|
+
__( 'Display a list of assigned terms from the taxonomy: %s' ),
|
|
87
|
+
$taxonomy->label
|
|
88
|
+
),
|
|
86
89
|
'attributes' => array(
|
|
87
90
|
'term' => $taxonomy->name,
|
|
88
91
|
),
|
package/src/preformatted/edit.js
CHANGED
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import { RichText, useBlockProps } from '@wordpress/block-editor';
|
|
6
|
+
import { createBlock, getDefaultBlockName } from '@wordpress/blocks';
|
|
6
7
|
|
|
7
8
|
export default function PreformattedEdit( {
|
|
8
9
|
attributes,
|
|
9
10
|
mergeBlocks,
|
|
10
11
|
setAttributes,
|
|
11
12
|
onRemove,
|
|
13
|
+
insertBlocksAfter,
|
|
12
14
|
style,
|
|
13
15
|
} ) {
|
|
14
16
|
const { content } = attributes;
|
|
@@ -31,6 +33,9 @@ export default function PreformattedEdit( {
|
|
|
31
33
|
onMerge={ mergeBlocks }
|
|
32
34
|
{ ...blockProps }
|
|
33
35
|
__unstablePastePlainText
|
|
36
|
+
__unstableOnSplitAtDoubleLineEnd={ () =>
|
|
37
|
+
insertBlocksAfter( createBlock( getDefaultBlockName() ) )
|
|
38
|
+
}
|
|
34
39
|
/>
|
|
35
40
|
);
|
|
36
41
|
}
|
|
@@ -14,12 +14,6 @@ import {
|
|
|
14
14
|
useBlockProps,
|
|
15
15
|
} from '@wordpress/block-editor';
|
|
16
16
|
import { select } from '@wordpress/data';
|
|
17
|
-
import {
|
|
18
|
-
create,
|
|
19
|
-
replace,
|
|
20
|
-
toHTMLString,
|
|
21
|
-
__UNSTABLE_LINE_SEPARATOR,
|
|
22
|
-
} from '@wordpress/rich-text';
|
|
23
17
|
|
|
24
18
|
/**
|
|
25
19
|
* Internal dependencies
|
|
@@ -64,13 +58,14 @@ function parseBorderColor( styleString ) {
|
|
|
64
58
|
}
|
|
65
59
|
|
|
66
60
|
function multilineToInline( value ) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
61
|
+
value = value || `<p></p>`;
|
|
62
|
+
const padded = `</p>${ value }<p>`;
|
|
63
|
+
const values = padded.split( `</p><p>` );
|
|
64
|
+
|
|
65
|
+
values.shift();
|
|
66
|
+
values.pop();
|
|
67
|
+
|
|
68
|
+
return values.join( '<br>' );
|
|
74
69
|
}
|
|
75
70
|
|
|
76
71
|
const v5 = {
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
Button,
|
|
6
|
+
Modal,
|
|
7
|
+
__experimentalVStack as VStack,
|
|
8
|
+
} from '@wordpress/components';
|
|
9
|
+
import { __ } from '@wordpress/i18n';
|
|
10
|
+
import { useState, useEffect } from '@wordpress/element';
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* Internal dependencies
|
|
14
|
+
*/
|
|
15
|
+
import { useContainsThirdPartyBlocks } from '../utils';
|
|
16
|
+
|
|
17
|
+
const disableEnhancedPaginationDescription = __(
|
|
18
|
+
'Plugin blocks are not supported yet. For the enhanced pagination to work, remove the plugin block, then re-enable "Enhanced pagination" in the Query Block settings.'
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const modalDescriptionId =
|
|
22
|
+
'wp-block-query-enhanced-pagination-modal__description';
|
|
23
|
+
|
|
24
|
+
export default function EnhancedPaginationModal( {
|
|
25
|
+
clientId,
|
|
26
|
+
attributes: { enhancedPagination },
|
|
27
|
+
setAttributes,
|
|
28
|
+
} ) {
|
|
29
|
+
const [ isOpen, setOpen ] = useState( false );
|
|
30
|
+
|
|
31
|
+
const containsThirdPartyBlocks = useContainsThirdPartyBlocks( clientId );
|
|
32
|
+
|
|
33
|
+
useEffect( () => {
|
|
34
|
+
setOpen( containsThirdPartyBlocks && enhancedPagination );
|
|
35
|
+
}, [ containsThirdPartyBlocks, enhancedPagination, setOpen ] );
|
|
36
|
+
|
|
37
|
+
return (
|
|
38
|
+
isOpen && (
|
|
39
|
+
<Modal
|
|
40
|
+
title={ __( 'Enhanced pagination will be disabled' ) }
|
|
41
|
+
className="wp-block-query__enhanced-pagination-modal"
|
|
42
|
+
aria={ {
|
|
43
|
+
describedby: modalDescriptionId,
|
|
44
|
+
} }
|
|
45
|
+
isDismissible={ false }
|
|
46
|
+
shouldCloseOnEsc={ false }
|
|
47
|
+
shouldCloseOnClickOutside={ false }
|
|
48
|
+
>
|
|
49
|
+
<VStack alignment="right" spacing={ 5 }>
|
|
50
|
+
<span id={ modalDescriptionId }>
|
|
51
|
+
{ disableEnhancedPaginationDescription }
|
|
52
|
+
</span>
|
|
53
|
+
<Button
|
|
54
|
+
variant="primary"
|
|
55
|
+
onClick={ () => {
|
|
56
|
+
setAttributes( { enhancedPagination: false } );
|
|
57
|
+
} }
|
|
58
|
+
>
|
|
59
|
+
{ __( 'OK' ) }
|
|
60
|
+
</Button>
|
|
61
|
+
</VStack>
|
|
62
|
+
</Modal>
|
|
63
|
+
)
|
|
64
|
+
);
|
|
65
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { ToggleControl, Notice } from '@wordpress/components';
|
|
5
|
+
import { __ } from '@wordpress/i18n';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Internal dependencies
|
|
9
|
+
*/
|
|
10
|
+
import { useContainsThirdPartyBlocks } from '../../utils';
|
|
11
|
+
|
|
12
|
+
export default function EnhancedPaginationControl( {
|
|
13
|
+
enhancedPagination,
|
|
14
|
+
setAttributes,
|
|
15
|
+
clientId,
|
|
16
|
+
} ) {
|
|
17
|
+
const enhancedPaginationNotice = __(
|
|
18
|
+
"Enhanced pagination doesn't support plugin blocks yet. If you want to enable it, you have to remove all plugin blocks from the Query Loop."
|
|
19
|
+
);
|
|
20
|
+
|
|
21
|
+
const containsThirdPartyBlocks = useContainsThirdPartyBlocks( clientId );
|
|
22
|
+
|
|
23
|
+
return (
|
|
24
|
+
<>
|
|
25
|
+
<ToggleControl
|
|
26
|
+
label={ __( 'Enhanced pagination' ) }
|
|
27
|
+
help={ __(
|
|
28
|
+
'Browsing between pages won’t require a full page reload.'
|
|
29
|
+
) }
|
|
30
|
+
checked={ !! enhancedPagination }
|
|
31
|
+
disabled={ containsThirdPartyBlocks }
|
|
32
|
+
onChange={ ( value ) => {
|
|
33
|
+
setAttributes( {
|
|
34
|
+
enhancedPagination: !! value,
|
|
35
|
+
} );
|
|
36
|
+
} }
|
|
37
|
+
/>
|
|
38
|
+
{ containsThirdPartyBlocks && (
|
|
39
|
+
<Notice
|
|
40
|
+
status="warning"
|
|
41
|
+
isDismissible={ false }
|
|
42
|
+
className="wp-block-query__enhanced-pagination-notice"
|
|
43
|
+
>
|
|
44
|
+
{ enhancedPaginationNotice }
|
|
45
|
+
</Notice>
|
|
46
|
+
) }
|
|
47
|
+
</>
|
|
48
|
+
);
|
|
49
|
+
}
|