@wordpress/block-library 8.8.0 → 8.10.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/comment-author-name/edit.js +1 -1
- package/build/comment-author-name/edit.js.map +1 -1
- package/build/comment-edit-link/edit.js +1 -1
- package/build/comment-edit-link/edit.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +1 -1
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/index.js +1 -1
- package/build/cover/transforms.js +10 -7
- package/build/cover/transforms.js.map +1 -1
- package/build/cover/variations.js +1 -1
- package/build/cover/variations.js.map +1 -1
- package/build/details/edit.js +19 -5
- package/build/details/edit.js.map +1 -1
- package/build/details/index.js +14 -10
- package/build/details/index.js.map +1 -1
- package/build/details/save.js +4 -1
- package/build/details/save.js.map +1 -1
- package/build/embed/variations.js +2 -2
- package/build/embed/variations.js.map +1 -1
- package/build/file/view.js +1 -1
- package/build/file/view.js.map +1 -1
- package/build/gallery/edit.js +2 -8
- package/build/gallery/edit.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 +1 -1
- package/build/index.js +0 -6
- package/build/index.js.map +1 -1
- package/build/index.native.js +10 -6
- package/build/index.native.js.map +1 -1
- package/build/list-item/utils.js +5 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/loginout/index.js +11 -1
- package/build/loginout/index.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/navigation/constants.js +13 -0
- package/build/navigation/constants.js.map +1 -0
- package/build/navigation/edit/index.js +26 -68
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/inner-blocks.js +4 -7
- package/build/navigation/edit/inner-blocks.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +4 -6
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
- package/build/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build/navigation/interactivity.js +139 -0
- package/build/navigation/interactivity.js.map +1 -0
- package/build/navigation-link/edit.js +1 -1
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +1 -1
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/paragraph/index.js +5 -1
- package/build/paragraph/index.js.map +1 -1
- package/build/paragraph/transforms.js +5 -1
- package/build/paragraph/transforms.js.map +1 -1
- package/build/post-author-name/edit.js +1 -1
- package/build/post-author-name/edit.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/edit.js +6 -4
- package/build/post-featured-image/edit.js.map +1 -1
- package/build/post-featured-image/overlay.js +5 -0
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-title/edit.js +14 -4
- package/build/post-title/edit.js.map +1 -1
- package/build/preformatted/edit.native.js +3 -2
- package/build/preformatted/edit.native.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/quote/transforms.js +16 -27
- package/build/quote/transforms.js.map +1 -1
- package/build/read-more/edit.js +1 -1
- package/build/read-more/edit.js.map +1 -1
- package/build/search/edit.js +9 -1
- package/build/search/edit.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/site-title/edit/index.js +1 -1
- package/build/site-title/edit/index.js.map +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/social-links/edit.js +2 -2
- package/build/social-links/edit.js.map +1 -1
- package/build/spacer/edit.js +117 -11
- package/build/spacer/edit.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/utils/interactivity/constants.js +9 -0
- package/build/utils/interactivity/constants.js.map +1 -0
- package/build/utils/interactivity/directives.js +208 -0
- package/build/utils/interactivity/directives.js.map +1 -0
- package/build/utils/interactivity/hooks.js +112 -0
- package/build/utils/interactivity/hooks.js.map +1 -0
- package/build/utils/interactivity/hydration.js +34 -0
- package/build/utils/interactivity/hydration.js.map +1 -0
- package/build/utils/interactivity/index.js +34 -0
- package/build/utils/interactivity/index.js.map +1 -0
- package/build/utils/interactivity/store.js +67 -0
- package/build/utils/interactivity/store.js.map +1 -0
- package/build/utils/interactivity/utils.js +87 -0
- package/build/utils/interactivity/utils.js.map +1 -0
- package/build/utils/interactivity/vdom.js +109 -0
- package/build/utils/interactivity/vdom.js.map +1 -0
- 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/comment-author-name/edit.js +1 -1
- package/build-module/comment-author-name/edit.js.map +1 -1
- package/build-module/comment-edit-link/edit.js +1 -1
- package/build-module/comment-edit-link/edit.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +1 -1
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/index.js +1 -1
- package/build-module/cover/transforms.js +5 -1
- package/build-module/cover/transforms.js.map +1 -1
- package/build-module/cover/variations.js +1 -1
- package/build-module/cover/variations.js.map +1 -1
- package/build-module/details/edit.js +20 -6
- package/build-module/details/edit.js.map +1 -1
- package/build-module/details/index.js +14 -10
- package/build-module/details/index.js.map +1 -1
- package/build-module/details/save.js +5 -2
- package/build-module/details/save.js.map +1 -1
- package/build-module/embed/variations.js +2 -2
- package/build-module/embed/variations.js.map +1 -1
- package/build-module/file/view.js +1 -1
- package/build-module/file/view.js.map +1 -1
- package/build-module/gallery/edit.js +2 -8
- package/build-module/gallery/edit.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 +1 -1
- package/build-module/index.js +0 -4
- package/build-module/index.js.map +1 -1
- package/build-module/index.native.js +10 -6
- package/build-module/index.native.js.map +1 -1
- package/build-module/list-item/utils.js +5 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/loginout/index.js +11 -1
- package/build-module/loginout/index.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/navigation/constants.js +5 -0
- package/build-module/navigation/constants.js.map +1 -0
- package/build-module/navigation/edit/index.js +28 -69
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/inner-blocks.js +1 -4
- package/build-module/navigation/edit/inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +1 -4
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
- package/build-module/navigation/edit/use-convert-classic-menu-to-block-menu.js.map +1 -1
- package/build-module/navigation/interactivity.js +136 -0
- package/build-module/navigation/interactivity.js.map +1 -0
- package/build-module/navigation-link/edit.js +1 -1
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +1 -1
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/paragraph/index.js +5 -1
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/paragraph/transforms.js +5 -1
- package/build-module/paragraph/transforms.js.map +1 -1
- package/build-module/post-author-name/edit.js +1 -1
- package/build-module/post-author-name/edit.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/edit.js +6 -4
- package/build-module/post-featured-image/edit.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +5 -0
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-title/edit.js +13 -4
- package/build-module/post-title/edit.js.map +1 -1
- package/build-module/preformatted/edit.native.js +3 -2
- package/build-module/preformatted/edit.native.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/quote/transforms.js +16 -27
- package/build-module/quote/transforms.js.map +1 -1
- package/build-module/read-more/edit.js +1 -1
- package/build-module/read-more/edit.js.map +1 -1
- package/build-module/search/edit.js +9 -1
- package/build-module/search/edit.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/site-title/edit/index.js +1 -1
- package/build-module/site-title/edit/index.js.map +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/social-links/edit.js +2 -2
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/spacer/edit.js +118 -12
- package/build-module/spacer/edit.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/utils/interactivity/constants.js +2 -0
- package/build-module/utils/interactivity/constants.js.map +1 -0
- package/build-module/utils/interactivity/directives.js +193 -0
- package/build-module/utils/interactivity/directives.js.map +1 -0
- package/build-module/utils/interactivity/hooks.js +98 -0
- package/build-module/utils/interactivity/hooks.js.map +1 -0
- package/build-module/utils/interactivity/hydration.js +21 -0
- package/build-module/utils/interactivity/hydration.js.map +1 -0
- package/build-module/utils/interactivity/index.js +17 -0
- package/build-module/utils/interactivity/index.js.map +1 -0
- package/build-module/utils/interactivity/store.js +56 -0
- package/build-module/utils/interactivity/store.js.map +1 -0
- package/build-module/utils/interactivity/utils.js +75 -0
- package/build-module/utils/interactivity/utils.js.map +1 -0
- package/build-module/utils/interactivity/vdom.js +97 -0
- package/build-module/utils/interactivity/vdom.js.map +1 -0
- 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/cover/editor-rtl.css +3 -3
- package/build-style/cover/editor.css +3 -3
- package/build-style/cover/style-rtl.css +2 -1
- package/build-style/cover/style.css +2 -1
- package/build-style/{details-summary → details}/editor-rtl.css +1 -1
- package/build-style/{details-summary → details}/editor.css +1 -1
- package/build-style/details/style-rtl.css +14 -0
- package/build-style/details/style.css +14 -0
- package/build-style/editor-rtl.css +74 -39
- package/build-style/editor.css +74 -39
- package/build-style/gallery/editor-rtl.css +0 -4
- package/build-style/gallery/editor.css +0 -4
- 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/query/editor-rtl.css +8 -12
- package/build-style/query/editor.css +8 -12
- package/build-style/search/editor-rtl.css +1 -0
- package/build-style/search/editor.css +1 -0
- package/build-style/search/style-rtl.css +2 -0
- package/build-style/search/style.css +2 -0
- package/build-style/shortcode/editor-rtl.css +3 -4
- package/build-style/shortcode/editor.css +3 -4
- package/build-style/site-logo/editor-rtl.css +47 -0
- package/build-style/site-logo/editor.css +47 -0
- package/build-style/style-rtl.css +15 -2
- package/build-style/style.css +15 -2
- package/build-style/template-part/editor-rtl.css +8 -12
- package/build-style/template-part/editor.css +8 -12
- package/package.json +36 -32
- package/src/buttons/test/__snapshots__/edit.native.js.snap +18 -0
- package/src/buttons/test/edit.native.js +123 -2
- package/src/comment-author-name/edit.js +1 -1
- package/src/comment-edit-link/edit.js +1 -1
- package/src/comment-template/index.php +8 -7
- package/src/cover/block.json +1 -1
- package/src/cover/edit/inspector-controls.js +56 -54
- package/src/cover/editor.scss +1 -1
- package/src/cover/style.scss +4 -0
- package/src/cover/test/edit.js +56 -2
- package/src/cover/transforms.js +4 -1
- package/src/cover/variations.js +1 -3
- package/src/details/block.json +8 -6
- package/src/details/edit.js +27 -5
- package/src/details/editor.scss +3 -0
- package/src/details/index.js +10 -5
- package/src/details/save.js +5 -1
- package/src/details/style.scss +16 -0
- package/src/editor.scss +1 -1
- package/src/embed/variations.js +2 -2
- package/src/file/view.js +4 -1
- package/src/gallery/edit.js +5 -8
- package/src/gallery/editor.scss +0 -6
- package/src/gallery/test/index.native.js +52 -7
- 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 +1 -1
- package/src/image/edit.js +21 -17
- package/src/image/editor.scss +1 -1
- package/src/image/test/edit.native.js +38 -16
- package/src/index.js +0 -4
- package/src/index.native.js +10 -5
- package/src/list/test/edit.native.js +7 -7
- package/src/loginout/block.json +11 -1
- package/src/media-text/block.json +3 -0
- package/src/media-text/edit.js +2 -1
- package/src/navigation/constants.js +16 -0
- package/src/navigation/edit/index.js +77 -163
- package/src/navigation/edit/inner-blocks.js +1 -16
- package/src/navigation/edit/unsaved-inner-blocks.js +1 -16
- package/src/navigation/edit/use-convert-classic-menu-to-block-menu.js +1 -1
- package/src/navigation/index.php +210 -197
- package/src/navigation/interactivity.js +144 -0
- package/src/navigation-link/edit.js +1 -1
- package/src/navigation-submenu/edit.js +1 -1
- package/src/paragraph/block.json +5 -1
- package/src/paragraph/test/edit.native.js +288 -28
- package/src/post-author-name/edit.js +1 -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-featured-image/edit.js +5 -4
- package/src/post-featured-image/overlay.js +4 -0
- package/src/post-terms/index.php +2 -2
- package/src/post-title/edit.js +8 -1
- package/src/preformatted/edit.native.js +1 -3
- package/src/preformatted/test/edit.native.js +6 -9
- package/src/pullquote/test/edit.native.js +7 -12
- 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 +6 -10
- package/src/quote/transforms.js +0 -6
- package/src/read-more/edit.js +1 -1
- package/src/search/edit.js +9 -4
- package/src/search/editor.scss +1 -0
- package/src/search/style.scss +3 -0
- package/src/shortcode/editor.scss +1 -21
- package/src/site-logo/block.json +1 -1
- package/src/site-logo/edit.js +123 -9
- package/src/site-logo/editor.scss +58 -0
- package/src/site-title/edit/index.js +1 -1
- 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/social-links/edit.js +33 -31
- package/src/spacer/edit.js +157 -18
- package/src/style.scss +0 -1
- 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/template-part/index.php +20 -5
- package/src/utils/interactivity/constants.js +1 -0
- package/src/utils/interactivity/directives.js +179 -0
- package/src/utils/interactivity/hooks.js +76 -0
- package/src/utils/interactivity/hydration.js +22 -0
- package/src/utils/interactivity/index.js +17 -0
- package/src/utils/interactivity/store.js +45 -0
- package/src/utils/interactivity/utils.js +66 -0
- package/src/utils/interactivity/vdom.js +94 -0
- package/src/utils/migrate-font-family.js +8 -1
- package/src/verse/test/edit.native.js +4 -9
- package/src/video/edit.native.js +2 -2
- package/tsconfig.json +2 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/build/details-content/edit.js +0 -34
- package/build/details-content/edit.js.map +0 -1
- package/build/details-content/index.js +0 -94
- package/build/details-content/index.js.map +0 -1
- package/build/details-content/save.js +0 -20
- package/build/details-content/save.js.map +0 -1
- package/build/details-summary/edit.js +0 -42
- package/build/details-summary/edit.js.map +0 -1
- package/build/details-summary/index.js +0 -97
- package/build/details-summary/index.js.map +0 -1
- package/build/details-summary/save.js +0 -24
- package/build/details-summary/save.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 -37
- package/build/utils/clean-empty-object.js.map +0 -1
- package/build-module/details-content/edit.js +0 -23
- package/build-module/details-content/edit.js.map +0 -1
- package/build-module/details-content/index.js +0 -76
- package/build-module/details-content/index.js.map +0 -1
- package/build-module/details-content/save.js +0 -11
- package/build-module/details-content/save.js.map +0 -1
- package/build-module/details-summary/edit.js +0 -30
- package/build-module/details-summary/edit.js.map +0 -1
- package/build-module/details-summary/index.js +0 -79
- package/build-module/details-summary/index.js.map +0 -1
- package/build-module/details-summary/save.js +0 -16
- package/build-module/details-summary/save.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 -28
- package/build-module/utils/clean-empty-object.js.map +0 -1
- package/build-style/details-summary/style-rtl.css +0 -91
- package/build-style/details-summary/style.css +0 -91
- package/src/details-content/block.json +0 -50
- package/src/details-content/edit.js +0 -29
- package/src/details-content/index.js +0 -23
- package/src/details-content/save.js +0 -12
- package/src/details-summary/block.json +0 -53
- package/src/details-summary/edit.js +0 -27
- package/src/details-summary/editor.scss +0 -3
- package/src/details-summary/index.js +0 -23
- package/src/details-summary/save.js +0 -13
- package/src/details-summary/style.scss +0 -3
- package/src/query/hooks.js +0 -53
- package/src/utils/clean-empty-object.js +0 -28
|
@@ -89,21 +89,17 @@
|
|
|
89
89
|
.block-editor-template-part__selection-modal {
|
|
90
90
|
z-index: 1000001;
|
|
91
91
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
height: calc(100% - 120px);
|
|
96
|
-
}
|
|
92
|
+
.block-editor-template-part__selection-modal .block-editor-block-patterns-list {
|
|
93
|
+
column-count: 2;
|
|
94
|
+
column-gap: 24px;
|
|
97
95
|
}
|
|
98
|
-
@media (min-width:
|
|
99
|
-
.block-editor-template-part__selection-modal .
|
|
100
|
-
|
|
96
|
+
@media (min-width: 1280px) {
|
|
97
|
+
.block-editor-template-part__selection-modal .block-editor-block-patterns-list {
|
|
98
|
+
column-count: 3;
|
|
101
99
|
}
|
|
102
100
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
height: 70%;
|
|
106
|
-
}
|
|
101
|
+
.block-editor-template-part__selection-modal .block-editor-block-patterns-list .block-editor-block-patterns-list__list-item {
|
|
102
|
+
break-inside: avoid-column;
|
|
107
103
|
}
|
|
108
104
|
|
|
109
105
|
.block-library-template-part__selection-search {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/block-library",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.10.0",
|
|
4
4
|
"description": "Block library for the WordPress editor.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -27,48 +27,52 @@
|
|
|
27
27
|
"sideEffects": [
|
|
28
28
|
"build-style/**",
|
|
29
29
|
"src/**/*.scss",
|
|
30
|
-
"{src,build,build-module}/*/init.js"
|
|
30
|
+
"{src,build,build-module}/*/init.js",
|
|
31
|
+
"{src,build,build-module}/utils/interactivity/index.js"
|
|
31
32
|
],
|
|
32
33
|
"dependencies": {
|
|
33
34
|
"@babel/runtime": "^7.16.0",
|
|
34
|
-
"@
|
|
35
|
-
"@wordpress/
|
|
36
|
-
"@wordpress/
|
|
37
|
-
"@wordpress/
|
|
38
|
-
"@wordpress/
|
|
39
|
-
"@wordpress/
|
|
40
|
-
"@wordpress/
|
|
41
|
-
"@wordpress/
|
|
42
|
-
"@wordpress/
|
|
43
|
-
"@wordpress/data": "^
|
|
44
|
-
"@wordpress/
|
|
45
|
-
"@wordpress/
|
|
46
|
-
"@wordpress/
|
|
47
|
-
"@wordpress/
|
|
48
|
-
"@wordpress/
|
|
49
|
-
"@wordpress/
|
|
50
|
-
"@wordpress/
|
|
51
|
-
"@wordpress/
|
|
52
|
-
"@wordpress/
|
|
53
|
-
"@wordpress/
|
|
54
|
-
"@wordpress/
|
|
55
|
-
"@wordpress/
|
|
56
|
-
"@wordpress/
|
|
57
|
-
"@wordpress/
|
|
58
|
-
"@wordpress/
|
|
59
|
-
"@wordpress/
|
|
60
|
-
"@wordpress/
|
|
61
|
-
"@wordpress/
|
|
62
|
-
"@wordpress/
|
|
35
|
+
"@preact/signals": "^1.1.3",
|
|
36
|
+
"@wordpress/a11y": "^3.33.0",
|
|
37
|
+
"@wordpress/api-fetch": "^6.30.0",
|
|
38
|
+
"@wordpress/autop": "^3.33.0",
|
|
39
|
+
"@wordpress/blob": "^3.33.0",
|
|
40
|
+
"@wordpress/block-editor": "^12.1.0",
|
|
41
|
+
"@wordpress/blocks": "^12.10.0",
|
|
42
|
+
"@wordpress/components": "^24.0.0",
|
|
43
|
+
"@wordpress/compose": "^6.10.0",
|
|
44
|
+
"@wordpress/core-data": "^6.10.0",
|
|
45
|
+
"@wordpress/data": "^9.3.0",
|
|
46
|
+
"@wordpress/date": "^4.33.0",
|
|
47
|
+
"@wordpress/deprecated": "^3.33.0",
|
|
48
|
+
"@wordpress/dom": "^3.33.0",
|
|
49
|
+
"@wordpress/element": "^5.10.0",
|
|
50
|
+
"@wordpress/escape-html": "^2.33.0",
|
|
51
|
+
"@wordpress/hooks": "^3.33.0",
|
|
52
|
+
"@wordpress/html-entities": "^3.33.0",
|
|
53
|
+
"@wordpress/i18n": "^4.33.0",
|
|
54
|
+
"@wordpress/icons": "^9.24.0",
|
|
55
|
+
"@wordpress/keycodes": "^3.33.0",
|
|
56
|
+
"@wordpress/notices": "^4.1.0",
|
|
57
|
+
"@wordpress/primitives": "^3.31.0",
|
|
58
|
+
"@wordpress/private-apis": "^0.15.0",
|
|
59
|
+
"@wordpress/reusable-blocks": "^4.10.0",
|
|
60
|
+
"@wordpress/rich-text": "^6.10.0",
|
|
61
|
+
"@wordpress/server-side-render": "^4.10.0",
|
|
62
|
+
"@wordpress/url": "^3.34.0",
|
|
63
|
+
"@wordpress/viewport": "^5.10.0",
|
|
64
|
+
"@wordpress/wordcount": "^3.33.0",
|
|
63
65
|
"change-case": "^4.1.2",
|
|
64
66
|
"classnames": "^2.3.1",
|
|
65
67
|
"colord": "^2.7.0",
|
|
68
|
+
"deepsignal": "^1.3.0",
|
|
66
69
|
"escape-html": "^1.0.3",
|
|
67
70
|
"fast-average-color": "^9.1.1",
|
|
68
71
|
"fast-deep-equal": "^3.1.3",
|
|
69
72
|
"lodash": "^4.17.21",
|
|
70
73
|
"memize": "^1.1.0",
|
|
71
74
|
"micromodal": "^0.4.10",
|
|
75
|
+
"preact": "^10.13.2",
|
|
72
76
|
"remove-accents": "^0.4.2"
|
|
73
77
|
},
|
|
74
78
|
"peerDependencies": {
|
|
@@ -78,5 +82,5 @@
|
|
|
78
82
|
"publishConfig": {
|
|
79
83
|
"access": "public"
|
|
80
84
|
},
|
|
81
|
-
"gitHead": "
|
|
85
|
+
"gitHead": "e936127e1e13881f1a940b7bd1593a9e500147f3"
|
|
82
86
|
}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
|
+
exports[`Buttons block color customization sets a background color 1`] = `
|
|
4
|
+
"<!-- wp:buttons -->
|
|
5
|
+
<div class="wp-block-buttons"><!-- wp:button {"backgroundColor":"luminous-vivid-amber"} /--></div>
|
|
6
|
+
<!-- /wp:buttons -->"
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
exports[`Buttons block color customization sets a gradient background color 1`] = `
|
|
10
|
+
"<!-- wp:buttons -->
|
|
11
|
+
<div class="wp-block-buttons"><!-- wp:button {"gradient":"light-green-cyan-to-vivid-green-cyan"} /--></div>
|
|
12
|
+
<!-- /wp:buttons -->"
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`Buttons block color customization sets a text color 1`] = `
|
|
16
|
+
"<!-- wp:buttons -->
|
|
17
|
+
<div class="wp-block-buttons"><!-- wp:button {"textColor":"pale-pink"} /--></div>
|
|
18
|
+
<!-- /wp:buttons -->"
|
|
19
|
+
`;
|
|
20
|
+
|
|
3
21
|
exports[`Buttons block justify content sets Justify items center option 1`] = `
|
|
4
22
|
"<!-- wp:buttons {"layout":{"type":"flex","justifyContent":"center"}} -->
|
|
5
23
|
<div class="wp-block-buttons"><!-- wp:button /--></div>
|
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* External dependencies
|
|
3
3
|
*/
|
|
4
4
|
import {
|
|
5
|
+
addBlock,
|
|
5
6
|
fireEvent,
|
|
6
7
|
getEditorHtml,
|
|
7
8
|
within,
|
|
8
9
|
getBlock,
|
|
9
10
|
initializeEditor,
|
|
10
|
-
|
|
11
|
+
triggerBlockListLayout,
|
|
12
|
+
typeInRichText,
|
|
13
|
+
waitFor,
|
|
11
14
|
} from 'test/helpers';
|
|
12
15
|
|
|
13
16
|
/**
|
|
@@ -196,7 +199,7 @@ describe( 'Buttons block', () => {
|
|
|
196
199
|
within( secondButtonBlock ).getByLabelText(
|
|
197
200
|
'Text input. Empty'
|
|
198
201
|
);
|
|
199
|
-
|
|
202
|
+
typeInRichText( secondButtonInput, 'Hello!' );
|
|
200
203
|
|
|
201
204
|
expect( getEditorHtml() ).toMatchSnapshot();
|
|
202
205
|
} );
|
|
@@ -271,4 +274,122 @@ describe( 'Buttons block', () => {
|
|
|
271
274
|
} )
|
|
272
275
|
);
|
|
273
276
|
} );
|
|
277
|
+
|
|
278
|
+
describe( 'color customization', () => {
|
|
279
|
+
it( 'sets a text color', async () => {
|
|
280
|
+
// Arrange
|
|
281
|
+
const screen = await initializeEditor();
|
|
282
|
+
await addBlock( screen, 'Buttons' );
|
|
283
|
+
|
|
284
|
+
// Act
|
|
285
|
+
const buttonsBlock = getBlock( screen, 'Buttons' );
|
|
286
|
+
fireEvent.press( buttonsBlock );
|
|
287
|
+
|
|
288
|
+
// Trigger onLayout for the list
|
|
289
|
+
await triggerBlockListLayout( buttonsBlock );
|
|
290
|
+
|
|
291
|
+
const buttonBlock = await getBlock( screen, 'Button' );
|
|
292
|
+
fireEvent.press( buttonBlock );
|
|
293
|
+
|
|
294
|
+
// Open Block Settings.
|
|
295
|
+
fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
|
|
296
|
+
|
|
297
|
+
// Wait for Block Settings to be visible.
|
|
298
|
+
const blockSettingsModal = screen.getByTestId(
|
|
299
|
+
'block-settings-modal'
|
|
300
|
+
);
|
|
301
|
+
await waitFor( () => blockSettingsModal.props.isVisible );
|
|
302
|
+
|
|
303
|
+
// Open Text color settings
|
|
304
|
+
fireEvent.press( screen.getByLabelText( 'Text, Default' ) );
|
|
305
|
+
|
|
306
|
+
// Tap one color
|
|
307
|
+
fireEvent.press( screen.getByLabelText( 'Pale pink' ) );
|
|
308
|
+
|
|
309
|
+
// Dismiss the Block Settings modal.
|
|
310
|
+
fireEvent( blockSettingsModal, 'backdropPress' );
|
|
311
|
+
|
|
312
|
+
// Assert
|
|
313
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
314
|
+
} );
|
|
315
|
+
|
|
316
|
+
it( 'sets a background color', async () => {
|
|
317
|
+
// Arrange
|
|
318
|
+
const screen = await initializeEditor();
|
|
319
|
+
await addBlock( screen, 'Buttons' );
|
|
320
|
+
|
|
321
|
+
// Act
|
|
322
|
+
const buttonsBlock = getBlock( screen, 'Buttons' );
|
|
323
|
+
fireEvent.press( buttonsBlock );
|
|
324
|
+
|
|
325
|
+
// Trigger onLayout for the list
|
|
326
|
+
await triggerBlockListLayout( buttonsBlock );
|
|
327
|
+
|
|
328
|
+
const buttonBlock = await getBlock( screen, 'Button' );
|
|
329
|
+
fireEvent.press( buttonBlock );
|
|
330
|
+
|
|
331
|
+
// Open Block Settings.
|
|
332
|
+
fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
|
|
333
|
+
|
|
334
|
+
// Wait for Block Settings to be visible.
|
|
335
|
+
const blockSettingsModal = screen.getByTestId(
|
|
336
|
+
'block-settings-modal'
|
|
337
|
+
);
|
|
338
|
+
await waitFor( () => blockSettingsModal.props.isVisible );
|
|
339
|
+
|
|
340
|
+
// Open Text color settings
|
|
341
|
+
fireEvent.press( screen.getByLabelText( 'Background, Default' ) );
|
|
342
|
+
|
|
343
|
+
// Tap one color
|
|
344
|
+
fireEvent.press( screen.getByLabelText( 'Luminous vivid amber' ) );
|
|
345
|
+
|
|
346
|
+
// Dismiss the Block Settings modal.
|
|
347
|
+
fireEvent( blockSettingsModal, 'backdropPress' );
|
|
348
|
+
|
|
349
|
+
// Assert
|
|
350
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
351
|
+
} );
|
|
352
|
+
|
|
353
|
+
it( 'sets a gradient background color', async () => {
|
|
354
|
+
// Arrange
|
|
355
|
+
const screen = await initializeEditor();
|
|
356
|
+
await addBlock( screen, 'Buttons' );
|
|
357
|
+
|
|
358
|
+
// Act
|
|
359
|
+
const buttonsBlock = getBlock( screen, 'Buttons' );
|
|
360
|
+
fireEvent.press( buttonsBlock );
|
|
361
|
+
|
|
362
|
+
// Trigger onLayout for the list
|
|
363
|
+
await triggerBlockListLayout( buttonsBlock );
|
|
364
|
+
|
|
365
|
+
const buttonBlock = await getBlock( screen, 'Button' );
|
|
366
|
+
fireEvent.press( buttonBlock );
|
|
367
|
+
|
|
368
|
+
// Open Block Settings.
|
|
369
|
+
fireEvent.press( screen.getByLabelText( 'Open Settings' ) );
|
|
370
|
+
|
|
371
|
+
// Wait for Block Settings to be visible.
|
|
372
|
+
const blockSettingsModal = screen.getByTestId(
|
|
373
|
+
'block-settings-modal'
|
|
374
|
+
);
|
|
375
|
+
await waitFor( () => blockSettingsModal.props.isVisible );
|
|
376
|
+
|
|
377
|
+
// Open Text color settings
|
|
378
|
+
fireEvent.press( screen.getByLabelText( 'Background, Default' ) );
|
|
379
|
+
|
|
380
|
+
// Tap on the gradient segment
|
|
381
|
+
fireEvent.press( screen.getByLabelText( 'Gradient' ) );
|
|
382
|
+
|
|
383
|
+
// Tap one gradient color
|
|
384
|
+
fireEvent.press(
|
|
385
|
+
screen.getByLabelText( 'Light green cyan to vivid green cyan' )
|
|
386
|
+
);
|
|
387
|
+
|
|
388
|
+
// Dismiss the Block Settings modal.
|
|
389
|
+
fireEvent( blockSettingsModal, 'backdropPress' );
|
|
390
|
+
|
|
391
|
+
// Assert
|
|
392
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
393
|
+
} );
|
|
394
|
+
} );
|
|
274
395
|
} );
|
|
@@ -70,7 +70,7 @@ export default function Edit( {
|
|
|
70
70
|
|
|
71
71
|
const inspectorControls = (
|
|
72
72
|
<InspectorControls>
|
|
73
|
-
<PanelBody title={ __( '
|
|
73
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
74
74
|
<ToggleControl
|
|
75
75
|
__nextHasNoMarginBottom
|
|
76
76
|
label={ __( 'Link to authors URL' ) }
|
|
@@ -37,7 +37,7 @@ export default function Edit( {
|
|
|
37
37
|
);
|
|
38
38
|
const inspectorControls = (
|
|
39
39
|
<InspectorControls>
|
|
40
|
-
<PanelBody title={ __( '
|
|
40
|
+
<PanelBody title={ __( 'Settings' ) }>
|
|
41
41
|
<ToggleControl
|
|
42
42
|
__nextHasNoMarginBottom
|
|
43
43
|
label={ __( 'Open in new tab' ) }
|
|
@@ -25,13 +25,14 @@ function block_core_comment_template_render_comments( $comments, $block ) {
|
|
|
25
25
|
|
|
26
26
|
$content = '';
|
|
27
27
|
foreach ( $comments as $comment ) {
|
|
28
|
-
|
|
29
|
-
$
|
|
30
|
-
$
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
28
|
+
$comment_id = $comment->comment_ID;
|
|
29
|
+
$filter_block_context = static function( $context ) use ( $comment_id ) {
|
|
30
|
+
$context['commentId'] = $comment_id;
|
|
31
|
+
return $context;
|
|
32
|
+
};
|
|
33
|
+
add_filter( 'render_block_context', $filter_block_context );
|
|
34
|
+
$block_content = $block->render( array( 'dynamic' => false ) );
|
|
35
|
+
remove_filter( 'render_block_context', $filter_block_context );
|
|
35
36
|
|
|
36
37
|
$children = $comment->get_children();
|
|
37
38
|
|
package/src/cover/block.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"name": "core/cover",
|
|
5
5
|
"title": "Cover",
|
|
6
6
|
"category": "media",
|
|
7
|
-
"description": "Add an image or video with a text overlay
|
|
7
|
+
"description": "Add an image or video with a text overlay.",
|
|
8
8
|
"textdomain": "default",
|
|
9
9
|
"attributes": {
|
|
10
10
|
"url": {
|
|
@@ -249,62 +249,64 @@ export default function CoverInspectorControls( {
|
|
|
249
249
|
</PanelBody>
|
|
250
250
|
) }
|
|
251
251
|
</InspectorControls>
|
|
252
|
-
|
|
253
|
-
<
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
{
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
onDeselect={ () =>
|
|
284
|
-
setAttributes( { dimRatio: url ? 50 : 100 } )
|
|
285
|
-
}
|
|
286
|
-
resetAllFilter={ () => ( {
|
|
287
|
-
dimRatio: url ? 50 : 100,
|
|
288
|
-
} ) }
|
|
289
|
-
isShownByDefault
|
|
290
|
-
panelId={ clientId }
|
|
291
|
-
>
|
|
292
|
-
<RangeControl
|
|
293
|
-
__nextHasNoMarginBottom
|
|
252
|
+
{ colorGradientSettings.hasColorsOrGradients && (
|
|
253
|
+
<InspectorControls group="color">
|
|
254
|
+
<ColorGradientSettingsDropdown
|
|
255
|
+
__experimentalIsRenderedInSidebar
|
|
256
|
+
settings={ [
|
|
257
|
+
{
|
|
258
|
+
colorValue: overlayColor.color,
|
|
259
|
+
gradientValue,
|
|
260
|
+
label: __( 'Overlay' ),
|
|
261
|
+
onColorChange: setOverlayColor,
|
|
262
|
+
onGradientChange: setGradient,
|
|
263
|
+
isShownByDefault: true,
|
|
264
|
+
resetAllFilter: () => ( {
|
|
265
|
+
overlayColor: undefined,
|
|
266
|
+
customOverlayColor: undefined,
|
|
267
|
+
gradient: undefined,
|
|
268
|
+
customGradient: undefined,
|
|
269
|
+
} ),
|
|
270
|
+
},
|
|
271
|
+
] }
|
|
272
|
+
panelId={ clientId }
|
|
273
|
+
{ ...colorGradientSettings }
|
|
274
|
+
/>
|
|
275
|
+
<ToolsPanelItem
|
|
276
|
+
hasValue={ () => {
|
|
277
|
+
// If there's a media background the dimRatio will be
|
|
278
|
+
// defaulted to 50 whereas it will be 100 for colors.
|
|
279
|
+
return dimRatio === undefined
|
|
280
|
+
? false
|
|
281
|
+
: dimRatio !== ( url ? 50 : 100 );
|
|
282
|
+
} }
|
|
294
283
|
label={ __( 'Overlay opacity' ) }
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
setAttributes( {
|
|
298
|
-
dimRatio: newDimRation,
|
|
299
|
-
} )
|
|
284
|
+
onDeselect={ () =>
|
|
285
|
+
setAttributes( { dimRatio: url ? 50 : 100 } )
|
|
300
286
|
}
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
287
|
+
resetAllFilter={ () => ( {
|
|
288
|
+
dimRatio: url ? 50 : 100,
|
|
289
|
+
} ) }
|
|
290
|
+
isShownByDefault
|
|
291
|
+
panelId={ clientId }
|
|
292
|
+
>
|
|
293
|
+
<RangeControl
|
|
294
|
+
__nextHasNoMarginBottom
|
|
295
|
+
label={ __( 'Overlay opacity' ) }
|
|
296
|
+
value={ dimRatio }
|
|
297
|
+
onChange={ ( newDimRation ) =>
|
|
298
|
+
setAttributes( {
|
|
299
|
+
dimRatio: newDimRation,
|
|
300
|
+
} )
|
|
301
|
+
}
|
|
302
|
+
min={ 0 }
|
|
303
|
+
max={ 100 }
|
|
304
|
+
step={ 10 }
|
|
305
|
+
required
|
|
306
|
+
/>
|
|
307
|
+
</ToolsPanelItem>
|
|
308
|
+
</InspectorControls>
|
|
309
|
+
) }
|
|
308
310
|
<InspectorControls group="dimensions">
|
|
309
311
|
<ToolsPanelItem
|
|
310
312
|
hasValue={ () => !! minHeight }
|
package/src/cover/editor.scss
CHANGED
|
@@ -10,7 +10,6 @@
|
|
|
10
10
|
padding: 0 !important;
|
|
11
11
|
display: flex;
|
|
12
12
|
align-items: stretch;
|
|
13
|
-
overflow: visible;
|
|
14
13
|
min-height: 240px;
|
|
15
14
|
|
|
16
15
|
.components-placeholder {
|
|
@@ -97,6 +96,7 @@
|
|
|
97
96
|
// The inner drag handle will still have `pointer-events: all` allowing
|
|
98
97
|
// it to continue to be interacted with.
|
|
99
98
|
pointer-events: none;
|
|
99
|
+
overflow: visible;
|
|
100
100
|
}
|
|
101
101
|
}
|
|
102
102
|
|
package/src/cover/style.scss
CHANGED
|
@@ -7,7 +7,11 @@
|
|
|
7
7
|
justify-content: center;
|
|
8
8
|
align-items: center;
|
|
9
9
|
padding: 1em;
|
|
10
|
+
// Prevent the `wp-block-cover__background` span from overflowing the container when border-radius is applied.
|
|
11
|
+
// `overflow: hidden` is provided as a fallback for browsers that don't support `overflow: clip`.
|
|
10
12
|
overflow: hidden;
|
|
13
|
+
// Use clip instead of overflow: hidden so that sticky position works on child elements.
|
|
14
|
+
overflow: clip;
|
|
11
15
|
// This block has customizable padding, border-box makes that more predictable.
|
|
12
16
|
box-sizing: border-box;
|
|
13
17
|
// Keep the flex layout direction to the physical direction (LTR) in RTL languages.
|
package/src/cover/test/edit.js
CHANGED
|
@@ -12,9 +12,34 @@ import {
|
|
|
12
12
|
selectBlock,
|
|
13
13
|
} from 'test/integration/helpers/integration-test-editor';
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const defaultSettings = {
|
|
16
|
+
__experimentalFeatures: {
|
|
17
|
+
color: {
|
|
18
|
+
defaultPalette: true,
|
|
19
|
+
defaultGradients: true,
|
|
20
|
+
palette: {
|
|
21
|
+
default: [ { name: 'Black', slug: 'black', color: '#000000' } ],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
colors: [ { name: 'Black', slug: 'black', color: '#000000' } ],
|
|
26
|
+
disableCustomColors: false,
|
|
27
|
+
disableCustomGradients: false,
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
const disabledColorSettings = {
|
|
31
|
+
color: {
|
|
32
|
+
defaultPalette: false,
|
|
33
|
+
defaultGradients: false,
|
|
34
|
+
},
|
|
35
|
+
disableCustomColors: true,
|
|
36
|
+
disableCustomGradients: true,
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
async function setup( attributes, useCoreBlocks, customSettings ) {
|
|
16
40
|
const testBlock = { name: 'core/cover', attributes };
|
|
17
|
-
|
|
41
|
+
const settings = customSettings || defaultSettings;
|
|
42
|
+
return initializeEditor( testBlock, useCoreBlocks, settings );
|
|
18
43
|
}
|
|
19
44
|
|
|
20
45
|
async function createAndSelectBlock() {
|
|
@@ -296,6 +321,35 @@ describe( 'Cover block', () => {
|
|
|
296
321
|
|
|
297
322
|
expect( overlay[ 0 ] ).toHaveClass( 'has-background-dim-30' );
|
|
298
323
|
} );
|
|
324
|
+
|
|
325
|
+
describe( 'when colors are disabled', () => {
|
|
326
|
+
test( 'does not render overlay control', async () => {
|
|
327
|
+
await setup( undefined, true, disabledColorSettings );
|
|
328
|
+
await createAndSelectBlock();
|
|
329
|
+
await userEvent.click(
|
|
330
|
+
screen.getByRole( 'tab', { name: 'Styles' } )
|
|
331
|
+
);
|
|
332
|
+
|
|
333
|
+
const overlayControl = screen.queryByRole( 'button', {
|
|
334
|
+
name: 'Overlay',
|
|
335
|
+
} );
|
|
336
|
+
|
|
337
|
+
expect( overlayControl ).not.toBeInTheDocument();
|
|
338
|
+
} );
|
|
339
|
+
test( 'does not render opacity control', async () => {
|
|
340
|
+
await setup( undefined, true, disabledColorSettings );
|
|
341
|
+
await createAndSelectBlock();
|
|
342
|
+
await userEvent.click(
|
|
343
|
+
screen.getByRole( 'tab', { name: 'Styles' } )
|
|
344
|
+
);
|
|
345
|
+
|
|
346
|
+
const opacityControl = screen.queryByRole( 'slider', {
|
|
347
|
+
name: 'Overlay opacity',
|
|
348
|
+
} );
|
|
349
|
+
|
|
350
|
+
expect( opacityControl ).not.toBeInTheDocument();
|
|
351
|
+
} );
|
|
352
|
+
} );
|
|
299
353
|
} );
|
|
300
354
|
|
|
301
355
|
describe( 'Dimensions panel', () => {
|
package/src/cover/transforms.js
CHANGED
|
@@ -2,12 +2,15 @@
|
|
|
2
2
|
* WordPress dependencies
|
|
3
3
|
*/
|
|
4
4
|
import { createBlock } from '@wordpress/blocks';
|
|
5
|
+
import { privateApis as blockEditorPrivateApis } from '@wordpress/block-editor';
|
|
5
6
|
|
|
6
7
|
/**
|
|
7
8
|
* Internal dependencies
|
|
8
9
|
*/
|
|
9
10
|
import { IMAGE_BACKGROUND_TYPE, VIDEO_BACKGROUND_TYPE } from './shared';
|
|
10
|
-
import
|
|
11
|
+
import { unlock } from '../private-apis';
|
|
12
|
+
|
|
13
|
+
const { cleanEmptyObject } = unlock( blockEditorPrivateApis );
|
|
11
14
|
|
|
12
15
|
const transforms = {
|
|
13
16
|
from: [
|
package/src/cover/variations.js
CHANGED
|
@@ -8,9 +8,7 @@ const variations = [
|
|
|
8
8
|
{
|
|
9
9
|
name: 'cover',
|
|
10
10
|
title: __( 'Cover' ),
|
|
11
|
-
description: __(
|
|
12
|
-
'Add an image or video with a text overlay — great for headers.'
|
|
13
|
-
),
|
|
11
|
+
description: __( 'Add an image or video with a text overlay.' ),
|
|
14
12
|
attributes: { layout: { type: 'constrained' } },
|
|
15
13
|
isDefault: true,
|
|
16
14
|
icon: cover,
|
package/src/details/block.json
CHANGED
|
@@ -5,28 +5,29 @@
|
|
|
5
5
|
"name": "core/details",
|
|
6
6
|
"title": "Details",
|
|
7
7
|
"category": "text",
|
|
8
|
-
"description": "
|
|
9
|
-
"keywords": [ "disclosure", "summary", "hide", "
|
|
8
|
+
"description": "Hide and show additional content.",
|
|
9
|
+
"keywords": [ "disclosure", "summary", "hide", "accordion" ],
|
|
10
10
|
"textdomain": "default",
|
|
11
11
|
"attributes": {
|
|
12
12
|
"showContent": {
|
|
13
13
|
"type": "boolean",
|
|
14
14
|
"default": false
|
|
15
|
+
},
|
|
16
|
+
"summary": {
|
|
17
|
+
"type": "string"
|
|
15
18
|
}
|
|
16
19
|
},
|
|
17
20
|
"supports": {
|
|
18
|
-
"align":
|
|
21
|
+
"align": [ "wide", "full" ],
|
|
19
22
|
"color": {
|
|
20
23
|
"gradients": true,
|
|
21
24
|
"link": true,
|
|
22
25
|
"__experimentalDefaultControls": {
|
|
23
26
|
"background": true,
|
|
24
|
-
"text": true
|
|
25
|
-
"link": true
|
|
27
|
+
"text": true
|
|
26
28
|
}
|
|
27
29
|
},
|
|
28
30
|
"__experimentalBorder": {
|
|
29
|
-
"radius": true,
|
|
30
31
|
"color": true,
|
|
31
32
|
"width": true,
|
|
32
33
|
"style": true
|
|
@@ -50,5 +51,6 @@
|
|
|
50
51
|
}
|
|
51
52
|
}
|
|
52
53
|
},
|
|
54
|
+
"editorStyle": "wp-block-details-editor",
|
|
53
55
|
"style": "wp-block-details"
|
|
54
56
|
}
|