@wordpress/block-library 7.18.0 → 8.0.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 +8 -0
- package/build/audio/edit.native.js +1 -3
- package/build/audio/edit.native.js.map +1 -1
- package/build/audio/index.js +2 -1
- package/build/audio/index.js.map +1 -1
- package/build/avatar/edit.js +1 -0
- package/build/avatar/edit.js.map +1 -1
- package/build/avatar/user-control.js +1 -0
- package/build/avatar/user-control.js.map +1 -1
- package/build/block/edit.js +14 -2
- package/build/block/edit.js.map +1 -1
- package/build/block/edit.native.js +14 -6
- package/build/block/edit.native.js.map +1 -1
- package/build/block/index.js +1 -2
- package/build/block/index.js.map +1 -1
- package/build/button/deprecated.js +16 -2
- package/build/button/deprecated.js.map +1 -1
- package/build/button/edit.js +13 -7
- package/build/button/edit.js.map +1 -1
- package/build/button/edit.native.js.map +1 -1
- package/build/button/index.js +4 -1
- package/build/button/index.js.map +1 -1
- package/build/button/save.js +2 -0
- package/build/button/save.js.map +1 -1
- package/build/code/transforms.js +1 -1
- package/build/code/transforms.js.map +1 -1
- package/build/columns/edit.js +1 -0
- package/build/columns/edit.js.map +1 -1
- package/build/columns/edit.native.js +13 -30
- package/build/columns/edit.native.js.map +1 -1
- package/build/columns/transforms.js +5 -0
- package/build/columns/transforms.js.map +1 -1
- package/build/comment-author-avatar/edit.js +1 -0
- package/build/comment-author-avatar/edit.js.map +1 -1
- package/build/cover/edit/index.js +3 -1
- package/build/cover/edit/index.js.map +1 -1
- package/build/cover/edit/inspector-controls.js +2 -0
- package/build/cover/edit/inspector-controls.js.map +1 -1
- package/build/cover/edit.native.js +24 -16
- package/build/cover/edit.native.js.map +1 -1
- package/build/embed/embed-controls.native.js +1 -0
- package/build/embed/embed-controls.native.js.map +1 -1
- package/build/embed/embed-preview.native.js +1 -3
- package/build/embed/embed-preview.native.js.map +1 -1
- package/build/file/inspector.js +1 -0
- package/build/file/inspector.js.map +1 -1
- package/build/gallery/edit.js +25 -13
- package/build/gallery/edit.js.map +1 -1
- package/build/gallery/gallery.native.js +1 -3
- package/build/gallery/gallery.native.js.map +1 -1
- package/build/gallery/shared.js +4 -10
- package/build/gallery/shared.js.map +1 -1
- package/build/gallery/transforms.js +1 -7
- package/build/gallery/transforms.js.map +1 -1
- package/build/gallery/use-get-media.js +1 -1
- package/build/gallery/use-get-media.js.map +1 -1
- package/build/gallery/use-get-media.native.js +3 -1
- package/build/gallery/use-get-media.native.js.map +1 -1
- package/build/gallery/v1/edit.js +26 -17
- package/build/gallery/v1/edit.js.map +1 -1
- package/build/gallery/v1/gallery.native.js +1 -3
- package/build/gallery/v1/gallery.native.js.map +1 -1
- package/build/gallery/v1/shared.js +4 -1
- package/build/gallery/v1/shared.js.map +1 -1
- package/build/group/edit.js +97 -45
- package/build/group/edit.js.map +1 -1
- package/build/group/index.js +6 -1
- package/build/group/index.js.map +1 -1
- package/build/group/placeholder.js +147 -0
- package/build/group/placeholder.js.map +1 -0
- package/build/group/variations.js +3 -3
- package/build/group/variations.js.map +1 -1
- package/build/heading/deprecated.js +152 -69
- package/build/heading/deprecated.js.map +1 -1
- package/build/heading/index.js +1 -2
- package/build/heading/index.js.map +1 -1
- package/build/heading/transforms.js +1 -2
- package/build/heading/transforms.js.map +1 -1
- package/build/html/index.js +1 -1
- package/build/image/edit.js +8 -5
- package/build/image/edit.js.map +1 -1
- package/build/image/edit.native.js +3 -2
- package/build/image/edit.native.js.map +1 -1
- package/build/image/image.js +12 -8
- package/build/image/image.js.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/latest-comments/edit.js +3 -1
- package/build/latest-comments/edit.js.map +1 -1
- package/build/latest-comments/index.js +5 -1
- package/build/latest-comments/index.js.map +1 -1
- package/build/latest-posts/deprecated.js +13 -0
- package/build/latest-posts/deprecated.js.map +1 -1
- package/build/latest-posts/edit.js +2 -0
- package/build/latest-posts/edit.js.map +1 -1
- package/build/latest-posts/index.js +13 -0
- package/build/latest-posts/index.js.map +1 -1
- package/build/list/transforms.js +1 -9
- package/build/list/transforms.js.map +1 -1
- package/build/list/utils.js +5 -2
- package/build/list/utils.js.map +1 -1
- package/build/list-item/edit.js +2 -1
- package/build/list-item/edit.js.map +1 -1
- package/build/list-item/index.js +4 -1
- package/build/list-item/index.js.map +1 -1
- package/build/list-item/transforms.js +22 -0
- package/build/list-item/transforms.js.map +1 -0
- package/build/list-item/utils.js +77 -1
- package/build/list-item/utils.js.map +1 -1
- package/build/media-text/edit.js +4 -2
- package/build/media-text/edit.js.map +1 -1
- package/build/navigation/edit/are-blocks-dirty.js +52 -0
- package/build/navigation/edit/are-blocks-dirty.js.map +1 -0
- package/build/navigation/edit/index.js +112 -143
- package/build/navigation/edit/index.js.map +1 -1
- package/build/navigation/edit/manage-menus-button.js +36 -0
- package/build/navigation/edit/manage-menus-button.js.map +1 -0
- package/build/navigation/edit/menu-inspector-controls.js +72 -0
- package/build/navigation/edit/menu-inspector-controls.js.map +1 -0
- package/build/navigation/edit/navigation-menu-selector.js +3 -1
- package/build/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build/navigation/edit/responsive-wrapper.js +2 -6
- package/build/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build/navigation/edit/unsaved-inner-blocks.js +15 -25
- package/build/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build/navigation/view-modal.js +6 -2
- package/build/navigation/view-modal.js.map +1 -1
- package/build/navigation-link/edit.js +52 -299
- package/build/navigation-link/edit.js.map +1 -1
- package/build/navigation-link/link-ui.js +222 -0
- package/build/navigation-link/link-ui.js.map +1 -0
- package/build/navigation-link/transforms.js +12 -0
- package/build/navigation-link/transforms.js.map +1 -1
- package/build/navigation-link/update-attributes.js +108 -0
- package/build/navigation-link/update-attributes.js.map +1 -0
- package/build/navigation-submenu/edit.js +42 -173
- package/build/navigation-submenu/edit.js.map +1 -1
- package/build/page-list/constants.js +15 -0
- package/build/page-list/constants.js.map +1 -0
- package/build/page-list/convert-to-links-modal.js +22 -86
- package/build/page-list/convert-to-links-modal.js.map +1 -1
- package/build/page-list/convert-to-navigation-links.js +76 -0
- package/build/page-list/convert-to-navigation-links.js.map +1 -0
- package/build/page-list/edit.js +142 -78
- package/build/page-list/edit.js.map +1 -1
- package/build/page-list/index.js +6 -1
- package/build/page-list/index.js.map +1 -1
- package/build/page-list-item/edit.js +87 -0
- package/build/page-list-item/edit.js.map +1 -0
- package/build/page-list-item/index.js +85 -0
- package/build/page-list-item/index.js.map +1 -0
- package/build/page-list-item/init.js +16 -0
- package/build/page-list-item/init.js.map +1 -0
- package/build/paragraph/index.js +1 -7
- package/build/paragraph/index.js.map +1 -1
- package/build/post-author/edit.js +38 -22
- package/build/post-author/edit.js.map +1 -1
- package/build/post-content/index.js +3 -0
- package/build/post-content/index.js.map +1 -1
- package/build/post-featured-image/overlay.js +1 -0
- package/build/post-featured-image/overlay.js.map +1 -1
- package/build/post-template/index.js +8 -0
- package/build/post-template/index.js.map +1 -1
- package/build/preformatted/transforms.js +3 -1
- package/build/preformatted/transforms.js.map +1 -1
- package/build/query/deprecated.js +192 -21
- package/build/query/deprecated.js.map +1 -1
- package/build/query/edit/inspector-controls/index.js +1 -0
- package/build/query/edit/inspector-controls/index.js.map +1 -1
- package/build/query/edit/query-placeholder.js +3 -19
- package/build/query/edit/query-placeholder.js.map +1 -1
- package/build/query/index.js +0 -8
- package/build/query/index.js.map +1 -1
- package/build/query/utils.js +0 -8
- package/build/query/utils.js.map +1 -1
- package/build/rss/edit.js +3 -0
- package/build/rss/edit.js.map +1 -1
- package/build/search/edit.native.js +22 -22
- package/build/search/edit.native.js.map +1 -1
- package/build/search/index.js +9 -1
- package/build/search/index.js.map +1 -1
- package/build/site-logo/edit.js +18 -10
- package/build/site-logo/edit.js.map +1 -1
- package/build/site-logo/index.js +1 -0
- package/build/site-logo/index.js.map +1 -1
- package/build/site-title/index.js +1 -0
- package/build/site-title/index.js.map +1 -1
- package/build/social-link/social-list.js +4 -12
- package/build/social-link/social-list.js.map +1 -1
- package/build/table/edit.js +3 -1
- package/build/table/edit.js.map +1 -1
- package/build/table/index.js +17 -1
- package/build/table/index.js.map +1 -1
- package/build/table/save.js +4 -2
- package/build/table/save.js.map +1 -1
- package/build/table/state.js +24 -12
- package/build/table/state.js.map +1 -1
- package/build/table/transforms.js +3 -2
- package/build/table/transforms.js.map +1 -1
- package/build/table-of-contents/edit.js +2 -2
- package/build/table-of-contents/edit.js.map +1 -1
- package/build/tag-cloud/edit.js +2 -1
- package/build/tag-cloud/edit.js.map +1 -1
- package/build/template-part/edit/selection-modal.js +5 -2
- package/build/template-part/edit/selection-modal.js.map +1 -1
- package/build/template-part/edit/utils/hooks.js +2 -6
- package/build/template-part/edit/utils/hooks.js.map +1 -1
- package/build/template-part/variations.js +5 -0
- package/build/template-part/variations.js.map +1 -1
- package/build/text-columns/edit.js +1 -0
- package/build/text-columns/edit.js.map +1 -1
- package/build/utils/transformation-categories.native.js +1 -1
- package/build/utils/transformation-categories.native.js.map +1 -1
- package/build/video/edit.js +1 -1
- package/build/video/edit.js.map +1 -1
- package/build/video/edit.native.js +1 -3
- package/build/video/edit.native.js.map +1 -1
- package/build-module/audio/edit.native.js +1 -2
- package/build-module/audio/edit.native.js.map +1 -1
- package/build-module/audio/index.js +2 -1
- package/build-module/audio/index.js.map +1 -1
- package/build-module/avatar/edit.js +1 -0
- package/build-module/avatar/edit.js.map +1 -1
- package/build-module/avatar/user-control.js +1 -0
- package/build-module/avatar/user-control.js.map +1 -1
- package/build-module/block/edit.js +14 -2
- package/build-module/block/edit.js.map +1 -1
- package/build-module/block/edit.native.js +14 -6
- package/build-module/block/edit.native.js.map +1 -1
- package/build-module/block/index.js +1 -2
- package/build-module/block/index.js.map +1 -1
- package/build-module/button/deprecated.js +16 -2
- package/build-module/button/deprecated.js.map +1 -1
- package/build-module/button/edit.js +15 -9
- package/build-module/button/edit.js.map +1 -1
- package/build-module/button/edit.native.js +2 -1
- package/build-module/button/edit.native.js.map +1 -1
- package/build-module/button/index.js +4 -1
- package/build-module/button/index.js.map +1 -1
- package/build-module/button/save.js +2 -0
- package/build-module/button/save.js.map +1 -1
- package/build-module/code/transforms.js +1 -1
- package/build-module/code/transforms.js.map +1 -1
- package/build-module/columns/edit.js +1 -0
- package/build-module/columns/edit.js.map +1 -1
- package/build-module/columns/edit.native.js +13 -29
- package/build-module/columns/edit.native.js.map +1 -1
- package/build-module/columns/transforms.js +5 -0
- package/build-module/columns/transforms.js.map +1 -1
- package/build-module/comment-author-avatar/edit.js +1 -0
- package/build-module/comment-author-avatar/edit.js.map +1 -1
- package/build-module/cover/edit/index.js +3 -1
- package/build-module/cover/edit/index.js.map +1 -1
- package/build-module/cover/edit/inspector-controls.js +2 -0
- package/build-module/cover/edit/inspector-controls.js.map +1 -1
- package/build-module/cover/edit.native.js +22 -14
- package/build-module/cover/edit.native.js.map +1 -1
- package/build-module/embed/embed-controls.native.js +2 -1
- package/build-module/embed/embed-controls.native.js.map +1 -1
- package/build-module/embed/embed-preview.native.js +1 -2
- package/build-module/embed/embed-preview.native.js.map +1 -1
- package/build-module/file/inspector.js +1 -0
- package/build-module/file/inspector.js.map +1 -1
- package/build-module/gallery/edit.js +25 -12
- package/build-module/gallery/edit.js.map +1 -1
- package/build-module/gallery/gallery.native.js +1 -2
- package/build-module/gallery/gallery.native.js.map +1 -1
- package/build-module/gallery/shared.js +5 -11
- package/build-module/gallery/shared.js.map +1 -1
- package/build-module/gallery/transforms.js +1 -6
- package/build-module/gallery/transforms.js.map +1 -1
- package/build-module/gallery/use-get-media.js +1 -1
- package/build-module/gallery/use-get-media.js.map +1 -1
- package/build-module/gallery/use-get-media.native.js +3 -1
- package/build-module/gallery/use-get-media.native.js.map +1 -1
- package/build-module/gallery/v1/edit.js +27 -18
- package/build-module/gallery/v1/edit.js.map +1 -1
- package/build-module/gallery/v1/gallery.native.js +1 -2
- package/build-module/gallery/v1/gallery.native.js.map +1 -1
- package/build-module/gallery/v1/shared.js +5 -2
- package/build-module/gallery/v1/shared.js.map +1 -1
- package/build-module/group/edit.js +92 -45
- package/build-module/group/edit.js.map +1 -1
- package/build-module/group/index.js +6 -1
- package/build-module/group/index.js.map +1 -1
- package/build-module/group/placeholder.js +133 -0
- package/build-module/group/placeholder.js.map +1 -0
- package/build-module/group/variations.js +3 -3
- package/build-module/group/variations.js.map +1 -1
- package/build-module/heading/deprecated.js +152 -69
- package/build-module/heading/deprecated.js.map +1 -1
- package/build-module/heading/index.js +1 -2
- package/build-module/heading/index.js.map +1 -1
- package/build-module/heading/transforms.js +1 -2
- package/build-module/heading/transforms.js.map +1 -1
- package/build-module/html/index.js +1 -1
- package/build-module/image/edit.js +9 -6
- package/build-module/image/edit.js.map +1 -1
- package/build-module/image/edit.native.js +2 -1
- package/build-module/image/edit.native.js.map +1 -1
- package/build-module/image/image.js +13 -9
- package/build-module/image/image.js.map +1 -1
- package/build-module/index.js +2 -1
- package/build-module/index.js.map +1 -1
- package/build-module/latest-comments/edit.js +3 -1
- package/build-module/latest-comments/edit.js.map +1 -1
- package/build-module/latest-comments/index.js +5 -1
- package/build-module/latest-comments/index.js.map +1 -1
- package/build-module/latest-posts/deprecated.js +13 -0
- package/build-module/latest-posts/deprecated.js.map +1 -1
- package/build-module/latest-posts/edit.js +2 -0
- package/build-module/latest-posts/edit.js.map +1 -1
- package/build-module/latest-posts/index.js +13 -0
- package/build-module/latest-posts/index.js.map +1 -1
- package/build-module/list/transforms.js +1 -9
- package/build-module/list/transforms.js.map +1 -1
- package/build-module/list/utils.js +5 -2
- package/build-module/list/utils.js.map +1 -1
- package/build-module/list-item/edit.js +2 -1
- package/build-module/list-item/edit.js.map +1 -1
- package/build-module/list-item/index.js +3 -1
- package/build-module/list-item/index.js.map +1 -1
- package/build-module/list-item/transforms.js +13 -0
- package/build-module/list-item/transforms.js.map +1 -0
- package/build-module/list-item/utils.js +78 -1
- package/build-module/list-item/utils.js.map +1 -1
- package/build-module/media-text/edit.js +5 -3
- package/build-module/media-text/edit.js.map +1 -1
- package/build-module/navigation/edit/are-blocks-dirty.js +44 -0
- package/build-module/navigation/edit/are-blocks-dirty.js.map +1 -0
- package/build-module/navigation/edit/index.js +111 -143
- package/build-module/navigation/edit/index.js.map +1 -1
- package/build-module/navigation/edit/manage-menus-button.js +26 -0
- package/build-module/navigation/edit/manage-menus-button.js.map +1 -0
- package/build-module/navigation/edit/menu-inspector-controls.js +59 -0
- package/build-module/navigation/edit/menu-inspector-controls.js.map +1 -0
- package/build-module/navigation/edit/navigation-menu-selector.js +3 -1
- package/build-module/navigation/edit/navigation-menu-selector.js.map +1 -1
- package/build-module/navigation/edit/responsive-wrapper.js +2 -6
- package/build-module/navigation/edit/responsive-wrapper.js.map +1 -1
- package/build-module/navigation/edit/unsaved-inner-blocks.js +16 -26
- package/build-module/navigation/edit/unsaved-inner-blocks.js.map +1 -1
- package/build-module/navigation/view-modal.js +6 -2
- package/build-module/navigation/view-modal.js.map +1 -1
- package/build-module/navigation-link/edit.js +56 -300
- package/build-module/navigation-link/edit.js.map +1 -1
- package/build-module/navigation-link/link-ui.js +206 -0
- package/build-module/navigation-link/link-ui.js.map +1 -0
- package/build-module/navigation-link/transforms.js +12 -0
- package/build-module/navigation-link/transforms.js.map +1 -1
- package/build-module/navigation-link/update-attributes.js +97 -0
- package/build-module/navigation-link/update-attributes.js.map +1 -0
- package/build-module/navigation-submenu/edit.js +47 -175
- package/build-module/navigation-submenu/edit.js.map +1 -1
- package/build-module/page-list/constants.js +6 -0
- package/build-module/page-list/constants.js.map +1 -0
- package/build-module/page-list/convert-to-links-modal.js +20 -81
- package/build-module/page-list/convert-to-links-modal.js.map +1 -1
- package/build-module/page-list/convert-to-navigation-links.js +66 -0
- package/build-module/page-list/convert-to-navigation-links.js.map +1 -0
- package/build-module/page-list/edit.js +144 -82
- package/build-module/page-list/edit.js.map +1 -1
- package/build-module/page-list/index.js +6 -1
- package/build-module/page-list/index.js.map +1 -1
- package/build-module/page-list-item/edit.js +74 -0
- package/build-module/page-list-item/edit.js.map +1 -0
- package/build-module/page-list-item/index.js +68 -0
- package/build-module/page-list-item/index.js.map +1 -0
- package/build-module/page-list-item/init.js +6 -0
- package/build-module/page-list-item/init.js.map +1 -0
- package/build-module/paragraph/index.js +1 -7
- package/build-module/paragraph/index.js.map +1 -1
- package/build-module/post-author/edit.js +38 -23
- package/build-module/post-author/edit.js.map +1 -1
- package/build-module/post-content/index.js +3 -0
- package/build-module/post-content/index.js.map +1 -1
- package/build-module/post-featured-image/overlay.js +1 -0
- package/build-module/post-featured-image/overlay.js.map +1 -1
- package/build-module/post-template/index.js +8 -0
- package/build-module/post-template/index.js.map +1 -1
- package/build-module/preformatted/transforms.js +3 -1
- package/build-module/preformatted/transforms.js.map +1 -1
- package/build-module/query/deprecated.js +185 -21
- package/build-module/query/deprecated.js.map +1 -1
- package/build-module/query/edit/inspector-controls/index.js +1 -0
- package/build-module/query/edit/inspector-controls/index.js.map +1 -1
- package/build-module/query/edit/query-placeholder.js +3 -19
- package/build-module/query/edit/query-placeholder.js.map +1 -1
- package/build-module/query/index.js +0 -8
- package/build-module/query/index.js.map +1 -1
- package/build-module/query/utils.js +0 -8
- package/build-module/query/utils.js.map +1 -1
- package/build-module/rss/edit.js +3 -0
- package/build-module/rss/edit.js.map +1 -1
- package/build-module/search/edit.native.js +20 -20
- package/build-module/search/edit.native.js.map +1 -1
- package/build-module/search/index.js +8 -1
- package/build-module/search/index.js.map +1 -1
- package/build-module/site-logo/edit.js +18 -9
- package/build-module/site-logo/edit.js.map +1 -1
- package/build-module/site-logo/index.js +1 -0
- package/build-module/site-logo/index.js.map +1 -1
- package/build-module/site-title/index.js +1 -0
- package/build-module/site-title/index.js.map +1 -1
- package/build-module/social-link/social-list.js +2 -11
- package/build-module/social-link/social-list.js.map +1 -1
- package/build-module/table/edit.js +3 -1
- package/build-module/table/edit.js.map +1 -1
- package/build-module/table/index.js +17 -1
- package/build-module/table/index.js.map +1 -1
- package/build-module/table/save.js +4 -2
- package/build-module/table/save.js.map +1 -1
- package/build-module/table/state.js +25 -13
- package/build-module/table/state.js.map +1 -1
- package/build-module/table/transforms.js +3 -2
- package/build-module/table/transforms.js.map +1 -1
- package/build-module/table-of-contents/edit.js +2 -2
- package/build-module/table-of-contents/edit.js.map +1 -1
- package/build-module/tag-cloud/edit.js +3 -2
- package/build-module/tag-cloud/edit.js.map +1 -1
- package/build-module/template-part/edit/selection-modal.js +6 -3
- package/build-module/template-part/edit/selection-modal.js.map +1 -1
- package/build-module/template-part/edit/utils/hooks.js +3 -7
- package/build-module/template-part/edit/utils/hooks.js.map +1 -1
- package/build-module/template-part/variations.js +5 -0
- package/build-module/template-part/variations.js.map +1 -1
- package/build-module/text-columns/edit.js +1 -0
- package/build-module/text-columns/edit.js.map +1 -1
- package/build-module/utils/transformation-categories.native.js +1 -1
- package/build-module/utils/transformation-categories.native.js.map +1 -1
- package/build-module/video/edit.js +1 -1
- package/build-module/video/edit.js.map +1 -1
- package/build-module/video/edit.native.js +1 -2
- package/build-module/video/edit.native.js.map +1 -1
- package/build-style/archives/editor-rtl.css +12 -0
- package/build-style/archives/editor.css +12 -0
- package/build-style/archives/style-rtl.css +12 -0
- package/build-style/archives/style.css +12 -0
- package/build-style/audio/editor-rtl.css +12 -0
- package/build-style/audio/editor.css +12 -0
- package/build-style/audio/style-rtl.css +12 -0
- package/build-style/audio/style.css +12 -0
- package/build-style/audio/theme-rtl.css +12 -0
- package/build-style/audio/theme.css +12 -0
- package/build-style/avatar/editor-rtl.css +12 -0
- package/build-style/avatar/editor.css +12 -0
- package/build-style/avatar/style-rtl.css +12 -0
- package/build-style/avatar/style.css +12 -0
- package/build-style/block/editor-rtl.css +22 -0
- package/build-style/block/editor.css +22 -0
- package/build-style/button/editor-rtl.css +12 -0
- package/build-style/button/editor.css +12 -0
- package/build-style/button/style-rtl.css +12 -0
- package/build-style/button/style.css +12 -0
- package/build-style/buttons/editor-rtl.css +12 -0
- package/build-style/buttons/editor.css +12 -0
- package/build-style/buttons/style-rtl.css +12 -0
- package/build-style/buttons/style.css +12 -0
- package/build-style/calendar/style-rtl.css +12 -0
- package/build-style/calendar/style.css +12 -0
- package/build-style/categories/editor-rtl.css +12 -0
- package/build-style/categories/editor.css +12 -0
- package/build-style/categories/style-rtl.css +12 -0
- package/build-style/categories/style.css +12 -0
- package/build-style/classic-rtl.css +12 -0
- package/build-style/classic.css +12 -0
- package/build-style/code/editor-rtl.css +12 -0
- package/build-style/code/editor.css +12 -0
- package/build-style/code/style-rtl.css +12 -0
- package/build-style/code/style.css +12 -0
- package/build-style/code/theme-rtl.css +12 -0
- package/build-style/code/theme.css +12 -0
- package/build-style/columns/editor-rtl.css +12 -0
- package/build-style/columns/editor.css +12 -0
- package/build-style/columns/style-rtl.css +12 -0
- package/build-style/columns/style.css +12 -0
- package/build-style/comment-author-avatar/editor-rtl.css +12 -0
- package/build-style/comment-author-avatar/editor.css +12 -0
- package/build-style/comment-content/style-rtl.css +12 -0
- package/build-style/comment-content/style.css +12 -0
- package/build-style/comment-template/style-rtl.css +12 -0
- package/build-style/comment-template/style.css +12 -0
- package/build-style/comments/editor-rtl.css +12 -0
- package/build-style/comments/editor.css +12 -0
- package/build-style/comments/style-rtl.css +12 -0
- package/build-style/comments/style.css +12 -0
- package/build-style/comments-pagination/editor-rtl.css +12 -0
- package/build-style/comments-pagination/editor.css +12 -0
- package/build-style/comments-pagination/style-rtl.css +12 -0
- package/build-style/comments-pagination/style.css +12 -0
- package/build-style/comments-pagination-numbers/editor-rtl.css +12 -0
- package/build-style/comments-pagination-numbers/editor.css +12 -0
- package/build-style/comments-title/editor-rtl.css +12 -0
- package/build-style/comments-title/editor.css +12 -0
- package/build-style/common-rtl.css +17 -1
- package/build-style/common.css +17 -1
- package/build-style/cover/editor-rtl.css +12 -0
- package/build-style/cover/editor.css +12 -0
- package/build-style/cover/style-rtl.css +14 -1
- package/build-style/cover/style.css +14 -1
- package/build-style/editor-elements-rtl.css +12 -0
- package/build-style/editor-elements.css +12 -0
- package/build-style/editor-rtl.css +115 -21
- package/build-style/editor.css +115 -21
- package/build-style/elements-rtl.css +12 -0
- package/build-style/elements.css +12 -0
- package/build-style/embed/editor-rtl.css +12 -0
- package/build-style/embed/editor.css +12 -0
- package/build-style/embed/style-rtl.css +12 -0
- package/build-style/embed/style.css +12 -0
- package/build-style/embed/theme-rtl.css +12 -0
- package/build-style/embed/theme.css +12 -0
- package/build-style/file/editor-rtl.css +12 -0
- package/build-style/file/editor.css +12 -0
- package/build-style/file/style-rtl.css +12 -0
- package/build-style/file/style.css +12 -0
- package/build-style/freeform/editor-rtl.css +12 -0
- package/build-style/freeform/editor.css +12 -0
- package/build-style/gallery/editor-rtl.css +13 -1
- package/build-style/gallery/editor.css +13 -1
- package/build-style/gallery/style-rtl.css +16 -2
- package/build-style/gallery/style.css +16 -2
- package/build-style/gallery/theme-rtl.css +12 -0
- package/build-style/gallery/theme.css +12 -0
- package/build-style/group/editor-rtl.css +56 -0
- package/build-style/group/editor.css +56 -0
- package/build-style/group/style-rtl.css +12 -0
- package/build-style/group/style.css +12 -0
- package/build-style/group/theme-rtl.css +12 -0
- package/build-style/group/theme.css +12 -0
- package/build-style/heading/style-rtl.css +12 -0
- package/build-style/heading/style.css +12 -0
- package/build-style/html/editor-rtl.css +12 -0
- package/build-style/html/editor.css +12 -0
- package/build-style/image/editor-rtl.css +12 -9
- package/build-style/image/editor.css +12 -9
- package/build-style/image/style-rtl.css +12 -0
- package/build-style/image/style.css +12 -0
- package/build-style/image/theme-rtl.css +12 -0
- package/build-style/image/theme.css +12 -0
- package/build-style/latest-comments/style-rtl.css +13 -0
- package/build-style/latest-comments/style.css +13 -0
- package/build-style/latest-posts/editor-rtl.css +12 -0
- package/build-style/latest-posts/editor.css +12 -0
- package/build-style/latest-posts/style-rtl.css +15 -0
- package/build-style/latest-posts/style.css +15 -0
- package/build-style/list/style-rtl.css +12 -0
- package/build-style/list/style.css +12 -0
- package/build-style/media-text/editor-rtl.css +12 -0
- package/build-style/media-text/editor.css +12 -0
- package/build-style/media-text/style-rtl.css +12 -0
- package/build-style/media-text/style.css +12 -0
- package/build-style/more/editor-rtl.css +12 -0
- package/build-style/more/editor.css +12 -0
- package/build-style/navigation/editor-rtl.css +35 -0
- package/build-style/navigation/editor.css +35 -0
- package/build-style/navigation/style-rtl.css +22 -0
- package/build-style/navigation/style.css +22 -0
- package/build-style/navigation-link/editor-rtl.css +20 -1
- package/build-style/navigation-link/editor.css +20 -1
- package/build-style/navigation-link/style-rtl.css +12 -0
- package/build-style/navigation-link/style.css +12 -0
- package/build-style/navigation-submenu/editor-rtl.css +12 -0
- package/build-style/navigation-submenu/editor.css +12 -0
- package/build-style/nextpage/editor-rtl.css +12 -0
- package/build-style/nextpage/editor.css +12 -0
- package/build-style/page-list/editor-rtl.css +12 -0
- package/build-style/page-list/editor.css +12 -0
- package/build-style/page-list/style-rtl.css +12 -0
- package/build-style/page-list/style.css +12 -0
- package/build-style/paragraph/editor-rtl.css +12 -0
- package/build-style/paragraph/editor.css +12 -0
- package/build-style/paragraph/style-rtl.css +12 -0
- package/build-style/paragraph/style.css +12 -0
- package/build-style/post-author/style-rtl.css +12 -0
- package/build-style/post-author/style.css +12 -0
- package/build-style/post-comments-form/editor-rtl.css +12 -0
- package/build-style/post-comments-form/editor.css +12 -0
- package/build-style/post-comments-form/style-rtl.css +12 -0
- package/build-style/post-comments-form/style.css +12 -0
- package/build-style/post-date/style-rtl.css +12 -0
- package/build-style/post-date/style.css +12 -0
- package/build-style/post-excerpt/editor-rtl.css +12 -0
- package/build-style/post-excerpt/editor.css +12 -0
- package/build-style/post-excerpt/style-rtl.css +12 -0
- package/build-style/post-excerpt/style.css +12 -0
- package/build-style/post-featured-image/editor-rtl.css +12 -0
- package/build-style/post-featured-image/editor.css +12 -0
- package/build-style/post-featured-image/style-rtl.css +12 -0
- package/build-style/post-featured-image/style.css +12 -0
- package/build-style/post-navigation-link/style-rtl.css +12 -0
- package/build-style/post-navigation-link/style.css +12 -0
- package/build-style/post-template/editor-rtl.css +12 -0
- package/build-style/post-template/editor.css +12 -0
- package/build-style/post-template/style-rtl.css +12 -0
- package/build-style/post-template/style.css +12 -0
- package/build-style/post-terms/style-rtl.css +12 -0
- package/build-style/post-terms/style.css +12 -0
- package/build-style/post-title/style-rtl.css +12 -0
- package/build-style/post-title/style.css +12 -0
- package/build-style/preformatted/style-rtl.css +12 -0
- package/build-style/preformatted/style.css +12 -0
- package/build-style/pullquote/editor-rtl.css +12 -0
- package/build-style/pullquote/editor.css +12 -0
- package/build-style/pullquote/style-rtl.css +12 -0
- package/build-style/pullquote/style.css +12 -0
- package/build-style/pullquote/theme-rtl.css +12 -0
- package/build-style/pullquote/theme.css +12 -0
- package/build-style/query/editor-rtl.css +13 -1
- package/build-style/query/editor.css +13 -1
- package/build-style/query-pagination/editor-rtl.css +12 -0
- package/build-style/query-pagination/editor.css +12 -0
- package/build-style/query-pagination/style-rtl.css +13 -1
- package/build-style/query-pagination/style.css +13 -1
- package/build-style/query-pagination-numbers/editor-rtl.css +12 -0
- package/build-style/query-pagination-numbers/editor.css +12 -0
- package/build-style/query-title/style-rtl.css +12 -0
- package/build-style/query-title/style.css +12 -0
- package/build-style/quote/style-rtl.css +12 -0
- package/build-style/quote/style.css +12 -0
- package/build-style/quote/theme-rtl.css +12 -0
- package/build-style/quote/theme.css +12 -0
- package/build-style/read-more/style-rtl.css +12 -0
- package/build-style/read-more/style.css +12 -0
- package/build-style/reset-rtl.css +12 -0
- package/build-style/reset.css +12 -0
- package/build-style/rss/editor-rtl.css +12 -0
- package/build-style/rss/editor.css +12 -0
- package/build-style/rss/style-rtl.css +12 -0
- package/build-style/rss/style.css +12 -0
- package/build-style/search/editor-rtl.css +12 -0
- package/build-style/search/editor.css +12 -0
- package/build-style/search/style-rtl.css +12 -0
- package/build-style/search/style.css +12 -0
- package/build-style/search/theme-rtl.css +12 -0
- package/build-style/search/theme.css +12 -0
- package/build-style/separator/editor-rtl.css +12 -0
- package/build-style/separator/editor.css +12 -0
- package/build-style/separator/style-rtl.css +12 -0
- package/build-style/separator/style.css +12 -0
- package/build-style/separator/theme-rtl.css +12 -0
- package/build-style/separator/theme.css +12 -0
- package/build-style/shortcode/editor-rtl.css +13 -1
- package/build-style/shortcode/editor.css +13 -1
- package/build-style/site-logo/editor-rtl.css +12 -0
- package/build-style/site-logo/editor.css +12 -0
- package/build-style/site-logo/style-rtl.css +12 -0
- package/build-style/site-logo/style.css +12 -0
- package/build-style/site-tagline/editor-rtl.css +12 -0
- package/build-style/site-tagline/editor.css +12 -0
- package/build-style/site-title/editor-rtl.css +12 -0
- package/build-style/site-title/editor.css +12 -0
- package/build-style/site-title/style-rtl.css +12 -0
- package/build-style/site-title/style.css +12 -0
- package/build-style/social-link/editor-rtl.css +12 -0
- package/build-style/social-link/editor.css +12 -0
- package/build-style/social-links/editor-rtl.css +12 -0
- package/build-style/social-links/editor.css +12 -0
- package/build-style/social-links/style-rtl.css +12 -0
- package/build-style/social-links/style.css +12 -0
- package/build-style/spacer/editor-rtl.css +12 -0
- package/build-style/spacer/editor.css +12 -0
- package/build-style/spacer/style-rtl.css +12 -0
- package/build-style/spacer/style.css +12 -0
- package/build-style/style-rtl.css +43 -6
- package/build-style/style.css +43 -6
- package/build-style/table/editor-rtl.css +13 -8
- package/build-style/table/editor.css +13 -8
- package/build-style/table/style-rtl.css +17 -0
- package/build-style/table/style.css +17 -0
- package/build-style/table/theme-rtl.css +13 -3
- package/build-style/table/theme.css +13 -3
- package/build-style/tag-cloud/style-rtl.css +12 -0
- package/build-style/tag-cloud/style.css +12 -0
- package/build-style/template-part/editor-rtl.css +27 -1
- package/build-style/template-part/editor.css +27 -1
- package/build-style/template-part/theme-rtl.css +12 -0
- package/build-style/template-part/theme.css +12 -0
- package/build-style/text-columns/editor-rtl.css +12 -0
- package/build-style/text-columns/editor.css +12 -0
- package/build-style/text-columns/style-rtl.css +12 -0
- package/build-style/text-columns/style.css +12 -0
- package/build-style/theme-rtl.css +13 -3
- package/build-style/theme.css +13 -3
- package/build-style/verse/style-rtl.css +12 -0
- package/build-style/verse/style.css +12 -0
- package/build-style/video/editor-rtl.css +12 -0
- package/build-style/video/editor.css +12 -0
- package/build-style/video/style-rtl.css +14 -1
- package/build-style/video/style.css +14 -1
- package/build-style/video/theme-rtl.css +12 -0
- package/build-style/video/theme.css +12 -0
- package/package.json +32 -30
- package/src/audio/edit.native.js +1 -2
- package/src/audio/index.js +1 -0
- package/src/avatar/edit.js +1 -0
- package/src/avatar/index.php +1 -1
- package/src/avatar/user-control.js +1 -0
- package/src/block/block.json +1 -2
- package/src/block/edit.js +14 -3
- package/src/block/edit.native.js +24 -12
- package/src/block/editor.scss +17 -0
- package/src/block/index.php +1 -2
- package/src/block/test/edit.native.js +28 -32
- package/src/button/block.json +4 -1
- package/src/button/deprecated.js +18 -2
- package/src/button/edit.js +11 -9
- package/src/button/edit.native.js +1 -0
- package/src/button/save.js +12 -2
- package/src/buttons/test/edit.native.js +41 -52
- package/src/code/transforms.js +3 -1
- package/src/columns/edit.js +1 -0
- package/src/columns/edit.native.js +18 -26
- package/src/columns/test/edit.native.js +32 -32
- package/src/columns/transforms.js +8 -0
- package/src/comment-author-avatar/edit.js +1 -0
- package/src/cover/edit/index.js +3 -1
- package/src/cover/edit/inspector-controls.js +2 -0
- package/src/cover/edit.native.js +32 -19
- package/src/cover/test/edit.native.js +77 -130
- package/src/embed/embed-controls.native.js +1 -0
- package/src/embed/embed-preview.native.js +1 -2
- package/src/embed/test/index.native.js +251 -245
- package/src/file/inspector.js +1 -0
- package/src/file/test/__snapshots__/edit.native.js.snap +2 -6
- package/src/gallery/edit.js +15 -5
- package/src/gallery/gallery.native.js +1 -2
- package/src/gallery/shared.js +7 -11
- package/src/gallery/test/index.native.js +11 -11
- package/src/gallery/transforms.js +1 -6
- package/src/gallery/use-get-media.js +1 -1
- package/src/gallery/use-get-media.native.js +2 -1
- package/src/gallery/v1/edit.js +26 -30
- package/src/gallery/v1/gallery.native.js +1 -2
- package/src/gallery/v1/shared.js +7 -2
- package/src/group/block.json +6 -1
- package/src/group/edit.js +91 -44
- package/src/group/editor.scss +48 -0
- package/src/group/placeholder.js +168 -0
- package/src/group/test/__snapshots__/edit.native.js.snap +1 -1
- package/src/group/test/edit.native.js +3 -3
- package/src/group/test/placeholder.js +78 -0
- package/src/group/variations.js +3 -3
- package/src/heading/block.json +1 -2
- package/src/heading/deprecated.js +209 -136
- package/src/heading/index.php +52 -0
- package/src/heading/test/__snapshots__/index.native.js.snap +7 -0
- package/src/heading/test/index.native.js +44 -0
- package/src/home-link/index.php +1 -1
- package/src/html/block.json +1 -1
- package/src/image/edit.js +7 -2
- package/src/image/edit.native.js +2 -1
- package/src/image/editor.scss +0 -11
- package/src/image/image.js +13 -8
- package/src/image/test/edit.native.js +24 -20
- package/src/index.js +2 -0
- package/src/latest-comments/block.json +5 -1
- package/src/latest-comments/edit.js +2 -0
- package/src/latest-comments/style.scss +3 -0
- package/src/latest-posts/block.json +13 -0
- package/src/latest-posts/edit.js +2 -0
- package/src/latest-posts/style.scss +3 -0
- package/src/list/test/edit.native.js +55 -47
- package/src/list/transforms.js +0 -11
- package/src/list/utils.js +6 -2
- package/src/list-item/edit.js +1 -0
- package/src/list-item/index.js +2 -0
- package/src/list-item/transforms.js +17 -0
- package/src/list-item/utils.js +10 -1
- package/src/media-text/edit.js +5 -3
- package/src/missing/test/edit-integration.native.js +10 -12
- package/src/navigation/edit/are-blocks-dirty.js +51 -0
- package/src/navigation/edit/index.js +269 -310
- package/src/navigation/edit/manage-menus-button.js +21 -0
- package/src/navigation/edit/menu-inspector-controls.js +78 -0
- package/src/navigation/edit/navigation-menu-selector.js +5 -1
- package/src/navigation/edit/responsive-wrapper.js +2 -10
- package/src/navigation/edit/test/are-blocks-dirty.js +121 -0
- package/src/navigation/edit/unsaved-inner-blocks.js +17 -36
- package/src/navigation/editor.scss +25 -0
- package/src/navigation/index.php +57 -10
- package/src/navigation/style.scss +16 -0
- package/src/navigation/view-modal.js +11 -1
- package/src/navigation-link/edit.js +66 -329
- package/src/navigation-link/editor.scss +8 -0
- package/src/navigation-link/index.php +32 -0
- package/src/navigation-link/link-ui.js +213 -0
- package/src/navigation-link/test/edit.js +23 -82
- package/src/navigation-link/transforms.js +14 -0
- package/src/navigation-link/update-attributes.js +99 -0
- package/src/navigation-submenu/edit.js +57 -177
- package/src/navigation-submenu/index.php +40 -0
- package/src/page-list/block.json +6 -1
- package/src/page-list/constants.js +8 -0
- package/src/page-list/convert-to-links-modal.js +19 -76
- package/src/page-list/convert-to-navigation-links.js +60 -0
- package/src/page-list/edit.js +179 -118
- package/src/page-list/index.php +9 -0
- package/src/page-list/test/convert-to-links-modal.js +28 -34
- package/src/page-list-item/block.json +51 -0
- package/src/page-list-item/edit.js +94 -0
- package/src/page-list-item/index.js +24 -0
- package/src/page-list-item/init.js +6 -0
- package/src/paragraph/index.js +0 -6
- package/src/post-author/edit.js +47 -22
- package/src/post-content/block.json +3 -0
- package/src/post-content/index.php +1 -2
- package/src/post-featured-image/index.php +7 -2
- package/src/post-featured-image/overlay.js +1 -0
- package/src/post-template/block.json +8 -0
- package/src/preformatted/transforms.js +4 -1
- package/src/query/block.json +0 -8
- package/src/query/deprecated.js +257 -86
- package/src/query/edit/inspector-controls/index.js +1 -0
- package/src/query/edit/query-placeholder.js +4 -16
- package/src/query/editor.scss +1 -1
- package/src/query-pagination/style.scss +1 -1
- package/src/read-more/index.php +9 -2
- package/src/rss/edit.js +3 -0
- package/src/search/edit.native.js +31 -27
- package/src/search/index.js +5 -1
- package/src/shortcode/test/edit.native.js +15 -18
- package/src/site-logo/edit.js +14 -6
- package/src/site-logo/index.js +1 -0
- package/src/site-title/index.js +1 -0
- package/src/social-link/social-list.js +2 -7
- package/src/social-link/test/index.native.js +16 -22
- package/src/social-links/test/edit.native.js +8 -7
- package/src/spacer/test/index.native.js +39 -36
- package/src/table/block.json +15 -0
- package/src/table/edit.js +2 -1
- package/src/table/editor.scss +1 -4
- package/src/table/index.js +1 -0
- package/src/table/save.js +5 -1
- package/src/table/state.js +22 -7
- package/src/table/style.scss +7 -0
- package/src/table/theme.scss +1 -3
- package/src/table/transforms.js +2 -1
- package/src/table-of-contents/edit.js +2 -2
- package/src/tag-cloud/edit.js +3 -2
- package/src/template-part/edit/selection-modal.js +4 -3
- package/src/template-part/edit/utils/hooks.js +7 -3
- package/src/template-part/editor.scss +20 -2
- package/src/template-part/index.php +6 -2
- package/src/template-part/variations.js +4 -0
- package/src/text-columns/edit.js +1 -0
- package/src/utils/transformation-categories.native.js +1 -0
- package/src/video/edit.js +1 -1
- package/src/video/edit.native.js +1 -2
- package/test/babel-plugin.js +35 -35
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -4,24 +4,23 @@ import { createElement } from "@wordpress/element";
|
|
|
4
4
|
* External dependencies
|
|
5
5
|
*/
|
|
6
6
|
import classnames from 'classnames';
|
|
7
|
-
import escapeHtml from 'escape-html';
|
|
8
7
|
/**
|
|
9
8
|
* WordPress dependencies
|
|
10
9
|
*/
|
|
11
10
|
|
|
12
11
|
import { useSelect, useDispatch } from '@wordpress/data';
|
|
13
|
-
import { PanelBody,
|
|
12
|
+
import { PanelBody, TextControl, TextareaControl, ToolbarButton, ToolbarGroup } from '@wordpress/components';
|
|
14
13
|
import { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';
|
|
15
|
-
import { __
|
|
16
|
-
import { BlockControls, InnerBlocks, useInnerBlocksProps, InspectorControls, RichText,
|
|
17
|
-
import { isURL, prependHTTP
|
|
18
|
-
import { Fragment, useState, useEffect, useRef
|
|
14
|
+
import { __ } from '@wordpress/i18n';
|
|
15
|
+
import { BlockControls, InnerBlocks, useInnerBlocksProps, InspectorControls, RichText, useBlockProps, store as blockEditorStore, getColorClassName } from '@wordpress/block-editor';
|
|
16
|
+
import { isURL, prependHTTP } from '@wordpress/url';
|
|
17
|
+
import { Fragment, useState, useEffect, useRef } from '@wordpress/element';
|
|
19
18
|
import { placeCaretAtHorizontalEdge } from '@wordpress/dom';
|
|
20
19
|
import { link as linkIcon, removeSubmenu } from '@wordpress/icons';
|
|
21
|
-
import { useResourcePermissions
|
|
20
|
+
import { useResourcePermissions } from '@wordpress/core-data';
|
|
22
21
|
import { speak } from '@wordpress/a11y';
|
|
23
22
|
import { createBlock } from '@wordpress/blocks';
|
|
24
|
-
import { useMergeRefs } from '@wordpress/compose';
|
|
23
|
+
import { useMergeRefs, usePrevious } from '@wordpress/compose';
|
|
25
24
|
/**
|
|
26
25
|
* Internal dependencies
|
|
27
26
|
*/
|
|
@@ -79,7 +78,9 @@ const {
|
|
|
79
78
|
editorStyle: "wp-block-navigation-submenu-editor",
|
|
80
79
|
style: "wp-block-navigation-submenu"
|
|
81
80
|
};
|
|
82
|
-
|
|
81
|
+
import { LinkUI } from '../navigation-link/link-ui';
|
|
82
|
+
import { updateAttributes } from '../navigation-link/update-attributes';
|
|
83
|
+
const ALLOWED_BLOCKS = ['core/navigation-link', 'core/navigation-submenu', 'core/page-list'];
|
|
83
84
|
const DEFAULT_BLOCK = {
|
|
84
85
|
name: 'core/navigation-link'
|
|
85
86
|
};
|
|
@@ -133,60 +134,6 @@ const useIsDraggingWithin = elementRef => {
|
|
|
133
134
|
}, []);
|
|
134
135
|
return isDraggingWithin;
|
|
135
136
|
};
|
|
136
|
-
/**
|
|
137
|
-
* Given the Link block's type attribute, return the query params to give to
|
|
138
|
-
* /wp/v2/search.
|
|
139
|
-
*
|
|
140
|
-
* @param {string} type Link block's type attribute.
|
|
141
|
-
* @param {string} kind Link block's entity of kind (post-type|taxonomy)
|
|
142
|
-
* @return {{ type?: string, subtype?: string }} Search query params.
|
|
143
|
-
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
function getSuggestionsQuery(type, kind) {
|
|
147
|
-
switch (type) {
|
|
148
|
-
case 'post':
|
|
149
|
-
case 'page':
|
|
150
|
-
return {
|
|
151
|
-
type: 'post',
|
|
152
|
-
subtype: type
|
|
153
|
-
};
|
|
154
|
-
|
|
155
|
-
case 'category':
|
|
156
|
-
return {
|
|
157
|
-
type: 'term',
|
|
158
|
-
subtype: 'category'
|
|
159
|
-
};
|
|
160
|
-
|
|
161
|
-
case 'tag':
|
|
162
|
-
return {
|
|
163
|
-
type: 'term',
|
|
164
|
-
subtype: 'post_tag'
|
|
165
|
-
};
|
|
166
|
-
|
|
167
|
-
case 'post_format':
|
|
168
|
-
return {
|
|
169
|
-
type: 'post-format'
|
|
170
|
-
};
|
|
171
|
-
|
|
172
|
-
default:
|
|
173
|
-
if (kind === 'taxonomy') {
|
|
174
|
-
return {
|
|
175
|
-
type: 'term',
|
|
176
|
-
subtype: type
|
|
177
|
-
};
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
if (kind === 'post-type') {
|
|
181
|
-
return {
|
|
182
|
-
type: 'post',
|
|
183
|
-
subtype: type
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return {};
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
137
|
/**
|
|
191
138
|
* Determine the colors for a menu.
|
|
192
139
|
*
|
|
@@ -263,63 +210,7 @@ function getColors(context, isSubMenu) {
|
|
|
263
210
|
* @property {string} [title] Link title attribute.
|
|
264
211
|
*/
|
|
265
212
|
|
|
266
|
-
/**
|
|
267
|
-
* Link Control onChange handler that updates block attributes when a setting is changed.
|
|
268
|
-
*
|
|
269
|
-
* @param {Object} updatedValue New block attributes to update.
|
|
270
|
-
* @param {Function} setAttributes Block attribute update function.
|
|
271
|
-
* @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.
|
|
272
|
-
*
|
|
273
|
-
*/
|
|
274
|
-
|
|
275
213
|
|
|
276
|
-
export const updateNavigationLinkBlockAttributes = function () {
|
|
277
|
-
let updatedValue = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
278
|
-
let setAttributes = arguments.length > 1 ? arguments[1] : undefined;
|
|
279
|
-
let blockAttributes = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
280
|
-
const {
|
|
281
|
-
label: originalLabel = '',
|
|
282
|
-
kind: originalKind = '',
|
|
283
|
-
type: originalType = ''
|
|
284
|
-
} = blockAttributes;
|
|
285
|
-
const {
|
|
286
|
-
title = '',
|
|
287
|
-
url = '',
|
|
288
|
-
opensInNewTab,
|
|
289
|
-
id,
|
|
290
|
-
kind: newKind = originalKind,
|
|
291
|
-
type: newType = originalType
|
|
292
|
-
} = updatedValue;
|
|
293
|
-
const normalizedTitle = title.replace(/http(s?):\/\//gi, '');
|
|
294
|
-
const normalizedURL = url.replace(/http(s?):\/\//gi, '');
|
|
295
|
-
const escapeTitle = title !== '' && normalizedTitle !== normalizedURL && originalLabel !== title;
|
|
296
|
-
const label = escapeTitle ? escapeHtml(title) : originalLabel || escapeHtml(normalizedURL); // In https://github.com/WordPress/gutenberg/pull/24670 we decided to use "tag" in favor of "post_tag"
|
|
297
|
-
|
|
298
|
-
const type = newType === 'post_tag' ? 'tag' : newType.replace('-', '_');
|
|
299
|
-
const isBuiltInType = ['post', 'page', 'tag', 'category'].indexOf(type) > -1;
|
|
300
|
-
const isCustomLink = !newKind && !isBuiltInType || newKind === 'custom';
|
|
301
|
-
const kind = isCustomLink ? 'custom' : newKind;
|
|
302
|
-
setAttributes({ // Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.
|
|
303
|
-
...(url && {
|
|
304
|
-
url: encodeURI(safeDecodeURI(url))
|
|
305
|
-
}),
|
|
306
|
-
...(label && {
|
|
307
|
-
label
|
|
308
|
-
}),
|
|
309
|
-
...(undefined !== opensInNewTab && {
|
|
310
|
-
opensInNewTab
|
|
311
|
-
}),
|
|
312
|
-
...(id && Number.isInteger(id) && {
|
|
313
|
-
id
|
|
314
|
-
}),
|
|
315
|
-
...(kind && {
|
|
316
|
-
kind
|
|
317
|
-
}),
|
|
318
|
-
...(type && type !== 'URL' && {
|
|
319
|
-
type
|
|
320
|
-
})
|
|
321
|
-
});
|
|
322
|
-
};
|
|
323
214
|
export default function NavigationSubmenuEdit(_ref) {
|
|
324
215
|
let {
|
|
325
216
|
attributes,
|
|
@@ -333,25 +224,16 @@ export default function NavigationSubmenuEdit(_ref) {
|
|
|
333
224
|
const {
|
|
334
225
|
label,
|
|
335
226
|
type,
|
|
336
|
-
opensInNewTab,
|
|
337
227
|
url,
|
|
338
228
|
description,
|
|
339
229
|
rel,
|
|
340
|
-
title
|
|
341
|
-
kind
|
|
230
|
+
title
|
|
342
231
|
} = attributes;
|
|
343
|
-
const link = {
|
|
344
|
-
url,
|
|
345
|
-
opensInNewTab
|
|
346
|
-
};
|
|
347
232
|
const {
|
|
348
233
|
showSubmenuIcon,
|
|
349
234
|
maxNestingLevel,
|
|
350
235
|
openSubmenusOnClick
|
|
351
236
|
} = context;
|
|
352
|
-
const {
|
|
353
|
-
saveEntityRecord
|
|
354
|
-
} = useDispatch(coreStore);
|
|
355
237
|
const {
|
|
356
238
|
__unstableMarkNextChangeAsNotPersistent,
|
|
357
239
|
replaceBlock
|
|
@@ -409,7 +291,8 @@ export default function NavigationSubmenuEdit(_ref) {
|
|
|
409
291
|
selectedBlockHasChildren: !!(selectedBlockChildren !== null && selectedBlockChildren !== void 0 && selectedBlockChildren.length),
|
|
410
292
|
onlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink
|
|
411
293
|
};
|
|
412
|
-
}, [clientId]);
|
|
294
|
+
}, [clientId]);
|
|
295
|
+
const prevHasChildren = usePrevious(hasChildren); // Show the LinkControl on mount if the URL is empty
|
|
413
296
|
// ( When adding a new menu item)
|
|
414
297
|
// This can't be done in the useState call because it conflicts
|
|
415
298
|
// with the autofocus behavior of the BlockListBlock component.
|
|
@@ -482,21 +365,6 @@ export default function NavigationSubmenuEdit(_ref) {
|
|
|
482
365
|
userCanCreate = postsPermissions.canCreate;
|
|
483
366
|
}
|
|
484
367
|
|
|
485
|
-
async function handleCreate(pageTitle) {
|
|
486
|
-
const postType = type || 'page';
|
|
487
|
-
const page = await saveEntityRecord('postType', postType, {
|
|
488
|
-
title: pageTitle,
|
|
489
|
-
status: 'draft'
|
|
490
|
-
});
|
|
491
|
-
return {
|
|
492
|
-
id: page.id,
|
|
493
|
-
type: postType,
|
|
494
|
-
title: page.title.rendered,
|
|
495
|
-
url: page.link,
|
|
496
|
-
kind: 'post-type'
|
|
497
|
-
};
|
|
498
|
-
}
|
|
499
|
-
|
|
500
368
|
const {
|
|
501
369
|
textColor,
|
|
502
370
|
customTextColor,
|
|
@@ -562,6 +430,12 @@ export default function NavigationSubmenuEdit(_ref) {
|
|
|
562
430
|
replaceBlock(clientId, newLinkBlock);
|
|
563
431
|
}
|
|
564
432
|
|
|
433
|
+
useEffect(() => {
|
|
434
|
+
// If block becomes empty, transform to Navigation Link.
|
|
435
|
+
if (!hasChildren && prevHasChildren) {
|
|
436
|
+
transformToLink();
|
|
437
|
+
}
|
|
438
|
+
}, [hasChildren, prevHasChildren]);
|
|
565
439
|
const canConvertToLink = !selectedBlockHasChildren || onlyDescendantIsEmptyLink;
|
|
566
440
|
return createElement(Fragment, null, createElement(BlockControls, null, createElement(ToolbarGroup, null, !openSubmenusOnClick && createElement(ToolbarButton, {
|
|
567
441
|
name: "link",
|
|
@@ -578,7 +452,25 @@ export default function NavigationSubmenuEdit(_ref) {
|
|
|
578
452
|
isDisabled: !canConvertToLink
|
|
579
453
|
}))), createElement(InspectorControls, null, createElement(PanelBody, {
|
|
580
454
|
title: __('Link settings')
|
|
581
|
-
}, createElement(
|
|
455
|
+
}, createElement(TextControl, {
|
|
456
|
+
value: label || '',
|
|
457
|
+
onChange: labelValue => {
|
|
458
|
+
setAttributes({
|
|
459
|
+
label: labelValue
|
|
460
|
+
});
|
|
461
|
+
},
|
|
462
|
+
label: __('Label'),
|
|
463
|
+
autoComplete: "off"
|
|
464
|
+
}), createElement(TextControl, {
|
|
465
|
+
value: url || '',
|
|
466
|
+
onChange: urlValue => {
|
|
467
|
+
setAttributes({
|
|
468
|
+
url: urlValue
|
|
469
|
+
});
|
|
470
|
+
},
|
|
471
|
+
label: __('URL'),
|
|
472
|
+
autoComplete: "off"
|
|
473
|
+
}), createElement(TextareaControl, {
|
|
582
474
|
value: description || '',
|
|
583
475
|
onChange: descriptionValue => {
|
|
584
476
|
setAttributes({
|
|
@@ -626,43 +518,23 @@ export default function NavigationSubmenuEdit(_ref) {
|
|
|
626
518
|
setIsLinkOpen(true);
|
|
627
519
|
}
|
|
628
520
|
}
|
|
629
|
-
}), !openSubmenusOnClick && isLinkOpen && createElement(
|
|
630
|
-
|
|
521
|
+
}), !openSubmenusOnClick && isLinkOpen && createElement(LinkUI, {
|
|
522
|
+
className: "wp-block-navigation-link__inline-link-input",
|
|
523
|
+
clientId: clientId,
|
|
524
|
+
link: attributes,
|
|
631
525
|
onClose: () => setIsLinkOpen(false),
|
|
632
526
|
anchor: popoverAnchor,
|
|
633
|
-
|
|
634
|
-
}, createElement(LinkControl, {
|
|
635
|
-
className: "wp-block-navigation-link__inline-link-input",
|
|
636
|
-
value: link,
|
|
637
|
-
showInitialSuggestions: true,
|
|
638
|
-
withCreateSuggestion: userCanCreate,
|
|
639
|
-
createSuggestion: handleCreate,
|
|
640
|
-
createSuggestionButtonText: searchTerm => {
|
|
641
|
-
let format;
|
|
642
|
-
|
|
643
|
-
if (type === 'post') {
|
|
644
|
-
/* translators: %s: search term. */
|
|
645
|
-
format = __('Create draft post: <mark>%s</mark>');
|
|
646
|
-
} else {
|
|
647
|
-
/* translators: %s: search term. */
|
|
648
|
-
format = __('Create draft page: <mark>%s</mark>');
|
|
649
|
-
}
|
|
650
|
-
|
|
651
|
-
return createInterpolateElement(sprintf(format, searchTerm), {
|
|
652
|
-
mark: createElement("mark", null)
|
|
653
|
-
});
|
|
654
|
-
},
|
|
655
|
-
noDirectEntry: !!type,
|
|
656
|
-
noURLSuggestion: !!type,
|
|
657
|
-
suggestionsQuery: getSuggestionsQuery(type, kind),
|
|
658
|
-
onChange: updatedValue => updateNavigationLinkBlockAttributes(updatedValue, setAttributes, attributes),
|
|
527
|
+
hasCreateSuggestion: userCanCreate,
|
|
659
528
|
onRemove: () => {
|
|
660
529
|
setAttributes({
|
|
661
530
|
url: ''
|
|
662
531
|
});
|
|
663
532
|
speak(__('Link removed.'), 'assertive');
|
|
533
|
+
},
|
|
534
|
+
onChange: updatedValue => {
|
|
535
|
+
updateAttributes(updatedValue, setAttributes, attributes);
|
|
664
536
|
}
|
|
665
|
-
}))
|
|
537
|
+
})), (showSubmenuIcon || openSubmenusOnClick) && createElement("span", {
|
|
666
538
|
className: "wp-block-navigation__submenu-icon"
|
|
667
539
|
}, createElement(ItemSubmenuIcon, null)), createElement("div", innerBlocksProps)));
|
|
668
540
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"names":["classnames","escapeHtml","useSelect","useDispatch","PanelBody","Popover","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","displayShortcut","isKeyboardEvent","__","sprintf","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","__experimentalLinkControl","LinkControl","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","safeDecodeURI","Fragment","useState","useEffect","useRef","createInterpolateElement","placeCaretAtHorizontalEdge","link","linkIcon","removeSubmenu","useResourcePermissions","coreStore","speak","createBlock","useMergeRefs","ItemSubmenuIcon","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","getSuggestionsQuery","type","kind","subtype","getColors","context","isSubMenu","textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","style","colors","color","text","background","updateNavigationLinkBlockAttributes","updatedValue","setAttributes","blockAttributes","label","originalLabel","originalKind","originalType","title","url","opensInNewTab","id","newKind","newType","normalizedTitle","replace","normalizedURL","escapeTitle","isBuiltInType","indexOf","isCustomLink","encodeURI","undefined","Number","isInteger","NavigationSubmenuEdit","attributes","isSelected","mergeBlocks","onReplace","clientId","description","rel","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","saveEntityRecord","__unstableMarkNextChangeAsNotPersistent","replaceBlock","isLinkOpen","setIsLinkOpen","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","pagesPermissions","postsPermissions","isAtMaxNesting","isTopLevelItem","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasChildren","selectedBlockHasChildren","onlyDescendantIsEmptyLink","select","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","getBlockCount","getBlockOrder","_onlyDescendantIsEmptyLink","selectedBlockId","selectedBlockChildren","length","singleBlock","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","userCanCreate","canCreate","handleCreate","pageTitle","postType","page","status","rendered","onKeyDown","primary","blockProps","className","innerBlocksColors","allowedBlocks","filter","blockName","innerBlocksProps","__experimentalDefaultBlock","__experimentalDirectInsert","__experimentalCaptureToolbars","renderAppender","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","canConvertToLink","descriptionValue","titleValue","relValue","labelValue","searchTerm","format","mark"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AACA,OAAOC,UAAP,MAAuB,aAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,SADD,EAECC,OAFD,EAGCC,WAHD,EAICC,eAJD,EAKCC,aALD,EAMCC,YAND,QAOO,uBAPP;AAQA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,qBAAjD;AACA,SAASC,EAAT,EAAaC,OAAb,QAA4B,iBAA5B;AACA,SACCC,aADD,EAECC,WAFD,EAGCC,mBAHD,EAICC,iBAJD,EAKCC,QALD,EAMCC,yBAAyB,IAAIC,WAN9B,EAOCC,aAPD,EAQCC,KAAK,IAAIC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,eAAe,IAAIE,mBAArB,KACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,cAAC,eAAD,OADD,CApFF,EAwFC,qBAAU2D,gBAAV,CAxFD,CAvDD,CADD;AAoJA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\nimport escapeHtml from 'escape-html';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tPopover,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __, sprintf } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\t__experimentalLinkControl as LinkControl,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP, safeDecodeURI } from '@wordpress/url';\nimport {\n\tFragment,\n\tuseState,\n\tuseEffect,\n\tuseRef,\n\tcreateInterpolateElement,\n} from '@wordpress/element';\nimport { placeCaretAtHorizontalEdge } from '@wordpress/dom';\nimport { link as linkIcon, removeSubmenu } from '@wordpress/icons';\nimport {\n\tuseResourcePermissions,\n\tstore as coreStore,\n} from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\nimport { createBlock } from '@wordpress/blocks';\nimport { useMergeRefs } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { name } from './block.json';\n\nconst ALLOWED_BLOCKS = [ 'core/navigation-link', 'core/navigation-submenu' ];\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n};\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\n/**\n * Given the Link block's type attribute, return the query params to give to\n * /wp/v2/search.\n *\n * @param {string} type Link block's type attribute.\n * @param {string} kind Link block's entity of kind (post-type|taxonomy)\n * @return {{ type?: string, subtype?: string }} Search query params.\n */\nfunction getSuggestionsQuery( type, kind ) {\n\tswitch ( type ) {\n\t\tcase 'post':\n\t\tcase 'page':\n\t\t\treturn { type: 'post', subtype: type };\n\t\tcase 'category':\n\t\t\treturn { type: 'term', subtype: 'category' };\n\t\tcase 'tag':\n\t\t\treturn { type: 'term', subtype: 'post_tag' };\n\t\tcase 'post_format':\n\t\t\treturn { type: 'post-format' };\n\t\tdefault:\n\t\t\tif ( kind === 'taxonomy' ) {\n\t\t\t\treturn { type: 'term', subtype: type };\n\t\t\t}\n\t\t\tif ( kind === 'post-type' ) {\n\t\t\t\treturn { type: 'post', subtype: type };\n\t\t\t}\n\t\t\treturn {};\n\t}\n}\n\n/**\n * Determine the colors for a menu.\n *\n * Order of priority is:\n * 1: Overlay custom colors (if submenu)\n * 2: Overlay theme colors (if submenu)\n * 3: Custom colors\n * 4: Theme colors\n * 5: Global styles\n *\n * @param {Object} context\n * @param {boolean} isSubMenu\n */\nfunction getColors( context, isSubMenu ) {\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t\toverlayTextColor,\n\t\tcustomOverlayTextColor,\n\t\toverlayBackgroundColor,\n\t\tcustomOverlayBackgroundColor,\n\t\tstyle,\n\t} = context;\n\n\tconst colors = {};\n\n\tif ( isSubMenu && !! customOverlayTextColor ) {\n\t\tcolors.customTextColor = customOverlayTextColor;\n\t} else if ( isSubMenu && !! overlayTextColor ) {\n\t\tcolors.textColor = overlayTextColor;\n\t} else if ( !! customTextColor ) {\n\t\tcolors.customTextColor = customTextColor;\n\t} else if ( !! textColor ) {\n\t\tcolors.textColor = textColor;\n\t} else if ( !! style?.color?.text ) {\n\t\tcolors.customTextColor = style.color.text;\n\t}\n\n\tif ( isSubMenu && !! customOverlayBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customOverlayBackgroundColor;\n\t} else if ( isSubMenu && !! overlayBackgroundColor ) {\n\t\tcolors.backgroundColor = overlayBackgroundColor;\n\t} else if ( !! customBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customBackgroundColor;\n\t} else if ( !! backgroundColor ) {\n\t\tcolors.backgroundColor = backgroundColor;\n\t} else if ( !! style?.color?.background ) {\n\t\tcolors.customTextColor = style.color.background;\n\t}\n\n\treturn colors;\n}\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\n/**\n * Link Control onChange handler that updates block attributes when a setting is changed.\n *\n * @param {Object} updatedValue New block attributes to update.\n * @param {Function} setAttributes Block attribute update function.\n * @param {WPNavigationLinkBlockAttributes} blockAttributes Current block attributes.\n *\n */\nexport const updateNavigationLinkBlockAttributes = (\n\tupdatedValue = {},\n\tsetAttributes,\n\tblockAttributes = {}\n) => {\n\tconst {\n\t\tlabel: originalLabel = '',\n\t\tkind: originalKind = '',\n\t\ttype: originalType = '',\n\t} = blockAttributes;\n\tconst {\n\t\ttitle = '',\n\t\turl = '',\n\t\topensInNewTab,\n\t\tid,\n\t\tkind: newKind = originalKind,\n\t\ttype: newType = originalType,\n\t} = updatedValue;\n\n\tconst normalizedTitle = title.replace( /http(s?):\\/\\//gi, '' );\n\tconst normalizedURL = url.replace( /http(s?):\\/\\//gi, '' );\n\tconst escapeTitle =\n\t\ttitle !== '' &&\n\t\tnormalizedTitle !== normalizedURL &&\n\t\toriginalLabel !== title;\n\tconst label = escapeTitle\n\t\t? escapeHtml( title )\n\t\t: originalLabel || escapeHtml( normalizedURL );\n\n\t// In https://github.com/WordPress/gutenberg/pull/24670 we decided to use \"tag\" in favor of \"post_tag\"\n\tconst type = newType === 'post_tag' ? 'tag' : newType.replace( '-', '_' );\n\n\tconst isBuiltInType =\n\t\t[ 'post', 'page', 'tag', 'category' ].indexOf( type ) > -1;\n\n\tconst isCustomLink =\n\t\t( ! newKind && ! isBuiltInType ) || newKind === 'custom';\n\tconst kind = isCustomLink ? 'custom' : newKind;\n\n\tsetAttributes( {\n\t\t// Passed `url` may already be encoded. To prevent double encoding, decodeURI is executed to revert to the original string.\n\t\t...( url && { url: encodeURI( safeDecodeURI( url ) ) } ),\n\t\t...( label && { label } ),\n\t\t...( undefined !== opensInNewTab && { opensInNewTab } ),\n\t\t...( id && Number.isInteger( id ) && { id } ),\n\t\t...( kind && { kind } ),\n\t\t...( type && type !== 'URL' && { type } ),\n\t} );\n};\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { label, type, opensInNewTab, url, description, rel, title, kind } =\n\t\tattributes;\n\tconst link = {\n\t\turl,\n\t\topensInNewTab,\n\t};\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\tconst { saveEntityRecord } = useDispatch( coreStore );\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceBlock } =\n\t\tuseDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\n\tconst pagesPermissions = useResourcePermissions( 'pages' );\n\tconst postsPermissions = useResourcePermissions( 'posts' );\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelItem,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasChildren,\n\t\tselectedBlockHasChildren,\n\t\tonlyDescendantIsEmptyLink,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tlet _onlyDescendantIsEmptyLink;\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst selectedBlockChildren = getBlockOrder( selectedBlockId );\n\n\t\t\t// Check for a single descendant in the submenu. If that block\n\t\t\t// is a link block in a \"placeholder\" state with no label then\n\t\t\t// we can consider as an \"empty\" link.\n\t\t\tif ( selectedBlockChildren?.length === 1 ) {\n\t\t\t\tconst singleBlock = getBlock( selectedBlockChildren[ 0 ] );\n\n\t\t\t\t_onlyDescendantIsEmptyLink =\n\t\t\t\t\tsingleBlock?.name === 'core/navigation-link' &&\n\t\t\t\t\t! singleBlock?.attributes?.label;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length >=\n\t\t\t\t\tmaxNestingLevel,\n\t\t\t\tisTopLevelItem:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length === 0,\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisImmediateParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasChildren: !! getBlockCount( clientId ),\n\t\t\t\tselectedBlockHasChildren: !! selectedBlockChildren?.length,\n\t\t\t\tonlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\t// Show the LinkControl on mount if the URL is empty\n\t// ( When adding a new menu item)\n\t// This can't be done in the useState call because it conflicts\n\t// with the autofocus behavior of the BlockListBlock component.\n\tuseEffect( () => {\n\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [] );\n\n\t// Store the colors from context as attributes for rendering.\n\tuseEffect( () => {\n\t\t// This side-effect should not create an undo level as those should\n\t\t// only be created via user interactions. Mark this change as\n\t\t// not persistent to avoid undo level creation.\n\t\t// See https://github.com/WordPress/gutenberg/issues/34564.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( { isTopLevelItem } );\n\t}, [ isTopLevelItem ] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = pagesPermissions.canCreate;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = postsPermissions.canCreate;\n\t}\n\n\tasync function handleCreate( pageTitle ) {\n\t\tconst postType = type || 'page';\n\n\t\tconst page = await saveEntityRecord( 'postType', postType, {\n\t\t\ttitle: pageTitle,\n\t\t\tstatus: 'draft',\n\t\t} );\n\n\t\treturn {\n\t\t\tid: page.id,\n\t\t\ttype: postType,\n\t\t\ttitle: page.title.rendered,\n\t\t\turl: page.link,\n\t\t\tkind: 'post-type',\n\t\t};\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelItem );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasChildren,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName( 'background-color', backgroundColor ) ]:\n\t\t\t\t!! backgroundColor,\n\t\t\t'open-on-click': openSubmenusOnClick,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\t// Always use overlay colors for submenus.\n\tconst innerBlocksColors = getColors( context, true );\n\n\tconst allowedBlocks = isAtMaxNesting\n\t\t? ALLOWED_BLOCKS.filter(\n\t\t\t\t( blockName ) => blockName !== 'core/navigation-submenu'\n\t\t )\n\t\t: ALLOWED_BLOCKS;\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: classnames( 'wp-block-navigation__submenu-container', {\n\t\t\t\t'is-parent-of-selected-block': isParentOfSelectedBlock,\n\t\t\t\t'has-text-color': !! (\n\t\t\t\t\tinnerBlocksColors.textColor ||\n\t\t\t\t\tinnerBlocksColors.customTextColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.textColor }-color` ]:\n\t\t\t\t\t!! innerBlocksColors.textColor,\n\t\t\t\t'has-background': !! (\n\t\t\t\t\tinnerBlocksColors.backgroundColor ||\n\t\t\t\t\tinnerBlocksColors.customBackgroundColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]:\n\t\t\t\t\t!! innerBlocksColors.backgroundColor,\n\t\t\t} ),\n\t\t\tstyle: {\n\t\t\t\tcolor: innerBlocksColors.customTextColor,\n\t\t\t\tbackgroundColor: innerBlocksColors.customBackgroundColor,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tallowedBlocks,\n\t\t\t__experimentalDefaultBlock: DEFAULT_BLOCK,\n\t\t\t__experimentalDirectInsert: true,\n\n\t\t\t// Ensure block toolbar is not too far removed from item\n\t\t\t// being edited.\n\t\t\t// see: https://github.com/WordPress/gutenberg/pull/34615.\n\t\t\t__experimentalCaptureToolbars: true,\n\n\t\t\trenderAppender:\n\t\t\t\tisSelected ||\n\t\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t\t! selectedBlockHasChildren ) ||\n\t\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\t\thasChildren\n\t\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t\t: false,\n\t\t}\n\t);\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\tfunction transformToLink() {\n\t\tconst newLinkBlock = createBlock( 'core/navigation-link', attributes );\n\t\treplaceBlock( clientId, newLinkBlock );\n\t}\n\n\tconst canConvertToLink =\n\t\t! selectedBlockHasChildren || onlyDescendantIsEmptyLink;\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"revert\"\n\t\t\t\t\t\ticon={ removeSubmenu }\n\t\t\t\t\t\ttitle={ __( 'Convert to Link' ) }\n\t\t\t\t\t\tonClick={ transformToLink }\n\t\t\t\t\t\tclassName=\"wp-block-navigation__submenu__revert\"\n\t\t\t\t\t\tisDisabled={ ! canConvertToLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link title' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<Popover\n\t\t\t\t\t\t\tplacement=\"bottom\"\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\tshift\n\t\t\t\t\t\t>\n\t\t\t\t\t\t\t<LinkControl\n\t\t\t\t\t\t\t\tclassName=\"wp-block-navigation-link__inline-link-input\"\n\t\t\t\t\t\t\t\tvalue={ link }\n\t\t\t\t\t\t\t\tshowInitialSuggestions={ true }\n\t\t\t\t\t\t\t\twithCreateSuggestion={ userCanCreate }\n\t\t\t\t\t\t\t\tcreateSuggestion={ handleCreate }\n\t\t\t\t\t\t\t\tcreateSuggestionButtonText={ ( searchTerm ) => {\n\t\t\t\t\t\t\t\t\tlet format;\n\t\t\t\t\t\t\t\t\tif ( type === 'post' ) {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft post: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t} else {\n\t\t\t\t\t\t\t\t\t\t/* translators: %s: search term. */\n\t\t\t\t\t\t\t\t\t\tformat = __(\n\t\t\t\t\t\t\t\t\t\t\t'Create draft page: <mark>%s</mark>'\n\t\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\treturn createInterpolateElement(\n\t\t\t\t\t\t\t\t\t\tsprintf( format, searchTerm ),\n\t\t\t\t\t\t\t\t\t\t{ mark: <mark /> }\n\t\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t\tnoDirectEntry={ !! type }\n\t\t\t\t\t\t\t\tnoURLSuggestion={ !! type }\n\t\t\t\t\t\t\t\tsuggestionsQuery={ getSuggestionsQuery(\n\t\t\t\t\t\t\t\t\ttype,\n\t\t\t\t\t\t\t\t\tkind\n\t\t\t\t\t\t\t\t) }\n\t\t\t\t\t\t\t\tonChange={ ( updatedValue ) =>\n\t\t\t\t\t\t\t\t\tupdateNavigationLinkBlockAttributes(\n\t\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t\t\t)\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\t/>\n\t\t\t\t\t\t</Popover>\n\t\t\t\t\t) }\n\t\t\t\t</ParentElement>\n\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</Fragment>\n\t);\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/navigation-submenu/edit.js"],"names":["classnames","useSelect","useDispatch","PanelBody","TextControl","TextareaControl","ToolbarButton","ToolbarGroup","displayShortcut","isKeyboardEvent","__","BlockControls","InnerBlocks","useInnerBlocksProps","InspectorControls","RichText","useBlockProps","store","blockEditorStore","getColorClassName","isURL","prependHTTP","Fragment","useState","useEffect","useRef","placeCaretAtHorizontalEdge","link","linkIcon","removeSubmenu","useResourcePermissions","speak","createBlock","useMergeRefs","usePrevious","ItemSubmenuIcon","LinkUI","updateAttributes","ALLOWED_BLOCKS","DEFAULT_BLOCK","name","useIsDraggingWithin","elementRef","isDraggingWithin","setIsDraggingWithin","ownerDocument","current","handleDragStart","event","handleDragEnter","handleDragEnd","contains","target","addEventListener","removeEventListener","getColors","context","isSubMenu","textColor","customTextColor","backgroundColor","customBackgroundColor","overlayTextColor","customOverlayTextColor","overlayBackgroundColor","customOverlayBackgroundColor","style","colors","color","text","background","NavigationSubmenuEdit","attributes","isSelected","setAttributes","mergeBlocks","onReplace","clientId","label","type","url","description","rel","title","showSubmenuIcon","maxNestingLevel","openSubmenusOnClick","__unstableMarkNextChangeAsNotPersistent","replaceBlock","isLinkOpen","setIsLinkOpen","popoverAnchor","setPopoverAnchor","listItemRef","itemLabelPlaceholder","ref","pagesPermissions","postsPermissions","isAtMaxNesting","isTopLevelItem","isParentOfSelectedBlock","isImmediateParentOfSelectedBlock","hasChildren","selectedBlockHasChildren","onlyDescendantIsEmptyLink","select","hasSelectedInnerBlock","getSelectedBlockClientId","getBlockParentsByBlockName","getBlock","getBlockCount","getBlockOrder","_onlyDescendantIsEmptyLink","selectedBlockId","selectedBlockChildren","length","singleBlock","prevHasChildren","test","selectLabelText","focus","defaultView","selection","getSelection","range","createRange","selectNodeContents","removeAllRanges","addRange","userCanCreate","canCreate","onKeyDown","primary","blockProps","className","innerBlocksColors","allowedBlocks","filter","blockName","innerBlocksProps","__experimentalDefaultBlock","__experimentalDirectInsert","__experimentalCaptureToolbars","renderAppender","ButtonBlockAppender","ParentElement","transformToLink","newLinkBlock","canConvertToLink","labelValue","urlValue","descriptionValue","titleValue","relValue","updatedValue"],"mappings":";;AAAA;AACA;AACA;AACA,OAAOA,UAAP,MAAuB,YAAvB;AAEA;AACA;AACA;;AACA,SAASC,SAAT,EAAoBC,WAApB,QAAuC,iBAAvC;AACA,SACCC,SADD,EAECC,WAFD,EAGCC,eAHD,EAICC,aAJD,EAKCC,YALD,QAMO,uBANP;AAOA,SAASC,eAAT,EAA0BC,eAA1B,QAAiD,qBAAjD;AACA,SAASC,EAAT,QAAmB,iBAAnB;AACA,SACCC,aADD,EAECC,WAFD,EAGCC,mBAHD,EAIC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S,EAAC,6CADX;AAEC,IAAA,QAAQ,EAAGZ,QAFZ;AAGC,IAAA,IAAI,EAAGL,UAHR;AAIC,IAAA,OAAO,EAAG,MAAMkB,aAAa,CAAE,KAAF,CAJ9B;AAKC,IAAA,MAAM,EAAGC,aALV;AAMC,IAAA,mBAAmB,EAAGsC,aANvB;AAOC,IAAA,QAAQ,EAAG,MAAM;AAChBvD,MAAAA,aAAa,CAAE;AAAEM,QAAAA,GAAG,EAAE;AAAP,OAAF,CAAb;AACAjD,MAAAA,KAAK,CAAErB,EAAE,CAAE,eAAF,CAAJ,EAAyB,WAAzB,CAAL;AACA,KAVF;AAWC,IAAA,QAAQ,EAAKgJ,YAAF,IAAoB;AAC9BrH,MAAAA,gBAAgB,CACfqH,YADe,EAEfhF,aAFe,EAGfF,UAHe,CAAhB;AAKA;AAjBF,IA9BF,CAFD,EAqDG,CAAEY,eAAe,IAAIE,mBAArB,KACD;AAAM,IAAA,SAAS,EAAC;AAAhB,KACC,cAAC,eAAD,OADD,CAtDF,EA0DC,qBAAUqD,gBAAV,CA1DD,CAxED,CADD;AAuIA","sourcesContent":["/**\n * External dependencies\n */\nimport classnames from 'classnames';\n\n/**\n * WordPress dependencies\n */\nimport { useSelect, useDispatch } from '@wordpress/data';\nimport {\n\tPanelBody,\n\tTextControl,\n\tTextareaControl,\n\tToolbarButton,\n\tToolbarGroup,\n} from '@wordpress/components';\nimport { displayShortcut, isKeyboardEvent } from '@wordpress/keycodes';\nimport { __ } from '@wordpress/i18n';\nimport {\n\tBlockControls,\n\tInnerBlocks,\n\tuseInnerBlocksProps,\n\tInspectorControls,\n\tRichText,\n\tuseBlockProps,\n\tstore as blockEditorStore,\n\tgetColorClassName,\n} from '@wordpress/block-editor';\nimport { isURL, prependHTTP } from '@wordpress/url';\nimport { Fragment, useState, useEffect, useRef } from '@wordpress/element';\nimport { placeCaretAtHorizontalEdge } from '@wordpress/dom';\nimport { link as linkIcon, removeSubmenu } from '@wordpress/icons';\nimport { useResourcePermissions } from '@wordpress/core-data';\nimport { speak } from '@wordpress/a11y';\nimport { createBlock } from '@wordpress/blocks';\nimport { useMergeRefs, usePrevious } from '@wordpress/compose';\n\n/**\n * Internal dependencies\n */\nimport { ItemSubmenuIcon } from './icons';\nimport { name } from './block.json';\nimport { LinkUI } from '../navigation-link/link-ui';\nimport { updateAttributes } from '../navigation-link/update-attributes';\n\nconst ALLOWED_BLOCKS = [\n\t'core/navigation-link',\n\t'core/navigation-submenu',\n\t'core/page-list',\n];\n\nconst DEFAULT_BLOCK = {\n\tname: 'core/navigation-link',\n};\n\n/**\n * A React hook to determine if it's dragging within the target element.\n *\n * @typedef {import('@wordpress/element').RefObject} RefObject\n *\n * @param {RefObject<HTMLElement>} elementRef The target elementRef object.\n *\n * @return {boolean} Is dragging within the target element.\n */\nconst useIsDraggingWithin = ( elementRef ) => {\n\tconst [ isDraggingWithin, setIsDraggingWithin ] = useState( false );\n\n\tuseEffect( () => {\n\t\tconst { ownerDocument } = elementRef.current;\n\n\t\tfunction handleDragStart( event ) {\n\t\t\t// Check the first time when the dragging starts.\n\t\t\thandleDragEnter( event );\n\t\t}\n\n\t\t// Set to false whenever the user cancel the drag event by either releasing the mouse or press Escape.\n\t\tfunction handleDragEnd() {\n\t\t\tsetIsDraggingWithin( false );\n\t\t}\n\n\t\tfunction handleDragEnter( event ) {\n\t\t\t// Check if the current target is inside the item element.\n\t\t\tif ( elementRef.current.contains( event.target ) ) {\n\t\t\t\tsetIsDraggingWithin( true );\n\t\t\t} else {\n\t\t\t\tsetIsDraggingWithin( false );\n\t\t\t}\n\t\t}\n\n\t\t// Bind these events to the document to catch all drag events.\n\t\t// Ideally, we can also use `event.relatedTarget`, but sadly that\n\t\t// doesn't work in Safari.\n\t\townerDocument.addEventListener( 'dragstart', handleDragStart );\n\t\townerDocument.addEventListener( 'dragend', handleDragEnd );\n\t\townerDocument.addEventListener( 'dragenter', handleDragEnter );\n\n\t\treturn () => {\n\t\t\townerDocument.removeEventListener( 'dragstart', handleDragStart );\n\t\t\townerDocument.removeEventListener( 'dragend', handleDragEnd );\n\t\t\townerDocument.removeEventListener( 'dragenter', handleDragEnter );\n\t\t};\n\t}, [] );\n\n\treturn isDraggingWithin;\n};\n\n/**\n * Determine the colors for a menu.\n *\n * Order of priority is:\n * 1: Overlay custom colors (if submenu)\n * 2: Overlay theme colors (if submenu)\n * 3: Custom colors\n * 4: Theme colors\n * 5: Global styles\n *\n * @param {Object} context\n * @param {boolean} isSubMenu\n */\nfunction getColors( context, isSubMenu ) {\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t\toverlayTextColor,\n\t\tcustomOverlayTextColor,\n\t\toverlayBackgroundColor,\n\t\tcustomOverlayBackgroundColor,\n\t\tstyle,\n\t} = context;\n\n\tconst colors = {};\n\n\tif ( isSubMenu && !! customOverlayTextColor ) {\n\t\tcolors.customTextColor = customOverlayTextColor;\n\t} else if ( isSubMenu && !! overlayTextColor ) {\n\t\tcolors.textColor = overlayTextColor;\n\t} else if ( !! customTextColor ) {\n\t\tcolors.customTextColor = customTextColor;\n\t} else if ( !! textColor ) {\n\t\tcolors.textColor = textColor;\n\t} else if ( !! style?.color?.text ) {\n\t\tcolors.customTextColor = style.color.text;\n\t}\n\n\tif ( isSubMenu && !! customOverlayBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customOverlayBackgroundColor;\n\t} else if ( isSubMenu && !! overlayBackgroundColor ) {\n\t\tcolors.backgroundColor = overlayBackgroundColor;\n\t} else if ( !! customBackgroundColor ) {\n\t\tcolors.customBackgroundColor = customBackgroundColor;\n\t} else if ( !! backgroundColor ) {\n\t\tcolors.backgroundColor = backgroundColor;\n\t} else if ( !! style?.color?.background ) {\n\t\tcolors.customTextColor = style.color.background;\n\t}\n\n\treturn colors;\n}\n\n/**\n * @typedef {'post-type'|'custom'|'taxonomy'|'post-type-archive'} WPNavigationLinkKind\n */\n\n/**\n * Navigation Link Block Attributes\n *\n * @typedef {Object} WPNavigationLinkBlockAttributes\n *\n * @property {string} [label] Link text.\n * @property {WPNavigationLinkKind} [kind] Kind is used to differentiate between term and post ids to check post draft status.\n * @property {string} [type] The type such as post, page, tag, category and other custom types.\n * @property {string} [rel] The relationship of the linked URL.\n * @property {number} [id] A post or term id.\n * @property {boolean} [opensInNewTab] Sets link target to _blank when true.\n * @property {string} [url] Link href.\n * @property {string} [title] Link title attribute.\n */\n\nexport default function NavigationSubmenuEdit( {\n\tattributes,\n\tisSelected,\n\tsetAttributes,\n\tmergeBlocks,\n\tonReplace,\n\tcontext,\n\tclientId,\n} ) {\n\tconst { label, type, url, description, rel, title } = attributes;\n\n\tconst { showSubmenuIcon, maxNestingLevel, openSubmenusOnClick } = context;\n\n\tconst { __unstableMarkNextChangeAsNotPersistent, replaceBlock } =\n\t\tuseDispatch( blockEditorStore );\n\tconst [ isLinkOpen, setIsLinkOpen ] = useState( false );\n\t// Use internal state instead of a ref to make sure that the component\n\t// re-renders when the popover's anchor updates.\n\tconst [ popoverAnchor, setPopoverAnchor ] = useState( null );\n\tconst listItemRef = useRef( null );\n\tconst isDraggingWithin = useIsDraggingWithin( listItemRef );\n\tconst itemLabelPlaceholder = __( 'Add text…' );\n\tconst ref = useRef();\n\n\tconst pagesPermissions = useResourcePermissions( 'pages' );\n\tconst postsPermissions = useResourcePermissions( 'posts' );\n\n\tconst {\n\t\tisAtMaxNesting,\n\t\tisTopLevelItem,\n\t\tisParentOfSelectedBlock,\n\t\tisImmediateParentOfSelectedBlock,\n\t\thasChildren,\n\t\tselectedBlockHasChildren,\n\t\tonlyDescendantIsEmptyLink,\n\t} = useSelect(\n\t\t( select ) => {\n\t\t\tconst {\n\t\t\t\thasSelectedInnerBlock,\n\t\t\t\tgetSelectedBlockClientId,\n\t\t\t\tgetBlockParentsByBlockName,\n\t\t\t\tgetBlock,\n\t\t\t\tgetBlockCount,\n\t\t\t\tgetBlockOrder,\n\t\t\t} = select( blockEditorStore );\n\n\t\t\tlet _onlyDescendantIsEmptyLink;\n\n\t\t\tconst selectedBlockId = getSelectedBlockClientId();\n\n\t\t\tconst selectedBlockChildren = getBlockOrder( selectedBlockId );\n\n\t\t\t// Check for a single descendant in the submenu. If that block\n\t\t\t// is a link block in a \"placeholder\" state with no label then\n\t\t\t// we can consider as an \"empty\" link.\n\t\t\tif ( selectedBlockChildren?.length === 1 ) {\n\t\t\t\tconst singleBlock = getBlock( selectedBlockChildren[ 0 ] );\n\n\t\t\t\t_onlyDescendantIsEmptyLink =\n\t\t\t\t\tsingleBlock?.name === 'core/navigation-link' &&\n\t\t\t\t\t! singleBlock?.attributes?.label;\n\t\t\t}\n\n\t\t\treturn {\n\t\t\t\tisAtMaxNesting:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length >=\n\t\t\t\t\tmaxNestingLevel,\n\t\t\t\tisTopLevelItem:\n\t\t\t\t\tgetBlockParentsByBlockName( clientId, name ).length === 0,\n\t\t\t\tisParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\ttrue\n\t\t\t\t),\n\t\t\t\tisImmediateParentOfSelectedBlock: hasSelectedInnerBlock(\n\t\t\t\t\tclientId,\n\t\t\t\t\tfalse\n\t\t\t\t),\n\t\t\t\thasChildren: !! getBlockCount( clientId ),\n\t\t\t\tselectedBlockHasChildren: !! selectedBlockChildren?.length,\n\t\t\t\tonlyDescendantIsEmptyLink: _onlyDescendantIsEmptyLink,\n\t\t\t};\n\t\t},\n\t\t[ clientId ]\n\t);\n\n\tconst prevHasChildren = usePrevious( hasChildren );\n\n\t// Show the LinkControl on mount if the URL is empty\n\t// ( When adding a new menu item)\n\t// This can't be done in the useState call because it conflicts\n\t// with the autofocus behavior of the BlockListBlock component.\n\tuseEffect( () => {\n\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}, [] );\n\n\t// Store the colors from context as attributes for rendering.\n\tuseEffect( () => {\n\t\t// This side-effect should not create an undo level as those should\n\t\t// only be created via user interactions. Mark this change as\n\t\t// not persistent to avoid undo level creation.\n\t\t// See https://github.com/WordPress/gutenberg/issues/34564.\n\t\t__unstableMarkNextChangeAsNotPersistent();\n\t\tsetAttributes( { isTopLevelItem } );\n\t}, [ isTopLevelItem ] );\n\n\t/**\n\t * The hook shouldn't be necessary but due to a focus loss happening\n\t * when selecting a suggestion in the link popover, we force close on block unselection.\n\t */\n\tuseEffect( () => {\n\t\tif ( ! isSelected ) {\n\t\t\tsetIsLinkOpen( false );\n\t\t}\n\t}, [ isSelected ] );\n\n\t// If the LinkControl popover is open and the URL has changed, close the LinkControl and focus the label text.\n\tuseEffect( () => {\n\t\tif ( isLinkOpen && url ) {\n\t\t\t// Does this look like a URL and have something TLD-ish?\n\t\t\tif (\n\t\t\t\tisURL( prependHTTP( label ) ) &&\n\t\t\t\t/^.+\\.[a-z]+/.test( label )\n\t\t\t) {\n\t\t\t\t// Focus and select the label text.\n\t\t\t\tselectLabelText();\n\t\t\t} else {\n\t\t\t\t// Focus it (but do not select).\n\t\t\t\tplaceCaretAtHorizontalEdge( ref.current, true );\n\t\t\t}\n\t\t}\n\t}, [ url ] );\n\n\t/**\n\t * Focus the Link label text and select it.\n\t */\n\tfunction selectLabelText() {\n\t\tref.current.focus();\n\t\tconst { ownerDocument } = ref.current;\n\t\tconst { defaultView } = ownerDocument;\n\t\tconst selection = defaultView.getSelection();\n\t\tconst range = ownerDocument.createRange();\n\t\t// Get the range of the current ref contents so we can add this range to the selection.\n\t\trange.selectNodeContents( ref.current );\n\t\tselection.removeAllRanges();\n\t\tselection.addRange( range );\n\t}\n\n\tlet userCanCreate = false;\n\tif ( ! type || type === 'page' ) {\n\t\tuserCanCreate = pagesPermissions.canCreate;\n\t} else if ( type === 'post' ) {\n\t\tuserCanCreate = postsPermissions.canCreate;\n\t}\n\n\tconst {\n\t\ttextColor,\n\t\tcustomTextColor,\n\t\tbackgroundColor,\n\t\tcustomBackgroundColor,\n\t} = getColors( context, ! isTopLevelItem );\n\n\tfunction onKeyDown( event ) {\n\t\tif ( isKeyboardEvent.primary( event, 'k' ) ) {\n\t\t\tsetIsLinkOpen( true );\n\t\t}\n\t}\n\n\tconst blockProps = useBlockProps( {\n\t\tref: useMergeRefs( [ setPopoverAnchor, listItemRef ] ),\n\t\tclassName: classnames( 'wp-block-navigation-item', {\n\t\t\t'is-editing': isSelected || isParentOfSelectedBlock,\n\t\t\t'is-dragging-within': isDraggingWithin,\n\t\t\t'has-link': !! url,\n\t\t\t'has-child': hasChildren,\n\t\t\t'has-text-color': !! textColor || !! customTextColor,\n\t\t\t[ getColorClassName( 'color', textColor ) ]: !! textColor,\n\t\t\t'has-background': !! backgroundColor || customBackgroundColor,\n\t\t\t[ getColorClassName( 'background-color', backgroundColor ) ]:\n\t\t\t\t!! backgroundColor,\n\t\t\t'open-on-click': openSubmenusOnClick,\n\t\t} ),\n\t\tstyle: {\n\t\t\tcolor: ! textColor && customTextColor,\n\t\t\tbackgroundColor: ! backgroundColor && customBackgroundColor,\n\t\t},\n\t\tonKeyDown,\n\t} );\n\n\t// Always use overlay colors for submenus.\n\tconst innerBlocksColors = getColors( context, true );\n\n\tconst allowedBlocks = isAtMaxNesting\n\t\t? ALLOWED_BLOCKS.filter(\n\t\t\t\t( blockName ) => blockName !== 'core/navigation-submenu'\n\t\t )\n\t\t: ALLOWED_BLOCKS;\n\n\tconst innerBlocksProps = useInnerBlocksProps(\n\t\t{\n\t\t\tclassName: classnames( 'wp-block-navigation__submenu-container', {\n\t\t\t\t'is-parent-of-selected-block': isParentOfSelectedBlock,\n\t\t\t\t'has-text-color': !! (\n\t\t\t\t\tinnerBlocksColors.textColor ||\n\t\t\t\t\tinnerBlocksColors.customTextColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.textColor }-color` ]:\n\t\t\t\t\t!! innerBlocksColors.textColor,\n\t\t\t\t'has-background': !! (\n\t\t\t\t\tinnerBlocksColors.backgroundColor ||\n\t\t\t\t\tinnerBlocksColors.customBackgroundColor\n\t\t\t\t),\n\t\t\t\t[ `has-${ innerBlocksColors.backgroundColor }-background-color` ]:\n\t\t\t\t\t!! innerBlocksColors.backgroundColor,\n\t\t\t} ),\n\t\t\tstyle: {\n\t\t\t\tcolor: innerBlocksColors.customTextColor,\n\t\t\t\tbackgroundColor: innerBlocksColors.customBackgroundColor,\n\t\t\t},\n\t\t},\n\t\t{\n\t\t\tallowedBlocks,\n\t\t\t__experimentalDefaultBlock: DEFAULT_BLOCK,\n\t\t\t__experimentalDirectInsert: true,\n\n\t\t\t// Ensure block toolbar is not too far removed from item\n\t\t\t// being edited.\n\t\t\t// see: https://github.com/WordPress/gutenberg/pull/34615.\n\t\t\t__experimentalCaptureToolbars: true,\n\n\t\t\trenderAppender:\n\t\t\t\tisSelected ||\n\t\t\t\t( isImmediateParentOfSelectedBlock &&\n\t\t\t\t\t! selectedBlockHasChildren ) ||\n\t\t\t\t// Show the appender while dragging to allow inserting element between item and the appender.\n\t\t\t\thasChildren\n\t\t\t\t\t? InnerBlocks.ButtonBlockAppender\n\t\t\t\t\t: false,\n\t\t}\n\t);\n\n\tconst ParentElement = openSubmenusOnClick ? 'button' : 'a';\n\n\tfunction transformToLink() {\n\t\tconst newLinkBlock = createBlock( 'core/navigation-link', attributes );\n\t\treplaceBlock( clientId, newLinkBlock );\n\t}\n\n\tuseEffect( () => {\n\t\t// If block becomes empty, transform to Navigation Link.\n\t\tif ( ! hasChildren && prevHasChildren ) {\n\t\t\ttransformToLink();\n\t\t}\n\t}, [ hasChildren, prevHasChildren ] );\n\n\tconst canConvertToLink =\n\t\t! selectedBlockHasChildren || onlyDescendantIsEmptyLink;\n\n\treturn (\n\t\t<Fragment>\n\t\t\t<BlockControls>\n\t\t\t\t<ToolbarGroup>\n\t\t\t\t\t{ ! openSubmenusOnClick && (\n\t\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\t\tname=\"link\"\n\t\t\t\t\t\t\ticon={ linkIcon }\n\t\t\t\t\t\t\ttitle={ __( 'Link' ) }\n\t\t\t\t\t\t\tshortcut={ displayShortcut.primary( 'k' ) }\n\t\t\t\t\t\t\tonClick={ () => setIsLinkOpen( true ) }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\n\t\t\t\t\t<ToolbarButton\n\t\t\t\t\t\tname=\"revert\"\n\t\t\t\t\t\ticon={ removeSubmenu }\n\t\t\t\t\t\ttitle={ __( 'Convert to Link' ) }\n\t\t\t\t\t\tonClick={ transformToLink }\n\t\t\t\t\t\tclassName=\"wp-block-navigation__submenu__revert\"\n\t\t\t\t\t\tisDisabled={ ! canConvertToLink }\n\t\t\t\t\t/>\n\t\t\t\t</ToolbarGroup>\n\t\t\t</BlockControls>\n\t\t\t{ /* Warning, this duplicated in packages/block-library/src/navigation-link/edit.js */ }\n\t\t\t<InspectorControls>\n\t\t\t\t<PanelBody title={ __( 'Link settings' ) }>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ label || '' }\n\t\t\t\t\t\tonChange={ ( labelValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { label: labelValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Label' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ url || '' }\n\t\t\t\t\t\tonChange={ ( urlValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { url: urlValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'URL' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextareaControl\n\t\t\t\t\t\tvalue={ description || '' }\n\t\t\t\t\t\tonChange={ ( descriptionValue ) => {\n\t\t\t\t\t\t\tsetAttributes( {\n\t\t\t\t\t\t\t\tdescription: descriptionValue,\n\t\t\t\t\t\t\t} );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Description' ) }\n\t\t\t\t\t\thelp={ __(\n\t\t\t\t\t\t\t'The description will be displayed in the menu if the current theme supports it.'\n\t\t\t\t\t\t) }\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ title || '' }\n\t\t\t\t\t\tonChange={ ( titleValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { title: titleValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link title' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t\t<TextControl\n\t\t\t\t\t\tvalue={ rel || '' }\n\t\t\t\t\t\tonChange={ ( relValue ) => {\n\t\t\t\t\t\t\tsetAttributes( { rel: relValue } );\n\t\t\t\t\t\t} }\n\t\t\t\t\t\tlabel={ __( 'Link rel' ) }\n\t\t\t\t\t\tautoComplete=\"off\"\n\t\t\t\t\t/>\n\t\t\t\t</PanelBody>\n\t\t\t</InspectorControls>\n\t\t\t<div { ...blockProps }>\n\t\t\t\t{ /* eslint-disable jsx-a11y/anchor-is-valid */ }\n\t\t\t\t<ParentElement className=\"wp-block-navigation-item__content\">\n\t\t\t\t\t{ /* eslint-enable */ }\n\t\t\t\t\t{\n\t\t\t\t\t\t<RichText\n\t\t\t\t\t\t\tref={ ref }\n\t\t\t\t\t\t\tidentifier=\"label\"\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-item__label\"\n\t\t\t\t\t\t\tvalue={ label }\n\t\t\t\t\t\t\tonChange={ ( labelValue ) =>\n\t\t\t\t\t\t\t\tsetAttributes( { label: labelValue } )\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tonMerge={ mergeBlocks }\n\t\t\t\t\t\t\tonReplace={ onReplace }\n\t\t\t\t\t\t\taria-label={ __( 'Navigation link text' ) }\n\t\t\t\t\t\t\tplaceholder={ itemLabelPlaceholder }\n\t\t\t\t\t\t\twithoutInteractiveFormatting\n\t\t\t\t\t\t\tallowedFormats={ [\n\t\t\t\t\t\t\t\t'core/bold',\n\t\t\t\t\t\t\t\t'core/italic',\n\t\t\t\t\t\t\t\t'core/image',\n\t\t\t\t\t\t\t\t'core/strikethrough',\n\t\t\t\t\t\t\t] }\n\t\t\t\t\t\t\tonClick={ () => {\n\t\t\t\t\t\t\t\tif ( ! openSubmenusOnClick && ! url ) {\n\t\t\t\t\t\t\t\t\tsetIsLinkOpen( true );\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t}\n\t\t\t\t\t{ ! openSubmenusOnClick && isLinkOpen && (\n\t\t\t\t\t\t<LinkUI\n\t\t\t\t\t\t\tclassName=\"wp-block-navigation-link__inline-link-input\"\n\t\t\t\t\t\t\tclientId={ clientId }\n\t\t\t\t\t\t\tlink={ attributes }\n\t\t\t\t\t\t\tonClose={ () => setIsLinkOpen( false ) }\n\t\t\t\t\t\t\tanchor={ popoverAnchor }\n\t\t\t\t\t\t\thasCreateSuggestion={ userCanCreate }\n\t\t\t\t\t\t\tonRemove={ () => {\n\t\t\t\t\t\t\t\tsetAttributes( { url: '' } );\n\t\t\t\t\t\t\t\tspeak( __( 'Link removed.' ), 'assertive' );\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t\tonChange={ ( updatedValue ) => {\n\t\t\t\t\t\t\t\tupdateAttributes(\n\t\t\t\t\t\t\t\t\tupdatedValue,\n\t\t\t\t\t\t\t\t\tsetAttributes,\n\t\t\t\t\t\t\t\t\tattributes\n\t\t\t\t\t\t\t\t);\n\t\t\t\t\t\t\t} }\n\t\t\t\t\t\t/>\n\t\t\t\t\t) }\n\t\t\t\t</ParentElement>\n\t\t\t\t{ ( showSubmenuIcon || openSubmenusOnClick ) && (\n\t\t\t\t\t<span className=\"wp-block-navigation__submenu-icon\">\n\t\t\t\t\t\t<ItemSubmenuIcon />\n\t\t\t\t\t</span>\n\t\t\t\t) }\n\t\t\t\t<div { ...innerBlocksProps } />\n\t\t\t</div>\n\t\t</Fragment>\n\t);\n}\n"]}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* WordPress dependencies
|
|
3
|
+
*/
|
|
4
|
+
import { __ } from '@wordpress/i18n';
|
|
5
|
+
export const convertDescription = __('This menu is automatically kept in sync with pages on your site. You can manage the menu yourself by clicking customize below.');
|
|
6
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["@wordpress/block-library/src/page-list/constants.js"],"names":["__","convertDescription"],"mappings":"AAAA;AACA;AACA;AACA,SAASA,EAAT,QAAmB,iBAAnB;AAEA,OAAO,MAAMC,kBAAkB,GAAGD,EAAE,CACnC,gIADmC,CAA7B","sourcesContent":["/**\n * WordPress dependencies\n */\nimport { __ } from '@wordpress/i18n';\n\nexport const convertDescription = __(\n\t'This menu is automatically kept in sync with pages on your site. You can manage the menu yourself by clicking customize below.'\n);\n"]}
|
|
@@ -7,84 +7,24 @@ import { Button, Modal } from '@wordpress/components';
|
|
|
7
7
|
import { __ } from '@wordpress/i18n';
|
|
8
8
|
import { useDispatch } from '@wordpress/data';
|
|
9
9
|
import { useEntityRecords } from '@wordpress/core-data';
|
|
10
|
-
import { createBlock as create } from '@wordpress/blocks';
|
|
11
10
|
import { store as blockEditorStore } from '@wordpress/block-editor';
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
let {
|
|
16
|
-
pages,
|
|
17
|
-
clientId,
|
|
18
|
-
replaceBlock,
|
|
19
|
-
createBlock
|
|
20
|
-
} = _ref;
|
|
21
|
-
return () => {
|
|
22
|
-
if (!pages) {
|
|
23
|
-
return;
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
const linkMap = {};
|
|
27
|
-
const navigationLinks = [];
|
|
28
|
-
pages.forEach(_ref2 => {
|
|
29
|
-
var _linkMap$id$innerBloc, _linkMap$id;
|
|
30
|
-
|
|
31
|
-
let {
|
|
32
|
-
id,
|
|
33
|
-
title,
|
|
34
|
-
link: url,
|
|
35
|
-
type,
|
|
36
|
-
parent
|
|
37
|
-
} = _ref2;
|
|
38
|
-
// See if a placeholder exists. This is created if children appear before parents in list.
|
|
39
|
-
const innerBlocks = (_linkMap$id$innerBloc = (_linkMap$id = linkMap[id]) === null || _linkMap$id === void 0 ? void 0 : _linkMap$id.innerBlocks) !== null && _linkMap$id$innerBloc !== void 0 ? _linkMap$id$innerBloc : [];
|
|
40
|
-
linkMap[id] = createBlock('core/navigation-link', {
|
|
41
|
-
id,
|
|
42
|
-
label: title.rendered,
|
|
43
|
-
url,
|
|
44
|
-
type,
|
|
45
|
-
kind: 'post-type'
|
|
46
|
-
}, innerBlocks);
|
|
47
|
-
|
|
48
|
-
if (!parent) {
|
|
49
|
-
navigationLinks.push(linkMap[id]);
|
|
50
|
-
} else {
|
|
51
|
-
if (!linkMap[parent]) {
|
|
52
|
-
// Use a placeholder if the child appears before parent in list.
|
|
53
|
-
linkMap[parent] = {
|
|
54
|
-
innerBlocks: []
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
const parentLinkInnerBlocks = linkMap[parent].innerBlocks;
|
|
59
|
-
parentLinkInnerBlocks.push(linkMap[id]);
|
|
60
|
-
}
|
|
61
|
-
}); // Transform all links with innerBlocks into Submenus. This can't be done
|
|
62
|
-
// sooner because page objects have no information on their children.
|
|
63
|
-
|
|
64
|
-
const transformSubmenus = listOfLinks => {
|
|
65
|
-
listOfLinks.forEach((block, index, listOfLinksArray) => {
|
|
66
|
-
const {
|
|
67
|
-
attributes,
|
|
68
|
-
innerBlocks
|
|
69
|
-
} = block;
|
|
11
|
+
/**
|
|
12
|
+
* Internal dependencies
|
|
13
|
+
*/
|
|
70
14
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
};
|
|
15
|
+
import { convertToNavigationLinks } from './convert-to-navigation-links';
|
|
16
|
+
/**
|
|
17
|
+
* Internal dependencies
|
|
18
|
+
*/
|
|
78
19
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
export default function ConvertToLinksModal(_ref3) {
|
|
20
|
+
import { convertDescription } from './constants';
|
|
21
|
+
const PAGE_FIELDS = ['id', 'title', 'link', 'type', 'parent'];
|
|
22
|
+
const MAX_PAGE_COUNT = 100;
|
|
23
|
+
export default function ConvertToLinksModal(_ref) {
|
|
84
24
|
let {
|
|
85
25
|
onClose,
|
|
86
26
|
clientId
|
|
87
|
-
} =
|
|
27
|
+
} = _ref;
|
|
88
28
|
const {
|
|
89
29
|
records: pages,
|
|
90
30
|
hasResolved: pagesFinished
|
|
@@ -103,14 +43,14 @@ export default function ConvertToLinksModal(_ref3) {
|
|
|
103
43
|
return createElement(Modal, {
|
|
104
44
|
closeLabel: __('Close'),
|
|
105
45
|
onRequestClose: onClose,
|
|
106
|
-
title: __('
|
|
46
|
+
title: __('Customize this menu'),
|
|
107
47
|
className: 'wp-block-page-list-modal',
|
|
108
48
|
aria: {
|
|
109
49
|
describedby: 'wp-block-page-list-modal__description'
|
|
110
50
|
}
|
|
111
51
|
}, createElement("p", {
|
|
112
52
|
id: 'wp-block-page-list-modal__description'
|
|
113
|
-
},
|
|
53
|
+
}, convertDescription), createElement("div", {
|
|
114
54
|
className: "wp-block-page-list-modal-buttons"
|
|
115
55
|
}, createElement(Button, {
|
|
116
56
|
variant: "tertiary",
|
|
@@ -118,12 +58,11 @@ export default function ConvertToLinksModal(_ref3) {
|
|
|
118
58
|
}, __('Cancel')), createElement(Button, {
|
|
119
59
|
variant: "primary",
|
|
120
60
|
disabled: !pagesFinished,
|
|
121
|
-
onClick:
|
|
122
|
-
pages
|
|
123
|
-
|
|
124
|
-
clientId,
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
}, __('Convert'))));
|
|
61
|
+
onClick: () => {
|
|
62
|
+
const navigationLinks = convertToNavigationLinks(pages); // Replace the Page List block with the Navigation Links.
|
|
63
|
+
|
|
64
|
+
replaceBlock(clientId, navigationLinks);
|
|
65
|
+
}
|
|
66
|
+
}, __('Customize'))));
|
|
128
67
|
}
|
|
129
68
|
//# sourceMappingURL=convert-to-links-modal.js.map
|