@wordpress/block-library 8.7.0 → 8.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/build/column/index.js +2 -1
- package/build/column/index.js.map +1 -1
- package/build/columns/edit.js +24 -6
- package/build/columns/edit.js.map +1 -1
- package/build/columns/index.js +2 -1
- package/build/columns/index.js.map +1 -1
- package/build/columns/utils.js +4 -9
- package/build/columns/utils.js.map +1 -1
- package/build/cover/edit/index.js +46 -50
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +32 -6
- package/build/cover/edit/resizable-cover-popover.js.map +1 -0
- package/build/cover/index.js +12 -0
- package/build/cover/index.js.map +1 -1
- package/build/cover/transforms.js +10 -7
- package/build/cover/transforms.js.map +1 -1
- package/build/details/edit.js +67 -0
- package/build/details/edit.js.map +1 -0
- package/build/details/index.js +110 -0
- package/build/details/index.js.map +1 -0
- package/build/details/save.js +33 -0
- package/build/details/save.js.map +1 -0
- package/build/details-content/edit.js +34 -0
- package/build/details-content/edit.js.map +1 -0
- package/build/details-content/index.js +94 -0
- package/build/details-content/index.js.map +1 -0
- package/build/details-content/save.js +20 -0
- package/build/details-content/save.js.map +1 -0
- package/build/details-summary/edit.js +42 -0
- package/build/details-summary/edit.js.map +1 -0
- package/build/details-summary/index.js +97 -0
- package/build/details-summary/index.js.map +1 -0
- package/build/details-summary/save.js +24 -0
- package/build/details-summary/save.js.map +1 -0
- package/build/embed/deprecated.js +4 -1
- package/build/embed/deprecated.js.map +1 -1
- package/build/embed/embed-link-settings.native.js +1 -1
- package/build/embed/embed-link-settings.native.js.map +1 -1
- package/build/embed/embed-placeholder.js +1 -1
- package/build/embed/embed-placeholder.js.map +1 -1
- package/build/embed/index.js +4 -1
- package/build/embed/index.js.map +1 -1
- package/build/embed/transforms.js +4 -1
- package/build/embed/transforms.js.map +1 -1
- package/build/embed/util.js +4 -1
- package/build/embed/util.js.map +1 -1
- package/build/file/edit.native.js +0 -2
- package/build/file/edit.native.js.map +1 -1
- package/build/gallery/use-get-media.native.js +2 -1
- package/build/gallery/use-get-media.native.js.map +1 -1
- package/build/group/edit.js +3 -1
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +3 -0
- package/build/group/index.js.map +1 -1
- package/build/image/edit.js +16 -13
- package/build/image/edit.js.map +1 -1
- package/build/image/index.js +5 -3
- package/build/image/index.js.map +1 -1
- package/build/index.js +24 -6
- package/build/index.js.map +1 -1
- package/build/index.native.js +9 -5
- package/build/index.native.js.map +1 -1
- package/build/media-text/edit.js +4 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/media-text/index.js +3 -0
- package/build/media-text/index.js.map +1 -1
- package/build/media-text/media-container.js +2 -6
- package/build/media-text/media-container.js.map +1 -1
- package/build/media-text/media-container.native.js +3 -3
- package/build/media-text/media-container.native.js.map +1 -1
- package/build/navigation/deprecated.js +8 -11
- package/build/navigation/deprecated.js.map +1 -1
- package/build/navigation/edit/index.js +32 -64
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +1 -14
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/post-author/index.js +0 -1
- package/build/post-author/index.js.map +1 -1
- package/build/post-date/edit.js +4 -2
- package/build/post-date/edit.js.map +1 -1
- package/build/post-excerpt/edit.js +2 -2
- package/build/post-excerpt/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +2 -1
- package/build/post-featured-image/dimension-controls.js.map +1 -1
- package/build/post-featured-image/edit.js +16 -27
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-time-to-read/edit.js +1 -1
- package/build/post-time-to-read/edit.js.map +1 -1
- package/build/post-time-to-read/index.js +7 -0
- package/build/post-time-to-read/index.js.map +1 -1
- package/build/query/deprecated.js +8 -6
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/inspector-controls/create-new-post-link.js +41 -0
- package/build/query/edit/inspector-controls/create-new-post-link.js.map +1 -0
- package/build/query/edit/inspector-controls/index.js +14 -6
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/pattern-selection-modal.js +2 -1
- package/build/query/edit/pattern-selection-modal.js.map +1 -1
- package/build/query/index.js +5 -12
- package/build/query/index.js.map +1 -1
- package/build/site-logo/edit.js +114 -16
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +1 -1
- package/build/social-link/icons/chain.js +1 -1
- package/build/social-link/icons/chain.js.map +1 -1
- package/build/social-link/icons/mail.js +1 -1
- package/build/social-link/icons/mail.js.map +1 -1
- package/build/spacer/controls.js +25 -6
- package/build/spacer/controls.js.map +1 -1
- package/build/spacer/edit.js +129 -13
- package/build/spacer/edit.js.map +1 -1
- package/build/spacer/save.js +2 -2
- package/build/spacer/save.js.map +1 -1
- package/build/table/state.js +35 -35
- package/build/table/state.js.map +1 -1
- package/build/template-part/edit/index.js +2 -1
- package/build/template-part/edit/index.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +2 -2
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/term-description/index.js +1 -2
- package/build/term-description/index.js.map +1 -1
- package/build/utils/migrate-font-family.js +12 -5
- package/build/utils/migrate-font-family.js.map +1 -1
- package/build/video/edit.native.js +4 -3
- package/build/video/edit.native.js.map +1 -1
- package/build-module/column/index.js +2 -1
- package/build-module/column/index.js.map +1 -1
- package/build-module/columns/edit.js +24 -6
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/index.js +2 -1
- package/build-module/columns/index.js.map +1 -1
- package/build-module/columns/utils.js +4 -8
- package/build-module/columns/utils.js.map +1 -1
- package/build-module/cover/edit/index.js +48 -52
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/{resizable-cover.js → resizable-cover-popover.js} +31 -6
- package/build-module/cover/edit/resizable-cover-popover.js.map +1 -0
- package/build-module/cover/index.js +12 -0
- package/build-module/cover/index.js.map +1 -1
- package/build-module/cover/transforms.js +5 -1
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/details/edit.js +52 -0
- package/build-module/details/edit.js.map +1 -0
- package/build-module/details/index.js +91 -0
- package/build-module/details/index.js.map +1 -0
- package/build-module/details/save.js +20 -0
- package/build-module/details/save.js.map +1 -0
- package/build-module/details-content/edit.js +23 -0
- package/build-module/details-content/edit.js.map +1 -0
- package/build-module/details-content/index.js +76 -0
- package/build-module/details-content/index.js.map +1 -0
- package/build-module/details-content/save.js +11 -0
- package/build-module/details-content/save.js.map +1 -0
- package/build-module/details-summary/edit.js +30 -0
- package/build-module/details-summary/edit.js.map +1 -0
- package/build-module/details-summary/index.js +79 -0
- package/build-module/details-summary/index.js.map +1 -0
- package/build-module/details-summary/save.js +16 -0
- package/build-module/details-summary/save.js.map +1 -0
- package/build-module/embed/deprecated.js +4 -1
- package/build-module/embed/deprecated.js.map +1 -1
- package/build-module/embed/embed-link-settings.native.js +1 -1
- package/build-module/embed/embed-link-settings.native.js.map +1 -1
- package/build-module/embed/embed-placeholder.js +1 -1
- package/build-module/embed/embed-placeholder.js.map +1 -1
- package/build-module/embed/index.js +4 -1
- package/build-module/embed/index.js.map +1 -1
- package/build-module/embed/transforms.js +4 -1
- package/build-module/embed/transforms.js.map +1 -1
- package/build-module/embed/util.js +4 -1
- package/build-module/embed/util.js.map +1 -1
- package/build-module/file/edit.native.js +0 -2
- package/build-module/file/edit.native.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +2 -1
- package/build-module/gallery/use-get-media.native.js.map +1 -1
- package/build-module/group/edit.js +3 -1
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +3 -0
- package/build-module/group/index.js.map +1 -1
- package/build-module/image/edit.js +16 -13
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/index.js +5 -3
- package/build-module/image/index.js.map +1 -1
- package/build-module/index.js +21 -6
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +9 -5
- package/build-module/index.native.js.map +1 -1
- package/build-module/media-text/edit.js +4 -2
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/media-text/index.js +3 -0
- package/build-module/media-text/index.js.map +1 -1
- package/build-module/media-text/media-container.js +1 -5
- package/build-module/media-text/media-container.js.map +1 -1
- package/build-module/media-text/media-container.native.js +1 -1
- package/build-module/media-text/media-container.native.js.map +1 -1
- package/build-module/navigation/deprecated.js +8 -10
- package/build-module/navigation/deprecated.js.map +1 -1
- package/build-module/navigation/edit/index.js +31 -63
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -14
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/post-author/index.js +0 -1
- package/build-module/post-author/index.js.map +1 -1
- package/build-module/post-date/edit.js +4 -2
- package/build-module/post-date/edit.js.map +1 -1
- package/build-module/post-excerpt/edit.js +2 -2
- package/build-module/post-excerpt/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +2 -1
- package/build-module/post-featured-image/dimension-controls.js.map +1 -1
- package/build-module/post-featured-image/edit.js +16 -27
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-time-to-read/edit.js +1 -1
- package/build-module/post-time-to-read/edit.js.map +1 -1
- package/build-module/post-time-to-read/index.js +7 -0
- package/build-module/post-time-to-read/index.js.map +1 -1
- package/build-module/query/deprecated.js +5 -2
- package/build-module/query/deprecated.js.map +1 -1
- package/build-module/query/edit/inspector-controls/create-new-post-link.js +33 -0
- package/build-module/query/edit/inspector-controls/create-new-post-link.js.map +1 -0
- package/build-module/query/edit/inspector-controls/index.js +12 -7
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/pattern-selection-modal.js +2 -1
- package/build-module/query/edit/pattern-selection-modal.js.map +1 -1
- package/build-module/query/index.js +5 -10
- package/build-module/query/index.js.map +1 -1
- package/build-module/site-logo/edit.js +115 -18
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +1 -1
- package/build-module/social-link/icons/chain.js +1 -1
- package/build-module/social-link/icons/chain.js.map +1 -1
- package/build-module/social-link/icons/mail.js +1 -1
- package/build-module/social-link/icons/mail.js.map +1 -1
- package/build-module/spacer/controls.js +27 -9
- package/build-module/spacer/controls.js.map +1 -1
- package/build-module/spacer/edit.js +129 -14
- package/build-module/spacer/edit.js.map +1 -1
- package/build-module/spacer/save.js +3 -3
- package/build-module/spacer/save.js.map +1 -1
- package/build-module/table/state.js +35 -33
- package/build-module/table/state.js.map +1 -1
- package/build-module/template-part/edit/index.js +2 -1
- package/build-module/template-part/edit/index.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +2 -2
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/term-description/index.js +1 -2
- package/build-module/term-description/index.js.map +1 -1
- package/build-module/utils/migrate-font-family.js +9 -1
- package/build-module/utils/migrate-font-family.js.map +1 -1
- package/build-module/video/edit.native.js +4 -3
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/columns/style-rtl.css +4 -1
- package/build-style/columns/style.css +4 -1
- package/build-style/common-rtl.css +1 -1
- package/build-style/common.css +1 -1
- package/build-style/cover/editor-rtl.css +9 -10
- package/build-style/cover/editor.css +9 -10
- package/build-style/cover/style-rtl.css +1 -1
- package/build-style/cover/style.css +1 -1
- package/build-style/details/style-rtl.css +91 -0
- package/build-style/details/style.css +91 -0
- package/build-style/details-summary/editor-rtl.css +91 -0
- package/build-style/details-summary/editor.css +91 -0
- package/build-style/details-summary/style-rtl.css +91 -0
- package/build-style/details-summary/style.css +91 -0
- package/build-style/editor-rtl.css +97 -74
- package/build-style/editor.css +97 -74
- package/build-style/file/style-rtl.css +4 -3
- package/build-style/file/style.css +4 -3
- package/build-style/html/editor-rtl.css +2 -2
- package/build-style/html/editor.css +2 -2
- package/build-style/image/editor-rtl.css +1 -1
- package/build-style/image/editor.css +1 -1
- package/build-style/post-excerpt/style-rtl.css +1 -1
- package/build-style/post-excerpt/style.css +1 -1
- package/build-style/pullquote/style-rtl.css +4 -1
- package/build-style/pullquote/style.css +4 -1
- package/build-style/query/editor-rtl.css +8 -12
- package/build-style/query/editor.css +8 -12
- package/build-style/search/style-rtl.css +2 -0
- package/build-style/search/style.css +2 -0
- package/build-style/shortcode/editor-rtl.css +15 -35
- package/build-style/shortcode/editor.css +15 -35
- package/build-style/site-logo/editor-rtl.css +46 -0
- package/build-style/site-logo/editor.css +46 -0
- package/build-style/spacer/editor-rtl.css +4 -2
- package/build-style/spacer/editor.css +4 -2
- package/build-style/style-rtl.css +25 -8
- package/build-style/style.css +25 -8
- package/build-style/template-part/editor-rtl.css +8 -12
- package/build-style/template-part/editor.css +8 -12
- package/package.json +31 -31
- package/src/buttons/test/__snapshots__/edit.native.js.snap +18 -0
- package/src/buttons/test/edit.native.js +123 -2
- package/src/column/block.json +2 -1
- package/src/columns/block.json +2 -1
- package/src/columns/edit.js +33 -9
- package/src/columns/style.scss +5 -1
- package/src/columns/utils.js +8 -9
- package/src/common.scss +1 -1
- package/src/cover/block.json +12 -0
- package/src/cover/edit/index.js +44 -37
- package/src/cover/edit/resizable-cover-popover.js +82 -0
- package/src/cover/editor.scss +20 -13
- package/src/cover/index.php +9 -10
- package/src/cover/style.scss +1 -1
- package/src/cover/test/edit.js +1 -1
- package/src/cover/transforms.js +4 -1
- package/src/details/block.json +54 -0
- package/src/details/edit.js +59 -0
- package/src/details/index.js +35 -0
- package/src/details/save.js +15 -0
- package/src/details/style.scss +3 -0
- package/src/details-content/block.json +50 -0
- package/src/details-content/edit.js +29 -0
- package/src/details-content/index.js +23 -0
- package/src/details-content/save.js +12 -0
- package/src/details-summary/block.json +53 -0
- package/src/details-summary/edit.js +27 -0
- package/src/details-summary/editor.scss +3 -0
- package/src/details-summary/index.js +23 -0
- package/src/details-summary/save.js +13 -0
- package/src/details-summary/style.scss +3 -0
- package/src/editor.scss +1 -0
- package/src/embed/block.json +4 -1
- package/src/embed/embed-link-settings.native.js +1 -1
- package/src/embed/embed-placeholder.js +1 -1
- package/src/file/edit.native.js +0 -2
- package/src/file/style.scss +5 -2
- package/src/gallery/test/index.native.js +4 -4
- package/src/gallery/test/use-get-media.native.js +24 -0
- package/src/gallery/use-get-media.native.js +1 -1
- package/src/group/block.json +3 -0
- package/src/group/edit.js +8 -2
- package/src/heading/test/__snapshots__/index.native.js.snap +12 -0
- package/src/heading/test/index.native.js +71 -0
- package/src/html/editor.scss +2 -21
- package/src/image/block.json +5 -3
- package/src/image/edit.js +21 -17
- package/src/image/editor.scss +1 -1
- package/src/index.js +13 -3
- package/src/index.native.js +9 -5
- package/src/list/test/edit.native.js +7 -7
- package/src/media-text/block.json +3 -0
- package/src/media-text/edit.js +2 -1
- package/src/media-text/media-container.js +1 -5
- package/src/media-text/media-container.native.js +1 -1
- package/src/navigation/deprecated.js +15 -19
- package/src/navigation/edit/index.js +32 -106
- package/src/navigation/edit/unsaved-inner-blocks.js +34 -46
- package/src/navigation/index.php +15 -12
- package/src/paragraph/test/edit.native.js +616 -1
- package/src/post-author/block.json +0 -1
- package/src/post-date/edit.js +4 -0
- package/src/post-date/index.php +17 -8
- package/src/post-excerpt/edit.js +1 -1
- package/src/post-excerpt/index.php +3 -3
- package/src/post-excerpt/style.scss +2 -1
- package/src/post-featured-image/dimension-controls.js +5 -1
- package/src/post-featured-image/edit.js +14 -34
- package/src/post-featured-image/index.php +1 -1
- package/src/post-time-to-read/block.json +7 -0
- package/src/post-time-to-read/edit.js +1 -1
- package/src/post-time-to-read/index.php +3 -3
- package/src/preformatted/test/__snapshots__/edit.native.js.snap +2 -2
- package/src/preformatted/test/edit.native.js +42 -2
- package/src/pullquote/style.scss +5 -1
- package/src/pullquote/test/edit.native.js +65 -0
- package/src/query/deprecated.js +4 -1
- package/src/query/edit/inspector-controls/create-new-post-link.js +26 -0
- package/src/query/edit/inspector-controls/index.js +13 -6
- package/src/query/edit/pattern-selection-modal.js +1 -0
- package/src/query/editor.scss +8 -11
- package/src/query/index.js +1 -7
- package/src/quote/test/edit.native.js +88 -0
- package/src/search/index.php +1 -1
- package/src/search/style.scss +3 -0
- package/src/shortcode/editor.scss +6 -5
- package/src/site-logo/block.json +1 -1
- package/src/site-logo/edit.js +123 -9
- package/src/site-logo/editor.scss +57 -0
- package/src/social-link/icons/chain.js +1 -1
- package/src/social-link/icons/mail.js +1 -1
- package/src/social-link/index.php +2 -2
- package/src/spacer/controls.js +42 -17
- package/src/spacer/edit.js +176 -18
- package/src/spacer/editor.scss +2 -1
- package/src/spacer/save.js +3 -3
- package/src/style.scss +2 -0
- package/src/table/state.js +83 -66
- package/src/template-part/edit/index.js +1 -0
- package/src/template-part/edit/utils/hooks.js +2 -2
- package/src/template-part/editor.scss +9 -11
- package/src/term-description/block.json +1 -2
- package/src/utils/migrate-font-family.js +8 -1
- package/src/verse/test/edit.native.js +28 -0
- package/src/video/edit.native.js +2 -2
- package/tsconfig.json +1 -0
- package/build/cover/edit/resizable-cover.js.map +0 -1
- package/build/media-text/media-container-icon.js +0 -27
- package/build/media-text/media-container-icon.js.map +0 -1
- package/build/query/hooks.js +0 -72
- package/build/query/hooks.js.map +0 -1
- package/build/utils/clean-empty-object.js +0 -34
- package/build/utils/clean-empty-object.js.map +0 -1
- package/build-module/cover/edit/resizable-cover.js.map +0 -1
- package/build-module/media-text/media-container-icon.js +0 -17
- package/build-module/media-text/media-container-icon.js.map +0 -1
- package/build-module/query/hooks.js +0 -59
- package/build-module/query/hooks.js.map +0 -1
- package/build-module/utils/clean-empty-object.js +0 -25
- package/build-module/utils/clean-empty-object.js.map +0 -1
- package/src/cover/edit/resizable-cover.js +0 -61
- package/src/media-text/media-container-icon.js +0 -12
- package/src/query/hooks.js +0 -53
- package/src/utils/clean-empty-object.js +0 -28
package/src/post-excerpt/edit.js
CHANGED
|
@@ -25,11 +25,11 @@ function render_block_core_post_excerpt( $attributes, $content, $block ) {
|
|
|
25
25
|
* wp_trim_words is used instead.
|
|
26
26
|
*/
|
|
27
27
|
$excerpt_length = $attributes['excerptLength'];
|
|
28
|
+
$excerpt = get_the_excerpt( $block->context['postId'] );
|
|
28
29
|
if ( isset( $excerpt_length ) ) {
|
|
29
|
-
$excerpt = wp_trim_words(
|
|
30
|
-
} else {
|
|
31
|
-
$excerpt = get_the_excerpt();
|
|
30
|
+
$excerpt = wp_trim_words( $excerpt, $excerpt_length );
|
|
32
31
|
}
|
|
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
34
|
$filter_excerpt_more = function( $more ) use ( $more_text ) {
|
|
35
35
|
return empty( $more_text ) ? $more : '';
|
|
@@ -70,6 +70,10 @@ const DimensionControls = ( {
|
|
|
70
70
|
} );
|
|
71
71
|
};
|
|
72
72
|
const scaleLabel = _x( 'Scale', 'Image scaling options' );
|
|
73
|
+
|
|
74
|
+
const showScaleControl =
|
|
75
|
+
height || ( aspectRatio && aspectRatio !== 'auto' );
|
|
76
|
+
|
|
73
77
|
return (
|
|
74
78
|
<InspectorControls group="dimensions">
|
|
75
79
|
<ToolsPanelItem
|
|
@@ -170,7 +174,7 @@ const DimensionControls = ( {
|
|
|
170
174
|
units={ units }
|
|
171
175
|
/>
|
|
172
176
|
</ToolsPanelItem>
|
|
173
|
-
{
|
|
177
|
+
{ showScaleControl && (
|
|
174
178
|
<ToolsPanelItem
|
|
175
179
|
hasValue={ () => !! scale && scale !== DEFAULT_SCALE }
|
|
176
180
|
label={ scaleLabel }
|
|
@@ -97,7 +97,7 @@ export default function PostFeaturedImageEdit( {
|
|
|
97
97
|
} ) );
|
|
98
98
|
|
|
99
99
|
const blockProps = useBlockProps( {
|
|
100
|
-
style: { width, height, aspectRatio },
|
|
100
|
+
style: { width, height, aspectRatio, maxWidth: '100%' },
|
|
101
101
|
} );
|
|
102
102
|
const borderProps = useBorderProps( attributes );
|
|
103
103
|
|
|
@@ -110,7 +110,8 @@ export default function PostFeaturedImageEdit( {
|
|
|
110
110
|
) }
|
|
111
111
|
withIllustration={ true }
|
|
112
112
|
style={ {
|
|
113
|
-
|
|
113
|
+
height: !! aspectRatio && '100%',
|
|
114
|
+
width: !! aspectRatio && '100%',
|
|
114
115
|
...borderProps.style,
|
|
115
116
|
} }
|
|
116
117
|
>
|
|
@@ -145,9 +146,9 @@ export default function PostFeaturedImageEdit( {
|
|
|
145
146
|
label={
|
|
146
147
|
postType?.labels.singular_name
|
|
147
148
|
? sprintf(
|
|
148
|
-
// translators: %s: Name of the post type e.g: "
|
|
149
|
+
// translators: %s: Name of the post type e.g: "Page".
|
|
149
150
|
__( 'Link to %s' ),
|
|
150
|
-
postType.labels.singular_name
|
|
151
|
+
postType.labels.singular_name
|
|
151
152
|
)
|
|
152
153
|
: __( 'Link to post' )
|
|
153
154
|
}
|
|
@@ -183,10 +184,15 @@ export default function PostFeaturedImageEdit( {
|
|
|
183
184
|
let image;
|
|
184
185
|
|
|
185
186
|
/**
|
|
186
|
-
* A
|
|
187
|
-
*
|
|
187
|
+
* A Post Featured Image block should not have image replacement
|
|
188
|
+
* or upload options in the following cases:
|
|
189
|
+
* - Is placed in a Query Loop. This is a consious decision to
|
|
190
|
+
* prevent content editing of different posts in Query Loop, and
|
|
191
|
+
* this could change in the future.
|
|
192
|
+
* - Is in a context where it does not have a postId (for example
|
|
193
|
+
* in a template or template part).
|
|
188
194
|
*/
|
|
189
|
-
if ( ! featuredImage && isDescendentOfQueryLoop ) {
|
|
195
|
+
if ( ! featuredImage && ( isDescendentOfQueryLoop || ! postId ) ) {
|
|
190
196
|
return (
|
|
191
197
|
<>
|
|
192
198
|
{ controls }
|
|
@@ -202,36 +208,10 @@ export default function PostFeaturedImageEdit( {
|
|
|
202
208
|
);
|
|
203
209
|
}
|
|
204
210
|
|
|
205
|
-
/**
|
|
206
|
-
* A post featured image placed in a block template, outside a query loop,
|
|
207
|
-
* does not have a postId and will always be a placeholder image.
|
|
208
|
-
* It does not have image replacement, upload, or link options.
|
|
209
|
-
*/
|
|
210
|
-
if ( ! featuredImage && ! postId ) {
|
|
211
|
-
return (
|
|
212
|
-
<>
|
|
213
|
-
<DimensionControls
|
|
214
|
-
clientId={ clientId }
|
|
215
|
-
attributes={ attributes }
|
|
216
|
-
setAttributes={ setAttributes }
|
|
217
|
-
imageSizeOptions={ imageSizeOptions }
|
|
218
|
-
/>
|
|
219
|
-
<div { ...blockProps }>
|
|
220
|
-
{ placeholder() }
|
|
221
|
-
<Overlay
|
|
222
|
-
attributes={ attributes }
|
|
223
|
-
setAttributes={ setAttributes }
|
|
224
|
-
clientId={ clientId }
|
|
225
|
-
/>
|
|
226
|
-
</div>
|
|
227
|
-
</>
|
|
228
|
-
);
|
|
229
|
-
}
|
|
230
|
-
|
|
231
211
|
const label = __( 'Add a featured image' );
|
|
232
212
|
const imageStyles = {
|
|
233
213
|
...borderProps.style,
|
|
234
|
-
height:
|
|
214
|
+
height: aspectRatio ? '100%' : height,
|
|
235
215
|
width: !! aspectRatio && '100%',
|
|
236
216
|
objectFit: !! ( height || aspectRatio ) && scale,
|
|
237
217
|
};
|
|
@@ -92,7 +92,7 @@ function render_block_core_post_featured_image( $attributes, $content, $block )
|
|
|
92
92
|
if ( ! $height && ! $width && ! $aspect_ratio ) {
|
|
93
93
|
$wrapper_attributes = get_block_wrapper_attributes();
|
|
94
94
|
} else {
|
|
95
|
-
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $aspect_ratio . $width . $height ) );
|
|
95
|
+
$wrapper_attributes = get_block_wrapper_attributes( array( 'style' => $aspect_ratio . $width . $height . 'max-width:100%;' ) );
|
|
96
96
|
}
|
|
97
97
|
return "<figure {$wrapper_attributes}>{$featured_image}</figure>";
|
|
98
98
|
}
|
|
@@ -32,8 +32,8 @@ function render_block_core_post_time_to_read( $attributes, $content, $block ) {
|
|
|
32
32
|
$minutes_to_read = max( 1, (int) round( wp_word_count( $content, $word_count_type ) / $average_reading_rate ) );
|
|
33
33
|
|
|
34
34
|
$minutes_to_read_string = sprintf(
|
|
35
|
-
/* translators: %
|
|
36
|
-
_n( '%
|
|
35
|
+
/* translators: %s is the number of minutes the post will take to read. */
|
|
36
|
+
_n( '%s minute', '%s minutes', $minutes_to_read ),
|
|
37
37
|
$minutes_to_read
|
|
38
38
|
);
|
|
39
39
|
|
|
@@ -42,7 +42,7 @@ function render_block_core_post_time_to_read( $attributes, $content, $block ) {
|
|
|
42
42
|
$wrapper_attributes = get_block_wrapper_attributes( array( 'class' => $align_class_name ) );
|
|
43
43
|
|
|
44
44
|
return sprintf(
|
|
45
|
-
'<
|
|
45
|
+
'<div %1$s>%2$s</div>',
|
|
46
46
|
$wrapper_attributes,
|
|
47
47
|
$minutes_to_read_string
|
|
48
48
|
);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
-
exports[`
|
|
3
|
+
exports[`Preformatted should match snapshot when content is empty 1`] = `
|
|
4
4
|
<View
|
|
5
5
|
style={
|
|
6
6
|
[
|
|
@@ -46,7 +46,7 @@ exports[`core/more/edit/native should match snapshot when content is empty 1`] =
|
|
|
46
46
|
</View>
|
|
47
47
|
`;
|
|
48
48
|
|
|
49
|
-
exports[`
|
|
49
|
+
exports[`Preformatted should match snapshot when content is not empty 1`] = `
|
|
50
50
|
<View
|
|
51
51
|
style={
|
|
52
52
|
[
|
|
@@ -1,14 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
addBlock,
|
|
6
|
+
typeInRichText,
|
|
7
|
+
fireEvent,
|
|
8
|
+
getEditorHtml,
|
|
9
|
+
initializeEditor,
|
|
10
|
+
render,
|
|
11
|
+
setupCoreBlocks,
|
|
12
|
+
} from 'test/helpers';
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* WordPress dependencies
|
|
16
|
+
*/
|
|
17
|
+
import { ENTER } from '@wordpress/keycodes';
|
|
5
18
|
|
|
6
19
|
/**
|
|
7
20
|
* Internal dependencies
|
|
8
21
|
*/
|
|
9
22
|
import PreformattedEdit from '../edit';
|
|
10
23
|
|
|
11
|
-
|
|
24
|
+
setupCoreBlocks();
|
|
25
|
+
|
|
26
|
+
describe( 'Preformatted', () => {
|
|
12
27
|
it( 'renders without crashing', () => {
|
|
13
28
|
const screen = render(
|
|
14
29
|
<PreformattedEdit
|
|
@@ -42,4 +57,29 @@ describe( 'core/more/edit/native', () => {
|
|
|
42
57
|
);
|
|
43
58
|
expect( screen.toJSON() ).toMatchSnapshot();
|
|
44
59
|
} );
|
|
60
|
+
|
|
61
|
+
it( 'should produce expected markup for multiline text', async () => {
|
|
62
|
+
// Arrange
|
|
63
|
+
const screen = await initializeEditor();
|
|
64
|
+
|
|
65
|
+
// Act
|
|
66
|
+
await addBlock( screen, 'Preformatted' );
|
|
67
|
+
const preformattedTextInput = await screen.findByPlaceholderText(
|
|
68
|
+
'Write preformatted text…'
|
|
69
|
+
);
|
|
70
|
+
typeInRichText( preformattedTextInput, 'A great statement.' );
|
|
71
|
+
fireEvent( preformattedTextInput, 'onKeyDown', {
|
|
72
|
+
nativeEvent: {},
|
|
73
|
+
preventDefault() {},
|
|
74
|
+
keyCode: ENTER,
|
|
75
|
+
} );
|
|
76
|
+
typeInRichText( preformattedTextInput, 'Again' );
|
|
77
|
+
|
|
78
|
+
// Assert
|
|
79
|
+
expect( getEditorHtml() ).toMatchInlineSnapshot( `
|
|
80
|
+
"<!-- wp:preformatted -->
|
|
81
|
+
<pre class="wp-block-preformatted">A great statement.<br>Again</pre>
|
|
82
|
+
<!-- /wp:preformatted -->"
|
|
83
|
+
` );
|
|
84
|
+
} );
|
|
45
85
|
} );
|
package/src/pullquote/style.scss
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
.wp-block-pullquote {
|
|
2
|
-
margin: 0 0 1em 0;
|
|
3
2
|
padding: 3em 0;
|
|
4
3
|
text-align: center; // Default text-alignment where the `textAlign` attribute value isn't specified.
|
|
5
4
|
overflow-wrap: break-word; // Break long strings of text without spaces so they don't overflow the block.
|
|
@@ -25,6 +24,11 @@
|
|
|
25
24
|
}
|
|
26
25
|
}
|
|
27
26
|
|
|
27
|
+
// Lowest specificity to avoid overriding layout styles.
|
|
28
|
+
:where(.wp-block-pullquote) {
|
|
29
|
+
margin: 0 0 1em 0;
|
|
30
|
+
}
|
|
31
|
+
|
|
28
32
|
// Ensure that we are reasonably specific to override theme defaults.
|
|
29
33
|
.wp-block-pullquote.has-text-align-left blockquote {
|
|
30
34
|
text-align: left;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
addBlock,
|
|
6
|
+
getBlock,
|
|
7
|
+
initializeEditor,
|
|
8
|
+
setupCoreBlocks,
|
|
9
|
+
getEditorHtml,
|
|
10
|
+
fireEvent,
|
|
11
|
+
within,
|
|
12
|
+
waitFor,
|
|
13
|
+
typeInRichText,
|
|
14
|
+
} from 'test/helpers';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
import { ENTER } from '@wordpress/keycodes';
|
|
20
|
+
|
|
21
|
+
setupCoreBlocks();
|
|
22
|
+
|
|
23
|
+
describe( 'Pullquote', () => {
|
|
24
|
+
it( 'should produce expected markup for multiline text', async () => {
|
|
25
|
+
// Arrange
|
|
26
|
+
const screen = await initializeEditor();
|
|
27
|
+
await addBlock( screen, 'Pullquote' );
|
|
28
|
+
// Await inner blocks to be rendered
|
|
29
|
+
const citationBlock = await waitFor( () =>
|
|
30
|
+
screen.getByPlaceholderText( 'Add citation' )
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
// Act
|
|
34
|
+
const pullquoteBlock = getBlock( screen, 'Pullquote' );
|
|
35
|
+
fireEvent.press( pullquoteBlock );
|
|
36
|
+
const pullquoteTextInput =
|
|
37
|
+
within( pullquoteBlock ).getByPlaceholderText( 'Add quote' );
|
|
38
|
+
typeInRichText( pullquoteTextInput, 'A great statement.' );
|
|
39
|
+
fireEvent( pullquoteTextInput, 'onKeyDown', {
|
|
40
|
+
nativeEvent: {},
|
|
41
|
+
preventDefault() {},
|
|
42
|
+
keyCode: ENTER,
|
|
43
|
+
} );
|
|
44
|
+
typeInRichText( pullquoteTextInput, 'Again' );
|
|
45
|
+
|
|
46
|
+
const citationTextInput =
|
|
47
|
+
within( citationBlock ).getByPlaceholderText( 'Add citation' );
|
|
48
|
+
typeInRichText( citationTextInput, 'A person', {
|
|
49
|
+
finalSelectionStart: 2,
|
|
50
|
+
finalSelectionEnd: 2,
|
|
51
|
+
} );
|
|
52
|
+
fireEvent( citationTextInput, 'onKeyDown', {
|
|
53
|
+
nativeEvent: {},
|
|
54
|
+
preventDefault() {},
|
|
55
|
+
keyCode: ENTER,
|
|
56
|
+
} );
|
|
57
|
+
|
|
58
|
+
// Assert
|
|
59
|
+
expect( getEditorHtml() ).toMatchInlineSnapshot( `
|
|
60
|
+
"<!-- wp:pullquote -->
|
|
61
|
+
<figure class="wp-block-pullquote"><blockquote><p>A great statement.<br>Again</p><cite>A <br>person</cite></blockquote></figure>
|
|
62
|
+
<!-- /wp:pullquote -->"
|
|
63
|
+
` );
|
|
64
|
+
} );
|
|
65
|
+
} );
|
package/src/query/deprecated.js
CHANGED
|
@@ -6,12 +6,15 @@ import {
|
|
|
6
6
|
InnerBlocks,
|
|
7
7
|
useInnerBlocksProps,
|
|
8
8
|
useBlockProps,
|
|
9
|
+
privateApis as blockEditorPrivateApis,
|
|
9
10
|
} from '@wordpress/block-editor';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Internal dependencies
|
|
13
14
|
*/
|
|
14
|
-
import
|
|
15
|
+
import { unlock } from '../private-apis';
|
|
16
|
+
|
|
17
|
+
const { cleanEmptyObject } = unlock( blockEditorPrivateApis );
|
|
15
18
|
|
|
16
19
|
const migrateToTaxQuery = ( attributes ) => {
|
|
17
20
|
const { query } = attributes;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
import { createInterpolateElement } from '@wordpress/element';
|
|
6
|
+
import { addQueryArgs } from '@wordpress/url';
|
|
7
|
+
|
|
8
|
+
const CreateNewPostLink = ( {
|
|
9
|
+
attributes: { query: { postType } = {} } = {},
|
|
10
|
+
} ) => {
|
|
11
|
+
if ( ! postType ) return null;
|
|
12
|
+
const newPostUrl = addQueryArgs( 'post-new.php', {
|
|
13
|
+
post_type: postType,
|
|
14
|
+
} );
|
|
15
|
+
return (
|
|
16
|
+
<div className="wp-block-query__create-new-link">
|
|
17
|
+
{ createInterpolateElement(
|
|
18
|
+
__( '<a>Add new post</a>' ),
|
|
19
|
+
// eslint-disable-next-line jsx-a11y/anchor-has-content
|
|
20
|
+
{ a: <a href={ newPostUrl } /> }
|
|
21
|
+
) }
|
|
22
|
+
</div>
|
|
23
|
+
);
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default CreateNewPostLink;
|
|
@@ -12,7 +12,10 @@ import {
|
|
|
12
12
|
__experimentalToolsPanelItem as ToolsPanelItem,
|
|
13
13
|
} from '@wordpress/components';
|
|
14
14
|
import { __ } from '@wordpress/i18n';
|
|
15
|
-
import {
|
|
15
|
+
import {
|
|
16
|
+
InspectorControls,
|
|
17
|
+
privateApis as blockEditorPrivateApis,
|
|
18
|
+
} from '@wordpress/block-editor';
|
|
16
19
|
import { debounce } from '@wordpress/compose';
|
|
17
20
|
import { useEffect, useState, useCallback } from '@wordpress/element';
|
|
18
21
|
|
|
@@ -24,6 +27,8 @@ import AuthorControl from './author-control';
|
|
|
24
27
|
import ParentControl from './parent-control';
|
|
25
28
|
import { TaxonomyControls } from './taxonomy-controls';
|
|
26
29
|
import StickyControl from './sticky-control';
|
|
30
|
+
import CreateNewPostLink from './create-new-post-link';
|
|
31
|
+
import { unlock } from '../../../private-apis';
|
|
27
32
|
import {
|
|
28
33
|
usePostTypes,
|
|
29
34
|
useIsPostTypeHierarchical,
|
|
@@ -32,11 +37,10 @@ import {
|
|
|
32
37
|
useTaxonomies,
|
|
33
38
|
} from '../../utils';
|
|
34
39
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
setDisplayLayout
|
|
39
|
-
} ) {
|
|
40
|
+
const { BlockInfo } = unlock( blockEditorPrivateApis );
|
|
41
|
+
|
|
42
|
+
export default function QueryInspectorControls( props ) {
|
|
43
|
+
const { attributes, setQuery, setDisplayLayout } = props;
|
|
40
44
|
const { query, displayLayout } = attributes;
|
|
41
45
|
const {
|
|
42
46
|
order,
|
|
@@ -127,6 +131,9 @@ export default function QueryInspectorControls( {
|
|
|
127
131
|
|
|
128
132
|
return (
|
|
129
133
|
<>
|
|
134
|
+
<BlockInfo>
|
|
135
|
+
<CreateNewPostLink { ...props } />
|
|
136
|
+
</BlockInfo>
|
|
130
137
|
{ showSettingsPanel && (
|
|
131
138
|
<InspectorControls>
|
|
132
139
|
<PanelBody title={ __( 'Settings' ) }>
|
|
@@ -62,6 +62,7 @@ export default function PatternSelectionModal( {
|
|
|
62
62
|
overlayClassName="block-library-query-pattern__selection-modal"
|
|
63
63
|
title={ __( 'Choose a pattern' ) }
|
|
64
64
|
onRequestClose={ () => setIsPatternSelectionModalOpen( false ) }
|
|
65
|
+
isFullScreen={ true }
|
|
65
66
|
>
|
|
66
67
|
<div className="block-library-query-pattern__selection-content">
|
|
67
68
|
<div className="block-library-query-pattern__selection-search">
|
package/src/query/editor.scss
CHANGED
|
@@ -20,20 +20,17 @@
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
.block-library-query-pattern__selection-modal {
|
|
23
|
-
// To keep modal dimensions consistent as subsections are navigated, width
|
|
24
|
-
// and height are used instead of max-(width/height).
|
|
25
|
-
.components-modal__frame {
|
|
26
|
-
@include break-small() {
|
|
27
|
-
width: calc(100% - #{$grid-unit-20 * 2});
|
|
28
|
-
height: calc(100% - #{$header-height * 2});
|
|
29
|
-
}
|
|
30
23
|
|
|
31
|
-
|
|
32
|
-
|
|
24
|
+
.block-editor-block-patterns-list {
|
|
25
|
+
column-count: 2;
|
|
26
|
+
column-gap: $grid-unit-30;
|
|
27
|
+
|
|
28
|
+
@include break-wide() {
|
|
29
|
+
column-count: 3;
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
|
|
36
|
-
|
|
32
|
+
.block-editor-block-patterns-list__list-item {
|
|
33
|
+
break-inside: avoid-column;
|
|
37
34
|
}
|
|
38
35
|
}
|
|
39
36
|
|
package/src/query/index.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { loop as icon } from '@wordpress/icons';
|
|
5
|
-
import { addFilter } from '@wordpress/hooks';
|
|
6
5
|
|
|
7
6
|
/**
|
|
8
7
|
* Internal dependencies
|
|
@@ -13,7 +12,6 @@ import edit from './edit';
|
|
|
13
12
|
import save from './save';
|
|
14
13
|
import variations from './variations';
|
|
15
14
|
import deprecated from './deprecated';
|
|
16
|
-
import queryInspectorControls from './hooks';
|
|
17
15
|
|
|
18
16
|
const { name } = metadata;
|
|
19
17
|
export { metadata, name };
|
|
@@ -26,8 +24,4 @@ export const settings = {
|
|
|
26
24
|
deprecated,
|
|
27
25
|
};
|
|
28
26
|
|
|
29
|
-
export const init = () => {
|
|
30
|
-
addFilter( 'editor.BlockEdit', 'core/query', queryInspectorControls );
|
|
31
|
-
|
|
32
|
-
return initBlock( { name, metadata, settings } );
|
|
33
|
-
};
|
|
27
|
+
export const init = () => initBlock( { name, metadata, settings } );
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
addBlock,
|
|
6
|
+
getBlock,
|
|
7
|
+
initializeEditor,
|
|
8
|
+
setupCoreBlocks,
|
|
9
|
+
getEditorHtml,
|
|
10
|
+
fireEvent,
|
|
11
|
+
within,
|
|
12
|
+
waitFor,
|
|
13
|
+
typeInRichText,
|
|
14
|
+
} from 'test/helpers';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* WordPress dependencies
|
|
18
|
+
*/
|
|
19
|
+
import { ENTER } from '@wordpress/keycodes';
|
|
20
|
+
|
|
21
|
+
setupCoreBlocks();
|
|
22
|
+
|
|
23
|
+
describe( 'Quote', () => {
|
|
24
|
+
it( 'should produce expected markup for multiline text', async () => {
|
|
25
|
+
// Arrange
|
|
26
|
+
const screen = await initializeEditor();
|
|
27
|
+
await addBlock( screen, 'Quote' );
|
|
28
|
+
const quoteBlock = getBlock( screen, 'Quote' );
|
|
29
|
+
// A layout event must be explicitly dispatched in BlockList component,
|
|
30
|
+
// otherwise the inner blocks are not rendered.
|
|
31
|
+
fireEvent(
|
|
32
|
+
within( quoteBlock ).getByTestId( 'block-list-wrapper' ),
|
|
33
|
+
'layout',
|
|
34
|
+
{
|
|
35
|
+
nativeEvent: {
|
|
36
|
+
layout: {
|
|
37
|
+
width: 320,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
// Await inner blocks to be rendered
|
|
43
|
+
const citationBlock = await waitFor( () =>
|
|
44
|
+
screen.getByPlaceholderText( 'Add citation' )
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
// Act
|
|
48
|
+
fireEvent.press( quoteBlock );
|
|
49
|
+
// screen.debug();
|
|
50
|
+
let quoteTextInput =
|
|
51
|
+
within( quoteBlock ).getByPlaceholderText( 'Start writing…' );
|
|
52
|
+
typeInRichText( quoteTextInput, 'A great statement.' );
|
|
53
|
+
fireEvent( quoteTextInput, 'onKeyDown', {
|
|
54
|
+
nativeEvent: {},
|
|
55
|
+
preventDefault() {},
|
|
56
|
+
keyCode: ENTER,
|
|
57
|
+
} );
|
|
58
|
+
quoteTextInput =
|
|
59
|
+
within( quoteBlock ).getAllByPlaceholderText(
|
|
60
|
+
'Start writing…'
|
|
61
|
+
)[ 1 ];
|
|
62
|
+
typeInRichText( quoteTextInput, 'Again.' );
|
|
63
|
+
const citationTextInput =
|
|
64
|
+
within( citationBlock ).getByPlaceholderText( 'Add citation' );
|
|
65
|
+
typeInRichText( citationTextInput, 'A person', {
|
|
66
|
+
finalSelectionStart: 2,
|
|
67
|
+
finalSelectionEnd: 2,
|
|
68
|
+
} );
|
|
69
|
+
fireEvent( citationTextInput, 'onKeyDown', {
|
|
70
|
+
nativeEvent: {},
|
|
71
|
+
preventDefault() {},
|
|
72
|
+
keyCode: ENTER,
|
|
73
|
+
} );
|
|
74
|
+
|
|
75
|
+
// Assert
|
|
76
|
+
expect( getEditorHtml() ).toMatchInlineSnapshot( `
|
|
77
|
+
"<!-- wp:quote -->
|
|
78
|
+
<blockquote class="wp-block-quote"><!-- wp:paragraph -->
|
|
79
|
+
<p>A great statement.</p>
|
|
80
|
+
<!-- /wp:paragraph -->
|
|
81
|
+
|
|
82
|
+
<!-- wp:paragraph -->
|
|
83
|
+
<p>Again.</p>
|
|
84
|
+
<!-- /wp:paragraph --><cite>A <br>person</cite></blockquote>
|
|
85
|
+
<!-- /wp:quote -->"
|
|
86
|
+
` );
|
|
87
|
+
} );
|
|
88
|
+
} );
|
package/src/search/index.php
CHANGED
|
@@ -116,7 +116,7 @@ function render_block_core_search( $attributes ) {
|
|
|
116
116
|
|
|
117
117
|
$button_internal_markup =
|
|
118
118
|
'<svg class="search-icon" viewBox="0 0 24 24" width="24" height="24">
|
|
119
|
-
<path d="M13
|
|
119
|
+
<path d="M13 5c-3.3 0-6 2.7-6 6 0 1.4.5 2.7 1.3 3.7l-3.8 3.8 1.1 1.1 3.8-3.8c1 .8 2.3 1.3 3.7 1.3 3.3 0 6-2.7 6-6S16.3 5 13 5zm0 10.5c-2.5 0-4.5-2-4.5-4.5s2-4.5 4.5-4.5 4.5 2 4.5 4.5-2 4.5-4.5 4.5z"></path>
|
|
120
120
|
</svg>';
|
|
121
121
|
}
|
|
122
122
|
|
package/src/search/style.scss
CHANGED
|
@@ -45,6 +45,9 @@ $button-spacing-y: math.div($grid-unit-15, 2); // 6px
|
|
|
45
45
|
// !important used to forcibly prevent undesired application of
|
|
46
46
|
// text-decoration styles on the input field.
|
|
47
47
|
text-decoration: unset !important;
|
|
48
|
+
|
|
49
|
+
// Hides a redundant extra search icon on Mobile Safari.
|
|
50
|
+
appearance: initial;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
.wp-block-search.wp-block-search__button-only {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
[data-type="core/shortcode"] {
|
|
2
|
-
.block-editor-plain-text {
|
|
3
|
-
max-height: 250px;
|
|
4
|
-
}
|
|
5
|
-
|
|
6
2
|
&.components-placeholder {
|
|
7
3
|
min-height: 0;
|
|
8
4
|
}
|
|
9
5
|
}
|
|
10
6
|
|
|
7
|
+
// The editing view for the Shortcode block is equivalent to block UI.
|
|
8
|
+
// Therefore we increase specificity to avoid theme styles bleeding in.
|
|
11
9
|
.blocks-shortcode__textarea {
|
|
12
|
-
|
|
10
|
+
box-sizing: border-box;
|
|
11
|
+
max-height: 250px;
|
|
12
|
+
resize: none;
|
|
13
|
+
@include editor-input-reset();
|
|
13
14
|
}
|
package/src/site-logo/block.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/site-logo",
|
|
5
5
|
"title": "Site Logo",
|
|
6
6
|
"category": "theme",
|
|
7
|
-
"description": "Display
|
|
7
|
+
"description": "Display an image to represent this site. Update this block and the changes apply everywhere.",
|
|
8
8
|
"textdomain": "default",
|
|
9
9
|
"attributes": {
|
|
10
10
|
"width": {
|