@wordpress/block-library 8.20.1 → 8.21.1-next.f8d8eceb.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +12 -0
- package/build/avatar/index.js +5 -1
- package/build/avatar/index.js.map +1 -1
- package/build/block/edit-title.native.js +11 -3
- package/build/block/edit-title.native.js.map +1 -1
- package/build/block/index.js +2 -1
- package/build/block/index.js.map +1 -1
- package/build/code/edit.native.js +8 -2
- package/build/code/edit.native.js.map +1 -1
- package/build/column/edit.js +2 -1
- package/build/column/edit.js.map +1 -1
- package/build/column/edit.native.js +2 -1
- package/build/column/edit.native.js.map +1 -1
- package/build/columns/edit.native.js +2 -1
- package/build/columns/edit.native.js.map +1 -1
- package/build/cover/controls.native.js +2 -1
- package/build/cover/controls.native.js.map +1 -1
- package/build/cover/deprecated.js +110 -1
- package/build/cover/deprecated.js.map +1 -1
- package/build/cover/edit/index.js +11 -4
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +3 -3
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +0 -3
- package/build/cover/index.js.map +1 -1
- package/build/cover/save.js +2 -1
- package/build/cover/save.js.map +1 -1
- package/build/cover/shared.js +1 -1
- package/build/cover/shared.js.map +1 -1
- package/build/file/view.js +1 -1
- package/build/file/view.js.map +1 -1
- package/build/footnotes/index.js +1 -0
- package/build/footnotes/index.js.map +1 -1
- package/build/form/edit.js +138 -0
- package/build/form/edit.js.map +1 -0
- package/build/form/index.js +92 -0
- package/build/form/index.js.map +1 -0
- package/build/form/init.js +13 -0
- package/build/form/init.js.map +1 -0
- package/build/form/save.js +28 -0
- package/build/form/save.js.map +1 -0
- package/build/form/utils.js +24 -0
- package/build/form/utils.js.map +1 -0
- package/build/form/variations.js +95 -0
- package/build/form/variations.js.map +1 -0
- package/build/form/view.js +42 -0
- package/build/form/view.js.map +1 -0
- package/build/form-input/edit.js +124 -0
- package/build/form-input/edit.js.map +1 -0
- package/build/form-input/index.js +105 -0
- package/build/form-input/index.js.map +1 -0
- package/build/form-input/init.js +13 -0
- package/build/form-input/init.js.map +1 -0
- package/build/form-input/save.js +87 -0
- package/build/form-input/save.js.map +1 -0
- package/build/form-input/variations.js +93 -0
- package/build/form-input/variations.js.map +1 -0
- package/build/form-submission-notification/edit.js +59 -0
- package/build/form-submission-notification/edit.js.map +1 -0
- package/build/form-submission-notification/index.js +56 -0
- package/build/form-submission-notification/index.js.map +1 -0
- package/build/form-submission-notification/init.js +13 -0
- package/build/form-submission-notification/init.js.map +1 -0
- package/build/form-submission-notification/save.js +33 -0
- package/build/form-submission-notification/save.js.map +1 -0
- package/build/form-submission-notification/variations.js +63 -0
- package/build/form-submission-notification/variations.js.map +1 -0
- package/build/form-submit-button/edit.js +32 -0
- package/build/form-submit-button/edit.js.map +1 -0
- package/build/form-submit-button/index.js +44 -0
- package/build/form-submit-button/index.js.map +1 -0
- package/build/form-submit-button/init.js +13 -0
- package/build/form-submit-button/init.js.map +1 -0
- package/build/form-submit-button/save.js +22 -0
- package/build/form-submit-button/save.js.map +1 -0
- package/build/group/edit.js +2 -11
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +0 -1
- package/build/group/index.js.map +1 -1
- package/build/heading/index.js +3 -2
- package/build/heading/index.js.map +1 -1
- package/build/html/preview.js +2 -4
- package/build/html/preview.js.map +1 -1
- package/build/image/image.js +15 -6
- package/build/image/image.js.map +1 -1
- package/build/image/view.js +71 -39
- package/build/image/view.js.map +1 -1
- package/build/index.js +10 -0
- package/build/index.js.map +1 -1
- package/build/latest-posts/edit.js +6 -2
- package/build/latest-posts/edit.js.map +1 -1
- package/build/list-item/hooks/use-merge.js +15 -15
- package/build/list-item/hooks/use-merge.js.map +1 -1
- package/build/lock-unlock.js +1 -1
- package/build/lock-unlock.js.map +1 -1
- package/build/missing/edit.native.js +54 -64
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/edit/index.js +0 -1
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/index.js +2 -1
- package/build/navigation/index.js.map +1 -1
- package/build/navigation/view.js +27 -5
- package/build/navigation/view.js.map +1 -1
- package/build/page-list-item/edit.js +3 -1
- package/build/page-list-item/edit.js.map +1 -1
- package/build/paragraph/edit.js +1 -1
- package/build/paragraph/edit.js.map +1 -1
- package/build/paragraph/index.js +7 -0
- package/build/paragraph/index.js.map +1 -1
- package/build/pattern/index.js +2 -1
- package/build/pattern/index.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +2 -2
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/query/edit/enhanced-pagination-modal.js +27 -13
- package/build/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js +15 -12
- package/build/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build/query/utils.js +29 -8
- package/build/query/utils.js.map +1 -1
- package/build/query/view.js +4 -2
- package/build/query/view.js.map +1 -1
- package/build/search/edit.js +1 -2
- package/build/search/edit.js.map +1 -1
- package/build/social-link/edit.native.js +7 -19
- package/build/social-link/edit.native.js.map +1 -1
- package/build/spacer/controls.js +3 -3
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/controls.native.js +2 -1
- package/build/spacer/controls.native.js.map +1 -1
- package/build/spacer/edit.js +1 -1
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/edit.native.js +5 -1
- package/build/spacer/edit.native.js.map +1 -1
- package/build/tag-cloud/edit.js +2 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/inner-blocks.js +2 -2
- package/build/template-part/edit/inner-blocks.js.map +1 -1
- package/build/template-part/index.js +2 -1
- package/build/template-part/index.js.map +1 -1
- package/build/term-description/index.js +0 -1
- package/build/term-description/index.js.map +1 -1
- package/build-module/avatar/index.js +5 -1
- package/build-module/avatar/index.js.map +1 -1
- package/build-module/block/edit-title.native.js +12 -4
- package/build-module/block/edit-title.native.js.map +1 -1
- package/build-module/block/index.js +2 -1
- package/build-module/block/index.js.map +1 -1
- package/build-module/code/edit.native.js +8 -2
- package/build-module/code/edit.native.js.map +1 -1
- package/build-module/column/edit.js +3 -2
- package/build-module/column/edit.js.map +1 -1
- package/build-module/column/edit.native.js +3 -2
- package/build-module/column/edit.native.js.map +1 -1
- package/build-module/columns/edit.native.js +3 -2
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/cover/controls.native.js +3 -2
- package/build-module/cover/controls.native.js.map +1 -1
- package/build-module/cover/deprecated.js +110 -1
- package/build-module/cover/deprecated.js.map +1 -1
- package/build-module/cover/edit/index.js +12 -5
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +4 -4
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/index.js +0 -3
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/save.js +2 -1
- package/build-module/cover/save.js.map +1 -1
- package/build-module/cover/shared.js +1 -1
- package/build-module/cover/shared.js.map +1 -1
- package/build-module/file/view.js +2 -2
- package/build-module/file/view.js.map +1 -1
- package/build-module/footnotes/index.js +1 -0
- package/build-module/footnotes/index.js.map +1 -1
- package/build-module/form/edit.js +130 -0
- package/build-module/form/edit.js.map +1 -0
- package/build-module/form/index.js +82 -0
- package/build-module/form/index.js.map +1 -0
- package/build-module/form/init.js +6 -0
- package/build-module/form/init.js.map +1 -0
- package/build-module/form/save.js +20 -0
- package/build-module/form/save.js.map +1 -0
- package/build-module/form/utils.js +15 -0
- package/build-module/form/utils.js.map +1 -0
- package/build-module/form/variations.js +86 -0
- package/build-module/form/variations.js.map +1 -0
- package/build-module/form/view.js +40 -0
- package/build-module/form/view.js.map +1 -0
- package/build-module/form-input/edit.js +115 -0
- package/build-module/form-input/edit.js.map +1 -0
- package/build-module/form-input/index.js +95 -0
- package/build-module/form-input/index.js.map +1 -0
- package/build-module/form-input/init.js +6 -0
- package/build-module/form-input/init.js.map +1 -0
- package/build-module/form-input/save.js +80 -0
- package/build-module/form-input/save.js.map +1 -0
- package/build-module/form-input/variations.js +85 -0
- package/build-module/form-input/variations.js.map +1 -0
- package/build-module/form-submission-notification/edit.js +50 -0
- package/build-module/form-submission-notification/edit.js.map +1 -0
- package/build-module/form-submission-notification/index.js +47 -0
- package/build-module/form-submission-notification/index.js.map +1 -0
- package/build-module/form-submission-notification/init.js +6 -0
- package/build-module/form-submission-notification/init.js.map +1 -0
- package/build-module/form-submission-notification/save.js +25 -0
- package/build-module/form-submission-notification/save.js.map +1 -0
- package/build-module/form-submission-notification/variations.js +55 -0
- package/build-module/form-submission-notification/variations.js.map +1 -0
- package/build-module/form-submit-button/edit.js +24 -0
- package/build-module/form-submit-button/edit.js.map +1 -0
- package/build-module/form-submit-button/index.js +34 -0
- package/build-module/form-submit-button/index.js.map +1 -0
- package/build-module/form-submit-button/init.js +6 -0
- package/build-module/form-submit-button/init.js.map +1 -0
- package/build-module/form-submit-button/save.js +14 -0
- package/build-module/form-submit-button/save.js.map +1 -0
- package/build-module/group/edit.js +3 -12
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +0 -1
- package/build-module/group/index.js.map +1 -1
- package/build-module/heading/index.js +3 -2
- package/build-module/heading/index.js.map +1 -1
- package/build-module/html/preview.js +2 -4
- package/build-module/html/preview.js.map +1 -1
- package/build-module/image/image.js +16 -7
- package/build-module/image/image.js.map +1 -1
- package/build-module/image/view.js +71 -39
- package/build-module/image/view.js.map +1 -1
- package/build-module/index.js +10 -0
- package/build-module/index.js.map +1 -1
- package/build-module/latest-posts/edit.js +6 -2
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/list-item/hooks/use-merge.js +15 -15
- package/build-module/list-item/hooks/use-merge.js.map +1 -1
- package/build-module/lock-unlock.js +1 -1
- package/build-module/lock-unlock.js.map +1 -1
- package/build-module/missing/edit.native.js +58 -68
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +0 -1
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/index.js +2 -1
- package/build-module/navigation/index.js.map +1 -1
- package/build-module/navigation/view.js +27 -5
- package/build-module/navigation/view.js.map +1 -1
- package/build-module/page-list-item/edit.js +3 -1
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/paragraph/edit.js +2 -2
- package/build-module/paragraph/edit.js.map +1 -1
- package/build-module/paragraph/index.js +7 -0
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/pattern/index.js +2 -1
- package/build-module/pattern/index.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +3 -3
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/query/edit/enhanced-pagination-modal.js +28 -14
- package/build-module/query/edit/enhanced-pagination-modal.js.map +1 -1
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js +17 -14
- package/build-module/query/edit/inspector-controls/enhanced-pagination-control.js.map +1 -1
- package/build-module/query/utils.js +27 -5
- package/build-module/query/utils.js.map +1 -1
- package/build-module/query/view.js +4 -2
- package/build-module/query/view.js.map +1 -1
- package/build-module/search/edit.js +2 -3
- package/build-module/search/edit.js.map +1 -1
- package/build-module/social-link/edit.native.js +8 -20
- package/build-module/social-link/edit.native.js.map +1 -1
- package/build-module/spacer/controls.js +4 -4
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/controls.native.js +3 -2
- package/build-module/spacer/controls.native.js.map +1 -1
- package/build-module/spacer/edit.js +2 -2
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/edit.native.js +6 -2
- package/build-module/spacer/edit.native.js.map +1 -1
- package/build-module/tag-cloud/edit.js +3 -2
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/inner-blocks.js +3 -3
- package/build-module/template-part/edit/inner-blocks.js.map +1 -1
- package/build-module/template-part/index.js +2 -1
- package/build-module/template-part/index.js.map +1 -1
- package/build-module/term-description/index.js +0 -1
- package/build-module/term-description/index.js.map +1 -1
- package/build-style/editor-rtl.css +50 -0
- package/build-style/editor.css +50 -0
- package/build-style/file/style-rtl.css +0 -5
- package/build-style/file/style.css +0 -5
- package/build-style/form-input/editor-rtl.css +106 -0
- package/build-style/form-input/editor.css +106 -0
- package/build-style/form-input/style-rtl.css +135 -0
- package/build-style/form-input/style.css +135 -0
- package/build-style/form-submission-notification/editor-rtl.css +118 -0
- package/build-style/form-submission-notification/editor.css +118 -0
- package/build-style/form-submit-button/style-rtl.css +91 -0
- package/build-style/form-submit-button/style.css +91 -0
- package/build-style/image/style-rtl.css +39 -5
- package/build-style/image/style.css +39 -5
- package/build-style/navigation/style-rtl.css +5 -0
- package/build-style/navigation/style.css +5 -0
- package/build-style/query/style-rtl.css +0 -10
- package/build-style/query/style.css +0 -10
- package/build-style/style-rtl.css +92 -10
- package/build-style/style.css +92 -10
- package/package.json +32 -32
- package/src/avatar/block.json +5 -1
- package/src/block/block.json +2 -1
- package/src/block/edit-title.native.js +16 -13
- package/src/calendar/index.php +2 -6
- package/src/code/edit.native.js +15 -1
- package/src/column/edit.js +3 -8
- package/src/column/edit.native.js +3 -8
- package/src/columns/edit.native.js +3 -8
- package/src/comment-author-avatar/index.php +1 -1
- package/src/cover/block.json +0 -3
- package/src/cover/controls.native.js +3 -8
- package/src/cover/deprecated.js +151 -1
- package/src/cover/edit/index.js +15 -5
- package/src/cover/edit/inspector-controls.js +22 -33
- package/src/cover/save.js +2 -1
- package/src/cover/shared.js +1 -1
- package/src/editor.scss +2 -0
- package/src/file/index.php +2 -1
- package/src/file/style.scss +0 -6
- package/src/file/view.js +2 -2
- package/src/footnotes/block.json +1 -0
- package/src/form/block.json +60 -0
- package/src/form/edit.js +179 -0
- package/src/form/index.js +20 -0
- package/src/form/index.php +214 -0
- package/src/form/init.js +6 -0
- package/src/form/save.js +20 -0
- package/src/form/utils.js +39 -0
- package/src/form/variations.js +139 -0
- package/src/form/view.js +41 -0
- package/src/form-input/block.json +73 -0
- package/src/form-input/edit.js +151 -0
- package/src/form-input/editor.scss +24 -0
- package/src/form-input/index.js +20 -0
- package/src/form-input/index.php +45 -0
- package/src/form-input/init.js +6 -0
- package/src/form-input/save.js +83 -0
- package/src/form-input/style.scss +61 -0
- package/src/form-input/variations.js +82 -0
- package/src/form-submission-notification/block.json +19 -0
- package/src/form-submission-notification/edit.js +63 -0
- package/src/form-submission-notification/editor.scss +45 -0
- package/src/form-submission-notification/index.js +26 -0
- package/src/form-submission-notification/index.php +48 -0
- package/src/form-submission-notification/init.js +6 -0
- package/src/form-submission-notification/save.js +28 -0
- package/src/form-submission-notification/variations.js +59 -0
- package/src/form-submit-button/block.json +14 -0
- package/src/form-submit-button/edit.js +33 -0
- package/src/form-submit-button/index.js +18 -0
- package/src/form-submit-button/init.js +6 -0
- package/src/form-submit-button/save.js +14 -0
- package/src/form-submit-button/style.scss +3 -0
- package/src/freeform/test/__snapshots__/index.native.js.snap +7 -0
- package/src/freeform/test/index.native.js +57 -0
- package/src/group/block.json +0 -1
- package/src/group/edit.js +2 -7
- package/src/heading/index.js +4 -2
- package/src/html/preview.js +9 -4
- package/src/image/image.js +27 -6
- package/src/image/index.php +128 -83
- package/src/image/style.scss +49 -5
- package/src/image/view.js +93 -51
- package/src/index.js +10 -0
- package/src/latest-posts/edit.js +11 -2
- package/src/latest-posts/index.php +17 -8
- package/src/list-item/hooks/use-merge.js +20 -23
- package/src/lock-unlock.js +1 -1
- package/src/missing/edit.native.js +56 -117
- package/src/missing/style.native.scss +0 -67
- package/src/missing/test/edit-integration.native.js +135 -49
- package/src/missing/test/edit.native.js +0 -41
- package/src/navigation/block.json +2 -1
- package/src/navigation/edit/index.js +0 -1
- package/src/navigation/index.php +28 -8
- package/src/navigation/style.scss +6 -1
- package/src/navigation/view.js +25 -6
- package/src/page-list-item/edit.js +2 -0
- package/src/paragraph/edit.js +2 -2
- package/src/paragraph/index.js +10 -0
- package/src/pattern/block.json +2 -1
- package/src/pattern/index.php +0 -3
- package/src/post-featured-image/dimension-controls.js +3 -3
- package/src/post-navigation-link/index.php +2 -1
- package/src/preformatted/test/edit.native.js +38 -0
- package/src/query/edit/enhanced-pagination-modal.js +37 -21
- package/src/query/edit/inspector-controls/enhanced-pagination-control.js +18 -22
- package/src/query/index.php +100 -10
- package/src/query/style.scss +0 -11
- package/src/query/utils.js +29 -8
- package/src/query/view.js +11 -2
- package/src/query-pagination-next/index.php +1 -1
- package/src/query-pagination-previous/index.php +1 -1
- package/src/search/edit.js +5 -3
- package/src/search/index.php +0 -4
- package/src/social-link/edit.native.js +12 -26
- package/src/social-link/editor.native.scss +0 -9
- package/src/social-link/index.php +2 -2
- package/src/spacer/controls.js +9 -12
- package/src/spacer/controls.native.js +3 -8
- package/src/spacer/edit.js +2 -2
- package/src/spacer/edit.native.js +6 -5
- package/src/style.scss +1 -0
- package/src/tag-cloud/edit.js +3 -7
- package/src/template-part/block.json +2 -1
- package/src/template-part/edit/inner-blocks.js +3 -3
- package/src/template-part/index.php +4 -7
- package/src/term-description/block.json +0 -1
- package/src/verse/test/edit.native.js +37 -0
package/src/query/view.js
CHANGED
|
@@ -33,7 +33,14 @@ store( {
|
|
|
33
33
|
core: {
|
|
34
34
|
query: {
|
|
35
35
|
navigate: async ( { event, ref, context } ) => {
|
|
36
|
-
|
|
36
|
+
const isDisabled = ref.closest( '[data-wp-navigation-id]' )
|
|
37
|
+
?.dataset.wpNavigationDisabled;
|
|
38
|
+
|
|
39
|
+
if (
|
|
40
|
+
isValidLink( ref ) &&
|
|
41
|
+
isValidEvent( event ) &&
|
|
42
|
+
! isDisabled
|
|
43
|
+
) {
|
|
37
44
|
event.preventDefault();
|
|
38
45
|
|
|
39
46
|
const id = ref.closest( '[data-wp-navigation-id]' )
|
|
@@ -70,7 +77,9 @@ store( {
|
|
|
70
77
|
}
|
|
71
78
|
},
|
|
72
79
|
prefetch: async ( { ref } ) => {
|
|
73
|
-
|
|
80
|
+
const isDisabled = ref.closest( '[data-wp-navigation-id]' )
|
|
81
|
+
?.dataset.wpNavigationDisabled;
|
|
82
|
+
if ( isValidLink( ref ) && ! isDisabled ) {
|
|
74
83
|
await prefetch( ref.href );
|
|
75
84
|
}
|
|
76
85
|
},
|
|
@@ -63,7 +63,7 @@ function render_block_core_query_pagination_next( $attributes, $content, $block
|
|
|
63
63
|
wp_reset_postdata(); // Restore original Post Data.
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
if ( $enhanced_pagination ) {
|
|
66
|
+
if ( $enhanced_pagination && isset( $content ) ) {
|
|
67
67
|
$p = new WP_HTML_Tag_Processor( $content );
|
|
68
68
|
if ( $p->next_tag(
|
|
69
69
|
array(
|
|
@@ -51,7 +51,7 @@ function render_block_core_query_pagination_previous( $attributes, $content, $bl
|
|
|
51
51
|
);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
|
-
if ( $enhanced_pagination ) {
|
|
54
|
+
if ( $enhanced_pagination && isset( $content ) ) {
|
|
55
55
|
$p = new WP_HTML_Tag_Processor( $content );
|
|
56
56
|
if ( $p->next_tag(
|
|
57
57
|
array(
|
package/src/search/edit.js
CHANGED
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
getTypographyClassesAndStyles as useTypographyProps,
|
|
17
17
|
store as blockEditorStore,
|
|
18
18
|
__experimentalGetElementClassName,
|
|
19
|
-
|
|
19
|
+
useSettings,
|
|
20
20
|
} from '@wordpress/block-editor';
|
|
21
21
|
import { useDispatch, useSelect } from '@wordpress/data';
|
|
22
22
|
import { useEffect, useRef } from '@wordpress/element';
|
|
@@ -125,8 +125,10 @@ export default function SearchEdit( {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
const colorProps = useColorProps( attributes );
|
|
128
|
-
const fluidTypographySettings =
|
|
129
|
-
|
|
128
|
+
const [ fluidTypographySettings, layout ] = useSettings(
|
|
129
|
+
'typography.fluid',
|
|
130
|
+
'layout'
|
|
131
|
+
);
|
|
130
132
|
const typographyProps = useTypographyProps( attributes, {
|
|
131
133
|
typography: {
|
|
132
134
|
fluid: fluidTypographySettings,
|
package/src/search/index.php
CHANGED
|
@@ -281,8 +281,6 @@ function classnames_for_block_core_search( $attributes ) {
|
|
|
281
281
|
* @param array $wrapper_styles Current collection of wrapper styles.
|
|
282
282
|
* @param array $button_styles Current collection of button styles.
|
|
283
283
|
* @param array $input_styles Current collection of input styles.
|
|
284
|
-
*
|
|
285
|
-
* @return void
|
|
286
284
|
*/
|
|
287
285
|
function apply_block_core_search_border_style( $attributes, $property, $side, &$wrapper_styles, &$button_styles, &$input_styles ) {
|
|
288
286
|
$is_button_inside = isset( $attributes['buttonPosition'] ) && 'button-inside' === $attributes['buttonPosition'];
|
|
@@ -327,8 +325,6 @@ function apply_block_core_search_border_style( $attributes, $property, $side, &$
|
|
|
327
325
|
* @param array $wrapper_styles Current collection of wrapper styles.
|
|
328
326
|
* @param array $button_styles Current collection of button styles.
|
|
329
327
|
* @param array $input_styles Current collection of input styles.
|
|
330
|
-
*
|
|
331
|
-
* @return void
|
|
332
328
|
*/
|
|
333
329
|
function apply_block_core_search_border_styles( $attributes, $property, &$wrapper_styles, &$button_styles, &$input_styles ) {
|
|
334
330
|
apply_block_core_search_border_style( $attributes, $property, null, $wrapper_styles, $button_styles, $input_styles );
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
ToolbarButton,
|
|
17
17
|
LinkSettingsNavigation,
|
|
18
18
|
} from '@wordpress/components';
|
|
19
|
-
import { compose
|
|
19
|
+
import { compose } from '@wordpress/compose';
|
|
20
20
|
import { __, sprintf } from '@wordpress/i18n';
|
|
21
21
|
import { link, Icon } from '@wordpress/icons';
|
|
22
22
|
import { withSelect } from '@wordpress/data';
|
|
@@ -30,10 +30,6 @@ const DEFAULT_ACTIVE_ICON_STYLES = {
|
|
|
30
30
|
backgroundColor: '#f0f0f0',
|
|
31
31
|
color: '#444',
|
|
32
32
|
};
|
|
33
|
-
const DEFAULT_INACTIVE_ICON_STYLES = {
|
|
34
|
-
backgroundColor: '#0000003f',
|
|
35
|
-
color: '#fff',
|
|
36
|
-
};
|
|
37
33
|
const ANIMATION_DELAY = 300;
|
|
38
34
|
const ANIMATION_DURATION = 400;
|
|
39
35
|
|
|
@@ -66,12 +62,6 @@ const SocialLinkEdit = ( {
|
|
|
66
62
|
styles[ `wp-social-link-${ service }` ] ||
|
|
67
63
|
styles[ `wp-social-link` ] ||
|
|
68
64
|
DEFAULT_ACTIVE_ICON_STYLES;
|
|
69
|
-
const inactiveIcon =
|
|
70
|
-
usePreferredColorSchemeStyle(
|
|
71
|
-
styles.inactiveIcon,
|
|
72
|
-
styles.inactiveIconDark
|
|
73
|
-
) || DEFAULT_INACTIVE_ICON_STYLES;
|
|
74
|
-
|
|
75
65
|
const animatedValue = useRef( new Animated.Value( 0 ) ).current;
|
|
76
66
|
|
|
77
67
|
const IconComponent = getIconBySite( service )();
|
|
@@ -94,23 +84,13 @@ const SocialLinkEdit = ( {
|
|
|
94
84
|
}, [ url ] );
|
|
95
85
|
|
|
96
86
|
const interpolationColors = {
|
|
97
|
-
|
|
98
|
-
inputRange: [ 0, 1 ],
|
|
99
|
-
outputRange: [
|
|
100
|
-
inactiveIcon.backgroundColor,
|
|
101
|
-
activeIcon.backgroundColor,
|
|
102
|
-
],
|
|
103
|
-
} ),
|
|
104
|
-
color: animatedValue.interpolate( {
|
|
87
|
+
opacity: animatedValue.interpolate( {
|
|
105
88
|
inputRange: [ 0, 1 ],
|
|
106
|
-
outputRange: [
|
|
89
|
+
outputRange: [ 0.3, 1 ],
|
|
107
90
|
} ),
|
|
108
|
-
stroke: '',
|
|
109
91
|
};
|
|
110
92
|
|
|
111
|
-
const {
|
|
112
|
-
? activeIcon
|
|
113
|
-
: interpolationColors;
|
|
93
|
+
const { opacity } = hasUrl ? activeIcon : interpolationColors;
|
|
114
94
|
|
|
115
95
|
function animateColors() {
|
|
116
96
|
Animated.sequence( [
|
|
@@ -200,12 +180,18 @@ const SocialLinkEdit = ( {
|
|
|
200
180
|
accessibilityHint={ accessibilityHint }
|
|
201
181
|
>
|
|
202
182
|
<Animated.View
|
|
203
|
-
style={ [
|
|
183
|
+
style={ [
|
|
184
|
+
styles.iconContainer,
|
|
185
|
+
{
|
|
186
|
+
backgroundColor: activeIcon.backgroundColor,
|
|
187
|
+
opacity,
|
|
188
|
+
},
|
|
189
|
+
] }
|
|
204
190
|
>
|
|
205
191
|
<Icon
|
|
206
192
|
animated
|
|
207
193
|
icon={ IconComponent }
|
|
208
|
-
style={ {
|
|
194
|
+
style={ { color: activeIcon.color } }
|
|
209
195
|
/>
|
|
210
196
|
</Animated.View>
|
|
211
197
|
</TouchableWithoutFeedback>
|
|
@@ -13,15 +13,6 @@
|
|
|
13
13
|
justify-content: center;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
.inactiveIcon {
|
|
17
|
-
background-color: $light-quaternary;
|
|
18
|
-
color: $white;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.inactiveIconDark {
|
|
22
|
-
background-color: $dark-quaternary;
|
|
23
|
-
}
|
|
24
|
-
|
|
25
16
|
.container {
|
|
26
17
|
margin: $block-selected-margin;
|
|
27
18
|
}
|
|
@@ -62,10 +62,10 @@ function render_block_core_social_link( $attributes, $content, $block ) {
|
|
|
62
62
|
$processor = new WP_HTML_Tag_Processor( $link );
|
|
63
63
|
$processor->next_tag( 'a' );
|
|
64
64
|
if ( $open_in_new_tab ) {
|
|
65
|
-
$processor->set_attribute( 'rel',
|
|
65
|
+
$processor->set_attribute( 'rel', trim( $rel . ' noopener nofollow' ) );
|
|
66
66
|
$processor->set_attribute( 'target', '_blank' );
|
|
67
67
|
} elseif ( '' !== $rel ) {
|
|
68
|
-
$processor->set_attribute( 'rel',
|
|
68
|
+
$processor->set_attribute( 'rel', trim( $rel ) );
|
|
69
69
|
}
|
|
70
70
|
return $processor->get_updated_html();
|
|
71
71
|
}
|
package/src/spacer/controls.js
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
import { __ } from '@wordpress/i18n';
|
|
5
5
|
import {
|
|
6
6
|
InspectorControls,
|
|
7
|
-
|
|
7
|
+
useSettings,
|
|
8
8
|
__experimentalSpacingSizesControl as SpacingSizesControl,
|
|
9
9
|
isValueSpacingPreset,
|
|
10
10
|
} from '@wordpress/block-editor';
|
|
@@ -25,22 +25,19 @@ import { MIN_SPACER_SIZE } from './constants';
|
|
|
25
25
|
|
|
26
26
|
function DimensionInput( { label, onChange, isResizing, value = '' } ) {
|
|
27
27
|
const inputId = useInstanceId( UnitControl, 'block-spacer-height-input' );
|
|
28
|
-
const spacingSizes =
|
|
28
|
+
const [ spacingSizes, spacingUnits ] = useSettings(
|
|
29
|
+
'spacing.spacingSizes',
|
|
30
|
+
'spacing.units'
|
|
31
|
+
);
|
|
29
32
|
// In most contexts the spacer size cannot meaningfully be set to a
|
|
30
33
|
// percentage, since this is relative to the parent container. This
|
|
31
34
|
// unit is disabled from the UI.
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
35
|
+
const availableUnits = spacingUnits
|
|
36
|
+
? spacingUnits.filter( ( unit ) => unit !== '%' )
|
|
37
|
+
: [ 'px', 'em', 'rem', 'vw', 'vh' ];
|
|
35
38
|
|
|
36
39
|
const units = useCustomUnits( {
|
|
37
|
-
availableUnits
|
|
38
|
-
'px',
|
|
39
|
-
'em',
|
|
40
|
-
'rem',
|
|
41
|
-
'vw',
|
|
42
|
-
'vh',
|
|
43
|
-
],
|
|
40
|
+
availableUnits,
|
|
44
41
|
defaultValues: { px: 100, em: 10, rem: 10, vw: 10, vh: 25 },
|
|
45
42
|
} );
|
|
46
43
|
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
__experimentalUseCustomUnits as useCustomUnits,
|
|
9
9
|
} from '@wordpress/components';
|
|
10
10
|
import { useCallback } from '@wordpress/element';
|
|
11
|
-
import {
|
|
11
|
+
import { useSettings } from '@wordpress/block-editor';
|
|
12
12
|
import { __ } from '@wordpress/i18n';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -59,14 +59,9 @@ function Controls( {
|
|
|
59
59
|
[ height, width ]
|
|
60
60
|
);
|
|
61
61
|
|
|
62
|
+
const [ availableUnits ] = useSettings( 'spacing.units' );
|
|
62
63
|
const units = useCustomUnits( {
|
|
63
|
-
availableUnits:
|
|
64
|
-
'px',
|
|
65
|
-
'em',
|
|
66
|
-
'rem',
|
|
67
|
-
'vw',
|
|
68
|
-
'vh',
|
|
69
|
-
],
|
|
64
|
+
availableUnits: availableUnits || [ 'px', 'em', 'rem', 'vw', 'vh' ],
|
|
70
65
|
defaultValues: DEFAULT_VALUES,
|
|
71
66
|
} );
|
|
72
67
|
|
package/src/spacer/edit.js
CHANGED
|
@@ -8,7 +8,7 @@ import classnames from 'classnames';
|
|
|
8
8
|
*/
|
|
9
9
|
import {
|
|
10
10
|
useBlockProps,
|
|
11
|
-
|
|
11
|
+
useSettings,
|
|
12
12
|
getCustomValueFromPreset,
|
|
13
13
|
getSpacingPresetCssVar,
|
|
14
14
|
store as blockEditorStore,
|
|
@@ -107,7 +107,7 @@ const SpacerEdit = ( {
|
|
|
107
107
|
const { layout = {} } = blockStyle;
|
|
108
108
|
const { selfStretch, flexSize } = layout;
|
|
109
109
|
|
|
110
|
-
const spacingSizes =
|
|
110
|
+
const [ spacingSizes ] = useSettings( 'spacing.spacingSizes' );
|
|
111
111
|
|
|
112
112
|
const [ isResizing, setIsResizing ] = useState( false );
|
|
113
113
|
const [ temporaryHeight, setTemporaryHeight ] = useState( null );
|
|
@@ -11,7 +11,7 @@ import { withPreferredColorScheme } from '@wordpress/compose';
|
|
|
11
11
|
import {
|
|
12
12
|
InspectorControls,
|
|
13
13
|
isValueSpacingPreset,
|
|
14
|
-
|
|
14
|
+
useSettings,
|
|
15
15
|
getCustomValueFromPreset,
|
|
16
16
|
getPxFromCssUnit,
|
|
17
17
|
} from '@wordpress/block-editor';
|
|
@@ -39,10 +39,11 @@ const Spacer = ( {
|
|
|
39
39
|
fontSize: DEFAULT_FONT_SIZE,
|
|
40
40
|
};
|
|
41
41
|
const { height, width } = attributes;
|
|
42
|
-
const spacingSizes = [
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
const spacingSizes = [ { name: 0, slug: '0', size: 0 } ];
|
|
43
|
+
const [ settingsSizes ] = useSettings( 'spacing.spacingSizes' );
|
|
44
|
+
if ( settingsSizes ) {
|
|
45
|
+
spacingSizes.push( ...settingsSizes );
|
|
46
|
+
}
|
|
46
47
|
const { orientation } = context;
|
|
47
48
|
const defaultStyle = getStylesFromColorScheme(
|
|
48
49
|
styles.staticSpacer,
|
package/src/style.scss
CHANGED
package/src/tag-cloud/edit.js
CHANGED
|
@@ -18,7 +18,7 @@ import { __ } from '@wordpress/i18n';
|
|
|
18
18
|
import {
|
|
19
19
|
InspectorControls,
|
|
20
20
|
useBlockProps,
|
|
21
|
-
|
|
21
|
+
useSettings,
|
|
22
22
|
} from '@wordpress/block-editor';
|
|
23
23
|
import ServerSideRender from '@wordpress/server-side-render';
|
|
24
24
|
import { store as coreStore } from '@wordpress/core-data';
|
|
@@ -49,13 +49,9 @@ function TagCloudEdit( { attributes, setAttributes, taxonomies } ) {
|
|
|
49
49
|
largestFontSize,
|
|
50
50
|
} = attributes;
|
|
51
51
|
|
|
52
|
+
const [ availableUnits ] = useSettings( 'spacing.units' );
|
|
52
53
|
const units = useCustomUnits( {
|
|
53
|
-
availableUnits:
|
|
54
|
-
'%',
|
|
55
|
-
'px',
|
|
56
|
-
'em',
|
|
57
|
-
'rem',
|
|
58
|
-
],
|
|
54
|
+
availableUnits: availableUnits || [ '%', 'px', 'em', 'rem' ],
|
|
59
55
|
} );
|
|
60
56
|
|
|
61
57
|
const getTaxonomyOptions = () => {
|
|
@@ -5,7 +5,7 @@ import { useEntityBlockEditor } from '@wordpress/core-data';
|
|
|
5
5
|
import {
|
|
6
6
|
InnerBlocks,
|
|
7
7
|
useInnerBlocksProps,
|
|
8
|
-
|
|
8
|
+
useSettings,
|
|
9
9
|
store as blockEditorStore,
|
|
10
10
|
} from '@wordpress/block-editor';
|
|
11
11
|
import { useSelect } from '@wordpress/data';
|
|
@@ -21,8 +21,8 @@ export default function TemplatePartInnerBlocks( {
|
|
|
21
21
|
const { getSettings } = select( blockEditorStore );
|
|
22
22
|
return getSettings()?.supportsLayout;
|
|
23
23
|
}, [] );
|
|
24
|
-
const defaultLayout =
|
|
25
|
-
const usedLayout =
|
|
24
|
+
const [ defaultLayout ] = useSettings( 'layout' );
|
|
25
|
+
const usedLayout = layout?.inherit ? defaultLayout || {} : layout;
|
|
26
26
|
|
|
27
27
|
const [ blocks, onInput, onChange ] = useEntityBlockEditor(
|
|
28
28
|
'postType',
|
|
@@ -18,13 +18,10 @@ function render_block_core_template_part( $attributes ) {
|
|
|
18
18
|
$template_part_id = null;
|
|
19
19
|
$content = null;
|
|
20
20
|
$area = WP_TEMPLATE_PART_AREA_UNCATEGORIZED;
|
|
21
|
+
$theme = isset( $attributes['theme'] ) ? $attributes['theme'] : get_stylesheet();
|
|
21
22
|
|
|
22
|
-
if (
|
|
23
|
-
|
|
24
|
-
isset( $attributes['theme'] ) &&
|
|
25
|
-
get_stylesheet() === $attributes['theme']
|
|
26
|
-
) {
|
|
27
|
-
$template_part_id = $attributes['theme'] . '//' . $attributes['slug'];
|
|
23
|
+
if ( isset( $attributes['slug'] ) && get_stylesheet() === $theme ) {
|
|
24
|
+
$template_part_id = $theme . '//' . $attributes['slug'];
|
|
28
25
|
$template_part_query = new WP_Query(
|
|
29
26
|
array(
|
|
30
27
|
'post_type' => 'wp_template_part',
|
|
@@ -34,7 +31,7 @@ function render_block_core_template_part( $attributes ) {
|
|
|
34
31
|
array(
|
|
35
32
|
'taxonomy' => 'wp_theme',
|
|
36
33
|
'field' => 'name',
|
|
37
|
-
'terms' => $
|
|
34
|
+
'terms' => $theme,
|
|
38
35
|
),
|
|
39
36
|
),
|
|
40
37
|
'posts_per_page' => 1,
|
|
@@ -78,4 +78,41 @@ describe( 'Verse block', () => {
|
|
|
78
78
|
<!-- /wp:verse -->"
|
|
79
79
|
` );
|
|
80
80
|
} );
|
|
81
|
+
|
|
82
|
+
it( 'should split on triple Enter', async () => {
|
|
83
|
+
// Arrange
|
|
84
|
+
const screen = await initializeEditor();
|
|
85
|
+
await addBlock( screen, 'Verse' );
|
|
86
|
+
|
|
87
|
+
// Act
|
|
88
|
+
const verseTextInput =
|
|
89
|
+
await screen.findByPlaceholderText( 'Write verse…' );
|
|
90
|
+
typeInRichText( verseTextInput, 'Hello' );
|
|
91
|
+
fireEvent( verseTextInput, 'onKeyDown', {
|
|
92
|
+
nativeEvent: {},
|
|
93
|
+
preventDefault() {},
|
|
94
|
+
keyCode: ENTER,
|
|
95
|
+
} );
|
|
96
|
+
fireEvent( verseTextInput, 'onKeyDown', {
|
|
97
|
+
nativeEvent: {},
|
|
98
|
+
preventDefault() {},
|
|
99
|
+
keyCode: ENTER,
|
|
100
|
+
} );
|
|
101
|
+
fireEvent( verseTextInput, 'onKeyDown', {
|
|
102
|
+
nativeEvent: {},
|
|
103
|
+
preventDefault() {},
|
|
104
|
+
keyCode: ENTER,
|
|
105
|
+
} );
|
|
106
|
+
|
|
107
|
+
// Assert
|
|
108
|
+
expect( getEditorHtml() ).toMatchInlineSnapshot( `
|
|
109
|
+
"<!-- wp:verse -->
|
|
110
|
+
<pre class="wp-block-verse">Hello</pre>
|
|
111
|
+
<!-- /wp:verse -->
|
|
112
|
+
|
|
113
|
+
<!-- wp:paragraph -->
|
|
114
|
+
<p></p>
|
|
115
|
+
<!-- /wp:paragraph -->"
|
|
116
|
+
` );
|
|
117
|
+
} );
|
|
81
118
|
} );
|