@wordpress/block-library 8.0.0 → 8.2.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/LICENSE.md +1 -1
- package/build/archives/edit.js +1 -0
- package/build/archives/edit.js.map +1 -1
- package/build/audio/edit.js +2 -0
- package/build/audio/edit.js.map +1 -1
- package/build/categories/edit.js +1 -1
- package/build/categories/edit.js.map +1 -1
- package/build/comments/edit/comments-inspector-controls.js +9 -3
- package/build/comments/edit/comments-inspector-controls.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/embed/embed-preview.js +1 -0
- package/build/embed/embed-preview.js.map +1 -1
- package/build/file/inspector.js +1 -0
- package/build/file/inspector.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 +15 -2
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.js +3 -16
- package/build/gallery/gallery.js.map +1 -1
- package/build/gallery/v1/edit.js +2 -0
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/group/edit.js +1 -0
- 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/image.js +7 -10
- package/build/image/image.js.map +1 -1
- package/build/latest-posts/edit.js +11 -8
- package/build/latest-posts/edit.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 +9 -7
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/menu-inspector-controls.js +81 -22
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build/navigation/edit/navigation-menu-selector.js +15 -10
- 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/leaf-more-menu.js +95 -0
- package/build/navigation/leaf-more-menu.js.map +1 -0
- package/build/navigation-link/edit.js +10 -61
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/update-attributes.js +3 -3
- package/build/navigation-link/update-attributes.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/page-list-item/index.js +2 -1
- package/build/page-list-item/index.js.map +1 -1
- package/build/post-author/edit.js +2 -0
- package/build/post-author/edit.js.map +1 -1
- package/build/post-featured-image/dimension-controls.js +1 -0
- package/build/post-featured-image/dimension-controls.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 +11 -5
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/inspector-controls/order-control.js +1 -0
- package/build/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build/query/edit/inspector-controls/sticky-control.js +1 -0
- package/build/query/edit/inspector-controls/sticky-control.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 +10 -4
- 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 +2 -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/edit.js +1 -0
- package/build/table/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/tag-cloud/edit.js +1 -0
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/advanced-controls.js +23 -2
- 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/video/edit-common-settings.js +6 -5
- package/build/video/edit-common-settings.js.map +1 -1
- package/build/video/edit.js +1 -0
- package/build/video/edit.js.map +1 -1
- package/build/video/tracks-editor.js +1 -0
- package/build/video/tracks-editor.js.map +1 -1
- package/build-module/archives/edit.js +1 -0
- package/build-module/archives/edit.js.map +1 -1
- package/build-module/audio/edit.js +2 -0
- package/build-module/audio/edit.js.map +1 -1
- package/build-module/categories/edit.js +1 -1
- package/build-module/categories/edit.js.map +1 -1
- package/build-module/comments/edit/comments-inspector-controls.js +9 -3
- package/build-module/comments/edit/comments-inspector-controls.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/embed/embed-preview.js +1 -0
- package/build-module/embed/embed-preview.js.map +1 -1
- package/build-module/file/inspector.js +1 -0
- package/build-module/file/inspector.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 +16 -3
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.js +4 -16
- package/build-module/gallery/gallery.js.map +1 -1
- package/build-module/gallery/v1/edit.js +2 -0
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/group/edit.js +1 -0
- 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/image.js +7 -10
- package/build-module/image/image.js.map +1 -1
- package/build-module/latest-posts/edit.js +12 -9
- package/build-module/latest-posts/edit.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 +9 -7
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/menu-inspector-controls.js +80 -25
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -1
- package/build-module/navigation/edit/navigation-menu-selector.js +16 -11
- 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/leaf-more-menu.js +76 -0
- package/build-module/navigation/leaf-more-menu.js.map +1 -0
- package/build-module/navigation-link/edit.js +10 -62
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +3 -3
- package/build-module/navigation-link/update-attributes.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/page-list-item/index.js +2 -1
- package/build-module/page-list-item/index.js.map +1 -1
- package/build-module/post-author/edit.js +2 -0
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-featured-image/dimension-controls.js +1 -0
- package/build-module/post-featured-image/dimension-controls.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 +11 -5
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/inspector-controls/order-control.js +1 -0
- package/build-module/query/edit/inspector-controls/order-control.js.map +1 -1
- package/build-module/query/edit/inspector-controls/sticky-control.js +1 -0
- package/build-module/query/edit/inspector-controls/sticky-control.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 +9 -2
- 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 +4 -3
- 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/edit.js +1 -0
- package/build-module/table/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/tag-cloud/edit.js +1 -0
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/advanced-controls.js +22 -2
- 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-module/video/edit-common-settings.js +6 -5
- package/build-module/video/edit-common-settings.js.map +1 -1
- package/build-module/video/edit.js +1 -0
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/tracks-editor.js +1 -0
- package/build-module/video/tracks-editor.js.map +1 -1
- 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/archives/edit.js +1 -0
- package/src/audio/edit.js +2 -0
- package/src/categories/edit.js +1 -1
- package/src/comments/edit/comments-inspector-controls.js +12 -2
- package/src/comments/index.php +0 -1
- package/src/cover/edit/inspector-controls.js +4 -4
- package/src/embed/embed-preview.js +1 -0
- package/src/file/inspector.js +1 -0
- package/src/freeform/edit.js +48 -29
- package/src/freeform/modal.js +111 -0
- package/src/gallery/edit.js +19 -2
- package/src/gallery/gallery.js +4 -13
- package/src/gallery/v1/edit.js +2 -0
- package/src/group/block.json +3 -0
- package/src/group/edit.js +1 -0
- package/src/image/image.js +27 -36
- package/src/latest-posts/edit.js +6 -7
- 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 +6 -4
- package/src/navigation/edit/menu-inspector-controls.js +115 -44
- package/src/navigation/edit/navigation-menu-selector.js +24 -11
- 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/leaf-more-menu.js +93 -0
- package/src/navigation/style.scss +0 -1
- package/src/navigation-link/edit.js +23 -65
- package/src/navigation-link/index.php +62 -3
- package/src/navigation-link/update-attributes.js +1 -1
- package/src/navigation-submenu/edit.js +29 -100
- package/src/navigation-submenu/index.php +34 -2
- 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 +14 -10
- package/src/page-list-item/block.json +2 -1
- package/src/page-list-item/edit.js +17 -9
- package/src/post-author/edit.js +2 -0
- package/src/post-featured-image/dimension-controls.js +1 -0
- 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 +50 -38
- package/src/query/edit/inspector-controls/order-control.js +1 -0
- package/src/query/edit/inspector-controls/sticky-control.js +1 -0
- package/src/query/edit/inspector-controls/taxonomy-controls.js +102 -38
- package/src/query/edit/query-content.js +15 -1
- package/src/query/edit/query-placeholder.js +15 -14
- package/src/query/utils.js +59 -1
- package/src/rss/index.php +1 -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 +5 -4
- package/src/social-links/edit.js +0 -1
- package/src/table/edit.js +1 -0
- 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/tag-cloud/edit.js +1 -0
- package/src/template-part/edit/advanced-controls.js +36 -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/src/video/edit-common-settings.js +6 -5
- package/src/video/edit.js +1 -0
- package/src/video/tracks-editor.js +1 -0
- 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
|
@@ -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,17 +716,18 @@ 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 }
|
|
730
729
|
onSelectNavigationMenu={ onSelectNavigationMenu }
|
|
730
|
+
isLoading={ isLoading }
|
|
731
731
|
/>
|
|
732
732
|
{ stylingInspectorControls }
|
|
733
733
|
<ResponsiveWrapper
|
|
@@ -759,16 +759,17 @@ function Navigation( {
|
|
|
759
759
|
return (
|
|
760
760
|
<TagName { ...blockProps }>
|
|
761
761
|
<MenuInspectorControls
|
|
762
|
+
clientId={ clientId }
|
|
762
763
|
createNavigationMenuIsSuccess={
|
|
763
764
|
createNavigationMenuIsSuccess
|
|
764
765
|
}
|
|
765
766
|
createNavigationMenuIsError={ createNavigationMenuIsError }
|
|
766
767
|
isNavigationMenuMissing={ isNavigationMenuMissing }
|
|
767
|
-
innerBlocks={ innerBlocks }
|
|
768
768
|
isManageMenusButtonDisabled={ isManageMenusButtonDisabled }
|
|
769
769
|
onCreateNew={ createUntitledEmptyNavigationMenu }
|
|
770
770
|
onSelectClassicMenu={ onSelectClassicMenu }
|
|
771
771
|
onSelectNavigationMenu={ onSelectNavigationMenu }
|
|
772
|
+
isLoading={ isLoading }
|
|
772
773
|
/>
|
|
773
774
|
<Warning>
|
|
774
775
|
{ __(
|
|
@@ -832,17 +833,18 @@ function Navigation( {
|
|
|
832
833
|
<EntityProvider kind="postType" type="wp_navigation" id={ ref }>
|
|
833
834
|
<RecursionProvider uniqueId={ recursionId }>
|
|
834
835
|
<MenuInspectorControls
|
|
836
|
+
clientId={ clientId }
|
|
835
837
|
createNavigationMenuIsSuccess={
|
|
836
838
|
createNavigationMenuIsSuccess
|
|
837
839
|
}
|
|
838
840
|
createNavigationMenuIsError={ createNavigationMenuIsError }
|
|
839
841
|
currentMenuId={ ref }
|
|
840
842
|
isNavigationMenuMissing={ isNavigationMenuMissing }
|
|
841
|
-
innerBlocks={ innerBlocks }
|
|
842
843
|
isManageMenusButtonDisabled={ isManageMenusButtonDisabled }
|
|
843
844
|
onCreateNew={ createUntitledEmptyNavigationMenu }
|
|
844
845
|
onSelectClassicMenu={ onSelectClassicMenu }
|
|
845
846
|
onSelectNavigationMenu={ onSelectNavigationMenu }
|
|
847
|
+
isLoading={ isLoading }
|
|
846
848
|
/>
|
|
847
849
|
{ stylingInspectorControls }
|
|
848
850
|
{ isEntityAvailable && (
|
|
@@ -4,8 +4,15 @@
|
|
|
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
|
+
Spinner,
|
|
14
|
+
} from '@wordpress/components';
|
|
15
|
+
import { useSelect } from '@wordpress/data';
|
|
9
16
|
import { __ } from '@wordpress/i18n';
|
|
10
17
|
|
|
11
18
|
/**
|
|
@@ -13,24 +20,114 @@ import { __ } from '@wordpress/i18n';
|
|
|
13
20
|
*/
|
|
14
21
|
import ManageMenusButton from './manage-menus-button';
|
|
15
22
|
import NavigationMenuSelector from './navigation-menu-selector';
|
|
23
|
+
import { LeafMoreMenu } from '../leaf-more-menu';
|
|
24
|
+
|
|
25
|
+
/* translators: %s: The name of a menu. */
|
|
26
|
+
const actionLabel = __( "Switch to '%s'" );
|
|
16
27
|
|
|
17
|
-
const
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
isManageMenusButtonDisabled,
|
|
23
|
-
onCreateNew,
|
|
24
|
-
onSelectClassicMenu,
|
|
25
|
-
onSelectNavigationMenu,
|
|
28
|
+
const ExperimentMainContent = ( {
|
|
29
|
+
clientId,
|
|
30
|
+
currentMenuId,
|
|
31
|
+
isLoading,
|
|
32
|
+
isNavigationMenuMissing,
|
|
26
33
|
} ) => {
|
|
34
|
+
// Provide a hierarchy of clientIds for the given Navigation block (clientId).
|
|
35
|
+
// This is required else the list view will display the entire block tree.
|
|
36
|
+
const clientIdsTree = useSelect(
|
|
37
|
+
( select ) => {
|
|
38
|
+
const { __unstableGetClientIdsTree } = select( blockEditorStore );
|
|
39
|
+
return __unstableGetClientIdsTree( clientId );
|
|
40
|
+
},
|
|
41
|
+
[ clientId ]
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
if ( currentMenuId && isNavigationMenuMissing ) {
|
|
45
|
+
return <p>{ __( 'Select or create a menu' ) }</p>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
if ( isLoading ) {
|
|
49
|
+
return <Spinner />;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<OffCanvasEditor
|
|
54
|
+
blocks={ clientIdsTree }
|
|
55
|
+
isExpanded={ true }
|
|
56
|
+
selectBlockInCanvas={ false }
|
|
57
|
+
LeafMoreMenu={ LeafMoreMenu }
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const ExperimentControls = ( props ) => {
|
|
63
|
+
const {
|
|
64
|
+
createNavigationMenuIsSuccess,
|
|
65
|
+
createNavigationMenuIsError,
|
|
66
|
+
currentMenuId = null,
|
|
67
|
+
onCreateNew,
|
|
68
|
+
onSelectClassicMenu,
|
|
69
|
+
onSelectNavigationMenu,
|
|
70
|
+
} = props;
|
|
71
|
+
|
|
72
|
+
return (
|
|
73
|
+
<>
|
|
74
|
+
<HStack className="wp-block-navigation-off-canvas-editor__header">
|
|
75
|
+
<Heading
|
|
76
|
+
className="wp-block-navigation-off-canvas-editor__title"
|
|
77
|
+
level={ 2 }
|
|
78
|
+
>
|
|
79
|
+
{ __( 'Menu' ) }
|
|
80
|
+
</Heading>
|
|
81
|
+
<NavigationMenuSelector
|
|
82
|
+
currentMenuId={ currentMenuId }
|
|
83
|
+
onSelectClassicMenu={ onSelectClassicMenu }
|
|
84
|
+
onSelectNavigationMenu={ onSelectNavigationMenu }
|
|
85
|
+
onCreateNew={ onCreateNew }
|
|
86
|
+
createNavigationMenuIsSuccess={
|
|
87
|
+
createNavigationMenuIsSuccess
|
|
88
|
+
}
|
|
89
|
+
createNavigationMenuIsError={ createNavigationMenuIsError }
|
|
90
|
+
actionLabel={ actionLabel }
|
|
91
|
+
/>
|
|
92
|
+
</HStack>
|
|
93
|
+
<ExperimentMainContent { ...props } />
|
|
94
|
+
</>
|
|
95
|
+
);
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
const DefaultControls = ( props ) => {
|
|
99
|
+
const {
|
|
100
|
+
createNavigationMenuIsSuccess,
|
|
101
|
+
createNavigationMenuIsError,
|
|
102
|
+
currentMenuId = null,
|
|
103
|
+
isManageMenusButtonDisabled,
|
|
104
|
+
onCreateNew,
|
|
105
|
+
onSelectClassicMenu,
|
|
106
|
+
onSelectNavigationMenu,
|
|
107
|
+
} = props;
|
|
108
|
+
|
|
109
|
+
return (
|
|
110
|
+
<>
|
|
111
|
+
<NavigationMenuSelector
|
|
112
|
+
currentMenuId={ currentMenuId }
|
|
113
|
+
onSelectClassicMenu={ onSelectClassicMenu }
|
|
114
|
+
onSelectNavigationMenu={ onSelectNavigationMenu }
|
|
115
|
+
onCreateNew={ onCreateNew }
|
|
116
|
+
createNavigationMenuIsSuccess={ createNavigationMenuIsSuccess }
|
|
117
|
+
createNavigationMenuIsError={ createNavigationMenuIsError }
|
|
118
|
+
actionLabel={ actionLabel }
|
|
119
|
+
/>
|
|
120
|
+
<ManageMenusButton disabled={ isManageMenusButtonDisabled } />
|
|
121
|
+
</>
|
|
122
|
+
);
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
const MenuInspectorControls = ( props ) => {
|
|
27
126
|
const isOffCanvasNavigationEditorEnabled =
|
|
28
127
|
window?.__experimentalEnableOffCanvasNavigationEditor === true;
|
|
29
|
-
const menuControlsSlot =
|
|
128
|
+
const menuControlsSlot = isOffCanvasNavigationEditorEnabled
|
|
30
129
|
? 'list'
|
|
31
130
|
: undefined;
|
|
32
|
-
/* translators: %s: The name of a menu. */
|
|
33
|
-
const actionLabel = __( "Switch to '%s'" );
|
|
34
131
|
|
|
35
132
|
return (
|
|
36
133
|
<InspectorControls __experimentalGroup={ menuControlsSlot }>
|
|
@@ -39,37 +136,11 @@ const MenuInspectorControls = ( {
|
|
|
39
136
|
isOffCanvasNavigationEditorEnabled ? null : __( 'Menu' )
|
|
40
137
|
}
|
|
41
138
|
>
|
|
42
|
-
|
|
43
|
-
{
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
) }
|
|
48
|
-
<NavigationMenuSelector
|
|
49
|
-
currentMenuId={ currentMenuId }
|
|
50
|
-
onSelectClassicMenu={ onSelectClassicMenu }
|
|
51
|
-
onSelectNavigationMenu={ onSelectNavigationMenu }
|
|
52
|
-
onCreateNew={ onCreateNew }
|
|
53
|
-
createNavigationMenuIsSuccess={
|
|
54
|
-
createNavigationMenuIsSuccess
|
|
55
|
-
}
|
|
56
|
-
createNavigationMenuIsError={
|
|
57
|
-
createNavigationMenuIsError
|
|
58
|
-
}
|
|
59
|
-
actionLabel={ actionLabel }
|
|
60
|
-
/>
|
|
61
|
-
{ isOffCanvasNavigationEditorEnabled ? (
|
|
62
|
-
<OffCanvasEditor
|
|
63
|
-
blocks={ innerBlocks }
|
|
64
|
-
isExpanded={ true }
|
|
65
|
-
selectBlockInCanvas={ false }
|
|
66
|
-
/>
|
|
67
|
-
) : (
|
|
68
|
-
<ManageMenusButton
|
|
69
|
-
disabled={ isManageMenusButtonDisabled }
|
|
70
|
-
/>
|
|
71
|
-
) }
|
|
72
|
-
</>
|
|
139
|
+
{ isOffCanvasNavigationEditorEnabled ? (
|
|
140
|
+
<ExperimentControls { ...props } />
|
|
141
|
+
) : (
|
|
142
|
+
<DefaultControls { ...props } />
|
|
143
|
+
) }
|
|
73
144
|
</PanelBody>
|
|
74
145
|
</InspectorControls>
|
|
75
146
|
);
|
|
@@ -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
|
|
|
@@ -67,7 +69,10 @@ function NavigationMenuSelector( {
|
|
|
67
69
|
navigationMenus?.map( ( { id, title } ) => {
|
|
68
70
|
const label = decodeEntities( title.rendered );
|
|
69
71
|
if ( id === currentMenuId && ! isCreatingMenu ) {
|
|
70
|
-
setSelectorLabel(
|
|
72
|
+
setSelectorLabel(
|
|
73
|
+
/* translators: %s is the name of a navigation menu. */
|
|
74
|
+
sprintf( __( 'You are currently editing %s' ), label )
|
|
75
|
+
);
|
|
71
76
|
setEnableOptions( shouldEnableMenuSelector );
|
|
72
77
|
}
|
|
73
78
|
return {
|
|
@@ -100,7 +105,7 @@ function NavigationMenuSelector( {
|
|
|
100
105
|
if ( ! hasResolvedNavigationMenus ) {
|
|
101
106
|
setSelectorLabel( __( 'Loading …' ) );
|
|
102
107
|
} else if ( noMenuSelected || noBlockMenus || menuUnavailable ) {
|
|
103
|
-
setSelectorLabel( __( '
|
|
108
|
+
setSelectorLabel( __( 'Choose a Navigation menu' ) );
|
|
104
109
|
setEnableOptions( shouldEnableMenuSelector );
|
|
105
110
|
}
|
|
106
111
|
|
|
@@ -140,7 +145,11 @@ function NavigationMenuSelector( {
|
|
|
140
145
|
},
|
|
141
146
|
};
|
|
142
147
|
|
|
143
|
-
if (
|
|
148
|
+
if (
|
|
149
|
+
! hasNavigationMenus &&
|
|
150
|
+
! hasClassicMenus &&
|
|
151
|
+
! isOffCanvasNavigationEditorEnabled
|
|
152
|
+
) {
|
|
144
153
|
return (
|
|
145
154
|
<Button
|
|
146
155
|
className="wp-block-navigation__navigation-selector-button--createnew"
|
|
@@ -161,15 +170,19 @@ function NavigationMenuSelector( {
|
|
|
161
170
|
|
|
162
171
|
return (
|
|
163
172
|
<DropdownMenu
|
|
164
|
-
className=
|
|
173
|
+
className={
|
|
174
|
+
isOffCanvasNavigationEditorEnabled
|
|
175
|
+
? ''
|
|
176
|
+
: 'wp-block-navigation__navigation-selector'
|
|
177
|
+
}
|
|
165
178
|
label={ selectorLabel }
|
|
166
|
-
text={
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
179
|
+
text={ isOffCanvasNavigationEditorEnabled ? '' : selectorLabel }
|
|
180
|
+
icon={ isOffCanvasNavigationEditorEnabled ? moreVertical : null }
|
|
181
|
+
toggleProps={
|
|
182
|
+
isOffCanvasNavigationEditorEnabled
|
|
183
|
+
? { isSmall: true }
|
|
184
|
+
: toggleProps
|
|
170
185
|
}
|
|
171
|
-
icon={ null }
|
|
172
|
-
toggleProps={ toggleProps }
|
|
173
186
|
>
|
|
174
187
|
{ ( { onClose } ) => (
|
|
175
188
|
<>
|
|
@@ -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' );
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { createBlock } from '@wordpress/blocks';
|
|
5
|
+
import { addSubmenu, moreVertical } from '@wordpress/icons';
|
|
6
|
+
import { DropdownMenu, MenuItem, MenuGroup } from '@wordpress/components';
|
|
7
|
+
import { useDispatch } from '@wordpress/data';
|
|
8
|
+
import { store as blockEditorStore, BlockTitle } from '@wordpress/block-editor';
|
|
9
|
+
import { __, sprintf } from '@wordpress/i18n';
|
|
10
|
+
|
|
11
|
+
const POPOVER_PROPS = {
|
|
12
|
+
className: 'block-editor-block-settings-menu__popover',
|
|
13
|
+
position: 'bottom right',
|
|
14
|
+
variant: 'toolbar',
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export const LeafMoreMenu = ( props ) => {
|
|
18
|
+
const { clientId, block } = props;
|
|
19
|
+
|
|
20
|
+
const { insertBlock, replaceBlock, removeBlocks, replaceInnerBlocks } =
|
|
21
|
+
useDispatch( blockEditorStore );
|
|
22
|
+
|
|
23
|
+
const label = sprintf(
|
|
24
|
+
/* translators: %s: block name */
|
|
25
|
+
__( 'Remove %s' ),
|
|
26
|
+
BlockTitle( { clientId, maximumLength: 25 } )
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
return (
|
|
30
|
+
<DropdownMenu
|
|
31
|
+
icon={ moreVertical }
|
|
32
|
+
label={ __( 'Options' ) }
|
|
33
|
+
className="block-editor-block-settings-menu"
|
|
34
|
+
popoverProps={ POPOVER_PROPS }
|
|
35
|
+
noIcons
|
|
36
|
+
{ ...props }
|
|
37
|
+
>
|
|
38
|
+
{ ( { onClose } ) => (
|
|
39
|
+
<MenuGroup>
|
|
40
|
+
<MenuItem
|
|
41
|
+
icon={ addSubmenu }
|
|
42
|
+
onClick={ () => {
|
|
43
|
+
const updateSelectionOnInsert = false;
|
|
44
|
+
const newLink = createBlock(
|
|
45
|
+
'core/navigation-link'
|
|
46
|
+
);
|
|
47
|
+
if ( block.name === 'core/navigation-submenu' ) {
|
|
48
|
+
insertBlock(
|
|
49
|
+
newLink,
|
|
50
|
+
block.innerBlocks.length,
|
|
51
|
+
clientId,
|
|
52
|
+
updateSelectionOnInsert
|
|
53
|
+
);
|
|
54
|
+
} else {
|
|
55
|
+
// Convert to a submenu if the block currently isn't one.
|
|
56
|
+
const newSubmenu = createBlock(
|
|
57
|
+
'core/navigation-submenu',
|
|
58
|
+
block.attributes,
|
|
59
|
+
block.innerBlocks
|
|
60
|
+
);
|
|
61
|
+
|
|
62
|
+
// The following must happen as two independent actions.
|
|
63
|
+
// Why? Because the offcanvas editor relies on the getLastInsertedBlocksClientIds
|
|
64
|
+
// selector to determine which block is "active". As the UX needs the newLink to be
|
|
65
|
+
// the "active" block it must be the last block to be inserted.
|
|
66
|
+
// Therefore the Submenu is first created and **then** the newLink is inserted
|
|
67
|
+
// thus ensuring it is the last inserted block.
|
|
68
|
+
replaceBlock( clientId, newSubmenu );
|
|
69
|
+
|
|
70
|
+
replaceInnerBlocks(
|
|
71
|
+
newSubmenu.clientId,
|
|
72
|
+
[ newLink ],
|
|
73
|
+
updateSelectionOnInsert
|
|
74
|
+
);
|
|
75
|
+
}
|
|
76
|
+
onClose();
|
|
77
|
+
} }
|
|
78
|
+
>
|
|
79
|
+
{ __( 'Add submenu item' ) }
|
|
80
|
+
</MenuItem>
|
|
81
|
+
<MenuItem
|
|
82
|
+
onClick={ () => {
|
|
83
|
+
removeBlocks( [ clientId ], false );
|
|
84
|
+
onClose();
|
|
85
|
+
} }
|
|
86
|
+
>
|
|
87
|
+
{ label }
|
|
88
|
+
</MenuItem>
|
|
89
|
+
</MenuGroup>
|
|
90
|
+
) }
|
|
91
|
+
</DropdownMenu>
|
|
92
|
+
);
|
|
93
|
+
};
|
|
@@ -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;
|