@wordpress/block-library 8.0.0 → 8.1.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 +2 -0
- package/build/categories/edit.js +1 -1
- package/build/categories/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/freeform/edit.js +21 -6
- package/build/freeform/edit.js.map +1 -1
- package/build/freeform/modal.js +97 -0
- package/build/freeform/modal.js.map +1 -0
- package/build/gallery/edit.js +13 -2
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +2 -16
- package/build/gallery/gallery.js.map +1 -1
- package/build/image/image.js +1 -0
- package/build/image/image.js.map +1 -1
- package/build/media-text/edit.js +1 -0
- package/build/media-text/edit.js.map +1 -1
- package/build/missing/edit.native.js +2 -2
- package/build/missing/edit.native.js.map +1 -1
- package/build/navigation/edit/index.js +3 -4
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +29 -7
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +11 -8
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/utils.js +81 -0
- package/build/navigation/edit/utils.js.map +1 -1
- package/build/navigation-link/edit.js +4 -58
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-submenu/edit.js +7 -72
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/edit.js +16 -15
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +29 -2
- package/build/page-list/index.js.map +1 -1
- package/build/page-list-item/edit.js +9 -5
- package/build/page-list-item/edit.js.map +1 -1
- package/build/post-featured-image/overlay.js +0 -1
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/query/edit/index.js +2 -1
- package/build/query/edit/index.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +10 -5
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/taxonomy-controls.js +101 -37
- package/build/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build/query/edit/query-content.js +2 -3
- package/build/query/edit/query-content.js.map +1 -1
- package/build/query/edit/query-placeholder.js +17 -12
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/utils.js +73 -1
- package/build/query/utils.js.map +1 -1
- package/build/search/edit.js +2 -2
- package/build/search/edit.js.map +1 -1
- package/build/social-link/edit.js.map +1 -1
- package/build/social-links/edit.js +0 -1
- package/build/social-links/edit.js.map +1 -1
- package/build/table-of-contents/edit.js +1 -1
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +11 -1
- package/build/template-part/edit/advanced-controls.js.map +1 -1
- package/build/template-part/edit/import-controls.js +160 -0
- package/build/template-part/edit/import-controls.js.map +1 -0
- 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/transformers.js +48 -0
- package/build/template-part/edit/utils/transformers.js.map +1 -0
- package/build-module/categories/edit.js +1 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +3 -3
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/freeform/edit.js +22 -8
- package/build-module/freeform/edit.js.map +1 -1
- package/build-module/freeform/modal.js +90 -0
- package/build-module/freeform/modal.js.map +1 -0
- package/build-module/gallery/edit.js +14 -3
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +3 -16
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/image/image.js +1 -0
- package/build-module/image/image.js.map +1 -1
- package/build-module/media-text/edit.js +1 -0
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/missing/edit.native.js +2 -2
- package/build-module/missing/edit.native.js.map +1 -1
- package/build-module/navigation/edit/index.js +3 -4
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +30 -9
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +12 -9
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/utils.js +75 -0
- package/build-module/navigation/edit/utils.js.map +1 -1
- package/build-module/navigation-link/edit.js +4 -59
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-submenu/edit.js +6 -72
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/edit.js +17 -15
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +30 -3
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/page-list-item/edit.js +9 -6
- package/build-module/page-list-item/edit.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +0 -1
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/query/edit/index.js +2 -1
- package/build-module/query/edit/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +10 -5
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js +99 -35
- package/build-module/query/edit/inspector-controls/taxonomy-controls.js.map +1 -1
- package/build-module/query/edit/query-content.js +1 -1
- package/build-module/query/edit/query-content.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +16 -12
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/utils.js +69 -0
- package/build-module/query/utils.js.map +1 -1
- package/build-module/search/edit.js +2 -2
- package/build-module/search/edit.js.map +1 -1
- package/build-module/social-link/edit.js +2 -2
- package/build-module/social-link/edit.js.map +1 -1
- package/build-module/social-links/edit.js +0 -1
- package/build-module/social-links/edit.js.map +1 -1
- package/build-module/table-of-contents/edit.js +1 -1
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +10 -1
- package/build-module/template-part/edit/advanced-controls.js.map +1 -1
- package/build-module/template-part/edit/import-controls.js +146 -0
- package/build-module/template-part/edit/import-controls.js.map +1 -0
- 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/transformers.js +40 -0
- package/build-module/template-part/edit/utils/transformers.js.map +1 -0
- package/build-style/archives/editor-rtl.css +3 -3
- package/build-style/archives/editor.css +3 -3
- package/build-style/archives/style-rtl.css +3 -3
- package/build-style/archives/style.css +3 -3
- package/build-style/audio/editor-rtl.css +3 -3
- package/build-style/audio/editor.css +3 -3
- package/build-style/audio/style-rtl.css +3 -3
- package/build-style/audio/style.css +3 -3
- package/build-style/audio/theme-rtl.css +3 -3
- package/build-style/audio/theme.css +3 -3
- package/build-style/avatar/editor-rtl.css +3 -3
- package/build-style/avatar/editor.css +3 -3
- package/build-style/avatar/style-rtl.css +3 -3
- package/build-style/avatar/style.css +3 -3
- package/build-style/block/editor-rtl.css +3 -3
- package/build-style/block/editor.css +3 -3
- package/build-style/button/editor-rtl.css +3 -3
- package/build-style/button/editor.css +3 -3
- package/build-style/button/style-rtl.css +3 -3
- package/build-style/button/style.css +3 -3
- package/build-style/buttons/editor-rtl.css +3 -3
- package/build-style/buttons/editor.css +3 -3
- package/build-style/buttons/style-rtl.css +3 -3
- package/build-style/buttons/style.css +3 -3
- package/build-style/calendar/style-rtl.css +3 -3
- package/build-style/calendar/style.css +3 -3
- package/build-style/categories/editor-rtl.css +3 -3
- package/build-style/categories/editor.css +3 -3
- package/build-style/categories/style-rtl.css +3 -3
- package/build-style/categories/style.css +3 -3
- package/build-style/classic-rtl.css +3 -3
- package/build-style/classic.css +3 -3
- package/build-style/code/editor-rtl.css +3 -3
- package/build-style/code/editor.css +3 -3
- package/build-style/code/style-rtl.css +3 -3
- package/build-style/code/style.css +3 -3
- package/build-style/code/theme-rtl.css +3 -3
- package/build-style/code/theme.css +3 -3
- package/build-style/columns/editor-rtl.css +3 -3
- package/build-style/columns/editor.css +3 -3
- package/build-style/columns/style-rtl.css +3 -3
- package/build-style/columns/style.css +3 -3
- package/build-style/comment-author-avatar/editor-rtl.css +3 -3
- package/build-style/comment-author-avatar/editor.css +3 -3
- package/build-style/comment-content/style-rtl.css +3 -3
- package/build-style/comment-content/style.css +3 -3
- package/build-style/comment-template/style-rtl.css +3 -3
- package/build-style/comment-template/style.css +3 -3
- package/build-style/comments/editor-rtl.css +3 -3
- package/build-style/comments/editor.css +3 -3
- package/build-style/comments/style-rtl.css +3 -3
- package/build-style/comments/style.css +3 -3
- package/build-style/comments-pagination/editor-rtl.css +3 -3
- package/build-style/comments-pagination/editor.css +3 -3
- package/build-style/comments-pagination/style-rtl.css +3 -3
- package/build-style/comments-pagination/style.css +3 -3
- package/build-style/comments-pagination-numbers/editor-rtl.css +3 -3
- package/build-style/comments-pagination-numbers/editor.css +3 -3
- package/build-style/comments-title/editor-rtl.css +3 -3
- package/build-style/comments-title/editor.css +3 -3
- package/build-style/common-rtl.css +3 -3
- package/build-style/common.css +3 -3
- package/build-style/cover/editor-rtl.css +3 -3
- package/build-style/cover/editor.css +3 -3
- package/build-style/cover/style-rtl.css +3 -3
- package/build-style/cover/style.css +3 -3
- package/build-style/editor-elements-rtl.css +3 -3
- package/build-style/editor-elements.css +3 -3
- package/build-style/editor-rtl.css +7 -9
- package/build-style/editor.css +7 -9
- package/build-style/elements-rtl.css +3 -3
- package/build-style/elements.css +3 -3
- package/build-style/embed/editor-rtl.css +3 -3
- package/build-style/embed/editor.css +3 -3
- package/build-style/embed/style-rtl.css +3 -3
- package/build-style/embed/style.css +3 -3
- package/build-style/embed/theme-rtl.css +3 -3
- package/build-style/embed/theme.css +3 -3
- package/build-style/file/editor-rtl.css +3 -3
- package/build-style/file/editor.css +3 -3
- package/build-style/file/style-rtl.css +3 -3
- package/build-style/file/style.css +3 -3
- package/build-style/freeform/editor-rtl.css +3 -3
- package/build-style/freeform/editor.css +3 -3
- package/build-style/gallery/editor-rtl.css +3 -3
- package/build-style/gallery/editor.css +3 -3
- package/build-style/gallery/style-rtl.css +3 -3
- package/build-style/gallery/style.css +3 -3
- package/build-style/gallery/theme-rtl.css +3 -3
- package/build-style/gallery/theme.css +3 -3
- package/build-style/group/editor-rtl.css +3 -3
- package/build-style/group/editor.css +3 -3
- package/build-style/group/style-rtl.css +3 -3
- package/build-style/group/style.css +3 -3
- package/build-style/group/theme-rtl.css +3 -3
- package/build-style/group/theme.css +3 -3
- package/build-style/heading/style-rtl.css +3 -3
- package/build-style/heading/style.css +3 -3
- package/build-style/html/editor-rtl.css +3 -3
- package/build-style/html/editor.css +3 -3
- package/build-style/image/editor-rtl.css +3 -3
- package/build-style/image/editor.css +3 -3
- package/build-style/image/style-rtl.css +3 -3
- package/build-style/image/style.css +3 -3
- package/build-style/image/theme-rtl.css +3 -3
- package/build-style/image/theme.css +3 -3
- package/build-style/latest-comments/style-rtl.css +3 -3
- package/build-style/latest-comments/style.css +3 -3
- package/build-style/latest-posts/editor-rtl.css +3 -3
- package/build-style/latest-posts/editor.css +3 -3
- package/build-style/latest-posts/style-rtl.css +3 -3
- package/build-style/latest-posts/style.css +3 -3
- package/build-style/list/style-rtl.css +3 -3
- package/build-style/list/style.css +3 -3
- package/build-style/media-text/editor-rtl.css +3 -3
- package/build-style/media-text/editor.css +3 -3
- package/build-style/media-text/style-rtl.css +3 -3
- package/build-style/media-text/style.css +3 -3
- package/build-style/more/editor-rtl.css +3 -3
- package/build-style/more/editor.css +3 -3
- package/build-style/navigation/editor-rtl.css +3 -9
- package/build-style/navigation/editor.css +3 -9
- package/build-style/navigation/style-rtl.css +3 -4
- package/build-style/navigation/style.css +3 -4
- package/build-style/navigation-link/editor-rtl.css +3 -3
- package/build-style/navigation-link/editor.css +3 -3
- package/build-style/navigation-link/style-rtl.css +3 -3
- package/build-style/navigation-link/style.css +3 -3
- package/build-style/navigation-submenu/editor-rtl.css +3 -3
- package/build-style/navigation-submenu/editor.css +3 -3
- package/build-style/nextpage/editor-rtl.css +3 -3
- package/build-style/nextpage/editor.css +3 -3
- package/build-style/page-list/editor-rtl.css +7 -3
- package/build-style/page-list/editor.css +7 -3
- package/build-style/page-list/style-rtl.css +3 -3
- package/build-style/page-list/style.css +3 -3
- package/build-style/paragraph/editor-rtl.css +3 -3
- package/build-style/paragraph/editor.css +3 -3
- package/build-style/paragraph/style-rtl.css +3 -3
- package/build-style/paragraph/style.css +3 -3
- package/build-style/post-author/style-rtl.css +3 -3
- package/build-style/post-author/style.css +3 -3
- package/build-style/post-comments-form/editor-rtl.css +3 -3
- package/build-style/post-comments-form/editor.css +3 -3
- package/build-style/post-comments-form/style-rtl.css +3 -3
- package/build-style/post-comments-form/style.css +3 -3
- package/build-style/post-date/style-rtl.css +3 -3
- package/build-style/post-date/style.css +3 -3
- package/build-style/post-excerpt/editor-rtl.css +3 -3
- package/build-style/post-excerpt/editor.css +3 -3
- package/build-style/post-excerpt/style-rtl.css +3 -3
- package/build-style/post-excerpt/style.css +3 -3
- package/build-style/post-featured-image/editor-rtl.css +3 -3
- package/build-style/post-featured-image/editor.css +3 -3
- package/build-style/post-featured-image/style-rtl.css +3 -3
- package/build-style/post-featured-image/style.css +3 -3
- package/build-style/post-navigation-link/style-rtl.css +3 -3
- package/build-style/post-navigation-link/style.css +3 -3
- package/build-style/post-template/editor-rtl.css +3 -3
- package/build-style/post-template/editor.css +3 -3
- package/build-style/post-template/style-rtl.css +3 -3
- package/build-style/post-template/style.css +3 -3
- package/build-style/post-terms/style-rtl.css +3 -3
- package/build-style/post-terms/style.css +3 -3
- package/build-style/post-title/style-rtl.css +3 -3
- package/build-style/post-title/style.css +3 -3
- package/build-style/preformatted/style-rtl.css +3 -3
- package/build-style/preformatted/style.css +3 -3
- package/build-style/pullquote/editor-rtl.css +3 -3
- package/build-style/pullquote/editor.css +3 -3
- package/build-style/pullquote/style-rtl.css +3 -3
- package/build-style/pullquote/style.css +3 -3
- package/build-style/pullquote/theme-rtl.css +3 -3
- package/build-style/pullquote/theme.css +3 -3
- package/build-style/query/editor-rtl.css +3 -3
- package/build-style/query/editor.css +3 -3
- package/build-style/query-pagination/editor-rtl.css +3 -3
- package/build-style/query-pagination/editor.css +3 -3
- package/build-style/query-pagination/style-rtl.css +3 -3
- package/build-style/query-pagination/style.css +3 -3
- package/build-style/query-pagination-numbers/editor-rtl.css +3 -3
- package/build-style/query-pagination-numbers/editor.css +3 -3
- package/build-style/query-title/style-rtl.css +3 -3
- package/build-style/query-title/style.css +3 -3
- package/build-style/quote/style-rtl.css +3 -3
- package/build-style/quote/style.css +3 -3
- package/build-style/quote/theme-rtl.css +3 -3
- package/build-style/quote/theme.css +3 -3
- package/build-style/read-more/style-rtl.css +3 -3
- package/build-style/read-more/style.css +3 -3
- package/build-style/reset-rtl.css +3 -3
- package/build-style/reset.css +3 -3
- package/build-style/rss/editor-rtl.css +3 -3
- package/build-style/rss/editor.css +3 -3
- package/build-style/rss/style-rtl.css +3 -3
- package/build-style/rss/style.css +3 -3
- package/build-style/search/editor-rtl.css +3 -3
- package/build-style/search/editor.css +3 -3
- package/build-style/search/style-rtl.css +3 -3
- package/build-style/search/style.css +3 -3
- package/build-style/search/theme-rtl.css +3 -3
- package/build-style/search/theme.css +3 -3
- package/build-style/separator/editor-rtl.css +3 -3
- package/build-style/separator/editor.css +3 -3
- package/build-style/separator/style-rtl.css +3 -3
- package/build-style/separator/style.css +3 -3
- package/build-style/separator/theme-rtl.css +3 -3
- package/build-style/separator/theme.css +3 -3
- package/build-style/shortcode/editor-rtl.css +3 -3
- package/build-style/shortcode/editor.css +3 -3
- package/build-style/site-logo/editor-rtl.css +3 -3
- package/build-style/site-logo/editor.css +3 -3
- package/build-style/site-logo/style-rtl.css +3 -3
- package/build-style/site-logo/style.css +3 -3
- package/build-style/site-tagline/editor-rtl.css +3 -3
- package/build-style/site-tagline/editor.css +3 -3
- package/build-style/site-title/editor-rtl.css +3 -3
- package/build-style/site-title/editor.css +3 -3
- package/build-style/site-title/style-rtl.css +3 -3
- package/build-style/site-title/style.css +3 -3
- package/build-style/social-link/editor-rtl.css +3 -3
- package/build-style/social-link/editor.css +3 -3
- package/build-style/social-links/editor-rtl.css +3 -3
- package/build-style/social-links/editor.css +3 -3
- package/build-style/social-links/style-rtl.css +3 -3
- package/build-style/social-links/style.css +3 -3
- package/build-style/spacer/editor-rtl.css +3 -3
- package/build-style/spacer/editor.css +3 -3
- package/build-style/spacer/style-rtl.css +3 -3
- package/build-style/spacer/style.css +3 -3
- package/build-style/style-rtl.css +13 -5
- package/build-style/style.css +13 -5
- package/build-style/table/editor-rtl.css +3 -3
- package/build-style/table/editor.css +3 -3
- package/build-style/table/style-rtl.css +9 -3
- package/build-style/table/style.css +9 -3
- package/build-style/table/theme-rtl.css +3 -9
- package/build-style/table/theme.css +3 -9
- package/build-style/tag-cloud/style-rtl.css +3 -3
- package/build-style/tag-cloud/style.css +3 -3
- package/build-style/template-part/editor-rtl.css +3 -3
- package/build-style/template-part/editor.css +3 -3
- package/build-style/template-part/theme-rtl.css +3 -3
- package/build-style/template-part/theme.css +3 -3
- package/build-style/text-columns/editor-rtl.css +3 -3
- package/build-style/text-columns/editor.css +3 -3
- package/build-style/text-columns/style-rtl.css +3 -3
- package/build-style/text-columns/style.css +3 -3
- package/build-style/theme-rtl.css +3 -9
- package/build-style/theme.css +3 -9
- package/build-style/verse/style-rtl.css +7 -4
- package/build-style/verse/style.css +7 -4
- package/build-style/video/editor-rtl.css +3 -3
- package/build-style/video/editor.css +3 -3
- package/build-style/video/style-rtl.css +3 -3
- package/build-style/video/style.css +3 -3
- package/build-style/video/theme-rtl.css +3 -3
- package/build-style/video/theme.css +3 -3
- package/package.json +29 -29
- package/src/categories/edit.js +1 -1
- package/src/comments/index.php +0 -1
- package/src/cover/edit/inspector-controls.js +4 -4
- package/src/freeform/edit.js +48 -29
- package/src/freeform/modal.js +111 -0
- package/src/gallery/edit.js +17 -2
- package/src/gallery/gallery.js +3 -13
- package/src/image/image.js +1 -0
- package/src/latest-posts/test/__snapshots__/edit.native.js.snap +3 -0
- package/src/latest-posts/test/edit.native.js +49 -0
- package/src/media-text/edit.js +1 -0
- package/src/missing/edit.native.js +13 -6
- package/src/more/test/__snapshots__/edit.native.js.snap +7 -0
- package/src/more/test/edit.native.js +41 -0
- package/src/navigation/edit/index.js +3 -4
- package/src/navigation/edit/menu-inspector-controls.js +70 -29
- package/src/navigation/edit/navigation-menu-selector.js +19 -9
- package/src/navigation/edit/utils.js +82 -0
- package/src/navigation/editor.scss +0 -7
- package/src/navigation/index.php +32 -0
- package/src/navigation/style.scss +0 -1
- package/src/navigation-link/edit.js +5 -58
- package/src/navigation-link/index.php +32 -0
- package/src/navigation-submenu/edit.js +29 -100
- package/src/navigation-submenu/index.php +32 -0
- package/src/page-list/block.json +18 -1
- package/src/page-list/edit.js +30 -22
- package/src/page-list/editor.scss +4 -0
- package/src/page-list/index.js +8 -2
- package/src/page-list/index.php +9 -10
- package/src/page-list-item/edit.js +17 -9
- package/src/post-featured-image/overlay.js +0 -1
- package/src/query/edit/index.js +1 -0
- package/src/query/edit/inspector-controls/index.js +49 -38
- package/src/query/edit/inspector-controls/taxonomy-controls.js +102 -38
- package/src/query/edit/query-content.js +2 -1
- package/src/query/edit/query-placeholder.js +15 -14
- package/src/query/utils.js +59 -1
- package/src/search/edit.js +2 -2
- package/src/separator/test/__snapshots__/edit.native.js.snap +7 -0
- package/src/separator/test/edit.native.js +41 -0
- package/src/social-link/edit.js +3 -3
- package/src/social-links/edit.js +0 -1
- package/src/table/style.scss +8 -0
- package/src/table/theme.scss +0 -8
- package/src/table-of-contents/edit.js +1 -1
- package/src/template-part/edit/advanced-controls.js +12 -0
- package/src/template-part/edit/import-controls.js +180 -0
- package/src/template-part/edit/index.js +1 -0
- package/src/template-part/edit/utils/transformers.js +37 -0
- package/src/verse/style.scss +4 -1
- package/src/verse/test/__snapshots__/edit.native.js.snap +13 -0
- package/src/verse/test/edit.native.js +40 -33
- package/tsconfig.tsbuildinfo +1 -1
- package/build/query/constants.js +0 -16
- package/build/query/constants.js.map +0 -1
- package/build-module/query/constants.js +0 -7
- package/build-module/query/constants.js.map +0 -1
- package/src/query/constants.js +0 -7
|
@@ -151,7 +151,8 @@ export class UnsupportedBlockEdit extends Component {
|
|
|
151
151
|
const infoTitle = sprintf( titleFormat, blockTitle );
|
|
152
152
|
const missingBlockDetail = applyFilters(
|
|
153
153
|
'native.missing_block_detail',
|
|
154
|
-
__( 'We are working hard to add more blocks with each release.' )
|
|
154
|
+
__( 'We are working hard to add more blocks with each release.' ),
|
|
155
|
+
blockName
|
|
155
156
|
);
|
|
156
157
|
const missingBlockActionButton = applyFilters(
|
|
157
158
|
'native.missing_block_action_button',
|
|
@@ -205,11 +206,17 @@ export class UnsupportedBlockEdit extends Component {
|
|
|
205
206
|
<Text style={ [ infoTextStyle, infoTitleStyle ] }>
|
|
206
207
|
{ infoTitle }
|
|
207
208
|
</Text>
|
|
208
|
-
{ isEditableInUnsupportedBlockEditor &&
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
209
|
+
{ isEditableInUnsupportedBlockEditor &&
|
|
210
|
+
missingBlockDetail && (
|
|
211
|
+
<Text
|
|
212
|
+
style={ [
|
|
213
|
+
infoTextStyle,
|
|
214
|
+
infoDescriptionStyle,
|
|
215
|
+
] }
|
|
216
|
+
>
|
|
217
|
+
{ missingBlockDetail }
|
|
218
|
+
</Text>
|
|
219
|
+
) }
|
|
213
220
|
</View>
|
|
214
221
|
{ ( isUnsupportedBlockEditorSupported ||
|
|
215
222
|
canEnableUnsupportedBlockEditor ) &&
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import {
|
|
5
|
+
addBlock,
|
|
6
|
+
getEditorHtml,
|
|
7
|
+
initializeEditor,
|
|
8
|
+
getBlock,
|
|
9
|
+
} from 'test/helpers';
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* WordPress dependencies
|
|
13
|
+
*/
|
|
14
|
+
import { getBlockTypes, unregisterBlockType } from '@wordpress/blocks';
|
|
15
|
+
import { registerCoreBlocks } from '@wordpress/block-library';
|
|
16
|
+
|
|
17
|
+
beforeAll( () => {
|
|
18
|
+
// Register all core blocks
|
|
19
|
+
registerCoreBlocks();
|
|
20
|
+
} );
|
|
21
|
+
|
|
22
|
+
afterAll( () => {
|
|
23
|
+
// Clean up registered blocks
|
|
24
|
+
getBlockTypes().forEach( ( block ) => {
|
|
25
|
+
unregisterBlockType( block.name );
|
|
26
|
+
} );
|
|
27
|
+
} );
|
|
28
|
+
|
|
29
|
+
describe( 'More block', () => {
|
|
30
|
+
it( 'inserts block', async () => {
|
|
31
|
+
const screen = await initializeEditor();
|
|
32
|
+
|
|
33
|
+
// Add block
|
|
34
|
+
await addBlock( screen, 'More' );
|
|
35
|
+
|
|
36
|
+
// Get block
|
|
37
|
+
const moreBlock = await getBlock( screen, 'More' );
|
|
38
|
+
expect( moreBlock ).toBeVisible();
|
|
39
|
+
expect( getEditorHtml() ).toMatchSnapshot();
|
|
40
|
+
} );
|
|
41
|
+
} );
|
|
@@ -648,7 +648,6 @@ function Navigation( {
|
|
|
648
648
|
{ hasColorSettings && (
|
|
649
649
|
<>
|
|
650
650
|
<ColorGradientSettingsDropdown
|
|
651
|
-
__experimentalHasMultipleOrigins
|
|
652
651
|
__experimentalIsRenderedInSidebar
|
|
653
652
|
settings={ [
|
|
654
653
|
{
|
|
@@ -717,13 +716,13 @@ function Navigation( {
|
|
|
717
716
|
return (
|
|
718
717
|
<TagName { ...blockProps }>
|
|
719
718
|
<MenuInspectorControls
|
|
719
|
+
clientId={ clientId }
|
|
720
720
|
createNavigationMenuIsSuccess={
|
|
721
721
|
createNavigationMenuIsSuccess
|
|
722
722
|
}
|
|
723
723
|
createNavigationMenuIsError={ createNavigationMenuIsError }
|
|
724
724
|
currentMenuId={ ref }
|
|
725
725
|
isNavigationMenuMissing={ isNavigationMenuMissing }
|
|
726
|
-
innerBlocks={ innerBlocks }
|
|
727
726
|
isManageMenusButtonDisabled={ isManageMenusButtonDisabled }
|
|
728
727
|
onCreateNew={ createUntitledEmptyNavigationMenu }
|
|
729
728
|
onSelectClassicMenu={ onSelectClassicMenu }
|
|
@@ -759,12 +758,12 @@ function Navigation( {
|
|
|
759
758
|
return (
|
|
760
759
|
<TagName { ...blockProps }>
|
|
761
760
|
<MenuInspectorControls
|
|
761
|
+
clientId={ clientId }
|
|
762
762
|
createNavigationMenuIsSuccess={
|
|
763
763
|
createNavigationMenuIsSuccess
|
|
764
764
|
}
|
|
765
765
|
createNavigationMenuIsError={ createNavigationMenuIsError }
|
|
766
766
|
isNavigationMenuMissing={ isNavigationMenuMissing }
|
|
767
|
-
innerBlocks={ innerBlocks }
|
|
768
767
|
isManageMenusButtonDisabled={ isManageMenusButtonDisabled }
|
|
769
768
|
onCreateNew={ createUntitledEmptyNavigationMenu }
|
|
770
769
|
onSelectClassicMenu={ onSelectClassicMenu }
|
|
@@ -832,13 +831,13 @@ function Navigation( {
|
|
|
832
831
|
<EntityProvider kind="postType" type="wp_navigation" id={ ref }>
|
|
833
832
|
<RecursionProvider uniqueId={ recursionId }>
|
|
834
833
|
<MenuInspectorControls
|
|
834
|
+
clientId={ clientId }
|
|
835
835
|
createNavigationMenuIsSuccess={
|
|
836
836
|
createNavigationMenuIsSuccess
|
|
837
837
|
}
|
|
838
838
|
createNavigationMenuIsError={ createNavigationMenuIsError }
|
|
839
839
|
currentMenuId={ ref }
|
|
840
840
|
isNavigationMenuMissing={ isNavigationMenuMissing }
|
|
841
|
-
innerBlocks={ innerBlocks }
|
|
842
841
|
isManageMenusButtonDisabled={ isManageMenusButtonDisabled }
|
|
843
842
|
onCreateNew={ createUntitledEmptyNavigationMenu }
|
|
844
843
|
onSelectClassicMenu={ onSelectClassicMenu }
|
|
@@ -4,8 +4,14 @@
|
|
|
4
4
|
import {
|
|
5
5
|
__experimentalOffCanvasEditor as OffCanvasEditor,
|
|
6
6
|
InspectorControls,
|
|
7
|
+
store as blockEditorStore,
|
|
7
8
|
} from '@wordpress/block-editor';
|
|
8
|
-
import {
|
|
9
|
+
import {
|
|
10
|
+
PanelBody,
|
|
11
|
+
__experimentalHStack as HStack,
|
|
12
|
+
__experimentalHeading as Heading,
|
|
13
|
+
} from '@wordpress/components';
|
|
14
|
+
import { useSelect } from '@wordpress/data';
|
|
9
15
|
import { __ } from '@wordpress/i18n';
|
|
10
16
|
|
|
11
17
|
/**
|
|
@@ -15,10 +21,11 @@ import ManageMenusButton from './manage-menus-button';
|
|
|
15
21
|
import NavigationMenuSelector from './navigation-menu-selector';
|
|
16
22
|
|
|
17
23
|
const MenuInspectorControls = ( {
|
|
24
|
+
clientId,
|
|
18
25
|
createNavigationMenuIsSuccess,
|
|
19
26
|
createNavigationMenuIsError,
|
|
20
27
|
currentMenuId = null,
|
|
21
|
-
|
|
28
|
+
isNavigationMenuMissing,
|
|
22
29
|
isManageMenusButtonDisabled,
|
|
23
30
|
onCreateNew,
|
|
24
31
|
onSelectClassicMenu,
|
|
@@ -32,6 +39,16 @@ const MenuInspectorControls = ( {
|
|
|
32
39
|
/* translators: %s: The name of a menu. */
|
|
33
40
|
const actionLabel = __( "Switch to '%s'" );
|
|
34
41
|
|
|
42
|
+
// Provide a hierarchy of clientIds for the given Navigation block (clientId).
|
|
43
|
+
// This is required else the list view will display the entire block tree.
|
|
44
|
+
const clientIdsTree = useSelect(
|
|
45
|
+
( select ) => {
|
|
46
|
+
const { __unstableGetClientIdsTree } = select( blockEditorStore );
|
|
47
|
+
return __unstableGetClientIdsTree( clientId );
|
|
48
|
+
},
|
|
49
|
+
[ clientId ]
|
|
50
|
+
);
|
|
51
|
+
|
|
35
52
|
return (
|
|
36
53
|
<InspectorControls __experimentalGroup={ menuControlsSlot }>
|
|
37
54
|
<PanelBody
|
|
@@ -39,37 +56,61 @@ const MenuInspectorControls = ( {
|
|
|
39
56
|
isOffCanvasNavigationEditorEnabled ? null : __( 'Menu' )
|
|
40
57
|
}
|
|
41
58
|
>
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
{ isOffCanvasNavigationEditorEnabled ? (
|
|
60
|
+
<>
|
|
61
|
+
<HStack className="wp-block-navigation-off-canvas-editor__header">
|
|
62
|
+
<Heading
|
|
63
|
+
className="wp-block-navigation-off-canvas-editor__title"
|
|
64
|
+
level={ 2 }
|
|
65
|
+
>
|
|
66
|
+
{ __( 'Menu' ) }
|
|
67
|
+
</Heading>
|
|
68
|
+
<NavigationMenuSelector
|
|
69
|
+
currentMenuId={ currentMenuId }
|
|
70
|
+
onSelectClassicMenu={ onSelectClassicMenu }
|
|
71
|
+
onSelectNavigationMenu={
|
|
72
|
+
onSelectNavigationMenu
|
|
73
|
+
}
|
|
74
|
+
onCreateNew={ onCreateNew }
|
|
75
|
+
createNavigationMenuIsSuccess={
|
|
76
|
+
createNavigationMenuIsSuccess
|
|
77
|
+
}
|
|
78
|
+
createNavigationMenuIsError={
|
|
79
|
+
createNavigationMenuIsError
|
|
80
|
+
}
|
|
81
|
+
actionLabel={ actionLabel }
|
|
82
|
+
/>
|
|
83
|
+
</HStack>
|
|
84
|
+
{ currentMenuId && isNavigationMenuMissing ? (
|
|
85
|
+
<p>{ __( 'Select or create a menu' ) }</p>
|
|
86
|
+
) : (
|
|
87
|
+
<OffCanvasEditor
|
|
88
|
+
blocks={ clientIdsTree }
|
|
89
|
+
isExpanded={ true }
|
|
90
|
+
selectBlockInCanvas={ false }
|
|
91
|
+
/>
|
|
92
|
+
) }
|
|
93
|
+
</>
|
|
94
|
+
) : (
|
|
95
|
+
<>
|
|
96
|
+
<NavigationMenuSelector
|
|
97
|
+
currentMenuId={ currentMenuId }
|
|
98
|
+
onSelectClassicMenu={ onSelectClassicMenu }
|
|
99
|
+
onSelectNavigationMenu={ onSelectNavigationMenu }
|
|
100
|
+
onCreateNew={ onCreateNew }
|
|
101
|
+
createNavigationMenuIsSuccess={
|
|
102
|
+
createNavigationMenuIsSuccess
|
|
103
|
+
}
|
|
104
|
+
createNavigationMenuIsError={
|
|
105
|
+
createNavigationMenuIsError
|
|
106
|
+
}
|
|
107
|
+
actionLabel={ actionLabel }
|
|
66
108
|
/>
|
|
67
|
-
) : (
|
|
68
109
|
<ManageMenusButton
|
|
69
110
|
disabled={ isManageMenusButtonDisabled }
|
|
70
111
|
/>
|
|
71
|
-
|
|
72
|
-
|
|
112
|
+
</>
|
|
113
|
+
) }
|
|
73
114
|
</PanelBody>
|
|
74
115
|
</InspectorControls>
|
|
75
116
|
);
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
VisuallyHidden,
|
|
11
11
|
} from '@wordpress/components';
|
|
12
12
|
import { useEntityProp } from '@wordpress/core-data';
|
|
13
|
-
import { Icon, chevronUp, chevronDown } from '@wordpress/icons';
|
|
13
|
+
import { Icon, chevronUp, chevronDown, moreVertical } from '@wordpress/icons';
|
|
14
14
|
import { __, sprintf } from '@wordpress/i18n';
|
|
15
15
|
import { decodeEntities } from '@wordpress/html-entities';
|
|
16
16
|
import { useEffect, useMemo, useState } from '@wordpress/element';
|
|
@@ -31,6 +31,8 @@ function NavigationMenuSelector( {
|
|
|
31
31
|
createNavigationMenuIsError,
|
|
32
32
|
toggleProps = {},
|
|
33
33
|
} ) {
|
|
34
|
+
const isOffCanvasNavigationEditorEnabled =
|
|
35
|
+
window?.__experimentalEnableOffCanvasNavigationEditor === true;
|
|
34
36
|
/* translators: %s: The name of a menu. */
|
|
35
37
|
const createActionLabel = __( "Create from '%s'" );
|
|
36
38
|
|
|
@@ -140,7 +142,11 @@ function NavigationMenuSelector( {
|
|
|
140
142
|
},
|
|
141
143
|
};
|
|
142
144
|
|
|
143
|
-
if (
|
|
145
|
+
if (
|
|
146
|
+
! hasNavigationMenus &&
|
|
147
|
+
! hasClassicMenus &&
|
|
148
|
+
! isOffCanvasNavigationEditorEnabled
|
|
149
|
+
) {
|
|
144
150
|
return (
|
|
145
151
|
<Button
|
|
146
152
|
className="wp-block-navigation__navigation-selector-button--createnew"
|
|
@@ -161,15 +167,19 @@ function NavigationMenuSelector( {
|
|
|
161
167
|
|
|
162
168
|
return (
|
|
163
169
|
<DropdownMenu
|
|
164
|
-
className=
|
|
170
|
+
className={
|
|
171
|
+
isOffCanvasNavigationEditorEnabled
|
|
172
|
+
? ''
|
|
173
|
+
: 'wp-block-navigation__navigation-selector'
|
|
174
|
+
}
|
|
165
175
|
label={ selectorLabel }
|
|
166
|
-
text={
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
176
|
+
text={ isOffCanvasNavigationEditorEnabled ? '' : selectorLabel }
|
|
177
|
+
icon={ isOffCanvasNavigationEditorEnabled ? moreVertical : null }
|
|
178
|
+
toggleProps={
|
|
179
|
+
isOffCanvasNavigationEditorEnabled
|
|
180
|
+
? { isSmall: true }
|
|
181
|
+
: toggleProps
|
|
170
182
|
}
|
|
171
|
-
icon={ null }
|
|
172
|
-
toggleProps={ toggleProps }
|
|
173
183
|
>
|
|
174
184
|
{ ( { onClose } ) => (
|
|
175
185
|
<>
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* External dependencies
|
|
3
|
+
*/
|
|
4
|
+
import classnames from 'classnames';
|
|
5
|
+
|
|
1
6
|
function getComputedStyle( node ) {
|
|
2
7
|
return node.ownerDocument.defaultView.getComputedStyle( node );
|
|
3
8
|
}
|
|
@@ -28,3 +33,80 @@ export function detectColors(
|
|
|
28
33
|
|
|
29
34
|
setBackground( backgroundColor );
|
|
30
35
|
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Determine the colors for a menu.
|
|
39
|
+
*
|
|
40
|
+
* Order of priority is:
|
|
41
|
+
* 1: Overlay custom colors (if submenu)
|
|
42
|
+
* 2: Overlay theme colors (if submenu)
|
|
43
|
+
* 3: Custom colors
|
|
44
|
+
* 4: Theme colors
|
|
45
|
+
* 5: Global styles
|
|
46
|
+
*
|
|
47
|
+
* @param {Object} context
|
|
48
|
+
* @param {boolean} isSubMenu
|
|
49
|
+
*/
|
|
50
|
+
export function getColors( context, isSubMenu ) {
|
|
51
|
+
const {
|
|
52
|
+
textColor,
|
|
53
|
+
customTextColor,
|
|
54
|
+
backgroundColor,
|
|
55
|
+
customBackgroundColor,
|
|
56
|
+
overlayTextColor,
|
|
57
|
+
customOverlayTextColor,
|
|
58
|
+
overlayBackgroundColor,
|
|
59
|
+
customOverlayBackgroundColor,
|
|
60
|
+
style,
|
|
61
|
+
} = context;
|
|
62
|
+
|
|
63
|
+
const colors = {};
|
|
64
|
+
|
|
65
|
+
if ( isSubMenu && !! customOverlayTextColor ) {
|
|
66
|
+
colors.customTextColor = customOverlayTextColor;
|
|
67
|
+
} else if ( isSubMenu && !! overlayTextColor ) {
|
|
68
|
+
colors.textColor = overlayTextColor;
|
|
69
|
+
} else if ( !! customTextColor ) {
|
|
70
|
+
colors.customTextColor = customTextColor;
|
|
71
|
+
} else if ( !! textColor ) {
|
|
72
|
+
colors.textColor = textColor;
|
|
73
|
+
} else if ( !! style?.color?.text ) {
|
|
74
|
+
colors.customTextColor = style.color.text;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
if ( isSubMenu && !! customOverlayBackgroundColor ) {
|
|
78
|
+
colors.customBackgroundColor = customOverlayBackgroundColor;
|
|
79
|
+
} else if ( isSubMenu && !! overlayBackgroundColor ) {
|
|
80
|
+
colors.backgroundColor = overlayBackgroundColor;
|
|
81
|
+
} else if ( !! customBackgroundColor ) {
|
|
82
|
+
colors.customBackgroundColor = customBackgroundColor;
|
|
83
|
+
} else if ( !! backgroundColor ) {
|
|
84
|
+
colors.backgroundColor = backgroundColor;
|
|
85
|
+
} else if ( !! style?.color?.background ) {
|
|
86
|
+
colors.customTextColor = style.color.background;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return colors;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export function getNavigationChildBlockProps( innerBlocksColors ) {
|
|
93
|
+
return {
|
|
94
|
+
className: classnames( 'wp-block-navigation__submenu-container', {
|
|
95
|
+
'has-text-color': !! (
|
|
96
|
+
innerBlocksColors.textColor || innerBlocksColors.customTextColor
|
|
97
|
+
),
|
|
98
|
+
[ `has-${ innerBlocksColors.textColor }-color` ]:
|
|
99
|
+
!! innerBlocksColors.textColor,
|
|
100
|
+
'has-background': !! (
|
|
101
|
+
innerBlocksColors.backgroundColor ||
|
|
102
|
+
innerBlocksColors.customBackgroundColor
|
|
103
|
+
),
|
|
104
|
+
[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]:
|
|
105
|
+
!! innerBlocksColors.backgroundColor,
|
|
106
|
+
} ),
|
|
107
|
+
style: {
|
|
108
|
+
color: innerBlocksColors.customTextColor,
|
|
109
|
+
backgroundColor: innerBlocksColors.customBackgroundColor,
|
|
110
|
+
},
|
|
111
|
+
};
|
|
112
|
+
}
|
|
@@ -32,13 +32,6 @@
|
|
|
32
32
|
* Submenus.
|
|
33
33
|
*/
|
|
34
34
|
|
|
35
|
-
// Ensure sub-menus stay open and visible when a nested block is selected.
|
|
36
|
-
.wp-block-navigation__container.is-parent-of-selected-block {
|
|
37
|
-
visibility: visible;
|
|
38
|
-
opacity: 1;
|
|
39
|
-
overflow: visible;
|
|
40
|
-
}
|
|
41
|
-
|
|
42
35
|
// Low specificity default to ensure background color applies to submenus.
|
|
43
36
|
.wp-block-navigation__container,
|
|
44
37
|
.wp-block-navigation-item {
|
package/src/navigation/index.php
CHANGED
|
@@ -856,3 +856,35 @@ function block_core_navigation_typographic_presets_backcompatibility( $parsed_bl
|
|
|
856
856
|
}
|
|
857
857
|
|
|
858
858
|
add_filter( 'render_block_data', 'block_core_navigation_typographic_presets_backcompatibility' );
|
|
859
|
+
|
|
860
|
+
/**
|
|
861
|
+
* Enables animation of the block inspector for the Navigation block.
|
|
862
|
+
*
|
|
863
|
+
* See:
|
|
864
|
+
* - https://github.com/WordPress/gutenberg/pull/46342
|
|
865
|
+
* - https://github.com/WordPress/gutenberg/issues/45884
|
|
866
|
+
*
|
|
867
|
+
* @param array $settings Default editor settings.
|
|
868
|
+
* @return array Filtered editor settings.
|
|
869
|
+
*/
|
|
870
|
+
function gutenberg_enable_animation_for_navigation_inspector( $settings ) {
|
|
871
|
+
$current_animation_settings = _wp_array_get(
|
|
872
|
+
$settings,
|
|
873
|
+
array( '__experimentalBlockInspectorAnimation' ),
|
|
874
|
+
array()
|
|
875
|
+
);
|
|
876
|
+
|
|
877
|
+
$settings['__experimentalBlockInspectorAnimation'] = array_merge(
|
|
878
|
+
$current_animation_settings,
|
|
879
|
+
array(
|
|
880
|
+
'core/navigation' =>
|
|
881
|
+
array(
|
|
882
|
+
'enterDirection' => 'leftToRight',
|
|
883
|
+
),
|
|
884
|
+
)
|
|
885
|
+
);
|
|
886
|
+
|
|
887
|
+
return $settings;
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
add_filter( 'block_editor_settings_all', 'gutenberg_enable_animation_for_navigation_inspector' );
|
|
@@ -533,7 +533,6 @@ button.wp-block-navigation-item__content {
|
|
|
533
533
|
}
|
|
534
534
|
|
|
535
535
|
// Always expand/unfold submenus inside the modal.
|
|
536
|
-
.has-child .submenu-container,
|
|
537
536
|
.has-child .wp-block-navigation__submenu-container {
|
|
538
537
|
// Unset CSS that hides dropdown menus.
|
|
539
538
|
opacity: 1;
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
useInnerBlocksProps,
|
|
31
31
|
} from '@wordpress/block-editor';
|
|
32
32
|
import { isURL, prependHTTP } from '@wordpress/url';
|
|
33
|
-
import {
|
|
33
|
+
import { useState, useEffect, useRef } from '@wordpress/element';
|
|
34
34
|
import {
|
|
35
35
|
placeCaretAtHorizontalEdge,
|
|
36
36
|
__unstableStripHTML as stripHTML,
|
|
@@ -48,6 +48,7 @@ import { useMergeRefs } from '@wordpress/compose';
|
|
|
48
48
|
import { name } from './block.json';
|
|
49
49
|
import { LinkUI } from './link-ui';
|
|
50
50
|
import { updateAttributes } from './update-attributes';
|
|
51
|
+
import { getColors } from '../navigation/edit/utils';
|
|
51
52
|
|
|
52
53
|
/**
|
|
53
54
|
* A React hook to determine if it's dragging within the target element.
|
|
@@ -100,61 +101,6 @@ const useIsDraggingWithin = ( elementRef ) => {
|
|
|
100
101
|
return isDraggingWithin;
|
|
101
102
|
};
|
|
102
103
|
|
|
103
|
-
/**
|
|
104
|
-
* Determine the colors for a menu.
|
|
105
|
-
*
|
|
106
|
-
* Order of priority is:
|
|
107
|
-
* 1: Overlay custom colors (if submenu)
|
|
108
|
-
* 2: Overlay theme colors (if submenu)
|
|
109
|
-
* 3: Custom colors
|
|
110
|
-
* 4: Theme colors
|
|
111
|
-
* 5: Global styles
|
|
112
|
-
*
|
|
113
|
-
* @param {Object} context
|
|
114
|
-
* @param {boolean} isSubMenu
|
|
115
|
-
*/
|
|
116
|
-
function getColors( context, isSubMenu ) {
|
|
117
|
-
const {
|
|
118
|
-
textColor,
|
|
119
|
-
customTextColor,
|
|
120
|
-
backgroundColor,
|
|
121
|
-
customBackgroundColor,
|
|
122
|
-
overlayTextColor,
|
|
123
|
-
customOverlayTextColor,
|
|
124
|
-
overlayBackgroundColor,
|
|
125
|
-
customOverlayBackgroundColor,
|
|
126
|
-
style,
|
|
127
|
-
} = context;
|
|
128
|
-
|
|
129
|
-
const colors = {};
|
|
130
|
-
|
|
131
|
-
if ( isSubMenu && !! customOverlayTextColor ) {
|
|
132
|
-
colors.customTextColor = customOverlayTextColor;
|
|
133
|
-
} else if ( isSubMenu && !! overlayTextColor ) {
|
|
134
|
-
colors.textColor = overlayTextColor;
|
|
135
|
-
} else if ( !! customTextColor ) {
|
|
136
|
-
colors.customTextColor = customTextColor;
|
|
137
|
-
} else if ( !! textColor ) {
|
|
138
|
-
colors.textColor = textColor;
|
|
139
|
-
} else if ( !! style?.color?.text ) {
|
|
140
|
-
colors.customTextColor = style.color.text;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
if ( isSubMenu && !! customOverlayBackgroundColor ) {
|
|
144
|
-
colors.customBackgroundColor = customOverlayBackgroundColor;
|
|
145
|
-
} else if ( isSubMenu && !! overlayBackgroundColor ) {
|
|
146
|
-
colors.backgroundColor = overlayBackgroundColor;
|
|
147
|
-
} else if ( !! customBackgroundColor ) {
|
|
148
|
-
colors.customBackgroundColor = customBackgroundColor;
|
|
149
|
-
} else if ( !! backgroundColor ) {
|
|
150
|
-
colors.backgroundColor = backgroundColor;
|
|
151
|
-
} else if ( !! style?.color?.background ) {
|
|
152
|
-
colors.customTextColor = style.color.background;
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
return colors;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
104
|
const useIsInvalidLink = ( kind, type, id ) => {
|
|
159
105
|
const isPostType =
|
|
160
106
|
kind === 'post-type' || type === 'post' || type === 'page';
|
|
@@ -455,7 +401,7 @@ export default function NavigationLinkEdit( {
|
|
|
455
401
|
: __( 'This item is missing a link' );
|
|
456
402
|
|
|
457
403
|
return (
|
|
458
|
-
|
|
404
|
+
<>
|
|
459
405
|
<BlockControls>
|
|
460
406
|
<ToolbarGroup>
|
|
461
407
|
<ToolbarButton
|
|
@@ -495,6 +441,7 @@ export default function NavigationLinkEdit( {
|
|
|
495
441
|
autoComplete="off"
|
|
496
442
|
/>
|
|
497
443
|
<TextareaControl
|
|
444
|
+
__nextHasNoMarginBottom
|
|
498
445
|
value={ description || '' }
|
|
499
446
|
onChange={ ( descriptionValue ) => {
|
|
500
447
|
setAttributes( { description: descriptionValue } );
|
|
@@ -644,6 +591,6 @@ export default function NavigationLinkEdit( {
|
|
|
644
591
|
</a>
|
|
645
592
|
<div { ...innerBlocksProps } />
|
|
646
593
|
</div>
|
|
647
|
-
|
|
594
|
+
</>
|
|
648
595
|
);
|
|
649
596
|
}
|
|
@@ -376,3 +376,35 @@ function gutenberg_disable_tabs_for_navigation_link_block( $settings ) {
|
|
|
376
376
|
}
|
|
377
377
|
|
|
378
378
|
add_filter( 'block_editor_settings_all', 'gutenberg_disable_tabs_for_navigation_link_block' );
|
|
379
|
+
|
|
380
|
+
/**
|
|
381
|
+
* Enables animation of the block inspector for the Navigation Link block.
|
|
382
|
+
*
|
|
383
|
+
* See:
|
|
384
|
+
* - https://github.com/WordPress/gutenberg/pull/46342
|
|
385
|
+
* - https://github.com/WordPress/gutenberg/issues/45884
|
|
386
|
+
*
|
|
387
|
+
* @param array $settings Default editor settings.
|
|
388
|
+
* @return array Filtered editor settings.
|
|
389
|
+
*/
|
|
390
|
+
function gutenberg_enable_animation_for_navigation_link_inspector( $settings ) {
|
|
391
|
+
$current_animation_settings = _wp_array_get(
|
|
392
|
+
$settings,
|
|
393
|
+
array( '__experimentalBlockInspectorAnimation' ),
|
|
394
|
+
array()
|
|
395
|
+
);
|
|
396
|
+
|
|
397
|
+
$settings['__experimentalBlockInspectorAnimation'] = array_merge(
|
|
398
|
+
$current_animation_settings,
|
|
399
|
+
array(
|
|
400
|
+
'core/navigation-link' =>
|
|
401
|
+
array(
|
|
402
|
+
'enterDirection' => 'rightToLeft',
|
|
403
|
+
),
|
|
404
|
+
)
|
|
405
|
+
);
|
|
406
|
+
|
|
407
|
+
return $settings;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
add_filter( 'block_editor_settings_all', 'gutenberg_enable_animation_for_navigation_link_inspector' );
|