@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/image/style.scss
CHANGED
|
@@ -154,21 +154,53 @@
|
|
|
154
154
|
|
|
155
155
|
.wp-lightbox-container {
|
|
156
156
|
position: relative;
|
|
157
|
+
display: flex;
|
|
158
|
+
flex-direction: column;
|
|
159
|
+
|
|
160
|
+
img {
|
|
161
|
+
cursor: zoom-in;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
img:hover + button {
|
|
165
|
+
opacity: 1;
|
|
166
|
+
}
|
|
157
167
|
|
|
158
168
|
button {
|
|
169
|
+
opacity: 0;
|
|
159
170
|
border: none;
|
|
160
|
-
background:
|
|
171
|
+
background: #000;
|
|
161
172
|
cursor: zoom-in;
|
|
162
|
-
width:
|
|
163
|
-
height:
|
|
173
|
+
width: 24px;
|
|
174
|
+
height: 24px;
|
|
164
175
|
position: absolute;
|
|
165
176
|
z-index: 100;
|
|
177
|
+
top: 10px;
|
|
178
|
+
right: 10px;
|
|
179
|
+
text-align: center;
|
|
180
|
+
padding: 0;
|
|
181
|
+
border-radius: 10%;
|
|
166
182
|
|
|
167
183
|
&:focus-visible {
|
|
168
184
|
outline: 5px auto #212121;
|
|
169
185
|
outline: 5px auto -webkit-focus-ring-color;
|
|
170
186
|
outline-offset: 5px;
|
|
171
187
|
}
|
|
188
|
+
|
|
189
|
+
&:hover {
|
|
190
|
+
cursor: pointer;
|
|
191
|
+
opacity: 1;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
&:focus {
|
|
195
|
+
opacity: 1;
|
|
196
|
+
}
|
|
197
|
+
|
|
198
|
+
&:hover,
|
|
199
|
+
&:focus,
|
|
200
|
+
&:not(:hover):not(:active):not(.has-background) {
|
|
201
|
+
background: #000;
|
|
202
|
+
border: none;
|
|
203
|
+
}
|
|
172
204
|
}
|
|
173
205
|
}
|
|
174
206
|
|
|
@@ -186,11 +218,23 @@
|
|
|
186
218
|
|
|
187
219
|
.close-button {
|
|
188
220
|
position: absolute;
|
|
189
|
-
top: calc(env(safe-area-inset-top) +
|
|
190
|
-
right: calc(env(safe-area-inset-right) +
|
|
221
|
+
top: calc(env(safe-area-inset-top) + 16px); // equivalent to $grid-unit-20
|
|
222
|
+
right: calc(env(safe-area-inset-right) + 16px); // equivalent to $grid-unit-20
|
|
191
223
|
padding: 0;
|
|
192
224
|
cursor: pointer;
|
|
193
225
|
z-index: 5000000;
|
|
226
|
+
min-width: 40px; // equivalent to $button-size-next-default-40px
|
|
227
|
+
min-height: 40px; // equivalent to $button-size-next-default-40px
|
|
228
|
+
display: flex;
|
|
229
|
+
align-items: center;
|
|
230
|
+
justify-content: center;
|
|
231
|
+
|
|
232
|
+
&:hover,
|
|
233
|
+
&:focus,
|
|
234
|
+
&:not(:hover):not(:active):not(.has-background) {
|
|
235
|
+
background: none;
|
|
236
|
+
border: none;
|
|
237
|
+
}
|
|
194
238
|
}
|
|
195
239
|
|
|
196
240
|
.lightbox-image-container {
|
package/src/image/view.js
CHANGED
|
@@ -103,9 +103,10 @@ store(
|
|
|
103
103
|
context.core.image.lastFocusedElement =
|
|
104
104
|
window.document.activeElement;
|
|
105
105
|
context.core.image.scrollDelta = 0;
|
|
106
|
+
context.core.image.pointerType = event.pointerType;
|
|
106
107
|
|
|
107
108
|
context.core.image.lightboxEnabled = true;
|
|
108
|
-
setStyles( context,
|
|
109
|
+
setStyles( context, context.core.image.imageRef );
|
|
109
110
|
|
|
110
111
|
context.core.image.scrollTopReset =
|
|
111
112
|
window.pageYOffset ||
|
|
@@ -148,12 +149,15 @@ store(
|
|
|
148
149
|
'scroll',
|
|
149
150
|
scrollCallback
|
|
150
151
|
);
|
|
152
|
+
// If we don't delay before changing the focus,
|
|
153
|
+
// the focus ring will appear on Firefox before
|
|
154
|
+
// the image has finished animating, which looks broken.
|
|
155
|
+
context.core.image.lightboxTriggerRef.focus( {
|
|
156
|
+
preventScroll: true,
|
|
157
|
+
} );
|
|
151
158
|
}, 450 );
|
|
152
159
|
|
|
153
160
|
context.core.image.lightboxEnabled = false;
|
|
154
|
-
context.core.image.lastFocusedElement.focus( {
|
|
155
|
-
preventScroll: true,
|
|
156
|
-
} );
|
|
157
161
|
}
|
|
158
162
|
},
|
|
159
163
|
handleKeydown: ( { context, actions, event } ) => {
|
|
@@ -188,11 +192,12 @@ store(
|
|
|
188
192
|
}
|
|
189
193
|
}
|
|
190
194
|
},
|
|
191
|
-
|
|
195
|
+
// This is fired just by lazily loaded
|
|
196
|
+
// images on the page, not all images.
|
|
197
|
+
handleLoad: ( { context, effects, ref } ) => {
|
|
192
198
|
context.core.image.imageLoaded = true;
|
|
193
199
|
context.core.image.imageCurrentSrc = ref.currentSrc;
|
|
194
200
|
effects.core.image.setButtonStyles( {
|
|
195
|
-
state,
|
|
196
201
|
context,
|
|
197
202
|
ref,
|
|
198
203
|
} );
|
|
@@ -227,7 +232,17 @@ store(
|
|
|
227
232
|
roleAttribute: ( { context } ) => {
|
|
228
233
|
return context.core.image.lightboxEnabled
|
|
229
234
|
? 'dialog'
|
|
230
|
-
:
|
|
235
|
+
: null;
|
|
236
|
+
},
|
|
237
|
+
ariaModal: ( { context } ) => {
|
|
238
|
+
return context.core.image.lightboxEnabled
|
|
239
|
+
? 'true'
|
|
240
|
+
: null;
|
|
241
|
+
},
|
|
242
|
+
dialogLabel: ( { context } ) => {
|
|
243
|
+
return context.core.image.lightboxEnabled
|
|
244
|
+
? context.core.image.dialogLabel
|
|
245
|
+
: null;
|
|
231
246
|
},
|
|
232
247
|
lightboxObjectFit: ( { context } ) => {
|
|
233
248
|
if ( context.core.image.initialized ) {
|
|
@@ -237,7 +252,7 @@ store(
|
|
|
237
252
|
enlargedImgSrc: ( { context } ) => {
|
|
238
253
|
return context.core.image.initialized
|
|
239
254
|
? context.core.image.imageUploadedSrc
|
|
240
|
-
: '';
|
|
255
|
+
: 'data:image/gif;base64,R0lGODlhAQABAAD/ACwAAAAAAQABAAACADs=';
|
|
241
256
|
},
|
|
242
257
|
},
|
|
243
258
|
},
|
|
@@ -245,17 +260,18 @@ store(
|
|
|
245
260
|
effects: {
|
|
246
261
|
core: {
|
|
247
262
|
image: {
|
|
248
|
-
|
|
263
|
+
initOriginImage: ( { context, ref } ) => {
|
|
264
|
+
context.core.image.imageRef = ref;
|
|
265
|
+
context.core.image.lightboxTriggerRef =
|
|
266
|
+
ref.parentElement.querySelector(
|
|
267
|
+
'.lightbox-trigger'
|
|
268
|
+
);
|
|
249
269
|
if ( ref.complete ) {
|
|
250
270
|
context.core.image.imageLoaded = true;
|
|
251
271
|
context.core.image.imageCurrentSrc = ref.currentSrc;
|
|
252
272
|
}
|
|
253
273
|
},
|
|
254
274
|
initLightbox: async ( { context, ref } ) => {
|
|
255
|
-
context.core.image.figureRef =
|
|
256
|
-
ref.querySelector( 'figure' );
|
|
257
|
-
context.core.image.imageRef =
|
|
258
|
-
ref.querySelector( 'img' );
|
|
259
275
|
if ( context.core.image.lightboxEnabled ) {
|
|
260
276
|
const focusableElements =
|
|
261
277
|
ref.querySelectorAll( focusableSelectors );
|
|
@@ -266,10 +282,11 @@ store(
|
|
|
266
282
|
focusableElements.length - 1
|
|
267
283
|
];
|
|
268
284
|
|
|
269
|
-
|
|
285
|
+
// Move focus to the dialog when opening it.
|
|
286
|
+
ref.focus();
|
|
270
287
|
}
|
|
271
288
|
},
|
|
272
|
-
setButtonStyles: ( {
|
|
289
|
+
setButtonStyles: ( { context, ref } ) => {
|
|
273
290
|
const {
|
|
274
291
|
naturalWidth,
|
|
275
292
|
naturalHeight,
|
|
@@ -278,54 +295,80 @@ store(
|
|
|
278
295
|
} = ref;
|
|
279
296
|
|
|
280
297
|
// If the image isn't loaded yet, we can't
|
|
281
|
-
// calculate
|
|
298
|
+
// calculate where the button should be.
|
|
282
299
|
if ( naturalWidth === 0 || naturalHeight === 0 ) {
|
|
283
300
|
return;
|
|
284
301
|
}
|
|
285
302
|
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
303
|
+
const figure = ref.parentElement;
|
|
304
|
+
const figureWidth = ref.parentElement.clientWidth;
|
|
305
|
+
|
|
306
|
+
// We need special handling for the height because
|
|
307
|
+
// a caption will cause the figure to be taller than
|
|
308
|
+
// the image, which means we need to account for that
|
|
309
|
+
// when calculating the placement of the button in the
|
|
310
|
+
// top right corner of the image.
|
|
311
|
+
let figureHeight = ref.parentElement.clientHeight;
|
|
312
|
+
const caption = figure.querySelector( 'figcaption' );
|
|
313
|
+
if ( caption ) {
|
|
314
|
+
const captionComputedStyle =
|
|
315
|
+
window.getComputedStyle( caption );
|
|
316
|
+
figureHeight =
|
|
317
|
+
figureHeight -
|
|
318
|
+
caption.offsetHeight -
|
|
319
|
+
parseFloat( captionComputedStyle.marginTop ) -
|
|
320
|
+
parseFloat( captionComputedStyle.marginBottom );
|
|
321
|
+
}
|
|
296
322
|
|
|
323
|
+
const buttonOffsetTop = figureHeight - offsetHeight;
|
|
324
|
+
const buttonOffsetRight = figureWidth - offsetWidth;
|
|
325
|
+
|
|
326
|
+
// In the case of an image with object-fit: contain, the
|
|
327
|
+
// size of the <img> element can be larger than the image itself,
|
|
328
|
+
// so we need to calculate where to place the button.
|
|
329
|
+
if ( context.core.image.scaleAttr === 'contain' ) {
|
|
297
330
|
// Natural ratio of the image.
|
|
298
331
|
const naturalRatio = naturalWidth / naturalHeight;
|
|
299
332
|
// Offset ratio of the image.
|
|
300
333
|
const offsetRatio = offsetWidth / offsetHeight;
|
|
301
334
|
|
|
302
|
-
if ( naturalRatio
|
|
335
|
+
if ( naturalRatio >= offsetRatio ) {
|
|
303
336
|
// If it reaches the width first, keep
|
|
304
|
-
// the width and
|
|
305
|
-
|
|
306
|
-
offsetWidth;
|
|
307
|
-
const buttonHeight = offsetWidth / naturalRatio;
|
|
308
|
-
context.core.image.imageButtonHeight =
|
|
309
|
-
buttonHeight;
|
|
337
|
+
// the width and compute the height.
|
|
338
|
+
const referenceHeight =
|
|
339
|
+
offsetWidth / naturalRatio;
|
|
310
340
|
context.core.image.imageButtonTop =
|
|
311
|
-
( offsetHeight -
|
|
341
|
+
( offsetHeight - referenceHeight ) / 2 +
|
|
342
|
+
buttonOffsetTop +
|
|
343
|
+
10;
|
|
344
|
+
context.core.image.imageButtonRight =
|
|
345
|
+
buttonOffsetRight + 10;
|
|
312
346
|
} else {
|
|
313
347
|
// If it reaches the height first, keep
|
|
314
|
-
// the height and
|
|
315
|
-
|
|
316
|
-
offsetHeight;
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
348
|
+
// the height and compute the width.
|
|
349
|
+
const referenceWidth =
|
|
350
|
+
offsetHeight * naturalRatio;
|
|
351
|
+
context.core.image.imageButtonTop =
|
|
352
|
+
buttonOffsetTop + 10;
|
|
353
|
+
context.core.image.imageButtonRight =
|
|
354
|
+
( offsetWidth - referenceWidth ) / 2 +
|
|
355
|
+
buttonOffsetRight +
|
|
356
|
+
10;
|
|
322
357
|
}
|
|
323
358
|
} else {
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
359
|
+
context.core.image.imageButtonTop =
|
|
360
|
+
buttonOffsetTop + 10;
|
|
361
|
+
context.core.image.imageButtonRight =
|
|
362
|
+
buttonOffsetRight + 10;
|
|
363
|
+
}
|
|
364
|
+
},
|
|
365
|
+
setStylesOnResize: ( { state, context, ref } ) => {
|
|
366
|
+
if (
|
|
367
|
+
context.core.image.lightboxEnabled &&
|
|
368
|
+
( state.core.image.windowWidth ||
|
|
369
|
+
state.core.image.windowHeight )
|
|
370
|
+
) {
|
|
371
|
+
setStyles( context, ref );
|
|
329
372
|
}
|
|
330
373
|
},
|
|
331
374
|
},
|
|
@@ -352,7 +395,7 @@ store(
|
|
|
352
395
|
* @param {Object} context - An Interactivity API context
|
|
353
396
|
* @param {Object} event - A triggering event
|
|
354
397
|
*/
|
|
355
|
-
function setStyles( context,
|
|
398
|
+
function setStyles( context, ref ) {
|
|
356
399
|
// The reference img element lies adjacent
|
|
357
400
|
// to the event target button in the DOM.
|
|
358
401
|
let {
|
|
@@ -360,9 +403,8 @@ function setStyles( context, event ) {
|
|
|
360
403
|
naturalHeight,
|
|
361
404
|
offsetWidth: originalWidth,
|
|
362
405
|
offsetHeight: originalHeight,
|
|
363
|
-
} =
|
|
364
|
-
let { x: screenPosX, y: screenPosY } =
|
|
365
|
-
event.target.nextElementSibling.getBoundingClientRect();
|
|
406
|
+
} = ref;
|
|
407
|
+
let { x: screenPosX, y: screenPosY } = ref.getBoundingClientRect();
|
|
366
408
|
|
|
367
409
|
// Natural ratio of the image clicked to open the lightbox.
|
|
368
410
|
const naturalRatio = naturalWidth / naturalHeight;
|
package/src/index.js
CHANGED
|
@@ -48,6 +48,10 @@ import * as cover from './cover';
|
|
|
48
48
|
import * as details from './details';
|
|
49
49
|
import * as embed from './embed';
|
|
50
50
|
import * as file from './file';
|
|
51
|
+
import * as form from './form';
|
|
52
|
+
import * as formInput from './form-input';
|
|
53
|
+
import * as formSubmitButton from './form-submit-button';
|
|
54
|
+
import * as formSubmissionNotification from './form-submission-notification';
|
|
51
55
|
import * as gallery from './gallery';
|
|
52
56
|
import * as group from './group';
|
|
53
57
|
import * as heading from './heading';
|
|
@@ -228,6 +232,12 @@ const getAllBlocks = () => {
|
|
|
228
232
|
queryTitle,
|
|
229
233
|
postAuthorBiography,
|
|
230
234
|
];
|
|
235
|
+
if ( window?.__experimentalEnableFormBlocks ) {
|
|
236
|
+
blocks.push( form );
|
|
237
|
+
blocks.push( formInput );
|
|
238
|
+
blocks.push( formSubmitButton );
|
|
239
|
+
blocks.push( formSubmissionNotification );
|
|
240
|
+
}
|
|
231
241
|
|
|
232
242
|
// When in a WordPress context, conditionally
|
|
233
243
|
// add the classic block and TinyMCE editor
|
package/src/latest-posts/edit.js
CHANGED
|
@@ -483,12 +483,18 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
483
483
|
.split( ' ', excerptLength )
|
|
484
484
|
.join( ' ' ) }
|
|
485
485
|
{ createInterpolateElement(
|
|
486
|
-
|
|
487
|
-
|
|
486
|
+
sprintf(
|
|
487
|
+
/* translators: 1: Hidden accessibility text: Post title */
|
|
488
|
+
__(
|
|
489
|
+
'… <a>Read more<span>: %1$s</span></a>'
|
|
490
|
+
),
|
|
491
|
+
titleTrimmed || __( '(no title)' )
|
|
492
|
+
),
|
|
488
493
|
{
|
|
489
494
|
a: (
|
|
490
495
|
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
491
496
|
<a
|
|
497
|
+
className="wp-block-latest-posts__read-more"
|
|
492
498
|
href={ post.link }
|
|
493
499
|
rel="noopener noreferrer"
|
|
494
500
|
onClick={
|
|
@@ -496,6 +502,9 @@ export default function LatestPostsEdit( { attributes, setAttributes } ) {
|
|
|
496
502
|
}
|
|
497
503
|
/>
|
|
498
504
|
),
|
|
505
|
+
span: (
|
|
506
|
+
<span className="screen-reader-text" />
|
|
507
|
+
),
|
|
499
508
|
}
|
|
500
509
|
) }
|
|
501
510
|
</>
|
|
@@ -48,14 +48,6 @@ function render_block_core_latest_posts( $attributes ) {
|
|
|
48
48
|
$block_core_latest_posts_excerpt_length = $attributes['excerptLength'];
|
|
49
49
|
add_filter( 'excerpt_length', 'block_core_latest_posts_get_excerpt_length', 20 );
|
|
50
50
|
|
|
51
|
-
$filter_latest_posts_excerpt_more = static function ( $more ) use ( $attributes ) {
|
|
52
|
-
$use_excerpt = 'excerpt' === $attributes['displayPostContentRadio'];
|
|
53
|
-
/* translators: %1$s is a URL to a post, excerpt truncation character, default … */
|
|
54
|
-
return $use_excerpt ? sprintf( __( ' … <a href="%1$s" rel="noopener noreferrer">Read more</a>' ), esc_url( get_permalink() ) ) : $more;
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
add_filter( 'excerpt_more', $filter_latest_posts_excerpt_more );
|
|
58
|
-
|
|
59
51
|
if ( ! empty( $attributes['categories'] ) ) {
|
|
60
52
|
$args['category__in'] = array_column( $attributes['categories'], 'id' );
|
|
61
53
|
}
|
|
@@ -151,6 +143,23 @@ function render_block_core_latest_posts( $attributes ) {
|
|
|
151
143
|
|
|
152
144
|
$trimmed_excerpt = get_the_excerpt( $post );
|
|
153
145
|
|
|
146
|
+
/*
|
|
147
|
+
* Adds a "Read more" link with screen reader text.
|
|
148
|
+
* […] is the default excerpt ending from wp_trim_excerpt() in Core.
|
|
149
|
+
*/
|
|
150
|
+
if ( str_ends_with( $trimmed_excerpt, ' […]' ) ) {
|
|
151
|
+
$excerpt_length = (int) apply_filters( 'excerpt_length', $block_core_latest_posts_excerpt_length );
|
|
152
|
+
if ( $excerpt_length <= $block_core_latest_posts_excerpt_length ) {
|
|
153
|
+
$trimmed_excerpt = substr( $trimmed_excerpt, 0, -11 );
|
|
154
|
+
$trimmed_excerpt .= sprintf(
|
|
155
|
+
/* translators: 1: A URL to a post, 2: Hidden accessibility text: Post title */
|
|
156
|
+
__( '… <a href="%1$s" rel="noopener noreferrer">Read more<span class="screen-reader-text">: %2$s</span></a>' ),
|
|
157
|
+
esc_url( $post_link ),
|
|
158
|
+
esc_html( $title )
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
154
163
|
if ( post_password_required( $post ) ) {
|
|
155
164
|
$trimmed_excerpt = __( 'This content is password protected.' );
|
|
156
165
|
}
|
|
@@ -76,6 +76,24 @@ export default function useMerge( clientId, onMerge ) {
|
|
|
76
76
|
}
|
|
77
77
|
|
|
78
78
|
return ( forward ) => {
|
|
79
|
+
function mergeWithNested( clientIdA, clientIdB ) {
|
|
80
|
+
registry.batch( () => {
|
|
81
|
+
// When merging a sub list item with a higher next list item, we
|
|
82
|
+
// also need to move any nested list items. Check if there's a
|
|
83
|
+
// listed list, and append its nested list items to the current
|
|
84
|
+
// list.
|
|
85
|
+
const [ nestedListClientId ] = getBlockOrder( clientIdB );
|
|
86
|
+
if ( nestedListClientId ) {
|
|
87
|
+
moveBlocksToPosition(
|
|
88
|
+
getBlockOrder( nestedListClientId ),
|
|
89
|
+
nestedListClientId,
|
|
90
|
+
getBlockRootClientId( clientIdA )
|
|
91
|
+
);
|
|
92
|
+
}
|
|
93
|
+
mergeBlocks( clientIdA, clientIdB );
|
|
94
|
+
} );
|
|
95
|
+
}
|
|
96
|
+
|
|
79
97
|
if ( forward ) {
|
|
80
98
|
const nextBlockClientId = getNextId( clientId );
|
|
81
99
|
|
|
@@ -87,14 +105,7 @@ export default function useMerge( clientId, onMerge ) {
|
|
|
87
105
|
if ( getParentListItemId( nextBlockClientId ) ) {
|
|
88
106
|
outdentListItem( nextBlockClientId );
|
|
89
107
|
} else {
|
|
90
|
-
|
|
91
|
-
moveBlocksToPosition(
|
|
92
|
-
getBlockOrder( nextBlockClientId ),
|
|
93
|
-
nextBlockClientId,
|
|
94
|
-
getPreviousBlockClientId( nextBlockClientId )
|
|
95
|
-
);
|
|
96
|
-
mergeBlocks( clientId, nextBlockClientId );
|
|
97
|
-
} );
|
|
108
|
+
mergeWithNested( clientId, nextBlockClientId );
|
|
98
109
|
}
|
|
99
110
|
} else {
|
|
100
111
|
// Merging is only done from the top level. For lowel levels, the
|
|
@@ -104,21 +115,7 @@ export default function useMerge( clientId, onMerge ) {
|
|
|
104
115
|
outdentListItem( clientId );
|
|
105
116
|
} else if ( previousBlockClientId ) {
|
|
106
117
|
const trailingId = getTrailingId( previousBlockClientId );
|
|
107
|
-
|
|
108
|
-
// When merging a list item with a previous trailing list
|
|
109
|
-
// item, we also need to move any nested list items. First,
|
|
110
|
-
// check if there's a listed list. If there's a nested list,
|
|
111
|
-
// append its nested list items to the trailing list.
|
|
112
|
-
const [ nestedListClientId ] = getBlockOrder( clientId );
|
|
113
|
-
if ( nestedListClientId ) {
|
|
114
|
-
moveBlocksToPosition(
|
|
115
|
-
getBlockOrder( nestedListClientId ),
|
|
116
|
-
nestedListClientId,
|
|
117
|
-
getBlockRootClientId( trailingId )
|
|
118
|
-
);
|
|
119
|
-
}
|
|
120
|
-
mergeBlocks( trailingId, clientId );
|
|
121
|
-
} );
|
|
118
|
+
mergeWithNested( trailingId, clientId );
|
|
122
119
|
} else {
|
|
123
120
|
onMerge( forward );
|
|
124
121
|
}
|
package/src/lock-unlock.js
CHANGED
|
@@ -5,6 +5,6 @@ import { __dangerousOptInToUnstableAPIsOnlyForCoreModules } from '@wordpress/pri
|
|
|
5
5
|
|
|
6
6
|
export const { lock, unlock } =
|
|
7
7
|
__dangerousOptInToUnstableAPIsOnlyForCoreModules(
|
|
8
|
-
'I know using unstable features means my
|
|
8
|
+
'I know using unstable features means my theme or plugin will inevitably break in the next version of WordPress.',
|
|
9
9
|
'@wordpress/block-library'
|
|
10
10
|
);
|